@whoz-oss/coday-client 0.171.2 → 0.172.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{m as ti}from"./chunk-4OIHXCET.js";import{a as S,b as K,e as Zt,f as Ye,h as X,i as ve,j as le}from"./chunk-QVW2GZXC.js";import{a as ri}from"./chunk-CPPSTTTC.js";import{b as ii,c as ni,x as si}from"./chunk-ZZTT5MET.js";import"./chunk-SLBKHVIO.js";import{c as Yt,f as Xt,g as xt}from"./chunk-4GVABYH4.js";import{a as ei}from"./chunk-CBYR4M6L.js";import{c as Jt}from"./chunk-6CNI4FAD.js";import"./chunk-Z7E7NSDY.js";import{b as Te}from"./chunk-5URVSSXV.js";import"./chunk-EF2BOSEH.js";import{B as Ot,Ca as We,G as It,L as Ft,La as Bt,Oa as qt,Oc as Gt,Pc as Wt,Uc as Ht,V as Lt,W as v,Wa as Qt,Z as Se,a as ye,ba as Ee,c as Ct,ca as z,d as _e,fb as He,la as zt,pa as Kt,q as Ge,r as Dt,rc as Vt,sa as jt,sc as $t,t as Rt,u as kt,ub as Ut}from"./chunk-B4RKRLIY.js";function oi(s){return new v(3e3,!1)}function cn(){return new v(3100,!1)}function un(){return new v(3101,!1)}function hn(s){return new v(3001,!1)}function dn(s){return new v(3003,!1)}function mn(s){return new v(3004,!1)}function li(s,e){return new v(3005,!1)}function ci(){return new v(3006,!1)}function ui(){return new v(3007,!1)}function hi(s,e){return new v(3008,!1)}function di(s){return new v(3002,!1)}function mi(s,e,t,i,n){return new v(3010,!1)}function fi(){return new v(3011,!1)}function pi(){return new v(3012,!1)}function gi(){return new v(3200,!1)}function yi(){return new v(3202,!1)}function _i(){return new v(3013,!1)}function Si(s){return new v(3014,!1)}function Ei(s){return new v(3015,!1)}function vi(s){return new v(3016,!1)}function Ti(s,e){return new v(3404,!1)}function fn(s){return new v(3502,!1)}function Ai(s){return new v(3503,!1)}function wi(){return new v(3300,!1)}function bi(s){return new v(3504,!1)}function Pi(s){return new v(3301,!1)}function Ni(s,e){return new v(3302,!1)}function Mi(s){return new v(3303,!1)}function Ci(s,e){return new v(3400,!1)}function Di(s){return new v(3401,!1)}function Ri(s){return new v(3402,!1)}function ki(s,e){return new v(3505,!1)}function V(s){switch(s.length){case 0:return new X;case 1:return s[0];default:return new ve(s)}}function Je(s,e,t=new Map,i=new Map){let n=[],r=[],o=-1,a=null;if(e.forEach(l=>{let c=l.get("offset"),h=c==o,u=h&&a||new Map;l.forEach((_,y)=>{let m=y,g=_;if(y!=="offset")switch(m=s.normalizePropertyName(m,n),g){case le:g=t.get(y);break;case K:g=i.get(y);break;default:g=s.normalizeStyleValue(y,m,g,n);break}u.set(m,g)}),h||r.push(u),a=u,o=c}),n.length)throw fn(n);return r}function Ae(s,e,t,i){switch(e){case"start":s.onStart(()=>i(t&&Xe(t,"start",s)));break;case"done":s.onDone(()=>i(t&&Xe(t,"done",s)));break;case"destroy":s.onDestroy(()=>i(t&&Xe(t,"destroy",s)));break}}function Xe(s,e,t){let i=t.totalTime,n=!!t.disabled,r=we(s.element,s.triggerName,s.fromState,s.toState,e||s.phaseName,i??s.totalTime,n),o=s._data;return o!=null&&(r._data=o),r}function we(s,e,t,i,n="",r=0,o){return{element:s,triggerName:e,fromState:t,toState:i,phaseName:n,totalTime:r,disabled:!!o}}function k(s,e,t){let i=s.get(e);return i||s.set(e,i=t),i}function et(s){let e=s.indexOf(":"),t=s.substring(1,e),i=s.slice(e+1);return[t,i]}var pn=typeof document>"u"?null:document.documentElement;function be(s){let e=s.parentNode||s.host||null;return e===pn?null:e}function gn(s){return s.substring(1,6)=="ebkit"}var x=null,ai=!1;function Oi(s){x||(x=yn()||{},ai=x.style?"WebkitAppearance"in x.style:!1);let e=!0;return x.style&&!gn(s)&&(e=s in x.style,!e&&ai&&(e="Webkit"+s.charAt(0).toUpperCase()+s.slice(1)in x.style)),e}function yn(){return typeof document<"u"?document.body:null}function tt(s,e){for(;e;){if(e===s)return!0;e=be(e)}return!1}function it(s,e,t){if(t)return Array.from(s.querySelectorAll(e));let i=s.querySelector(e);return i?[i]:[]}var _n=1e3,nt="{{",Sn="}}",st="ng-enter",Pe="ng-leave",ce="ng-trigger",ue=".ng-trigger",rt="ng-animating",Ne=".ng-animating";function U(s){if(typeof s=="number")return s;let e=s.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:xe(parseFloat(e[1]),e[2])}function xe(s,e){return e==="s"?s*_n:s}function he(s,e,t){return s.hasOwnProperty("duration")?s:vn(s,e,t)}var En=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;function vn(s,e,t){let i,n=0,r="";if(typeof s=="string"){let o=s.match(En);if(o===null)return e.push(oi(s)),{duration:0,delay:0,easing:""};i=xe(parseFloat(o[1]),o[2]);let a=o[3];a!=null&&(n=xe(parseFloat(a),o[4]));let l=o[5];l&&(r=l)}else i=s;if(!t){let o=!1,a=e.length;i<0&&(e.push(cn()),o=!0),n<0&&(e.push(un()),o=!0),o&&e.splice(a,0,oi(s))}return{duration:i,delay:n,easing:r}}function Ii(s){return s.length?s[0]instanceof Map?s:s.map(e=>new Map(Object.entries(e))):[]}function j(s,e,t){e.forEach((i,n)=>{let r=Me(n);t&&!t.has(n)&&t.set(n,s.style[r]),s.style[r]=i})}function G(s,e){e.forEach((t,i)=>{let n=Me(i);s.style[n]=""})}function se(s){return Array.isArray(s)?s.length==1?s[0]:Zt(s):s}function Fi(s,e,t){let i=e.params||{},n=ot(s);n.length&&n.forEach(r=>{i.hasOwnProperty(r)||t.push(hn(r))})}var Ze=new RegExp(`${nt}\\s*(.+?)\\s*${Sn}`,"g");function ot(s){let e=[];if(typeof s=="string"){let t;for(;t=Ze.exec(s);)e.push(t[1]);Ze.lastIndex=0}return e}function re(s,e,t){let i=`${s}`,n=i.replace(Ze,(r,o)=>{let a=e[o];return a==null&&(t.push(dn(o)),a=""),a.toString()});return n==i?s:n}var Tn=/-+([a-z0-9])/g;function Me(s){return s.replace(Tn,(...e)=>e[1].toUpperCase())}function Li(s,e){return s===0||e===0}function zi(s,e,t){if(t.size&&e.length){let i=e[0],n=[];if(t.forEach((r,o)=>{i.has(o)||n.push(o),i.set(o,r)}),n.length)for(let r=1;r<e.length;r++){let o=e[r];n.forEach(a=>o.set(a,Ce(s,a)))}}return e}function O(s,e,t){switch(e.type){case S.Trigger:return s.visitTrigger(e,t);case S.State:return s.visitState(e,t);case S.Transition:return s.visitTransition(e,t);case S.Sequence:return s.visitSequence(e,t);case S.Group:return s.visitGroup(e,t);case S.Animate:return s.visitAnimate(e,t);case S.Keyframes:return s.visitKeyframes(e,t);case S.Style:return s.visitStyle(e,t);case S.Reference:return s.visitReference(e,t);case S.AnimateChild:return s.visitAnimateChild(e,t);case S.AnimateRef:return s.visitAnimateRef(e,t);case S.Query:return s.visitQuery(e,t);case S.Stagger:return s.visitStagger(e,t);default:throw mn(e.type)}}function Ce(s,e){return window.getComputedStyle(s)[e]}var At=(()=>{class s{validateStyleProperty(t){return Oi(t)}containsElement(t,i){return tt(t,i)}getParentElement(t){return be(t)}query(t,i,n){return it(t,i,n)}computeStyle(t,i,n){return n||""}animate(t,i,n,r,o,a=[],l){return new X(n,r)}static \u0275fac=function(i){return new(i||s)};static \u0275prov=Se({token:s,factory:s.\u0275fac})}return s})(),J=class{static NOOP=new At},ee=class{};var An=new Set(["width","height","minWidth","minHeight","maxWidth","maxHeight","left","top","bottom","right","fontSize","outlineWidth","outlineOffset","paddingTop","paddingLeft","paddingBottom","paddingRight","marginTop","marginLeft","marginBottom","marginRight","borderRadius","borderWidth","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","textIndent","perspective"]),Ie=class extends ee{normalizePropertyName(e,t){return Me(e)}normalizeStyleValue(e,t,i,n){let r="",o=i.toString().trim();if(An.has(t)&&i!==0&&i!=="0")if(typeof i=="number")r="px";else{let a=i.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&a[1].length==0&&n.push(li(e,i))}return o+r}};var Fe="*";function wn(s,e){let t=[];return typeof s=="string"?s.split(/\s*,\s*/).forEach(i=>bn(i,t,e)):t.push(s),t}function bn(s,e,t){if(s[0]==":"){let l=Pn(s,t);if(typeof l=="function"){e.push(l);return}s=l}let i=s.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(i==null||i.length<4)return t.push(Ei(s)),e;let n=i[1],r=i[2],o=i[3];e.push(Ki(n,o));let a=n==Fe&&o==Fe;r[0]=="<"&&!a&&e.push(Ki(o,n))}function Pn(s,e){switch(s){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,i)=>parseFloat(i)>parseFloat(t);case":decrement":return(t,i)=>parseFloat(i)<parseFloat(t);default:return e.push(vi(s)),"* => *"}}var De=new Set(["true","1"]),Re=new Set(["false","0"]);function Ki(s,e){let t=De.has(s)||Re.has(s),i=De.has(e)||Re.has(e);return(n,r)=>{let o=s==Fe||s==n,a=e==Fe||e==r;return!o&&t&&typeof n=="boolean"&&(o=n?De.has(s):Re.has(s)),!a&&i&&typeof r=="boolean"&&(a=r?De.has(e):Re.has(e)),o&&a}}var Yi=":self",Nn=new RegExp(`s*${Yi}s*,?`,"g");function Xi(s,e,t,i){return new dt(s).build(e,t,i)}var ji="",dt=class{_driver;constructor(e){this._driver=e}build(e,t,i){let n=new mt(t);return this._resetContextStyleTimingState(n),O(this,se(e),n)}_resetContextStyleTimingState(e){e.currentQuerySelector=ji,e.collectedStyles=new Map,e.collectedStyles.set(ji,new Map),e.currentTime=0}visitTrigger(e,t){let i=t.queryCount=0,n=t.depCount=0,r=[],o=[];return e.name.charAt(0)=="@"&&t.errors.push(ci()),e.definitions.forEach(a=>{if(this._resetContextStyleTimingState(t),a.type==S.State){let l=a,c=l.name;c.toString().split(/\s*,\s*/).forEach(h=>{l.name=h,r.push(this.visitState(l,t))}),l.name=c}else if(a.type==S.Transition){let l=this.visitTransition(a,t);i+=l.queryCount,n+=l.depCount,o.push(l)}else t.errors.push(ui())}),{type:S.Trigger,name:e.name,states:r,transitions:o,queryCount:i,depCount:n,options:null}}visitState(e,t){let i=this.visitStyle(e.styles,t),n=e.options&&e.options.params||null;if(i.containsDynamicStyles){let r=new Set,o=n||{};i.styles.forEach(a=>{a instanceof Map&&a.forEach(l=>{ot(l).forEach(c=>{o.hasOwnProperty(c)||r.add(c)})})}),r.size&&t.errors.push(hi(e.name,[...r.values()]))}return{type:S.State,name:e.name,style:i,options:n?{params:n}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;let i=O(this,se(e.animation),t),n=wn(e.expr,t.errors);return{type:S.Transition,matchers:n,animation:i,queryCount:t.queryCount,depCount:t.depCount,options:Z(e.options)}}visitSequence(e,t){return{type:S.Sequence,steps:e.steps.map(i=>O(this,i,t)),options:Z(e.options)}}visitGroup(e,t){let i=t.currentTime,n=0,r=e.steps.map(o=>{t.currentTime=i;let a=O(this,o,t);return n=Math.max(n,t.currentTime),a});return t.currentTime=n,{type:S.Group,steps:r,options:Z(e.options)}}visitAnimate(e,t){let i=Rn(e.timings,t.errors);t.currentAnimateTimings=i;let n,r=e.styles?e.styles:Ye({});if(r.type==S.Keyframes)n=this.visitKeyframes(r,t);else{let o=e.styles,a=!1;if(!o){a=!0;let c={};i.easing&&(c.easing=i.easing),o=Ye(c)}t.currentTime+=i.duration+i.delay;let l=this.visitStyle(o,t);l.isEmptyStep=a,n=l}return t.currentAnimateTimings=null,{type:S.Animate,timings:i,style:n,options:null}}visitStyle(e,t){let i=this._makeStyleAst(e,t);return this._validateStyleAst(i,t),i}_makeStyleAst(e,t){let i=[],n=Array.isArray(e.styles)?e.styles:[e.styles];for(let a of n)typeof a=="string"?a===K?i.push(a):t.errors.push(di(a)):i.push(new Map(Object.entries(a)));let r=!1,o=null;return i.forEach(a=>{if(a instanceof Map&&(a.has("easing")&&(o=a.get("easing"),a.delete("easing")),!r)){for(let l of a.values())if(l.toString().indexOf(nt)>=0){r=!0;break}}}),{type:S.Style,styles:i,easing:o,offset:e.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(e,t){let i=t.currentAnimateTimings,n=t.currentTime,r=t.currentTime;i&&r>0&&(r-=i.duration+i.delay),e.styles.forEach(o=>{typeof o!="string"&&o.forEach((a,l)=>{let c=t.collectedStyles.get(t.currentQuerySelector),h=c.get(l),u=!0;h&&(r!=n&&r>=h.startTime&&n<=h.endTime&&(t.errors.push(mi(l,h.startTime,h.endTime,r,n)),u=!1),r=h.startTime),u&&c.set(l,{startTime:r,endTime:n}),t.options&&Fi(a,t.options,t.errors)})})}visitKeyframes(e,t){let i={type:S.Keyframes,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push(fi()),i;let n=1,r=0,o=[],a=!1,l=!1,c=0,h=e.steps.map(w=>{let b=this._makeStyleAst(w,t),C=b.offset!=null?b.offset:Dn(b.styles),N=0;return C!=null&&(r++,N=b.offset=C),l=l||N<0||N>1,a=a||N<c,c=N,o.push(N),b});l&&t.errors.push(pi()),a&&t.errors.push(gi());let u=e.steps.length,_=0;r>0&&r<u?t.errors.push(yi()):r==0&&(_=n/(u-1));let y=u-1,m=t.currentTime,g=t.currentAnimateTimings,T=g.duration;return h.forEach((w,b)=>{let C=_>0?b==y?1:_*b:o[b],N=C*T;t.currentTime=m+g.delay+N,g.duration=N,this._validateStyleAst(w,t),w.offset=C,i.styles.push(w)}),i}visitReference(e,t){return{type:S.Reference,animation:O(this,se(e.animation),t),options:Z(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:S.AnimateChild,options:Z(e.options)}}visitAnimateRef(e,t){return{type:S.AnimateRef,animation:this.visitReference(e.animation,t),options:Z(e.options)}}visitQuery(e,t){let i=t.currentQuerySelector,n=e.options||{};t.queryCount++,t.currentQuery=e;let[r,o]=Mn(e.selector);t.currentQuerySelector=i.length?i+" "+r:r,k(t.collectedStyles,t.currentQuerySelector,new Map);let a=O(this,se(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=i,{type:S.Query,selector:r,limit:n.limit||0,optional:!!n.optional,includeSelf:o,animation:a,originalSelector:e.selector,options:Z(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push(_i());let i=e.timings==="full"?{duration:0,delay:0,easing:"full"}:he(e.timings,t.errors,!0);return{type:S.Stagger,animation:O(this,se(e.animation),t),timings:i,options:null}}};function Mn(s){let e=!!s.split(/\s*,\s*/).find(t=>t==Yi);return e&&(s=s.replace(Nn,"")),s=s.replace(/@\*/g,ue).replace(/@\w+/g,t=>ue+"-"+t.slice(1)).replace(/:animating/g,Ne),[s,e]}function Cn(s){return s?ye({},s):null}var mt=class{errors;queryCount=0;depCount=0;currentTransition=null;currentQuery=null;currentQuerySelector=null;currentAnimateTimings=null;currentTime=0;collectedStyles=new Map;options=null;unsupportedCSSPropertiesFound=new Set;constructor(e){this.errors=e}};function Dn(s){if(typeof s=="string")return null;let e=null;if(Array.isArray(s))s.forEach(t=>{if(t instanceof Map&&t.has("offset")){let i=t;e=parseFloat(i.get("offset")),i.delete("offset")}});else if(s instanceof Map&&s.has("offset")){let t=s;e=parseFloat(t.get("offset")),t.delete("offset")}return e}function Rn(s,e){if(s.hasOwnProperty("duration"))return s;if(typeof s=="number"){let r=he(s,e).duration;return at(r,0,"")}let t=s;if(t.split(/\s+/).some(r=>r.charAt(0)=="{"&&r.charAt(1)=="{")){let r=at(0,0,"");return r.dynamic=!0,r.strValue=t,r}let n=he(t,e);return at(n.duration,n.delay,n.easing)}function Z(s){return s?(s=ye({},s),s.params&&(s.params=Cn(s.params))):s={},s}function at(s,e,t){return{duration:s,delay:e,easing:t}}function wt(s,e,t,i,n,r,o=null,a=!1){return{type:1,element:s,keyframes:e,preStyleProps:t,postStyleProps:i,duration:n,delay:r,totalTime:n+r,easing:o,subTimeline:a}}var me=class{_map=new Map;get(e){return this._map.get(e)||[]}append(e,t){let i=this._map.get(e);i||this._map.set(e,i=[]),i.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}},kn=1,On=":enter",In=new RegExp(On,"g"),Fn=":leave",Ln=new RegExp(Fn,"g");function xi(s,e,t,i,n,r=new Map,o=new Map,a,l,c=[]){return new ft().buildKeyframes(s,e,t,i,n,r,o,a,l,c)}var ft=class{buildKeyframes(e,t,i,n,r,o,a,l,c,h=[]){c=c||new me;let u=new pt(e,t,c,n,r,h,[]);u.options=l;let _=l.delay?U(l.delay):0;u.currentTimeline.delayNextStep(_),u.currentTimeline.setStyles([o],null,u.errors,l),O(this,i,u);let y=u.timelines.filter(m=>m.containsAnimation());if(y.length&&a.size){let m;for(let g=y.length-1;g>=0;g--){let T=y[g];if(T.element===t){m=T;break}}m&&!m.allowOnlyTimelineStyles()&&m.setStyles([a],null,u.errors,l)}return y.length?y.map(m=>m.buildKeyframes()):[wt(t,[],[],[],0,_,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){let i=t.subInstructions.get(t.element);if(i){let n=t.createSubContext(e.options),r=t.currentTimeline.currentTime,o=this._visitSubInstructions(i,n,n.options);r!=o&&t.transformIntoNewTimeline(o)}t.previousNode=e}visitAnimateRef(e,t){let i=t.createSubContext(e.options);i.transformIntoNewTimeline(),this._applyAnimationRefDelays([e.options,e.animation.options],t,i),this.visitReference(e.animation,i),t.transformIntoNewTimeline(i.currentTimeline.currentTime),t.previousNode=e}_applyAnimationRefDelays(e,t,i){for(let n of e){let r=n?.delay;if(r){let o=typeof r=="number"?r:U(re(r,n?.params??{},t.errors));i.delayNextStep(o)}}}_visitSubInstructions(e,t,i){let r=t.currentTimeline.currentTime,o=i.duration!=null?U(i.duration):null,a=i.delay!=null?U(i.delay):null;return o!==0&&e.forEach(l=>{let c=t.appendInstructionToTimeline(l,o,a);r=Math.max(r,c.duration+c.delay)}),r}visitReference(e,t){t.updateOptions(e.options,!0),O(this,e.animation,t),t.previousNode=e}visitSequence(e,t){let i=t.subContextCount,n=t,r=e.options;if(r&&(r.params||r.delay)&&(n=t.createSubContext(r),n.transformIntoNewTimeline(),r.delay!=null)){n.previousNode.type==S.Style&&(n.currentTimeline.snapshotCurrentStyles(),n.previousNode=Le);let o=U(r.delay);n.delayNextStep(o)}e.steps.length&&(e.steps.forEach(o=>O(this,o,n)),n.currentTimeline.applyStylesToKeyframe(),n.subContextCount>i&&n.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){let i=[],n=t.currentTimeline.currentTime,r=e.options&&e.options.delay?U(e.options.delay):0;e.steps.forEach(o=>{let a=t.createSubContext(e.options);r&&a.delayNextStep(r),O(this,o,a),n=Math.max(n,a.currentTimeline.currentTime),i.push(a.currentTimeline)}),i.forEach(o=>t.currentTimeline.mergeTimelineCollectedStyles(o)),t.transformIntoNewTimeline(n),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){let i=e.strValue,n=t.params?re(i,t.params,t.errors):i;return he(n,t.errors)}else return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){let i=t.currentAnimateTimings=this._visitTiming(e.timings,t),n=t.currentTimeline;i.delay&&(t.incrementTime(i.delay),n.snapshotCurrentStyles());let r=e.style;r.type==S.Keyframes?this.visitKeyframes(r,t):(t.incrementTime(i.duration),this.visitStyle(r,t),n.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){let i=t.currentTimeline,n=t.currentAnimateTimings;!n&&i.hasCurrentStyleProperties()&&i.forwardFrame();let r=n&&n.easing||e.easing;e.isEmptyStep?i.applyEmptyStep(r):i.setStyles(e.styles,r,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){let i=t.currentAnimateTimings,n=t.currentTimeline.duration,r=i.duration,a=t.createSubContext().currentTimeline;a.easing=i.easing,e.styles.forEach(l=>{let c=l.offset||0;a.forwardTime(c*r),a.setStyles(l.styles,l.easing,t.errors,t.options),a.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(a),t.transformIntoNewTimeline(n+r),t.previousNode=e}visitQuery(e,t){let i=t.currentTimeline.currentTime,n=e.options||{},r=n.delay?U(n.delay):0;r&&(t.previousNode.type===S.Style||i==0&&t.currentTimeline.hasCurrentStyleProperties())&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=Le);let o=i,a=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!n.optional,t.errors);t.currentQueryTotal=a.length;let l=null;a.forEach((c,h)=>{t.currentQueryIndex=h;let u=t.createSubContext(e.options,c);r&&u.delayNextStep(r),c===t.element&&(l=u.currentTimeline),O(this,e.animation,u),u.currentTimeline.applyStylesToKeyframe();let _=u.currentTimeline.currentTime;o=Math.max(o,_)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(o),l&&(t.currentTimeline.mergeTimelineCollectedStyles(l),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){let i=t.parentContext,n=t.currentTimeline,r=e.timings,o=Math.abs(r.duration),a=o*(t.currentQueryTotal-1),l=o*t.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":l=a-l;break;case"full":l=i.currentStaggerTime;break}let h=t.currentTimeline;l&&h.delayNextStep(l);let u=h.currentTime;O(this,e.animation,t),t.previousNode=e,i.currentStaggerTime=n.currentTime-u+(n.startTime-i.currentTimeline.startTime)}},Le={},pt=class s{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=Le;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(e,t,i,n,r,o,a,l){this._driver=e,this.element=t,this.subInstructions=i,this._enterClassName=n,this._leaveClassName=r,this.errors=o,this.timelines=a,this.currentTimeline=l||new ze(this._driver,t,0),a.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;let i=e,n=this.options;i.duration!=null&&(n.duration=U(i.duration)),i.delay!=null&&(n.delay=U(i.delay));let r=i.params;if(r){let o=n.params;o||(o=this.options.params={}),Object.keys(r).forEach(a=>{(!t||!o.hasOwnProperty(a))&&(o[a]=re(r[a],o,this.errors))})}}_copyOptions(){let e={};if(this.options){let t=this.options.params;if(t){let i=e.params={};Object.keys(t).forEach(n=>{i[n]=t[n]})}}return e}createSubContext(e=null,t,i){let n=t||this.element,r=new s(this._driver,n,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(n,i||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(e),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(e){return this.previousNode=Le,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,i){let n={duration:t??e.duration,delay:this.currentTimeline.currentTime+(i??0)+e.delay,easing:""},r=new gt(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,n,e.stretchStartingKeyframe);return this.timelines.push(r),n}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,i,n,r,o){let a=[];if(n&&a.push(this.element),e.length>0){e=e.replace(In,"."+this._enterClassName),e=e.replace(Ln,"."+this._leaveClassName);let l=i!=1,c=this._driver.query(this.element,e,l);i!==0&&(c=i<0?c.slice(c.length+i,c.length):c.slice(0,i)),a.push(...c)}return!r&&a.length==0&&o.push(Si(t)),a}},ze=class s{_driver;element;startTime;_elementTimelineStylesLookup;duration=0;easing=null;_previousKeyframe=new Map;_currentKeyframe=new Map;_keyframes=new Map;_styleSummary=new Map;_localTimelineStyles=new Map;_globalTimelineStyles;_pendingStyles=new Map;_backFill=new Map;_currentEmptyStepKeyframe=null;constructor(e,t,i,n){this._driver=e,this.element=t,this.startTime=i,this._elementTimelineStylesLookup=n,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.hasCurrentStyleProperties();default:return!0}}hasCurrentStyleProperties(){return this._currentKeyframe.size>0}get currentTime(){return this.startTime+this.duration}delayNextStep(e){let t=this._keyframes.size===1&&this._pendingStyles.size;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new s(this._driver,e,t||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=new Map,this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=kn,this._loadKeyframe()}forwardTime(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles.set(e,t),this._globalTimelineStyles.set(e,t),this._styleSummary.set(e,{time:this.currentTime,value:t})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&this._previousKeyframe.set("easing",e);for(let[t,i]of this._globalTimelineStyles)this._backFill.set(t,i||K),this._currentKeyframe.set(t,K);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,i,n){t&&this._previousKeyframe.set("easing",t);let r=n&&n.params||{},o=zn(e,this._globalTimelineStyles);for(let[a,l]of o){let c=re(l,r,i);this._pendingStyles.set(a,c),this._localTimelineStyles.has(a)||this._backFill.set(a,this._globalTimelineStyles.get(a)??K),this._updateStyle(a,c)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((e,t)=>{this._currentKeyframe.set(t,e)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((e,t)=>{this._currentKeyframe.has(t)||this._currentKeyframe.set(t,e)}))}snapshotCurrentStyles(){for(let[e,t]of this._localTimelineStyles)this._pendingStyles.set(e,t),this._updateStyle(e,t)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){e._styleSummary.forEach((t,i)=>{let n=this._styleSummary.get(i);(!n||t.time>n.time)&&this._updateStyle(i,t.value)})}buildKeyframes(){this.applyStylesToKeyframe();let e=new Set,t=new Set,i=this._keyframes.size===1&&this.duration===0,n=[];this._keyframes.forEach((a,l)=>{let c=new Map([...this._backFill,...a]);c.forEach((h,u)=>{h===le?e.add(u):h===K&&t.add(u)}),i||c.set("offset",l/this.duration),n.push(c)});let r=[...e.values()],o=[...t.values()];if(i){let a=n[0],l=new Map(a);a.set("offset",0),l.set("offset",1),n=[a,l]}return wt(this.element,n,r,o,this.duration,this.startTime,this.easing,!1)}},gt=class extends ze{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(e,t,i,n,r,o,a=!1){super(e,t,o.delay),this.keyframes=i,this.preStyleProps=n,this.postStyleProps=r,this._stretchStartingKeyframe=a,this.timings={duration:o.duration,delay:o.delay,easing:o.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:i,easing:n}=this.timings;if(this._stretchStartingKeyframe&&t){let r=[],o=i+t,a=t/o,l=new Map(e[0]);l.set("offset",0),r.push(l);let c=new Map(e[0]);c.set("offset",Bi(a)),r.push(c);let h=e.length-1;for(let u=1;u<=h;u++){let _=new Map(e[u]),y=_.get("offset"),m=t+y*i;_.set("offset",Bi(m/o)),r.push(_)}i=o,t=0,n="",e=r}return wt(this.element,e,this.preStyleProps,this.postStyleProps,i,t,n,!0)}};function Bi(s,e=3){let t=Math.pow(10,e-1);return Math.round(s*t)/t}function zn(s,e){let t=new Map,i;return s.forEach(n=>{if(n==="*"){i??=e.keys();for(let r of i)t.set(r,K)}else for(let[r,o]of n)t.set(r,o)}),t}function qi(s,e,t,i,n,r,o,a,l,c,h,u,_){return{type:0,element:s,triggerName:e,isRemovalTransition:n,fromState:t,fromStyles:r,toState:i,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:h,totalTime:u,errors:_}}var lt={},Ke=class{_triggerName;ast;_stateStyles;constructor(e,t,i){this._triggerName=e,this.ast=t,this._stateStyles=i}match(e,t,i,n){return Kn(this.ast.matchers,e,t,i,n)}buildStyles(e,t,i){let n=this._stateStyles.get("*");return e!==void 0&&(n=this._stateStyles.get(e?.toString())||n),n?n.buildStyles(t,i):new Map}build(e,t,i,n,r,o,a,l,c,h){let u=[],_=this.ast.options&&this.ast.options.params||lt,y=a&&a.params||lt,m=this.buildStyles(i,y,u),g=l&&l.params||lt,T=this.buildStyles(n,g,u),w=new Set,b=new Map,C=new Map,N=n==="void",ie={params:Zi(g,_),delay:this.ast.options?.delay},q=h?[]:xi(e,t,this.ast.animation,r,o,m,T,ie,c,u),D=0;return q.forEach(R=>{D=Math.max(R.duration+R.delay,D)}),u.length?qi(t,this._triggerName,i,n,N,m,T,[],[],b,C,D,u):(q.forEach(R=>{let W=R.element,ne=k(b,W,new Set);R.preStyleProps.forEach(H=>ne.add(H));let bt=k(C,W,new Set);R.postStyleProps.forEach(H=>bt.add(H)),W!==t&&w.add(W)}),qi(t,this._triggerName,i,n,N,m,T,q,[...w.values()],b,C,D))}};function Kn(s,e,t,i,n){return s.some(r=>r(e,t,i,n))}function Zi(s,e){let t=ye({},e);return Object.entries(s).forEach(([i,n])=>{n!=null&&(t[i]=n)}),t}var yt=class{styles;defaultParams;normalizer;constructor(e,t,i){this.styles=e,this.defaultParams=t,this.normalizer=i}buildStyles(e,t){let i=new Map,n=Zi(e,this.defaultParams);return this.styles.styles.forEach(r=>{typeof r!="string"&&r.forEach((o,a)=>{o&&(o=re(o,n,t));let l=this.normalizer.normalizePropertyName(a,t);o=this.normalizer.normalizeStyleValue(a,l,o,t),i.set(a,o)})}),i}};function jn(s,e,t){return new _t(s,e,t)}var _t=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(e,t,i){this.name=e,this.ast=t,this._normalizer=i,t.states.forEach(n=>{let r=n.options&&n.options.params||{};this.states.set(n.name,new yt(n.style,r,i))}),Qi(this.states,"true","1"),Qi(this.states,"false","0"),t.transitions.forEach(n=>{this.transitionFactories.push(new Ke(e,n,this.states))}),this.fallbackTransition=Bn(e,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,i,n){return this.transitionFactories.find(o=>o.match(e,t,i,n))||null}matchStyles(e,t,i){return this.fallbackTransition.buildStyles(e,t,i)}};function Bn(s,e,t){let i=[(o,a)=>!0],n={type:S.Sequence,steps:[],options:null},r={type:S.Transition,animation:n,matchers:i,options:null,queryCount:0,depCount:0};return new Ke(s,r,e)}function Qi(s,e,t){s.has(e)?s.has(t)||s.set(t,s.get(e)):s.has(t)&&s.set(e,s.get(t))}var qn=new me,St=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(e,t,i){this.bodyNode=e,this._driver=t,this._normalizer=i}register(e,t){let i=[],n=[],r=Xi(this._driver,t,i,n);if(i.length)throw Ai(i);this._animations.set(e,r)}_buildPlayer(e,t,i){let n=e.element,r=Je(this._normalizer,e.keyframes,t,i);return this._driver.animate(n,r,e.duration,e.delay,e.easing,[],!0)}create(e,t,i={}){let n=[],r=this._animations.get(e),o,a=new Map;if(r?(o=xi(this._driver,t,r,st,Pe,new Map,new Map,i,qn,n),o.forEach(h=>{let u=k(a,h.element,new Map);h.postStyleProps.forEach(_=>u.set(_,null))})):(n.push(wi()),o=[]),n.length)throw bi(n);a.forEach((h,u)=>{h.forEach((_,y)=>{h.set(y,this._driver.computeStyle(u,y,K))})});let l=o.map(h=>{let u=a.get(h.element);return this._buildPlayer(h,new Map,u)}),c=V(l);return this._playersById.set(e,c),c.onDestroy(()=>this.destroy(e)),this.players.push(c),c}destroy(e){let t=this._getPlayer(e);t.destroy(),this._playersById.delete(e);let i=this.players.indexOf(t);i>=0&&this.players.splice(i,1)}_getPlayer(e){let t=this._playersById.get(e);if(!t)throw Pi(e);return t}listen(e,t,i,n){let r=we(t,"","","");return Ae(this._getPlayer(e),i,r,n),()=>{}}command(e,t,i,n){if(i=="register"){this.register(e,n[0]);return}if(i=="create"){let o=n[0]||{};this.create(e,t,o);return}let r=this._getPlayer(e);switch(i){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(n[0]));break;case"destroy":this.destroy(e);break}}},Ui="ng-animate-queued",Qn=".ng-animate-queued",ct="ng-animate-disabled",Un=".ng-animate-disabled",Vn="ng-star-inserted",$n=".ng-star-inserted",Gn=[],Ji={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Wn={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},B="__ng_removed",fe=class{namespaceId;value;options;get params(){return this.options.params}constructor(e,t=""){this.namespaceId=t;let i=e&&e.hasOwnProperty("value"),n=i?e.value:e;if(this.value=Yn(n),i){let r=e,{value:o}=r,a=Ct(r,["value"]);this.options=a}else this.options={};this.options.params||(this.options.params={})}absorbOptions(e){let t=e.params;if(t){let i=this.options.params;Object.keys(t).forEach(n=>{i[n]==null&&(i[n]=t[n])})}}},de="void",ut=new fe(de),Et=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(e,t,i){this.id=e,this.hostElement=t,this._engine=i,this._hostClassName="ng-tns-"+e,L(t,this._hostClassName)}listen(e,t,i,n){if(!this._triggers.has(t))throw Ni(i,t);if(i==null||i.length==0)throw Mi(t);if(!Xn(i))throw Ci(i,t);let r=k(this._elementListeners,e,[]),o={name:t,phase:i,callback:n};r.push(o);let a=k(this._engine.statesByElement,e,new Map);return a.has(t)||(L(e,ce),L(e,ce+"-"+t),a.set(t,ut)),()=>{this._engine.afterFlush(()=>{let l=r.indexOf(o);l>=0&&r.splice(l,1),this._triggers.has(t)||a.delete(t)})}}register(e,t){return this._triggers.has(e)?!1:(this._triggers.set(e,t),!0)}_getTrigger(e){let t=this._triggers.get(e);if(!t)throw Di(e);return t}trigger(e,t,i,n=!0){let r=this._getTrigger(t),o=new pe(this.id,t,e),a=this._engine.statesByElement.get(e);a||(L(e,ce),L(e,ce+"-"+t),this._engine.statesByElement.set(e,a=new Map));let l=a.get(t),c=new fe(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&l&&c.absorbOptions(l.options),a.set(t,c),l||(l=ut),!(c.value===de)&&l.value===c.value){if(!Jn(l.params,c.params)){let g=[],T=r.matchStyles(l.value,l.params,g),w=r.matchStyles(c.value,c.params,g);g.length?this._engine.reportError(g):this._engine.afterFlush(()=>{G(e,T),j(e,w)})}return}let _=k(this._engine.playersByElement,e,[]);_.forEach(g=>{g.namespaceId==this.id&&g.triggerName==t&&g.queued&&g.destroy()});let y=r.matchTransition(l.value,c.value,e,c.params),m=!1;if(!y){if(!n)return;y=r.fallbackTransition,m=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:y,fromState:l,toState:c,player:o,isFallbackTransition:m}),m||(L(e,Ui),o.onStart(()=>{oe(e,Ui)})),o.onDone(()=>{let g=this.players.indexOf(o);g>=0&&this.players.splice(g,1);let T=this._engine.playersByElement.get(e);if(T){let w=T.indexOf(o);w>=0&&T.splice(w,1)}}),this.players.push(o),_.push(o),o}deregister(e){this._triggers.delete(e),this._engine.statesByElement.forEach(t=>t.delete(e)),this._elementListeners.forEach((t,i)=>{this._elementListeners.set(i,t.filter(n=>n.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);let t=this._engine.playersByElement.get(e);t&&(t.forEach(i=>i.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){let i=this._engine.driver.query(e,ue,!0);i.forEach(n=>{if(n[B])return;let r=this._engine.fetchNamespacesByElement(n);r.size?r.forEach(o=>o.triggerLeaveAnimation(n,t,!1,!0)):this.clearElementCache(n)}),this._engine.afterFlushAnimationsDone(()=>i.forEach(n=>this.clearElementCache(n)))}triggerLeaveAnimation(e,t,i,n){let r=this._engine.statesByElement.get(e),o=new Map;if(r){let a=[];if(r.forEach((l,c)=>{if(o.set(c,l.value),this._triggers.has(c)){let h=this.trigger(e,c,de,n);h&&a.push(h)}}),a.length)return this._engine.markElementAsRemoved(this.id,e,!0,t,o),i&&V(a).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){let t=this._elementListeners.get(e),i=this._engine.statesByElement.get(e);if(t&&i){let n=new Set;t.forEach(r=>{let o=r.name;if(n.has(o))return;n.add(o);let l=this._triggers.get(o).fallbackTransition,c=i.get(o)||ut,h=new fe(de),u=new pe(this.id,o,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:o,transition:l,fromState:c,toState:h,player:u,isFallbackTransition:!0})})}}removeNode(e,t){let i=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let n=!1;if(i.totalAnimations){let r=i.players.length?i.playersByQueriedElement.get(e):[];if(r&&r.length)n=!0;else{let o=e;for(;o=o.parentNode;)if(i.statesByElement.get(o)){n=!0;break}}}if(this.prepareLeaveAnimationListeners(e),n)i.markElementAsRemoved(this.id,e,!1,t);else{let r=e[B];(!r||r===Ji)&&(i.afterFlush(()=>this.clearElementCache(e)),i.destroyInnerAnimations(e),i._onRemovalComplete(e,t))}}insertNode(e,t){L(e,this._hostClassName)}drainQueuedTransitions(e){let t=[];return this._queue.forEach(i=>{let n=i.player;if(n.destroyed)return;let r=i.element,o=this._elementListeners.get(r);o&&o.forEach(a=>{if(a.name==i.triggerName){let l=we(r,i.triggerName,i.fromState.value,i.toState.value);l._data=e,Ae(i.player,a.phase,l,a.callback)}}),n.markedForDestroy?this._engine.afterFlush(()=>{n.destroy()}):t.push(i)}),this._queue=[],t.sort((i,n)=>{let r=i.transition.ast.depCount,o=n.transition.ast.depCount;return r==0||o==0?r-o:this._engine.driver.containsElement(i.element,n.element)?1:-1})}destroy(e){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}},vt=class{bodyNode;driver;_normalizer;players=[];newHostElements=new Map;playersByElement=new Map;playersByQueriedElement=new Map;statesByElement=new Map;disabledNodes=new Set;totalAnimations=0;totalQueuedPlayers=0;_namespaceLookup={};_namespaceList=[];_flushFns=[];_whenQuietFns=[];namespacesByHostElement=new Map;collectedEnterElements=[];collectedLeaveElements=[];onRemovalComplete=(e,t)=>{};_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}constructor(e,t,i){this.bodyNode=e,this.driver=t,this._normalizer=i}get queuedPlayers(){let e=[];return this._namespaceList.forEach(t=>{t.players.forEach(i=>{i.queued&&e.push(i)})}),e}createNamespace(e,t){let i=new Et(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(i,t):(this.newHostElements.set(t,i),this.collectEnterElement(t)),this._namespaceLookup[e]=i}_balanceNamespaceList(e,t){let i=this._namespaceList,n=this.namespacesByHostElement;if(i.length-1>=0){let o=!1,a=this.driver.getParentElement(t);for(;a;){let l=n.get(a);if(l){let c=i.indexOf(l);i.splice(c+1,0,e),o=!0;break}a=this.driver.getParentElement(a)}o||i.unshift(e)}else i.push(e);return n.set(t,e),e}register(e,t){let i=this._namespaceLookup[e];return i||(i=this.createNamespace(e,t)),i}registerTrigger(e,t,i){let n=this._namespaceLookup[e];n&&n.register(t,i)&&this.totalAnimations++}destroy(e,t){e&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let i=this._fetchNamespace(e);this.namespacesByHostElement.delete(i.hostElement);let n=this._namespaceList.indexOf(i);n>=0&&this._namespaceList.splice(n,1),i.destroy(t),delete this._namespaceLookup[e]}))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){let t=new Set,i=this.statesByElement.get(e);if(i){for(let n of i.values())if(n.namespaceId){let r=this._fetchNamespace(n.namespaceId);r&&t.add(r)}}return t}trigger(e,t,i,n){if(ke(t)){let r=this._fetchNamespace(e);if(r)return r.trigger(t,i,n),!0}return!1}insertNode(e,t,i,n){if(!ke(t))return;let r=t[B];if(r&&r.setForRemoval){r.setForRemoval=!1,r.setForMove=!0;let o=this.collectedLeaveElements.indexOf(t);o>=0&&this.collectedLeaveElements.splice(o,1)}if(e){let o=this._fetchNamespace(e);o&&o.insertNode(t,i)}n&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),L(e,ct)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),oe(e,ct))}removeNode(e,t,i){if(ke(t)){let n=e?this._fetchNamespace(e):null;n?n.removeNode(t,i):this.markElementAsRemoved(e,t,!1,i);let r=this.namespacesByHostElement.get(t);r&&r.id!==e&&r.removeNode(t,i)}else this._onRemovalComplete(t,i)}markElementAsRemoved(e,t,i,n,r){this.collectedLeaveElements.push(t),t[B]={namespaceId:e,setForRemoval:n,hasAnimation:i,removedBeforeQueried:!1,previousTriggersValues:r}}listen(e,t,i,n,r){return ke(t)?this._fetchNamespace(e).listen(t,i,n,r):()=>{}}_buildInstruction(e,t,i,n,r){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,i,n,e.fromState.options,e.toState.options,t,r)}destroyInnerAnimations(e){let t=this.driver.query(e,ue,!0);t.forEach(i=>this.destroyActiveAnimationsForElement(i)),this.playersByQueriedElement.size!=0&&(t=this.driver.query(e,Ne,!0),t.forEach(i=>this.finishActiveQueriedAnimationOnElement(i)))}destroyActiveAnimationsForElement(e){let t=this.playersByElement.get(e);t&&t.forEach(i=>{i.queued?i.markedForDestroy=!0:i.destroy()})}finishActiveQueriedAnimationOnElement(e){let t=this.playersByQueriedElement.get(e);t&&t.forEach(i=>i.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return V(this.players).onDone(()=>e());e()})}processLeaveNode(e){let t=e[B];if(t&&t.setForRemoval){if(e[B]=Ji,t.namespaceId){this.destroyInnerAnimations(e);let i=this._fetchNamespace(t.namespaceId);i&&i.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}e.classList?.contains(ct)&&this.markElementAsDisabled(e,!1),this.driver.query(e,Un,!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((i,n)=>this._balanceNamespaceList(i,n)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let i=0;i<this.collectedEnterElements.length;i++){let n=this.collectedEnterElements[i];L(n,Vn)}if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){let i=[];try{t=this._flushAnimations(i,e)}finally{for(let n=0;n<i.length;n++)i[n]()}}else for(let i=0;i<this.collectedLeaveElements.length;i++){let n=this.collectedLeaveElements[i];this.processLeaveNode(n)}if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(i=>i()),this._flushFns=[],this._whenQuietFns.length){let i=this._whenQuietFns;this._whenQuietFns=[],t.length?V(t).onDone(()=>{i.forEach(n=>n())}):i.forEach(n=>n())}}reportError(e){throw Ri(e)}_flushAnimations(e,t){let i=new me,n=[],r=new Map,o=[],a=new Map,l=new Map,c=new Map,h=new Set;this.disabledNodes.forEach(d=>{h.add(d);let f=this.driver.query(d,Qn,!0);for(let p=0;p<f.length;p++)h.add(f[p])});let u=this.bodyNode,_=Array.from(this.statesByElement.keys()),y=Gi(_,this.collectedEnterElements),m=new Map,g=0;y.forEach((d,f)=>{let p=st+g++;m.set(f,p),d.forEach(E=>L(E,p))});let T=[],w=new Set,b=new Set;for(let d=0;d<this.collectedLeaveElements.length;d++){let f=this.collectedLeaveElements[d],p=f[B];p&&p.setForRemoval&&(T.push(f),w.add(f),p.hasAnimation?this.driver.query(f,$n,!0).forEach(E=>w.add(E)):b.add(f))}let C=new Map,N=Gi(_,Array.from(w));N.forEach((d,f)=>{let p=Pe+g++;C.set(f,p),d.forEach(E=>L(E,p))}),e.push(()=>{y.forEach((d,f)=>{let p=m.get(f);d.forEach(E=>oe(E,p))}),N.forEach((d,f)=>{let p=C.get(f);d.forEach(E=>oe(E,p))}),T.forEach(d=>{this.processLeaveNode(d)})});let ie=[],q=[];for(let d=this._namespaceList.length-1;d>=0;d--)this._namespaceList[d].drainQueuedTransitions(t).forEach(p=>{let E=p.player,P=p.element;if(ie.push(E),this.collectedEnterElements.length){let M=P[B];if(M&&M.setForMove){if(M.previousTriggersValues&&M.previousTriggersValues.has(p.triggerName)){let Y=M.previousTriggersValues.get(p.triggerName),F=this.statesByElement.get(p.element);if(F&&F.has(p.triggerName)){let ge=F.get(p.triggerName);ge.value=Y,F.set(p.triggerName,ge)}}E.destroy();return}}let Q=!u||!this.driver.containsElement(u,P),I=C.get(P),$=m.get(P),A=this._buildInstruction(p,i,$,I,Q);if(A.errors&&A.errors.length){q.push(A);return}if(Q){E.onStart(()=>G(P,A.fromStyles)),E.onDestroy(()=>j(P,A.toStyles)),n.push(E);return}if(p.isFallbackTransition){E.onStart(()=>G(P,A.fromStyles)),E.onDestroy(()=>j(P,A.toStyles)),n.push(E);return}let Mt=[];A.timelines.forEach(M=>{M.stretchStartingKeyframe=!0,this.disabledNodes.has(M.element)||Mt.push(M)}),A.timelines=Mt,i.append(P,A.timelines);let ln={instruction:A,player:E,element:P};o.push(ln),A.queriedElements.forEach(M=>k(a,M,[]).push(E)),A.preStyleProps.forEach((M,Y)=>{if(M.size){let F=l.get(Y);F||l.set(Y,F=new Set),M.forEach((ge,$e)=>F.add($e))}}),A.postStyleProps.forEach((M,Y)=>{let F=c.get(Y);F||c.set(Y,F=new Set),M.forEach((ge,$e)=>F.add($e))})});if(q.length){let d=[];q.forEach(f=>{d.push(ki(f.triggerName,f.errors))}),ie.forEach(f=>f.destroy()),this.reportError(d)}let D=new Map,R=new Map;o.forEach(d=>{let f=d.element;i.has(f)&&(R.set(f,f),this._beforeAnimationBuild(d.player.namespaceId,d.instruction,D))}),n.forEach(d=>{let f=d.element;this._getPreviousPlayers(f,!1,d.namespaceId,d.triggerName,null).forEach(E=>{k(D,f,[]).push(E),E.destroy()})});let W=T.filter(d=>Wi(d,l,c)),ne=new Map;$i(ne,this.driver,b,c,K).forEach(d=>{Wi(d,l,c)&&W.push(d)});let H=new Map;y.forEach((d,f)=>{$i(H,this.driver,new Set(d),l,le)}),W.forEach(d=>{let f=ne.get(d),p=H.get(d);ne.set(d,new Map([...f?.entries()??[],...p?.entries()??[]]))});let Ve=[],Pt=[],Nt={};o.forEach(d=>{let{element:f,player:p,instruction:E}=d;if(i.has(f)){if(h.has(f)){p.onDestroy(()=>j(f,E.toStyles)),p.disabled=!0,p.overrideTotalTime(E.totalTime),n.push(p);return}let P=Nt;if(R.size>1){let I=f,$=[];for(;I=I.parentNode;){let A=R.get(I);if(A){P=A;break}$.push(I)}$.forEach(A=>R.set(A,P))}let Q=this._buildAnimation(p.namespaceId,E,D,r,H,ne);if(p.setRealPlayer(Q),P===Nt)Ve.push(p);else{let I=this.playersByElement.get(P);I&&I.length&&(p.parentPlayer=V(I)),n.push(p)}}else G(f,E.fromStyles),p.onDestroy(()=>j(f,E.toStyles)),Pt.push(p),h.has(f)&&n.push(p)}),Pt.forEach(d=>{let f=r.get(d.element);if(f&&f.length){let p=V(f);d.setRealPlayer(p)}}),n.forEach(d=>{d.parentPlayer?d.syncPlayerEvents(d.parentPlayer):d.destroy()});for(let d=0;d<T.length;d++){let f=T[d],p=f[B];if(oe(f,Pe),p&&p.hasAnimation)continue;let E=[];if(a.size){let Q=a.get(f);Q&&Q.length&&E.push(...Q);let I=this.driver.query(f,Ne,!0);for(let $=0;$<I.length;$++){let A=a.get(I[$]);A&&A.length&&E.push(...A)}}let P=E.filter(Q=>!Q.destroyed);P.length?xn(this,f,P):this.processLeaveNode(f)}return T.length=0,Ve.forEach(d=>{this.players.push(d),d.onDone(()=>{d.destroy();let f=this.players.indexOf(d);this.players.splice(f,1)}),d.play()}),Ve}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,i,n,r){let o=[];if(t){let a=this.playersByQueriedElement.get(e);a&&(o=a)}else{let a=this.playersByElement.get(e);if(a){let l=!r||r==de;a.forEach(c=>{c.queued||!l&&c.triggerName!=n||o.push(c)})}}return(i||n)&&(o=o.filter(a=>!(i&&i!=a.namespaceId||n&&n!=a.triggerName))),o}_beforeAnimationBuild(e,t,i){let n=t.triggerName,r=t.element,o=t.isRemovalTransition?void 0:e,a=t.isRemovalTransition?void 0:n;for(let l of t.timelines){let c=l.element,h=c!==r,u=k(i,c,[]);this._getPreviousPlayers(c,h,o,a,t.toState).forEach(y=>{let m=y.getRealPlayer();m.beforeDestroy&&m.beforeDestroy(),y.destroy(),u.push(y)})}G(r,t.fromStyles)}_buildAnimation(e,t,i,n,r,o){let a=t.triggerName,l=t.element,c=[],h=new Set,u=new Set,_=t.timelines.map(m=>{let g=m.element;h.add(g);let T=g[B];if(T&&T.removedBeforeQueried)return new X(m.duration,m.delay);let w=g!==l,b=Zn((i.get(g)||Gn).map(D=>D.getRealPlayer())).filter(D=>{let R=D;return R.element?R.element===g:!1}),C=r.get(g),N=o.get(g),ie=Je(this._normalizer,m.keyframes,C,N),q=this._buildPlayer(m,ie,b);if(m.subTimeline&&n&&u.add(g),w){let D=new pe(e,a,g);D.setRealPlayer(q),c.push(D)}return q});c.forEach(m=>{k(this.playersByQueriedElement,m.element,[]).push(m),m.onDone(()=>Hn(this.playersByQueriedElement,m.element,m))}),h.forEach(m=>L(m,rt));let y=V(_);return y.onDestroy(()=>{h.forEach(m=>oe(m,rt)),j(l,t.toStyles)}),u.forEach(m=>{k(n,m,[]).push(y)}),y}_buildPlayer(e,t,i){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,i):new X(e.duration,e.delay)}},pe=class{namespaceId;triggerName;element;_player=new X;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(e,t,i){this.namespaceId=e,this.triggerName=t,this.element=i}setRealPlayer(e){this._containsRealPlayer||(this._player=e,this._queuedCallbacks.forEach((t,i)=>{t.forEach(n=>Ae(e,i,void 0,n))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(e){this.totalTime=e}syncPlayerEvents(e){let t=this._player;t.triggerCallback&&e.onStart(()=>t.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,t){k(this._queuedCallbacks,e,[]).push(t)}onDone(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}onStart(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}onDestroy(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}init(){this._player.init()}hasStarted(){return this.queued?!1:this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(e){this.queued||this._player.setPosition(e)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(e){let t=this._player;t.triggerCallback&&t.triggerCallback(e)}};function Hn(s,e,t){let i=s.get(e);if(i){if(i.length){let n=i.indexOf(t);i.splice(n,1)}i.length==0&&s.delete(e)}return i}function Yn(s){return s??null}function ke(s){return s&&s.nodeType===1}function Xn(s){return s=="start"||s=="done"}function Vi(s,e){let t=s.style.display;return s.style.display=e??"none",t}function $i(s,e,t,i,n){let r=[];t.forEach(l=>r.push(Vi(l)));let o=[];i.forEach((l,c)=>{let h=new Map;l.forEach(u=>{let _=e.computeStyle(c,u,n);h.set(u,_),(!_||_.length==0)&&(c[B]=Wn,o.push(c))}),s.set(c,h)});let a=0;return t.forEach(l=>Vi(l,r[a++])),o}function Gi(s,e){let t=new Map;if(s.forEach(a=>t.set(a,[])),e.length==0)return t;let i=1,n=new Set(e),r=new Map;function o(a){if(!a)return i;let l=r.get(a);if(l)return l;let c=a.parentNode;return t.has(c)?l=c:n.has(c)?l=i:l=o(c),r.set(a,l),l}return e.forEach(a=>{let l=o(a);l!==i&&t.get(l).push(a)}),t}function L(s,e){s.classList?.add(e)}function oe(s,e){s.classList?.remove(e)}function xn(s,e,t){V(t).onDone(()=>s.processLeaveNode(e))}function Zn(s){let e=[];return en(s,e),e}function en(s,e){for(let t=0;t<s.length;t++){let i=s[t];i instanceof ve?en(i.players,e):e.push(i)}}function Jn(s,e){let t=Object.keys(s),i=Object.keys(e);if(t.length!=i.length)return!1;for(let n=0;n<t.length;n++){let r=t[n];if(!e.hasOwnProperty(r)||s[r]!==e[r])return!1}return!0}function Wi(s,e,t){let i=t.get(s);if(!i)return!1;let n=e.get(s);return n?i.forEach(r=>n.add(r)):e.set(s,i),t.delete(s),!0}var ae=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(e,t)=>{};constructor(e,t,i){this._driver=t,this._normalizer=i,this._transitionEngine=new vt(e.body,t,i),this._timelineEngine=new St(e.body,t,i),this._transitionEngine.onRemovalComplete=(n,r)=>this.onRemovalComplete(n,r)}registerTrigger(e,t,i,n,r){let o=e+"-"+n,a=this._triggerCache[o];if(!a){let l=[],c=[],h=Xi(this._driver,r,l,c);if(l.length)throw Ti(n,l);a=jn(n,h,this._normalizer),this._triggerCache[o]=a}this._transitionEngine.registerTrigger(t,n,a)}register(e,t){this._transitionEngine.register(e,t)}destroy(e,t){this._transitionEngine.destroy(e,t)}onInsert(e,t,i,n){this._transitionEngine.insertNode(e,t,i,n)}onRemove(e,t,i){this._transitionEngine.removeNode(e,t,i)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,i,n){if(i.charAt(0)=="@"){let[r,o]=et(i),a=n;this._timelineEngine.command(r,t,o,a)}else this._transitionEngine.trigger(e,t,i,n)}listen(e,t,i,n,r){if(i.charAt(0)=="@"){let[o,a]=et(i);return this._timelineEngine.listen(o,t,a,r)}return this._transitionEngine.listen(e,t,i,n,r)}flush(e=-1){this._transitionEngine.flush(e)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(e){this._transitionEngine.afterFlushAnimationsDone(e)}};function es(s,e){let t=null,i=null;return Array.isArray(e)&&e.length?(t=ht(e[0]),e.length>1&&(i=ht(e[e.length-1]))):e instanceof Map&&(t=ht(e)),t||i?new ts(s,t,i):null}var ts=(()=>{class s{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(t,i,n){this._element=t,this._startStyles=i,this._endStyles=n;let r=s.initialStylesByElement.get(t);r||s.initialStylesByElement.set(t,r=new Map),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&j(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(j(this._element,this._initialStyles),this._endStyles&&(j(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(s.initialStylesByElement.delete(this._element),this._startStyles&&(G(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(G(this._element,this._endStyles),this._endStyles=null),j(this._element,this._initialStyles),this._state=3)}}return s})();function ht(s){let e=null;return s.forEach((t,i)=>{is(i)&&(e=e||new Map,e.set(i,t))}),e}function is(s){return s==="display"||s==="position"}var je=class{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer=null;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(e,t,i,n){this.element=e,this.keyframes=t,this.options=i,this._specialStyles=n,this._duration=i.duration,this._delay=i.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this._buildPlayer()&&this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return this.domPlayer;this._initialized=!0;let e=this.keyframes,t=this._triggerWebAnimation(this.element,e,this.options);if(!t)return this._onFinish(),null;this.domPlayer=t,this._finalKeyframe=e.length?e[e.length-1]:new Map;let i=()=>this._onFinish();return t.addEventListener("finish",i),this.onDestroy(()=>{t.removeEventListener("finish",i)}),t}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer?.pause()}_convertKeyframesToObject(e){let t=[];return e.forEach(i=>{t.push(Object.fromEntries(i))}),t}_triggerWebAnimation(e,t,i){let n=this._convertKeyframesToObject(t);try{return e.animate(n,i)}catch(r){return null}}onStart(e){this._originalOnStartFns.push(e),this._onStartFns.push(e)}onDone(e){this._originalOnDoneFns.push(e),this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){let e=this._buildPlayer();e&&(this.hasStarted()||(this._onStartFns.forEach(t=>t()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),e.play())}pause(){this.init(),this.domPlayer?.pause()}finish(){this.init(),this.domPlayer&&(this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish())}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}_resetDomPlayerState(){this.domPlayer?.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}setPosition(e){this.domPlayer||this.init(),this.domPlayer&&(this.domPlayer.currentTime=e*this.time)}getPosition(){return this.domPlayer?+(this.domPlayer.currentTime??0)/this.time:this._initialized?1:0}get totalTime(){return this._delay+this._duration}beforeDestroy(){let e=new Map;this.hasStarted()&&this._finalKeyframe.forEach((i,n)=>{n!=="offset"&&e.set(n,this._finished?i:Ce(this.element,n))}),this.currentSnapshot=e}triggerCallback(e){let t=e==="start"?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}},Be=class{validateStyleProperty(e){return!0}validateAnimatableStyleProperty(e){return!0}containsElement(e,t){return tt(e,t)}getParentElement(e){return be(e)}query(e,t,i){return it(e,t,i)}computeStyle(e,t,i){return Ce(e,t)}animate(e,t,i,n,r,o=[]){let a=n==0?"both":"forwards",l={duration:i,delay:n,fill:a};r&&(l.easing=r);let c=new Map,h=o.filter(y=>y instanceof je);Li(i,n)&&h.forEach(y=>{y.currentSnapshot.forEach((m,g)=>c.set(g,m))});let u=Ii(t).map(y=>new Map(y));u=zi(e,u,c);let _=es(e,u);return new je(e,u,l,_)}};var Oe="@",tn="@.disabled",qe=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(e,t,i,n){this.namespaceId=e,this.delegate=t,this.engine=i,this._onDestroy=n}get data(){return this.delegate.data}destroyNode(e){this.delegate.destroyNode?.(e)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(e,t){return this.delegate.createElement(e,t)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,t){this.delegate.appendChild(e,t),this.engine.onInsert(this.namespaceId,t,e,!1)}insertBefore(e,t,i,n=!0){this.delegate.insertBefore(e,t,i),this.engine.onInsert(this.namespaceId,t,e,n)}removeChild(e,t,i,n){if(n){this.delegate.removeChild(e,t,i,n);return}this.parentNode(t)&&this.engine.onRemove(this.namespaceId,t,this.delegate)}selectRootElement(e,t){return this.delegate.selectRootElement(e,t)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,t,i,n){this.delegate.setAttribute(e,t,i,n)}removeAttribute(e,t,i){this.delegate.removeAttribute(e,t,i)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,i,n){this.delegate.setStyle(e,t,i,n)}removeStyle(e,t,i){this.delegate.removeStyle(e,t,i)}setProperty(e,t,i){t.charAt(0)==Oe&&t==tn?this.disableAnimations(e,!!i):this.delegate.setProperty(e,t,i)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,i,n){return this.delegate.listen(e,t,i,n)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}},Tt=class extends qe{factory;constructor(e,t,i,n,r){super(t,i,n,r),this.factory=e,this.namespaceId=t}setProperty(e,t,i){t.charAt(0)==Oe?t.charAt(1)=="."&&t==tn?(i=i===void 0?!0:!!i,this.disableAnimations(e,i)):this.engine.process(this.namespaceId,e,t.slice(1),i):this.delegate.setProperty(e,t,i)}listen(e,t,i,n){if(t.charAt(0)==Oe){let r=ns(e),o=t.slice(1),a="";return o.charAt(0)!=Oe&&([o,a]=ss(o)),this.engine.listen(this.namespaceId,r,o,a,l=>{let c=l._data||-1;this.factory.scheduleListenerCallback(c,i,l)})}return this.delegate.listen(e,t,i,n)}};function ns(s){switch(s){case"body":return document.body;case"document":return document;case"window":return window;default:return s}}function ss(s){let e=s.indexOf("."),t=s.substring(0,e),i=s.slice(e+1);return[t,i]}var Qe=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(e,t,i){this.delegate=e,this.engine=t,this._zone=i,t.onRemovalComplete=(n,r)=>{r?.removeChild(null,n)}}createRenderer(e,t){let n=this.delegate.createRenderer(e,t);if(!e||!t?.data?.animation){let c=this._rendererCache,h=c.get(n);if(!h){let u=()=>c.delete(n);h=new qe("",n,this.engine,u),c.set(n,h)}return h}let r=t.id,o=t.id+"-"+this._currentId;this._currentId++,this.engine.register(o,e);let a=c=>{Array.isArray(c)?c.forEach(a):this.engine.registerTrigger(r,o,e,c.name,c)};return t.data.animation.forEach(a),new Tt(this,o,n,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(e,t,i){if(e>=0&&e<this._microtaskId){this._zone.run(()=>t(i));return}let n=this._animationCallbacksBuffer;n.length==0&&queueMicrotask(()=>{this._zone.run(()=>{n.forEach(r=>{let[o,a]=r;o(a)}),this._animationCallbacksBuffer=[]})}),n.push([t,i])}end(){this._cdRecurDepth--,this._cdRecurDepth==0&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}componentReplaced(e){this.engine.flush(),this.delegate.componentReplaced?.(e)}};var os=(()=>{class s extends ae{constructor(t,i,n){super(t,i,n)}ngOnDestroy(){this.flush()}static \u0275fac=function(i){return new(i||s)(Ee(zt),Ee(J),Ee(ee))};static \u0275prov=Se({token:s,factory:s.\u0275fac})}return s})();function as(){return new Ie}function ls(){return new Qe(z(Gt),z(ae),z(Kt))}var nn=[{provide:ee,useFactory:as},{provide:ae,useClass:os},{provide:qt,useFactory:ls}],ks=[{provide:J,useClass:At},{provide:We,useValue:"NoopAnimations"},...nn],cs=[{provide:J,useFactory:()=>new Be},{provide:We,useFactory:()=>"BrowserAnimations"},...nn];function sn(){return Bt("NgEagerAnimations"),[...cs]}var te=s=>_e(null,null,function*(){let e=z(Te),t=s.params.projectName;return t?e.getSelectedProjectId()===t?!0:(e.selectProject(t),(yield Dt(e.selectedProject$.pipe(Ft(n=>n?.name===t))))?.name===t):(console.log("[PROJECT GUARD] no project id in route"),!1)});var rn=s=>_e(null,null,function*(){let e=z(ii),t=z(ni),i=s.params.threadId;if(!t.getUsername())try{yield Ge(t.fetchCurrentUser())}catch(n){console.error("[THREAD GUARD] Failed to load current user:",n)}if(!i)return console.log("[THREAD GUARD] no threadId in route"),!1;if(console.log("[THREAD GUARD] Checking thread:",i),console.log("[THREAD GUARD] Current selected thread:",e.getSelectedThreadId()),e.getSelectedThreadId()===i)return console.log("[THREAD GUARD] Thread already selected, allowing navigation"),!0;console.log("[THREAD GUARD] Selecting thread:",i),e.selectThread(i);try{let n=yield Ge(kt([e.isLoading$,e.selectedThread$]).pipe(Lt(([o,a])=>console.log(`\u{1F43C} [${o?"loading":"loaded"}]`,a?.id)),Ot(([o,a])=>!o&&!!a),It(1),Rt(([o,a])=>a?.id))),r=n===i;return r?console.log("[THREAD GUARD] Thread validated, allowing navigation"):console.error("[THREAD GUARD] Thread ID mismatch - route:",i,"loaded:",n),r}catch(n){return console.error("[THREAD GUARD] Error loading thread:",n),!1}});var on=[{path:"",loadComponent:()=>import("./chunk-C3QNKWXB.js").then(s=>s.GlobalTaskControlComponent)},{path:"projects",loadComponent:()=>import("./chunk-IO7Y6AGH.js").then(s=>s.ProjectListComponent)},{path:"oauth/callback",loadComponent:()=>import("./chunk-PQK52BSF.js").then(s=>s.OAuthCallbackComponent)},{path:"project/new",loadComponent:()=>import("./chunk-GX3AY74Y.js").then(s=>s.ProjectNewComponent)},{path:"project/:projectName",loadComponent:()=>import("./chunk-FEL3TDWB.js").then(s=>s.MainAppComponent),canActivate:[te]},{path:"project/:projectName/prompts",loadComponent:()=>import("./chunk-UT7VOSQ7.js").then(s=>s.PromptListComponent),canActivate:[te]},{path:"project/:projectName/schedulers",loadComponent:()=>import("./chunk-VJM7NYWY.js").then(s=>s.SchedulerListComponent),canActivate:[te]},{path:"project/:projectName/agents",loadComponent:()=>import("./chunk-UL3MSBXV.js").then(s=>s.AgentListComponent),canActivate:[te]},{path:"project/:projectName/tasks",loadComponent:()=>import("./chunk-67VHNMT7.js").then(s=>s.TaskControlComponent),canActivate:[te]},{path:"project/:projectName/missions",redirectTo:"project/:projectName/tasks"},{path:"project/:projectName/thread/:threadId",loadComponent:()=>import("./chunk-FEL3TDWB.js").then(s=>s.MainAppComponent),canActivate:[te,rn]},{path:"token-usage",loadComponent:()=>import("./chunk-QUJXN3NC.js").then(s=>s.TokenUsageComponent)},{path:"agentos",loadChildren:()=>import("./chunk-5K34TKOT.js").then(s=>s.AGENTOS_ROUTES)},{path:"**",redirectTo:""}];function us(s){return()=>s.initializeDefaultProject()}function hs(s){return()=>{console.log("[APP_INIT] OAuthService initialized")}}var an={providers:[jt(),Vt({eventCoalescing:!0}),Xt(on),Ht(),sn(),{provide:ei,useValue:{duration:3e3}},{provide:He,useFactory:us,deps:[Te],multi:!0},{provide:He,useFactory:hs,deps:[ri],multi:!0},ti({basePath:"/api/agentos"}),{provide:Jt,useValue:{width:"80vw",maxWidth:"80vw",maxHeight:"80vh"}}]};var Ue=class s{title="client";themeService=z(si);ngOnInit(){console.log("[APP] Application initialized with theme:",this.themeService.getCurrentTheme())}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=Qt({type:s,selectors:[["app-root"]],decls:1,vars:0,template:function(t,i){t&1&&Ut(0,"router-outlet")},dependencies:[xt,Yt],encapsulation:2})};Wt(Ue,an).catch(s=>console.error(s));"serviceWorker"in navigator&&!$t()&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(s=>console.error("[SW] Registration failed:",s))});
1
+ import{m as ti}from"./chunk-4OIHXCET.js";import{a as S,b as K,e as Zt,f as Ye,h as X,i as ve,j as le}from"./chunk-QVW2GZXC.js";import{a as ri}from"./chunk-CPPSTTTC.js";import{b as ii,c as ni,x as si}from"./chunk-ZZTT5MET.js";import"./chunk-SLBKHVIO.js";import{c as Yt,f as Xt,g as xt}from"./chunk-4GVABYH4.js";import{a as ei}from"./chunk-CBYR4M6L.js";import{c as Jt}from"./chunk-6CNI4FAD.js";import"./chunk-Z7E7NSDY.js";import{b as Te}from"./chunk-5URVSSXV.js";import"./chunk-EF2BOSEH.js";import{B as Ot,Ca as We,G as It,L as Ft,La as Bt,Oa as qt,Oc as Gt,Pc as Wt,Uc as Ht,V as Lt,W as v,Wa as Qt,Z as Se,a as ye,ba as Ee,c as Ct,ca as z,d as _e,fb as He,la as zt,pa as Kt,q as Ge,r as Dt,rc as Vt,sa as jt,sc as $t,t as Rt,u as kt,ub as Ut}from"./chunk-B4RKRLIY.js";function oi(s){return new v(3e3,!1)}function cn(){return new v(3100,!1)}function un(){return new v(3101,!1)}function hn(s){return new v(3001,!1)}function dn(s){return new v(3003,!1)}function mn(s){return new v(3004,!1)}function li(s,e){return new v(3005,!1)}function ci(){return new v(3006,!1)}function ui(){return new v(3007,!1)}function hi(s,e){return new v(3008,!1)}function di(s){return new v(3002,!1)}function mi(s,e,t,i,n){return new v(3010,!1)}function fi(){return new v(3011,!1)}function pi(){return new v(3012,!1)}function gi(){return new v(3200,!1)}function yi(){return new v(3202,!1)}function _i(){return new v(3013,!1)}function Si(s){return new v(3014,!1)}function Ei(s){return new v(3015,!1)}function vi(s){return new v(3016,!1)}function Ti(s,e){return new v(3404,!1)}function fn(s){return new v(3502,!1)}function Ai(s){return new v(3503,!1)}function wi(){return new v(3300,!1)}function bi(s){return new v(3504,!1)}function Pi(s){return new v(3301,!1)}function Ni(s,e){return new v(3302,!1)}function Mi(s){return new v(3303,!1)}function Ci(s,e){return new v(3400,!1)}function Di(s){return new v(3401,!1)}function Ri(s){return new v(3402,!1)}function ki(s,e){return new v(3505,!1)}function V(s){switch(s.length){case 0:return new X;case 1:return s[0];default:return new ve(s)}}function Je(s,e,t=new Map,i=new Map){let n=[],r=[],o=-1,a=null;if(e.forEach(l=>{let c=l.get("offset"),h=c==o,u=h&&a||new Map;l.forEach((_,y)=>{let m=y,g=_;if(y!=="offset")switch(m=s.normalizePropertyName(m,n),g){case le:g=t.get(y);break;case K:g=i.get(y);break;default:g=s.normalizeStyleValue(y,m,g,n);break}u.set(m,g)}),h||r.push(u),a=u,o=c}),n.length)throw fn(n);return r}function Ae(s,e,t,i){switch(e){case"start":s.onStart(()=>i(t&&Xe(t,"start",s)));break;case"done":s.onDone(()=>i(t&&Xe(t,"done",s)));break;case"destroy":s.onDestroy(()=>i(t&&Xe(t,"destroy",s)));break}}function Xe(s,e,t){let i=t.totalTime,n=!!t.disabled,r=we(s.element,s.triggerName,s.fromState,s.toState,e||s.phaseName,i??s.totalTime,n),o=s._data;return o!=null&&(r._data=o),r}function we(s,e,t,i,n="",r=0,o){return{element:s,triggerName:e,fromState:t,toState:i,phaseName:n,totalTime:r,disabled:!!o}}function k(s,e,t){let i=s.get(e);return i||s.set(e,i=t),i}function et(s){let e=s.indexOf(":"),t=s.substring(1,e),i=s.slice(e+1);return[t,i]}var pn=typeof document>"u"?null:document.documentElement;function be(s){let e=s.parentNode||s.host||null;return e===pn?null:e}function gn(s){return s.substring(1,6)=="ebkit"}var x=null,ai=!1;function Oi(s){x||(x=yn()||{},ai=x.style?"WebkitAppearance"in x.style:!1);let e=!0;return x.style&&!gn(s)&&(e=s in x.style,!e&&ai&&(e="Webkit"+s.charAt(0).toUpperCase()+s.slice(1)in x.style)),e}function yn(){return typeof document<"u"?document.body:null}function tt(s,e){for(;e;){if(e===s)return!0;e=be(e)}return!1}function it(s,e,t){if(t)return Array.from(s.querySelectorAll(e));let i=s.querySelector(e);return i?[i]:[]}var _n=1e3,nt="{{",Sn="}}",st="ng-enter",Pe="ng-leave",ce="ng-trigger",ue=".ng-trigger",rt="ng-animating",Ne=".ng-animating";function U(s){if(typeof s=="number")return s;let e=s.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:xe(parseFloat(e[1]),e[2])}function xe(s,e){return e==="s"?s*_n:s}function he(s,e,t){return s.hasOwnProperty("duration")?s:vn(s,e,t)}var En=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;function vn(s,e,t){let i,n=0,r="";if(typeof s=="string"){let o=s.match(En);if(o===null)return e.push(oi(s)),{duration:0,delay:0,easing:""};i=xe(parseFloat(o[1]),o[2]);let a=o[3];a!=null&&(n=xe(parseFloat(a),o[4]));let l=o[5];l&&(r=l)}else i=s;if(!t){let o=!1,a=e.length;i<0&&(e.push(cn()),o=!0),n<0&&(e.push(un()),o=!0),o&&e.splice(a,0,oi(s))}return{duration:i,delay:n,easing:r}}function Ii(s){return s.length?s[0]instanceof Map?s:s.map(e=>new Map(Object.entries(e))):[]}function j(s,e,t){e.forEach((i,n)=>{let r=Me(n);t&&!t.has(n)&&t.set(n,s.style[r]),s.style[r]=i})}function G(s,e){e.forEach((t,i)=>{let n=Me(i);s.style[n]=""})}function se(s){return Array.isArray(s)?s.length==1?s[0]:Zt(s):s}function Fi(s,e,t){let i=e.params||{},n=ot(s);n.length&&n.forEach(r=>{i.hasOwnProperty(r)||t.push(hn(r))})}var Ze=new RegExp(`${nt}\\s*(.+?)\\s*${Sn}`,"g");function ot(s){let e=[];if(typeof s=="string"){let t;for(;t=Ze.exec(s);)e.push(t[1]);Ze.lastIndex=0}return e}function re(s,e,t){let i=`${s}`,n=i.replace(Ze,(r,o)=>{let a=e[o];return a==null&&(t.push(dn(o)),a=""),a.toString()});return n==i?s:n}var Tn=/-+([a-z0-9])/g;function Me(s){return s.replace(Tn,(...e)=>e[1].toUpperCase())}function Li(s,e){return s===0||e===0}function zi(s,e,t){if(t.size&&e.length){let i=e[0],n=[];if(t.forEach((r,o)=>{i.has(o)||n.push(o),i.set(o,r)}),n.length)for(let r=1;r<e.length;r++){let o=e[r];n.forEach(a=>o.set(a,Ce(s,a)))}}return e}function O(s,e,t){switch(e.type){case S.Trigger:return s.visitTrigger(e,t);case S.State:return s.visitState(e,t);case S.Transition:return s.visitTransition(e,t);case S.Sequence:return s.visitSequence(e,t);case S.Group:return s.visitGroup(e,t);case S.Animate:return s.visitAnimate(e,t);case S.Keyframes:return s.visitKeyframes(e,t);case S.Style:return s.visitStyle(e,t);case S.Reference:return s.visitReference(e,t);case S.AnimateChild:return s.visitAnimateChild(e,t);case S.AnimateRef:return s.visitAnimateRef(e,t);case S.Query:return s.visitQuery(e,t);case S.Stagger:return s.visitStagger(e,t);default:throw mn(e.type)}}function Ce(s,e){return window.getComputedStyle(s)[e]}var At=(()=>{class s{validateStyleProperty(t){return Oi(t)}containsElement(t,i){return tt(t,i)}getParentElement(t){return be(t)}query(t,i,n){return it(t,i,n)}computeStyle(t,i,n){return n||""}animate(t,i,n,r,o,a=[],l){return new X(n,r)}static \u0275fac=function(i){return new(i||s)};static \u0275prov=Se({token:s,factory:s.\u0275fac})}return s})(),J=class{static NOOP=new At},ee=class{};var An=new Set(["width","height","minWidth","minHeight","maxWidth","maxHeight","left","top","bottom","right","fontSize","outlineWidth","outlineOffset","paddingTop","paddingLeft","paddingBottom","paddingRight","marginTop","marginLeft","marginBottom","marginRight","borderRadius","borderWidth","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","textIndent","perspective"]),Ie=class extends ee{normalizePropertyName(e,t){return Me(e)}normalizeStyleValue(e,t,i,n){let r="",o=i.toString().trim();if(An.has(t)&&i!==0&&i!=="0")if(typeof i=="number")r="px";else{let a=i.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&a[1].length==0&&n.push(li(e,i))}return o+r}};var Fe="*";function wn(s,e){let t=[];return typeof s=="string"?s.split(/\s*,\s*/).forEach(i=>bn(i,t,e)):t.push(s),t}function bn(s,e,t){if(s[0]==":"){let l=Pn(s,t);if(typeof l=="function"){e.push(l);return}s=l}let i=s.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(i==null||i.length<4)return t.push(Ei(s)),e;let n=i[1],r=i[2],o=i[3];e.push(Ki(n,o));let a=n==Fe&&o==Fe;r[0]=="<"&&!a&&e.push(Ki(o,n))}function Pn(s,e){switch(s){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,i)=>parseFloat(i)>parseFloat(t);case":decrement":return(t,i)=>parseFloat(i)<parseFloat(t);default:return e.push(vi(s)),"* => *"}}var De=new Set(["true","1"]),Re=new Set(["false","0"]);function Ki(s,e){let t=De.has(s)||Re.has(s),i=De.has(e)||Re.has(e);return(n,r)=>{let o=s==Fe||s==n,a=e==Fe||e==r;return!o&&t&&typeof n=="boolean"&&(o=n?De.has(s):Re.has(s)),!a&&i&&typeof r=="boolean"&&(a=r?De.has(e):Re.has(e)),o&&a}}var Yi=":self",Nn=new RegExp(`s*${Yi}s*,?`,"g");function Xi(s,e,t,i){return new dt(s).build(e,t,i)}var ji="",dt=class{_driver;constructor(e){this._driver=e}build(e,t,i){let n=new mt(t);return this._resetContextStyleTimingState(n),O(this,se(e),n)}_resetContextStyleTimingState(e){e.currentQuerySelector=ji,e.collectedStyles=new Map,e.collectedStyles.set(ji,new Map),e.currentTime=0}visitTrigger(e,t){let i=t.queryCount=0,n=t.depCount=0,r=[],o=[];return e.name.charAt(0)=="@"&&t.errors.push(ci()),e.definitions.forEach(a=>{if(this._resetContextStyleTimingState(t),a.type==S.State){let l=a,c=l.name;c.toString().split(/\s*,\s*/).forEach(h=>{l.name=h,r.push(this.visitState(l,t))}),l.name=c}else if(a.type==S.Transition){let l=this.visitTransition(a,t);i+=l.queryCount,n+=l.depCount,o.push(l)}else t.errors.push(ui())}),{type:S.Trigger,name:e.name,states:r,transitions:o,queryCount:i,depCount:n,options:null}}visitState(e,t){let i=this.visitStyle(e.styles,t),n=e.options&&e.options.params||null;if(i.containsDynamicStyles){let r=new Set,o=n||{};i.styles.forEach(a=>{a instanceof Map&&a.forEach(l=>{ot(l).forEach(c=>{o.hasOwnProperty(c)||r.add(c)})})}),r.size&&t.errors.push(hi(e.name,[...r.values()]))}return{type:S.State,name:e.name,style:i,options:n?{params:n}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;let i=O(this,se(e.animation),t),n=wn(e.expr,t.errors);return{type:S.Transition,matchers:n,animation:i,queryCount:t.queryCount,depCount:t.depCount,options:Z(e.options)}}visitSequence(e,t){return{type:S.Sequence,steps:e.steps.map(i=>O(this,i,t)),options:Z(e.options)}}visitGroup(e,t){let i=t.currentTime,n=0,r=e.steps.map(o=>{t.currentTime=i;let a=O(this,o,t);return n=Math.max(n,t.currentTime),a});return t.currentTime=n,{type:S.Group,steps:r,options:Z(e.options)}}visitAnimate(e,t){let i=Rn(e.timings,t.errors);t.currentAnimateTimings=i;let n,r=e.styles?e.styles:Ye({});if(r.type==S.Keyframes)n=this.visitKeyframes(r,t);else{let o=e.styles,a=!1;if(!o){a=!0;let c={};i.easing&&(c.easing=i.easing),o=Ye(c)}t.currentTime+=i.duration+i.delay;let l=this.visitStyle(o,t);l.isEmptyStep=a,n=l}return t.currentAnimateTimings=null,{type:S.Animate,timings:i,style:n,options:null}}visitStyle(e,t){let i=this._makeStyleAst(e,t);return this._validateStyleAst(i,t),i}_makeStyleAst(e,t){let i=[],n=Array.isArray(e.styles)?e.styles:[e.styles];for(let a of n)typeof a=="string"?a===K?i.push(a):t.errors.push(di(a)):i.push(new Map(Object.entries(a)));let r=!1,o=null;return i.forEach(a=>{if(a instanceof Map&&(a.has("easing")&&(o=a.get("easing"),a.delete("easing")),!r)){for(let l of a.values())if(l.toString().indexOf(nt)>=0){r=!0;break}}}),{type:S.Style,styles:i,easing:o,offset:e.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(e,t){let i=t.currentAnimateTimings,n=t.currentTime,r=t.currentTime;i&&r>0&&(r-=i.duration+i.delay),e.styles.forEach(o=>{typeof o!="string"&&o.forEach((a,l)=>{let c=t.collectedStyles.get(t.currentQuerySelector),h=c.get(l),u=!0;h&&(r!=n&&r>=h.startTime&&n<=h.endTime&&(t.errors.push(mi(l,h.startTime,h.endTime,r,n)),u=!1),r=h.startTime),u&&c.set(l,{startTime:r,endTime:n}),t.options&&Fi(a,t.options,t.errors)})})}visitKeyframes(e,t){let i={type:S.Keyframes,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push(fi()),i;let n=1,r=0,o=[],a=!1,l=!1,c=0,h=e.steps.map(w=>{let b=this._makeStyleAst(w,t),C=b.offset!=null?b.offset:Dn(b.styles),N=0;return C!=null&&(r++,N=b.offset=C),l=l||N<0||N>1,a=a||N<c,c=N,o.push(N),b});l&&t.errors.push(pi()),a&&t.errors.push(gi());let u=e.steps.length,_=0;r>0&&r<u?t.errors.push(yi()):r==0&&(_=n/(u-1));let y=u-1,m=t.currentTime,g=t.currentAnimateTimings,T=g.duration;return h.forEach((w,b)=>{let C=_>0?b==y?1:_*b:o[b],N=C*T;t.currentTime=m+g.delay+N,g.duration=N,this._validateStyleAst(w,t),w.offset=C,i.styles.push(w)}),i}visitReference(e,t){return{type:S.Reference,animation:O(this,se(e.animation),t),options:Z(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:S.AnimateChild,options:Z(e.options)}}visitAnimateRef(e,t){return{type:S.AnimateRef,animation:this.visitReference(e.animation,t),options:Z(e.options)}}visitQuery(e,t){let i=t.currentQuerySelector,n=e.options||{};t.queryCount++,t.currentQuery=e;let[r,o]=Mn(e.selector);t.currentQuerySelector=i.length?i+" "+r:r,k(t.collectedStyles,t.currentQuerySelector,new Map);let a=O(this,se(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=i,{type:S.Query,selector:r,limit:n.limit||0,optional:!!n.optional,includeSelf:o,animation:a,originalSelector:e.selector,options:Z(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push(_i());let i=e.timings==="full"?{duration:0,delay:0,easing:"full"}:he(e.timings,t.errors,!0);return{type:S.Stagger,animation:O(this,se(e.animation),t),timings:i,options:null}}};function Mn(s){let e=!!s.split(/\s*,\s*/).find(t=>t==Yi);return e&&(s=s.replace(Nn,"")),s=s.replace(/@\*/g,ue).replace(/@\w+/g,t=>ue+"-"+t.slice(1)).replace(/:animating/g,Ne),[s,e]}function Cn(s){return s?ye({},s):null}var mt=class{errors;queryCount=0;depCount=0;currentTransition=null;currentQuery=null;currentQuerySelector=null;currentAnimateTimings=null;currentTime=0;collectedStyles=new Map;options=null;unsupportedCSSPropertiesFound=new Set;constructor(e){this.errors=e}};function Dn(s){if(typeof s=="string")return null;let e=null;if(Array.isArray(s))s.forEach(t=>{if(t instanceof Map&&t.has("offset")){let i=t;e=parseFloat(i.get("offset")),i.delete("offset")}});else if(s instanceof Map&&s.has("offset")){let t=s;e=parseFloat(t.get("offset")),t.delete("offset")}return e}function Rn(s,e){if(s.hasOwnProperty("duration"))return s;if(typeof s=="number"){let r=he(s,e).duration;return at(r,0,"")}let t=s;if(t.split(/\s+/).some(r=>r.charAt(0)=="{"&&r.charAt(1)=="{")){let r=at(0,0,"");return r.dynamic=!0,r.strValue=t,r}let n=he(t,e);return at(n.duration,n.delay,n.easing)}function Z(s){return s?(s=ye({},s),s.params&&(s.params=Cn(s.params))):s={},s}function at(s,e,t){return{duration:s,delay:e,easing:t}}function wt(s,e,t,i,n,r,o=null,a=!1){return{type:1,element:s,keyframes:e,preStyleProps:t,postStyleProps:i,duration:n,delay:r,totalTime:n+r,easing:o,subTimeline:a}}var me=class{_map=new Map;get(e){return this._map.get(e)||[]}append(e,t){let i=this._map.get(e);i||this._map.set(e,i=[]),i.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}},kn=1,On=":enter",In=new RegExp(On,"g"),Fn=":leave",Ln=new RegExp(Fn,"g");function xi(s,e,t,i,n,r=new Map,o=new Map,a,l,c=[]){return new ft().buildKeyframes(s,e,t,i,n,r,o,a,l,c)}var ft=class{buildKeyframes(e,t,i,n,r,o,a,l,c,h=[]){c=c||new me;let u=new pt(e,t,c,n,r,h,[]);u.options=l;let _=l.delay?U(l.delay):0;u.currentTimeline.delayNextStep(_),u.currentTimeline.setStyles([o],null,u.errors,l),O(this,i,u);let y=u.timelines.filter(m=>m.containsAnimation());if(y.length&&a.size){let m;for(let g=y.length-1;g>=0;g--){let T=y[g];if(T.element===t){m=T;break}}m&&!m.allowOnlyTimelineStyles()&&m.setStyles([a],null,u.errors,l)}return y.length?y.map(m=>m.buildKeyframes()):[wt(t,[],[],[],0,_,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){let i=t.subInstructions.get(t.element);if(i){let n=t.createSubContext(e.options),r=t.currentTimeline.currentTime,o=this._visitSubInstructions(i,n,n.options);r!=o&&t.transformIntoNewTimeline(o)}t.previousNode=e}visitAnimateRef(e,t){let i=t.createSubContext(e.options);i.transformIntoNewTimeline(),this._applyAnimationRefDelays([e.options,e.animation.options],t,i),this.visitReference(e.animation,i),t.transformIntoNewTimeline(i.currentTimeline.currentTime),t.previousNode=e}_applyAnimationRefDelays(e,t,i){for(let n of e){let r=n?.delay;if(r){let o=typeof r=="number"?r:U(re(r,n?.params??{},t.errors));i.delayNextStep(o)}}}_visitSubInstructions(e,t,i){let r=t.currentTimeline.currentTime,o=i.duration!=null?U(i.duration):null,a=i.delay!=null?U(i.delay):null;return o!==0&&e.forEach(l=>{let c=t.appendInstructionToTimeline(l,o,a);r=Math.max(r,c.duration+c.delay)}),r}visitReference(e,t){t.updateOptions(e.options,!0),O(this,e.animation,t),t.previousNode=e}visitSequence(e,t){let i=t.subContextCount,n=t,r=e.options;if(r&&(r.params||r.delay)&&(n=t.createSubContext(r),n.transformIntoNewTimeline(),r.delay!=null)){n.previousNode.type==S.Style&&(n.currentTimeline.snapshotCurrentStyles(),n.previousNode=Le);let o=U(r.delay);n.delayNextStep(o)}e.steps.length&&(e.steps.forEach(o=>O(this,o,n)),n.currentTimeline.applyStylesToKeyframe(),n.subContextCount>i&&n.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){let i=[],n=t.currentTimeline.currentTime,r=e.options&&e.options.delay?U(e.options.delay):0;e.steps.forEach(o=>{let a=t.createSubContext(e.options);r&&a.delayNextStep(r),O(this,o,a),n=Math.max(n,a.currentTimeline.currentTime),i.push(a.currentTimeline)}),i.forEach(o=>t.currentTimeline.mergeTimelineCollectedStyles(o)),t.transformIntoNewTimeline(n),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){let i=e.strValue,n=t.params?re(i,t.params,t.errors):i;return he(n,t.errors)}else return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){let i=t.currentAnimateTimings=this._visitTiming(e.timings,t),n=t.currentTimeline;i.delay&&(t.incrementTime(i.delay),n.snapshotCurrentStyles());let r=e.style;r.type==S.Keyframes?this.visitKeyframes(r,t):(t.incrementTime(i.duration),this.visitStyle(r,t),n.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){let i=t.currentTimeline,n=t.currentAnimateTimings;!n&&i.hasCurrentStyleProperties()&&i.forwardFrame();let r=n&&n.easing||e.easing;e.isEmptyStep?i.applyEmptyStep(r):i.setStyles(e.styles,r,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){let i=t.currentAnimateTimings,n=t.currentTimeline.duration,r=i.duration,a=t.createSubContext().currentTimeline;a.easing=i.easing,e.styles.forEach(l=>{let c=l.offset||0;a.forwardTime(c*r),a.setStyles(l.styles,l.easing,t.errors,t.options),a.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(a),t.transformIntoNewTimeline(n+r),t.previousNode=e}visitQuery(e,t){let i=t.currentTimeline.currentTime,n=e.options||{},r=n.delay?U(n.delay):0;r&&(t.previousNode.type===S.Style||i==0&&t.currentTimeline.hasCurrentStyleProperties())&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=Le);let o=i,a=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!n.optional,t.errors);t.currentQueryTotal=a.length;let l=null;a.forEach((c,h)=>{t.currentQueryIndex=h;let u=t.createSubContext(e.options,c);r&&u.delayNextStep(r),c===t.element&&(l=u.currentTimeline),O(this,e.animation,u),u.currentTimeline.applyStylesToKeyframe();let _=u.currentTimeline.currentTime;o=Math.max(o,_)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(o),l&&(t.currentTimeline.mergeTimelineCollectedStyles(l),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){let i=t.parentContext,n=t.currentTimeline,r=e.timings,o=Math.abs(r.duration),a=o*(t.currentQueryTotal-1),l=o*t.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":l=a-l;break;case"full":l=i.currentStaggerTime;break}let h=t.currentTimeline;l&&h.delayNextStep(l);let u=h.currentTime;O(this,e.animation,t),t.previousNode=e,i.currentStaggerTime=n.currentTime-u+(n.startTime-i.currentTimeline.startTime)}},Le={},pt=class s{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=Le;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(e,t,i,n,r,o,a,l){this._driver=e,this.element=t,this.subInstructions=i,this._enterClassName=n,this._leaveClassName=r,this.errors=o,this.timelines=a,this.currentTimeline=l||new ze(this._driver,t,0),a.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;let i=e,n=this.options;i.duration!=null&&(n.duration=U(i.duration)),i.delay!=null&&(n.delay=U(i.delay));let r=i.params;if(r){let o=n.params;o||(o=this.options.params={}),Object.keys(r).forEach(a=>{(!t||!o.hasOwnProperty(a))&&(o[a]=re(r[a],o,this.errors))})}}_copyOptions(){let e={};if(this.options){let t=this.options.params;if(t){let i=e.params={};Object.keys(t).forEach(n=>{i[n]=t[n]})}}return e}createSubContext(e=null,t,i){let n=t||this.element,r=new s(this._driver,n,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(n,i||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(e),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(e){return this.previousNode=Le,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,i){let n={duration:t??e.duration,delay:this.currentTimeline.currentTime+(i??0)+e.delay,easing:""},r=new gt(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,n,e.stretchStartingKeyframe);return this.timelines.push(r),n}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,i,n,r,o){let a=[];if(n&&a.push(this.element),e.length>0){e=e.replace(In,"."+this._enterClassName),e=e.replace(Ln,"."+this._leaveClassName);let l=i!=1,c=this._driver.query(this.element,e,l);i!==0&&(c=i<0?c.slice(c.length+i,c.length):c.slice(0,i)),a.push(...c)}return!r&&a.length==0&&o.push(Si(t)),a}},ze=class s{_driver;element;startTime;_elementTimelineStylesLookup;duration=0;easing=null;_previousKeyframe=new Map;_currentKeyframe=new Map;_keyframes=new Map;_styleSummary=new Map;_localTimelineStyles=new Map;_globalTimelineStyles;_pendingStyles=new Map;_backFill=new Map;_currentEmptyStepKeyframe=null;constructor(e,t,i,n){this._driver=e,this.element=t,this.startTime=i,this._elementTimelineStylesLookup=n,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.hasCurrentStyleProperties();default:return!0}}hasCurrentStyleProperties(){return this._currentKeyframe.size>0}get currentTime(){return this.startTime+this.duration}delayNextStep(e){let t=this._keyframes.size===1&&this._pendingStyles.size;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new s(this._driver,e,t||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=new Map,this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=kn,this._loadKeyframe()}forwardTime(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles.set(e,t),this._globalTimelineStyles.set(e,t),this._styleSummary.set(e,{time:this.currentTime,value:t})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&this._previousKeyframe.set("easing",e);for(let[t,i]of this._globalTimelineStyles)this._backFill.set(t,i||K),this._currentKeyframe.set(t,K);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,i,n){t&&this._previousKeyframe.set("easing",t);let r=n&&n.params||{},o=zn(e,this._globalTimelineStyles);for(let[a,l]of o){let c=re(l,r,i);this._pendingStyles.set(a,c),this._localTimelineStyles.has(a)||this._backFill.set(a,this._globalTimelineStyles.get(a)??K),this._updateStyle(a,c)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((e,t)=>{this._currentKeyframe.set(t,e)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((e,t)=>{this._currentKeyframe.has(t)||this._currentKeyframe.set(t,e)}))}snapshotCurrentStyles(){for(let[e,t]of this._localTimelineStyles)this._pendingStyles.set(e,t),this._updateStyle(e,t)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){e._styleSummary.forEach((t,i)=>{let n=this._styleSummary.get(i);(!n||t.time>n.time)&&this._updateStyle(i,t.value)})}buildKeyframes(){this.applyStylesToKeyframe();let e=new Set,t=new Set,i=this._keyframes.size===1&&this.duration===0,n=[];this._keyframes.forEach((a,l)=>{let c=new Map([...this._backFill,...a]);c.forEach((h,u)=>{h===le?e.add(u):h===K&&t.add(u)}),i||c.set("offset",l/this.duration),n.push(c)});let r=[...e.values()],o=[...t.values()];if(i){let a=n[0],l=new Map(a);a.set("offset",0),l.set("offset",1),n=[a,l]}return wt(this.element,n,r,o,this.duration,this.startTime,this.easing,!1)}},gt=class extends ze{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(e,t,i,n,r,o,a=!1){super(e,t,o.delay),this.keyframes=i,this.preStyleProps=n,this.postStyleProps=r,this._stretchStartingKeyframe=a,this.timings={duration:o.duration,delay:o.delay,easing:o.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:i,easing:n}=this.timings;if(this._stretchStartingKeyframe&&t){let r=[],o=i+t,a=t/o,l=new Map(e[0]);l.set("offset",0),r.push(l);let c=new Map(e[0]);c.set("offset",Bi(a)),r.push(c);let h=e.length-1;for(let u=1;u<=h;u++){let _=new Map(e[u]),y=_.get("offset"),m=t+y*i;_.set("offset",Bi(m/o)),r.push(_)}i=o,t=0,n="",e=r}return wt(this.element,e,this.preStyleProps,this.postStyleProps,i,t,n,!0)}};function Bi(s,e=3){let t=Math.pow(10,e-1);return Math.round(s*t)/t}function zn(s,e){let t=new Map,i;return s.forEach(n=>{if(n==="*"){i??=e.keys();for(let r of i)t.set(r,K)}else for(let[r,o]of n)t.set(r,o)}),t}function qi(s,e,t,i,n,r,o,a,l,c,h,u,_){return{type:0,element:s,triggerName:e,isRemovalTransition:n,fromState:t,fromStyles:r,toState:i,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:h,totalTime:u,errors:_}}var lt={},Ke=class{_triggerName;ast;_stateStyles;constructor(e,t,i){this._triggerName=e,this.ast=t,this._stateStyles=i}match(e,t,i,n){return Kn(this.ast.matchers,e,t,i,n)}buildStyles(e,t,i){let n=this._stateStyles.get("*");return e!==void 0&&(n=this._stateStyles.get(e?.toString())||n),n?n.buildStyles(t,i):new Map}build(e,t,i,n,r,o,a,l,c,h){let u=[],_=this.ast.options&&this.ast.options.params||lt,y=a&&a.params||lt,m=this.buildStyles(i,y,u),g=l&&l.params||lt,T=this.buildStyles(n,g,u),w=new Set,b=new Map,C=new Map,N=n==="void",ie={params:Zi(g,_),delay:this.ast.options?.delay},q=h?[]:xi(e,t,this.ast.animation,r,o,m,T,ie,c,u),D=0;return q.forEach(R=>{D=Math.max(R.duration+R.delay,D)}),u.length?qi(t,this._triggerName,i,n,N,m,T,[],[],b,C,D,u):(q.forEach(R=>{let W=R.element,ne=k(b,W,new Set);R.preStyleProps.forEach(H=>ne.add(H));let bt=k(C,W,new Set);R.postStyleProps.forEach(H=>bt.add(H)),W!==t&&w.add(W)}),qi(t,this._triggerName,i,n,N,m,T,q,[...w.values()],b,C,D))}};function Kn(s,e,t,i,n){return s.some(r=>r(e,t,i,n))}function Zi(s,e){let t=ye({},e);return Object.entries(s).forEach(([i,n])=>{n!=null&&(t[i]=n)}),t}var yt=class{styles;defaultParams;normalizer;constructor(e,t,i){this.styles=e,this.defaultParams=t,this.normalizer=i}buildStyles(e,t){let i=new Map,n=Zi(e,this.defaultParams);return this.styles.styles.forEach(r=>{typeof r!="string"&&r.forEach((o,a)=>{o&&(o=re(o,n,t));let l=this.normalizer.normalizePropertyName(a,t);o=this.normalizer.normalizeStyleValue(a,l,o,t),i.set(a,o)})}),i}};function jn(s,e,t){return new _t(s,e,t)}var _t=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(e,t,i){this.name=e,this.ast=t,this._normalizer=i,t.states.forEach(n=>{let r=n.options&&n.options.params||{};this.states.set(n.name,new yt(n.style,r,i))}),Qi(this.states,"true","1"),Qi(this.states,"false","0"),t.transitions.forEach(n=>{this.transitionFactories.push(new Ke(e,n,this.states))}),this.fallbackTransition=Bn(e,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,i,n){return this.transitionFactories.find(o=>o.match(e,t,i,n))||null}matchStyles(e,t,i){return this.fallbackTransition.buildStyles(e,t,i)}};function Bn(s,e,t){let i=[(o,a)=>!0],n={type:S.Sequence,steps:[],options:null},r={type:S.Transition,animation:n,matchers:i,options:null,queryCount:0,depCount:0};return new Ke(s,r,e)}function Qi(s,e,t){s.has(e)?s.has(t)||s.set(t,s.get(e)):s.has(t)&&s.set(e,s.get(t))}var qn=new me,St=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(e,t,i){this.bodyNode=e,this._driver=t,this._normalizer=i}register(e,t){let i=[],n=[],r=Xi(this._driver,t,i,n);if(i.length)throw Ai(i);this._animations.set(e,r)}_buildPlayer(e,t,i){let n=e.element,r=Je(this._normalizer,e.keyframes,t,i);return this._driver.animate(n,r,e.duration,e.delay,e.easing,[],!0)}create(e,t,i={}){let n=[],r=this._animations.get(e),o,a=new Map;if(r?(o=xi(this._driver,t,r,st,Pe,new Map,new Map,i,qn,n),o.forEach(h=>{let u=k(a,h.element,new Map);h.postStyleProps.forEach(_=>u.set(_,null))})):(n.push(wi()),o=[]),n.length)throw bi(n);a.forEach((h,u)=>{h.forEach((_,y)=>{h.set(y,this._driver.computeStyle(u,y,K))})});let l=o.map(h=>{let u=a.get(h.element);return this._buildPlayer(h,new Map,u)}),c=V(l);return this._playersById.set(e,c),c.onDestroy(()=>this.destroy(e)),this.players.push(c),c}destroy(e){let t=this._getPlayer(e);t.destroy(),this._playersById.delete(e);let i=this.players.indexOf(t);i>=0&&this.players.splice(i,1)}_getPlayer(e){let t=this._playersById.get(e);if(!t)throw Pi(e);return t}listen(e,t,i,n){let r=we(t,"","","");return Ae(this._getPlayer(e),i,r,n),()=>{}}command(e,t,i,n){if(i=="register"){this.register(e,n[0]);return}if(i=="create"){let o=n[0]||{};this.create(e,t,o);return}let r=this._getPlayer(e);switch(i){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(n[0]));break;case"destroy":this.destroy(e);break}}},Ui="ng-animate-queued",Qn=".ng-animate-queued",ct="ng-animate-disabled",Un=".ng-animate-disabled",Vn="ng-star-inserted",$n=".ng-star-inserted",Gn=[],Ji={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Wn={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},B="__ng_removed",fe=class{namespaceId;value;options;get params(){return this.options.params}constructor(e,t=""){this.namespaceId=t;let i=e&&e.hasOwnProperty("value"),n=i?e.value:e;if(this.value=Yn(n),i){let r=e,{value:o}=r,a=Ct(r,["value"]);this.options=a}else this.options={};this.options.params||(this.options.params={})}absorbOptions(e){let t=e.params;if(t){let i=this.options.params;Object.keys(t).forEach(n=>{i[n]==null&&(i[n]=t[n])})}}},de="void",ut=new fe(de),Et=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(e,t,i){this.id=e,this.hostElement=t,this._engine=i,this._hostClassName="ng-tns-"+e,L(t,this._hostClassName)}listen(e,t,i,n){if(!this._triggers.has(t))throw Ni(i,t);if(i==null||i.length==0)throw Mi(t);if(!Xn(i))throw Ci(i,t);let r=k(this._elementListeners,e,[]),o={name:t,phase:i,callback:n};r.push(o);let a=k(this._engine.statesByElement,e,new Map);return a.has(t)||(L(e,ce),L(e,ce+"-"+t),a.set(t,ut)),()=>{this._engine.afterFlush(()=>{let l=r.indexOf(o);l>=0&&r.splice(l,1),this._triggers.has(t)||a.delete(t)})}}register(e,t){return this._triggers.has(e)?!1:(this._triggers.set(e,t),!0)}_getTrigger(e){let t=this._triggers.get(e);if(!t)throw Di(e);return t}trigger(e,t,i,n=!0){let r=this._getTrigger(t),o=new pe(this.id,t,e),a=this._engine.statesByElement.get(e);a||(L(e,ce),L(e,ce+"-"+t),this._engine.statesByElement.set(e,a=new Map));let l=a.get(t),c=new fe(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&l&&c.absorbOptions(l.options),a.set(t,c),l||(l=ut),!(c.value===de)&&l.value===c.value){if(!Jn(l.params,c.params)){let g=[],T=r.matchStyles(l.value,l.params,g),w=r.matchStyles(c.value,c.params,g);g.length?this._engine.reportError(g):this._engine.afterFlush(()=>{G(e,T),j(e,w)})}return}let _=k(this._engine.playersByElement,e,[]);_.forEach(g=>{g.namespaceId==this.id&&g.triggerName==t&&g.queued&&g.destroy()});let y=r.matchTransition(l.value,c.value,e,c.params),m=!1;if(!y){if(!n)return;y=r.fallbackTransition,m=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:y,fromState:l,toState:c,player:o,isFallbackTransition:m}),m||(L(e,Ui),o.onStart(()=>{oe(e,Ui)})),o.onDone(()=>{let g=this.players.indexOf(o);g>=0&&this.players.splice(g,1);let T=this._engine.playersByElement.get(e);if(T){let w=T.indexOf(o);w>=0&&T.splice(w,1)}}),this.players.push(o),_.push(o),o}deregister(e){this._triggers.delete(e),this._engine.statesByElement.forEach(t=>t.delete(e)),this._elementListeners.forEach((t,i)=>{this._elementListeners.set(i,t.filter(n=>n.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);let t=this._engine.playersByElement.get(e);t&&(t.forEach(i=>i.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){let i=this._engine.driver.query(e,ue,!0);i.forEach(n=>{if(n[B])return;let r=this._engine.fetchNamespacesByElement(n);r.size?r.forEach(o=>o.triggerLeaveAnimation(n,t,!1,!0)):this.clearElementCache(n)}),this._engine.afterFlushAnimationsDone(()=>i.forEach(n=>this.clearElementCache(n)))}triggerLeaveAnimation(e,t,i,n){let r=this._engine.statesByElement.get(e),o=new Map;if(r){let a=[];if(r.forEach((l,c)=>{if(o.set(c,l.value),this._triggers.has(c)){let h=this.trigger(e,c,de,n);h&&a.push(h)}}),a.length)return this._engine.markElementAsRemoved(this.id,e,!0,t,o),i&&V(a).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){let t=this._elementListeners.get(e),i=this._engine.statesByElement.get(e);if(t&&i){let n=new Set;t.forEach(r=>{let o=r.name;if(n.has(o))return;n.add(o);let l=this._triggers.get(o).fallbackTransition,c=i.get(o)||ut,h=new fe(de),u=new pe(this.id,o,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:o,transition:l,fromState:c,toState:h,player:u,isFallbackTransition:!0})})}}removeNode(e,t){let i=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let n=!1;if(i.totalAnimations){let r=i.players.length?i.playersByQueriedElement.get(e):[];if(r&&r.length)n=!0;else{let o=e;for(;o=o.parentNode;)if(i.statesByElement.get(o)){n=!0;break}}}if(this.prepareLeaveAnimationListeners(e),n)i.markElementAsRemoved(this.id,e,!1,t);else{let r=e[B];(!r||r===Ji)&&(i.afterFlush(()=>this.clearElementCache(e)),i.destroyInnerAnimations(e),i._onRemovalComplete(e,t))}}insertNode(e,t){L(e,this._hostClassName)}drainQueuedTransitions(e){let t=[];return this._queue.forEach(i=>{let n=i.player;if(n.destroyed)return;let r=i.element,o=this._elementListeners.get(r);o&&o.forEach(a=>{if(a.name==i.triggerName){let l=we(r,i.triggerName,i.fromState.value,i.toState.value);l._data=e,Ae(i.player,a.phase,l,a.callback)}}),n.markedForDestroy?this._engine.afterFlush(()=>{n.destroy()}):t.push(i)}),this._queue=[],t.sort((i,n)=>{let r=i.transition.ast.depCount,o=n.transition.ast.depCount;return r==0||o==0?r-o:this._engine.driver.containsElement(i.element,n.element)?1:-1})}destroy(e){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}},vt=class{bodyNode;driver;_normalizer;players=[];newHostElements=new Map;playersByElement=new Map;playersByQueriedElement=new Map;statesByElement=new Map;disabledNodes=new Set;totalAnimations=0;totalQueuedPlayers=0;_namespaceLookup={};_namespaceList=[];_flushFns=[];_whenQuietFns=[];namespacesByHostElement=new Map;collectedEnterElements=[];collectedLeaveElements=[];onRemovalComplete=(e,t)=>{};_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}constructor(e,t,i){this.bodyNode=e,this.driver=t,this._normalizer=i}get queuedPlayers(){let e=[];return this._namespaceList.forEach(t=>{t.players.forEach(i=>{i.queued&&e.push(i)})}),e}createNamespace(e,t){let i=new Et(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(i,t):(this.newHostElements.set(t,i),this.collectEnterElement(t)),this._namespaceLookup[e]=i}_balanceNamespaceList(e,t){let i=this._namespaceList,n=this.namespacesByHostElement;if(i.length-1>=0){let o=!1,a=this.driver.getParentElement(t);for(;a;){let l=n.get(a);if(l){let c=i.indexOf(l);i.splice(c+1,0,e),o=!0;break}a=this.driver.getParentElement(a)}o||i.unshift(e)}else i.push(e);return n.set(t,e),e}register(e,t){let i=this._namespaceLookup[e];return i||(i=this.createNamespace(e,t)),i}registerTrigger(e,t,i){let n=this._namespaceLookup[e];n&&n.register(t,i)&&this.totalAnimations++}destroy(e,t){e&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let i=this._fetchNamespace(e);this.namespacesByHostElement.delete(i.hostElement);let n=this._namespaceList.indexOf(i);n>=0&&this._namespaceList.splice(n,1),i.destroy(t),delete this._namespaceLookup[e]}))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){let t=new Set,i=this.statesByElement.get(e);if(i){for(let n of i.values())if(n.namespaceId){let r=this._fetchNamespace(n.namespaceId);r&&t.add(r)}}return t}trigger(e,t,i,n){if(ke(t)){let r=this._fetchNamespace(e);if(r)return r.trigger(t,i,n),!0}return!1}insertNode(e,t,i,n){if(!ke(t))return;let r=t[B];if(r&&r.setForRemoval){r.setForRemoval=!1,r.setForMove=!0;let o=this.collectedLeaveElements.indexOf(t);o>=0&&this.collectedLeaveElements.splice(o,1)}if(e){let o=this._fetchNamespace(e);o&&o.insertNode(t,i)}n&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),L(e,ct)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),oe(e,ct))}removeNode(e,t,i){if(ke(t)){let n=e?this._fetchNamespace(e):null;n?n.removeNode(t,i):this.markElementAsRemoved(e,t,!1,i);let r=this.namespacesByHostElement.get(t);r&&r.id!==e&&r.removeNode(t,i)}else this._onRemovalComplete(t,i)}markElementAsRemoved(e,t,i,n,r){this.collectedLeaveElements.push(t),t[B]={namespaceId:e,setForRemoval:n,hasAnimation:i,removedBeforeQueried:!1,previousTriggersValues:r}}listen(e,t,i,n,r){return ke(t)?this._fetchNamespace(e).listen(t,i,n,r):()=>{}}_buildInstruction(e,t,i,n,r){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,i,n,e.fromState.options,e.toState.options,t,r)}destroyInnerAnimations(e){let t=this.driver.query(e,ue,!0);t.forEach(i=>this.destroyActiveAnimationsForElement(i)),this.playersByQueriedElement.size!=0&&(t=this.driver.query(e,Ne,!0),t.forEach(i=>this.finishActiveQueriedAnimationOnElement(i)))}destroyActiveAnimationsForElement(e){let t=this.playersByElement.get(e);t&&t.forEach(i=>{i.queued?i.markedForDestroy=!0:i.destroy()})}finishActiveQueriedAnimationOnElement(e){let t=this.playersByQueriedElement.get(e);t&&t.forEach(i=>i.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return V(this.players).onDone(()=>e());e()})}processLeaveNode(e){let t=e[B];if(t&&t.setForRemoval){if(e[B]=Ji,t.namespaceId){this.destroyInnerAnimations(e);let i=this._fetchNamespace(t.namespaceId);i&&i.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}e.classList?.contains(ct)&&this.markElementAsDisabled(e,!1),this.driver.query(e,Un,!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((i,n)=>this._balanceNamespaceList(i,n)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let i=0;i<this.collectedEnterElements.length;i++){let n=this.collectedEnterElements[i];L(n,Vn)}if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){let i=[];try{t=this._flushAnimations(i,e)}finally{for(let n=0;n<i.length;n++)i[n]()}}else for(let i=0;i<this.collectedLeaveElements.length;i++){let n=this.collectedLeaveElements[i];this.processLeaveNode(n)}if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(i=>i()),this._flushFns=[],this._whenQuietFns.length){let i=this._whenQuietFns;this._whenQuietFns=[],t.length?V(t).onDone(()=>{i.forEach(n=>n())}):i.forEach(n=>n())}}reportError(e){throw Ri(e)}_flushAnimations(e,t){let i=new me,n=[],r=new Map,o=[],a=new Map,l=new Map,c=new Map,h=new Set;this.disabledNodes.forEach(d=>{h.add(d);let f=this.driver.query(d,Qn,!0);for(let p=0;p<f.length;p++)h.add(f[p])});let u=this.bodyNode,_=Array.from(this.statesByElement.keys()),y=Gi(_,this.collectedEnterElements),m=new Map,g=0;y.forEach((d,f)=>{let p=st+g++;m.set(f,p),d.forEach(E=>L(E,p))});let T=[],w=new Set,b=new Set;for(let d=0;d<this.collectedLeaveElements.length;d++){let f=this.collectedLeaveElements[d],p=f[B];p&&p.setForRemoval&&(T.push(f),w.add(f),p.hasAnimation?this.driver.query(f,$n,!0).forEach(E=>w.add(E)):b.add(f))}let C=new Map,N=Gi(_,Array.from(w));N.forEach((d,f)=>{let p=Pe+g++;C.set(f,p),d.forEach(E=>L(E,p))}),e.push(()=>{y.forEach((d,f)=>{let p=m.get(f);d.forEach(E=>oe(E,p))}),N.forEach((d,f)=>{let p=C.get(f);d.forEach(E=>oe(E,p))}),T.forEach(d=>{this.processLeaveNode(d)})});let ie=[],q=[];for(let d=this._namespaceList.length-1;d>=0;d--)this._namespaceList[d].drainQueuedTransitions(t).forEach(p=>{let E=p.player,P=p.element;if(ie.push(E),this.collectedEnterElements.length){let M=P[B];if(M&&M.setForMove){if(M.previousTriggersValues&&M.previousTriggersValues.has(p.triggerName)){let Y=M.previousTriggersValues.get(p.triggerName),F=this.statesByElement.get(p.element);if(F&&F.has(p.triggerName)){let ge=F.get(p.triggerName);ge.value=Y,F.set(p.triggerName,ge)}}E.destroy();return}}let Q=!u||!this.driver.containsElement(u,P),I=C.get(P),$=m.get(P),A=this._buildInstruction(p,i,$,I,Q);if(A.errors&&A.errors.length){q.push(A);return}if(Q){E.onStart(()=>G(P,A.fromStyles)),E.onDestroy(()=>j(P,A.toStyles)),n.push(E);return}if(p.isFallbackTransition){E.onStart(()=>G(P,A.fromStyles)),E.onDestroy(()=>j(P,A.toStyles)),n.push(E);return}let Mt=[];A.timelines.forEach(M=>{M.stretchStartingKeyframe=!0,this.disabledNodes.has(M.element)||Mt.push(M)}),A.timelines=Mt,i.append(P,A.timelines);let ln={instruction:A,player:E,element:P};o.push(ln),A.queriedElements.forEach(M=>k(a,M,[]).push(E)),A.preStyleProps.forEach((M,Y)=>{if(M.size){let F=l.get(Y);F||l.set(Y,F=new Set),M.forEach((ge,$e)=>F.add($e))}}),A.postStyleProps.forEach((M,Y)=>{let F=c.get(Y);F||c.set(Y,F=new Set),M.forEach((ge,$e)=>F.add($e))})});if(q.length){let d=[];q.forEach(f=>{d.push(ki(f.triggerName,f.errors))}),ie.forEach(f=>f.destroy()),this.reportError(d)}let D=new Map,R=new Map;o.forEach(d=>{let f=d.element;i.has(f)&&(R.set(f,f),this._beforeAnimationBuild(d.player.namespaceId,d.instruction,D))}),n.forEach(d=>{let f=d.element;this._getPreviousPlayers(f,!1,d.namespaceId,d.triggerName,null).forEach(E=>{k(D,f,[]).push(E),E.destroy()})});let W=T.filter(d=>Wi(d,l,c)),ne=new Map;$i(ne,this.driver,b,c,K).forEach(d=>{Wi(d,l,c)&&W.push(d)});let H=new Map;y.forEach((d,f)=>{$i(H,this.driver,new Set(d),l,le)}),W.forEach(d=>{let f=ne.get(d),p=H.get(d);ne.set(d,new Map([...f?.entries()??[],...p?.entries()??[]]))});let Ve=[],Pt=[],Nt={};o.forEach(d=>{let{element:f,player:p,instruction:E}=d;if(i.has(f)){if(h.has(f)){p.onDestroy(()=>j(f,E.toStyles)),p.disabled=!0,p.overrideTotalTime(E.totalTime),n.push(p);return}let P=Nt;if(R.size>1){let I=f,$=[];for(;I=I.parentNode;){let A=R.get(I);if(A){P=A;break}$.push(I)}$.forEach(A=>R.set(A,P))}let Q=this._buildAnimation(p.namespaceId,E,D,r,H,ne);if(p.setRealPlayer(Q),P===Nt)Ve.push(p);else{let I=this.playersByElement.get(P);I&&I.length&&(p.parentPlayer=V(I)),n.push(p)}}else G(f,E.fromStyles),p.onDestroy(()=>j(f,E.toStyles)),Pt.push(p),h.has(f)&&n.push(p)}),Pt.forEach(d=>{let f=r.get(d.element);if(f&&f.length){let p=V(f);d.setRealPlayer(p)}}),n.forEach(d=>{d.parentPlayer?d.syncPlayerEvents(d.parentPlayer):d.destroy()});for(let d=0;d<T.length;d++){let f=T[d],p=f[B];if(oe(f,Pe),p&&p.hasAnimation)continue;let E=[];if(a.size){let Q=a.get(f);Q&&Q.length&&E.push(...Q);let I=this.driver.query(f,Ne,!0);for(let $=0;$<I.length;$++){let A=a.get(I[$]);A&&A.length&&E.push(...A)}}let P=E.filter(Q=>!Q.destroyed);P.length?xn(this,f,P):this.processLeaveNode(f)}return T.length=0,Ve.forEach(d=>{this.players.push(d),d.onDone(()=>{d.destroy();let f=this.players.indexOf(d);this.players.splice(f,1)}),d.play()}),Ve}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,i,n,r){let o=[];if(t){let a=this.playersByQueriedElement.get(e);a&&(o=a)}else{let a=this.playersByElement.get(e);if(a){let l=!r||r==de;a.forEach(c=>{c.queued||!l&&c.triggerName!=n||o.push(c)})}}return(i||n)&&(o=o.filter(a=>!(i&&i!=a.namespaceId||n&&n!=a.triggerName))),o}_beforeAnimationBuild(e,t,i){let n=t.triggerName,r=t.element,o=t.isRemovalTransition?void 0:e,a=t.isRemovalTransition?void 0:n;for(let l of t.timelines){let c=l.element,h=c!==r,u=k(i,c,[]);this._getPreviousPlayers(c,h,o,a,t.toState).forEach(y=>{let m=y.getRealPlayer();m.beforeDestroy&&m.beforeDestroy(),y.destroy(),u.push(y)})}G(r,t.fromStyles)}_buildAnimation(e,t,i,n,r,o){let a=t.triggerName,l=t.element,c=[],h=new Set,u=new Set,_=t.timelines.map(m=>{let g=m.element;h.add(g);let T=g[B];if(T&&T.removedBeforeQueried)return new X(m.duration,m.delay);let w=g!==l,b=Zn((i.get(g)||Gn).map(D=>D.getRealPlayer())).filter(D=>{let R=D;return R.element?R.element===g:!1}),C=r.get(g),N=o.get(g),ie=Je(this._normalizer,m.keyframes,C,N),q=this._buildPlayer(m,ie,b);if(m.subTimeline&&n&&u.add(g),w){let D=new pe(e,a,g);D.setRealPlayer(q),c.push(D)}return q});c.forEach(m=>{k(this.playersByQueriedElement,m.element,[]).push(m),m.onDone(()=>Hn(this.playersByQueriedElement,m.element,m))}),h.forEach(m=>L(m,rt));let y=V(_);return y.onDestroy(()=>{h.forEach(m=>oe(m,rt)),j(l,t.toStyles)}),u.forEach(m=>{k(n,m,[]).push(y)}),y}_buildPlayer(e,t,i){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,i):new X(e.duration,e.delay)}},pe=class{namespaceId;triggerName;element;_player=new X;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(e,t,i){this.namespaceId=e,this.triggerName=t,this.element=i}setRealPlayer(e){this._containsRealPlayer||(this._player=e,this._queuedCallbacks.forEach((t,i)=>{t.forEach(n=>Ae(e,i,void 0,n))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(e){this.totalTime=e}syncPlayerEvents(e){let t=this._player;t.triggerCallback&&e.onStart(()=>t.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,t){k(this._queuedCallbacks,e,[]).push(t)}onDone(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}onStart(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}onDestroy(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}init(){this._player.init()}hasStarted(){return this.queued?!1:this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(e){this.queued||this._player.setPosition(e)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(e){let t=this._player;t.triggerCallback&&t.triggerCallback(e)}};function Hn(s,e,t){let i=s.get(e);if(i){if(i.length){let n=i.indexOf(t);i.splice(n,1)}i.length==0&&s.delete(e)}return i}function Yn(s){return s??null}function ke(s){return s&&s.nodeType===1}function Xn(s){return s=="start"||s=="done"}function Vi(s,e){let t=s.style.display;return s.style.display=e??"none",t}function $i(s,e,t,i,n){let r=[];t.forEach(l=>r.push(Vi(l)));let o=[];i.forEach((l,c)=>{let h=new Map;l.forEach(u=>{let _=e.computeStyle(c,u,n);h.set(u,_),(!_||_.length==0)&&(c[B]=Wn,o.push(c))}),s.set(c,h)});let a=0;return t.forEach(l=>Vi(l,r[a++])),o}function Gi(s,e){let t=new Map;if(s.forEach(a=>t.set(a,[])),e.length==0)return t;let i=1,n=new Set(e),r=new Map;function o(a){if(!a)return i;let l=r.get(a);if(l)return l;let c=a.parentNode;return t.has(c)?l=c:n.has(c)?l=i:l=o(c),r.set(a,l),l}return e.forEach(a=>{let l=o(a);l!==i&&t.get(l).push(a)}),t}function L(s,e){s.classList?.add(e)}function oe(s,e){s.classList?.remove(e)}function xn(s,e,t){V(t).onDone(()=>s.processLeaveNode(e))}function Zn(s){let e=[];return en(s,e),e}function en(s,e){for(let t=0;t<s.length;t++){let i=s[t];i instanceof ve?en(i.players,e):e.push(i)}}function Jn(s,e){let t=Object.keys(s),i=Object.keys(e);if(t.length!=i.length)return!1;for(let n=0;n<t.length;n++){let r=t[n];if(!e.hasOwnProperty(r)||s[r]!==e[r])return!1}return!0}function Wi(s,e,t){let i=t.get(s);if(!i)return!1;let n=e.get(s);return n?i.forEach(r=>n.add(r)):e.set(s,i),t.delete(s),!0}var ae=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(e,t)=>{};constructor(e,t,i){this._driver=t,this._normalizer=i,this._transitionEngine=new vt(e.body,t,i),this._timelineEngine=new St(e.body,t,i),this._transitionEngine.onRemovalComplete=(n,r)=>this.onRemovalComplete(n,r)}registerTrigger(e,t,i,n,r){let o=e+"-"+n,a=this._triggerCache[o];if(!a){let l=[],c=[],h=Xi(this._driver,r,l,c);if(l.length)throw Ti(n,l);a=jn(n,h,this._normalizer),this._triggerCache[o]=a}this._transitionEngine.registerTrigger(t,n,a)}register(e,t){this._transitionEngine.register(e,t)}destroy(e,t){this._transitionEngine.destroy(e,t)}onInsert(e,t,i,n){this._transitionEngine.insertNode(e,t,i,n)}onRemove(e,t,i){this._transitionEngine.removeNode(e,t,i)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,i,n){if(i.charAt(0)=="@"){let[r,o]=et(i),a=n;this._timelineEngine.command(r,t,o,a)}else this._transitionEngine.trigger(e,t,i,n)}listen(e,t,i,n,r){if(i.charAt(0)=="@"){let[o,a]=et(i);return this._timelineEngine.listen(o,t,a,r)}return this._transitionEngine.listen(e,t,i,n,r)}flush(e=-1){this._transitionEngine.flush(e)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(e){this._transitionEngine.afterFlushAnimationsDone(e)}};function es(s,e){let t=null,i=null;return Array.isArray(e)&&e.length?(t=ht(e[0]),e.length>1&&(i=ht(e[e.length-1]))):e instanceof Map&&(t=ht(e)),t||i?new ts(s,t,i):null}var ts=(()=>{class s{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(t,i,n){this._element=t,this._startStyles=i,this._endStyles=n;let r=s.initialStylesByElement.get(t);r||s.initialStylesByElement.set(t,r=new Map),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&j(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(j(this._element,this._initialStyles),this._endStyles&&(j(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(s.initialStylesByElement.delete(this._element),this._startStyles&&(G(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(G(this._element,this._endStyles),this._endStyles=null),j(this._element,this._initialStyles),this._state=3)}}return s})();function ht(s){let e=null;return s.forEach((t,i)=>{is(i)&&(e=e||new Map,e.set(i,t))}),e}function is(s){return s==="display"||s==="position"}var je=class{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer=null;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(e,t,i,n){this.element=e,this.keyframes=t,this.options=i,this._specialStyles=n,this._duration=i.duration,this._delay=i.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this._buildPlayer()&&this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return this.domPlayer;this._initialized=!0;let e=this.keyframes,t=this._triggerWebAnimation(this.element,e,this.options);if(!t)return this._onFinish(),null;this.domPlayer=t,this._finalKeyframe=e.length?e[e.length-1]:new Map;let i=()=>this._onFinish();return t.addEventListener("finish",i),this.onDestroy(()=>{t.removeEventListener("finish",i)}),t}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer?.pause()}_convertKeyframesToObject(e){let t=[];return e.forEach(i=>{t.push(Object.fromEntries(i))}),t}_triggerWebAnimation(e,t,i){let n=this._convertKeyframesToObject(t);try{return e.animate(n,i)}catch(r){return null}}onStart(e){this._originalOnStartFns.push(e),this._onStartFns.push(e)}onDone(e){this._originalOnDoneFns.push(e),this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){let e=this._buildPlayer();e&&(this.hasStarted()||(this._onStartFns.forEach(t=>t()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),e.play())}pause(){this.init(),this.domPlayer?.pause()}finish(){this.init(),this.domPlayer&&(this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish())}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}_resetDomPlayerState(){this.domPlayer?.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}setPosition(e){this.domPlayer||this.init(),this.domPlayer&&(this.domPlayer.currentTime=e*this.time)}getPosition(){return this.domPlayer?+(this.domPlayer.currentTime??0)/this.time:this._initialized?1:0}get totalTime(){return this._delay+this._duration}beforeDestroy(){let e=new Map;this.hasStarted()&&this._finalKeyframe.forEach((i,n)=>{n!=="offset"&&e.set(n,this._finished?i:Ce(this.element,n))}),this.currentSnapshot=e}triggerCallback(e){let t=e==="start"?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}},Be=class{validateStyleProperty(e){return!0}validateAnimatableStyleProperty(e){return!0}containsElement(e,t){return tt(e,t)}getParentElement(e){return be(e)}query(e,t,i){return it(e,t,i)}computeStyle(e,t,i){return Ce(e,t)}animate(e,t,i,n,r,o=[]){let a=n==0?"both":"forwards",l={duration:i,delay:n,fill:a};r&&(l.easing=r);let c=new Map,h=o.filter(y=>y instanceof je);Li(i,n)&&h.forEach(y=>{y.currentSnapshot.forEach((m,g)=>c.set(g,m))});let u=Ii(t).map(y=>new Map(y));u=zi(e,u,c);let _=es(e,u);return new je(e,u,l,_)}};var Oe="@",tn="@.disabled",qe=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(e,t,i,n){this.namespaceId=e,this.delegate=t,this.engine=i,this._onDestroy=n}get data(){return this.delegate.data}destroyNode(e){this.delegate.destroyNode?.(e)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(e,t){return this.delegate.createElement(e,t)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,t){this.delegate.appendChild(e,t),this.engine.onInsert(this.namespaceId,t,e,!1)}insertBefore(e,t,i,n=!0){this.delegate.insertBefore(e,t,i),this.engine.onInsert(this.namespaceId,t,e,n)}removeChild(e,t,i,n){if(n){this.delegate.removeChild(e,t,i,n);return}this.parentNode(t)&&this.engine.onRemove(this.namespaceId,t,this.delegate)}selectRootElement(e,t){return this.delegate.selectRootElement(e,t)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,t,i,n){this.delegate.setAttribute(e,t,i,n)}removeAttribute(e,t,i){this.delegate.removeAttribute(e,t,i)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,i,n){this.delegate.setStyle(e,t,i,n)}removeStyle(e,t,i){this.delegate.removeStyle(e,t,i)}setProperty(e,t,i){t.charAt(0)==Oe&&t==tn?this.disableAnimations(e,!!i):this.delegate.setProperty(e,t,i)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,i,n){return this.delegate.listen(e,t,i,n)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}},Tt=class extends qe{factory;constructor(e,t,i,n,r){super(t,i,n,r),this.factory=e,this.namespaceId=t}setProperty(e,t,i){t.charAt(0)==Oe?t.charAt(1)=="."&&t==tn?(i=i===void 0?!0:!!i,this.disableAnimations(e,i)):this.engine.process(this.namespaceId,e,t.slice(1),i):this.delegate.setProperty(e,t,i)}listen(e,t,i,n){if(t.charAt(0)==Oe){let r=ns(e),o=t.slice(1),a="";return o.charAt(0)!=Oe&&([o,a]=ss(o)),this.engine.listen(this.namespaceId,r,o,a,l=>{let c=l._data||-1;this.factory.scheduleListenerCallback(c,i,l)})}return this.delegate.listen(e,t,i,n)}};function ns(s){switch(s){case"body":return document.body;case"document":return document;case"window":return window;default:return s}}function ss(s){let e=s.indexOf("."),t=s.substring(0,e),i=s.slice(e+1);return[t,i]}var Qe=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(e,t,i){this.delegate=e,this.engine=t,this._zone=i,t.onRemovalComplete=(n,r)=>{r?.removeChild(null,n)}}createRenderer(e,t){let n=this.delegate.createRenderer(e,t);if(!e||!t?.data?.animation){let c=this._rendererCache,h=c.get(n);if(!h){let u=()=>c.delete(n);h=new qe("",n,this.engine,u),c.set(n,h)}return h}let r=t.id,o=t.id+"-"+this._currentId;this._currentId++,this.engine.register(o,e);let a=c=>{Array.isArray(c)?c.forEach(a):this.engine.registerTrigger(r,o,e,c.name,c)};return t.data.animation.forEach(a),new Tt(this,o,n,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(e,t,i){if(e>=0&&e<this._microtaskId){this._zone.run(()=>t(i));return}let n=this._animationCallbacksBuffer;n.length==0&&queueMicrotask(()=>{this._zone.run(()=>{n.forEach(r=>{let[o,a]=r;o(a)}),this._animationCallbacksBuffer=[]})}),n.push([t,i])}end(){this._cdRecurDepth--,this._cdRecurDepth==0&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}componentReplaced(e){this.engine.flush(),this.delegate.componentReplaced?.(e)}};var os=(()=>{class s extends ae{constructor(t,i,n){super(t,i,n)}ngOnDestroy(){this.flush()}static \u0275fac=function(i){return new(i||s)(Ee(zt),Ee(J),Ee(ee))};static \u0275prov=Se({token:s,factory:s.\u0275fac})}return s})();function as(){return new Ie}function ls(){return new Qe(z(Gt),z(ae),z(Kt))}var nn=[{provide:ee,useFactory:as},{provide:ae,useClass:os},{provide:qt,useFactory:ls}],ks=[{provide:J,useClass:At},{provide:We,useValue:"NoopAnimations"},...nn],cs=[{provide:J,useFactory:()=>new Be},{provide:We,useFactory:()=>"BrowserAnimations"},...nn];function sn(){return Bt("NgEagerAnimations"),[...cs]}var te=s=>_e(null,null,function*(){let e=z(Te),t=s.params.projectName;return t?e.getSelectedProjectId()===t?!0:(e.selectProject(t),(yield Dt(e.selectedProject$.pipe(Ft(n=>n?.name===t))))?.name===t):(console.log("[PROJECT GUARD] no project id in route"),!1)});var rn=s=>_e(null,null,function*(){let e=z(ii),t=z(ni),i=s.params.threadId;if(!t.getUsername())try{yield Ge(t.fetchCurrentUser())}catch(n){console.error("[THREAD GUARD] Failed to load current user:",n)}if(!i)return console.log("[THREAD GUARD] no threadId in route"),!1;if(console.log("[THREAD GUARD] Checking thread:",i),console.log("[THREAD GUARD] Current selected thread:",e.getSelectedThreadId()),e.getSelectedThreadId()===i)return console.log("[THREAD GUARD] Thread already selected, allowing navigation"),!0;console.log("[THREAD GUARD] Selecting thread:",i),e.selectThread(i);try{let n=yield Ge(kt([e.isLoading$,e.selectedThread$]).pipe(Lt(([o,a])=>console.log(`\u{1F43C} [${o?"loading":"loaded"}]`,a?.id)),Ot(([o,a])=>!o&&!!a),It(1),Rt(([o,a])=>a?.id))),r=n===i;return r?console.log("[THREAD GUARD] Thread validated, allowing navigation"):console.error("[THREAD GUARD] Thread ID mismatch - route:",i,"loaded:",n),r}catch(n){return console.error("[THREAD GUARD] Error loading thread:",n),!1}});var on=[{path:"",loadComponent:()=>import("./chunk-L75REITS.js").then(s=>s.GlobalTaskControlComponent)},{path:"projects",loadComponent:()=>import("./chunk-IO7Y6AGH.js").then(s=>s.ProjectListComponent)},{path:"oauth/callback",loadComponent:()=>import("./chunk-PQK52BSF.js").then(s=>s.OAuthCallbackComponent)},{path:"project/new",loadComponent:()=>import("./chunk-GX3AY74Y.js").then(s=>s.ProjectNewComponent)},{path:"project/:projectName",loadComponent:()=>import("./chunk-VTAI3MOF.js").then(s=>s.MainAppComponent),canActivate:[te]},{path:"project/:projectName/prompts",loadComponent:()=>import("./chunk-UT7VOSQ7.js").then(s=>s.PromptListComponent),canActivate:[te]},{path:"project/:projectName/schedulers",loadComponent:()=>import("./chunk-OONW44HQ.js").then(s=>s.SchedulerListComponent),canActivate:[te]},{path:"project/:projectName/agents",loadComponent:()=>import("./chunk-UL3MSBXV.js").then(s=>s.AgentListComponent),canActivate:[te]},{path:"project/:projectName/tasks",loadComponent:()=>import("./chunk-H76XRLTE.js").then(s=>s.TaskControlComponent),canActivate:[te]},{path:"project/:projectName/missions",redirectTo:"project/:projectName/tasks"},{path:"project/:projectName/thread/:threadId",loadComponent:()=>import("./chunk-VTAI3MOF.js").then(s=>s.MainAppComponent),canActivate:[te,rn]},{path:"token-usage",loadComponent:()=>import("./chunk-QUJXN3NC.js").then(s=>s.TokenUsageComponent)},{path:"agentos",loadChildren:()=>import("./chunk-5K34TKOT.js").then(s=>s.AGENTOS_ROUTES)},{path:"**",redirectTo:""}];function us(s){return()=>s.initializeDefaultProject()}function hs(s){return()=>{console.log("[APP_INIT] OAuthService initialized")}}var an={providers:[jt(),Vt({eventCoalescing:!0}),Xt(on),Ht(),sn(),{provide:ei,useValue:{duration:3e3}},{provide:He,useFactory:us,deps:[Te],multi:!0},{provide:He,useFactory:hs,deps:[ri],multi:!0},ti({basePath:"/api/agentos"}),{provide:Jt,useValue:{width:"80vw",maxWidth:"80vw",maxHeight:"80vh"}}]};var Ue=class s{title="client";themeService=z(si);ngOnInit(){console.log("[APP] Application initialized with theme:",this.themeService.getCurrentTheme())}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=Qt({type:s,selectors:[["app-root"]],decls:1,vars:0,template:function(t,i){t&1&&Ut(0,"router-outlet")},dependencies:[xt,Yt],encapsulation:2})};Wt(Ue,an).catch(s=>console.error(s));"serviceWorker"in navigator&&!$t()&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(s=>console.error("[SW] Registration failed:",s))});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whoz-oss/coday-client",
3
- "version": "0.171.2",
3
+ "version": "0.172.0",
4
4
  "repository": "https://github.com/whoz-oss/coday",
5
5
  "type": "module",
6
6
  "dependencies": {
@@ -1,2 +0,0 @@
1
- import{a as Fe,b as Ke,c as Z}from"./chunk-7VBWPMKN.js";import{a as He}from"./chunk-Q75AFBTG.js";import{d as Je}from"./chunk-NBI5KRAV.js";import{a as Ue}from"./chunk-MUX7LGIM.js";import{a as q,b as $,c as Pe,d as je,f as Xe,h as Ze}from"./chunk-KLKORS6D.js";import"./chunk-FPNEFWYN.js";import"./chunk-CPPSTTTC.js";import{a as ve,b as Ce,c as ke,e as Ie,l as Ae,o as Re,q as Ge,v as Ve,w as Qe}from"./chunk-ZZTT5MET.js";import"./chunk-SLBKHVIO.js";import"./chunk-XYYLNQXO.js";import{d as ce,e as de}from"./chunk-4GVABYH4.js";import"./chunk-CBYR4M6L.js";import{a as qe,b as $e,c as Be}from"./chunk-V5O7FKAM.js";import{a as ze,b as We}from"./chunk-FSOL3ALS.js";import"./chunk-TIMFZNT6.js";import"./chunk-MOG6OBSN.js";import{c as Ye}from"./chunk-YNZD2HBV.js";import{a as Te,c as ye,d as Se,e as Me,j as Le}from"./chunk-VDRETD5H.js";import{a as xe,b as we,c as Oe,e as De,f as B,i as z,j as W,m as U,n as H}from"./chunk-BUA6GPP7.js";import{a as Ne,c as P}from"./chunk-V363EHJE.js";import{a as me,d as A,e as ge,f as ue,g as _e,h as he}from"./chunk-6CNI4FAD.js";import"./chunk-Z7E7NSDY.js";import{a as F,b as L}from"./chunk-ZEMOOOQR.js";import{E as Ee}from"./chunk-HZF57OLY.js";import{a as be,b as V}from"./chunk-5URVSSXV.js";import{O as fe,Q as R,S as G,n as pe}from"./chunk-EF2BOSEH.js";import{Bb as x,Db as u,Fb as p,Ja as K,Jb as oe,Ka as c,Kb as re,Lb as ae,Pb as S,Qb as se,Rb as y,Tb as l,Tc as le,Ub as b,Vb as j,Wa as N,Z as E,a as O,b as D,ca as h,ga as m,ha as g,jb as Y,kc as v,lb as C,ma as ie,mb as k,ob as I,pb as w,qb as T,rb as f,s as te,sb as o,t as ne,ta as _,tb as s,ub as M}from"./chunk-B4RKRLIY.js";var lt=(r,t)=>t.name;function ct(r,t){if(r&1&&(o(0,"mat-option",11),l(1),s()),r&2){let e=t.$implicit;f("value",e),c(),b(e)}}function dt(r,t){r&1&&M(0,"mat-spinner",13)}function pt(r,t){if(r&1&&(o(0,"span",20),l(1),s()),r&2){let e=p().$implicit;c(),b(e.description)}}function mt(r,t){if(r&1&&(o(0,"mat-option",11)(1,"span",19),l(2),s(),C(3,pt,2,1,"span",20),s()),r&2){let e=t.$implicit;f("value",e.name),c(2),b(e.name),c(),k(e.description?3:-1)}}function gt(r,t){if(r&1&&(o(0,"mat-option",11),l(1),s()),r&2){let e=t.$implicit;f("value",e),c(),b(e)}}function ut(r,t){if(r&1){let e=x();o(0,"div",25)(1,"mat-form-field",8)(2,"mat-label"),l(3,"Name"),s(),o(4,"input",26),u("input",function(i){m(e);let a=p(2);return g(a.issueNumber.set(i.target.value))}),s()(),o(5,"mat-form-field",27)(6,"mat-label"),l(7,"Type"),s(),o(8,"mat-select",28),u("selectionChange",function(i){m(e);let a=p(2);return g(a.branchType.set(i.value))}),w(9,gt,2,2,"mat-option",11,I),s()()()}if(r&2){let e=p(2);c(4),f("value",e.issueNumber()),c(4),f("value",e.branchType()),c(),T(e.branchTypes)}}function _t(r,t){r&1&&M(0,"mat-spinner",13)}function ht(r,t){if(r&1&&(o(0,"mat-option",11),l(1),s()),r&2){let e=t.$implicit;f("value",e),c(),b(e)}}function ft(r,t){if(r&1){let e=x();o(0,"mat-form-field",8)(1,"mat-label"),l(2,"Source branch"),s(),o(3,"input",29,4),u("input",function(i){m(e);let a=p(2);return g(a.onBranchSearchInput(i.target.value))})("focus",function(){m(e);let i=S(4),a=p(2);return g(a.openPanel(i))}),s(),C(5,_t,1,0,"mat-spinner",13),o(6,"mat-autocomplete",10,5),u("optionSelected",function(i){m(e);let a=p(2);return g(a.selectBranch(i.option.value))}),w(8,ht,2,2,"mat-option",11,I),s()()}if(r&2){let e=S(7),n=p(2);c(3),f("value",n.branchSearch())("matAutocomplete",e)("disabled",n.isLoadingBranches()),c(2),k(n.isLoadingBranches()?5:-1),c(3),T(n.filteredBranches())}}function bt(r,t){if(r&1){let e=x();o(0,"div",21)(1,"button",22),u("click",function(){m(e);let i=p();return g(i.onModeChange("local"))}),o(2,"mat-icon"),l(3,"folder_open"),s(),o(4,"span",23),l(5,"Local"),s(),o(6,"span",24),l(7,"Work directly on the current branch"),s()(),o(8,"button",22),u("click",function(){m(e);let i=p();return g(i.onModeChange("worktree"))}),o(9,"mat-icon"),l(10,"account_tree"),s(),o(11,"span",23),l(12,"Worktree"),s(),o(13,"span",24),l(14,"Create an isolated worktree from a branch"),s()()(),C(15,ut,11,2,"div",25),C(16,ft,10,4,"mat-form-field",8)}if(r&2){let e=p();c(),y("active",e.mode()==="local"),c(7),y("active",e.mode()==="worktree"),c(7),k(e.isWorktree()?15:-1),c(),k(e.isWorktree()?16:-1)}}function vt(r,t){r&1&&M(0,"mat-spinner",18)}function Ct(r,t){r&1&&(o(0,"mat-icon"),l(1,"rocket_launch"),s())}function kt(r,t){r&1&&(o(0,"mat-icon"),l(1,"open_in_new"),s())}var Q=class r{projectApi=h(be);agentApi=h(Ue);dialogRef=h(me);projectState=h(V);forcedProject=P(this.projectState.forcedProject$,{initialValue:null});selectedProject=_("");projectSearch=_("");selectedAgent=_("");agentSearch=_("");mode=_("local");selectedBranch=_("");branchSearch=_("");issueNumber=_("");branchType=_("feature");task=_("");hasGit=_(!1);branchTypes=["feature","fix","refactor","chore","docs","build"];projects=_([]);agents=_([]);branches=_([]);filteredProjects=v(()=>{let t=this.projectSearch().toLowerCase();return t?this.projects().filter(e=>e.toLowerCase().includes(t)):this.projects()});filteredAgents=v(()=>{let t=this.agentSearch().toLowerCase();return t?this.agents().filter(e=>e.name.toLowerCase().includes(t)||e.description?.toLowerCase().includes(t)):this.agents()});filteredBranches=v(()=>{let t=this.branchSearch().toLowerCase();return t?this.branches().filter(e=>e.toLowerCase().includes(t)):this.branches()});isLoadingAgents=_(!1);isLoadingBranches=_(!1);isSubmitting=_(!1);isWorktree=v(()=>this.mode()==="worktree"&&this.hasGit());isValid=v(()=>{let t=this.projects().includes(this.selectedProject()),e=this.agents().some(i=>i.name===this.selectedAgent()),n=t&&e&&!!this.task().trim();return this.isWorktree()?n&&!!this.selectedBranch()&&!!this.issueNumber().trim()&&!!this.branchType():n});canNavigate=v(()=>this.projects().includes(this.selectedProject()));openPanel(t){t.openPanel()}onProjectSearchInput(t){this.projectSearch.set(t),this.selectedProject()&&t!==this.selectedProject()&&(this.selectedProject.set(""),this.selectedAgent.set(""),this.agentSearch.set(""),this.agents.set([]))}selectProject(t){this.selectedProject.set(t),this.projectSearch.set(t),this.selectedAgent.set(""),this.agentSearch.set(""),this.agents.set([]),this.branches.set([]),this.selectedBranch.set(""),this.branchSearch.set(""),this.hasGit.set(!1),this.mode.set("local"),this.isLoadingAgents.set(!0),this.agentApi.getAgents(t).subscribe({next:e=>{this.agents.set(e),this.isLoadingAgents.set(!1)},error:()=>{this.isLoadingAgents.set(!1)}}),this.projectApi.getGitBranches(t).subscribe({next:({branches:e})=>{this.hasGit.set(e.length>0)},error:()=>{this.hasGit.set(!1)}})}onAgentSearchInput(t){this.agentSearch.set(t),this.selectedAgent()&&t!==this.selectedAgent()&&this.selectedAgent.set("")}selectAgent(t){this.selectedAgent.set(t),this.agentSearch.set(t)}onBranchSearchInput(t){this.branchSearch.set(t),this.selectedBranch()&&t!==this.selectedBranch()&&this.selectedBranch.set("")}selectBranch(t){this.selectedBranch.set(t),this.branchSearch.set(t)}ngOnInit(){this.projectApi.listProjects().subscribe({next:({projects:t})=>{let e=t.map(n=>n.name);this.projects.set(e),e.length===1&&e[0]&&this.selectProject(e[0])}})}onProjectChange(t){this.selectProject(t)}onModeChange(t){this.mode.set(t),t==="worktree"&&this.selectedProject()&&this.branches().length===0&&this.loadBranches()}loadBranches(){this.isLoadingBranches.set(!0),this.projectApi.getGitBranches(this.selectedProject()).subscribe({next:({branches:t})=>{this.branches.set(t),this.isLoadingBranches.set(!1)},error:()=>{this.isLoadingBranches.set(!1)}})}submit(){if(!this.isSubmitting()){if(this.isValid()){this.isSubmitting.set(!0);let t=this.isWorktree()&&this.issueNumber().trim()?`${this.issueNumber().trim()} ${this.task().trim()}`:this.task().trim();this.projectApi.createTask(this.selectedProject(),this.selectedAgent(),t,this.isWorktree()?"worktree":"local",this.isWorktree()?this.selectedBranch():void 0,this.isWorktree()?this.issueNumber().trim():void 0,this.isWorktree()?this.branchType():void 0).subscribe({next:({threadId:e,projectId:n})=>{this.dialogRef.close({threadId:e,projectId:n})},error:()=>{this.isSubmitting.set(!1)}});return}if(this.canNavigate()){this.dialogRef.close({projectId:this.selectedProject(),navigate:!0});return}}}cancel(){this.dialogRef.close(null)}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=N({type:r,selectors:[["app-new-task-dialog"]],decls:37,vars:12,consts:[["projectTrigger","matAutocompleteTrigger"],["projectAuto",""],["agentTrigger","matAutocompleteTrigger"],["agentAuto",""],["branchTrigger","matAutocompleteTrigger"],["branchAuto",""],["mat-dialog-title",""],[1,"ntd-content"],["appearance","outline",1,"ntd-field"],["matInput","","placeholder","Search project...",3,"input","focus","value","matAutocomplete"],[3,"optionSelected"],[3,"value"],["matInput","","placeholder","Search agent...",3,"input","focus","value","matAutocomplete","disabled"],["matSuffix","","diameter","16"],["matInput","","placeholder","Describe what the agent should accomplish...","rows","4",3,"input","value"],["align","end"],["mat-button","",3,"click","disabled"],["mat-flat-button","",1,"ntd-launch-btn",3,"click","disabled"],["diameter","16"],[1,"ntd-agent-name"],[1,"ntd-agent-desc"],[1,"ntd-radio-group"],["type","button",1,"ntd-mode-btn",3,"click"],[1,"ntd-radio-label"],[1,"ntd-radio-hint"],[1,"ntd-row"],["matInput","","type","text","placeholder","Name",3,"input","value"],["appearance","outline",1,"ntd-field","ntd-field--small"],[3,"selectionChange","value"],["matInput","","placeholder","Search branch...",3,"input","focus","value","matAutocomplete","disabled"]],template:function(e,n){if(e&1){let i=x();o(0,"h2",6)(1,"mat-icon"),l(2,"rocket_launch"),s(),l(3,` New Task
2
- `),s(),o(4,"mat-dialog-content",7)(5,"mat-form-field",8)(6,"mat-label"),l(7,"Project"),s(),o(8,"input",9,0),u("input",function(d){return n.onProjectSearchInput(d.target.value)})("focus",function(){m(i);let d=S(9);return g(n.openPanel(d))}),s(),o(10,"mat-autocomplete",10,1),u("optionSelected",function(d){return n.selectProject(d.option.value)}),w(12,ct,2,2,"mat-option",11,I),s()(),o(14,"mat-form-field",8)(15,"mat-label"),l(16,"Agent"),s(),o(17,"input",12,2),u("input",function(d){return n.onAgentSearchInput(d.target.value)})("focus",function(){m(i);let d=S(18);return g(n.openPanel(d))}),s(),C(19,dt,1,0,"mat-spinner",13),o(20,"mat-autocomplete",10,3),u("optionSelected",function(d){return n.selectAgent(d.option.value)}),w(22,mt,4,3,"mat-option",11,lt),s()(),C(24,bt,17,6),o(25,"mat-form-field",8)(26,"mat-label"),l(27,"Task"),s(),o(28,"textarea",14),u("input",function(d){return n.task.set(d.target.value)}),s()()(),o(29,"mat-dialog-actions",15)(30,"button",16),u("click",function(){return n.cancel()}),l(31,"Cancel"),s(),o(32,"button",17),u("click",function(){return n.submit()}),C(33,vt,1,0,"mat-spinner",18)(34,Ct,2,0,"mat-icon")(35,kt,2,0,"mat-icon"),l(36),s()()}if(e&2){let i=S(11),a=S(21);c(8),f("value",n.projectSearch())("matAutocomplete",i),c(4),T(n.filteredProjects()),c(5),f("value",n.agentSearch())("matAutocomplete",a)("disabled",!n.selectedProject()||n.isLoadingAgents()),c(2),k(n.isLoadingAgents()?19:-1),c(3),T(n.filteredAgents()),c(2),k(n.hasGit()&&!n.forcedProject()?24:-1),c(4),f("value",n.task()),c(2),f("disabled",n.isSubmitting()),c(2),f("disabled",!n.canNavigate()||n.isSubmitting()),c(),k(n.isSubmitting()?33:n.isValid()?34:35),c(3),j(" ",n.isValid()?"Launch":"Open"," ")}},dependencies:[Ee,he,ge,_e,ue,G,R,W,z,Oe,B,H,U,Be,qe,Le,$e,We,ze,$,q,L,F],styles:["h2[mat-dialog-title][_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:0}.ntd-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;padding-top:20px!important}.ntd-field[_ngcontent-%COMP%]{width:100%}.ntd-row[_ngcontent-%COMP%]{display:flex;gap:.75rem}.ntd-row[_ngcontent-%COMP%] .ntd-field--small[_ngcontent-%COMP%]{width:130px;flex-shrink:0}.ntd-radio-group[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding:.25rem 0 .75rem}.ntd-mode-btn[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;align-items:flex-start;gap:.15rem;padding:.75rem;border:1px solid var(--color-border);border-radius:8px;background:transparent;color:var(--color-text);cursor:pointer;transition:border-color .15s,background .15s}.ntd-mode-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.1rem;width:1.1rem;height:1.1rem;margin-bottom:.1rem}.ntd-mode-btn.active[_ngcontent-%COMP%]{border-color:var(--color-primary);background:color-mix(in srgb,var(--color-primary) 10%,transparent)}.ntd-mode-btn[_ngcontent-%COMP%]:hover:not(.active){border-color:var(--color-text-secondary)}.ntd-radio-label[_ngcontent-%COMP%]{font-weight:600;font-size:.9rem}.ntd-radio-hint[_ngcontent-%COMP%]{font-size:.72rem;color:var(--color-text-secondary);line-height:1.3;text-align:left}.ntd-agent-name[_ngcontent-%COMP%]{font-weight:500;display:block}.ntd-agent-desc[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:380px}.ntd-launch-btn[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse)}.ntd-launch-btn[_ngcontent-%COMP%]:disabled{background:var(--color-border);color:var(--color-text-secondary);opacity:.6;cursor:not-allowed}"]})};var X=class r{http=h(le);threadApi=h(ve);isLoading=_(!1);tasks=_([]);refresh(){this.isLoading.set(!0),this.threadApi.listAllThreads().pipe(te(15e3)).subscribe({next:t=>{let e=t.filter(n=>!n.parentThreadId).map(n=>({id:n.id,name:n.name,summary:n.summary,modifiedDate:n.modifiedDate,starring:n.starring??[],users:n.users??[],isActive:!1,status:this.deriveStatus(n),projectId:n.projectId,worktreeProject:n.worktreeProject}));this.tasks.set(this.sorted(e)),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1)}})}applyStatusEvent(t,e){let n=e==="invite"?"waiting-you":"in-progress";this.tasks.update(i=>this.sorted(i.map(a=>a.id===t?D(O({},a),{status:n}):a)))}closeTask(t,e){this.tasks.update(n=>n.filter(i=>i.id!==e)),this.http.delete(`/api/projects/${t}/missions/${e}`).subscribe({next:()=>this.refresh(),error:n=>{console.error("[GLOBAL-TC] Failed to close task:",n),this.refresh()}})}stopThread(t,e){this.http.post(`/api/projects/${t}/threads/${e}/stop`,{}).subscribe({error:n=>console.error("[GLOBAL-TC] Failed to stop thread:",n)})}deleteThread(t,e){this.tasks.update(n=>n.filter(i=>i.id!==e)),this.http.delete(`/api/projects/${t}/threads/${e}`).subscribe({next:()=>this.refresh(),error:n=>{console.error("[GLOBAL-TC] Failed to delete thread:",n),this.refresh()}})}toggleStar(t,e,n){let i=`/api/projects/${t}/threads/${e}/star`;(n?this.http.delete(i):this.http.post(i,{})).subscribe({next:()=>this.refresh(),error:d=>console.error("[GLOBAL-TC] Failed to toggle star:",d)})}markTaskDone(t,e){this.http.post(`/api/projects/${t}/threads/${e}/done`,{}).subscribe({next:()=>this.refresh(),error:n=>console.error("[GLOBAL-TC] Failed to mark task as done:",n)})}markTaskActive(t,e){this.http.delete(`/api/projects/${t}/threads/${e}/done`).subscribe({next:()=>this.refresh(),error:n=>console.error("[GLOBAL-TC] Failed to mark task as active:",n)})}deriveStatus(t){return t.closedByUser?"done":t.pendingInvite?"waiting-you":Date.now()-new Date(t.modifiedDate).getTime()<Ke?"in-progress":"paused"}sorted(t){return[...t].sort((e,n)=>{let i=Z[e.status]-Z[n.status];return i!==0?i:e.modifiedDate>n.modifiedDate?-1:1})}static \u0275fac=function(e){return new(e||r)};static \u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})};var J=class r{configApi=h(Ye);dialog=h(A);openUserConfigEditor(){this.configApi.getUserConfig().subscribe({next:t=>{this.dialog.open(Ze,{data:{configType:"user",initialContent:JSON.stringify(t,null,2)}}).afterClosed().subscribe(n=>{n&&this.configApi.updateUserConfig(n).subscribe({error:i=>console.error("[CONFIG-STATE] Error saving user config:",i)})})},error:t=>console.error("[CONFIG-STATE] Error loading user config:",t)})}static \u0275fac=function(e){return new(e||r)};static \u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})};var xt=["layoutContainer"],wt=(r,t)=>t.key,Tt=(r,t)=>t.name,yt=(r,t)=>t.status,tt=(r,t)=>t.id;function St(r,t){if(r&1){let e=x();o(0,"button",30),u("click",function(){m(e);let i=p();return g(i.clearSearch())}),o(1,"mat-icon"),l(2,"close"),s()()}}function Mt(r,t){if(r&1){let e=x();o(0,"button",31),u("click",function(){let i=m(e).$implicit,a=p(2);return g(a.setProject(i.name))}),l(1),o(2,"span",32),l(3),s()()}if(r&2){let e=t.$implicit,n=p(2);y("active",n.activeProject()===e.name),c(),j(" ",e.name," "),c(2),b(e.count)}}function Pt(r,t){if(r&1){let e=x();o(0,"nav",20)(1,"button",31),u("click",function(){m(e);let i=p();return g(i.setProject(null))}),l(2," All projects "),o(3,"span",32),l(4),s()(),w(5,Mt,4,4,"button",33,Tt),s()}if(r&2){let e=p();c(),y("active",e.activeProject()===null),c(3),b(e.allTasks().length),c(),T(e.projectSummaries())}}function jt(r,t){if(r&1&&(o(0,"span",35),l(1),s()),r&2){let e=p().$implicit,n=p();c(),b(n.filterCounts()[e.key])}}function Ot(r,t){if(r&1){let e=x();o(0,"button",34),u("click",function(){let i=m(e).$implicit,a=p();return g(a.setFilter(i.key))}),o(1,"mat-icon",24),l(2),s(),o(3,"span"),l(4),s(),C(5,jt,2,1,"span",35),s()}if(r&2){let e=t.$implicit,n=p();y("active",n.activeFilter()===e.key),Y("aria-selected",n.activeFilter()===e.key),c(2),b(e.icon),c(2),b(e.label),c(),k(n.filterCounts()[e.key]>0?5:-1)}}function Dt(r,t){r&1&&(o(0,"div",27),M(1,"mat-spinner",36),o(2,"p"),l(3,"Loading tasks from all projects\u2026"),s()())}function Et(r,t){r&1&&(o(0,"div",28)(1,"mat-icon",37),l(2,"hub"),s(),o(3,"p"),l(4,"No tasks found."),s()())}function Nt(r,t){if(r&1){let e=x();o(0,"app-task-card",43),u("stopRequested",function(i){let a=m(e).$implicit,d=p(3);return g(d.onStopRequested(i,a.projectId))})("deleteRequested",function(i){let a=m(e).$implicit,d=p(3);return g(d.onDeleteRequested(i,a.projectId))})("starToggled",function(i){let a=m(e).$implicit,d=p(3);return g(d.onStarToggled(i,a.projectId))})("closeTaskRequested",function(i){let a=m(e).$implicit,d=p(3);return g(d.onCloseTaskRequested(i,a.projectId))})("markDoneRequested",function(i){let a=m(e).$implicit,d=p(3);return g(d.onMarkDoneRequested(i,a.projectId))})("markActiveRequested",function(i){let a=m(e).$implicit,d=p(3);return g(d.onMarkActiveRequested(i,a.projectId))})("previewRequested",function(i){let a=m(e).$implicit,d=p(3);return g(d.onPreviewRequested(i,a.projectId,a.name))}),s()}if(r&2){let e=t.$implicit,n=p(3);y("is-previewed",n.previewThreadId()===e.id),f("task",e)("projectNameOverride",e.projectId)("showProject",!0)("previewMode",n.previewActive())}}function It(r,t){if(r&1&&(o(0,"section",38)(1,"h3",39)(2,"mat-icon",40),l(3),s(),l(4),o(5,"span",41),l(6),s()(),o(7,"div",29),w(8,Nt,1,6,"app-task-card",42,tt),s()()),r&2){let e=t.$implicit;c(3),b(e.icon),c(),j(" ",e.label," "),c(2),b(e.tasks.length),c(2),T(e.tasks)}}function At(r,t){if(r&1&&w(0,It,10,3,"section",38,yt),r&2){let e=p();T(e.taskGroups())}}function Rt(r,t){if(r&1){let e=x();o(0,"app-task-card",43),u("stopRequested",function(i){let a=m(e).$implicit,d=p(2);return g(d.onStopRequested(i,a.projectId))})("deleteRequested",function(i){let a=m(e).$implicit,d=p(2);return g(d.onDeleteRequested(i,a.projectId))})("starToggled",function(i){let a=m(e).$implicit,d=p(2);return g(d.onStarToggled(i,a.projectId))})("closeTaskRequested",function(i){let a=m(e).$implicit,d=p(2);return g(d.onCloseTaskRequested(i,a.projectId))})("markDoneRequested",function(i){let a=m(e).$implicit,d=p(2);return g(d.onMarkDoneRequested(i,a.projectId))})("markActiveRequested",function(i){let a=m(e).$implicit,d=p(2);return g(d.onMarkActiveRequested(i,a.projectId))})("previewRequested",function(i){let a=m(e).$implicit,d=p(2);return g(d.onPreviewRequested(i,a.projectId,a.name))}),s()}if(r&2){let e=t.$implicit,n=p(2);y("is-previewed",n.previewThreadId()===e.id),f("task",e)("projectNameOverride",e.projectId)("showProject",!0)("previewMode",n.previewActive())}}function Gt(r,t){if(r&1&&(o(0,"div",29),w(1,Rt,1,6,"app-task-card",42,tt),s()),r&2){let e=p();c(),T(e.displayedTasks())}}function Vt(r,t){if(r&1){let e=x();o(0,"div",44),u("mousedown",function(i){m(e);let a=p();return g(a.onResizerMousedown(i))}),s(),o(1,"div",45)(2,"header",46)(3,"span",47),l(4),s(),o(5,"div",48)(6,"button",49),u("click",function(){m(e);let i=p();return g(i.navigateToThread())}),o(7,"mat-icon"),l(8,"open_in_new"),s()(),o(9,"button",50),u("click",function(){m(e);let i=p();return g(i.closePreview())}),o(10,"mat-icon"),l(11,"close"),s()()()(),o(12,"div",51),M(13,"app-thread",52),s()()}if(r&2){let e=p();c(),se("width",e.previewPanelWidthPercent(),"%"),c(3),b(e.previewTaskName()||"Task"),c(9),f("projectName",e.previewProjectId())("threadId",e.previewThreadId())}}var Ft=20,Lt=70,qt=[{status:"waiting-you",label:"Waiting for you",icon:"mark_unread_chat_alt"},{status:"in-progress",label:"In progress",icon:"pending"},{status:"paused",label:"Paused",icon:"pause_circle"},{status:"error",label:"Error",icon:"error"},{status:"done",label:"Done",icon:"check_circle"}],$t=[{key:"all",label:"All",icon:"grid_view"},{key:"waiting-you",label:"Waiting for you",icon:"mark_unread_chat_alt"},{key:"in-progress",label:"In progress",icon:"pending"},{key:"paused",label:"Paused",icon:"pause_circle"},{key:"done",label:"Done",icon:"check_circle"}],et=class r{globalTaskService=h(X);destroyRef=h(ie);dialog=h(A);router=h(ce);configState=h(J);userService=h(ke);preferences=h(Qe);projectState=h(V);threadState=h(Ce);breakpointObserver=h(pe);username=P(this.userService.username$,{initialValue:null});isDesktop=P(this.breakpointObserver.observe("(min-width: 1280px)").pipe(ne(t=>t.matches)),{initialValue:!1});previewEnabled=P(this.preferences.missionPreviewEnabled$,{initialValue:!1});previewActive=v(()=>this.previewEnabled()&&this.isDesktop());previewThreadId=_(null);previewProjectId=_(null);previewTaskName=_(null);previewPanelWidthPercent=_(this.preferences.getMissionPreviewPanelWidth());isDraggingResizer=!1;dragStartX=0;dragStartWidth=0;containerWidth=0;layoutContainerRef;globalEventSource=null;filters=$t;activeFilter=_("all");starredOnly=_(!1);activeProject=_(null);searchQuery=_("");isLoading=this.globalTaskService.isLoading;allTasks=this.globalTaskService.tasks;projectSummaries=v(()=>{let t=this.allTasks(),e=new Map;for(let n of t)e.set(n.projectId,(e.get(n.projectId)??0)+1);return[...e.entries()].map(([n,i])=>({name:n,count:i})).sort((n,i)=>n.name.localeCompare(i.name))});filteredTasks=v(()=>{let t=this.allTasks(),e=this.activeProject();e&&(t=t.filter(a=>a.projectId===e));let n=this.username();this.starredOnly()&&n&&(t=t.filter(a=>a.starring.includes(n)));let i=this.activeFilter();return i!=="all"&&(t=t.filter(a=>a.status===i)),t});filterCounts=v(()=>{let t=this.allTasks(),e=this.activeProject();e&&(t=t.filter(i=>i.projectId===e));let n=this.username();return this.starredOnly()&&n&&(t=t.filter(i=>i.starring.includes(n))),{all:t.length,"waiting-you":t.filter(i=>i.status==="waiting-you").length,"in-progress":t.filter(i=>i.status==="in-progress").length,done:t.filter(i=>i.status==="done").length,paused:t.filter(i=>i.status==="paused").length,error:t.filter(i=>i.status==="error").length}});displayedTasks=v(()=>{let t=this.searchQuery().toLowerCase().trim(),e=this.sortedFilteredTasks();return t?e.filter(n=>(n.name||"").toLowerCase().includes(t)||(n.summary||"").toLowerCase().includes(t)):e});taskGroups=v(()=>{let t=this.displayedTasks();return qt.map(e=>D(O({},e),{tasks:t.filter(n=>n.status===e.status)})).filter(e=>e.tasks.length>0)});sortedFilteredTasks=v(()=>{let t=this.filteredTasks(),e={"waiting-you":0,"in-progress":1,paused:2,error:3,done:4};return[...t].sort((n,i)=>(e[n.status]??99)-(e[i.status]??99))});constructor(){this.destroyRef.onDestroy(()=>this.disconnectGlobalSse())}ngOnInit(){this.globalTaskService.refresh(),this.connectGlobalSse(),this.userService.fetchCurrentUser().pipe(Ne(this.destroyRef)).subscribe({error:t=>console.warn("[GTC] Could not fetch user:",t)})}setFilter(t){this.activeFilter.set(t)}toggleStarredFilter(){this.starredOnly.update(t=>!t)}setProject(t){this.activeProject.set(t),this.activeFilter.set("all")}onSearchInput(t){this.searchQuery.set(t.target.value)}clearSearch(){this.searchQuery.set("")}refresh(){this.globalTaskService.refresh()}openPreferences(){this.dialog.open(Xe,{width:"400px"})}openTokenUsage(){this.router.navigate(["/token-usage"])}openUserConfig(){this.configState.openUserConfigEditor()}openNewTaskDialog(){this.dialog.open(Q,{width:"500px",disableClose:!1}).afterClosed().subscribe(e=>{e&&(e.navigate?this.router.navigate(["project",e.projectId]):(setTimeout(()=>this.globalTaskService.refresh(),300),setTimeout(()=>this.globalTaskService.refresh(),1500)))})}onStopRequested(t,e){this.globalTaskService.stopThread(e,t)}onDeleteRequested(t,e){this.globalTaskService.deleteThread(e,t)}onStarToggled(t,e){let n=this.allTasks().find(d=>d.id===t);if(!n)return;let i=this.username(),a=!!i&&n.starring.includes(i);this.globalTaskService.toggleStar(e,t,a)}onCloseTaskRequested(t,e){let i=this.allTasks().find(d=>d.id===t)?.worktreeProject??e;this.dialog.open(He,{width:"420px",data:{title:"Close task",message:`This will stop the agent, delete the thread and remove the worktree project "${i}" from disk. This cannot be undone.`,confirmLabel:"Close task",cancelLabel:"Cancel"}}).afterClosed().subscribe(d=>{d&&this.globalTaskService.closeTask(e,t)})}onMarkDoneRequested(t,e){this.globalTaskService.markTaskDone(e,t)}onMarkActiveRequested(t,e){this.globalTaskService.markTaskActive(e,t)}onPreviewRequested(t,e,n){this.previewThreadId()===t?(this.previewThreadId.set(null),this.previewProjectId.set(null),this.previewTaskName.set(null)):(this.projectState.selectProject(e),this.threadState.selectThread(t),this.previewProjectId.set(e),this.previewThreadId.set(t),this.previewTaskName.set(n))}closePreview(){this.previewThreadId.set(null),this.previewProjectId.set(null),this.previewTaskName.set(null)}navigateToThread(){let t=this.previewThreadId(),e=this.previewProjectId();!t||!e||this.router.navigate(["project",e,"thread",t])}onResizerMousedown(t){t.preventDefault(),this.isDraggingResizer=!0,this.dragStartX=t.clientX,this.dragStartWidth=this.previewPanelWidthPercent(),this.containerWidth=this.layoutContainerRef?.nativeElement.offsetWidth??window.innerWidth}onDocumentMousemove(t){if(!this.isDraggingResizer)return;let n=(this.dragStartX-t.clientX)/this.containerWidth*100,i=Math.min(Lt,Math.max(Ft,this.dragStartWidth+n));this.previewPanelWidthPercent.set(i)}onDocumentMouseup(){this.isDraggingResizer&&(this.isDraggingResizer=!1,this.preferences.setMissionPreviewPanelWidth(this.previewPanelWidthPercent()))}connectGlobalSse(t=5e3){this.disconnectGlobalSse();let e=new EventSource("/api/event-stream");this.globalEventSource=e,e.onmessage=n=>{try{let i=JSON.parse(n.data),a=Ve(i);if(!a)return;let d=a.threadId;if(!d)return;a instanceof Ie||a instanceof Ae?this.globalTaskService.applyStatusEvent(d,"invite"):a instanceof Re?this.globalTaskService.applyStatusEvent(d,"thinking"):a instanceof Ge&&this.globalTaskService.refresh()}catch(i){}},e.onerror=()=>{e.readyState===EventSource.CLOSED&&(this.globalEventSource=null,setTimeout(()=>{this.globalEventSource||this.connectGlobalSse(Math.min(t*2,6e4))},t))}}disconnectGlobalSse(){this.globalEventSource&&(this.globalEventSource.close(),this.globalEventSource=null)}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=N({type:r,selectors:[["app-global-task-control"]],viewQuery:function(e,n){if(e&1&&oe(xt,5),e&2){let i;re(i=ae())&&(n.layoutContainerRef=i.first)}},hostBindings:function(e,n){e&1&&u("mousemove",function(a){return n.onDocumentMousemove(a)},K)("mouseup",function(){return n.onDocumentMouseup()},K)},decls:70,vars:10,consts:[["layoutContainer",""],["controlCenterMenu","matMenu"],[1,"gtc"],[1,"gtc-toolbar"],[1,"gtc-toolbar-left"],[1,"gtc-logo-icon"],[1,"gtc-title"],["appearance","fill","subscriptSizing","dynamic",1,"gtc-search"],["matPrefix",""],["matInput","","type","search","placeholder","Filter tasks\u2026","autocomplete","off",3,"input","keydown.escape","value"],["matSuffix","","mat-icon-button","","aria-label","Clear"],[1,"gtc-toolbar-actions"],["mat-icon-button","","matTooltip","Control Center","aria-label","Control Center",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click"],["mat-menu-item","","href","https://github.com/whoz-oss/coday","target","_blank","rel","noopener noreferrer"],["mat-icon-button","","matTooltip","Refresh all tasks","aria-label","Refresh tasks",3,"click","disabled"],["mat-stroked-button","","routerLink","/projects","aria-label","Manage projects","matTooltip","Manage projects"],[1,"btn-label"],["mat-flat-button","","aria-label","New task","matTooltip","New Task",1,"gtc-new-btn",3,"click"],[1,"gtc-filter-bar"],["aria-label","Filter by project",1,"gtc-project-filters"],["role","tablist","aria-label","Filter by status",1,"gtc-filters"],["role","tab",1,"filter-chip",3,"active"],["role","switch","aria-label","Show starred tasks only",1,"filter-chip","starred-filter",3,"click"],[1,"filter-icon"],[1,"gtc-body"],[1,"gtc-content"],[1,"gtc-loading"],[1,"gtc-empty"],[1,"gtc-grid"],["matSuffix","","mat-icon-button","","aria-label","Clear",3,"click"],[1,"project-chip",3,"click"],[1,"chip-count"],[1,"project-chip",3,"active"],["role","tab",1,"filter-chip",3,"click"],[1,"filter-badge"],["diameter","36"],[1,"empty-icon"],[1,"gtc-group"],[1,"gtc-group-title"],[1,"group-icon"],[1,"group-count"],[3,"task","projectNameOverride","showProject","previewMode","is-previewed"],[3,"stopRequested","deleteRequested","starToggled","closeTaskRequested","markDoneRequested","markActiveRequested","previewRequested","task","projectNameOverride","showProject","previewMode"],["matTooltip","Drag to resize","aria-hidden","true",1,"gtc-resizer",3,"mousedown"],[1,"gtc-preview-pane"],[1,"gtc-preview-header"],[1,"gtc-preview-title"],[1,"gtc-preview-actions"],["matTooltip","Open full view","aria-label","Open thread in full view","type","button",1,"preview-action-btn",3,"click"],["matTooltip","Close panel","aria-label","Close preview panel","type","button",1,"preview-action-btn",3,"click"],[1,"gtc-preview-body","thread-preview-host"],[3,"projectName","threadId"]],template:function(e,n){if(e&1&&(o(0,"div",2,0)(2,"header",3)(3,"div",4)(4,"mat-icon",5),l(5,"hub"),s(),o(6,"h1",6),l(7,"Global Task Control"),s()(),o(8,"mat-form-field",7)(9,"mat-icon",8),l(10,"search"),s(),o(11,"input",9),u("input",function(a){return n.onSearchInput(a)})("keydown.escape",function(){return n.clearSearch()}),s(),C(12,St,3,0,"button",10),s(),o(13,"div",11)(14,"button",12)(15,"mat-icon"),l(16,"hub"),s()(),o(17,"mat-menu",null,1)(19,"button",13),u("click",function(){return n.openPreferences()}),o(20,"mat-icon"),l(21,"tune"),s(),o(22,"span"),l(23,"Preferences"),s()(),o(24,"button",13),u("click",function(){return n.openTokenUsage()}),o(25,"mat-icon"),l(26,"data_usage"),s(),o(27,"span"),l(28,"Token Usage"),s()(),o(29,"button",13),u("click",function(){return n.openUserConfig()}),o(30,"mat-icon"),l(31,"manage_accounts"),s(),o(32,"span"),l(33,"User Configuration"),s()(),M(34,"mat-divider"),o(35,"a",14)(36,"mat-icon"),l(37,"code"),s(),o(38,"span"),l(39,"Contribute on GitHub"),s()()(),o(40,"button",15),u("click",function(){return n.refresh()}),o(41,"mat-icon"),l(42,"refresh"),s()(),o(43,"button",16)(44,"mat-icon"),l(45,"settings"),s(),o(46,"span",17),l(47,"Manage projects"),s()(),o(48,"button",18),u("click",function(){return n.openNewTaskDialog()}),o(49,"mat-icon"),l(50,"rocket_launch"),s(),o(51,"span",17),l(52,"New Task"),s()()()(),o(53,"div",19),C(54,Pt,7,3,"nav",20),o(55,"nav",21),w(56,Ot,6,6,"button",22,wt),o(58,"button",23),u("click",function(){return n.toggleStarredFilter()}),o(59,"mat-icon",24),l(60,"star"),s(),o(61,"span"),l(62,"Starred"),s()()()(),o(63,"div",25)(64,"main",26),C(65,Dt,4,0,"div",27)(66,Et,5,0,"div",28)(67,At,2,0)(68,Gt,3,0,"div",29),s(),C(69,Vt,14,5),s()()),e&2){let i=S(18);c(11),f("value",n.searchQuery()),c(),k(n.searchQuery()?12:-1),c(2),f("matMenuTriggerFor",i),c(26),f("disabled",n.isLoading()),c(14),k(n.projectSummaries().length>1?54:-1),c(2),T(n.filters),c(2),y("active",n.starredOnly()),Y("aria-checked",n.starredOnly()),c(7),k(n.isLoading()?65:n.displayedTasks().length===0?66:n.activeFilter()==="all"&&!n.searchQuery()?67:68),c(4),k(n.previewActive()&&n.previewThreadId()&&n.previewProjectId()?69:-1)}},dependencies:[Fe,Je,L,F,G,R,fe,we,xe,$,q,Me,ye,Te,Se,je,Pe,W,z,De,B,H,U,de],styles:[".glass-panel[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow)}.glass-interactive[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-interactive[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-interactive[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-card[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);border-radius:20px;padding:1.5rem}.glass-button[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-button[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-button[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-button[_ngcontent-%COMP%]{border-radius:12px;padding:.75rem 1.5rem;font-weight:600;cursor:pointer}.glass-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed;transform:none}.glass-button[_ngcontent-%COMP%]:disabled:hover{transform:none}.smooth-theme-transition[_ngcontent-%COMP%]{transition:background .3s ease,color .3s ease,border-color .3s ease,box-shadow .3s ease}[_nghost-%COMP%]{display:block;width:100%;height:100%;overflow:hidden}.gtc[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden}.gtc-toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:0 .75rem;height:56px;flex-shrink:0;border-bottom:1px solid var(--color-border, rgba(0, 0, 0, .1));box-sizing:border-box}.gtc-toolbar-left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;flex-shrink:0}.gtc-logo-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem;color:var(--color-primary)}.gtc-title[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600;color:var(--color-text);white-space:nowrap}.gtc-search[_ngcontent-%COMP%]{margin-left:auto;flex:0 1 240px;min-width:80px;--mat-form-field-container-height: 36px;--mat-form-field-container-vertical-padding: 6px;font-size:.875rem;--mdc-filled-text-field-container-color: transparent;--mdc-filled-text-field-hover-container-color: transparent;--mdc-filled-text-field-focus-container-color: transparent;--mdc-filled-text-field-active-indicator-color: transparent;--mdc-filled-text-field-hover-active-indicator-color: transparent;--mdc-filled-text-field-focus-active-indicator-color: transparent;--mdc-filled-text-field-active-indicator-height: 0}.gtc-toolbar-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;flex-shrink:0}.gtc-new-btn[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-radius:12px;font-weight:600;height:36px;padding:0 1rem}.gtc-new-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.1rem;width:1.1rem;height:1.1rem}@media(max-width:600px){.gtc-toolbar[_ngcontent-%COMP%]{flex-wrap:wrap;height:auto;min-height:48px;padding:.5rem .75rem;gap:.375rem}.gtc-title[_ngcontent-%COMP%]{font-size:.875rem}.gtc-search[_ngcontent-%COMP%]{order:3;flex:1 1 100%;min-width:0;margin-left:0}.gtc-toolbar-actions[_ngcontent-%COMP%]{margin-left:auto}.btn-label[_ngcontent-%COMP%]{display:none}.gtc-toolbar-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:not(mat-icon-button):not([mat-icon-button]){--mdc-text-button-container-height: 36px;--mdc-filled-button-container-height: 36px;--mdc-outlined-button-container-height: 36px;min-width:36px;width:36px;height:36px;padding:0;border-radius:50%!important}.gtc-toolbar-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:not(mat-icon-button):not([mat-icon-button]) .mat-mdc-button-touch-target[_ngcontent-%COMP%]{width:36px;height:36px}.gtc-toolbar-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:not(mat-icon-button):not([mat-icon-button]) mat-icon[_ngcontent-%COMP%]{margin:0!important}}.gtc-filter-bar[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem;padding:.5rem .75rem;flex-shrink:0;border-bottom:1px solid var(--color-border, rgba(0, 0, 0, .08))}.gtc-project-filters[_ngcontent-%COMP%]{display:flex;gap:.375rem;flex-wrap:wrap}.project-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;padding:.2rem .65rem;border-radius:100px;font-size:.75rem;font-weight:500;color:var(--color-text-secondary);background:transparent;border:1px solid var(--color-border);cursor:pointer;transition:background .15s ease,color .15s ease,border-color .15s ease;white-space:nowrap}.project-chip[_ngcontent-%COMP%] .chip-count[_ngcontent-%COMP%]{background:var(--color-bg-hover);border-radius:100px;padding:0 .3rem;font-size:.68rem;font-weight:700;min-width:16px;text-align:center;line-height:16px}.project-chip.active[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-color:var(--color-primary)}.project-chip.active[_ngcontent-%COMP%] .chip-count[_ngcontent-%COMP%]{background:#ffffff40;color:var(--color-text-inverse)}.project-chip[_ngcontent-%COMP%]:hover:not(.active){background:var(--color-bg-hover);color:var(--color-text)}.gtc-filters[_ngcontent-%COMP%]{display:flex;gap:.375rem;flex-wrap:wrap}.filter-chip[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);display:flex;align-items:center;gap:.375rem;padding:.3rem .75rem;border-radius:100px;font-size:.8rem;font-weight:500;color:var(--color-text-secondary);cursor:pointer;border:1px solid var(--color-border);transition:background .15s ease,color .15s ease,border-color .15s ease;white-space:nowrap}.filter-chip[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{font-size:.9rem;width:.9rem;height:.9rem}.filter-chip[_ngcontent-%COMP%] .filter-badge[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-radius:100px;padding:0 .375rem;font-size:.7rem;font-weight:700;min-width:18px;text-align:center;line-height:18px}.filter-chip.active[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-color:var(--color-primary)}.filter-chip.active[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{color:var(--color-text-inverse)}.filter-chip.active[_ngcontent-%COMP%] .filter-badge[_ngcontent-%COMP%]{background:#ffffff40;color:var(--color-text-inverse)}.filter-chip[_ngcontent-%COMP%]:hover:not(.active){background:var(--color-bg-hover);color:var(--color-text)}.starred-filter.active[_ngcontent-%COMP%]{background:#f5a62326;border-color:#f5a623;color:#f5a623}.starred-filter.active[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{color:#f5a623}.gtc-body[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex:1;overflow:hidden;min-height:0}.gtc-content[_ngcontent-%COMP%]{flex:1;overflow-y:auto;padding:1rem 1rem 2rem;min-width:0}.gtc-resizer[_ngcontent-%COMP%]{width:6px;flex-shrink:0;cursor:col-resize;background:transparent;border-left:1px solid var(--color-border);border-right:1px solid var(--color-border);transition:background .15s ease}.gtc-resizer[_ngcontent-%COMP%]:hover, .gtc-resizer[_ngcontent-%COMP%]:active{background:var(--color-primary);opacity:.4}.gtc-preview-pane[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;flex-shrink:0;min-width:280px;border-left:1px solid var(--color-border);background:var(--glass-bg)}.gtc-preview-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.625rem .75rem .625rem 1rem;border-bottom:1px solid var(--color-border);flex-shrink:0}.gtc-preview-title[_ngcontent-%COMP%]{font-size:.875rem;font-weight:600;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1}.gtc-preview-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.125rem;flex-shrink:0}.preview-action-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:none;border-radius:6px;background:transparent;cursor:pointer;transition:background .15s ease}.preview-action-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;line-height:18px;vertical-align:middle;color:var(--color-text-secondary)}.preview-action-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.preview-action-btn[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:var(--color-text)}.gtc-preview-body[_ngcontent-%COMP%]{flex:1;overflow:hidden;display:flex;flex-direction:column;min-height:0}.gtc-preview-body[_ngcontent-%COMP%] app-thread[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;overflow:hidden;min-height:0} app-task-card.is-previewed .task-card{border-color:var(--color-primary);box-shadow:0 0 0 2px var(--color-primary)}.gtc-group[_ngcontent-%COMP%]{margin-bottom:1.25rem}.gtc-group[_ngcontent-%COMP%]:last-child{margin-bottom:0}.gtc-group-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin:0 0 .75rem;font-size:.8rem;font-weight:600;color:var(--color-text-secondary);text-transform:uppercase;letter-spacing:.05em}.gtc-group-title[_ngcontent-%COMP%] .group-icon[_ngcontent-%COMP%]{font-size:.95rem;width:.95rem;height:.95rem}.gtc-group-title[_ngcontent-%COMP%] .group-count[_ngcontent-%COMP%]{background:var(--color-bg-hover);border-radius:100px;padding:0 .375rem;font-size:.7rem;font-weight:700;min-width:16px;text-align:center;line-height:16px}.gtc-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1rem}@media(max-width:600px){.gtc-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.gtc-loading[_ngcontent-%COMP%], .gtc-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;padding:3rem;color:var(--color-text-secondary);text-align:center}.gtc-loading[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .gtc-empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:.9rem}.empty-icon[_ngcontent-%COMP%]{font-size:2.5rem;width:2.5rem;height:2.5rem;opacity:.3}"],changeDetection:0})};export{et as GlobalTaskControlComponent};
@@ -1,2 +0,0 @@
1
- import{g as Ee,h as Re,i as Te,j as De,k as Fe,l as Le,m as R}from"./chunk-VDRETD5H.js";import{h as Me}from"./chunk-BUA6GPP7.js";import{c as ve,d as ye,f as be,l as Oe,m as Ae,p as Se,s as we,v as Pe}from"./chunk-Z7E7NSDY.js";import{a as ke}from"./chunk-HZF57OLY.js";import{A as fe,E as ge,I as Ce,K as E,c as ce,d as pe,e as ue,l as de,n as he,t as me,u as _,v as _e,x as k,y as f}from"./chunk-EF2BOSEH.js";import{$b as C,A as h,B as O,Cb as ee,Db as te,Fb as ie,G as I,Gb as oe,Hb as ne,I as V,Ib as ae,Jb as se,Kb as p,Lb as u,Ma as q,Na as Y,Pa as G,R as x,Rb as le,S as m,Sa as z,Sb as re,V as B,Wa as Q,Xa as U,Y as W,Ya as X,_ as H,aa as A,bb as Z,ca as s,e as d,ea as N,g as v,h as y,jb as P,ka as S,m as b,oa as c,pa as K,t as F,tc as M,uc as r,va as j,vb as J,wb as $,y as L,ya as w}from"./chunk-B4RKRLIY.js";var Ne=["panel"],Ke=["*"];function je(a,g){if(a&1&&(J(0,"div",1,0),ne(2),$()),a&2){let e=g.id,t=ie();re(t._classList),le("mat-mdc-autocomplete-visible",t.showPanel)("mat-mdc-autocomplete-hidden",!t.showPanel)("mat-autocomplete-panel-animations-enabled",!t._animationsDisabled)("mat-primary",t._color==="primary")("mat-accent",t._color==="accent")("mat-warn",t._color==="warn"),ee("id",t.id),P("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby(e))}}var T=class{source;option;constructor(g,e){this.source=g,this.option=e}},xe=new A("mat-autocomplete-default-options",{providedIn:"root",factory:()=>({autoActiveFirstOption:!1,autoSelectActiveOption:!1,hideSingleSelectionIndicator:!1,requireSelection:!1,hasBackdrop:!1})}),bt=(()=>{class a{_changeDetectorRef=s(M);_elementRef=s(w);_defaults=s(xe);_animationsDisabled=E();_activeOptionChanges=d.EMPTY;_keyManager;showPanel=!1;get isOpen(){return this._isOpen&&this.showPanel}_isOpen=!1;_latestOpeningTrigger;_setColor(e){this._color=e,this._changeDetectorRef.markForCheck()}_color;template;panel;options;optionGroups;ariaLabel;ariaLabelledby;displayWith=null;autoActiveFirstOption;autoSelectActiveOption;requireSelection;panelWidth;disableRipple=!1;optionSelected=new c;opened=new c;closed=new c;optionActivated=new c;set classList(e){this._classList=e,this._elementRef.nativeElement.className=""}_classList;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties()}_hideSingleSelectionIndicator;_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck()}id=s(me).getId("mat-autocomplete-");inertGroups;constructor(){let e=s(ue);this.inertGroups=e?.SAFARI||!1,this.autoActiveFirstOption=!!this._defaults.autoActiveFirstOption,this.autoSelectActiveOption=!!this._defaults.autoSelectActiveOption,this.requireSelection=!!this._defaults.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??!1}ngAfterContentInit(){this._keyManager=new _e(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(e=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[e]||null})}),this._setVisibility()}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe()}_setScrollTop(e){this.panel&&(this.panel.nativeElement.scrollTop=e)}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options?.length,this._changeDetectorRef.markForCheck()}_emitSelectEvent(e){let t=new T(this,e);this.optionSelected.emit(t)}_getPanelAriaLabelledby(e){if(this.ariaLabel)return null;let t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_skipPredicate(){return!1}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=Q({type:a,selectors:[["mat-autocomplete"]],contentQueries:function(t,i,o){if(t&1&&ae(o,De,5)(o,Re,5),t&2){let n;p(n=u())&&(i.options=n),p(n=u())&&(i.optionGroups=n)}},viewQuery:function(t,i){if(t&1&&se(Y,7)(Ne,5),t&2){let o;p(o=u())&&(i.template=o.first),p(o=u())&&(i.panel=o.first)}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",r],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",r],requireSelection:[2,"requireSelection","requireSelection",r],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",r],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",r]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],features:[C([{provide:Ee,useExisting:a}])],ngContentSelectors:Ke,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(t,i){t&1&&(oe(),Z(0,je,3,17,"ng-template"))},styles:[`div.mat-mdc-autocomplete-panel{width:100%;max-height:256px;visibility:hidden;transform-origin:center top;overflow:auto;padding:8px 0;box-sizing:border-box;position:relative;border-radius:var(--mat-autocomplete-container-shape, var(--mat-sys-corner-extra-small));box-shadow:var(--mat-autocomplete-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));background-color:var(--mat-autocomplete-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-autocomplete-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-autocomplete-panel-above) div.mat-mdc-autocomplete-panel{border-top-left-radius:0;border-top-right-radius:0}.mat-mdc-autocomplete-panel-above div.mat-mdc-autocomplete-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:center bottom}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-visible{visibility:visible}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-hidden,.cdk-overlay-pane:has(>.mat-mdc-autocomplete-hidden){visibility:hidden;pointer-events:none}@keyframes _mat-autocomplete-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}.mat-autocomplete-panel-animations-enabled{animation:_mat-autocomplete-enter 120ms cubic-bezier(0, 0, 0.2, 1)}mat-autocomplete{display:none}
2
- `],encapsulation:2,changeDetection:0})}return a})();var qe={provide:ke,useExisting:W(()=>Ge),multi:!0};var Ye=new A("mat-autocomplete-scroll-strategy",{providedIn:"root",factory:()=>{let a=s(S);return()=>Oe(a)}}),Ge=(()=>{class a{_environmentInjector=s(N);_element=s(w);_injector=s(S);_viewContainerRef=s(z);_zone=s(K);_changeDetectorRef=s(M);_dir=s(fe,{optional:!0});_formField=s(Me,{optional:!0,host:!0});_viewportRuler=s(ve);_scrollStrategy=s(Ye);_renderer=s(G);_animationsDisabled=E();_defaults=s(xe,{optional:!0});_overlayRef=null;_portal;_componentDestroyed=!1;_initialized=new y;_keydownSubscription;_outsideClickSubscription;_cleanupWindowBlur;_previousValue=null;_valueOnAttach=null;_valueOnLastKeydown=null;_positionStrategy;_manuallyFloatingLabel=!1;_closingActionsSubscription;_viewportSubscription=d.EMPTY;_breakpointObserver=s(he);_handsetLandscapeSubscription=d.EMPTY;_canOpenOnNextFocus=!0;_valueBeforeAutoSelection;_pendingAutoselectedOption=null;_closeKeyEventStream=new y;_overlayPanelClass=de(this._defaults?.overlayPanelClass||[]);_windowBlurHandler=()=>{this._canOpenOnNextFocus=this.panelOpen||!this._hasFocus()};_onChange=()=>{};_onTouched=()=>{};autocomplete;position="auto";connectedTo;autocompleteAttribute="off";autocompleteDisabled=!1;constructor(){}_aboveClass="mat-mdc-autocomplete-panel-above";ngAfterViewInit(){this._initialized.next(),this._initialized.complete(),this._cleanupWindowBlur=this._renderer.listen("window","blur",this._windowBlurHandler)}ngOnChanges(e){e.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition())}ngOnDestroy(){this._cleanupWindowBlur?.(),this._handsetLandscapeSubscription.unsubscribe(),this._viewportSubscription.unsubscribe(),this._componentDestroyed=!0,this._destroyPanel(),this._closeKeyEventStream.complete(),this._clearFromModal()}get panelOpen(){return this._overlayAttached&&this.autocomplete.showPanel}_overlayAttached=!1;openPanel(){this._openPanelInternal()}closePanel(){this._resetLabel(),this._overlayAttached&&(this.panelOpen&&this._zone.run(()=>{this.autocomplete.closed.emit()}),this.autocomplete._latestOpeningTrigger===this&&(this.autocomplete._isOpen=!1,this.autocomplete._latestOpeningTrigger=null),this._overlayAttached=!1,this._pendingAutoselectedOption=null,this._overlayRef&&this._overlayRef.hasAttached()&&(this._overlayRef.detach(),this._closingActionsSubscription.unsubscribe()),this._updatePanelState(),this._componentDestroyed||this._changeDetectorRef.detectChanges(),this._trackedModal&&f(this._trackedModal,"aria-owns",this.autocomplete.id))}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition()}get panelClosingActions(){return h(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(O(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(O(()=>this._overlayAttached)):b()).pipe(F(e=>e instanceof Te?e:null))}optionSelections=L(()=>{let e=this.autocomplete?this.autocomplete.options:null;return e?e.changes.pipe(x(e),m(()=>h(...e.map(t=>t.onSelectionChange)))):this._initialized.pipe(m(()=>this.optionSelections))});get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return new v(e=>{let t=o=>{let n=pe(o),l=this._formField?this._formField.getConnectedOverlayOrigin().nativeElement:null,D=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;this._overlayAttached&&n!==this._element.nativeElement&&!this._hasFocus()&&(!l||!l.contains(n))&&(!D||!D.contains(n))&&this._overlayRef&&!this._overlayRef.overlayElement.contains(n)&&e.next(o)},i=[this._renderer.listen("document","click",t),this._renderer.listen("document","auxclick",t),this._renderer.listen("document","touchend",t)];return()=>{i.forEach(o=>o())}})}writeValue(e){Promise.resolve(null).then(()=>this._assignOptionValue(e))}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this._element.nativeElement.disabled=e}_handleKeydown(e){let t=e,i=t.keyCode,o=_(t);if(i===27&&!o&&t.preventDefault(),this._valueOnLastKeydown=this._element.nativeElement.value,this.activeOption&&i===13&&this.panelOpen&&!o)this.activeOption._selectViaInteraction(),this._resetActiveItem(),t.preventDefault();else if(this.autocomplete){let n=this.autocomplete._keyManager.activeItem,l=i===38||i===40;i===9||l&&!o&&this.panelOpen?this.autocomplete._keyManager.onKeydown(t):l&&this._canOpen()&&this._openPanelInternal(this._valueOnLastKeydown),(l||this.autocomplete._keyManager.activeItem!==n)&&(this._scrollToOption(this.autocomplete._keyManager.activeItemIndex||0),this.autocomplete.autoSelectActiveOption&&this.activeOption&&(this._pendingAutoselectedOption||(this._valueBeforeAutoSelection=this._valueOnLastKeydown),this._pendingAutoselectedOption=this.activeOption,this._assignOptionValue(this.activeOption.value)))}}_handleInput(e){let t=e.target,i=t.value;if(t.type==="number"&&(i=i==""?null:parseFloat(i)),this._previousValue!==i){if(this._previousValue=i,this._pendingAutoselectedOption=null,(!this.autocomplete||!this.autocomplete.requireSelection)&&this._onChange(i),!i)this._clearPreviousSelectedOption(null,!1);else if(this.panelOpen&&!this.autocomplete.requireSelection){let o=this.autocomplete.options?.find(n=>n.selected);if(o){let n=this._getDisplayValue(o.value);i!==n&&o.deselect(!1)}}if(this._canOpen()&&this._hasFocus()){let o=this._valueOnLastKeydown??this._element.nativeElement.value;this._valueOnLastKeydown=null,this._openPanelInternal(o)}}}_handleFocus(){this._canOpenOnNextFocus?this._canOpen()&&(this._previousValue=this._element.nativeElement.value,this._attachOverlay(this._previousValue),this._floatLabel(!0)):this._canOpenOnNextFocus=!0}_handleClick(){this._canOpen()&&!this.panelOpen&&this._openPanelInternal()}_hasFocus(){return ce()===this._element.nativeElement}_floatLabel(e=!1){this._formField&&this._formField.floatLabel==="auto"&&(e?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=!0)}_resetLabel(){this._manuallyFloatingLabel&&(this._formField&&(this._formField.floatLabel="auto"),this._manuallyFloatingLabel=!1)}_subscribeToClosingActions(){let e=new v(i=>{q(()=>{i.next()},{injector:this._environmentInjector})}),t=this.autocomplete.options?.changes.pipe(B(()=>this._positionStrategy.reapplyLastPosition()),V(0))??b();return h(e,t).pipe(m(()=>this._zone.run(()=>{let i=this.panelOpen;return this._resetActiveItem(),this._updatePanelState(),this._changeDetectorRef.detectChanges(),this.panelOpen&&this._overlayRef.updatePosition(),i!==this.panelOpen&&(this.panelOpen?this._emitOpened():this.autocomplete.closed.emit()),this.panelClosingActions})),I(1)).subscribe(i=>this._setValueAndClose(i))}_emitOpened(){this.autocomplete.opened.emit()}_destroyPanel(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null)}_getDisplayValue(e){let t=this.autocomplete;return t&&t.displayWith?t.displayWith(e):e}_assignOptionValue(e){let t=this._getDisplayValue(e);e==null&&this._clearPreviousSelectedOption(null,!1),this._updateNativeInputValue(t??"")}_updateNativeInputValue(e){this._formField?this._formField._control.value=e:this._element.nativeElement.value=e,this._previousValue=e}_setValueAndClose(e){let t=this.autocomplete,i=e?e.source:this._pendingAutoselectedOption;i?(this._clearPreviousSelectedOption(i),this._assignOptionValue(i.value),this._onChange(i.value),t._emitSelectEvent(i),this._element.nativeElement.focus()):t.requireSelection&&this._element.nativeElement.value!==this._valueOnAttach&&(this._clearPreviousSelectedOption(null),this._assignOptionValue(null),this._onChange(null)),this.closePanel()}_clearPreviousSelectedOption(e,t){this.autocomplete?.options?.forEach(i=>{i!==e&&i.selected&&i.deselect(t)})}_openPanelInternal(e=this._element.nativeElement.value){if(this._attachOverlay(e),this._floatLabel(),this._trackedModal){let t=this.autocomplete.id;k(this._trackedModal,"aria-owns",t)}}_attachOverlay(e){if(!this.autocomplete)return;let t=this._overlayRef;t?(this._positionStrategy.setOrigin(this._getConnectedElement()),t.updateSize({width:this._getPanelWidth()})):(this._portal=new be(this.autocomplete.template,this._viewContainerRef,{id:this._formField?.getLabelId()}),t=we(this._injector,this._getOverlayConfig()),this._overlayRef=t,this._viewportSubscription=this._viewportRuler.change().subscribe(()=>{this.panelOpen&&t&&t.updateSize({width:this._getPanelWidth()})}),this._handsetLandscapeSubscription=this._breakpointObserver.observe(Ce.HandsetLandscape).subscribe(o=>{o.matches?this._positionStrategy.withFlexibleDimensions(!0).withGrowAfterOpen(!0).withViewportMargin(8):this._positionStrategy.withFlexibleDimensions(!1).withGrowAfterOpen(!1).withViewportMargin(0)})),t&&!t.hasAttached()&&(t.attach(this._portal),this._valueOnAttach=e,this._valueOnLastKeydown=null,this._closingActionsSubscription=this._subscribeToClosingActions());let i=this.panelOpen;this.autocomplete._isOpen=this._overlayAttached=!0,this.autocomplete._latestOpeningTrigger=this,this.autocomplete._setColor(this._formField?.color),this._updatePanelState(),this._applyModalPanelOwnership(),this.panelOpen&&i!==this.panelOpen&&this._emitOpened()}_handlePanelKeydown=e=>{(e.keyCode===27&&!_(e)||e.keyCode===38&&_(e,"altKey"))&&(this._pendingAutoselectedOption&&(this._updateNativeInputValue(this._valueBeforeAutoSelection??""),this._pendingAutoselectedOption=null),this._closeKeyEventStream.next(),this._resetActiveItem(),e.stopPropagation(),e.preventDefault())};_updatePanelState(){if(this.autocomplete._setVisibility(),this.panelOpen){let e=this._overlayRef;this._keydownSubscription||(this._keydownSubscription=e.keydownEvents().subscribe(this._handlePanelKeydown)),this._outsideClickSubscription||(this._outsideClickSubscription=e.outsidePointerEvents().subscribe())}else this._keydownSubscription?.unsubscribe(),this._outsideClickSubscription?.unsubscribe(),this._keydownSubscription=this._outsideClickSubscription=void 0}_getOverlayConfig(){return new Ae({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir??void 0,hasBackdrop:this._defaults?.hasBackdrop,backdropClass:this._defaults?.backdropClass||"cdk-overlay-transparent-backdrop",panelClass:this._overlayPanelClass,disableAnimations:this._animationsDisabled})}_getOverlayPosition(){let e=Se(this._injector,this._getConnectedElement()).withFlexibleDimensions(!1).withPush(!1).withPopoverLocation("inline");return this._setStrategyPositions(e),this._positionStrategy=e,e}_setStrategyPositions(e){let t=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],i=this._aboveClass,o=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:i},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:i}],n;this.position==="above"?n=o:this.position==="below"?n=t:n=[...t,...o],e.withPositions(n)}_getConnectedElement(){return this.connectedTo?this.connectedTo.elementRef:this._formField?this._formField.getConnectedOverlayOrigin():this._element}_getPanelWidth(){return this.autocomplete.panelWidth||this._getHostWidth()}_getHostWidth(){return this._getConnectedElement().nativeElement.getBoundingClientRect().width}_resetActiveItem(){let e=this.autocomplete;if(e.autoActiveFirstOption){let t=-1;for(let i=0;i<e.options.length;i++)if(!e.options.get(i).disabled){t=i;break}e._keyManager.setActiveItem(t)}else e._keyManager.setActiveItem(-1)}_canOpen(){let e=this._element.nativeElement;return!e.readOnly&&!e.disabled&&!this.autocompleteDisabled}_scrollToOption(e){let t=this.autocomplete,i=Fe(e,t.options,t.optionGroups);if(e===0&&i===1)t._setScrollTop(0);else if(t.panel){let o=t.options.toArray()[e];if(o){let n=o._getHostElement(),l=Le(n.offsetTop,n.offsetHeight,t._getScrollTop(),t.panel.nativeElement.offsetHeight);t._setScrollTop(l)}}}_trackedModal=null;_applyModalPanelOwnership(){let e=this._element.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!e)return;let t=this.autocomplete.id;this._trackedModal&&f(this._trackedModal,"aria-owns",t),k(e,"aria-owns",t),this._trackedModal=e}_clearFromModal(){if(this._trackedModal){let e=this.autocomplete.id;f(this._trackedModal,"aria-owns",e),this._trackedModal=null}}static \u0275fac=function(t){return new(t||a)};static \u0275dir=X({type:a,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-mdc-autocomplete-trigger"],hostVars:7,hostBindings:function(t,i){t&1&&te("focusin",function(){return i._handleFocus()})("blur",function(){return i._onTouched()})("input",function(n){return i._handleInput(n)})("keydown",function(n){return i._handleKeydown(n)})("click",function(){return i._handleClick()}),t&2&&P("autocomplete",i.autocompleteAttribute)("role",i.autocompleteDisabled?null:"combobox")("aria-autocomplete",i.autocompleteDisabled?null:"list")("aria-activedescendant",i.panelOpen&&i.activeOption?i.activeOption.id:null)("aria-expanded",i.autocompleteDisabled?null:i.panelOpen.toString())("aria-controls",i.autocompleteDisabled||!i.panelOpen||i.autocomplete==null?null:i.autocomplete.id)("aria-haspopup",i.autocompleteDisabled?null:"listbox")},inputs:{autocomplete:[0,"matAutocomplete","autocomplete"],position:[0,"matAutocompletePosition","position"],connectedTo:[0,"matAutocompleteConnectedTo","connectedTo"],autocompleteAttribute:[0,"autocomplete","autocompleteAttribute"],autocompleteDisabled:[2,"matAutocompleteDisabled","autocompleteDisabled",r]},exportAs:["matAutocompleteTrigger"],features:[C([qe]),j]})}return a})(),Ot=(()=>{class a{static \u0275fac=function(t){return new(t||a)};static \u0275mod=U({type:a});static \u0275inj=H({imports:[Pe,R,ye,R,ge]})}return a})();export{bt as a,Ge as b,Ot as c};