@whoz-oss/coday-client 0.97.2 → 0.98.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,10 +1,10 @@
|
|
|
1
|
-
import{a as Hm,b as Se}from"./chunk-KJ4PW3PQ.js";import{a as Do,b as Wm,c as Le,d as Ya,e as Qa,f as Xa,g as Ve,i as Ka,k as ze,m as Za,n as Ro,o as Um,q as Ja,r as $m,s as es,t as ts,u as qm,v as is,w as Fo,x as Gm,y as je}from"./chunk-LZXYIZHY.js";import{A as ic,B as zm,C as jm,D as He,E as rt,F as Tt,G as An,H as In,I as Qe,J as ft,K as Rr,L as ae,M as qa,N as Et,O as Ga,P as it,Q as he,R as Oe,S as Ym,T as Qm,a as za,b as ja,c as et,d as Rm,e as gi,f as Dr,g as Ri,h as Rt,i as Ba,j as Jl,k as Fm,l as Nm,m as Po,n as Ha,o as Wa,p as Oo,q as Re,r as gt,s as Lm,t as Vm,u as ec,v as Ua,w as Ao,x as $a,y as Io,z as tc}from"./chunk-7IQDWHG4.js";import{a as nn,b as _t}from"./chunk-2O4PKY5C.js";import{e as Bm}from"./chunk-OF4NB5FG.js";import{$ as be,$a as Zn,$b as Tm,A as Gl,Aa as T,Ab as Tn,B as Ea,Ba as re,Bb as qe,Ca as Ce,Cb as vm,D as lm,Da as gm,Db as ym,E as Eo,Ea as Mt,Eb as Jn,Fa as fm,Fb as Cm,G as Mr,Ga as $e,Gb as Pr,Ha as U,I as kt,Ia as de,Ib as Ra,J as Yn,Ja as Dt,Jb as xm,K as L,L as cm,La as Xl,Lb as hi,M as vt,Ma as Kl,Mb as Or,N as ye,Na as X,Nb as En,O as Qn,Ob as Ar,P as V,Pa as C,Pb as wm,Q as oe,Qa as x,Qb as Ge,R as ne,Ra as Kn,Rb as J,S as Pa,Sa as _m,Sb as ui,T as m,Ta as xe,Tb as Sm,Ua as we,Ub as km,V as dm,Va as w,W as Oa,Wa as s,Wb as Mm,X as v,Xa as l,Xb as Pn,Y as y,Ya as A,Yb as Fa,Z as en,Za as ii,Zb as Na,_ as Aa,_a as ni,_b as La,a as Z,aa as Je,ab as Da,ac as Ir,b as ut,ba as Yl,bb as M,c as im,cb as Zt,cc as Pe,d as ee,da as mm,db as _,e as Pi,ea as Ia,ec as Em,f as Oi,fa as Ee,fb as u,fc as Pm,g as R,ga as tt,gb as Be,h as le,ha as ti,hb as me,i as nm,ia as ie,ib as Ct,ja as pm,jb as Q,jc as Ye,k as It,kb as H,kc as Om,l as Mo,lb as W,lc as Di,m as om,ma as Tr,mb as bm,mc as Va,n as rm,nb as Er,nc as Am,o as _e,ob as Zl,oc as On,p as Gn,pa as Kt,pb as Jt,pc as Im,qa as Sn,qb as Ii,qc as Dm,r as To,ra as hm,rb as E,sa as d,sb as tn,t as am,ta as kn,tb as p,u as Ai,ua as pi,ub as F,v as ce,va as yt,vb as te,w as ql,wb as Mn,x as wn,xa as Xn,xb as z,y as sm,ya as um,yb as j,z as Ut,za as Ql,zb as B}from"./chunk-MFNSHXOA.js";var se=(function(o){return o[o.State=0]="State",o[o.Transition=1]="Transition",o[o.Sequence=2]="Sequence",o[o.Group=3]="Group",o[o.Animate=4]="Animate",o[o.Keyframes=5]="Keyframes",o[o.Style=6]="Style",o[o.Trigger=7]="Trigger",o[o.Reference=8]="Reference",o[o.AnimateChild=9]="AnimateChild",o[o.AnimateRef=10]="AnimateRef",o[o.Query=11]="Query",o[o.Stagger=12]="Stagger",o})(se||{}),oi="*";function nc(o,t){return{type:se.Trigger,name:o,definitions:t,options:{}}}function ns(o,t=null){return{type:se.Animate,styles:t,timings:o}}function Xm(o,t=null){return{type:se.Sequence,steps:o,options:t}}function Dn(o){return{type:se.Style,styles:o,offset:null}}function os(o,t,e=null){return{type:se.Transition,expr:o,animation:t,options:e}}var Fi=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(t=0,e=0){this.totalTime=t+e}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}onStart(t){this._originalOnStartFns.push(t),this._onStartFns.push(t)}onDone(t){this._originalOnDoneFns.push(t),this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(t){this._position=this.totalTime?t*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(t){let e=t=="start"?this._onStartFns:this._onDoneFns;e.forEach(i=>i()),e.length=0}},eo=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(t){this.players=t;let e=0,i=0,n=0,r=this.players.length;r==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(a=>{a.onDone(()=>{++e==r&&this._onFinish()}),a.onDestroy(()=>{++i==r&&this._onDestroy()}),a.onStart(()=>{++n==r&&this._onStart()})}),this.totalTime=this.players.reduce((a,c)=>Math.max(a,c.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this.players.forEach(t=>t.init())}onStart(t){this._onStartFns.push(t)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(t=>t()),this._onStartFns=[])}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(t=>t.play())}pause(){this.players.forEach(t=>t.pause())}restart(){this.players.forEach(t=>t.restart())}finish(){this._onFinish(),this.players.forEach(t=>t.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(t=>t.destroy()),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this.players.forEach(t=>t.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(t){let e=t*this.totalTime;this.players.forEach(i=>{let n=i.totalTime?Math.min(1,e/i.totalTime):1;i.setPosition(n)})}getPosition(){let t=this.players.reduce((e,i)=>e===null||i.totalTime>e.totalTime?i:e,null);return t!=null?t.getPosition():0}beforeDestroy(){this.players.forEach(t=>{t.beforeDestroy&&t.beforeDestroy()})}triggerCallback(t){let e=t=="start"?this._onStartFns:this._onDoneFns;e.forEach(i=>i()),e.length=0}},No="!";function Km(o){return new ye(3e3,!1)}function Ig(){return new ye(3100,!1)}function Dg(){return new ye(3101,!1)}function Rg(o){return new ye(3001,!1)}function Fg(o){return new ye(3003,!1)}function Ng(o){return new ye(3004,!1)}function Jm(o,t){return new ye(3005,!1)}function ep(){return new ye(3006,!1)}function tp(){return new ye(3007,!1)}function ip(o,t){return new ye(3008,!1)}function np(o){return new ye(3002,!1)}function op(o,t,e,i,n){return new ye(3010,!1)}function rp(){return new ye(3011,!1)}function ap(){return new ye(3012,!1)}function sp(){return new ye(3200,!1)}function lp(){return new ye(3202,!1)}function cp(){return new ye(3013,!1)}function dp(o){return new ye(3014,!1)}function mp(o){return new ye(3015,!1)}function pp(o){return new ye(3016,!1)}function hp(o,t){return new ye(3404,!1)}function Lg(o){return new ye(3502,!1)}function up(o){return new ye(3503,!1)}function gp(){return new ye(3300,!1)}function fp(o){return new ye(3504,!1)}function _p(o){return new ye(3301,!1)}function bp(o,t){return new ye(3302,!1)}function vp(o){return new ye(3303,!1)}function yp(o,t){return new ye(3400,!1)}function Cp(o){return new ye(3401,!1)}function xp(o){return new ye(3402,!1)}function wp(o,t){return new ye(3505,!1)}function on(o){switch(o.length){case 0:return new Fi;case 1:return o[0];default:return new eo(o)}}function sc(o,t,e=new Map,i=new Map){let n=[],r=[],a=-1,c=null;if(t.forEach(h=>{let g=h.get("offset"),b=g==a,S=b&&c||new Map;h.forEach((P,N)=>{let k=N,I=P;if(N!=="offset")switch(k=o.normalizePropertyName(k,n),I){case No:I=e.get(N);break;case oi:I=i.get(N);break;default:I=o.normalizeStyleValue(N,k,I,n);break}S.set(k,I)}),b||r.push(S),c=S,a=g}),n.length)throw Lg(n);return r}function rs(o,t,e,i){switch(t){case"start":o.onStart(()=>i(e&&oc(e,"start",o)));break;case"done":o.onDone(()=>i(e&&oc(e,"done",o)));break;case"destroy":o.onDestroy(()=>i(e&&oc(e,"destroy",o)));break}}function oc(o,t,e){let i=e.totalTime,n=!!e.disabled,r=as(o.element,o.triggerName,o.fromState,o.toState,t||o.phaseName,i??o.totalTime,n),a=o._data;return a!=null&&(r._data=a),r}function as(o,t,e,i,n="",r=0,a){return{element:o,triggerName:t,fromState:e,toState:i,phaseName:n,totalTime:r,disabled:!!a}}function $t(o,t,e){let i=o.get(t);return i||o.set(t,i=e),i}function lc(o){let t=o.indexOf(":"),e=o.substring(1,t),i=o.slice(t+1);return[e,i]}var Vg=typeof document>"u"?null:document.documentElement;function ss(o){let t=o.parentNode||o.host||null;return t===Vg?null:t}function zg(o){return o.substring(1,6)=="ebkit"}var to=null,Zm=!1;function Sp(o){to||(to=jg()||{},Zm=to.style?"WebkitAppearance"in to.style:!1);let t=!0;return to.style&&!zg(o)&&(t=o in to.style,!t&&Zm&&(t="Webkit"+o.charAt(0).toUpperCase()+o.slice(1)in to.style)),t}function jg(){return typeof document<"u"?document.body:null}function cc(o,t){for(;t;){if(t===o)return!0;t=ss(t)}return!1}function dc(o,t,e){if(e)return Array.from(o.querySelectorAll(t));let i=o.querySelector(t);return i?[i]:[]}var Bg=1e3,mc="{{",Hg="}}",pc="ng-enter",ls="ng-leave",Fr="ng-trigger",Nr=".ng-trigger",hc="ng-animating",cs=".ng-animating";function Ni(o){if(typeof o=="number")return o;let t=o.match(/^(-?[\.\d]+)(m?s)/);return!t||t.length<2?0:rc(parseFloat(t[1]),t[2])}function rc(o,t){switch(t){case"s":return o*Bg;default:return o}}function Lr(o,t,e){return o.hasOwnProperty("duration")?o:Ug(o,t,e)}var Wg=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;function Ug(o,t,e){let i,n=0,r="";if(typeof o=="string"){let a=o.match(Wg);if(a===null)return t.push(Km(o)),{duration:0,delay:0,easing:""};i=rc(parseFloat(a[1]),a[2]);let c=a[3];c!=null&&(n=rc(parseFloat(c),a[4]));let h=a[5];h&&(r=h)}else i=o;if(!e){let a=!1,c=t.length;i<0&&(t.push(Ig()),a=!0),n<0&&(t.push(Dg()),a=!0),a&&t.splice(c,0,Km(o))}return{duration:i,delay:n,easing:r}}function kp(o){return o.length?o[0]instanceof Map?o:o.map(t=>new Map(Object.entries(t))):[]}function fi(o,t,e){t.forEach((i,n)=>{let r=ds(n);e&&!e.has(n)&&e.set(n,o.style[r]),o.style[r]=i})}function Rn(o,t){t.forEach((e,i)=>{let n=ds(i);o.style[n]=""})}function Lo(o){return Array.isArray(o)?o.length==1?o[0]:Xm(o):o}function Mp(o,t,e){let i=t.params||{},n=uc(o);n.length&&n.forEach(r=>{i.hasOwnProperty(r)||e.push(Rg(r))})}var ac=new RegExp(`${mc}\\s*(.+?)\\s*${Hg}`,"g");function uc(o){let t=[];if(typeof o=="string"){let e;for(;e=ac.exec(o);)t.push(e[1]);ac.lastIndex=0}return t}function Vo(o,t,e){let i=`${o}`,n=i.replace(ac,(r,a)=>{let c=t[a];return c==null&&(e.push(Fg(a)),c=""),c.toString()});return n==i?o:n}var $g=/-+([a-z0-9])/g;function ds(o){return o.replace($g,(...t)=>t[1].toUpperCase())}function Tp(o,t){return o===0||t===0}function Ep(o,t,e){if(e.size&&t.length){let i=t[0],n=[];if(e.forEach((r,a)=>{i.has(a)||n.push(a),i.set(a,r)}),n.length)for(let r=1;r<t.length;r++){let a=t[r];n.forEach(c=>a.set(c,ms(o,c)))}}return t}function qt(o,t,e){switch(t.type){case se.Trigger:return o.visitTrigger(t,e);case se.State:return o.visitState(t,e);case se.Transition:return o.visitTransition(t,e);case se.Sequence:return o.visitSequence(t,e);case se.Group:return o.visitGroup(t,e);case se.Animate:return o.visitAnimate(t,e);case se.Keyframes:return o.visitKeyframes(t,e);case se.Style:return o.visitStyle(t,e);case se.Reference:return o.visitReference(t,e);case se.AnimateChild:return o.visitAnimateChild(t,e);case se.AnimateRef:return o.visitAnimateRef(t,e);case se.Query:return o.visitQuery(t,e);case se.Stagger:return o.visitStagger(t,e);default:throw Ng(t.type)}}function ms(o,t){return window.getComputedStyle(o)[t]}var Ac=(()=>{class o{validateStyleProperty(e){return Sp(e)}containsElement(e,i){return cc(e,i)}getParentElement(e){return ss(e)}query(e,i,n){return dc(e,i,n)}computeStyle(e,i,n){return n||""}animate(e,i,n,r,a,c=[],h){return new Fi(n,r)}static \u0275fac=function(i){return new(i||o)};static \u0275prov=V({token:o,factory:o.\u0275fac})}return o})(),no=class{static NOOP=new Ac},oo=class{};var qg=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"]),fs=class extends oo{normalizePropertyName(t,e){return ds(t)}normalizeStyleValue(t,e,i,n){let r="",a=i.toString().trim();if(qg.has(e)&&i!==0&&i!=="0")if(typeof i=="number")r="px";else{let c=i.match(/^[+-]?[\d\.]+([a-z]*)$/);c&&c[1].length==0&&n.push(Jm(t,i))}return a+r}};var _s="*";function Gg(o,t){let e=[];return typeof o=="string"?o.split(/\s*,\s*/).forEach(i=>Yg(i,e,t)):e.push(o),e}function Yg(o,t,e){if(o[0]==":"){let h=Qg(o,e);if(typeof h=="function"){t.push(h);return}o=h}let i=o.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(i==null||i.length<4)return e.push(mp(o)),t;let n=i[1],r=i[2],a=i[3];t.push(Pp(n,a));let c=n==_s&&a==_s;r[0]=="<"&&!c&&t.push(Pp(a,n))}function Qg(o,t){switch(o){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(e,i)=>parseFloat(i)>parseFloat(e);case":decrement":return(e,i)=>parseFloat(i)<parseFloat(e);default:return t.push(pp(o)),"* => *"}}var ps=new Set(["true","1"]),hs=new Set(["false","0"]);function Pp(o,t){let e=ps.has(o)||hs.has(o),i=ps.has(t)||hs.has(t);return(n,r)=>{let a=o==_s||o==n,c=t==_s||t==r;return!a&&e&&typeof n=="boolean"&&(a=n?ps.has(o):hs.has(o)),!c&&i&&typeof r=="boolean"&&(c=r?ps.has(t):hs.has(t)),a&&c}}var zp=":self",Xg=new RegExp(`s*${zp}s*,?`,"g");function jp(o,t,e,i){return new yc(o).build(t,e,i)}var Op="",yc=class{_driver;constructor(t){this._driver=t}build(t,e,i){let n=new Cc(e);return this._resetContextStyleTimingState(n),qt(this,Lo(t),n)}_resetContextStyleTimingState(t){t.currentQuerySelector=Op,t.collectedStyles=new Map,t.collectedStyles.set(Op,new Map),t.currentTime=0}visitTrigger(t,e){let i=e.queryCount=0,n=e.depCount=0,r=[],a=[];return t.name.charAt(0)=="@"&&e.errors.push(ep()),t.definitions.forEach(c=>{if(this._resetContextStyleTimingState(e),c.type==se.State){let h=c,g=h.name;g.toString().split(/\s*,\s*/).forEach(b=>{h.name=b,r.push(this.visitState(h,e))}),h.name=g}else if(c.type==se.Transition){let h=this.visitTransition(c,e);i+=h.queryCount,n+=h.depCount,a.push(h)}else e.errors.push(tp())}),{type:se.Trigger,name:t.name,states:r,transitions:a,queryCount:i,depCount:n,options:null}}visitState(t,e){let i=this.visitStyle(t.styles,e),n=t.options&&t.options.params||null;if(i.containsDynamicStyles){let r=new Set,a=n||{};i.styles.forEach(c=>{c instanceof Map&&c.forEach(h=>{uc(h).forEach(g=>{a.hasOwnProperty(g)||r.add(g)})})}),r.size&&e.errors.push(ip(t.name,[...r.values()]))}return{type:se.State,name:t.name,style:i,options:n?{params:n}:null}}visitTransition(t,e){e.queryCount=0,e.depCount=0;let i=qt(this,Lo(t.animation),e),n=Gg(t.expr,e.errors);return{type:se.Transition,matchers:n,animation:i,queryCount:e.queryCount,depCount:e.depCount,options:io(t.options)}}visitSequence(t,e){return{type:se.Sequence,steps:t.steps.map(i=>qt(this,i,e)),options:io(t.options)}}visitGroup(t,e){let i=e.currentTime,n=0,r=t.steps.map(a=>{e.currentTime=i;let c=qt(this,a,e);return n=Math.max(n,e.currentTime),c});return e.currentTime=n,{type:se.Group,steps:r,options:io(t.options)}}visitAnimate(t,e){let i=ef(t.timings,e.errors);e.currentAnimateTimings=i;let n,r=t.styles?t.styles:Dn({});if(r.type==se.Keyframes)n=this.visitKeyframes(r,e);else{let a=t.styles,c=!1;if(!a){c=!0;let g={};i.easing&&(g.easing=i.easing),a=Dn(g)}e.currentTime+=i.duration+i.delay;let h=this.visitStyle(a,e);h.isEmptyStep=c,n=h}return e.currentAnimateTimings=null,{type:se.Animate,timings:i,style:n,options:null}}visitStyle(t,e){let i=this._makeStyleAst(t,e);return this._validateStyleAst(i,e),i}_makeStyleAst(t,e){let i=[],n=Array.isArray(t.styles)?t.styles:[t.styles];for(let c of n)typeof c=="string"?c===oi?i.push(c):e.errors.push(np(c)):i.push(new Map(Object.entries(c)));let r=!1,a=null;return i.forEach(c=>{if(c instanceof Map&&(c.has("easing")&&(a=c.get("easing"),c.delete("easing")),!r)){for(let h of c.values())if(h.toString().indexOf(mc)>=0){r=!0;break}}}),{type:se.Style,styles:i,easing:a,offset:t.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(t,e){let i=e.currentAnimateTimings,n=e.currentTime,r=e.currentTime;i&&r>0&&(r-=i.duration+i.delay),t.styles.forEach(a=>{typeof a!="string"&&a.forEach((c,h)=>{let g=e.collectedStyles.get(e.currentQuerySelector),b=g.get(h),S=!0;b&&(r!=n&&r>=b.startTime&&n<=b.endTime&&(e.errors.push(op(h,b.startTime,b.endTime,r,n)),S=!1),r=b.startTime),S&&g.set(h,{startTime:r,endTime:n}),e.options&&Mp(c,e.options,e.errors)})})}visitKeyframes(t,e){let i={type:se.Keyframes,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push(rp()),i;let n=1,r=0,a=[],c=!1,h=!1,g=0,b=t.steps.map(ke=>{let ve=this._makeStyleAst(ke,e),Ke=ve.offset!=null?ve.offset:Jg(ve.styles),ge=0;return Ke!=null&&(r++,ge=ve.offset=Ke),h=h||ge<0||ge>1,c=c||ge<g,g=ge,a.push(ge),ve});h&&e.errors.push(ap()),c&&e.errors.push(sp());let S=t.steps.length,P=0;r>0&&r<S?e.errors.push(lp()):r==0&&(P=n/(S-1));let N=S-1,k=e.currentTime,I=e.currentAnimateTimings,pe=I.duration;return b.forEach((ke,ve)=>{let Ke=P>0?ve==N?1:P*ve:a[ve],ge=Ke*pe;e.currentTime=k+I.delay+ge,I.duration=ge,this._validateStyleAst(ke,e),ke.offset=Ke,i.styles.push(ke)}),i}visitReference(t,e){return{type:se.Reference,animation:qt(this,Lo(t.animation),e),options:io(t.options)}}visitAnimateChild(t,e){return e.depCount++,{type:se.AnimateChild,options:io(t.options)}}visitAnimateRef(t,e){return{type:se.AnimateRef,animation:this.visitReference(t.animation,e),options:io(t.options)}}visitQuery(t,e){let i=e.currentQuerySelector,n=t.options||{};e.queryCount++,e.currentQuery=t;let[r,a]=Kg(t.selector);e.currentQuerySelector=i.length?i+" "+r:r,$t(e.collectedStyles,e.currentQuerySelector,new Map);let c=qt(this,Lo(t.animation),e);return e.currentQuery=null,e.currentQuerySelector=i,{type:se.Query,selector:r,limit:n.limit||0,optional:!!n.optional,includeSelf:a,animation:c,originalSelector:t.selector,options:io(t.options)}}visitStagger(t,e){e.currentQuery||e.errors.push(cp());let i=t.timings==="full"?{duration:0,delay:0,easing:"full"}:Lr(t.timings,e.errors,!0);return{type:se.Stagger,animation:qt(this,Lo(t.animation),e),timings:i,options:null}}};function Kg(o){let t=!!o.split(/\s*,\s*/).find(e=>e==zp);return t&&(o=o.replace(Xg,"")),o=o.replace(/@\*/g,Nr).replace(/@\w+/g,e=>Nr+"-"+e.slice(1)).replace(/:animating/g,cs),[o,t]}function Zg(o){return o?Z({},o):null}var Cc=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(t){this.errors=t}};function Jg(o){if(typeof o=="string")return null;let t=null;if(Array.isArray(o))o.forEach(e=>{if(e instanceof Map&&e.has("offset")){let i=e;t=parseFloat(i.get("offset")),i.delete("offset")}});else if(o instanceof Map&&o.has("offset")){let e=o;t=parseFloat(e.get("offset")),e.delete("offset")}return t}function ef(o,t){if(o.hasOwnProperty("duration"))return o;if(typeof o=="number"){let r=Lr(o,t).duration;return gc(r,0,"")}let e=o;if(e.split(/\s+/).some(r=>r.charAt(0)=="{"&&r.charAt(1)=="{")){let r=gc(0,0,"");return r.dynamic=!0,r.strValue=e,r}let n=Lr(e,t);return gc(n.duration,n.delay,n.easing)}function io(o){return o?(o=Z({},o),o.params&&(o.params=Zg(o.params))):o={},o}function gc(o,t,e){return{duration:o,delay:t,easing:e}}function Ic(o,t,e,i,n,r,a=null,c=!1){return{type:1,element:o,keyframes:t,preStyleProps:e,postStyleProps:i,duration:n,delay:r,totalTime:n+r,easing:a,subTimeline:c}}var zr=class{_map=new Map;get(t){return this._map.get(t)||[]}append(t,e){let i=this._map.get(t);i||this._map.set(t,i=[]),i.push(...e)}has(t){return this._map.has(t)}clear(){this._map.clear()}},tf=1,nf=":enter",of=new RegExp(nf,"g"),rf=":leave",af=new RegExp(rf,"g");function Bp(o,t,e,i,n,r=new Map,a=new Map,c,h,g=[]){return new xc().buildKeyframes(o,t,e,i,n,r,a,c,h,g)}var xc=class{buildKeyframes(t,e,i,n,r,a,c,h,g,b=[]){g=g||new zr;let S=new wc(t,e,g,n,r,b,[]);S.options=h;let P=h.delay?Ni(h.delay):0;S.currentTimeline.delayNextStep(P),S.currentTimeline.setStyles([a],null,S.errors,h),qt(this,i,S);let N=S.timelines.filter(k=>k.containsAnimation());if(N.length&&c.size){let k;for(let I=N.length-1;I>=0;I--){let pe=N[I];if(pe.element===e){k=pe;break}}k&&!k.allowOnlyTimelineStyles()&&k.setStyles([c],null,S.errors,h)}return N.length?N.map(k=>k.buildKeyframes()):[Ic(e,[],[],[],0,P,"",!1)]}visitTrigger(t,e){}visitState(t,e){}visitTransition(t,e){}visitAnimateChild(t,e){let i=e.subInstructions.get(e.element);if(i){let n=e.createSubContext(t.options),r=e.currentTimeline.currentTime,a=this._visitSubInstructions(i,n,n.options);r!=a&&e.transformIntoNewTimeline(a)}e.previousNode=t}visitAnimateRef(t,e){let i=e.createSubContext(t.options);i.transformIntoNewTimeline(),this._applyAnimationRefDelays([t.options,t.animation.options],e,i),this.visitReference(t.animation,i),e.transformIntoNewTimeline(i.currentTimeline.currentTime),e.previousNode=t}_applyAnimationRefDelays(t,e,i){for(let n of t){let r=n?.delay;if(r){let a=typeof r=="number"?r:Ni(Vo(r,n?.params??{},e.errors));i.delayNextStep(a)}}}_visitSubInstructions(t,e,i){let r=e.currentTimeline.currentTime,a=i.duration!=null?Ni(i.duration):null,c=i.delay!=null?Ni(i.delay):null;return a!==0&&t.forEach(h=>{let g=e.appendInstructionToTimeline(h,a,c);r=Math.max(r,g.duration+g.delay)}),r}visitReference(t,e){e.updateOptions(t.options,!0),qt(this,t.animation,e),e.previousNode=t}visitSequence(t,e){let i=e.subContextCount,n=e,r=t.options;if(r&&(r.params||r.delay)&&(n=e.createSubContext(r),n.transformIntoNewTimeline(),r.delay!=null)){n.previousNode.type==se.Style&&(n.currentTimeline.snapshotCurrentStyles(),n.previousNode=bs);let a=Ni(r.delay);n.delayNextStep(a)}t.steps.length&&(t.steps.forEach(a=>qt(this,a,n)),n.currentTimeline.applyStylesToKeyframe(),n.subContextCount>i&&n.transformIntoNewTimeline()),e.previousNode=t}visitGroup(t,e){let i=[],n=e.currentTimeline.currentTime,r=t.options&&t.options.delay?Ni(t.options.delay):0;t.steps.forEach(a=>{let c=e.createSubContext(t.options);r&&c.delayNextStep(r),qt(this,a,c),n=Math.max(n,c.currentTimeline.currentTime),i.push(c.currentTimeline)}),i.forEach(a=>e.currentTimeline.mergeTimelineCollectedStyles(a)),e.transformIntoNewTimeline(n),e.previousNode=t}_visitTiming(t,e){if(t.dynamic){let i=t.strValue,n=e.params?Vo(i,e.params,e.errors):i;return Lr(n,e.errors)}else return{duration:t.duration,delay:t.delay,easing:t.easing}}visitAnimate(t,e){let i=e.currentAnimateTimings=this._visitTiming(t.timings,e),n=e.currentTimeline;i.delay&&(e.incrementTime(i.delay),n.snapshotCurrentStyles());let r=t.style;r.type==se.Keyframes?this.visitKeyframes(r,e):(e.incrementTime(i.duration),this.visitStyle(r,e),n.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=t}visitStyle(t,e){let i=e.currentTimeline,n=e.currentAnimateTimings;!n&&i.hasCurrentStyleProperties()&&i.forwardFrame();let r=n&&n.easing||t.easing;t.isEmptyStep?i.applyEmptyStep(r):i.setStyles(t.styles,r,e.errors,e.options),e.previousNode=t}visitKeyframes(t,e){let i=e.currentAnimateTimings,n=e.currentTimeline.duration,r=i.duration,c=e.createSubContext().currentTimeline;c.easing=i.easing,t.styles.forEach(h=>{let g=h.offset||0;c.forwardTime(g*r),c.setStyles(h.styles,h.easing,e.errors,e.options),c.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(c),e.transformIntoNewTimeline(n+r),e.previousNode=t}visitQuery(t,e){let i=e.currentTimeline.currentTime,n=t.options||{},r=n.delay?Ni(n.delay):0;r&&(e.previousNode.type===se.Style||i==0&&e.currentTimeline.hasCurrentStyleProperties())&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=bs);let a=i,c=e.invokeQuery(t.selector,t.originalSelector,t.limit,t.includeSelf,!!n.optional,e.errors);e.currentQueryTotal=c.length;let h=null;c.forEach((g,b)=>{e.currentQueryIndex=b;let S=e.createSubContext(t.options,g);r&&S.delayNextStep(r),g===e.element&&(h=S.currentTimeline),qt(this,t.animation,S),S.currentTimeline.applyStylesToKeyframe();let P=S.currentTimeline.currentTime;a=Math.max(a,P)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(a),h&&(e.currentTimeline.mergeTimelineCollectedStyles(h),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=t}visitStagger(t,e){let i=e.parentContext,n=e.currentTimeline,r=t.timings,a=Math.abs(r.duration),c=a*(e.currentQueryTotal-1),h=a*e.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":h=c-h;break;case"full":h=i.currentStaggerTime;break}let b=e.currentTimeline;h&&b.delayNextStep(h);let S=b.currentTime;qt(this,t.animation,e),e.previousNode=t,i.currentStaggerTime=n.currentTime-S+(n.startTime-i.currentTimeline.startTime)}},bs={},wc=class o{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=bs;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(t,e,i,n,r,a,c,h){this._driver=t,this.element=e,this.subInstructions=i,this._enterClassName=n,this._leaveClassName=r,this.errors=a,this.timelines=c,this.currentTimeline=h||new vs(this._driver,e,0),c.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(t,e){if(!t)return;let i=t,n=this.options;i.duration!=null&&(n.duration=Ni(i.duration)),i.delay!=null&&(n.delay=Ni(i.delay));let r=i.params;if(r){let a=n.params;a||(a=this.options.params={}),Object.keys(r).forEach(c=>{(!e||!a.hasOwnProperty(c))&&(a[c]=Vo(r[c],a,this.errors))})}}_copyOptions(){let t={};if(this.options){let e=this.options.params;if(e){let i=t.params={};Object.keys(e).forEach(n=>{i[n]=e[n]})}}return t}createSubContext(t=null,e,i){let n=e||this.element,r=new o(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(t),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(t){return this.previousNode=bs,this.currentTimeline=this.currentTimeline.fork(this.element,t),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(t,e,i){let n={duration:e??t.duration,delay:this.currentTimeline.currentTime+(i??0)+t.delay,easing:""},r=new Sc(this._driver,t.element,t.keyframes,t.preStyleProps,t.postStyleProps,n,t.stretchStartingKeyframe);return this.timelines.push(r),n}incrementTime(t){this.currentTimeline.forwardTime(this.currentTimeline.duration+t)}delayNextStep(t){t>0&&this.currentTimeline.delayNextStep(t)}invokeQuery(t,e,i,n,r,a){let c=[];if(n&&c.push(this.element),t.length>0){t=t.replace(of,"."+this._enterClassName),t=t.replace(af,"."+this._leaveClassName);let h=i!=1,g=this._driver.query(this.element,t,h);i!==0&&(g=i<0?g.slice(g.length+i,g.length):g.slice(0,i)),c.push(...g)}return!r&&c.length==0&&a.push(dp(e)),c}},vs=class o{_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(t,e,i,n){this._driver=t,this.element=e,this.startTime=i,this._elementTimelineStylesLookup=n,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(e),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(e,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(t){let e=this._keyframes.size===1&&this._pendingStyles.size;this.duration||e?(this.forwardTime(this.currentTime+t),e&&this.snapshotCurrentStyles()):this.startTime+=t}fork(t,e){return this.applyStylesToKeyframe(),new o(this._driver,t,e||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+=tf,this._loadKeyframe()}forwardTime(t){this.applyStylesToKeyframe(),this.duration=t,this._loadKeyframe()}_updateStyle(t,e){this._localTimelineStyles.set(t,e),this._globalTimelineStyles.set(t,e),this._styleSummary.set(t,{time:this.currentTime,value:e})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(t){t&&this._previousKeyframe.set("easing",t);for(let[e,i]of this._globalTimelineStyles)this._backFill.set(e,i||oi),this._currentKeyframe.set(e,oi);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(t,e,i,n){e&&this._previousKeyframe.set("easing",e);let r=n&&n.params||{},a=sf(t,this._globalTimelineStyles);for(let[c,h]of a){let g=Vo(h,r,i);this._pendingStyles.set(c,g),this._localTimelineStyles.has(c)||this._backFill.set(c,this._globalTimelineStyles.get(c)??oi),this._updateStyle(c,g)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((t,e)=>{this._currentKeyframe.set(e,t)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((t,e)=>{this._currentKeyframe.has(e)||this._currentKeyframe.set(e,t)}))}snapshotCurrentStyles(){for(let[t,e]of this._localTimelineStyles)this._pendingStyles.set(t,e),this._updateStyle(t,e)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let t=[];for(let e in this._currentKeyframe)t.push(e);return t}mergeTimelineCollectedStyles(t){t._styleSummary.forEach((e,i)=>{let n=this._styleSummary.get(i);(!n||e.time>n.time)&&this._updateStyle(i,e.value)})}buildKeyframes(){this.applyStylesToKeyframe();let t=new Set,e=new Set,i=this._keyframes.size===1&&this.duration===0,n=[];this._keyframes.forEach((c,h)=>{let g=new Map([...this._backFill,...c]);g.forEach((b,S)=>{b===No?t.add(S):b===oi&&e.add(S)}),i||g.set("offset",h/this.duration),n.push(g)});let r=[...t.values()],a=[...e.values()];if(i){let c=n[0],h=new Map(c);c.set("offset",0),h.set("offset",1),n=[c,h]}return Ic(this.element,n,r,a,this.duration,this.startTime,this.easing,!1)}},Sc=class extends vs{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(t,e,i,n,r,a,c=!1){super(t,e,a.delay),this.keyframes=i,this.preStyleProps=n,this.postStyleProps=r,this._stretchStartingKeyframe=c,this.timings={duration:a.duration,delay:a.delay,easing:a.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let t=this.keyframes,{delay:e,duration:i,easing:n}=this.timings;if(this._stretchStartingKeyframe&&e){let r=[],a=i+e,c=e/a,h=new Map(t[0]);h.set("offset",0),r.push(h);let g=new Map(t[0]);g.set("offset",Ap(c)),r.push(g);let b=t.length-1;for(let S=1;S<=b;S++){let P=new Map(t[S]),N=P.get("offset"),k=e+N*i;P.set("offset",Ap(k/a)),r.push(P)}i=a,e=0,n="",t=r}return Ic(this.element,t,this.preStyleProps,this.postStyleProps,i,e,n,!0)}};function Ap(o,t=3){let e=Math.pow(10,t-1);return Math.round(o*e)/e}function sf(o,t){let e=new Map,i;return o.forEach(n=>{if(n==="*"){i??=t.keys();for(let r of i)e.set(r,oi)}else for(let[r,a]of n)e.set(r,a)}),e}function Ip(o,t,e,i,n,r,a,c,h,g,b,S,P){return{type:0,element:o,triggerName:t,isRemovalTransition:n,fromState:e,fromStyles:r,toState:i,toStyles:a,timelines:c,queriedElements:h,preStyleProps:g,postStyleProps:b,totalTime:S,errors:P}}var fc={},ys=class{_triggerName;ast;_stateStyles;constructor(t,e,i){this._triggerName=t,this.ast=e,this._stateStyles=i}match(t,e,i,n){return lf(this.ast.matchers,t,e,i,n)}buildStyles(t,e,i){let n=this._stateStyles.get("*");return t!==void 0&&(n=this._stateStyles.get(t?.toString())||n),n?n.buildStyles(e,i):new Map}build(t,e,i,n,r,a,c,h,g,b){let S=[],P=this.ast.options&&this.ast.options.params||fc,N=c&&c.params||fc,k=this.buildStyles(i,N,S),I=h&&h.params||fc,pe=this.buildStyles(n,I,S),ke=new Set,ve=new Map,Ke=new Map,ge=n==="void",Bt={params:Hp(I,P),delay:this.ast.options?.delay},pt=b?[]:Bp(t,e,this.ast.animation,r,a,k,pe,Bt,g,S),Ze=0;return pt.forEach(xt=>{Ze=Math.max(xt.duration+xt.delay,Ze)}),S.length?Ip(e,this._triggerName,i,n,ge,k,pe,[],[],ve,Ke,Ze,S):(pt.forEach(xt=>{let Xi=xt.element,Cn=$t(ve,Xi,new Set);xt.preStyleProps.forEach(mi=>Cn.add(mi));let ht=$t(Ke,Xi,new Set);xt.postStyleProps.forEach(mi=>ht.add(mi)),Xi!==e&&ke.add(Xi)}),Ip(e,this._triggerName,i,n,ge,k,pe,pt,[...ke.values()],ve,Ke,Ze))}};function lf(o,t,e,i,n){return o.some(r=>r(t,e,i,n))}function Hp(o,t){let e=Z({},t);return Object.entries(o).forEach(([i,n])=>{n!=null&&(e[i]=n)}),e}var kc=class{styles;defaultParams;normalizer;constructor(t,e,i){this.styles=t,this.defaultParams=e,this.normalizer=i}buildStyles(t,e){let i=new Map,n=Hp(t,this.defaultParams);return this.styles.styles.forEach(r=>{typeof r!="string"&&r.forEach((a,c)=>{a&&(a=Vo(a,n,e));let h=this.normalizer.normalizePropertyName(c,e);a=this.normalizer.normalizeStyleValue(c,h,a,e),i.set(c,a)})}),i}};function cf(o,t,e){return new Mc(o,t,e)}var Mc=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(t,e,i){this.name=t,this.ast=e,this._normalizer=i,e.states.forEach(n=>{let r=n.options&&n.options.params||{};this.states.set(n.name,new kc(n.style,r,i))}),Dp(this.states,"true","1"),Dp(this.states,"false","0"),e.transitions.forEach(n=>{this.transitionFactories.push(new ys(t,n,this.states))}),this.fallbackTransition=df(t,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(t,e,i,n){return this.transitionFactories.find(a=>a.match(t,e,i,n))||null}matchStyles(t,e,i){return this.fallbackTransition.buildStyles(t,e,i)}};function df(o,t,e){let i=[(a,c)=>!0],n={type:se.Sequence,steps:[],options:null},r={type:se.Transition,animation:n,matchers:i,options:null,queryCount:0,depCount:0};return new ys(o,r,t)}function Dp(o,t,e){o.has(t)?o.has(e)||o.set(e,o.get(t)):o.has(e)&&o.set(t,o.get(e))}var mf=new zr,Tc=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(t,e,i){this.bodyNode=t,this._driver=e,this._normalizer=i}register(t,e){let i=[],n=[],r=jp(this._driver,e,i,n);if(i.length)throw up(i);this._animations.set(t,r)}_buildPlayer(t,e,i){let n=t.element,r=sc(this._normalizer,t.keyframes,e,i);return this._driver.animate(n,r,t.duration,t.delay,t.easing,[],!0)}create(t,e,i={}){let n=[],r=this._animations.get(t),a,c=new Map;if(r?(a=Bp(this._driver,e,r,pc,ls,new Map,new Map,i,mf,n),a.forEach(b=>{let S=$t(c,b.element,new Map);b.postStyleProps.forEach(P=>S.set(P,null))})):(n.push(gp()),a=[]),n.length)throw fp(n);c.forEach((b,S)=>{b.forEach((P,N)=>{b.set(N,this._driver.computeStyle(S,N,oi))})});let h=a.map(b=>{let S=c.get(b.element);return this._buildPlayer(b,new Map,S)}),g=on(h);return this._playersById.set(t,g),g.onDestroy(()=>this.destroy(t)),this.players.push(g),g}destroy(t){let e=this._getPlayer(t);e.destroy(),this._playersById.delete(t);let i=this.players.indexOf(e);i>=0&&this.players.splice(i,1)}_getPlayer(t){let e=this._playersById.get(t);if(!e)throw _p(t);return e}listen(t,e,i,n){let r=as(e,"","","");return rs(this._getPlayer(t),i,r,n),()=>{}}command(t,e,i,n){if(i=="register"){this.register(t,n[0]);return}if(i=="create"){let a=n[0]||{};this.create(t,e,a);return}let r=this._getPlayer(t);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(t);break}}},Rp="ng-animate-queued",pf=".ng-animate-queued",_c="ng-animate-disabled",hf=".ng-animate-disabled",uf="ng-star-inserted",gf=".ng-star-inserted",ff=[],Wp={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},_f={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},_i="__ng_removed",jr=class{namespaceId;value;options;get params(){return this.options.params}constructor(t,e=""){this.namespaceId=e;let i=t&&t.hasOwnProperty("value"),n=i?t.value:t;if(this.value=vf(n),i){let r=t,{value:a}=r,c=im(r,["value"]);this.options=c}else this.options={};this.options.params||(this.options.params={})}absorbOptions(t){let e=t.params;if(e){let i=this.options.params;Object.keys(e).forEach(n=>{i[n]==null&&(i[n]=e[n])})}}},Vr="void",bc=new jr(Vr),Ec=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(t,e,i){this.id=t,this.hostElement=e,this._engine=i,this._hostClassName="ng-tns-"+t,ri(e,this._hostClassName)}listen(t,e,i,n){if(!this._triggers.has(e))throw bp(i,e);if(i==null||i.length==0)throw vp(e);if(!yf(i))throw yp(i,e);let r=$t(this._elementListeners,t,[]),a={name:e,phase:i,callback:n};r.push(a);let c=$t(this._engine.statesByElement,t,new Map);return c.has(e)||(ri(t,Fr),ri(t,Fr+"-"+e),c.set(e,bc)),()=>{this._engine.afterFlush(()=>{let h=r.indexOf(a);h>=0&&r.splice(h,1),this._triggers.has(e)||c.delete(e)})}}register(t,e){return this._triggers.has(t)?!1:(this._triggers.set(t,e),!0)}_getTrigger(t){let e=this._triggers.get(t);if(!e)throw Cp(t);return e}trigger(t,e,i,n=!0){let r=this._getTrigger(e),a=new Br(this.id,e,t),c=this._engine.statesByElement.get(t);c||(ri(t,Fr),ri(t,Fr+"-"+e),this._engine.statesByElement.set(t,c=new Map));let h=c.get(e),g=new jr(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&h&&g.absorbOptions(h.options),c.set(e,g),h||(h=bc),!(g.value===Vr)&&h.value===g.value){if(!wf(h.params,g.params)){let I=[],pe=r.matchStyles(h.value,h.params,I),ke=r.matchStyles(g.value,g.params,I);I.length?this._engine.reportError(I):this._engine.afterFlush(()=>{Rn(t,pe),fi(t,ke)})}return}let P=$t(this._engine.playersByElement,t,[]);P.forEach(I=>{I.namespaceId==this.id&&I.triggerName==e&&I.queued&&I.destroy()});let N=r.matchTransition(h.value,g.value,t,g.params),k=!1;if(!N){if(!n)return;N=r.fallbackTransition,k=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:e,transition:N,fromState:h,toState:g,player:a,isFallbackTransition:k}),k||(ri(t,Rp),a.onStart(()=>{zo(t,Rp)})),a.onDone(()=>{let I=this.players.indexOf(a);I>=0&&this.players.splice(I,1);let pe=this._engine.playersByElement.get(t);if(pe){let ke=pe.indexOf(a);ke>=0&&pe.splice(ke,1)}}),this.players.push(a),P.push(a),a}deregister(t){this._triggers.delete(t),this._engine.statesByElement.forEach(e=>e.delete(t)),this._elementListeners.forEach((e,i)=>{this._elementListeners.set(i,e.filter(n=>n.name!=t))})}clearElementCache(t){this._engine.statesByElement.delete(t),this._elementListeners.delete(t);let e=this._engine.playersByElement.get(t);e&&(e.forEach(i=>i.destroy()),this._engine.playersByElement.delete(t))}_signalRemovalForInnerTriggers(t,e){let i=this._engine.driver.query(t,Nr,!0);i.forEach(n=>{if(n[_i])return;let r=this._engine.fetchNamespacesByElement(n);r.size?r.forEach(a=>a.triggerLeaveAnimation(n,e,!1,!0)):this.clearElementCache(n)}),this._engine.afterFlushAnimationsDone(()=>i.forEach(n=>this.clearElementCache(n)))}triggerLeaveAnimation(t,e,i,n){let r=this._engine.statesByElement.get(t),a=new Map;if(r){let c=[];if(r.forEach((h,g)=>{if(a.set(g,h.value),this._triggers.has(g)){let b=this.trigger(t,g,Vr,n);b&&c.push(b)}}),c.length)return this._engine.markElementAsRemoved(this.id,t,!0,e,a),i&&on(c).onDone(()=>this._engine.processLeaveNode(t)),!0}return!1}prepareLeaveAnimationListeners(t){let e=this._elementListeners.get(t),i=this._engine.statesByElement.get(t);if(e&&i){let n=new Set;e.forEach(r=>{let a=r.name;if(n.has(a))return;n.add(a);let h=this._triggers.get(a).fallbackTransition,g=i.get(a)||bc,b=new jr(Vr),S=new Br(this.id,a,t);this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:a,transition:h,fromState:g,toState:b,player:S,isFallbackTransition:!0})})}}removeNode(t,e){let i=this._engine;if(t.childElementCount&&this._signalRemovalForInnerTriggers(t,e),this.triggerLeaveAnimation(t,e,!0))return;let n=!1;if(i.totalAnimations){let r=i.players.length?i.playersByQueriedElement.get(t):[];if(r&&r.length)n=!0;else{let a=t;for(;a=a.parentNode;)if(i.statesByElement.get(a)){n=!0;break}}}if(this.prepareLeaveAnimationListeners(t),n)i.markElementAsRemoved(this.id,t,!1,e);else{let r=t[_i];(!r||r===Wp)&&(i.afterFlush(()=>this.clearElementCache(t)),i.destroyInnerAnimations(t),i._onRemovalComplete(t,e))}}insertNode(t,e){ri(t,this._hostClassName)}drainQueuedTransitions(t){let e=[];return this._queue.forEach(i=>{let n=i.player;if(n.destroyed)return;let r=i.element,a=this._elementListeners.get(r);a&&a.forEach(c=>{if(c.name==i.triggerName){let h=as(r,i.triggerName,i.fromState.value,i.toState.value);h._data=t,rs(i.player,c.phase,h,c.callback)}}),n.markedForDestroy?this._engine.afterFlush(()=>{n.destroy()}):e.push(i)}),this._queue=[],e.sort((i,n)=>{let r=i.transition.ast.depCount,a=n.transition.ast.depCount;return r==0||a==0?r-a:this._engine.driver.containsElement(i.element,n.element)?1:-1})}destroy(t){this.players.forEach(e=>e.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,t)}},Pc=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=(t,e)=>{};_onRemovalComplete(t,e){this.onRemovalComplete(t,e)}constructor(t,e,i){this.bodyNode=t,this.driver=e,this._normalizer=i}get queuedPlayers(){let t=[];return this._namespaceList.forEach(e=>{e.players.forEach(i=>{i.queued&&t.push(i)})}),t}createNamespace(t,e){let i=new Ec(t,e,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,e)?this._balanceNamespaceList(i,e):(this.newHostElements.set(e,i),this.collectEnterElement(e)),this._namespaceLookup[t]=i}_balanceNamespaceList(t,e){let i=this._namespaceList,n=this.namespacesByHostElement;if(i.length-1>=0){let a=!1,c=this.driver.getParentElement(e);for(;c;){let h=n.get(c);if(h){let g=i.indexOf(h);i.splice(g+1,0,t),a=!0;break}c=this.driver.getParentElement(c)}a||i.unshift(t)}else i.push(t);return n.set(e,t),t}register(t,e){let i=this._namespaceLookup[t];return i||(i=this.createNamespace(t,e)),i}registerTrigger(t,e,i){let n=this._namespaceLookup[t];n&&n.register(e,i)&&this.totalAnimations++}destroy(t,e){t&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let i=this._fetchNamespace(t);this.namespacesByHostElement.delete(i.hostElement);let n=this._namespaceList.indexOf(i);n>=0&&this._namespaceList.splice(n,1),i.destroy(e),delete this._namespaceLookup[t]}))}_fetchNamespace(t){return this._namespaceLookup[t]}fetchNamespacesByElement(t){let e=new Set,i=this.statesByElement.get(t);if(i){for(let n of i.values())if(n.namespaceId){let r=this._fetchNamespace(n.namespaceId);r&&e.add(r)}}return e}trigger(t,e,i,n){if(us(e)){let r=this._fetchNamespace(t);if(r)return r.trigger(e,i,n),!0}return!1}insertNode(t,e,i,n){if(!us(e))return;let r=e[_i];if(r&&r.setForRemoval){r.setForRemoval=!1,r.setForMove=!0;let a=this.collectedLeaveElements.indexOf(e);a>=0&&this.collectedLeaveElements.splice(a,1)}if(t){let a=this._fetchNamespace(t);a&&a.insertNode(e,i)}n&&this.collectEnterElement(e)}collectEnterElement(t){this.collectedEnterElements.push(t)}markElementAsDisabled(t,e){e?this.disabledNodes.has(t)||(this.disabledNodes.add(t),ri(t,_c)):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),zo(t,_c))}removeNode(t,e,i){if(us(e)){let n=t?this._fetchNamespace(t):null;n?n.removeNode(e,i):this.markElementAsRemoved(t,e,!1,i);let r=this.namespacesByHostElement.get(e);r&&r.id!==t&&r.removeNode(e,i)}else this._onRemovalComplete(e,i)}markElementAsRemoved(t,e,i,n,r){this.collectedLeaveElements.push(e),e[_i]={namespaceId:t,setForRemoval:n,hasAnimation:i,removedBeforeQueried:!1,previousTriggersValues:r}}listen(t,e,i,n,r){return us(e)?this._fetchNamespace(t).listen(e,i,n,r):()=>{}}_buildInstruction(t,e,i,n,r){return t.transition.build(this.driver,t.element,t.fromState.value,t.toState.value,i,n,t.fromState.options,t.toState.options,e,r)}destroyInnerAnimations(t){let e=this.driver.query(t,Nr,!0);e.forEach(i=>this.destroyActiveAnimationsForElement(i)),this.playersByQueriedElement.size!=0&&(e=this.driver.query(t,cs,!0),e.forEach(i=>this.finishActiveQueriedAnimationOnElement(i)))}destroyActiveAnimationsForElement(t){let e=this.playersByElement.get(t);e&&e.forEach(i=>{i.queued?i.markedForDestroy=!0:i.destroy()})}finishActiveQueriedAnimationOnElement(t){let e=this.playersByQueriedElement.get(t);e&&e.forEach(i=>i.finish())}whenRenderingDone(){return new Promise(t=>{if(this.players.length)return on(this.players).onDone(()=>t());t()})}processLeaveNode(t){let e=t[_i];if(e&&e.setForRemoval){if(t[_i]=Wp,e.namespaceId){this.destroyInnerAnimations(t);let i=this._fetchNamespace(e.namespaceId);i&&i.clearElementCache(t)}this._onRemovalComplete(t,e.setForRemoval)}t.classList?.contains(_c)&&this.markElementAsDisabled(t,!1),this.driver.query(t,hf,!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(t=-1){let e=[];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];ri(n,uf)}if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){let i=[];try{e=this._flushAnimations(i,t)}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=[],e.length?on(e).onDone(()=>{i.forEach(n=>n())}):i.forEach(n=>n())}}reportError(t){throw xp(t)}_flushAnimations(t,e){let i=new zr,n=[],r=new Map,a=[],c=new Map,h=new Map,g=new Map,b=new Set;this.disabledNodes.forEach($=>{b.add($);let G=this.driver.query($,pf,!0);for(let K=0;K<G.length;K++)b.add(G[K])});let S=this.bodyNode,P=Array.from(this.statesByElement.keys()),N=Lp(P,this.collectedEnterElements),k=new Map,I=0;N.forEach(($,G)=>{let K=pc+I++;k.set(G,K),$.forEach(fe=>ri(fe,K))});let pe=[],ke=new Set,ve=new Set;for(let $=0;$<this.collectedLeaveElements.length;$++){let G=this.collectedLeaveElements[$],K=G[_i];K&&K.setForRemoval&&(pe.push(G),ke.add(G),K.hasAnimation?this.driver.query(G,gf,!0).forEach(fe=>ke.add(fe)):ve.add(G))}let Ke=new Map,ge=Lp(P,Array.from(ke));ge.forEach(($,G)=>{let K=ls+I++;Ke.set(G,K),$.forEach(fe=>ri(fe,K))}),t.push(()=>{N.forEach(($,G)=>{let K=k.get(G);$.forEach(fe=>zo(fe,K))}),ge.forEach(($,G)=>{let K=Ke.get(G);$.forEach(fe=>zo(fe,K))}),pe.forEach($=>{this.processLeaveNode($)})});let Bt=[],pt=[];for(let $=this._namespaceList.length-1;$>=0;$--)this._namespaceList[$].drainQueuedTransitions(e).forEach(K=>{let fe=K.player,ot=K.element;if(Bt.push(fe),this.collectedEnterElements.length){let at=ot[_i];if(at&&at.setForMove){if(at.previousTriggersValues&&at.previousTriggersValues.has(K.triggerName)){let Ht=at.previousTriggersValues.get(K.triggerName),At=this.statesByElement.get(K.element);if(At&&At.has(K.triggerName)){let xn=At.get(K.triggerName);xn.value=Ht,At.set(K.triggerName,xn)}}fe.destroy();return}}let De=!S||!this.driver.containsElement(S,ot),wt=Ke.get(ot),Fe=k.get(ot),Ne=this._buildInstruction(K,i,Fe,wt,De);if(Ne.errors&&Ne.errors.length){pt.push(Ne);return}if(De){fe.onStart(()=>Rn(ot,Ne.fromStyles)),fe.onDestroy(()=>fi(ot,Ne.toStyles)),n.push(fe);return}if(K.isFallbackTransition){fe.onStart(()=>Rn(ot,Ne.fromStyles)),fe.onDestroy(()=>fi(ot,Ne.toStyles)),n.push(fe);return}let We=[];Ne.timelines.forEach(at=>{at.stretchStartingKeyframe=!0,this.disabledNodes.has(at.element)||We.push(at)}),Ne.timelines=We,i.append(ot,Ne.timelines);let Un={instruction:Ne,player:fe,element:ot};a.push(Un),Ne.queriedElements.forEach(at=>$t(c,at,[]).push(fe)),Ne.preStyleProps.forEach((at,Ht)=>{if(at.size){let At=h.get(Ht);At||h.set(Ht,At=new Set),at.forEach((xn,vo)=>At.add(vo))}}),Ne.postStyleProps.forEach((at,Ht)=>{let At=g.get(Ht);At||g.set(Ht,At=new Set),at.forEach((xn,vo)=>At.add(vo))})});if(pt.length){let $=[];pt.forEach(G=>{$.push(wp(G.triggerName,G.errors))}),Bt.forEach(G=>G.destroy()),this.reportError($)}let Ze=new Map,xt=new Map;a.forEach($=>{let G=$.element;i.has(G)&&(xt.set(G,G),this._beforeAnimationBuild($.player.namespaceId,$.instruction,Ze))}),n.forEach($=>{let G=$.element;this._getPreviousPlayers(G,!1,$.namespaceId,$.triggerName,null).forEach(fe=>{$t(Ze,G,[]).push(fe),fe.destroy()})});let Xi=pe.filter($=>Vp($,h,g)),Cn=new Map;Np(Cn,this.driver,ve,g,oi).forEach($=>{Vp($,h,g)&&Xi.push($)});let mi=new Map;N.forEach(($,G)=>{Np(mi,this.driver,new Set($),h,No)}),Xi.forEach($=>{let G=Cn.get($),K=mi.get($);Cn.set($,new Map([...G?.entries()??[],...K?.entries()??[]]))});let Wn=[],bo=[],ya={};a.forEach($=>{let{element:G,player:K,instruction:fe}=$;if(i.has(G)){if(b.has(G)){K.onDestroy(()=>fi(G,fe.toStyles)),K.disabled=!0,K.overrideTotalTime(fe.totalTime),n.push(K);return}let ot=ya;if(xt.size>1){let wt=G,Fe=[];for(;wt=wt.parentNode;){let Ne=xt.get(wt);if(Ne){ot=Ne;break}Fe.push(wt)}Fe.forEach(Ne=>xt.set(Ne,ot))}let De=this._buildAnimation(K.namespaceId,fe,Ze,r,mi,Cn);if(K.setRealPlayer(De),ot===ya)Wn.push(K);else{let wt=this.playersByElement.get(ot);wt&&wt.length&&(K.parentPlayer=on(wt)),n.push(K)}}else Rn(G,fe.fromStyles),K.onDestroy(()=>fi(G,fe.toStyles)),bo.push(K),b.has(G)&&n.push(K)}),bo.forEach($=>{let G=r.get($.element);if(G&&G.length){let K=on(G);$.setRealPlayer(K)}}),n.forEach($=>{$.parentPlayer?$.syncPlayerEvents($.parentPlayer):$.destroy()});for(let $=0;$<pe.length;$++){let G=pe[$],K=G[_i];if(zo(G,ls),K&&K.hasAnimation)continue;let fe=[];if(c.size){let De=c.get(G);De&&De.length&&fe.push(...De);let wt=this.driver.query(G,cs,!0);for(let Fe=0;Fe<wt.length;Fe++){let Ne=c.get(wt[Fe]);Ne&&Ne.length&&fe.push(...Ne)}}let ot=fe.filter(De=>!De.destroyed);ot.length?Cf(this,G,ot):this.processLeaveNode(G)}return pe.length=0,Wn.forEach($=>{this.players.push($),$.onDone(()=>{$.destroy();let G=this.players.indexOf($);this.players.splice(G,1)}),$.play()}),Wn}afterFlush(t){this._flushFns.push(t)}afterFlushAnimationsDone(t){this._whenQuietFns.push(t)}_getPreviousPlayers(t,e,i,n,r){let a=[];if(e){let c=this.playersByQueriedElement.get(t);c&&(a=c)}else{let c=this.playersByElement.get(t);if(c){let h=!r||r==Vr;c.forEach(g=>{g.queued||!h&&g.triggerName!=n||a.push(g)})}}return(i||n)&&(a=a.filter(c=>!(i&&i!=c.namespaceId||n&&n!=c.triggerName))),a}_beforeAnimationBuild(t,e,i){let n=e.triggerName,r=e.element,a=e.isRemovalTransition?void 0:t,c=e.isRemovalTransition?void 0:n;for(let h of e.timelines){let g=h.element,b=g!==r,S=$t(i,g,[]);this._getPreviousPlayers(g,b,a,c,e.toState).forEach(N=>{let k=N.getRealPlayer();k.beforeDestroy&&k.beforeDestroy(),N.destroy(),S.push(N)})}Rn(r,e.fromStyles)}_buildAnimation(t,e,i,n,r,a){let c=e.triggerName,h=e.element,g=[],b=new Set,S=new Set,P=e.timelines.map(k=>{let I=k.element;b.add(I);let pe=I[_i];if(pe&&pe.removedBeforeQueried)return new Fi(k.duration,k.delay);let ke=I!==h,ve=xf((i.get(I)||ff).map(Ze=>Ze.getRealPlayer())).filter(Ze=>{let xt=Ze;return xt.element?xt.element===I:!1}),Ke=r.get(I),ge=a.get(I),Bt=sc(this._normalizer,k.keyframes,Ke,ge),pt=this._buildPlayer(k,Bt,ve);if(k.subTimeline&&n&&S.add(I),ke){let Ze=new Br(t,c,I);Ze.setRealPlayer(pt),g.push(Ze)}return pt});g.forEach(k=>{$t(this.playersByQueriedElement,k.element,[]).push(k),k.onDone(()=>bf(this.playersByQueriedElement,k.element,k))}),b.forEach(k=>ri(k,hc));let N=on(P);return N.onDestroy(()=>{b.forEach(k=>zo(k,hc)),fi(h,e.toStyles)}),S.forEach(k=>{$t(n,k,[]).push(N)}),N}_buildPlayer(t,e,i){return e.length>0?this.driver.animate(t.element,e,t.duration,t.delay,t.easing,i):new Fi(t.duration,t.delay)}},Br=class{namespaceId;triggerName;element;_player=new Fi;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(t,e,i){this.namespaceId=t,this.triggerName=e,this.element=i}setRealPlayer(t){this._containsRealPlayer||(this._player=t,this._queuedCallbacks.forEach((e,i)=>{e.forEach(n=>rs(t,i,void 0,n))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(t.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(t){this.totalTime=t}syncPlayerEvents(t){let e=this._player;e.triggerCallback&&t.onStart(()=>e.triggerCallback("start")),t.onDone(()=>this.finish()),t.onDestroy(()=>this.destroy())}_queueEvent(t,e){$t(this._queuedCallbacks,t,[]).push(e)}onDone(t){this.queued&&this._queueEvent("done",t),this._player.onDone(t)}onStart(t){this.queued&&this._queueEvent("start",t),this._player.onStart(t)}onDestroy(t){this.queued&&this._queueEvent("destroy",t),this._player.onDestroy(t)}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(t){this.queued||this._player.setPosition(t)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(t){let e=this._player;e.triggerCallback&&e.triggerCallback(t)}};function bf(o,t,e){let i=o.get(t);if(i){if(i.length){let n=i.indexOf(e);i.splice(n,1)}i.length==0&&o.delete(t)}return i}function vf(o){return o??null}function us(o){return o&&o.nodeType===1}function yf(o){return o=="start"||o=="done"}function Fp(o,t){let e=o.style.display;return o.style.display=t??"none",e}function Np(o,t,e,i,n){let r=[];e.forEach(h=>r.push(Fp(h)));let a=[];i.forEach((h,g)=>{let b=new Map;h.forEach(S=>{let P=t.computeStyle(g,S,n);b.set(S,P),(!P||P.length==0)&&(g[_i]=_f,a.push(g))}),o.set(g,b)});let c=0;return e.forEach(h=>Fp(h,r[c++])),a}function Lp(o,t){let e=new Map;if(o.forEach(c=>e.set(c,[])),t.length==0)return e;let i=1,n=new Set(t),r=new Map;function a(c){if(!c)return i;let h=r.get(c);if(h)return h;let g=c.parentNode;return e.has(g)?h=g:n.has(g)?h=i:h=a(g),r.set(c,h),h}return t.forEach(c=>{let h=a(c);h!==i&&e.get(h).push(c)}),e}function ri(o,t){o.classList?.add(t)}function zo(o,t){o.classList?.remove(t)}function Cf(o,t,e){on(e).onDone(()=>o.processLeaveNode(t))}function xf(o){let t=[];return Up(o,t),t}function Up(o,t){for(let e=0;e<o.length;e++){let i=o[e];i instanceof eo?Up(i.players,t):t.push(i)}}function wf(o,t){let e=Object.keys(o),i=Object.keys(t);if(e.length!=i.length)return!1;for(let n=0;n<e.length;n++){let r=e[n];if(!t.hasOwnProperty(r)||o[r]!==t[r])return!1}return!0}function Vp(o,t,e){let i=e.get(o);if(!i)return!1;let n=t.get(o);return n?i.forEach(r=>n.add(r)):t.set(o,i),e.delete(o),!0}var jo=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(t,e)=>{};constructor(t,e,i){this._driver=e,this._normalizer=i,this._transitionEngine=new Pc(t.body,e,i),this._timelineEngine=new Tc(t.body,e,i),this._transitionEngine.onRemovalComplete=(n,r)=>this.onRemovalComplete(n,r)}registerTrigger(t,e,i,n,r){let a=t+"-"+n,c=this._triggerCache[a];if(!c){let h=[],g=[],b=jp(this._driver,r,h,g);if(h.length)throw hp(n,h);c=cf(n,b,this._normalizer),this._triggerCache[a]=c}this._transitionEngine.registerTrigger(e,n,c)}register(t,e){this._transitionEngine.register(t,e)}destroy(t,e){this._transitionEngine.destroy(t,e)}onInsert(t,e,i,n){this._transitionEngine.insertNode(t,e,i,n)}onRemove(t,e,i){this._transitionEngine.removeNode(t,e,i)}disableAnimations(t,e){this._transitionEngine.markElementAsDisabled(t,e)}process(t,e,i,n){if(i.charAt(0)=="@"){let[r,a]=lc(i),c=n;this._timelineEngine.command(r,e,a,c)}else this._transitionEngine.trigger(t,e,i,n)}listen(t,e,i,n,r){if(i.charAt(0)=="@"){let[a,c]=lc(i);return this._timelineEngine.listen(a,e,c,r)}return this._transitionEngine.listen(t,e,i,n,r)}flush(t=-1){this._transitionEngine.flush(t)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(t){this._transitionEngine.afterFlushAnimationsDone(t)}};function Sf(o,t){let e=null,i=null;return Array.isArray(t)&&t.length?(e=vc(t[0]),t.length>1&&(i=vc(t[t.length-1]))):t instanceof Map&&(e=vc(t)),e||i?new kf(o,e,i):null}var kf=(()=>{class o{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(e,i,n){this._element=e,this._startStyles=i,this._endStyles=n;let r=o.initialStylesByElement.get(e);r||o.initialStylesByElement.set(e,r=new Map),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&fi(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(fi(this._element,this._initialStyles),this._endStyles&&(fi(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(o.initialStylesByElement.delete(this._element),this._startStyles&&(Rn(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Rn(this._element,this._endStyles),this._endStyles=null),fi(this._element,this._initialStyles),this._state=3)}}return o})();function vc(o){let t=null;return o.forEach((e,i)=>{Mf(i)&&(t=t||new Map,t.set(i,e))}),t}function Mf(o){return o==="display"||o==="position"}var Cs=class{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(t,e,i,n){this.element=t,this.keyframes=e,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(t=>t()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;let t=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,t,this.options),this._finalKeyframe=t.length?t[t.length-1]:new Map;let e=()=>this._onFinish();this.domPlayer.addEventListener("finish",e),this.onDestroy(()=>{this.domPlayer.removeEventListener("finish",e)})}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_convertKeyframesToObject(t){let e=[];return t.forEach(i=>{e.push(Object.fromEntries(i))}),e}_triggerWebAnimation(t,e,i){return t.animate(this._convertKeyframesToObject(e),i)}onStart(t){this._originalOnStartFns.push(t),this._onStartFns.push(t)}onDone(t){this._originalOnDoneFns.push(t),this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(t=>t()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),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&&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(t=>t()),this._onDestroyFns=[])}setPosition(t){this.domPlayer===void 0&&this.init(),this.domPlayer.currentTime=t*this.time}getPosition(){return+(this.domPlayer.currentTime??0)/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){let t=new Map;this.hasStarted()&&this._finalKeyframe.forEach((i,n)=>{n!=="offset"&&t.set(n,this._finished?i:ms(this.element,n))}),this.currentSnapshot=t}triggerCallback(t){let e=t==="start"?this._onStartFns:this._onDoneFns;e.forEach(i=>i()),e.length=0}},xs=class{validateStyleProperty(t){return!0}validateAnimatableStyleProperty(t){return!0}containsElement(t,e){return cc(t,e)}getParentElement(t){return ss(t)}query(t,e,i){return dc(t,e,i)}computeStyle(t,e,i){return ms(t,e)}animate(t,e,i,n,r,a=[]){let c=n==0?"both":"forwards",h={duration:i,delay:n,fill:c};r&&(h.easing=r);let g=new Map,b=a.filter(N=>N instanceof Cs);Tp(i,n)&&b.forEach(N=>{N.currentSnapshot.forEach((k,I)=>g.set(I,k))});let S=kp(e).map(N=>new Map(N));S=Ep(t,S,g);let P=Sf(t,S);return new Cs(t,S,h,P)}};var gs="@",$p="@.disabled",ws=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(t,e,i,n){this.namespaceId=t,this.delegate=e,this.engine=i,this._onDestroy=n}get data(){return this.delegate.data}destroyNode(t){this.delegate.destroyNode?.(t)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(t,e){return this.delegate.createElement(t,e)}createComment(t){return this.delegate.createComment(t)}createText(t){return this.delegate.createText(t)}appendChild(t,e){this.delegate.appendChild(t,e),this.engine.onInsert(this.namespaceId,e,t,!1)}insertBefore(t,e,i,n=!0){this.delegate.insertBefore(t,e,i),this.engine.onInsert(this.namespaceId,e,t,n)}removeChild(t,e,i,n){if(n){this.delegate.removeChild(t,e,i);return}this.parentNode(e)&&this.engine.onRemove(this.namespaceId,e,this.delegate)}selectRootElement(t,e){return this.delegate.selectRootElement(t,e)}parentNode(t){return this.delegate.parentNode(t)}nextSibling(t){return this.delegate.nextSibling(t)}setAttribute(t,e,i,n){this.delegate.setAttribute(t,e,i,n)}removeAttribute(t,e,i){this.delegate.removeAttribute(t,e,i)}addClass(t,e){this.delegate.addClass(t,e)}removeClass(t,e){this.delegate.removeClass(t,e)}setStyle(t,e,i,n){this.delegate.setStyle(t,e,i,n)}removeStyle(t,e,i){this.delegate.removeStyle(t,e,i)}setProperty(t,e,i){e.charAt(0)==gs&&e==$p?this.disableAnimations(t,!!i):this.delegate.setProperty(t,e,i)}setValue(t,e){this.delegate.setValue(t,e)}listen(t,e,i,n){return this.delegate.listen(t,e,i,n)}disableAnimations(t,e){this.engine.disableAnimations(t,e)}},Oc=class extends ws{factory;constructor(t,e,i,n,r){super(e,i,n,r),this.factory=t,this.namespaceId=e}setProperty(t,e,i){e.charAt(0)==gs?e.charAt(1)=="."&&e==$p?(i=i===void 0?!0:!!i,this.disableAnimations(t,i)):this.engine.process(this.namespaceId,t,e.slice(1),i):this.delegate.setProperty(t,e,i)}listen(t,e,i,n){if(e.charAt(0)==gs){let r=Tf(t),a=e.slice(1),c="";return a.charAt(0)!=gs&&([a,c]=Ef(a)),this.engine.listen(this.namespaceId,r,a,c,h=>{let g=h._data||-1;this.factory.scheduleListenerCallback(g,i,h)})}return this.delegate.listen(t,e,i,n)}};function Tf(o){switch(o){case"body":return document.body;case"document":return document;case"window":return window;default:return o}}function Ef(o){let t=o.indexOf("."),e=o.substring(0,t),i=o.slice(t+1);return[e,i]}var Ss=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(t,e,i){this.delegate=t,this.engine=e,this._zone=i,e.onRemovalComplete=(n,r)=>{r?.removeChild(null,n)}}createRenderer(t,e){let n=this.delegate.createRenderer(t,e);if(!t||!e?.data?.animation){let g=this._rendererCache,b=g.get(n);if(!b){let S=()=>g.delete(n);b=new ws("",n,this.engine,S),g.set(n,b)}return b}let r=e.id,a=e.id+"-"+this._currentId;this._currentId++,this.engine.register(a,t);let c=g=>{Array.isArray(g)?g.forEach(c):this.engine.registerTrigger(r,a,t,g.name,g)};return e.data.animation.forEach(c),new Oc(this,a,n,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(t,e,i){if(t>=0&&t<this._microtaskId){this._zone.run(()=>e(i));return}let n=this._animationCallbacksBuffer;n.length==0&&queueMicrotask(()=>{this._zone.run(()=>{n.forEach(r=>{let[a,c]=r;a(c)}),this._animationCallbacksBuffer=[]})}),n.push([e,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(t){this.engine.flush(),this.delegate.componentReplaced?.(t)}};var Of=(()=>{class o extends jo{constructor(e,i,n){super(e,i,n)}ngOnDestroy(){this.flush()}static \u0275fac=function(i){return new(i||o)(Pa(Je),Pa(no),Pa(oo))};static \u0275prov=V({token:o,factory:o.\u0275fac})}return o})();function Af(){return new fs}function If(o,t,e){return new Ss(o,t,e)}var qp=[{provide:oo,useFactory:Af},{provide:jo,useClass:Of},{provide:pi,useFactory:If,deps:[Em,jo,de]}],Gw=[{provide:no,useClass:Ac},{provide:Tr,useValue:"NoopAnimations"},...qp],Df=[{provide:no,useFactory:()=>new xs},{provide:Tr,useFactory:()=>"BrowserAnimations"},...qp];function Gp(){return um("NgEagerAnimations"),[...Df]}var Hr=class{_attachedHost;attach(t){return this._attachedHost=t,t.attach(this)}detach(){let t=this._attachedHost;t!=null&&(this._attachedHost=null,t.detach())}get isAttached(){return this._attachedHost!=null}setAttachedHost(t){this._attachedHost=t}},bi=class extends Hr{component;viewContainerRef;injector;projectableNodes;constructor(t,e,i,n){super(),this.component=t,this.viewContainerRef=e,this.injector=i,this.projectableNodes=n}},rn=class extends Hr{templateRef;viewContainerRef;context;injector;constructor(t,e,i,n){super(),this.templateRef=t,this.viewContainerRef=e,this.context=i,this.injector=n}get origin(){return this.templateRef.elementRef}attach(t,e=this.context){return this.context=e,super.attach(t)}detach(){return this.context=void 0,super.detach()}},Dc=class extends Hr{element;constructor(t){super(),this.element=t instanceof ie?t.nativeElement:t}},Fn=class{_attachedPortal;_disposeFn;_isDisposed=!1;hasAttached(){return!!this._attachedPortal}attach(t){if(t instanceof bi)return this._attachedPortal=t,this.attachComponentPortal(t);if(t instanceof rn)return this._attachedPortal=t,this.attachTemplatePortal(t);if(this.attachDomPortal&&t instanceof Dc)return this._attachedPortal=t,this.attachDomPortal(t)}attachDomPortal=null;detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(t){this._disposeFn=t}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}},ks=class extends Fn{outletElement;_appRef;_defaultInjector;constructor(t,e,i){super(),this.outletElement=t,this._appRef=e,this._defaultInjector=i}attachComponentPortal(t){let e;if(t.viewContainerRef){let i=t.injector||t.viewContainerRef.injector,n=i.get(Ql,null,{optional:!0})||void 0;e=t.viewContainerRef.createComponent(t.component,{index:t.viewContainerRef.length,injector:i,ngModuleRef:n,projectableNodes:t.projectableNodes||void 0}),this.setDisposeFn(()=>e.destroy())}else{let i=this._appRef,n=t.injector||this._defaultInjector||be.NULL,r=n.get(Oa,i.injector);e=km(t.component,{elementInjector:n,environmentInjector:r,projectableNodes:t.projectableNodes||void 0}),i.attachView(e.hostView),this.setDisposeFn(()=>{i.viewCount>0&&i.detachView(e.hostView),e.destroy()})}return this.outletElement.appendChild(this._getComponentRootNode(e)),this._attachedPortal=t,e}attachTemplatePortal(t){let e=t.viewContainerRef,i=e.createEmbeddedView(t.templateRef,t.context,{injector:t.injector});return i.rootNodes.forEach(n=>this.outletElement.appendChild(n)),i.detectChanges(),this.setDisposeFn(()=>{let n=e.indexOf(i);n!==-1&&e.remove(n)}),this._attachedPortal=t,i}attachDomPortal=t=>{let e=t.element;e.parentNode;let i=this.outletElement.ownerDocument.createComment("dom-portal");e.parentNode.insertBefore(i,e),this.outletElement.appendChild(e),this._attachedPortal=t,super.setDisposeFn(()=>{i.parentNode&&i.parentNode.replaceChild(e,i)})};dispose(){super.dispose(),this.outletElement.remove()}_getComponentRootNode(t){return t.hostView.rootNodes[0]}};var Nn=(()=>{class o extends Fn{_moduleRef=m(Ql,{optional:!0});_document=m(Je);_viewContainerRef=m(Xn);_isInitialized=!1;_attachedRef;constructor(){super()}get portal(){return this._attachedPortal}set portal(e){this.hasAttached()&&!e&&!this._isInitialized||(this.hasAttached()&&super.detach(),e&&super.attach(e),this._attachedPortal=e||null)}attached=new U;get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedRef=this._attachedPortal=null}attachComponentPortal(e){e.setAttachedHost(this);let i=e.viewContainerRef!=null?e.viewContainerRef:this._viewContainerRef,n=i.createComponent(e.component,{index:i.length,injector:e.injector||i.injector,projectableNodes:e.projectableNodes||void 0,ngModuleRef:this._moduleRef||void 0});return i!==this._viewContainerRef&&this._getRootNode().appendChild(n.hostView.rootNodes[0]),super.setDisposeFn(()=>n.destroy()),this._attachedPortal=e,this._attachedRef=n,this.attached.emit(n),n}attachTemplatePortal(e){e.setAttachedHost(this);let i=this._viewContainerRef.createEmbeddedView(e.templateRef,e.context,{injector:e.injector});return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=e,this._attachedRef=i,this.attached.emit(i),i}attachDomPortal=e=>{let i=e.element;i.parentNode;let n=this._document.createComment("dom-portal");e.setAttachedHost(this),i.parentNode.insertBefore(n,i),this._getRootNode().appendChild(i),this._attachedPortal=e,super.setDisposeFn(()=>{n.parentNode&&n.parentNode.replaceChild(i,n)})};_getRootNode(){let e=this._viewContainerRef.element.nativeElement;return e.nodeType===e.ELEMENT_NODE?e:e.parentNode}static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:[0,"cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[Mt]})}return o})();var an=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({})}return o})();var Rf=20,sn=(()=>{class o{_ngZone=m(de);_platform=m(et);_renderer=m(pi).createRenderer(null,null);_cleanupGlobalListener;constructor(){}_scrolled=new R;_scrolledCount=0;scrollContainers=new Map;register(e){this.scrollContainers.has(e)||this.scrollContainers.set(e,e.elementScrolled().subscribe(()=>this._scrolled.next(e)))}deregister(e){let i=this.scrollContainers.get(e);i&&(i.unsubscribe(),this.scrollContainers.delete(e))}scrolled(e=Rf){return this._platform.isBrowser?new Oi(i=>{this._cleanupGlobalListener||(this._cleanupGlobalListener=this._ngZone.runOutsideAngular(()=>this._renderer.listen("document","scroll",()=>this._scrolled.next())));let n=e>0?this._scrolled.pipe(ql(e)).subscribe(i):this._scrolled.subscribe(i);return this._scrolledCount++,()=>{n.unsubscribe(),this._scrolledCount--,this._scrolledCount||(this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0)}}):It()}ngOnDestroy(){this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0,this.scrollContainers.forEach((e,i)=>this.deregister(i)),this._scrolled.complete()}ancestorScrolled(e,i){let n=this.getAncestorScrollContainers(e);return this.scrolled(i).pipe(ce(r=>!r||n.indexOf(r)>-1))}getAncestorScrollContainers(e){let i=[];return this.scrollContainers.forEach((n,r)=>{this._scrollableContainsElement(r,e)&&i.push(r)}),i}_scrollableContainsElement(e,i){let n=Dr(i),r=e.getElementRef().nativeElement;do if(n==r)return!0;while(n=n.parentElement);return!1}static \u0275fac=function(i){return new(i||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),ln=(()=>{class o{elementRef=m(ie);scrollDispatcher=m(sn);ngZone=m(de);dir=m(ft,{optional:!0});_scrollElement=this.elementRef.nativeElement;_destroyed=new R;_renderer=m(yt);_cleanupScroll;_elementScrolled=new R;constructor(){}ngOnInit(){this._cleanupScroll=this.ngZone.runOutsideAngular(()=>this._renderer.listen(this._scrollElement,"scroll",e=>this._elementScrolled.next(e))),this.scrollDispatcher.register(this)}ngOnDestroy(){this._cleanupScroll?.(),this._elementScrolled.complete(),this.scrollDispatcher.deregister(this),this._destroyed.next(),this._destroyed.complete()}elementScrolled(){return this._elementScrolled}getElementRef(){return this.elementRef}scrollTo(e){let i=this.elementRef.nativeElement,n=this.dir&&this.dir.value=="rtl";e.left==null&&(e.left=n?e.end:e.start),e.right==null&&(e.right=n?e.start:e.end),e.bottom!=null&&(e.top=i.scrollHeight-i.clientHeight-e.bottom),n&&Io()!=Ao.NORMAL?(e.left!=null&&(e.right=i.scrollWidth-i.clientWidth-e.left),Io()==Ao.INVERTED?e.left=e.right:Io()==Ao.NEGATED&&(e.left=e.right?-e.right:e.right)):e.right!=null&&(e.left=i.scrollWidth-i.clientWidth-e.right),this._applyScrollToOptions(e)}_applyScrollToOptions(e){let i=this.elementRef.nativeElement;$a()?i.scrollTo(e):(e.top!=null&&(i.scrollTop=e.top),e.left!=null&&(i.scrollLeft=e.left))}measureScrollOffset(e){let i="left",n="right",r=this.elementRef.nativeElement;if(e=="top")return r.scrollTop;if(e=="bottom")return r.scrollHeight-r.clientHeight-r.scrollTop;let a=this.dir&&this.dir.value=="rtl";return e=="start"?e=a?n:i:e=="end"&&(e=a?i:n),a&&Io()==Ao.INVERTED?e==i?r.scrollWidth-r.clientWidth-r.scrollLeft:r.scrollLeft:a&&Io()==Ao.NEGATED?e==i?r.scrollLeft+r.scrollWidth-r.clientWidth:-r.scrollLeft:e==i?r.scrollLeft:r.scrollWidth-r.clientWidth-r.scrollLeft}static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["","cdk-scrollable",""],["","cdkScrollable",""]]})}return o})(),Ff=20,Vi=(()=>{class o{_platform=m(et);_listeners;_viewportSize;_change=new R;_document=m(Je);constructor(){let e=m(de),i=m(pi).createRenderer(null,null);e.runOutsideAngular(()=>{if(this._platform.isBrowser){let n=r=>this._change.next(r);this._listeners=[i.listen("window","resize",n),i.listen("window","orientationchange",n)]}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){this._listeners?.forEach(e=>e()),this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();let e={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),e}getViewportRect(){let e=this.getViewportScrollPosition(),{width:i,height:n}=this.getViewportSize();return{top:e.top,left:e.left,bottom:e.top+n,right:e.left+i,height:n,width:i}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let e=this._document,i=this._getWindow(),n=e.documentElement,r=n.getBoundingClientRect(),a=-r.top||e.body.scrollTop||i.scrollY||n.scrollTop||0,c=-r.left||e.body.scrollLeft||i.scrollX||n.scrollLeft||0;return{top:a,left:c}}change(e=Ff){return e>0?this._change.pipe(ql(e)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){let e=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:e.innerWidth,height:e.innerHeight}:{width:0,height:0}}static \u0275fac=function(i){return new(i||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var Li=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({})}return o})(),Rc=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({imports:[Rr,Li,Rr,Li]})}return o})();var Yp=$a();function Wo(o){return new Ms(o.get(Vi),o.get(Je))}var Ms=class{_viewportRuler;_previousHTMLStyles={top:"",left:""};_previousScrollPosition;_isEnabled=!1;_document;constructor(t,e){this._viewportRuler=t,this._document=e}attach(){}enable(){if(this._canBeEnabled()){let t=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=t.style.left||"",this._previousHTMLStyles.top=t.style.top||"",t.style.left=rt(-this._previousScrollPosition.left),t.style.top=rt(-this._previousScrollPosition.top),t.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){let t=this._document.documentElement,e=this._document.body,i=t.style,n=e.style,r=i.scrollBehavior||"",a=n.scrollBehavior||"";this._isEnabled=!1,i.left=this._previousHTMLStyles.left,i.top=this._previousHTMLStyles.top,t.classList.remove("cdk-global-scrollblock"),Yp&&(i.scrollBehavior=n.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),Yp&&(i.scrollBehavior=r,n.scrollBehavior=a)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;let e=this._document.documentElement,i=this._viewportRuler.getViewportSize();return e.scrollHeight>i.height||e.scrollWidth>i.width}};function th(o,t){return new Ts(o.get(sn),o.get(de),o.get(Vi),t)}var Ts=class{_scrollDispatcher;_ngZone;_viewportRuler;_config;_scrollSubscription=null;_overlayRef;_initialScrollPosition;constructor(t,e,i,n){this._scrollDispatcher=t,this._ngZone=e,this._viewportRuler=i,this._config=n}attach(t){this._overlayRef,this._overlayRef=t}enable(){if(this._scrollSubscription)return;let t=this._scrollDispatcher.scrolled(0).pipe(ce(e=>!e||!this._overlayRef.overlayElement.contains(e.getElementRef().nativeElement)));this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=t.subscribe(()=>{let e=this._viewportRuler.getViewportScrollPosition().top;Math.abs(e-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=t.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}_detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}};var Wr=class{enable(){}disable(){}attach(){}};function Fc(o,t){return t.some(e=>{let i=o.bottom<e.top,n=o.top>e.bottom,r=o.right<e.left,a=o.left>e.right;return i||n||r||a})}function Qp(o,t){return t.some(e=>{let i=o.top<e.top,n=o.bottom>e.bottom,r=o.left<e.left,a=o.right>e.right;return i||n||r||a})}function zi(o,t){return new Es(o.get(sn),o.get(Vi),o.get(de),t)}var Es=class{_scrollDispatcher;_viewportRuler;_ngZone;_config;_scrollSubscription=null;_overlayRef;constructor(t,e,i,n){this._scrollDispatcher=t,this._viewportRuler=e,this._ngZone=i,this._config=n}attach(t){this._overlayRef,this._overlayRef=t}enable(){if(!this._scrollSubscription){let t=this._config?this._config.scrollThrottle:0;this._scrollSubscription=this._scrollDispatcher.scrolled(t).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){let e=this._overlayRef.overlayElement.getBoundingClientRect(),{width:i,height:n}=this._viewportRuler.getViewportSize();Fc(e,[{width:i,height:n,bottom:n,right:i,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}})}}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}},ih=(()=>{class o{_injector=m(be);constructor(){}noop=()=>new Wr;close=e=>th(this._injector,e);block=()=>Wo(this._injector);reposition=e=>zi(this._injector,e);static \u0275fac=function(i){return new(i||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),cn=class{positionStrategy;scrollStrategy=new Wr;panelClass="";hasBackdrop=!1;backdropClass="cdk-overlay-dark-backdrop";disableAnimations;width;height;minWidth;minHeight;maxWidth;maxHeight;direction;disposeOnNavigation=!1;constructor(t){if(t){let e=Object.keys(t);for(let i of e)t[i]!==void 0&&(this[i]=t[i])}}};var Ps=class{connectionPair;scrollableViewProperties;constructor(t,e){this.connectionPair=t,this.scrollableViewProperties=e}};var nh=(()=>{class o{_attachedOverlays=[];_document=m(Je);_isAttached;constructor(){}ngOnDestroy(){this.detach()}add(e){this.remove(e),this._attachedOverlays.push(e)}remove(e){let i=this._attachedOverlays.indexOf(e);i>-1&&this._attachedOverlays.splice(i,1),this._attachedOverlays.length===0&&this.detach()}static \u0275fac=function(i){return new(i||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),oh=(()=>{class o extends nh{_ngZone=m(de);_renderer=m(pi).createRenderer(null,null);_cleanupKeydown;add(e){super.add(e),this._isAttached||(this._ngZone.runOutsideAngular(()=>{this._cleanupKeydown=this._renderer.listen("body","keydown",this._keydownListener)}),this._isAttached=!0)}detach(){this._isAttached&&(this._cleanupKeydown?.(),this._isAttached=!1)}_keydownListener=e=>{let i=this._attachedOverlays;for(let n=i.length-1;n>-1;n--)if(i[n]._keydownEvents.observers.length>0){this._ngZone.run(()=>i[n]._keydownEvents.next(e));break}};static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),rh=(()=>{class o extends nh{_platform=m(et);_ngZone=m(de);_renderer=m(pi).createRenderer(null,null);_cursorOriginalValue;_cursorStyleIsSet=!1;_pointerDownEventTarget;_cleanups;add(e){if(super.add(e),!this._isAttached){let i=this._document.body,n={capture:!0},r=this._renderer;this._cleanups=this._ngZone.runOutsideAngular(()=>[r.listen(i,"pointerdown",this._pointerDownListener,n),r.listen(i,"click",this._clickListener,n),r.listen(i,"auxclick",this._clickListener,n),r.listen(i,"contextmenu",this._clickListener,n)]),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=i.style.cursor,i.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){this._isAttached&&(this._cleanups?.forEach(e=>e()),this._cleanups=void 0,this._platform.IOS&&this._cursorStyleIsSet&&(this._document.body.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1)}_pointerDownListener=e=>{this._pointerDownEventTarget=ja(e)};_clickListener=e=>{let i=ja(e),n=e.type==="click"&&this._pointerDownEventTarget?this._pointerDownEventTarget:i;this._pointerDownEventTarget=null;let r=this._attachedOverlays.slice();for(let a=r.length-1;a>-1;a--){let c=r[a];if(c._outsidePointerEvents.observers.length<1||!c.hasAttached())continue;if(Xp(c.overlayElement,i)||Xp(c.overlayElement,n))break;let h=c._outsidePointerEvents;this._ngZone?this._ngZone.run(()=>h.next(e)):h.next(e)}};static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function Xp(o,t){let e=typeof ShadowRoot<"u"&&ShadowRoot,i=t;for(;i;){if(i===o)return!0;i=e&&i instanceof ShadowRoot?i.host:i.parentNode}return!1}var ah=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["ng-component"]],hostAttrs:["cdk-overlay-style-loader",""],decls:0,vars:0,template:function(i,n){},styles:[`.cdk-overlay-container,.cdk-global-overlay-wrapper{pointer-events:none;top:0;left:0;height:100%;width:100%}.cdk-overlay-container{position:fixed}@layer cdk-overlay{.cdk-overlay-container{z-index:1000}}.cdk-overlay-container:empty{display:none}.cdk-global-overlay-wrapper{display:flex;position:absolute}@layer cdk-overlay{.cdk-global-overlay-wrapper{z-index:1000}}.cdk-overlay-pane{position:absolute;pointer-events:auto;box-sizing:border-box;display:flex;max-width:100%;max-height:100%}@layer cdk-overlay{.cdk-overlay-pane{z-index:1000}}.cdk-overlay-backdrop{position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:auto;-webkit-tap-highlight-color:rgba(0,0,0,0);opacity:0;touch-action:manipulation}@layer cdk-overlay{.cdk-overlay-backdrop{z-index:1000;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}}@media(prefers-reduced-motion){.cdk-overlay-backdrop{transition-duration:1ms}}.cdk-overlay-backdrop-showing{opacity:1}@media(forced-colors: active){.cdk-overlay-backdrop-showing{opacity:.6}}@layer cdk-overlay{.cdk-overlay-dark-backdrop{background:rgba(0,0,0,.32)}}.cdk-overlay-transparent-backdrop{transition:visibility 1ms linear,opacity 1ms linear;visibility:hidden;opacity:1}.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing,.cdk-high-contrast-active .cdk-overlay-transparent-backdrop{opacity:0;visibility:visible}.cdk-overlay-backdrop-noop-animation{transition:none}.cdk-overlay-connected-position-bounding-box{position:absolute;display:flex;flex-direction:column;min-width:1px;min-height:1px}@layer cdk-overlay{.cdk-overlay-connected-position-bounding-box{z-index:1000}}.cdk-global-scrollblock{position:fixed;width:100%;overflow-y:scroll}
|
|
2
|
-
`],encapsulation:2,changeDetection:0})}return o})(),Is=(()=>{class o{_platform=m(et);_containerElement;_document=m(Je);_styleLoader=m(Rt);constructor(){}ngOnDestroy(){this._containerElement?.remove()}getContainerElement(){return this._loadStyles(),this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let e="cdk-overlay-container";if(this._platform.isBrowser||tc()){let n=this._document.querySelectorAll(`.${e}[platform="server"], .${e}[platform="test"]`);for(let r=0;r<n.length;r++)n[r].remove()}let i=this._document.createElement("div");i.classList.add(e),tc()?i.setAttribute("platform","test"):this._platform.isBrowser||i.setAttribute("platform","server"),this._document.body.appendChild(i),this._containerElement=i}_loadStyles(){this._styleLoader.load(ah)}static \u0275fac=function(i){return new(i||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),Nc=class{_renderer;_ngZone;element;_cleanupClick;_cleanupTransitionEnd;_fallbackTimeout;constructor(t,e,i,n){this._renderer=e,this._ngZone=i,this.element=t.createElement("div"),this.element.classList.add("cdk-overlay-backdrop"),this._cleanupClick=e.listen(this.element,"click",n)}detach(){this._ngZone.runOutsideAngular(()=>{let t=this.element;clearTimeout(this._fallbackTimeout),this._cleanupTransitionEnd?.(),this._cleanupTransitionEnd=this._renderer.listen(t,"transitionend",this.dispose),this._fallbackTimeout=setTimeout(this.dispose,500),t.style.pointerEvents="none",t.classList.remove("cdk-overlay-backdrop-showing")})}dispose=()=>{clearTimeout(this._fallbackTimeout),this._cleanupClick?.(),this._cleanupTransitionEnd?.(),this._cleanupClick=this._cleanupTransitionEnd=this._fallbackTimeout=void 0,this.element.remove()}},Bo=class{_portalOutlet;_host;_pane;_config;_ngZone;_keyboardDispatcher;_document;_location;_outsideClickDispatcher;_animationsDisabled;_injector;_renderer;_backdropClick=new R;_attachments=new R;_detachments=new R;_positionStrategy;_scrollStrategy;_locationChanges=Pi.EMPTY;_backdropRef=null;_detachContentMutationObserver;_detachContentAfterRenderRef;_previousHostParent;_keydownEvents=new R;_outsidePointerEvents=new R;_afterNextRenderRef;constructor(t,e,i,n,r,a,c,h,g,b=!1,S,P){this._portalOutlet=t,this._host=e,this._pane=i,this._config=n,this._ngZone=r,this._keyboardDispatcher=a,this._document=c,this._location=h,this._outsideClickDispatcher=g,this._animationsDisabled=b,this._injector=S,this._renderer=P,n.scrollStrategy&&(this._scrollStrategy=n.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=n.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropRef?.element||null}get hostElement(){return this._host}attach(t){!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host);let e=this._portalOutlet.attach(t);return this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._afterNextRenderRef?.destroy(),this._afterNextRenderRef=Dt(()=>{this.hasAttached()&&this.updatePosition()},{injector:this._injector}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._completeDetachContent(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),typeof e?.onDestroy=="function"&&e.onDestroy(()=>{this.hasAttached()&&this._ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>this.detach()))}),e}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();let t=this._portalOutlet.detach();return this._detachments.next(),this._completeDetachContent(),this._keyboardDispatcher.remove(this),this._detachContentWhenEmpty(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),t}dispose(){let t=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this._backdropRef?.dispose(),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host?.remove(),this._afterNextRenderRef?.destroy(),this._previousHostParent=this._pane=this._host=this._backdropRef=null,t&&this._detachments.next(),this._detachments.complete(),this._completeDetachContent()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(t){t!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=t,this.hasAttached()&&(t.attach(this),this.updatePosition()))}updateSize(t){this._config=Z(Z({},this._config),t),this._updateElementSize()}setDirection(t){this._config=ut(Z({},this._config),{direction:t}),this._updateElementDirection()}addPanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!0)}removePanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!1)}getDirection(){let t=this._config.direction;return t?typeof t=="string"?t:t.value:"ltr"}updateScrollStrategy(t){t!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=t,this.hasAttached()&&(t.attach(this),t.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;let t=this._pane.style;t.width=rt(this._config.width),t.height=rt(this._config.height),t.minWidth=rt(this._config.minWidth),t.minHeight=rt(this._config.minHeight),t.maxWidth=rt(this._config.maxWidth),t.maxHeight=rt(this._config.maxHeight)}_togglePointerEvents(t){this._pane.style.pointerEvents=t?"":"none"}_attachBackdrop(){let t="cdk-overlay-backdrop-showing";this._backdropRef?.dispose(),this._backdropRef=new Nc(this._document,this._renderer,this._ngZone,e=>{this._backdropClick.next(e)}),this._animationsDisabled&&this._backdropRef.element.classList.add("cdk-overlay-backdrop-noop-animation"),this._config.backdropClass&&this._toggleClasses(this._backdropRef.element,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropRef.element,this._host),!this._animationsDisabled&&typeof requestAnimationFrame<"u"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>this._backdropRef?.element.classList.add(t))}):this._backdropRef.element.classList.add(t)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){this._animationsDisabled?(this._backdropRef?.dispose(),this._backdropRef=null):this._backdropRef?.detach()}_toggleClasses(t,e,i){let n=Jl(e||[]).filter(r=>!!r);n.length&&(i?t.classList.add(...n):t.classList.remove(...n))}_detachContentWhenEmpty(){let t=!1;try{this._detachContentAfterRenderRef=Dt(()=>{t=!0,this._detachContent()},{injector:this._injector})}catch(e){if(t)throw e;this._detachContent()}globalThis.MutationObserver&&this._pane&&(this._detachContentMutationObserver||=new globalThis.MutationObserver(()=>{this._detachContent()}),this._detachContentMutationObserver.observe(this._pane,{childList:!0}))}_detachContent(){(!this._pane||!this._host||this._pane.children.length===0)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._host.remove()),this._completeDetachContent())}_completeDetachContent(){this._detachContentAfterRenderRef?.destroy(),this._detachContentAfterRenderRef=void 0,this._detachContentMutationObserver?.disconnect()}_disposeScrollStrategy(){let t=this._scrollStrategy;t?.disable(),t?.detach?.()}},Kp="cdk-overlay-connected-position-bounding-box",Lf=/([A-Za-z%]+)$/;function Ur(o,t){return new Os(t,o.get(Vi),o.get(Je),o.get(et),o.get(Is))}var Os=class{_viewportRuler;_document;_platform;_overlayContainer;_overlayRef;_isInitialRender;_lastBoundingBoxSize={width:0,height:0};_isPushed=!1;_canPush=!0;_growAfterOpen=!1;_hasFlexibleDimensions=!0;_positionLocked=!1;_originRect;_overlayRect;_viewportRect;_containerRect;_viewportMargin=0;_scrollables=[];_preferredPositions=[];_origin;_pane;_isDisposed;_boundingBox;_lastPosition;_lastScrollVisibility;_positionChanges=new R;_resizeSubscription=Pi.EMPTY;_offsetX=0;_offsetY=0;_transformOriginSelector;_appliedPanelClasses=[];_previousPushAmount;positionChanges=this._positionChanges;get positions(){return this._preferredPositions}constructor(t,e,i,n,r){this._viewportRuler=e,this._document=i,this._platform=n,this._overlayContainer=r,this.setOrigin(t)}attach(t){this._overlayRef&&this._overlayRef,this._validatePositions(),t.hostElement.classList.add(Kp),this._overlayRef=t,this._boundingBox=t.hostElement,this._pane=t.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition){this.reapplyLastPosition();return}this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let t=this._originRect,e=this._overlayRect,i=this._viewportRect,n=this._containerRect,r=[],a;for(let c of this._preferredPositions){let h=this._getOriginPoint(t,n,c),g=this._getOverlayPoint(h,e,c),b=this._getOverlayFit(g,e,i,c);if(b.isCompletelyWithinViewport){this._isPushed=!1,this._applyPosition(c,h);return}if(this._canFitWithFlexibleDimensions(b,g,i)){r.push({position:c,origin:h,overlayRect:e,boundingBoxRect:this._calculateBoundingBoxRect(h,c)});continue}(!a||a.overlayFit.visibleArea<b.visibleArea)&&(a={overlayFit:b,overlayPoint:g,originPoint:h,position:c,overlayRect:e})}if(r.length){let c=null,h=-1;for(let g of r){let b=g.boundingBoxRect.width*g.boundingBoxRect.height*(g.position.weight||1);b>h&&(h=b,c=g)}this._isPushed=!1,this._applyPosition(c.position,c.origin);return}if(this._canPush){this._isPushed=!0,this._applyPosition(a.position,a.originPoint);return}this._applyPosition(a.position,a.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&ro(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(Kp),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(this._isDisposed||!this._platform.isBrowser)return;let t=this._lastPosition;if(t){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let e=this._getOriginPoint(this._originRect,this._containerRect,t);this._applyPosition(t,e)}else this.apply()}withScrollableContainers(t){return this._scrollables=t,this}withPositions(t){return this._preferredPositions=t,t.indexOf(this._lastPosition)===-1&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(t){return this._viewportMargin=t,this}withFlexibleDimensions(t=!0){return this._hasFlexibleDimensions=t,this}withGrowAfterOpen(t=!0){return this._growAfterOpen=t,this}withPush(t=!0){return this._canPush=t,this}withLockedPosition(t=!0){return this._positionLocked=t,this}setOrigin(t){return this._origin=t,this}withDefaultOffsetX(t){return this._offsetX=t,this}withDefaultOffsetY(t){return this._offsetY=t,this}withTransformOriginOn(t){return this._transformOriginSelector=t,this}_getOriginPoint(t,e,i){let n;if(i.originX=="center")n=t.left+t.width/2;else{let a=this._isRtl()?t.right:t.left,c=this._isRtl()?t.left:t.right;n=i.originX=="start"?a:c}e.left<0&&(n-=e.left);let r;return i.originY=="center"?r=t.top+t.height/2:r=i.originY=="top"?t.top:t.bottom,e.top<0&&(r-=e.top),{x:n,y:r}}_getOverlayPoint(t,e,i){let n;i.overlayX=="center"?n=-e.width/2:i.overlayX==="start"?n=this._isRtl()?-e.width:0:n=this._isRtl()?0:-e.width;let r;return i.overlayY=="center"?r=-e.height/2:r=i.overlayY=="top"?0:-e.height,{x:t.x+n,y:t.y+r}}_getOverlayFit(t,e,i,n){let r=Jp(e),{x:a,y:c}=t,h=this._getOffset(n,"x"),g=this._getOffset(n,"y");h&&(a+=h),g&&(c+=g);let b=0-a,S=a+r.width-i.width,P=0-c,N=c+r.height-i.height,k=this._subtractOverflows(r.width,b,S),I=this._subtractOverflows(r.height,P,N),pe=k*I;return{visibleArea:pe,isCompletelyWithinViewport:r.width*r.height===pe,fitsInViewportVertically:I===r.height,fitsInViewportHorizontally:k==r.width}}_canFitWithFlexibleDimensions(t,e,i){if(this._hasFlexibleDimensions){let n=i.bottom-e.y,r=i.right-e.x,a=Zp(this._overlayRef.getConfig().minHeight),c=Zp(this._overlayRef.getConfig().minWidth),h=t.fitsInViewportVertically||a!=null&&a<=n,g=t.fitsInViewportHorizontally||c!=null&&c<=r;return h&&g}return!1}_pushOverlayOnScreen(t,e,i){if(this._previousPushAmount&&this._positionLocked)return{x:t.x+this._previousPushAmount.x,y:t.y+this._previousPushAmount.y};let n=Jp(e),r=this._viewportRect,a=Math.max(t.x+n.width-r.width,0),c=Math.max(t.y+n.height-r.height,0),h=Math.max(r.top-i.top-t.y,0),g=Math.max(r.left-i.left-t.x,0),b=0,S=0;return n.width<=r.width?b=g||-a:b=t.x<this._viewportMargin?r.left-i.left-t.x:0,n.height<=r.height?S=h||-c:S=t.y<this._viewportMargin?r.top-i.top-t.y:0,this._previousPushAmount={x:b,y:S},{x:t.x+b,y:t.y+S}}_applyPosition(t,e){if(this._setTransformOrigin(t),this._setOverlayElementStyles(e,t),this._setBoundingBoxStyles(e,t),t.panelClass&&this._addPanelClasses(t.panelClass),this._positionChanges.observers.length){let i=this._getScrollVisibility();if(t!==this._lastPosition||!this._lastScrollVisibility||!Vf(this._lastScrollVisibility,i)){let n=new Ps(t,i);this._positionChanges.next(n)}this._lastScrollVisibility=i}this._lastPosition=t,this._isInitialRender=!1}_setTransformOrigin(t){if(!this._transformOriginSelector)return;let e=this._boundingBox.querySelectorAll(this._transformOriginSelector),i,n=t.overlayY;t.overlayX==="center"?i="center":this._isRtl()?i=t.overlayX==="start"?"right":"left":i=t.overlayX==="start"?"left":"right";for(let r=0;r<e.length;r++)e[r].style.transformOrigin=`${i} ${n}`}_calculateBoundingBoxRect(t,e){let i=this._viewportRect,n=this._isRtl(),r,a,c;if(e.overlayY==="top")a=t.y,r=i.height-a+this._viewportMargin;else if(e.overlayY==="bottom")c=i.height-t.y+this._viewportMargin*2,r=i.height-c+this._viewportMargin;else{let N=Math.min(i.bottom-t.y+i.top,t.y),k=this._lastBoundingBoxSize.height;r=N*2,a=t.y-N,r>k&&!this._isInitialRender&&!this._growAfterOpen&&(a=t.y-k/2)}let h=e.overlayX==="start"&&!n||e.overlayX==="end"&&n,g=e.overlayX==="end"&&!n||e.overlayX==="start"&&n,b,S,P;if(g)P=i.width-t.x+this._viewportMargin*2,b=t.x-this._viewportMargin;else if(h)S=t.x,b=i.right-t.x;else{let N=Math.min(i.right-t.x+i.left,t.x),k=this._lastBoundingBoxSize.width;b=N*2,S=t.x-N,b>k&&!this._isInitialRender&&!this._growAfterOpen&&(S=t.x-k/2)}return{top:a,left:S,bottom:c,right:P,width:b,height:r}}_setBoundingBoxStyles(t,e){let i=this._calculateBoundingBoxRect(t,e);!this._isInitialRender&&!this._growAfterOpen&&(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.width,this._lastBoundingBoxSize.width));let n={};if(this._hasExactPosition())n.top=n.left="0",n.bottom=n.right=n.maxHeight=n.maxWidth="",n.width=n.height="100%";else{let r=this._overlayRef.getConfig().maxHeight,a=this._overlayRef.getConfig().maxWidth;n.height=rt(i.height),n.top=rt(i.top),n.bottom=rt(i.bottom),n.width=rt(i.width),n.left=rt(i.left),n.right=rt(i.right),e.overlayX==="center"?n.alignItems="center":n.alignItems=e.overlayX==="end"?"flex-end":"flex-start",e.overlayY==="center"?n.justifyContent="center":n.justifyContent=e.overlayY==="bottom"?"flex-end":"flex-start",r&&(n.maxHeight=rt(r)),a&&(n.maxWidth=rt(a))}this._lastBoundingBoxSize=i,ro(this._boundingBox.style,n)}_resetBoundingBoxStyles(){ro(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){ro(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(t,e){let i={},n=this._hasExactPosition(),r=this._hasFlexibleDimensions,a=this._overlayRef.getConfig();if(n){let b=this._viewportRuler.getViewportScrollPosition();ro(i,this._getExactOverlayY(e,t,b)),ro(i,this._getExactOverlayX(e,t,b))}else i.position="static";let c="",h=this._getOffset(e,"x"),g=this._getOffset(e,"y");h&&(c+=`translateX(${h}px) `),g&&(c+=`translateY(${g}px)`),i.transform=c.trim(),a.maxHeight&&(n?i.maxHeight=rt(a.maxHeight):r&&(i.maxHeight="")),a.maxWidth&&(n?i.maxWidth=rt(a.maxWidth):r&&(i.maxWidth="")),ro(this._pane.style,i)}_getExactOverlayY(t,e,i){let n={top:"",bottom:""},r=this._getOverlayPoint(e,this._overlayRect,t);if(this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,i)),t.overlayY==="bottom"){let a=this._document.documentElement.clientHeight;n.bottom=`${a-(r.y+this._overlayRect.height)}px`}else n.top=rt(r.y);return n}_getExactOverlayX(t,e,i){let n={left:"",right:""},r=this._getOverlayPoint(e,this._overlayRect,t);this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,i));let a;if(this._isRtl()?a=t.overlayX==="end"?"left":"right":a=t.overlayX==="end"?"right":"left",a==="right"){let c=this._document.documentElement.clientWidth;n.right=`${c-(r.x+this._overlayRect.width)}px`}else n.left=rt(r.x);return n}_getScrollVisibility(){let t=this._getOriginRect(),e=this._pane.getBoundingClientRect(),i=this._scrollables.map(n=>n.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:Qp(t,i),isOriginOutsideView:Fc(t,i),isOverlayClipped:Qp(e,i),isOverlayOutsideView:Fc(e,i)}}_subtractOverflows(t,...e){return e.reduce((i,n)=>i-Math.max(n,0),t)}_getNarrowedViewportRect(){let t=this._document.documentElement.clientWidth,e=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+t-this._viewportMargin,bottom:i.top+e-this._viewportMargin,width:t-2*this._viewportMargin,height:e-2*this._viewportMargin}}_isRtl(){return this._overlayRef.getDirection()==="rtl"}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(t,e){return e==="x"?t.offsetX==null?this._offsetX:t.offsetX:t.offsetY==null?this._offsetY:t.offsetY}_validatePositions(){}_addPanelClasses(t){this._pane&&Jl(t).forEach(e=>{e!==""&&this._appliedPanelClasses.indexOf(e)===-1&&(this._appliedPanelClasses.push(e),this._pane.classList.add(e))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(t=>{this._pane.classList.remove(t)}),this._appliedPanelClasses=[])}_getOriginRect(){let t=this._origin;if(t instanceof ie)return t.nativeElement.getBoundingClientRect();if(t instanceof Element)return t.getBoundingClientRect();let e=t.width||0,i=t.height||0;return{top:t.y,bottom:t.y+i,left:t.x,right:t.x+e,height:i,width:e}}};function ro(o,t){for(let e in t)t.hasOwnProperty(e)&&(o[e]=t[e]);return o}function Zp(o){if(typeof o!="number"&&o!=null){let[t,e]=o.split(Lf);return!e||e==="px"?parseFloat(t):null}return o||null}function Jp(o){return{top:Math.floor(o.top),right:Math.floor(o.right),bottom:Math.floor(o.bottom),left:Math.floor(o.left),width:Math.floor(o.width),height:Math.floor(o.height)}}function Vf(o,t){return o===t?!0:o.isOriginClipped===t.isOriginClipped&&o.isOriginOutsideView===t.isOriginOutsideView&&o.isOverlayClipped===t.isOverlayClipped&&o.isOverlayOutsideView===t.isOverlayOutsideView}var eh="cdk-global-overlay-wrapper";function Ln(o){return new As}var As=class{_overlayRef;_cssPosition="static";_topOffset="";_bottomOffset="";_alignItems="";_xPosition="";_xOffset="";_width="";_height="";_isDisposed=!1;attach(t){let e=t.getConfig();this._overlayRef=t,this._width&&!e.width&&t.updateSize({width:this._width}),this._height&&!e.height&&t.updateSize({height:this._height}),t.hostElement.classList.add(eh),this._isDisposed=!1}top(t=""){return this._bottomOffset="",this._topOffset=t,this._alignItems="flex-start",this}left(t=""){return this._xOffset=t,this._xPosition="left",this}bottom(t=""){return this._topOffset="",this._bottomOffset=t,this._alignItems="flex-end",this}right(t=""){return this._xOffset=t,this._xPosition="right",this}start(t=""){return this._xOffset=t,this._xPosition="start",this}end(t=""){return this._xOffset=t,this._xPosition="end",this}width(t=""){return this._overlayRef?this._overlayRef.updateSize({width:t}):this._width=t,this}height(t=""){return this._overlayRef?this._overlayRef.updateSize({height:t}):this._height=t,this}centerHorizontally(t=""){return this.left(t),this._xPosition="center",this}centerVertically(t=""){return this.top(t),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;let t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement.style,i=this._overlayRef.getConfig(),{width:n,height:r,maxWidth:a,maxHeight:c}=i,h=(n==="100%"||n==="100vw")&&(!a||a==="100%"||a==="100vw"),g=(r==="100%"||r==="100vh")&&(!c||c==="100%"||c==="100vh"),b=this._xPosition,S=this._xOffset,P=this._overlayRef.getConfig().direction==="rtl",N="",k="",I="";h?I="flex-start":b==="center"?(I="center",P?k=S:N=S):P?b==="left"||b==="end"?(I="flex-end",N=S):(b==="right"||b==="start")&&(I="flex-start",k=S):b==="left"||b==="start"?(I="flex-start",N=S):(b==="right"||b==="end")&&(I="flex-end",k=S),t.position=this._cssPosition,t.marginLeft=h?"0":N,t.marginTop=g?"0":this._topOffset,t.marginBottom=this._bottomOffset,t.marginRight=h?"0":k,e.justifyContent=I,e.alignItems=g?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;let t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement,i=e.style;e.classList.remove(eh),i.justifyContent=i.alignItems=t.marginTop=t.marginBottom=t.marginLeft=t.marginRight=t.position="",this._overlayRef=null,this._isDisposed=!0}},sh=(()=>{class o{_injector=m(be);constructor(){}global(){return Ln()}flexibleConnectedTo(e){return Ur(this._injector,e)}static \u0275fac=function(i){return new(i||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function mn(o,t){o.get(Rt).load(ah);let e=o.get(Is),i=o.get(Je),n=o.get(Re),r=o.get(Kl),a=o.get(ft),c=i.createElement("div"),h=i.createElement("div");h.id=n.getId("cdk-overlay-"),h.classList.add("cdk-overlay-pane"),c.appendChild(h),e.getContainerElement().appendChild(c);let g=new ks(h,r,o),b=new cn(t),S=o.get(yt,null,{optional:!0})||o.get(pi).createRenderer(null,null);return b.direction=b.direction||a.value,new Bo(g,c,h,b,o.get(de),o.get(oh),i,o.get(Mm),o.get(rh),t?.disableAnimations??o.get(Tr,null,{optional:!0})==="NoopAnimations",o.get(Oa),S)}var lh=(()=>{class o{scrollStrategies=m(ih);_positionBuilder=m(sh);_injector=m(be);constructor(){}create(e){return mn(this._injector,e)}position(){return this._positionBuilder}static \u0275fac=function(i){return new(i||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),zf=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],ch=new ne("cdk-connected-overlay-scroll-strategy",{providedIn:"root",factory:()=>{let o=m(be);return()=>zi(o)}}),Ho=(()=>{class o{elementRef=m(ie);constructor(){}static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]})}return o})(),Ds=(()=>{class o{_dir=m(ft,{optional:!0});_injector=m(be);_overlayRef;_templatePortal;_backdropSubscription=Pi.EMPTY;_attachSubscription=Pi.EMPTY;_detachSubscription=Pi.EMPTY;_positionSubscription=Pi.EMPTY;_offsetX;_offsetY;_position;_scrollStrategyFactory=m(ch);_disposeOnNavigation=!1;_ngZone=m(de);origin;positions;positionStrategy;get offsetX(){return this._offsetX}set offsetX(e){this._offsetX=e,this._position&&this._updatePositionStrategy(this._position)}get offsetY(){return this._offsetY}set offsetY(e){this._offsetY=e,this._position&&this._updatePositionStrategy(this._position)}width;height;minWidth;minHeight;backdropClass;panelClass;viewportMargin=0;scrollStrategy;open=!1;disableClose=!1;transformOriginSelector;hasBackdrop=!1;lockPosition=!1;flexibleDimensions=!1;growAfterOpen=!1;push=!1;get disposeOnNavigation(){return this._disposeOnNavigation}set disposeOnNavigation(e){this._disposeOnNavigation=e}backdropClick=new U;positionChange=new U;attach=new U;detach=new U;overlayKeydown=new U;overlayOutsideClick=new U;constructor(){let e=m(kn),i=m(Xn);this._templatePortal=new rn(e,i),this.scrollStrategy=this._scrollStrategyFactory()}get overlayRef(){return this._overlayRef}get dir(){return this._dir?this._dir.value:"ltr"}ngOnDestroy(){this._attachSubscription.unsubscribe(),this._detachSubscription.unsubscribe(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this._overlayRef?.dispose()}ngOnChanges(e){this._position&&(this._updatePositionStrategy(this._position),this._overlayRef?.updateSize({width:this.width,minWidth:this.minWidth,height:this.height,minHeight:this.minHeight}),e.origin&&this.open&&this._position.apply()),e.open&&(this.open?this.attachOverlay():this.detachOverlay())}_createOverlay(){(!this.positions||!this.positions.length)&&(this.positions=zf);let e=this._overlayRef=mn(this._injector,this._buildConfig());this._attachSubscription=e.attachments().subscribe(()=>this.attach.emit()),this._detachSubscription=e.detachments().subscribe(()=>this.detach.emit()),e.keydownEvents().subscribe(i=>{this.overlayKeydown.next(i),i.keyCode===27&&!this.disableClose&&!gt(i)&&(i.preventDefault(),this.detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(i=>{let n=this._getOriginElement(),r=ja(i);(!n||n!==r&&!n.contains(r))&&this.overlayOutsideClick.next(i)})}_buildConfig(){let e=this._position=this.positionStrategy||this._createPositionStrategy(),i=new cn({direction:this._dir||"ltr",positionStrategy:e,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop,disposeOnNavigation:this.disposeOnNavigation});return(this.width||this.width===0)&&(i.width=this.width),(this.height||this.height===0)&&(i.height=this.height),(this.minWidth||this.minWidth===0)&&(i.minWidth=this.minWidth),(this.minHeight||this.minHeight===0)&&(i.minHeight=this.minHeight),this.backdropClass&&(i.backdropClass=this.backdropClass),this.panelClass&&(i.panelClass=this.panelClass),i}_updatePositionStrategy(e){let i=this.positions.map(n=>({originX:n.originX,originY:n.originY,overlayX:n.overlayX,overlayY:n.overlayY,offsetX:n.offsetX||this.offsetX,offsetY:n.offsetY||this.offsetY,panelClass:n.panelClass||void 0}));return e.setOrigin(this._getOrigin()).withPositions(i).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector)}_createPositionStrategy(){let e=Ur(this._injector,this._getOrigin());return this._updatePositionStrategy(e),e}_getOrigin(){return this.origin instanceof Ho?this.origin.elementRef:this.origin}_getOriginElement(){return this.origin instanceof Ho?this.origin.elementRef.nativeElement:this.origin instanceof ie?this.origin.nativeElement:typeof Element<"u"&&this.origin instanceof Element?this.origin:null}attachOverlay(){this._overlayRef?this._overlayRef.getConfig().hasBackdrop=this.hasBackdrop:this._createOverlay(),this._overlayRef.hasAttached()||this._overlayRef.attach(this._templatePortal),this.hasBackdrop?this._backdropSubscription=this._overlayRef.backdropClick().subscribe(e=>{this.backdropClick.emit(e)}):this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.positionChange.observers.length>0&&(this._positionSubscription=this._position.positionChanges.pipe(cm(()=>this.positionChange.observers.length>0)).subscribe(e=>{this._ngZone.run(()=>this.positionChange.emit(e)),this.positionChange.observers.length===0&&this._positionSubscription.unsubscribe()})),this.open=!0}detachOverlay(){this._overlayRef?.detach(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.open=!1}static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["","cdk-connected-overlay",""],["","connected-overlay",""],["","cdkConnectedOverlay",""]],inputs:{origin:[0,"cdkConnectedOverlayOrigin","origin"],positions:[0,"cdkConnectedOverlayPositions","positions"],positionStrategy:[0,"cdkConnectedOverlayPositionStrategy","positionStrategy"],offsetX:[0,"cdkConnectedOverlayOffsetX","offsetX"],offsetY:[0,"cdkConnectedOverlayOffsetY","offsetY"],width:[0,"cdkConnectedOverlayWidth","width"],height:[0,"cdkConnectedOverlayHeight","height"],minWidth:[0,"cdkConnectedOverlayMinWidth","minWidth"],minHeight:[0,"cdkConnectedOverlayMinHeight","minHeight"],backdropClass:[0,"cdkConnectedOverlayBackdropClass","backdropClass"],panelClass:[0,"cdkConnectedOverlayPanelClass","panelClass"],viewportMargin:[0,"cdkConnectedOverlayViewportMargin","viewportMargin"],scrollStrategy:[0,"cdkConnectedOverlayScrollStrategy","scrollStrategy"],open:[0,"cdkConnectedOverlayOpen","open"],disableClose:[0,"cdkConnectedOverlayDisableClose","disableClose"],transformOriginSelector:[0,"cdkConnectedOverlayTransformOriginOn","transformOriginSelector"],hasBackdrop:[2,"cdkConnectedOverlayHasBackdrop","hasBackdrop",J],lockPosition:[2,"cdkConnectedOverlayLockPosition","lockPosition",J],flexibleDimensions:[2,"cdkConnectedOverlayFlexibleDimensions","flexibleDimensions",J],growAfterOpen:[2,"cdkConnectedOverlayGrowAfterOpen","growAfterOpen",J],push:[2,"cdkConnectedOverlayPush","push",J],disposeOnNavigation:[2,"cdkConnectedOverlayDisposeOnNavigation","disposeOnNavigation",J]},outputs:{backdropClick:"backdropClick",positionChange:"positionChange",attach:"attach",detach:"detach",overlayKeydown:"overlayKeydown",overlayOutsideClick:"overlayOutsideClick"},exportAs:["cdkConnectedOverlay"],features:[tt]})}return o})();function jf(o){let t=m(be);return()=>zi(t)}var Bf={provide:ch,useFactory:jf},vi=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({providers:[lh,Bf],imports:[Rr,an,Rc,Rc]})}return o})();function Hf(o,t){if(o&1){let e=M();s(0,"div",1)(1,"button",2),_("click",function(){v(e);let n=u();return y(n.action())}),p(2),l()()}if(o&2){let e=u();d(2),te(" ",e.data.action," ")}}var Wf=["label"];function Uf(o,t){}var $f=Math.pow(2,31)-1,$r=class{_overlayRef;instance;containerInstance;_afterDismissed=new R;_afterOpened=new R;_onAction=new R;_durationTimeoutId;_dismissedByAction=!1;constructor(t,e){this._overlayRef=e,this.containerInstance=t,t._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete(),this.dismiss()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(t){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(t,$f))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}},dh=new ne("MatSnackBarData"),Uo=class{politeness="polite";announcementMessage="";viewContainerRef;duration=0;panelClass;direction;data=null;horizontalPosition="center";verticalPosition="bottom"},qf=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["","matSnackBarLabel",""]],hostAttrs:[1,"mat-mdc-snack-bar-label","mdc-snackbar__label"]})}return o})(),Gf=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["","matSnackBarActions",""]],hostAttrs:[1,"mat-mdc-snack-bar-actions","mdc-snackbar__actions"]})}return o})(),Yf=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["","matSnackBarAction",""]],hostAttrs:[1,"mat-mdc-snack-bar-action","mdc-snackbar__action"]})}return o})(),mh=(()=>{class o{snackBarRef=m($r);data=m(dh);constructor(){}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-mdc-simple-snack-bar"],exportAs:["matSnackBar"],decls:3,vars:2,consts:[["matSnackBarLabel",""],["matSnackBarActions",""],["matButton","","matSnackBarAction","",3,"click"]],template:function(i,n){i&1&&(s(0,"div",0),p(1),l(),C(2,Hf,3,1,"div",1)),i&2&&(d(),te(" ",n.data.message,`
|
|
1
|
+
import{a as Hm,b as Se}from"./chunk-KJ4PW3PQ.js";import{a as Do,b as Wm,c as Le,d as Ya,e as Qa,f as Xa,g as Ve,i as Ka,k as ze,m as Za,n as Ro,o as Um,q as Ja,r as $m,s as es,t as ts,u as qm,v as is,w as Fo,x as Gm,y as je}from"./chunk-LZXYIZHY.js";import{A as ic,B as zm,C as jm,D as He,E as rt,F as Tt,G as On,H as An,I as Qe,J as ft,K as Rr,L as ae,M as qa,N as Et,O as Ga,P as it,Q as he,R as Oe,S as Ym,T as Qm,a as za,b as ja,c as et,d as Rm,e as gi,f as Dr,g as Ri,h as Rt,i as Ba,j as Jl,k as Fm,l as Nm,m as Po,n as Ha,o as Wa,p as Oo,q as Re,r as gt,s as Lm,t as Vm,u as ec,v as Ua,w as Ao,x as $a,y as Io,z as tc}from"./chunk-7IQDWHG4.js";import{a as nn,b as _t}from"./chunk-2O4PKY5C.js";import{e as Bm}from"./chunk-OF4NB5FG.js";import{$ as be,$a as Zn,$b as Tm,A as Gl,Aa as T,Ab as Mn,B as Ea,Ba as re,Bb as qe,Ca as Ce,Cb as vm,D as lm,Da as gm,Db as ym,E as Eo,Ea as Mt,Eb as Jn,Fa as fm,Fb as Cm,G as Mr,Ga as $e,Gb as Pr,Ha as U,I as kt,Ia as de,Ib as Ra,J as Gn,Ja as Dt,Jb as xm,K as L,L as cm,La as Xl,Lb as hi,M as vt,Ma as Kl,Mb as Or,N as ye,Na as K,Nb as Tn,O as Yn,Ob as Ar,P as V,Pa as C,Pb as wm,Q as oe,Qa as x,Qb as Ge,R as ne,Ra as Kn,Rb as J,S as Pa,Sa as _m,Sb as ui,T as m,Ta as xe,Tb as Sm,Ua as we,Ub as km,V as dm,Va as w,W as Oa,Wa as s,Wb as Mm,X as v,Xa as l,Xb as En,Y as y,Ya as I,Yb as Fa,Z as en,Za as ii,Zb as Na,_ as Aa,_a as ni,_b as La,a as Z,aa as Je,ab as Da,ac as Ir,b as ut,ba as Yl,bb as M,c as im,cb as Zt,cc as Pe,d as ee,da as mm,db as _,e as Pi,ea as Ia,ec as Em,f as Oi,fa as Ee,fb as u,fc as Pm,g as R,ga as tt,gb as Be,h as le,ha as ti,hb as me,i as nm,ia as ie,ib as Ct,ja as pm,jb as Q,jc as Ye,k as It,kb as H,kc as Om,l as Mo,lb as W,lc as Di,m as om,ma as Tr,mb as bm,mc as Va,n as rm,nb as Er,nc as Am,o as _e,ob as Zl,oc as Pn,p as qn,pa as Kt,pb as Jt,pc as Im,qa as Qn,qb as Ii,qc as Dm,r as To,ra as hm,rb as E,sa as d,sb as tn,t as am,ta as Sn,tb as p,u as Ai,ua as pi,ub as F,v as ce,va as yt,vb as te,w as ql,wb as kn,x as wn,xa as Xn,xb as z,y as sm,ya as um,yb as j,z as Ut,za as Ql,zb as B}from"./chunk-MFNSHXOA.js";var se=(function(o){return o[o.State=0]="State",o[o.Transition=1]="Transition",o[o.Sequence=2]="Sequence",o[o.Group=3]="Group",o[o.Animate=4]="Animate",o[o.Keyframes=5]="Keyframes",o[o.Style=6]="Style",o[o.Trigger=7]="Trigger",o[o.Reference=8]="Reference",o[o.AnimateChild=9]="AnimateChild",o[o.AnimateRef=10]="AnimateRef",o[o.Query=11]="Query",o[o.Stagger=12]="Stagger",o})(se||{}),oi="*";function nc(o,t){return{type:se.Trigger,name:o,definitions:t,options:{}}}function ns(o,t=null){return{type:se.Animate,styles:t,timings:o}}function Xm(o,t=null){return{type:se.Sequence,steps:o,options:t}}function In(o){return{type:se.Style,styles:o,offset:null}}function os(o,t,e=null){return{type:se.Transition,expr:o,animation:t,options:e}}var Fi=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(t=0,e=0){this.totalTime=t+e}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}onStart(t){this._originalOnStartFns.push(t),this._onStartFns.push(t)}onDone(t){this._originalOnDoneFns.push(t),this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(t){this._position=this.totalTime?t*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(t){let e=t=="start"?this._onStartFns:this._onDoneFns;e.forEach(i=>i()),e.length=0}},eo=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(t){this.players=t;let e=0,i=0,n=0,r=this.players.length;r==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(a=>{a.onDone(()=>{++e==r&&this._onFinish()}),a.onDestroy(()=>{++i==r&&this._onDestroy()}),a.onStart(()=>{++n==r&&this._onStart()})}),this.totalTime=this.players.reduce((a,c)=>Math.max(a,c.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this.players.forEach(t=>t.init())}onStart(t){this._onStartFns.push(t)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(t=>t()),this._onStartFns=[])}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(t=>t.play())}pause(){this.players.forEach(t=>t.pause())}restart(){this.players.forEach(t=>t.restart())}finish(){this._onFinish(),this.players.forEach(t=>t.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(t=>t.destroy()),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this.players.forEach(t=>t.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(t){let e=t*this.totalTime;this.players.forEach(i=>{let n=i.totalTime?Math.min(1,e/i.totalTime):1;i.setPosition(n)})}getPosition(){let t=this.players.reduce((e,i)=>e===null||i.totalTime>e.totalTime?i:e,null);return t!=null?t.getPosition():0}beforeDestroy(){this.players.forEach(t=>{t.beforeDestroy&&t.beforeDestroy()})}triggerCallback(t){let e=t=="start"?this._onStartFns:this._onDoneFns;e.forEach(i=>i()),e.length=0}},No="!";function Km(o){return new ye(3e3,!1)}function Ig(){return new ye(3100,!1)}function Dg(){return new ye(3101,!1)}function Rg(o){return new ye(3001,!1)}function Fg(o){return new ye(3003,!1)}function Ng(o){return new ye(3004,!1)}function Jm(o,t){return new ye(3005,!1)}function ep(){return new ye(3006,!1)}function tp(){return new ye(3007,!1)}function ip(o,t){return new ye(3008,!1)}function np(o){return new ye(3002,!1)}function op(o,t,e,i,n){return new ye(3010,!1)}function rp(){return new ye(3011,!1)}function ap(){return new ye(3012,!1)}function sp(){return new ye(3200,!1)}function lp(){return new ye(3202,!1)}function cp(){return new ye(3013,!1)}function dp(o){return new ye(3014,!1)}function mp(o){return new ye(3015,!1)}function pp(o){return new ye(3016,!1)}function hp(o,t){return new ye(3404,!1)}function Lg(o){return new ye(3502,!1)}function up(o){return new ye(3503,!1)}function gp(){return new ye(3300,!1)}function fp(o){return new ye(3504,!1)}function _p(o){return new ye(3301,!1)}function bp(o,t){return new ye(3302,!1)}function vp(o){return new ye(3303,!1)}function yp(o,t){return new ye(3400,!1)}function Cp(o){return new ye(3401,!1)}function xp(o){return new ye(3402,!1)}function wp(o,t){return new ye(3505,!1)}function on(o){switch(o.length){case 0:return new Fi;case 1:return o[0];default:return new eo(o)}}function sc(o,t,e=new Map,i=new Map){let n=[],r=[],a=-1,c=null;if(t.forEach(h=>{let g=h.get("offset"),b=g==a,S=b&&c||new Map;h.forEach((P,N)=>{let k=N,A=P;if(N!=="offset")switch(k=o.normalizePropertyName(k,n),A){case No:A=e.get(N);break;case oi:A=i.get(N);break;default:A=o.normalizeStyleValue(N,k,A,n);break}S.set(k,A)}),b||r.push(S),c=S,a=g}),n.length)throw Lg(n);return r}function rs(o,t,e,i){switch(t){case"start":o.onStart(()=>i(e&&oc(e,"start",o)));break;case"done":o.onDone(()=>i(e&&oc(e,"done",o)));break;case"destroy":o.onDestroy(()=>i(e&&oc(e,"destroy",o)));break}}function oc(o,t,e){let i=e.totalTime,n=!!e.disabled,r=as(o.element,o.triggerName,o.fromState,o.toState,t||o.phaseName,i??o.totalTime,n),a=o._data;return a!=null&&(r._data=a),r}function as(o,t,e,i,n="",r=0,a){return{element:o,triggerName:t,fromState:e,toState:i,phaseName:n,totalTime:r,disabled:!!a}}function $t(o,t,e){let i=o.get(t);return i||o.set(t,i=e),i}function lc(o){let t=o.indexOf(":"),e=o.substring(1,t),i=o.slice(t+1);return[e,i]}var Vg=typeof document>"u"?null:document.documentElement;function ss(o){let t=o.parentNode||o.host||null;return t===Vg?null:t}function zg(o){return o.substring(1,6)=="ebkit"}var to=null,Zm=!1;function Sp(o){to||(to=jg()||{},Zm=to.style?"WebkitAppearance"in to.style:!1);let t=!0;return to.style&&!zg(o)&&(t=o in to.style,!t&&Zm&&(t="Webkit"+o.charAt(0).toUpperCase()+o.slice(1)in to.style)),t}function jg(){return typeof document<"u"?document.body:null}function cc(o,t){for(;t;){if(t===o)return!0;t=ss(t)}return!1}function dc(o,t,e){if(e)return Array.from(o.querySelectorAll(t));let i=o.querySelector(t);return i?[i]:[]}var Bg=1e3,mc="{{",Hg="}}",pc="ng-enter",ls="ng-leave",Fr="ng-trigger",Nr=".ng-trigger",hc="ng-animating",cs=".ng-animating";function Ni(o){if(typeof o=="number")return o;let t=o.match(/^(-?[\.\d]+)(m?s)/);return!t||t.length<2?0:rc(parseFloat(t[1]),t[2])}function rc(o,t){switch(t){case"s":return o*Bg;default:return o}}function Lr(o,t,e){return o.hasOwnProperty("duration")?o:Ug(o,t,e)}var Wg=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;function Ug(o,t,e){let i,n=0,r="";if(typeof o=="string"){let a=o.match(Wg);if(a===null)return t.push(Km(o)),{duration:0,delay:0,easing:""};i=rc(parseFloat(a[1]),a[2]);let c=a[3];c!=null&&(n=rc(parseFloat(c),a[4]));let h=a[5];h&&(r=h)}else i=o;if(!e){let a=!1,c=t.length;i<0&&(t.push(Ig()),a=!0),n<0&&(t.push(Dg()),a=!0),a&&t.splice(c,0,Km(o))}return{duration:i,delay:n,easing:r}}function kp(o){return o.length?o[0]instanceof Map?o:o.map(t=>new Map(Object.entries(t))):[]}function fi(o,t,e){t.forEach((i,n)=>{let r=ds(n);e&&!e.has(n)&&e.set(n,o.style[r]),o.style[r]=i})}function Dn(o,t){t.forEach((e,i)=>{let n=ds(i);o.style[n]=""})}function Lo(o){return Array.isArray(o)?o.length==1?o[0]:Xm(o):o}function Mp(o,t,e){let i=t.params||{},n=uc(o);n.length&&n.forEach(r=>{i.hasOwnProperty(r)||e.push(Rg(r))})}var ac=new RegExp(`${mc}\\s*(.+?)\\s*${Hg}`,"g");function uc(o){let t=[];if(typeof o=="string"){let e;for(;e=ac.exec(o);)t.push(e[1]);ac.lastIndex=0}return t}function Vo(o,t,e){let i=`${o}`,n=i.replace(ac,(r,a)=>{let c=t[a];return c==null&&(e.push(Fg(a)),c=""),c.toString()});return n==i?o:n}var $g=/-+([a-z0-9])/g;function ds(o){return o.replace($g,(...t)=>t[1].toUpperCase())}function Tp(o,t){return o===0||t===0}function Ep(o,t,e){if(e.size&&t.length){let i=t[0],n=[];if(e.forEach((r,a)=>{i.has(a)||n.push(a),i.set(a,r)}),n.length)for(let r=1;r<t.length;r++){let a=t[r];n.forEach(c=>a.set(c,ms(o,c)))}}return t}function qt(o,t,e){switch(t.type){case se.Trigger:return o.visitTrigger(t,e);case se.State:return o.visitState(t,e);case se.Transition:return o.visitTransition(t,e);case se.Sequence:return o.visitSequence(t,e);case se.Group:return o.visitGroup(t,e);case se.Animate:return o.visitAnimate(t,e);case se.Keyframes:return o.visitKeyframes(t,e);case se.Style:return o.visitStyle(t,e);case se.Reference:return o.visitReference(t,e);case se.AnimateChild:return o.visitAnimateChild(t,e);case se.AnimateRef:return o.visitAnimateRef(t,e);case se.Query:return o.visitQuery(t,e);case se.Stagger:return o.visitStagger(t,e);default:throw Ng(t.type)}}function ms(o,t){return window.getComputedStyle(o)[t]}var Ac=(()=>{class o{validateStyleProperty(e){return Sp(e)}containsElement(e,i){return cc(e,i)}getParentElement(e){return ss(e)}query(e,i,n){return dc(e,i,n)}computeStyle(e,i,n){return n||""}animate(e,i,n,r,a,c=[],h){return new Fi(n,r)}static \u0275fac=function(i){return new(i||o)};static \u0275prov=V({token:o,factory:o.\u0275fac})}return o})(),no=class{static NOOP=new Ac},oo=class{};var qg=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"]),fs=class extends oo{normalizePropertyName(t,e){return ds(t)}normalizeStyleValue(t,e,i,n){let r="",a=i.toString().trim();if(qg.has(e)&&i!==0&&i!=="0")if(typeof i=="number")r="px";else{let c=i.match(/^[+-]?[\d\.]+([a-z]*)$/);c&&c[1].length==0&&n.push(Jm(t,i))}return a+r}};var _s="*";function Gg(o,t){let e=[];return typeof o=="string"?o.split(/\s*,\s*/).forEach(i=>Yg(i,e,t)):e.push(o),e}function Yg(o,t,e){if(o[0]==":"){let h=Qg(o,e);if(typeof h=="function"){t.push(h);return}o=h}let i=o.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(i==null||i.length<4)return e.push(mp(o)),t;let n=i[1],r=i[2],a=i[3];t.push(Pp(n,a));let c=n==_s&&a==_s;r[0]=="<"&&!c&&t.push(Pp(a,n))}function Qg(o,t){switch(o){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(e,i)=>parseFloat(i)>parseFloat(e);case":decrement":return(e,i)=>parseFloat(i)<parseFloat(e);default:return t.push(pp(o)),"* => *"}}var ps=new Set(["true","1"]),hs=new Set(["false","0"]);function Pp(o,t){let e=ps.has(o)||hs.has(o),i=ps.has(t)||hs.has(t);return(n,r)=>{let a=o==_s||o==n,c=t==_s||t==r;return!a&&e&&typeof n=="boolean"&&(a=n?ps.has(o):hs.has(o)),!c&&i&&typeof r=="boolean"&&(c=r?ps.has(t):hs.has(t)),a&&c}}var zp=":self",Xg=new RegExp(`s*${zp}s*,?`,"g");function jp(o,t,e,i){return new yc(o).build(t,e,i)}var Op="",yc=class{_driver;constructor(t){this._driver=t}build(t,e,i){let n=new Cc(e);return this._resetContextStyleTimingState(n),qt(this,Lo(t),n)}_resetContextStyleTimingState(t){t.currentQuerySelector=Op,t.collectedStyles=new Map,t.collectedStyles.set(Op,new Map),t.currentTime=0}visitTrigger(t,e){let i=e.queryCount=0,n=e.depCount=0,r=[],a=[];return t.name.charAt(0)=="@"&&e.errors.push(ep()),t.definitions.forEach(c=>{if(this._resetContextStyleTimingState(e),c.type==se.State){let h=c,g=h.name;g.toString().split(/\s*,\s*/).forEach(b=>{h.name=b,r.push(this.visitState(h,e))}),h.name=g}else if(c.type==se.Transition){let h=this.visitTransition(c,e);i+=h.queryCount,n+=h.depCount,a.push(h)}else e.errors.push(tp())}),{type:se.Trigger,name:t.name,states:r,transitions:a,queryCount:i,depCount:n,options:null}}visitState(t,e){let i=this.visitStyle(t.styles,e),n=t.options&&t.options.params||null;if(i.containsDynamicStyles){let r=new Set,a=n||{};i.styles.forEach(c=>{c instanceof Map&&c.forEach(h=>{uc(h).forEach(g=>{a.hasOwnProperty(g)||r.add(g)})})}),r.size&&e.errors.push(ip(t.name,[...r.values()]))}return{type:se.State,name:t.name,style:i,options:n?{params:n}:null}}visitTransition(t,e){e.queryCount=0,e.depCount=0;let i=qt(this,Lo(t.animation),e),n=Gg(t.expr,e.errors);return{type:se.Transition,matchers:n,animation:i,queryCount:e.queryCount,depCount:e.depCount,options:io(t.options)}}visitSequence(t,e){return{type:se.Sequence,steps:t.steps.map(i=>qt(this,i,e)),options:io(t.options)}}visitGroup(t,e){let i=e.currentTime,n=0,r=t.steps.map(a=>{e.currentTime=i;let c=qt(this,a,e);return n=Math.max(n,e.currentTime),c});return e.currentTime=n,{type:se.Group,steps:r,options:io(t.options)}}visitAnimate(t,e){let i=ef(t.timings,e.errors);e.currentAnimateTimings=i;let n,r=t.styles?t.styles:In({});if(r.type==se.Keyframes)n=this.visitKeyframes(r,e);else{let a=t.styles,c=!1;if(!a){c=!0;let g={};i.easing&&(g.easing=i.easing),a=In(g)}e.currentTime+=i.duration+i.delay;let h=this.visitStyle(a,e);h.isEmptyStep=c,n=h}return e.currentAnimateTimings=null,{type:se.Animate,timings:i,style:n,options:null}}visitStyle(t,e){let i=this._makeStyleAst(t,e);return this._validateStyleAst(i,e),i}_makeStyleAst(t,e){let i=[],n=Array.isArray(t.styles)?t.styles:[t.styles];for(let c of n)typeof c=="string"?c===oi?i.push(c):e.errors.push(np(c)):i.push(new Map(Object.entries(c)));let r=!1,a=null;return i.forEach(c=>{if(c instanceof Map&&(c.has("easing")&&(a=c.get("easing"),c.delete("easing")),!r)){for(let h of c.values())if(h.toString().indexOf(mc)>=0){r=!0;break}}}),{type:se.Style,styles:i,easing:a,offset:t.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(t,e){let i=e.currentAnimateTimings,n=e.currentTime,r=e.currentTime;i&&r>0&&(r-=i.duration+i.delay),t.styles.forEach(a=>{typeof a!="string"&&a.forEach((c,h)=>{let g=e.collectedStyles.get(e.currentQuerySelector),b=g.get(h),S=!0;b&&(r!=n&&r>=b.startTime&&n<=b.endTime&&(e.errors.push(op(h,b.startTime,b.endTime,r,n)),S=!1),r=b.startTime),S&&g.set(h,{startTime:r,endTime:n}),e.options&&Mp(c,e.options,e.errors)})})}visitKeyframes(t,e){let i={type:se.Keyframes,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push(rp()),i;let n=1,r=0,a=[],c=!1,h=!1,g=0,b=t.steps.map(ke=>{let ve=this._makeStyleAst(ke,e),Ke=ve.offset!=null?ve.offset:Jg(ve.styles),ge=0;return Ke!=null&&(r++,ge=ve.offset=Ke),h=h||ge<0||ge>1,c=c||ge<g,g=ge,a.push(ge),ve});h&&e.errors.push(ap()),c&&e.errors.push(sp());let S=t.steps.length,P=0;r>0&&r<S?e.errors.push(lp()):r==0&&(P=n/(S-1));let N=S-1,k=e.currentTime,A=e.currentAnimateTimings,pe=A.duration;return b.forEach((ke,ve)=>{let Ke=P>0?ve==N?1:P*ve:a[ve],ge=Ke*pe;e.currentTime=k+A.delay+ge,A.duration=ge,this._validateStyleAst(ke,e),ke.offset=Ke,i.styles.push(ke)}),i}visitReference(t,e){return{type:se.Reference,animation:qt(this,Lo(t.animation),e),options:io(t.options)}}visitAnimateChild(t,e){return e.depCount++,{type:se.AnimateChild,options:io(t.options)}}visitAnimateRef(t,e){return{type:se.AnimateRef,animation:this.visitReference(t.animation,e),options:io(t.options)}}visitQuery(t,e){let i=e.currentQuerySelector,n=t.options||{};e.queryCount++,e.currentQuery=t;let[r,a]=Kg(t.selector);e.currentQuerySelector=i.length?i+" "+r:r,$t(e.collectedStyles,e.currentQuerySelector,new Map);let c=qt(this,Lo(t.animation),e);return e.currentQuery=null,e.currentQuerySelector=i,{type:se.Query,selector:r,limit:n.limit||0,optional:!!n.optional,includeSelf:a,animation:c,originalSelector:t.selector,options:io(t.options)}}visitStagger(t,e){e.currentQuery||e.errors.push(cp());let i=t.timings==="full"?{duration:0,delay:0,easing:"full"}:Lr(t.timings,e.errors,!0);return{type:se.Stagger,animation:qt(this,Lo(t.animation),e),timings:i,options:null}}};function Kg(o){let t=!!o.split(/\s*,\s*/).find(e=>e==zp);return t&&(o=o.replace(Xg,"")),o=o.replace(/@\*/g,Nr).replace(/@\w+/g,e=>Nr+"-"+e.slice(1)).replace(/:animating/g,cs),[o,t]}function Zg(o){return o?Z({},o):null}var Cc=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(t){this.errors=t}};function Jg(o){if(typeof o=="string")return null;let t=null;if(Array.isArray(o))o.forEach(e=>{if(e instanceof Map&&e.has("offset")){let i=e;t=parseFloat(i.get("offset")),i.delete("offset")}});else if(o instanceof Map&&o.has("offset")){let e=o;t=parseFloat(e.get("offset")),e.delete("offset")}return t}function ef(o,t){if(o.hasOwnProperty("duration"))return o;if(typeof o=="number"){let r=Lr(o,t).duration;return gc(r,0,"")}let e=o;if(e.split(/\s+/).some(r=>r.charAt(0)=="{"&&r.charAt(1)=="{")){let r=gc(0,0,"");return r.dynamic=!0,r.strValue=e,r}let n=Lr(e,t);return gc(n.duration,n.delay,n.easing)}function io(o){return o?(o=Z({},o),o.params&&(o.params=Zg(o.params))):o={},o}function gc(o,t,e){return{duration:o,delay:t,easing:e}}function Ic(o,t,e,i,n,r,a=null,c=!1){return{type:1,element:o,keyframes:t,preStyleProps:e,postStyleProps:i,duration:n,delay:r,totalTime:n+r,easing:a,subTimeline:c}}var zr=class{_map=new Map;get(t){return this._map.get(t)||[]}append(t,e){let i=this._map.get(t);i||this._map.set(t,i=[]),i.push(...e)}has(t){return this._map.has(t)}clear(){this._map.clear()}},tf=1,nf=":enter",of=new RegExp(nf,"g"),rf=":leave",af=new RegExp(rf,"g");function Bp(o,t,e,i,n,r=new Map,a=new Map,c,h,g=[]){return new xc().buildKeyframes(o,t,e,i,n,r,a,c,h,g)}var xc=class{buildKeyframes(t,e,i,n,r,a,c,h,g,b=[]){g=g||new zr;let S=new wc(t,e,g,n,r,b,[]);S.options=h;let P=h.delay?Ni(h.delay):0;S.currentTimeline.delayNextStep(P),S.currentTimeline.setStyles([a],null,S.errors,h),qt(this,i,S);let N=S.timelines.filter(k=>k.containsAnimation());if(N.length&&c.size){let k;for(let A=N.length-1;A>=0;A--){let pe=N[A];if(pe.element===e){k=pe;break}}k&&!k.allowOnlyTimelineStyles()&&k.setStyles([c],null,S.errors,h)}return N.length?N.map(k=>k.buildKeyframes()):[Ic(e,[],[],[],0,P,"",!1)]}visitTrigger(t,e){}visitState(t,e){}visitTransition(t,e){}visitAnimateChild(t,e){let i=e.subInstructions.get(e.element);if(i){let n=e.createSubContext(t.options),r=e.currentTimeline.currentTime,a=this._visitSubInstructions(i,n,n.options);r!=a&&e.transformIntoNewTimeline(a)}e.previousNode=t}visitAnimateRef(t,e){let i=e.createSubContext(t.options);i.transformIntoNewTimeline(),this._applyAnimationRefDelays([t.options,t.animation.options],e,i),this.visitReference(t.animation,i),e.transformIntoNewTimeline(i.currentTimeline.currentTime),e.previousNode=t}_applyAnimationRefDelays(t,e,i){for(let n of t){let r=n?.delay;if(r){let a=typeof r=="number"?r:Ni(Vo(r,n?.params??{},e.errors));i.delayNextStep(a)}}}_visitSubInstructions(t,e,i){let r=e.currentTimeline.currentTime,a=i.duration!=null?Ni(i.duration):null,c=i.delay!=null?Ni(i.delay):null;return a!==0&&t.forEach(h=>{let g=e.appendInstructionToTimeline(h,a,c);r=Math.max(r,g.duration+g.delay)}),r}visitReference(t,e){e.updateOptions(t.options,!0),qt(this,t.animation,e),e.previousNode=t}visitSequence(t,e){let i=e.subContextCount,n=e,r=t.options;if(r&&(r.params||r.delay)&&(n=e.createSubContext(r),n.transformIntoNewTimeline(),r.delay!=null)){n.previousNode.type==se.Style&&(n.currentTimeline.snapshotCurrentStyles(),n.previousNode=bs);let a=Ni(r.delay);n.delayNextStep(a)}t.steps.length&&(t.steps.forEach(a=>qt(this,a,n)),n.currentTimeline.applyStylesToKeyframe(),n.subContextCount>i&&n.transformIntoNewTimeline()),e.previousNode=t}visitGroup(t,e){let i=[],n=e.currentTimeline.currentTime,r=t.options&&t.options.delay?Ni(t.options.delay):0;t.steps.forEach(a=>{let c=e.createSubContext(t.options);r&&c.delayNextStep(r),qt(this,a,c),n=Math.max(n,c.currentTimeline.currentTime),i.push(c.currentTimeline)}),i.forEach(a=>e.currentTimeline.mergeTimelineCollectedStyles(a)),e.transformIntoNewTimeline(n),e.previousNode=t}_visitTiming(t,e){if(t.dynamic){let i=t.strValue,n=e.params?Vo(i,e.params,e.errors):i;return Lr(n,e.errors)}else return{duration:t.duration,delay:t.delay,easing:t.easing}}visitAnimate(t,e){let i=e.currentAnimateTimings=this._visitTiming(t.timings,e),n=e.currentTimeline;i.delay&&(e.incrementTime(i.delay),n.snapshotCurrentStyles());let r=t.style;r.type==se.Keyframes?this.visitKeyframes(r,e):(e.incrementTime(i.duration),this.visitStyle(r,e),n.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=t}visitStyle(t,e){let i=e.currentTimeline,n=e.currentAnimateTimings;!n&&i.hasCurrentStyleProperties()&&i.forwardFrame();let r=n&&n.easing||t.easing;t.isEmptyStep?i.applyEmptyStep(r):i.setStyles(t.styles,r,e.errors,e.options),e.previousNode=t}visitKeyframes(t,e){let i=e.currentAnimateTimings,n=e.currentTimeline.duration,r=i.duration,c=e.createSubContext().currentTimeline;c.easing=i.easing,t.styles.forEach(h=>{let g=h.offset||0;c.forwardTime(g*r),c.setStyles(h.styles,h.easing,e.errors,e.options),c.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(c),e.transformIntoNewTimeline(n+r),e.previousNode=t}visitQuery(t,e){let i=e.currentTimeline.currentTime,n=t.options||{},r=n.delay?Ni(n.delay):0;r&&(e.previousNode.type===se.Style||i==0&&e.currentTimeline.hasCurrentStyleProperties())&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=bs);let a=i,c=e.invokeQuery(t.selector,t.originalSelector,t.limit,t.includeSelf,!!n.optional,e.errors);e.currentQueryTotal=c.length;let h=null;c.forEach((g,b)=>{e.currentQueryIndex=b;let S=e.createSubContext(t.options,g);r&&S.delayNextStep(r),g===e.element&&(h=S.currentTimeline),qt(this,t.animation,S),S.currentTimeline.applyStylesToKeyframe();let P=S.currentTimeline.currentTime;a=Math.max(a,P)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(a),h&&(e.currentTimeline.mergeTimelineCollectedStyles(h),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=t}visitStagger(t,e){let i=e.parentContext,n=e.currentTimeline,r=t.timings,a=Math.abs(r.duration),c=a*(e.currentQueryTotal-1),h=a*e.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":h=c-h;break;case"full":h=i.currentStaggerTime;break}let b=e.currentTimeline;h&&b.delayNextStep(h);let S=b.currentTime;qt(this,t.animation,e),e.previousNode=t,i.currentStaggerTime=n.currentTime-S+(n.startTime-i.currentTimeline.startTime)}},bs={},wc=class o{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=bs;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(t,e,i,n,r,a,c,h){this._driver=t,this.element=e,this.subInstructions=i,this._enterClassName=n,this._leaveClassName=r,this.errors=a,this.timelines=c,this.currentTimeline=h||new vs(this._driver,e,0),c.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(t,e){if(!t)return;let i=t,n=this.options;i.duration!=null&&(n.duration=Ni(i.duration)),i.delay!=null&&(n.delay=Ni(i.delay));let r=i.params;if(r){let a=n.params;a||(a=this.options.params={}),Object.keys(r).forEach(c=>{(!e||!a.hasOwnProperty(c))&&(a[c]=Vo(r[c],a,this.errors))})}}_copyOptions(){let t={};if(this.options){let e=this.options.params;if(e){let i=t.params={};Object.keys(e).forEach(n=>{i[n]=e[n]})}}return t}createSubContext(t=null,e,i){let n=e||this.element,r=new o(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(t),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(t){return this.previousNode=bs,this.currentTimeline=this.currentTimeline.fork(this.element,t),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(t,e,i){let n={duration:e??t.duration,delay:this.currentTimeline.currentTime+(i??0)+t.delay,easing:""},r=new Sc(this._driver,t.element,t.keyframes,t.preStyleProps,t.postStyleProps,n,t.stretchStartingKeyframe);return this.timelines.push(r),n}incrementTime(t){this.currentTimeline.forwardTime(this.currentTimeline.duration+t)}delayNextStep(t){t>0&&this.currentTimeline.delayNextStep(t)}invokeQuery(t,e,i,n,r,a){let c=[];if(n&&c.push(this.element),t.length>0){t=t.replace(of,"."+this._enterClassName),t=t.replace(af,"."+this._leaveClassName);let h=i!=1,g=this._driver.query(this.element,t,h);i!==0&&(g=i<0?g.slice(g.length+i,g.length):g.slice(0,i)),c.push(...g)}return!r&&c.length==0&&a.push(dp(e)),c}},vs=class o{_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(t,e,i,n){this._driver=t,this.element=e,this.startTime=i,this._elementTimelineStylesLookup=n,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(e),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(e,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(t){let e=this._keyframes.size===1&&this._pendingStyles.size;this.duration||e?(this.forwardTime(this.currentTime+t),e&&this.snapshotCurrentStyles()):this.startTime+=t}fork(t,e){return this.applyStylesToKeyframe(),new o(this._driver,t,e||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+=tf,this._loadKeyframe()}forwardTime(t){this.applyStylesToKeyframe(),this.duration=t,this._loadKeyframe()}_updateStyle(t,e){this._localTimelineStyles.set(t,e),this._globalTimelineStyles.set(t,e),this._styleSummary.set(t,{time:this.currentTime,value:e})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(t){t&&this._previousKeyframe.set("easing",t);for(let[e,i]of this._globalTimelineStyles)this._backFill.set(e,i||oi),this._currentKeyframe.set(e,oi);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(t,e,i,n){e&&this._previousKeyframe.set("easing",e);let r=n&&n.params||{},a=sf(t,this._globalTimelineStyles);for(let[c,h]of a){let g=Vo(h,r,i);this._pendingStyles.set(c,g),this._localTimelineStyles.has(c)||this._backFill.set(c,this._globalTimelineStyles.get(c)??oi),this._updateStyle(c,g)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((t,e)=>{this._currentKeyframe.set(e,t)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((t,e)=>{this._currentKeyframe.has(e)||this._currentKeyframe.set(e,t)}))}snapshotCurrentStyles(){for(let[t,e]of this._localTimelineStyles)this._pendingStyles.set(t,e),this._updateStyle(t,e)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let t=[];for(let e in this._currentKeyframe)t.push(e);return t}mergeTimelineCollectedStyles(t){t._styleSummary.forEach((e,i)=>{let n=this._styleSummary.get(i);(!n||e.time>n.time)&&this._updateStyle(i,e.value)})}buildKeyframes(){this.applyStylesToKeyframe();let t=new Set,e=new Set,i=this._keyframes.size===1&&this.duration===0,n=[];this._keyframes.forEach((c,h)=>{let g=new Map([...this._backFill,...c]);g.forEach((b,S)=>{b===No?t.add(S):b===oi&&e.add(S)}),i||g.set("offset",h/this.duration),n.push(g)});let r=[...t.values()],a=[...e.values()];if(i){let c=n[0],h=new Map(c);c.set("offset",0),h.set("offset",1),n=[c,h]}return Ic(this.element,n,r,a,this.duration,this.startTime,this.easing,!1)}},Sc=class extends vs{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(t,e,i,n,r,a,c=!1){super(t,e,a.delay),this.keyframes=i,this.preStyleProps=n,this.postStyleProps=r,this._stretchStartingKeyframe=c,this.timings={duration:a.duration,delay:a.delay,easing:a.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let t=this.keyframes,{delay:e,duration:i,easing:n}=this.timings;if(this._stretchStartingKeyframe&&e){let r=[],a=i+e,c=e/a,h=new Map(t[0]);h.set("offset",0),r.push(h);let g=new Map(t[0]);g.set("offset",Ap(c)),r.push(g);let b=t.length-1;for(let S=1;S<=b;S++){let P=new Map(t[S]),N=P.get("offset"),k=e+N*i;P.set("offset",Ap(k/a)),r.push(P)}i=a,e=0,n="",t=r}return Ic(this.element,t,this.preStyleProps,this.postStyleProps,i,e,n,!0)}};function Ap(o,t=3){let e=Math.pow(10,t-1);return Math.round(o*e)/e}function sf(o,t){let e=new Map,i;return o.forEach(n=>{if(n==="*"){i??=t.keys();for(let r of i)e.set(r,oi)}else for(let[r,a]of n)e.set(r,a)}),e}function Ip(o,t,e,i,n,r,a,c,h,g,b,S,P){return{type:0,element:o,triggerName:t,isRemovalTransition:n,fromState:e,fromStyles:r,toState:i,toStyles:a,timelines:c,queriedElements:h,preStyleProps:g,postStyleProps:b,totalTime:S,errors:P}}var fc={},ys=class{_triggerName;ast;_stateStyles;constructor(t,e,i){this._triggerName=t,this.ast=e,this._stateStyles=i}match(t,e,i,n){return lf(this.ast.matchers,t,e,i,n)}buildStyles(t,e,i){let n=this._stateStyles.get("*");return t!==void 0&&(n=this._stateStyles.get(t?.toString())||n),n?n.buildStyles(e,i):new Map}build(t,e,i,n,r,a,c,h,g,b){let S=[],P=this.ast.options&&this.ast.options.params||fc,N=c&&c.params||fc,k=this.buildStyles(i,N,S),A=h&&h.params||fc,pe=this.buildStyles(n,A,S),ke=new Set,ve=new Map,Ke=new Map,ge=n==="void",Bt={params:Hp(A,P),delay:this.ast.options?.delay},pt=b?[]:Bp(t,e,this.ast.animation,r,a,k,pe,Bt,g,S),Ze=0;return pt.forEach(xt=>{Ze=Math.max(xt.duration+xt.delay,Ze)}),S.length?Ip(e,this._triggerName,i,n,ge,k,pe,[],[],ve,Ke,Ze,S):(pt.forEach(xt=>{let Xi=xt.element,Cn=$t(ve,Xi,new Set);xt.preStyleProps.forEach(mi=>Cn.add(mi));let ht=$t(Ke,Xi,new Set);xt.postStyleProps.forEach(mi=>ht.add(mi)),Xi!==e&&ke.add(Xi)}),Ip(e,this._triggerName,i,n,ge,k,pe,pt,[...ke.values()],ve,Ke,Ze))}};function lf(o,t,e,i,n){return o.some(r=>r(t,e,i,n))}function Hp(o,t){let e=Z({},t);return Object.entries(o).forEach(([i,n])=>{n!=null&&(e[i]=n)}),e}var kc=class{styles;defaultParams;normalizer;constructor(t,e,i){this.styles=t,this.defaultParams=e,this.normalizer=i}buildStyles(t,e){let i=new Map,n=Hp(t,this.defaultParams);return this.styles.styles.forEach(r=>{typeof r!="string"&&r.forEach((a,c)=>{a&&(a=Vo(a,n,e));let h=this.normalizer.normalizePropertyName(c,e);a=this.normalizer.normalizeStyleValue(c,h,a,e),i.set(c,a)})}),i}};function cf(o,t,e){return new Mc(o,t,e)}var Mc=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(t,e,i){this.name=t,this.ast=e,this._normalizer=i,e.states.forEach(n=>{let r=n.options&&n.options.params||{};this.states.set(n.name,new kc(n.style,r,i))}),Dp(this.states,"true","1"),Dp(this.states,"false","0"),e.transitions.forEach(n=>{this.transitionFactories.push(new ys(t,n,this.states))}),this.fallbackTransition=df(t,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(t,e,i,n){return this.transitionFactories.find(a=>a.match(t,e,i,n))||null}matchStyles(t,e,i){return this.fallbackTransition.buildStyles(t,e,i)}};function df(o,t,e){let i=[(a,c)=>!0],n={type:se.Sequence,steps:[],options:null},r={type:se.Transition,animation:n,matchers:i,options:null,queryCount:0,depCount:0};return new ys(o,r,t)}function Dp(o,t,e){o.has(t)?o.has(e)||o.set(e,o.get(t)):o.has(e)&&o.set(t,o.get(e))}var mf=new zr,Tc=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(t,e,i){this.bodyNode=t,this._driver=e,this._normalizer=i}register(t,e){let i=[],n=[],r=jp(this._driver,e,i,n);if(i.length)throw up(i);this._animations.set(t,r)}_buildPlayer(t,e,i){let n=t.element,r=sc(this._normalizer,t.keyframes,e,i);return this._driver.animate(n,r,t.duration,t.delay,t.easing,[],!0)}create(t,e,i={}){let n=[],r=this._animations.get(t),a,c=new Map;if(r?(a=Bp(this._driver,e,r,pc,ls,new Map,new Map,i,mf,n),a.forEach(b=>{let S=$t(c,b.element,new Map);b.postStyleProps.forEach(P=>S.set(P,null))})):(n.push(gp()),a=[]),n.length)throw fp(n);c.forEach((b,S)=>{b.forEach((P,N)=>{b.set(N,this._driver.computeStyle(S,N,oi))})});let h=a.map(b=>{let S=c.get(b.element);return this._buildPlayer(b,new Map,S)}),g=on(h);return this._playersById.set(t,g),g.onDestroy(()=>this.destroy(t)),this.players.push(g),g}destroy(t){let e=this._getPlayer(t);e.destroy(),this._playersById.delete(t);let i=this.players.indexOf(e);i>=0&&this.players.splice(i,1)}_getPlayer(t){let e=this._playersById.get(t);if(!e)throw _p(t);return e}listen(t,e,i,n){let r=as(e,"","","");return rs(this._getPlayer(t),i,r,n),()=>{}}command(t,e,i,n){if(i=="register"){this.register(t,n[0]);return}if(i=="create"){let a=n[0]||{};this.create(t,e,a);return}let r=this._getPlayer(t);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(t);break}}},Rp="ng-animate-queued",pf=".ng-animate-queued",_c="ng-animate-disabled",hf=".ng-animate-disabled",uf="ng-star-inserted",gf=".ng-star-inserted",ff=[],Wp={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},_f={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},_i="__ng_removed",jr=class{namespaceId;value;options;get params(){return this.options.params}constructor(t,e=""){this.namespaceId=e;let i=t&&t.hasOwnProperty("value"),n=i?t.value:t;if(this.value=vf(n),i){let r=t,{value:a}=r,c=im(r,["value"]);this.options=c}else this.options={};this.options.params||(this.options.params={})}absorbOptions(t){let e=t.params;if(e){let i=this.options.params;Object.keys(e).forEach(n=>{i[n]==null&&(i[n]=e[n])})}}},Vr="void",bc=new jr(Vr),Ec=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(t,e,i){this.id=t,this.hostElement=e,this._engine=i,this._hostClassName="ng-tns-"+t,ri(e,this._hostClassName)}listen(t,e,i,n){if(!this._triggers.has(e))throw bp(i,e);if(i==null||i.length==0)throw vp(e);if(!yf(i))throw yp(i,e);let r=$t(this._elementListeners,t,[]),a={name:e,phase:i,callback:n};r.push(a);let c=$t(this._engine.statesByElement,t,new Map);return c.has(e)||(ri(t,Fr),ri(t,Fr+"-"+e),c.set(e,bc)),()=>{this._engine.afterFlush(()=>{let h=r.indexOf(a);h>=0&&r.splice(h,1),this._triggers.has(e)||c.delete(e)})}}register(t,e){return this._triggers.has(t)?!1:(this._triggers.set(t,e),!0)}_getTrigger(t){let e=this._triggers.get(t);if(!e)throw Cp(t);return e}trigger(t,e,i,n=!0){let r=this._getTrigger(e),a=new Br(this.id,e,t),c=this._engine.statesByElement.get(t);c||(ri(t,Fr),ri(t,Fr+"-"+e),this._engine.statesByElement.set(t,c=new Map));let h=c.get(e),g=new jr(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&h&&g.absorbOptions(h.options),c.set(e,g),h||(h=bc),!(g.value===Vr)&&h.value===g.value){if(!wf(h.params,g.params)){let A=[],pe=r.matchStyles(h.value,h.params,A),ke=r.matchStyles(g.value,g.params,A);A.length?this._engine.reportError(A):this._engine.afterFlush(()=>{Dn(t,pe),fi(t,ke)})}return}let P=$t(this._engine.playersByElement,t,[]);P.forEach(A=>{A.namespaceId==this.id&&A.triggerName==e&&A.queued&&A.destroy()});let N=r.matchTransition(h.value,g.value,t,g.params),k=!1;if(!N){if(!n)return;N=r.fallbackTransition,k=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:e,transition:N,fromState:h,toState:g,player:a,isFallbackTransition:k}),k||(ri(t,Rp),a.onStart(()=>{zo(t,Rp)})),a.onDone(()=>{let A=this.players.indexOf(a);A>=0&&this.players.splice(A,1);let pe=this._engine.playersByElement.get(t);if(pe){let ke=pe.indexOf(a);ke>=0&&pe.splice(ke,1)}}),this.players.push(a),P.push(a),a}deregister(t){this._triggers.delete(t),this._engine.statesByElement.forEach(e=>e.delete(t)),this._elementListeners.forEach((e,i)=>{this._elementListeners.set(i,e.filter(n=>n.name!=t))})}clearElementCache(t){this._engine.statesByElement.delete(t),this._elementListeners.delete(t);let e=this._engine.playersByElement.get(t);e&&(e.forEach(i=>i.destroy()),this._engine.playersByElement.delete(t))}_signalRemovalForInnerTriggers(t,e){let i=this._engine.driver.query(t,Nr,!0);i.forEach(n=>{if(n[_i])return;let r=this._engine.fetchNamespacesByElement(n);r.size?r.forEach(a=>a.triggerLeaveAnimation(n,e,!1,!0)):this.clearElementCache(n)}),this._engine.afterFlushAnimationsDone(()=>i.forEach(n=>this.clearElementCache(n)))}triggerLeaveAnimation(t,e,i,n){let r=this._engine.statesByElement.get(t),a=new Map;if(r){let c=[];if(r.forEach((h,g)=>{if(a.set(g,h.value),this._triggers.has(g)){let b=this.trigger(t,g,Vr,n);b&&c.push(b)}}),c.length)return this._engine.markElementAsRemoved(this.id,t,!0,e,a),i&&on(c).onDone(()=>this._engine.processLeaveNode(t)),!0}return!1}prepareLeaveAnimationListeners(t){let e=this._elementListeners.get(t),i=this._engine.statesByElement.get(t);if(e&&i){let n=new Set;e.forEach(r=>{let a=r.name;if(n.has(a))return;n.add(a);let h=this._triggers.get(a).fallbackTransition,g=i.get(a)||bc,b=new jr(Vr),S=new Br(this.id,a,t);this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:a,transition:h,fromState:g,toState:b,player:S,isFallbackTransition:!0})})}}removeNode(t,e){let i=this._engine;if(t.childElementCount&&this._signalRemovalForInnerTriggers(t,e),this.triggerLeaveAnimation(t,e,!0))return;let n=!1;if(i.totalAnimations){let r=i.players.length?i.playersByQueriedElement.get(t):[];if(r&&r.length)n=!0;else{let a=t;for(;a=a.parentNode;)if(i.statesByElement.get(a)){n=!0;break}}}if(this.prepareLeaveAnimationListeners(t),n)i.markElementAsRemoved(this.id,t,!1,e);else{let r=t[_i];(!r||r===Wp)&&(i.afterFlush(()=>this.clearElementCache(t)),i.destroyInnerAnimations(t),i._onRemovalComplete(t,e))}}insertNode(t,e){ri(t,this._hostClassName)}drainQueuedTransitions(t){let e=[];return this._queue.forEach(i=>{let n=i.player;if(n.destroyed)return;let r=i.element,a=this._elementListeners.get(r);a&&a.forEach(c=>{if(c.name==i.triggerName){let h=as(r,i.triggerName,i.fromState.value,i.toState.value);h._data=t,rs(i.player,c.phase,h,c.callback)}}),n.markedForDestroy?this._engine.afterFlush(()=>{n.destroy()}):e.push(i)}),this._queue=[],e.sort((i,n)=>{let r=i.transition.ast.depCount,a=n.transition.ast.depCount;return r==0||a==0?r-a:this._engine.driver.containsElement(i.element,n.element)?1:-1})}destroy(t){this.players.forEach(e=>e.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,t)}},Pc=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=(t,e)=>{};_onRemovalComplete(t,e){this.onRemovalComplete(t,e)}constructor(t,e,i){this.bodyNode=t,this.driver=e,this._normalizer=i}get queuedPlayers(){let t=[];return this._namespaceList.forEach(e=>{e.players.forEach(i=>{i.queued&&t.push(i)})}),t}createNamespace(t,e){let i=new Ec(t,e,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,e)?this._balanceNamespaceList(i,e):(this.newHostElements.set(e,i),this.collectEnterElement(e)),this._namespaceLookup[t]=i}_balanceNamespaceList(t,e){let i=this._namespaceList,n=this.namespacesByHostElement;if(i.length-1>=0){let a=!1,c=this.driver.getParentElement(e);for(;c;){let h=n.get(c);if(h){let g=i.indexOf(h);i.splice(g+1,0,t),a=!0;break}c=this.driver.getParentElement(c)}a||i.unshift(t)}else i.push(t);return n.set(e,t),t}register(t,e){let i=this._namespaceLookup[t];return i||(i=this.createNamespace(t,e)),i}registerTrigger(t,e,i){let n=this._namespaceLookup[t];n&&n.register(e,i)&&this.totalAnimations++}destroy(t,e){t&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let i=this._fetchNamespace(t);this.namespacesByHostElement.delete(i.hostElement);let n=this._namespaceList.indexOf(i);n>=0&&this._namespaceList.splice(n,1),i.destroy(e),delete this._namespaceLookup[t]}))}_fetchNamespace(t){return this._namespaceLookup[t]}fetchNamespacesByElement(t){let e=new Set,i=this.statesByElement.get(t);if(i){for(let n of i.values())if(n.namespaceId){let r=this._fetchNamespace(n.namespaceId);r&&e.add(r)}}return e}trigger(t,e,i,n){if(us(e)){let r=this._fetchNamespace(t);if(r)return r.trigger(e,i,n),!0}return!1}insertNode(t,e,i,n){if(!us(e))return;let r=e[_i];if(r&&r.setForRemoval){r.setForRemoval=!1,r.setForMove=!0;let a=this.collectedLeaveElements.indexOf(e);a>=0&&this.collectedLeaveElements.splice(a,1)}if(t){let a=this._fetchNamespace(t);a&&a.insertNode(e,i)}n&&this.collectEnterElement(e)}collectEnterElement(t){this.collectedEnterElements.push(t)}markElementAsDisabled(t,e){e?this.disabledNodes.has(t)||(this.disabledNodes.add(t),ri(t,_c)):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),zo(t,_c))}removeNode(t,e,i){if(us(e)){let n=t?this._fetchNamespace(t):null;n?n.removeNode(e,i):this.markElementAsRemoved(t,e,!1,i);let r=this.namespacesByHostElement.get(e);r&&r.id!==t&&r.removeNode(e,i)}else this._onRemovalComplete(e,i)}markElementAsRemoved(t,e,i,n,r){this.collectedLeaveElements.push(e),e[_i]={namespaceId:t,setForRemoval:n,hasAnimation:i,removedBeforeQueried:!1,previousTriggersValues:r}}listen(t,e,i,n,r){return us(e)?this._fetchNamespace(t).listen(e,i,n,r):()=>{}}_buildInstruction(t,e,i,n,r){return t.transition.build(this.driver,t.element,t.fromState.value,t.toState.value,i,n,t.fromState.options,t.toState.options,e,r)}destroyInnerAnimations(t){let e=this.driver.query(t,Nr,!0);e.forEach(i=>this.destroyActiveAnimationsForElement(i)),this.playersByQueriedElement.size!=0&&(e=this.driver.query(t,cs,!0),e.forEach(i=>this.finishActiveQueriedAnimationOnElement(i)))}destroyActiveAnimationsForElement(t){let e=this.playersByElement.get(t);e&&e.forEach(i=>{i.queued?i.markedForDestroy=!0:i.destroy()})}finishActiveQueriedAnimationOnElement(t){let e=this.playersByQueriedElement.get(t);e&&e.forEach(i=>i.finish())}whenRenderingDone(){return new Promise(t=>{if(this.players.length)return on(this.players).onDone(()=>t());t()})}processLeaveNode(t){let e=t[_i];if(e&&e.setForRemoval){if(t[_i]=Wp,e.namespaceId){this.destroyInnerAnimations(t);let i=this._fetchNamespace(e.namespaceId);i&&i.clearElementCache(t)}this._onRemovalComplete(t,e.setForRemoval)}t.classList?.contains(_c)&&this.markElementAsDisabled(t,!1),this.driver.query(t,hf,!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(t=-1){let e=[];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];ri(n,uf)}if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){let i=[];try{e=this._flushAnimations(i,t)}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=[],e.length?on(e).onDone(()=>{i.forEach(n=>n())}):i.forEach(n=>n())}}reportError(t){throw xp(t)}_flushAnimations(t,e){let i=new zr,n=[],r=new Map,a=[],c=new Map,h=new Map,g=new Map,b=new Set;this.disabledNodes.forEach($=>{b.add($);let G=this.driver.query($,pf,!0);for(let X=0;X<G.length;X++)b.add(G[X])});let S=this.bodyNode,P=Array.from(this.statesByElement.keys()),N=Lp(P,this.collectedEnterElements),k=new Map,A=0;N.forEach(($,G)=>{let X=pc+A++;k.set(G,X),$.forEach(fe=>ri(fe,X))});let pe=[],ke=new Set,ve=new Set;for(let $=0;$<this.collectedLeaveElements.length;$++){let G=this.collectedLeaveElements[$],X=G[_i];X&&X.setForRemoval&&(pe.push(G),ke.add(G),X.hasAnimation?this.driver.query(G,gf,!0).forEach(fe=>ke.add(fe)):ve.add(G))}let Ke=new Map,ge=Lp(P,Array.from(ke));ge.forEach(($,G)=>{let X=ls+A++;Ke.set(G,X),$.forEach(fe=>ri(fe,X))}),t.push(()=>{N.forEach(($,G)=>{let X=k.get(G);$.forEach(fe=>zo(fe,X))}),ge.forEach(($,G)=>{let X=Ke.get(G);$.forEach(fe=>zo(fe,X))}),pe.forEach($=>{this.processLeaveNode($)})});let Bt=[],pt=[];for(let $=this._namespaceList.length-1;$>=0;$--)this._namespaceList[$].drainQueuedTransitions(e).forEach(X=>{let fe=X.player,ot=X.element;if(Bt.push(fe),this.collectedEnterElements.length){let at=ot[_i];if(at&&at.setForMove){if(at.previousTriggersValues&&at.previousTriggersValues.has(X.triggerName)){let Ht=at.previousTriggersValues.get(X.triggerName),At=this.statesByElement.get(X.element);if(At&&At.has(X.triggerName)){let xn=At.get(X.triggerName);xn.value=Ht,At.set(X.triggerName,xn)}}fe.destroy();return}}let De=!S||!this.driver.containsElement(S,ot),wt=Ke.get(ot),Fe=k.get(ot),Ne=this._buildInstruction(X,i,Fe,wt,De);if(Ne.errors&&Ne.errors.length){pt.push(Ne);return}if(De){fe.onStart(()=>Dn(ot,Ne.fromStyles)),fe.onDestroy(()=>fi(ot,Ne.toStyles)),n.push(fe);return}if(X.isFallbackTransition){fe.onStart(()=>Dn(ot,Ne.fromStyles)),fe.onDestroy(()=>fi(ot,Ne.toStyles)),n.push(fe);return}let We=[];Ne.timelines.forEach(at=>{at.stretchStartingKeyframe=!0,this.disabledNodes.has(at.element)||We.push(at)}),Ne.timelines=We,i.append(ot,Ne.timelines);let Wn={instruction:Ne,player:fe,element:ot};a.push(Wn),Ne.queriedElements.forEach(at=>$t(c,at,[]).push(fe)),Ne.preStyleProps.forEach((at,Ht)=>{if(at.size){let At=h.get(Ht);At||h.set(Ht,At=new Set),at.forEach((xn,vo)=>At.add(vo))}}),Ne.postStyleProps.forEach((at,Ht)=>{let At=g.get(Ht);At||g.set(Ht,At=new Set),at.forEach((xn,vo)=>At.add(vo))})});if(pt.length){let $=[];pt.forEach(G=>{$.push(wp(G.triggerName,G.errors))}),Bt.forEach(G=>G.destroy()),this.reportError($)}let Ze=new Map,xt=new Map;a.forEach($=>{let G=$.element;i.has(G)&&(xt.set(G,G),this._beforeAnimationBuild($.player.namespaceId,$.instruction,Ze))}),n.forEach($=>{let G=$.element;this._getPreviousPlayers(G,!1,$.namespaceId,$.triggerName,null).forEach(fe=>{$t(Ze,G,[]).push(fe),fe.destroy()})});let Xi=pe.filter($=>Vp($,h,g)),Cn=new Map;Np(Cn,this.driver,ve,g,oi).forEach($=>{Vp($,h,g)&&Xi.push($)});let mi=new Map;N.forEach(($,G)=>{Np(mi,this.driver,new Set($),h,No)}),Xi.forEach($=>{let G=Cn.get($),X=mi.get($);Cn.set($,new Map([...G?.entries()??[],...X?.entries()??[]]))});let Hn=[],bo=[],ya={};a.forEach($=>{let{element:G,player:X,instruction:fe}=$;if(i.has(G)){if(b.has(G)){X.onDestroy(()=>fi(G,fe.toStyles)),X.disabled=!0,X.overrideTotalTime(fe.totalTime),n.push(X);return}let ot=ya;if(xt.size>1){let wt=G,Fe=[];for(;wt=wt.parentNode;){let Ne=xt.get(wt);if(Ne){ot=Ne;break}Fe.push(wt)}Fe.forEach(Ne=>xt.set(Ne,ot))}let De=this._buildAnimation(X.namespaceId,fe,Ze,r,mi,Cn);if(X.setRealPlayer(De),ot===ya)Hn.push(X);else{let wt=this.playersByElement.get(ot);wt&&wt.length&&(X.parentPlayer=on(wt)),n.push(X)}}else Dn(G,fe.fromStyles),X.onDestroy(()=>fi(G,fe.toStyles)),bo.push(X),b.has(G)&&n.push(X)}),bo.forEach($=>{let G=r.get($.element);if(G&&G.length){let X=on(G);$.setRealPlayer(X)}}),n.forEach($=>{$.parentPlayer?$.syncPlayerEvents($.parentPlayer):$.destroy()});for(let $=0;$<pe.length;$++){let G=pe[$],X=G[_i];if(zo(G,ls),X&&X.hasAnimation)continue;let fe=[];if(c.size){let De=c.get(G);De&&De.length&&fe.push(...De);let wt=this.driver.query(G,cs,!0);for(let Fe=0;Fe<wt.length;Fe++){let Ne=c.get(wt[Fe]);Ne&&Ne.length&&fe.push(...Ne)}}let ot=fe.filter(De=>!De.destroyed);ot.length?Cf(this,G,ot):this.processLeaveNode(G)}return pe.length=0,Hn.forEach($=>{this.players.push($),$.onDone(()=>{$.destroy();let G=this.players.indexOf($);this.players.splice(G,1)}),$.play()}),Hn}afterFlush(t){this._flushFns.push(t)}afterFlushAnimationsDone(t){this._whenQuietFns.push(t)}_getPreviousPlayers(t,e,i,n,r){let a=[];if(e){let c=this.playersByQueriedElement.get(t);c&&(a=c)}else{let c=this.playersByElement.get(t);if(c){let h=!r||r==Vr;c.forEach(g=>{g.queued||!h&&g.triggerName!=n||a.push(g)})}}return(i||n)&&(a=a.filter(c=>!(i&&i!=c.namespaceId||n&&n!=c.triggerName))),a}_beforeAnimationBuild(t,e,i){let n=e.triggerName,r=e.element,a=e.isRemovalTransition?void 0:t,c=e.isRemovalTransition?void 0:n;for(let h of e.timelines){let g=h.element,b=g!==r,S=$t(i,g,[]);this._getPreviousPlayers(g,b,a,c,e.toState).forEach(N=>{let k=N.getRealPlayer();k.beforeDestroy&&k.beforeDestroy(),N.destroy(),S.push(N)})}Dn(r,e.fromStyles)}_buildAnimation(t,e,i,n,r,a){let c=e.triggerName,h=e.element,g=[],b=new Set,S=new Set,P=e.timelines.map(k=>{let A=k.element;b.add(A);let pe=A[_i];if(pe&&pe.removedBeforeQueried)return new Fi(k.duration,k.delay);let ke=A!==h,ve=xf((i.get(A)||ff).map(Ze=>Ze.getRealPlayer())).filter(Ze=>{let xt=Ze;return xt.element?xt.element===A:!1}),Ke=r.get(A),ge=a.get(A),Bt=sc(this._normalizer,k.keyframes,Ke,ge),pt=this._buildPlayer(k,Bt,ve);if(k.subTimeline&&n&&S.add(A),ke){let Ze=new Br(t,c,A);Ze.setRealPlayer(pt),g.push(Ze)}return pt});g.forEach(k=>{$t(this.playersByQueriedElement,k.element,[]).push(k),k.onDone(()=>bf(this.playersByQueriedElement,k.element,k))}),b.forEach(k=>ri(k,hc));let N=on(P);return N.onDestroy(()=>{b.forEach(k=>zo(k,hc)),fi(h,e.toStyles)}),S.forEach(k=>{$t(n,k,[]).push(N)}),N}_buildPlayer(t,e,i){return e.length>0?this.driver.animate(t.element,e,t.duration,t.delay,t.easing,i):new Fi(t.duration,t.delay)}},Br=class{namespaceId;triggerName;element;_player=new Fi;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(t,e,i){this.namespaceId=t,this.triggerName=e,this.element=i}setRealPlayer(t){this._containsRealPlayer||(this._player=t,this._queuedCallbacks.forEach((e,i)=>{e.forEach(n=>rs(t,i,void 0,n))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(t.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(t){this.totalTime=t}syncPlayerEvents(t){let e=this._player;e.triggerCallback&&t.onStart(()=>e.triggerCallback("start")),t.onDone(()=>this.finish()),t.onDestroy(()=>this.destroy())}_queueEvent(t,e){$t(this._queuedCallbacks,t,[]).push(e)}onDone(t){this.queued&&this._queueEvent("done",t),this._player.onDone(t)}onStart(t){this.queued&&this._queueEvent("start",t),this._player.onStart(t)}onDestroy(t){this.queued&&this._queueEvent("destroy",t),this._player.onDestroy(t)}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(t){this.queued||this._player.setPosition(t)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(t){let e=this._player;e.triggerCallback&&e.triggerCallback(t)}};function bf(o,t,e){let i=o.get(t);if(i){if(i.length){let n=i.indexOf(e);i.splice(n,1)}i.length==0&&o.delete(t)}return i}function vf(o){return o??null}function us(o){return o&&o.nodeType===1}function yf(o){return o=="start"||o=="done"}function Fp(o,t){let e=o.style.display;return o.style.display=t??"none",e}function Np(o,t,e,i,n){let r=[];e.forEach(h=>r.push(Fp(h)));let a=[];i.forEach((h,g)=>{let b=new Map;h.forEach(S=>{let P=t.computeStyle(g,S,n);b.set(S,P),(!P||P.length==0)&&(g[_i]=_f,a.push(g))}),o.set(g,b)});let c=0;return e.forEach(h=>Fp(h,r[c++])),a}function Lp(o,t){let e=new Map;if(o.forEach(c=>e.set(c,[])),t.length==0)return e;let i=1,n=new Set(t),r=new Map;function a(c){if(!c)return i;let h=r.get(c);if(h)return h;let g=c.parentNode;return e.has(g)?h=g:n.has(g)?h=i:h=a(g),r.set(c,h),h}return t.forEach(c=>{let h=a(c);h!==i&&e.get(h).push(c)}),e}function ri(o,t){o.classList?.add(t)}function zo(o,t){o.classList?.remove(t)}function Cf(o,t,e){on(e).onDone(()=>o.processLeaveNode(t))}function xf(o){let t=[];return Up(o,t),t}function Up(o,t){for(let e=0;e<o.length;e++){let i=o[e];i instanceof eo?Up(i.players,t):t.push(i)}}function wf(o,t){let e=Object.keys(o),i=Object.keys(t);if(e.length!=i.length)return!1;for(let n=0;n<e.length;n++){let r=e[n];if(!t.hasOwnProperty(r)||o[r]!==t[r])return!1}return!0}function Vp(o,t,e){let i=e.get(o);if(!i)return!1;let n=t.get(o);return n?i.forEach(r=>n.add(r)):t.set(o,i),e.delete(o),!0}var jo=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(t,e)=>{};constructor(t,e,i){this._driver=e,this._normalizer=i,this._transitionEngine=new Pc(t.body,e,i),this._timelineEngine=new Tc(t.body,e,i),this._transitionEngine.onRemovalComplete=(n,r)=>this.onRemovalComplete(n,r)}registerTrigger(t,e,i,n,r){let a=t+"-"+n,c=this._triggerCache[a];if(!c){let h=[],g=[],b=jp(this._driver,r,h,g);if(h.length)throw hp(n,h);c=cf(n,b,this._normalizer),this._triggerCache[a]=c}this._transitionEngine.registerTrigger(e,n,c)}register(t,e){this._transitionEngine.register(t,e)}destroy(t,e){this._transitionEngine.destroy(t,e)}onInsert(t,e,i,n){this._transitionEngine.insertNode(t,e,i,n)}onRemove(t,e,i){this._transitionEngine.removeNode(t,e,i)}disableAnimations(t,e){this._transitionEngine.markElementAsDisabled(t,e)}process(t,e,i,n){if(i.charAt(0)=="@"){let[r,a]=lc(i),c=n;this._timelineEngine.command(r,e,a,c)}else this._transitionEngine.trigger(t,e,i,n)}listen(t,e,i,n,r){if(i.charAt(0)=="@"){let[a,c]=lc(i);return this._timelineEngine.listen(a,e,c,r)}return this._transitionEngine.listen(t,e,i,n,r)}flush(t=-1){this._transitionEngine.flush(t)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(t){this._transitionEngine.afterFlushAnimationsDone(t)}};function Sf(o,t){let e=null,i=null;return Array.isArray(t)&&t.length?(e=vc(t[0]),t.length>1&&(i=vc(t[t.length-1]))):t instanceof Map&&(e=vc(t)),e||i?new kf(o,e,i):null}var kf=(()=>{class o{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(e,i,n){this._element=e,this._startStyles=i,this._endStyles=n;let r=o.initialStylesByElement.get(e);r||o.initialStylesByElement.set(e,r=new Map),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&fi(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(fi(this._element,this._initialStyles),this._endStyles&&(fi(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(o.initialStylesByElement.delete(this._element),this._startStyles&&(Dn(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Dn(this._element,this._endStyles),this._endStyles=null),fi(this._element,this._initialStyles),this._state=3)}}return o})();function vc(o){let t=null;return o.forEach((e,i)=>{Mf(i)&&(t=t||new Map,t.set(i,e))}),t}function Mf(o){return o==="display"||o==="position"}var Cs=class{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(t,e,i,n){this.element=t,this.keyframes=e,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(t=>t()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;let t=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,t,this.options),this._finalKeyframe=t.length?t[t.length-1]:new Map;let e=()=>this._onFinish();this.domPlayer.addEventListener("finish",e),this.onDestroy(()=>{this.domPlayer.removeEventListener("finish",e)})}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_convertKeyframesToObject(t){let e=[];return t.forEach(i=>{e.push(Object.fromEntries(i))}),e}_triggerWebAnimation(t,e,i){return t.animate(this._convertKeyframesToObject(e),i)}onStart(t){this._originalOnStartFns.push(t),this._onStartFns.push(t)}onDone(t){this._originalOnDoneFns.push(t),this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(t=>t()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),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&&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(t=>t()),this._onDestroyFns=[])}setPosition(t){this.domPlayer===void 0&&this.init(),this.domPlayer.currentTime=t*this.time}getPosition(){return+(this.domPlayer.currentTime??0)/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){let t=new Map;this.hasStarted()&&this._finalKeyframe.forEach((i,n)=>{n!=="offset"&&t.set(n,this._finished?i:ms(this.element,n))}),this.currentSnapshot=t}triggerCallback(t){let e=t==="start"?this._onStartFns:this._onDoneFns;e.forEach(i=>i()),e.length=0}},xs=class{validateStyleProperty(t){return!0}validateAnimatableStyleProperty(t){return!0}containsElement(t,e){return cc(t,e)}getParentElement(t){return ss(t)}query(t,e,i){return dc(t,e,i)}computeStyle(t,e,i){return ms(t,e)}animate(t,e,i,n,r,a=[]){let c=n==0?"both":"forwards",h={duration:i,delay:n,fill:c};r&&(h.easing=r);let g=new Map,b=a.filter(N=>N instanceof Cs);Tp(i,n)&&b.forEach(N=>{N.currentSnapshot.forEach((k,A)=>g.set(A,k))});let S=kp(e).map(N=>new Map(N));S=Ep(t,S,g);let P=Sf(t,S);return new Cs(t,S,h,P)}};var gs="@",$p="@.disabled",ws=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(t,e,i,n){this.namespaceId=t,this.delegate=e,this.engine=i,this._onDestroy=n}get data(){return this.delegate.data}destroyNode(t){this.delegate.destroyNode?.(t)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(t,e){return this.delegate.createElement(t,e)}createComment(t){return this.delegate.createComment(t)}createText(t){return this.delegate.createText(t)}appendChild(t,e){this.delegate.appendChild(t,e),this.engine.onInsert(this.namespaceId,e,t,!1)}insertBefore(t,e,i,n=!0){this.delegate.insertBefore(t,e,i),this.engine.onInsert(this.namespaceId,e,t,n)}removeChild(t,e,i,n){if(n){this.delegate.removeChild(t,e,i);return}this.parentNode(e)&&this.engine.onRemove(this.namespaceId,e,this.delegate)}selectRootElement(t,e){return this.delegate.selectRootElement(t,e)}parentNode(t){return this.delegate.parentNode(t)}nextSibling(t){return this.delegate.nextSibling(t)}setAttribute(t,e,i,n){this.delegate.setAttribute(t,e,i,n)}removeAttribute(t,e,i){this.delegate.removeAttribute(t,e,i)}addClass(t,e){this.delegate.addClass(t,e)}removeClass(t,e){this.delegate.removeClass(t,e)}setStyle(t,e,i,n){this.delegate.setStyle(t,e,i,n)}removeStyle(t,e,i){this.delegate.removeStyle(t,e,i)}setProperty(t,e,i){e.charAt(0)==gs&&e==$p?this.disableAnimations(t,!!i):this.delegate.setProperty(t,e,i)}setValue(t,e){this.delegate.setValue(t,e)}listen(t,e,i,n){return this.delegate.listen(t,e,i,n)}disableAnimations(t,e){this.engine.disableAnimations(t,e)}},Oc=class extends ws{factory;constructor(t,e,i,n,r){super(e,i,n,r),this.factory=t,this.namespaceId=e}setProperty(t,e,i){e.charAt(0)==gs?e.charAt(1)=="."&&e==$p?(i=i===void 0?!0:!!i,this.disableAnimations(t,i)):this.engine.process(this.namespaceId,t,e.slice(1),i):this.delegate.setProperty(t,e,i)}listen(t,e,i,n){if(e.charAt(0)==gs){let r=Tf(t),a=e.slice(1),c="";return a.charAt(0)!=gs&&([a,c]=Ef(a)),this.engine.listen(this.namespaceId,r,a,c,h=>{let g=h._data||-1;this.factory.scheduleListenerCallback(g,i,h)})}return this.delegate.listen(t,e,i,n)}};function Tf(o){switch(o){case"body":return document.body;case"document":return document;case"window":return window;default:return o}}function Ef(o){let t=o.indexOf("."),e=o.substring(0,t),i=o.slice(t+1);return[e,i]}var Ss=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(t,e,i){this.delegate=t,this.engine=e,this._zone=i,e.onRemovalComplete=(n,r)=>{r?.removeChild(null,n)}}createRenderer(t,e){let n=this.delegate.createRenderer(t,e);if(!t||!e?.data?.animation){let g=this._rendererCache,b=g.get(n);if(!b){let S=()=>g.delete(n);b=new ws("",n,this.engine,S),g.set(n,b)}return b}let r=e.id,a=e.id+"-"+this._currentId;this._currentId++,this.engine.register(a,t);let c=g=>{Array.isArray(g)?g.forEach(c):this.engine.registerTrigger(r,a,t,g.name,g)};return e.data.animation.forEach(c),new Oc(this,a,n,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(t,e,i){if(t>=0&&t<this._microtaskId){this._zone.run(()=>e(i));return}let n=this._animationCallbacksBuffer;n.length==0&&queueMicrotask(()=>{this._zone.run(()=>{n.forEach(r=>{let[a,c]=r;a(c)}),this._animationCallbacksBuffer=[]})}),n.push([e,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(t){this.engine.flush(),this.delegate.componentReplaced?.(t)}};var Of=(()=>{class o extends jo{constructor(e,i,n){super(e,i,n)}ngOnDestroy(){this.flush()}static \u0275fac=function(i){return new(i||o)(Pa(Je),Pa(no),Pa(oo))};static \u0275prov=V({token:o,factory:o.\u0275fac})}return o})();function Af(){return new fs}function If(o,t,e){return new Ss(o,t,e)}var qp=[{provide:oo,useFactory:Af},{provide:jo,useClass:Of},{provide:pi,useFactory:If,deps:[Em,jo,de]}],qw=[{provide:no,useClass:Ac},{provide:Tr,useValue:"NoopAnimations"},...qp],Df=[{provide:no,useFactory:()=>new xs},{provide:Tr,useFactory:()=>"BrowserAnimations"},...qp];function Gp(){return um("NgEagerAnimations"),[...Df]}var Hr=class{_attachedHost;attach(t){return this._attachedHost=t,t.attach(this)}detach(){let t=this._attachedHost;t!=null&&(this._attachedHost=null,t.detach())}get isAttached(){return this._attachedHost!=null}setAttachedHost(t){this._attachedHost=t}},bi=class extends Hr{component;viewContainerRef;injector;projectableNodes;constructor(t,e,i,n){super(),this.component=t,this.viewContainerRef=e,this.injector=i,this.projectableNodes=n}},rn=class extends Hr{templateRef;viewContainerRef;context;injector;constructor(t,e,i,n){super(),this.templateRef=t,this.viewContainerRef=e,this.context=i,this.injector=n}get origin(){return this.templateRef.elementRef}attach(t,e=this.context){return this.context=e,super.attach(t)}detach(){return this.context=void 0,super.detach()}},Dc=class extends Hr{element;constructor(t){super(),this.element=t instanceof ie?t.nativeElement:t}},Rn=class{_attachedPortal;_disposeFn;_isDisposed=!1;hasAttached(){return!!this._attachedPortal}attach(t){if(t instanceof bi)return this._attachedPortal=t,this.attachComponentPortal(t);if(t instanceof rn)return this._attachedPortal=t,this.attachTemplatePortal(t);if(this.attachDomPortal&&t instanceof Dc)return this._attachedPortal=t,this.attachDomPortal(t)}attachDomPortal=null;detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(t){this._disposeFn=t}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}},ks=class extends Rn{outletElement;_appRef;_defaultInjector;constructor(t,e,i){super(),this.outletElement=t,this._appRef=e,this._defaultInjector=i}attachComponentPortal(t){let e;if(t.viewContainerRef){let i=t.injector||t.viewContainerRef.injector,n=i.get(Ql,null,{optional:!0})||void 0;e=t.viewContainerRef.createComponent(t.component,{index:t.viewContainerRef.length,injector:i,ngModuleRef:n,projectableNodes:t.projectableNodes||void 0}),this.setDisposeFn(()=>e.destroy())}else{let i=this._appRef,n=t.injector||this._defaultInjector||be.NULL,r=n.get(Oa,i.injector);e=km(t.component,{elementInjector:n,environmentInjector:r,projectableNodes:t.projectableNodes||void 0}),i.attachView(e.hostView),this.setDisposeFn(()=>{i.viewCount>0&&i.detachView(e.hostView),e.destroy()})}return this.outletElement.appendChild(this._getComponentRootNode(e)),this._attachedPortal=t,e}attachTemplatePortal(t){let e=t.viewContainerRef,i=e.createEmbeddedView(t.templateRef,t.context,{injector:t.injector});return i.rootNodes.forEach(n=>this.outletElement.appendChild(n)),i.detectChanges(),this.setDisposeFn(()=>{let n=e.indexOf(i);n!==-1&&e.remove(n)}),this._attachedPortal=t,i}attachDomPortal=t=>{let e=t.element;e.parentNode;let i=this.outletElement.ownerDocument.createComment("dom-portal");e.parentNode.insertBefore(i,e),this.outletElement.appendChild(e),this._attachedPortal=t,super.setDisposeFn(()=>{i.parentNode&&i.parentNode.replaceChild(e,i)})};dispose(){super.dispose(),this.outletElement.remove()}_getComponentRootNode(t){return t.hostView.rootNodes[0]}};var Fn=(()=>{class o extends Rn{_moduleRef=m(Ql,{optional:!0});_document=m(Je);_viewContainerRef=m(Xn);_isInitialized=!1;_attachedRef;constructor(){super()}get portal(){return this._attachedPortal}set portal(e){this.hasAttached()&&!e&&!this._isInitialized||(this.hasAttached()&&super.detach(),e&&super.attach(e),this._attachedPortal=e||null)}attached=new U;get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedRef=this._attachedPortal=null}attachComponentPortal(e){e.setAttachedHost(this);let i=e.viewContainerRef!=null?e.viewContainerRef:this._viewContainerRef,n=i.createComponent(e.component,{index:i.length,injector:e.injector||i.injector,projectableNodes:e.projectableNodes||void 0,ngModuleRef:this._moduleRef||void 0});return i!==this._viewContainerRef&&this._getRootNode().appendChild(n.hostView.rootNodes[0]),super.setDisposeFn(()=>n.destroy()),this._attachedPortal=e,this._attachedRef=n,this.attached.emit(n),n}attachTemplatePortal(e){e.setAttachedHost(this);let i=this._viewContainerRef.createEmbeddedView(e.templateRef,e.context,{injector:e.injector});return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=e,this._attachedRef=i,this.attached.emit(i),i}attachDomPortal=e=>{let i=e.element;i.parentNode;let n=this._document.createComment("dom-portal");e.setAttachedHost(this),i.parentNode.insertBefore(n,i),this._getRootNode().appendChild(i),this._attachedPortal=e,super.setDisposeFn(()=>{n.parentNode&&n.parentNode.replaceChild(i,n)})};_getRootNode(){let e=this._viewContainerRef.element.nativeElement;return e.nodeType===e.ELEMENT_NODE?e:e.parentNode}static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:[0,"cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[Mt]})}return o})();var an=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({})}return o})();var Rf=20,sn=(()=>{class o{_ngZone=m(de);_platform=m(et);_renderer=m(pi).createRenderer(null,null);_cleanupGlobalListener;constructor(){}_scrolled=new R;_scrolledCount=0;scrollContainers=new Map;register(e){this.scrollContainers.has(e)||this.scrollContainers.set(e,e.elementScrolled().subscribe(()=>this._scrolled.next(e)))}deregister(e){let i=this.scrollContainers.get(e);i&&(i.unsubscribe(),this.scrollContainers.delete(e))}scrolled(e=Rf){return this._platform.isBrowser?new Oi(i=>{this._cleanupGlobalListener||(this._cleanupGlobalListener=this._ngZone.runOutsideAngular(()=>this._renderer.listen("document","scroll",()=>this._scrolled.next())));let n=e>0?this._scrolled.pipe(ql(e)).subscribe(i):this._scrolled.subscribe(i);return this._scrolledCount++,()=>{n.unsubscribe(),this._scrolledCount--,this._scrolledCount||(this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0)}}):It()}ngOnDestroy(){this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0,this.scrollContainers.forEach((e,i)=>this.deregister(i)),this._scrolled.complete()}ancestorScrolled(e,i){let n=this.getAncestorScrollContainers(e);return this.scrolled(i).pipe(ce(r=>!r||n.indexOf(r)>-1))}getAncestorScrollContainers(e){let i=[];return this.scrollContainers.forEach((n,r)=>{this._scrollableContainsElement(r,e)&&i.push(r)}),i}_scrollableContainsElement(e,i){let n=Dr(i),r=e.getElementRef().nativeElement;do if(n==r)return!0;while(n=n.parentElement);return!1}static \u0275fac=function(i){return new(i||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),ln=(()=>{class o{elementRef=m(ie);scrollDispatcher=m(sn);ngZone=m(de);dir=m(ft,{optional:!0});_scrollElement=this.elementRef.nativeElement;_destroyed=new R;_renderer=m(yt);_cleanupScroll;_elementScrolled=new R;constructor(){}ngOnInit(){this._cleanupScroll=this.ngZone.runOutsideAngular(()=>this._renderer.listen(this._scrollElement,"scroll",e=>this._elementScrolled.next(e))),this.scrollDispatcher.register(this)}ngOnDestroy(){this._cleanupScroll?.(),this._elementScrolled.complete(),this.scrollDispatcher.deregister(this),this._destroyed.next(),this._destroyed.complete()}elementScrolled(){return this._elementScrolled}getElementRef(){return this.elementRef}scrollTo(e){let i=this.elementRef.nativeElement,n=this.dir&&this.dir.value=="rtl";e.left==null&&(e.left=n?e.end:e.start),e.right==null&&(e.right=n?e.start:e.end),e.bottom!=null&&(e.top=i.scrollHeight-i.clientHeight-e.bottom),n&&Io()!=Ao.NORMAL?(e.left!=null&&(e.right=i.scrollWidth-i.clientWidth-e.left),Io()==Ao.INVERTED?e.left=e.right:Io()==Ao.NEGATED&&(e.left=e.right?-e.right:e.right)):e.right!=null&&(e.left=i.scrollWidth-i.clientWidth-e.right),this._applyScrollToOptions(e)}_applyScrollToOptions(e){let i=this.elementRef.nativeElement;$a()?i.scrollTo(e):(e.top!=null&&(i.scrollTop=e.top),e.left!=null&&(i.scrollLeft=e.left))}measureScrollOffset(e){let i="left",n="right",r=this.elementRef.nativeElement;if(e=="top")return r.scrollTop;if(e=="bottom")return r.scrollHeight-r.clientHeight-r.scrollTop;let a=this.dir&&this.dir.value=="rtl";return e=="start"?e=a?n:i:e=="end"&&(e=a?i:n),a&&Io()==Ao.INVERTED?e==i?r.scrollWidth-r.clientWidth-r.scrollLeft:r.scrollLeft:a&&Io()==Ao.NEGATED?e==i?r.scrollLeft+r.scrollWidth-r.clientWidth:-r.scrollLeft:e==i?r.scrollLeft:r.scrollWidth-r.clientWidth-r.scrollLeft}static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["","cdk-scrollable",""],["","cdkScrollable",""]]})}return o})(),Ff=20,Vi=(()=>{class o{_platform=m(et);_listeners;_viewportSize;_change=new R;_document=m(Je);constructor(){let e=m(de),i=m(pi).createRenderer(null,null);e.runOutsideAngular(()=>{if(this._platform.isBrowser){let n=r=>this._change.next(r);this._listeners=[i.listen("window","resize",n),i.listen("window","orientationchange",n)]}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){this._listeners?.forEach(e=>e()),this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();let e={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),e}getViewportRect(){let e=this.getViewportScrollPosition(),{width:i,height:n}=this.getViewportSize();return{top:e.top,left:e.left,bottom:e.top+n,right:e.left+i,height:n,width:i}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let e=this._document,i=this._getWindow(),n=e.documentElement,r=n.getBoundingClientRect(),a=-r.top||e.body.scrollTop||i.scrollY||n.scrollTop||0,c=-r.left||e.body.scrollLeft||i.scrollX||n.scrollLeft||0;return{top:a,left:c}}change(e=Ff){return e>0?this._change.pipe(ql(e)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){let e=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:e.innerWidth,height:e.innerHeight}:{width:0,height:0}}static \u0275fac=function(i){return new(i||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var Li=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({})}return o})(),Rc=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({imports:[Rr,Li,Rr,Li]})}return o})();var Yp=$a();function Wo(o){return new Ms(o.get(Vi),o.get(Je))}var Ms=class{_viewportRuler;_previousHTMLStyles={top:"",left:""};_previousScrollPosition;_isEnabled=!1;_document;constructor(t,e){this._viewportRuler=t,this._document=e}attach(){}enable(){if(this._canBeEnabled()){let t=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=t.style.left||"",this._previousHTMLStyles.top=t.style.top||"",t.style.left=rt(-this._previousScrollPosition.left),t.style.top=rt(-this._previousScrollPosition.top),t.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){let t=this._document.documentElement,e=this._document.body,i=t.style,n=e.style,r=i.scrollBehavior||"",a=n.scrollBehavior||"";this._isEnabled=!1,i.left=this._previousHTMLStyles.left,i.top=this._previousHTMLStyles.top,t.classList.remove("cdk-global-scrollblock"),Yp&&(i.scrollBehavior=n.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),Yp&&(i.scrollBehavior=r,n.scrollBehavior=a)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;let e=this._document.documentElement,i=this._viewportRuler.getViewportSize();return e.scrollHeight>i.height||e.scrollWidth>i.width}};function th(o,t){return new Ts(o.get(sn),o.get(de),o.get(Vi),t)}var Ts=class{_scrollDispatcher;_ngZone;_viewportRuler;_config;_scrollSubscription=null;_overlayRef;_initialScrollPosition;constructor(t,e,i,n){this._scrollDispatcher=t,this._ngZone=e,this._viewportRuler=i,this._config=n}attach(t){this._overlayRef,this._overlayRef=t}enable(){if(this._scrollSubscription)return;let t=this._scrollDispatcher.scrolled(0).pipe(ce(e=>!e||!this._overlayRef.overlayElement.contains(e.getElementRef().nativeElement)));this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=t.subscribe(()=>{let e=this._viewportRuler.getViewportScrollPosition().top;Math.abs(e-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=t.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}_detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}};var Wr=class{enable(){}disable(){}attach(){}};function Fc(o,t){return t.some(e=>{let i=o.bottom<e.top,n=o.top>e.bottom,r=o.right<e.left,a=o.left>e.right;return i||n||r||a})}function Qp(o,t){return t.some(e=>{let i=o.top<e.top,n=o.bottom>e.bottom,r=o.left<e.left,a=o.right>e.right;return i||n||r||a})}function zi(o,t){return new Es(o.get(sn),o.get(Vi),o.get(de),t)}var Es=class{_scrollDispatcher;_viewportRuler;_ngZone;_config;_scrollSubscription=null;_overlayRef;constructor(t,e,i,n){this._scrollDispatcher=t,this._viewportRuler=e,this._ngZone=i,this._config=n}attach(t){this._overlayRef,this._overlayRef=t}enable(){if(!this._scrollSubscription){let t=this._config?this._config.scrollThrottle:0;this._scrollSubscription=this._scrollDispatcher.scrolled(t).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){let e=this._overlayRef.overlayElement.getBoundingClientRect(),{width:i,height:n}=this._viewportRuler.getViewportSize();Fc(e,[{width:i,height:n,bottom:n,right:i,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}})}}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}},ih=(()=>{class o{_injector=m(be);constructor(){}noop=()=>new Wr;close=e=>th(this._injector,e);block=()=>Wo(this._injector);reposition=e=>zi(this._injector,e);static \u0275fac=function(i){return new(i||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),cn=class{positionStrategy;scrollStrategy=new Wr;panelClass="";hasBackdrop=!1;backdropClass="cdk-overlay-dark-backdrop";disableAnimations;width;height;minWidth;minHeight;maxWidth;maxHeight;direction;disposeOnNavigation=!1;constructor(t){if(t){let e=Object.keys(t);for(let i of e)t[i]!==void 0&&(this[i]=t[i])}}};var Ps=class{connectionPair;scrollableViewProperties;constructor(t,e){this.connectionPair=t,this.scrollableViewProperties=e}};var nh=(()=>{class o{_attachedOverlays=[];_document=m(Je);_isAttached;constructor(){}ngOnDestroy(){this.detach()}add(e){this.remove(e),this._attachedOverlays.push(e)}remove(e){let i=this._attachedOverlays.indexOf(e);i>-1&&this._attachedOverlays.splice(i,1),this._attachedOverlays.length===0&&this.detach()}static \u0275fac=function(i){return new(i||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),oh=(()=>{class o extends nh{_ngZone=m(de);_renderer=m(pi).createRenderer(null,null);_cleanupKeydown;add(e){super.add(e),this._isAttached||(this._ngZone.runOutsideAngular(()=>{this._cleanupKeydown=this._renderer.listen("body","keydown",this._keydownListener)}),this._isAttached=!0)}detach(){this._isAttached&&(this._cleanupKeydown?.(),this._isAttached=!1)}_keydownListener=e=>{let i=this._attachedOverlays;for(let n=i.length-1;n>-1;n--)if(i[n]._keydownEvents.observers.length>0){this._ngZone.run(()=>i[n]._keydownEvents.next(e));break}};static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),rh=(()=>{class o extends nh{_platform=m(et);_ngZone=m(de);_renderer=m(pi).createRenderer(null,null);_cursorOriginalValue;_cursorStyleIsSet=!1;_pointerDownEventTarget;_cleanups;add(e){if(super.add(e),!this._isAttached){let i=this._document.body,n={capture:!0},r=this._renderer;this._cleanups=this._ngZone.runOutsideAngular(()=>[r.listen(i,"pointerdown",this._pointerDownListener,n),r.listen(i,"click",this._clickListener,n),r.listen(i,"auxclick",this._clickListener,n),r.listen(i,"contextmenu",this._clickListener,n)]),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=i.style.cursor,i.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){this._isAttached&&(this._cleanups?.forEach(e=>e()),this._cleanups=void 0,this._platform.IOS&&this._cursorStyleIsSet&&(this._document.body.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1)}_pointerDownListener=e=>{this._pointerDownEventTarget=ja(e)};_clickListener=e=>{let i=ja(e),n=e.type==="click"&&this._pointerDownEventTarget?this._pointerDownEventTarget:i;this._pointerDownEventTarget=null;let r=this._attachedOverlays.slice();for(let a=r.length-1;a>-1;a--){let c=r[a];if(c._outsidePointerEvents.observers.length<1||!c.hasAttached())continue;if(Xp(c.overlayElement,i)||Xp(c.overlayElement,n))break;let h=c._outsidePointerEvents;this._ngZone?this._ngZone.run(()=>h.next(e)):h.next(e)}};static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function Xp(o,t){let e=typeof ShadowRoot<"u"&&ShadowRoot,i=t;for(;i;){if(i===o)return!0;i=e&&i instanceof ShadowRoot?i.host:i.parentNode}return!1}var ah=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["ng-component"]],hostAttrs:["cdk-overlay-style-loader",""],decls:0,vars:0,template:function(i,n){},styles:[`.cdk-overlay-container,.cdk-global-overlay-wrapper{pointer-events:none;top:0;left:0;height:100%;width:100%}.cdk-overlay-container{position:fixed}@layer cdk-overlay{.cdk-overlay-container{z-index:1000}}.cdk-overlay-container:empty{display:none}.cdk-global-overlay-wrapper{display:flex;position:absolute}@layer cdk-overlay{.cdk-global-overlay-wrapper{z-index:1000}}.cdk-overlay-pane{position:absolute;pointer-events:auto;box-sizing:border-box;display:flex;max-width:100%;max-height:100%}@layer cdk-overlay{.cdk-overlay-pane{z-index:1000}}.cdk-overlay-backdrop{position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:auto;-webkit-tap-highlight-color:rgba(0,0,0,0);opacity:0;touch-action:manipulation}@layer cdk-overlay{.cdk-overlay-backdrop{z-index:1000;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}}@media(prefers-reduced-motion){.cdk-overlay-backdrop{transition-duration:1ms}}.cdk-overlay-backdrop-showing{opacity:1}@media(forced-colors: active){.cdk-overlay-backdrop-showing{opacity:.6}}@layer cdk-overlay{.cdk-overlay-dark-backdrop{background:rgba(0,0,0,.32)}}.cdk-overlay-transparent-backdrop{transition:visibility 1ms linear,opacity 1ms linear;visibility:hidden;opacity:1}.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing,.cdk-high-contrast-active .cdk-overlay-transparent-backdrop{opacity:0;visibility:visible}.cdk-overlay-backdrop-noop-animation{transition:none}.cdk-overlay-connected-position-bounding-box{position:absolute;display:flex;flex-direction:column;min-width:1px;min-height:1px}@layer cdk-overlay{.cdk-overlay-connected-position-bounding-box{z-index:1000}}.cdk-global-scrollblock{position:fixed;width:100%;overflow-y:scroll}
|
|
2
|
+
`],encapsulation:2,changeDetection:0})}return o})(),Is=(()=>{class o{_platform=m(et);_containerElement;_document=m(Je);_styleLoader=m(Rt);constructor(){}ngOnDestroy(){this._containerElement?.remove()}getContainerElement(){return this._loadStyles(),this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let e="cdk-overlay-container";if(this._platform.isBrowser||tc()){let n=this._document.querySelectorAll(`.${e}[platform="server"], .${e}[platform="test"]`);for(let r=0;r<n.length;r++)n[r].remove()}let i=this._document.createElement("div");i.classList.add(e),tc()?i.setAttribute("platform","test"):this._platform.isBrowser||i.setAttribute("platform","server"),this._document.body.appendChild(i),this._containerElement=i}_loadStyles(){this._styleLoader.load(ah)}static \u0275fac=function(i){return new(i||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),Nc=class{_renderer;_ngZone;element;_cleanupClick;_cleanupTransitionEnd;_fallbackTimeout;constructor(t,e,i,n){this._renderer=e,this._ngZone=i,this.element=t.createElement("div"),this.element.classList.add("cdk-overlay-backdrop"),this._cleanupClick=e.listen(this.element,"click",n)}detach(){this._ngZone.runOutsideAngular(()=>{let t=this.element;clearTimeout(this._fallbackTimeout),this._cleanupTransitionEnd?.(),this._cleanupTransitionEnd=this._renderer.listen(t,"transitionend",this.dispose),this._fallbackTimeout=setTimeout(this.dispose,500),t.style.pointerEvents="none",t.classList.remove("cdk-overlay-backdrop-showing")})}dispose=()=>{clearTimeout(this._fallbackTimeout),this._cleanupClick?.(),this._cleanupTransitionEnd?.(),this._cleanupClick=this._cleanupTransitionEnd=this._fallbackTimeout=void 0,this.element.remove()}},Bo=class{_portalOutlet;_host;_pane;_config;_ngZone;_keyboardDispatcher;_document;_location;_outsideClickDispatcher;_animationsDisabled;_injector;_renderer;_backdropClick=new R;_attachments=new R;_detachments=new R;_positionStrategy;_scrollStrategy;_locationChanges=Pi.EMPTY;_backdropRef=null;_detachContentMutationObserver;_detachContentAfterRenderRef;_previousHostParent;_keydownEvents=new R;_outsidePointerEvents=new R;_afterNextRenderRef;constructor(t,e,i,n,r,a,c,h,g,b=!1,S,P){this._portalOutlet=t,this._host=e,this._pane=i,this._config=n,this._ngZone=r,this._keyboardDispatcher=a,this._document=c,this._location=h,this._outsideClickDispatcher=g,this._animationsDisabled=b,this._injector=S,this._renderer=P,n.scrollStrategy&&(this._scrollStrategy=n.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=n.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropRef?.element||null}get hostElement(){return this._host}attach(t){!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host);let e=this._portalOutlet.attach(t);return this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._afterNextRenderRef?.destroy(),this._afterNextRenderRef=Dt(()=>{this.hasAttached()&&this.updatePosition()},{injector:this._injector}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._completeDetachContent(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),typeof e?.onDestroy=="function"&&e.onDestroy(()=>{this.hasAttached()&&this._ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>this.detach()))}),e}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();let t=this._portalOutlet.detach();return this._detachments.next(),this._completeDetachContent(),this._keyboardDispatcher.remove(this),this._detachContentWhenEmpty(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),t}dispose(){let t=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this._backdropRef?.dispose(),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host?.remove(),this._afterNextRenderRef?.destroy(),this._previousHostParent=this._pane=this._host=this._backdropRef=null,t&&this._detachments.next(),this._detachments.complete(),this._completeDetachContent()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(t){t!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=t,this.hasAttached()&&(t.attach(this),this.updatePosition()))}updateSize(t){this._config=Z(Z({},this._config),t),this._updateElementSize()}setDirection(t){this._config=ut(Z({},this._config),{direction:t}),this._updateElementDirection()}addPanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!0)}removePanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!1)}getDirection(){let t=this._config.direction;return t?typeof t=="string"?t:t.value:"ltr"}updateScrollStrategy(t){t!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=t,this.hasAttached()&&(t.attach(this),t.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;let t=this._pane.style;t.width=rt(this._config.width),t.height=rt(this._config.height),t.minWidth=rt(this._config.minWidth),t.minHeight=rt(this._config.minHeight),t.maxWidth=rt(this._config.maxWidth),t.maxHeight=rt(this._config.maxHeight)}_togglePointerEvents(t){this._pane.style.pointerEvents=t?"":"none"}_attachBackdrop(){let t="cdk-overlay-backdrop-showing";this._backdropRef?.dispose(),this._backdropRef=new Nc(this._document,this._renderer,this._ngZone,e=>{this._backdropClick.next(e)}),this._animationsDisabled&&this._backdropRef.element.classList.add("cdk-overlay-backdrop-noop-animation"),this._config.backdropClass&&this._toggleClasses(this._backdropRef.element,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropRef.element,this._host),!this._animationsDisabled&&typeof requestAnimationFrame<"u"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>this._backdropRef?.element.classList.add(t))}):this._backdropRef.element.classList.add(t)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){this._animationsDisabled?(this._backdropRef?.dispose(),this._backdropRef=null):this._backdropRef?.detach()}_toggleClasses(t,e,i){let n=Jl(e||[]).filter(r=>!!r);n.length&&(i?t.classList.add(...n):t.classList.remove(...n))}_detachContentWhenEmpty(){let t=!1;try{this._detachContentAfterRenderRef=Dt(()=>{t=!0,this._detachContent()},{injector:this._injector})}catch(e){if(t)throw e;this._detachContent()}globalThis.MutationObserver&&this._pane&&(this._detachContentMutationObserver||=new globalThis.MutationObserver(()=>{this._detachContent()}),this._detachContentMutationObserver.observe(this._pane,{childList:!0}))}_detachContent(){(!this._pane||!this._host||this._pane.children.length===0)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._host.remove()),this._completeDetachContent())}_completeDetachContent(){this._detachContentAfterRenderRef?.destroy(),this._detachContentAfterRenderRef=void 0,this._detachContentMutationObserver?.disconnect()}_disposeScrollStrategy(){let t=this._scrollStrategy;t?.disable(),t?.detach?.()}},Kp="cdk-overlay-connected-position-bounding-box",Lf=/([A-Za-z%]+)$/;function Ur(o,t){return new Os(t,o.get(Vi),o.get(Je),o.get(et),o.get(Is))}var Os=class{_viewportRuler;_document;_platform;_overlayContainer;_overlayRef;_isInitialRender;_lastBoundingBoxSize={width:0,height:0};_isPushed=!1;_canPush=!0;_growAfterOpen=!1;_hasFlexibleDimensions=!0;_positionLocked=!1;_originRect;_overlayRect;_viewportRect;_containerRect;_viewportMargin=0;_scrollables=[];_preferredPositions=[];_origin;_pane;_isDisposed;_boundingBox;_lastPosition;_lastScrollVisibility;_positionChanges=new R;_resizeSubscription=Pi.EMPTY;_offsetX=0;_offsetY=0;_transformOriginSelector;_appliedPanelClasses=[];_previousPushAmount;positionChanges=this._positionChanges;get positions(){return this._preferredPositions}constructor(t,e,i,n,r){this._viewportRuler=e,this._document=i,this._platform=n,this._overlayContainer=r,this.setOrigin(t)}attach(t){this._overlayRef&&this._overlayRef,this._validatePositions(),t.hostElement.classList.add(Kp),this._overlayRef=t,this._boundingBox=t.hostElement,this._pane=t.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition){this.reapplyLastPosition();return}this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let t=this._originRect,e=this._overlayRect,i=this._viewportRect,n=this._containerRect,r=[],a;for(let c of this._preferredPositions){let h=this._getOriginPoint(t,n,c),g=this._getOverlayPoint(h,e,c),b=this._getOverlayFit(g,e,i,c);if(b.isCompletelyWithinViewport){this._isPushed=!1,this._applyPosition(c,h);return}if(this._canFitWithFlexibleDimensions(b,g,i)){r.push({position:c,origin:h,overlayRect:e,boundingBoxRect:this._calculateBoundingBoxRect(h,c)});continue}(!a||a.overlayFit.visibleArea<b.visibleArea)&&(a={overlayFit:b,overlayPoint:g,originPoint:h,position:c,overlayRect:e})}if(r.length){let c=null,h=-1;for(let g of r){let b=g.boundingBoxRect.width*g.boundingBoxRect.height*(g.position.weight||1);b>h&&(h=b,c=g)}this._isPushed=!1,this._applyPosition(c.position,c.origin);return}if(this._canPush){this._isPushed=!0,this._applyPosition(a.position,a.originPoint);return}this._applyPosition(a.position,a.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&ro(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(Kp),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(this._isDisposed||!this._platform.isBrowser)return;let t=this._lastPosition;if(t){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let e=this._getOriginPoint(this._originRect,this._containerRect,t);this._applyPosition(t,e)}else this.apply()}withScrollableContainers(t){return this._scrollables=t,this}withPositions(t){return this._preferredPositions=t,t.indexOf(this._lastPosition)===-1&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(t){return this._viewportMargin=t,this}withFlexibleDimensions(t=!0){return this._hasFlexibleDimensions=t,this}withGrowAfterOpen(t=!0){return this._growAfterOpen=t,this}withPush(t=!0){return this._canPush=t,this}withLockedPosition(t=!0){return this._positionLocked=t,this}setOrigin(t){return this._origin=t,this}withDefaultOffsetX(t){return this._offsetX=t,this}withDefaultOffsetY(t){return this._offsetY=t,this}withTransformOriginOn(t){return this._transformOriginSelector=t,this}_getOriginPoint(t,e,i){let n;if(i.originX=="center")n=t.left+t.width/2;else{let a=this._isRtl()?t.right:t.left,c=this._isRtl()?t.left:t.right;n=i.originX=="start"?a:c}e.left<0&&(n-=e.left);let r;return i.originY=="center"?r=t.top+t.height/2:r=i.originY=="top"?t.top:t.bottom,e.top<0&&(r-=e.top),{x:n,y:r}}_getOverlayPoint(t,e,i){let n;i.overlayX=="center"?n=-e.width/2:i.overlayX==="start"?n=this._isRtl()?-e.width:0:n=this._isRtl()?0:-e.width;let r;return i.overlayY=="center"?r=-e.height/2:r=i.overlayY=="top"?0:-e.height,{x:t.x+n,y:t.y+r}}_getOverlayFit(t,e,i,n){let r=Jp(e),{x:a,y:c}=t,h=this._getOffset(n,"x"),g=this._getOffset(n,"y");h&&(a+=h),g&&(c+=g);let b=0-a,S=a+r.width-i.width,P=0-c,N=c+r.height-i.height,k=this._subtractOverflows(r.width,b,S),A=this._subtractOverflows(r.height,P,N),pe=k*A;return{visibleArea:pe,isCompletelyWithinViewport:r.width*r.height===pe,fitsInViewportVertically:A===r.height,fitsInViewportHorizontally:k==r.width}}_canFitWithFlexibleDimensions(t,e,i){if(this._hasFlexibleDimensions){let n=i.bottom-e.y,r=i.right-e.x,a=Zp(this._overlayRef.getConfig().minHeight),c=Zp(this._overlayRef.getConfig().minWidth),h=t.fitsInViewportVertically||a!=null&&a<=n,g=t.fitsInViewportHorizontally||c!=null&&c<=r;return h&&g}return!1}_pushOverlayOnScreen(t,e,i){if(this._previousPushAmount&&this._positionLocked)return{x:t.x+this._previousPushAmount.x,y:t.y+this._previousPushAmount.y};let n=Jp(e),r=this._viewportRect,a=Math.max(t.x+n.width-r.width,0),c=Math.max(t.y+n.height-r.height,0),h=Math.max(r.top-i.top-t.y,0),g=Math.max(r.left-i.left-t.x,0),b=0,S=0;return n.width<=r.width?b=g||-a:b=t.x<this._viewportMargin?r.left-i.left-t.x:0,n.height<=r.height?S=h||-c:S=t.y<this._viewportMargin?r.top-i.top-t.y:0,this._previousPushAmount={x:b,y:S},{x:t.x+b,y:t.y+S}}_applyPosition(t,e){if(this._setTransformOrigin(t),this._setOverlayElementStyles(e,t),this._setBoundingBoxStyles(e,t),t.panelClass&&this._addPanelClasses(t.panelClass),this._positionChanges.observers.length){let i=this._getScrollVisibility();if(t!==this._lastPosition||!this._lastScrollVisibility||!Vf(this._lastScrollVisibility,i)){let n=new Ps(t,i);this._positionChanges.next(n)}this._lastScrollVisibility=i}this._lastPosition=t,this._isInitialRender=!1}_setTransformOrigin(t){if(!this._transformOriginSelector)return;let e=this._boundingBox.querySelectorAll(this._transformOriginSelector),i,n=t.overlayY;t.overlayX==="center"?i="center":this._isRtl()?i=t.overlayX==="start"?"right":"left":i=t.overlayX==="start"?"left":"right";for(let r=0;r<e.length;r++)e[r].style.transformOrigin=`${i} ${n}`}_calculateBoundingBoxRect(t,e){let i=this._viewportRect,n=this._isRtl(),r,a,c;if(e.overlayY==="top")a=t.y,r=i.height-a+this._viewportMargin;else if(e.overlayY==="bottom")c=i.height-t.y+this._viewportMargin*2,r=i.height-c+this._viewportMargin;else{let N=Math.min(i.bottom-t.y+i.top,t.y),k=this._lastBoundingBoxSize.height;r=N*2,a=t.y-N,r>k&&!this._isInitialRender&&!this._growAfterOpen&&(a=t.y-k/2)}let h=e.overlayX==="start"&&!n||e.overlayX==="end"&&n,g=e.overlayX==="end"&&!n||e.overlayX==="start"&&n,b,S,P;if(g)P=i.width-t.x+this._viewportMargin*2,b=t.x-this._viewportMargin;else if(h)S=t.x,b=i.right-t.x;else{let N=Math.min(i.right-t.x+i.left,t.x),k=this._lastBoundingBoxSize.width;b=N*2,S=t.x-N,b>k&&!this._isInitialRender&&!this._growAfterOpen&&(S=t.x-k/2)}return{top:a,left:S,bottom:c,right:P,width:b,height:r}}_setBoundingBoxStyles(t,e){let i=this._calculateBoundingBoxRect(t,e);!this._isInitialRender&&!this._growAfterOpen&&(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.width,this._lastBoundingBoxSize.width));let n={};if(this._hasExactPosition())n.top=n.left="0",n.bottom=n.right=n.maxHeight=n.maxWidth="",n.width=n.height="100%";else{let r=this._overlayRef.getConfig().maxHeight,a=this._overlayRef.getConfig().maxWidth;n.height=rt(i.height),n.top=rt(i.top),n.bottom=rt(i.bottom),n.width=rt(i.width),n.left=rt(i.left),n.right=rt(i.right),e.overlayX==="center"?n.alignItems="center":n.alignItems=e.overlayX==="end"?"flex-end":"flex-start",e.overlayY==="center"?n.justifyContent="center":n.justifyContent=e.overlayY==="bottom"?"flex-end":"flex-start",r&&(n.maxHeight=rt(r)),a&&(n.maxWidth=rt(a))}this._lastBoundingBoxSize=i,ro(this._boundingBox.style,n)}_resetBoundingBoxStyles(){ro(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){ro(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(t,e){let i={},n=this._hasExactPosition(),r=this._hasFlexibleDimensions,a=this._overlayRef.getConfig();if(n){let b=this._viewportRuler.getViewportScrollPosition();ro(i,this._getExactOverlayY(e,t,b)),ro(i,this._getExactOverlayX(e,t,b))}else i.position="static";let c="",h=this._getOffset(e,"x"),g=this._getOffset(e,"y");h&&(c+=`translateX(${h}px) `),g&&(c+=`translateY(${g}px)`),i.transform=c.trim(),a.maxHeight&&(n?i.maxHeight=rt(a.maxHeight):r&&(i.maxHeight="")),a.maxWidth&&(n?i.maxWidth=rt(a.maxWidth):r&&(i.maxWidth="")),ro(this._pane.style,i)}_getExactOverlayY(t,e,i){let n={top:"",bottom:""},r=this._getOverlayPoint(e,this._overlayRect,t);if(this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,i)),t.overlayY==="bottom"){let a=this._document.documentElement.clientHeight;n.bottom=`${a-(r.y+this._overlayRect.height)}px`}else n.top=rt(r.y);return n}_getExactOverlayX(t,e,i){let n={left:"",right:""},r=this._getOverlayPoint(e,this._overlayRect,t);this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,i));let a;if(this._isRtl()?a=t.overlayX==="end"?"left":"right":a=t.overlayX==="end"?"right":"left",a==="right"){let c=this._document.documentElement.clientWidth;n.right=`${c-(r.x+this._overlayRect.width)}px`}else n.left=rt(r.x);return n}_getScrollVisibility(){let t=this._getOriginRect(),e=this._pane.getBoundingClientRect(),i=this._scrollables.map(n=>n.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:Qp(t,i),isOriginOutsideView:Fc(t,i),isOverlayClipped:Qp(e,i),isOverlayOutsideView:Fc(e,i)}}_subtractOverflows(t,...e){return e.reduce((i,n)=>i-Math.max(n,0),t)}_getNarrowedViewportRect(){let t=this._document.documentElement.clientWidth,e=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+t-this._viewportMargin,bottom:i.top+e-this._viewportMargin,width:t-2*this._viewportMargin,height:e-2*this._viewportMargin}}_isRtl(){return this._overlayRef.getDirection()==="rtl"}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(t,e){return e==="x"?t.offsetX==null?this._offsetX:t.offsetX:t.offsetY==null?this._offsetY:t.offsetY}_validatePositions(){}_addPanelClasses(t){this._pane&&Jl(t).forEach(e=>{e!==""&&this._appliedPanelClasses.indexOf(e)===-1&&(this._appliedPanelClasses.push(e),this._pane.classList.add(e))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(t=>{this._pane.classList.remove(t)}),this._appliedPanelClasses=[])}_getOriginRect(){let t=this._origin;if(t instanceof ie)return t.nativeElement.getBoundingClientRect();if(t instanceof Element)return t.getBoundingClientRect();let e=t.width||0,i=t.height||0;return{top:t.y,bottom:t.y+i,left:t.x,right:t.x+e,height:i,width:e}}};function ro(o,t){for(let e in t)t.hasOwnProperty(e)&&(o[e]=t[e]);return o}function Zp(o){if(typeof o!="number"&&o!=null){let[t,e]=o.split(Lf);return!e||e==="px"?parseFloat(t):null}return o||null}function Jp(o){return{top:Math.floor(o.top),right:Math.floor(o.right),bottom:Math.floor(o.bottom),left:Math.floor(o.left),width:Math.floor(o.width),height:Math.floor(o.height)}}function Vf(o,t){return o===t?!0:o.isOriginClipped===t.isOriginClipped&&o.isOriginOutsideView===t.isOriginOutsideView&&o.isOverlayClipped===t.isOverlayClipped&&o.isOverlayOutsideView===t.isOverlayOutsideView}var eh="cdk-global-overlay-wrapper";function Nn(o){return new As}var As=class{_overlayRef;_cssPosition="static";_topOffset="";_bottomOffset="";_alignItems="";_xPosition="";_xOffset="";_width="";_height="";_isDisposed=!1;attach(t){let e=t.getConfig();this._overlayRef=t,this._width&&!e.width&&t.updateSize({width:this._width}),this._height&&!e.height&&t.updateSize({height:this._height}),t.hostElement.classList.add(eh),this._isDisposed=!1}top(t=""){return this._bottomOffset="",this._topOffset=t,this._alignItems="flex-start",this}left(t=""){return this._xOffset=t,this._xPosition="left",this}bottom(t=""){return this._topOffset="",this._bottomOffset=t,this._alignItems="flex-end",this}right(t=""){return this._xOffset=t,this._xPosition="right",this}start(t=""){return this._xOffset=t,this._xPosition="start",this}end(t=""){return this._xOffset=t,this._xPosition="end",this}width(t=""){return this._overlayRef?this._overlayRef.updateSize({width:t}):this._width=t,this}height(t=""){return this._overlayRef?this._overlayRef.updateSize({height:t}):this._height=t,this}centerHorizontally(t=""){return this.left(t),this._xPosition="center",this}centerVertically(t=""){return this.top(t),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;let t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement.style,i=this._overlayRef.getConfig(),{width:n,height:r,maxWidth:a,maxHeight:c}=i,h=(n==="100%"||n==="100vw")&&(!a||a==="100%"||a==="100vw"),g=(r==="100%"||r==="100vh")&&(!c||c==="100%"||c==="100vh"),b=this._xPosition,S=this._xOffset,P=this._overlayRef.getConfig().direction==="rtl",N="",k="",A="";h?A="flex-start":b==="center"?(A="center",P?k=S:N=S):P?b==="left"||b==="end"?(A="flex-end",N=S):(b==="right"||b==="start")&&(A="flex-start",k=S):b==="left"||b==="start"?(A="flex-start",N=S):(b==="right"||b==="end")&&(A="flex-end",k=S),t.position=this._cssPosition,t.marginLeft=h?"0":N,t.marginTop=g?"0":this._topOffset,t.marginBottom=this._bottomOffset,t.marginRight=h?"0":k,e.justifyContent=A,e.alignItems=g?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;let t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement,i=e.style;e.classList.remove(eh),i.justifyContent=i.alignItems=t.marginTop=t.marginBottom=t.marginLeft=t.marginRight=t.position="",this._overlayRef=null,this._isDisposed=!0}},sh=(()=>{class o{_injector=m(be);constructor(){}global(){return Nn()}flexibleConnectedTo(e){return Ur(this._injector,e)}static \u0275fac=function(i){return new(i||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function mn(o,t){o.get(Rt).load(ah);let e=o.get(Is),i=o.get(Je),n=o.get(Re),r=o.get(Kl),a=o.get(ft),c=i.createElement("div"),h=i.createElement("div");h.id=n.getId("cdk-overlay-"),h.classList.add("cdk-overlay-pane"),c.appendChild(h),e.getContainerElement().appendChild(c);let g=new ks(h,r,o),b=new cn(t),S=o.get(yt,null,{optional:!0})||o.get(pi).createRenderer(null,null);return b.direction=b.direction||a.value,new Bo(g,c,h,b,o.get(de),o.get(oh),i,o.get(Mm),o.get(rh),t?.disableAnimations??o.get(Tr,null,{optional:!0})==="NoopAnimations",o.get(Oa),S)}var lh=(()=>{class o{scrollStrategies=m(ih);_positionBuilder=m(sh);_injector=m(be);constructor(){}create(e){return mn(this._injector,e)}position(){return this._positionBuilder}static \u0275fac=function(i){return new(i||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),zf=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],ch=new ne("cdk-connected-overlay-scroll-strategy",{providedIn:"root",factory:()=>{let o=m(be);return()=>zi(o)}}),Ho=(()=>{class o{elementRef=m(ie);constructor(){}static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]})}return o})(),Ds=(()=>{class o{_dir=m(ft,{optional:!0});_injector=m(be);_overlayRef;_templatePortal;_backdropSubscription=Pi.EMPTY;_attachSubscription=Pi.EMPTY;_detachSubscription=Pi.EMPTY;_positionSubscription=Pi.EMPTY;_offsetX;_offsetY;_position;_scrollStrategyFactory=m(ch);_disposeOnNavigation=!1;_ngZone=m(de);origin;positions;positionStrategy;get offsetX(){return this._offsetX}set offsetX(e){this._offsetX=e,this._position&&this._updatePositionStrategy(this._position)}get offsetY(){return this._offsetY}set offsetY(e){this._offsetY=e,this._position&&this._updatePositionStrategy(this._position)}width;height;minWidth;minHeight;backdropClass;panelClass;viewportMargin=0;scrollStrategy;open=!1;disableClose=!1;transformOriginSelector;hasBackdrop=!1;lockPosition=!1;flexibleDimensions=!1;growAfterOpen=!1;push=!1;get disposeOnNavigation(){return this._disposeOnNavigation}set disposeOnNavigation(e){this._disposeOnNavigation=e}backdropClick=new U;positionChange=new U;attach=new U;detach=new U;overlayKeydown=new U;overlayOutsideClick=new U;constructor(){let e=m(Sn),i=m(Xn);this._templatePortal=new rn(e,i),this.scrollStrategy=this._scrollStrategyFactory()}get overlayRef(){return this._overlayRef}get dir(){return this._dir?this._dir.value:"ltr"}ngOnDestroy(){this._attachSubscription.unsubscribe(),this._detachSubscription.unsubscribe(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this._overlayRef?.dispose()}ngOnChanges(e){this._position&&(this._updatePositionStrategy(this._position),this._overlayRef?.updateSize({width:this.width,minWidth:this.minWidth,height:this.height,minHeight:this.minHeight}),e.origin&&this.open&&this._position.apply()),e.open&&(this.open?this.attachOverlay():this.detachOverlay())}_createOverlay(){(!this.positions||!this.positions.length)&&(this.positions=zf);let e=this._overlayRef=mn(this._injector,this._buildConfig());this._attachSubscription=e.attachments().subscribe(()=>this.attach.emit()),this._detachSubscription=e.detachments().subscribe(()=>this.detach.emit()),e.keydownEvents().subscribe(i=>{this.overlayKeydown.next(i),i.keyCode===27&&!this.disableClose&&!gt(i)&&(i.preventDefault(),this.detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(i=>{let n=this._getOriginElement(),r=ja(i);(!n||n!==r&&!n.contains(r))&&this.overlayOutsideClick.next(i)})}_buildConfig(){let e=this._position=this.positionStrategy||this._createPositionStrategy(),i=new cn({direction:this._dir||"ltr",positionStrategy:e,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop,disposeOnNavigation:this.disposeOnNavigation});return(this.width||this.width===0)&&(i.width=this.width),(this.height||this.height===0)&&(i.height=this.height),(this.minWidth||this.minWidth===0)&&(i.minWidth=this.minWidth),(this.minHeight||this.minHeight===0)&&(i.minHeight=this.minHeight),this.backdropClass&&(i.backdropClass=this.backdropClass),this.panelClass&&(i.panelClass=this.panelClass),i}_updatePositionStrategy(e){let i=this.positions.map(n=>({originX:n.originX,originY:n.originY,overlayX:n.overlayX,overlayY:n.overlayY,offsetX:n.offsetX||this.offsetX,offsetY:n.offsetY||this.offsetY,panelClass:n.panelClass||void 0}));return e.setOrigin(this._getOrigin()).withPositions(i).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector)}_createPositionStrategy(){let e=Ur(this._injector,this._getOrigin());return this._updatePositionStrategy(e),e}_getOrigin(){return this.origin instanceof Ho?this.origin.elementRef:this.origin}_getOriginElement(){return this.origin instanceof Ho?this.origin.elementRef.nativeElement:this.origin instanceof ie?this.origin.nativeElement:typeof Element<"u"&&this.origin instanceof Element?this.origin:null}attachOverlay(){this._overlayRef?this._overlayRef.getConfig().hasBackdrop=this.hasBackdrop:this._createOverlay(),this._overlayRef.hasAttached()||this._overlayRef.attach(this._templatePortal),this.hasBackdrop?this._backdropSubscription=this._overlayRef.backdropClick().subscribe(e=>{this.backdropClick.emit(e)}):this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.positionChange.observers.length>0&&(this._positionSubscription=this._position.positionChanges.pipe(cm(()=>this.positionChange.observers.length>0)).subscribe(e=>{this._ngZone.run(()=>this.positionChange.emit(e)),this.positionChange.observers.length===0&&this._positionSubscription.unsubscribe()})),this.open=!0}detachOverlay(){this._overlayRef?.detach(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.open=!1}static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["","cdk-connected-overlay",""],["","connected-overlay",""],["","cdkConnectedOverlay",""]],inputs:{origin:[0,"cdkConnectedOverlayOrigin","origin"],positions:[0,"cdkConnectedOverlayPositions","positions"],positionStrategy:[0,"cdkConnectedOverlayPositionStrategy","positionStrategy"],offsetX:[0,"cdkConnectedOverlayOffsetX","offsetX"],offsetY:[0,"cdkConnectedOverlayOffsetY","offsetY"],width:[0,"cdkConnectedOverlayWidth","width"],height:[0,"cdkConnectedOverlayHeight","height"],minWidth:[0,"cdkConnectedOverlayMinWidth","minWidth"],minHeight:[0,"cdkConnectedOverlayMinHeight","minHeight"],backdropClass:[0,"cdkConnectedOverlayBackdropClass","backdropClass"],panelClass:[0,"cdkConnectedOverlayPanelClass","panelClass"],viewportMargin:[0,"cdkConnectedOverlayViewportMargin","viewportMargin"],scrollStrategy:[0,"cdkConnectedOverlayScrollStrategy","scrollStrategy"],open:[0,"cdkConnectedOverlayOpen","open"],disableClose:[0,"cdkConnectedOverlayDisableClose","disableClose"],transformOriginSelector:[0,"cdkConnectedOverlayTransformOriginOn","transformOriginSelector"],hasBackdrop:[2,"cdkConnectedOverlayHasBackdrop","hasBackdrop",J],lockPosition:[2,"cdkConnectedOverlayLockPosition","lockPosition",J],flexibleDimensions:[2,"cdkConnectedOverlayFlexibleDimensions","flexibleDimensions",J],growAfterOpen:[2,"cdkConnectedOverlayGrowAfterOpen","growAfterOpen",J],push:[2,"cdkConnectedOverlayPush","push",J],disposeOnNavigation:[2,"cdkConnectedOverlayDisposeOnNavigation","disposeOnNavigation",J]},outputs:{backdropClick:"backdropClick",positionChange:"positionChange",attach:"attach",detach:"detach",overlayKeydown:"overlayKeydown",overlayOutsideClick:"overlayOutsideClick"},exportAs:["cdkConnectedOverlay"],features:[tt]})}return o})();function jf(o){let t=m(be);return()=>zi(t)}var Bf={provide:ch,useFactory:jf},vi=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({providers:[lh,Bf],imports:[Rr,an,Rc,Rc]})}return o})();function Hf(o,t){if(o&1){let e=M();s(0,"div",1)(1,"button",2),_("click",function(){v(e);let n=u();return y(n.action())}),p(2),l()()}if(o&2){let e=u();d(2),te(" ",e.data.action," ")}}var Wf=["label"];function Uf(o,t){}var $f=Math.pow(2,31)-1,$r=class{_overlayRef;instance;containerInstance;_afterDismissed=new R;_afterOpened=new R;_onAction=new R;_durationTimeoutId;_dismissedByAction=!1;constructor(t,e){this._overlayRef=e,this.containerInstance=t,t._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete(),this.dismiss()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(t){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(t,$f))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}},dh=new ne("MatSnackBarData"),Uo=class{politeness="polite";announcementMessage="";viewContainerRef;duration=0;panelClass;direction;data=null;horizontalPosition="center";verticalPosition="bottom"},qf=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["","matSnackBarLabel",""]],hostAttrs:[1,"mat-mdc-snack-bar-label","mdc-snackbar__label"]})}return o})(),Gf=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["","matSnackBarActions",""]],hostAttrs:[1,"mat-mdc-snack-bar-actions","mdc-snackbar__actions"]})}return o})(),Yf=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["","matSnackBarAction",""]],hostAttrs:[1,"mat-mdc-snack-bar-action","mdc-snackbar__action"]})}return o})(),mh=(()=>{class o{snackBarRef=m($r);data=m(dh);constructor(){}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-mdc-simple-snack-bar"],exportAs:["matSnackBar"],decls:3,vars:2,consts:[["matSnackBarLabel",""],["matSnackBarActions",""],["matButton","","matSnackBarAction","",3,"click"]],template:function(i,n){i&1&&(s(0,"div",0),p(1),l(),C(2,Hf,3,1,"div",1)),i&2&&(d(),te(" ",n.data.message,`
|
|
3
3
|
`),d(),x(n.hasAction?2:-1))},dependencies:[Et,qf,Gf,Yf],styles:[`.mat-mdc-simple-snack-bar{display:flex}.mat-mdc-simple-snack-bar .mat-mdc-snack-bar-label{max-height:50vh;overflow:auto}
|
|
4
|
-
`],encapsulation:2,changeDetection:0})}return o})(),Lc="_mat-snack-bar-enter",Vc="_mat-snack-bar-exit",Qf=(()=>{class o extends
|
|
5
|
-
`],encapsulation:2})}return o})();function Xf(){return new Uo}var Kf=new ne("mat-snack-bar-default-options",{providedIn:"root",factory:Xf}),qr=(()=>{class o{_live=m(Wa);_injector=m(be);_breakpointObserver=m(Fm);_parentSnackBar=m(o,{optional:!0,skipSelf:!0});_defaultConfig=m(Kf);_animationsDisabled=He();_snackBarRefAtThisLevel=null;simpleSnackBarComponent=mh;snackBarContainerComponent=Qf;handsetCssClass="mat-mdc-snack-bar-handset";get _openedSnackBarRef(){let e=this._parentSnackBar;return e?e._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(e){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=e:this._snackBarRefAtThisLevel=e}constructor(){}openFromComponent(e,i){return this._attach(e,i)}openFromTemplate(e,i){return this._attach(e,i)}open(e,i="",n){let r=Z(Z({},this._defaultConfig),n);return r.data={message:e,action:i},r.announcementMessage===e&&(r.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,r)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(e,i){let n=i&&i.viewContainerRef&&i.viewContainerRef.injector,r=be.create({parent:n||this._injector,providers:[{provide:Uo,useValue:i}]}),a=new bi(this.snackBarContainerComponent,i.viewContainerRef,r),c=e.attach(a);return c.instance.snackBarConfig=i,c.instance}_attach(e,i){let n=Z(Z(Z({},new Uo),this._defaultConfig),i),r=this._createOverlay(n),a=this._attachSnackBarContainer(r,n),c=new $r(a,r);if(e instanceof
|
|
6
|
-
`],encapsulation:2})}return o})(),Gr=class{overlayRef;config;componentInstance;componentRef;containerInstance;disableClose;closed=new R;backdropClick;keydownEvents;outsidePointerEvents;id;_detachSubscription;constructor(t,e){this.overlayRef=t,this.config=e,this.disableClose=e.disableClose,this.backdropClick=t.backdropClick(),this.keydownEvents=t.keydownEvents(),this.outsidePointerEvents=t.outsidePointerEvents(),this.id=e.id,this.keydownEvents.subscribe(i=>{i.keyCode===27&&!this.disableClose&&!gt(i)&&(i.preventDefault(),this.close(void 0,{focusOrigin:"keyboard"}))}),this.backdropClick.subscribe(()=>{!this.disableClose&&this._canClose()?this.close(void 0,{focusOrigin:"mouse"}):this.containerInstance._recaptureFocus?.()}),this._detachSubscription=t.detachments().subscribe(()=>{e.closeOnOverlayDetachments!==!1&&this.close()})}close(t,e){if(this._canClose(t)){let i=this.closed;this.containerInstance._closeInteractionType=e?.focusOrigin||"program",this._detachSubscription.unsubscribe(),this.overlayRef.dispose(),i.next(t),i.complete(),this.componentInstance=this.containerInstance=null}}updatePosition(){return this.overlayRef.updatePosition(),this}updateSize(t="",e=""){return this.overlayRef.updateSize({width:t,height:e}),this}addPanelClass(t){return this.overlayRef.addPanelClass(t),this}removePanelClass(t){return this.overlayRef.removePanelClass(t),this}_canClose(t){let e=this.config;return!!this.containerInstance&&(!e.closePredicate||e.closePredicate(t,e,this.componentInstance))}},Jf=new ne("DialogScrollStrategy",{providedIn:"root",factory:()=>{let o=m(be);return()=>Wo(o)}}),e_=new ne("DialogData"),t_=new ne("DefaultDialogConfig");function i_(o){let t=Ee(o),e=new U;return{valueSignal:t,get value(){return t()},change:e,ngOnDestroy(){e.complete()}}}var Bc=(()=>{class o{_injector=m(be);_defaultOptions=m(t_,{optional:!0});_parentDialog=m(o,{optional:!0,skipSelf:!0});_overlayContainer=m(Is);_idGenerator=m(Re);_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new R;_afterOpenedAtThisLevel=new R;_ariaHiddenElements=new Map;_scrollStrategy=m(Jf);get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}afterAllClosed=To(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(kt(void 0)));constructor(){}open(e,i){let n=this._defaultOptions||new Vn;i=Z(Z({},n),i),i.id=i.id||this._idGenerator.getId("cdk-dialog-"),i.id&&this.getDialogById(i.id);let r=this._getOverlayConfig(i),a=mn(this._injector,r),c=new Gr(a,i),h=this._attachContainer(a,c,i);if(c.containerInstance=h,!this.openDialogs.length){let g=this._overlayContainer.getContainerElement();h._focusTrapped?h._focusTrapped.pipe(Ut(1)).subscribe(()=>{this._hideNonDialogContentFromAssistiveTechnology(g)}):this._hideNonDialogContentFromAssistiveTechnology(g)}return this._attachDialogContent(e,c,h,i),this.openDialogs.push(c),c.closed.subscribe(()=>this._removeOpenDialog(c,!0)),this.afterOpened.next(c),c}closeAll(){zc(this.openDialogs,e=>e.close())}getDialogById(e){return this.openDialogs.find(i=>i.id===e)}ngOnDestroy(){zc(this._openDialogsAtThisLevel,e=>{e.config.closeOnDestroy===!1&&this._removeOpenDialog(e,!1)}),zc(this._openDialogsAtThisLevel,e=>e.close()),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete(),this._openDialogsAtThisLevel=[]}_getOverlayConfig(e){let i=new cn({positionStrategy:e.positionStrategy||Ln().centerHorizontally().centerVertically(),scrollStrategy:e.scrollStrategy||this._scrollStrategy(),panelClass:e.panelClass,hasBackdrop:e.hasBackdrop,direction:e.direction,minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight,width:e.width,height:e.height,disposeOnNavigation:e.closeOnNavigation,disableAnimations:e.disableAnimations});return e.backdropClass&&(i.backdropClass=e.backdropClass),i}_attachContainer(e,i,n){let r=n.injector||n.viewContainerRef?.injector,a=[{provide:Vn,useValue:n},{provide:Gr,useValue:i},{provide:Bo,useValue:e}],c;n.container?typeof n.container=="function"?c=n.container:(c=n.container.type,a.push(...n.container.providers(n))):c=jc;let h=new bi(c,n.viewContainerRef,be.create({parent:r||this._injector,providers:a}));return e.attach(h).instance}_attachDialogContent(e,i,n,r){if(e instanceof kn){let a=this._createInjector(r,i,n,void 0),c={$implicit:r.data,dialogRef:i};r.templateContext&&(c=Z(Z({},c),typeof r.templateContext=="function"?r.templateContext():r.templateContext)),n.attachTemplatePortal(new rn(e,null,c,a))}else{let a=this._createInjector(r,i,n,this._injector),c=n.attachComponentPortal(new bi(e,r.viewContainerRef,a));i.componentRef=c,i.componentInstance=c.instance}}_createInjector(e,i,n,r){let a=e.injector||e.viewContainerRef?.injector,c=[{provide:e_,useValue:e.data},{provide:Gr,useValue:i}];return e.providers&&(typeof e.providers=="function"?c.push(...e.providers(i,e,n)):c.push(...e.providers)),e.direction&&(!a||!a.get(ft,null,{optional:!0}))&&c.push({provide:ft,useValue:i_(e.direction)}),be.create({parent:a||r,providers:c})}_removeOpenDialog(e,i){let n=this.openDialogs.indexOf(e);n>-1&&(this.openDialogs.splice(n,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((r,a)=>{r?a.setAttribute("aria-hidden",r):a.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),i&&this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(e){if(e.parentElement){let i=e.parentElement.children;for(let n=i.length-1;n>-1;n--){let r=i[n];r!==e&&r.nodeName!=="SCRIPT"&&r.nodeName!=="STYLE"&&!r.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(r,r.getAttribute("aria-hidden")),r.setAttribute("aria-hidden","true"))}}}_getAfterAllClosed(){let e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}static \u0275fac=function(i){return new(i||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function zc(o,t){let e=o.length;for(;e--;)t(o[e])}var ph=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({providers:[Bc],imports:[vi,an,Oo,an]})}return o})();function n_(o,t){}var Qr=class{viewContainerRef;injector;id;role="dialog";panelClass="";hasBackdrop=!0;backdropClass="";disableClose=!1;closePredicate;width="";height="";minWidth;minHeight;maxWidth;maxHeight;position;data=null;direction;ariaDescribedBy=null;ariaLabelledBy=null;ariaLabel=null;ariaModal=!1;autoFocus="first-tabbable";restoreFocus=!0;delayFocusTrap=!0;scrollStrategy;closeOnNavigation=!0;enterAnimationDuration;exitAnimationDuration},Hc="mdc-dialog--open",hh="mdc-dialog--opening",uh="mdc-dialog--closing",o_=150,r_=75,_h=(()=>{class o extends jc{_animationStateChanged=new U;_animationsEnabled=!He();_actionSectionCount=0;_hostElement=this._elementRef.nativeElement;_enterAnimationDuration=this._animationsEnabled?fh(this._config.enterAnimationDuration)??o_:0;_exitAnimationDuration=this._animationsEnabled?fh(this._config.exitAnimationDuration)??r_:0;_animationTimer=null;_contentAttached(){super._contentAttached(),this._startOpenAnimation()}_startOpenAnimation(){this._animationStateChanged.emit({state:"opening",totalTime:this._enterAnimationDuration}),this._animationsEnabled?(this._hostElement.style.setProperty(gh,`${this._enterAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(hh,Hc)),this._waitForAnimationToComplete(this._enterAnimationDuration,this._finishDialogOpen)):(this._hostElement.classList.add(Hc),Promise.resolve().then(()=>this._finishDialogOpen()))}_startExitAnimation(){this._animationStateChanged.emit({state:"closing",totalTime:this._exitAnimationDuration}),this._hostElement.classList.remove(Hc),this._animationsEnabled?(this._hostElement.style.setProperty(gh,`${this._exitAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(uh)),this._waitForAnimationToComplete(this._exitAnimationDuration,this._finishDialogClose)):Promise.resolve().then(()=>this._finishDialogClose())}_updateActionSectionCount(e){this._actionSectionCount+=e,this._changeDetectorRef.markForCheck()}_finishDialogOpen=()=>{this._clearAnimationClasses(),this._openAnimationDone(this._enterAnimationDuration)};_finishDialogClose=()=>{this._clearAnimationClasses(),this._animationStateChanged.emit({state:"closed",totalTime:this._exitAnimationDuration})};_clearAnimationClasses(){this._hostElement.classList.remove(hh,uh)}_waitForAnimationToComplete(e,i){this._animationTimer!==null&&clearTimeout(this._animationTimer),this._animationTimer=setTimeout(i,e)}_requestAnimationFrame(e){this._ngZone.runOutsideAngular(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()})}_captureInitialFocus(){this._config.delayFocusTrap||this._trapFocus()}_openAnimationDone(e){this._config.delayFocusTrap&&this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:e})}ngOnDestroy(){super.ngOnDestroy(),this._animationTimer!==null&&clearTimeout(this._animationTimer)}attachComponentPortal(e){let i=super.attachComponentPortal(e);return i.location.nativeElement.classList.add("mat-mdc-dialog-component-host"),i}static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275cmp=T({type:o,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1",1,"mat-mdc-dialog-container","mdc-dialog"],hostVars:10,hostBindings:function(i,n){i&2&&(Zt("id",n._config.id),X("aria-modal",n._config.ariaModal)("role",n._config.role)("aria-labelledby",n._config.ariaLabel?null:n._ariaLabelledByQueue[0])("aria-label",n._config.ariaLabel)("aria-describedby",n._config.ariaDescribedBy||null),E("_mat-animation-noopable",!n._animationsEnabled)("mat-mdc-dialog-container-with-actions",n._actionSectionCount>0))},features:[Mt],decls:3,vars:0,consts:[[1,"mat-mdc-dialog-inner-container","mdc-dialog__container"],[1,"mat-mdc-dialog-surface","mdc-dialog__surface"],["cdkPortalOutlet",""]],template:function(i,n){i&1&&(s(0,"div",0)(1,"div",1),$e(2,n_,0,0,"ng-template",2),l()())},dependencies:[Nn],styles:[`.mat-mdc-dialog-container{width:100%;height:100%;display:block;box-sizing:border-box;max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit;outline:0}.cdk-overlay-pane.mat-mdc-dialog-panel{max-width:var(--mat-dialog-container-max-width, 560px);min-width:var(--mat-dialog-container-min-width, 280px)}@media(max-width: 599px){.cdk-overlay-pane.mat-mdc-dialog-panel{max-width:var(--mat-dialog-container-small-max-width, calc(100vw - 32px))}}.mat-mdc-dialog-inner-container{display:flex;flex-direction:row;align-items:center;justify-content:space-around;box-sizing:border-box;height:100%;opacity:0;transition:opacity linear var(--mat-dialog-transition-duration, 0ms);max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit}.mdc-dialog--closing .mat-mdc-dialog-inner-container{transition:opacity 75ms linear;transform:none}.mdc-dialog--open .mat-mdc-dialog-inner-container{opacity:1}._mat-animation-noopable .mat-mdc-dialog-inner-container{transition:none}.mat-mdc-dialog-surface{display:flex;flex-direction:column;flex-grow:0;flex-shrink:0;box-sizing:border-box;width:100%;height:100%;position:relative;overflow-y:auto;outline:0;transform:scale(0.8);transition:transform var(--mat-dialog-transition-duration, 0ms) cubic-bezier(0, 0, 0.2, 1);max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit;box-shadow:var(--mat-dialog-container-elevation-shadow, none);border-radius:var(--mat-dialog-container-shape, var(--mat-sys-corner-extra-large, 4px));background-color:var(--mat-dialog-container-color, var(--mat-sys-surface, white))}[dir=rtl] .mat-mdc-dialog-surface{text-align:right}.mdc-dialog--open .mat-mdc-dialog-surface,.mdc-dialog--closing .mat-mdc-dialog-surface{transform:none}._mat-animation-noopable .mat-mdc-dialog-surface{transition:none}.mat-mdc-dialog-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:2px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mat-mdc-dialog-title{display:block;position:relative;flex-shrink:0;box-sizing:border-box;margin:0 0 1px;padding:var(--mat-dialog-headline-padding, 6px 24px 13px)}.mat-mdc-dialog-title::before{display:inline-block;width:0;height:40px;content:"";vertical-align:0}[dir=rtl] .mat-mdc-dialog-title{text-align:right}.mat-mdc-dialog-container .mat-mdc-dialog-title{color:var(--mat-dialog-subhead-color, var(--mat-sys-on-surface, rgba(0, 0, 0, 0.87)));font-family:var(--mat-dialog-subhead-font, var(--mat-sys-headline-small-font, inherit));line-height:var(--mat-dialog-subhead-line-height, var(--mat-sys-headline-small-line-height, 1.5rem));font-size:var(--mat-dialog-subhead-size, var(--mat-sys-headline-small-size, 1rem));font-weight:var(--mat-dialog-subhead-weight, var(--mat-sys-headline-small-weight, 400));letter-spacing:var(--mat-dialog-subhead-tracking, var(--mat-sys-headline-small-tracking, 0.03125em))}.mat-mdc-dialog-content{display:block;flex-grow:1;box-sizing:border-box;margin:0;overflow:auto;max-height:65vh}.mat-mdc-dialog-content>:first-child{margin-top:0}.mat-mdc-dialog-content>:last-child{margin-bottom:0}.mat-mdc-dialog-container .mat-mdc-dialog-content{color:var(--mat-dialog-supporting-text-color, var(--mat-sys-on-surface-variant, rgba(0, 0, 0, 0.6)));font-family:var(--mat-dialog-supporting-text-font, var(--mat-sys-body-medium-font, inherit));line-height:var(--mat-dialog-supporting-text-line-height, var(--mat-sys-body-medium-line-height, 1.5rem));font-size:var(--mat-dialog-supporting-text-size, var(--mat-sys-body-medium-size, 1rem));font-weight:var(--mat-dialog-supporting-text-weight, var(--mat-sys-body-medium-weight, 400));letter-spacing:var(--mat-dialog-supporting-text-tracking, var(--mat-sys-body-medium-tracking, 0.03125em))}.mat-mdc-dialog-container .mat-mdc-dialog-content{padding:var(--mat-dialog-content-padding, 20px 24px)}.mat-mdc-dialog-container-with-actions .mat-mdc-dialog-content{padding:var(--mat-dialog-with-actions-content-padding, 20px 24px 0)}.mat-mdc-dialog-container .mat-mdc-dialog-title+.mat-mdc-dialog-content{padding-top:0}.mat-mdc-dialog-actions{display:flex;position:relative;flex-shrink:0;flex-wrap:wrap;align-items:center;box-sizing:border-box;min-height:52px;margin:0;border-top:1px solid rgba(0,0,0,0);padding:var(--mat-dialog-actions-padding, 16px 24px);justify-content:var(--mat-dialog-actions-alignment, flex-end)}@media(forced-colors: active){.mat-mdc-dialog-actions{border-top-color:CanvasText}}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-start,.mat-mdc-dialog-actions[align=start]{justify-content:start}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-center,.mat-mdc-dialog-actions[align=center]{justify-content:center}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-end,.mat-mdc-dialog-actions[align=end]{justify-content:flex-end}.mat-mdc-dialog-actions .mat-button-base+.mat-button-base,.mat-mdc-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-mdc-dialog-actions .mat-button-base+.mat-button-base,[dir=rtl] .mat-mdc-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}.mat-mdc-dialog-component-host{display:contents}
|
|
7
|
-
`],encapsulation:2})}return o})(),gh="--mat-dialog-transition-duration";function fh(o){return o==null?null:typeof o=="number"?o:o.endsWith("ms")?gi(o.substring(0,o.length-2)):o.endsWith("s")?gi(o.substring(0,o.length-1))*1e3:o==="0"?0:null}var Yr=(function(o){return o[o.OPEN=0]="OPEN",o[o.CLOSING=1]="CLOSING",o[o.CLOSED=2]="CLOSED",o})(Yr||{}),ei=class{_ref;_config;_containerInstance;componentInstance;componentRef;disableClose;id;_afterOpened=new R;_beforeClosed=new R;_result;_closeFallbackTimeout;_state=Yr.OPEN;_closeInteractionType;constructor(t,e,i){this._ref=t,this._config=e,this._containerInstance=i,this.disableClose=e.disableClose,this.id=t.id,t.addPanelClass("mat-mdc-dialog-panel"),i._animationStateChanged.pipe(ce(n=>n.state==="opened"),Ut(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),i._animationStateChanged.pipe(ce(n=>n.state==="closed"),Ut(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),t.overlayRef.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._finishDialogClose()}),Ai(this.backdropClick(),this.keydownEvents().pipe(ce(n=>n.keyCode===27&&!this.disableClose&&!gt(n)))).subscribe(n=>{this.disableClose||(n.preventDefault(),bh(this,n.type==="keydown"?"keyboard":"mouse"))})}close(t){let e=this._config.closePredicate;e&&!e(t,this._config,this.componentInstance)||(this._result=t,this._containerInstance._animationStateChanged.pipe(ce(i=>i.state==="closing"),Ut(1)).subscribe(i=>{this._beforeClosed.next(t),this._beforeClosed.complete(),this._ref.overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),i.totalTime+100)}),this._state=Yr.CLOSING,this._containerInstance._startExitAnimation())}afterOpened(){return this._afterOpened}afterClosed(){return this._ref.closed}beforeClosed(){return this._beforeClosed}backdropClick(){return this._ref.backdropClick}keydownEvents(){return this._ref.keydownEvents}updatePosition(t){let e=this._ref.config.positionStrategy;return t&&(t.left||t.right)?t.left?e.left(t.left):e.right(t.right):e.centerHorizontally(),t&&(t.top||t.bottom)?t.top?e.top(t.top):e.bottom(t.bottom):e.centerVertically(),this._ref.updatePosition(),this}updateSize(t="",e=""){return this._ref.updateSize(t,e),this}addPanelClass(t){return this._ref.addPanelClass(t),this}removePanelClass(t){return this._ref.removePanelClass(t),this}getState(){return this._state}_finishDialogClose(){this._state=Yr.CLOSED,this._ref.close(this._result,{focusOrigin:this._closeInteractionType}),this.componentInstance=null}};function bh(o,t,e){return o._closeInteractionType=t,o.close(e)}var ji=new ne("MatMdcDialogData"),Rs=new ne("mat-mdc-dialog-default-options"),vh=new ne("mat-mdc-dialog-scroll-strategy",{providedIn:"root",factory:()=>{let o=m(be);return()=>Wo(o)}}),yi=(()=>{class o{_defaultOptions=m(Rs,{optional:!0});_scrollStrategy=m(vh);_parentDialog=m(o,{optional:!0,skipSelf:!0});_idGenerator=m(Re);_injector=m(be);_dialog=m(Bc);_animationsDisabled=He();_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new R;_afterOpenedAtThisLevel=new R;dialogConfigClass=Qr;_dialogRefConstructor;_dialogContainerType;_dialogDataToken;get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}_getAfterAllClosed(){let e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}afterAllClosed=To(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(kt(void 0)));constructor(){this._dialogRefConstructor=ei,this._dialogContainerType=_h,this._dialogDataToken=ji}open(e,i){let n;i=Z(Z({},this._defaultOptions||new Qr),i),i.id=i.id||this._idGenerator.getId("mat-mdc-dialog-"),i.scrollStrategy=i.scrollStrategy||this._scrollStrategy();let r=this._dialog.open(e,ut(Z({},i),{positionStrategy:Ln(this._injector).centerHorizontally().centerVertically(),disableClose:!0,closePredicate:void 0,closeOnDestroy:!1,closeOnOverlayDetachments:!1,disableAnimations:this._animationsDisabled||i.enterAnimationDuration?.toLocaleString()==="0"||i.exitAnimationDuration?.toString()==="0",container:{type:this._dialogContainerType,providers:()=>[{provide:this.dialogConfigClass,useValue:i},{provide:Vn,useValue:i}]},templateContext:()=>({dialogRef:n}),providers:(a,c,h)=>(n=new this._dialogRefConstructor(a,i,h),n.updatePosition(i?.position),[{provide:this._dialogContainerType,useValue:h},{provide:this._dialogDataToken,useValue:c.data},{provide:this._dialogRefConstructor,useValue:n}])}));return n.componentRef=r.componentRef,n.componentInstance=r.componentInstance,this.openDialogs.push(n),this.afterOpened.next(n),n.afterClosed().subscribe(()=>{let a=this.openDialogs.indexOf(n);a>-1&&(this.openDialogs.splice(a,1),this.openDialogs.length||this._getAfterAllClosed().next())}),n}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(e){return this.openDialogs.find(i=>i.id===e)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_closeDialogs(e){let i=e.length;for(;i--;)e[i].close()}static \u0275fac=function(i){return new(i||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var yh=(()=>{class o{_dialogRef=m(ei,{optional:!0});_elementRef=m(ie);_dialog=m(yi);constructor(){}ngOnInit(){this._dialogRef||(this._dialogRef=a_(this._elementRef,this._dialog.openDialogs)),this._dialogRef&&Promise.resolve().then(()=>{this._onAdd()})}ngOnDestroy(){this._dialogRef?._containerInstance&&Promise.resolve().then(()=>{this._onRemove()})}static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o})}return o})(),pn=(()=>{class o extends yh{id=m(Re).getId("mat-mdc-dialog-title-");_onAdd(){this._dialogRef._containerInstance?._addAriaLabelledBy?.(this.id)}_onRemove(){this._dialogRef?._containerInstance?._removeAriaLabelledBy?.(this.id)}static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275dir=Ce({type:o,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-mdc-dialog-title","mdc-dialog__title"],hostVars:1,hostBindings:function(i,n){i&2&&Zt("id",n.id)},inputs:{id:"id"},exportAs:["matDialogTitle"],features:[Mt]})}return o})(),hn=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-mdc-dialog-content","mdc-dialog__content"],features:[fm([ln])]})}return o})(),un=(()=>{class o extends yh{align;_onAdd(){this._dialogRef._containerInstance?._updateActionSectionCount?.(1)}_onRemove(){this._dialogRef._containerInstance?._updateActionSectionCount?.(-1)}static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275dir=Ce({type:o,selectors:[["","mat-dialog-actions",""],["mat-dialog-actions"],["","matDialogActions",""]],hostAttrs:[1,"mat-mdc-dialog-actions","mdc-dialog__actions"],hostVars:6,hostBindings:function(i,n){i&2&&E("mat-mdc-dialog-actions-align-start",n.align==="start")("mat-mdc-dialog-actions-align-center",n.align==="center")("mat-mdc-dialog-actions-align-end",n.align==="end")},inputs:{align:"align"},features:[Mt]})}return o})();function a_(o,t){let e=o.nativeElement.parentElement;for(;e&&!e.classList.contains("mat-mdc-dialog-container");)e=e.parentElement;return e?t.find(i=>i.id===e.id):null}var ao=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({providers:[yi],imports:[ph,vi,an,ae,ae]})}return o})();function Gc(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var lo=Gc();function Th(o){lo=o}var Jr={exec:()=>null};function Me(o,t=""){let e=typeof o=="string"?o:o.source,i={replace:(n,r)=>{let a=typeof r=="string"?r:r.source;return a=a.replace(Ft.caret,"$1"),e=e.replace(n,a),i},getRegex:()=>new RegExp(e,t)};return i}var Ft={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:o=>new RegExp(`^( {0,3}${o})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}#`),htmlBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}<(?:[a-z].*>|!--)`,"i")},s_=/^(?:[ \t]*(?:\n|$))+/,l_=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,c_=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ea=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,d_=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Yc=/(?:[*+-]|\d{1,9}[.)])/,Eh=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ph=Me(Eh).replace(/bull/g,Yc).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),m_=Me(Eh).replace(/bull/g,Yc).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Qc=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,p_=/^[^\n]+/,Xc=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,h_=Me(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Xc).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),u_=Me(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Yc).getRegex(),Vs="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Kc=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,g_=Me("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Kc).replace("tag",Vs).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Oh=Me(Qc).replace("hr",ea).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Vs).getRegex(),f_=Me(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Oh).getRegex(),Zc={blockquote:f_,code:l_,def:h_,fences:c_,heading:d_,hr:ea,html:g_,lheading:Ph,list:u_,newline:s_,paragraph:Oh,table:Jr,text:p_},Ch=Me("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ea).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Vs).getRegex(),__=ut(Z({},Zc),{lheading:m_,table:Ch,paragraph:Me(Qc).replace("hr",ea).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ch).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Vs).getRegex()}),b_=ut(Z({},Zc),{html:Me(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Kc).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Jr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Me(Qc).replace("hr",ea).replace("heading",` *#{1,6} *[^
|
|
4
|
+
`],encapsulation:2,changeDetection:0})}return o})(),Lc="_mat-snack-bar-enter",Vc="_mat-snack-bar-exit",Qf=(()=>{class o extends Rn{_ngZone=m(de);_elementRef=m(ie);_changeDetectorRef=m(Ge);_platform=m(et);_animationsDisabled=He();snackBarConfig=m(Uo);_document=m(Je);_trackedModals=new Set;_enterFallback;_exitFallback;_injector=m(be);_announceDelay=150;_announceTimeoutId;_destroyed=!1;_portalOutlet;_onAnnounce=new R;_onExit=new R;_onEnter=new R;_animationState="void";_live;_label;_role;_liveElementId=m(Re).getId("mat-snack-bar-container-live-");constructor(){super();let e=this.snackBarConfig;e.politeness==="assertive"&&!e.announcementMessage?this._live="assertive":e.politeness==="off"?this._live="off":this._live="polite",this._platform.FIREFOX&&(this._live==="polite"&&(this._role="status"),this._live==="assertive"&&(this._role="alert"))}attachComponentPortal(e){this._assertNotAttached();let i=this._portalOutlet.attachComponentPortal(e);return this._afterPortalAttached(),i}attachTemplatePortal(e){this._assertNotAttached();let i=this._portalOutlet.attachTemplatePortal(e);return this._afterPortalAttached(),i}attachDomPortal=e=>{this._assertNotAttached();let i=this._portalOutlet.attachDomPortal(e);return this._afterPortalAttached(),i};onAnimationEnd(e){e===Vc?this._completeExit():e===Lc&&(clearTimeout(this._enterFallback),this._ngZone.run(()=>{this._onEnter.next(),this._onEnter.complete()}))}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.markForCheck(),this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce(),this._animationsDisabled?Dt(()=>{this._ngZone.run(()=>queueMicrotask(()=>this.onAnimationEnd(Lc)))},{injector:this._injector}):(clearTimeout(this._enterFallback),this._enterFallback=setTimeout(()=>{this._elementRef.nativeElement.classList.add("mat-snack-bar-fallback-visible"),this.onAnimationEnd(Lc)},200)))}exit(){return this._destroyed?It(void 0):(this._ngZone.run(()=>{this._animationState="hidden",this._changeDetectorRef.markForCheck(),this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId),this._animationsDisabled?Dt(()=>{this._ngZone.run(()=>queueMicrotask(()=>this.onAnimationEnd(Vc)))},{injector:this._injector}):(clearTimeout(this._exitFallback),this._exitFallback=setTimeout(()=>this.onAnimationEnd(Vc),200))}),this._onExit)}ngOnDestroy(){this._destroyed=!0,this._clearFromModals(),this._completeExit()}_completeExit(){clearTimeout(this._exitFallback),queueMicrotask(()=>{this._onExit.next(),this._onExit.complete()})}_afterPortalAttached(){let e=this._elementRef.nativeElement,i=this.snackBarConfig.panelClass;i&&(Array.isArray(i)?i.forEach(a=>e.classList.add(a)):e.classList.add(i)),this._exposeToModals();let n=this._label.nativeElement,r="mdc-snackbar__label";n.classList.toggle(r,!n.querySelector(`.${r}`))}_exposeToModals(){let e=this._liveElementId,i=this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]');for(let n=0;n<i.length;n++){let r=i[n],a=r.getAttribute("aria-owns");this._trackedModals.add(r),a?a.indexOf(e)===-1&&r.setAttribute("aria-owns",a+" "+e):r.setAttribute("aria-owns",e)}}_clearFromModals(){this._trackedModals.forEach(e=>{let i=e.getAttribute("aria-owns");if(i){let n=i.replace(this._liveElementId,"").trim();n.length>0?e.setAttribute("aria-owns",n):e.removeAttribute("aria-owns")}}),this._trackedModals.clear()}_assertNotAttached(){this._portalOutlet.hasAttached()}_screenReaderAnnounce(){this._announceTimeoutId||this._ngZone.runOutsideAngular(()=>{this._announceTimeoutId=setTimeout(()=>{if(this._destroyed)return;let e=this._elementRef.nativeElement,i=e.querySelector("[aria-hidden]"),n=e.querySelector("[aria-live]");if(i&&n){let r=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&i.contains(document.activeElement)&&(r=document.activeElement),i.removeAttribute("aria-hidden"),n.appendChild(i),r?.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["mat-snack-bar-container"]],viewQuery:function(i,n){if(i&1&&(Q(Fn,7),Q(Wf,7)),i&2){let r;H(r=W())&&(n._portalOutlet=r.first),H(r=W())&&(n._label=r.first)}},hostAttrs:[1,"mdc-snackbar","mat-mdc-snack-bar-container"],hostVars:6,hostBindings:function(i,n){i&1&&_("animationend",function(a){return n.onAnimationEnd(a.animationName)})("animationcancel",function(a){return n.onAnimationEnd(a.animationName)}),i&2&&E("mat-snack-bar-container-enter",n._animationState==="visible")("mat-snack-bar-container-exit",n._animationState==="hidden")("mat-snack-bar-container-animations-enabled",!n._animationsDisabled)},features:[Mt],decls:6,vars:3,consts:[["label",""],[1,"mdc-snackbar__surface","mat-mdc-snackbar-surface"],[1,"mat-mdc-snack-bar-label"],["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(i,n){i&1&&(s(0,"div",1)(1,"div",2,0)(3,"div",3),$e(4,Uf,0,0,"ng-template",4),l(),I(5,"div"),l()()),i&2&&(d(5),K("aria-live",n._live)("role",n._role)("id",n._liveElementId))},dependencies:[Fn],styles:[`@keyframes _mat-snack-bar-enter{from{transform:scale(0.8);opacity:0}to{transform:scale(1);opacity:1}}@keyframes _mat-snack-bar-exit{from{opacity:1}to{opacity:0}}.mat-mdc-snack-bar-container{display:flex;align-items:center;justify-content:center;box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0);margin:8px}.mat-mdc-snack-bar-handset .mat-mdc-snack-bar-container{width:100vw}.mat-snack-bar-container-animations-enabled{opacity:0}.mat-snack-bar-container-animations-enabled.mat-snack-bar-fallback-visible{opacity:1}.mat-snack-bar-container-animations-enabled.mat-snack-bar-container-enter{animation:_mat-snack-bar-enter 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-snack-bar-container-animations-enabled.mat-snack-bar-container-exit{animation:_mat-snack-bar-exit 75ms cubic-bezier(0.4, 0, 1, 1) forwards}.mat-mdc-snackbar-surface{box-shadow:0px 3px 5px -1px rgba(0, 0, 0, 0.2), 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);display:flex;align-items:center;justify-content:flex-start;box-sizing:border-box;padding-left:0;padding-right:8px}[dir=rtl] .mat-mdc-snackbar-surface{padding-right:0;padding-left:8px}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{min-width:344px;max-width:672px}.mat-mdc-snack-bar-handset .mat-mdc-snackbar-surface{width:100%;min-width:0}@media(forced-colors: active){.mat-mdc-snackbar-surface{outline:solid 1px}}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{color:var(--mat-snack-bar-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mat-snack-bar-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mat-snack-bar-container-color, var(--mat-sys-inverse-surface))}.mdc-snackbar__label{width:100%;flex-grow:1;box-sizing:border-box;margin:0;padding:14px 8px 14px 16px}[dir=rtl] .mdc-snackbar__label{padding-left:8px;padding-right:16px}.mat-mdc-snack-bar-container .mdc-snackbar__label{font-family:var(--mat-snack-bar-supporting-text-font, var(--mat-sys-body-medium-font));font-size:var(--mat-snack-bar-supporting-text-size, var(--mat-sys-body-medium-size));font-weight:var(--mat-snack-bar-supporting-text-weight, var(--mat-sys-body-medium-weight));line-height:var(--mat-snack-bar-supporting-text-line-height, var(--mat-sys-body-medium-line-height))}.mat-mdc-snack-bar-actions{display:flex;flex-shrink:0;align-items:center;box-sizing:border-box}.mat-mdc-snack-bar-handset,.mat-mdc-snack-bar-container,.mat-mdc-snack-bar-label{flex:1 1 auto}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled){--mat-button-text-state-layer-color: currentColor;--mat-button-text-ripple-color: currentColor}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled).mat-unthemed{color:var(--mat-snack-bar-button-color, var(--mat-sys-inverse-primary))}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled) .mat-ripple-element{opacity:.1}
|
|
5
|
+
`],encapsulation:2})}return o})();function Xf(){return new Uo}var Kf=new ne("mat-snack-bar-default-options",{providedIn:"root",factory:Xf}),qr=(()=>{class o{_live=m(Wa);_injector=m(be);_breakpointObserver=m(Fm);_parentSnackBar=m(o,{optional:!0,skipSelf:!0});_defaultConfig=m(Kf);_animationsDisabled=He();_snackBarRefAtThisLevel=null;simpleSnackBarComponent=mh;snackBarContainerComponent=Qf;handsetCssClass="mat-mdc-snack-bar-handset";get _openedSnackBarRef(){let e=this._parentSnackBar;return e?e._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(e){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=e:this._snackBarRefAtThisLevel=e}constructor(){}openFromComponent(e,i){return this._attach(e,i)}openFromTemplate(e,i){return this._attach(e,i)}open(e,i="",n){let r=Z(Z({},this._defaultConfig),n);return r.data={message:e,action:i},r.announcementMessage===e&&(r.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,r)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(e,i){let n=i&&i.viewContainerRef&&i.viewContainerRef.injector,r=be.create({parent:n||this._injector,providers:[{provide:Uo,useValue:i}]}),a=new bi(this.snackBarContainerComponent,i.viewContainerRef,r),c=e.attach(a);return c.instance.snackBarConfig=i,c.instance}_attach(e,i){let n=Z(Z(Z({},new Uo),this._defaultConfig),i),r=this._createOverlay(n),a=this._attachSnackBarContainer(r,n),c=new $r(a,r);if(e instanceof Sn){let h=new rn(e,null,{$implicit:n.data,snackBarRef:c});c.instance=a.attachTemplatePortal(h)}else{let h=this._createInjector(n,c),g=new bi(e,void 0,h),b=a.attachComponentPortal(g);c.instance=b.instance}return this._breakpointObserver.observe(zm.HandsetPortrait).pipe(L(r.detachments())).subscribe(h=>{r.overlayElement.classList.toggle(this.handsetCssClass,h.matches)}),n.announcementMessage&&a._onAnnounce.subscribe(()=>{this._live.announce(n.announcementMessage,n.politeness)}),this._animateSnackBar(c,n),this._openedSnackBarRef=c,this._openedSnackBarRef}_animateSnackBar(e,i){e.afterDismissed().subscribe(()=>{this._openedSnackBarRef==e&&(this._openedSnackBarRef=null),i.announcementMessage&&this._live.clear()}),i.duration&&i.duration>0&&e.afterOpened().subscribe(()=>e._dismissAfter(i.duration)),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{e.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):e.containerInstance.enter()}_createOverlay(e){let i=new cn;i.direction=e.direction;let n=Nn(this._injector),r=e.direction==="rtl",a=e.horizontalPosition==="left"||e.horizontalPosition==="start"&&!r||e.horizontalPosition==="end"&&r,c=!a&&e.horizontalPosition!=="center";return a?n.left("0"):c?n.right("0"):n.centerHorizontally(),e.verticalPosition==="top"?n.top("0"):n.bottom("0"),i.positionStrategy=n,i.disableAnimations=this._animationsDisabled,mn(this._injector,i)}_createInjector(e,i){let n=e&&e.viewContainerRef&&e.viewContainerRef.injector;return be.create({parent:n||this._injector,providers:[{provide:$r,useValue:i},{provide:dh,useValue:e.data}]})}static \u0275fac=function(i){return new(i||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var $o=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({providers:[qr],imports:[vi,an,it,ae,mh,ae]})}return o})();function Zf(o,t){}var Ln=class{viewContainerRef;injector;id;role="dialog";panelClass="";hasBackdrop=!0;backdropClass="";disableClose=!1;closePredicate;width="";height="";minWidth;minHeight;maxWidth;maxHeight;positionStrategy;data=null;direction;ariaDescribedBy=null;ariaLabelledBy=null;ariaLabel=null;ariaModal=!1;autoFocus="first-tabbable";restoreFocus=!0;scrollStrategy;closeOnNavigation=!0;closeOnDestroy=!0;closeOnOverlayDetachments=!0;disableAnimations=!1;providers;container;templateContext};var jc=(()=>{class o extends Rn{_elementRef=m(ie);_focusTrapFactory=m(Ha);_config;_interactivityChecker=m(Po);_ngZone=m(de);_focusMonitor=m(Ri);_renderer=m(yt);_changeDetectorRef=m(Ge);_injector=m(be);_platform=m(et);_document=m(Je);_portalOutlet;_focusTrapped=new R;_focusTrap=null;_elementFocusedBeforeDialogWasOpened=null;_closeInteractionType=null;_ariaLabelledByQueue=[];_isDestroyed=!1;constructor(){super(),this._config=m(Ln,{optional:!0})||new Ln,this._config.ariaLabelledBy&&this._ariaLabelledByQueue.push(this._config.ariaLabelledBy)}_addAriaLabelledBy(e){this._ariaLabelledByQueue.push(e),this._changeDetectorRef.markForCheck()}_removeAriaLabelledBy(e){let i=this._ariaLabelledByQueue.indexOf(e);i>-1&&(this._ariaLabelledByQueue.splice(i,1),this._changeDetectorRef.markForCheck())}_contentAttached(){this._initializeFocusTrap(),this._captureInitialFocus()}_captureInitialFocus(){this._trapFocus()}ngOnDestroy(){this._focusTrapped.complete(),this._isDestroyed=!0,this._restoreFocus()}attachComponentPortal(e){this._portalOutlet.hasAttached();let i=this._portalOutlet.attachComponentPortal(e);return this._contentAttached(),i}attachTemplatePortal(e){this._portalOutlet.hasAttached();let i=this._portalOutlet.attachTemplatePortal(e);return this._contentAttached(),i}attachDomPortal=e=>{this._portalOutlet.hasAttached();let i=this._portalOutlet.attachDomPortal(e);return this._contentAttached(),i};_recaptureFocus(){this._containsFocus()||this._trapFocus()}_forceFocus(e,i){this._interactivityChecker.isFocusable(e)||(e.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{let n=()=>{r(),a(),e.removeAttribute("tabindex")},r=this._renderer.listen(e,"blur",n),a=this._renderer.listen(e,"mousedown",n)})),e.focus(i)}_focusByCssSelector(e,i){let n=this._elementRef.nativeElement.querySelector(e);n&&this._forceFocus(n,i)}_trapFocus(e){this._isDestroyed||Dt(()=>{let i=this._elementRef.nativeElement;switch(this._config.autoFocus){case!1:case"dialog":this._containsFocus()||i.focus(e);break;case!0:case"first-tabbable":this._focusTrap?.focusInitialElement(e)||this._focusDialogContainer(e);break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]',e);break;default:this._focusByCssSelector(this._config.autoFocus,e);break}this._focusTrapped.next()},{injector:this._injector})}_restoreFocus(){let e=this._config.restoreFocus,i=null;if(typeof e=="string"?i=this._document.querySelector(e):typeof e=="boolean"?i=e?this._elementFocusedBeforeDialogWasOpened:null:e&&(i=e),this._config.restoreFocus&&i&&typeof i.focus=="function"){let n=za(),r=this._elementRef.nativeElement;(!n||n===this._document.body||n===r||r.contains(n))&&(this._focusMonitor?(this._focusMonitor.focusVia(i,this._closeInteractionType),this._closeInteractionType=null):i.focus())}this._focusTrap&&this._focusTrap.destroy()}_focusDialogContainer(e){this._elementRef.nativeElement.focus?.(e)}_containsFocus(){let e=this._elementRef.nativeElement,i=za();return e===i||e.contains(i)}_initializeFocusTrap(){this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._document&&(this._elementFocusedBeforeDialogWasOpened=za()))}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["cdk-dialog-container"]],viewQuery:function(i,n){if(i&1&&Q(Fn,7),i&2){let r;H(r=W())&&(n._portalOutlet=r.first)}},hostAttrs:["tabindex","-1",1,"cdk-dialog-container"],hostVars:6,hostBindings:function(i,n){i&2&&K("id",n._config.id||null)("role",n._config.role)("aria-modal",n._config.ariaModal)("aria-labelledby",n._config.ariaLabel?null:n._ariaLabelledByQueue[0])("aria-label",n._config.ariaLabel)("aria-describedby",n._config.ariaDescribedBy||null)},features:[Mt],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(i,n){i&1&&$e(0,Zf,0,0,"ng-template",0)},dependencies:[Fn],styles:[`.cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit}
|
|
6
|
+
`],encapsulation:2})}return o})(),Gr=class{overlayRef;config;componentInstance;componentRef;containerInstance;disableClose;closed=new R;backdropClick;keydownEvents;outsidePointerEvents;id;_detachSubscription;constructor(t,e){this.overlayRef=t,this.config=e,this.disableClose=e.disableClose,this.backdropClick=t.backdropClick(),this.keydownEvents=t.keydownEvents(),this.outsidePointerEvents=t.outsidePointerEvents(),this.id=e.id,this.keydownEvents.subscribe(i=>{i.keyCode===27&&!this.disableClose&&!gt(i)&&(i.preventDefault(),this.close(void 0,{focusOrigin:"keyboard"}))}),this.backdropClick.subscribe(()=>{!this.disableClose&&this._canClose()?this.close(void 0,{focusOrigin:"mouse"}):this.containerInstance._recaptureFocus?.()}),this._detachSubscription=t.detachments().subscribe(()=>{e.closeOnOverlayDetachments!==!1&&this.close()})}close(t,e){if(this._canClose(t)){let i=this.closed;this.containerInstance._closeInteractionType=e?.focusOrigin||"program",this._detachSubscription.unsubscribe(),this.overlayRef.dispose(),i.next(t),i.complete(),this.componentInstance=this.containerInstance=null}}updatePosition(){return this.overlayRef.updatePosition(),this}updateSize(t="",e=""){return this.overlayRef.updateSize({width:t,height:e}),this}addPanelClass(t){return this.overlayRef.addPanelClass(t),this}removePanelClass(t){return this.overlayRef.removePanelClass(t),this}_canClose(t){let e=this.config;return!!this.containerInstance&&(!e.closePredicate||e.closePredicate(t,e,this.componentInstance))}},Jf=new ne("DialogScrollStrategy",{providedIn:"root",factory:()=>{let o=m(be);return()=>Wo(o)}}),e_=new ne("DialogData"),t_=new ne("DefaultDialogConfig");function i_(o){let t=Ee(o),e=new U;return{valueSignal:t,get value(){return t()},change:e,ngOnDestroy(){e.complete()}}}var Bc=(()=>{class o{_injector=m(be);_defaultOptions=m(t_,{optional:!0});_parentDialog=m(o,{optional:!0,skipSelf:!0});_overlayContainer=m(Is);_idGenerator=m(Re);_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new R;_afterOpenedAtThisLevel=new R;_ariaHiddenElements=new Map;_scrollStrategy=m(Jf);get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}afterAllClosed=To(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(kt(void 0)));constructor(){}open(e,i){let n=this._defaultOptions||new Ln;i=Z(Z({},n),i),i.id=i.id||this._idGenerator.getId("cdk-dialog-"),i.id&&this.getDialogById(i.id);let r=this._getOverlayConfig(i),a=mn(this._injector,r),c=new Gr(a,i),h=this._attachContainer(a,c,i);if(c.containerInstance=h,!this.openDialogs.length){let g=this._overlayContainer.getContainerElement();h._focusTrapped?h._focusTrapped.pipe(Ut(1)).subscribe(()=>{this._hideNonDialogContentFromAssistiveTechnology(g)}):this._hideNonDialogContentFromAssistiveTechnology(g)}return this._attachDialogContent(e,c,h,i),this.openDialogs.push(c),c.closed.subscribe(()=>this._removeOpenDialog(c,!0)),this.afterOpened.next(c),c}closeAll(){zc(this.openDialogs,e=>e.close())}getDialogById(e){return this.openDialogs.find(i=>i.id===e)}ngOnDestroy(){zc(this._openDialogsAtThisLevel,e=>{e.config.closeOnDestroy===!1&&this._removeOpenDialog(e,!1)}),zc(this._openDialogsAtThisLevel,e=>e.close()),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete(),this._openDialogsAtThisLevel=[]}_getOverlayConfig(e){let i=new cn({positionStrategy:e.positionStrategy||Nn().centerHorizontally().centerVertically(),scrollStrategy:e.scrollStrategy||this._scrollStrategy(),panelClass:e.panelClass,hasBackdrop:e.hasBackdrop,direction:e.direction,minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight,width:e.width,height:e.height,disposeOnNavigation:e.closeOnNavigation,disableAnimations:e.disableAnimations});return e.backdropClass&&(i.backdropClass=e.backdropClass),i}_attachContainer(e,i,n){let r=n.injector||n.viewContainerRef?.injector,a=[{provide:Ln,useValue:n},{provide:Gr,useValue:i},{provide:Bo,useValue:e}],c;n.container?typeof n.container=="function"?c=n.container:(c=n.container.type,a.push(...n.container.providers(n))):c=jc;let h=new bi(c,n.viewContainerRef,be.create({parent:r||this._injector,providers:a}));return e.attach(h).instance}_attachDialogContent(e,i,n,r){if(e instanceof Sn){let a=this._createInjector(r,i,n,void 0),c={$implicit:r.data,dialogRef:i};r.templateContext&&(c=Z(Z({},c),typeof r.templateContext=="function"?r.templateContext():r.templateContext)),n.attachTemplatePortal(new rn(e,null,c,a))}else{let a=this._createInjector(r,i,n,this._injector),c=n.attachComponentPortal(new bi(e,r.viewContainerRef,a));i.componentRef=c,i.componentInstance=c.instance}}_createInjector(e,i,n,r){let a=e.injector||e.viewContainerRef?.injector,c=[{provide:e_,useValue:e.data},{provide:Gr,useValue:i}];return e.providers&&(typeof e.providers=="function"?c.push(...e.providers(i,e,n)):c.push(...e.providers)),e.direction&&(!a||!a.get(ft,null,{optional:!0}))&&c.push({provide:ft,useValue:i_(e.direction)}),be.create({parent:a||r,providers:c})}_removeOpenDialog(e,i){let n=this.openDialogs.indexOf(e);n>-1&&(this.openDialogs.splice(n,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((r,a)=>{r?a.setAttribute("aria-hidden",r):a.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),i&&this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(e){if(e.parentElement){let i=e.parentElement.children;for(let n=i.length-1;n>-1;n--){let r=i[n];r!==e&&r.nodeName!=="SCRIPT"&&r.nodeName!=="STYLE"&&!r.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(r,r.getAttribute("aria-hidden")),r.setAttribute("aria-hidden","true"))}}}_getAfterAllClosed(){let e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}static \u0275fac=function(i){return new(i||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function zc(o,t){let e=o.length;for(;e--;)t(o[e])}var ph=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({providers:[Bc],imports:[vi,an,Oo,an]})}return o})();function n_(o,t){}var Qr=class{viewContainerRef;injector;id;role="dialog";panelClass="";hasBackdrop=!0;backdropClass="";disableClose=!1;closePredicate;width="";height="";minWidth;minHeight;maxWidth;maxHeight;position;data=null;direction;ariaDescribedBy=null;ariaLabelledBy=null;ariaLabel=null;ariaModal=!1;autoFocus="first-tabbable";restoreFocus=!0;delayFocusTrap=!0;scrollStrategy;closeOnNavigation=!0;enterAnimationDuration;exitAnimationDuration},Hc="mdc-dialog--open",hh="mdc-dialog--opening",uh="mdc-dialog--closing",o_=150,r_=75,_h=(()=>{class o extends jc{_animationStateChanged=new U;_animationsEnabled=!He();_actionSectionCount=0;_hostElement=this._elementRef.nativeElement;_enterAnimationDuration=this._animationsEnabled?fh(this._config.enterAnimationDuration)??o_:0;_exitAnimationDuration=this._animationsEnabled?fh(this._config.exitAnimationDuration)??r_:0;_animationTimer=null;_contentAttached(){super._contentAttached(),this._startOpenAnimation()}_startOpenAnimation(){this._animationStateChanged.emit({state:"opening",totalTime:this._enterAnimationDuration}),this._animationsEnabled?(this._hostElement.style.setProperty(gh,`${this._enterAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(hh,Hc)),this._waitForAnimationToComplete(this._enterAnimationDuration,this._finishDialogOpen)):(this._hostElement.classList.add(Hc),Promise.resolve().then(()=>this._finishDialogOpen()))}_startExitAnimation(){this._animationStateChanged.emit({state:"closing",totalTime:this._exitAnimationDuration}),this._hostElement.classList.remove(Hc),this._animationsEnabled?(this._hostElement.style.setProperty(gh,`${this._exitAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(uh)),this._waitForAnimationToComplete(this._exitAnimationDuration,this._finishDialogClose)):Promise.resolve().then(()=>this._finishDialogClose())}_updateActionSectionCount(e){this._actionSectionCount+=e,this._changeDetectorRef.markForCheck()}_finishDialogOpen=()=>{this._clearAnimationClasses(),this._openAnimationDone(this._enterAnimationDuration)};_finishDialogClose=()=>{this._clearAnimationClasses(),this._animationStateChanged.emit({state:"closed",totalTime:this._exitAnimationDuration})};_clearAnimationClasses(){this._hostElement.classList.remove(hh,uh)}_waitForAnimationToComplete(e,i){this._animationTimer!==null&&clearTimeout(this._animationTimer),this._animationTimer=setTimeout(i,e)}_requestAnimationFrame(e){this._ngZone.runOutsideAngular(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()})}_captureInitialFocus(){this._config.delayFocusTrap||this._trapFocus()}_openAnimationDone(e){this._config.delayFocusTrap&&this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:e})}ngOnDestroy(){super.ngOnDestroy(),this._animationTimer!==null&&clearTimeout(this._animationTimer)}attachComponentPortal(e){let i=super.attachComponentPortal(e);return i.location.nativeElement.classList.add("mat-mdc-dialog-component-host"),i}static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275cmp=T({type:o,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1",1,"mat-mdc-dialog-container","mdc-dialog"],hostVars:10,hostBindings:function(i,n){i&2&&(Zt("id",n._config.id),K("aria-modal",n._config.ariaModal)("role",n._config.role)("aria-labelledby",n._config.ariaLabel?null:n._ariaLabelledByQueue[0])("aria-label",n._config.ariaLabel)("aria-describedby",n._config.ariaDescribedBy||null),E("_mat-animation-noopable",!n._animationsEnabled)("mat-mdc-dialog-container-with-actions",n._actionSectionCount>0))},features:[Mt],decls:3,vars:0,consts:[[1,"mat-mdc-dialog-inner-container","mdc-dialog__container"],[1,"mat-mdc-dialog-surface","mdc-dialog__surface"],["cdkPortalOutlet",""]],template:function(i,n){i&1&&(s(0,"div",0)(1,"div",1),$e(2,n_,0,0,"ng-template",2),l()())},dependencies:[Fn],styles:[`.mat-mdc-dialog-container{width:100%;height:100%;display:block;box-sizing:border-box;max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit;outline:0}.cdk-overlay-pane.mat-mdc-dialog-panel{max-width:var(--mat-dialog-container-max-width, 560px);min-width:var(--mat-dialog-container-min-width, 280px)}@media(max-width: 599px){.cdk-overlay-pane.mat-mdc-dialog-panel{max-width:var(--mat-dialog-container-small-max-width, calc(100vw - 32px))}}.mat-mdc-dialog-inner-container{display:flex;flex-direction:row;align-items:center;justify-content:space-around;box-sizing:border-box;height:100%;opacity:0;transition:opacity linear var(--mat-dialog-transition-duration, 0ms);max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit}.mdc-dialog--closing .mat-mdc-dialog-inner-container{transition:opacity 75ms linear;transform:none}.mdc-dialog--open .mat-mdc-dialog-inner-container{opacity:1}._mat-animation-noopable .mat-mdc-dialog-inner-container{transition:none}.mat-mdc-dialog-surface{display:flex;flex-direction:column;flex-grow:0;flex-shrink:0;box-sizing:border-box;width:100%;height:100%;position:relative;overflow-y:auto;outline:0;transform:scale(0.8);transition:transform var(--mat-dialog-transition-duration, 0ms) cubic-bezier(0, 0, 0.2, 1);max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit;box-shadow:var(--mat-dialog-container-elevation-shadow, none);border-radius:var(--mat-dialog-container-shape, var(--mat-sys-corner-extra-large, 4px));background-color:var(--mat-dialog-container-color, var(--mat-sys-surface, white))}[dir=rtl] .mat-mdc-dialog-surface{text-align:right}.mdc-dialog--open .mat-mdc-dialog-surface,.mdc-dialog--closing .mat-mdc-dialog-surface{transform:none}._mat-animation-noopable .mat-mdc-dialog-surface{transition:none}.mat-mdc-dialog-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:2px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mat-mdc-dialog-title{display:block;position:relative;flex-shrink:0;box-sizing:border-box;margin:0 0 1px;padding:var(--mat-dialog-headline-padding, 6px 24px 13px)}.mat-mdc-dialog-title::before{display:inline-block;width:0;height:40px;content:"";vertical-align:0}[dir=rtl] .mat-mdc-dialog-title{text-align:right}.mat-mdc-dialog-container .mat-mdc-dialog-title{color:var(--mat-dialog-subhead-color, var(--mat-sys-on-surface, rgba(0, 0, 0, 0.87)));font-family:var(--mat-dialog-subhead-font, var(--mat-sys-headline-small-font, inherit));line-height:var(--mat-dialog-subhead-line-height, var(--mat-sys-headline-small-line-height, 1.5rem));font-size:var(--mat-dialog-subhead-size, var(--mat-sys-headline-small-size, 1rem));font-weight:var(--mat-dialog-subhead-weight, var(--mat-sys-headline-small-weight, 400));letter-spacing:var(--mat-dialog-subhead-tracking, var(--mat-sys-headline-small-tracking, 0.03125em))}.mat-mdc-dialog-content{display:block;flex-grow:1;box-sizing:border-box;margin:0;overflow:auto;max-height:65vh}.mat-mdc-dialog-content>:first-child{margin-top:0}.mat-mdc-dialog-content>:last-child{margin-bottom:0}.mat-mdc-dialog-container .mat-mdc-dialog-content{color:var(--mat-dialog-supporting-text-color, var(--mat-sys-on-surface-variant, rgba(0, 0, 0, 0.6)));font-family:var(--mat-dialog-supporting-text-font, var(--mat-sys-body-medium-font, inherit));line-height:var(--mat-dialog-supporting-text-line-height, var(--mat-sys-body-medium-line-height, 1.5rem));font-size:var(--mat-dialog-supporting-text-size, var(--mat-sys-body-medium-size, 1rem));font-weight:var(--mat-dialog-supporting-text-weight, var(--mat-sys-body-medium-weight, 400));letter-spacing:var(--mat-dialog-supporting-text-tracking, var(--mat-sys-body-medium-tracking, 0.03125em))}.mat-mdc-dialog-container .mat-mdc-dialog-content{padding:var(--mat-dialog-content-padding, 20px 24px)}.mat-mdc-dialog-container-with-actions .mat-mdc-dialog-content{padding:var(--mat-dialog-with-actions-content-padding, 20px 24px 0)}.mat-mdc-dialog-container .mat-mdc-dialog-title+.mat-mdc-dialog-content{padding-top:0}.mat-mdc-dialog-actions{display:flex;position:relative;flex-shrink:0;flex-wrap:wrap;align-items:center;box-sizing:border-box;min-height:52px;margin:0;border-top:1px solid rgba(0,0,0,0);padding:var(--mat-dialog-actions-padding, 16px 24px);justify-content:var(--mat-dialog-actions-alignment, flex-end)}@media(forced-colors: active){.mat-mdc-dialog-actions{border-top-color:CanvasText}}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-start,.mat-mdc-dialog-actions[align=start]{justify-content:start}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-center,.mat-mdc-dialog-actions[align=center]{justify-content:center}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-end,.mat-mdc-dialog-actions[align=end]{justify-content:flex-end}.mat-mdc-dialog-actions .mat-button-base+.mat-button-base,.mat-mdc-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-mdc-dialog-actions .mat-button-base+.mat-button-base,[dir=rtl] .mat-mdc-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}.mat-mdc-dialog-component-host{display:contents}
|
|
7
|
+
`],encapsulation:2})}return o})(),gh="--mat-dialog-transition-duration";function fh(o){return o==null?null:typeof o=="number"?o:o.endsWith("ms")?gi(o.substring(0,o.length-2)):o.endsWith("s")?gi(o.substring(0,o.length-1))*1e3:o==="0"?0:null}var Yr=(function(o){return o[o.OPEN=0]="OPEN",o[o.CLOSING=1]="CLOSING",o[o.CLOSED=2]="CLOSED",o})(Yr||{}),ei=class{_ref;_config;_containerInstance;componentInstance;componentRef;disableClose;id;_afterOpened=new R;_beforeClosed=new R;_result;_closeFallbackTimeout;_state=Yr.OPEN;_closeInteractionType;constructor(t,e,i){this._ref=t,this._config=e,this._containerInstance=i,this.disableClose=e.disableClose,this.id=t.id,t.addPanelClass("mat-mdc-dialog-panel"),i._animationStateChanged.pipe(ce(n=>n.state==="opened"),Ut(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),i._animationStateChanged.pipe(ce(n=>n.state==="closed"),Ut(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),t.overlayRef.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._finishDialogClose()}),Ai(this.backdropClick(),this.keydownEvents().pipe(ce(n=>n.keyCode===27&&!this.disableClose&&!gt(n)))).subscribe(n=>{this.disableClose||(n.preventDefault(),bh(this,n.type==="keydown"?"keyboard":"mouse"))})}close(t){let e=this._config.closePredicate;e&&!e(t,this._config,this.componentInstance)||(this._result=t,this._containerInstance._animationStateChanged.pipe(ce(i=>i.state==="closing"),Ut(1)).subscribe(i=>{this._beforeClosed.next(t),this._beforeClosed.complete(),this._ref.overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),i.totalTime+100)}),this._state=Yr.CLOSING,this._containerInstance._startExitAnimation())}afterOpened(){return this._afterOpened}afterClosed(){return this._ref.closed}beforeClosed(){return this._beforeClosed}backdropClick(){return this._ref.backdropClick}keydownEvents(){return this._ref.keydownEvents}updatePosition(t){let e=this._ref.config.positionStrategy;return t&&(t.left||t.right)?t.left?e.left(t.left):e.right(t.right):e.centerHorizontally(),t&&(t.top||t.bottom)?t.top?e.top(t.top):e.bottom(t.bottom):e.centerVertically(),this._ref.updatePosition(),this}updateSize(t="",e=""){return this._ref.updateSize(t,e),this}addPanelClass(t){return this._ref.addPanelClass(t),this}removePanelClass(t){return this._ref.removePanelClass(t),this}getState(){return this._state}_finishDialogClose(){this._state=Yr.CLOSED,this._ref.close(this._result,{focusOrigin:this._closeInteractionType}),this.componentInstance=null}};function bh(o,t,e){return o._closeInteractionType=t,o.close(e)}var ji=new ne("MatMdcDialogData"),Rs=new ne("mat-mdc-dialog-default-options"),vh=new ne("mat-mdc-dialog-scroll-strategy",{providedIn:"root",factory:()=>{let o=m(be);return()=>Wo(o)}}),yi=(()=>{class o{_defaultOptions=m(Rs,{optional:!0});_scrollStrategy=m(vh);_parentDialog=m(o,{optional:!0,skipSelf:!0});_idGenerator=m(Re);_injector=m(be);_dialog=m(Bc);_animationsDisabled=He();_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new R;_afterOpenedAtThisLevel=new R;dialogConfigClass=Qr;_dialogRefConstructor;_dialogContainerType;_dialogDataToken;get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}_getAfterAllClosed(){let e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}afterAllClosed=To(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(kt(void 0)));constructor(){this._dialogRefConstructor=ei,this._dialogContainerType=_h,this._dialogDataToken=ji}open(e,i){let n;i=Z(Z({},this._defaultOptions||new Qr),i),i.id=i.id||this._idGenerator.getId("mat-mdc-dialog-"),i.scrollStrategy=i.scrollStrategy||this._scrollStrategy();let r=this._dialog.open(e,ut(Z({},i),{positionStrategy:Nn(this._injector).centerHorizontally().centerVertically(),disableClose:!0,closePredicate:void 0,closeOnDestroy:!1,closeOnOverlayDetachments:!1,disableAnimations:this._animationsDisabled||i.enterAnimationDuration?.toLocaleString()==="0"||i.exitAnimationDuration?.toString()==="0",container:{type:this._dialogContainerType,providers:()=>[{provide:this.dialogConfigClass,useValue:i},{provide:Ln,useValue:i}]},templateContext:()=>({dialogRef:n}),providers:(a,c,h)=>(n=new this._dialogRefConstructor(a,i,h),n.updatePosition(i?.position),[{provide:this._dialogContainerType,useValue:h},{provide:this._dialogDataToken,useValue:c.data},{provide:this._dialogRefConstructor,useValue:n}])}));return n.componentRef=r.componentRef,n.componentInstance=r.componentInstance,this.openDialogs.push(n),this.afterOpened.next(n),n.afterClosed().subscribe(()=>{let a=this.openDialogs.indexOf(n);a>-1&&(this.openDialogs.splice(a,1),this.openDialogs.length||this._getAfterAllClosed().next())}),n}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(e){return this.openDialogs.find(i=>i.id===e)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_closeDialogs(e){let i=e.length;for(;i--;)e[i].close()}static \u0275fac=function(i){return new(i||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var yh=(()=>{class o{_dialogRef=m(ei,{optional:!0});_elementRef=m(ie);_dialog=m(yi);constructor(){}ngOnInit(){this._dialogRef||(this._dialogRef=a_(this._elementRef,this._dialog.openDialogs)),this._dialogRef&&Promise.resolve().then(()=>{this._onAdd()})}ngOnDestroy(){this._dialogRef?._containerInstance&&Promise.resolve().then(()=>{this._onRemove()})}static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o})}return o})(),pn=(()=>{class o extends yh{id=m(Re).getId("mat-mdc-dialog-title-");_onAdd(){this._dialogRef._containerInstance?._addAriaLabelledBy?.(this.id)}_onRemove(){this._dialogRef?._containerInstance?._removeAriaLabelledBy?.(this.id)}static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275dir=Ce({type:o,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-mdc-dialog-title","mdc-dialog__title"],hostVars:1,hostBindings:function(i,n){i&2&&Zt("id",n.id)},inputs:{id:"id"},exportAs:["matDialogTitle"],features:[Mt]})}return o})(),hn=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-mdc-dialog-content","mdc-dialog__content"],features:[fm([ln])]})}return o})(),un=(()=>{class o extends yh{align;_onAdd(){this._dialogRef._containerInstance?._updateActionSectionCount?.(1)}_onRemove(){this._dialogRef._containerInstance?._updateActionSectionCount?.(-1)}static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275dir=Ce({type:o,selectors:[["","mat-dialog-actions",""],["mat-dialog-actions"],["","matDialogActions",""]],hostAttrs:[1,"mat-mdc-dialog-actions","mdc-dialog__actions"],hostVars:6,hostBindings:function(i,n){i&2&&E("mat-mdc-dialog-actions-align-start",n.align==="start")("mat-mdc-dialog-actions-align-center",n.align==="center")("mat-mdc-dialog-actions-align-end",n.align==="end")},inputs:{align:"align"},features:[Mt]})}return o})();function a_(o,t){let e=o.nativeElement.parentElement;for(;e&&!e.classList.contains("mat-mdc-dialog-container");)e=e.parentElement;return e?t.find(i=>i.id===e.id):null}var ao=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({providers:[yi],imports:[ph,vi,an,ae,ae]})}return o})();function Gc(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var lo=Gc();function Th(o){lo=o}var Jr={exec:()=>null};function Me(o,t=""){let e=typeof o=="string"?o:o.source,i={replace:(n,r)=>{let a=typeof r=="string"?r:r.source;return a=a.replace(Ft.caret,"$1"),e=e.replace(n,a),i},getRegex:()=>new RegExp(e,t)};return i}var Ft={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:o=>new RegExp(`^( {0,3}${o})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}#`),htmlBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}<(?:[a-z].*>|!--)`,"i")},s_=/^(?:[ \t]*(?:\n|$))+/,l_=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,c_=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ea=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,d_=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Yc=/(?:[*+-]|\d{1,9}[.)])/,Eh=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ph=Me(Eh).replace(/bull/g,Yc).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),m_=Me(Eh).replace(/bull/g,Yc).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Qc=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,p_=/^[^\n]+/,Xc=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,h_=Me(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Xc).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),u_=Me(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Yc).getRegex(),Vs="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Kc=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,g_=Me("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Kc).replace("tag",Vs).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Oh=Me(Qc).replace("hr",ea).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Vs).getRegex(),f_=Me(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Oh).getRegex(),Zc={blockquote:f_,code:l_,def:h_,fences:c_,heading:d_,hr:ea,html:g_,lheading:Ph,list:u_,newline:s_,paragraph:Oh,table:Jr,text:p_},Ch=Me("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ea).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Vs).getRegex(),__=ut(Z({},Zc),{lheading:m_,table:Ch,paragraph:Me(Qc).replace("hr",ea).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ch).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Vs).getRegex()}),b_=ut(Z({},Zc),{html:Me(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Kc).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Jr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Me(Qc).replace("hr",ea).replace("heading",` *#{1,6} *[^
|
|
8
8
|
]`).replace("lheading",Ph).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),v_=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,y_=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ah=/^( {2,}|\\)\n(?!\s*$)/,C_=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,zs=/[\p{P}\p{S}]/u,Jc=/[\s\p{P}\p{S}]/u,Ih=/[^\s\p{P}\p{S}]/u,x_=Me(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Jc).getRegex(),Dh=/(?!~)[\p{P}\p{S}]/u,w_=/(?!~)[\s\p{P}\p{S}]/u,S_=/(?:[^\s\p{P}\p{S}]|~)/u,k_=/\[(?:[^\[\]`]|`[^`]*?`)*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,Rh=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,M_=Me(Rh,"u").replace(/punct/g,zs).getRegex(),T_=Me(Rh,"u").replace(/punct/g,Dh).getRegex(),Fh="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",E_=Me(Fh,"gu").replace(/notPunctSpace/g,Ih).replace(/punctSpace/g,Jc).replace(/punct/g,zs).getRegex(),P_=Me(Fh,"gu").replace(/notPunctSpace/g,S_).replace(/punctSpace/g,w_).replace(/punct/g,Dh).getRegex(),O_=Me("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ih).replace(/punctSpace/g,Jc).replace(/punct/g,zs).getRegex(),A_=Me(/\\(punct)/,"gu").replace(/punct/g,zs).getRegex(),I_=Me(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),D_=Me(Kc).replace("(?:-->|$)","-->").getRegex(),R_=Me("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",D_).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ns=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,F_=Me(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Ns).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Nh=Me(/^!?\[(label)\]\[(ref)\]/).replace("label",Ns).replace("ref",Xc).getRegex(),Lh=Me(/^!?\[(ref)\](?:\[\])?/).replace("ref",Xc).getRegex(),N_=Me("reflink|nolink(?!\\()","g").replace("reflink",Nh).replace("nolink",Lh).getRegex(),xh=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ed={_backpedal:Jr,anyPunctuation:A_,autolink:I_,blockSkip:k_,br:Ah,code:y_,del:Jr,emStrongLDelim:M_,emStrongRDelimAst:E_,emStrongRDelimUnd:O_,escape:v_,link:F_,nolink:Lh,punctuation:x_,reflink:Nh,reflinkSearch:N_,tag:R_,text:C_,url:Jr},L_=ut(Z({},ed),{link:Me(/^!?\[(label)\]\((.*?)\)/).replace("label",Ns).getRegex(),reflink:Me(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ns).getRegex()}),Uc=ut(Z({},ed),{emStrongRDelimAst:P_,emStrongLDelim:T_,url:Me(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",xh).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Me(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",xh).getRegex()}),V_=ut(Z({},Uc),{br:Me(Ah).replace("{2,}","*").getRegex(),text:Me(Uc.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),Fs={normal:Zc,gfm:__,pedantic:b_},Xr={normal:ed,gfm:Uc,breaks:V_,pedantic:L_},z_={"&":"&","<":"<",">":">",'"':""","'":"'"},wh=o=>z_[o];function Bi(o,t){if(t){if(Ft.escapeTest.test(o))return o.replace(Ft.escapeReplace,wh)}else if(Ft.escapeTestNoEncode.test(o))return o.replace(Ft.escapeReplaceNoEncode,wh);return o}function Sh(o){try{o=encodeURI(o).replace(Ft.percentDecode,"%")}catch{return null}return o}function kh(o,t){let e=o.replace(Ft.findPipe,(r,a,c)=>{let h=!1,g=a;for(;--g>=0&&c[g]==="\\";)h=!h;return h?"|":" |"}),i=e.split(Ft.splitPipe),n=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace(Ft.slashPipe,"|");return i}function Kr(o,t,e){let i=o.length;if(i===0)return"";let n=0;for(;n<i;){let r=o.charAt(i-n-1);if(r===t&&!e)n++;else if(r!==t&&e)n++;else break}return o.slice(0,i-n)}function j_(o,t){if(o.indexOf(t[1])===-1)return-1;let e=0;for(let i=0;i<o.length;i++)if(o[i]==="\\")i++;else if(o[i]===t[0])e++;else if(o[i]===t[1]&&(e--,e<0))return i;return e>0?-2:-1}function Mh(o,t,e,i,n){let r=t.href,a=t.title||null,c=o[1].replace(n.other.outputLinkReplace,"$1");i.state.inLink=!0;let h={type:o[0].charAt(0)==="!"?"image":"link",raw:e,href:r,title:a,text:c,tokens:i.inlineTokens(c)};return i.state.inLink=!1,h}function B_(o,t,e){let i=o.match(e.other.indentCodeCompensation);if(i===null)return t;let n=i[1];return t.split(`
|
|
9
9
|
`).map(r=>{let a=r.match(e.other.beginningSpace);if(a===null)return r;let[c]=a;return c.length>=n.length?r.slice(n.length):r}).join(`
|
|
10
10
|
`)}var Ls=class{options;rules;lexer;constructor(o){this.options=o||lo}space(o){let t=this.rules.block.newline.exec(o);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(o){let t=this.rules.block.code.exec(o);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Kr(e,`
|
|
@@ -17,9 +17,9 @@ import{a as Hm,b as Se}from"./chunk-KJ4PW3PQ.js";import{a as Do,b as Wm,c as Le,
|
|
|
17
17
|
${g}`:g,n=n?`${n}
|
|
18
18
|
${b}`:b;let S=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(b,r,!0),this.lexer.state.top=S,e.length===0)break;let P=r.at(-1);if(P?.type==="code")break;if(P?.type==="blockquote"){let N=P,k=N.raw+`
|
|
19
19
|
`+e.join(`
|
|
20
|
-
`),
|
|
20
|
+
`),A=this.blockquote(k);r[r.length-1]=A,i=i.substring(0,i.length-N.raw.length)+A.raw,n=n.substring(0,n.length-N.text.length)+A.text;break}else if(P?.type==="list"){let N=P,k=N.raw+`
|
|
21
21
|
`+e.join(`
|
|
22
|
-
`),
|
|
22
|
+
`),A=this.list(k);r[r.length-1]=A,i=i.substring(0,i.length-P.raw.length)+A.raw,n=n.substring(0,n.length-N.raw.length)+A.raw,e=k.substring(r.at(-1).raw.length).split(`
|
|
23
23
|
`);continue}}return{type:"blockquote",raw:i,tokens:r,text:n}}}list(o){let t=this.rules.block.list.exec(o);if(t){let e=t[1].trim(),i=e.length>1,n={type:"list",raw:"",ordered:i,start:i?+e.slice(0,-1):"",loose:!1,items:[]};e=i?`\\d{1,9}\\${e.slice(-1)}`:`\\${e}`,this.options.pedantic&&(e=i?e:"[*+-]");let r=this.rules.other.listItemRegex(e),a=!1;for(;o;){let h=!1,g="",b="";if(!(t=r.exec(o))||this.rules.block.hr.test(o))break;g=t[0],o=o.substring(g.length);let S=t[2].split(`
|
|
24
24
|
`,1)[0].replace(this.rules.other.listReplaceTabs,ke=>" ".repeat(3*ke.length)),P=o.split(`
|
|
25
25
|
`,1)[0],N=!S.trim(),k=0;if(this.options.pedantic?(k=2,b=S.trimStart()):N?k=t[1].length+1:(k=t[2].search(this.rules.other.nonSpaceChar),k=k>4?1:k,b=S.slice(k),k+=t[1].length),N&&this.rules.other.blankLine.test(P)&&(g+=P+`
|
|
@@ -27,7 +27,7 @@ ${b}`:b;let S=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
27
27
|
`,1)[0],Ze;if(P=pt,this.options.pedantic?(P=P.replace(this.rules.other.listReplaceNesting," "),Ze=P):Ze=P.replace(this.rules.other.tabCharGlobal," "),Ke.test(P)||ge.test(P)||Bt.test(P)||ke.test(P)||ve.test(P))break;if(Ze.search(this.rules.other.nonSpaceChar)>=k||!P.trim())b+=`
|
|
28
28
|
`+Ze.slice(k);else{if(N||S.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||Ke.test(S)||ge.test(S)||ve.test(S))break;b+=`
|
|
29
29
|
`+P}!N&&!P.trim()&&(N=!0),g+=pt+`
|
|
30
|
-
`,o=o.substring(pt.length+1),S=Ze.slice(k)}}n.loose||(a?n.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(a=!0));let
|
|
30
|
+
`,o=o.substring(pt.length+1),S=Ze.slice(k)}}n.loose||(a?n.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(a=!0));let A=null,pe;this.options.gfm&&(A=this.rules.other.listIsTask.exec(b),A&&(pe=A[0]!=="[ ] ",b=b.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:g,task:!!A,checked:pe,loose:!1,text:b,tokens:[]}),n.raw+=g}let c=n.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let h=0;h<n.items.length;h++)if(this.lexer.state.top=!1,n.items[h].tokens=this.lexer.blockTokens(n.items[h].text,[]),!n.loose){let g=n.items[h].tokens.filter(S=>S.type==="space"),b=g.length>0&&g.some(S=>this.rules.other.anyLine.test(S.raw));n.loose=b}if(n.loose)for(let h=0;h<n.items.length;h++)n.items[h].loose=!0;return n}}html(o){let t=this.rules.block.html.exec(o);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(o){let t=this.rules.block.def.exec(o);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:i,title:n}}}table(o){let t=this.rules.block.table.exec(o);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let e=kh(t[1]),i=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
31
31
|
`):[],r={type:"table",raw:t[0],header:[],align:[],rows:[]};if(e.length===i.length){for(let a of i)this.rules.other.tableAlignRight.test(a)?r.align.push("right"):this.rules.other.tableAlignCenter.test(a)?r.align.push("center"):this.rules.other.tableAlignLeft.test(a)?r.align.push("left"):r.align.push(null);for(let a=0;a<e.length;a++)r.header.push({text:e[a],tokens:this.lexer.inline(e[a]),header:!0,align:r.align[a]});for(let a of n)r.rows.push(kh(a,r.header.length).map((c,h)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:r.align[h]})));return r}}lheading(o){let t=this.rules.block.lheading.exec(o);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(o){let t=this.rules.block.paragraph.exec(o);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
32
32
|
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(o){let t=this.rules.block.text.exec(o);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(o){let t=this.rules.inline.escape.exec(o);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(o){let t=this.rules.inline.tag.exec(o);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(o){let t=this.rules.inline.link.exec(o);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let r=Kr(e.slice(0,-1),"\\");if((e.length-r.length)%2===0)return}else{let r=j_(t[2],"()");if(r===-2)return;if(r>-1){let a=(t[0].indexOf("!")===0?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let i=t[2],n="";if(this.options.pedantic){let r=this.rules.other.pedanticHrefTitle.exec(i);r&&(i=r[1],n=r[3])}else n=t[3]?t[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?i=i.slice(1):i=i.slice(1,-1)),Mh(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(o,t){let e;if((e=this.rules.inline.reflink.exec(o))||(e=this.rules.inline.nolink.exec(o))){let i=(e[2]||e[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=t[i.toLowerCase()];if(!n){let r=e[0].charAt(0);return{type:"text",raw:r,text:r}}return Mh(e,n,e[0],this.lexer,this.rules)}}emStrong(o,t,e=""){let i=this.rules.inline.emStrongLDelim.exec(o);if(!(!i||i[3]&&e.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!e||this.rules.inline.punctuation.exec(e))){let n=[...i[0]].length-1,r,a,c=n,h=0,g=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(g.lastIndex=0,t=t.slice(-1*o.length+n);(i=g.exec(t))!=null;){if(r=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!r)continue;if(a=[...r].length,i[3]||i[4]){c+=a;continue}else if((i[5]||i[6])&&n%3&&!((n+a)%3)){h+=a;continue}if(c-=a,c>0)continue;a=Math.min(a,a+c+h);let b=[...i[0]][0].length,S=o.slice(0,n+i.index+b+a);if(Math.min(n,a)%2){let N=S.slice(1,-1);return{type:"em",raw:S,text:N,tokens:this.lexer.inlineTokens(N)}}let P=S.slice(2,-2);return{type:"strong",raw:S,text:P,tokens:this.lexer.inlineTokens(P)}}}}codespan(o){let t=this.rules.inline.code.exec(o);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(e),n=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return i&&n&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(o){let t=this.rules.inline.br.exec(o);if(t)return{type:"br",raw:t[0]}}del(o){let t=this.rules.inline.del.exec(o);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(o){let t=this.rules.inline.autolink.exec(o);if(t){let e,i;return t[2]==="@"?(e=t[1],i="mailto:"+e):(e=t[1],i=e),{type:"link",raw:t[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}url(o){let t;if(t=this.rules.inline.url.exec(o)){let e,i;if(t[2]==="@")e=t[0],i="mailto:"+e;else{let n;do n=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(n!==t[0]);e=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(o){let t=this.rules.inline.text.exec(o);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},Ci=class $c{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||lo,this.options.tokenizer=this.options.tokenizer||new Ls,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let e={other:Ft,block:Fs.normal,inline:Xr.normal};this.options.pedantic?(e.block=Fs.pedantic,e.inline=Xr.pedantic):this.options.gfm&&(e.block=Fs.gfm,this.options.breaks?e.inline=Xr.breaks:e.inline=Xr.gfm),this.tokenizer.rules=e}static get rules(){return{block:Fs,inline:Xr}}static lex(t,e){return new $c(e).lex(t)}static lexInline(t,e){return new $c(e).inlineTokens(t)}lex(t){t=t.replace(Ft.carriageReturn,`
|
|
33
33
|
`),this.blockTokens(t,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let i=this.inlineQueue[e];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,e=[],i=!1){for(this.options.pedantic&&(t=t.replace(Ft.tabCharGlobal," ").replace(Ft.spaceLine,""));t;){let n;if(this.options.extensions?.block?.some(a=>(n=a.call({lexer:this},t,e))?(t=t.substring(n.raw.length),e.push(n),!0):!1))continue;if(n=this.tokenizer.space(t)){t=t.substring(n.raw.length);let a=e.at(-1);n.raw.length===1&&a!==void 0?a.raw+=`
|
|
@@ -63,9 +63,9 @@ ${o}</tr>
|
|
|
63
63
|
`}tablecell(o){let t=this.parser.parseInline(o.tokens),e=o.header?"th":"td";return(o.align?`<${e} align="${o.align}">`:`<${e}>`)+t+`</${e}>
|
|
64
64
|
`}strong({tokens:o}){return`<strong>${this.parser.parseInline(o)}</strong>`}em({tokens:o}){return`<em>${this.parser.parseInline(o)}</em>`}codespan({text:o}){return`<code>${Bi(o,!0)}</code>`}br(o){return"<br>"}del({tokens:o}){return`<del>${this.parser.parseInline(o)}</del>`}link({href:o,title:t,tokens:e}){let i=this.parser.parseInline(e),n=Sh(o);if(n===null)return i;o=n;let r='<a href="'+o+'"';return t&&(r+=' title="'+Bi(t)+'"'),r+=">"+i+"</a>",r}image({href:o,title:t,text:e,tokens:i}){i&&(e=this.parser.parseInline(i,this.parser.textRenderer));let n=Sh(o);if(n===null)return Bi(e);o=n;let r=`<img src="${o}" alt="${e}"`;return t&&(r+=` title="${Bi(t)}"`),r+=">",r}text(o){return"tokens"in o&&o.tokens?this.parser.parseInline(o.tokens):"escaped"in o&&o.escaped?o.text:Bi(o.text)}},td=class{strong({text:o}){return o}em({text:o}){return o}codespan({text:o}){return o}del({text:o}){return o}html({text:o}){return o}text({text:o}){return o}link({text:o}){return""+o}image({text:o}){return""+o}br(){return""}},xi=class qc{options;renderer;textRenderer;constructor(t){this.options=t||lo,this.options.renderer=this.options.renderer||new qo,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new td}static parse(t,e){return new qc(e).parse(t)}static parseInline(t,e){return new qc(e).parseInline(t)}parse(t,e=!0){let i="";for(let n=0;n<t.length;n++){let r=t[n];if(this.options.extensions?.renderers?.[r.type]){let c=r,h=this.options.extensions.renderers[c.type].call({parser:this},c);if(h!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){i+=h||"";continue}}let a=r;switch(a.type){case"space":{i+=this.renderer.space(a);continue}case"hr":{i+=this.renderer.hr(a);continue}case"heading":{i+=this.renderer.heading(a);continue}case"code":{i+=this.renderer.code(a);continue}case"table":{i+=this.renderer.table(a);continue}case"blockquote":{i+=this.renderer.blockquote(a);continue}case"list":{i+=this.renderer.list(a);continue}case"html":{i+=this.renderer.html(a);continue}case"def":{i+=this.renderer.def(a);continue}case"paragraph":{i+=this.renderer.paragraph(a);continue}case"text":{let c=a,h=this.renderer.text(c);for(;n+1<t.length&&t[n+1].type==="text";)c=t[++n],h+=`
|
|
65
65
|
`+this.renderer.text(c);e?i+=this.renderer.paragraph({type:"paragraph",raw:h,text:h,tokens:[{type:"text",raw:h,text:h,escaped:!0}]}):i+=h;continue}default:{let c='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return i}parseInline(t,e=this.renderer){let i="";for(let n=0;n<t.length;n++){let r=t[n];if(this.options.extensions?.renderers?.[r.type]){let c=this.options.extensions.renderers[r.type].call({parser:this},r);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)){i+=c||"";continue}}let a=r;switch(a.type){case"escape":{i+=e.text(a);break}case"html":{i+=e.html(a);break}case"link":{i+=e.link(a);break}case"image":{i+=e.image(a);break}case"strong":{i+=e.strong(a);break}case"em":{i+=e.em(a);break}case"codespan":{i+=e.codespan(a);break}case"br":{i+=e.br(a);break}case"del":{i+=e.del(a);break}case"text":{i+=e.text(a);break}default:{let c='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return i}},Zr=class{options;block;constructor(o){this.options=o||lo}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(o){return o}postprocess(o){return o}processAllTokens(o){return o}emStrongMask(o){return o}provideLexer(){return this.block?Ci.lex:Ci.lexInline}provideParser(){return this.block?xi.parse:xi.parseInline}},H_=class{defaults=Gc();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=xi;Renderer=qo;TextRenderer=td;Lexer=Ci;Tokenizer=Ls;Hooks=Zr;constructor(...o){this.use(...o)}walkTokens(o,t){let e=[];for(let i of o)switch(e=e.concat(t.call(this,i)),i.type){case"table":{let n=i;for(let r of n.header)e=e.concat(this.walkTokens(r.tokens,t));for(let r of n.rows)for(let a of r)e=e.concat(this.walkTokens(a.tokens,t));break}case"list":{let n=i;e=e.concat(this.walkTokens(n.items,t));break}default:{let n=i;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(r=>{let a=n[r].flat(1/0);e=e.concat(this.walkTokens(a,t))}):n.tokens&&(e=e.concat(this.walkTokens(n.tokens,t)))}}return e}use(...o){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return o.forEach(e=>{let i=Z({},e);if(i.async=this.defaults.async||i.async||!1,e.extensions&&(e.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let r=t.renderers[n.name];r?t.renderers[n.name]=function(...a){let c=n.renderer.apply(this,a);return c===!1&&(c=r.apply(this,a)),c}:t.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=t[n.level];r?r.unshift(n.tokenizer):t[n.level]=[n.tokenizer],n.start&&(n.level==="block"?t.startBlock?t.startBlock.push(n.start):t.startBlock=[n.start]:n.level==="inline"&&(t.startInline?t.startInline.push(n.start):t.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(t.childTokens[n.name]=n.childTokens)}),i.extensions=t),e.renderer){let n=this.defaults.renderer||new qo(this.defaults);for(let r in e.renderer){if(!(r in n))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let a=r,c=e.renderer[a],h=n[a];n[a]=(...g)=>{let b=c.apply(n,g);return b===!1&&(b=h.apply(n,g)),b||""}}i.renderer=n}if(e.tokenizer){let n=this.defaults.tokenizer||new Ls(this.defaults);for(let r in e.tokenizer){if(!(r in n))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let a=r,c=e.tokenizer[a],h=n[a];n[a]=(...g)=>{let b=c.apply(n,g);return b===!1&&(b=h.apply(n,g)),b}}i.tokenizer=n}if(e.hooks){let n=this.defaults.hooks||new Zr;for(let r in e.hooks){if(!(r in n))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let a=r,c=e.hooks[a],h=n[a];Zr.passThroughHooks.has(r)?n[a]=g=>{if(this.defaults.async&&Zr.passThroughHooksRespectAsync.has(r))return ee(this,null,function*(){let S=yield c.call(n,g);return h.call(n,S)});let b=c.call(n,g);return h.call(n,b)}:n[a]=(...g)=>{if(this.defaults.async)return ee(this,null,function*(){let S=yield c.apply(n,g);return S===!1&&(S=yield h.apply(n,g)),S});let b=c.apply(n,g);return b===!1&&(b=h.apply(n,g)),b}}i.hooks=n}if(e.walkTokens){let n=this.defaults.walkTokens,r=e.walkTokens;i.walkTokens=function(a){let c=[];return c.push(r.call(this,a)),n&&(c=c.concat(n.call(this,a))),c}}this.defaults=Z(Z({},this.defaults),i)}),this}setOptions(o){return this.defaults=Z(Z({},this.defaults),o),this}lexer(o,t){return Ci.lex(o,t??this.defaults)}parser(o,t){return xi.parse(o,t??this.defaults)}parseMarkdown(o){return(t,e)=>{let i=Z({},e),n=Z(Z({},this.defaults),i),r=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&i.async===!1)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=o),n.async)return ee(this,null,function*(){let a=n.hooks?yield n.hooks.preprocess(t):t,c=yield(n.hooks?yield n.hooks.provideLexer():o?Ci.lex:Ci.lexInline)(a,n),h=n.hooks?yield n.hooks.processAllTokens(c):c;n.walkTokens&&(yield Promise.all(this.walkTokens(h,n.walkTokens)));let g=yield(n.hooks?yield n.hooks.provideParser():o?xi.parse:xi.parseInline)(h,n);return n.hooks?yield n.hooks.postprocess(g):g}).catch(r);try{n.hooks&&(t=n.hooks.preprocess(t));let a=(n.hooks?n.hooks.provideLexer():o?Ci.lex:Ci.lexInline)(t,n);n.hooks&&(a=n.hooks.processAllTokens(a)),n.walkTokens&&this.walkTokens(a,n.walkTokens);let c=(n.hooks?n.hooks.provideParser():o?xi.parse:xi.parseInline)(a,n);return n.hooks&&(c=n.hooks.postprocess(c)),c}catch(a){return r(a)}}}onError(o,t){return e=>{if(e.message+=`
|
|
66
|
-
Please report this to https://github.com/markedjs/marked.`,o){let i="<p>An error occurred:</p><pre>"+Bi(e.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(e);throw e}}},so=new H_;function Ae(o,t){return so.parse(o,t)}Ae.options=Ae.setOptions=function(o){return so.setOptions(o),Ae.defaults=so.defaults,Th(Ae.defaults),Ae};Ae.getDefaults=Gc;Ae.defaults=lo;Ae.use=function(...o){return so.use(...o),Ae.defaults=so.defaults,Th(Ae.defaults),Ae};Ae.walkTokens=function(o,t){return so.walkTokens(o,t)};Ae.parseInline=so.parseInline;Ae.Parser=xi;Ae.parser=xi.parse;Ae.Renderer=qo;Ae.TextRenderer=td;Ae.Lexer=Ci;Ae.lexer=Ci.lex;Ae.Tokenizer=Ls;Ae.Hooks=Zr;Ae.parse=Ae;var Ck=Ae.options,xk=Ae.setOptions,wk=Ae.use,Sk=Ae.walkTokens,kk=Ae.parseInline;var Mk=xi.parse,Tk=Ci.lex;var{entries:qh,setPrototypeOf:Vh,isFrozen:W_,getPrototypeOf:U_,getOwnPropertyDescriptor:$_}=Object,{freeze:Lt,seal:ai,create:ld}=Object,{apply:cd,construct:dd}=typeof Reflect<"u"&&Reflect;Lt||(Lt=function(t){return t});ai||(ai=function(t){return t});cd||(cd=function(t,e){for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];return t.apply(e,n)});dd||(dd=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return new t(...i)});var js=Vt(Array.prototype.forEach),q_=Vt(Array.prototype.lastIndexOf),zh=Vt(Array.prototype.pop),ta=Vt(Array.prototype.push),G_=Vt(Array.prototype.splice),Hs=Vt(String.prototype.toLowerCase),id=Vt(String.prototype.toString),nd=Vt(String.prototype.match),ia=Vt(String.prototype.replace),Y_=Vt(String.prototype.indexOf),Q_=Vt(String.prototype.trim),wi=Vt(Object.prototype.hasOwnProperty),Nt=Vt(RegExp.prototype.test),na=X_(TypeError);function Vt(o){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return cd(o,t,i)}}function X_(o){return function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return dd(o,e)}}function ue(o,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Hs;Vh&&Vh(o,null);let i=t.length;for(;i--;){let n=t[i];if(typeof n=="string"){let r=e(n);r!==n&&(W_(t)||(t[i]=r),n=r)}o[n]=!0}return o}function K_(o){for(let t=0;t<o.length;t++)wi(o,t)||(o[t]=null);return o}function Hi(o){let t=ld(null);for(let[e,i]of qh(o))wi(o,e)&&(Array.isArray(i)?t[e]=K_(i):i&&typeof i=="object"&&i.constructor===Object?t[e]=Hi(i):t[e]=i);return t}function oa(o,t){for(;o!==null;){let i=$_(o,t);if(i){if(i.get)return Vt(i.get);if(typeof i.value=="function")return Vt(i.value)}o=U_(o)}function e(){return null}return e}var jh=Lt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),od=Lt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),rd=Lt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Z_=Lt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ad=Lt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),J_=Lt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Bh=Lt(["#text"]),Hh=Lt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),sd=Lt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Wh=Lt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Bs=Lt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),eb=ai(/\{\{[\w\W]*|[\w\W]*\}\}/gm),tb=ai(/<%[\w\W]*|[\w\W]*%>/gm),ib=ai(/\$\{[\w\W]*/gm),nb=ai(/^data-[\-\w.\u00B7-\uFFFF]+$/),ob=ai(/^aria-[\-\w]+$/),Gh=ai(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),rb=ai(/^(?:\w+script|data):/i),ab=ai(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Yh=ai(/^html$/i),sb=ai(/^[a-z][.\w]*(-[.\w]+)+$/i),Uh=Object.freeze({__proto__:null,ARIA_ATTR:ob,ATTR_WHITESPACE:ab,CUSTOM_ELEMENT:sb,DATA_ATTR:nb,DOCTYPE_NAME:Yh,ERB_EXPR:tb,IS_ALLOWED_URI:Gh,IS_SCRIPT_OR_DATA:rb,MUSTACHE_EXPR:eb,TMPLIT_EXPR:ib}),ra={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},lb=function(){return typeof window>"u"?null:window},cb=function(t,e){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,n="data-tt-policy-suffix";e&&e.hasAttribute(n)&&(i=e.getAttribute(n));let r="dompurify"+(i?"#"+i:"");try{return t.createPolicy(r,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},$h=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Qh(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:lb(),t=Y=>Qh(Y);if(t.version="3.3.1",t.removed=[],!o||!o.document||o.document.nodeType!==ra.document||!o.Element)return t.isSupported=!1,t;let{document:e}=o,i=e,n=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:a,Node:c,Element:h,NodeFilter:g,NamedNodeMap:b=o.NamedNodeMap||o.MozNamedAttrMap,HTMLFormElement:S,DOMParser:P,trustedTypes:N}=o,k=h.prototype,I=oa(k,"cloneNode"),pe=oa(k,"remove"),ke=oa(k,"nextSibling"),ve=oa(k,"childNodes"),Ke=oa(k,"parentNode");if(typeof a=="function"){let Y=e.createElement("template");Y.content&&Y.content.ownerDocument&&(e=Y.content.ownerDocument)}let ge,Bt="",{implementation:pt,createNodeIterator:Ze,createDocumentFragment:xt,getElementsByTagName:Xi}=e,{importNode:Cn}=i,ht=$h();t.isSupported=typeof qh=="function"&&typeof Ke=="function"&&pt&&pt.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:mi,ERB_EXPR:Wn,TMPLIT_EXPR:bo,DATA_ATTR:ya,ARIA_ATTR:$,IS_SCRIPT_OR_DATA:G,ATTR_WHITESPACE:K,CUSTOM_ELEMENT:fe}=Uh,{IS_ALLOWED_URI:ot}=Uh,De=null,wt=ue({},[...jh,...od,...rd,...ad,...Bh]),Fe=null,Ne=ue({},[...Hh,...sd,...Wh,...Bs]),We=Object.seal(ld(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Un=null,at=null,Ht=Object.seal(ld(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),At=!0,xn=!0,vo=!1,Vd=!0,yo=!1,Ca=!0,$n=!1,Nl=!1,Ll=!1,Co=!1,xa=!1,wa=!1,zd=!0,jd=!1,Sg="user-content-",Vl=!0,Sr=!1,xo={},Ti=null,zl=ue({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Bd=null,Hd=ue({},["audio","video","img","source","image","track"]),jl=null,Wd=ue({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Sa="http://www.w3.org/1998/Math/MathML",ka="http://www.w3.org/2000/svg",Ki="http://www.w3.org/1999/xhtml",wo=Ki,Bl=!1,Hl=null,kg=ue({},[Sa,ka,Ki],id),Ma=ue({},["mi","mo","mn","ms","mtext"]),Ta=ue({},["annotation-xml"]),Mg=ue({},["title","style","font","a","script"]),kr=null,Tg=["application/xhtml+xml","text/html"],Eg="text/html",dt=null,So=null,Pg=e.createElement("form"),Ud=function(f){return f instanceof RegExp||f instanceof Function},Wl=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(So&&So===f)){if((!f||typeof f!="object")&&(f={}),f=Hi(f),kr=Tg.indexOf(f.PARSER_MEDIA_TYPE)===-1?Eg:f.PARSER_MEDIA_TYPE,dt=kr==="application/xhtml+xml"?id:Hs,De=wi(f,"ALLOWED_TAGS")?ue({},f.ALLOWED_TAGS,dt):wt,Fe=wi(f,"ALLOWED_ATTR")?ue({},f.ALLOWED_ATTR,dt):Ne,Hl=wi(f,"ALLOWED_NAMESPACES")?ue({},f.ALLOWED_NAMESPACES,id):kg,jl=wi(f,"ADD_URI_SAFE_ATTR")?ue(Hi(Wd),f.ADD_URI_SAFE_ATTR,dt):Wd,Bd=wi(f,"ADD_DATA_URI_TAGS")?ue(Hi(Hd),f.ADD_DATA_URI_TAGS,dt):Hd,Ti=wi(f,"FORBID_CONTENTS")?ue({},f.FORBID_CONTENTS,dt):zl,Un=wi(f,"FORBID_TAGS")?ue({},f.FORBID_TAGS,dt):Hi({}),at=wi(f,"FORBID_ATTR")?ue({},f.FORBID_ATTR,dt):Hi({}),xo=wi(f,"USE_PROFILES")?f.USE_PROFILES:!1,At=f.ALLOW_ARIA_ATTR!==!1,xn=f.ALLOW_DATA_ATTR!==!1,vo=f.ALLOW_UNKNOWN_PROTOCOLS||!1,Vd=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,yo=f.SAFE_FOR_TEMPLATES||!1,Ca=f.SAFE_FOR_XML!==!1,$n=f.WHOLE_DOCUMENT||!1,Co=f.RETURN_DOM||!1,xa=f.RETURN_DOM_FRAGMENT||!1,wa=f.RETURN_TRUSTED_TYPE||!1,Ll=f.FORCE_BODY||!1,zd=f.SANITIZE_DOM!==!1,jd=f.SANITIZE_NAMED_PROPS||!1,Vl=f.KEEP_CONTENT!==!1,Sr=f.IN_PLACE||!1,ot=f.ALLOWED_URI_REGEXP||Gh,wo=f.NAMESPACE||Ki,Ma=f.MATHML_TEXT_INTEGRATION_POINTS||Ma,Ta=f.HTML_INTEGRATION_POINTS||Ta,We=f.CUSTOM_ELEMENT_HANDLING||{},f.CUSTOM_ELEMENT_HANDLING&&Ud(f.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(We.tagNameCheck=f.CUSTOM_ELEMENT_HANDLING.tagNameCheck),f.CUSTOM_ELEMENT_HANDLING&&Ud(f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(We.attributeNameCheck=f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(We.allowCustomizedBuiltInElements=f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),yo&&(xn=!1),xa&&(Co=!0),xo&&(De=ue({},Bh),Fe=[],xo.html===!0&&(ue(De,jh),ue(Fe,Hh)),xo.svg===!0&&(ue(De,od),ue(Fe,sd),ue(Fe,Bs)),xo.svgFilters===!0&&(ue(De,rd),ue(Fe,sd),ue(Fe,Bs)),xo.mathMl===!0&&(ue(De,ad),ue(Fe,Wh),ue(Fe,Bs))),f.ADD_TAGS&&(typeof f.ADD_TAGS=="function"?Ht.tagCheck=f.ADD_TAGS:(De===wt&&(De=Hi(De)),ue(De,f.ADD_TAGS,dt))),f.ADD_ATTR&&(typeof f.ADD_ATTR=="function"?Ht.attributeCheck=f.ADD_ATTR:(Fe===Ne&&(Fe=Hi(Fe)),ue(Fe,f.ADD_ATTR,dt))),f.ADD_URI_SAFE_ATTR&&ue(jl,f.ADD_URI_SAFE_ATTR,dt),f.FORBID_CONTENTS&&(Ti===zl&&(Ti=Hi(Ti)),ue(Ti,f.FORBID_CONTENTS,dt)),f.ADD_FORBID_CONTENTS&&(Ti===zl&&(Ti=Hi(Ti)),ue(Ti,f.ADD_FORBID_CONTENTS,dt)),Vl&&(De["#text"]=!0),$n&&ue(De,["html","head","body"]),De.table&&(ue(De,["tbody"]),delete Un.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw na('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw na('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');ge=f.TRUSTED_TYPES_POLICY,Bt=ge.createHTML("")}else ge===void 0&&(ge=cb(N,n)),ge!==null&&typeof Bt=="string"&&(Bt=ge.createHTML(""));Lt&&Lt(f),So=f}},$d=ue({},[...od,...rd,...Z_]),qd=ue({},[...ad,...J_]),Og=function(f){let O=Ke(f);(!O||!O.tagName)&&(O={namespaceURI:wo,tagName:"template"});let q=Hs(f.tagName),Ue=Hs(O.tagName);return Hl[f.namespaceURI]?f.namespaceURI===ka?O.namespaceURI===Ki?q==="svg":O.namespaceURI===Sa?q==="svg"&&(Ue==="annotation-xml"||Ma[Ue]):!!$d[q]:f.namespaceURI===Sa?O.namespaceURI===Ki?q==="math":O.namespaceURI===ka?q==="math"&&Ta[Ue]:!!qd[q]:f.namespaceURI===Ki?O.namespaceURI===ka&&!Ta[Ue]||O.namespaceURI===Sa&&!Ma[Ue]?!1:!qd[q]&&(Mg[q]||!$d[q]):!!(kr==="application/xhtml+xml"&&Hl[f.namespaceURI]):!1},Ei=function(f){ta(t.removed,{element:f});try{Ke(f).removeChild(f)}catch{pe(f)}},qn=function(f,O){try{ta(t.removed,{attribute:O.getAttributeNode(f),from:O})}catch{ta(t.removed,{attribute:null,from:O})}if(O.removeAttribute(f),f==="is")if(Co||xa)try{Ei(O)}catch{}else try{O.setAttribute(f,"")}catch{}},Gd=function(f){let O=null,q=null;if(Ll)f="<remove></remove>"+f;else{let st=nd(f,/^[\r\n\t ]+/);q=st&&st[0]}kr==="application/xhtml+xml"&&wo===Ki&&(f='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+f+"</body></html>");let Ue=ge?ge.createHTML(f):f;if(wo===Ki)try{O=new P().parseFromString(Ue,kr)}catch{}if(!O||!O.documentElement){O=pt.createDocument(wo,"template",null);try{O.documentElement.innerHTML=Bl?Bt:Ue}catch{}}let St=O.body||O.documentElement;return f&&q&&St.insertBefore(e.createTextNode(q),St.childNodes[0]||null),wo===Ki?Xi.call(O,$n?"html":"body")[0]:$n?O.documentElement:St},Yd=function(f){return Ze.call(f.ownerDocument||f,f,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},Ul=function(f){return f instanceof S&&(typeof f.nodeName!="string"||typeof f.textContent!="string"||typeof f.removeChild!="function"||!(f.attributes instanceof b)||typeof f.removeAttribute!="function"||typeof f.setAttribute!="function"||typeof f.namespaceURI!="string"||typeof f.insertBefore!="function"||typeof f.hasChildNodes!="function")},Qd=function(f){return typeof c=="function"&&f instanceof c};function Zi(Y,f,O){js(Y,q=>{q.call(t,f,O,So)})}let Xd=function(f){let O=null;if(Zi(ht.beforeSanitizeElements,f,null),Ul(f))return Ei(f),!0;let q=dt(f.nodeName);if(Zi(ht.uponSanitizeElement,f,{tagName:q,allowedTags:De}),Ca&&f.hasChildNodes()&&!Qd(f.firstElementChild)&&Nt(/<[/\w!]/g,f.innerHTML)&&Nt(/<[/\w!]/g,f.textContent)||f.nodeType===ra.progressingInstruction||Ca&&f.nodeType===ra.comment&&Nt(/<[/\w]/g,f.data))return Ei(f),!0;if(!(Ht.tagCheck instanceof Function&&Ht.tagCheck(q))&&(!De[q]||Un[q])){if(!Un[q]&&Zd(q)&&(We.tagNameCheck instanceof RegExp&&Nt(We.tagNameCheck,q)||We.tagNameCheck instanceof Function&&We.tagNameCheck(q)))return!1;if(Vl&&!Ti[q]){let Ue=Ke(f)||f.parentNode,St=ve(f)||f.childNodes;if(St&&Ue){let st=St.length;for(let Wt=st-1;Wt>=0;--Wt){let Ji=I(St[Wt],!0);Ji.__removalCount=(f.__removalCount||0)+1,Ue.insertBefore(Ji,ke(f))}}}return Ei(f),!0}return f instanceof h&&!Og(f)||(q==="noscript"||q==="noembed"||q==="noframes")&&Nt(/<\/no(script|embed|frames)/i,f.innerHTML)?(Ei(f),!0):(yo&&f.nodeType===ra.text&&(O=f.textContent,js([mi,Wn,bo],Ue=>{O=ia(O,Ue," ")}),f.textContent!==O&&(ta(t.removed,{element:f.cloneNode()}),f.textContent=O)),Zi(ht.afterSanitizeElements,f,null),!1)},Kd=function(f,O,q){if(zd&&(O==="id"||O==="name")&&(q in e||q in Pg))return!1;if(!(xn&&!at[O]&&Nt(ya,O))){if(!(At&&Nt($,O))){if(!(Ht.attributeCheck instanceof Function&&Ht.attributeCheck(O,f))){if(!Fe[O]||at[O]){if(!(Zd(f)&&(We.tagNameCheck instanceof RegExp&&Nt(We.tagNameCheck,f)||We.tagNameCheck instanceof Function&&We.tagNameCheck(f))&&(We.attributeNameCheck instanceof RegExp&&Nt(We.attributeNameCheck,O)||We.attributeNameCheck instanceof Function&&We.attributeNameCheck(O,f))||O==="is"&&We.allowCustomizedBuiltInElements&&(We.tagNameCheck instanceof RegExp&&Nt(We.tagNameCheck,q)||We.tagNameCheck instanceof Function&&We.tagNameCheck(q))))return!1}else if(!jl[O]){if(!Nt(ot,ia(q,K,""))){if(!((O==="src"||O==="xlink:href"||O==="href")&&f!=="script"&&Y_(q,"data:")===0&&Bd[f])){if(!(vo&&!Nt(G,ia(q,K,"")))){if(q)return!1}}}}}}}return!0},Zd=function(f){return f!=="annotation-xml"&&nd(f,fe)},Jd=function(f){Zi(ht.beforeSanitizeAttributes,f,null);let{attributes:O}=f;if(!O||Ul(f))return;let q={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Fe,forceKeepAttr:void 0},Ue=O.length;for(;Ue--;){let St=O[Ue],{name:st,namespaceURI:Wt,value:Ji}=St,ko=dt(st),$l=Ji,bt=st==="value"?$l:Q_($l);if(q.attrName=ko,q.attrValue=bt,q.keepAttr=!0,q.forceKeepAttr=void 0,Zi(ht.uponSanitizeAttribute,f,q),bt=q.attrValue,jd&&(ko==="id"||ko==="name")&&(qn(st,f),bt=Sg+bt),Ca&&Nt(/((--!?|])>)|<\/(style|title|textarea)/i,bt)){qn(st,f);continue}if(ko==="attributename"&&nd(bt,"href")){qn(st,f);continue}if(q.forceKeepAttr)continue;if(!q.keepAttr){qn(st,f);continue}if(!Vd&&Nt(/\/>/i,bt)){qn(st,f);continue}yo&&js([mi,Wn,bo],tm=>{bt=ia(bt,tm," ")});let em=dt(f.nodeName);if(!Kd(em,ko,bt)){qn(st,f);continue}if(ge&&typeof N=="object"&&typeof N.getAttributeType=="function"&&!Wt)switch(N.getAttributeType(em,ko)){case"TrustedHTML":{bt=ge.createHTML(bt);break}case"TrustedScriptURL":{bt=ge.createScriptURL(bt);break}}if(bt!==$l)try{Wt?f.setAttributeNS(Wt,st,bt):f.setAttribute(st,bt),Ul(f)?Ei(f):zh(t.removed)}catch{qn(st,f)}}Zi(ht.afterSanitizeAttributes,f,null)},Ag=function Y(f){let O=null,q=Yd(f);for(Zi(ht.beforeSanitizeShadowDOM,f,null);O=q.nextNode();)Zi(ht.uponSanitizeShadowNode,O,null),Xd(O),Jd(O),O.content instanceof r&&Y(O.content);Zi(ht.afterSanitizeShadowDOM,f,null)};return t.sanitize=function(Y){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O=null,q=null,Ue=null,St=null;if(Bl=!Y,Bl&&(Y="<!-->"),typeof Y!="string"&&!Qd(Y))if(typeof Y.toString=="function"){if(Y=Y.toString(),typeof Y!="string")throw na("dirty is not a string, aborting")}else throw na("toString is not a function");if(!t.isSupported)return Y;if(Nl||Wl(f),t.removed=[],typeof Y=="string"&&(Sr=!1),Sr){if(Y.nodeName){let Ji=dt(Y.nodeName);if(!De[Ji]||Un[Ji])throw na("root node is forbidden and cannot be sanitized in-place")}}else if(Y instanceof c)O=Gd("<!---->"),q=O.ownerDocument.importNode(Y,!0),q.nodeType===ra.element&&q.nodeName==="BODY"||q.nodeName==="HTML"?O=q:O.appendChild(q);else{if(!Co&&!yo&&!$n&&Y.indexOf("<")===-1)return ge&&wa?ge.createHTML(Y):Y;if(O=Gd(Y),!O)return Co?null:wa?Bt:""}O&&Ll&&Ei(O.firstChild);let st=Yd(Sr?Y:O);for(;Ue=st.nextNode();)Xd(Ue),Jd(Ue),Ue.content instanceof r&&Ag(Ue.content);if(Sr)return Y;if(Co){if(xa)for(St=xt.call(O.ownerDocument);O.firstChild;)St.appendChild(O.firstChild);else St=O;return(Fe.shadowroot||Fe.shadowrootmode)&&(St=Cn.call(i,St,!0)),St}let Wt=$n?O.outerHTML:O.innerHTML;return $n&&De["!doctype"]&&O.ownerDocument&&O.ownerDocument.doctype&&O.ownerDocument.doctype.name&&Nt(Yh,O.ownerDocument.doctype.name)&&(Wt="<!DOCTYPE "+O.ownerDocument.doctype.name+`>
|
|
67
|
-
`+Wt),yo&&js([mi,Wn,bo],Ji=>{Wt=ia(Wt,Ji," ")}),ge&&wa?ge.createHTML(Wt):Wt},t.setConfig=function(){let Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Wl(Y),Nl=!0},t.clearConfig=function(){So=null,Nl=!1},t.isValidAttribute=function(Y,f,O){So||Wl({});let q=dt(Y),Ue=dt(f);return Kd(q,Ue,O)},t.addHook=function(Y,f){typeof f=="function"&&ta(ht[Y],f)},t.removeHook=function(Y,f){if(f!==void 0){let O=q_(ht[Y],f);return O===-1?void 0:G_(ht[Y],O,1)[0]}return zh(ht[Y])},t.removeHooks=function(Y){ht[Y]=[]},t.removeAllHooks=function(){ht=$h()},t}var Xh=Qh();var Wi=class o{renderer;constructor(){this.renderer=new qo,this.configureRenderer()}configureRenderer(){let t=this.renderer.link.bind(this.renderer);this.renderer.link=e=>{let i=this.isExternalLink(e.href),n=t(e);if(i){n=n.replace("<a ",'<a target="_blank" rel="noopener noreferrer" ');let r=e.title?`${e.text} - ${e.title} (opens in new tab)`:`${e.text} (opens in new tab)`;n=n.replace("<a ",`<a aria-label="${this.escapeHtml(r)}" `),n=n.replace("</a>",'<span class="external-link-icon" aria-hidden="true">\u2197</span></a>')}return n}}isExternalLink(t){if(!t||t.startsWith("/")||t.startsWith("#")||t.startsWith("?"))return!1;if(t.startsWith("//"))return!0;try{return new URL(t,window.location.href).hostname!==window.location.hostname}catch{return!1}}escapeHtml(t){let e={"&":"&","<":"<",">":">",'"':""","'":"'"};return t.replace(/[&<>"']/g,i=>e[i]||i)}parse(t){return ee(this,null,function*(){let e=yield Ae.parse(t,{renderer:this.renderer,breaks:!0,gfm:!0});return Xh.sanitize(e,{ADD_TAGS:["span"],ADD_ATTR:["aria-hidden","aria-label","target","rel"],ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))/i})})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var db=["buttonContainer"],mb=["freeTextInput"],pb=(o,t)=>t.value;function hb(o,t){o&1&&(s(0,"mat-icon",10),p(1,"keyboard_return"),l())}function ub(o,t){if(o&1){let e=M();s(0,"button",8),_("click",function(){let n=v(e).$implicit,r=u(2);return y(r.onOptionClick(n.value))}),s(1,"span",9),p(2),l(),C(3,hb,2,0,"mat-icon",10),l()}if(o&2){let e=t.$implicit,i=t.$index,n=u(2);E("highlighted",i===n.highlightedIndex),w("disabled",e.disabled)("id","choice-option-"+i),X("aria-selected",i===n.highlightedIndex),d(2),F(e.label),d(),x(i===n.highlightedIndex?3:-1)}}function gb(o,t){if(o&1){let e=M();s(0,"div",6)(1,"span",11),p(2,"Or type your own answer:"),l(),s(3,"div",12)(4,"input",13,1),B("ngModelChange",function(n){v(e);let r=u(2);return j(r.freeTextValue,n)||(r.freeTextValue=n),y(n)}),_("keydown",function(n){v(e);let r=u(2);return y(r.onFreeTextKeyDown(n))}),l(),s(6,"button",14),_("click",function(){v(e);let n=u(2);return y(n.onFreeTextSubmit())}),s(7,"mat-icon"),p(8,"send"),l()()()()}if(o&2){let e=u(2);d(4),z("ngModel",e.freeTextValue),d(2),w("disabled",!e.freeTextValue.trim())}}function fb(o,t){if(o&1&&(s(0,"div",7)(1,"mat-icon"),p(2,"search"),l(),s(3,"span"),p(4),l()()),o&2){let e=u(2);d(4),F(e.searchText)}}function _b(o,t){if(o&1){let e=M();s(0,"div",2),A(1,"div",3),Jn(2,"async"),s(3,"div",4,0),_("keydown",function(n){v(e);let r=u();return y(r.onKeyDown(n))}),xe(5,ub,4,7,"button",5,pb),l(),C(7,gb,9,2,"div",6),C(8,fb,5,1,"div",7),l()}if(o&2){let e=u();d(),w("innerHTML",Cm(2,4,e.renderedLabel$),Kt),d(2),X("aria-activedescendant","choice-option-"+e.highlightedIndex),d(2),we(e.options),d(2),x(e.allowFreeText?7:-1),d(),x(e.searchText?8:-1)}}var Go=class o{options=[];allowFreeText=!1;set labelHtml(t){typeof t=="object"?this.renderedLabelSubject.next(t):this.renderLabelMarkdown(t)}isVisible=!1;choiceSelected=new U;buttonContainer;freeTextInput;highlightedIndex=0;searchText="";freeTextValue="";searchTimeout;destroy$=new R;renderedLabelSubject=new le("");renderedLabel$=this.renderedLabelSubject.asObservable();sanitizer=m(Di);markdownService=m(Wi);ngOnDestroy(){this.renderedLabelSubject.complete(),this.destroy$.next(),this.destroy$.complete(),this.searchTimeout&&clearTimeout(this.searchTimeout)}ngAfterViewInit(){this.isVisible&&this.buttonContainer&&setTimeout(()=>this.focusContainer(),100)}ngOnChanges(t){t.isVisible&&t.isVisible.currentValue&&!t.isVisible.previousValue&&(this.highlightedIndex=0,setTimeout(()=>this.focusContainer(),150)),t.options&&!t.options.firstChange&&(this.highlightedIndex=0,this.searchText="",this.freeTextValue="")}focusContainer(){this.buttonContainer?.nativeElement&&this.buttonContainer.nativeElement.focus()}onKeyDown(t){if(this.options.filter(i=>!i.disabled).length!==0)switch(t.key){case"ArrowDown":t.preventDefault(),this.moveHighlight(1);break;case"ArrowUp":t.preventDefault(),this.moveHighlight(-1);break;case"Enter":case" ":t.preventDefault(),this.selectHighlighted();break;case"Home":t.preventDefault(),this.highlightFirst();break;case"End":t.preventDefault(),this.highlightLast();break;case"Escape":t.preventDefault();break;default:t.key.length===1&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&this.handleTypeAhead(t.key);break}}moveHighlight(t){let e=this.options.map((r,a)=>({opt:r,idx:a})).filter(({opt:r})=>!r.disabled).map(({idx:r})=>r);if(e.length===0)return;let n=e.findIndex(r=>r===this.highlightedIndex)+t;if(n>=0&&n<e.length){let r=e[n];r!==void 0&&(this.highlightedIndex=r,this.scrollToHighlighted())}else if(t===1&&n>=e.length){let r=e[0];r!==void 0&&(this.highlightedIndex=r,this.scrollToHighlighted())}else if(t===-1&&n<0){let r=e[e.length-1];r!==void 0&&(this.highlightedIndex=r,this.scrollToHighlighted())}}highlightFirst(){let t=this.options.findIndex(e=>!e.disabled);t>=0&&(this.highlightedIndex=t,this.scrollToHighlighted())}highlightLast(){let t=this.options.map((e,i)=>({opt:e,idx:i})).filter(({opt:e})=>!e.disabled).map(({idx:e})=>e);if(t.length>0){let e=t[t.length-1];e!==void 0&&(this.highlightedIndex=e,this.scrollToHighlighted())}}scrollToHighlighted(){setTimeout(()=>{let t=document.getElementById("choice-option-"+this.highlightedIndex);t&&t.scrollIntoView({block:"nearest",behavior:"smooth"})},0)}selectHighlighted(){let t=this.options[this.highlightedIndex];t&&!t.disabled&&this.onOptionClick(t.value)}handleTypeAhead(t){this.searchText+=t.toLowerCase();let e=this.options.findIndex(i=>!i.disabled&&i.label.toLowerCase().startsWith(this.searchText));e>=0&&(this.highlightedIndex=e,this.scrollToHighlighted()),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchText=""},1e3)}onOptionClick(t){this.choiceSelected.emit(t)}onFreeTextSubmit(){let t=this.freeTextValue.trim();t&&(this.freeTextValue="",this.choiceSelected.emit(t))}onFreeTextKeyDown(t){t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),this.onFreeTextSubmit())}renderLabelMarkdown(t){return ee(this,null,function*(){if(!t){this.renderedLabelSubject.next(this.sanitizer.bypassSecurityTrustHtml(""));return}try{let e=yield this.markdownService.parse(t);this.renderedLabelSubject.next(this.sanitizer.bypassSecurityTrustHtml(e))}catch(e){console.error("[CHOICE-SELECT] Error parsing label markdown:",e),this.renderedLabelSubject.next(this.sanitizer.bypassSecurityTrustHtml(t))}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-choice-select"]],viewQuery:function(e,i){if(e&1&&(Q(db,5),Q(mb,5)),e&2){let n;H(n=W())&&(i.buttonContainer=n.first),H(n=W())&&(i.freeTextInput=n.first)}},inputs:{options:"options",allowFreeText:"allowFreeText",labelHtml:"labelHtml",isVisible:"isVisible"},outputs:{choiceSelected:"choiceSelected"},features:[tt],decls:1,vars:1,consts:[["buttonContainer",""],["freeTextInput",""],[1,"choice-container"],[1,"choice-label",3,"innerHTML"],["role","listbox","tabindex","0",1,"choice-buttons",3,"keydown"],["type","button","role","option",1,"choice-button",3,"highlighted","disabled","id"],[1,"free-text-section"],[1,"search-indicator"],["type","button","role","option",1,"choice-button",3,"click","disabled","id"],[1,"choice-button-label"],[1,"choice-button-icon"],[1,"free-text-hint"],[1,"free-text-input-row"],["type","text","placeholder","Type a custom answer\u2026","aria-label","Custom answer",1,"free-text-input",3,"ngModelChange","keydown","ngModel"],["type","button","aria-label","Send custom answer",1,"free-text-send-btn",3,"click","disabled"]],template:function(e,i){e&1&&C(0,_b,9,6,"div",2),e&2&&x(i.isVisible?0:-1)},dependencies:[Oe,he,je,Le,Ve,ze,Tm],styles:[".choice-container[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:1rem}.choice-label[_ngcontent-%COMP%]{display:block;font-weight:500;color:var(--color-text);font-size:1rem;line-height:1.5}.choice-label[_ngcontent-%COMP%] p{margin:0 0 .5rem}.choice-label[_ngcontent-%COMP%] p:last-child{margin-bottom:0}.choice-label[_ngcontent-%COMP%] code{background:var(--color-code-bg);padding:.2em .4em;border-radius:4px;font-family:monospace;font-size:.9em}.choice-label[_ngcontent-%COMP%] strong{font-weight:600}.choice-buttons[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;max-height:400px;overflow-y:auto;padding:.5rem;background:var(--color-background);border:2px solid var(--color-border);border-radius:12px;outline:none}.choice-buttons[_ngcontent-%COMP%]:focus-within{border-color:var(--color-primary);box-shadow:0 0 0 3px #007aff1a}.choice-buttons[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.choice-buttons[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:var(--color-background);border-radius:4px}.choice-buttons[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-border);border-radius:4px}.choice-buttons[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text-secondary)}.choice-button[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;width:100%;padding:.75rem 1rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-background);color:var(--color-text);font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,system-ui,sans-serif;font-size:1rem;text-align:left;cursor:pointer;transition:all .2s ease}.choice-button[_ngcontent-%COMP%]:hover:not(:disabled):not(.highlighted){background:var(--color-bg-hover);border-color:var(--color-primary);transform:translate(2px)}.choice-button.highlighted[_ngcontent-%COMP%]{background:var(--color-primary);color:#fff;border-color:var(--color-primary);box-shadow:0 2px 8px #007aff4d}.choice-button.highlighted[_ngcontent-%COMP%] .choice-button-icon[_ngcontent-%COMP%]{color:#fff}.choice-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.choice-button[_ngcontent-%COMP%]:focus{outline:none}.choice-button-label[_ngcontent-%COMP%]{flex:1;line-height:1.5}.choice-button-icon[_ngcontent-%COMP%]{flex-shrink:0;margin-left:.5rem;font-size:1.2rem;width:1.2rem;height:1.2rem}.free-text-section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.free-text-hint[_ngcontent-%COMP%]{font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.free-text-input-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.free-text-input[_ngcontent-%COMP%]{flex:1;padding:.625rem .875rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-background);color:var(--color-text);font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,system-ui,sans-serif;font-size:1rem;outline:none;transition:border-color .2s ease,box-shadow .2s ease}.free-text-input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary);box-shadow:0 0 0 3px #007aff1a}.free-text-input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);opacity:.7}.free-text-send-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;flex-shrink:0;border:none;border-radius:8px;background:var(--color-primary);color:#fff;cursor:pointer;transition:background .2s ease,opacity .2s ease}.free-text-send-btn[_ngcontent-%COMP%]:hover:not(:disabled){opacity:.9}.free-text-send-btn[_ngcontent-%COMP%]:disabled{opacity:.4;cursor:not-allowed}.free-text-send-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.2rem;width:1.2rem;height:1.2rem}.search-indicator[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem;background:var(--color-primary);color:#fff;border-radius:8px;font-size:.9rem;font-weight:500;animation:_ngcontent-%COMP%_fadeIn .2s ease}.search-indicator[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1rem;width:1rem;height:1rem;color:#fff}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 480px){.choice-container[_ngcontent-%COMP%]{gap:.75rem}.choice-label[_ngcontent-%COMP%]{font-size:.95rem}.choice-buttons[_ngcontent-%COMP%]{max-height:300px;gap:.375rem}.choice-button[_ngcontent-%COMP%]{font-size:.95rem;padding:.625rem .875rem}}@media print{.choice-buttons[_ngcontent-%COMP%]{max-height:none;overflow:visible}.search-indicator[_ngcontent-%COMP%]{display:none!important}}"]})};var Yo=class o{welcomeMessages=["Welcome to Coday","Bienvenue sur Coday","Bienvenido a Coday","Willkommen bei Coday","Benvenuto su Coday","Bem-vindo ao Coday","Welkom bij Coday","\u0414\u043E\u0431\u0440\u043E \u043F\u043E\u0436\u0430\u043B\u043E\u0432\u0430\u0442\u044C \u0432 Coday","Coday \u3078\u3088\u3046\u3053\u305D","\u6B22\u8FCE\u6765\u5230 Coday","Coday \uC5D0 \uC624\uC2E0 \uAC83\uC744 \uD658\uC601\uD569\uB2C8\uB2E4","\u0645\u0631\u062D\u0628\u064B\u0627 \u0628\u0643 \u0641\u064A Coday"];currentWelcomeIndex=0;currentWelcomeMessage=this.welcomeMessages[0];welcomeRotationInterval;ngOnInit(){this.startWelcomeRotation()}ngOnDestroy(){this.stopWelcomeRotation()}startWelcomeRotation(){this.welcomeRotationInterval=window.setInterval(()=>{this.currentWelcomeIndex=(this.currentWelcomeIndex+1)%this.welcomeMessages.length,this.currentWelcomeMessage=this.welcomeMessages[this.currentWelcomeIndex]},3e3)}stopWelcomeRotation(){this.welcomeRotationInterval&&(clearInterval(this.welcomeRotationInterval),this.welcomeRotationInterval=void 0)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-welcome-message"]],decls:2,vars:1,consts:[[1,"welcome-title"]],template:function(e,i){e&1&&(ii(0,"h1",0),p(1),ni()),e&2&&(d(),F(i.currentWelcomeMessage))},styles:[".welcome-title[_ngcontent-%COMP%]{font-size:clamp(2.5rem,6vw,4rem);font-weight:700;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% auto;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:_ngcontent-%COMP%_gradientShift 3s ease-in-out infinite;margin:0;padding:0;line-height:1.2;transition:opacity .5s ease-in-out;display:inline-block;min-height:1.2em}@media (max-width: 768px){.welcome-title[_ngcontent-%COMP%]{font-size:clamp(2rem,5vw,3rem)}}@media (max-width: 480px){.welcome-title[_ngcontent-%COMP%]{font-size:clamp(1.5rem,4vw,2rem)}}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0% center}50%{background-position:100% center}to{background-position:0% center}}"]})};var bb=["inputElement"];function vb(o,t){if(o&1&&(s(0,"span",3),p(1),l()),o&2){let e=u();d(),F(e.label)}}function yb(o,t){if(o&1&&(s(0,"small",5),p(1),l()),o&2){let e=u();d(),F(e.hint)}}var Ws=class o{label="";placeholder="";hint="";isDisabled=!1;value="";autoFocus=!0;valueChange=new U;enterPressed=new U;inputElement;inputValue="";ngAfterViewInit(){this.inputValue=this.value,this.autoFocus&&setTimeout(()=>this.inputElement?.nativeElement.focus(),100)}onValueChange(t){this.valueChange.emit(t)}onEnter(){this.inputValue.trim()&&this.enterPressed.emit(this.inputValue.trim())}focus(){this.inputElement?.nativeElement.focus()}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-text-input"]],viewQuery:function(e,i){if(e&1&&Q(bb,5),e&2){let n;H(n=W())&&(i.inputElement=n.first)}},inputs:{label:"label",placeholder:"placeholder",hint:"hint",isDisabled:"isDisabled",value:"value",autoFocus:"autoFocus"},outputs:{valueChange:"valueChange",enterPressed:"enterPressed"},decls:6,vars:5,consts:[["inputElement",""],[1,"text-input-container"],[1,"text-input-wrapper"],[1,"text-input-label"],["type","text",1,"text-input-field",3,"ngModelChange","keydown.enter","ngModel","placeholder","disabled"],[1,"text-input-hint"]],template:function(e,i){if(e&1){let n=M();s(0,"div",1)(1,"label",2),C(2,vb,2,1,"span",3),s(3,"input",4,0),B("ngModelChange",function(a){return v(n),j(i.inputValue,a)||(i.inputValue=a),y(a)}),_("ngModelChange",function(a){return v(n),y(i.onValueChange(a))})("keydown.enter",function(){return v(n),y(i.onEnter())}),l()(),C(5,yb,2,1,"small",5),l()}e&2&&(d(2),x(i.label?2:-1),d(),z("ngModel",i.inputValue),w("placeholder",i.placeholder)("disabled",i.isDisabled),d(2),x(i.hint?5:-1))},dependencies:[je,Le,Ve,ze,Pe],styles:[".text-input-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%}.text-input-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%;cursor:text}.text-input-label[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text);margin:0}.text-input-field[_ngcontent-%COMP%]{width:100%;padding:.75rem 1rem;font-size:1rem;color:var(--color-text);background:var(--color-bg);border:1px solid var(--color-border);border-radius:8px;outline:none;transition:all .2s ease}.text-input-field[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);opacity:.7}.text-input-field[_ngcontent-%COMP%]:focus{border-color:var(--color-primary);box-shadow:0 0 0 3px rgba(var(--color-primary-rgb),.1)}.text-input-field[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed;background:var(--color-surface)}.text-input-hint[_ngcontent-%COMP%]{font-size:.85rem;color:var(--color-text-secondary);margin:0;font-style:italic}@media (max-width: 768px){.text-input-field[_ngcontent-%COMP%]{padding:.65rem .85rem;font-size:.95rem}.text-input-label[_ngcontent-%COMP%]{font-size:.9rem}.text-input-hint[_ngcontent-%COMP%]{font-size:.8rem}}"]})};var Cb=["nameInput"],xb=["pathInput"];function wb(o,t){if(o&1&&(s(0,"div",7),p(1),l()),o&2){let e=u();d(),F(e.errorMessage)}}var Us=class o{isCreating=!1;create=new U;cancelled=new U;nameInput;pathInput;projectName="";projectPath="";errorMessage="";isValid(){return this.projectName.trim()!==""&&this.projectPath.trim()!==""}onNameEnter(){this.projectName.trim()&&setTimeout(()=>this.pathInput?.focus(),50)}onCreate(){this.isValid()?(this.errorMessage="",this.create.emit({name:this.projectName.trim(),path:this.projectPath.trim()})):this.errorMessage="Both name and path are required"}onCancel(){this.cancelled.emit()}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-project-create"]],viewQuery:function(e,i){if(e&1&&(Q(Cb,5),Q(xb,5)),e&2){let n;H(n=W())&&(i.nameInput=n.first),H(n=W())&&(i.pathInput=n.first)}},inputs:{isCreating:"isCreating"},outputs:{create:"create",cancelled:"cancelled"},decls:14,vars:10,consts:[["nameInput",""],["pathInput",""],[1,"project-create"],[1,"create-title"],[1,"create-form"],["label","Project Name","placeholder","my-project",3,"valueChange","enterPressed","value","isDisabled","autoFocus"],["label","Project Path","placeholder","/path/to/project","hint","Absolute path to the project directory",3,"valueChange","enterPressed","value","isDisabled","autoFocus"],[1,"error-message"],[1,"form-actions"],["matButton","",3,"click","disabled"],["matButton","filled",3,"click","disabled"]],template:function(e,i){if(e&1){let n=M();s(0,"div",2)(1,"h3",3),p(2,"Create New Project"),l(),s(3,"div",4)(4,"app-text-input",5,0),_("valueChange",function(a){return v(n),y(i.projectName=a)})("enterPressed",function(){return v(n),y(i.onNameEnter())}),l(),s(6,"app-text-input",6,1),_("valueChange",function(a){return v(n),y(i.projectPath=a)})("enterPressed",function(){return v(n),y(i.onCreate())}),l(),C(8,wb,2,1,"div",7),l(),s(9,"div",8)(10,"button",9),_("click",function(){return v(n),y(i.onCancel())}),p(11,"Cancel"),l(),s(12,"button",10),_("click",function(){return v(n),y(i.onCreate())}),p(13),l()()()}e&2&&(d(4),w("value",i.projectName)("isDisabled",i.isCreating)("autoFocus",!0),d(2),w("value",i.projectPath)("isDisabled",i.isCreating)("autoFocus",!1),d(2),x(i.errorMessage?8:-1),d(2),w("disabled",i.isCreating),d(2),w("disabled",!i.isValid()||i.isCreating),d(),te(" ",i.isCreating?"Creating...":"Create Project"," "))},dependencies:[Pe,Ws,Et],styles:[".project-create[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding:1rem;animation:_ngcontent-%COMP%_slideIn .3s ease-out}.create-title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text);text-align:center}.create-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.error-message[_ngcontent-%COMP%]{padding:.75rem 1rem;background:#dc26261a;border:1px solid rgba(220,38,38,.3);border-radius:8px;color:var(--color-error);font-size:.9rem;text-align:center}.form-actions[_ngcontent-%COMP%]{display:flex;gap:1rem;justify-content:flex-end;margin-top:.5rem}@keyframes _ngcontent-%COMP%_slideIn{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 768px){.project-create[_ngcontent-%COMP%]{gap:1.25rem;padding:.75rem}.create-title[_ngcontent-%COMP%]{font-size:1.3rem}.form-actions[_ngcontent-%COMP%]{flex-direction:column-reverse;gap:.75rem}}@media (max-width: 480px){.project-create[_ngcontent-%COMP%]{gap:1rem;padding:.5rem}.create-title[_ngcontent-%COMP%]{font-size:1.2rem}}"]})};function Sb(o,t){if(o&1){let e=M();s(0,"app-project-create",10),_("create",function(n){v(e);let r=u();return y(r.onCreateProject(n))})("cancelled",function(){v(e);let n=u();return y(n.closeCreateForm())}),l()}if(o&2){let e=u();w("isCreating",e.isCreating)}}function kb(o,t){o&1&&(s(0,"div",6),A(1,"div",11),s(2,"p",12),p(3,"Loading projects..."),l()())}function Mb(o,t){if(o&1&&(s(0,"div",7)(1,"p",13),p(2),l()()),o&2){let e=u();d(2),F(e.error)}}function Tb(o,t){if(o&1){let e=M();s(0,"app-choice-select",14),_("choiceSelected",function(n){v(e);let r=u();return y(r.selectProject(n))}),l()}if(o&2){let e=u();w("options",e.projectOptions())("labelHtml","Select a project to continue")("isVisible",!0)}}function Eb(o,t){if(o&1){let e=M();s(0,"div",9)(1,"p",15),p(2,"No projects available."),l(),s(3,"button",16),_("click",function(){v(e);let n=u();return y(n.openCreateForm())}),p(4,"Create your first project"),l()()}}var $s=class o{isLoading=!1;error=null;showCreateForm=!1;isCreating=!1;router=m(On);projectStateService=m(Se);projects=_t(this.projectStateService.projectList$);forcedProject=_t(this.projectStateService.forcedProject$);projectOptions=hi(()=>{let t=this.projects();if(!t)return[];let e=t.filter(a=>!a.volatile),i=t.filter(a=>a.volatile),r=[...e,...i].map(a=>({value:a.name,label:a.volatile?`${a.name} \u{1F538}temp`:a.name}));return t.length>0&&r.push({value:"__new_project__",label:"New project..."}),r});showCreateButton=hi(()=>!this.forcedProject());constructor(){this.projectStateService.selectedProject$.pipe(nn(),ce(t=>!!t),ce(()=>this.router.url.split("?")[0]==="/"),Ut(1)).subscribe(t=>{console.log(`\u{1F43C} navigate to ${t.name}`),this.router.navigate(["project",t.name])})}selectProject(t){if(t==="__new_project__"){this.openCreateForm();return}this.projectStateService.selectProject(t)}openCreateForm(){this.showCreateForm=!0}closeCreateForm(){this.showCreateForm=!1,this.isCreating=!1}onCreateProject(t){this.isCreating=!0,this.error=null,this.projectStateService.createProject(t.name,t.path).subscribe({next:e=>{console.log("[PROJECT-SELECTION] Project created:",e.message),this.isCreating=!1,this.closeCreateForm(),this.selectProject(t.name)},error:e=>{console.error("[PROJECT-SELECTION] Error creating project:",e),this.error=e.error?.error||"Failed to create project",this.isCreating=!1}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-project-selection"]],decls:11,vars:1,consts:[[1,"project-selection"],[1,"centered-content"],[1,"welcome-section"],[1,"choice-section"],[1,"choice-glass"],[3,"isCreating"],[1,"loading-container"],[1,"error-container"],[3,"options","labelHtml","isVisible"],[1,"no-projects-container"],[3,"create","cancelled","isCreating"],[1,"loading-spinner"],[1,"loading-text"],[1,"error-text"],[3,"choiceSelected","options","labelHtml","isVisible"],[1,"no-projects-text"],["matButton","filled","color","primary",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"div",2),A(3,"app-welcome-message"),l(),s(4,"div",3)(5,"div",4),C(6,Sb,1,1,"app-project-create",5)(7,kb,4,0,"div",6)(8,Mb,3,1,"div",7)(9,Tb,1,3,"app-choice-select",8)(10,Eb,5,0,"div",9),l()()()()),e&2&&(d(6),x(i.showCreateForm?6:i.isLoading?7:i.error?8:i.projects()&&i.projects().length>0?9:10))},dependencies:[Pe,Go,Yo,Us,Et],styles:[".project-selection[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:100vh;width:100%;overflow:hidden;background:var(--color-bg);padding:2rem}.centered-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3rem;width:100%;max-width:800px;animation:_ngcontent-%COMP%_fadeIn .6s ease-out}.welcome-section[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_slideUp .8s ease-out}.choice-section[_ngcontent-%COMP%]{width:100%;animation:_ngcontent-%COMP%_slideUp .8s ease-out .2s both}.choice-glass[_ngcontent-%COMP%]{background:var(--color-surface);border:1px solid var(--color-border);border-radius:12px;padding:1.5rem;box-shadow:0 4px 6px #0000001a;transition:all .3s ease}.choice-glass[_ngcontent-%COMP%]:hover{box-shadow:0 8px 12px #00000026}.loading-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:1rem;padding:2rem}.loading-spinner[_ngcontent-%COMP%]{width:40px;height:40px;border:3px solid var(--color-border);border-top-color:var(--color-primary);border-radius:50%;animation:_ngcontent-%COMP%_spin 1s linear infinite}.loading-text[_ngcontent-%COMP%]{color:var(--color-text-secondary);margin:0}.error-container[_ngcontent-%COMP%]{padding:2rem;text-align:center}.error-text[_ngcontent-%COMP%]{color:var(--color-error);margin:0}.no-projects-container[_ngcontent-%COMP%]{padding:2rem;text-align:center}.no-projects-text[_ngcontent-%COMP%]{color:var(--color-text);margin:0 0 1rem;font-size:1.1rem}.no-projects-hint[_ngcontent-%COMP%]{color:var(--color-text-secondary);margin:0;font-size:.9rem}.create-action[_ngcontent-%COMP%]{margin-top:1.5rem;padding-top:1.5rem;border-top:1px solid var(--color-border);display:flex;justify-content:center}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0}to{opacity:1}}@keyframes _ngcontent-%COMP%_slideUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}@media (max-width: 768px){.project-selection[_ngcontent-%COMP%]{padding:1.5rem}.centered-content[_ngcontent-%COMP%]{gap:2rem}.choice-glass[_ngcontent-%COMP%]{padding:1rem}}@media (max-width: 480px){.project-selection[_ngcontent-%COMP%]{padding:1rem}.centered-content[_ngcontent-%COMP%]{gap:1.5rem}.choice-glass[_ngcontent-%COMP%]{padding:.75rem}.create-action[_ngcontent-%COMP%]{margin-top:1rem;padding-top:1rem}}"]})};var nt=class o{STORAGE_KEY="coday-preferences";isDesktopApp=!1;electronStorage=null;voiceLanguageSubject=new le("en-US");voiceLanguage$=this.voiceLanguageSubject.asObservable();enterToSendSubject=new le(!0);enterToSend$=this.enterToSendSubject.asObservable();voiceAnnounceEnabledSubject=new le(!1);voiceAnnounceEnabled$=this.voiceAnnounceEnabledSubject.asObservable();voiceModeSubject=new le("speech");voiceMode$=this.voiceModeSubject.asObservable();voiceReadFullTextSubject=new le(!1);voiceReadFullText$=this.voiceReadFullTextSubject.asObservable();voiceVolumeSubject=new le(.8);voiceVolume$=this.voiceVolumeSubject.asObservable();voiceRateSubject=new le(1.2);voiceRate$=this.voiceRateSubject.asObservable();selectedVoiceSubject=new le(null);selectedVoice$=this.selectedVoiceSubject.asObservable();printTechnicalMessagesSubject=new le(!1);printTechnicalMessages$=this.printTechnicalMessagesSubject.asObservable();hideTechnicalMessagesSubject=new le(!0);hideTechnicalMessages$=this.hideTechnicalMessagesSubject.asObservable();hideWarningMessagesSubject=new le(!1);hideWarningMessages$=this.hideWarningMessagesSubject.asObservable();agentNotificationEnabledSubject=new le(!1);agentNotificationEnabled$=this.agentNotificationEnabledSubject.asObservable();notificationSoundEnabledSubject=new le(!1);notificationSoundEnabled$=this.notificationSoundEnabledSubject.asObservable();browserNotificationEnabledSubject=new le(!1);browserNotificationEnabled$=this.browserNotificationEnabledSubject.asObservable();constructor(){console.log("[PREFERENCES] Initializing preferences service"),typeof window<"u"&&window.codayDesktop?.storage&&(this.isDesktopApp=!0,this.electronStorage=window.codayDesktop.storage,console.log("[PREFERENCES] Running in desktop app mode with persistent storage")),this.initializePreferences()}initializePreferences(){this.isDesktopApp?this.loadPreferencesAsync():this.loadPreferencesSync()}loadPreferencesSync(){let t=this.getPreferenceSync("voiceLanguage","en-US")??"en-US";this.voiceLanguageSubject.next(t),console.log("[PREFERENCES] Voice language initialized to:",t);let e=this.getPreferenceSync("useEnterToSend",!0)??!0;this.enterToSendSubject.next(e),console.log("[PREFERENCES] Enter to send initialized to:",e);let i=this.getPreferenceSync("voiceAnnounceEnabled",!1)??!1;this.voiceAnnounceEnabledSubject.next(i);let n=this.getPreferenceSync("voiceMode","speech")??"speech";this.voiceModeSubject.next(n);let r=this.getPreferenceSync("voiceReadFullText",!1)??!1;this.voiceReadFullTextSubject.next(r);let a=this.getPreferenceSync("voiceVolume",.8)??.8;this.voiceVolumeSubject.next(a);let c=this.getPreferenceSync("voiceRate",1.2)??1.2;this.voiceRateSubject.next(c);let h=this.getPreferenceSync("selectedVoice",null)??null;this.selectedVoiceSubject.next(h);let g=this.getPreferenceSync("printTechnicalMessages",!1)??!1;this.printTechnicalMessagesSubject.next(g);let b=this.getPreferenceSync("hideTechnicalMessages",!0)??!0;this.hideTechnicalMessagesSubject.next(b);let S=this.getPreferenceSync("hideWarningMessages",!1)??!1;this.hideWarningMessagesSubject.next(S);let P=this.getPreferenceSync("agentNotificationEnabled",!1)??!1;this.agentNotificationEnabledSubject.next(P);let N=this.getPreferenceSync("notificationSoundEnabled",!0)??!0;this.notificationSoundEnabledSubject.next(N);let k=this.getPreferenceSync("browserNotificationEnabled",!1)??!1;this.browserNotificationEnabledSubject.next(k),console.log("[PREFERENCES] All preferences initialized successfully")}loadPreferencesAsync(){return ee(this,null,function*(){let t=(yield this.getPreferenceAsync("voiceLanguage","en-US"))??"en-US";this.voiceLanguageSubject.next(t),console.log("[PREFERENCES] Voice language initialized to:",t);let e=(yield this.getPreferenceAsync("useEnterToSend",!0))??!0;this.enterToSendSubject.next(e),console.log("[PREFERENCES] Enter to send initialized to:",e);let i=(yield this.getPreferenceAsync("voiceAnnounceEnabled",!1))??!1;this.voiceAnnounceEnabledSubject.next(i);let n=(yield this.getPreferenceAsync("voiceMode","speech"))??"speech";this.voiceModeSubject.next(n);let r=(yield this.getPreferenceAsync("voiceReadFullText",!1))??!1;this.voiceReadFullTextSubject.next(r);let a=(yield this.getPreferenceAsync("voiceVolume",.8))??.8;this.voiceVolumeSubject.next(a);let c=(yield this.getPreferenceAsync("voiceRate",1.2))??1.2;this.voiceRateSubject.next(c);let h=(yield this.getPreferenceAsync("selectedVoice",null))??null;this.selectedVoiceSubject.next(h);let g=(yield this.getPreferenceAsync("printTechnicalMessages",!1))??!1;this.printTechnicalMessagesSubject.next(g);let b=(yield this.getPreferenceAsync("hideTechnicalMessages",!0))??!0;this.hideTechnicalMessagesSubject.next(b);let S=(yield this.getPreferenceAsync("hideWarningMessages",!1))??!1;this.hideWarningMessagesSubject.next(S);let P=(yield this.getPreferenceAsync("agentNotificationEnabled",!1))??!1;this.agentNotificationEnabledSubject.next(P);let N=(yield this.getPreferenceAsync("notificationSoundEnabled",!0))??!0;this.notificationSoundEnabledSubject.next(N);let k=(yield this.getPreferenceAsync("browserNotificationEnabled",!1))??!1;this.browserNotificationEnabledSubject.next(k),console.log("[PREFERENCES] All preferences initialized successfully (async)")})}getPreference(t,e){return this.getPreferenceSync(t,e)}getPreferenceSync(t,e){try{let i=localStorage.getItem(this.STORAGE_KEY);if(!i)return e;let n=JSON.parse(i);return n[t]!==void 0?n[t]:e}catch{return e}}getPreferenceAsync(t,e){return ee(this,null,function*(){if(!this.electronStorage)return this.getPreferenceSync(t,e);try{let i=yield this.electronStorage.get(this.STORAGE_KEY);if(!i)return e;let n=JSON.parse(i);return n[t]!==void 0?n[t]:e}catch{return e}})}setPreference(t,e){this.isDesktopApp?this.setPreferenceAsync(t,e):this.setPreferenceSync(t,e)}setPreferenceSync(t,e){try{let i=localStorage.getItem(this.STORAGE_KEY),n=i?JSON.parse(i):{};n[t]=e,localStorage.setItem(this.STORAGE_KEY,JSON.stringify(n)),this.updateSubject(t,e)}catch(i){console.error("Failed to set preference:",i)}}setPreferenceAsync(t,e){return ee(this,null,function*(){if(!this.electronStorage){this.setPreferenceSync(t,e);return}try{let i=yield this.electronStorage.get(this.STORAGE_KEY),n=i?JSON.parse(i):{};n[t]=e,yield this.electronStorage.set(this.STORAGE_KEY,JSON.stringify(n)),this.updateSubject(t,e)}catch(i){console.error("Failed to set preference:",i)}})}updateSubject(t,e){t==="voiceLanguage"&&this.voiceLanguageSubject.next(e),t==="useEnterToSend"&&this.enterToSendSubject.next(e),t==="voiceAnnounceEnabled"&&this.voiceAnnounceEnabledSubject.next(e),t==="voiceMode"&&this.voiceModeSubject.next(e),t==="voiceReadFullText"&&this.voiceReadFullTextSubject.next(e),t==="voiceVolume"&&this.voiceVolumeSubject.next(e),t==="voiceRate"&&this.voiceRateSubject.next(e),t==="selectedVoice"&&this.selectedVoiceSubject.next(e),t==="printTechnicalMessages"&&this.printTechnicalMessagesSubject.next(e),t==="hideTechnicalMessages"&&this.hideTechnicalMessagesSubject.next(e),t==="hideWarningMessages"&&this.hideWarningMessagesSubject.next(e),t==="agentNotificationEnabled"&&this.agentNotificationEnabledSubject.next(e),t==="notificationSoundEnabled"&&this.notificationSoundEnabledSubject.next(e),t==="browserNotificationEnabled"&&this.browserNotificationEnabledSubject.next(e)}setVoiceLanguage(t){console.log("[PREFERENCES] Setting voice language to:",t),this.setPreference("voiceLanguage",t)}getVoiceLanguage(){return this.getPreference("voiceLanguage","en-US")??"en-US"}setEnterToSend(t){console.log("[PREFERENCES] Setting Enter to send to:",t),this.setPreference("useEnterToSend",t)}getEnterToSend(){return this.getPreference("useEnterToSend",!1)??!1}setVoiceAnnounceEnabled(t){console.log("[PREFERENCES] Setting voice announce enabled to:",t),this.setPreference("voiceAnnounceEnabled",t)}getVoiceAnnounceEnabled(){return this.getPreference("voiceAnnounceEnabled",!1)??!1}setVoiceMode(t){console.log("[PREFERENCES] Setting voice mode to:",t),this.setPreference("voiceMode",t)}getVoiceMode(){return this.getPreference("voiceMode","speech")??"speech"}setVoiceReadFullText(t){console.log("[PREFERENCES] Setting voice read full text to:",t),this.setPreference("voiceReadFullText",t)}getVoiceReadFullText(){return this.getPreference("voiceReadFullText",!1)??!1}setVoiceVolume(t){let e=Math.max(0,Math.min(1,t));console.log("[PREFERENCES] Setting voice volume to:",e),this.setPreference("voiceVolume",e)}getVoiceVolume(){return this.getPreference("voiceVolume",.8)??.8}setVoiceRate(t){let e=Math.max(.5,Math.min(2,t));console.log("[PREFERENCES] Setting voice rate to:",e),this.setPreference("voiceRate",e)}getVoiceRate(){return this.getPreference("voiceRate",1.2)??1.2}setSelectedVoice(t){console.log("[PREFERENCES] Setting selected voice to:",t),this.setPreference("selectedVoice",t)}getSelectedVoice(){return this.getPreference("selectedVoice",null)??null}setPrintTechnicalMessages(t){console.log("[PREFERENCES] Setting print technical messages to:",t),this.setPreference("printTechnicalMessages",t)}getPrintTechnicalMessages(){return this.getPreference("printTechnicalMessages",!1)??!1}setHideTechnicalMessages(t){console.log("[PREFERENCES] Setting hide technical messages to:",t),this.setPreference("hideTechnicalMessages",t)}getHideTechnicalMessages(){return this.getPreference("hideTechnicalMessages",!0)??!0}setHideWarningMessages(t){console.log("[PREFERENCES] Setting hide warning messages to:",t),this.setPreference("hideWarningMessages",t)}getHideWarningMessages(){return this.getPreference("hideWarningMessages",!1)??!1}setAgentNotificationEnabled(t){console.log("[PREFERENCES] Setting agent notification enabled to:",t),this.setPreference("agentNotificationEnabled",t)}getAgentNotificationEnabled(){return this.getPreference("agentNotificationEnabled",!1)??!1}setNotificationSoundEnabled(t){console.log("[PREFERENCES] Setting notification sound enabled to:",t),this.setPreference("notificationSoundEnabled",t)}getNotificationSoundEnabled(){return this.getPreference("notificationSoundEnabled",!0)??!0}setBrowserNotificationEnabled(t){console.log("[PREFERENCES] Setting browser notification enabled to:",t),this.setPreference("browserNotificationEnabled",t)}getBrowserNotificationEnabled(){return this.getPreference("browserNotificationEnabled",!1)??!1}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};function md(o,t=80){if(o.length<=t)return o;try{if(o.trim().startsWith("{")||o.trim().startsWith("[")){let e=JSON.parse(o),i=JSON.stringify(e);return i.length<=t?i:i.substring(0,t)+`...(${i.length} chars)`}}catch{}return o.substring(0,t)+"..."}var mt=class{constructor(t,e){this.type=e;if(t.timestamp)this.timestamp=t.timestamp;else{let i=Math.random().toString(36).substring(2,7);this.timestamp=`${new Date().toISOString()}-${i}`}this.parentKey=t.parentKey,this.threadId=t.threadId,this.length=0}timestamp;parentKey;static type;length;threadId;get date(){let t=this.timestamp.lastIndexOf("-");if(t>0){let e=this.timestamp.substring(t+1);if(e.length===5&&/^[a-z0-9]+$/.test(e))return new Date(this.timestamp.substring(0,t))}return new Date(this.timestamp)}},qs=class extends mt{invite;constructor(t,e){super(t,e),this.invite=t.invite}buildAnswer(t){return new Yt({answer:t,parentKey:this.timestamp,invite:this.invite})}},Qo=class o extends mt{static type="heartbeat";constructor(t){super(t,o.type)}},gn=class o extends qs{defaultValue;static type="invite";constructor(t){super(t,o.type),this.defaultValue=t.defaultValue}},pd="InviteEventDefault",Yt=class o extends mt{answer;invite;static type="answer";constructor(t){super(t,o.type),this.answer=t.answer??"No answer",this.invite=t.invite}},Ui=class o extends mt{speaker;text;static type="text";constructor(t){super(t,o.type),this.speaker=t.speaker,this.text=t.text}},zn=class o extends mt{chunk;static type="text_chunk";constructor(t){super(t,o.type),this.chunk=t.chunk,this.length=this.chunk.length}},co=class o extends mt{warning;static type="warn";constructor(t){super(t,o.type),this.warning=t.warning}},Si=class o extends mt{error;static type="error";constructor(t){super(t,o.type),this.error=t.error}},fn=class o extends qs{options;optionalQuestion;allowFreeText;static type="choice";constructor(t){super(t,o.type),this.options=t.options,this.optionalQuestion=t.optionalQuestion,this.allowFreeText=t.allowFreeText??!1}},ki=class o extends mt{toolRequestId;name;args;static type="tool_request";constructor(t){super(t,o.type),this.toolRequestId=t.toolRequestId??this.timestamp,this.name=t.name,this.args=t.args,this.length=this.args.length+this.name.length+this.toolRequestId.length+20}buildResponse(t){return new li({output:t,toolRequestId:this.toolRequestId,parentKey:this.timestamp})}toSingleLineString(t=50){let e=md(this.args,t);return`\u{1F527} ${this.name}(${e})`}},li=class o extends mt{toolRequestId;output;static type="tool_response";constructor(t){if(super(t,o.type),this.toolRequestId=t.toolRequestId||this.timestamp||new Date().toISOString(),this.output=t.output,typeof this.output=="string")this.length=this.output.length+this.toolRequestId.length+20;else if(this.output.type==="text")this.length=this.output.content.length+this.toolRequestId.length+20;else if(this.output.type==="image"){let e=(this.output.width??0)*(this.output.height??0)/750;this.length=(e?e*3.5:this.output.content.length)+this.toolRequestId.length+20}else this.length=this.toolRequestId.length+20}getTextOutput(){return typeof this.output=="string"?this.output:this.output.type==="text"?this.output.content:this.output.type==="image"?`[Image: ${this.output.mimeType}]`:""}toSingleLineString(t=50){let e=this.getTextOutput(),i=md(e,t),n=typeof this.output!="string"&&this.output.type==="image"?" [image]":"";return`\u2B91 ${i}${n}`}},jn=class o extends mt{static type="thinking";static debounce=5e3;constructor(t){super(t,o.type)}},mo=class o extends mt{summary;static type="summary";constructor(t){super(t,o.type),this.summary=t.summary,this.length=this.summary.length}toSingleLineString(t=80){return`\u{1F4CB} Summary: ${md(this.summary,t)}`}},Mi=class o extends mt{role;name;content;static type="message";constructor(t){super(t,o.type),this.role=t.role,this.name=t.name,this.content=t.content,this.length=this.content.map(e=>{if(e.type==="text")return e.content.length;if(e.type==="image"){let i=(e.width||0)*(e.height||0)/750;return i?i*3.5:e.content.length}return 0}).reduce((e,i)=>e+i,0)}getTextContent(){return this.content.filter(t=>t.type==="text").map(t=>t.content).join(`
|
|
68
|
-
`)}},Xo=class o extends mt{threadId;name;summary;users;static type="thread_update";constructor(t){super(t,o.type),this.threadId=t.threadId,this.name=t.name,this.summary=t.summary,this.users=t.users}},
|
|
66
|
+
Please report this to https://github.com/markedjs/marked.`,o){let i="<p>An error occurred:</p><pre>"+Bi(e.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(e);throw e}}},so=new H_;function Ae(o,t){return so.parse(o,t)}Ae.options=Ae.setOptions=function(o){return so.setOptions(o),Ae.defaults=so.defaults,Th(Ae.defaults),Ae};Ae.getDefaults=Gc;Ae.defaults=lo;Ae.use=function(...o){return so.use(...o),Ae.defaults=so.defaults,Th(Ae.defaults),Ae};Ae.walkTokens=function(o,t){return so.walkTokens(o,t)};Ae.parseInline=so.parseInline;Ae.Parser=xi;Ae.parser=xi.parse;Ae.Renderer=qo;Ae.TextRenderer=td;Ae.Lexer=Ci;Ae.lexer=Ci.lex;Ae.Tokenizer=Ls;Ae.Hooks=Zr;Ae.parse=Ae;var yk=Ae.options,Ck=Ae.setOptions,xk=Ae.use,wk=Ae.walkTokens,Sk=Ae.parseInline;var kk=xi.parse,Mk=Ci.lex;var{entries:qh,setPrototypeOf:Vh,isFrozen:W_,getPrototypeOf:U_,getOwnPropertyDescriptor:$_}=Object,{freeze:Lt,seal:ai,create:ld}=Object,{apply:cd,construct:dd}=typeof Reflect<"u"&&Reflect;Lt||(Lt=function(t){return t});ai||(ai=function(t){return t});cd||(cd=function(t,e){for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];return t.apply(e,n)});dd||(dd=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return new t(...i)});var js=Vt(Array.prototype.forEach),q_=Vt(Array.prototype.lastIndexOf),zh=Vt(Array.prototype.pop),ta=Vt(Array.prototype.push),G_=Vt(Array.prototype.splice),Hs=Vt(String.prototype.toLowerCase),id=Vt(String.prototype.toString),nd=Vt(String.prototype.match),ia=Vt(String.prototype.replace),Y_=Vt(String.prototype.indexOf),Q_=Vt(String.prototype.trim),wi=Vt(Object.prototype.hasOwnProperty),Nt=Vt(RegExp.prototype.test),na=X_(TypeError);function Vt(o){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return cd(o,t,i)}}function X_(o){return function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return dd(o,e)}}function ue(o,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Hs;Vh&&Vh(o,null);let i=t.length;for(;i--;){let n=t[i];if(typeof n=="string"){let r=e(n);r!==n&&(W_(t)||(t[i]=r),n=r)}o[n]=!0}return o}function K_(o){for(let t=0;t<o.length;t++)wi(o,t)||(o[t]=null);return o}function Hi(o){let t=ld(null);for(let[e,i]of qh(o))wi(o,e)&&(Array.isArray(i)?t[e]=K_(i):i&&typeof i=="object"&&i.constructor===Object?t[e]=Hi(i):t[e]=i);return t}function oa(o,t){for(;o!==null;){let i=$_(o,t);if(i){if(i.get)return Vt(i.get);if(typeof i.value=="function")return Vt(i.value)}o=U_(o)}function e(){return null}return e}var jh=Lt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),od=Lt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),rd=Lt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Z_=Lt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ad=Lt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),J_=Lt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Bh=Lt(["#text"]),Hh=Lt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),sd=Lt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Wh=Lt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Bs=Lt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),eb=ai(/\{\{[\w\W]*|[\w\W]*\}\}/gm),tb=ai(/<%[\w\W]*|[\w\W]*%>/gm),ib=ai(/\$\{[\w\W]*/gm),nb=ai(/^data-[\-\w.\u00B7-\uFFFF]+$/),ob=ai(/^aria-[\-\w]+$/),Gh=ai(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),rb=ai(/^(?:\w+script|data):/i),ab=ai(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Yh=ai(/^html$/i),sb=ai(/^[a-z][.\w]*(-[.\w]+)+$/i),Uh=Object.freeze({__proto__:null,ARIA_ATTR:ob,ATTR_WHITESPACE:ab,CUSTOM_ELEMENT:sb,DATA_ATTR:nb,DOCTYPE_NAME:Yh,ERB_EXPR:tb,IS_ALLOWED_URI:Gh,IS_SCRIPT_OR_DATA:rb,MUSTACHE_EXPR:eb,TMPLIT_EXPR:ib}),ra={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},lb=function(){return typeof window>"u"?null:window},cb=function(t,e){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,n="data-tt-policy-suffix";e&&e.hasAttribute(n)&&(i=e.getAttribute(n));let r="dompurify"+(i?"#"+i:"");try{return t.createPolicy(r,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},$h=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Qh(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:lb(),t=Y=>Qh(Y);if(t.version="3.3.1",t.removed=[],!o||!o.document||o.document.nodeType!==ra.document||!o.Element)return t.isSupported=!1,t;let{document:e}=o,i=e,n=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:a,Node:c,Element:h,NodeFilter:g,NamedNodeMap:b=o.NamedNodeMap||o.MozNamedAttrMap,HTMLFormElement:S,DOMParser:P,trustedTypes:N}=o,k=h.prototype,A=oa(k,"cloneNode"),pe=oa(k,"remove"),ke=oa(k,"nextSibling"),ve=oa(k,"childNodes"),Ke=oa(k,"parentNode");if(typeof a=="function"){let Y=e.createElement("template");Y.content&&Y.content.ownerDocument&&(e=Y.content.ownerDocument)}let ge,Bt="",{implementation:pt,createNodeIterator:Ze,createDocumentFragment:xt,getElementsByTagName:Xi}=e,{importNode:Cn}=i,ht=$h();t.isSupported=typeof qh=="function"&&typeof Ke=="function"&&pt&&pt.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:mi,ERB_EXPR:Hn,TMPLIT_EXPR:bo,DATA_ATTR:ya,ARIA_ATTR:$,IS_SCRIPT_OR_DATA:G,ATTR_WHITESPACE:X,CUSTOM_ELEMENT:fe}=Uh,{IS_ALLOWED_URI:ot}=Uh,De=null,wt=ue({},[...jh,...od,...rd,...ad,...Bh]),Fe=null,Ne=ue({},[...Hh,...sd,...Wh,...Bs]),We=Object.seal(ld(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Wn=null,at=null,Ht=Object.seal(ld(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),At=!0,xn=!0,vo=!1,Vd=!0,yo=!1,Ca=!0,Un=!1,Nl=!1,Ll=!1,Co=!1,xa=!1,wa=!1,zd=!0,jd=!1,Sg="user-content-",Vl=!0,Sr=!1,xo={},Ti=null,zl=ue({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Bd=null,Hd=ue({},["audio","video","img","source","image","track"]),jl=null,Wd=ue({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Sa="http://www.w3.org/1998/Math/MathML",ka="http://www.w3.org/2000/svg",Ki="http://www.w3.org/1999/xhtml",wo=Ki,Bl=!1,Hl=null,kg=ue({},[Sa,ka,Ki],id),Ma=ue({},["mi","mo","mn","ms","mtext"]),Ta=ue({},["annotation-xml"]),Mg=ue({},["title","style","font","a","script"]),kr=null,Tg=["application/xhtml+xml","text/html"],Eg="text/html",dt=null,So=null,Pg=e.createElement("form"),Ud=function(f){return f instanceof RegExp||f instanceof Function},Wl=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(So&&So===f)){if((!f||typeof f!="object")&&(f={}),f=Hi(f),kr=Tg.indexOf(f.PARSER_MEDIA_TYPE)===-1?Eg:f.PARSER_MEDIA_TYPE,dt=kr==="application/xhtml+xml"?id:Hs,De=wi(f,"ALLOWED_TAGS")?ue({},f.ALLOWED_TAGS,dt):wt,Fe=wi(f,"ALLOWED_ATTR")?ue({},f.ALLOWED_ATTR,dt):Ne,Hl=wi(f,"ALLOWED_NAMESPACES")?ue({},f.ALLOWED_NAMESPACES,id):kg,jl=wi(f,"ADD_URI_SAFE_ATTR")?ue(Hi(Wd),f.ADD_URI_SAFE_ATTR,dt):Wd,Bd=wi(f,"ADD_DATA_URI_TAGS")?ue(Hi(Hd),f.ADD_DATA_URI_TAGS,dt):Hd,Ti=wi(f,"FORBID_CONTENTS")?ue({},f.FORBID_CONTENTS,dt):zl,Wn=wi(f,"FORBID_TAGS")?ue({},f.FORBID_TAGS,dt):Hi({}),at=wi(f,"FORBID_ATTR")?ue({},f.FORBID_ATTR,dt):Hi({}),xo=wi(f,"USE_PROFILES")?f.USE_PROFILES:!1,At=f.ALLOW_ARIA_ATTR!==!1,xn=f.ALLOW_DATA_ATTR!==!1,vo=f.ALLOW_UNKNOWN_PROTOCOLS||!1,Vd=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,yo=f.SAFE_FOR_TEMPLATES||!1,Ca=f.SAFE_FOR_XML!==!1,Un=f.WHOLE_DOCUMENT||!1,Co=f.RETURN_DOM||!1,xa=f.RETURN_DOM_FRAGMENT||!1,wa=f.RETURN_TRUSTED_TYPE||!1,Ll=f.FORCE_BODY||!1,zd=f.SANITIZE_DOM!==!1,jd=f.SANITIZE_NAMED_PROPS||!1,Vl=f.KEEP_CONTENT!==!1,Sr=f.IN_PLACE||!1,ot=f.ALLOWED_URI_REGEXP||Gh,wo=f.NAMESPACE||Ki,Ma=f.MATHML_TEXT_INTEGRATION_POINTS||Ma,Ta=f.HTML_INTEGRATION_POINTS||Ta,We=f.CUSTOM_ELEMENT_HANDLING||{},f.CUSTOM_ELEMENT_HANDLING&&Ud(f.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(We.tagNameCheck=f.CUSTOM_ELEMENT_HANDLING.tagNameCheck),f.CUSTOM_ELEMENT_HANDLING&&Ud(f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(We.attributeNameCheck=f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(We.allowCustomizedBuiltInElements=f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),yo&&(xn=!1),xa&&(Co=!0),xo&&(De=ue({},Bh),Fe=[],xo.html===!0&&(ue(De,jh),ue(Fe,Hh)),xo.svg===!0&&(ue(De,od),ue(Fe,sd),ue(Fe,Bs)),xo.svgFilters===!0&&(ue(De,rd),ue(Fe,sd),ue(Fe,Bs)),xo.mathMl===!0&&(ue(De,ad),ue(Fe,Wh),ue(Fe,Bs))),f.ADD_TAGS&&(typeof f.ADD_TAGS=="function"?Ht.tagCheck=f.ADD_TAGS:(De===wt&&(De=Hi(De)),ue(De,f.ADD_TAGS,dt))),f.ADD_ATTR&&(typeof f.ADD_ATTR=="function"?Ht.attributeCheck=f.ADD_ATTR:(Fe===Ne&&(Fe=Hi(Fe)),ue(Fe,f.ADD_ATTR,dt))),f.ADD_URI_SAFE_ATTR&&ue(jl,f.ADD_URI_SAFE_ATTR,dt),f.FORBID_CONTENTS&&(Ti===zl&&(Ti=Hi(Ti)),ue(Ti,f.FORBID_CONTENTS,dt)),f.ADD_FORBID_CONTENTS&&(Ti===zl&&(Ti=Hi(Ti)),ue(Ti,f.ADD_FORBID_CONTENTS,dt)),Vl&&(De["#text"]=!0),Un&&ue(De,["html","head","body"]),De.table&&(ue(De,["tbody"]),delete Wn.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw na('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw na('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');ge=f.TRUSTED_TYPES_POLICY,Bt=ge.createHTML("")}else ge===void 0&&(ge=cb(N,n)),ge!==null&&typeof Bt=="string"&&(Bt=ge.createHTML(""));Lt&&Lt(f),So=f}},$d=ue({},[...od,...rd,...Z_]),qd=ue({},[...ad,...J_]),Og=function(f){let O=Ke(f);(!O||!O.tagName)&&(O={namespaceURI:wo,tagName:"template"});let q=Hs(f.tagName),Ue=Hs(O.tagName);return Hl[f.namespaceURI]?f.namespaceURI===ka?O.namespaceURI===Ki?q==="svg":O.namespaceURI===Sa?q==="svg"&&(Ue==="annotation-xml"||Ma[Ue]):!!$d[q]:f.namespaceURI===Sa?O.namespaceURI===Ki?q==="math":O.namespaceURI===ka?q==="math"&&Ta[Ue]:!!qd[q]:f.namespaceURI===Ki?O.namespaceURI===ka&&!Ta[Ue]||O.namespaceURI===Sa&&!Ma[Ue]?!1:!qd[q]&&(Mg[q]||!$d[q]):!!(kr==="application/xhtml+xml"&&Hl[f.namespaceURI]):!1},Ei=function(f){ta(t.removed,{element:f});try{Ke(f).removeChild(f)}catch{pe(f)}},$n=function(f,O){try{ta(t.removed,{attribute:O.getAttributeNode(f),from:O})}catch{ta(t.removed,{attribute:null,from:O})}if(O.removeAttribute(f),f==="is")if(Co||xa)try{Ei(O)}catch{}else try{O.setAttribute(f,"")}catch{}},Gd=function(f){let O=null,q=null;if(Ll)f="<remove></remove>"+f;else{let st=nd(f,/^[\r\n\t ]+/);q=st&&st[0]}kr==="application/xhtml+xml"&&wo===Ki&&(f='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+f+"</body></html>");let Ue=ge?ge.createHTML(f):f;if(wo===Ki)try{O=new P().parseFromString(Ue,kr)}catch{}if(!O||!O.documentElement){O=pt.createDocument(wo,"template",null);try{O.documentElement.innerHTML=Bl?Bt:Ue}catch{}}let St=O.body||O.documentElement;return f&&q&&St.insertBefore(e.createTextNode(q),St.childNodes[0]||null),wo===Ki?Xi.call(O,Un?"html":"body")[0]:Un?O.documentElement:St},Yd=function(f){return Ze.call(f.ownerDocument||f,f,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},Ul=function(f){return f instanceof S&&(typeof f.nodeName!="string"||typeof f.textContent!="string"||typeof f.removeChild!="function"||!(f.attributes instanceof b)||typeof f.removeAttribute!="function"||typeof f.setAttribute!="function"||typeof f.namespaceURI!="string"||typeof f.insertBefore!="function"||typeof f.hasChildNodes!="function")},Qd=function(f){return typeof c=="function"&&f instanceof c};function Zi(Y,f,O){js(Y,q=>{q.call(t,f,O,So)})}let Xd=function(f){let O=null;if(Zi(ht.beforeSanitizeElements,f,null),Ul(f))return Ei(f),!0;let q=dt(f.nodeName);if(Zi(ht.uponSanitizeElement,f,{tagName:q,allowedTags:De}),Ca&&f.hasChildNodes()&&!Qd(f.firstElementChild)&&Nt(/<[/\w!]/g,f.innerHTML)&&Nt(/<[/\w!]/g,f.textContent)||f.nodeType===ra.progressingInstruction||Ca&&f.nodeType===ra.comment&&Nt(/<[/\w]/g,f.data))return Ei(f),!0;if(!(Ht.tagCheck instanceof Function&&Ht.tagCheck(q))&&(!De[q]||Wn[q])){if(!Wn[q]&&Zd(q)&&(We.tagNameCheck instanceof RegExp&&Nt(We.tagNameCheck,q)||We.tagNameCheck instanceof Function&&We.tagNameCheck(q)))return!1;if(Vl&&!Ti[q]){let Ue=Ke(f)||f.parentNode,St=ve(f)||f.childNodes;if(St&&Ue){let st=St.length;for(let Wt=st-1;Wt>=0;--Wt){let Ji=A(St[Wt],!0);Ji.__removalCount=(f.__removalCount||0)+1,Ue.insertBefore(Ji,ke(f))}}}return Ei(f),!0}return f instanceof h&&!Og(f)||(q==="noscript"||q==="noembed"||q==="noframes")&&Nt(/<\/no(script|embed|frames)/i,f.innerHTML)?(Ei(f),!0):(yo&&f.nodeType===ra.text&&(O=f.textContent,js([mi,Hn,bo],Ue=>{O=ia(O,Ue," ")}),f.textContent!==O&&(ta(t.removed,{element:f.cloneNode()}),f.textContent=O)),Zi(ht.afterSanitizeElements,f,null),!1)},Kd=function(f,O,q){if(zd&&(O==="id"||O==="name")&&(q in e||q in Pg))return!1;if(!(xn&&!at[O]&&Nt(ya,O))){if(!(At&&Nt($,O))){if(!(Ht.attributeCheck instanceof Function&&Ht.attributeCheck(O,f))){if(!Fe[O]||at[O]){if(!(Zd(f)&&(We.tagNameCheck instanceof RegExp&&Nt(We.tagNameCheck,f)||We.tagNameCheck instanceof Function&&We.tagNameCheck(f))&&(We.attributeNameCheck instanceof RegExp&&Nt(We.attributeNameCheck,O)||We.attributeNameCheck instanceof Function&&We.attributeNameCheck(O,f))||O==="is"&&We.allowCustomizedBuiltInElements&&(We.tagNameCheck instanceof RegExp&&Nt(We.tagNameCheck,q)||We.tagNameCheck instanceof Function&&We.tagNameCheck(q))))return!1}else if(!jl[O]){if(!Nt(ot,ia(q,X,""))){if(!((O==="src"||O==="xlink:href"||O==="href")&&f!=="script"&&Y_(q,"data:")===0&&Bd[f])){if(!(vo&&!Nt(G,ia(q,X,"")))){if(q)return!1}}}}}}}return!0},Zd=function(f){return f!=="annotation-xml"&&nd(f,fe)},Jd=function(f){Zi(ht.beforeSanitizeAttributes,f,null);let{attributes:O}=f;if(!O||Ul(f))return;let q={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Fe,forceKeepAttr:void 0},Ue=O.length;for(;Ue--;){let St=O[Ue],{name:st,namespaceURI:Wt,value:Ji}=St,ko=dt(st),$l=Ji,bt=st==="value"?$l:Q_($l);if(q.attrName=ko,q.attrValue=bt,q.keepAttr=!0,q.forceKeepAttr=void 0,Zi(ht.uponSanitizeAttribute,f,q),bt=q.attrValue,jd&&(ko==="id"||ko==="name")&&($n(st,f),bt=Sg+bt),Ca&&Nt(/((--!?|])>)|<\/(style|title|textarea)/i,bt)){$n(st,f);continue}if(ko==="attributename"&&nd(bt,"href")){$n(st,f);continue}if(q.forceKeepAttr)continue;if(!q.keepAttr){$n(st,f);continue}if(!Vd&&Nt(/\/>/i,bt)){$n(st,f);continue}yo&&js([mi,Hn,bo],tm=>{bt=ia(bt,tm," ")});let em=dt(f.nodeName);if(!Kd(em,ko,bt)){$n(st,f);continue}if(ge&&typeof N=="object"&&typeof N.getAttributeType=="function"&&!Wt)switch(N.getAttributeType(em,ko)){case"TrustedHTML":{bt=ge.createHTML(bt);break}case"TrustedScriptURL":{bt=ge.createScriptURL(bt);break}}if(bt!==$l)try{Wt?f.setAttributeNS(Wt,st,bt):f.setAttribute(st,bt),Ul(f)?Ei(f):zh(t.removed)}catch{$n(st,f)}}Zi(ht.afterSanitizeAttributes,f,null)},Ag=function Y(f){let O=null,q=Yd(f);for(Zi(ht.beforeSanitizeShadowDOM,f,null);O=q.nextNode();)Zi(ht.uponSanitizeShadowNode,O,null),Xd(O),Jd(O),O.content instanceof r&&Y(O.content);Zi(ht.afterSanitizeShadowDOM,f,null)};return t.sanitize=function(Y){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O=null,q=null,Ue=null,St=null;if(Bl=!Y,Bl&&(Y="<!-->"),typeof Y!="string"&&!Qd(Y))if(typeof Y.toString=="function"){if(Y=Y.toString(),typeof Y!="string")throw na("dirty is not a string, aborting")}else throw na("toString is not a function");if(!t.isSupported)return Y;if(Nl||Wl(f),t.removed=[],typeof Y=="string"&&(Sr=!1),Sr){if(Y.nodeName){let Ji=dt(Y.nodeName);if(!De[Ji]||Wn[Ji])throw na("root node is forbidden and cannot be sanitized in-place")}}else if(Y instanceof c)O=Gd("<!---->"),q=O.ownerDocument.importNode(Y,!0),q.nodeType===ra.element&&q.nodeName==="BODY"||q.nodeName==="HTML"?O=q:O.appendChild(q);else{if(!Co&&!yo&&!Un&&Y.indexOf("<")===-1)return ge&&wa?ge.createHTML(Y):Y;if(O=Gd(Y),!O)return Co?null:wa?Bt:""}O&&Ll&&Ei(O.firstChild);let st=Yd(Sr?Y:O);for(;Ue=st.nextNode();)Xd(Ue),Jd(Ue),Ue.content instanceof r&&Ag(Ue.content);if(Sr)return Y;if(Co){if(xa)for(St=xt.call(O.ownerDocument);O.firstChild;)St.appendChild(O.firstChild);else St=O;return(Fe.shadowroot||Fe.shadowrootmode)&&(St=Cn.call(i,St,!0)),St}let Wt=Un?O.outerHTML:O.innerHTML;return Un&&De["!doctype"]&&O.ownerDocument&&O.ownerDocument.doctype&&O.ownerDocument.doctype.name&&Nt(Yh,O.ownerDocument.doctype.name)&&(Wt="<!DOCTYPE "+O.ownerDocument.doctype.name+`>
|
|
67
|
+
`+Wt),yo&&js([mi,Hn,bo],Ji=>{Wt=ia(Wt,Ji," ")}),ge&&wa?ge.createHTML(Wt):Wt},t.setConfig=function(){let Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Wl(Y),Nl=!0},t.clearConfig=function(){So=null,Nl=!1},t.isValidAttribute=function(Y,f,O){So||Wl({});let q=dt(Y),Ue=dt(f);return Kd(q,Ue,O)},t.addHook=function(Y,f){typeof f=="function"&&ta(ht[Y],f)},t.removeHook=function(Y,f){if(f!==void 0){let O=q_(ht[Y],f);return O===-1?void 0:G_(ht[Y],O,1)[0]}return zh(ht[Y])},t.removeHooks=function(Y){ht[Y]=[]},t.removeAllHooks=function(){ht=$h()},t}var Xh=Qh();var Wi=class o{renderer;constructor(){this.renderer=new qo,this.configureRenderer()}configureRenderer(){let t=this.renderer.link.bind(this.renderer);this.renderer.link=e=>{let i=this.isExternalLink(e.href),n=t(e);if(i){n=n.replace("<a ",'<a target="_blank" rel="noopener noreferrer" ');let r=e.title?`${e.text} - ${e.title} (opens in new tab)`:`${e.text} (opens in new tab)`;n=n.replace("<a ",`<a aria-label="${this.escapeHtml(r)}" `),n=n.replace("</a>",'<span class="external-link-icon" aria-hidden="true">\u2197</span></a>')}return n}}isExternalLink(t){if(!t||t.startsWith("/")||t.startsWith("#")||t.startsWith("?"))return!1;if(t.startsWith("//"))return!0;try{return new URL(t,window.location.href).hostname!==window.location.hostname}catch{return!1}}escapeHtml(t){let e={"&":"&","<":"<",">":">",'"':""","'":"'"};return t.replace(/[&<>"']/g,i=>e[i]||i)}parse(t){return ee(this,null,function*(){let e=yield Ae.parse(t,{renderer:this.renderer,breaks:!0,gfm:!0});return Xh.sanitize(e,{ADD_TAGS:["span"],ADD_ATTR:["aria-hidden","aria-label","target","rel"],ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))/i})})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var db=["buttonContainer"],mb=["freeTextInput"],pb=(o,t)=>t.value;function hb(o,t){o&1&&(s(0,"mat-icon",10),p(1,"keyboard_return"),l())}function ub(o,t){if(o&1){let e=M();s(0,"button",8),_("click",function(){let n=v(e).$implicit,r=u(2);return y(r.onOptionClick(n.value))}),s(1,"span",9),p(2),l(),C(3,hb,2,0,"mat-icon",10),l()}if(o&2){let e=t.$implicit,i=t.$index,n=u(2);E("highlighted",i===n.highlightedIndex),w("disabled",e.disabled)("id","choice-option-"+i),K("aria-selected",i===n.highlightedIndex),d(2),F(e.label),d(),x(i===n.highlightedIndex?3:-1)}}function gb(o,t){if(o&1){let e=M();s(0,"div",6)(1,"span",11),p(2,"Or type your own answer:"),l(),s(3,"div",12)(4,"input",13,1),B("ngModelChange",function(n){v(e);let r=u(2);return j(r.freeTextValue,n)||(r.freeTextValue=n),y(n)}),_("keydown",function(n){v(e);let r=u(2);return y(r.onFreeTextKeyDown(n))}),l(),s(6,"button",14),_("click",function(){v(e);let n=u(2);return y(n.onFreeTextSubmit())}),s(7,"mat-icon"),p(8,"send"),l()()()()}if(o&2){let e=u(2);d(4),z("ngModel",e.freeTextValue),d(2),w("disabled",!e.freeTextValue.trim())}}function fb(o,t){if(o&1&&(s(0,"div",7)(1,"mat-icon"),p(2,"search"),l(),s(3,"span"),p(4),l()()),o&2){let e=u(2);d(4),F(e.searchText)}}function _b(o,t){if(o&1){let e=M();s(0,"div",2),I(1,"div",3),Jn(2,"async"),s(3,"div",4,0),_("keydown",function(n){v(e);let r=u();return y(r.onKeyDown(n))}),xe(5,ub,4,7,"button",5,pb),l(),C(7,gb,9,2,"div",6),C(8,fb,5,1,"div",7),l()}if(o&2){let e=u();d(),w("innerHTML",Cm(2,4,e.renderedLabel$),Kt),d(2),K("aria-activedescendant","choice-option-"+e.highlightedIndex),d(2),we(e.options),d(2),x(e.allowFreeText?7:-1),d(),x(e.searchText?8:-1)}}var Go=class o{options=[];allowFreeText=!1;set labelHtml(t){typeof t=="object"?this.renderedLabelSubject.next(t):this.renderLabelMarkdown(t)}isVisible=!1;choiceSelected=new U;buttonContainer;freeTextInput;highlightedIndex=0;searchText="";freeTextValue="";searchTimeout;destroy$=new R;renderedLabelSubject=new le("");renderedLabel$=this.renderedLabelSubject.asObservable();sanitizer=m(Di);markdownService=m(Wi);ngOnDestroy(){this.renderedLabelSubject.complete(),this.destroy$.next(),this.destroy$.complete(),this.searchTimeout&&clearTimeout(this.searchTimeout)}ngAfterViewInit(){this.isVisible&&this.buttonContainer&&setTimeout(()=>this.focusContainer(),100)}ngOnChanges(t){t.isVisible&&t.isVisible.currentValue&&!t.isVisible.previousValue&&(this.highlightedIndex=0,setTimeout(()=>this.focusContainer(),150)),t.options&&!t.options.firstChange&&(this.highlightedIndex=0,this.searchText="",this.freeTextValue="")}focusContainer(){this.buttonContainer?.nativeElement&&this.buttonContainer.nativeElement.focus()}onKeyDown(t){if(this.options.filter(i=>!i.disabled).length!==0)switch(t.key){case"ArrowDown":t.preventDefault(),this.moveHighlight(1);break;case"ArrowUp":t.preventDefault(),this.moveHighlight(-1);break;case"Enter":case" ":t.preventDefault(),this.selectHighlighted();break;case"Home":t.preventDefault(),this.highlightFirst();break;case"End":t.preventDefault(),this.highlightLast();break;case"Escape":t.preventDefault();break;default:t.key.length===1&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&this.handleTypeAhead(t.key);break}}moveHighlight(t){let e=this.options.map((r,a)=>({opt:r,idx:a})).filter(({opt:r})=>!r.disabled).map(({idx:r})=>r);if(e.length===0)return;let n=e.findIndex(r=>r===this.highlightedIndex)+t;if(n>=0&&n<e.length){let r=e[n];r!==void 0&&(this.highlightedIndex=r,this.scrollToHighlighted())}else if(t===1&&n>=e.length){let r=e[0];r!==void 0&&(this.highlightedIndex=r,this.scrollToHighlighted())}else if(t===-1&&n<0){let r=e[e.length-1];r!==void 0&&(this.highlightedIndex=r,this.scrollToHighlighted())}}highlightFirst(){let t=this.options.findIndex(e=>!e.disabled);t>=0&&(this.highlightedIndex=t,this.scrollToHighlighted())}highlightLast(){let t=this.options.map((e,i)=>({opt:e,idx:i})).filter(({opt:e})=>!e.disabled).map(({idx:e})=>e);if(t.length>0){let e=t[t.length-1];e!==void 0&&(this.highlightedIndex=e,this.scrollToHighlighted())}}scrollToHighlighted(){setTimeout(()=>{let t=document.getElementById("choice-option-"+this.highlightedIndex);t&&t.scrollIntoView({block:"nearest",behavior:"smooth"})},0)}selectHighlighted(){let t=this.options[this.highlightedIndex];t&&!t.disabled&&this.onOptionClick(t.value)}handleTypeAhead(t){this.searchText+=t.toLowerCase();let e=this.options.findIndex(i=>!i.disabled&&i.label.toLowerCase().startsWith(this.searchText));e>=0&&(this.highlightedIndex=e,this.scrollToHighlighted()),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchText=""},1e3)}onOptionClick(t){this.choiceSelected.emit(t)}onFreeTextSubmit(){let t=this.freeTextValue.trim();t&&(this.freeTextValue="",this.choiceSelected.emit(t))}onFreeTextKeyDown(t){t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),this.onFreeTextSubmit())}renderLabelMarkdown(t){return ee(this,null,function*(){if(!t){this.renderedLabelSubject.next(this.sanitizer.bypassSecurityTrustHtml(""));return}try{let e=yield this.markdownService.parse(t);this.renderedLabelSubject.next(this.sanitizer.bypassSecurityTrustHtml(e))}catch(e){console.error("[CHOICE-SELECT] Error parsing label markdown:",e),this.renderedLabelSubject.next(this.sanitizer.bypassSecurityTrustHtml(t))}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-choice-select"]],viewQuery:function(e,i){if(e&1&&(Q(db,5),Q(mb,5)),e&2){let n;H(n=W())&&(i.buttonContainer=n.first),H(n=W())&&(i.freeTextInput=n.first)}},inputs:{options:"options",allowFreeText:"allowFreeText",labelHtml:"labelHtml",isVisible:"isVisible"},outputs:{choiceSelected:"choiceSelected"},features:[tt],decls:1,vars:1,consts:[["buttonContainer",""],["freeTextInput",""],[1,"choice-container"],[1,"choice-label",3,"innerHTML"],["role","listbox","tabindex","0",1,"choice-buttons",3,"keydown"],["type","button","role","option",1,"choice-button",3,"highlighted","disabled","id"],[1,"free-text-section"],[1,"search-indicator"],["type","button","role","option",1,"choice-button",3,"click","disabled","id"],[1,"choice-button-label"],[1,"choice-button-icon"],[1,"free-text-hint"],[1,"free-text-input-row"],["type","text","placeholder","Type a custom answer\u2026","aria-label","Custom answer",1,"free-text-input",3,"ngModelChange","keydown","ngModel"],["type","button","aria-label","Send custom answer",1,"free-text-send-btn",3,"click","disabled"]],template:function(e,i){e&1&&C(0,_b,9,6,"div",2),e&2&&x(i.isVisible?0:-1)},dependencies:[Oe,he,je,Le,Ve,ze,Tm],styles:[".choice-container[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:1rem}.choice-label[_ngcontent-%COMP%]{display:block;font-weight:500;color:var(--color-text);font-size:1rem;line-height:1.5}.choice-label[_ngcontent-%COMP%] p{margin:0 0 .5rem}.choice-label[_ngcontent-%COMP%] p:last-child{margin-bottom:0}.choice-label[_ngcontent-%COMP%] code{background:var(--color-code-bg);padding:.2em .4em;border-radius:4px;font-family:monospace;font-size:.9em}.choice-label[_ngcontent-%COMP%] strong{font-weight:600}.choice-buttons[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;max-height:400px;overflow-y:auto;padding:.5rem;background:var(--color-background);border:2px solid var(--color-border);border-radius:12px;outline:none}.choice-buttons[_ngcontent-%COMP%]:focus-within{border-color:var(--color-primary);box-shadow:0 0 0 3px #007aff1a}.choice-buttons[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.choice-buttons[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:var(--color-background);border-radius:4px}.choice-buttons[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-border);border-radius:4px}.choice-buttons[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text-secondary)}.choice-button[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;width:100%;padding:.75rem 1rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-background);color:var(--color-text);font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,system-ui,sans-serif;font-size:1rem;text-align:left;cursor:pointer;transition:all .2s ease}.choice-button[_ngcontent-%COMP%]:hover:not(:disabled):not(.highlighted){background:var(--color-bg-hover);border-color:var(--color-primary);transform:translate(2px)}.choice-button.highlighted[_ngcontent-%COMP%]{background:var(--color-primary);color:#fff;border-color:var(--color-primary);box-shadow:0 2px 8px #007aff4d}.choice-button.highlighted[_ngcontent-%COMP%] .choice-button-icon[_ngcontent-%COMP%]{color:#fff}.choice-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.choice-button[_ngcontent-%COMP%]:focus{outline:none}.choice-button-label[_ngcontent-%COMP%]{flex:1;line-height:1.5}.choice-button-icon[_ngcontent-%COMP%]{flex-shrink:0;margin-left:.5rem;font-size:1.2rem;width:1.2rem;height:1.2rem}.free-text-section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.free-text-hint[_ngcontent-%COMP%]{font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.free-text-input-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.free-text-input[_ngcontent-%COMP%]{flex:1;padding:.625rem .875rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-background);color:var(--color-text);font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,system-ui,sans-serif;font-size:1rem;outline:none;transition:border-color .2s ease,box-shadow .2s ease}.free-text-input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary);box-shadow:0 0 0 3px #007aff1a}.free-text-input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);opacity:.7}.free-text-send-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;flex-shrink:0;border:none;border-radius:8px;background:var(--color-primary);color:#fff;cursor:pointer;transition:background .2s ease,opacity .2s ease}.free-text-send-btn[_ngcontent-%COMP%]:hover:not(:disabled){opacity:.9}.free-text-send-btn[_ngcontent-%COMP%]:disabled{opacity:.4;cursor:not-allowed}.free-text-send-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.2rem;width:1.2rem;height:1.2rem}.search-indicator[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem;background:var(--color-primary);color:#fff;border-radius:8px;font-size:.9rem;font-weight:500;animation:_ngcontent-%COMP%_fadeIn .2s ease}.search-indicator[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1rem;width:1rem;height:1rem;color:#fff}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 480px){.choice-container[_ngcontent-%COMP%]{gap:.75rem}.choice-label[_ngcontent-%COMP%]{font-size:.95rem}.choice-buttons[_ngcontent-%COMP%]{max-height:300px;gap:.375rem}.choice-button[_ngcontent-%COMP%]{font-size:.95rem;padding:.625rem .875rem}}@media print{.choice-buttons[_ngcontent-%COMP%]{max-height:none;overflow:visible}.search-indicator[_ngcontent-%COMP%]{display:none!important}}"]})};var Yo=class o{welcomeMessages=["Welcome to Coday","Bienvenue sur Coday","Bienvenido a Coday","Willkommen bei Coday","Benvenuto su Coday","Bem-vindo ao Coday","Welkom bij Coday","\u0414\u043E\u0431\u0440\u043E \u043F\u043E\u0436\u0430\u043B\u043E\u0432\u0430\u0442\u044C \u0432 Coday","Coday \u3078\u3088\u3046\u3053\u305D","\u6B22\u8FCE\u6765\u5230 Coday","Coday \uC5D0 \uC624\uC2E0 \uAC83\uC744 \uD658\uC601\uD569\uB2C8\uB2E4","\u0645\u0631\u062D\u0628\u064B\u0627 \u0628\u0643 \u0641\u064A Coday"];currentWelcomeIndex=0;currentWelcomeMessage=this.welcomeMessages[0];welcomeRotationInterval;ngOnInit(){this.startWelcomeRotation()}ngOnDestroy(){this.stopWelcomeRotation()}startWelcomeRotation(){this.welcomeRotationInterval=window.setInterval(()=>{this.currentWelcomeIndex=(this.currentWelcomeIndex+1)%this.welcomeMessages.length,this.currentWelcomeMessage=this.welcomeMessages[this.currentWelcomeIndex]},3e3)}stopWelcomeRotation(){this.welcomeRotationInterval&&(clearInterval(this.welcomeRotationInterval),this.welcomeRotationInterval=void 0)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-welcome-message"]],decls:2,vars:1,consts:[[1,"welcome-title"]],template:function(e,i){e&1&&(ii(0,"h1",0),p(1),ni()),e&2&&(d(),F(i.currentWelcomeMessage))},styles:[".welcome-title[_ngcontent-%COMP%]{font-size:clamp(2.5rem,6vw,4rem);font-weight:700;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% auto;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:_ngcontent-%COMP%_gradientShift 3s ease-in-out infinite;margin:0;padding:0;line-height:1.2;transition:opacity .5s ease-in-out;display:inline-block;min-height:1.2em}@media (max-width: 768px){.welcome-title[_ngcontent-%COMP%]{font-size:clamp(2rem,5vw,3rem)}}@media (max-width: 480px){.welcome-title[_ngcontent-%COMP%]{font-size:clamp(1.5rem,4vw,2rem)}}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0% center}50%{background-position:100% center}to{background-position:0% center}}"]})};var bb=["inputElement"];function vb(o,t){if(o&1&&(s(0,"span",3),p(1),l()),o&2){let e=u();d(),F(e.label)}}function yb(o,t){if(o&1&&(s(0,"small",5),p(1),l()),o&2){let e=u();d(),F(e.hint)}}var Ws=class o{label="";placeholder="";hint="";isDisabled=!1;value="";autoFocus=!0;valueChange=new U;enterPressed=new U;inputElement;inputValue="";ngAfterViewInit(){this.inputValue=this.value,this.autoFocus&&setTimeout(()=>this.inputElement?.nativeElement.focus(),100)}onValueChange(t){this.valueChange.emit(t)}onEnter(){this.inputValue.trim()&&this.enterPressed.emit(this.inputValue.trim())}focus(){this.inputElement?.nativeElement.focus()}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-text-input"]],viewQuery:function(e,i){if(e&1&&Q(bb,5),e&2){let n;H(n=W())&&(i.inputElement=n.first)}},inputs:{label:"label",placeholder:"placeholder",hint:"hint",isDisabled:"isDisabled",value:"value",autoFocus:"autoFocus"},outputs:{valueChange:"valueChange",enterPressed:"enterPressed"},decls:6,vars:5,consts:[["inputElement",""],[1,"text-input-container"],[1,"text-input-wrapper"],[1,"text-input-label"],["type","text",1,"text-input-field",3,"ngModelChange","keydown.enter","ngModel","placeholder","disabled"],[1,"text-input-hint"]],template:function(e,i){if(e&1){let n=M();s(0,"div",1)(1,"label",2),C(2,vb,2,1,"span",3),s(3,"input",4,0),B("ngModelChange",function(a){return v(n),j(i.inputValue,a)||(i.inputValue=a),y(a)}),_("ngModelChange",function(a){return v(n),y(i.onValueChange(a))})("keydown.enter",function(){return v(n),y(i.onEnter())}),l()(),C(5,yb,2,1,"small",5),l()}e&2&&(d(2),x(i.label?2:-1),d(),z("ngModel",i.inputValue),w("placeholder",i.placeholder)("disabled",i.isDisabled),d(2),x(i.hint?5:-1))},dependencies:[je,Le,Ve,ze,Pe],styles:[".text-input-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%}.text-input-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%;cursor:text}.text-input-label[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text);margin:0}.text-input-field[_ngcontent-%COMP%]{width:100%;padding:.75rem 1rem;font-size:1rem;color:var(--color-text);background:var(--color-bg);border:1px solid var(--color-border);border-radius:8px;outline:none;transition:all .2s ease}.text-input-field[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);opacity:.7}.text-input-field[_ngcontent-%COMP%]:focus{border-color:var(--color-primary);box-shadow:0 0 0 3px rgba(var(--color-primary-rgb),.1)}.text-input-field[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed;background:var(--color-surface)}.text-input-hint[_ngcontent-%COMP%]{font-size:.85rem;color:var(--color-text-secondary);margin:0;font-style:italic}@media (max-width: 768px){.text-input-field[_ngcontent-%COMP%]{padding:.65rem .85rem;font-size:.95rem}.text-input-label[_ngcontent-%COMP%]{font-size:.9rem}.text-input-hint[_ngcontent-%COMP%]{font-size:.8rem}}"]})};var Cb=["nameInput"],xb=["pathInput"];function wb(o,t){if(o&1&&(s(0,"div",7),p(1),l()),o&2){let e=u();d(),F(e.errorMessage)}}var Us=class o{isCreating=!1;create=new U;cancelled=new U;nameInput;pathInput;projectName="";projectPath="";errorMessage="";isValid(){return this.projectName.trim()!==""&&this.projectPath.trim()!==""}onNameEnter(){this.projectName.trim()&&setTimeout(()=>this.pathInput?.focus(),50)}onCreate(){this.isValid()?(this.errorMessage="",this.create.emit({name:this.projectName.trim(),path:this.projectPath.trim()})):this.errorMessage="Both name and path are required"}onCancel(){this.cancelled.emit()}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-project-create"]],viewQuery:function(e,i){if(e&1&&(Q(Cb,5),Q(xb,5)),e&2){let n;H(n=W())&&(i.nameInput=n.first),H(n=W())&&(i.pathInput=n.first)}},inputs:{isCreating:"isCreating"},outputs:{create:"create",cancelled:"cancelled"},decls:14,vars:10,consts:[["nameInput",""],["pathInput",""],[1,"project-create"],[1,"create-title"],[1,"create-form"],["label","Project Name","placeholder","my-project",3,"valueChange","enterPressed","value","isDisabled","autoFocus"],["label","Project Path","placeholder","/path/to/project","hint","Absolute path to the project directory",3,"valueChange","enterPressed","value","isDisabled","autoFocus"],[1,"error-message"],[1,"form-actions"],["matButton","",3,"click","disabled"],["matButton","filled",3,"click","disabled"]],template:function(e,i){if(e&1){let n=M();s(0,"div",2)(1,"h3",3),p(2,"Create New Project"),l(),s(3,"div",4)(4,"app-text-input",5,0),_("valueChange",function(a){return v(n),y(i.projectName=a)})("enterPressed",function(){return v(n),y(i.onNameEnter())}),l(),s(6,"app-text-input",6,1),_("valueChange",function(a){return v(n),y(i.projectPath=a)})("enterPressed",function(){return v(n),y(i.onCreate())}),l(),C(8,wb,2,1,"div",7),l(),s(9,"div",8)(10,"button",9),_("click",function(){return v(n),y(i.onCancel())}),p(11,"Cancel"),l(),s(12,"button",10),_("click",function(){return v(n),y(i.onCreate())}),p(13),l()()()}e&2&&(d(4),w("value",i.projectName)("isDisabled",i.isCreating)("autoFocus",!0),d(2),w("value",i.projectPath)("isDisabled",i.isCreating)("autoFocus",!1),d(2),x(i.errorMessage?8:-1),d(2),w("disabled",i.isCreating),d(2),w("disabled",!i.isValid()||i.isCreating),d(),te(" ",i.isCreating?"Creating...":"Create Project"," "))},dependencies:[Pe,Ws,Et],styles:[".project-create[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding:1rem;animation:_ngcontent-%COMP%_slideIn .3s ease-out}.create-title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text);text-align:center}.create-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.error-message[_ngcontent-%COMP%]{padding:.75rem 1rem;background:#dc26261a;border:1px solid rgba(220,38,38,.3);border-radius:8px;color:var(--color-error);font-size:.9rem;text-align:center}.form-actions[_ngcontent-%COMP%]{display:flex;gap:1rem;justify-content:flex-end;margin-top:.5rem}@keyframes _ngcontent-%COMP%_slideIn{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 768px){.project-create[_ngcontent-%COMP%]{gap:1.25rem;padding:.75rem}.create-title[_ngcontent-%COMP%]{font-size:1.3rem}.form-actions[_ngcontent-%COMP%]{flex-direction:column-reverse;gap:.75rem}}@media (max-width: 480px){.project-create[_ngcontent-%COMP%]{gap:1rem;padding:.5rem}.create-title[_ngcontent-%COMP%]{font-size:1.2rem}}"]})};function Sb(o,t){if(o&1){let e=M();s(0,"app-project-create",10),_("create",function(n){v(e);let r=u();return y(r.onCreateProject(n))})("cancelled",function(){v(e);let n=u();return y(n.closeCreateForm())}),l()}if(o&2){let e=u();w("isCreating",e.isCreating)}}function kb(o,t){o&1&&(s(0,"div",6),I(1,"div",11),s(2,"p",12),p(3,"Loading projects..."),l()())}function Mb(o,t){if(o&1&&(s(0,"div",7)(1,"p",13),p(2),l()()),o&2){let e=u();d(2),F(e.error)}}function Tb(o,t){if(o&1){let e=M();s(0,"app-choice-select",14),_("choiceSelected",function(n){v(e);let r=u();return y(r.selectProject(n))}),l()}if(o&2){let e=u();w("options",e.projectOptions())("labelHtml","Select a project to continue")("isVisible",!0)}}function Eb(o,t){if(o&1){let e=M();s(0,"div",9)(1,"p",15),p(2,"No projects available."),l(),s(3,"button",16),_("click",function(){v(e);let n=u();return y(n.openCreateForm())}),p(4,"Create your first project"),l()()}}var $s=class o{isLoading=!1;error=null;showCreateForm=!1;isCreating=!1;router=m(Pn);projectStateService=m(Se);projects=_t(this.projectStateService.projectList$);forcedProject=_t(this.projectStateService.forcedProject$);projectOptions=hi(()=>{let t=this.projects();if(!t)return[];let e=t.filter(a=>!a.volatile),i=t.filter(a=>a.volatile),r=[...e,...i].map(a=>({value:a.name,label:a.volatile?`${a.name} \u{1F538}temp`:a.name}));return t.length>0&&r.push({value:"__new_project__",label:"New project..."}),r});showCreateButton=hi(()=>!this.forcedProject());constructor(){this.projectStateService.selectedProject$.pipe(nn(),ce(t=>!!t),ce(()=>this.router.url.split("?")[0]==="/"),Ut(1)).subscribe(t=>{console.log(`\u{1F43C} navigate to ${t.name}`),this.router.navigate(["project",t.name])})}selectProject(t){if(t==="__new_project__"){this.openCreateForm();return}this.projectStateService.selectProject(t)}openCreateForm(){this.showCreateForm=!0}closeCreateForm(){this.showCreateForm=!1,this.isCreating=!1}onCreateProject(t){this.isCreating=!0,this.error=null,this.projectStateService.createProject(t.name,t.path).subscribe({next:e=>{console.log("[PROJECT-SELECTION] Project created:",e.message),this.isCreating=!1,this.closeCreateForm(),this.selectProject(t.name)},error:e=>{console.error("[PROJECT-SELECTION] Error creating project:",e),this.error=e.error?.error||"Failed to create project",this.isCreating=!1}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-project-selection"]],decls:11,vars:1,consts:[[1,"project-selection"],[1,"centered-content"],[1,"welcome-section"],[1,"choice-section"],[1,"choice-glass"],[3,"isCreating"],[1,"loading-container"],[1,"error-container"],[3,"options","labelHtml","isVisible"],[1,"no-projects-container"],[3,"create","cancelled","isCreating"],[1,"loading-spinner"],[1,"loading-text"],[1,"error-text"],[3,"choiceSelected","options","labelHtml","isVisible"],[1,"no-projects-text"],["matButton","filled","color","primary",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"div",2),I(3,"app-welcome-message"),l(),s(4,"div",3)(5,"div",4),C(6,Sb,1,1,"app-project-create",5)(7,kb,4,0,"div",6)(8,Mb,3,1,"div",7)(9,Tb,1,3,"app-choice-select",8)(10,Eb,5,0,"div",9),l()()()()),e&2&&(d(6),x(i.showCreateForm?6:i.isLoading?7:i.error?8:i.projects()&&i.projects().length>0?9:10))},dependencies:[Pe,Go,Yo,Us,Et],styles:[".project-selection[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:100vh;width:100%;overflow:hidden;background:var(--color-bg);padding:2rem}.centered-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3rem;width:100%;max-width:800px;animation:_ngcontent-%COMP%_fadeIn .6s ease-out}.welcome-section[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_slideUp .8s ease-out}.choice-section[_ngcontent-%COMP%]{width:100%;animation:_ngcontent-%COMP%_slideUp .8s ease-out .2s both}.choice-glass[_ngcontent-%COMP%]{background:var(--color-surface);border:1px solid var(--color-border);border-radius:12px;padding:1.5rem;box-shadow:0 4px 6px #0000001a;transition:all .3s ease}.choice-glass[_ngcontent-%COMP%]:hover{box-shadow:0 8px 12px #00000026}.loading-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:1rem;padding:2rem}.loading-spinner[_ngcontent-%COMP%]{width:40px;height:40px;border:3px solid var(--color-border);border-top-color:var(--color-primary);border-radius:50%;animation:_ngcontent-%COMP%_spin 1s linear infinite}.loading-text[_ngcontent-%COMP%]{color:var(--color-text-secondary);margin:0}.error-container[_ngcontent-%COMP%]{padding:2rem;text-align:center}.error-text[_ngcontent-%COMP%]{color:var(--color-error);margin:0}.no-projects-container[_ngcontent-%COMP%]{padding:2rem;text-align:center}.no-projects-text[_ngcontent-%COMP%]{color:var(--color-text);margin:0 0 1rem;font-size:1.1rem}.no-projects-hint[_ngcontent-%COMP%]{color:var(--color-text-secondary);margin:0;font-size:.9rem}.create-action[_ngcontent-%COMP%]{margin-top:1.5rem;padding-top:1.5rem;border-top:1px solid var(--color-border);display:flex;justify-content:center}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0}to{opacity:1}}@keyframes _ngcontent-%COMP%_slideUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}@media (max-width: 768px){.project-selection[_ngcontent-%COMP%]{padding:1.5rem}.centered-content[_ngcontent-%COMP%]{gap:2rem}.choice-glass[_ngcontent-%COMP%]{padding:1rem}}@media (max-width: 480px){.project-selection[_ngcontent-%COMP%]{padding:1rem}.centered-content[_ngcontent-%COMP%]{gap:1.5rem}.choice-glass[_ngcontent-%COMP%]{padding:.75rem}.create-action[_ngcontent-%COMP%]{margin-top:1rem;padding-top:1rem}}"]})};var nt=class o{STORAGE_KEY="coday-preferences";isDesktopApp=!1;electronStorage=null;voiceLanguageSubject=new le("en-US");voiceLanguage$=this.voiceLanguageSubject.asObservable();enterToSendSubject=new le(!0);enterToSend$=this.enterToSendSubject.asObservable();voiceAnnounceEnabledSubject=new le(!1);voiceAnnounceEnabled$=this.voiceAnnounceEnabledSubject.asObservable();voiceModeSubject=new le("speech");voiceMode$=this.voiceModeSubject.asObservable();voiceReadFullTextSubject=new le(!1);voiceReadFullText$=this.voiceReadFullTextSubject.asObservable();voiceVolumeSubject=new le(.8);voiceVolume$=this.voiceVolumeSubject.asObservable();voiceRateSubject=new le(1.2);voiceRate$=this.voiceRateSubject.asObservable();selectedVoiceSubject=new le(null);selectedVoice$=this.selectedVoiceSubject.asObservable();printTechnicalMessagesSubject=new le(!1);printTechnicalMessages$=this.printTechnicalMessagesSubject.asObservable();hideTechnicalMessagesSubject=new le(!0);hideTechnicalMessages$=this.hideTechnicalMessagesSubject.asObservable();hideWarningMessagesSubject=new le(!1);hideWarningMessages$=this.hideWarningMessagesSubject.asObservable();agentNotificationEnabledSubject=new le(!1);agentNotificationEnabled$=this.agentNotificationEnabledSubject.asObservable();notificationSoundEnabledSubject=new le(!1);notificationSoundEnabled$=this.notificationSoundEnabledSubject.asObservable();browserNotificationEnabledSubject=new le(!1);browserNotificationEnabled$=this.browserNotificationEnabledSubject.asObservable();constructor(){console.log("[PREFERENCES] Initializing preferences service"),typeof window<"u"&&window.codayDesktop?.storage&&(this.isDesktopApp=!0,this.electronStorage=window.codayDesktop.storage,console.log("[PREFERENCES] Running in desktop app mode with persistent storage")),this.initializePreferences()}initializePreferences(){this.isDesktopApp?this.loadPreferencesAsync():this.loadPreferencesSync()}loadPreferencesSync(){let t=this.getPreferenceSync("voiceLanguage","en-US")??"en-US";this.voiceLanguageSubject.next(t),console.log("[PREFERENCES] Voice language initialized to:",t);let e=this.getPreferenceSync("useEnterToSend",!0)??!0;this.enterToSendSubject.next(e),console.log("[PREFERENCES] Enter to send initialized to:",e);let i=this.getPreferenceSync("voiceAnnounceEnabled",!1)??!1;this.voiceAnnounceEnabledSubject.next(i);let n=this.getPreferenceSync("voiceMode","speech")??"speech";this.voiceModeSubject.next(n);let r=this.getPreferenceSync("voiceReadFullText",!1)??!1;this.voiceReadFullTextSubject.next(r);let a=this.getPreferenceSync("voiceVolume",.8)??.8;this.voiceVolumeSubject.next(a);let c=this.getPreferenceSync("voiceRate",1.2)??1.2;this.voiceRateSubject.next(c);let h=this.getPreferenceSync("selectedVoice",null)??null;this.selectedVoiceSubject.next(h);let g=this.getPreferenceSync("printTechnicalMessages",!1)??!1;this.printTechnicalMessagesSubject.next(g);let b=this.getPreferenceSync("hideTechnicalMessages",!0)??!0;this.hideTechnicalMessagesSubject.next(b);let S=this.getPreferenceSync("hideWarningMessages",!1)??!1;this.hideWarningMessagesSubject.next(S);let P=this.getPreferenceSync("agentNotificationEnabled",!1)??!1;this.agentNotificationEnabledSubject.next(P);let N=this.getPreferenceSync("notificationSoundEnabled",!0)??!0;this.notificationSoundEnabledSubject.next(N);let k=this.getPreferenceSync("browserNotificationEnabled",!1)??!1;this.browserNotificationEnabledSubject.next(k),console.log("[PREFERENCES] All preferences initialized successfully")}loadPreferencesAsync(){return ee(this,null,function*(){let t=(yield this.getPreferenceAsync("voiceLanguage","en-US"))??"en-US";this.voiceLanguageSubject.next(t),console.log("[PREFERENCES] Voice language initialized to:",t);let e=(yield this.getPreferenceAsync("useEnterToSend",!0))??!0;this.enterToSendSubject.next(e),console.log("[PREFERENCES] Enter to send initialized to:",e);let i=(yield this.getPreferenceAsync("voiceAnnounceEnabled",!1))??!1;this.voiceAnnounceEnabledSubject.next(i);let n=(yield this.getPreferenceAsync("voiceMode","speech"))??"speech";this.voiceModeSubject.next(n);let r=(yield this.getPreferenceAsync("voiceReadFullText",!1))??!1;this.voiceReadFullTextSubject.next(r);let a=(yield this.getPreferenceAsync("voiceVolume",.8))??.8;this.voiceVolumeSubject.next(a);let c=(yield this.getPreferenceAsync("voiceRate",1.2))??1.2;this.voiceRateSubject.next(c);let h=(yield this.getPreferenceAsync("selectedVoice",null))??null;this.selectedVoiceSubject.next(h);let g=(yield this.getPreferenceAsync("printTechnicalMessages",!1))??!1;this.printTechnicalMessagesSubject.next(g);let b=(yield this.getPreferenceAsync("hideTechnicalMessages",!0))??!0;this.hideTechnicalMessagesSubject.next(b);let S=(yield this.getPreferenceAsync("hideWarningMessages",!1))??!1;this.hideWarningMessagesSubject.next(S);let P=(yield this.getPreferenceAsync("agentNotificationEnabled",!1))??!1;this.agentNotificationEnabledSubject.next(P);let N=(yield this.getPreferenceAsync("notificationSoundEnabled",!0))??!0;this.notificationSoundEnabledSubject.next(N);let k=(yield this.getPreferenceAsync("browserNotificationEnabled",!1))??!1;this.browserNotificationEnabledSubject.next(k),console.log("[PREFERENCES] All preferences initialized successfully (async)")})}getPreference(t,e){return this.getPreferenceSync(t,e)}getPreferenceSync(t,e){try{let i=localStorage.getItem(this.STORAGE_KEY);if(!i)return e;let n=JSON.parse(i);return n[t]!==void 0?n[t]:e}catch{return e}}getPreferenceAsync(t,e){return ee(this,null,function*(){if(!this.electronStorage)return this.getPreferenceSync(t,e);try{let i=yield this.electronStorage.get(this.STORAGE_KEY);if(!i)return e;let n=JSON.parse(i);return n[t]!==void 0?n[t]:e}catch{return e}})}setPreference(t,e){this.isDesktopApp?this.setPreferenceAsync(t,e):this.setPreferenceSync(t,e)}setPreferenceSync(t,e){try{let i=localStorage.getItem(this.STORAGE_KEY),n=i?JSON.parse(i):{};n[t]=e,localStorage.setItem(this.STORAGE_KEY,JSON.stringify(n)),this.updateSubject(t,e)}catch(i){console.error("Failed to set preference:",i)}}setPreferenceAsync(t,e){return ee(this,null,function*(){if(!this.electronStorage){this.setPreferenceSync(t,e);return}try{let i=yield this.electronStorage.get(this.STORAGE_KEY),n=i?JSON.parse(i):{};n[t]=e,yield this.electronStorage.set(this.STORAGE_KEY,JSON.stringify(n)),this.updateSubject(t,e)}catch(i){console.error("Failed to set preference:",i)}})}updateSubject(t,e){t==="voiceLanguage"&&this.voiceLanguageSubject.next(e),t==="useEnterToSend"&&this.enterToSendSubject.next(e),t==="voiceAnnounceEnabled"&&this.voiceAnnounceEnabledSubject.next(e),t==="voiceMode"&&this.voiceModeSubject.next(e),t==="voiceReadFullText"&&this.voiceReadFullTextSubject.next(e),t==="voiceVolume"&&this.voiceVolumeSubject.next(e),t==="voiceRate"&&this.voiceRateSubject.next(e),t==="selectedVoice"&&this.selectedVoiceSubject.next(e),t==="printTechnicalMessages"&&this.printTechnicalMessagesSubject.next(e),t==="hideTechnicalMessages"&&this.hideTechnicalMessagesSubject.next(e),t==="hideWarningMessages"&&this.hideWarningMessagesSubject.next(e),t==="agentNotificationEnabled"&&this.agentNotificationEnabledSubject.next(e),t==="notificationSoundEnabled"&&this.notificationSoundEnabledSubject.next(e),t==="browserNotificationEnabled"&&this.browserNotificationEnabledSubject.next(e)}setVoiceLanguage(t){console.log("[PREFERENCES] Setting voice language to:",t),this.setPreference("voiceLanguage",t)}getVoiceLanguage(){return this.getPreference("voiceLanguage","en-US")??"en-US"}setEnterToSend(t){console.log("[PREFERENCES] Setting Enter to send to:",t),this.setPreference("useEnterToSend",t)}getEnterToSend(){return this.getPreference("useEnterToSend",!1)??!1}setVoiceAnnounceEnabled(t){console.log("[PREFERENCES] Setting voice announce enabled to:",t),this.setPreference("voiceAnnounceEnabled",t)}getVoiceAnnounceEnabled(){return this.getPreference("voiceAnnounceEnabled",!1)??!1}setVoiceMode(t){console.log("[PREFERENCES] Setting voice mode to:",t),this.setPreference("voiceMode",t)}getVoiceMode(){return this.getPreference("voiceMode","speech")??"speech"}setVoiceReadFullText(t){console.log("[PREFERENCES] Setting voice read full text to:",t),this.setPreference("voiceReadFullText",t)}getVoiceReadFullText(){return this.getPreference("voiceReadFullText",!1)??!1}setVoiceVolume(t){let e=Math.max(0,Math.min(1,t));console.log("[PREFERENCES] Setting voice volume to:",e),this.setPreference("voiceVolume",e)}getVoiceVolume(){return this.getPreference("voiceVolume",.8)??.8}setVoiceRate(t){let e=Math.max(.5,Math.min(2,t));console.log("[PREFERENCES] Setting voice rate to:",e),this.setPreference("voiceRate",e)}getVoiceRate(){return this.getPreference("voiceRate",1.2)??1.2}setSelectedVoice(t){console.log("[PREFERENCES] Setting selected voice to:",t),this.setPreference("selectedVoice",t)}getSelectedVoice(){return this.getPreference("selectedVoice",null)??null}setPrintTechnicalMessages(t){console.log("[PREFERENCES] Setting print technical messages to:",t),this.setPreference("printTechnicalMessages",t)}getPrintTechnicalMessages(){return this.getPreference("printTechnicalMessages",!1)??!1}setHideTechnicalMessages(t){console.log("[PREFERENCES] Setting hide technical messages to:",t),this.setPreference("hideTechnicalMessages",t)}getHideTechnicalMessages(){return this.getPreference("hideTechnicalMessages",!0)??!0}setHideWarningMessages(t){console.log("[PREFERENCES] Setting hide warning messages to:",t),this.setPreference("hideWarningMessages",t)}getHideWarningMessages(){return this.getPreference("hideWarningMessages",!1)??!1}setAgentNotificationEnabled(t){console.log("[PREFERENCES] Setting agent notification enabled to:",t),this.setPreference("agentNotificationEnabled",t)}getAgentNotificationEnabled(){return this.getPreference("agentNotificationEnabled",!1)??!1}setNotificationSoundEnabled(t){console.log("[PREFERENCES] Setting notification sound enabled to:",t),this.setPreference("notificationSoundEnabled",t)}getNotificationSoundEnabled(){return this.getPreference("notificationSoundEnabled",!0)??!0}setBrowserNotificationEnabled(t){console.log("[PREFERENCES] Setting browser notification enabled to:",t),this.setPreference("browserNotificationEnabled",t)}getBrowserNotificationEnabled(){return this.getPreference("browserNotificationEnabled",!1)??!1}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};function md(o,t=80){if(o.length<=t)return o;try{if(o.trim().startsWith("{")||o.trim().startsWith("[")){let e=JSON.parse(o),i=JSON.stringify(e);return i.length<=t?i:i.substring(0,t)+`...(${i.length} chars)`}}catch{}return o.substring(0,t)+"..."}var mt=class{constructor(t,e){this.type=e;if(t.timestamp)this.timestamp=t.timestamp;else{let i=Math.random().toString(36).substring(2,7);this.timestamp=`${new Date().toISOString()}-${i}`}this.parentKey=t.parentKey,this.threadId=t.threadId,this.length=0}timestamp;parentKey;static type;length;threadId;get date(){let t=this.timestamp.lastIndexOf("-");if(t>0){let e=this.timestamp.substring(t+1);if(e.length===5&&/^[a-z0-9]+$/.test(e))return new Date(this.timestamp.substring(0,t))}return new Date(this.timestamp)}},qs=class extends mt{invite;constructor(t,e){super(t,e),this.invite=t.invite}buildAnswer(t){return new Yt({answer:t,parentKey:this.timestamp,invite:this.invite})}},Qo=class o extends mt{static type="heartbeat";constructor(t){super(t,o.type)}},gn=class o extends qs{defaultValue;static type="invite";constructor(t){super(t,o.type),this.defaultValue=t.defaultValue}},pd="InviteEventDefault",Yt=class o extends mt{answer;invite;static type="answer";constructor(t){super(t,o.type),this.answer=t.answer??"No answer",this.invite=t.invite}},Ui=class o extends mt{speaker;text;static type="text";constructor(t){super(t,o.type),this.speaker=t.speaker,this.text=t.text}},Vn=class o extends mt{chunk;static type="text_chunk";constructor(t){super(t,o.type),this.chunk=t.chunk,this.length=this.chunk.length}},co=class o extends mt{warning;static type="warn";constructor(t){super(t,o.type),this.warning=t.warning}},Si=class o extends mt{error;static type="error";constructor(t){super(t,o.type),this.error=t.error}},fn=class o extends qs{options;optionalQuestion;allowFreeText;static type="choice";constructor(t){super(t,o.type),this.options=t.options,this.optionalQuestion=t.optionalQuestion,this.allowFreeText=t.allowFreeText??!1}},ki=class o extends mt{toolRequestId;name;args;static type="tool_request";constructor(t){super(t,o.type),this.toolRequestId=t.toolRequestId??this.timestamp,this.name=t.name,this.args=t.args,this.length=this.args.length+this.name.length+this.toolRequestId.length+20}buildResponse(t){return new li({output:t,toolRequestId:this.toolRequestId,parentKey:this.timestamp})}toSingleLineString(t=50){let e=md(this.args,t);return`\u{1F527} ${this.name}(${e})`}},li=class o extends mt{toolRequestId;output;static type="tool_response";constructor(t){if(super(t,o.type),this.toolRequestId=t.toolRequestId||this.timestamp||new Date().toISOString(),this.output=t.output,typeof this.output=="string")this.length=this.output.length+this.toolRequestId.length+20;else if(this.output.type==="text")this.length=this.output.content.length+this.toolRequestId.length+20;else if(this.output.type==="image"){let e=(this.output.width??0)*(this.output.height??0)/750;this.length=(e?e*3.5:this.output.content.length)+this.toolRequestId.length+20}else this.length=this.toolRequestId.length+20}getTextOutput(){return typeof this.output=="string"?this.output:this.output.type==="text"?this.output.content:this.output.type==="image"?`[Image: ${this.output.mimeType}]`:""}toSingleLineString(t=50){let e=this.getTextOutput(),i=md(e,t),n=typeof this.output!="string"&&this.output.type==="image"?" [image]":"";return`\u2B91 ${i}${n}`}},zn=class o extends mt{static type="thinking";static debounce=5e3;constructor(t){super(t,o.type)}},mo=class o extends mt{summary;static type="summary";constructor(t){super(t,o.type),this.summary=t.summary,this.length=this.summary.length}toSingleLineString(t=80){return`\u{1F4CB} Summary: ${md(this.summary,t)}`}},Mi=class o extends mt{role;name;content;static type="message";constructor(t){super(t,o.type),this.role=t.role,this.name=t.name,this.content=t.content,this.length=this.content.map(e=>{if(e.type==="text")return e.content.length;if(e.type==="image"){let i=(e.width||0)*(e.height||0)/750;return i?i*3.5:e.content.length}return 0}).reduce((e,i)=>e+i,0)}getTextContent(){return this.content.filter(t=>t.type==="text").map(t=>t.content).join(`
|
|
68
|
+
`)}},Xo=class o extends mt{threadId;name;summary;users;static type="thread_update";constructor(t){super(t,o.type),this.threadId=t.threadId,this.name=t.name,this.summary=t.summary,this.users=t.users}},jn=class o extends mt{filename;operation;size;mimeType;static type="file";constructor(t){super(t,o.type),this.filename=t.filename,this.operation=t.operation,this.size=t.size,this.mimeType=t.mimeType}toSingleLineString(){let t=this.operation==="created"?"\u{1F4C4}":this.operation==="updated"?"\u{1F4DD}":"\u{1F5D1}\uFE0F",e=this.size?` (${(this.size/1024).toFixed(1)} KB)`:"";return`${t} ${this.operation}: ${this.filename}${e}`}},Ko=class o extends mt{authUrl;state;integrationName;static type="oauth_request";constructor(t){super(t,o.type),this.authUrl=t.authUrl,this.state=t.state,this.integrationName=t.integrationName}},$i=class o extends mt{subThreadId;agentName;static type="delegation";constructor(t){super(t,o.type),this.subThreadId=t.subThreadId,this.agentName=t.agentName}},qi=class o extends mt{code;state;integrationName;error;errorDescription;static type="oauth_callback";constructor(t){super(t,o.type),this.code=t.code,this.state=t.state,this.integrationName=t.integrationName,this.error=t.error,this.errorDescription=t.errorDescription}},Pb={[Mi.type]:Mi,[Yt.type]:Yt,[fn.type]:fn,[$i.type]:$i,[Si.type]:Si,[Qo.type]:Qo,[gn.type]:gn,[ki.type]:ki,[li.type]:li,[Ui.type]:Ui,[Vn.type]:Vn,[zn.type]:zn,[co.type]:co,[Xo.type]:Xo,[mo.type]:mo,[jn.type]:jn,[Ko.type]:Ko,[qi.type]:qi};function aa(o){let t=Pb[o.type];return t?new t(o):void 0}var rT=[{id:"builtin-plan",name:"plan",description:"Build a plan to complete the given task",source:"builtin",commands:[`@ We start a 3 phase process to build a comprehensive execution plan for the following task:
|
|
69
69
|
|
|
70
70
|
<task>
|
|
71
71
|
{{PARAMETERS}}
|
|
@@ -333,11 +333,11 @@ Verify the memory system's overall health:
|
|
|
333
333
|
- List any remaining issues or concerns
|
|
334
334
|
- Provide recommendations for maintaining memory quality
|
|
335
335
|
|
|
336
|
-
This ensures the memory system stays efficient and valuable.`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""}];var yT=[Mi.type,ki.type,li.type,mo.type,gn.type,fn.type,Yt.type,$i.type];var Kh={CONFLUENCE:[],GIT:[],GIT_WORKTREE:[],GITLAB:[],JIRA:[],SLACK:[],ZENDESK:[],BASECAMP:[]},VT=Object.keys(Kh).filter(o=>Kh[o]?.length===0);var Gi=class o{eventSource=null;eventsSubject=new R;connectionStatusSubject=new le({connected:!1,reconnectAttempts:0,maxAttempts:3});reconnectAttempts=0;MAX_RECONNECT_ATTEMPTS=3;RECONNECT_DELAY=2e3;events$=this.eventsSubject.asObservable();connectionStatus$=this.connectionStatusSubject.asObservable();ngZone=m(de);connectToThread(t,e){console.log("[SSE] Connecting to thread event stream:",t,e),this.eventSource&&(console.log("[SSE] Closing existing EventSource"),this.eventSource.close());let i=`/api/projects/${t}/threads/${e}/event-stream`;console.log("[SSE] EventSource URL:",i),this.eventSource=new EventSource(i),this.setupEventHandlers()}setupEventHandlers(){this.eventSource&&(this.eventSource.onmessage=t=>{this.ngZone.run(()=>{console.log("[SSE] Message received:",t.data.substring(0,100)),this.reconnectAttempts=0,this.updateConnectionStatus(!0,0);try{let e=JSON.parse(t.data),i=aa(e);i?(console.log("[SSE] Event:",i.type),this.eventsSubject.next(i)):console.warn("[SSE] Failed to build event:",e.type)}catch(e){console.error("[SSE] Parse error:",e.message)}})},this.eventSource.onopen=()=>{this.ngZone.run(()=>{console.log("[SSE] Connection established"),this.reconnectAttempts=0,this.updateConnectionStatus(!0,0)})},this.eventSource.onerror=t=>{this.ngZone.run(()=>{console.log("[SSE] EventSource error:",t),this.eventSource?.readyState===EventSource.CLOSED&&(console.log("[SSE] Connection closed"),this.updateConnectionStatus(!1,this.reconnectAttempts),this.reconnectAttempts<this.MAX_RECONNECT_ATTEMPTS?(console.log(`[SSE] Attempting reconnect ${this.reconnectAttempts+1}/${this.MAX_RECONNECT_ATTEMPTS}`),this.eventsSubject.next(new Si({error:new Error(`Connection lost. Attempting to reconnect (${this.reconnectAttempts+1}/${this.MAX_RECONNECT_ATTEMPTS})...`)})),setTimeout(()=>{this.reconnectAttempts++,console.warn("[SSE] Reconnection may not work properly with thread-based connections")},this.RECONNECT_DELAY)):(console.log("[SSE] Max reconnection attempts reached"),this.eventsSubject.next(new Si({error:new Error("Connection lost permanently. Please refresh the page.")}))))})})}disconnect(){this.eventSource&&(console.log("[SSE] Disconnecting EventSource"),this.eventSource.close(),this.eventSource=null,this.updateConnectionStatus(!1,0))}updateConnectionStatus(t,e){this.connectionStatusSubject.next({connected:t,reconnectAttempts:e,maxAttempts:this.MAX_RECONNECT_ATTEMPTS})}ngOnDestroy(){this.disconnect(),this.eventsSubject.complete(),this.connectionStatusSubject.complete()}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var Yi=class o{http=m(Ye);projectState=m(Se);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads`}listThreads(){return this.http.get(this.getBaseUrl())}getThread(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createThread(t){let e=t?{name:t}:{};return this.http.post(this.getBaseUrl(),e)}updateThread(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,{name:e})}updateThreadUsers(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,{users:e})}starThread(t){return this.http.post(`${this.getBaseUrl()}/${t}/star`,{})}unstarThread(t){return this.http.delete(`${this.getBaseUrl()}/${t}/star`)}deleteThread(t){return this.http.delete(`${this.getBaseUrl()}/${t}`)}stopThread(t){return this.http.post(`${this.getBaseUrl()}/${t}/stop`,{})}getThreadMessages(t){return this.http.get(`${this.getBaseUrl()}/${t}/messages`)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var Pt=class o{selectedThreadIdSubject=new le(null);isLoadingSubject=new le(!1);isLoadingThreadListSubject=new le(!1);refreshThreadListSubject=new R;threadListSubject=new le([]);hasLoadedOncePerProject=new Map;currentProjectName=null;isLoading$=this.isLoadingSubject.asObservable();isLoadingThreadList$=this.isLoadingThreadListSubject.asObservable();threadApi=m(Yi);projectStateService=m(Se);projectName$=this.projectStateService.selectedProject$.pipe(_e(t=>t?.name),Ea());constructor(){Gn([this.projectName$,this.refreshThreadListSubject.asObservable().pipe(kt(void 0))]).pipe(vt(([t])=>{t!==this.currentProjectName&&(console.log("[THREAD_STATE] Project changed, clearing thread list"),this.threadListSubject.next([]),this.currentProjectName=t),t?this.hasLoadedOncePerProject.get(t)?console.log("[THREAD_STATE] Refreshing thread list for project",t,"(no spinner)"):(console.log("[THREAD_STATE] Initial load for project",t,"- showing spinner"),this.isLoadingThreadListSubject.next(!0)):(console.log("[THREAD_STATE] No project selected, hiding spinner"),this.isLoadingThreadListSubject.next(!1))}),Yn(([t])=>t?(console.log("[THREAD_STATE] Fetching threads for project:",t),this.threadApi.listThreads().pipe(_e(e=>({threads:e,projectName:t})),wn(e=>(console.error("[THREAD_STATE] Error loading thread list:",e),It({threads:[],projectName:t}))))):(console.log("[THREAD_STATE] No project selected, returning empty list"),It({threads:[],projectName:null}))),vt(({threads:t,projectName:e})=>{console.log("[THREAD_STATE] Thread list loaded:",t.length,"threads for project",e),e&&this.hasLoadedOncePerProject.set(e,!0),this.isLoadingThreadListSubject.next(!1),this.threadListSubject.next(t)})).subscribe()}threadList$=this.threadListSubject.asObservable();refreshSelectedThreadSubject=new R;selectedThread$=Gn([this.projectName$,this.selectedThreadIdSubject.pipe(Ea()),this.refreshSelectedThreadSubject.pipe(kt(void 0))]).pipe(Yn(([t,e])=>!t||!e?It(null):(this.isLoadingSubject.next(!0),this.threadApi.getThread(e).pipe(Mr({bufferSize:1,refCount:!0})))),vt(()=>{this.isLoadingSubject.next(!1)}));selectThread(t){this.selectedThreadIdSubject.next(t)}getSelectedThreadId(){return this.selectedThreadIdSubject.value}getSelectedThreadIdOrThrow(){let t=this.selectedThreadIdSubject.value;if(!t)throw new Error("[THREAD_STATE] No thread selected");return t}clearSelection(){this.selectedThreadIdSubject.next(null)}stop(){let t=this.selectedThreadIdSubject.value;if(!t){console.error("[THREAD_STATE] Cannot stop: no thread selected");return}console.log("[THREAD_STATE] Stopping thread:",t),this.threadApi.stopThread(t).subscribe({next:e=>console.log("[THREAD_STATE] Stop signal sent:",e.message),error:e=>console.error("[THREAD_STATE] Error stopping thread:",e)})}refreshThreadList(){console.log("[THREAD_STATE] Manually refreshing thread list"),this.refreshThreadListSubject.next()}refreshSelectedThread(){this.refreshSelectedThreadSubject.next()}updateThreadUsers(t,e){return this.threadApi.updateThreadUsers(t,e).pipe(vt(()=>{this.refreshThreadList()}),wn(i=>(console.error("[THREAD_STATE] Error updating thread users:",i),Mo(()=>i))))}renameThread(t,e){let i=e.trim();return!i||i.length===0?(console.error("[THREAD_STATE] Cannot rename thread: name is empty after trimming"),Mo(()=>new Error("Thread name cannot be empty"))):(console.log("[THREAD_STATE] Renaming thread:",t,"to:",i),this.threadApi.updateThread(t,i).pipe(vt(n=>{console.log("[THREAD_STATE] Thread renamed successfully:",n),this.refreshThreadList()}),wn(n=>(console.error("[THREAD_STATE] Error renaming thread:",n),Mo(()=>n)))))}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var Zo=class o{http=m(Ye);projectState=m(Se);threadState=m(Pt);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads/${this.threadState.getSelectedThreadIdOrThrow()}/messages`}getMessages(){return this.http.get(this.getBaseUrl())}sendMessage(t){return this.http.post(this.getBaseUrl(),t,{responseType:"text"})}sendFreeMessage(t){return this.http.post(this.getBaseUrl(),{message:t})}getMessage(t){return this.http.get(`${this.getBaseUrl()}/${encodeURIComponent(t)}`)}deleteMessage(t){return this.http.delete(`${this.getBaseUrl()}/${encodeURIComponent(t)}`)}getFormattedMessage(t){return this.http.get(`${this.getBaseUrl()}/${encodeURIComponent(t)}/formatted`,{responseType:"text"})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var Qt=class o{destroy$=new R;currentProject=null;currentThread=null;messagesSubject=new le([]);isThinkingSubject=new le(!1);currentChoiceSubject=new le(null);projectTitleSubject=new le("Coday");currentInviteEventSubject=new le(null);messageToRestoreSubject=new le("");threadUpdateEventSubject=new le(null);currentChoiceEvent=null;thinkingTimeout=null;accumulatedChunks="";streamingTextSubject=new le("");subThreadEventsSubject=new R;subThreadEvents$=this.subThreadEventsSubject.asObservable();subThreadEventBuffers=new Map;getBufferedSubThreadEvents(t){return this.subThreadEventBuffers.get(t)??[]}messages$=this.messagesSubject.asObservable();streamingText$=this.streamingTextSubject.asObservable();isThinking$=this.isThinkingSubject.asObservable();currentChoice$=this.currentChoiceSubject.asObservable();currentInviteEvent$=this.currentInviteEventSubject.asObservable();messageToRestore$=this.messageToRestoreSubject.asObservable();threadUpdateEvent$=this.threadUpdateEventSubject.asObservable();connectionStatus$;tabTitleService=null;eventStream=m(Gi);messageApi=m(Zo);constructor(){this.connectionStatus$=this.eventStream.connectionStatus$,this.initializeEventHandling()}setTabTitleService(t){this.tabTitleService=t}connectToThread(t,e){this.currentProject=t,this.currentThread=e,this.eventStream.connectToThread(t,e)}resetMessages(){this.messagesSubject.next([]),this.currentChoiceSubject.next(null),this.currentInviteEventSubject.next(null),this.currentChoiceEvent=null,this.accumulatedChunks="",this.streamingTextSubject.next(""),this.subThreadEventBuffers.clear(),this.stopThinking()}sendMessage(t){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send message: no project or thread selected");return}let e=this.currentInviteEventSubject.value;if(e){this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive(),this.currentInviteEventSubject.next(null);let i=e.buildAnswer(t);this.handleAnswerEvent(i),this.messageApi.sendMessage(i).subscribe({error:n=>{console.error("[CODAY] Send invite answer error:",n),this.currentInviteEventSubject.next(e),this.stopThinking()}})}else this.messageApi.sendFreeMessage(t).subscribe({error:i=>{console.error("[CODAY] Send error:",i)}})}sendChoice(t){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send choice: no project or thread selected");return}if(this.currentChoiceEvent){this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive();let e=this.currentChoiceEvent.buildAnswer(t);this.currentChoiceSubject.next(null),this.currentChoiceEvent=null,this.messageApi.sendMessage(e).subscribe({next:()=>{},error:i=>{console.error("[CODAY-CHOICE] Choice error:",i),this.stopThinking()}})}else console.error("[CODAY-CHOICE] No choice event available for choice:",t)}deleteMessage(t){let e=this.messagesSubject.value.find(n=>n.id===t),i=this.extractTextContentFromMessage(e);return this.messageApi.deleteMessage(t).pipe(vt(n=>{n.success&&(this.removeMessagesFromIndex(t),i.trim()&&this.messageToRestoreSubject.next(i))}))}getCurrentProjectTitle(){return this.projectTitleSubject.value}getCurrentInviteEvent(){return this.currentInviteEventSubject.value}setThinkingForPendingMessage(){this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive()}initializeEventHandling(){this.eventStream.events$.pipe(L(this.destroy$)).subscribe({next:t=>this.handleEvent(t),error:t=>console.error("[CODAY] Event stream error:",t),complete:()=>console.log("[CODAY] Event stream completed")})}handleEvent(t){if(t.threadId&&t.threadId!==this.currentThread){let e=this.subThreadEventBuffers.get(t.threadId);e?e.push(t):this.subThreadEventBuffers.set(t.threadId,[t]),this.subThreadEventsSubject.next(t);return}t instanceof Mi?this.handleMessageEvent(t):t instanceof zn?this.handleTextChunkEvent(t):t instanceof Ui?this.handleTextEvent(t):t instanceof Yt?this.handleAnswerEvent(t):t instanceof Si?this.handleErrorEvent(t):t instanceof co?this.handleWarnEvent(t):t instanceof jn?this.handleThinkingEvent(t):t instanceof ki?this.handleToolRequestEvent(t):t instanceof li?this.handleToolResponseEvent(t):t instanceof fn?this.handleChoiceEvent(t):t instanceof Qo?this.handleHeartBeatEvent(t):t instanceof gn?this.handleInviteEvent(t):t instanceof Xo?this.handleThreadUpdateEvent(t):t instanceof $i?this.handleDelegationEvent(t):t instanceof Ko||t instanceof qi||console.warn("[CODAY] Unhandled event type:",t.type)}handleDelegationEvent(t){if(console.log("[CODAY] DelegationEvent received:",t.subThreadId,t.agentName),this.messagesSubject.value.findIndex(n=>n.subThreadId===t.subThreadId)===-1){let n={id:t.timestamp,role:"system",speaker:t.agentName,content:[{type:"text",content:""}],timestamp:new Date,type:"delegation",subThreadId:t.subThreadId,delegationAgentName:t.agentName};this.addMessage(n)}}handleThreadUpdateEvent(t){this.threadUpdateEventSubject.next(t)}handleMessageEvent(t){t.role==="assistant"&&this.accumulatedChunks&&(this.accumulatedChunks="",this.streamingTextSubject.next(""));let e={id:t.timestamp,role:t.role,speaker:t.name,content:t.content,timestamp:t.date,type:"text"};this.addMessage(e)}handleTextChunkEvent(t){this.accumulatedChunks+=t.chunk,this.streamingTextSubject.next(this.accumulatedChunks)}handleTextEvent(t){let e={id:t.timestamp,role:t.speaker?"assistant":"system",speaker:t.speaker??"System",content:[{type:"text",content:t.text}],timestamp:t.date,type:t.speaker?"text":"technical"};this.addMessage(e)}handleAnswerEvent(t){let e={id:t.timestamp,role:"user",speaker:"User",content:[{type:"text",content:t.answer}],timestamp:t.date,type:"text",parentKey:t.parentKey,invite:t.invite};this.addMessage(e)}handleErrorEvent(t){let e={id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:`Error: ${JSON.stringify(t.error)}`}],timestamp:t.date,type:"error"};this.addMessage(e)}handleWarnEvent(t){let e={id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:`Warning: ${JSON.stringify(t.warning)}`}],timestamp:t.date,type:"warning"};this.addMessage(e)}handleThinkingEvent(t){this.currentInviteEventSubject.value||this.currentChoiceEvent||(this.clearThinkingTimeout(),this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive(),this.thinkingTimeout=setTimeout(()=>{this.isThinkingSubject.next(!1),this.thinkingTimeout=null,this.tabTitleService?.setSystemInactive()},jn.debounce+1e3))}handleToolRequestEvent(t){let e={id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:t.toSingleLineString()}],timestamp:t.date,type:"technical",eventId:t.timestamp};this.addMessage(e)}handleToolResponseEvent(t){let e={id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:t.toSingleLineString()}],timestamp:t.date,type:"technical",eventId:t.timestamp};this.addMessage(e)}handleChoiceEvent(t){this.stopThinking(),this.currentChoiceEvent=t,this.tabTitleService?.setSystemInactive();let e=t.options.map(n=>({value:n,label:n})),i=t.optionalQuestion?`${t.optionalQuestion} ${t.invite}`:t.invite;this.currentChoiceSubject.next({options:e,label:i,allowFreeText:t.allowFreeText})}handleHeartBeatEvent(t){}handleInviteEvent(t){this.stopThinking();let e=this.messagesSubject.value,i=e[e.length-1];if(!(!(t.invite===pd)&&i&&i.role==="assistant"&&i.content.some(a=>a.type==="text"&&a.content.includes(t.invite)))&&t.invite!==pd){let a={id:t.timestamp,role:"assistant",speaker:"Assistant",content:[{type:"text",content:t.invite}],timestamp:t.date,type:"text"};this.addMessage(a)}this.currentInviteEventSubject.next(t),this.tabTitleService?.setSystemInactive()}addMessage(t){let e=this.messagesSubject.value;e.some(i=>i.id===t.id)||this.messagesSubject.next([...e,t])}removeMessagesFromIndex(t){let e=this.messagesSubject.value,i=e.findIndex(r=>r.id===t);if(i===-1||i===0)return;let n=e.slice(0,i);this.messagesSubject.next(n),this.stopThinking()}extractTextContentFromMessage(t){return t?t.content.filter(e=>e.type==="text").map(e=>e.content).join(`
|
|
336
|
+
This ensures the memory system stays efficient and valuable.`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""}];var vT=[Mi.type,ki.type,li.type,mo.type,gn.type,fn.type,Yt.type,$i.type];var Kh={CONFLUENCE:[],GIT:[],GIT_WORKTREE:[],GITLAB:[],JIRA:[],SLACK:[],ZENDESK:[],BASECAMP:[]},LT=Object.keys(Kh).filter(o=>Kh[o]?.length===0);var Gi=class o{eventSource=null;eventsSubject=new R;connectionStatusSubject=new le({connected:!1,reconnectAttempts:0,maxAttempts:3});reconnectAttempts=0;MAX_RECONNECT_ATTEMPTS=3;RECONNECT_DELAY=2e3;events$=this.eventsSubject.asObservable();connectionStatus$=this.connectionStatusSubject.asObservable();ngZone=m(de);connectToThread(t,e){console.log("[SSE] Connecting to thread event stream:",t,e),this.eventSource&&(console.log("[SSE] Closing existing EventSource"),this.eventSource.close());let i=`/api/projects/${t}/threads/${e}/event-stream`;console.log("[SSE] EventSource URL:",i),this.eventSource=new EventSource(i),this.setupEventHandlers()}setupEventHandlers(){this.eventSource&&(this.eventSource.onmessage=t=>{this.ngZone.run(()=>{console.log("[SSE] Message received:",t.data.substring(0,100)),this.reconnectAttempts=0,this.updateConnectionStatus(!0,0);try{let e=JSON.parse(t.data),i=aa(e);i?(console.log("[SSE] Event:",i.type),this.eventsSubject.next(i)):console.warn("[SSE] Failed to build event:",e.type)}catch(e){console.error("[SSE] Parse error:",e.message)}})},this.eventSource.onopen=()=>{this.ngZone.run(()=>{console.log("[SSE] Connection established"),this.reconnectAttempts=0,this.updateConnectionStatus(!0,0)})},this.eventSource.onerror=t=>{this.ngZone.run(()=>{console.log("[SSE] EventSource error:",t),this.eventSource?.readyState===EventSource.CLOSED&&(console.log("[SSE] Connection closed"),this.updateConnectionStatus(!1,this.reconnectAttempts),this.reconnectAttempts<this.MAX_RECONNECT_ATTEMPTS?(console.log(`[SSE] Attempting reconnect ${this.reconnectAttempts+1}/${this.MAX_RECONNECT_ATTEMPTS}`),this.eventsSubject.next(new Si({error:new Error(`Connection lost. Attempting to reconnect (${this.reconnectAttempts+1}/${this.MAX_RECONNECT_ATTEMPTS})...`)})),setTimeout(()=>{this.reconnectAttempts++,console.warn("[SSE] Reconnection may not work properly with thread-based connections")},this.RECONNECT_DELAY)):(console.log("[SSE] Max reconnection attempts reached"),this.eventsSubject.next(new Si({error:new Error("Connection lost permanently. Please refresh the page.")}))))})})}disconnect(){this.eventSource&&(console.log("[SSE] Disconnecting EventSource"),this.eventSource.close(),this.eventSource=null,this.updateConnectionStatus(!1,0))}updateConnectionStatus(t,e){this.connectionStatusSubject.next({connected:t,reconnectAttempts:e,maxAttempts:this.MAX_RECONNECT_ATTEMPTS})}ngOnDestroy(){this.disconnect(),this.eventsSubject.complete(),this.connectionStatusSubject.complete()}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var Yi=class o{http=m(Ye);projectState=m(Se);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads`}listThreads(){return this.http.get(this.getBaseUrl())}getThread(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createThread(t){let e=t?{name:t}:{};return this.http.post(this.getBaseUrl(),e)}updateThread(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,{name:e})}updateThreadUsers(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,{users:e})}starThread(t){return this.http.post(`${this.getBaseUrl()}/${t}/star`,{})}unstarThread(t){return this.http.delete(`${this.getBaseUrl()}/${t}/star`)}deleteThread(t){return this.http.delete(`${this.getBaseUrl()}/${t}`)}stopThread(t){return this.http.post(`${this.getBaseUrl()}/${t}/stop`,{})}getThreadMessages(t){return this.http.get(`${this.getBaseUrl()}/${t}/messages`)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var Pt=class o{selectedThreadIdSubject=new le(null);isLoadingSubject=new le(!1);isLoadingThreadListSubject=new le(!1);refreshThreadListSubject=new R;threadListSubject=new le([]);hasLoadedOncePerProject=new Map;currentProjectName=null;isLoading$=this.isLoadingSubject.asObservable();isLoadingThreadList$=this.isLoadingThreadListSubject.asObservable();threadApi=m(Yi);projectStateService=m(Se);projectName$=this.projectStateService.selectedProject$.pipe(_e(t=>t?.name),Ea());constructor(){qn([this.projectName$,this.refreshThreadListSubject.asObservable().pipe(kt(void 0))]).pipe(vt(([t])=>{t!==this.currentProjectName&&(console.log("[THREAD_STATE] Project changed, clearing thread list"),this.threadListSubject.next([]),this.currentProjectName=t),t?this.hasLoadedOncePerProject.get(t)?console.log("[THREAD_STATE] Refreshing thread list for project",t,"(no spinner)"):(console.log("[THREAD_STATE] Initial load for project",t,"- showing spinner"),this.isLoadingThreadListSubject.next(!0)):(console.log("[THREAD_STATE] No project selected, hiding spinner"),this.isLoadingThreadListSubject.next(!1))}),Gn(([t])=>t?(console.log("[THREAD_STATE] Fetching threads for project:",t),this.threadApi.listThreads().pipe(_e(e=>({threads:e,projectName:t})),wn(e=>(console.error("[THREAD_STATE] Error loading thread list:",e),It({threads:[],projectName:t}))))):(console.log("[THREAD_STATE] No project selected, returning empty list"),It({threads:[],projectName:null}))),vt(({threads:t,projectName:e})=>{console.log("[THREAD_STATE] Thread list loaded:",t.length,"threads for project",e),e&&this.hasLoadedOncePerProject.set(e,!0),this.isLoadingThreadListSubject.next(!1),this.threadListSubject.next(t)})).subscribe()}threadList$=this.threadListSubject.asObservable();refreshSelectedThreadSubject=new R;selectedThread$=qn([this.projectName$,this.selectedThreadIdSubject.pipe(Ea()),this.refreshSelectedThreadSubject.pipe(kt(void 0))]).pipe(Gn(([t,e])=>!t||!e?It(null):(this.isLoadingSubject.next(!0),this.threadApi.getThread(e).pipe(Mr({bufferSize:1,refCount:!0})))),vt(()=>{this.isLoadingSubject.next(!1)}));selectThread(t){this.selectedThreadIdSubject.next(t)}getSelectedThreadId(){return this.selectedThreadIdSubject.value}getSelectedThreadIdOrThrow(){let t=this.selectedThreadIdSubject.value;if(!t)throw new Error("[THREAD_STATE] No thread selected");return t}clearSelection(){this.selectedThreadIdSubject.next(null)}stop(){let t=this.selectedThreadIdSubject.value;if(!t){console.error("[THREAD_STATE] Cannot stop: no thread selected");return}console.log("[THREAD_STATE] Stopping thread:",t),this.threadApi.stopThread(t).subscribe({next:e=>console.log("[THREAD_STATE] Stop signal sent:",e.message),error:e=>console.error("[THREAD_STATE] Error stopping thread:",e)})}refreshThreadList(){console.log("[THREAD_STATE] Manually refreshing thread list"),this.refreshThreadListSubject.next()}refreshSelectedThread(){this.refreshSelectedThreadSubject.next()}updateThreadUsers(t,e){return this.threadApi.updateThreadUsers(t,e).pipe(vt(()=>{this.refreshThreadList()}),wn(i=>(console.error("[THREAD_STATE] Error updating thread users:",i),Mo(()=>i))))}renameThread(t,e){let i=e.trim();return!i||i.length===0?(console.error("[THREAD_STATE] Cannot rename thread: name is empty after trimming"),Mo(()=>new Error("Thread name cannot be empty"))):(console.log("[THREAD_STATE] Renaming thread:",t,"to:",i),this.threadApi.updateThread(t,i).pipe(vt(n=>{console.log("[THREAD_STATE] Thread renamed successfully:",n),this.refreshThreadList()}),wn(n=>(console.error("[THREAD_STATE] Error renaming thread:",n),Mo(()=>n)))))}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var Zo=class o{http=m(Ye);projectState=m(Se);threadState=m(Pt);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads/${this.threadState.getSelectedThreadIdOrThrow()}/messages`}getMessages(){return this.http.get(this.getBaseUrl())}sendMessage(t){return this.http.post(this.getBaseUrl(),t,{responseType:"text"})}sendFreeMessage(t){return this.http.post(this.getBaseUrl(),{message:t})}getMessage(t){return this.http.get(`${this.getBaseUrl()}/${encodeURIComponent(t)}`)}deleteMessage(t){return this.http.delete(`${this.getBaseUrl()}/${encodeURIComponent(t)}`)}getFormattedMessage(t){return this.http.get(`${this.getBaseUrl()}/${encodeURIComponent(t)}/formatted`,{responseType:"text"})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var Qt=class o{destroy$=new R;currentProject=null;currentThread=null;messagesSubject=new le([]);isThinkingSubject=new le(!1);currentChoiceSubject=new le(null);projectTitleSubject=new le("Coday");currentInviteEventSubject=new le(null);messageToRestoreSubject=new le("");threadUpdateEventSubject=new le(null);currentChoiceEvent=null;thinkingTimeout=null;accumulatedChunks="";streamingTextSubject=new le("");subThreadEventsSubject=new R;subThreadEvents$=this.subThreadEventsSubject.asObservable();subThreadEventBuffers=new Map;getBufferedSubThreadEvents(t){return this.subThreadEventBuffers.get(t)??[]}messages$=this.messagesSubject.asObservable();streamingText$=this.streamingTextSubject.asObservable();isThinking$=this.isThinkingSubject.asObservable();currentChoice$=this.currentChoiceSubject.asObservable();currentInviteEvent$=this.currentInviteEventSubject.asObservable();messageToRestore$=this.messageToRestoreSubject.asObservable();threadUpdateEvent$=this.threadUpdateEventSubject.asObservable();connectionStatus$;tabTitleService=null;eventStream=m(Gi);messageApi=m(Zo);constructor(){this.connectionStatus$=this.eventStream.connectionStatus$,this.initializeEventHandling()}setTabTitleService(t){this.tabTitleService=t}connectToThread(t,e){this.currentProject=t,this.currentThread=e,this.eventStream.connectToThread(t,e)}resetMessages(){this.messagesSubject.next([]),this.currentChoiceSubject.next(null),this.currentInviteEventSubject.next(null),this.currentChoiceEvent=null,this.accumulatedChunks="",this.streamingTextSubject.next(""),this.subThreadEventBuffers.clear(),this.stopThinking()}sendMessage(t){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send message: no project or thread selected");return}let e=this.currentInviteEventSubject.value;if(e){this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive(),this.currentInviteEventSubject.next(null);let i=e.buildAnswer(t);this.handleAnswerEvent(i),this.messageApi.sendMessage(i).subscribe({error:n=>{console.error("[CODAY] Send invite answer error:",n),this.currentInviteEventSubject.next(e),this.stopThinking()}})}else this.messageApi.sendFreeMessage(t).subscribe({error:i=>{console.error("[CODAY] Send error:",i)}})}sendChoice(t){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send choice: no project or thread selected");return}if(this.currentChoiceEvent){this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive();let e=this.currentChoiceEvent.buildAnswer(t);this.currentChoiceSubject.next(null),this.currentChoiceEvent=null,this.messageApi.sendMessage(e).subscribe({next:()=>{},error:i=>{console.error("[CODAY-CHOICE] Choice error:",i),this.stopThinking()}})}else console.error("[CODAY-CHOICE] No choice event available for choice:",t)}deleteMessage(t){let e=this.messagesSubject.value.find(n=>n.id===t),i=this.extractTextContentFromMessage(e);return this.messageApi.deleteMessage(t).pipe(vt(n=>{n.success&&(this.removeMessagesFromIndex(t),i.trim()&&this.messageToRestoreSubject.next(i))}))}getCurrentProjectTitle(){return this.projectTitleSubject.value}getCurrentInviteEvent(){return this.currentInviteEventSubject.value}setThinkingForPendingMessage(){this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive()}initializeEventHandling(){this.eventStream.events$.pipe(L(this.destroy$)).subscribe({next:t=>this.handleEvent(t),error:t=>console.error("[CODAY] Event stream error:",t),complete:()=>console.log("[CODAY] Event stream completed")})}handleEvent(t){if(t.threadId&&t.threadId!==this.currentThread){let e=this.subThreadEventBuffers.get(t.threadId);e?e.push(t):this.subThreadEventBuffers.set(t.threadId,[t]),this.subThreadEventsSubject.next(t);return}t instanceof Mi?this.handleMessageEvent(t):t instanceof Vn?this.handleTextChunkEvent(t):t instanceof Ui?this.handleTextEvent(t):t instanceof Yt?this.handleAnswerEvent(t):t instanceof Si?this.handleErrorEvent(t):t instanceof co?this.handleWarnEvent(t):t instanceof zn?this.handleThinkingEvent(t):t instanceof ki?this.handleToolRequestEvent(t):t instanceof li?this.handleToolResponseEvent(t):t instanceof fn?this.handleChoiceEvent(t):t instanceof Qo?this.handleHeartBeatEvent(t):t instanceof gn?this.handleInviteEvent(t):t instanceof Xo?this.handleThreadUpdateEvent(t):t instanceof $i?this.handleDelegationEvent(t):t instanceof Ko||t instanceof qi||console.warn("[CODAY] Unhandled event type:",t.type)}handleDelegationEvent(t){if(console.log("[CODAY] DelegationEvent received:",t.subThreadId,t.agentName),this.messagesSubject.value.findIndex(n=>n.subThreadId===t.subThreadId)===-1){let n={id:t.timestamp,role:"system",speaker:t.agentName,content:[{type:"text",content:""}],timestamp:new Date,type:"delegation",subThreadId:t.subThreadId,delegationAgentName:t.agentName};this.addMessage(n)}}handleThreadUpdateEvent(t){this.threadUpdateEventSubject.next(t)}handleMessageEvent(t){t.role==="assistant"&&this.accumulatedChunks&&(this.accumulatedChunks="",this.streamingTextSubject.next(""));let e={id:t.timestamp,role:t.role,speaker:t.name,content:t.content,timestamp:t.date,type:"text"};this.addMessage(e)}handleTextChunkEvent(t){this.accumulatedChunks+=t.chunk,this.streamingTextSubject.next(this.accumulatedChunks)}handleTextEvent(t){let e={id:t.timestamp,role:t.speaker?"assistant":"system",speaker:t.speaker??"System",content:[{type:"text",content:t.text}],timestamp:t.date,type:t.speaker?"text":"technical"};this.addMessage(e)}handleAnswerEvent(t){let e={id:t.timestamp,role:"user",speaker:"User",content:[{type:"text",content:t.answer}],timestamp:t.date,type:"text",parentKey:t.parentKey,invite:t.invite};this.addMessage(e)}handleErrorEvent(t){let e={id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:`Error: ${JSON.stringify(t.error)}`}],timestamp:t.date,type:"error"};this.addMessage(e)}handleWarnEvent(t){let e={id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:`Warning: ${JSON.stringify(t.warning)}`}],timestamp:t.date,type:"warning"};this.addMessage(e)}handleThinkingEvent(t){this.currentInviteEventSubject.value||this.currentChoiceEvent||(this.clearThinkingTimeout(),this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive(),this.thinkingTimeout=setTimeout(()=>{this.isThinkingSubject.next(!1),this.thinkingTimeout=null,this.tabTitleService?.setSystemInactive()},zn.debounce+1e3))}handleToolRequestEvent(t){let e={id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:t.toSingleLineString()}],timestamp:t.date,type:"technical",eventId:t.timestamp};this.addMessage(e)}handleToolResponseEvent(t){let e={id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:t.toSingleLineString()}],timestamp:t.date,type:"technical",eventId:t.timestamp};this.addMessage(e)}handleChoiceEvent(t){this.stopThinking(),this.currentChoiceEvent=t,this.tabTitleService?.setSystemInactive();let e=t.options.map(n=>({value:n,label:n})),i=t.optionalQuestion?`${t.optionalQuestion} ${t.invite}`:t.invite;this.currentChoiceSubject.next({options:e,label:i,allowFreeText:t.allowFreeText})}handleHeartBeatEvent(t){}handleInviteEvent(t){this.stopThinking();let e=this.messagesSubject.value,i=e[e.length-1];if(!(!(t.invite===pd)&&i&&i.role==="assistant"&&i.content.some(a=>a.type==="text"&&a.content.includes(t.invite)))&&t.invite!==pd){let a={id:t.timestamp,role:"assistant",speaker:"Assistant",content:[{type:"text",content:t.invite}],timestamp:t.date,type:"text"};this.addMessage(a)}this.currentInviteEventSubject.next(t),this.tabTitleService?.setSystemInactive()}addMessage(t){let e=this.messagesSubject.value;e.some(i=>i.id===t.id)||this.messagesSubject.next([...e,t])}removeMessagesFromIndex(t){let e=this.messagesSubject.value,i=e.findIndex(r=>r.id===t);if(i===-1||i===0)return;let n=e.slice(0,i);this.messagesSubject.next(n),this.stopThinking()}extractTextContentFromMessage(t){return t?t.content.filter(e=>e.type==="text").map(e=>e.content).join(`
|
|
337
337
|
|
|
338
|
-
`):""}clearThinkingTimeout(){this.thinkingTimeout&&(clearTimeout(this.thinkingTimeout),this.thinkingTimeout=null)}stopThinking(){this.clearThinkingTimeout(),this.isThinkingSubject.next(!1),this.tabTitleService&&this.tabTitleService.setSystemInactive()}ngOnDestroy(){this.clearThinkingTimeout(),this.destroy$.next(),this.destroy$.complete(),this.currentInviteEventSubject.complete(),this.messageToRestoreSubject.complete(),this.threadUpdateEventSubject.complete(),this.streamingTextSubject.complete(),this.eventStream.disconnect()}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var Jo=class o{http=m(Ye);agentsCache=new Map;getAgents(t){let e=this.agentsCache.get(t);return e?It(e):this.http.get(`/api/projects/${t}/agents`).pipe(vt(i=>{this.agentsCache.set(t,i)}))}getAgentsAutocomplete(t,e){return this.getAgents(t).pipe(_e(i=>{if(!e)return i;let n=e.toLowerCase();return i.filter(r=>{let a=r.name.toLowerCase(),c=r.description?.toLowerCase()||"";return a.includes(n)||c.includes(n)})}))}clearCache(t){this.agentsCache.delete(t)}clearAllCache(){this.agentsCache.clear()}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var ci=class o{http=m(Ye);projectState=m(Se);promptsCache=new Map;getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/prompts`}listPrompts(){return this.http.get(this.getBaseUrl())}getPromptsAutocomplete(t,e){let i=this.promptsCache.get(t);return i?It(this.filterPromptsForAutocomplete(i,e)):this.http.get(`/api/projects/${t}/prompts`).pipe(_e(n=>(this.promptsCache.set(t,n),this.filterPromptsForAutocomplete(n,e))))}filterPromptsForAutocomplete(t,e){let i=e.toLowerCase();return t.filter(r=>r.name.toLowerCase().includes(i)||r.description.toLowerCase().includes(i)).map(r=>({name:r.name,description:r.description,parameterFormat:r.parameterFormat}))}clearCache(t){t?this.promptsCache.delete(t):this.promptsCache.clear()}getPrompt(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createPrompt(t){return this.http.post(this.getBaseUrl(),t).pipe(_e(e=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),e)))}updatePrompt(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,e).pipe(_e(i=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),i)))}deletePrompt(t){return this.http.delete(`${this.getBaseUrl()}/${t}`).pipe(_e(e=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),e)))}enableWebhook(t){return this.http.post(`${this.getBaseUrl()}/${t}/webhook`,{})}disableWebhook(t){return this.http.delete(`${this.getBaseUrl()}/${t}/webhook`)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var Gs=class o{sanitizer=m(Di);transform(t,e){if(!e||!t)return t;let i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n=new RegExp(`(${i})`,"gi"),r=t.replace(n,"<strong>$1</strong>");return this.sanitizer.bypassSecurityTrustHtml(r)}static \u0275fac=function(e){return new(e||o)};static \u0275pipe=gm({name:"highlight",type:o,pure:!0})};var Ab=["messageInput"],Ib=["fileInput"],Db=(o,t)=>t.name;function Rb(o,t){o&1&&(s(0,"div",3),A(1,"span",7),p(2," Recording... Click mic to stop "),l())}function Fb(o,t){if(o&1&&(s(0,"span",12),p(1),l()),o&2){let e=u().$implicit,i=u(2);d(),F(" "+(i.getParameterFormat(e)||""))}}function Nb(o,t){if(o&1){let e=M();s(0,"div",9),_("click",function(){let n=v(e).$index,r=u(2);return y(r.selectAutocompleteItemByClick(n))})("keydown.enter",function(){let n=v(e).$index,r=u(2);return y(r.selectAutocompleteItemByClick(n))})("keydown.space",function(){let n=v(e).$index,r=u(2);return y(r.selectAutocompleteItemByClick(n))})("mouseenter",function(){let n=v(e).$index,r=u(2);return y(r.selectedAutocompleteIndex=n)}),s(1,"div",10),A(2,"span",11),Jn(3,"highlight"),C(4,Fb,2,1,"span",12),l(),A(5,"div",13),Jn(6,"highlight"),l()}if(o&2){let e=t.$implicit,i=t.$index,n=u(2);E("selected",i===n.selectedAutocompleteIndex),X("aria-selected",i===n.selectedAutocompleteIndex),d(2),w("innerHTML",Pr(3,6,n.autocompleteTrigger+e.name,n.getAutocompleteQuery()),Kt),d(2),x(n.hasParameterFormat(e)?4:-1),d(),w("innerHTML",Pr(6,9,e.description,n.getAutocompleteQuery()),Kt)}}function Lb(o,t){if(o&1&&(s(0,"div",4),xe(1,Nb,7,12,"div",8,Db),l()),o&2){let e=u();d(),we(e.autocompleteItems)}}function Vb(o,t){if(o&1){let e=M();s(0,"ds-icon-button",16),_("action",function(){v(e);let n=u(2);return y(n.onStopClick())}),l()}}function zb(o,t){if(o&1){let e=M();s(0,"ds-icon-button",17),_("action",function(){v(e);let n=u(2);return y(n.sendMessage())}),l()}if(o&2){let e=u(2);E("hidden",e.isDisabled||!e.message.trim())("active",!!e.message.trim()&&!e.isDisabled),w("title",e.getSendButtonTooltip())("disabled",e.isDisabled||!e.message.trim())}}function jb(o,t){if(o&1){let e=M();s(0,"ds-icon-button",19),_("action",function(){v(e);let n=u(3);return y(n.triggerFileUpload())}),l(),s(1,"input",20,1),_("change",function(n){v(e);let r=u(3);return y(r.onFileInputChange(n))}),l()}if(o&2){let e=u(3);w("disabled",e.isDisabled)}}function Bb(o,t){if(o&1){let e=M();C(0,jb,3,1),s(1,"ds-icon-button",18),_("action",function(){v(e);let n=u(2);return y(n.toggleRecording())}),l()}if(o&2){let e=u(2);x(e.showWelcome?-1:0),d(),E("recording",e.isRecording)("hidden",e.message.trim()),w("icon",e.isRecording?"fiber_manual_record":"mic")("title",e.isRecording?"Click to stop recording":"Click to start recording")}}function Hb(o,t){if(o&1&&(C(0,Vb,1,0,"ds-icon-button",14),C(1,zb,1,6,"ds-icon-button",15),C(2,Bb,2,7)),o&2){let e=u();x(e.isThinking?0:-1),d(),x(!e.isThinking||e.message.trim()?1:-1),d(),x(e.isThinking?-1:2)}}var er=class o{static MIN_TEXTAREA_LINES=2;static MAX_TEXTAREA_LINES=15;isDisabled=!1;showWelcome=!1;isThinking=!1;isStarting=!1;isSessionInitializing=!1;isStopping=!1;filesPasted=new U;messageSubmitted=new U;voiceRecordingToggled=new U;heightChanged=new U;stopRequested=new U;messageInput;fileInput;message="";isRecording=!1;isFocused=!1;recognition=null;sessionHadTranscript=!1;pendingLineBreaksTimeout=null;lastProcessedResultIndex=0;useEnterToSend=!1;currentInvite="";subscriptions=[];thinkingPhrases=["Processing request...","Thinking...","Working on it..."];currentThinkingPhrase="Processing request...";thinkingPhraseIndex=0;thinkingInterval=null;autocompleteVisible=!1;autocompleteTrigger=null;autocompleteItems=[];selectedAutocompleteIndex=0;preferencesService=m(nt);codayService=m(Qt);agentApiService=m(Jo);promptApiService=m(ci);projectStateService=m(Se);ngOnInit(){this.initializeVoiceInput(),this.useEnterToSend=this.preferencesService.getEnterToSend(),this.subscriptions.push(this.preferencesService.voiceLanguage$.subscribe(()=>this.updateRecognitionLanguage())),this.subscriptions.push(this.preferencesService.enterToSend$.subscribe(t=>{this.useEnterToSend=t})),this.subscribeToInviteEvents(),this.subscribeToMessageRestore()}ngAfterViewInit(){this.adjustTextareaHeight(),requestAnimationFrame(()=>{setTimeout(()=>this.focusTextarea(),200)})}ngOnChanges(t){t.isThinking&&(t.isThinking.currentValue?this.startThinkingAnimation():(this.stopThinkingAnimation(),this.isStopping=!1,t.isThinking.previousValue&&(console.log("[CHAT-TEXTAREA] Thinking ended, scheduling focus"),requestAnimationFrame(()=>{setTimeout(()=>this.focusTextarea(),100)})))),t.isSessionInitializing&&!t.isSessionInitializing.currentValue&&t.isSessionInitializing.previousValue&&(console.log("[CHAT-TEXTAREA] Session initialization completed, scheduling focus"),requestAnimationFrame(()=>{setTimeout(()=>this.focusTextarea(),100)})),t.isStarting&&!t.isStarting.currentValue&&t.isStarting.previousValue&&this.isThinking&&(this.thinkingPhraseIndex===0?(console.log("[CHAT-TEXTAREA] Transitioning from Starting to Thinking at index 0 - restarting animation"),this.stopThinkingAnimation(),this.startThinkingAnimation()):console.log("[CHAT-TEXTAREA] Transitioning from Starting to Thinking at index",this.thinkingPhraseIndex,"- continuing without restart"))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[],this.clearPendingLineBreaks(),this.stopThinkingAnimation()}onKeyDown(t){if(this.autocompleteVisible)switch(t.key){case"ArrowDown":t.preventDefault(),this.selectedAutocompleteIndex=Math.min(this.selectedAutocompleteIndex+1,this.autocompleteItems.length-1),this.scrollSelectedItemIntoView();return;case"ArrowUp":t.preventDefault(),this.selectedAutocompleteIndex=Math.max(this.selectedAutocompleteIndex-1,0),this.scrollSelectedItemIntoView();return;case"Tab":case"Enter":if(!this.message.includes(" ")){t.preventDefault(),this.selectAutocompleteItem();return}break;case"Escape":t.preventDefault(),this.hideAutocomplete();return}t.key==="Enter"&&(this.useEnterToSend?!t.shiftKey&&!t.metaKey&&!t.ctrlKey&&(t.preventDefault(),this.sendMessage(!0)):(navigator.platform.toLowerCase().includes("mac")?t.metaKey:t.ctrlKey)&&!t.shiftKey&&(t.preventDefault(),this.sendMessage(!0)))}onInput(){this.adjustTextareaHeight(),this.checkForAutocomplete()}onPaste(t){let e=t.clipboardData?.items;if(!e)return;let i=Array.from(e).filter(r=>r.kind==="file");if(!i.length)return;t.preventDefault();let n=i.reduce((r,a)=>{let c=a.getAsFile();return c?[...r,c]:r},[]);n.length&&this.filesPasted.emit(n)}triggerFileUpload(){console.log("[CHAT-TEXTAREA] Triggering file upload"),this.fileInput?.nativeElement?.click()}onFileInputChange(t){let e=t.target,i=e.files;if(!i||i.length===0){console.log("[CHAT-TEXTAREA] No files selected");return}console.log("[CHAT-TEXTAREA] Files selected:",i.length);let n=Array.from(i);this.filesPasted.emit(n),e.value=""}onDocumentClick(t){if(!this.autocompleteVisible)return;let e=t.target,i=document.querySelector(".autocomplete-popup"),n=this.messageInput?.nativeElement;i&&!i.contains(e)&&n&&!n.contains(e)&&this.hideAutocomplete()}sendMessage(t=!1){let e=this.message.trim();!this.isDisabled&&(t||e)&&(this.messageSubmitted.emit(e),this.message="",setTimeout(()=>this.adjustTextareaHeight(),0))}onStopClick(){this.isStopping=!0,this.stopRequested.emit()}toggleRecording(){this.isRecording?this.stopRecording():this.startRecording()}initializeVoiceInput(){let t=window.SpeechRecognition??window.webkitSpeechRecognition;if(console.log("[SPEECH] speechRecognition",t),!t){console.warn("[SPEECH] Speech Recognition API not available");return}this.recognition=new t,this.recognition.continuous=!0,this.recognition.interimResults=!0,this.recognition.maxAlternatives=1,this.recognition.lang=this.getSelectedLanguage();try{"grammars"in this.recognition&&(this.recognition.serviceURI=void 0)}catch{console.log("[SPEECH] Advanced speech recognition parameters not supported")}this.recognition.onresult=e=>{let i="",n=Math.max(e.resultIndex,this.lastProcessedResultIndex);for(let r=n;r<e.results.length;r++)e.results[r].isFinal&&(i+=e.results[r][0].transcript,this.lastProcessedResultIndex=r+1);if(i){let r=this.improveTranscriptPunctuation(i.trim());this.sessionHadTranscript=!0,console.log("[SPEECH] onresult ending, appending to textarea",this.isRecording),this.appendToTextarea(r)}},this.recognition.onend=()=>{console.log("[SPEECH] Recognition ended. Was recording:",this.isRecording),this.isRecording=!1,this.lastProcessedResultIndex=0,this.voiceRecordingToggled.emit(this.isRecording)},this.recognition.onerror=e=>{console.error("[SPEECH] Speech recognition error:",e.error),console.log("[SPEECH] Error details:",{error:e.error,message:e.message,timeStamp:e.timeStamp}),this.isRecording=!1,this.lastProcessedResultIndex=0,this.clearPendingLineBreaks(),this.voiceRecordingToggled.emit(this.isRecording)},this.recognition.onstart=()=>{console.log("[SPEECH] Recognition started successfully")},this.recognition.onspeechstart=()=>{console.log("[SPEECH] Speech detected")},this.recognition.onspeechend=()=>{console.log("[SPEECH] Speech ended")}}startRecording(){return ee(this,null,function*(){if(!(!this.recognition||this.isRecording))try{this.isRecording=!0,this.sessionHadTranscript=!1,this.lastProcessedResultIndex=0,this.clearPendingLineBreaks(),this.voiceRecordingToggled.emit(this.isRecording),this.recognition.start(),console.log("[SPEECH] Started recording")}catch(t){console.error("[SPEECH] Failed to start recording:",t),this.isRecording=!1,this.voiceRecordingToggled.emit(this.isRecording)}})}stopRecording(){if(!this.recognition||!this.isRecording){console.log("[SPEECH] stopRecording not recording");return}try{console.log("[SPEECH] stopRecording recognition stop"),this.recognition.stop(),this.schedulePendingLineBreaks()}catch(t){console.error("[SPEECH] Failed to stop recording:",t)}}getSelectedLanguage(){return this.preferencesService.getVoiceLanguage()}updateRecognitionLanguage(){if(this.recognition){let t=this.getSelectedLanguage();this.recognition.lang=t,console.log("[SPEECH] Language changed to:",t)}}improveTranscriptPunctuation(t){let e=t;return/[.!?]$/.test(e.trim())||(e=e.trim()+"."),e=e.charAt(0).toUpperCase()+e.slice(1),e=e.replace(/\s+/g," "),e=e+" ",e}appendToTextarea(t){let e=this.message;if(this.message=e?`${e}${t}`:t,this.messageInput?.nativeElement){this.messageInput.nativeElement.focus();let i=this.message.length;this.messageInput.nativeElement.setSelectionRange(i,i)}setTimeout(()=>this.adjustTextareaHeight(),0)}schedulePendingLineBreaks(){this.clearPendingLineBreaks(),this.pendingLineBreaksTimeout=window.setTimeout(()=>{this.sessionHadTranscript&&(console.log("[SPEECH] Adding line breaks after transcript session"),this.appendToTextarea(`
|
|
338
|
+
`):""}clearThinkingTimeout(){this.thinkingTimeout&&(clearTimeout(this.thinkingTimeout),this.thinkingTimeout=null)}stopThinking(){this.clearThinkingTimeout(),this.isThinkingSubject.next(!1),this.tabTitleService&&this.tabTitleService.setSystemInactive()}ngOnDestroy(){this.clearThinkingTimeout(),this.destroy$.next(),this.destroy$.complete(),this.currentInviteEventSubject.complete(),this.messageToRestoreSubject.complete(),this.threadUpdateEventSubject.complete(),this.streamingTextSubject.complete(),this.eventStream.disconnect()}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var Jo=class o{http=m(Ye);agentsCache=new Map;getAgents(t){let e=this.agentsCache.get(t);return e?It(e):this.http.get(`/api/projects/${t}/agents`).pipe(vt(i=>{this.agentsCache.set(t,i)}))}getAgentsAutocomplete(t,e){return this.getAgents(t).pipe(_e(i=>{if(!e)return i;let n=e.toLowerCase();return i.filter(r=>{let a=r.name.toLowerCase(),c=r.description?.toLowerCase()||"";return a.includes(n)||c.includes(n)})}))}clearCache(t){this.agentsCache.delete(t)}clearAllCache(){this.agentsCache.clear()}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var ci=class o{http=m(Ye);projectState=m(Se);promptsCache=new Map;getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/prompts`}listPrompts(){return this.http.get(this.getBaseUrl())}getPromptsAutocomplete(t,e){let i=this.promptsCache.get(t);return i?It(this.filterPromptsForAutocomplete(i,e)):this.http.get(`/api/projects/${t}/prompts`).pipe(_e(n=>(this.promptsCache.set(t,n),this.filterPromptsForAutocomplete(n,e))))}filterPromptsForAutocomplete(t,e){let i=e.toLowerCase();return t.filter(r=>r.name.toLowerCase().includes(i)||r.description.toLowerCase().includes(i)).map(r=>({name:r.name,description:r.description,parameterFormat:r.parameterFormat}))}clearCache(t){t?this.promptsCache.delete(t):this.promptsCache.clear()}getPrompt(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createPrompt(t){return this.http.post(this.getBaseUrl(),t).pipe(_e(e=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),e)))}updatePrompt(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,e).pipe(_e(i=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),i)))}deletePrompt(t){return this.http.delete(`${this.getBaseUrl()}/${t}`).pipe(_e(e=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),e)))}enableWebhook(t){return this.http.post(`${this.getBaseUrl()}/${t}/webhook`,{})}disableWebhook(t){return this.http.delete(`${this.getBaseUrl()}/${t}/webhook`)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var Gs=class o{sanitizer=m(Di);transform(t,e){if(!e||!t)return t;let i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n=new RegExp(`(${i})`,"gi"),r=t.replace(n,"<strong>$1</strong>");return this.sanitizer.bypassSecurityTrustHtml(r)}static \u0275fac=function(e){return new(e||o)};static \u0275pipe=gm({name:"highlight",type:o,pure:!0})};var Ab=["messageInput"],Ib=["fileInput"],Db=(o,t)=>t.name;function Rb(o,t){o&1&&(s(0,"div",3),I(1,"span",8),p(2," Recording... Click mic to stop "),l())}function Fb(o,t){if(o&1&&(s(0,"span",13),p(1),l()),o&2){let e=u().$implicit,i=u(2);d(),F(" "+(i.getParameterFormat(e)||""))}}function Nb(o,t){if(o&1){let e=M();s(0,"div",10),_("click",function(){let n=v(e).$index,r=u(2);return y(r.selectAutocompleteItemByClick(n))})("keydown.enter",function(){let n=v(e).$index,r=u(2);return y(r.selectAutocompleteItemByClick(n))})("keydown.space",function(){let n=v(e).$index,r=u(2);return y(r.selectAutocompleteItemByClick(n))})("mouseenter",function(){let n=v(e).$index,r=u(2);return y(r.selectedAutocompleteIndex=n)}),s(1,"div",11),I(2,"span",12),Jn(3,"highlight"),C(4,Fb,2,1,"span",13),l(),I(5,"div",14),Jn(6,"highlight"),l()}if(o&2){let e=t.$implicit,i=t.$index,n=u(2);E("selected",i===n.selectedAutocompleteIndex),K("aria-selected",i===n.selectedAutocompleteIndex),d(2),w("innerHTML",Pr(3,6,n.autocompleteTrigger+e.name,n.getAutocompleteQuery()),Kt),d(2),x(n.hasParameterFormat(e)?4:-1),d(),w("innerHTML",Pr(6,9,e.description,n.getAutocompleteQuery()),Kt)}}function Lb(o,t){if(o&1&&(s(0,"div",4),xe(1,Nb,7,12,"div",9,Db),l()),o&2){let e=u();d(),we(e.autocompleteItems)}}function Vb(o,t){if(o&1){let e=M();s(0,"ds-icon-button",17),_("action",function(){v(e);let n=u(2);return y(n.onStopClick())}),l()}}function zb(o,t){if(o&1){let e=M();s(0,"ds-icon-button",18),_("action",function(){v(e);let n=u(2);return y(n.sendMessage())}),l()}if(o&2){let e=u(2);E("hidden",e.isDisabled||!e.message.trim())("active",!!e.message.trim()&&!e.isDisabled),w("title",e.getSendButtonTooltip())("disabled",e.isDisabled||!e.message.trim())}}function jb(o,t){if(o&1){let e=M();s(0,"ds-icon-button",20),_("action",function(){v(e);let n=u(3);return y(n.triggerFileUpload())}),l(),s(1,"input",21,1),_("change",function(n){v(e);let r=u(3);return y(r.onFileInputChange(n))}),l()}if(o&2){let e=u(3);w("disabled",e.isDisabled)}}function Bb(o,t){if(o&1){let e=M();C(0,jb,3,1),s(1,"ds-icon-button",19),_("action",function(){v(e);let n=u(2);return y(n.toggleRecording())}),l()}if(o&2){let e=u(2);x(e.showWelcome?-1:0),d(),E("recording",e.isRecording)("hidden",e.message.trim()),w("icon",e.isRecording?"fiber_manual_record":"mic")("title",e.isRecording?"Click to stop recording":"Click to start recording")}}function Hb(o,t){if(o&1&&(s(0,"div",7),C(1,Vb,1,0,"ds-icon-button",15),C(2,zb,1,6,"ds-icon-button",16),C(3,Bb,2,7),l()),o&2){let e=u();d(),x(e.isThinking?1:-1),d(),x(!e.isThinking||e.message.trim()?2:-1),d(),x(e.isThinking?-1:3)}}var er=class o{isDisabled=!1;showWelcome=!1;isThinking=!1;isStarting=!1;isSessionInitializing=!1;isStopping=!1;filesPasted=new U;messageSubmitted=new U;voiceRecordingToggled=new U;heightChanged=new U;stopRequested=new U;messageInput;fileInput;message="";isRecording=!1;isFocused=!1;recognition=null;sessionHadTranscript=!1;pendingLineBreaksTimeout=null;lastProcessedResultIndex=0;useEnterToSend=!1;currentInvite="";subscriptions=[];thinkingPhrases=["Processing request...","Thinking...","Working on it..."];currentThinkingPhrase="Processing request...";thinkingPhraseIndex=0;thinkingInterval=null;autocompleteVisible=!1;autocompleteTrigger=null;autocompleteItems=[];selectedAutocompleteIndex=0;preferencesService=m(nt);codayService=m(Qt);agentApiService=m(Jo);promptApiService=m(ci);projectStateService=m(Se);ngOnInit(){this.initializeVoiceInput(),this.useEnterToSend=this.preferencesService.getEnterToSend(),this.subscriptions.push(this.preferencesService.voiceLanguage$.subscribe(()=>this.updateRecognitionLanguage())),this.subscriptions.push(this.preferencesService.enterToSend$.subscribe(t=>{this.useEnterToSend=t})),this.subscribeToInviteEvents(),this.subscribeToMessageRestore()}ngAfterViewInit(){this.adjustTextareaHeight(),requestAnimationFrame(()=>{setTimeout(()=>this.focusTextarea(),200)})}ngOnChanges(t){t.isThinking&&(t.isThinking.currentValue?this.startThinkingAnimation():(this.stopThinkingAnimation(),this.isStopping=!1,t.isThinking.previousValue&&(console.log("[CHAT-TEXTAREA] Thinking ended, scheduling focus"),requestAnimationFrame(()=>{setTimeout(()=>this.focusTextarea(),100)})))),t.isSessionInitializing&&!t.isSessionInitializing.currentValue&&t.isSessionInitializing.previousValue&&(console.log("[CHAT-TEXTAREA] Session initialization completed, scheduling focus"),requestAnimationFrame(()=>{setTimeout(()=>this.focusTextarea(),100)})),t.isStarting&&!t.isStarting.currentValue&&t.isStarting.previousValue&&this.isThinking&&(this.thinkingPhraseIndex===0?(console.log("[CHAT-TEXTAREA] Transitioning from Starting to Thinking at index 0 - restarting animation"),this.stopThinkingAnimation(),this.startThinkingAnimation()):console.log("[CHAT-TEXTAREA] Transitioning from Starting to Thinking at index",this.thinkingPhraseIndex,"- continuing without restart"))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[],this.clearPendingLineBreaks(),this.stopThinkingAnimation()}onKeyDown(t){if(this.autocompleteVisible)switch(t.key){case"ArrowDown":t.preventDefault(),this.selectedAutocompleteIndex=Math.min(this.selectedAutocompleteIndex+1,this.autocompleteItems.length-1),this.scrollSelectedItemIntoView();return;case"ArrowUp":t.preventDefault(),this.selectedAutocompleteIndex=Math.max(this.selectedAutocompleteIndex-1,0),this.scrollSelectedItemIntoView();return;case"Tab":case"Enter":if(!this.message.includes(" ")){t.preventDefault(),this.selectAutocompleteItem();return}break;case"Escape":t.preventDefault(),this.hideAutocomplete();return}t.key==="Enter"&&(this.useEnterToSend?!t.shiftKey&&!t.metaKey&&!t.ctrlKey&&(t.preventDefault(),this.sendMessage(!0)):(navigator.platform.toLowerCase().includes("mac")?t.metaKey:t.ctrlKey)&&!t.shiftKey&&(t.preventDefault(),this.sendMessage(!0)))}onInput(){this.adjustTextareaHeight(),this.checkForAutocomplete()}onPaste(t){let e=t.clipboardData?.items;if(!e)return;let i=Array.from(e).filter(r=>r.kind==="file");if(!i.length)return;t.preventDefault();let n=i.reduce((r,a)=>{let c=a.getAsFile();return c?[...r,c]:r},[]);n.length&&this.filesPasted.emit(n)}triggerFileUpload(){console.log("[CHAT-TEXTAREA] Triggering file upload"),this.fileInput?.nativeElement?.click()}onFileInputChange(t){let e=t.target,i=e.files;if(!i||i.length===0){console.log("[CHAT-TEXTAREA] No files selected");return}console.log("[CHAT-TEXTAREA] Files selected:",i.length);let n=Array.from(i);this.filesPasted.emit(n),e.value=""}onDocumentClick(t){if(!this.autocompleteVisible)return;let e=t.target,i=document.querySelector(".autocomplete-popup"),n=this.messageInput?.nativeElement;i&&!i.contains(e)&&n&&!n.contains(e)&&this.hideAutocomplete()}sendMessage(t=!1){let e=this.message.trim();!this.isDisabled&&(t||e)&&(this.messageSubmitted.emit(e),this.message="",setTimeout(()=>this.adjustTextareaHeight(),0))}onStopClick(){this.isStopping=!0,this.stopRequested.emit()}toggleRecording(){this.isRecording?this.stopRecording():this.startRecording()}initializeVoiceInput(){let t=window.SpeechRecognition??window.webkitSpeechRecognition;if(console.log("[SPEECH] speechRecognition",t),!t){console.warn("[SPEECH] Speech Recognition API not available");return}this.recognition=new t,this.recognition.continuous=!0,this.recognition.interimResults=!0,this.recognition.maxAlternatives=1,this.recognition.lang=this.getSelectedLanguage();try{"grammars"in this.recognition&&(this.recognition.serviceURI=void 0)}catch{console.log("[SPEECH] Advanced speech recognition parameters not supported")}this.recognition.onresult=e=>{let i="",n=Math.max(e.resultIndex,this.lastProcessedResultIndex);for(let r=n;r<e.results.length;r++)e.results[r].isFinal&&(i+=e.results[r][0].transcript,this.lastProcessedResultIndex=r+1);if(i){let r=this.improveTranscriptPunctuation(i.trim());this.sessionHadTranscript=!0,console.log("[SPEECH] onresult ending, appending to textarea",this.isRecording),this.appendToTextarea(r)}},this.recognition.onend=()=>{console.log("[SPEECH] Recognition ended. Was recording:",this.isRecording),this.isRecording=!1,this.lastProcessedResultIndex=0,this.voiceRecordingToggled.emit(this.isRecording)},this.recognition.onerror=e=>{console.error("[SPEECH] Speech recognition error:",e.error),console.log("[SPEECH] Error details:",{error:e.error,message:e.message,timeStamp:e.timeStamp}),this.isRecording=!1,this.lastProcessedResultIndex=0,this.clearPendingLineBreaks(),this.voiceRecordingToggled.emit(this.isRecording)},this.recognition.onstart=()=>{console.log("[SPEECH] Recognition started successfully")},this.recognition.onspeechstart=()=>{console.log("[SPEECH] Speech detected")},this.recognition.onspeechend=()=>{console.log("[SPEECH] Speech ended")}}startRecording(){return ee(this,null,function*(){if(!(!this.recognition||this.isRecording))try{this.isRecording=!0,this.sessionHadTranscript=!1,this.lastProcessedResultIndex=0,this.clearPendingLineBreaks(),this.voiceRecordingToggled.emit(this.isRecording),this.recognition.start(),console.log("[SPEECH] Started recording")}catch(t){console.error("[SPEECH] Failed to start recording:",t),this.isRecording=!1,this.voiceRecordingToggled.emit(this.isRecording)}})}stopRecording(){if(!this.recognition||!this.isRecording){console.log("[SPEECH] stopRecording not recording");return}try{console.log("[SPEECH] stopRecording recognition stop"),this.recognition.stop(),this.schedulePendingLineBreaks()}catch(t){console.error("[SPEECH] Failed to stop recording:",t)}}getSelectedLanguage(){return this.preferencesService.getVoiceLanguage()}updateRecognitionLanguage(){if(this.recognition){let t=this.getSelectedLanguage();this.recognition.lang=t,console.log("[SPEECH] Language changed to:",t)}}improveTranscriptPunctuation(t){let e=t;return/[.!?]$/.test(e.trim())||(e=e.trim()+"."),e=e.charAt(0).toUpperCase()+e.slice(1),e=e.replace(/\s+/g," "),e=e+" ",e}appendToTextarea(t){let e=this.message;if(this.message=e?`${e}${t}`:t,this.messageInput?.nativeElement){this.messageInput.nativeElement.focus();let i=this.message.length;this.messageInput.nativeElement.setSelectionRange(i,i)}setTimeout(()=>this.adjustTextareaHeight(),0)}schedulePendingLineBreaks(){this.clearPendingLineBreaks(),this.pendingLineBreaksTimeout=window.setTimeout(()=>{this.sessionHadTranscript&&(console.log("[SPEECH] Adding line breaks after transcript session"),this.appendToTextarea(`
|
|
339
339
|
|
|
340
|
-
`),this.sessionHadTranscript=!1),this.pendingLineBreaksTimeout=null},500)}clearPendingLineBreaks(){this.pendingLineBreaksTimeout&&(clearTimeout(this.pendingLineBreaksTimeout),this.pendingLineBreaksTimeout=null)}adjustTextareaHeight(){let t=this.messageInput?.nativeElement;if(!t)return;let e=window.getComputedStyle(t),i=parseFloat(e.fontSize),n=parseFloat(e.lineHeight)||i*1.5,r=n*o.MIN_TEXTAREA_LINES+parseFloat(e.paddingTop)+parseFloat(e.paddingBottom),a=n*o.MAX_TEXTAREA_LINES+parseFloat(e.paddingTop)+parseFloat(e.paddingBottom);t.style.height="auto";let c=t.scrollHeight;c<r?c=r:c>a&&(c=a),t.style.height=`${c}px`;let h=t.parentElement?.offsetHeight??c+32;this.heightChanged.emit(h)}getSendButtonShortcut(){return this.useEnterToSend?"Enter":navigator.platform.toLowerCase().includes("mac")?"\u2318+Enter":"Ctrl+Enter"}getSendButtonTooltip(){return this.useEnterToSend?"Send message (Enter) - Shift+Enter for new line":`Send message (${navigator.platform.toLowerCase().includes("mac")?"Cmd+Enter":"Ctrl+Enter"}) - Enter for new line`}getPlaceholder(){return this.isSessionInitializing?"Initializing session...":this.isThinking?this.isStopping?"Stopping...":this.isStarting?"Processing request...":this.currentThinkingPhrase:this.showWelcome?"How can I help you today?":"Type '@' for agents, '/' for commands, or just your message..."}startThinkingAnimation(){this.thinkingPhraseIndex=0,this.currentThinkingPhrase=this.thinkingPhrases[0]??"Thinking...",this.thinkingInterval=window.setInterval(()=>{this.thinkingPhraseIndex<this.thinkingPhrases.length-1&&(this.thinkingPhraseIndex++,this.currentThinkingPhrase=this.thinkingPhrases[this.thinkingPhraseIndex]??"Thinking...")},2e3)}stopThinkingAnimation(){this.thinkingInterval&&(clearInterval(this.thinkingInterval),this.thinkingInterval=null),this.thinkingPhraseIndex=0,this.currentThinkingPhrase="Thinking..."}subscribeToInviteEvents(){this.subscriptions.push(this.codayService.currentInviteEvent$.subscribe(t=>{t?this.handleInviteEvent(t.invite,t.defaultValue):this.currentInvite=""}))}handleInviteEvent(t,e){this.currentInvite=t,e&&(this.message=e,setTimeout(()=>this.adjustTextareaHeight(),0)),setTimeout(()=>{this.messageInput?.nativeElement&&this.messageInput.nativeElement.focus()},50)}subscribeToMessageRestore(){this.subscriptions.push(this.codayService.messageToRestore$.subscribe(t=>{t.trim()&&(console.log("[CHAT-TEXTAREA] Restoring message content:",t.substring(0,50)+"..."),this.restoreMessageContent(t))}))}restoreMessageContent(t){this.message=t,this.messageInput?.nativeElement&&(this.messageInput.nativeElement.focus(),setTimeout(()=>{let e=this.messageInput.nativeElement,i=this.message.length;e.setSelectionRange(i,i)},0)),setTimeout(()=>this.adjustTextareaHeight(),10)}focusTextarea(){let t=this.messageInput?.nativeElement;console.log("[CHAT-TEXTAREA] focusTextarea called",{hasElement:!!t,isDisabled:this.isDisabled,isThinking:this.isThinking,elementDisabled:t?.disabled,isSessionInitializing:this.isSessionInitializing}),t&&!t.disabled?(t.focus(),console.log("[CHAT-TEXTAREA] Textarea focused successfully")):console.log("[CHAT-TEXTAREA] Focus blocked - element disabled or not available")}checkForAutocomplete(){let t=this.message;if(t.startsWith("@")){let e=t.substring(1);if(e.includes(" ")){this.hideAutocomplete();return}this.showAgentAutocomplete(e);return}if(t.startsWith("/")){let e=t.substring(1);if(e.includes(" ")){this.hideAutocomplete();return}this.showPromptAutocomplete(e);return}this.hideAutocomplete()}showAgentAutocomplete(t){this.autocompleteTrigger="@";try{let e=this.projectStateService.getSelectedProjectIdOrThrow();this.agentApiService.getAgentsAutocomplete(e,t).subscribe({next:i=>{this.autocompleteItems=i,this.autocompleteVisible=i.length>0,this.selectedAutocompleteIndex=0},error:i=>{console.error("[AUTOCOMPLETE] Error loading agents:",i),this.hideAutocomplete()}})}catch{console.warn("[AUTOCOMPLETE] No project selected, cannot load agents"),this.hideAutocomplete()}}showPromptAutocomplete(t){this.autocompleteTrigger="/";try{let e=this.projectStateService.getSelectedProjectIdOrThrow();this.promptApiService.getPromptsAutocomplete(e,t).subscribe({next:i=>{this.autocompleteItems=i,this.autocompleteVisible=i.length>0,this.selectedAutocompleteIndex=0},error:i=>{console.error("[AUTOCOMPLETE] Error loading prompts:",i),this.hideAutocomplete()}})}catch{console.warn("[AUTOCOMPLETE] No project selected, cannot load prompts"),this.hideAutocomplete()}}hideAutocomplete(){this.autocompleteVisible=!1,this.autocompleteItems=[],this.selectedAutocompleteIndex=0}selectAutocompleteItem(){let t=this.autocompleteItems[this.selectedAutocompleteIndex];if(!t)return;let e=null;if(this.autocompleteTrigger==="/"){let i=t,n=i.parameterFormat;if(console.log(i),n===void 0)this.message=`/${t.name}`;else if(n==="")this.message=`/${t.name} `;else{this.message=`/${t.name} ${n}`;let r=this.message.indexOf('=""');r!==-1&&(e=r+2)}}else this.message=`@${t.name} `;this.hideAutocomplete(),setTimeout(()=>{if(this.messageInput?.nativeElement)if(this.messageInput.nativeElement.focus(),e!==null)this.messageInput.nativeElement.setSelectionRange(e,e);else{let i=this.message.length;this.messageInput.nativeElement.setSelectionRange(i,i)}},0)}selectAutocompleteItemByClick(t){this.selectedAutocompleteIndex=t,this.selectAutocompleteItem()}getAutocompleteQuery(){return this.message.substring(1).split(" ")[0]??""}getParameterFormat(t){return t.parameterFormat}hasParameterFormat(t){return this.autocompleteTrigger==="/"&&t.parameterFormat!==void 0}scrollSelectedItemIntoView(){setTimeout(()=>{let t=document.querySelector(".autocomplete-popup");if(!t)return;let e=t.querySelector(".autocomplete-item.selected");e&&e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},0)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-chat-textarea"]],viewQuery:function(e,i){if(e&1&&(Q(Ab,7),Q(Ib,5)),e&2){let n;H(n=W())&&(i.messageInput=n.first),H(n=W())&&(i.fileInput=n.first)}},hostBindings:function(e,i){e&1&&_("paste",function(r){return i.onPaste(r)})("click",function(r){return i.onDocumentClick(r)},hm)},inputs:{isDisabled:"isDisabled",showWelcome:"showWelcome",isThinking:"isThinking",isStarting:"isStarting",isSessionInitializing:"isSessionInitializing"},outputs:{filesPasted:"filesPasted",messageSubmitted:"messageSubmitted",voiceRecordingToggled:"voiceRecordingToggled",heightChanged:"heightChanged",stopRequested:"stopRequested"},features:[tt],decls:7,vars:12,consts:[["messageInput",""],["fileInput",""],[1,"chat-input-container"],[1,"recording-indicator"],[1,"autocomplete-popup"],[1,"input-row","grouped-input"],[1,"message-input",3,"ngModelChange","keydown","input","focus","blur","ngModel","placeholder","disabled"],[1,"recording-dot"],["role","option","tabindex","0",1,"autocomplete-item",3,"selected"],["role","option","tabindex","0",1,"autocomplete-item",3,"click","keydown.enter","keydown.space","mouseenter"],[1,"item-name"],[3,"innerHTML"],[1,"parameter-format"],[1,"item-description",3,"innerHTML"],["icon","stop","variant","danger","title","Stop generation",1,"action-btn"],["icon","send","variant","primary",1,"send-btn",3,"title","disabled","hidden","active"],["icon","stop","variant","danger","title","Stop generation",1,"action-btn",3,"action"],["icon","send","variant","primary",1,"send-btn",3,"action","title","disabled"],["variant","default",1,"voice-btn",3,"action","icon","title"],["icon","attach_file","variant","default","title","Upload files (images or documents)",1,"upload-btn",3,"action","disabled"],["type","file","multiple","","accept","image/*,application/pdf,.pdf,.doc,.docx,.txt,.md,.json,.yaml,.yml,.csv,.xml,.html",2,"display","none",3,"change"]],template:function(e,i){if(e&1){let n=M();s(0,"div",2),C(1,Rb,3,0,"div",3),C(2,Lb,3,0,"div",4),s(3,"div",5)(4,"textarea",6,0),B("ngModelChange",function(a){return v(n),j(i.message,a)||(i.message=a),y(a)}),_("keydown",function(a){return v(n),y(i.onKeyDown(a))})("input",function(){return v(n),y(i.onInput())})("focus",function(){return v(n),y(i.isFocused=!0)})("blur",function(){return v(n),y(i.isFocused=!1)}),l(),C(6,Hb,3,3),l()()}e&2&&(d(),x(i.isRecording?1:-1),d(),x(i.autocompleteVisible?2:-1),d(),E("focused",i.isFocused)("welcome-mode",i.showWelcome)("is-thinking",i.isThinking),d(),z("ngModel",i.message),w("placeholder",i.getPlaceholder())("disabled",i.isDisabled),d(2),x(i.isSessionInitializing?-1:6))},dependencies:[je,Le,Ve,ze,Ym,Gs],styles:['@keyframes _ngcontent-%COMP%_gradientBorderShift{0%{background-position:0 0}50%{background-position:100% 0}to{background-position:0 0}}.chat-input-container[_ngcontent-%COMP%]{flex-shrink:0;width:100%;position:relative}.thinking-progress[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0;height:3px;z-index:1}.thinking-progress[_ngcontent-%COMP%] .mdc-linear-progress__bar-inner{border-top-width:3px}.input-row.grouped-input[_ngcontent-%COMP%]{display:flex;align-items:center;background:var(--glass-bg);border-radius:16px;padding:0 .15rem 0 1.25rem;position:relative;transition:border-color .2s,box-shadow .2s,background .3s}.input-row[_ngcontent-%COMP%]{position:relative;background:var(--glass-bg, #1e1e1e)!important;background-clip:padding-box}.input-row[_ngcontent-%COMP%]:before{content:"";position:absolute;inset:-2px;border-radius:inherit;background-size:200% 100%;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;padding:1px;pointer-events:none;z-index:-1;animation:_ngcontent-%COMP%_gradientBorderShift 3s ease-in-out infinite}.input-row.is-thinking[_ngcontent-%COMP%]:before{inset:0;mask:none;padding:0;opacity:.15;z-index:0;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% 100%;animation:_ngcontent-%COMP%_gradientBorderShift 3s ease-in-out infinite}.input-row.is-thinking[_ngcontent-%COMP%] .message-input[_ngcontent-%COMP%], .input-row.is-thinking[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%]{position:relative;z-index:1}.input-row.grouped-input.focused[_ngcontent-%COMP%]:not(.is-thinking){box-shadow:0 0 0 4px #007aff1a}.input-row.grouped-input.focused[_ngcontent-%COMP%]:not(.is-thinking):before{background:var(--color-primary);animation:none}.message-input[_ngcontent-%COMP%]{flex:1;border:none;outline:none;background:transparent!important;box-shadow:none;font-size:1rem;padding:1rem 0;color:var(--color-text);resize:none;min-height:36px;max-height:70vh;overflow-y:auto;font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,system-ui,sans-serif;line-height:1.5}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-border);border-radius:4px}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text-secondary)}.message-input[_ngcontent-%COMP%]:focus{outline:none;border:none;box-shadow:none}.message-input[_ngcontent-%COMP%]:disabled{background-color:var(--color-bg-secondary);color:var(--color-text-secondary);cursor:not-allowed;opacity:.6}.message-input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);transition:opacity .3s ease-in-out}.message-input[_ngcontent-%COMP%]:disabled::placeholder{animation:_ngcontent-%COMP%_thinkingPulsate 2s ease-in-out infinite}@keyframes _ngcontent-%COMP%_thinkingPulsate{0%,to{opacity:.6}50%{opacity:1}}.voice-btn[_ngcontent-%COMP%], .send-btn[_ngcontent-%COMP%], .action-btn[_ngcontent-%COMP%], .upload-btn[_ngcontent-%COMP%]{margin:0 .5rem 0 .08rem}.voice-btn.recording[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:var(--color-error);animation:_ngcontent-%COMP%_pulse 1.5s infinite}.send-btn[_ngcontent-%COMP%]{transition:opacity .4s,margin-left .4s}.send-btn.active[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{opacity:1}.send-btn[_ngcontent-%COMP%]:not(.active) button[_ngcontent-%COMP%]{opacity:0;margin-left:calc(-.5rem - 36px)}.send-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){color:#fff;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-primary, #3b82f6) 20%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 80%,var(--color-primary, #3b82f6) 100%);background-size:300% auto;animation:sendButtonGradientShift 6s ease-in-out infinite;box-shadow:0 4px 14px #007aff30;transform:scale(1.2)}.send-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:active:not(:disabled){transform:scale(1.3);box-shadow:0 4px 24px #007aff30}.recording-indicator[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-top:.2rem;margin-bottom:.2rem;color:var(--color-error, #ff5555);font-size:.9rem;position:absolute;top:-1.5rem}@keyframes _ngcontent-%COMP%_pulse{0%,to{opacity:1}50%{opacity:.5}}.autocomplete-popup[_ngcontent-%COMP%]{position:absolute;bottom:100%;left:0;right:0;margin-bottom:.5rem;background:var(--glass-bg);-webkit-backdrop-filter:var(--glass-backdrop-blur);backdrop-filter:var(--glass-backdrop-blur);border-radius:12px;box-shadow:0 8px 32px #00000026;border:1px solid var(--color-border);max-height:400px;max-width:500px;overflow-y:auto;z-index:100}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-border);border-radius:4px}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text-secondary)}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%]{padding:.75rem 1rem;cursor:pointer;transition:background .2s;border-left:3px solid transparent}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%]:hover, .autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item.selected[_ngcontent-%COMP%]{background:var(--color-bg-hover)}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item.selected[_ngcontent-%COMP%]{border-left-color:var(--color-primary)}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%]{font-weight:600;color:var(--color-text);margin-bottom:.25rem;font-family:SF Mono,Monaco,Menlo,Cascadia Code,Consolas,monospace;font-size:.95rem}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%] strong{font-weight:700;color:var(--color-primary);background:var(--color-primary-light, rgba(99, 102, 241, .1));padding:0 2px;border-radius:2px}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%] .parameter-format[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-weight:400;opacity:.7}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-description[_ngcontent-%COMP%]{font-size:.85rem;color:var(--color-text-secondary);line-height:1.3}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-description[_ngcontent-%COMP%] strong{font-weight:700;color:var(--color-primary);background:var(--color-primary-light, rgba(99, 102, 241, .1))}@media print{.thinking-progress[_ngcontent-%COMP%], .action-btn[_ngcontent-%COMP%], .voice-btn[_ngcontent-%COMP%], .send-btn[_ngcontent-%COMP%], .upload-btn[_ngcontent-%COMP%], .recording-indicator[_ngcontent-%COMP%], .autocomplete-popup[_ngcontent-%COMP%]{display:none!important}}']})};var Wb=(o,t)=>t.label;function Ub(o,t){if(o&1){let e=M();s(0,"button",2),_("click",function(n){let r=v(e).$implicit,a=u();return y(a.executeAction(r,n))}),s(1,"mat-icon"),p(2),l()()}if(o&2){let e=t.$implicit;X("title",e.tooltip||e.label),d(),X("aria-label",e.label),d(),F(e.icon)}}var Ys=class o{actions=[];executeAction(t,e){e.stopPropagation(),t.action()}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-message-context-menu"]],inputs:{actions:"actions"},decls:3,vars:0,consts:[[1,"context-menu-wrapper"],["mat-icon-button",""],["mat-icon-button","",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0),xe(1,Ub,3,3,"button",1,Wb),l()),e&2&&(d(),we(i.actions))},dependencies:[Pe,Qe,he],styles:[".context-menu-wrapper[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center}.context-menu-wrapper[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{transform:scale(.75)}"]})};var Qs=class o{snackBar=m(qr);success(t,e=2e3){this.snackBar.open(t,"",{duration:e,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["snackbar-success"]})}error(t,e=3e3){this.snackBar.open(t,"",{duration:e,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["snackbar-error"]})}info(t,e=2e3){this.snackBar.open(t,"",{duration:e,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["snackbar-info"]})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var $b=o=>({"user-message-wrapper":o});function qb(o,t){if(o&1&&(s(0,"div",5)(1,"div",9),p(2),l()()),o&2){let e=u(2);d(2),te(" ",e.message.speaker," ")}}function Gb(o,t){if(o&1&&(s(0,"time",7),p(1),l()),o&2){let e=u(2);d(),F(e.formattedTimestamp)}}function Yb(o,t){if(o&1&&(s(0,"div",8),A(1,"app-message-context-menu",10),l()),o&2){let e=u(2);d(),w("actions",e.actions)}}function Qb(o,t){if(o&1&&(C(0,qb,3,1,"div",5),A(1,"div",6),C(2,Gb,2,1,"time",7),C(3,Yb,2,1,"div",8)),o&2){let e=u();x(e.shouldShowSpeaker?0:-1),d(),w("innerHTML",e.renderedContent,Kt),d(),x(e.formattedTimestamp?2:-1),d(),x(e.isLongMessage&&e.shouldShowActions&&e.message.role==="assistant"?3:-1)}}function Xb(o,t){if(o&1&&(s(0,"a",12),p(1,"view"),l()),o&2){let e=u(2);w("href",e.eventLink,Sn)}}function Kb(o,t){if(o&1&&(s(0,"div",2),A(1,"span",11),C(2,Xb,2,1,"a",12),l()),o&2){let e=u();d(),w("innerHTML",e.renderedContent,Kt),d(),x(e.eventLink?2:-1)}}function Zb(o,t){if(o&1&&(s(0,"div",3),A(1,"app-message-context-menu",10),l()),o&2){let e=u();d(),w("actions",e.actions)}}function Jb(o,t){if(o&1&&(s(0,"div",4),A(1,"app-message-context-menu",10),l()),o&2){let e=u();d(),w("actions",e.actions)}}var tr=class o{destroy$=new R;message;canDelete=!0;copyRequested=new U;deleteRequested=new U;renderedContent="";shouldHideTechnical=!1;shouldHideWarning=!1;sanitizer=m(Di);notificationService=m(Qs);preferencesService=m(nt);projectState=m(Se);threadState=m(Pt);markdownService=m(Wi);get messageClasses(){return{[this.message.role]:!0,[this.message.type]:!0,"hidden-technical":this.shouldHideTechnical&&this.message.type==="technical","hidden-warning":this.shouldHideWarning&&this.message.type==="warning"}}ngOnInit(){return ee(this,null,function*(){yield this.renderMarkdown(),this.preferencesService.hideTechnicalMessages$.pipe(L(this.destroy$)).subscribe(t=>{this.shouldHideTechnical=t}),this.preferencesService.hideWarningMessages$.pipe(L(this.destroy$)).subscribe(t=>{this.shouldHideWarning=t}),this.shouldHideTechnical=this.preferencesService.getHideTechnicalMessages(),this.shouldHideWarning=this.preferencesService.getHideWarningMessages()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get shouldShowSpeaker(){return this.message.role==="user"?this.message.speaker.startsWith("@"):this.message.role==="assistant"}get shouldShowActions(){return this.message.role==="user"||this.message.role==="assistant"}get isSimplified(){return this.message.role!=="user"&&this.message.role!=="assistant"}datePipe=m(Ir);get formattedTimestamp(){if(this.message.role!=="user"||!this.message.timestamp)return null;let t=new Date().toDateString()===this.message.timestamp.toDateString();return this.datePipe.transform(this.message.timestamp,t?"HH:mm":"dd/MM HH:mm")}get isLongMessage(){let t=this.extractTextContent();return t.length>1e3||t.split(`
|
|
340
|
+
`),this.sessionHadTranscript=!1),this.pendingLineBreaksTimeout=null},500)}clearPendingLineBreaks(){this.pendingLineBreaksTimeout&&(clearTimeout(this.pendingLineBreaksTimeout),this.pendingLineBreaksTimeout=null)}adjustTextareaHeight(){let t=this.messageInput?.nativeElement;if(!t)return;let e=t.parentElement?.offsetHeight??t.offsetHeight+32;this.heightChanged.emit(e)}getSendButtonShortcut(){return this.useEnterToSend?"Enter":navigator.platform.toLowerCase().includes("mac")?"\u2318+Enter":"Ctrl+Enter"}getSendButtonTooltip(){return this.useEnterToSend?"Send message (Enter) - Shift+Enter for new line":`Send message (${navigator.platform.toLowerCase().includes("mac")?"Cmd+Enter":"Ctrl+Enter"}) - Enter for new line`}getPlaceholder(){return this.isSessionInitializing?"Initializing session...":this.isThinking?this.isStopping?"Stopping...":this.isStarting?"Processing request...":this.currentThinkingPhrase:this.showWelcome?"How can I help you today?":"Type '@' for agents, '/' for commands, or just your message..."}startThinkingAnimation(){this.thinkingPhraseIndex=0,this.currentThinkingPhrase=this.thinkingPhrases[0]??"Thinking...",this.thinkingInterval=window.setInterval(()=>{this.thinkingPhraseIndex<this.thinkingPhrases.length-1&&(this.thinkingPhraseIndex++,this.currentThinkingPhrase=this.thinkingPhrases[this.thinkingPhraseIndex]??"Thinking...")},2e3)}stopThinkingAnimation(){this.thinkingInterval&&(clearInterval(this.thinkingInterval),this.thinkingInterval=null),this.thinkingPhraseIndex=0,this.currentThinkingPhrase="Thinking..."}subscribeToInviteEvents(){this.subscriptions.push(this.codayService.currentInviteEvent$.subscribe(t=>{t?this.handleInviteEvent(t.invite,t.defaultValue):this.currentInvite=""}))}handleInviteEvent(t,e){this.currentInvite=t,e&&(this.message=e,setTimeout(()=>this.adjustTextareaHeight(),0)),setTimeout(()=>{this.messageInput?.nativeElement&&this.messageInput.nativeElement.focus()},50)}subscribeToMessageRestore(){this.subscriptions.push(this.codayService.messageToRestore$.subscribe(t=>{t.trim()&&(console.log("[CHAT-TEXTAREA] Restoring message content:",t.substring(0,50)+"..."),this.restoreMessageContent(t))}))}restoreMessageContent(t){this.message=t,this.messageInput?.nativeElement&&(this.messageInput.nativeElement.focus(),setTimeout(()=>{let e=this.messageInput.nativeElement,i=this.message.length;e.setSelectionRange(i,i)},0)),setTimeout(()=>this.adjustTextareaHeight(),10)}focusTextarea(){let t=this.messageInput?.nativeElement;console.log("[CHAT-TEXTAREA] focusTextarea called",{hasElement:!!t,isDisabled:this.isDisabled,isThinking:this.isThinking,elementDisabled:t?.disabled,isSessionInitializing:this.isSessionInitializing}),t&&!t.disabled?(t.focus(),console.log("[CHAT-TEXTAREA] Textarea focused successfully")):console.log("[CHAT-TEXTAREA] Focus blocked - element disabled or not available")}checkForAutocomplete(){let t=this.message;if(t.startsWith("@")){let e=t.substring(1);if(e.includes(" ")){this.hideAutocomplete();return}this.showAgentAutocomplete(e);return}if(t.startsWith("/")){let e=t.substring(1);if(e.includes(" ")){this.hideAutocomplete();return}this.showPromptAutocomplete(e);return}this.hideAutocomplete()}showAgentAutocomplete(t){this.autocompleteTrigger="@";try{let e=this.projectStateService.getSelectedProjectIdOrThrow();this.agentApiService.getAgentsAutocomplete(e,t).subscribe({next:i=>{this.autocompleteItems=i,this.autocompleteVisible=i.length>0,this.selectedAutocompleteIndex=0},error:i=>{console.error("[AUTOCOMPLETE] Error loading agents:",i),this.hideAutocomplete()}})}catch{console.warn("[AUTOCOMPLETE] No project selected, cannot load agents"),this.hideAutocomplete()}}showPromptAutocomplete(t){this.autocompleteTrigger="/";try{let e=this.projectStateService.getSelectedProjectIdOrThrow();this.promptApiService.getPromptsAutocomplete(e,t).subscribe({next:i=>{this.autocompleteItems=i,this.autocompleteVisible=i.length>0,this.selectedAutocompleteIndex=0},error:i=>{console.error("[AUTOCOMPLETE] Error loading prompts:",i),this.hideAutocomplete()}})}catch{console.warn("[AUTOCOMPLETE] No project selected, cannot load prompts"),this.hideAutocomplete()}}hideAutocomplete(){this.autocompleteVisible=!1,this.autocompleteItems=[],this.selectedAutocompleteIndex=0}selectAutocompleteItem(){let t=this.autocompleteItems[this.selectedAutocompleteIndex];if(!t)return;let e=null;if(this.autocompleteTrigger==="/"){let i=t,n=i.parameterFormat;if(console.log(i),n===void 0)this.message=`/${t.name}`;else if(n==="")this.message=`/${t.name} `;else{this.message=`/${t.name} ${n}`;let r=this.message.indexOf('=""');r!==-1&&(e=r+2)}}else this.message=`@${t.name} `;this.hideAutocomplete(),setTimeout(()=>{if(this.messageInput?.nativeElement)if(this.messageInput.nativeElement.focus(),e!==null)this.messageInput.nativeElement.setSelectionRange(e,e);else{let i=this.message.length;this.messageInput.nativeElement.setSelectionRange(i,i)}},0)}selectAutocompleteItemByClick(t){this.selectedAutocompleteIndex=t,this.selectAutocompleteItem()}getAutocompleteQuery(){return this.message.substring(1).split(" ")[0]??""}getParameterFormat(t){return t.parameterFormat}hasParameterFormat(t){return this.autocompleteTrigger==="/"&&t.parameterFormat!==void 0}scrollSelectedItemIntoView(){setTimeout(()=>{let t=document.querySelector(".autocomplete-popup");if(!t)return;let e=t.querySelector(".autocomplete-item.selected");e&&e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},0)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-chat-textarea"]],viewQuery:function(e,i){if(e&1&&(Q(Ab,7),Q(Ib,5)),e&2){let n;H(n=W())&&(i.messageInput=n.first),H(n=W())&&(i.fileInput=n.first)}},hostBindings:function(e,i){e&1&&_("paste",function(r){return i.onPaste(r)})("click",function(r){return i.onDocumentClick(r)},hm)},inputs:{isDisabled:"isDisabled",showWelcome:"showWelcome",isThinking:"isThinking",isStarting:"isStarting",isSessionInitializing:"isSessionInitializing"},outputs:{filesPasted:"filesPasted",messageSubmitted:"messageSubmitted",voiceRecordingToggled:"voiceRecordingToggled",heightChanged:"heightChanged",stopRequested:"stopRequested"},features:[tt],decls:7,vars:12,consts:[["messageInput",""],["fileInput",""],[1,"chat-input-container"],[1,"recording-indicator"],[1,"autocomplete-popup"],[1,"input-row","grouped-input"],[1,"message-input",3,"ngModelChange","keydown","input","focus","blur","ngModel","placeholder","disabled"],[1,"actions"],[1,"recording-dot"],["role","option","tabindex","0",1,"autocomplete-item",3,"selected"],["role","option","tabindex","0",1,"autocomplete-item",3,"click","keydown.enter","keydown.space","mouseenter"],[1,"item-name"],[3,"innerHTML"],[1,"parameter-format"],[1,"item-description",3,"innerHTML"],["icon","stop","variant","danger","title","Stop generation",1,"action-btn"],["icon","send","variant","primary",1,"send-btn",3,"title","disabled","hidden","active"],["icon","stop","variant","danger","title","Stop generation",1,"action-btn",3,"action"],["icon","send","variant","primary",1,"send-btn",3,"action","title","disabled"],["variant","default",1,"voice-btn",3,"action","icon","title"],["icon","attach_file","variant","default","title","Upload files (images or documents)",1,"upload-btn",3,"action","disabled"],["type","file","multiple","","accept","image/*,application/pdf,.pdf,.doc,.docx,.txt,.md,.json,.yaml,.yml,.csv,.xml,.html",2,"display","none",3,"change"]],template:function(e,i){if(e&1){let n=M();s(0,"div",2),C(1,Rb,3,0,"div",3),C(2,Lb,3,0,"div",4),s(3,"div",5)(4,"textarea",6,0),B("ngModelChange",function(a){return v(n),j(i.message,a)||(i.message=a),y(a)}),_("keydown",function(a){return v(n),y(i.onKeyDown(a))})("input",function(){return v(n),y(i.onInput())})("focus",function(){return v(n),y(i.isFocused=!0)})("blur",function(){return v(n),y(i.isFocused=!1)}),l(),C(6,Hb,4,3,"div",7),l()()}e&2&&(d(),x(i.isRecording?1:-1),d(),x(i.autocompleteVisible?2:-1),d(),E("focused",i.isFocused)("welcome-mode",i.showWelcome)("is-thinking",i.isThinking),d(),z("ngModel",i.message),w("placeholder",i.getPlaceholder())("disabled",i.isDisabled),d(2),x(i.isSessionInitializing?-1:6))},dependencies:[je,Le,Ve,ze,Ym,Gs],styles:['@keyframes _ngcontent-%COMP%_gradientBorderShift{0%{background-position:0 0}50%{background-position:100% 0}to{background-position:0 0}}.chat-input-container[_ngcontent-%COMP%]{flex-shrink:0;width:100%;position:relative}.thinking-progress[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0;height:3px;z-index:1}.thinking-progress[_ngcontent-%COMP%] .mdc-linear-progress__bar-inner{border-top-width:3px}.input-row.grouped-input[_ngcontent-%COMP%]{display:flex;align-items:stretch;background:var(--glass-bg);border-radius:16px;padding:0 .15rem 0 1.25rem;position:relative;transition:border-color .2s,box-shadow .2s,background .3s}.input-row[_ngcontent-%COMP%]{position:relative;background:var(--glass-bg, #1e1e1e)!important;background-clip:padding-box}.input-row[_ngcontent-%COMP%]:before{content:"";position:absolute;inset:-2px;border-radius:inherit;background-size:200% 100%;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;padding:1px;pointer-events:none;z-index:-1;animation:_ngcontent-%COMP%_gradientBorderShift 3s ease-in-out infinite}.input-row.is-thinking[_ngcontent-%COMP%]:before{inset:0;mask:none;padding:0;opacity:.15;z-index:0;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% 100%;animation:_ngcontent-%COMP%_gradientBorderShift 3s ease-in-out infinite}.input-row.is-thinking[_ngcontent-%COMP%] .message-input[_ngcontent-%COMP%], .input-row.is-thinking[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%]{position:relative;z-index:1}.input-row.grouped-input.focused[_ngcontent-%COMP%]:not(.is-thinking){box-shadow:0 0 0 4px #007aff1a}.input-row.grouped-input.focused[_ngcontent-%COMP%]:not(.is-thinking):before{background:var(--color-primary);animation:none}.message-input[_ngcontent-%COMP%]{flex:1;border:none;outline:none;background:transparent!important;box-shadow:none;font-size:1rem;padding:1rem 0;color:var(--color-text);resize:none;field-sizing:content;min-height:36px;max-height:70vh;overflow-y:auto;font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,system-ui,sans-serif;line-height:1.5}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-border);border-radius:4px}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text-secondary)}.message-input[_ngcontent-%COMP%]:focus{outline:none;border:none;box-shadow:none}.message-input[_ngcontent-%COMP%]:disabled{background-color:var(--color-bg-secondary);color:var(--color-text-secondary);cursor:not-allowed;opacity:.6}.message-input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);transition:opacity .3s ease-in-out}.message-input[_ngcontent-%COMP%]:disabled::placeholder{animation:_ngcontent-%COMP%_thinkingPulsate 2s ease-in-out infinite}@keyframes _ngcontent-%COMP%_thinkingPulsate{0%,to{opacity:.6}50%{opacity:1}}.voice-btn[_ngcontent-%COMP%], .send-btn[_ngcontent-%COMP%], .action-btn[_ngcontent-%COMP%], .upload-btn[_ngcontent-%COMP%]{margin:0}.actions[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex-wrap:wrap;justify-content:center}.voice-btn.recording[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:var(--color-error);animation:_ngcontent-%COMP%_pulse 1.5s infinite}.send-btn[_ngcontent-%COMP%]{transition:opacity .4s,margin-left .4s}.send-btn.active[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{opacity:1}.send-btn[_ngcontent-%COMP%]:not(.active) button[_ngcontent-%COMP%]{opacity:0;margin-left:calc(-.5rem - 36px)}.send-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){color:#fff;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-primary, #3b82f6) 20%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 80%,var(--color-primary, #3b82f6) 100%);background-size:300% auto;animation:sendButtonGradientShift 6s ease-in-out infinite;box-shadow:0 4px 14px #007aff30;transform:scale(1.2)}.send-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:active:not(:disabled){transform:scale(1.3);box-shadow:0 4px 24px #007aff30}.recording-indicator[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-top:.2rem;margin-bottom:.2rem;color:var(--color-error, #ff5555);font-size:.9rem;position:absolute;top:-1.5rem}@keyframes _ngcontent-%COMP%_pulse{0%,to{opacity:1}50%{opacity:.5}}.autocomplete-popup[_ngcontent-%COMP%]{position:absolute;bottom:100%;left:0;right:0;margin-bottom:.5rem;background:var(--glass-bg);-webkit-backdrop-filter:var(--glass-backdrop-blur);backdrop-filter:var(--glass-backdrop-blur);border-radius:12px;box-shadow:0 8px 32px #00000026;border:1px solid var(--color-border);max-height:400px;max-width:500px;overflow-y:auto;z-index:100}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-border);border-radius:4px}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text-secondary)}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%]{padding:.75rem 1rem;cursor:pointer;transition:background .2s;border-left:3px solid transparent}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%]:hover, .autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item.selected[_ngcontent-%COMP%]{background:var(--color-bg-hover)}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item.selected[_ngcontent-%COMP%]{border-left-color:var(--color-primary)}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%]{font-weight:600;color:var(--color-text);margin-bottom:.25rem;font-family:SF Mono,Monaco,Menlo,Cascadia Code,Consolas,monospace;font-size:.95rem}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%] strong{font-weight:700;color:var(--color-primary);background:var(--color-primary-light, rgba(99, 102, 241, .1));padding:0 2px;border-radius:2px}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%] .parameter-format[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-weight:400;opacity:.7}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-description[_ngcontent-%COMP%]{font-size:.85rem;color:var(--color-text-secondary);line-height:1.3}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-description[_ngcontent-%COMP%] strong{font-weight:700;color:var(--color-primary);background:var(--color-primary-light, rgba(99, 102, 241, .1))}@media print{.thinking-progress[_ngcontent-%COMP%], .action-btn[_ngcontent-%COMP%], .voice-btn[_ngcontent-%COMP%], .send-btn[_ngcontent-%COMP%], .upload-btn[_ngcontent-%COMP%], .recording-indicator[_ngcontent-%COMP%], .autocomplete-popup[_ngcontent-%COMP%]{display:none!important}}']})};var Wb=(o,t)=>t.label;function Ub(o,t){if(o&1){let e=M();s(0,"button",2),_("click",function(n){let r=v(e).$implicit,a=u();return y(a.executeAction(r,n))}),s(1,"mat-icon"),p(2),l()()}if(o&2){let e=t.$implicit;K("title",e.tooltip||e.label),d(),K("aria-label",e.label),d(),F(e.icon)}}var Ys=class o{actions=[];executeAction(t,e){e.stopPropagation(),t.action()}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-message-context-menu"]],inputs:{actions:"actions"},decls:3,vars:0,consts:[[1,"context-menu-wrapper"],["mat-icon-button",""],["mat-icon-button","",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0),xe(1,Ub,3,3,"button",1,Wb),l()),e&2&&(d(),we(i.actions))},dependencies:[Pe,Qe,he],styles:[".context-menu-wrapper[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center}.context-menu-wrapper[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{transform:scale(.75)}"]})};var Qs=class o{snackBar=m(qr);success(t,e=2e3){this.snackBar.open(t,"",{duration:e,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["snackbar-success"]})}error(t,e=3e3){this.snackBar.open(t,"",{duration:e,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["snackbar-error"]})}info(t,e=2e3){this.snackBar.open(t,"",{duration:e,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["snackbar-info"]})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var $b=o=>({"user-message-wrapper":o});function qb(o,t){if(o&1&&(s(0,"div",5)(1,"div",9),p(2),l()()),o&2){let e=u(2);d(2),te(" ",e.message.speaker," ")}}function Gb(o,t){if(o&1&&(s(0,"time",7),p(1),l()),o&2){let e=u(2);d(),F(e.formattedTimestamp)}}function Yb(o,t){if(o&1&&(s(0,"div",8),I(1,"app-message-context-menu",10),l()),o&2){let e=u(2);d(),w("actions",e.actions)}}function Qb(o,t){if(o&1&&(C(0,qb,3,1,"div",5),I(1,"div",6),C(2,Gb,2,1,"time",7),C(3,Yb,2,1,"div",8)),o&2){let e=u();x(e.shouldShowSpeaker?0:-1),d(),w("innerHTML",e.renderedContent,Kt),d(),x(e.formattedTimestamp?2:-1),d(),x(e.isLongMessage&&e.shouldShowActions&&e.message.role==="assistant"?3:-1)}}function Xb(o,t){if(o&1&&(s(0,"a",12),p(1,"view"),l()),o&2){let e=u(2);w("href",e.eventLink,Qn)}}function Kb(o,t){if(o&1&&(s(0,"div",2),I(1,"span",11),C(2,Xb,2,1,"a",12),l()),o&2){let e=u();d(),w("innerHTML",e.renderedContent,Kt),d(),x(e.eventLink?2:-1)}}function Zb(o,t){if(o&1&&(s(0,"div",3),I(1,"app-message-context-menu",10),l()),o&2){let e=u();d(),w("actions",e.actions)}}function Jb(o,t){if(o&1&&(s(0,"div",4),I(1,"app-message-context-menu",10),l()),o&2){let e=u();d(),w("actions",e.actions)}}var tr=class o{destroy$=new R;message;canDelete=!0;copyRequested=new U;deleteRequested=new U;renderedContent="";shouldHideTechnical=!1;shouldHideWarning=!1;sanitizer=m(Di);notificationService=m(Qs);preferencesService=m(nt);projectState=m(Se);threadState=m(Pt);markdownService=m(Wi);get messageClasses(){return{[this.message.role]:!0,[this.message.type]:!0,"hidden-technical":this.shouldHideTechnical&&this.message.type==="technical","hidden-warning":this.shouldHideWarning&&this.message.type==="warning"}}ngOnInit(){return ee(this,null,function*(){yield this.renderMarkdown(),this.preferencesService.hideTechnicalMessages$.pipe(L(this.destroy$)).subscribe(t=>{this.shouldHideTechnical=t}),this.preferencesService.hideWarningMessages$.pipe(L(this.destroy$)).subscribe(t=>{this.shouldHideWarning=t}),this.shouldHideTechnical=this.preferencesService.getHideTechnicalMessages(),this.shouldHideWarning=this.preferencesService.getHideWarningMessages()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get shouldShowSpeaker(){return this.message.role==="user"?this.message.speaker.startsWith("@"):this.message.role==="assistant"}get shouldShowActions(){return this.message.role==="user"||this.message.role==="assistant"}get isSimplified(){return this.message.role!=="user"&&this.message.role!=="assistant"}datePipe=m(Ir);get formattedTimestamp(){if(this.message.role!=="user"||!this.message.timestamp)return null;let t=new Date().toDateString()===this.message.timestamp.toDateString();return this.datePipe.transform(this.message.timestamp,t?"HH:mm":"dd/MM HH:mm")}get isLongMessage(){let t=this.extractTextContent();return t.length>1e3||t.split(`
|
|
341
341
|
`).length>20}get actions(){let t=[];return this.message.role==="user"&&this.canDelete&&t.push({icon:"delete",label:"Delete from here",tooltip:"Delete this message and all following messages",action:()=>this.onDelete(),destructive:!0}),t.push({icon:"content_copy",label:"Copy message",tooltip:"Copy message content to clipboard",action:()=>this.onCopy()}),t}get eventLink(){if(!this.message.eventId)return null;let t=this.projectState.getSelectedProjectId(),e=this.threadState.getSelectedThreadId();return!t||!e?null:`/api/projects/${t}/threads/${e}/messages/${encodeURIComponent(this.message.eventId)}/formatted`}renderMarkdown(){return ee(this,null,function*(){try{let t=yield this.renderRichContent(this.message.content);this.renderedContent=this.sanitizer.bypassSecurityTrustHtml(t)}catch(t){console.error("Error parsing rich content:",t);let e=this.extractTextContent();this.renderedContent=this.sanitizer.bypassSecurityTrustHtml(e)}})}renderRichContent(t){return ee(this,null,function*(){let e=[];for(let i of t)if(i.type==="text"){let n=yield this.markdownService.parse(i.content);e.push(`<div class="text-part">${n}</div>`)}else if(i.type==="image"){let n=`data:${i.mimeType};base64,${i.content}`,r=i.source||"Image",a=`
|
|
342
342
|
<div class="image-content">
|
|
343
343
|
<img src="${n}"
|
|
@@ -348,10 +348,10 @@ This ensures the memory system stays efficient and valuable.`],createdBy:"system
|
|
|
348
348
|
</div>
|
|
349
349
|
`;e.push(a)}return e.join("")})}onCopy(){let t=this.extractTextContent();t.trim()&&navigator.clipboard.writeText(t).then(()=>{console.log("[CHAT-MESSAGE] Message copied to clipboard"),this.notificationService.success("Message copied to clipboard")}).catch(e=>{console.error("[CHAT-MESSAGE] Failed to copy message:",e),this.notificationService.error("Failed to copy message")}),this.copyRequested.emit(this.message)}onDelete(){console.log("[CHAT-MESSAGE] Delete requested for message:",this.message.id),this.deleteRequested.emit(this.message)}extractTextContent(){return this.message.content.filter(t=>t.type==="text").map(t=>t.content).join(`
|
|
350
350
|
|
|
351
|
-
`)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-chat-message"]],inputs:{message:"message",canDelete:"canDelete"},outputs:{copyRequested:"copyRequested",deleteRequested:"deleteRequested"},features:[qe([Ir])],decls:6,vars:8,consts:[[1,"message-wrapper",3,"ngClass"],[1,"message",3,"ngClass"],[1,"simple-content","markdown-content"],[1,"actions","assistant-top-actions"],[1,"actions","user-top-actions"],[1,"message-header"],[1,"content","markdown-content",3,"innerHTML"],[1,"message-timestamp"],[1,"actions","bottom-actions"],[1,"speaker"],[3,"actions"],[3,"innerHTML"],["target","_blank",1,"event-link",3,"href"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1),C(2,Qb,4,4),C(3,Kb,3,2,"div",2),l(),C(4,Zb,2,1,"div",3),C(5,Jb,2,1,"div",4),l()),e&2&&(w("ngClass",ym(6,$b,i.message.role==="user")),d(),w("ngClass",i.messageClasses),d(),x(i.isSimplified?-1:2),d(),x(i.isSimplified?3:-1),d(),x(!i.isLongMessage&&i.shouldShowActions&&i.message.role==="assistant"?4:-1),d(),x(i.shouldShowActions&&i.message.role==="user"?5:-1))},dependencies:[Ys,Pn],styles:[".message-wrapper[_ngcontent-%COMP%]{margin:0;display:flex;align-items:flex-start;gap:.5rem}.message-wrapper.user-message-wrapper[_ngcontent-%COMP%]{margin:.75rem 0;flex-direction:row-reverse;align-items:flex-start}.message[_ngcontent-%COMP%]{position:relative}.message.user[_ngcontent-%COMP%]{padding:1rem 1.25rem .5rem;background:var(--color-message-user);border-radius:18px 18px 6px;border:1px solid var(--glass-border);box-shadow:none;backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);width:fit-content;max-width:75%;min-width:120px;word-wrap:break-word;transition:transform .2s ease,box-shadow .2s ease}.message.user[_ngcontent-%COMP%] .message-timestamp[_ngcontent-%COMP%]{display:block;text-align:right;font-size:.7rem;color:var(--color-text-secondary, #6272a4);white-space:nowrap;margin-top:.4rem;opacity:.7}.message.user[_ngcontent-%COMP%]:hover{transform:translateY(-1px);box-shadow:0 12px 40px #1f268733}.message.assistant[_ngcontent-%COMP%]{background:transparent;border:none;box-shadow:none;border-radius:0;margin-left:0;margin-right:auto;padding:.5rem 0;width:100%;max-width:none;min-width:0}.message.system[_ngcontent-%COMP%], .message.technical[_ngcontent-%COMP%]{padding:.5rem .75rem;background:transparent;border:none;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none;margin:0;font-family:SF Mono,Monaco,Menlo,monospace;font-size:.85rem;color:var(--color-text-secondary);max-width:none;width:auto;min-width:auto}.message.system[_ngcontent-%COMP%]:hover, .message.technical[_ngcontent-%COMP%]:hover{transform:none;box-shadow:none}.message.hidden-technical[_ngcontent-%COMP%], .message.hidden-warning[_ngcontent-%COMP%]{display:none!important}.message.error[_ngcontent-%COMP%]{padding:1rem 1.25rem;background:#ff3b301f;border-left:3px solid var(--color-error);color:var(--color-error)}.message.warning[_ngcontent-%COMP%]{padding:1rem 1.25rem;background:#ff95001f;border-left:3px solid var(--color-warning);color:var(--color-warning)}.message-header[_ngcontent-%COMP%]{margin-bottom:.5rem}.speaker[_ngcontent-%COMP%]{font-weight:600;font-size:.85rem;color:var(--color-text-secondary, #6272a4)}.content[_ngcontent-%COMP%]{line-height:1.5}.context-menu-top[_ngcontent-%COMP%]{top:.5rem;right:.5rem;z-index:10}.context-menu-bottom[_ngcontent-%COMP%]{bottom:.5rem;right:.5rem;z-index:10}.user-top-actions[_ngcontent-%COMP%]{display:flex;align-items:flex-start;padding-top:.5rem;opacity:0;transition:opacity .2s ease}.user-message-wrapper[_ngcontent-%COMP%]:hover .user-top-actions[_ngcontent-%COMP%]{opacity:1}.assistant-top-actions[_ngcontent-%COMP%]{display:flex;align-items:flex-start;padding-top:.5rem;opacity:0;transition:opacity .2s ease}.message-wrapper[_ngcontent-%COMP%]:hover .assistant-top-actions[_ngcontent-%COMP%]{opacity:1}.simple-content[_ngcontent-%COMP%]{display:flex}.simple-content[_ngcontent-%COMP%] .event-link[_ngcontent-%COMP%]{margin-left:5px;font-size:.9em;color:var(--color-link, #3498db);text-decoration:none}.simple-content[_ngcontent-%COMP%] .event-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.text-part[_ngcontent-%COMP%]{margin:4px 0}.image-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;margin:1em 0}.message-image[_ngcontent-%COMP%]{display:block;max-width:100%;height:auto;margin:8px 0;border-radius:12px;cursor:pointer;box-shadow:var(--glass-shadow);transition:transform .3s ease,box-shadow .3s ease;border:1px solid var(--glass-border)}.message-image[_ngcontent-%COMP%]:hover{transform:scale(1.02) translateY(-2px);box-shadow:0 16px 48px #00000026}@media (max-width: 768px){.message-image[_ngcontent-%COMP%]{border-radius:4px;margin:6px 0}}@media (max-width: 480px){.message-image[_ngcontent-%COMP%]{margin:4px 0}}"]})};var e0=["determinateSpinner"];function t0(o,t){if(o&1&&(en(),s(0,"svg",11),A(1,"circle",12),l()),o&2){let e=u();X("viewBox",e._viewBox()),d(),Ii("stroke-dasharray",e._strokeCircumference(),"px")("stroke-dashoffset",e._strokeCircumference()/2,"px")("stroke-width",e._circleStrokeWidth(),"%"),X("r",e._circleRadius())}}var i0=new ne("mat-progress-spinner-default-options",{providedIn:"root",factory:n0});function n0(){return{diameter:Zh}}var Zh=100,o0=10,ir=(()=>{class o{_elementRef=m(ie);_noopAnimations;get color(){return this._color||this._defaultColor}set color(e){this._color=e}_color;_defaultColor="primary";_determinateCircle;constructor(){let e=m(i0),i=jm(),n=this._elementRef.nativeElement;this._noopAnimations=i==="di-disabled"&&!!e&&!e._forceAnimations,this.mode=n.nodeName.toLowerCase()==="mat-spinner"?"indeterminate":"determinate",!this._noopAnimations&&i==="reduced-motion"&&n.classList.add("mat-progress-spinner-reduced-motion"),e&&(e.color&&(this.color=this._defaultColor=e.color),e.diameter&&(this.diameter=e.diameter),e.strokeWidth&&(this.strokeWidth=e.strokeWidth))}mode;get value(){return this.mode==="determinate"?this._value:0}set value(e){this._value=Math.max(0,Math.min(100,e||0))}_value=0;get diameter(){return this._diameter}set diameter(e){this._diameter=e||0}_diameter=Zh;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(e){this._strokeWidth=e||0}_strokeWidth;_circleRadius(){return(this.diameter-o0)/2}_viewBox(){let e=this._circleRadius()*2+this.strokeWidth;return`0 0 ${e} ${e}`}_strokeCircumference(){return 2*Math.PI*this._circleRadius()}_strokeDashOffset(){return this.mode==="determinate"?this._strokeCircumference()*(100-this._value)/100:null}_circleStrokeWidth(){return this.strokeWidth/this.diameter*100}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(i,n){if(i&1&&Q(e0,5),i&2){let r;H(r=W())&&(n._determinateCircle=r.first)}},hostAttrs:["role","progressbar","tabindex","-1",1,"mat-mdc-progress-spinner","mdc-circular-progress"],hostVars:18,hostBindings:function(i,n){i&2&&(X("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",n.mode==="determinate"?n.value:null)("mode",n.mode),tn("mat-"+n.color),Ii("width",n.diameter,"px")("height",n.diameter,"px")("--mat-progress-spinner-size",n.diameter+"px")("--mat-progress-spinner-active-indicator-width",n.diameter+"px"),E("_mat-animation-noopable",n._noopAnimations)("mdc-circular-progress--indeterminate",n.mode==="indeterminate"))},inputs:{color:"color",mode:"mode",value:[2,"value","value",ui],diameter:[2,"diameter","diameter",ui],strokeWidth:[2,"strokeWidth","strokeWidth",ui]},exportAs:["matProgressSpinner"],decls:14,vars:11,consts:[["circle",""],["determinateSpinner",""],["aria-hidden","true",1,"mdc-circular-progress__determinate-container"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__determinate-circle-graphic"],["cx","50%","cy","50%",1,"mdc-circular-progress__determinate-circle"],["aria-hidden","true",1,"mdc-circular-progress__indeterminate-container"],[1,"mdc-circular-progress__spinner-layer"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-left"],[3,"ngTemplateOutlet"],[1,"mdc-circular-progress__gap-patch"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-right"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__indeterminate-circle-graphic"],["cx","50%","cy","50%"]],template:function(i,n){if(i&1&&($e(0,t0,2,8,"ng-template",null,0,Ra),s(2,"div",2,1),en(),s(4,"svg",3),A(5,"circle",4),l()(),Aa(),s(6,"div",5)(7,"div",6)(8,"div",7),Da(9,8),l(),s(10,"div",9),Da(11,8),l(),s(12,"div",10),Da(13,8),l()()()),i&2){let r=Jt(1);d(4),X("viewBox",n._viewBox()),d(),Ii("stroke-dasharray",n._strokeCircumference(),"px")("stroke-dashoffset",n._strokeDashOffset(),"px")("stroke-width",n._circleStrokeWidth(),"%"),X("r",n._circleRadius()),d(4),w("ngTemplateOutlet",r),d(2),w("ngTemplateOutlet",r),d(2),w("ngTemplateOutlet",r)}},dependencies:[La],styles:[`.mat-mdc-progress-spinner{--mat-progress-spinner-animation-multiplier: 1;display:block;overflow:hidden;line-height:0;position:relative;direction:ltr;transition:opacity 250ms cubic-bezier(0.4, 0, 0.6, 1)}.mat-mdc-progress-spinner circle{stroke-width:var(--mat-progress-spinner-active-indicator-width, 4px)}.mat-mdc-progress-spinner._mat-animation-noopable,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__determinate-circle{transition:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__spinner-layer,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container{animation:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container circle{stroke-dasharray:0 !important}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle{stroke:currentColor;stroke:CanvasText}}.mat-progress-spinner-reduced-motion{--mat-progress-spinner-animation-multiplier: 1.25}.mdc-circular-progress__determinate-container,.mdc-circular-progress__indeterminate-circle-graphic,.mdc-circular-progress__indeterminate-container,.mdc-circular-progress__spinner-layer{position:absolute;width:100%;height:100%}.mdc-circular-progress__determinate-container{transform:rotate(-90deg)}.mdc-circular-progress--indeterminate .mdc-circular-progress__determinate-container{opacity:0}.mdc-circular-progress__indeterminate-container{font-size:0;letter-spacing:0;white-space:nowrap;opacity:0}.mdc-circular-progress--indeterminate .mdc-circular-progress__indeterminate-container{opacity:1;animation:mdc-circular-progress-container-rotate calc(1568.2352941176ms*var(--mat-progress-spinner-animation-multiplier)) linear infinite}.mdc-circular-progress__determinate-circle-graphic,.mdc-circular-progress__indeterminate-circle-graphic{fill:rgba(0,0,0,0)}.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:var(--mat-progress-spinner-active-indicator-color, var(--mat-sys-primary))}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:CanvasText}}.mdc-circular-progress__determinate-circle{transition:stroke-dashoffset 500ms cubic-bezier(0, 0, 0.2, 1)}.mdc-circular-progress__gap-patch{position:absolute;top:0;left:47.5%;box-sizing:border-box;width:5%;height:100%;overflow:hidden}.mdc-circular-progress__gap-patch .mdc-circular-progress__indeterminate-circle-graphic{left:-900%;width:2000%;transform:rotate(180deg)}.mdc-circular-progress__circle-clipper .mdc-circular-progress__indeterminate-circle-graphic{width:200%}.mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{left:-100%}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-left .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-left-spin calc(1333ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-right-spin calc(1333ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress__circle-clipper{display:inline-flex;position:relative;width:50%;height:100%;overflow:hidden}.mdc-circular-progress--indeterminate .mdc-circular-progress__spinner-layer{animation:mdc-circular-progress-spinner-layer-rotate calc(5332ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}@keyframes mdc-circular-progress-container-rotate{to{transform:rotate(360deg)}}@keyframes mdc-circular-progress-spinner-layer-rotate{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}@keyframes mdc-circular-progress-left-spin{from{transform:rotate(265deg)}50%{transform:rotate(130deg)}to{transform:rotate(265deg)}}@keyframes mdc-circular-progress-right-spin{from{transform:rotate(-265deg)}50%{transform:rotate(-130deg)}to{transform:rotate(-265deg)}}
|
|
352
|
-
`],encapsulation:2,changeDetection:0})}return o})();var nr=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({imports:[ae]})}return o})();var r0=(o,t)=>t.id;function a0(o,t){if(o&1&&(s(0,"span",4),p(1),l()),o&2){let e=u();d(),F(e.taskSummary)}}function s0(o,t){o&1&&(s(0,"div",6),A(1,"mat-spinner",8),s(2,"span"),p(3,"Loading..."),l()()),o&2&&(d(),w("diameter",16))}function l0(o,t){if(o&1&&A(0,"app-delegation-inline",9),o&2){let e=u().$implicit;w("subThreadId",e.subThreadId)("agentName",e.delegationAgentName)}}function c0(o,t){if(o&1&&A(0,"app-chat-message",10),o&2){let e=u().$implicit;w("message",e)("canDelete",!1)}}function d0(o,t){if(o&1&&C(0,l0,1,2,"app-delegation-inline",9)(1,c0,1,2,"app-chat-message",10),o&2){let e=t.$implicit;x(e.type==="delegation"?0:1)}}function m0(o,t){if(o&1&&(s(0,"div",7)(1,"div",11),p(2),l()()),o&2){let e=u(2);d(2),F(e.streamingText)}}function p0(o,t){if(o&1&&(s(0,"div",5),C(1,s0,4,1,"div",6),xe(2,d0,2,1,null,null,r0),C(4,m0,3,1,"div",7),l()),o&2){let e=u();d(),x(e.isLoading?1:-1),d(),we(e.subMessages),d(2),x(e.streamingText?4:-1)}}var Xs=class o{subThreadId;agentName;isExpanded=!1;isLoading=!1;subMessages=[];streamingText="";eventSubscription;codayService=m(Qt);threadApi=m(Yi);get taskSummary(){let t=this.subMessages.find(e=>e.role==="user");if(t){let e=t.content.filter(i=>i.type==="text").map(i=>i.content).join(" ");return e.length>120?e.substring(0,120)+"...":e}return""}ngOnInit(){for(let t of this.codayService.getBufferedSubThreadEvents(this.subThreadId))this.handleSubThreadEvent(t);this.eventSubscription=this.codayService.subThreadEvents$.pipe(ce(t=>t.threadId===this.subThreadId)).subscribe(t=>this.handleSubThreadEvent(t))}ngOnDestroy(){this.eventSubscription?.unsubscribe()}toggle(){this.isExpanded=!this.isExpanded,this.isExpanded&&this.loadSubThreadMessages()}loadSubThreadMessages(){this.isLoading=!0,this.threadApi.getThreadMessages(this.subThreadId).subscribe({next:t=>{if(t.messages){this.subMessages=[];for(let e of t.messages){let i=aa(e);i&&this.handleSubThreadEvent(i)}}this.isLoading=!1},error:t=>{console.error("[DELEGATION-INLINE] Failed to load sub-thread messages:",t),this.isLoading=!1}})}handleSubThreadEvent(t){t instanceof Yt?this.addMessage({id:t.timestamp,role:"user",speaker:"User",content:[{type:"text",content:t.answer}],timestamp:new Date,type:"text"}):t instanceof zn?this.streamingText+=t.chunk:t instanceof Mi?(t.role==="assistant"&&(this.streamingText=""),this.addMessage({id:t.timestamp,role:t.role,speaker:t.name,content:t.content,timestamp:new Date,type:"text"})):t instanceof ki?this.addMessage({id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:t.toSingleLineString()}],timestamp:new Date,type:"technical",eventId:t.timestamp}):t instanceof li?this.addMessage({id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:t.toSingleLineString()}],timestamp:new Date,type:"technical",eventId:t.timestamp}):t instanceof $i?this.addMessage({id:t.timestamp,role:"system",speaker:t.agentName,content:[{type:"text",content:""}],timestamp:new Date,type:"delegation",subThreadId:t.subThreadId,delegationAgentName:t.agentName}):t instanceof Ui&&this.addMessage({id:t.timestamp,role:"system",speaker:t.speaker??"System",content:[{type:"text",content:t.text}],timestamp:new Date,type:"technical"})}addMessage(t){this.subMessages=[...this.subMessages,t]}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-delegation-inline"]],inputs:{subThreadId:"subThreadId",agentName:"agentName"},decls:8,vars:4,consts:[[1,"delegation-inline"],["role","button","tabindex","0",1,"delegation-header",3,"click","keydown.enter","keydown.space"],[1,"expand-icon"],[1,"agent-name"],[1,"task-summary"],[1,"delegation-body"],[1,"loading"],[1,"streaming-message"],[3,"diameter"],[3,"subThreadId","agentName"],[3,"message","canDelete"],[1,"content"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1),_("click",function(){return i.toggle()})("keydown.enter",function(){return i.toggle()})("keydown.space",function(){return i.toggle()}),s(2,"mat-icon",2),p(3),l(),s(4,"span",3),p(5),l(),C(6,a0,2,1,"span",4),l(),C(7,p0,5,2,"div",5),l()),e&2&&(d(3),F(i.isExpanded?"expand_more":"chevron_right"),d(2),F(i.agentName),d(),x(i.taskSummary?6:-1),d(),x(i.isExpanded?7:-1))},dependencies:[o,Pe,Oe,he,nr,ir,tr],styles:[".delegation-inline[_ngcontent-%COMP%]{margin:.5rem 0;border-left:3px solid var(--color-primary, #6366f1);border-radius:4px;background:var(--color-bg-secondary);overflow:hidden}.delegation-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;cursor:pointer;-webkit-user-select:none;user-select:none}.delegation-header[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.delegation-header[_ngcontent-%COMP%] .expand-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;color:var(--color-text-secondary, #94a3b8)}.delegation-header[_ngcontent-%COMP%] .agent-name[_ngcontent-%COMP%]{font-weight:600;color:var(--color-primary, #6366f1);white-space:nowrap}.delegation-header[_ngcontent-%COMP%] .task-summary[_ngcontent-%COMP%]{flex:1;color:var(--color-text-secondary, #94a3b8);font-size:.85rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.delegation-body[_ngcontent-%COMP%]{padding:0 .75rem .75rem 1.5rem;border-top:1px solid var(--color-border-light)}.delegation-body[_ngcontent-%COMP%] .loading[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 0;color:var(--color-text-secondary, #94a3b8);font-size:.85rem}.delegation-body[_ngcontent-%COMP%] .sub-messages[_ngcontent-%COMP%]{padding:.5rem 0}"]})};var or=class o{unreadCountSubject=new le(0);unreadCount$=this.unreadCountSubject.asObservable();constructor(){console.log("[UNREAD] Service initialized")}addUnread(){let e=this.unreadCountSubject.value+1;this.unreadCountSubject.next(e),console.log("[UNREAD] Added unread message, total:",e)}markAllAsRead(){this.unreadCountSubject.value>0&&(this.unreadCountSubject.next(0),console.log("[UNREAD] Marked all messages as read"))}getCurrentCount(){return this.unreadCountSubject.value}reset(){this.unreadCountSubject.next(0),console.log("[UNREAD] Counter reset")}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var rr=class o{destroy$=new R;voices;currentUtterance=null;currentOnEndCallback=null;speakingSubject=new le(!1);speaking$=this.speakingSubject.asObservable();volume=.8;rate=1.2;language="en-US";selectedVoice;preferencesService=m(nt);constructor(){this.initializeSpeechSynthesis(),this.subscribeToPreferences()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.stopSpeech()}initializeSpeechSynthesis(){if(!("speechSynthesis"in window)){console.warn("[VOICE-SERVICE] Speech synthesis not available"),this.voices=new Promise(t=>t([]));return}this.voices=new Promise((t,e)=>{let i=speechSynthesis.getVoices();if(i.length)t(i);else{let n=setTimeout(()=>{e("no voices found")},2e3);speechSynthesis.addEventListener("voiceschanged",()=>{let r=speechSynthesis.getVoices();r.length&&(clearTimeout(n),t(r))})}}),console.log("[VOICE-SERVICE] Speech synthesis initialized")}subscribeToPreferences(){this.preferencesService.voiceVolume$.pipe(L(this.destroy$)).subscribe(t=>{this.volume=t,console.log("[VOICE-SERVICE] Volume updated to:",t)}),this.preferencesService.voiceRate$.pipe(L(this.destroy$)).subscribe(t=>{this.rate=t,console.log("[VOICE-SERVICE] Rate updated to:",t)}),this.preferencesService.voiceLanguage$.pipe(L(this.destroy$)).subscribe(t=>{this.language=t,console.log("[VOICE-SERVICE] Language updated to:",t),this.updateSelectedVoiceForLanguage()}),this.preferencesService.selectedVoice$.pipe(L(this.destroy$)).subscribe(t=>{this.setSelectedVoice(t)}),this.volume=this.preferencesService.getVoiceVolume(),this.rate=this.preferencesService.getVoiceRate(),this.language=this.preferencesService.getVoiceLanguage(),this.setSelectedVoice(this.preferencesService.getSelectedVoice())}isReady(){return"speechSynthesis"in window&&this.selectedVoice!==void 0}isSpeaking(){return speechSynthesis.speaking}speak(t,e){return ee(this,null,function*(){if(!this.selectedVoice)return console.warn("[VOICE-SERVICE] No voice selected"),!1;if(!t.trim())return console.warn("[VOICE-SERVICE] No text to speak"),!1;let i=this.extractPlainText(t);if(!i.trim())return console.warn("[VOICE-SERVICE] No text to speak after markdown cleaning"),!1;this.stopSpeech();try{let n=new SpeechSynthesisUtterance(i);n.voice=this.selectedVoice,n.lang=this.selectedVoice.lang,n.volume=this.volume,n.rate=this.rate,this.currentOnEndCallback=e||null,e&&(n.onend=()=>{this.currentOnEndCallback===e&&(this.currentOnEndCallback=null,e())},n.onerror=()=>{this.currentOnEndCallback===e&&(this.currentOnEndCallback=null,e())}),this.currentUtterance=n,this.speakingSubject.next(!0);let r=n.onend,a=n.onerror;return n.onend=c=>{this.speakingSubject.next(!1),r&&r.call(n,c)},n.onerror=c=>{this.speakingSubject.next(!1),a&&a.call(n,c)},speechSynthesis.speak(n),console.log("[VOICE-SERVICE] Started speaking:",t.substring(0,50)+"..."),!0}catch(n){return console.error("[VOICE-SERVICE] Error speaking:",n),!1}})}stopSpeech(){if(this.currentUtterance||speechSynthesis.speaking){if(speechSynthesis.cancel(),this.currentUtterance=null,this.currentOnEndCallback){let t=this.currentOnEndCallback;this.currentOnEndCallback=null,t()}this.speakingSubject.next(!1),console.log("[VOICE-SERVICE] Speech stopped")}}ding(){try{let t=new(window.AudioContext||window.webkitAudioContext),e=t.createOscillator(),i=t.createGain();e.connect(i),i.connect(t.destination),e.frequency.setValueAtTime(800,t.currentTime),i.gain.setValueAtTime(.1,t.currentTime),i.gain.exponentialRampToValueAtTime(.01,t.currentTime+.1),e.start(t.currentTime),e.stop(t.currentTime+.1),console.log("[VOICE-SERVICE] Notification sound played")}catch(t){console.error("[VOICE-SERVICE] Notification sound failed:",t)}}getVoicesForLanguage(){return ee(this,null,function*(){try{let t=this.language.slice(0,2),e=yield this.voices;if(!e||e.length===0)return console.warn("[VOICE-SERVICE] No voices available on system"),[];let i=e.filter(n=>n.lang.toLowerCase().startsWith(t)).sort((n,r)=>n.localService&&!r.localService?-1:!n.localService&&r.localService?1:n.name.localeCompare(r.name));return console.log("[VOICE-SERVICE] Found matching voices:",i.length,"for language:",t),i.map(n=>({name:n.name,lang:n.lang,localService:n.localService,default:n.default,displayName:this.formatVoiceDisplayName(n)}))}catch(t){return console.error("[VOICE-SERVICE] Error getting voices for language:",t),[]}})}formatVoiceDisplayName(t){let e=t.localService?"\u{1F3E0}":"\u2601\uFE0F",i=t.default?" \u2B50":"";return`${e} ${t.name} (${t.lang})${i}`}setSelectedVoice(t){return ee(this,null,function*(){if(!t){this.selectedVoice=void 0;return}let[e,i]=t.split("|");if(!e||!i){this.selectedVoice=void 0;return}let n=(yield this.voices)?.find(r=>r.name===e&&r.lang===i);n?(this.selectedVoice=n,console.log("[VOICE-SERVICE] Selected voice:",n.name,n.lang)):(this.selectedVoice=void 0,console.warn("[VOICE-SERVICE] Voice not found:",e,i))})}updateSelectedVoiceForLanguage(){return ee(this,null,function*(){let t=yield this.getVoicesForLanguage();if(t.length===0){console.warn("[VOICE-SERVICE] No voices available for language:",this.language),this.selectedVoice=void 0,this.preferencesService.setSelectedVoice(null);return}let e=this.preferencesService.getSelectedVoice();if(e){let[n,r]=e.split("|"),a=r?.slice(0,2),c=this.language.slice(0,2);if(a===c&&t.some(g=>g.name===n&&g.lang===r)){console.log("[VOICE-SERVICE] Keeping current voice for language:",e);return}}let i=t[0];if(i){let n=`${i.name}|${i.lang}`;this.preferencesService.setSelectedVoice(n),console.log("[VOICE-SERVICE] Auto-selected voice for language change:",i.displayName)}})}testSelectedVoice(){setTimeout(()=>{if(!this.selectedVoice){console.log("[VOICE-SERVICE] No voice selected for test");return}this.stopSpeech();let t=this.getTestText();t&&this.speak(t)},100)}getTestText(){let t=this.language.slice(0,2),e={fr:"Bonjour, ceci est un test de la voix s\xE9lectionn\xE9e.",en:"Hello, this is a test of the selected voice.",es:"Hola, esta es una prueba de la voz seleccionada.",de:"Hallo, dies ist ein Test der ausgew\xE4hlten Stimme.",it:"Ciao, questo \xE8 un test della voce selezionata.",pt:"Ol\xE1, este \xE9 um teste da voz selecionada.",ja:"\u3053\u3093\u306B\u3061\u306F\u3001\u3053\u308C\u306F\u9078\u629E\u3055\u308C\u305F\u97F3\u58F0\u306E\u30C6\u30B9\u30C8\u3067\u3059\u3002",ko:"\uC548\uB155\uD558\uC138\uC694, \uC774\uAC83\uC740 \uC120\uD0DD\uB41C \uC74C\uC131\uC758 \uD14C\uC2A4\uD2B8\uC785\uB2C8\uB2E4.",zh:"\u4F60\u597D\uFF0C\u8FD9\u662F\u6240\u9009\u8BED\u97F3\u7684\u6D4B\u8BD5\u3002",ru:"\u041F\u0440\u0438\u0432\u0435\u0442, \u044D\u0442\u043E \u0442\u0435\u0441\u0442 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0433\u043E\u043B\u043E\u0441\u0430.",ar:"\u0645\u0631\u062D\u0628\u0627\u060C \u0647\u0630\u0627 \u0627\u062E\u062A\u0628\u0627\u0631 \u0644\u0644\u0635\u0648\u062A \u0627\u0644\u0645\u062D\u062F\u062F."};return e[t]||e.en||"Hello, this is a test."}extractPlainText(t){let e=t.replace(/[\u{1F600}-\u{1F64F}]|[\u{1F300}-\u{1F5FF}]|[\u{1F680}-\u{1F6FF}]|[\u{1F1E0}-\u{1F1FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|⭐/gu,"").replace(/```[\s\S]*?```/g,"code block").replace(/`([^`]+)`/g,"$1").replace(/\*\*\*(.*?)\*\*\*/g,"$1").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/~~(.*?)~~/g,"$1").replace(/#{1,6}\s*(.*)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/https?:\/\/[^\s]+/g,"link").replace(/ /g," ").replace(/&/g,"and").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"');return e=this.addNaturalPunctuation(e),e.replace(/\s+/g," ").trim()}addNaturalPunctuation(t){return t.replace(/\n+/g,`
|
|
351
|
+
`)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-chat-message"]],inputs:{message:"message",canDelete:"canDelete"},outputs:{copyRequested:"copyRequested",deleteRequested:"deleteRequested"},features:[qe([Ir])],decls:6,vars:8,consts:[[1,"message-wrapper",3,"ngClass"],[1,"message",3,"ngClass"],[1,"simple-content","markdown-content"],[1,"actions","assistant-top-actions"],[1,"actions","user-top-actions"],[1,"message-header"],[1,"content","markdown-content",3,"innerHTML"],[1,"message-timestamp"],[1,"actions","bottom-actions"],[1,"speaker"],[3,"actions"],[3,"innerHTML"],["target","_blank",1,"event-link",3,"href"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1),C(2,Qb,4,4),C(3,Kb,3,2,"div",2),l(),C(4,Zb,2,1,"div",3),C(5,Jb,2,1,"div",4),l()),e&2&&(w("ngClass",ym(6,$b,i.message.role==="user")),d(),w("ngClass",i.messageClasses),d(),x(i.isSimplified?-1:2),d(),x(i.isSimplified?3:-1),d(),x(!i.isLongMessage&&i.shouldShowActions&&i.message.role==="assistant"?4:-1),d(),x(i.shouldShowActions&&i.message.role==="user"?5:-1))},dependencies:[Ys,En],styles:[".message-wrapper[_ngcontent-%COMP%]{margin:0;display:flex;align-items:flex-start;gap:.5rem}.message-wrapper.user-message-wrapper[_ngcontent-%COMP%]{margin:.75rem 0;flex-direction:row-reverse;align-items:flex-start}.message[_ngcontent-%COMP%]{position:relative}.message.user[_ngcontent-%COMP%]{padding:1rem 1.25rem .5rem;background:var(--color-message-user);border-radius:18px 18px 6px;border:1px solid var(--glass-border);box-shadow:none;backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);width:fit-content;max-width:75%;min-width:120px;word-wrap:break-word;transition:transform .2s ease,box-shadow .2s ease}.message.user[_ngcontent-%COMP%] .message-timestamp[_ngcontent-%COMP%]{display:block;text-align:right;font-size:.7rem;color:var(--color-text-secondary, #6272a4);white-space:nowrap;margin-top:.4rem;opacity:.7}.message.user[_ngcontent-%COMP%]:hover{transform:translateY(-1px);box-shadow:0 12px 40px #1f268733}.message.assistant[_ngcontent-%COMP%]{background:transparent;border:none;box-shadow:none;border-radius:0;margin-left:0;margin-right:auto;padding:.5rem 0;width:100%;max-width:none;min-width:0}.message.system[_ngcontent-%COMP%], .message.technical[_ngcontent-%COMP%]{padding:.5rem .75rem;background:transparent;border:none;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none;margin:0;font-family:SF Mono,Monaco,Menlo,monospace;font-size:.85rem;color:var(--color-text-secondary);max-width:none;width:auto;min-width:auto}.message.system[_ngcontent-%COMP%]:hover, .message.technical[_ngcontent-%COMP%]:hover{transform:none;box-shadow:none}.message.hidden-technical[_ngcontent-%COMP%], .message.hidden-warning[_ngcontent-%COMP%]{display:none!important}.message.error[_ngcontent-%COMP%]{padding:1rem 1.25rem;background:#ff3b301f;border-left:3px solid var(--color-error);color:var(--color-error)}.message.warning[_ngcontent-%COMP%]{padding:1rem 1.25rem;background:#ff95001f;border-left:3px solid var(--color-warning);color:var(--color-warning)}.message-header[_ngcontent-%COMP%]{margin-bottom:.5rem}.speaker[_ngcontent-%COMP%]{font-weight:600;font-size:.85rem;color:var(--color-text-secondary, #6272a4)}.content[_ngcontent-%COMP%]{line-height:1.5}.context-menu-top[_ngcontent-%COMP%]{top:.5rem;right:.5rem;z-index:10}.context-menu-bottom[_ngcontent-%COMP%]{bottom:.5rem;right:.5rem;z-index:10}.user-top-actions[_ngcontent-%COMP%]{display:flex;align-items:flex-start;padding-top:.5rem;opacity:0;transition:opacity .2s ease}.user-message-wrapper[_ngcontent-%COMP%]:hover .user-top-actions[_ngcontent-%COMP%]{opacity:1}.assistant-top-actions[_ngcontent-%COMP%]{display:flex;align-items:flex-start;padding-top:.5rem;opacity:0;transition:opacity .2s ease}.message-wrapper[_ngcontent-%COMP%]:hover .assistant-top-actions[_ngcontent-%COMP%]{opacity:1}.simple-content[_ngcontent-%COMP%]{display:flex}.simple-content[_ngcontent-%COMP%] .event-link[_ngcontent-%COMP%]{margin-left:5px;font-size:.9em;color:var(--color-link, #3498db);text-decoration:none}.simple-content[_ngcontent-%COMP%] .event-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.text-part[_ngcontent-%COMP%]{margin:4px 0}.image-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;margin:1em 0}.message-image[_ngcontent-%COMP%]{display:block;max-width:100%;height:auto;margin:8px 0;border-radius:12px;cursor:pointer;box-shadow:var(--glass-shadow);transition:transform .3s ease,box-shadow .3s ease;border:1px solid var(--glass-border)}.message-image[_ngcontent-%COMP%]:hover{transform:scale(1.02) translateY(-2px);box-shadow:0 16px 48px #00000026}@media (max-width: 768px){.message-image[_ngcontent-%COMP%]{border-radius:4px;margin:6px 0}}@media (max-width: 480px){.message-image[_ngcontent-%COMP%]{margin:4px 0}}"]})};var e0=["determinateSpinner"];function t0(o,t){if(o&1&&(en(),s(0,"svg",11),I(1,"circle",12),l()),o&2){let e=u();K("viewBox",e._viewBox()),d(),Ii("stroke-dasharray",e._strokeCircumference(),"px")("stroke-dashoffset",e._strokeCircumference()/2,"px")("stroke-width",e._circleStrokeWidth(),"%"),K("r",e._circleRadius())}}var i0=new ne("mat-progress-spinner-default-options",{providedIn:"root",factory:n0});function n0(){return{diameter:Zh}}var Zh=100,o0=10,ir=(()=>{class o{_elementRef=m(ie);_noopAnimations;get color(){return this._color||this._defaultColor}set color(e){this._color=e}_color;_defaultColor="primary";_determinateCircle;constructor(){let e=m(i0),i=jm(),n=this._elementRef.nativeElement;this._noopAnimations=i==="di-disabled"&&!!e&&!e._forceAnimations,this.mode=n.nodeName.toLowerCase()==="mat-spinner"?"indeterminate":"determinate",!this._noopAnimations&&i==="reduced-motion"&&n.classList.add("mat-progress-spinner-reduced-motion"),e&&(e.color&&(this.color=this._defaultColor=e.color),e.diameter&&(this.diameter=e.diameter),e.strokeWidth&&(this.strokeWidth=e.strokeWidth))}mode;get value(){return this.mode==="determinate"?this._value:0}set value(e){this._value=Math.max(0,Math.min(100,e||0))}_value=0;get diameter(){return this._diameter}set diameter(e){this._diameter=e||0}_diameter=Zh;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(e){this._strokeWidth=e||0}_strokeWidth;_circleRadius(){return(this.diameter-o0)/2}_viewBox(){let e=this._circleRadius()*2+this.strokeWidth;return`0 0 ${e} ${e}`}_strokeCircumference(){return 2*Math.PI*this._circleRadius()}_strokeDashOffset(){return this.mode==="determinate"?this._strokeCircumference()*(100-this._value)/100:null}_circleStrokeWidth(){return this.strokeWidth/this.diameter*100}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(i,n){if(i&1&&Q(e0,5),i&2){let r;H(r=W())&&(n._determinateCircle=r.first)}},hostAttrs:["role","progressbar","tabindex","-1",1,"mat-mdc-progress-spinner","mdc-circular-progress"],hostVars:18,hostBindings:function(i,n){i&2&&(K("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",n.mode==="determinate"?n.value:null)("mode",n.mode),tn("mat-"+n.color),Ii("width",n.diameter,"px")("height",n.diameter,"px")("--mat-progress-spinner-size",n.diameter+"px")("--mat-progress-spinner-active-indicator-width",n.diameter+"px"),E("_mat-animation-noopable",n._noopAnimations)("mdc-circular-progress--indeterminate",n.mode==="indeterminate"))},inputs:{color:"color",mode:"mode",value:[2,"value","value",ui],diameter:[2,"diameter","diameter",ui],strokeWidth:[2,"strokeWidth","strokeWidth",ui]},exportAs:["matProgressSpinner"],decls:14,vars:11,consts:[["circle",""],["determinateSpinner",""],["aria-hidden","true",1,"mdc-circular-progress__determinate-container"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__determinate-circle-graphic"],["cx","50%","cy","50%",1,"mdc-circular-progress__determinate-circle"],["aria-hidden","true",1,"mdc-circular-progress__indeterminate-container"],[1,"mdc-circular-progress__spinner-layer"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-left"],[3,"ngTemplateOutlet"],[1,"mdc-circular-progress__gap-patch"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-right"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__indeterminate-circle-graphic"],["cx","50%","cy","50%"]],template:function(i,n){if(i&1&&($e(0,t0,2,8,"ng-template",null,0,Ra),s(2,"div",2,1),en(),s(4,"svg",3),I(5,"circle",4),l()(),Aa(),s(6,"div",5)(7,"div",6)(8,"div",7),Da(9,8),l(),s(10,"div",9),Da(11,8),l(),s(12,"div",10),Da(13,8),l()()()),i&2){let r=Jt(1);d(4),K("viewBox",n._viewBox()),d(),Ii("stroke-dasharray",n._strokeCircumference(),"px")("stroke-dashoffset",n._strokeDashOffset(),"px")("stroke-width",n._circleStrokeWidth(),"%"),K("r",n._circleRadius()),d(4),w("ngTemplateOutlet",r),d(2),w("ngTemplateOutlet",r),d(2),w("ngTemplateOutlet",r)}},dependencies:[La],styles:[`.mat-mdc-progress-spinner{--mat-progress-spinner-animation-multiplier: 1;display:block;overflow:hidden;line-height:0;position:relative;direction:ltr;transition:opacity 250ms cubic-bezier(0.4, 0, 0.6, 1)}.mat-mdc-progress-spinner circle{stroke-width:var(--mat-progress-spinner-active-indicator-width, 4px)}.mat-mdc-progress-spinner._mat-animation-noopable,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__determinate-circle{transition:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__spinner-layer,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container{animation:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container circle{stroke-dasharray:0 !important}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle{stroke:currentColor;stroke:CanvasText}}.mat-progress-spinner-reduced-motion{--mat-progress-spinner-animation-multiplier: 1.25}.mdc-circular-progress__determinate-container,.mdc-circular-progress__indeterminate-circle-graphic,.mdc-circular-progress__indeterminate-container,.mdc-circular-progress__spinner-layer{position:absolute;width:100%;height:100%}.mdc-circular-progress__determinate-container{transform:rotate(-90deg)}.mdc-circular-progress--indeterminate .mdc-circular-progress__determinate-container{opacity:0}.mdc-circular-progress__indeterminate-container{font-size:0;letter-spacing:0;white-space:nowrap;opacity:0}.mdc-circular-progress--indeterminate .mdc-circular-progress__indeterminate-container{opacity:1;animation:mdc-circular-progress-container-rotate calc(1568.2352941176ms*var(--mat-progress-spinner-animation-multiplier)) linear infinite}.mdc-circular-progress__determinate-circle-graphic,.mdc-circular-progress__indeterminate-circle-graphic{fill:rgba(0,0,0,0)}.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:var(--mat-progress-spinner-active-indicator-color, var(--mat-sys-primary))}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:CanvasText}}.mdc-circular-progress__determinate-circle{transition:stroke-dashoffset 500ms cubic-bezier(0, 0, 0.2, 1)}.mdc-circular-progress__gap-patch{position:absolute;top:0;left:47.5%;box-sizing:border-box;width:5%;height:100%;overflow:hidden}.mdc-circular-progress__gap-patch .mdc-circular-progress__indeterminate-circle-graphic{left:-900%;width:2000%;transform:rotate(180deg)}.mdc-circular-progress__circle-clipper .mdc-circular-progress__indeterminate-circle-graphic{width:200%}.mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{left:-100%}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-left .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-left-spin calc(1333ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-right-spin calc(1333ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress__circle-clipper{display:inline-flex;position:relative;width:50%;height:100%;overflow:hidden}.mdc-circular-progress--indeterminate .mdc-circular-progress__spinner-layer{animation:mdc-circular-progress-spinner-layer-rotate calc(5332ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}@keyframes mdc-circular-progress-container-rotate{to{transform:rotate(360deg)}}@keyframes mdc-circular-progress-spinner-layer-rotate{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}@keyframes mdc-circular-progress-left-spin{from{transform:rotate(265deg)}50%{transform:rotate(130deg)}to{transform:rotate(265deg)}}@keyframes mdc-circular-progress-right-spin{from{transform:rotate(-265deg)}50%{transform:rotate(-130deg)}to{transform:rotate(-265deg)}}
|
|
352
|
+
`],encapsulation:2,changeDetection:0})}return o})();var nr=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({imports:[ae]})}return o})();var r0=(o,t)=>t.id;function a0(o,t){if(o&1&&(s(0,"span",4),p(1),l()),o&2){let e=u();d(),F(e.taskSummary)}}function s0(o,t){o&1&&(s(0,"div",6),I(1,"mat-spinner",8),s(2,"span"),p(3,"Loading..."),l()()),o&2&&(d(),w("diameter",16))}function l0(o,t){if(o&1&&I(0,"app-delegation-inline",9),o&2){let e=u().$implicit;w("subThreadId",e.subThreadId)("agentName",e.delegationAgentName)}}function c0(o,t){if(o&1&&I(0,"app-chat-message",10),o&2){let e=u().$implicit;w("message",e)("canDelete",!1)}}function d0(o,t){if(o&1&&C(0,l0,1,2,"app-delegation-inline",9)(1,c0,1,2,"app-chat-message",10),o&2){let e=t.$implicit;x(e.type==="delegation"?0:1)}}function m0(o,t){if(o&1&&(s(0,"div",7)(1,"div",11),p(2),l()()),o&2){let e=u(2);d(2),F(e.streamingText)}}function p0(o,t){if(o&1&&(s(0,"div",5),C(1,s0,4,1,"div",6),xe(2,d0,2,1,null,null,r0),C(4,m0,3,1,"div",7),l()),o&2){let e=u();d(),x(e.isLoading?1:-1),d(),we(e.subMessages),d(2),x(e.streamingText?4:-1)}}var Xs=class o{subThreadId;agentName;isExpanded=!1;isLoading=!1;subMessages=[];streamingText="";eventSubscription;codayService=m(Qt);threadApi=m(Yi);get taskSummary(){let t=this.subMessages.find(e=>e.role==="user");if(t){let e=t.content.filter(i=>i.type==="text").map(i=>i.content).join(" ");return e.length>120?e.substring(0,120)+"...":e}return""}ngOnInit(){for(let t of this.codayService.getBufferedSubThreadEvents(this.subThreadId))this.handleSubThreadEvent(t);this.eventSubscription=this.codayService.subThreadEvents$.pipe(ce(t=>t.threadId===this.subThreadId)).subscribe(t=>this.handleSubThreadEvent(t))}ngOnDestroy(){this.eventSubscription?.unsubscribe()}toggle(){this.isExpanded=!this.isExpanded,this.isExpanded&&this.loadSubThreadMessages()}loadSubThreadMessages(){this.isLoading=!0,this.threadApi.getThreadMessages(this.subThreadId).subscribe({next:t=>{if(t.messages){this.subMessages=[];for(let e of t.messages){let i=aa(e);i&&this.handleSubThreadEvent(i)}}this.isLoading=!1},error:t=>{console.error("[DELEGATION-INLINE] Failed to load sub-thread messages:",t),this.isLoading=!1}})}handleSubThreadEvent(t){t instanceof Yt?this.addMessage({id:t.timestamp,role:"user",speaker:"User",content:[{type:"text",content:t.answer}],timestamp:new Date,type:"text"}):t instanceof Vn?this.streamingText+=t.chunk:t instanceof Mi?(t.role==="assistant"&&(this.streamingText=""),this.addMessage({id:t.timestamp,role:t.role,speaker:t.name,content:t.content,timestamp:new Date,type:"text"})):t instanceof ki?this.addMessage({id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:t.toSingleLineString()}],timestamp:new Date,type:"technical",eventId:t.timestamp}):t instanceof li?this.addMessage({id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:t.toSingleLineString()}],timestamp:new Date,type:"technical",eventId:t.timestamp}):t instanceof $i?this.addMessage({id:t.timestamp,role:"system",speaker:t.agentName,content:[{type:"text",content:""}],timestamp:new Date,type:"delegation",subThreadId:t.subThreadId,delegationAgentName:t.agentName}):t instanceof Ui&&this.addMessage({id:t.timestamp,role:"system",speaker:t.speaker??"System",content:[{type:"text",content:t.text}],timestamp:new Date,type:"technical"})}addMessage(t){this.subMessages=[...this.subMessages,t]}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-delegation-inline"]],inputs:{subThreadId:"subThreadId",agentName:"agentName"},decls:8,vars:4,consts:[[1,"delegation-inline"],["role","button","tabindex","0",1,"delegation-header",3,"click","keydown.enter","keydown.space"],[1,"expand-icon"],[1,"agent-name"],[1,"task-summary"],[1,"delegation-body"],[1,"loading"],[1,"streaming-message"],[3,"diameter"],[3,"subThreadId","agentName"],[3,"message","canDelete"],[1,"content"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1),_("click",function(){return i.toggle()})("keydown.enter",function(){return i.toggle()})("keydown.space",function(){return i.toggle()}),s(2,"mat-icon",2),p(3),l(),s(4,"span",3),p(5),l(),C(6,a0,2,1,"span",4),l(),C(7,p0,5,2,"div",5),l()),e&2&&(d(3),F(i.isExpanded?"expand_more":"chevron_right"),d(2),F(i.agentName),d(),x(i.taskSummary?6:-1),d(),x(i.isExpanded?7:-1))},dependencies:[o,Pe,Oe,he,nr,ir,tr],styles:[".delegation-inline[_ngcontent-%COMP%]{margin:.5rem 0;border-left:3px solid var(--color-primary, #6366f1);border-radius:4px;background:var(--color-bg-secondary);overflow:hidden}.delegation-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;cursor:pointer;-webkit-user-select:none;user-select:none}.delegation-header[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.delegation-header[_ngcontent-%COMP%] .expand-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;color:var(--color-text-secondary, #94a3b8)}.delegation-header[_ngcontent-%COMP%] .agent-name[_ngcontent-%COMP%]{font-weight:600;color:var(--color-primary, #6366f1);white-space:nowrap}.delegation-header[_ngcontent-%COMP%] .task-summary[_ngcontent-%COMP%]{flex:1;color:var(--color-text-secondary, #94a3b8);font-size:.85rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.delegation-body[_ngcontent-%COMP%]{padding:0 .75rem .75rem 1.5rem;border-top:1px solid var(--color-border-light)}.delegation-body[_ngcontent-%COMP%] .loading[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 0;color:var(--color-text-secondary, #94a3b8);font-size:.85rem}.delegation-body[_ngcontent-%COMP%] .sub-messages[_ngcontent-%COMP%]{padding:.5rem 0}"]})};var or=class o{unreadCountSubject=new le(0);unreadCount$=this.unreadCountSubject.asObservable();constructor(){console.log("[UNREAD] Service initialized")}addUnread(){let e=this.unreadCountSubject.value+1;this.unreadCountSubject.next(e),console.log("[UNREAD] Added unread message, total:",e)}markAllAsRead(){this.unreadCountSubject.value>0&&(this.unreadCountSubject.next(0),console.log("[UNREAD] Marked all messages as read"))}getCurrentCount(){return this.unreadCountSubject.value}reset(){this.unreadCountSubject.next(0),console.log("[UNREAD] Counter reset")}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var rr=class o{destroy$=new R;voices;currentUtterance=null;currentOnEndCallback=null;speakingSubject=new le(!1);speaking$=this.speakingSubject.asObservable();volume=.8;rate=1.2;language="en-US";selectedVoice;preferencesService=m(nt);constructor(){this.initializeSpeechSynthesis(),this.subscribeToPreferences()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.stopSpeech()}initializeSpeechSynthesis(){if(!("speechSynthesis"in window)){console.warn("[VOICE-SERVICE] Speech synthesis not available"),this.voices=new Promise(t=>t([]));return}this.voices=new Promise((t,e)=>{let i=speechSynthesis.getVoices();if(i.length)t(i);else{let n=setTimeout(()=>{e("no voices found")},2e3);speechSynthesis.addEventListener("voiceschanged",()=>{let r=speechSynthesis.getVoices();r.length&&(clearTimeout(n),t(r))})}}),console.log("[VOICE-SERVICE] Speech synthesis initialized")}subscribeToPreferences(){this.preferencesService.voiceVolume$.pipe(L(this.destroy$)).subscribe(t=>{this.volume=t,console.log("[VOICE-SERVICE] Volume updated to:",t)}),this.preferencesService.voiceRate$.pipe(L(this.destroy$)).subscribe(t=>{this.rate=t,console.log("[VOICE-SERVICE] Rate updated to:",t)}),this.preferencesService.voiceLanguage$.pipe(L(this.destroy$)).subscribe(t=>{this.language=t,console.log("[VOICE-SERVICE] Language updated to:",t),this.updateSelectedVoiceForLanguage()}),this.preferencesService.selectedVoice$.pipe(L(this.destroy$)).subscribe(t=>{this.setSelectedVoice(t)}),this.volume=this.preferencesService.getVoiceVolume(),this.rate=this.preferencesService.getVoiceRate(),this.language=this.preferencesService.getVoiceLanguage(),this.setSelectedVoice(this.preferencesService.getSelectedVoice())}isReady(){return"speechSynthesis"in window&&this.selectedVoice!==void 0}isSpeaking(){return speechSynthesis.speaking}speak(t,e){return ee(this,null,function*(){if(!this.selectedVoice)return console.warn("[VOICE-SERVICE] No voice selected"),!1;if(!t.trim())return console.warn("[VOICE-SERVICE] No text to speak"),!1;let i=this.extractPlainText(t);if(!i.trim())return console.warn("[VOICE-SERVICE] No text to speak after markdown cleaning"),!1;this.stopSpeech();try{let n=new SpeechSynthesisUtterance(i);n.voice=this.selectedVoice,n.lang=this.selectedVoice.lang,n.volume=this.volume,n.rate=this.rate,this.currentOnEndCallback=e||null,e&&(n.onend=()=>{this.currentOnEndCallback===e&&(this.currentOnEndCallback=null,e())},n.onerror=()=>{this.currentOnEndCallback===e&&(this.currentOnEndCallback=null,e())}),this.currentUtterance=n,this.speakingSubject.next(!0);let r=n.onend,a=n.onerror;return n.onend=c=>{this.speakingSubject.next(!1),r&&r.call(n,c)},n.onerror=c=>{this.speakingSubject.next(!1),a&&a.call(n,c)},speechSynthesis.speak(n),console.log("[VOICE-SERVICE] Started speaking:",t.substring(0,50)+"..."),!0}catch(n){return console.error("[VOICE-SERVICE] Error speaking:",n),!1}})}stopSpeech(){if(this.currentUtterance||speechSynthesis.speaking){if(speechSynthesis.cancel(),this.currentUtterance=null,this.currentOnEndCallback){let t=this.currentOnEndCallback;this.currentOnEndCallback=null,t()}this.speakingSubject.next(!1),console.log("[VOICE-SERVICE] Speech stopped")}}ding(){try{let t=new(window.AudioContext||window.webkitAudioContext),e=t.createOscillator(),i=t.createGain();e.connect(i),i.connect(t.destination),e.frequency.setValueAtTime(800,t.currentTime),i.gain.setValueAtTime(.1,t.currentTime),i.gain.exponentialRampToValueAtTime(.01,t.currentTime+.1),e.start(t.currentTime),e.stop(t.currentTime+.1),console.log("[VOICE-SERVICE] Notification sound played")}catch(t){console.error("[VOICE-SERVICE] Notification sound failed:",t)}}getVoicesForLanguage(){return ee(this,null,function*(){try{let t=this.language.slice(0,2),e=yield this.voices;if(!e||e.length===0)return console.warn("[VOICE-SERVICE] No voices available on system"),[];let i=e.filter(n=>n.lang.toLowerCase().startsWith(t)).sort((n,r)=>n.localService&&!r.localService?-1:!n.localService&&r.localService?1:n.name.localeCompare(r.name));return console.log("[VOICE-SERVICE] Found matching voices:",i.length,"for language:",t),i.map(n=>({name:n.name,lang:n.lang,localService:n.localService,default:n.default,displayName:this.formatVoiceDisplayName(n)}))}catch(t){return console.error("[VOICE-SERVICE] Error getting voices for language:",t),[]}})}formatVoiceDisplayName(t){let e=t.localService?"\u{1F3E0}":"\u2601\uFE0F",i=t.default?" \u2B50":"";return`${e} ${t.name} (${t.lang})${i}`}setSelectedVoice(t){return ee(this,null,function*(){if(!t){this.selectedVoice=void 0;return}let[e,i]=t.split("|");if(!e||!i){this.selectedVoice=void 0;return}let n=(yield this.voices)?.find(r=>r.name===e&&r.lang===i);n?(this.selectedVoice=n,console.log("[VOICE-SERVICE] Selected voice:",n.name,n.lang)):(this.selectedVoice=void 0,console.warn("[VOICE-SERVICE] Voice not found:",e,i))})}updateSelectedVoiceForLanguage(){return ee(this,null,function*(){let t=yield this.getVoicesForLanguage();if(t.length===0){console.warn("[VOICE-SERVICE] No voices available for language:",this.language),this.selectedVoice=void 0,this.preferencesService.setSelectedVoice(null);return}let e=this.preferencesService.getSelectedVoice();if(e){let[n,r]=e.split("|"),a=r?.slice(0,2),c=this.language.slice(0,2);if(a===c&&t.some(g=>g.name===n&&g.lang===r)){console.log("[VOICE-SERVICE] Keeping current voice for language:",e);return}}let i=t[0];if(i){let n=`${i.name}|${i.lang}`;this.preferencesService.setSelectedVoice(n),console.log("[VOICE-SERVICE] Auto-selected voice for language change:",i.displayName)}})}testSelectedVoice(){setTimeout(()=>{if(!this.selectedVoice){console.log("[VOICE-SERVICE] No voice selected for test");return}this.stopSpeech();let t=this.getTestText();t&&this.speak(t)},100)}getTestText(){let t=this.language.slice(0,2),e={fr:"Bonjour, ceci est un test de la voix s\xE9lectionn\xE9e.",en:"Hello, this is a test of the selected voice.",es:"Hola, esta es una prueba de la voz seleccionada.",de:"Hallo, dies ist ein Test der ausgew\xE4hlten Stimme.",it:"Ciao, questo \xE8 un test della voce selezionata.",pt:"Ol\xE1, este \xE9 um teste da voz selecionada.",ja:"\u3053\u3093\u306B\u3061\u306F\u3001\u3053\u308C\u306F\u9078\u629E\u3055\u308C\u305F\u97F3\u58F0\u306E\u30C6\u30B9\u30C8\u3067\u3059\u3002",ko:"\uC548\uB155\uD558\uC138\uC694, \uC774\uAC83\uC740 \uC120\uD0DD\uB41C \uC74C\uC131\uC758 \uD14C\uC2A4\uD2B8\uC785\uB2C8\uB2E4.",zh:"\u4F60\u597D\uFF0C\u8FD9\u662F\u6240\u9009\u8BED\u97F3\u7684\u6D4B\u8BD5\u3002",ru:"\u041F\u0440\u0438\u0432\u0435\u0442, \u044D\u0442\u043E \u0442\u0435\u0441\u0442 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0433\u043E\u043B\u043E\u0441\u0430.",ar:"\u0645\u0631\u062D\u0628\u0627\u060C \u0647\u0630\u0627 \u0627\u062E\u062A\u0628\u0627\u0631 \u0644\u0644\u0635\u0648\u062A \u0627\u0644\u0645\u062D\u062F\u062F."};return e[t]||e.en||"Hello, this is a test."}extractPlainText(t){let e=t.replace(/[\u{1F600}-\u{1F64F}]|[\u{1F300}-\u{1F5FF}]|[\u{1F680}-\u{1F6FF}]|[\u{1F1E0}-\u{1F1FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|⭐/gu,"").replace(/```[\s\S]*?```/g,"code block").replace(/`([^`]+)`/g,"$1").replace(/\*\*\*(.*?)\*\*\*/g,"$1").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/~~(.*?)~~/g,"$1").replace(/#{1,6}\s*(.*)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/https?:\/\/[^\s]+/g,"link").replace(/ /g," ").replace(/&/g,"and").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"');return e=this.addNaturalPunctuation(e),e.replace(/\s+/g," ").trim()}addNaturalPunctuation(t){return t.replace(/\n+/g,`
|
|
353
353
|
`).split(`
|
|
354
|
-
`).map(e=>this.addPeriodIfNeeded(e.trim())).filter(e=>e.length>0).join(" ")}addPeriodIfNeeded(t){return t?/[.!?;:]$/.test(t)?t:t+".":""}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var Ks=class o{thinkingPhrases=["Processing request...","Thinking...","Working on it..."];currentThinkingPhrase="Processing request...";thinkingPhraseIndex=0;thinkingInterval=null;ngOnInit(){this.startThinkingAnimation()}ngOnDestroy(){this.stopThinkingAnimation()}startThinkingAnimation(){this.thinkingPhraseIndex=0,this.currentThinkingPhrase=this.thinkingPhrases[0]||"Thinking...",this.thinkingInterval=window.setInterval(()=>{this.thinkingPhraseIndex<this.thinkingPhrases.length-1&&(this.thinkingPhraseIndex++,this.currentThinkingPhrase=this.thinkingPhrases[this.thinkingPhraseIndex]||"Thinking...")},2e3)}stopThinkingAnimation(){this.thinkingInterval&&(clearInterval(this.thinkingInterval),this.thinkingInterval=null),this.thinkingPhraseIndex=0,this.currentThinkingPhrase="Thinking..."}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-thinking-loader"]],decls:8,vars:1,consts:[[1,"message-wrapper"],[1,"message","assistant","thinking-message"],[1,"content"],[1,"thinking-loader"],[1,"logo-container"],["src","CODAY-Logo.png","alt","Coday Logo",1,"coday-logo"],[1,"thinking-text"]],template:function(e,i){e&1&&(ii(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),Zn(5,"img",5),ni(),ii(6,"p",6),p(7),ni()()()()()),e&2&&(d(7),F(i.currentThinkingPhrase))},dependencies:[Pe],styles:[".message-wrapper[_ngcontent-%COMP%]{margin:0;display:flex;align-items:flex-start;gap:.5rem}.message.assistant[_ngcontent-%COMP%]{background:transparent;border:none;box-shadow:none;border-radius:0;margin-left:0;margin-right:auto;padding:.5rem 0;width:100%;max-width:none;min-width:0}.message.thinking-message[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{line-height:1.5}.thinking-loader[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:.75rem 0}.logo-container[_ngcontent-%COMP%]{position:relative;width:32px;height:32px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.coday-logo[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:contain;animation:_ngcontent-%COMP%_pulse 2s ease-in-out infinite;filter:drop-shadow(0 1px 4px rgba(0,0,0,.1))}.thinking-text[_ngcontent-%COMP%]{font-size:.95rem;font-weight:400;color:var(--color-text-secondary);margin:0;animation:_ngcontent-%COMP%_fadeInOut 2s ease-in-out infinite;letter-spacing:.01em;font-style:italic}@keyframes _ngcontent-%COMP%_pulse{0%,to{transform:scale(1);opacity:1}50%{transform:scale(1.1);opacity:.7}}@keyframes _ngcontent-%COMP%_fadeInOut{0%,to{opacity:.6}50%{opacity:1}}@media (max-width: 768px){.logo-container[_ngcontent-%COMP%]{width:28px;height:28px}.thinking-text[_ngcontent-%COMP%]{font-size:.875rem}.thinking-loader[_ngcontent-%COMP%]{gap:.75rem}}@media print{.thinking-loader[_ngcontent-%COMP%]{display:none!important}}"]})};var h0=(o,t)=>t.id;function u0(o,t){if(o&1&&
|
|
354
|
+
`).map(e=>this.addPeriodIfNeeded(e.trim())).filter(e=>e.length>0).join(" ")}addPeriodIfNeeded(t){return t?/[.!?;:]$/.test(t)?t:t+".":""}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var Ks=class o{thinkingPhrases=["Processing request...","Thinking...","Working on it..."];currentThinkingPhrase="Processing request...";thinkingPhraseIndex=0;thinkingInterval=null;ngOnInit(){this.startThinkingAnimation()}ngOnDestroy(){this.stopThinkingAnimation()}startThinkingAnimation(){this.thinkingPhraseIndex=0,this.currentThinkingPhrase=this.thinkingPhrases[0]||"Thinking...",this.thinkingInterval=window.setInterval(()=>{this.thinkingPhraseIndex<this.thinkingPhrases.length-1&&(this.thinkingPhraseIndex++,this.currentThinkingPhrase=this.thinkingPhrases[this.thinkingPhraseIndex]||"Thinking...")},2e3)}stopThinkingAnimation(){this.thinkingInterval&&(clearInterval(this.thinkingInterval),this.thinkingInterval=null),this.thinkingPhraseIndex=0,this.currentThinkingPhrase="Thinking..."}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-thinking-loader"]],decls:8,vars:1,consts:[[1,"message-wrapper"],[1,"message","assistant","thinking-message"],[1,"content"],[1,"thinking-loader"],[1,"logo-container"],["src","CODAY-Logo.png","alt","Coday Logo",1,"coday-logo"],[1,"thinking-text"]],template:function(e,i){e&1&&(ii(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),Zn(5,"img",5),ni(),ii(6,"p",6),p(7),ni()()()()()),e&2&&(d(7),F(i.currentThinkingPhrase))},dependencies:[Pe],styles:[".message-wrapper[_ngcontent-%COMP%]{margin:0;display:flex;align-items:flex-start;gap:.5rem}.message.assistant[_ngcontent-%COMP%]{background:transparent;border:none;box-shadow:none;border-radius:0;margin-left:0;margin-right:auto;padding:.5rem 0;width:100%;max-width:none;min-width:0}.message.thinking-message[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{line-height:1.5}.thinking-loader[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:.75rem 0}.logo-container[_ngcontent-%COMP%]{position:relative;width:32px;height:32px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.coday-logo[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:contain;animation:_ngcontent-%COMP%_pulse 2s ease-in-out infinite;filter:drop-shadow(0 1px 4px rgba(0,0,0,.1))}.thinking-text[_ngcontent-%COMP%]{font-size:.95rem;font-weight:400;color:var(--color-text-secondary);margin:0;animation:_ngcontent-%COMP%_fadeInOut 2s ease-in-out infinite;letter-spacing:.01em;font-style:italic}@keyframes _ngcontent-%COMP%_pulse{0%,to{transform:scale(1);opacity:1}50%{transform:scale(1.1);opacity:.7}}@keyframes _ngcontent-%COMP%_fadeInOut{0%,to{opacity:.6}50%{opacity:1}}@media (max-width: 768px){.logo-container[_ngcontent-%COMP%]{width:28px;height:28px}.thinking-text[_ngcontent-%COMP%]{font-size:.875rem}.thinking-loader[_ngcontent-%COMP%]{gap:.75rem}}@media print{.thinking-loader[_ngcontent-%COMP%]{display:none!important}}"]})};var h0=(o,t)=>t.id;function u0(o,t){if(o&1&&I(0,"app-delegation-inline",3),o&2){let e=u().$implicit;w("subThreadId",e.subThreadId)("agentName",e.delegationAgentName)}}function g0(o,t){if(o&1){let e=M();s(0,"app-chat-message",5),_("copyRequested",function(n){v(e);let r=u(2);return y(r.onCopyMessage(n))})("deleteRequested",function(n){v(e);let r=u(2);return y(r.onDeleteMessage(n))}),l()}if(o&2){let e=u(),i=e.$implicit,n=e.$index,r=u();w("message",i)("canDelete",r.canDeleteMessage(n))}}function f0(o,t){if(o&1&&C(0,u0,1,2,"app-delegation-inline",3)(1,g0,1,2,"app-chat-message",4),o&2){let e=t.$implicit;x(e.type==="delegation"?0:1)}}function _0(o,t){if(o&1&&(s(0,"div",1),I(1,"div",6),l()),o&2){let e=u();d(),w("innerHTML",e.renderedStreamingText,Kt)}}function b0(o,t){o&1&&I(0,"app-thinking-loader")}function v0(o,t){if(o&1){let e=M();s(0,"button",7),_("click",function(){v(e);let n=u();return y(n.goToBottom())}),s(1,"mat-icon",8),p(2,"arrow_downward"),l()()}}var Zs=class o{messages=[];streamingText="";isThinking=!1;copyRequested=new U;stopRequested=new U;lastMessageCount=0;destroy$=new R;renderedStreamingText="";isTracking=!0;showGoToBottom=!1;scrollContainer=null;lastScrollTop=0;NEAR_BOTTOM_THRESHOLD=100;scrollCheckTimeout;isProgrammaticScroll=!1;MESSAGE_FRESHNESS_THRESHOLD=300*1e3;elementRef=m(ie);unreadService=m(or);voiceSynthesisService=m(rr);preferencesService=m(nt);codayService=m(Qt);markdownService=m(Wi);sanitizer=m(Di);ngOnInit(){this.findScrollContainer(),this.setupFocusListeners()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.scrollCheckTimeout&&clearTimeout(this.scrollCheckTimeout),window.removeEventListener("focus",this.handleWindowFocus),window.removeEventListener("blur",this.handleWindowBlur)}ngOnChanges(t){t.streamingText&&(this.renderStreamingText(),this.streamingText&&this.isTracking&&setTimeout(()=>this.scrollToBottom(),0))}ngAfterViewChecked(){if(this.messages.length!==this.lastMessageCount){console.log("[CHAT-HISTORY] Message count changed:",this.lastMessageCount,"->",this.messages.length);let t=this.messages.length-this.lastMessageCount;t>0&&(this.handleNewMessages(t),this.handleVoiceAnnouncement(t)),this.lastMessageCount=this.messages.length,this.isTracking&&this.scrollToBottom()}this.scrollContainer||this.findScrollContainer()}scrollToBottom(){try{this.scrollContainer||this.findScrollContainer(),this.scrollContainer&&(this.isProgrammaticScroll=!0,setTimeout(()=>{this.scrollContainer&&this.scrollContainer.scrollTo({top:this.scrollContainer.scrollHeight,behavior:"smooth"}),setTimeout(()=>{this.isProgrammaticScroll=!1},600)},50))}catch(t){console.error("Error scrolling to bottom:",t)}}trackByMessageId(t,e){return e.id}onCopyMessage(t){let e=t.content.filter(i=>i.type==="text").map(i=>i.content).join(`
|
|
355
355
|
|
|
356
356
|
`);navigator.clipboard.writeText(e).then(()=>console.log("Message copied")).catch(i=>console.error("Failed to copy:",i)),this.copyRequested.emit(t)}onStop(){this.stopRequested.emit()}canDeleteMessage(t){return t===0?!1:!this.isThinking}onDeleteMessage(t){if(console.log("[CHAT-HISTORY] Delete requested for message:",t.id),this.messages.findIndex(n=>n.id===t.id)===0){console.warn("[CHAT-HISTORY] Cannot delete first message");return}if(this.isThinking){console.warn("[CHAT-HISTORY] Cannot delete message while agent is thinking");return}if(t.role!=="user"){console.warn("[CHAT-HISTORY] Can only delete user messages");return}confirm(`Delete this message and all following messages?
|
|
357
357
|
|
|
@@ -359,19 +359,19 @@ This action cannot be undone once you post another message.`)&&(console.log("[CH
|
|
|
359
359
|
|
|
360
360
|
`)}extractPartialText(t){return t.split(`
|
|
361
361
|
`).filter(a=>a.trim().length>0).reduce((a,c)=>{if(a.paragraphs>=3)return a;let h=c.length>80?1:0;return{paragraphs:a.paragraphs+h,text:a.text+(a.text?`
|
|
362
|
-
`:"")+c}},{paragraphs:0,text:""}).text||t}renderStreamingText(){return ee(this,null,function*(){if(!this.streamingText){this.renderedStreamingText="";return}try{let t=yield this.markdownService.parse(this.streamingText);this.renderedStreamingText=this.sanitizer.bypassSecurityTrustHtml(t)}catch(t){console.error("[CHAT-HISTORY] Error rendering streaming text markdown:",t),this.renderedStreamingText=this.sanitizer.bypassSecurityTrustHtml(this.streamingText)}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-chat-history"]],hostBindings:function(e,i){e&1&&_("scroll",function(){return i.onScroll()})},inputs:{messages:"messages",streamingText:"streamingText",isThinking:"isThinking"},outputs:{copyRequested:"copyRequested",stopRequested:"stopRequested"},features:[tt],decls:6,vars:3,consts:[[1,"chat-history"],[1,"streaming-message","message","assistant"],["mat-fab","","color","primary","title","Go to bottom",1,"go-to-bottom-btn"],[3,"subThreadId","agentName"],[3,"message","canDelete"],[3,"copyRequested","deleteRequested","message","canDelete"],[1,"content","markdown-content",3,"innerHTML"],["mat-fab","","color","primary","title","Go to bottom",1,"go-to-bottom-btn",3,"click"],["fontSet","material-icons-outlined"]],template:function(e,i){e&1&&(s(0,"div",0),xe(1,f0,2,1,null,null,h0),C(3,_0,2,1,"div",1),C(4,b0,1,0,"app-thinking-loader"),C(5,v0,3,0,"button",2),l()),e&2&&(d(),we(i.messages),d(2),x(i.streamingText?3:-1),d(),x(i.isThinking?4:-1),d(),x(i.showGoToBottom?5:-1))},dependencies:[tr,he,Ks,Ga,Xs],styles:[".streaming-message.assistant[_ngcontent-%COMP%]{background:transparent;border:none;box-shadow:none;border-radius:0;margin-left:0;margin-right:auto;padding:.5rem 0;width:100%;max-width:none;min-width:0}.streaming-message[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{color:var(--color-text);line-height:1.5}.go-to-bottom-btn[_ngcontent-%COMP%]{position:fixed!important;bottom:120px!important;right:2rem!important;z-index:1000!important}@media (max-width: 768px){.go-to-bottom-btn[_ngcontent-%COMP%]{right:1rem!important;bottom:100px!important}}@media print{[_nghost-%COMP%]{display:block!important;height:auto!important;max-height:none!important;overflow:visible!important;position:static!important}.chat-history[_ngcontent-%COMP%]{display:block!important;height:auto!important;max-height:none!important;overflow:visible!important;position:static!important}.go-to-bottom-btn[_ngcontent-%COMP%]{display:none!important}}"]})};var Js=class o{http=m(Ye);projectState=m(Se);threadState=m(Pt);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads/${this.threadState.getSelectedThreadIdOrThrow()}/files`}uploadFile(t){let e=this.projectState.getSelectedProjectIdOrThrow(),i=this.threadState.getSelectedThreadIdOrThrow();return new Oi(n=>{let r=new FileReader;r.onload=()=>{let c=r.result.split(",")[1];this.http.post(`/api/projects/${e}/threads/${i}/upload`,{content:c,mimeType:t.type||"application/octet-stream",filename:t.name}).subscribe({next:h=>{n.next({success:h.success,filename:h.filename}),n.complete()},error:h=>n.error(h)})},r.onerror=()=>n.error(new Error("Failed to read file")),r.readAsDataURL(t)})}listFiles(){return this.http.get(this.getBaseUrl()).pipe(_e(t=>t.files))}downloadFile(t){let e=encodeURIComponent(t);return this.http.get(`${this.getBaseUrl()}/${e}`,{responseType:"blob"})}deleteFile(t){let e=encodeURIComponent(t);return this.http.delete(`${this.getBaseUrl()}/${e}`)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var ar=class o{fileApi=m(Js);eventStream=m(Gi);filesSignal=Ee([]);isLoadingSignal=Ee(!1);currentProjectSignal=Ee(null);currentThreadSignal=Ee(null);files=hi(()=>this.filesSignal());isLoading=hi(()=>this.isLoadingSignal());fileCount=hi(()=>this.filesSignal().length);constructor(){this.subscribeToFileEvents()}initializeForThread(t,e){this.currentProjectSignal.set(t),this.currentThreadSignal.set(e),this.refreshFileList()}clear(){this.filesSignal.set([]),this.currentProjectSignal.set(null),this.currentThreadSignal.set(null)}refreshFileList(){this.isLoadingSignal.set(!0),this.fileApi.listFiles().subscribe({next:t=>{let e=t.map(i=>ut(Z({},i),{lastModified:new Date(i.lastModified)})).sort((i,n)=>n.lastModified.getTime()-i.lastModified.getTime());this.filesSignal.set(e),this.isLoadingSignal.set(!1)},error:t=>{console.error("[FILE_EXCHANGE_STATE] Error loading files:",t),this.isLoadingSignal.set(!1)}})}uploadFile(t){return ee(this,null,function*(){return new Promise(e=>{this.fileApi.uploadFile(t).subscribe({next:()=>{this.refreshFileList(),e({success:!0})},error:i=>{console.error("[FILE_EXCHANGE_STATE] Upload error:",i),e({success:!1,error:i.message||"Upload failed"})}})})})}downloadAllFiles(){let t=this.filesSignal();if(t.length===0){console.warn("[FILE_EXCHANGE_STATE] No files to download");return}t.forEach((e,i)=>{setTimeout(()=>{this.downloadFile(e.filename)},i*300)})}downloadFile(t){this.fileApi.downloadFile(t).subscribe({next:e=>{let i=window.URL.createObjectURL(e),n=document.createElement("a");n.href=i,n.download=t,n.click(),window.URL.revokeObjectURL(i)},error:e=>{console.error("[FILE_EXCHANGE_STATE] Download error:",e)}})}deleteFile(t){return ee(this,null,function*(){return new Promise(e=>{this.fileApi.deleteFile(t).subscribe({next:()=>{this.refreshFileList(),e({success:!0})},error:i=>{console.error("[FILE_EXCHANGE_STATE] Delete error:",i),e({success:!1,error:i.message||"Delete failed"})}})})})}subscribeToFileEvents(){this.eventStream.events$.pipe(ce(t=>t instanceof Bn),nn()).subscribe(t=>{this.handleFileEvent(t)})}handleFileEvent(t){let e=this.filesSignal();switch(t.operation){case"created":{let i=t.timestamp,n=t.timestamp.lastIndexOf("-");if(n>0){let a=t.timestamp.substring(n+1);a.length===5&&/^[a-z0-9]+$/.test(a)&&(i=t.timestamp.substring(0,n))}let r={filename:t.filename,size:t.size||0,lastModified:new Date(i)};this.filesSignal.set([r,...e]);break}case"updated":{let i=e.filter(h=>h.filename!==t.filename),n=e.find(h=>h.filename===t.filename),r=t.timestamp,a=t.timestamp.lastIndexOf("-");if(a>0){let h=t.timestamp.substring(a+1);h.length===5&&/^[a-z0-9]+$/.test(h)&&(r=t.timestamp.substring(0,a))}let c={filename:t.filename,size:t.size||n?.size||0,lastModified:new Date(r)};this.filesSignal.set([c,...i]);break}case"deleted":{let i=e.filter(n=>n.filename!==t.filename);this.filesSignal.set(i);break}}}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};function y0(o,t){if(o&1&&A(0,"div",1),o&2){let e=u();w("innerHTML",e.renderedContent,Kt)}}function C0(o,t){if(o&1&&A(0,"iframe",2),o&2){let e=u();w("srcdoc",e.content,Kt)}}function x0(o,t){if(o&1&&(s(0,"pre",3),p(1),l()),o&2){let e=u();d(),F(e.content)}}var el=class o{content="";format="text";renderedContent="";sanitizer=m(Di);markdownService=m(Wi);ngOnChanges(t){(t.content||t.format)&&this.renderContent()}renderContent(){this.format==="markdown"?this.renderMarkdown():this.format==="json"&&this.formatJson()}renderMarkdown(){return ee(this,null,function*(){try{let t=yield this.markdownService.parse(this.content);this.renderedContent=this.sanitizer.bypassSecurityTrustHtml(t)}catch(t){console.error("[CONTENT_RENDERER] Error rendering markdown:",t),this.content=this.content}})}formatJson(){try{let t=JSON.parse(this.content);this.content=JSON.stringify(t,null,2)}catch(t){console.error("[CONTENT_RENDERER] Error formatting JSON:",t)}}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-content-renderer"]],inputs:{content:"content",format:"format"},features:[tt],decls:4,vars:2,consts:[[1,"content-renderer",3,"ngClass"],[1,"markdown-content",3,"innerHTML"],["sandbox","allow-same-origin",1,"html-viewer",3,"srcdoc"],[1,"code-content"]],template:function(e,i){e&1&&(s(0,"div",0),C(1,y0,1,1,"div",1)(2,C0,1,1,"iframe",2)(3,x0,2,1,"pre",3),l()),e&2&&(w("ngClass","format-"+i.format),d(),x(i.format==="markdown"?1:i.format==="html"?2:3))},dependencies:[Pe,Pn],styles:[".content-renderer[_ngcontent-%COMP%]{width:100%;height:100%;overflow:auto;padding:1rem}.markdown-content[_ngcontent-%COMP%]{line-height:1.6;color:var(--color-text)}.code-content[_ngcontent-%COMP%]{font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-size:.9rem;line-height:1.5;margin:0;white-space:pre-wrap;word-wrap:break-word;color:var(--color-text)}.format-json[_ngcontent-%COMP%] .code-content[_ngcontent-%COMP%]{color:var(--color-code-text, #d63384)}.format-yaml[_ngcontent-%COMP%] .code-content[_ngcontent-%COMP%], .format-text[_ngcontent-%COMP%] .code-content[_ngcontent-%COMP%]{color:var(--color-text)}.html-viewer[_ngcontent-%COMP%]{width:100%;height:100%;min-height:400px;border:1px solid var(--color-border);border-radius:8px;background:#fff}"]})};var sr=class o{http=m(Ye);MAX_FILE_SIZE=20*1024*1024;isViewable(t){return t<=this.MAX_FILE_SIZE}isFormatViewable(t){let e=t.split(".").pop()?.toLowerCase();return!(e&&["pdf","png","jpg","jpeg","gif","webp","zip","tar","gz","exe","bin","doc","docx","xls","xlsx","ppt","pptx"].includes(e))}detectFormat(t){switch(t.split(".").pop()?.toLowerCase()){case"md":return"markdown";case"json":return"json";case"yaml":case"yml":return"yaml";case"html":case"htm":return"html";default:return"text"}}loadFileContent(t,e,i){let n=`/api/projects/${t}/threads/${e}/files/${encodeURIComponent(i)}`,r=this.detectFormat(i);return this.http.get(n,{responseType:"text",observe:"response"}).pipe(_e(a=>{let c=a.body||"",h=new Blob([c]).size;return{content:c,format:r,filename:i,size:h}}),wn(a=>(console.error("[CONTENT_VIEWER] Error loading file:",i,a),Mo(()=>new Error(`Failed to load file: ${a.message||"Unknown error"}`)))))}formatSize(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};function w0(o,t){if(o&1){let e=M();s(0,"button",12),_("click",function(){v(e);let n=u();return y(n.download())}),s(1,"mat-icon"),p(2,"download"),l()()}}function S0(o,t){o&1&&(s(0,"div",9),A(1,"mat-spinner",13),s(2,"p"),p(3,"Loading file content..."),l()())}function k0(o,t){if(o&1){let e=M();s(0,"div",10)(1,"mat-icon",14),p(2,"error_outline"),l(),s(3,"p",15),p(4),l(),s(5,"button",16),_("click",function(){v(e);let n=u();return y(n.download())}),s(6,"mat-icon"),p(7,"download"),l(),p(8," Download instead "),l()()}if(o&2){let e=u();d(4),F(e.error)}}function M0(o,t){if(o&1&&A(0,"app-content-renderer",11),o&2){let e=u();w("content",e.fileContent.content)("format",e.fileContent.format)}}var tl=class o{destroy$=new R;file;projectName;threadId;closeViewer=new U;contentService=m(sr);eventStream=m(Gi);fileContent=null;isLoading=!1;error="";ngOnInit(){this.loadContent(),this.subscribeToFileEvents()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}loadContent(){if(!this.contentService.isViewable(this.file.size)){this.error=`File too large to view (${this.contentService.formatSize(this.file.size)}). Maximum size: 20 MB.`;return}this.isLoading=!0,this.error="",this.contentService.loadFileContent(this.projectName,this.threadId,this.file.filename).subscribe({next:t=>{console.log("[CONTENT_VIEWER] Content loaded:",t.filename),this.fileContent=t,this.isLoading=!1},error:t=>{console.error("[CONTENT_VIEWER] Error loading content:",t),this.error=t.message||"Failed to load file content",this.isLoading=!1}})}onClose(){this.closeViewer.emit()}download(){let t=new Blob([this.fileContent?.content||""],{type:"text/plain"}),e=window.URL.createObjectURL(t),i=document.createElement("a");i.href=e,i.download=this.file.filename,i.click(),window.URL.revokeObjectURL(e)}formatSize(t){return this.contentService.formatSize(t)}subscribeToFileEvents(){this.eventStream.events$.pipe(ce(t=>t instanceof Bn),ce(t=>t.filename===this.file.filename),ce(t=>t.operation==="updated"),L(this.destroy$)).subscribe(t=>{console.log("[CONTENT_VIEWER] File updated event received, reloading:",t.filename),t.size&&(this.file.size=t.size),this.loadContent()})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-content-viewer"]],inputs:{file:"file",projectName:"projectName",threadId:"threadId"},outputs:{closeViewer:"closeViewer"},decls:16,vars:6,consts:[[1,"viewer-container"],[1,"viewer-header"],[1,"header-info"],[1,"filename"],[1,"file-size"],[1,"header-actions"],["mat-icon-button","","title","Download","type","button"],["mat-icon-button","","title","Close","type","button",3,"click"],[1,"viewer-content"],[1,"loading-state"],[1,"error-state"],[3,"content","format"],["mat-icon-button","","title","Download","type","button",3,"click"],["diameter","48"],[1,"error-icon"],[1,"error-message"],["mat-raised-button","","color","primary","type","button",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),p(4),l(),s(5,"span",4),p(6),l()(),s(7,"div",5),C(8,w0,3,0,"button",6),s(9,"button",7),_("click",function(){return i.onClose()}),s(10,"mat-icon"),p(11,"chevron_right"),l()()()(),s(12,"div",8),C(13,S0,4,0,"div",9),C(14,k0,9,1,"div",10),C(15,M0,1,2,"app-content-renderer",11),l()()),e&2&&(d(4),F(i.file.filename),d(2),F(i.formatSize(i.file.size)),d(2),x(i.fileContent&&!i.isLoading&&!i.error?8:-1),d(5),x(i.isLoading?13:-1),d(),x(i.error?14:-1),d(),x(i.fileContent&&!i.isLoading&&!i.error?15:-1))},dependencies:[Pe,Oe,he,it,Et,Qe,nr,ir,el],styles:[".viewer-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;background:var(--color-bg)}.viewer-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:1rem;border-bottom:1px solid var(--color-border);background:var(--color-bg);flex-shrink:0}.header-info[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column;gap:.25rem}.filename[_ngcontent-%COMP%]{font-weight:500;color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-size[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary)}.header-actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;flex-shrink:0}.viewer-content[_ngcontent-%COMP%]{flex:1;overflow:auto;background:var(--color-bg)}.loading-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;gap:1rem;color:var(--color-text-secondary)}.error-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;gap:1rem;padding:2rem;text-align:center}.error-icon[_ngcontent-%COMP%]{font-size:3rem;width:3rem;height:3rem;color:var(--color-error)}.error-message[_ngcontent-%COMP%]{color:var(--color-text);margin:0;max-width:400px}"]})};var T0=Math.pow(10,8)*24*60*60*1e3,JI=-T0,il=6048e5,eu=864e5;var E0=3600;var tu=E0*24,eD=tu*7,P0=tu*365.2425,O0=P0/12,tD=O0*3,ud=Symbol.for("constructDateFrom");function lt(o,t){return typeof o=="function"?o(t):o&&typeof o=="object"&&ud in o?o[ud](t):o instanceof Date?new o.constructor(t):new Date(t)}function Xe(o,t){return lt(t||o,o)}function iu(o,t,e){let i=Xe(o,e?.in);return isNaN(t)?lt(e?.in||o,NaN):(t&&i.setDate(i.getDate()+t),i)}var A0={};function Hn(){return A0}function bn(o,t){let e=Hn(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,n=Xe(o,t?.in),r=n.getDay(),a=(r<i?7:0)+r-i;return n.setDate(n.getDate()-a),n.setHours(0,0,0,0),n}function po(o,t){return bn(o,ut(Z({},t),{weekStartsOn:1}))}function nl(o,t){let e=Xe(o,t?.in),i=e.getFullYear(),n=lt(e,0);n.setFullYear(i+1,0,4),n.setHours(0,0,0,0);let r=po(n),a=lt(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);let c=po(a);return e.getTime()>=r.getTime()?i+1:e.getTime()>=c.getTime()?i:i-1}function gd(o){let t=Xe(o),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+o-+e}function lr(o,...t){let e=lt.bind(null,o||t.find(i=>typeof i=="object"));return t.map(e)}function cr(o,t){let e=Xe(o,t?.in);return e.setHours(0,0,0,0),e}function ol(o,t,e){let[i,n]=lr(e?.in,o,t),r=cr(i),a=cr(n),c=+r-gd(r),h=+a-gd(a);return Math.round((c-h)/eu)}function nu(o,t){let e=nl(o,t),i=lt(t?.in||o,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),po(i)}function ou(o){return lt(o,Date.now())}function ru(o,t,e){let[i,n]=lr(e?.in,o,t);return+cr(i)==+cr(n)}function au(o){return o instanceof Date||typeof o=="object"&&Object.prototype.toString.call(o)==="[object Date]"}function su(o){return!(!au(o)&&typeof o!="number"||isNaN(+Xe(o)))}function cu(o,t,e){let[i,n]=lr(e?.in,o,t),r=lu(i,n),a=Math.abs(ol(i,n));i.setDate(i.getDate()-r*a);let c=+(lu(i,n)===-r),h=r*(a-c);return h===0?0:h}function lu(o,t){let e=o.getFullYear()-t.getFullYear()||o.getMonth()-t.getMonth()||o.getDate()-t.getDate()||o.getHours()-t.getHours()||o.getMinutes()-t.getMinutes()||o.getSeconds()-t.getSeconds()||o.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function du(o,t){let e=Xe(o,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}var I0={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},mu=(o,t,e)=>{let i,n=I0[o];return typeof n=="string"?i=n:t===1?i=n.one:i=n.other.replace("{{count}}",t.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function rl(o){return(t={})=>{let e=t.width?String(t.width):o.defaultWidth;return o.formats[e]||o.formats[o.defaultWidth]}}var D0={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},R0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},F0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},pu={date:rl({formats:D0,defaultWidth:"full"}),time:rl({formats:R0,defaultWidth:"full"}),dateTime:rl({formats:F0,defaultWidth:"full"})};var N0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},hu=(o,t,e,i)=>N0[o];function dr(o){return(t,e)=>{let i=e?.context?String(e.context):"standalone",n;if(i==="formatting"&&o.formattingValues){let a=o.defaultFormattingWidth||o.defaultWidth,c=e?.width?String(e.width):a;n=o.formattingValues[c]||o.formattingValues[a]}else{let a=o.defaultWidth,c=e?.width?String(e.width):o.defaultWidth;n=o.values[c]||o.values[a]}let r=o.argumentCallback?o.argumentCallback(t):t;return n[r]}}var L0={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},V0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},z0={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},j0={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},B0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},H0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},W0=(o,t)=>{let e=Number(o),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},uu={ordinalNumber:W0,era:dr({values:L0,defaultWidth:"wide"}),quarter:dr({values:V0,defaultWidth:"wide",argumentCallback:o=>o-1}),month:dr({values:z0,defaultWidth:"wide"}),day:dr({values:j0,defaultWidth:"wide"}),dayPeriod:dr({values:B0,defaultWidth:"wide",formattingValues:H0,defaultFormattingWidth:"wide"})};function mr(o){return(t,e={})=>{let i=e.width,n=i&&o.matchPatterns[i]||o.matchPatterns[o.defaultMatchWidth],r=t.match(n);if(!r)return null;let a=r[0],c=i&&o.parsePatterns[i]||o.parsePatterns[o.defaultParseWidth],h=Array.isArray(c)?$0(c,S=>S.test(a)):U0(c,S=>S.test(a)),g;g=o.valueCallback?o.valueCallback(h):h,g=e.valueCallback?e.valueCallback(g):g;let b=t.slice(a.length);return{value:g,rest:b}}}function U0(o,t){for(let e in o)if(Object.prototype.hasOwnProperty.call(o,e)&&t(o[e]))return e}function $0(o,t){for(let e=0;e<o.length;e++)if(t(o[e]))return e}function gu(o){return(t,e={})=>{let i=t.match(o.matchPattern);if(!i)return null;let n=i[0],r=t.match(o.parsePattern);if(!r)return null;let a=o.valueCallback?o.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;let c=t.slice(n.length);return{value:a,rest:c}}}var q0=/^(\d+)(th|st|nd|rd)?/i,G0=/\d+/i,Y0={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Q0={any:[/^b/i,/^(a|c)/i]},X0={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},K0={any:[/1/i,/2/i,/3/i,/4/i]},Z0={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},J0={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ev={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},tv={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},iv={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},nv={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},fu={ordinalNumber:gu({matchPattern:q0,parsePattern:G0,valueCallback:o=>parseInt(o,10)}),era:mr({matchPatterns:Y0,defaultMatchWidth:"wide",parsePatterns:Q0,defaultParseWidth:"any"}),quarter:mr({matchPatterns:X0,defaultMatchWidth:"wide",parsePatterns:K0,defaultParseWidth:"any",valueCallback:o=>o+1}),month:mr({matchPatterns:Z0,defaultMatchWidth:"wide",parsePatterns:J0,defaultParseWidth:"any"}),day:mr({matchPatterns:ev,defaultMatchWidth:"wide",parsePatterns:tv,defaultParseWidth:"any"}),dayPeriod:mr({matchPatterns:iv,defaultMatchWidth:"any",parsePatterns:nv,defaultParseWidth:"any"})};var fd={code:"en-US",formatDistance:mu,formatLong:pu,formatRelative:hu,localize:uu,match:fu,options:{weekStartsOn:0,firstWeekContainsDate:1}};function _u(o,t){let e=Xe(o,t?.in);return ol(e,du(e))+1}function bu(o,t){let e=Xe(o,t?.in),i=+po(e)-+nu(e);return Math.round(i/il)+1}function al(o,t){let e=Xe(o,t?.in),i=e.getFullYear(),n=Hn(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=lt(t?.in||o,0);a.setFullYear(i+1,0,r),a.setHours(0,0,0,0);let c=bn(a,t),h=lt(t?.in||o,0);h.setFullYear(i,0,r),h.setHours(0,0,0,0);let g=bn(h,t);return+e>=+c?i+1:+e>=+g?i:i-1}function vu(o,t){let e=Hn(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,n=al(o,t),r=lt(t?.in||o,0);return r.setFullYear(n,0,i),r.setHours(0,0,0,0),bn(r,t)}function yu(o,t){let e=Xe(o,t?.in),i=+bn(e,t)-+vu(e,t);return Math.round(i/il)+1}function Te(o,t){let e=o<0?"-":"",i=Math.abs(o).toString().padStart(t,"0");return e+i}var vn={y(o,t){let e=o.getFullYear(),i=e>0?e:1-e;return Te(t==="yy"?i%100:i,t.length)},M(o,t){let e=o.getMonth();return t==="M"?String(e+1):Te(e+1,2)},d(o,t){return Te(o.getDate(),t.length)},a(o,t){let e=o.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(o,t){return Te(o.getHours()%12||12,t.length)},H(o,t){return Te(o.getHours(),t.length)},m(o,t){return Te(o.getMinutes(),t.length)},s(o,t){return Te(o.getSeconds(),t.length)},S(o,t){let e=t.length,i=o.getMilliseconds(),n=Math.trunc(i*Math.pow(10,e-3));return Te(n,t.length)}};var pr={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},_d={G:function(o,t,e){let i=o.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(o,t,e){if(t==="yo"){let i=o.getFullYear(),n=i>0?i:1-i;return e.ordinalNumber(n,{unit:"year"})}return vn.y(o,t)},Y:function(o,t,e,i){let n=al(o,i),r=n>0?n:1-n;if(t==="YY"){let a=r%100;return Te(a,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Te(r,t.length)},R:function(o,t){let e=nl(o);return Te(e,t.length)},u:function(o,t){let e=o.getFullYear();return Te(e,t.length)},Q:function(o,t,e){let i=Math.ceil((o.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Te(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(o,t,e){let i=Math.ceil((o.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Te(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(o,t,e){let i=o.getMonth();switch(t){case"M":case"MM":return vn.M(o,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(o,t,e){let i=o.getMonth();switch(t){case"L":return String(i+1);case"LL":return Te(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(o,t,e,i){let n=yu(o,i);return t==="wo"?e.ordinalNumber(n,{unit:"week"}):Te(n,t.length)},I:function(o,t,e){let i=bu(o);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Te(i,t.length)},d:function(o,t,e){return t==="do"?e.ordinalNumber(o.getDate(),{unit:"date"}):vn.d(o,t)},D:function(o,t,e){let i=_u(o);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Te(i,t.length)},E:function(o,t,e){let i=o.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(o,t,e,i){let n=o.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return Te(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(n,{width:"short",context:"formatting"});case"eeee":default:return e.day(n,{width:"wide",context:"formatting"})}},c:function(o,t,e,i){let n=o.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return Te(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(n,{width:"narrow",context:"standalone"});case"cccccc":return e.day(n,{width:"short",context:"standalone"});case"cccc":default:return e.day(n,{width:"wide",context:"standalone"})}},i:function(o,t,e){let i=o.getDay(),n=i===0?7:i;switch(t){case"i":return String(n);case"ii":return Te(n,t.length);case"io":return e.ordinalNumber(n,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(o,t,e){let n=o.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(o,t,e){let i=o.getHours(),n;switch(i===12?n=pr.noon:i===0?n=pr.midnight:n=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(o,t,e){let i=o.getHours(),n;switch(i>=17?n=pr.evening:i>=12?n=pr.afternoon:i>=4?n=pr.morning:n=pr.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(o,t,e){if(t==="ho"){let i=o.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return vn.h(o,t)},H:function(o,t,e){return t==="Ho"?e.ordinalNumber(o.getHours(),{unit:"hour"}):vn.H(o,t)},K:function(o,t,e){let i=o.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Te(i,t.length)},k:function(o,t,e){let i=o.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Te(i,t.length)},m:function(o,t,e){return t==="mo"?e.ordinalNumber(o.getMinutes(),{unit:"minute"}):vn.m(o,t)},s:function(o,t,e){return t==="so"?e.ordinalNumber(o.getSeconds(),{unit:"second"}):vn.s(o,t)},S:function(o,t){return vn.S(o,t)},X:function(o,t,e){let i=o.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return xu(i);case"XXXX":case"XX":return ho(i);case"XXXXX":case"XXX":default:return ho(i,":")}},x:function(o,t,e){let i=o.getTimezoneOffset();switch(t){case"x":return xu(i);case"xxxx":case"xx":return ho(i);case"xxxxx":case"xxx":default:return ho(i,":")}},O:function(o,t,e){let i=o.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Cu(i,":");case"OOOO":default:return"GMT"+ho(i,":")}},z:function(o,t,e){let i=o.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Cu(i,":");case"zzzz":default:return"GMT"+ho(i,":")}},t:function(o,t,e){let i=Math.trunc(+o/1e3);return Te(i,t.length)},T:function(o,t,e){return Te(+o,t.length)}};function Cu(o,t=""){let e=o>0?"-":"+",i=Math.abs(o),n=Math.trunc(i/60),r=i%60;return r===0?e+String(n):e+String(n)+t+Te(r,2)}function xu(o,t){return o%60===0?(o>0?"-":"+")+Te(Math.abs(o)/60,2):ho(o,t)}function ho(o,t=""){let e=o>0?"-":"+",i=Math.abs(o),n=Te(Math.trunc(i/60),2),r=Te(i%60,2);return e+n+t+r}var wu=(o,t)=>{switch(o){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Su=(o,t)=>{switch(o){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},ov=(o,t)=>{let e=o.match(/(P+)(p+)?/)||[],i=e[1],n=e[2];if(!n)return wu(o,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",wu(i,t)).replace("{{time}}",Su(n,t))},ku={p:Su,P:ov};var rv=/^D+$/,av=/^Y+$/,sv=["D","DD","YY","YYYY"];function Mu(o){return rv.test(o)}function Tu(o){return av.test(o)}function Eu(o,t,e){let i=lv(o,t,e);if(console.warn(i),sv.includes(o))throw new RangeError(i)}function lv(o,t,e){let i=o[0]==="Y"?"years":"days of the month";return`Use \`${o.toLowerCase()}\` instead of \`${o}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var cv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,dv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,mv=/^'([^]*?)'?$/,pv=/''/g,hv=/[a-zA-Z]/;function bd(o,t,e){let i=Hn(),n=e?.locale??i.locale??fd,r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,c=Xe(o,e?.in);if(!su(c))throw new RangeError("Invalid time value");let h=t.match(dv).map(b=>{let S=b[0];if(S==="p"||S==="P"){let P=ku[S];return P(b,n.formatLong)}return b}).join("").match(cv).map(b=>{if(b==="''")return{isToken:!1,value:"'"};let S=b[0];if(S==="'")return{isToken:!1,value:uv(b)};if(_d[S])return{isToken:!0,value:b};if(S.match(hv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:b}});n.localize.preprocessor&&(h=n.localize.preprocessor(c,h));let g={firstWeekContainsDate:r,weekStartsOn:a,locale:n};return h.map(b=>{if(!b.isToken)return b.value;let S=b.value;(!e?.useAdditionalWeekYearTokens&&Tu(S)||!e?.useAdditionalDayOfYearTokens&&Mu(S))&&Eu(S,t,String(o));let P=_d[S[0]];return P(c,S,n.localize,g)}).join("")}function uv(o){let t=o.match(mv);return t?t[1].replace(pv,"'"):o}function Pu(o,t,e){return iu(o,-t,e)}function Ou(o,t){return ru(lt(t?.in||o,o),Pu(ou(t?.in||o),1))}function Au(o){if(!o||isNaN(o.getTime()))return"unknown";let t=new Date,e=bd(o,"HH:mm:ss"),i=t.getTime()-o.getTime(),n=Math.floor(i/(1e3*60));if(n<1)return`just now (${e})`;if(n<60)return`${n} min ago (${e})`;let r=Math.floor(i/(1e3*60*60));if(r<24)return`${r}h ago (${e})`;if(Ou(o))return`yesterday ${e}`;let a=cu(t,o);return a<7?`${a}d ago ${e}`:`${bd(o,"dd/MM/yyyy")} ${e}`}var gv=(o,t)=>t.filename;function fv(o,t){if(o&1){let e=M();s(0,"button",11),_("click",function(){v(e);let n=u(2);return y(n.downloadAll())}),s(1,"mat-icon"),p(2,"download_for_offline"),l()()}}function _v(o,t){o&1&&(s(0,"div",10),A(1,"span",12),s(2,"span",13),p(3,"Loading files..."),l()())}function bv(o,t){o&1&&(s(0,"div",14)(1,"mat-icon",15),p(2,"folder_open"),l(),s(3,"p",16),p(4,"No files in exchange space"),l(),s(5,"p",17),p(6,"Upload files to share with the agent"),l()())}function vv(o,t){if(o&1){let e=M();s(0,"button",28),_("click",function(){v(e);let n=u().$implicit,r=u(4);return y(r.viewFile(n))}),s(1,"mat-icon"),p(2,"visibility"),l()()}}function yv(o,t){if(o&1){let e=M();s(0,"div",18)(1,"div",19)(2,"mat-icon",20),p(3),l(),s(4,"div",21)(5,"span",22),p(6),l(),s(7,"span",23),p(8),l()()(),s(9,"div",24),C(10,vv,3,0,"button",25),s(11,"button",26),_("click",function(){let n=v(e).$implicit,r=u(4);return y(r.download(n))}),s(12,"mat-icon"),p(13,"download"),l()(),s(14,"button",27),_("click",function(){let n=v(e).$implicit,r=u(4);return y(r.delete(n))}),s(15,"mat-icon"),p(16,"delete"),l()()()()}if(o&2){let e=t.$implicit,i=u(4);d(3),F(i.getFileIcon(e.filename)),d(2),w("title",e.filename),d(),F(e.filename),d(2),Mn("",i.formatSize(e.size)," \u2022 ",i.formatDate(e.lastModified)),d(2),x(i.canViewFile(e)?10:-1)}}function Cv(o,t){if(o&1&&xe(0,yv,17,6,"div",18,gv),o&2){let e=u(3);we(e.files())}}function xv(o,t){if(o&1&&C(0,bv,7,0,"div",14)(1,Cv,2,0),o&2){let e=u(2);x(e.files().length===0?0:1)}}function wv(o,t){if(o&1){let e=M();s(0,"div",0)(1,"div",2)(2,"div",3)(3,"h3",4),p(4,"Exchange"),l(),s(5,"span",5),p(6),l()(),s(7,"div",6),C(8,fv,3,0,"button",7),s(9,"button",8),_("click",function(){v(e);let n=u();return y(n.close())}),s(10,"mat-icon"),p(11,"chevron_right"),l()()()(),s(12,"div",9),C(13,_v,4,0,"div",10)(14,xv,2,1),l()()}if(o&2){let e=u();d(6),te("(",e.files().length,")"),d(2),x(e.files().length>0?8:-1),d(5),x(e.isLoading()?13:14)}}function Sv(o,t){if(o&1){let e=M();s(0,"app-content-viewer",29),_("closeViewer",function(){v(e);let n=u();return y(n.backToList())}),l()}if(o&2){let e=u();w("file",e.currentFile)("projectName",e.projectName)("threadId",e.threadId)}}var sl=class o{projectName;threadId;closeDrawer=new U;fileExchangeState=m(ar);contentViewerService=m(sr);files=this.fileExchangeState.files;isLoading=this.fileExchangeState.isLoading;viewerState="list";currentFile=null;close(){this.viewerState==="content"?this.backToList():this.closeDrawer.emit()}viewFile(t){this.currentFile=t,this.viewerState="content"}backToList(){this.viewerState="list",this.currentFile=null}downloadAll(){this.fileExchangeState.downloadAllFiles()}download(t){this.fileExchangeState.downloadFile(t.filename)}delete(t){return ee(this,null,function*(){if(!confirm(`Delete file "${t.filename}"?`))return;let i=yield this.fileExchangeState.deleteFile(t.filename);i.success||alert(`Failed to delete file: ${i.error}`)})}getFileIcon(t){switch(t.split(".").pop()?.toLowerCase()){case"pdf":return"picture_as_pdf";case"csv":case"xlsx":case"xls":return"table_chart";case"txt":case"md":return"description";case"jpg":case"jpeg":case"png":case"gif":case"webp":return"image";case"zip":case"tar":case"gz":return"folder_zip";default:return"insert_drive_file"}}formatSize(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}formatDate(t){return Au(t)}canViewFile(t){return this.contentViewerService.isFormatViewable(t.filename)&&this.contentViewerService.isViewable(t.size)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-file-exchange-drawer"]],inputs:{projectName:"projectName",threadId:"threadId"},outputs:{closeDrawer:"closeDrawer"},decls:2,vars:2,consts:[[1,"file-drawer-container"],[3,"file","projectName","threadId"],[1,"drawer-header"],[1,"header-left"],[1,"drawer-title"],[1,"file-count"],[1,"header-actions"],["mat-icon-button","","title","Download all files","type","button",1,"download-all-btn"],["mat-icon-button","","title","Close","type","button",1,"close-btn",3,"click"],[1,"file-list"],[1,"file-loading"],["mat-icon-button","","title","Download all files","type","button",1,"download-all-btn",3,"click"],[1,"loading-spinner"],[1,"loading-text"],[1,"file-empty"],[1,"empty-icon"],[1,"empty-text"],[1,"empty-hint"],[1,"file-item"],[1,"file-info"],[1,"file-icon"],[1,"file-details"],[1,"file-name",3,"title"],[1,"file-meta"],[1,"file-actions"],["mat-icon-button","","title","View","type","button",1,"action-btn","view-btn"],["mat-icon-button","","title","Download","type","button",1,"action-btn","download-btn",3,"click"],["mat-icon-button","","title","Delete","type","button",1,"action-btn","delete-btn",3,"click"],["mat-icon-button","","title","View","type","button",1,"action-btn","view-btn",3,"click"],[3,"closeViewer","file","projectName","threadId"]],template:function(e,i){e&1&&(C(0,wv,15,3,"div",0),C(1,Sv,1,3,"app-content-viewer",1)),e&2&&(x(i.viewerState==="list"?0:-1),d(),x(i.viewerState==="content"&&i.currentFile?1:-1))},dependencies:[Pe,Oe,he,it,Qe,tl],styles:[".file-drawer-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);color:var(--color-text)}.drawer-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;border-bottom:1px solid var(--color-border);flex-shrink:0}.header-left[_ngcontent-%COMP%]{display:flex;align-items:baseline;gap:.5rem}.header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.drawer-title[_ngcontent-%COMP%]{margin:0;font-size:1.25rem;font-weight:600;color:var(--color-text)}.file-count[_ngcontent-%COMP%]{font-size:.9rem;color:var(--color-text-secondary)}.download-all-btn[_ngcontent-%COMP%]{color:var(--color-primary)}.download-all-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.close-btn[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.close-btn[_ngcontent-%COMP%]:hover{color:var(--color-text);background:var(--color-bg-hover)}.file-list[_ngcontent-%COMP%]{flex:1;overflow-y:auto;padding:.5rem}.file-loading[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:3rem 1rem;gap:1rem;color:var(--color-text-secondary)}.loading-spinner[_ngcontent-%COMP%]{display:inline-block;width:32px;height:32px;border:3px solid var(--color-border);border-top-color:var(--color-primary);border-radius:50%;animation:_ngcontent-%COMP%_spin .8s linear infinite}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}.loading-text[_ngcontent-%COMP%]{font-size:.9rem}.file-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:3rem 1rem;text-align:center;color:var(--color-text-secondary)}.empty-icon[_ngcontent-%COMP%]{font-size:64px;width:64px;height:64px;margin-bottom:1rem;opacity:.5}.empty-text[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem;font-weight:500}.empty-hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;opacity:.7}.file-item[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:.75rem;border-radius:8px;transition:background .2s;gap:1rem}.file-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.file-item[_ngcontent-%COMP%]:hover .file-actions[_ngcontent-%COMP%]{opacity:1}.file-info[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;flex:1;min-width:0}.file-icon[_ngcontent-%COMP%]{flex-shrink:0;color:var(--color-primary);font-size:28px;width:28px;height:28px}.file-details[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:0}.file-name[_ngcontent-%COMP%]{font-weight:500;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.file-meta[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary)}.file-actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;flex-shrink:0;opacity:0;transition:opacity .2s}.action-btn[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.action-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.action-btn.view-btn[_ngcontent-%COMP%]:hover, .action-btn.download-btn[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.action-btn.delete-btn[_ngcontent-%COMP%]:hover{color:var(--color-error)}@media (max-width: 768px){.file-actions[_ngcontent-%COMP%]{opacity:1}.file-item[_ngcontent-%COMP%]{padding:1rem .75rem}.drawer-header[_ngcontent-%COMP%]{padding:.75rem}}"]})};var kv=["tooltip"],vd=20;var yd=new ne("mat-tooltip-scroll-strategy",{providedIn:"root",factory:()=>{let o=m(be);return()=>zi(o,{scrollThrottle:vd})}});function Ru(o){let t=m(be);return()=>zi(t,{scrollThrottle:vd})}var Cd={provide:yd,deps:[],useFactory:Ru};function Fu(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}var Nu=new ne("mat-tooltip-default-options",{providedIn:"root",factory:Fu});var Iu="tooltip-panel",Du=Rm({passive:!0}),Mv=8,Tv=8,Ev=24,Pv=200,xd=(()=>{class o{_elementRef=m(ie);_ngZone=m(de);_platform=m(et);_ariaDescriber=m(Ua);_focusMonitor=m(Ri);_dir=m(ft);_injector=m(be);_viewContainerRef=m(Xn);_animationsDisabled=He();_defaultOptions=m(Nu,{optional:!0});_overlayRef;_tooltipInstance;_overlayPanelClass;_portal;_position="below";_positionAtOrigin=!1;_disabled=!1;_tooltipClass;_viewInitialized=!1;_pointerExitEventsInitialized=!1;_tooltipComponent=Lu;_viewportMargin=8;_currentPosition;_cssClassPrefix="mat-mdc";_ariaDescriptionPending;_dirSubscribed=!1;get position(){return this._position}set position(e){e!==this._position&&(this._position=e,this._overlayRef&&(this._updatePosition(this._overlayRef),this._tooltipInstance?.show(0),this._overlayRef.updatePosition()))}get positionAtOrigin(){return this._positionAtOrigin}set positionAtOrigin(e){this._positionAtOrigin=Tt(e),this._detach(),this._overlayRef=null}get disabled(){return this._disabled}set disabled(e){let i=Tt(e);this._disabled!==i&&(this._disabled=i,i?this.hide(0):this._setupPointerEnterEventsIfNeeded(),this._syncAriaDescription(this.message))}get showDelay(){return this._showDelay}set showDelay(e){this._showDelay=gi(e)}_showDelay;get hideDelay(){return this._hideDelay}set hideDelay(e){this._hideDelay=gi(e),this._tooltipInstance&&(this._tooltipInstance._mouseLeaveHideDelay=this._hideDelay)}_hideDelay;touchGestures="auto";get message(){return this._message}set message(e){let i=this._message;this._message=e!=null?String(e).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage()),this._syncAriaDescription(i)}_message="";get tooltipClass(){return this._tooltipClass}set tooltipClass(e){this._tooltipClass=e,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass)}_passiveListeners=[];_touchstartTimeout=null;_destroyed=new R;_isDestroyed=!1;constructor(){let e=this._defaultOptions;e&&(this._showDelay=e.showDelay,this._hideDelay=e.hideDelay,e.position&&(this.position=e.position),e.positionAtOrigin&&(this.positionAtOrigin=e.positionAtOrigin),e.touchGestures&&(this.touchGestures=e.touchGestures),e.tooltipClass&&(this.tooltipClass=e.tooltipClass)),this._viewportMargin=Mv}ngAfterViewInit(){this._viewInitialized=!0,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(L(this._destroyed)).subscribe(e=>{e?e==="keyboard"&&this._ngZone.run(()=>this.show()):this._ngZone.run(()=>this.hide(0))})}ngOnDestroy(){let e=this._elementRef.nativeElement;this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),this._passiveListeners.forEach(([i,n])=>{e.removeEventListener(i,n,Du)}),this._passiveListeners.length=0,this._destroyed.next(),this._destroyed.complete(),this._isDestroyed=!0,this._ariaDescriber.removeDescription(e,this.message,"tooltip"),this._focusMonitor.stopMonitoring(e)}show(e=this.showDelay,i){if(this.disabled||!this.message||this._isTooltipVisible()){this._tooltipInstance?._cancelPendingAnimations();return}let n=this._createOverlay(i);this._detach(),this._portal=this._portal||new bi(this._tooltipComponent,this._viewContainerRef);let r=this._tooltipInstance=n.attach(this._portal).instance;r._triggerElement=this._elementRef.nativeElement,r._mouseLeaveHideDelay=this._hideDelay,r.afterHidden().pipe(L(this._destroyed)).subscribe(()=>this._detach()),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),r.show(e)}hide(e=this.hideDelay){let i=this._tooltipInstance;i&&(i.isVisible()?i.hide(e):(i._cancelPendingAnimations(),this._detach()))}toggle(e){this._isTooltipVisible()?this.hide():this.show(void 0,e)}_isTooltipVisible(){return!!this._tooltipInstance&&this._tooltipInstance.isVisible()}_createOverlay(e){if(this._overlayRef){let a=this._overlayRef.getConfig().positionStrategy;if((!this.positionAtOrigin||!e)&&a._origin instanceof ie)return this._overlayRef;this._detach()}let i=this._injector.get(sn).getAncestorScrollContainers(this._elementRef),n=`${this._cssClassPrefix}-${Iu}`,r=Ur(this._injector,this.positionAtOrigin?e||this._elementRef:this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(!1).withViewportMargin(this._viewportMargin).withScrollableContainers(i);return r.positionChanges.pipe(L(this._destroyed)).subscribe(a=>{this._updateCurrentPositionClass(a.connectionPair),this._tooltipInstance&&a.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0))}),this._overlayRef=mn(this._injector,{direction:this._dir,positionStrategy:r,panelClass:this._overlayPanelClass?[...this._overlayPanelClass,n]:n,scrollStrategy:this._injector.get(yd)(),disableAnimations:this._animationsDisabled}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(L(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(L(this._destroyed)).subscribe(()=>this._tooltipInstance?._handleBodyInteraction()),this._overlayRef.keydownEvents().pipe(L(this._destroyed)).subscribe(a=>{this._isTooltipVisible()&&a.keyCode===27&&!gt(a)&&(a.preventDefault(),a.stopPropagation(),this._ngZone.run(()=>this.hide(0)))}),this._defaultOptions?.disableTooltipInteractivity&&this._overlayRef.addPanelClass(`${this._cssClassPrefix}-tooltip-panel-non-interactive`),this._dirSubscribed||(this._dirSubscribed=!0,this._dir.change.pipe(L(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef)})),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null}_updatePosition(e){let i=e.getConfig().positionStrategy,n=this._getOrigin(),r=this._getOverlayPosition();i.withPositions([this._addOffset(Z(Z({},n.main),r.main)),this._addOffset(Z(Z({},n.fallback),r.fallback))])}_addOffset(e){let i=Tv,n=!this._dir||this._dir.value=="ltr";return e.originY==="top"?e.offsetY=-i:e.originY==="bottom"?e.offsetY=i:e.originX==="start"?e.offsetX=n?-i:i:e.originX==="end"&&(e.offsetX=n?i:-i),e}_getOrigin(){let e=!this._dir||this._dir.value=="ltr",i=this.position,n;i=="above"||i=="below"?n={originX:"center",originY:i=="above"?"top":"bottom"}:i=="before"||i=="left"&&e||i=="right"&&!e?n={originX:"start",originY:"center"}:(i=="after"||i=="right"&&e||i=="left"&&!e)&&(n={originX:"end",originY:"center"});let{x:r,y:a}=this._invertPosition(n.originX,n.originY);return{main:n,fallback:{originX:r,originY:a}}}_getOverlayPosition(){let e=!this._dir||this._dir.value=="ltr",i=this.position,n;i=="above"?n={overlayX:"center",overlayY:"bottom"}:i=="below"?n={overlayX:"center",overlayY:"top"}:i=="before"||i=="left"&&e||i=="right"&&!e?n={overlayX:"end",overlayY:"center"}:(i=="after"||i=="right"&&e||i=="left"&&!e)&&(n={overlayX:"start",overlayY:"center"});let{x:r,y:a}=this._invertPosition(n.overlayX,n.overlayY);return{main:n,fallback:{overlayX:r,overlayY:a}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),Dt(()=>{this._tooltipInstance&&this._overlayRef.updatePosition()},{injector:this._injector}))}_setTooltipClass(e){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=e,this._tooltipInstance._markForCheck())}_invertPosition(e,i){return this.position==="above"||this.position==="below"?i==="top"?i="bottom":i==="bottom"&&(i="top"):e==="end"?e="start":e==="start"&&(e="end"),{x:e,y:i}}_updateCurrentPositionClass(e){let{overlayY:i,originX:n,originY:r}=e,a;if(i==="center"?this._dir&&this._dir.value==="rtl"?a=n==="end"?"left":"right":a=n==="start"?"left":"right":a=i==="bottom"&&r==="top"?"above":"below",a!==this._currentPosition){let c=this._overlayRef;if(c){let h=`${this._cssClassPrefix}-${Iu}-`;c.removePanelClass(h+this._currentPosition),c.addPanelClass(h+a)}this._currentPosition=a}}_setupPointerEnterEventsIfNeeded(){this._disabled||!this.message||!this._viewInitialized||this._passiveListeners.length||(this._platformSupportsMouseEvents()?this._passiveListeners.push(["mouseenter",e=>{this._setupPointerExitEventsIfNeeded();let i;e.x!==void 0&&e.y!==void 0&&(i=e),this.show(void 0,i)}]):this.touchGestures!=="off"&&(this._disableNativeGesturesIfNecessary(),this._passiveListeners.push(["touchstart",e=>{let i=e.targetTouches?.[0],n=i?{x:i.clientX,y:i.clientY}:void 0;this._setupPointerExitEventsIfNeeded(),this._touchstartTimeout&&clearTimeout(this._touchstartTimeout);let r=500;this._touchstartTimeout=setTimeout(()=>{this._touchstartTimeout=null,this.show(void 0,n)},this._defaultOptions?.touchLongPressShowDelay??r)}])),this._addListeners(this._passiveListeners))}_setupPointerExitEventsIfNeeded(){if(this._pointerExitEventsInitialized)return;this._pointerExitEventsInitialized=!0;let e=[];if(this._platformSupportsMouseEvents())e.push(["mouseleave",i=>{let n=i.relatedTarget;(!n||!this._overlayRef?.overlayElement.contains(n))&&this.hide()}],["wheel",i=>this._wheelListener(i)]);else if(this.touchGestures!=="off"){this._disableNativeGesturesIfNecessary();let i=()=>{this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions?.touchendHideDelay)};e.push(["touchend",i],["touchcancel",i])}this._addListeners(e),this._passiveListeners.push(...e)}_addListeners(e){e.forEach(([i,n])=>{this._elementRef.nativeElement.addEventListener(i,n,Du)})}_platformSupportsMouseEvents(){return!this._platform.IOS&&!this._platform.ANDROID}_wheelListener(e){if(this._isTooltipVisible()){let i=this._injector.get(Je).elementFromPoint(e.clientX,e.clientY),n=this._elementRef.nativeElement;i!==n&&!n.contains(i)&&this.hide()}}_disableNativeGesturesIfNecessary(){let e=this.touchGestures;if(e!=="off"){let i=this._elementRef.nativeElement,n=i.style;(e==="on"||i.nodeName!=="INPUT"&&i.nodeName!=="TEXTAREA")&&(n.userSelect=n.msUserSelect=n.webkitUserSelect=n.MozUserSelect="none"),(e==="on"||!i.draggable)&&(n.webkitUserDrag="none"),n.touchAction="none",n.webkitTapHighlightColor="transparent"}}_syncAriaDescription(e){this._ariaDescriptionPending||(this._ariaDescriptionPending=!0,this._ariaDescriber.removeDescription(this._elementRef.nativeElement,e,"tooltip"),this._isDestroyed||Dt({write:()=>{this._ariaDescriptionPending=!1,this.message&&!this.disabled&&this._ariaDescriber.describe(this._elementRef.nativeElement,this.message,"tooltip")}},{injector:this._injector}))}static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-mdc-tooltip-trigger"],hostVars:2,hostBindings:function(i,n){i&2&&E("mat-mdc-tooltip-disabled",n.disabled)},inputs:{position:[0,"matTooltipPosition","position"],positionAtOrigin:[0,"matTooltipPositionAtOrigin","positionAtOrigin"],disabled:[0,"matTooltipDisabled","disabled"],showDelay:[0,"matTooltipShowDelay","showDelay"],hideDelay:[0,"matTooltipHideDelay","hideDelay"],touchGestures:[0,"matTooltipTouchGestures","touchGestures"],message:[0,"matTooltip","message"],tooltipClass:[0,"matTooltipClass","tooltipClass"]},exportAs:["matTooltip"]})}return o})(),Lu=(()=>{class o{_changeDetectorRef=m(Ge);_elementRef=m(ie);_isMultiline=!1;message;tooltipClass;_showTimeoutId;_hideTimeoutId;_triggerElement;_mouseLeaveHideDelay;_animationsDisabled=He();_tooltip;_closeOnInteraction=!1;_isVisible=!1;_onHide=new R;_showAnimation="mat-mdc-tooltip-show";_hideAnimation="mat-mdc-tooltip-hide";constructor(){}show(e){this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=setTimeout(()=>{this._toggleVisibility(!0),this._showTimeoutId=void 0},e)}hide(e){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(()=>{this._toggleVisibility(!1),this._hideTimeoutId=void 0},e)}afterHidden(){return this._onHide}isVisible(){return this._isVisible}ngOnDestroy(){this._cancelPendingAnimations(),this._onHide.complete(),this._triggerElement=null}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0)}_markForCheck(){this._changeDetectorRef.markForCheck()}_handleMouseLeave({relatedTarget:e}){(!e||!this._triggerElement.contains(e))&&(this.isVisible()?this.hide(this._mouseLeaveHideDelay):this._finalizeAnimation(!1))}_onShow(){this._isMultiline=this._isTooltipMultiline(),this._markForCheck()}_isTooltipMultiline(){let e=this._elementRef.nativeElement.getBoundingClientRect();return e.height>Ev&&e.width>=Pv}_handleAnimationEnd({animationName:e}){(e===this._showAnimation||e===this._hideAnimation)&&this._finalizeAnimation(e===this._showAnimation)}_cancelPendingAnimations(){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=this._hideTimeoutId=void 0}_finalizeAnimation(e){e?this._closeOnInteraction=!0:this.isVisible()||this._onHide.next()}_toggleVisibility(e){let i=this._tooltip.nativeElement,n=this._showAnimation,r=this._hideAnimation;if(i.classList.remove(e?r:n),i.classList.add(e?n:r),this._isVisible!==e&&(this._isVisible=e,this._changeDetectorRef.markForCheck()),e&&!this._animationsDisabled&&typeof getComputedStyle=="function"){let a=getComputedStyle(i);(a.getPropertyValue("animation-duration")==="0s"||a.getPropertyValue("animation-name")==="none")&&(this._animationsDisabled=!0)}e&&this._onShow(),this._animationsDisabled&&(i.classList.add("_mat-animation-noopable"),this._finalizeAnimation(e))}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["mat-tooltip-component"]],viewQuery:function(i,n){if(i&1&&Q(kv,7),i&2){let r;H(r=W())&&(n._tooltip=r.first)}},hostAttrs:["aria-hidden","true"],hostBindings:function(i,n){i&1&&_("mouseleave",function(a){return n._handleMouseLeave(a)})},decls:4,vars:4,consts:[["tooltip",""],[1,"mdc-tooltip","mat-mdc-tooltip",3,"animationend","ngClass"],[1,"mat-mdc-tooltip-surface","mdc-tooltip__surface"]],template:function(i,n){if(i&1){let r=M();s(0,"div",1,0),_("animationend",function(c){return v(r),y(n._handleAnimationEnd(c))}),s(2,"div",2),p(3),l()()}i&2&&(E("mdc-tooltip--multiline",n._isMultiline),w("ngClass",n.tooltipClass),d(3),F(n.message))},dependencies:[Pn],styles:[`.mat-mdc-tooltip{position:relative;transform:scale(0);display:inline-flex}.mat-mdc-tooltip::before{content:"";top:0;right:0;bottom:0;left:0;z-index:-1;position:absolute}.mat-mdc-tooltip-panel-below .mat-mdc-tooltip::before{top:-8px}.mat-mdc-tooltip-panel-above .mat-mdc-tooltip::before{bottom:-8px}.mat-mdc-tooltip-panel-right .mat-mdc-tooltip::before{left:-8px}.mat-mdc-tooltip-panel-left .mat-mdc-tooltip::before{right:-8px}.mat-mdc-tooltip._mat-animation-noopable{animation:none;transform:scale(1)}.mat-mdc-tooltip-surface{word-break:normal;overflow-wrap:anywhere;padding:4px 8px;min-width:40px;max-width:200px;min-height:24px;max-height:40vh;box-sizing:border-box;overflow:hidden;text-align:center;will-change:transform,opacity;background-color:var(--mat-tooltip-container-color, var(--mat-sys-inverse-surface));color:var(--mat-tooltip-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mat-tooltip-container-shape, var(--mat-sys-corner-extra-small));font-family:var(--mat-tooltip-supporting-text-font, var(--mat-sys-body-small-font));font-size:var(--mat-tooltip-supporting-text-size, var(--mat-sys-body-small-size));font-weight:var(--mat-tooltip-supporting-text-weight, var(--mat-sys-body-small-weight));line-height:var(--mat-tooltip-supporting-text-line-height, var(--mat-sys-body-small-line-height));letter-spacing:var(--mat-tooltip-supporting-text-tracking, var(--mat-sys-body-small-tracking))}.mat-mdc-tooltip-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:left}[dir=rtl] .mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:right}.mat-mdc-tooltip-panel{line-height:normal}.mat-mdc-tooltip-panel.mat-mdc-tooltip-panel-non-interactive{pointer-events:none}@keyframes mat-mdc-tooltip-show{0%{opacity:0;transform:scale(0.8)}100%{opacity:1;transform:scale(1)}}@keyframes mat-mdc-tooltip-hide{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(0.8)}}.mat-mdc-tooltip-show{animation:mat-mdc-tooltip-show 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-mdc-tooltip-hide{animation:mat-mdc-tooltip-hide 75ms cubic-bezier(0.4, 0, 1, 1) forwards}
|
|
362
|
+
`:"")+c}},{paragraphs:0,text:""}).text||t}renderStreamingText(){return ee(this,null,function*(){if(!this.streamingText){this.renderedStreamingText="";return}try{let t=yield this.markdownService.parse(this.streamingText);this.renderedStreamingText=this.sanitizer.bypassSecurityTrustHtml(t)}catch(t){console.error("[CHAT-HISTORY] Error rendering streaming text markdown:",t),this.renderedStreamingText=this.sanitizer.bypassSecurityTrustHtml(this.streamingText)}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-chat-history"]],hostBindings:function(e,i){e&1&&_("scroll",function(){return i.onScroll()})},inputs:{messages:"messages",streamingText:"streamingText",isThinking:"isThinking"},outputs:{copyRequested:"copyRequested",stopRequested:"stopRequested"},features:[tt],decls:6,vars:3,consts:[[1,"chat-history"],[1,"streaming-message","message","assistant"],["mat-fab","","color","primary","title","Go to bottom",1,"go-to-bottom-btn"],[3,"subThreadId","agentName"],[3,"message","canDelete"],[3,"copyRequested","deleteRequested","message","canDelete"],[1,"content","markdown-content",3,"innerHTML"],["mat-fab","","color","primary","title","Go to bottom",1,"go-to-bottom-btn",3,"click"],["fontSet","material-icons-outlined"]],template:function(e,i){e&1&&(s(0,"div",0),xe(1,f0,2,1,null,null,h0),C(3,_0,2,1,"div",1),C(4,b0,1,0,"app-thinking-loader"),C(5,v0,3,0,"button",2),l()),e&2&&(d(),we(i.messages),d(2),x(i.streamingText?3:-1),d(),x(i.isThinking?4:-1),d(),x(i.showGoToBottom?5:-1))},dependencies:[tr,he,Ks,Ga,Xs],styles:[".streaming-message.assistant[_ngcontent-%COMP%]{background:transparent;border:none;box-shadow:none;border-radius:0;margin-left:0;margin-right:auto;padding:.5rem 0;width:100%;max-width:none;min-width:0}.streaming-message[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{color:var(--color-text);line-height:1.5}.go-to-bottom-btn[_ngcontent-%COMP%]{position:fixed!important;bottom:30%!important;right:1rem!important;z-index:1000!important}@media print{[_nghost-%COMP%]{display:block!important;height:auto!important;max-height:none!important;overflow:visible!important;position:static!important}.chat-history[_ngcontent-%COMP%]{display:block!important;height:auto!important;max-height:none!important;overflow:visible!important;position:static!important}.go-to-bottom-btn[_ngcontent-%COMP%]{display:none!important}}"]})};var Js=class o{http=m(Ye);projectState=m(Se);threadState=m(Pt);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads/${this.threadState.getSelectedThreadIdOrThrow()}/files`}uploadFile(t){let e=this.projectState.getSelectedProjectIdOrThrow(),i=this.threadState.getSelectedThreadIdOrThrow();return new Oi(n=>{let r=new FileReader;r.onload=()=>{let c=r.result.split(",")[1];this.http.post(`/api/projects/${e}/threads/${i}/upload`,{content:c,mimeType:t.type||"application/octet-stream",filename:t.name}).subscribe({next:h=>{n.next({success:h.success,filename:h.filename}),n.complete()},error:h=>n.error(h)})},r.onerror=()=>n.error(new Error("Failed to read file")),r.readAsDataURL(t)})}listFiles(){return this.http.get(this.getBaseUrl()).pipe(_e(t=>t.files))}downloadFile(t){let e=encodeURIComponent(t);return this.http.get(`${this.getBaseUrl()}/${e}`,{responseType:"blob"})}deleteFile(t){let e=encodeURIComponent(t);return this.http.delete(`${this.getBaseUrl()}/${e}`)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var ar=class o{fileApi=m(Js);eventStream=m(Gi);filesSignal=Ee([]);isLoadingSignal=Ee(!1);currentProjectSignal=Ee(null);currentThreadSignal=Ee(null);files=hi(()=>this.filesSignal());isLoading=hi(()=>this.isLoadingSignal());fileCount=hi(()=>this.filesSignal().length);constructor(){this.subscribeToFileEvents()}initializeForThread(t,e){this.currentProjectSignal.set(t),this.currentThreadSignal.set(e),this.refreshFileList()}clear(){this.filesSignal.set([]),this.currentProjectSignal.set(null),this.currentThreadSignal.set(null)}refreshFileList(){this.isLoadingSignal.set(!0),this.fileApi.listFiles().subscribe({next:t=>{let e=t.map(i=>ut(Z({},i),{lastModified:new Date(i.lastModified)})).sort((i,n)=>n.lastModified.getTime()-i.lastModified.getTime());this.filesSignal.set(e),this.isLoadingSignal.set(!1)},error:t=>{console.error("[FILE_EXCHANGE_STATE] Error loading files:",t),this.isLoadingSignal.set(!1)}})}uploadFile(t){return ee(this,null,function*(){return new Promise(e=>{this.fileApi.uploadFile(t).subscribe({next:()=>{this.refreshFileList(),e({success:!0})},error:i=>{console.error("[FILE_EXCHANGE_STATE] Upload error:",i),e({success:!1,error:i.message||"Upload failed"})}})})})}downloadAllFiles(){let t=this.filesSignal();if(t.length===0){console.warn("[FILE_EXCHANGE_STATE] No files to download");return}t.forEach((e,i)=>{setTimeout(()=>{this.downloadFile(e.filename)},i*300)})}downloadFile(t){this.fileApi.downloadFile(t).subscribe({next:e=>{let i=window.URL.createObjectURL(e),n=document.createElement("a");n.href=i,n.download=t,n.click(),window.URL.revokeObjectURL(i)},error:e=>{console.error("[FILE_EXCHANGE_STATE] Download error:",e)}})}deleteFile(t){return ee(this,null,function*(){return new Promise(e=>{this.fileApi.deleteFile(t).subscribe({next:()=>{this.refreshFileList(),e({success:!0})},error:i=>{console.error("[FILE_EXCHANGE_STATE] Delete error:",i),e({success:!1,error:i.message||"Delete failed"})}})})})}subscribeToFileEvents(){this.eventStream.events$.pipe(ce(t=>t instanceof jn),nn()).subscribe(t=>{this.handleFileEvent(t)})}handleFileEvent(t){let e=this.filesSignal();switch(t.operation){case"created":{let i=t.timestamp,n=t.timestamp.lastIndexOf("-");if(n>0){let a=t.timestamp.substring(n+1);a.length===5&&/^[a-z0-9]+$/.test(a)&&(i=t.timestamp.substring(0,n))}let r={filename:t.filename,size:t.size||0,lastModified:new Date(i)};this.filesSignal.set([r,...e]);break}case"updated":{let i=e.filter(h=>h.filename!==t.filename),n=e.find(h=>h.filename===t.filename),r=t.timestamp,a=t.timestamp.lastIndexOf("-");if(a>0){let h=t.timestamp.substring(a+1);h.length===5&&/^[a-z0-9]+$/.test(h)&&(r=t.timestamp.substring(0,a))}let c={filename:t.filename,size:t.size||n?.size||0,lastModified:new Date(r)};this.filesSignal.set([c,...i]);break}case"deleted":{let i=e.filter(n=>n.filename!==t.filename);this.filesSignal.set(i);break}}}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};function y0(o,t){if(o&1&&I(0,"div",1),o&2){let e=u();w("innerHTML",e.renderedContent,Kt)}}function C0(o,t){if(o&1&&I(0,"iframe",2),o&2){let e=u();w("srcdoc",e.content,Kt)}}function x0(o,t){if(o&1&&(s(0,"pre",3),p(1),l()),o&2){let e=u();d(),F(e.content)}}var el=class o{content="";format="text";renderedContent="";sanitizer=m(Di);markdownService=m(Wi);ngOnChanges(t){(t.content||t.format)&&this.renderContent()}renderContent(){this.format==="markdown"?this.renderMarkdown():this.format==="json"&&this.formatJson()}renderMarkdown(){return ee(this,null,function*(){try{let t=yield this.markdownService.parse(this.content);this.renderedContent=this.sanitizer.bypassSecurityTrustHtml(t)}catch(t){console.error("[CONTENT_RENDERER] Error rendering markdown:",t),this.content=this.content}})}formatJson(){try{let t=JSON.parse(this.content);this.content=JSON.stringify(t,null,2)}catch(t){console.error("[CONTENT_RENDERER] Error formatting JSON:",t)}}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-content-renderer"]],inputs:{content:"content",format:"format"},features:[tt],decls:4,vars:2,consts:[[1,"content-renderer",3,"ngClass"],[1,"markdown-content",3,"innerHTML"],["sandbox","allow-same-origin",1,"html-viewer",3,"srcdoc"],[1,"code-content"]],template:function(e,i){e&1&&(s(0,"div",0),C(1,y0,1,1,"div",1)(2,C0,1,1,"iframe",2)(3,x0,2,1,"pre",3),l()),e&2&&(w("ngClass","format-"+i.format),d(),x(i.format==="markdown"?1:i.format==="html"?2:3))},dependencies:[Pe,En],styles:[".content-renderer[_ngcontent-%COMP%]{width:100%;height:100%;overflow:auto;padding:1rem}.markdown-content[_ngcontent-%COMP%]{line-height:1.6;color:var(--color-text)}.code-content[_ngcontent-%COMP%]{font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-size:.9rem;line-height:1.5;margin:0;white-space:pre-wrap;word-wrap:break-word;color:var(--color-text)}.format-json[_ngcontent-%COMP%] .code-content[_ngcontent-%COMP%]{color:var(--color-code-text, #d63384)}.format-yaml[_ngcontent-%COMP%] .code-content[_ngcontent-%COMP%], .format-text[_ngcontent-%COMP%] .code-content[_ngcontent-%COMP%]{color:var(--color-text)}.html-viewer[_ngcontent-%COMP%]{width:100%;height:100%;min-height:400px;border:1px solid var(--color-border);border-radius:8px;background:#fff}"]})};var sr=class o{http=m(Ye);MAX_FILE_SIZE=20*1024*1024;isViewable(t){return t<=this.MAX_FILE_SIZE}isFormatViewable(t){let e=t.split(".").pop()?.toLowerCase();return!(e&&["pdf","png","jpg","jpeg","gif","webp","zip","tar","gz","exe","bin","doc","docx","xls","xlsx","ppt","pptx"].includes(e))}detectFormat(t){switch(t.split(".").pop()?.toLowerCase()){case"md":return"markdown";case"json":return"json";case"yaml":case"yml":return"yaml";case"html":case"htm":return"html";default:return"text"}}loadFileContent(t,e,i){let n=`/api/projects/${t}/threads/${e}/files/${encodeURIComponent(i)}`,r=this.detectFormat(i);return this.http.get(n,{responseType:"text",observe:"response"}).pipe(_e(a=>{let c=a.body||"",h=new Blob([c]).size;return{content:c,format:r,filename:i,size:h}}),wn(a=>(console.error("[CONTENT_VIEWER] Error loading file:",i,a),Mo(()=>new Error(`Failed to load file: ${a.message||"Unknown error"}`)))))}formatSize(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};function w0(o,t){if(o&1){let e=M();s(0,"button",12),_("click",function(){v(e);let n=u();return y(n.download())}),s(1,"mat-icon"),p(2,"download"),l()()}}function S0(o,t){o&1&&(s(0,"div",9),I(1,"mat-spinner",13),s(2,"p"),p(3,"Loading file content..."),l()())}function k0(o,t){if(o&1){let e=M();s(0,"div",10)(1,"mat-icon",14),p(2,"error_outline"),l(),s(3,"p",15),p(4),l(),s(5,"button",16),_("click",function(){v(e);let n=u();return y(n.download())}),s(6,"mat-icon"),p(7,"download"),l(),p(8," Download instead "),l()()}if(o&2){let e=u();d(4),F(e.error)}}function M0(o,t){if(o&1&&I(0,"app-content-renderer",11),o&2){let e=u();w("content",e.fileContent.content)("format",e.fileContent.format)}}var tl=class o{destroy$=new R;file;projectName;threadId;closeViewer=new U;contentService=m(sr);eventStream=m(Gi);fileContent=null;isLoading=!1;error="";ngOnInit(){this.loadContent(),this.subscribeToFileEvents()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}loadContent(){if(!this.contentService.isViewable(this.file.size)){this.error=`File too large to view (${this.contentService.formatSize(this.file.size)}). Maximum size: 20 MB.`;return}this.isLoading=!0,this.error="",this.contentService.loadFileContent(this.projectName,this.threadId,this.file.filename).subscribe({next:t=>{console.log("[CONTENT_VIEWER] Content loaded:",t.filename),this.fileContent=t,this.isLoading=!1},error:t=>{console.error("[CONTENT_VIEWER] Error loading content:",t),this.error=t.message||"Failed to load file content",this.isLoading=!1}})}onClose(){this.closeViewer.emit()}download(){let t=new Blob([this.fileContent?.content||""],{type:"text/plain"}),e=window.URL.createObjectURL(t),i=document.createElement("a");i.href=e,i.download=this.file.filename,i.click(),window.URL.revokeObjectURL(e)}formatSize(t){return this.contentService.formatSize(t)}subscribeToFileEvents(){this.eventStream.events$.pipe(ce(t=>t instanceof jn),ce(t=>t.filename===this.file.filename),ce(t=>t.operation==="updated"),L(this.destroy$)).subscribe(t=>{console.log("[CONTENT_VIEWER] File updated event received, reloading:",t.filename),t.size&&(this.file.size=t.size),this.loadContent()})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-content-viewer"]],inputs:{file:"file",projectName:"projectName",threadId:"threadId"},outputs:{closeViewer:"closeViewer"},decls:16,vars:6,consts:[[1,"viewer-container"],[1,"viewer-header"],[1,"header-info"],[1,"filename"],[1,"file-size"],[1,"header-actions"],["mat-icon-button","","title","Download","type","button"],["mat-icon-button","","title","Close","type","button",3,"click"],[1,"viewer-content"],[1,"loading-state"],[1,"error-state"],[3,"content","format"],["mat-icon-button","","title","Download","type","button",3,"click"],["diameter","48"],[1,"error-icon"],[1,"error-message"],["mat-raised-button","","color","primary","type","button",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),p(4),l(),s(5,"span",4),p(6),l()(),s(7,"div",5),C(8,w0,3,0,"button",6),s(9,"button",7),_("click",function(){return i.onClose()}),s(10,"mat-icon"),p(11,"chevron_right"),l()()()(),s(12,"div",8),C(13,S0,4,0,"div",9),C(14,k0,9,1,"div",10),C(15,M0,1,2,"app-content-renderer",11),l()()),e&2&&(d(4),F(i.file.filename),d(2),F(i.formatSize(i.file.size)),d(2),x(i.fileContent&&!i.isLoading&&!i.error?8:-1),d(5),x(i.isLoading?13:-1),d(),x(i.error?14:-1),d(),x(i.fileContent&&!i.isLoading&&!i.error?15:-1))},dependencies:[Pe,Oe,he,it,Et,Qe,nr,ir,el],styles:[".viewer-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;background:var(--color-bg)}.viewer-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:1rem;border-bottom:1px solid var(--color-border);background:var(--color-bg);flex-shrink:0}.header-info[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column;gap:.25rem}.filename[_ngcontent-%COMP%]{font-weight:500;color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-size[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary)}.header-actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;flex-shrink:0}.viewer-content[_ngcontent-%COMP%]{flex:1;overflow:auto;background:var(--color-bg)}.loading-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;gap:1rem;color:var(--color-text-secondary)}.error-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;gap:1rem;padding:2rem;text-align:center}.error-icon[_ngcontent-%COMP%]{font-size:3rem;width:3rem;height:3rem;color:var(--color-error)}.error-message[_ngcontent-%COMP%]{color:var(--color-text);margin:0;max-width:400px}"]})};var T0=Math.pow(10,8)*24*60*60*1e3,ZI=-T0,il=6048e5,eu=864e5;var E0=3600;var tu=E0*24,JI=tu*7,P0=tu*365.2425,O0=P0/12,eD=O0*3,ud=Symbol.for("constructDateFrom");function lt(o,t){return typeof o=="function"?o(t):o&&typeof o=="object"&&ud in o?o[ud](t):o instanceof Date?new o.constructor(t):new Date(t)}function Xe(o,t){return lt(t||o,o)}function iu(o,t,e){let i=Xe(o,e?.in);return isNaN(t)?lt(e?.in||o,NaN):(t&&i.setDate(i.getDate()+t),i)}var A0={};function Bn(){return A0}function bn(o,t){let e=Bn(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,n=Xe(o,t?.in),r=n.getDay(),a=(r<i?7:0)+r-i;return n.setDate(n.getDate()-a),n.setHours(0,0,0,0),n}function po(o,t){return bn(o,ut(Z({},t),{weekStartsOn:1}))}function nl(o,t){let e=Xe(o,t?.in),i=e.getFullYear(),n=lt(e,0);n.setFullYear(i+1,0,4),n.setHours(0,0,0,0);let r=po(n),a=lt(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);let c=po(a);return e.getTime()>=r.getTime()?i+1:e.getTime()>=c.getTime()?i:i-1}function gd(o){let t=Xe(o),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+o-+e}function lr(o,...t){let e=lt.bind(null,o||t.find(i=>typeof i=="object"));return t.map(e)}function cr(o,t){let e=Xe(o,t?.in);return e.setHours(0,0,0,0),e}function ol(o,t,e){let[i,n]=lr(e?.in,o,t),r=cr(i),a=cr(n),c=+r-gd(r),h=+a-gd(a);return Math.round((c-h)/eu)}function nu(o,t){let e=nl(o,t),i=lt(t?.in||o,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),po(i)}function ou(o){return lt(o,Date.now())}function ru(o,t,e){let[i,n]=lr(e?.in,o,t);return+cr(i)==+cr(n)}function au(o){return o instanceof Date||typeof o=="object"&&Object.prototype.toString.call(o)==="[object Date]"}function su(o){return!(!au(o)&&typeof o!="number"||isNaN(+Xe(o)))}function cu(o,t,e){let[i,n]=lr(e?.in,o,t),r=lu(i,n),a=Math.abs(ol(i,n));i.setDate(i.getDate()-r*a);let c=+(lu(i,n)===-r),h=r*(a-c);return h===0?0:h}function lu(o,t){let e=o.getFullYear()-t.getFullYear()||o.getMonth()-t.getMonth()||o.getDate()-t.getDate()||o.getHours()-t.getHours()||o.getMinutes()-t.getMinutes()||o.getSeconds()-t.getSeconds()||o.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function du(o,t){let e=Xe(o,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}var I0={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},mu=(o,t,e)=>{let i,n=I0[o];return typeof n=="string"?i=n:t===1?i=n.one:i=n.other.replace("{{count}}",t.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function rl(o){return(t={})=>{let e=t.width?String(t.width):o.defaultWidth;return o.formats[e]||o.formats[o.defaultWidth]}}var D0={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},R0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},F0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},pu={date:rl({formats:D0,defaultWidth:"full"}),time:rl({formats:R0,defaultWidth:"full"}),dateTime:rl({formats:F0,defaultWidth:"full"})};var N0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},hu=(o,t,e,i)=>N0[o];function dr(o){return(t,e)=>{let i=e?.context?String(e.context):"standalone",n;if(i==="formatting"&&o.formattingValues){let a=o.defaultFormattingWidth||o.defaultWidth,c=e?.width?String(e.width):a;n=o.formattingValues[c]||o.formattingValues[a]}else{let a=o.defaultWidth,c=e?.width?String(e.width):o.defaultWidth;n=o.values[c]||o.values[a]}let r=o.argumentCallback?o.argumentCallback(t):t;return n[r]}}var L0={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},V0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},z0={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},j0={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},B0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},H0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},W0=(o,t)=>{let e=Number(o),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},uu={ordinalNumber:W0,era:dr({values:L0,defaultWidth:"wide"}),quarter:dr({values:V0,defaultWidth:"wide",argumentCallback:o=>o-1}),month:dr({values:z0,defaultWidth:"wide"}),day:dr({values:j0,defaultWidth:"wide"}),dayPeriod:dr({values:B0,defaultWidth:"wide",formattingValues:H0,defaultFormattingWidth:"wide"})};function mr(o){return(t,e={})=>{let i=e.width,n=i&&o.matchPatterns[i]||o.matchPatterns[o.defaultMatchWidth],r=t.match(n);if(!r)return null;let a=r[0],c=i&&o.parsePatterns[i]||o.parsePatterns[o.defaultParseWidth],h=Array.isArray(c)?$0(c,S=>S.test(a)):U0(c,S=>S.test(a)),g;g=o.valueCallback?o.valueCallback(h):h,g=e.valueCallback?e.valueCallback(g):g;let b=t.slice(a.length);return{value:g,rest:b}}}function U0(o,t){for(let e in o)if(Object.prototype.hasOwnProperty.call(o,e)&&t(o[e]))return e}function $0(o,t){for(let e=0;e<o.length;e++)if(t(o[e]))return e}function gu(o){return(t,e={})=>{let i=t.match(o.matchPattern);if(!i)return null;let n=i[0],r=t.match(o.parsePattern);if(!r)return null;let a=o.valueCallback?o.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;let c=t.slice(n.length);return{value:a,rest:c}}}var q0=/^(\d+)(th|st|nd|rd)?/i,G0=/\d+/i,Y0={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Q0={any:[/^b/i,/^(a|c)/i]},X0={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},K0={any:[/1/i,/2/i,/3/i,/4/i]},Z0={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},J0={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ev={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},tv={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},iv={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},nv={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},fu={ordinalNumber:gu({matchPattern:q0,parsePattern:G0,valueCallback:o=>parseInt(o,10)}),era:mr({matchPatterns:Y0,defaultMatchWidth:"wide",parsePatterns:Q0,defaultParseWidth:"any"}),quarter:mr({matchPatterns:X0,defaultMatchWidth:"wide",parsePatterns:K0,defaultParseWidth:"any",valueCallback:o=>o+1}),month:mr({matchPatterns:Z0,defaultMatchWidth:"wide",parsePatterns:J0,defaultParseWidth:"any"}),day:mr({matchPatterns:ev,defaultMatchWidth:"wide",parsePatterns:tv,defaultParseWidth:"any"}),dayPeriod:mr({matchPatterns:iv,defaultMatchWidth:"any",parsePatterns:nv,defaultParseWidth:"any"})};var fd={code:"en-US",formatDistance:mu,formatLong:pu,formatRelative:hu,localize:uu,match:fu,options:{weekStartsOn:0,firstWeekContainsDate:1}};function _u(o,t){let e=Xe(o,t?.in);return ol(e,du(e))+1}function bu(o,t){let e=Xe(o,t?.in),i=+po(e)-+nu(e);return Math.round(i/il)+1}function al(o,t){let e=Xe(o,t?.in),i=e.getFullYear(),n=Bn(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=lt(t?.in||o,0);a.setFullYear(i+1,0,r),a.setHours(0,0,0,0);let c=bn(a,t),h=lt(t?.in||o,0);h.setFullYear(i,0,r),h.setHours(0,0,0,0);let g=bn(h,t);return+e>=+c?i+1:+e>=+g?i:i-1}function vu(o,t){let e=Bn(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,n=al(o,t),r=lt(t?.in||o,0);return r.setFullYear(n,0,i),r.setHours(0,0,0,0),bn(r,t)}function yu(o,t){let e=Xe(o,t?.in),i=+bn(e,t)-+vu(e,t);return Math.round(i/il)+1}function Te(o,t){let e=o<0?"-":"",i=Math.abs(o).toString().padStart(t,"0");return e+i}var vn={y(o,t){let e=o.getFullYear(),i=e>0?e:1-e;return Te(t==="yy"?i%100:i,t.length)},M(o,t){let e=o.getMonth();return t==="M"?String(e+1):Te(e+1,2)},d(o,t){return Te(o.getDate(),t.length)},a(o,t){let e=o.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(o,t){return Te(o.getHours()%12||12,t.length)},H(o,t){return Te(o.getHours(),t.length)},m(o,t){return Te(o.getMinutes(),t.length)},s(o,t){return Te(o.getSeconds(),t.length)},S(o,t){let e=t.length,i=o.getMilliseconds(),n=Math.trunc(i*Math.pow(10,e-3));return Te(n,t.length)}};var pr={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},_d={G:function(o,t,e){let i=o.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(o,t,e){if(t==="yo"){let i=o.getFullYear(),n=i>0?i:1-i;return e.ordinalNumber(n,{unit:"year"})}return vn.y(o,t)},Y:function(o,t,e,i){let n=al(o,i),r=n>0?n:1-n;if(t==="YY"){let a=r%100;return Te(a,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Te(r,t.length)},R:function(o,t){let e=nl(o);return Te(e,t.length)},u:function(o,t){let e=o.getFullYear();return Te(e,t.length)},Q:function(o,t,e){let i=Math.ceil((o.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Te(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(o,t,e){let i=Math.ceil((o.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Te(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(o,t,e){let i=o.getMonth();switch(t){case"M":case"MM":return vn.M(o,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(o,t,e){let i=o.getMonth();switch(t){case"L":return String(i+1);case"LL":return Te(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(o,t,e,i){let n=yu(o,i);return t==="wo"?e.ordinalNumber(n,{unit:"week"}):Te(n,t.length)},I:function(o,t,e){let i=bu(o);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Te(i,t.length)},d:function(o,t,e){return t==="do"?e.ordinalNumber(o.getDate(),{unit:"date"}):vn.d(o,t)},D:function(o,t,e){let i=_u(o);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Te(i,t.length)},E:function(o,t,e){let i=o.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(o,t,e,i){let n=o.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return Te(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(n,{width:"short",context:"formatting"});case"eeee":default:return e.day(n,{width:"wide",context:"formatting"})}},c:function(o,t,e,i){let n=o.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return Te(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(n,{width:"narrow",context:"standalone"});case"cccccc":return e.day(n,{width:"short",context:"standalone"});case"cccc":default:return e.day(n,{width:"wide",context:"standalone"})}},i:function(o,t,e){let i=o.getDay(),n=i===0?7:i;switch(t){case"i":return String(n);case"ii":return Te(n,t.length);case"io":return e.ordinalNumber(n,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(o,t,e){let n=o.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(o,t,e){let i=o.getHours(),n;switch(i===12?n=pr.noon:i===0?n=pr.midnight:n=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(o,t,e){let i=o.getHours(),n;switch(i>=17?n=pr.evening:i>=12?n=pr.afternoon:i>=4?n=pr.morning:n=pr.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(o,t,e){if(t==="ho"){let i=o.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return vn.h(o,t)},H:function(o,t,e){return t==="Ho"?e.ordinalNumber(o.getHours(),{unit:"hour"}):vn.H(o,t)},K:function(o,t,e){let i=o.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Te(i,t.length)},k:function(o,t,e){let i=o.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Te(i,t.length)},m:function(o,t,e){return t==="mo"?e.ordinalNumber(o.getMinutes(),{unit:"minute"}):vn.m(o,t)},s:function(o,t,e){return t==="so"?e.ordinalNumber(o.getSeconds(),{unit:"second"}):vn.s(o,t)},S:function(o,t){return vn.S(o,t)},X:function(o,t,e){let i=o.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return xu(i);case"XXXX":case"XX":return ho(i);case"XXXXX":case"XXX":default:return ho(i,":")}},x:function(o,t,e){let i=o.getTimezoneOffset();switch(t){case"x":return xu(i);case"xxxx":case"xx":return ho(i);case"xxxxx":case"xxx":default:return ho(i,":")}},O:function(o,t,e){let i=o.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Cu(i,":");case"OOOO":default:return"GMT"+ho(i,":")}},z:function(o,t,e){let i=o.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Cu(i,":");case"zzzz":default:return"GMT"+ho(i,":")}},t:function(o,t,e){let i=Math.trunc(+o/1e3);return Te(i,t.length)},T:function(o,t,e){return Te(+o,t.length)}};function Cu(o,t=""){let e=o>0?"-":"+",i=Math.abs(o),n=Math.trunc(i/60),r=i%60;return r===0?e+String(n):e+String(n)+t+Te(r,2)}function xu(o,t){return o%60===0?(o>0?"-":"+")+Te(Math.abs(o)/60,2):ho(o,t)}function ho(o,t=""){let e=o>0?"-":"+",i=Math.abs(o),n=Te(Math.trunc(i/60),2),r=Te(i%60,2);return e+n+t+r}var wu=(o,t)=>{switch(o){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Su=(o,t)=>{switch(o){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},ov=(o,t)=>{let e=o.match(/(P+)(p+)?/)||[],i=e[1],n=e[2];if(!n)return wu(o,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",wu(i,t)).replace("{{time}}",Su(n,t))},ku={p:Su,P:ov};var rv=/^D+$/,av=/^Y+$/,sv=["D","DD","YY","YYYY"];function Mu(o){return rv.test(o)}function Tu(o){return av.test(o)}function Eu(o,t,e){let i=lv(o,t,e);if(console.warn(i),sv.includes(o))throw new RangeError(i)}function lv(o,t,e){let i=o[0]==="Y"?"years":"days of the month";return`Use \`${o.toLowerCase()}\` instead of \`${o}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var cv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,dv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,mv=/^'([^]*?)'?$/,pv=/''/g,hv=/[a-zA-Z]/;function bd(o,t,e){let i=Bn(),n=e?.locale??i.locale??fd,r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,c=Xe(o,e?.in);if(!su(c))throw new RangeError("Invalid time value");let h=t.match(dv).map(b=>{let S=b[0];if(S==="p"||S==="P"){let P=ku[S];return P(b,n.formatLong)}return b}).join("").match(cv).map(b=>{if(b==="''")return{isToken:!1,value:"'"};let S=b[0];if(S==="'")return{isToken:!1,value:uv(b)};if(_d[S])return{isToken:!0,value:b};if(S.match(hv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:b}});n.localize.preprocessor&&(h=n.localize.preprocessor(c,h));let g={firstWeekContainsDate:r,weekStartsOn:a,locale:n};return h.map(b=>{if(!b.isToken)return b.value;let S=b.value;(!e?.useAdditionalWeekYearTokens&&Tu(S)||!e?.useAdditionalDayOfYearTokens&&Mu(S))&&Eu(S,t,String(o));let P=_d[S[0]];return P(c,S,n.localize,g)}).join("")}function uv(o){let t=o.match(mv);return t?t[1].replace(pv,"'"):o}function Pu(o,t,e){return iu(o,-t,e)}function Ou(o,t){return ru(lt(t?.in||o,o),Pu(ou(t?.in||o),1))}function Au(o){if(!o||isNaN(o.getTime()))return"unknown";let t=new Date,e=bd(o,"HH:mm:ss"),i=t.getTime()-o.getTime(),n=Math.floor(i/(1e3*60));if(n<1)return`just now (${e})`;if(n<60)return`${n} min ago (${e})`;let r=Math.floor(i/(1e3*60*60));if(r<24)return`${r}h ago (${e})`;if(Ou(o))return`yesterday ${e}`;let a=cu(t,o);return a<7?`${a}d ago ${e}`:`${bd(o,"dd/MM/yyyy")} ${e}`}var gv=(o,t)=>t.filename;function fv(o,t){if(o&1){let e=M();s(0,"button",11),_("click",function(){v(e);let n=u(2);return y(n.downloadAll())}),s(1,"mat-icon"),p(2,"download_for_offline"),l()()}}function _v(o,t){o&1&&(s(0,"div",10),I(1,"span",12),s(2,"span",13),p(3,"Loading files..."),l()())}function bv(o,t){o&1&&(s(0,"div",14)(1,"mat-icon",15),p(2,"folder_open"),l(),s(3,"p",16),p(4,"No files in exchange space"),l(),s(5,"p",17),p(6,"Upload files to share with the agent"),l()())}function vv(o,t){if(o&1){let e=M();s(0,"button",28),_("click",function(){v(e);let n=u().$implicit,r=u(4);return y(r.viewFile(n))}),s(1,"mat-icon"),p(2,"visibility"),l()()}}function yv(o,t){if(o&1){let e=M();s(0,"div",18)(1,"div",19)(2,"mat-icon",20),p(3),l(),s(4,"div",21)(5,"span",22),p(6),l(),s(7,"span",23),p(8),l()()(),s(9,"div",24),C(10,vv,3,0,"button",25),s(11,"button",26),_("click",function(){let n=v(e).$implicit,r=u(4);return y(r.download(n))}),s(12,"mat-icon"),p(13,"download"),l()(),s(14,"button",27),_("click",function(){let n=v(e).$implicit,r=u(4);return y(r.delete(n))}),s(15,"mat-icon"),p(16,"delete"),l()()()()}if(o&2){let e=t.$implicit,i=u(4);d(3),F(i.getFileIcon(e.filename)),d(2),w("title",e.filename),d(),F(e.filename),d(2),kn("",i.formatSize(e.size)," \u2022 ",i.formatDate(e.lastModified)),d(2),x(i.canViewFile(e)?10:-1)}}function Cv(o,t){if(o&1&&xe(0,yv,17,6,"div",18,gv),o&2){let e=u(3);we(e.files())}}function xv(o,t){if(o&1&&C(0,bv,7,0,"div",14)(1,Cv,2,0),o&2){let e=u(2);x(e.files().length===0?0:1)}}function wv(o,t){if(o&1){let e=M();s(0,"div",0)(1,"div",2)(2,"div",3)(3,"h3",4),p(4,"Exchange"),l(),s(5,"span",5),p(6),l()(),s(7,"div",6),C(8,fv,3,0,"button",7),s(9,"button",8),_("click",function(){v(e);let n=u();return y(n.close())}),s(10,"mat-icon"),p(11,"chevron_right"),l()()()(),s(12,"div",9),C(13,_v,4,0,"div",10)(14,xv,2,1),l()()}if(o&2){let e=u();d(6),te("(",e.files().length,")"),d(2),x(e.files().length>0?8:-1),d(5),x(e.isLoading()?13:14)}}function Sv(o,t){if(o&1){let e=M();s(0,"app-content-viewer",29),_("closeViewer",function(){v(e);let n=u();return y(n.backToList())}),l()}if(o&2){let e=u();w("file",e.currentFile)("projectName",e.projectName)("threadId",e.threadId)}}var sl=class o{projectName;threadId;closeDrawer=new U;fileExchangeState=m(ar);contentViewerService=m(sr);files=this.fileExchangeState.files;isLoading=this.fileExchangeState.isLoading;viewerState="list";currentFile=null;close(){this.viewerState==="content"?this.backToList():this.closeDrawer.emit()}viewFile(t){this.currentFile=t,this.viewerState="content"}backToList(){this.viewerState="list",this.currentFile=null}downloadAll(){this.fileExchangeState.downloadAllFiles()}download(t){this.fileExchangeState.downloadFile(t.filename)}delete(t){return ee(this,null,function*(){if(!confirm(`Delete file "${t.filename}"?`))return;let i=yield this.fileExchangeState.deleteFile(t.filename);i.success||alert(`Failed to delete file: ${i.error}`)})}getFileIcon(t){switch(t.split(".").pop()?.toLowerCase()){case"pdf":return"picture_as_pdf";case"csv":case"xlsx":case"xls":return"table_chart";case"txt":case"md":return"description";case"jpg":case"jpeg":case"png":case"gif":case"webp":return"image";case"zip":case"tar":case"gz":return"folder_zip";default:return"insert_drive_file"}}formatSize(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}formatDate(t){return Au(t)}canViewFile(t){return this.contentViewerService.isFormatViewable(t.filename)&&this.contentViewerService.isViewable(t.size)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-file-exchange-drawer"]],inputs:{projectName:"projectName",threadId:"threadId"},outputs:{closeDrawer:"closeDrawer"},decls:2,vars:2,consts:[[1,"file-drawer-container"],[3,"file","projectName","threadId"],[1,"drawer-header"],[1,"header-left"],[1,"drawer-title"],[1,"file-count"],[1,"header-actions"],["mat-icon-button","","title","Download all files","type","button",1,"download-all-btn"],["mat-icon-button","","title","Close","type","button",1,"close-btn",3,"click"],[1,"file-list"],[1,"file-loading"],["mat-icon-button","","title","Download all files","type","button",1,"download-all-btn",3,"click"],[1,"loading-spinner"],[1,"loading-text"],[1,"file-empty"],[1,"empty-icon"],[1,"empty-text"],[1,"empty-hint"],[1,"file-item"],[1,"file-info"],[1,"file-icon"],[1,"file-details"],[1,"file-name",3,"title"],[1,"file-meta"],[1,"file-actions"],["mat-icon-button","","title","View","type","button",1,"action-btn","view-btn"],["mat-icon-button","","title","Download","type","button",1,"action-btn","download-btn",3,"click"],["mat-icon-button","","title","Delete","type","button",1,"action-btn","delete-btn",3,"click"],["mat-icon-button","","title","View","type","button",1,"action-btn","view-btn",3,"click"],[3,"closeViewer","file","projectName","threadId"]],template:function(e,i){e&1&&(C(0,wv,15,3,"div",0),C(1,Sv,1,3,"app-content-viewer",1)),e&2&&(x(i.viewerState==="list"?0:-1),d(),x(i.viewerState==="content"&&i.currentFile?1:-1))},dependencies:[Pe,Oe,he,it,Qe,tl],styles:[".file-drawer-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);color:var(--color-text)}.drawer-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;border-bottom:1px solid var(--color-border);flex-shrink:0}.header-left[_ngcontent-%COMP%]{display:flex;align-items:baseline;gap:.5rem}.header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.drawer-title[_ngcontent-%COMP%]{margin:0;font-size:1.25rem;font-weight:600;color:var(--color-text)}.file-count[_ngcontent-%COMP%]{font-size:.9rem;color:var(--color-text-secondary)}.download-all-btn[_ngcontent-%COMP%]{color:var(--color-primary)}.download-all-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.close-btn[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.close-btn[_ngcontent-%COMP%]:hover{color:var(--color-text);background:var(--color-bg-hover)}.file-list[_ngcontent-%COMP%]{flex:1;overflow-y:auto;padding:.5rem}.file-loading[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:3rem 1rem;gap:1rem;color:var(--color-text-secondary)}.loading-spinner[_ngcontent-%COMP%]{display:inline-block;width:32px;height:32px;border:3px solid var(--color-border);border-top-color:var(--color-primary);border-radius:50%;animation:_ngcontent-%COMP%_spin .8s linear infinite}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}.loading-text[_ngcontent-%COMP%]{font-size:.9rem}.file-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:3rem 1rem;text-align:center;color:var(--color-text-secondary)}.empty-icon[_ngcontent-%COMP%]{font-size:64px;width:64px;height:64px;margin-bottom:1rem;opacity:.5}.empty-text[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem;font-weight:500}.empty-hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;opacity:.7}.file-item[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:.75rem;border-radius:8px;transition:background .2s;gap:1rem}.file-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.file-item[_ngcontent-%COMP%]:hover .file-actions[_ngcontent-%COMP%]{opacity:1}.file-info[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;flex:1;min-width:0}.file-icon[_ngcontent-%COMP%]{flex-shrink:0;color:var(--color-primary);font-size:28px;width:28px;height:28px}.file-details[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:0}.file-name[_ngcontent-%COMP%]{font-weight:500;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.file-meta[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary)}.file-actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;flex-shrink:0;opacity:0;transition:opacity .2s}.action-btn[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.action-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.action-btn.view-btn[_ngcontent-%COMP%]:hover, .action-btn.download-btn[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.action-btn.delete-btn[_ngcontent-%COMP%]:hover{color:var(--color-error)}@media (max-width: 768px){.file-actions[_ngcontent-%COMP%]{opacity:1}.file-item[_ngcontent-%COMP%]{padding:1rem .75rem}.drawer-header[_ngcontent-%COMP%]{padding:.75rem}}"]})};var kv=["tooltip"],vd=20;var yd=new ne("mat-tooltip-scroll-strategy",{providedIn:"root",factory:()=>{let o=m(be);return()=>zi(o,{scrollThrottle:vd})}});function Ru(o){let t=m(be);return()=>zi(t,{scrollThrottle:vd})}var Cd={provide:yd,deps:[],useFactory:Ru};function Fu(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}var Nu=new ne("mat-tooltip-default-options",{providedIn:"root",factory:Fu});var Iu="tooltip-panel",Du=Rm({passive:!0}),Mv=8,Tv=8,Ev=24,Pv=200,xd=(()=>{class o{_elementRef=m(ie);_ngZone=m(de);_platform=m(et);_ariaDescriber=m(Ua);_focusMonitor=m(Ri);_dir=m(ft);_injector=m(be);_viewContainerRef=m(Xn);_animationsDisabled=He();_defaultOptions=m(Nu,{optional:!0});_overlayRef;_tooltipInstance;_overlayPanelClass;_portal;_position="below";_positionAtOrigin=!1;_disabled=!1;_tooltipClass;_viewInitialized=!1;_pointerExitEventsInitialized=!1;_tooltipComponent=Lu;_viewportMargin=8;_currentPosition;_cssClassPrefix="mat-mdc";_ariaDescriptionPending;_dirSubscribed=!1;get position(){return this._position}set position(e){e!==this._position&&(this._position=e,this._overlayRef&&(this._updatePosition(this._overlayRef),this._tooltipInstance?.show(0),this._overlayRef.updatePosition()))}get positionAtOrigin(){return this._positionAtOrigin}set positionAtOrigin(e){this._positionAtOrigin=Tt(e),this._detach(),this._overlayRef=null}get disabled(){return this._disabled}set disabled(e){let i=Tt(e);this._disabled!==i&&(this._disabled=i,i?this.hide(0):this._setupPointerEnterEventsIfNeeded(),this._syncAriaDescription(this.message))}get showDelay(){return this._showDelay}set showDelay(e){this._showDelay=gi(e)}_showDelay;get hideDelay(){return this._hideDelay}set hideDelay(e){this._hideDelay=gi(e),this._tooltipInstance&&(this._tooltipInstance._mouseLeaveHideDelay=this._hideDelay)}_hideDelay;touchGestures="auto";get message(){return this._message}set message(e){let i=this._message;this._message=e!=null?String(e).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage()),this._syncAriaDescription(i)}_message="";get tooltipClass(){return this._tooltipClass}set tooltipClass(e){this._tooltipClass=e,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass)}_passiveListeners=[];_touchstartTimeout=null;_destroyed=new R;_isDestroyed=!1;constructor(){let e=this._defaultOptions;e&&(this._showDelay=e.showDelay,this._hideDelay=e.hideDelay,e.position&&(this.position=e.position),e.positionAtOrigin&&(this.positionAtOrigin=e.positionAtOrigin),e.touchGestures&&(this.touchGestures=e.touchGestures),e.tooltipClass&&(this.tooltipClass=e.tooltipClass)),this._viewportMargin=Mv}ngAfterViewInit(){this._viewInitialized=!0,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(L(this._destroyed)).subscribe(e=>{e?e==="keyboard"&&this._ngZone.run(()=>this.show()):this._ngZone.run(()=>this.hide(0))})}ngOnDestroy(){let e=this._elementRef.nativeElement;this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),this._passiveListeners.forEach(([i,n])=>{e.removeEventListener(i,n,Du)}),this._passiveListeners.length=0,this._destroyed.next(),this._destroyed.complete(),this._isDestroyed=!0,this._ariaDescriber.removeDescription(e,this.message,"tooltip"),this._focusMonitor.stopMonitoring(e)}show(e=this.showDelay,i){if(this.disabled||!this.message||this._isTooltipVisible()){this._tooltipInstance?._cancelPendingAnimations();return}let n=this._createOverlay(i);this._detach(),this._portal=this._portal||new bi(this._tooltipComponent,this._viewContainerRef);let r=this._tooltipInstance=n.attach(this._portal).instance;r._triggerElement=this._elementRef.nativeElement,r._mouseLeaveHideDelay=this._hideDelay,r.afterHidden().pipe(L(this._destroyed)).subscribe(()=>this._detach()),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),r.show(e)}hide(e=this.hideDelay){let i=this._tooltipInstance;i&&(i.isVisible()?i.hide(e):(i._cancelPendingAnimations(),this._detach()))}toggle(e){this._isTooltipVisible()?this.hide():this.show(void 0,e)}_isTooltipVisible(){return!!this._tooltipInstance&&this._tooltipInstance.isVisible()}_createOverlay(e){if(this._overlayRef){let a=this._overlayRef.getConfig().positionStrategy;if((!this.positionAtOrigin||!e)&&a._origin instanceof ie)return this._overlayRef;this._detach()}let i=this._injector.get(sn).getAncestorScrollContainers(this._elementRef),n=`${this._cssClassPrefix}-${Iu}`,r=Ur(this._injector,this.positionAtOrigin?e||this._elementRef:this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(!1).withViewportMargin(this._viewportMargin).withScrollableContainers(i);return r.positionChanges.pipe(L(this._destroyed)).subscribe(a=>{this._updateCurrentPositionClass(a.connectionPair),this._tooltipInstance&&a.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0))}),this._overlayRef=mn(this._injector,{direction:this._dir,positionStrategy:r,panelClass:this._overlayPanelClass?[...this._overlayPanelClass,n]:n,scrollStrategy:this._injector.get(yd)(),disableAnimations:this._animationsDisabled}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(L(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(L(this._destroyed)).subscribe(()=>this._tooltipInstance?._handleBodyInteraction()),this._overlayRef.keydownEvents().pipe(L(this._destroyed)).subscribe(a=>{this._isTooltipVisible()&&a.keyCode===27&&!gt(a)&&(a.preventDefault(),a.stopPropagation(),this._ngZone.run(()=>this.hide(0)))}),this._defaultOptions?.disableTooltipInteractivity&&this._overlayRef.addPanelClass(`${this._cssClassPrefix}-tooltip-panel-non-interactive`),this._dirSubscribed||(this._dirSubscribed=!0,this._dir.change.pipe(L(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef)})),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null}_updatePosition(e){let i=e.getConfig().positionStrategy,n=this._getOrigin(),r=this._getOverlayPosition();i.withPositions([this._addOffset(Z(Z({},n.main),r.main)),this._addOffset(Z(Z({},n.fallback),r.fallback))])}_addOffset(e){let i=Tv,n=!this._dir||this._dir.value=="ltr";return e.originY==="top"?e.offsetY=-i:e.originY==="bottom"?e.offsetY=i:e.originX==="start"?e.offsetX=n?-i:i:e.originX==="end"&&(e.offsetX=n?i:-i),e}_getOrigin(){let e=!this._dir||this._dir.value=="ltr",i=this.position,n;i=="above"||i=="below"?n={originX:"center",originY:i=="above"?"top":"bottom"}:i=="before"||i=="left"&&e||i=="right"&&!e?n={originX:"start",originY:"center"}:(i=="after"||i=="right"&&e||i=="left"&&!e)&&(n={originX:"end",originY:"center"});let{x:r,y:a}=this._invertPosition(n.originX,n.originY);return{main:n,fallback:{originX:r,originY:a}}}_getOverlayPosition(){let e=!this._dir||this._dir.value=="ltr",i=this.position,n;i=="above"?n={overlayX:"center",overlayY:"bottom"}:i=="below"?n={overlayX:"center",overlayY:"top"}:i=="before"||i=="left"&&e||i=="right"&&!e?n={overlayX:"end",overlayY:"center"}:(i=="after"||i=="right"&&e||i=="left"&&!e)&&(n={overlayX:"start",overlayY:"center"});let{x:r,y:a}=this._invertPosition(n.overlayX,n.overlayY);return{main:n,fallback:{overlayX:r,overlayY:a}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),Dt(()=>{this._tooltipInstance&&this._overlayRef.updatePosition()},{injector:this._injector}))}_setTooltipClass(e){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=e,this._tooltipInstance._markForCheck())}_invertPosition(e,i){return this.position==="above"||this.position==="below"?i==="top"?i="bottom":i==="bottom"&&(i="top"):e==="end"?e="start":e==="start"&&(e="end"),{x:e,y:i}}_updateCurrentPositionClass(e){let{overlayY:i,originX:n,originY:r}=e,a;if(i==="center"?this._dir&&this._dir.value==="rtl"?a=n==="end"?"left":"right":a=n==="start"?"left":"right":a=i==="bottom"&&r==="top"?"above":"below",a!==this._currentPosition){let c=this._overlayRef;if(c){let h=`${this._cssClassPrefix}-${Iu}-`;c.removePanelClass(h+this._currentPosition),c.addPanelClass(h+a)}this._currentPosition=a}}_setupPointerEnterEventsIfNeeded(){this._disabled||!this.message||!this._viewInitialized||this._passiveListeners.length||(this._platformSupportsMouseEvents()?this._passiveListeners.push(["mouseenter",e=>{this._setupPointerExitEventsIfNeeded();let i;e.x!==void 0&&e.y!==void 0&&(i=e),this.show(void 0,i)}]):this.touchGestures!=="off"&&(this._disableNativeGesturesIfNecessary(),this._passiveListeners.push(["touchstart",e=>{let i=e.targetTouches?.[0],n=i?{x:i.clientX,y:i.clientY}:void 0;this._setupPointerExitEventsIfNeeded(),this._touchstartTimeout&&clearTimeout(this._touchstartTimeout);let r=500;this._touchstartTimeout=setTimeout(()=>{this._touchstartTimeout=null,this.show(void 0,n)},this._defaultOptions?.touchLongPressShowDelay??r)}])),this._addListeners(this._passiveListeners))}_setupPointerExitEventsIfNeeded(){if(this._pointerExitEventsInitialized)return;this._pointerExitEventsInitialized=!0;let e=[];if(this._platformSupportsMouseEvents())e.push(["mouseleave",i=>{let n=i.relatedTarget;(!n||!this._overlayRef?.overlayElement.contains(n))&&this.hide()}],["wheel",i=>this._wheelListener(i)]);else if(this.touchGestures!=="off"){this._disableNativeGesturesIfNecessary();let i=()=>{this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions?.touchendHideDelay)};e.push(["touchend",i],["touchcancel",i])}this._addListeners(e),this._passiveListeners.push(...e)}_addListeners(e){e.forEach(([i,n])=>{this._elementRef.nativeElement.addEventListener(i,n,Du)})}_platformSupportsMouseEvents(){return!this._platform.IOS&&!this._platform.ANDROID}_wheelListener(e){if(this._isTooltipVisible()){let i=this._injector.get(Je).elementFromPoint(e.clientX,e.clientY),n=this._elementRef.nativeElement;i!==n&&!n.contains(i)&&this.hide()}}_disableNativeGesturesIfNecessary(){let e=this.touchGestures;if(e!=="off"){let i=this._elementRef.nativeElement,n=i.style;(e==="on"||i.nodeName!=="INPUT"&&i.nodeName!=="TEXTAREA")&&(n.userSelect=n.msUserSelect=n.webkitUserSelect=n.MozUserSelect="none"),(e==="on"||!i.draggable)&&(n.webkitUserDrag="none"),n.touchAction="none",n.webkitTapHighlightColor="transparent"}}_syncAriaDescription(e){this._ariaDescriptionPending||(this._ariaDescriptionPending=!0,this._ariaDescriber.removeDescription(this._elementRef.nativeElement,e,"tooltip"),this._isDestroyed||Dt({write:()=>{this._ariaDescriptionPending=!1,this.message&&!this.disabled&&this._ariaDescriber.describe(this._elementRef.nativeElement,this.message,"tooltip")}},{injector:this._injector}))}static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-mdc-tooltip-trigger"],hostVars:2,hostBindings:function(i,n){i&2&&E("mat-mdc-tooltip-disabled",n.disabled)},inputs:{position:[0,"matTooltipPosition","position"],positionAtOrigin:[0,"matTooltipPositionAtOrigin","positionAtOrigin"],disabled:[0,"matTooltipDisabled","disabled"],showDelay:[0,"matTooltipShowDelay","showDelay"],hideDelay:[0,"matTooltipHideDelay","hideDelay"],touchGestures:[0,"matTooltipTouchGestures","touchGestures"],message:[0,"matTooltip","message"],tooltipClass:[0,"matTooltipClass","tooltipClass"]},exportAs:["matTooltip"]})}return o})(),Lu=(()=>{class o{_changeDetectorRef=m(Ge);_elementRef=m(ie);_isMultiline=!1;message;tooltipClass;_showTimeoutId;_hideTimeoutId;_triggerElement;_mouseLeaveHideDelay;_animationsDisabled=He();_tooltip;_closeOnInteraction=!1;_isVisible=!1;_onHide=new R;_showAnimation="mat-mdc-tooltip-show";_hideAnimation="mat-mdc-tooltip-hide";constructor(){}show(e){this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=setTimeout(()=>{this._toggleVisibility(!0),this._showTimeoutId=void 0},e)}hide(e){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(()=>{this._toggleVisibility(!1),this._hideTimeoutId=void 0},e)}afterHidden(){return this._onHide}isVisible(){return this._isVisible}ngOnDestroy(){this._cancelPendingAnimations(),this._onHide.complete(),this._triggerElement=null}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0)}_markForCheck(){this._changeDetectorRef.markForCheck()}_handleMouseLeave({relatedTarget:e}){(!e||!this._triggerElement.contains(e))&&(this.isVisible()?this.hide(this._mouseLeaveHideDelay):this._finalizeAnimation(!1))}_onShow(){this._isMultiline=this._isTooltipMultiline(),this._markForCheck()}_isTooltipMultiline(){let e=this._elementRef.nativeElement.getBoundingClientRect();return e.height>Ev&&e.width>=Pv}_handleAnimationEnd({animationName:e}){(e===this._showAnimation||e===this._hideAnimation)&&this._finalizeAnimation(e===this._showAnimation)}_cancelPendingAnimations(){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=this._hideTimeoutId=void 0}_finalizeAnimation(e){e?this._closeOnInteraction=!0:this.isVisible()||this._onHide.next()}_toggleVisibility(e){let i=this._tooltip.nativeElement,n=this._showAnimation,r=this._hideAnimation;if(i.classList.remove(e?r:n),i.classList.add(e?n:r),this._isVisible!==e&&(this._isVisible=e,this._changeDetectorRef.markForCheck()),e&&!this._animationsDisabled&&typeof getComputedStyle=="function"){let a=getComputedStyle(i);(a.getPropertyValue("animation-duration")==="0s"||a.getPropertyValue("animation-name")==="none")&&(this._animationsDisabled=!0)}e&&this._onShow(),this._animationsDisabled&&(i.classList.add("_mat-animation-noopable"),this._finalizeAnimation(e))}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["mat-tooltip-component"]],viewQuery:function(i,n){if(i&1&&Q(kv,7),i&2){let r;H(r=W())&&(n._tooltip=r.first)}},hostAttrs:["aria-hidden","true"],hostBindings:function(i,n){i&1&&_("mouseleave",function(a){return n._handleMouseLeave(a)})},decls:4,vars:4,consts:[["tooltip",""],[1,"mdc-tooltip","mat-mdc-tooltip",3,"animationend","ngClass"],[1,"mat-mdc-tooltip-surface","mdc-tooltip__surface"]],template:function(i,n){if(i&1){let r=M();s(0,"div",1,0),_("animationend",function(c){return v(r),y(n._handleAnimationEnd(c))}),s(2,"div",2),p(3),l()()}i&2&&(E("mdc-tooltip--multiline",n._isMultiline),w("ngClass",n.tooltipClass),d(3),F(n.message))},dependencies:[En],styles:[`.mat-mdc-tooltip{position:relative;transform:scale(0);display:inline-flex}.mat-mdc-tooltip::before{content:"";top:0;right:0;bottom:0;left:0;z-index:-1;position:absolute}.mat-mdc-tooltip-panel-below .mat-mdc-tooltip::before{top:-8px}.mat-mdc-tooltip-panel-above .mat-mdc-tooltip::before{bottom:-8px}.mat-mdc-tooltip-panel-right .mat-mdc-tooltip::before{left:-8px}.mat-mdc-tooltip-panel-left .mat-mdc-tooltip::before{right:-8px}.mat-mdc-tooltip._mat-animation-noopable{animation:none;transform:scale(1)}.mat-mdc-tooltip-surface{word-break:normal;overflow-wrap:anywhere;padding:4px 8px;min-width:40px;max-width:200px;min-height:24px;max-height:40vh;box-sizing:border-box;overflow:hidden;text-align:center;will-change:transform,opacity;background-color:var(--mat-tooltip-container-color, var(--mat-sys-inverse-surface));color:var(--mat-tooltip-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mat-tooltip-container-shape, var(--mat-sys-corner-extra-small));font-family:var(--mat-tooltip-supporting-text-font, var(--mat-sys-body-small-font));font-size:var(--mat-tooltip-supporting-text-size, var(--mat-sys-body-small-size));font-weight:var(--mat-tooltip-supporting-text-weight, var(--mat-sys-body-small-weight));line-height:var(--mat-tooltip-supporting-text-line-height, var(--mat-sys-body-small-line-height));letter-spacing:var(--mat-tooltip-supporting-text-tracking, var(--mat-sys-body-small-tracking))}.mat-mdc-tooltip-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:left}[dir=rtl] .mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:right}.mat-mdc-tooltip-panel{line-height:normal}.mat-mdc-tooltip-panel.mat-mdc-tooltip-panel-non-interactive{pointer-events:none}@keyframes mat-mdc-tooltip-show{0%{opacity:0;transform:scale(0.8)}100%{opacity:1;transform:scale(1)}}@keyframes mat-mdc-tooltip-hide{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(0.8)}}.mat-mdc-tooltip-show{animation:mat-mdc-tooltip-show 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-mdc-tooltip-hide{animation:mat-mdc-tooltip-hide 75ms cubic-bezier(0.4, 0, 1, 1) forwards}
|
|
363
363
|
`],encapsulation:2,changeDetection:0})}return o})();var sa=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({providers:[Cd],imports:[Oo,vi,ae,ae,Li]})}return o})();var ll=class o{http=m(Ye);listUsers(){return this.http.get("/api/users")}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var cl=class o{excludedUserIds=[];placeholder="Search username";disabled=!1;userSelected=new U;userApi=m(ll);search(t){let e=t.toLowerCase();return this.userApi.listUsers().pipe(_e(i=>i.filter(n=>!this.excludedUserIds.includes(n.username)).filter(n=>n.username.toLowerCase().includes(e)).map(n=>({id:n.username,name:n.username}))))}onItemSelected(t){this.userSelected.emit(t.id)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-user-autocomplete"]],inputs:{excludedUserIds:"excludedUserIds",placeholder:"placeholder",disabled:"disabled"},outputs:{userSelected:"userSelected"},decls:1,vars:3,consts:[[3,"itemSelected","dataSource","placeholder","disabled"]],template:function(e,i){e&1&&(s(0,"ds-autocomplete-input",0),_("itemSelected",function(r){return i.onItemSelected(r)}),l()),e&2&&w("dataSource",i)("placeholder",i.placeholder)("disabled",i.disabled)},dependencies:[Qm],styles:["[_nghost-%COMP%]{display:block}"]})};var Av=(o,t)=>t.userId;function Iv(o,t){if(o&1&&(s(0,"div",6),p(1),l()),o&2){let e=u(2);d(),F(e.errorMessage())}}function Dv(o,t){if(o&1){let e=M();s(0,"div",4)(1,"app-user-autocomplete",5),_("userSelected",function(n){v(e);let r=u();return y(r.onUserSelected(n))}),l()(),C(2,Iv,2,1,"div",6)}if(o&2){let e=u();d(),w("excludedUserIds",e.excludedUserIds)("disabled",e.isAdding()),d(),x(e.errorMessage()?2:-1)}}function Rv(o,t){o&1&&(s(0,"span",10),p(1,"owner"),l())}function Fv(o,t){if(o&1){let e=M();s(0,"button",12),_("click",function(){v(e);let n=u().$implicit,r=u();return y(r.removeUser(n.userId))}),s(1,"mat-icon"),p(2,"close"),l()()}}function Nv(o,t){if(o&1&&(s(0,"div",7)(1,"mat-icon",8),p(2,"person"),l(),s(3,"span",9),p(4),l(),C(5,Rv,2,0,"span",10),C(6,Fv,3,0,"button",11),l()),o&2){let e=t.$implicit,i=u();E("owner",e.userId===i.ownerUsername),d(4),F(e.userId),d(),x(e.userId===i.ownerUsername?5:-1),d(),x(i.isOwner&&e.userId!==i.ownerUsername?6:-1)}}var la=class o{threadId;users=[];ownerUsername;currentUsername;userAdded=new U;userRemoved=new U;isAdding=Ee(!1);errorMessage=Ee("");get isOwner(){return this.currentUsername===this.ownerUsername}get excludedUserIds(){return[this.currentUsername,...this.users.map(t=>t.userId)]}setAdding(t){this.isAdding.set(t)}setError(t){this.errorMessage.set(t),this.isAdding.set(!1)}onUserSelected(t){this.errorMessage.set(""),this.userAdded.emit(t)}removeUser(t){this.userRemoved.emit(t)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-thread-share"]],inputs:{threadId:"threadId",users:"users",ownerUsername:"ownerUsername",currentUsername:"currentUsername"},outputs:{userAdded:"userAdded",userRemoved:"userRemoved"},decls:10,vars:1,consts:[[1,"thread-share"],[1,"share-header"],[1,"users-list"],[1,"user-item",3,"owner"],[1,"add-user-section"],[3,"userSelected","excludedUserIds","disabled"],[1,"error-message"],[1,"user-item"],[1,"user-icon"],[1,"user-name"],[1,"owner-badge"],["mat-icon-button","","title","Remove user",1,"remove-button"],["mat-icon-button","","title","Remove user",1,"remove-button",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"mat-icon"),p(3,"group"),l(),s(4,"span"),p(5,"Participants"),l()(),C(6,Dv,3,3),s(7,"div",2),xe(8,Nv,7,5,"div",3,Av),l()()),e&2&&(d(6),x(i.isOwner?6:-1),d(2),we(i.users))},dependencies:[Oe,he,it,Qe,sa,cl],styles:[".thread-share[_ngcontent-%COMP%]{padding:1rem;display:flex;flex-direction:column;gap:.75rem}.share-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;font-weight:600;font-size:.9rem;color:var(--color-text)}.share-header[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;color:var(--color-text-secondary)}.add-user-section[_ngcontent-%COMP%]{display:flex;align-items:center;width:50%}.error-message[_ngcontent-%COMP%]{color:var(--color-error);font-size:.75rem;margin-top:-.5rem}.users-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.user-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;border-radius:6px;transition:background .15s ease}.user-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.user-item.owner[_ngcontent-%COMP%]{background:rgba(var(--color-primary-rgb, 25, 118, 210),.05)}.user-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;color:var(--color-text-secondary);flex-shrink:0}.user-name[_ngcontent-%COMP%]{flex:1;font-size:.875rem;color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.owner-badge[_ngcontent-%COMP%]{font-size:.7rem;background:var(--color-primary-light);color:var(--color-primary);padding:.1rem .5rem;border-radius:10px;flex-shrink:0;font-weight:500}.remove-button[_ngcontent-%COMP%]{flex-shrink:0;width:28px!important;height:28px!important;padding:0!important}.remove-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;color:var(--color-text-secondary)}.remove-button[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:var(--color-error, #ef4444)}"]})};var ml=["*"],Lv=["content"],Vv=[[["mat-drawer"]],[["mat-drawer-content"]],"*"],zv=["mat-drawer","mat-drawer-content","*"];function jv(o,t){if(o&1){let e=M();s(0,"div",1),_("click",function(){v(e);let n=u();return y(n._onBackdropClicked())}),l()}if(o&2){let e=u();E("mat-drawer-shown",e._isShowingBackdrop())}}function Bv(o,t){o&1&&(s(0,"mat-drawer-content"),me(1,2),l())}var Hv=[[["mat-sidenav"]],[["mat-sidenav-content"]],"*"],Wv=["mat-sidenav","mat-sidenav-content","*"];function Uv(o,t){if(o&1){let e=M();s(0,"div",1),_("click",function(){v(e);let n=u();return y(n._onBackdropClicked())}),l()}if(o&2){let e=u();E("mat-drawer-shown",e._isShowingBackdrop())}}function $v(o,t){o&1&&(s(0,"mat-sidenav-content"),me(1,2),l())}var qv=`.mat-drawer-container{position:relative;z-index:1;color:var(--mat-sidenav-content-text-color, var(--mat-sys-on-background));background-color:var(--mat-sidenav-content-background-color, var(--mat-sys-background));box-sizing:border-box;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-container-has-open{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-container.ng-animate-disabled .mat-drawer-backdrop,.mat-drawer-container.ng-animate-disabled .mat-drawer-content,.ng-animate-disabled .mat-drawer-container .mat-drawer-backdrop,.ng-animate-disabled .mat-drawer-container .mat-drawer-content{transition:none}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible;background-color:var(--mat-sidenav-scrim-color, color-mix(in srgb, var(--mat-sys-neutral-variant20) 40%, transparent))}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:background-color,visibility}@media(forced-colors: active){.mat-drawer-backdrop{opacity:.5}}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-content.mat-drawer-content-hidden{opacity:0}.mat-drawer-transition .mat-drawer-content{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;color:var(--mat-sidenav-container-text-color, var(--mat-sys-on-surface-variant));box-shadow:var(--mat-sidenav-container-elevation-shadow, none);background-color:var(--mat-sidenav-container-background-color, var(--mat-sys-surface));border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));width:var(--mat-sidenav-container-width, 360px);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%, 0, 0)}@media(forced-colors: active){.mat-drawer,[dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}}@media(forced-colors: active){[dir=rtl] .mat-drawer,.mat-drawer.mat-drawer-end{border-left:solid 1px currentColor;border-right:none}}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%, 0, 0);border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .mat-drawer{border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer.mat-drawer-end{border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%, 0, 0)}.mat-drawer-transition .mat-drawer{transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating){visibility:hidden;box-shadow:none}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating) .mat-drawer-inner-container{display:none}.mat-drawer.mat-drawer-opened.mat-drawer-opened{transform:none}.mat-drawer-side{box-shadow:none;border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid}.mat-drawer-side.mat-drawer-end{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side.mat-drawer-end{border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid;border-left:none}.mat-drawer-inner-container{width:100%;height:100%;overflow:auto}.mat-sidenav-fixed{position:fixed}
|
|
364
|
-
`;var Gv=new ne("MAT_DRAWER_DEFAULT_AUTOSIZE",{providedIn:"root",factory:Yv}),wd=new ne("MAT_DRAWER_CONTAINER");function Yv(){return!1}var hr=(()=>{class o extends ln{_platform=m(et);_changeDetectorRef=m(Ge);_container=m(da);constructor(){let e=m(ie),i=m(sn),n=m(de);super(e,i,n)}ngAfterContentInit(){this._container._contentMarginChanges.subscribe(()=>{this._changeDetectorRef.markForCheck()})}_shouldBeHidden(){if(this._platform.isBrowser)return!1;let{start:e,end:i}=this._container;return e!=null&&e.mode!=="over"&&e.opened||i!=null&&i.mode!=="over"&&i.opened}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["mat-drawer-content"]],hostAttrs:[1,"mat-drawer-content"],hostVars:6,hostBindings:function(i,n){i&2&&(Ii("margin-left",n._container._contentMargins.left,"px")("margin-right",n._container._contentMargins.right,"px"),E("mat-drawer-content-hidden",n._shouldBeHidden()))},features:[qe([{provide:ln,useExisting:o}]),Mt],ngContentSelectors:ml,decls:1,vars:0,template:function(i,n){i&1&&(Be(),me(0))},encapsulation:2,changeDetection:0})}return o})(),ca=(()=>{class o{_elementRef=m(ie);_focusTrapFactory=m(Ha);_focusMonitor=m(Ri);_platform=m(et);_ngZone=m(de);_renderer=m(yt);_interactivityChecker=m(Po);_doc=m(Je);_container=m(wd,{optional:!0});_focusTrap=null;_elementFocusedBeforeDrawerWasOpened=null;_eventCleanups;_isAttached;_anchor;get position(){return this._position}set position(e){e=e==="end"?"end":"start",e!==this._position&&(this._isAttached&&this._updatePositionInParent(e),this._position=e,this.onPositionChanged.emit())}_position="start";get mode(){return this._mode}set mode(e){this._mode=e,this._updateFocusTrapState(),this._modeChanged.next()}_mode="over";get disableClose(){return this._disableClose}set disableClose(e){this._disableClose=Tt(e)}_disableClose=!1;get autoFocus(){let e=this._autoFocus;return e??(this.mode==="side"?"dialog":"first-tabbable")}set autoFocus(e){(e==="true"||e==="false"||e==null)&&(e=Tt(e)),this._autoFocus=e}_autoFocus;get opened(){return this._opened()}set opened(e){this.toggle(Tt(e))}_opened=Ee(!1);_openedVia;_animationStarted=new R;_animationEnd=new R;openedChange=new U(!0);_openedStream=this.openedChange.pipe(ce(e=>e),_e(()=>{}));openedStart=this._animationStarted.pipe(ce(()=>this.opened),Gl(void 0));_closedStream=this.openedChange.pipe(ce(e=>!e),_e(()=>{}));closedStart=this._animationStarted.pipe(ce(()=>!this.opened),Gl(void 0));_destroyed=new R;onPositionChanged=new U;_content;_modeChanged=new R;_injector=m(be);_changeDetectorRef=m(Ge);constructor(){this.openedChange.pipe(L(this._destroyed)).subscribe(e=>{e?(this._elementFocusedBeforeDrawerWasOpened=this._doc.activeElement,this._takeFocus()):this._isFocusWithinDrawer()&&this._restoreFocus(this._openedVia||"program")}),this._ngZone.runOutsideAngular(()=>{let e=this._elementRef.nativeElement;am(e,"keydown").pipe(ce(i=>i.keyCode===27&&!this.disableClose&&!gt(i)),L(this._destroyed)).subscribe(i=>this._ngZone.run(()=>{this.close(),i.stopPropagation(),i.preventDefault()})),this._eventCleanups=[this._renderer.listen(e,"transitionrun",this._handleTransitionEvent),this._renderer.listen(e,"transitionend",this._handleTransitionEvent),this._renderer.listen(e,"transitioncancel",this._handleTransitionEvent)]}),this._animationEnd.subscribe(()=>{this.openedChange.emit(this.opened)})}_forceFocus(e,i){this._interactivityChecker.isFocusable(e)||(e.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{let n=()=>{r(),a(),e.removeAttribute("tabindex")},r=this._renderer.listen(e,"blur",n),a=this._renderer.listen(e,"mousedown",n)})),e.focus(i)}_focusByCssSelector(e,i){let n=this._elementRef.nativeElement.querySelector(e);n&&this._forceFocus(n,i)}_takeFocus(){if(!this._focusTrap)return;let e=this._elementRef.nativeElement;switch(this.autoFocus){case!1:case"dialog":return;case!0:case"first-tabbable":Dt(()=>{!this._focusTrap.focusInitialElement()&&typeof e.focus=="function"&&e.focus()},{injector:this._injector});break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]');break;default:this._focusByCssSelector(this.autoFocus);break}}_restoreFocus(e){this.autoFocus!=="dialog"&&(this._elementFocusedBeforeDrawerWasOpened?this._focusMonitor.focusVia(this._elementFocusedBeforeDrawerWasOpened,e):this._elementRef.nativeElement.blur(),this._elementFocusedBeforeDrawerWasOpened=null)}_isFocusWithinDrawer(){let e=this._doc.activeElement;return!!e&&this._elementRef.nativeElement.contains(e)}ngAfterViewInit(){this._isAttached=!0,this._position==="end"&&this._updatePositionInParent("end"),this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._updateFocusTrapState())}ngOnDestroy(){this._eventCleanups.forEach(e=>e()),this._focusTrap?.destroy(),this._anchor?.remove(),this._anchor=null,this._animationStarted.complete(),this._animationEnd.complete(),this._modeChanged.complete(),this._destroyed.next(),this._destroyed.complete()}open(e){return this.toggle(!0,e)}close(){return this.toggle(!1)}_closeViaBackdropClick(){return this._setOpen(!1,!0,"mouse")}toggle(e=!this.opened,i){e&&i&&(this._openedVia=i);let n=this._setOpen(e,!e&&this._isFocusWithinDrawer(),this._openedVia||"program");return e||(this._openedVia=null),n}_setOpen(e,i,n){return e===this.opened?Promise.resolve(e?"open":"close"):(this._opened.set(e),this._container?._transitionsEnabled?this._setIsAnimating(!0):setTimeout(()=>{this._animationStarted.next(),this._animationEnd.next()}),this._elementRef.nativeElement.classList.toggle("mat-drawer-opened",e),!e&&i&&this._restoreFocus(n),this._changeDetectorRef.markForCheck(),this._updateFocusTrapState(),new Promise(r=>{this.openedChange.pipe(Ut(1)).subscribe(a=>r(a?"open":"close"))}))}_setIsAnimating(e){this._elementRef.nativeElement.classList.toggle("mat-drawer-animating",e)}_getWidth(){return this._elementRef.nativeElement.offsetWidth||0}_updateFocusTrapState(){this._focusTrap&&(this._focusTrap.enabled=!!this._container?.hasBackdrop&&this.opened)}_updatePositionInParent(e){if(!this._platform.isBrowser)return;let i=this._elementRef.nativeElement,n=i.parentNode;e==="end"?(this._anchor||(this._anchor=this._doc.createComment("mat-drawer-anchor"),n.insertBefore(this._anchor,i)),n.appendChild(i)):this._anchor&&this._anchor.parentNode.insertBefore(i,this._anchor)}_handleTransitionEvent=e=>{let i=this._elementRef.nativeElement;e.target===i&&this._ngZone.run(()=>{e.type==="transitionrun"?this._animationStarted.next(e):(e.type==="transitionend"&&this._setIsAnimating(!1),this._animationEnd.next(e))})};static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["mat-drawer"]],viewQuery:function(i,n){if(i&1&&Q(Lv,5),i&2){let r;H(r=W())&&(n._content=r.first)}},hostAttrs:[1,"mat-drawer"],hostVars:12,hostBindings:function(i,n){i&2&&(X("align",null)("tabIndex",n.mode!=="side"?"-1":null),Ii("visibility",!n._container&&!n.opened?"hidden":null),E("mat-drawer-end",n.position==="end")("mat-drawer-over",n.mode==="over")("mat-drawer-push",n.mode==="push")("mat-drawer-side",n.mode==="side"))},inputs:{position:"position",mode:"mode",disableClose:"disableClose",autoFocus:"autoFocus",opened:"opened"},outputs:{openedChange:"openedChange",_openedStream:"opened",openedStart:"openedStart",_closedStream:"closed",closedStart:"closedStart",onPositionChanged:"positionChanged"},exportAs:["matDrawer"],ngContentSelectors:ml,decls:3,vars:0,consts:[["content",""],["cdkScrollable","",1,"mat-drawer-inner-container"]],template:function(i,n){i&1&&(Be(),s(0,"div",1,0),me(2),l())},dependencies:[ln],encapsulation:2,changeDetection:0})}return o})(),da=(()=>{class o{_dir=m(ft,{optional:!0});_element=m(ie);_ngZone=m(de);_changeDetectorRef=m(Ge);_animationDisabled=He();_transitionsEnabled=!1;_allDrawers;_drawers=new pm;_content;_userContent;get start(){return this._start}get end(){return this._end}get autosize(){return this._autosize}set autosize(e){this._autosize=Tt(e)}_autosize=m(Gv);get hasBackdrop(){return this._drawerHasBackdrop(this._start)||this._drawerHasBackdrop(this._end)}set hasBackdrop(e){this._backdropOverride=e==null?null:Tt(e)}_backdropOverride;backdropClick=new U;_start;_end;_left;_right;_destroyed=new R;_doCheckSubject=new R;_contentMargins={left:null,right:null};_contentMarginChanges=new R;get scrollable(){return this._userContent||this._content}_injector=m(be);constructor(){let e=m(et),i=m(Vi);this._dir?.change.pipe(L(this._destroyed)).subscribe(()=>{this._validateDrawers(),this.updateContentMargins()}),i.change().pipe(L(this._destroyed)).subscribe(()=>this.updateContentMargins()),!this._animationDisabled&&e.isBrowser&&this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{this._element.nativeElement.classList.add("mat-drawer-transition"),this._transitionsEnabled=!0},200)})}ngAfterContentInit(){this._allDrawers.changes.pipe(kt(this._allDrawers),L(this._destroyed)).subscribe(e=>{this._drawers.reset(e.filter(i=>!i._container||i._container===this)),this._drawers.notifyOnChanges()}),this._drawers.changes.pipe(kt(null)).subscribe(()=>{this._validateDrawers(),this._drawers.forEach(e=>{this._watchDrawerToggle(e),this._watchDrawerPosition(e),this._watchDrawerMode(e)}),(!this._drawers.length||this._isDrawerOpen(this._start)||this._isDrawerOpen(this._end))&&this.updateContentMargins(),this._changeDetectorRef.markForCheck()}),this._ngZone.runOutsideAngular(()=>{this._doCheckSubject.pipe(sm(10),L(this._destroyed)).subscribe(()=>this.updateContentMargins())})}ngOnDestroy(){this._contentMarginChanges.complete(),this._doCheckSubject.complete(),this._drawers.destroy(),this._destroyed.next(),this._destroyed.complete()}open(){this._drawers.forEach(e=>e.open())}close(){this._drawers.forEach(e=>e.close())}updateContentMargins(){let e=0,i=0;if(this._left&&this._left.opened){if(this._left.mode=="side")e+=this._left._getWidth();else if(this._left.mode=="push"){let n=this._left._getWidth();e+=n,i-=n}}if(this._right&&this._right.opened){if(this._right.mode=="side")i+=this._right._getWidth();else if(this._right.mode=="push"){let n=this._right._getWidth();i+=n,e-=n}}e=e||null,i=i||null,(e!==this._contentMargins.left||i!==this._contentMargins.right)&&(this._contentMargins={left:e,right:i},this._ngZone.run(()=>this._contentMarginChanges.next(this._contentMargins)))}ngDoCheck(){this._autosize&&this._isPushed()&&this._ngZone.runOutsideAngular(()=>this._doCheckSubject.next())}_watchDrawerToggle(e){e._animationStarted.pipe(L(this._drawers.changes)).subscribe(()=>{this.updateContentMargins(),this._changeDetectorRef.markForCheck()}),e.mode!=="side"&&e.openedChange.pipe(L(this._drawers.changes)).subscribe(()=>this._setContainerClass(e.opened))}_watchDrawerPosition(e){e.onPositionChanged.pipe(L(this._drawers.changes)).subscribe(()=>{Dt({read:()=>this._validateDrawers()},{injector:this._injector})})}_watchDrawerMode(e){e._modeChanged.pipe(L(Ai(this._drawers.changes,this._destroyed))).subscribe(()=>{this.updateContentMargins(),this._changeDetectorRef.markForCheck()})}_setContainerClass(e){let i=this._element.nativeElement.classList,n="mat-drawer-container-has-open";e?i.add(n):i.remove(n)}_validateDrawers(){this._start=this._end=null,this._drawers.forEach(e=>{e.position=="end"?(this._end!=null,this._end=e):(this._start!=null,this._start=e)}),this._right=this._left=null,this._dir&&this._dir.value==="rtl"?(this._left=this._end,this._right=this._start):(this._left=this._start,this._right=this._end)}_isPushed(){return this._isDrawerOpen(this._start)&&this._start.mode!="over"||this._isDrawerOpen(this._end)&&this._end.mode!="over"}_onBackdropClicked(){this.backdropClick.emit(),this._closeModalDrawersViaBackdrop()}_closeModalDrawersViaBackdrop(){[this._start,this._end].filter(e=>e&&!e.disableClose&&this._drawerHasBackdrop(e)).forEach(e=>e._closeViaBackdropClick())}_isShowingBackdrop(){return this._isDrawerOpen(this._start)&&this._drawerHasBackdrop(this._start)||this._isDrawerOpen(this._end)&&this._drawerHasBackdrop(this._end)}_isDrawerOpen(e){return e!=null&&e.opened}_drawerHasBackdrop(e){return this._backdropOverride==null?!!e&&e.mode!=="side":this._backdropOverride}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["mat-drawer-container"]],contentQueries:function(i,n,r){if(i&1&&(Ct(r,hr,5),Ct(r,ca,5)),i&2){let a;H(a=W())&&(n._content=a.first),H(a=W())&&(n._allDrawers=a)}},viewQuery:function(i,n){if(i&1&&Q(hr,5),i&2){let r;H(r=W())&&(n._userContent=r.first)}},hostAttrs:[1,"mat-drawer-container"],hostVars:2,hostBindings:function(i,n){i&2&&E("mat-drawer-container-explicit-backdrop",n._backdropOverride)},inputs:{autosize:"autosize",hasBackdrop:"hasBackdrop"},outputs:{backdropClick:"backdropClick"},exportAs:["matDrawerContainer"],features:[qe([{provide:wd,useExisting:o}])],ngContentSelectors:zv,decls:4,vars:2,consts:[[1,"mat-drawer-backdrop",3,"mat-drawer-shown"],[1,"mat-drawer-backdrop",3,"click"]],template:function(i,n){i&1&&(Be(Vv),C(0,jv,1,2,"div",0),me(1),me(2,1),C(3,Bv,2,0,"mat-drawer-content")),i&2&&(x(n.hasBackdrop?0:-1),d(3),x(n._content?-1:3))},dependencies:[hr],styles:[`.mat-drawer-container{position:relative;z-index:1;color:var(--mat-sidenav-content-text-color, var(--mat-sys-on-background));background-color:var(--mat-sidenav-content-background-color, var(--mat-sys-background));box-sizing:border-box;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-container-has-open{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-container.ng-animate-disabled .mat-drawer-backdrop,.mat-drawer-container.ng-animate-disabled .mat-drawer-content,.ng-animate-disabled .mat-drawer-container .mat-drawer-backdrop,.ng-animate-disabled .mat-drawer-container .mat-drawer-content{transition:none}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible;background-color:var(--mat-sidenav-scrim-color, color-mix(in srgb, var(--mat-sys-neutral-variant20) 40%, transparent))}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:background-color,visibility}@media(forced-colors: active){.mat-drawer-backdrop{opacity:.5}}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-content.mat-drawer-content-hidden{opacity:0}.mat-drawer-transition .mat-drawer-content{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;color:var(--mat-sidenav-container-text-color, var(--mat-sys-on-surface-variant));box-shadow:var(--mat-sidenav-container-elevation-shadow, none);background-color:var(--mat-sidenav-container-background-color, var(--mat-sys-surface));border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));width:var(--mat-sidenav-container-width, 360px);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%, 0, 0)}@media(forced-colors: active){.mat-drawer,[dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}}@media(forced-colors: active){[dir=rtl] .mat-drawer,.mat-drawer.mat-drawer-end{border-left:solid 1px currentColor;border-right:none}}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%, 0, 0);border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .mat-drawer{border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer.mat-drawer-end{border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%, 0, 0)}.mat-drawer-transition .mat-drawer{transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating){visibility:hidden;box-shadow:none}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating) .mat-drawer-inner-container{display:none}.mat-drawer.mat-drawer-opened.mat-drawer-opened{transform:none}.mat-drawer-side{box-shadow:none;border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid}.mat-drawer-side.mat-drawer-end{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side.mat-drawer-end{border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid;border-left:none}.mat-drawer-inner-container{width:100%;height:100%;overflow:auto}.mat-sidenav-fixed{position:fixed}
|
|
365
|
-
`],encapsulation:2,changeDetection:0})}return o})(),dl=(()=>{class o extends hr{static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275cmp=T({type:o,selectors:[["mat-sidenav-content"]],hostAttrs:[1,"mat-drawer-content","mat-sidenav-content"],features:[qe([{provide:ln,useExisting:o}]),Mt],ngContentSelectors:ml,decls:1,vars:0,template:function(i,n){i&1&&(Be(),me(0))},encapsulation:2,changeDetection:0})}return o})(),Sd=(()=>{class o extends ca{get fixedInViewport(){return this._fixedInViewport}set fixedInViewport(e){this._fixedInViewport=Tt(e)}_fixedInViewport=!1;get fixedTopGap(){return this._fixedTopGap}set fixedTopGap(e){this._fixedTopGap=gi(e)}_fixedTopGap=0;get fixedBottomGap(){return this._fixedBottomGap}set fixedBottomGap(e){this._fixedBottomGap=gi(e)}_fixedBottomGap=0;static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275cmp=T({type:o,selectors:[["mat-sidenav"]],hostAttrs:[1,"mat-drawer","mat-sidenav"],hostVars:16,hostBindings:function(i,n){i&2&&(
|
|
366
|
-
`],encapsulation:2,changeDetection:0})}return o})(),Bu=(()=>{class o{_ngZone=m(de);_elementRef=m(ie);_ariaDescriber=m(Ua);_renderer=m(yt);_animationsDisabled=He();_idGenerator=m(Re);get color(){return this._color}set color(e){this._setColor(e),this._color=e}_color="primary";overlap=!0;disabled;position="above after";get content(){return this._content}set content(e){this._updateRenderedContent(e)}_content;get description(){return this._description}set description(e){this._updateDescription(e)}_description;size="medium";hidden;_badgeElement;_inlineBadgeDescription;_isInitialized=!1;_interactivityChecker=m(Po);_document=m(Je);constructor(){let e=m(Rt);e.load(Qv),e.load(Ba)}isAbove(){return this.position.indexOf("below")===-1}isAfter(){return this.position.indexOf("before")===-1}getBadgeElement(){return this._badgeElement}ngOnInit(){this._clearExistingBadges(),this.content&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement(),this._updateRenderedContent(this.content)),this._isInitialized=!0}ngOnDestroy(){this._renderer.destroyNode&&(this._renderer.destroyNode(this._badgeElement),this._inlineBadgeDescription?.remove()),this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description)}_isHostInteractive(){return this._interactivityChecker.isFocusable(this._elementRef.nativeElement,{ignoreVisibility:!0})}_createBadgeElement(){let e=this._renderer.createElement("span"),i="mat-badge-active";return e.setAttribute("id",this._idGenerator.getId("mat-badge-content-")),e.setAttribute("aria-hidden","true"),e.classList.add(ju),this._animationsDisabled&&e.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(e),typeof requestAnimationFrame=="function"&&!this._animationsDisabled?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{e.classList.add(i)})}):e.classList.add(i),e}_updateRenderedContent(e){let i=`${e??""}`.trim();this._isInitialized&&i&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=i),this._content=i}_updateDescription(e){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!e||this._isHostInteractive())&&this._removeInlineDescription(),this._description=e,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,e):this._updateInlineDescription()}_updateInlineDescription(){this._inlineBadgeDescription||(this._inlineBadgeDescription=this._document.createElement("span"),this._inlineBadgeDescription.classList.add("cdk-visually-hidden")),this._inlineBadgeDescription.textContent=this.description,this._badgeElement?.appendChild(this._inlineBadgeDescription)}_removeInlineDescription(){this._inlineBadgeDescription?.remove(),this._inlineBadgeDescription=void 0}_setColor(e){let i=this._elementRef.nativeElement.classList;i.remove(`mat-badge-${this._color}`),e&&i.add(`mat-badge-${e}`)}_clearExistingBadges(){let e=this._elementRef.nativeElement.querySelectorAll(`:scope > .${ju}`);for(let i of Array.from(e))i!==this._badgeElement&&i.remove()}static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(i,n){i&2&&E("mat-badge-overlap",n.overlap)("mat-badge-above",n.isAbove())("mat-badge-below",!n.isAbove())("mat-badge-before",!n.isAfter())("mat-badge-after",n.isAfter())("mat-badge-small",n.size==="small")("mat-badge-medium",n.size==="medium")("mat-badge-large",n.size==="large")("mat-badge-hidden",n.hidden||!n.content)("mat-badge-disabled",n.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",J],disabled:[2,"matBadgeDisabled","disabled",J],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",J]}})}return o})(),Hu=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({imports:[Oo,ae,ae]})}return o})();var ur=class o{ATTENTION_EMOJI="\u{1F534}";isSystemActive=!1;systemActiveTimer=null;SYSTEM_ACTIVE_TIMEOUT=4e3;unreadService=m(or);project=m(Se);constructor(){this.initializeTitleUpdates()}initializeTitleUpdates(){Gn([this.project.selectedProject$,this.unreadService.unreadCount$]).subscribe(([t,e])=>{this.updateTitle(t?.name??"...",e)})}updateTitle(t,e){let i;this.isSystemActive?i=`\u23F3${e>0?` (${e}) `:" "}${t}`:e>0?i=`${this.ATTENTION_EMOJI} (${e}) ${t}`:i=t,document.title=i,console.log("[TAB-TITLE] Updated to:",i)}setSystemActive(){console.log("[TAB-TITLE] System active - showing hourglass"),this.isSystemActive=!0,this.systemActiveTimer&&clearTimeout(this.systemActiveTimer),this.systemActiveTimer=setTimeout(()=>{console.log("[TAB-TITLE] System active timeout - hiding hourglass"),this.isSystemActive=!1,this.forceUpdateTitle()},this.SYSTEM_ACTIVE_TIMEOUT),this.forceUpdateTitle()}setSystemInactive(){console.log("[TAB-TITLE] System inactive - hiding hourglass"),this.isSystemActive=!1,this.systemActiveTimer&&(clearTimeout(this.systemActiveTimer),this.systemActiveTimer=null),this.forceUpdateTitle()}forceUpdateTitle(){let t=this.project.getSelectedProjectId()??"...",e=this.unreadService.getCurrentCount();this.updateTitle(t,e)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var hl=class o{http=m(Ye);maxFileSize=5*1024*1024;supportedTypes=["image/png","image/jpeg","image/gif","image/webp"];validateFile(t){if(!this.supportedTypes.includes(t.type))throw new Error(`Unsupported file type: ${t.type}`);if(t.size>this.maxFileSize)throw new Error(`File too large: ${(t.size/1024/1024).toFixed(1)}MB exceeds 5MB limit`)}fileToBase64(t){return ee(this,null,function*(){return new Promise((e,i)=>{let n=new FileReader;n.onload=()=>{let r=n.result;if(!r){i(new Error("Failed to read file"));return}let a=r.split(",")[1];if(!a){i(new Error("Invalid file format"));return}e(a)},n.onerror=i,n.readAsDataURL(t)})})}getUploadUrl(t,e){return`/api/projects/${t}/threads/${e}/upload`}uploadImage(t,e,i){console.log("[IMAGE-UPLOAD] uploadImage - file:",t.name,t.type,t.size),console.log("[IMAGE-UPLOAD] uploadImage - project:",e,"thread:",i);try{console.log("[IMAGE-UPLOAD] Validating file..."),this.validateFile(t)}catch(n){return console.log("[IMAGE-UPLOAD] Validation failed:",n),It({success:!1,error:n instanceof Error?n.message:"Validation failed"})}return new Oi(n=>{console.log("[IMAGE-UPLOAD] Converting to base64..."),this.fileToBase64(t).then(r=>{console.log("[IMAGE-UPLOAD] Base64 length:",r.length),console.log("[IMAGE-UPLOAD] Sending upload request..."),this.http.post(this.getUploadUrl(e,i),{content:r,mimeType:t.type,filename:t.name}).pipe(_e(a=>(console.log("[IMAGE-UPLOAD] Upload success result:",a),{success:!0,processedSize:a.processedSize,dimensions:a.dimensions})),wn(a=>{console.log("[IMAGE-UPLOAD] Upload failed:",a);let c=a.error?.error||a.message||"Upload failed";return It({success:!1,error:c})})).subscribe({next:a=>{n.next(a),n.complete()},error:a=>n.error(a)})}).catch(r=>{console.log("[IMAGE-UPLOAD] Base64 conversion failed:",r),n.next({success:!1,error:r instanceof Error?r.message:"Failed to read file"}),n.complete()})})}hasImageFiles(t){if(console.log("[IMAGE-UPLOAD] hasImageFiles - dataTransfer:",t),!t)return console.log("[IMAGE-UPLOAD] hasImageFiles - no dataTransfer"),!1;if(console.log("[IMAGE-UPLOAD] hasImageFiles - types:",Array.from(t.types)),!Array.from(t.types).includes("Files"))return console.log("[IMAGE-UPLOAD] hasImageFiles - no Files type"),!1;let e=Array.from(t.files||[]);console.log("[IMAGE-UPLOAD] hasImageFiles - files:",e.map(n=>({name:n.name,type:n.type})));let i=e.some(n=>this.supportedTypes.includes(n.type));return console.log("[IMAGE-UPLOAD] hasImageFiles - result:",i),i}filterImageFiles(t){return Array.from(t).filter(i=>this.supportedTypes.includes(i.type))}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var gr=class o{pendingFirstMessage=null;setPendingFirstMessage(t){console.log("[FIRST-MESSAGE-STATE] Storing pending first message:",t.substring(0,50)+"..."),this.pendingFirstMessage=t}consumePendingFirstMessage(){let t=this.pendingFirstMessage;return t?(console.log("[FIRST-MESSAGE-STATE] Consuming pending first message:",t.substring(0,50)+"..."),this.pendingFirstMessage=null):console.log("[FIRST-MESSAGE-STATE] No pending first message to consume"),t}hasPendingFirstMessage(){return this.pendingFirstMessage!==null}clear(){this.pendingFirstMessage&&(console.log("[FIRST-MESSAGE-STATE] Clearing pending first message"),this.pendingFirstMessage=null)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var fr=class o{http=m(Ye);usernameSubject=new le(null);username$=this.usernameSubject.asObservable();fetchCurrentUser(){return this.http.get("/api/user/me").pipe(vt(t=>{this.usernameSubject.next(t.username)}))}getUsername(){return this.usernameSubject.value}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var Kv=["inputSection"],Zv=()=>[];function Jv(o,t){if(o&1){let e=M();s(0,"button",20),_("click",function(){v(e);let n=u();return y(n.toggleFileDrawer())}),s(1,"mat-icon"),p(2,"folder_open"),l()()}if(o&2){let e=u();E("has-files",e.fileCount>0),w("title",Tn("Files Exchange",e.fileCount>0?" ("+e.fileCount+" file"+(e.fileCount>1?"s":"")+")":""))("matBadge",e.fileCount>0?e.fileCount:null)}}function ey(o,t){if(o&1){let e=M();s(0,"button",21),_("click",function(){v(e);let n=u();return y(n.toggleSharePanel())}),s(1,"mat-icon"),p(2,"group"),l()()}if(o&2){let e=u();E("has-shared-users",((e.threadDetails==null||e.threadDetails.users==null?null:e.threadDetails.users.length)??0)>1)}}function ty(o,t){if(o&1&&(s(0,"div",6),p(1),l()),o&2){let e=u();d(),Mn(" \u26A0\uFE0F Connection lost. Reconnecting... (",e.connectionStatus.reconnectAttempts,"/",e.connectionStatus.maxAttempts,") ")}}function iy(o,t){if(o&1&&(s(0,"div",22),p(1),l()),o&2){let e=u();E("error",e.uploadStatus.isError),d(),te(" ",e.uploadStatus.message," ")}}function ny(o,t){if(o&1){let e=M();s(0,"app-chat-textarea",23),_("messageSubmitted",function(n){v(e);let r=u();return y(r.onMessageSubmitted(n))})("voiceRecordingToggled",function(n){v(e);let r=u();return y(r.onVoiceToggled(n))})("heightChanged",function(n){v(e);let r=u();return y(r.onInputHeightChanged(n))})("stopRequested",function(){v(e);let n=u();return y(n.onStopRequested())})("filesPasted",function(n){v(e);let r=u();return y(r.onFilesPasted(n))}),l()}if(o&2){let e=u();w("isDisabled",!e.isConnected)("isSessionInitializing",!1)("showWelcome",!1)("isThinking",e.isThinking)("isStarting",!1)}}function oy(o,t){if(o&1){let e=M();s(0,"app-choice-select",24),_("choiceSelected",function(n){v(e);let r=u();return y(r.onChoiceSelected(n))}),l()}if(o&2){let e=u();w("options",e.currentChoice.options)("labelHtml",e.currentChoice.label)("isVisible",!!e.currentChoice)("allowFreeText",e.currentChoice.allowFreeText)}}function ry(o,t){if(o&1){let e=M();s(0,"app-file-exchange-drawer",25),_("closeDrawer",function(){v(e);let n=u();return y(n.closeDrawer())}),l()}if(o&2){let e=u();w("projectName",e.projectName)("threadId",e.threadId)}}function ay(o,t){if(o&1){let e=M();s(0,"div",18)(1,"div",26)(2,"h3",27),p(3,"Share"),l(),s(4,"button",28),_("click",function(){v(e);let n=u();return y(n.closeDrawer())}),s(5,"mat-icon"),p(6,"chevron_right"),l()()(),s(7,"app-thread-share",29),_("userAdded",function(n){v(e);let r=u();return y(r.onUserAdded(n))})("userRemoved",function(n){v(e);let r=u();return y(r.onUserRemoved(n))}),l()()}if(o&2){let e=u();d(7),w("threadId",e.threadId)("users",e.threadDetails.users||vm(4,Zv))("ownerUsername",e.threadDetails.username)("currentUsername",e.currentUsername)}}function sy(o,t){o&1&&(s(0,"div",19)(1,"div",30)(2,"div",31),p(3,"\u{1F4CE}"),l(),s(4,"div",32),p(5,"Drop files here to upload"),l(),s(6,"div",33),p(7,"Images will be added to conversation, other files to exchange space"),l()()())}var ul=class o{projectName;threadId;destroy$=new R;inputSection;messages=[];streamingText="";isThinking=!1;currentChoice=null;connectionStatus=null;isConnected=!1;showConnectionStatus=!1;hasEverConnected=!1;inputSectionHeight=80;uploadStatus={message:"",isError:!1};isDragOver=!1;drawerMode="none";get isDrawerOpen(){return this.drawerMode!=="none"}threadDetails=null;threadShareRef;get fileCount(){return this.fileExchangeState.fileCount()}get currentUsername(){return this.userService.getUsername()??""}pendingFirstMessage=null;subscriptions=[];codayService=m(Qt);preferencesService=m(nt);titleService=m(ur);elementRef=m(ie);threadState=m(Pt);userService=m(fr);imageUploadService=m(hl);fileExchangeState=m(ar);firstMessageState=m(gr);ngOnInit(){if(console.log("[THREAD] Initializing with project:",this.projectName,"thread:",this.threadId),!this.projectName||!this.threadId){console.error("[THREAD] Missing required inputs: projectName or threadId");return}this.setupPrintHandlers(),this.initializeThreadConnection()}ngOnChanges(t){console.log("[THREAD] ngOnChanges called",t),t.threadId&&(console.log("[THREAD] threadId changed:",{firstChange:t.threadId.firstChange,previousValue:t.threadId.previousValue,currentValue:t.threadId.currentValue}),t.threadId.firstChange||(console.log("[THREAD] Reconnecting to new thread"),this.initializeThreadConnection()))}initializeThreadConnection(){console.log("[THREAD] Initializing connection for thread:",this.threadId),this.fileExchangeState.initializeForThread(this.projectName,this.threadId),this.codayService.messages$.pipe(L(this.destroy$)).subscribe(e=>{console.log("[THREAD] Messages updated:",e.length),this.messages=e}),this.codayService.streamingText$.pipe(L(this.destroy$)).subscribe(e=>{this.streamingText=e}),this.codayService.isThinking$.pipe(L(this.destroy$)).subscribe(e=>{this.isThinking=e}),this.codayService.currentChoice$.pipe(L(this.destroy$)).subscribe(e=>{this.currentChoice=e}),this.codayService.connectionStatus$.pipe(L(this.destroy$)).subscribe(e=>{this.connectionStatus=e,this.isConnected=e.connected,e.connected&&!this.hasEverConnected&&(this.hasEverConnected=!0,this.showConnectionStatus=!0),!e.connected&&!this.hasEverConnected?setTimeout(()=>{!this.isConnected&&!this.hasEverConnected&&(this.showConnectionStatus=!0)},2e3):!e.connected&&this.hasEverConnected?this.showConnectionStatus=!0:e.connected&&(this.showConnectionStatus=!0)}),this.codayService.threadUpdateEvent$.pipe(L(this.destroy$)).subscribe(e=>{e&&(console.log("[THREAD] Thread update event received:",e),this.threadState.refreshThreadList())}),this.threadState.selectedThread$.pipe(L(this.destroy$)).subscribe(e=>{this.threadDetails=e}),this.codayService.resetMessages(),this.codayService.setTabTitleService(this.titleService),console.log("[THREAD] Connecting to thread event stream"),this.codayService.connectToThread(this.projectName,this.threadId);let t=this.firstMessageState.consumePendingFirstMessage();t?(console.log("[THREAD] First message pending:",t.substring(0,50)+"..."),this.pendingFirstMessage=t,this.codayService.setThinkingForPendingMessage(),this.subscribeToFirstInvite()):console.log("[THREAD] No first message found in state service")}ngAfterViewChecked(){if(this.inputSection?.nativeElement){let t=this.inputSection.nativeElement.offsetHeight;t!==this.inputSectionHeight&&t>0&&(this.inputSectionHeight=t)}}ngOnDestroy(){console.log("[THREAD] Destroying component"),this.destroy$.next(),this.destroy$.complete(),this.fileExchangeState.clear(),this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[],window.removeEventListener("beforeprint",this.handleBeforePrint),window.removeEventListener("afterprint",this.handleAfterPrint)}onMessageSubmitted(t){console.log("[THREAD] Sending message:",t),this.codayService.sendMessage(t)}onVoiceToggled(t){console.log("[VOICE] Recording:",t)}onChoiceSelected(t){console.log("[THREAD] Choice selected:",t),this.codayService.sendChoice(t)}onCopyMessage(t){console.log("[COPY] Message copied:",t.id)}onStopRequested(){this.threadState.stop()}onInputHeightChanged(t){console.log("[THREAD] Input height changed:",t),this.inputSectionHeight=t}onFilesPasted(t){console.log("[THREAD] File(s) pasted:",t.length);let e=this.imageUploadService.filterImageFiles(t),i=t.filter(n=>!n.type.startsWith("image/"));e.length&&this.uploadFilesSequentially(e,0),i.length&&this.uploadFilesToExchangeSpace(i),!e.length&&!i.length&&this.showUploadError("No supported files found")}toggleFileDrawer(){this.drawerMode=this.drawerMode==="files"?"none":"files"}toggleSharePanel(){this.drawerMode=this.drawerMode==="share"?"none":"share"}closeDrawer(){this.drawerMode="none"}onUserAdded(t){if(console.log("[THREAD] Adding user to thread:",t),!this.threadDetails)return;let e=this.threadDetails.users||[];if(e.some(n=>n.userId===t)){this.threadShareRef?.setError("User already has access to this thread");return}this.threadShareRef?.setAdding(!0);let i=[...e,{userId:t}];this.threadState.updateThreadUsers(this.threadId,i).pipe(L(this.destroy$)).subscribe({next:()=>{console.log("[THREAD] User added successfully"),this.threadShareRef?.setAdding(!1),this.threadState.refreshSelectedThread()},error:n=>{console.error("[THREAD] Error adding user:",n),this.threadShareRef?.setError(n?.error?.error||"Failed to add user")}})}onUserRemoved(t){if(console.log("[THREAD] Removing user from thread:",t),!this.threadDetails)return;let e=(this.threadDetails.users||[]).filter(i=>i.userId!==t);this.threadState.updateThreadUsers(this.threadId,e).pipe(L(this.destroy$)).subscribe({next:()=>{console.log("[THREAD] User removed successfully"),this.threadState.refreshSelectedThread()},error:i=>{console.error("[THREAD] Error removing user:",i)}})}onDragEnter(t){t.preventDefault(),t.dataTransfer?.types.includes("Files")&&(console.log("[THREAD] Image files detected - showing drag overlay"),this.isDragOver=!0)}onDragOver(t){t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="copy")}onDragLeave(t){this.elementRef.nativeElement.contains(t.relatedTarget)||(console.log("[THREAD] Leaving component area - hiding drag overlay"),this.isDragOver=!1)}onDrop(t){t.preventDefault(),this.isDragOver=!1,console.log("[THREAD] Files dropped:",t.dataTransfer?.files?.length||0);let e=t.dataTransfer?.files;if(!e||e.length===0){console.log("[THREAD] No files in drop event");return}let i=this.imageUploadService.filterImageFiles(e),n=Array.from(e).filter(r=>!r.type.startsWith("image/"));console.log("[THREAD] Image files:",i.length,"Other files:",n.length),i.length>0&&this.uploadFilesSequentially(i,0),n.length>0&&this.uploadFilesToExchangeSpace(n),i.length===0&&n.length===0&&this.showUploadError("No supported files found")}uploadFilesSequentially(t,e){if(e>=t.length)return;let i=t[e];if(!i){console.error("[THREAD] File at index",e,"is undefined");return}console.log("[THREAD] Uploading file:",i.name),this.uploadStatus={message:`Uploading ${i.name}...`,isError:!1},this.imageUploadService.uploadImage(i,this.projectName,this.threadId).subscribe({next:n=>{n.success?(console.log("[THREAD] Upload successful:",i.name),this.uploadStatus={message:`\u2713 ${i.name} uploaded (${(n.processedSize/1024).toFixed(1)} KB)`,isError:!1},setTimeout(()=>{this.uploadStatus.isError||(this.uploadStatus={message:"",isError:!1})},3e3),this.uploadFilesSequentially(t,e+1)):(console.error("[THREAD] Upload failed:",i.name,n.error),this.showUploadError(`Failed to upload ${i.name}: ${n.error}`))},error:n=>{console.error("[THREAD] Upload error:",i.name,n),this.showUploadError(`Failed to upload ${i.name}: ${n.message||"Unknown error"}`)}})}showUploadError(t){this.uploadStatus={message:t,isError:!0},setTimeout(()=>{this.uploadStatus={message:"",isError:!1}},5e3)}uploadFilesToExchangeSpace(t){return ee(this,null,function*(){for(let e of t){console.log("[THREAD] Uploading to exchange space:",e.name),this.uploadStatus={message:`Uploading ${e.name}...`,isError:!1};let i=yield this.fileExchangeState.uploadFile(e);if(i.success)console.log("[THREAD] Upload to exchange space successful:",e.name),this.uploadStatus={message:`\u2713 ${e.name} uploaded to exchange space`,isError:!1},setTimeout(()=>{this.uploadStatus.isError||(this.uploadStatus={message:"",isError:!1})},3e3);else{console.error("[THREAD] Upload to exchange space failed:",e.name,i.error),this.showUploadError(`Failed to upload ${e.name}: ${i.error}`);break}}})}subscribeToFirstInvite(){console.log("[THREAD] Subscribing to wait for InviteEvent"),this.subscriptions.push(this.codayService.currentInviteEvent$.subscribe(t=>{if(t&&this.pendingFirstMessage){console.log("[THREAD] Received InviteEvent, sending pending message");let e=this.pendingFirstMessage;this.pendingFirstMessage=null,this.codayService.sendMessage(e)}}))}setupPrintHandlers(){window.addEventListener("beforeprint",this.handleBeforePrint),window.addEventListener("afterprint",this.handleAfterPrint)}handleBeforePrint=()=>{console.log("[PRINT] Before print event triggered");let t=this.preferencesService.getPrintTechnicalMessages();console.log("[PRINT] Print technical messages:",t),t?document.body.classList.add("print-include-technical"):document.body.classList.remove("print-include-technical")};handleAfterPrint=()=>{console.log("[PRINT] After print event triggered"),document.body.classList.remove("print-include-technical")};static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-thread"]],viewQuery:function(e,i){if(e&1&&(Q(Kv,5),Q(la,5)),e&2){let n;H(n=W())&&(i.inputSection=n.first),H(n=W())&&(i.threadShareRef=n.first)}},inputs:{projectName:"projectName",threadId:"threadId"},features:[tt],decls:21,vars:14,consts:[["inputSection",""],[1,"drag-drop-wrapper",3,"dragenter","dragover","dragleave","drop"],[1,"file-drawer-container",3,"hasBackdrop"],[1,"thread-container"],["matFab","","type","button",1,"file-drawer-toggle-btn",3,"has-files","matBadge","title"],["matFab","","title","Share thread","type","button",1,"share-toggle-btn",3,"has-shared-users"],[1,"connection-status"],[1,"chat-wrapper"],[1,"chat-center"],[3,"copyRequested","stopRequested","messages","streamingText","isThinking"],[1,"upload-status",3,"error"],[1,"input-section"],[1,"input-center"],[1,"input-glass"],[3,"isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"],[1,"choice-overlay",3,"options","labelHtml","isVisible","allowFreeText"],["mode","side","position","end",3,"closed","opened"],[3,"projectName","threadId"],[1,"share-drawer-container"],[1,"drag-overlay"],["matFab","","type","button",1,"file-drawer-toggle-btn",3,"click","matBadge","title"],["matFab","","title","Share thread","type","button",1,"share-toggle-btn",3,"click"],[1,"upload-status"],[3,"messageSubmitted","voiceRecordingToggled","heightChanged","stopRequested","filesPasted","isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"],[1,"choice-overlay",3,"choiceSelected","options","labelHtml","isVisible","allowFreeText"],[3,"closeDrawer","projectName","threadId"],[1,"drawer-header"],[1,"drawer-title"],["mat-icon-button","","title","Close","type","button",1,"close-btn",3,"click"],[3,"userAdded","userRemoved","threadId","users","ownerUsername","currentUsername"],[1,"drag-overlay-content"],[1,"drag-icon"],[1,"drag-text"],[1,"drag-hint"]],template:function(e,i){if(e&1){let n=M();s(0,"div",1),_("dragenter",function(a){return v(n),y(i.onDragEnter(a))})("dragover",function(a){return v(n),y(i.onDragOver(a))})("dragleave",function(a){return v(n),y(i.onDragLeave(a))})("drop",function(a){return v(n),y(i.onDrop(a))}),s(1,"mat-drawer-container",2)(2,"mat-drawer-content")(3,"div",3),C(4,Jv,3,5,"button",4),C(5,ey,3,2,"button",5),C(6,ty,2,2,"div",6),s(7,"div",7)(8,"div",8)(9,"app-chat-history",9),_("copyRequested",function(a){return v(n),y(i.onCopyMessage(a))})("stopRequested",function(){return v(n),y(i.onStopRequested())}),l(),C(10,iy,2,3,"div",10),l()(),s(11,"div",11,0)(13,"div",12)(14,"div",13),C(15,ny,1,5,"app-chat-textarea",14),C(16,oy,1,4,"app-choice-select",15),l()()()()(),s(17,"mat-drawer",16),_("closed",function(){return v(n),y(i.closeDrawer())}),C(18,ry,1,2,"app-file-exchange-drawer",17),C(19,ay,8,5,"div",18),l()(),C(20,sy,8,0,"div",19),l()}e&2&&(d(),w("hasBackdrop",!1),d(3),x(i.drawerMode!=="files"?4:-1),d(),x(i.drawerMode!=="share"?5:-1),d(),x(i.showConnectionStatus&&i.connectionStatus&&!i.connectionStatus.connected?6:-1),d(3),w("messages",i.messages)("streamingText",i.streamingText)("isThinking",i.isThinking),d(),x(i.uploadStatus.message?10:-1),d(5),x(i.currentChoice?-1:15),d(),x(i.currentChoice?16:-1),d(),w("opened",i.isDrawerOpen),d(),x(i.drawerMode==="files"?18:-1),d(),x(i.drawerMode==="share"&&i.threadDetails?19:-1),d(),x(i.isDragOver?20:-1))},dependencies:[Zs,er,Go,sl,la,pl,ca,da,hr,Oe,he,it,Qe,Ga,Hu,Bu],styles:[".drag-drop-wrapper[_ngcontent-%COMP%]{height:100vh;width:100%;position:relative}.thread-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;width:100%;position:relative;background:transparent}.file-drawer-toggle-btn[_ngcontent-%COMP%]{position:fixed!important;top:1rem!important;right:1rem!important;z-index:100!important}.file-drawer-toggle-btn.has-files[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_pulse-subtle 3s infinite}.share-toggle-btn[_ngcontent-%COMP%]{position:fixed!important;top:5rem!important;right:1rem!important;z-index:100!important}.share-toggle-btn.has-shared-users[_ngcontent-%COMP%]{color:var(--color-primary)!important}.share-drawer-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);color:var(--color-text)}.share-drawer-container[_ngcontent-%COMP%] .drawer-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;border-bottom:1px solid var(--color-border);flex-shrink:0}.share-drawer-container[_ngcontent-%COMP%] .drawer-title[_ngcontent-%COMP%]{margin:0;font-size:1.25rem;font-weight:600;color:var(--color-text)}.share-drawer-container[_ngcontent-%COMP%] .close-btn[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.share-drawer-container[_ngcontent-%COMP%] .close-btn[_ngcontent-%COMP%]:hover{color:var(--color-text);background:var(--color-bg-hover)}@keyframes _ngcontent-%COMP%_pulse-subtle{0%,to{box-shadow:0 2px 8px #00000026}50%{box-shadow:0 4px 16px rgba(var(--color-primary-rgb, 25, 118, 210),.3)}}.file-drawer-container[_ngcontent-%COMP%]{height:100vh;width:100%;background:var(--color-bg)}.file-drawer-container[_ngcontent-%COMP%] .mat-drawer-content{display:flex;flex-direction:column;height:100%;overflow:hidden;background:transparent}.file-drawer-container[_ngcontent-%COMP%] .mat-drawer{width:35vw;max-width:90vw;box-shadow:-2px 0 8px #0000001a}@media (max-width: 768px){.file-drawer-container[_ngcontent-%COMP%] .mat-drawer{width:100vw;max-width:100vw}}.file-drawer-container[_ngcontent-%COMP%] .mat-drawer-backdrop{display:none}.connection-status[_ngcontent-%COMP%]{position:fixed;top:0;left:0;right:0;z-index:1000;background:var(--color-warning);color:var(--color-text);padding:.5rem 1rem;text-align:center;font-size:.9rem;box-shadow:0 2px 4px #0000001a}.chat-wrapper[_ngcontent-%COMP%]{flex:1;overflow-y:auto;overflow-x:hidden;display:flex;flex-direction:column;width:100%;padding:1rem 0}.chat-center[_ngcontent-%COMP%]{max-width:800px;width:100%;margin:0 auto;padding:0 1rem;display:flex;flex-direction:column;gap:1rem}.input-section[_ngcontent-%COMP%]{width:100%;padding:1rem 0;background:transparent;position:relative}.input-center[_ngcontent-%COMP%]{max-width:800px;width:100%;margin:0 auto;padding:0 1rem}.input-glass[_ngcontent-%COMP%]{position:relative;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border-color);border-radius:12px;box-shadow:var(--glass-shadow);padding:1rem;min-height:60px}@media (max-width: 768px){.input-glass[_ngcontent-%COMP%]{border-radius:8px;padding:.75rem}}.choice-overlay[_ngcontent-%COMP%]{display:block;width:100%}.upload-status[_ngcontent-%COMP%]{padding:.75rem 1rem;border-radius:8px;background:var(--color-success-light);color:var(--color-text);font-size:.9rem;text-align:center}.upload-status.error[_ngcontent-%COMP%]{background:var(--color-error-light)}@media print{.file-drawer-toggle-btn[_ngcontent-%COMP%], .share-toggle-btn[_ngcontent-%COMP%], .connection-status[_ngcontent-%COMP%]{display:none}.thread-container[_ngcontent-%COMP%]{background:#fff}.input-section[_ngcontent-%COMP%]{display:none}}"]})};var Wu=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({imports:[ae,ae]})}return o})();var Uu=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({imports:[ae]})}return o})();var Qi=class o{http=m(Ye);getUserConfig(){return this.http.get("/api/config/user").pipe(vt(t=>console.log("[CONFIG-API] User config retrieved:",t)))}updateUserConfig(t){return this.http.put("/api/config/user",t).pipe(vt(e=>console.log("[CONFIG-API] User config updated:",e)))}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var _r=class o{currentThemeSubject=new le("light");currentTheme$=this.currentThemeSubject.asObservable();preferences=m(nt);constructor(){console.log("[THEME] Initializing theme service"),this.initializeTheme(),this.setupSystemThemeListener()}initializeTheme(){let t=this.preferences.getPreference("theme","light")??"light";console.log("[THEME] Loaded saved theme:",t),this.applyTheme(t),setTimeout(()=>{let e=this.preferences.getPreference("theme","light")??"light";e!==t&&(console.log("[THEME] Theme updated after async load:",e),this.applyTheme(e))},100)}setTheme(t){this.preferences.setPreference("theme",t),this.applyTheme(t)}getCurrentTheme(){return this.currentThemeSubject.value}applyTheme(t){if(console.log("[THEME] Applying theme:",t),this.currentThemeSubject.next(t),t==="system")if(typeof window<"u"&&window.matchMedia){let i=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";console.log("[THEME] System theme resolved to:",i),this.setDocumentTheme(i)}else console.log("[THEME] matchMedia not available, defaulting to light theme"),this.setDocumentTheme("light");else this.setDocumentTheme(t)}setDocumentTheme(t){console.log("[THEME] Setting document theme to:",t),typeof document<"u"&&document.documentElement&&(t==="dark"?document.documentElement.setAttribute("data-theme","dark"):document.documentElement.removeAttribute("data-theme"))}setupSystemThemeListener(){typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{this.getCurrentTheme()==="system"&&this.setDocumentTheme(t.matches?"dark":"light")})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var ly=["mat-internal-form-field",""],cy=["*"],gl=(()=>{class o{labelPosition;static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["div","mat-internal-form-field",""]],hostAttrs:[1,"mdc-form-field","mat-internal-form-field"],hostVars:2,hostBindings:function(i,n){i&2&&E("mdc-form-field--align-end",n.labelPosition==="before")},inputs:{labelPosition:"labelPosition"},attrs:ly,ngContentSelectors:cy,decls:1,vars:0,template:function(i,n){i&1&&(Be(),me(0))},styles:[`.mat-internal-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;vertical-align:middle}.mat-internal-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mat-internal-form-field>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end .mdc-form-field--align-end label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0}
|
|
367
|
-
`],encapsulation:2,changeDetection:0})}return o})();var dy=["switch"],my=["*"];function py(o,t){o&1&&(s(0,"span",11),en(),s(1,"svg",13),A(2,"path",14),l(),s(3,"svg",15),A(4,"path",16),l()())}var hy=new ne("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1,hideIcon:!1,disabledInteractive:!1})}),fl=class{source;checked;constructor(t,e){this.source=t,this.checked=e}},uo=(()=>{class o{_elementRef=m(ie);_focusMonitor=m(Ri);_changeDetectorRef=m(Ge);defaults=m(hy);_onChange=e=>{};_onTouched=()=>{};_validatorOnChange=()=>{};_uniqueId;_checked=!1;_createChangeEvent(e){return new fl(this,e)}_labelId;get buttonId(){return`${this.id||this._uniqueId}-button`}_switchElement;focus(){this._switchElement.nativeElement.focus()}_noopAnimations=He();_focused;name=null;id;labelPosition="after";ariaLabel=null;ariaLabelledby=null;ariaDescribedby;required;color;disabled=!1;disableRipple=!1;tabIndex=0;get checked(){return this._checked}set checked(e){this._checked=e,this._changeDetectorRef.markForCheck()}hideIcon;disabledInteractive;change=new U;toggleChange=new U;get inputId(){return`${this.id||this._uniqueId}-input`}constructor(){m(Rt).load(In);let e=m(new En("tabindex"),{optional:!0}),i=this.defaults;this.tabIndex=e==null?0:parseInt(e)||0,this.color=i.color||"accent",this.id=this._uniqueId=m(Re).getId("mat-mdc-slide-toggle-"),this.hideIcon=i.hideIcon??!1,this.disabledInteractive=i.disabledInteractive??!1,this._labelId=this._uniqueId+"-label"}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(e=>{e==="keyboard"||e==="program"?(this._focused=!0,this._changeDetectorRef.markForCheck()):e||Promise.resolve().then(()=>{this._focused=!1,this._onTouched(),this._changeDetectorRef.markForCheck()})})}ngOnChanges(e){e.required&&this._validatorOnChange()}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}writeValue(e){this.checked=!!e}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}validate(e){return this.required&&e.value!==!0?{required:!0}:null}registerOnValidatorChange(e){this._validatorOnChange=e}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck()}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(this._createChangeEvent(this.checked))}_handleClick(){this.disabled||(this.toggleChange.emit(),this.defaults.disableToggleValue||(this.checked=!this.checked,this._onChange(this.checked),this.change.emit(new fl(this,this.checked))))}_getAriaLabelledBy(){return this.ariaLabelledby?this.ariaLabelledby:this.ariaLabel?null:this._labelId}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["mat-slide-toggle"]],viewQuery:function(i,n){if(i&1&&Q(dy,5),i&2){let r;H(r=W())&&(n._switchElement=r.first)}},hostAttrs:[1,"mat-mdc-slide-toggle"],hostVars:13,hostBindings:function(i,n){i&2&&(Zt("id",n.id),X("tabindex",null)("aria-label",null)("name",null)("aria-labelledby",null),tn(n.color?"mat-"+n.color:""),E("mat-mdc-slide-toggle-focused",n._focused)("mat-mdc-slide-toggle-checked",n.checked)("_mat-animation-noopable",n._noopAnimations))},inputs:{name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],required:[2,"required","required",J],color:"color",disabled:[2,"disabled","disabled",J],disableRipple:[2,"disableRipple","disableRipple",J],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:ui(e)],checked:[2,"checked","checked",J],hideIcon:[2,"hideIcon","hideIcon",J],disabledInteractive:[2,"disabledInteractive","disabledInteractive",J]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[qe([{provide:Do,useExisting:Qn(()=>o),multi:!0},{provide:Ya,useExisting:o,multi:!0}]),tt],ngContentSelectors:my,decls:14,vars:27,consts:[["switch",""],["mat-internal-form-field","",3,"labelPosition"],["role","switch","type","button",1,"mdc-switch",3,"click","tabIndex","disabled"],[1,"mat-mdc-slide-toggle-touch-target"],[1,"mdc-switch__track"],[1,"mdc-switch__handle-track"],[1,"mdc-switch__handle"],[1,"mdc-switch__shadow"],[1,"mdc-elevation-overlay"],[1,"mdc-switch__ripple"],["mat-ripple","",1,"mat-mdc-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-switch__icons"],[1,"mdc-label",3,"click","for"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--on"],["d","M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--off"],["d","M20 13H4v-2h16v2z"]],template:function(i,n){if(i&1){let r=M();Be(),s(0,"div",1)(1,"button",2,0),_("click",function(){return v(r),y(n._handleClick())}),A(3,"div",3)(4,"span",4),s(5,"span",5)(6,"span",6)(7,"span",7),A(8,"span",8),l(),s(9,"span",9),A(10,"span",10),l(),C(11,py,5,0,"span",11),l()()(),s(12,"label",12),_("click",function(c){return v(r),y(c.stopPropagation())}),me(13),l()()}if(i&2){let r=Jt(2);w("labelPosition",n.labelPosition),d(),E("mdc-switch--selected",n.checked)("mdc-switch--unselected",!n.checked)("mdc-switch--checked",n.checked)("mdc-switch--disabled",n.disabled)("mat-mdc-slide-toggle-disabled-interactive",n.disabledInteractive),w("tabIndex",n.disabled&&!n.disabledInteractive?-1:n.tabIndex)("disabled",n.disabled&&!n.disabledInteractive),X("id",n.buttonId)("name",n.name)("aria-label",n.ariaLabel)("aria-labelledby",n._getAriaLabelledBy())("aria-describedby",n.ariaDescribedby)("aria-required",n.required||null)("aria-checked",n.checked)("aria-disabled",n.disabled&&n.disabledInteractive?"true":null),d(9),w("matRippleTrigger",r)("matRippleDisabled",n.disableRipple||n.disabled)("matRippleCentered",!0),d(),x(n.hideIcon?-1:11),d(),w("for",n.buttonId),X("id",n._labelId)}},dependencies:[An,gl],styles:[`.mdc-switch{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;flex-shrink:0;margin:0;outline:none;overflow:visible;padding:0;position:relative;width:var(--mat-slide-toggle-track-width, 52px)}.mdc-switch.mdc-switch--disabled{cursor:default;pointer-events:none}.mdc-switch.mat-mdc-slide-toggle-disabled-interactive{pointer-events:auto}.mdc-switch__track{overflow:hidden;position:relative;width:100%;height:var(--mat-slide-toggle-track-height, 32px);border-radius:var(--mat-slide-toggle-track-shape, var(--mat-sys-corner-full))}.mdc-switch--disabled.mdc-switch .mdc-switch__track{opacity:var(--mat-slide-toggle-disabled-track-opacity, 0.12)}.mdc-switch__track::before,.mdc-switch__track::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";height:100%;left:0;position:absolute;width:100%;border-width:var(--mat-slide-toggle-track-outline-width, 2px);border-color:var(--mat-slide-toggle-track-outline-color, var(--mat-sys-outline))}.mdc-switch--selected .mdc-switch__track::before,.mdc-switch--selected .mdc-switch__track::after{border-width:var(--mat-slide-toggle-selected-track-outline-width, 2px);border-color:var(--mat-slide-toggle-selected-track-outline-color, transparent)}.mdc-switch--disabled .mdc-switch__track::before,.mdc-switch--disabled .mdc-switch__track::after{border-width:var(--mat-slide-toggle-disabled-unselected-track-outline-width, 2px);border-color:var(--mat-slide-toggle-disabled-unselected-track-outline-color, var(--mat-sys-on-surface))}@media(forced-colors: active){.mdc-switch__track{border-color:currentColor}}.mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:translateX(0);background:var(--mat-slide-toggle-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1);transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch--selected .mdc-switch__track::before{transform:translateX(-100%)}.mdc-switch--selected .mdc-switch__track::before{opacity:var(--mat-slide-toggle-hidden-track-opacity, 0);transition:var(--mat-slide-toggle-hidden-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::before{opacity:var(--mat-slide-toggle-visible-track-opacity, 1);transition:var(--mat-slide-toggle-visible-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-hover-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-focus-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:active .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-pressed-track-color, var(--mat-sys-surface-variant))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::before,.mdc-switch.mdc-switch--disabled .mdc-switch__track::before{background:var(--mat-slide-toggle-disabled-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch__track::after{transform:translateX(-100%);background:var(--mat-slide-toggle-selected-track-color, var(--mat-sys-primary))}[dir=rtl] .mdc-switch__track::after{transform:translateX(100%)}.mdc-switch--selected .mdc-switch__track::after{transform:translateX(0)}.mdc-switch--selected .mdc-switch__track::after{opacity:var(--mat-slide-toggle-visible-track-opacity, 1);transition:var(--mat-slide-toggle-visible-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::after{opacity:var(--mat-slide-toggle-hidden-track-opacity, 0);transition:var(--mat-slide-toggle-hidden-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-hover-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-focus-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:active .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-pressed-track-color, var(--mat-sys-primary))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::after,.mdc-switch.mdc-switch--disabled .mdc-switch__track::after{background:var(--mat-slide-toggle-disabled-selected-track-color, var(--mat-sys-on-surface))}.mdc-switch__handle-track{height:100%;pointer-events:none;position:absolute;top:0;transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);left:0;right:auto;transform:translateX(0);width:calc(100% - var(--mat-slide-toggle-handle-width))}[dir=rtl] .mdc-switch__handle-track{left:auto;right:0}.mdc-switch--selected .mdc-switch__handle-track{transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch__handle-track{transform:translateX(-100%)}.mdc-switch__handle{display:flex;pointer-events:auto;position:absolute;top:50%;transform:translateY(-50%);left:0;right:auto;transition:width 75ms cubic-bezier(0.4, 0, 0.2, 1),height 75ms cubic-bezier(0.4, 0, 0.2, 1),margin 75ms cubic-bezier(0.4, 0, 0.2, 1);width:var(--mat-slide-toggle-handle-width);height:var(--mat-slide-toggle-handle-height);border-radius:var(--mat-slide-toggle-handle-shape, var(--mat-sys-corner-full))}[dir=rtl] .mdc-switch__handle{left:auto;right:0}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle{width:var(--mat-slide-toggle-unselected-handle-size, 16px);height:var(--mat-slide-toggle-unselected-handle-size, 16px);margin:var(--mat-slide-toggle-unselected-handle-horizontal-margin, 0 8px)}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-slide-toggle-unselected-with-icon-handle-horizontal-margin, 0 4px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle{width:var(--mat-slide-toggle-selected-handle-size, 24px);height:var(--mat-slide-toggle-selected-handle-size, 24px);margin:var(--mat-slide-toggle-selected-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-slide-toggle-selected-with-icon-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch__handle:has(.mdc-switch__icons){width:var(--mat-slide-toggle-with-icon-handle-size, 24px);height:var(--mat-slide-toggle-with-icon-handle-size, 24px)}.mat-mdc-slide-toggle .mdc-switch:active:not(.mdc-switch--disabled) .mdc-switch__handle{width:var(--mat-slide-toggle-pressed-handle-size, 28px);height:var(--mat-slide-toggle-pressed-handle-size, 28px)}.mat-mdc-slide-toggle .mdc-switch--selected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-slide-toggle-selected-pressed-handle-horizontal-margin, 0 22px)}.mat-mdc-slide-toggle .mdc-switch--unselected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-slide-toggle-unselected-pressed-handle-horizontal-margin, 0 2px)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__handle::after{opacity:var(--mat-slide-toggle-disabled-selected-handle-opacity, 1)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__handle::after{opacity:var(--mat-slide-toggle-disabled-unselected-handle-opacity, 0.38)}.mdc-switch__handle::before,.mdc-switch__handle::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";width:100%;height:100%;left:0;position:absolute;top:0;transition:background-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1),border-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);z-index:-1}@media(forced-colors: active){.mdc-switch__handle::before,.mdc-switch__handle::after{border-color:currentColor}}.mdc-switch--selected:enabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-handle-color, var(--mat-sys-on-primary))}.mdc-switch--selected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-hover-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-focus-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:active .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-pressed-handle-color, var(--mat-sys-primary-container))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:hover:not(:focus):not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:focus:not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:active .mdc-switch__handle::after,.mdc-switch--selected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-disabled-selected-handle-color, var(--mat-sys-surface))}.mdc-switch--unselected:enabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-handle-color, var(--mat-sys-outline))}.mdc-switch--unselected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-hover-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-focus-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:active .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-pressed-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-disabled-unselected-handle-color, var(--mat-sys-on-surface))}.mdc-switch__handle::before{background:var(--mat-slide-toggle-handle-surface-color)}.mdc-switch__shadow{border-radius:inherit;bottom:0;left:0;position:absolute;right:0;top:0}.mdc-switch:enabled .mdc-switch__shadow{box-shadow:var(--mat-slide-toggle-handle-elevation-shadow)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__shadow,.mdc-switch.mdc-switch--disabled .mdc-switch__shadow{box-shadow:var(--mat-slide-toggle-disabled-handle-elevation-shadow)}.mdc-switch__ripple{left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);z-index:-1;width:var(--mat-slide-toggle-state-layer-size, 40px);height:var(--mat-slide-toggle-state-layer-size, 40px)}.mdc-switch__ripple::after{content:"";opacity:0}.mdc-switch--disabled .mdc-switch__ripple::after{display:none}.mat-mdc-slide-toggle-disabled-interactive .mdc-switch__ripple::after{display:block}.mdc-switch:hover .mdc-switch__ripple::after{transition:75ms opacity cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:focus .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:active .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:hover:not(:focus) .mdc-switch__ripple::after,.mdc-switch--unselected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-hover-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mdc-switch--unselected:enabled:focus .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-focus-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-switch--unselected:enabled:active .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-pressed-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch--selected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-hover-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mdc-switch--selected:enabled:focus .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-focus-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-switch--selected:enabled:active .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-pressed-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch__icons{position:relative;height:100%;width:100%;z-index:1;transform:translateZ(0)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__icons{opacity:var(--mat-slide-toggle-disabled-unselected-icon-opacity, 0.38)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__icons{opacity:var(--mat-slide-toggle-disabled-selected-icon-opacity, 0.38)}.mdc-switch__icon{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;opacity:0;transition:opacity 30ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-switch--unselected .mdc-switch__icon{width:var(--mat-slide-toggle-unselected-icon-size, 16px);height:var(--mat-slide-toggle-unselected-icon-size, 16px);fill:var(--mat-slide-toggle-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mat-slide-toggle-disabled-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__icon{width:var(--mat-slide-toggle-selected-icon-size, 16px);height:var(--mat-slide-toggle-selected-icon-size, 16px);fill:var(--mat-slide-toggle-selected-icon-color, var(--mat-sys-on-primary-container))}.mdc-switch--selected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mat-slide-toggle-disabled-selected-icon-color, var(--mat-sys-on-surface))}.mdc-switch--selected .mdc-switch__icon--on,.mdc-switch--unselected .mdc-switch__icon--off{opacity:1;transition:opacity 45ms 30ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle{-webkit-user-select:none;user-select:none;display:inline-block;-webkit-tap-highlight-color:rgba(0,0,0,0);outline:0}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple,.mat-mdc-slide-toggle .mdc-switch__ripple::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple:not(:empty),.mat-mdc-slide-toggle .mdc-switch__ripple::after:not(:empty){transform:translateZ(0)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mat-focus-indicator::before{content:""}.mat-mdc-slide-toggle .mat-internal-form-field{color:var(--mat-slide-toggle-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-slide-toggle-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-slide-toggle-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-slide-toggle-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-slide-toggle-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-slide-toggle-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-slide-toggle .mat-ripple-element{opacity:.12}.mat-mdc-slide-toggle .mat-focus-indicator::before{border-radius:50%}.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle-track,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__icon,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::after,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::after{transition:none}.mat-mdc-slide-toggle .mdc-switch:enabled+.mdc-label{cursor:pointer}.mat-mdc-slide-toggle .mdc-switch--disabled+label{color:var(--mat-slide-toggle-disabled-label-text-color, var(--mat-sys-on-surface))}.mat-mdc-slide-toggle-touch-target{position:absolute;top:50%;left:50%;height:var(--mat-slide-toggle-touch-target-size, 48px);width:100%;transform:translate(-50%, -50%);display:var(--mat-slide-toggle-touch-target-display, block)}[dir=rtl] .mat-mdc-slide-toggle-touch-target{left:auto;right:50%;transform:translate(50%, -50%)}
|
|
368
|
-
`],encapsulation:2,changeDetection:0})}return o})(),_l=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({imports:[uo,ae,ae]})}return o})();var uy=(o,t)=>t.code,gy=(o,t)=>t.name+t.lang;function fy(o,t){o&1&&(s(0,"div",15)(1,"mat-icon",32),p(2,"warning"),l(),s(3,"span",33),p(4," Browser notifications have been blocked. To enable them, please reset the site permissions in your browser settings. "),l()())}function _y(o,t){if(o&1&&(s(0,"option",18),p(1),l()),o&2){let e=t.$implicit;w("value",e.code),d(),Mn("",e.flag," ",e.label)}}function by(o,t){o&1&&(s(0,"option",25),p(1,"Loading voices..."),l())}function vy(o,t){o&1&&(s(0,"option",25),p(1,"No voice available"),l())}function yy(o,t){if(o&1&&(s(0,"option",18),p(1),l()),o&2){let e=t.$implicit;w("value",e.name+"|"+e.lang),d(),te(" ",e.displayName," ")}}var ma=class o{destroy$=new R;selectedTheme="light";selectedVoiceLanguage="en-US";useEnterToSend=!1;printTechnicalMessages=!1;showTechnicalMessages=!0;showWarningMessages=!0;voiceAnnounceEnabled=!1;voiceMode="speech";voiceReadFullText=!1;voiceVolume=80;voiceRate=120;agentNotificationEnabled=!1;notificationSoundEnabled=!0;browserNotificationEnabled=!1;browserNotificationDenied=!1;availableVoices=[];selectedVoiceId=null;loadingVoices=!1;voiceLanguageOptions=[{code:"fr-FR",label:"Fran\xE7ais",flag:"\u{1F1EB}\u{1F1F7}"},{code:"en-US",label:"English (US)",flag:"\u{1F1FA}\u{1F1F8}"},{code:"en-GB",label:"English (UK)",flag:"\u{1F1EC}\u{1F1E7}"},{code:"es-ES",label:"Espa\xF1ol",flag:"\u{1F1EA}\u{1F1F8}"},{code:"de-DE",label:"Deutsch",flag:"\u{1F1E9}\u{1F1EA}"},{code:"it-IT",label:"Italiano",flag:"\u{1F1EE}\u{1F1F9}"},{code:"pt-BR",label:"Portugu\xEAs",flag:"\u{1F1E7}\u{1F1F7}"},{code:"ja-JP",label:"\u65E5\u672C\u8A9E",flag:"\u{1F1EF}\u{1F1F5}"},{code:"ko-KR",label:"\uD55C\uAD6D\uC5B4",flag:"\u{1F1F0}\u{1F1F7}"},{code:"zh-CN",label:"\u4E2D\u6587 (\u7B80\u4F53)",flag:"\u{1F1E8}\u{1F1F3}"},{code:"ru-RU",label:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",flag:"\u{1F1F7}\u{1F1FA}"},{code:"ar-SA",label:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",flag:"\u{1F1F8}\u{1F1E6}"}];preferencesService=m(nt);voiceSynthesisService=m(rr);themeService=m(_r);ngOnInit(){this.selectedTheme=this.themeService.getCurrentTheme(),this.selectedVoiceLanguage=this.preferencesService.getVoiceLanguage(),this.useEnterToSend=this.preferencesService.getEnterToSend(),this.printTechnicalMessages=this.preferencesService.getPrintTechnicalMessages(),this.showTechnicalMessages=!this.preferencesService.getHideTechnicalMessages(),this.showWarningMessages=!this.preferencesService.getHideWarningMessages(),this.voiceAnnounceEnabled=this.preferencesService.getVoiceAnnounceEnabled(),this.voiceMode=this.preferencesService.getVoiceMode(),this.voiceReadFullText=this.preferencesService.getVoiceReadFullText(),this.voiceVolume=Math.round(this.preferencesService.getVoiceVolume()*100),this.voiceRate=Math.round(this.preferencesService.getVoiceRate()*100),this.selectedVoiceId=this.preferencesService.getSelectedVoice(),this.agentNotificationEnabled=this.preferencesService.getAgentNotificationEnabled(),this.notificationSoundEnabled=this.preferencesService.getNotificationSoundEnabled(),this.browserNotificationEnabled=this.preferencesService.getBrowserNotificationEnabled(),this.loadAvailableVoices(),this.themeService.currentTheme$.pipe(L(this.destroy$)).subscribe(t=>{this.selectedTheme=t}),this.preferencesService.voiceLanguage$.pipe(L(this.destroy$)).subscribe(t=>{this.selectedVoiceLanguage=t}),this.preferencesService.enterToSend$.pipe(L(this.destroy$)).subscribe(t=>{this.useEnterToSend=t}),this.preferencesService.printTechnicalMessages$.pipe(L(this.destroy$)).subscribe(t=>{this.printTechnicalMessages=t}),this.preferencesService.hideTechnicalMessages$.pipe(L(this.destroy$)).subscribe(t=>{this.showTechnicalMessages=!t}),this.preferencesService.hideWarningMessages$.pipe(L(this.destroy$)).subscribe(t=>{this.showWarningMessages=!t}),this.preferencesService.voiceAnnounceEnabled$.pipe(L(this.destroy$)).subscribe(t=>{this.voiceAnnounceEnabled=t}),this.preferencesService.voiceMode$.pipe(L(this.destroy$)).subscribe(t=>{this.voiceMode=t}),this.preferencesService.voiceReadFullText$.pipe(L(this.destroy$)).subscribe(t=>{this.voiceReadFullText=t}),this.preferencesService.voiceVolume$.pipe(L(this.destroy$)).subscribe(t=>{this.voiceVolume=Math.round(t*100)}),this.preferencesService.voiceRate$.pipe(L(this.destroy$)).subscribe(t=>{this.voiceRate=Math.round(t*100)}),this.preferencesService.selectedVoice$.pipe(L(this.destroy$)).subscribe(t=>{this.selectedVoiceId=t}),this.preferencesService.voiceLanguage$.pipe(L(this.destroy$)).subscribe(()=>{this.loadAvailableVoices()}),this.preferencesService.agentNotificationEnabled$.pipe(L(this.destroy$)).subscribe(t=>{this.agentNotificationEnabled=t}),this.preferencesService.notificationSoundEnabled$.pipe(L(this.destroy$)).subscribe(t=>{this.notificationSoundEnabled=t}),this.preferencesService.browserNotificationEnabled$.pipe(L(this.destroy$)).subscribe(t=>{this.browserNotificationEnabled=t,this.checkNotificationPermission()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}onThemeChange(){console.log("[OPTIONS] Theme changed to:",this.selectedTheme),this.themeService.setTheme(this.selectedTheme)}onVoiceLanguageChange(){console.log("[OPTIONS] Voice language changed to:",this.selectedVoiceLanguage),this.preferencesService.setVoiceLanguage(this.selectedVoiceLanguage)}onEnterToSendChange(){console.log("[OPTIONS] Enter to send changed to:",this.useEnterToSend),this.preferencesService.setEnterToSend(this.useEnterToSend)}onPrintTechnicalMessagesChange(){console.log("[OPTIONS] Print technical messages changed to:",this.printTechnicalMessages),this.preferencesService.setPrintTechnicalMessages(this.printTechnicalMessages)}onShowTechnicalMessagesChange(){let t=!this.showTechnicalMessages;console.log("[OPTIONS] Show technical messages changed to:",this.showTechnicalMessages,"(hide:",t,")"),this.preferencesService.setHideTechnicalMessages(t)}onShowWarningMessagesChange(){let t=!this.showWarningMessages;console.log("[OPTIONS] Show warning messages changed to:",this.showWarningMessages,"(hide:",t,")"),this.preferencesService.setHideWarningMessages(t)}onVoiceAnnounceEnabledChange(){console.log("[OPTIONS] Voice announce enabled changed to:",this.voiceAnnounceEnabled),this.preferencesService.setVoiceAnnounceEnabled(this.voiceAnnounceEnabled)}onVoiceModeChange(){console.log("[OPTIONS] Voice mode changed to:",this.voiceMode),this.preferencesService.setVoiceMode(this.voiceMode)}onVoiceReadFullTextChange(){console.log("[OPTIONS] Voice read full text changed to:",this.voiceReadFullText),this.preferencesService.setVoiceReadFullText(this.voiceReadFullText)}onVoiceVolumeChange(){let t=this.voiceVolume/100;console.log("[OPTIONS] Voice volume changed to:",t),this.preferencesService.setVoiceVolume(t)}onVoiceRateChange(){let t=this.voiceRate/100;console.log("[OPTIONS] Voice rate changed to:",t),this.preferencesService.setVoiceRate(t)}loadAvailableVoices(){return ee(this,null,function*(){this.loadingVoices=!0;try{this.availableVoices=yield this.voiceSynthesisService.getVoicesForLanguage(),console.log("[OPTIONS] Loaded",this.availableVoices.length,"voices for current language")}catch(t){console.error("[OPTIONS] Error loading voices:",t),this.availableVoices=[]}finally{this.loadingVoices=!1}})}onSelectedVoiceChange(){console.log("[OPTIONS] Selected voice changed to:",this.selectedVoiceId),this.preferencesService.setSelectedVoice(this.selectedVoiceId)}testVoice(){console.log("[OPTIONS] Testing voice with current settings"),this.voiceSynthesisService.testSelectedVoice()}onAgentNotificationEnabledChange(){console.log("[OPTIONS] Agent notification enabled changed to:",this.agentNotificationEnabled),this.preferencesService.setAgentNotificationEnabled(this.agentNotificationEnabled)}onNotificationSoundEnabledChange(){console.log("[OPTIONS] Notification sound enabled changed to:",this.notificationSoundEnabled),this.preferencesService.setNotificationSoundEnabled(this.notificationSoundEnabled)}onBrowserNotificationEnabledChange(){console.log("[OPTIONS] Browser notification enabled changed to:",this.browserNotificationEnabled),this.preferencesService.setBrowserNotificationEnabled(this.browserNotificationEnabled)}checkNotificationPermission(){"Notification"in window&&(this.browserNotificationDenied=Notification.permission==="denied",console.log("[OPTIONS] Notification permission status:",Notification.permission))}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-options-panel"]],decls:144,vars:35,consts:[[1,"options-content"],[1,"option-section"],[1,"section-title"],[1,"option-group"],[1,"radio-group"],[1,"option-radio"],["type","radio","name","theme","value","light",3,"ngModelChange","change","ngModel"],[1,"radio-mark"],["type","radio","name","theme","value","dark",3,"ngModelChange","change","ngModel"],["type","radio","name","theme","value","system",3,"ngModelChange","change","ngModel"],[1,"option-label"],["type","radio","name","enterBehavior",3,"ngModelChange","change","value","ngModel"],[1,"toggle-option"],["color","primary",3,"ngModelChange","change","ngModel"],["color","primary",3,"ngModelChange","change","ngModel","disabled"],[1,"notification-error"],["for","voice-language-select",1,"option-label"],["id","voice-language-select",1,"option-select",3,"ngModelChange","change","ngModel"],[3,"value"],["type","radio","name","voiceAnnounce",3,"ngModelChange","change","value","ngModel"],["type","radio","name","voiceMode","value","speech",3,"ngModelChange","change","ngModel"],["type","radio","name","voiceMode","value","notification",3,"ngModelChange","change","ngModel"],["type","radio","name","voiceReadFull",3,"ngModelChange","change","value","ngModel"],["for","voice-select",1,"option-label"],["id","voice-select",1,"option-select",3,"ngModelChange","change","ngModel","disabled"],["value",""],["role","button","tabindex","0","title","Test voice with current settings",1,"test-voice-link",3,"click"],[1,"thread-name"],["for","voice-volume-slider",1,"option-label"],["id","voice-volume-slider","type","range","min","0","max","100","step","5",1,"option-slider",3,"ngModelChange","input","ngModel"],["for","voice-rate-slider",1,"option-label"],["id","voice-rate-slider","type","range","min","50","max","200","step","10",1,"option-slider",3,"ngModelChange","input","ngModel"],[1,"error-icon"],[1,"error-message"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"mat-icon"),p(4,"palette"),l(),s(5,"span"),p(6,"Appearance"),l()(),s(7,"div",3)(8,"div",4)(9,"label",5)(10,"input",6),B("ngModelChange",function(r){return j(i.selectedTheme,r)||(i.selectedTheme=r),r}),_("change",function(){return i.onThemeChange()}),l(),A(11,"span",7),p(12," Light "),l(),s(13,"label",5)(14,"input",8),B("ngModelChange",function(r){return j(i.selectedTheme,r)||(i.selectedTheme=r),r}),_("change",function(){return i.onThemeChange()}),l(),A(15,"span",7),p(16," Dark "),l(),s(17,"label",5)(18,"input",9),B("ngModelChange",function(r){return j(i.selectedTheme,r)||(i.selectedTheme=r),r}),_("change",function(){return i.onThemeChange()}),l(),A(19,"span",7),p(20," System "),l()()()(),s(21,"div",1)(22,"div",2)(23,"mat-icon"),p(24,"chat_bubble_outline"),l(),s(25,"span"),p(26,"Messaging"),l()(),s(27,"div",3)(28,"span",10),p(29,"Send message behavior:"),l(),s(30,"div",4)(31,"label",5)(32,"input",11),B("ngModelChange",function(r){return j(i.useEnterToSend,r)||(i.useEnterToSend=r),r}),_("change",function(){return i.onEnterToSendChange()}),l(),A(33,"span",7),p(34," Enter to send "),l(),s(35,"label",5)(36,"input",11),B("ngModelChange",function(r){return j(i.useEnterToSend,r)||(i.useEnterToSend=r),r}),_("change",function(){return i.onEnterToSendChange()}),l(),A(37,"span",7),p(38," Enter for new line "),l()()(),s(39,"div",3)(40,"div",12)(41,"span",10),p(42,"Show technical messages"),l(),s(43,"mat-slide-toggle",13),B("ngModelChange",function(r){return j(i.showTechnicalMessages,r)||(i.showTechnicalMessages=r),r}),_("change",function(){return i.onShowTechnicalMessagesChange()}),l()()(),s(44,"div",3)(45,"div",12)(46,"span",10),p(47,"Show warning messages"),l(),s(48,"mat-slide-toggle",13),B("ngModelChange",function(r){return j(i.showWarningMessages,r)||(i.showWarningMessages=r),r}),_("change",function(){return i.onShowWarningMessagesChange()}),l()()(),s(49,"div",3)(50,"div",12)(51,"span",10),p(52,"Include technical messages in print"),l(),s(53,"mat-slide-toggle",13),B("ngModelChange",function(r){return j(i.printTechnicalMessages,r)||(i.printTechnicalMessages=r),r}),_("change",function(){return i.onPrintTechnicalMessagesChange()}),l()()()(),s(54,"div",1)(55,"div",2)(56,"mat-icon"),p(57,"notifications"),l(),s(58,"span"),p(59,"Notifications"),l()(),s(60,"div",3)(61,"div",12)(62,"span",10),p(63,"Notify when the agent answers or requests input"),l(),s(64,"mat-slide-toggle",13),B("ngModelChange",function(r){return j(i.agentNotificationEnabled,r)||(i.agentNotificationEnabled=r),r}),_("change",function(){return i.onAgentNotificationEnabledChange()}),l()()(),s(65,"div",3)(66,"div",12)(67,"span",10),p(68,"Notification sound"),l(),s(69,"mat-slide-toggle",14),B("ngModelChange",function(r){return j(i.notificationSoundEnabled,r)||(i.notificationSoundEnabled=r),r}),_("change",function(){return i.onNotificationSoundEnabledChange()}),l()()(),s(70,"div",3)(71,"div",12)(72,"span",10),p(73,"Browser notification"),l(),s(74,"mat-slide-toggle",14),B("ngModelChange",function(r){return j(i.browserNotificationEnabled,r)||(i.browserNotificationEnabled=r),r}),_("change",function(){return i.onBrowserNotificationEnabledChange()}),l()(),C(75,fy,5,0,"div",15),l()(),s(76,"div",1)(77,"div",2)(78,"mat-icon"),p(79,"record_voice_over"),l(),s(80,"span"),p(81,"Voice & Speech"),l()(),s(82,"div",3)(83,"label",16),p(84,"Voice recognition language:"),l(),s(85,"select",17),B("ngModelChange",function(r){return j(i.selectedVoiceLanguage,r)||(i.selectedVoiceLanguage=r),r}),_("change",function(){return i.onVoiceLanguageChange()}),xe(86,_y,2,3,"option",18,uy),l()(),s(88,"div",3)(89,"span",10),p(90,"Automatic announcement:"),l(),s(91,"div",4)(92,"label",5)(93,"input",19),B("ngModelChange",function(r){return j(i.voiceAnnounceEnabled,r)||(i.voiceAnnounceEnabled=r),r}),_("change",function(){return i.onVoiceAnnounceEnabledChange()}),l(),A(94,"span",7),p(95," Enabled "),l(),s(96,"label",5)(97,"input",19),B("ngModelChange",function(r){return j(i.voiceAnnounceEnabled,r)||(i.voiceAnnounceEnabled=r),r}),_("change",function(){return i.onVoiceAnnounceEnabledChange()}),l(),A(98,"span",7),p(99," Disabled "),l()()(),s(100,"div",3)(101,"span",10),p(102,"Voice mode:"),l(),s(103,"div",4)(104,"label",5)(105,"input",20),B("ngModelChange",function(r){return j(i.voiceMode,r)||(i.voiceMode=r),r}),_("change",function(){return i.onVoiceModeChange()}),l(),A(106,"span",7),p(107," Voice synthesis "),l(),s(108,"label",5)(109,"input",21),B("ngModelChange",function(r){return j(i.voiceMode,r)||(i.voiceMode=r),r}),_("change",function(){return i.onVoiceModeChange()}),l(),A(110,"span",7),p(111," Sound notification "),l()()(),s(112,"div",3)(113,"span",10),p(114,"Message reading:"),l(),s(115,"div",4)(116,"label",5)(117,"input",22),B("ngModelChange",function(r){return j(i.voiceReadFullText,r)||(i.voiceReadFullText=r),r}),_("change",function(){return i.onVoiceReadFullTextChange()}),l(),A(118,"span",7),p(119," Full message "),l(),s(120,"label",5)(121,"input",22),B("ngModelChange",function(r){return j(i.voiceReadFullText,r)||(i.voiceReadFullText=r),r}),_("change",function(){return i.onVoiceReadFullTextChange()}),l(),A(122,"span",7),p(123," First paragraphs only "),l()()(),s(124,"div",3)(125,"label",23),p(126,"Selected voice:"),l(),s(127,"select",24),B("ngModelChange",function(r){return j(i.selectedVoiceId,r)||(i.selectedVoiceId=r),r}),_("change",function(){return i.onSelectedVoiceChange()}),C(128,by,2,0,"option",25),C(129,vy,2,0,"option",25),xe(130,yy,2,2,"option",18,gy),l(),A(132,"div",10),s(133,"a",26),_("click",function(){return i.testVoice()}),s(134,"span",27),p(135,"Test voice"),l()()(),s(136,"div",3)(137,"label",28),p(138),l(),s(139,"input",29),B("ngModelChange",function(r){return j(i.voiceVolume,r)||(i.voiceVolume=r),r}),_("input",function(){return i.onVoiceVolumeChange()}),l()(),s(140,"div",3)(141,"label",30),p(142),l(),s(143,"input",31),B("ngModelChange",function(r){return j(i.voiceRate,r)||(i.voiceRate=r),r}),_("input",function(){return i.onVoiceRateChange()}),l()()()()),e&2&&(d(10),z("ngModel",i.selectedTheme),d(4),z("ngModel",i.selectedTheme),d(4),z("ngModel",i.selectedTheme),d(14),w("value",!0),z("ngModel",i.useEnterToSend),d(4),w("value",!1),z("ngModel",i.useEnterToSend),d(7),z("ngModel",i.showTechnicalMessages),d(5),z("ngModel",i.showWarningMessages),d(5),z("ngModel",i.printTechnicalMessages),d(11),z("ngModel",i.agentNotificationEnabled),d(5),z("ngModel",i.notificationSoundEnabled),w("disabled",!i.agentNotificationEnabled),d(5),z("ngModel",i.browserNotificationEnabled),w("disabled",!i.agentNotificationEnabled||i.browserNotificationDenied),d(),x(i.browserNotificationDenied?75:-1),d(10),z("ngModel",i.selectedVoiceLanguage),d(),we(i.voiceLanguageOptions),d(7),w("value",!0),z("ngModel",i.voiceAnnounceEnabled),d(4),w("value",!1),z("ngModel",i.voiceAnnounceEnabled),d(8),z("ngModel",i.voiceMode),d(4),z("ngModel",i.voiceMode),d(8),w("value",!0),z("ngModel",i.voiceReadFullText),d(4),w("value",!1),z("ngModel",i.voiceReadFullText),d(6),z("ngModel",i.selectedVoiceId),w("disabled",i.loadingVoices||i.availableVoices.length===0),d(),x(i.loadingVoices?128:-1),d(),x(!i.loadingVoices&&i.availableVoices.length===0?129:-1),d(),we(i.availableVoices),d(8),te("Volume: ",i.voiceVolume,"%"),d(),z("ngModel",i.voiceVolume),d(3),te("Speed: ",i.voiceRate,"%"),d(),z("ngModel",i.voiceRate))},dependencies:[je,es,ts,Le,Um,$m,Ro,Ve,ze,he,uo],styles:['.options-content[_ngcontent-%COMP%]{padding:0;width:100%}.option-group[_ngcontent-%COMP%]{padding:0 1rem 1rem;margin-bottom:1rem;border-bottom:1px solid var(--color-border-light)}.option-group[_ngcontent-%COMP%]:last-child{margin-bottom:0;padding-bottom:0;border-bottom:none}.option-label[_ngcontent-%COMP%]{display:block;margin-bottom:.5rem;font-weight:500;color:var(--color-text);font-size:.875rem}.toggle-option[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:1rem}.toggle-option[_ngcontent-%COMP%] .option-label[_ngcontent-%COMP%]{margin-bottom:0;flex:1}.toggle-option[_ngcontent-%COMP%] mat-slide-toggle[_ngcontent-%COMP%]{flex-shrink:0}.option-select[_ngcontent-%COMP%]{width:100%;padding:.5rem;border:1px solid var(--color-border);border-radius:4px;background:var(--color-input-bg);color:var(--color-text);font-size:.875rem;cursor:pointer}.option-select[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary);box-shadow:0 0 0 3px #7064fb1a}.option-select[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.option-select[_ngcontent-%COMP%] option[_ngcontent-%COMP%]{padding:.5rem}.option-checkbox[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;font-size:.875rem;color:var(--color-text);-webkit-user-select:none;user-select:none}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{display:none}.option-checkbox[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]{width:18px;height:18px;border:2px solid var(--color-border);border-radius:3px;margin-right:.75rem;display:flex;align-items:center;justify-content:center;transition:all .2s ease;flex-shrink:0}.option-checkbox[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]:after{content:"";width:10px;height:6px;border-left:2px solid transparent;border-bottom:2px solid transparent;transform:rotate(-45deg);transition:all .2s ease;opacity:0}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + .checkmark[_ngcontent-%COMP%]{background-color:var(--color-primary);border-color:var(--color-primary)}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + .checkmark[_ngcontent-%COMP%]:after{border-left-color:#fff;border-bottom-color:#fff;opacity:1}.option-checkbox[_ngcontent-%COMP%]:hover .checkmark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-checkbox[_ngcontent-%COMP%]:focus-within .checkmark[_ngcontent-%COMP%]{box-shadow:0 0 0 3px #7064fb1a}.option-section[_ngcontent-%COMP%]{padding-top:1rem;margin-top:1rem;border-top:2px solid var(--color-border)}.option-section[_ngcontent-%COMP%]:first-child{border-top:none;padding-top:0;margin-top:0}.section-title[_ngcontent-%COMP%]{margin:0 0 1rem;padding:0 1rem;font-size:.9rem;font-weight:600;color:var(--color-text);display:flex;align-items:center;gap:.5rem}.section-title[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.option-radio[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;font-size:.875rem;color:var(--color-text);-webkit-user-select:none;user-select:none}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{display:none}.option-radio[_ngcontent-%COMP%] .radio-mark[_ngcontent-%COMP%]{width:16px;height:16px;border:2px solid var(--color-border);border-radius:50%;margin-right:.5rem;display:flex;align-items:center;justify-content:center;transition:all .2s ease;flex-shrink:0;position:relative}.option-radio[_ngcontent-%COMP%] .radio-mark[_ngcontent-%COMP%]:after{content:"";width:8px;height:8px;border-radius:50%;background-color:var(--color-primary);transition:all .2s ease;opacity:0;transform:scale(0)}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + .radio-mark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + .radio-mark[_ngcontent-%COMP%]:after{opacity:1;transform:scale(1)}.option-radio[_ngcontent-%COMP%]:hover .radio-mark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-radio[_ngcontent-%COMP%]:focus-within .radio-mark[_ngcontent-%COMP%]{box-shadow:0 0 0 3px #7064fb1a}.option-slider[_ngcontent-%COMP%]{width:100%;height:6px;border-radius:3px;background:var(--color-bg-solid);outline:none;cursor:pointer;-webkit-appearance:none;appearance:none}.option-slider[_ngcontent-%COMP%]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;border-radius:50%;background:var(--color-primary);cursor:pointer;border:2px solid white;box-shadow:0 2px 6px #0003;transition:all .2s ease}.option-slider[_ngcontent-%COMP%]::-webkit-slider-thumb:hover{transform:scale(1.1);box-shadow:0 2px 8px #0000004d}.option-slider[_ngcontent-%COMP%]::-moz-range-thumb{width:20px;height:20px;border-radius:50%;background:var(--color-primary);cursor:pointer;border:2px solid white;box-shadow:0 2px 6px #0003;transition:all .2s ease}.option-slider[_ngcontent-%COMP%]::-moz-range-thumb:hover{transform:scale(1.1);box-shadow:0 2px 8px #0000004d}.option-slider[_ngcontent-%COMP%]::-webkit-slider-track{height:6px;border-radius:3px;background:var(--color-bg-secondary)}.option-slider[_ngcontent-%COMP%]::-moz-range-track{height:6px;border-radius:3px;background:var(--color-bg-secondary);border:none}.option-slider[_ngcontent-%COMP%]:focus{outline:none}.option-slider[_ngcontent-%COMP%]:focus::-webkit-slider-thumb{box-shadow:0 0 0 3px #7064fb4d,0 2px 6px #0003}.option-slider[_ngcontent-%COMP%]:focus::-moz-range-thumb{box-shadow:0 0 0 3px #7064fb4d,0 2px 6px #0003}.test-voice-btn[_ngcontent-%COMP%]{width:100%;padding:.75rem 1rem;background:var(--color-primary);color:#fff;border:none;border-radius:6px;font-size:.875rem;font-weight:500;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;justify-content:center;gap:.5rem}.test-voice-btn[_ngcontent-%COMP%]:hover{background:var(--color-primary-hover);transform:translateY(-1px);box-shadow:0 2px 8px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:active{transform:translateY(0);box-shadow:0 1px 4px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:focus{outline:none;box-shadow:0 0 0 3px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:disabled{background:var(--color-bg-secondary);color:var(--color-text-secondary);cursor:not-allowed;transform:none;box-shadow:none}.test-voice-link[_ngcontent-%COMP%]{text-decoration-thickness:1.5px;text-underline-offset:3px;background:transparent;border:none;padding:0;font-size:.775rem;font-weight:400;cursor:pointer;transition:all .2s ease;display:inline-flex;align-items:center;justify-content:center;gap:.5rem;text-decoration:underline}.test-voice-link[_ngcontent-%COMP%]:hover{color:var(--color-primary-hover, var(--color-primary));text-decoration-thickness:2px}.test-voice-link[_ngcontent-%COMP%]:active{opacity:.8}.test-voice-link[_ngcontent-%COMP%]:focus{outline:2px solid var(--color-primary);outline-offset:2px}.test-voice-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.notification-error[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem;padding:.75rem;margin-top:.75rem;background-color:#d32f2f1a;border:1px solid rgba(211,47,47,.3);border-radius:6px;font-size:.8125rem;line-height:1.5}.notification-error[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{color:#d32f2f;font-size:20px;width:20px;height:20px;flex-shrink:0;margin-top:2px}.notification-error[_ngcontent-%COMP%] .error-message[_ngcontent-%COMP%]{color:var(--color-text);flex:1}.notification-error[_ngcontent-%COMP%]{margin-top:.75rem;padding:.75rem;background-color:#f443361a;border:1px solid rgba(244,67,54,.3);border-radius:6px;display:flex;align-items:flex-start;gap:.5rem}.notification-error[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{color:#f44336;font-size:20px;width:20px;height:20px;flex-shrink:0;margin-top:2px}.notification-error[_ngcontent-%COMP%] .error-message[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-text);line-height:1.5;flex:1}']})};var Cy=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["ng-component"]],hostAttrs:["cdk-text-field-style-loader",""],decls:0,vars:0,template:function(i,n){},styles:[`textarea.cdk-textarea-autosize{resize:none}textarea.cdk-textarea-autosize-measuring{padding:2px 0 !important;box-sizing:content-box !important;height:auto !important;overflow:hidden !important}textarea.cdk-textarea-autosize-measuring-firefox{padding:2px 0 !important;box-sizing:content-box !important;height:0 !important}@keyframes cdk-text-field-autofill-start{/*!*/}@keyframes cdk-text-field-autofill-end{/*!*/}.cdk-text-field-autofill-monitored:-webkit-autofill{animation:cdk-text-field-autofill-start 0s 1ms}.cdk-text-field-autofill-monitored:not(:-webkit-autofill){animation:cdk-text-field-autofill-end 0s 1ms}
|
|
369
|
-
`],encapsulation:2,changeDetection:0})}return o})(),xy={passive:!0},qu=(()=>{class o{_platform=m(et);_ngZone=m(de);_renderer=m(pi).createRenderer(null,null);_styleLoader=m(Rt);_monitoredElements=new Map;constructor(){}monitor(e){if(!this._platform.isBrowser)return nm;this._styleLoader.load(Cy);let i=Dr(e),n=this._monitoredElements.get(i);if(n)return n.subject;let r=new R,a="cdk-text-field-autofilled",c=g=>{g.animationName==="cdk-text-field-autofill-start"&&!i.classList.contains(a)?(i.classList.add(a),this._ngZone.run(()=>r.next({target:g.target,isAutofilled:!0}))):g.animationName==="cdk-text-field-autofill-end"&&i.classList.contains(a)&&(i.classList.remove(a),this._ngZone.run(()=>r.next({target:g.target,isAutofilled:!1})))},h=this._ngZone.runOutsideAngular(()=>(i.classList.add("cdk-text-field-autofill-monitored"),this._renderer.listen(i,"animationstart",c,xy)));return this._monitoredElements.set(i,{subject:r,unlisten:h}),r}stopMonitoring(e){let i=Dr(e),n=this._monitoredElements.get(i);n&&(n.unlisten(),n.subject.complete(),i.classList.remove("cdk-text-field-autofill-monitored"),i.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(i))}ngOnDestroy(){this._monitoredElements.forEach((e,i)=>this.stopMonitoring(i))}static \u0275fac=function(i){return new(i||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var Gu=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({})}return o})();var Yu=new ne("MAT_INPUT_VALUE_ACCESSOR");var kd=class{_box;_destroyed=new R;_resizeSubject=new R;_resizeObserver;_elementObservables=new Map;constructor(t){this._box=t,typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(e=>this._resizeSubject.next(e)))}observe(t){return this._elementObservables.has(t)||this._elementObservables.set(t,new Oi(e=>{let i=this._resizeSubject.subscribe(e);return this._resizeObserver?.observe(t,{box:this._box}),()=>{this._resizeObserver?.unobserve(t),i.unsubscribe(),this._elementObservables.delete(t)}}).pipe(ce(e=>e.some(i=>i.target===t)),Mr({bufferSize:1,refCount:!0}),L(this._destroyed))),this._elementObservables.get(t)}destroy(){this._destroyed.next(),this._destroyed.complete(),this._resizeSubject.complete(),this._elementObservables.clear()}},Qu=(()=>{class o{_cleanupErrorListener;_observers=new Map;_ngZone=m(de);constructor(){typeof ResizeObserver<"u"}ngOnDestroy(){for(let[,e]of this._observers)e.destroy();this._observers.clear(),this._cleanupErrorListener?.()}observe(e,i){let n=i?.box||"content-box";return this._observers.has(n)||this._observers.set(n,new kd(n)),this._observers.get(n).observe(e)}static \u0275fac=function(i){return new(i||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var wy=["notch"],Sy=["matFormFieldNotchedOutline",""],ky=["*"],Xu=["iconPrefixContainer"],Ku=["textPrefixContainer"],Zu=["iconSuffixContainer"],Ju=["textSuffixContainer"],My=["textField"],Ty=["*",[["mat-label"]],[["","matPrefix",""],["","matIconPrefix",""]],[["","matTextPrefix",""]],[["","matTextSuffix",""]],[["","matSuffix",""],["","matIconSuffix",""]],[["mat-error"],["","matError",""]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],Ey=["*","mat-label","[matPrefix], [matIconPrefix]","[matTextPrefix]","[matTextSuffix]","[matSuffix], [matIconSuffix]","mat-error, [matError]","mat-hint:not([align='end'])","mat-hint[align='end']"];function Py(o,t){o&1&&A(0,"span",21)}function Oy(o,t){if(o&1&&(s(0,"label",20),me(1,1),C(2,Py,1,0,"span",21),l()),o&2){let e=u(2);w("floating",e._shouldLabelFloat())("monitorResize",e._hasOutline())("id",e._labelId),X("for",e._control.disableAutomaticLabeling?null:e._control.id),d(2),x(!e.hideRequiredMarker&&e._control.required?2:-1)}}function Ay(o,t){if(o&1&&C(0,Oy,3,5,"label",20),o&2){let e=u();x(e._hasFloatingLabel()?0:-1)}}function Iy(o,t){o&1&&A(0,"div",7)}function Dy(o,t){}function Ry(o,t){if(o&1&&$e(0,Dy,0,0,"ng-template",13),o&2){u(2);let e=Jt(1);w("ngTemplateOutlet",e)}}function Fy(o,t){if(o&1&&(s(0,"div",9),C(1,Ry,1,1,null,13),l()),o&2){let e=u();w("matFormFieldNotchedOutlineOpen",e._shouldLabelFloat()),d(),x(e._forceDisplayInfixLabel()?-1:1)}}function Ny(o,t){o&1&&(s(0,"div",10,2),me(2,2),l())}function Ly(o,t){o&1&&(s(0,"div",11,3),me(2,3),l())}function Vy(o,t){}function zy(o,t){if(o&1&&$e(0,Vy,0,0,"ng-template",13),o&2){u();let e=Jt(1);w("ngTemplateOutlet",e)}}function jy(o,t){o&1&&(s(0,"div",14,4),me(2,4),l())}function By(o,t){o&1&&(s(0,"div",15,5),me(2,5),l())}function Hy(o,t){o&1&&A(0,"div",16)}function Wy(o,t){o&1&&(s(0,"div",18),me(1,6),l())}function Uy(o,t){if(o&1&&(s(0,"mat-hint",22),p(1),l()),o&2){let e=u(2);w("id",e._hintLabelId),d(),F(e.hintLabel)}}function $y(o,t){if(o&1&&(s(0,"div",19),C(1,Uy,2,2,"mat-hint",22),me(2,7),A(3,"div",23),me(4,8),l()),o&2){let e=u();d(),x(e.hintLabel?1:-1)}}var zt=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["mat-label"]]})}return o})(),qy=new ne("MatError");var yn=(()=>{class o{align="start";id=m(Re).getId("mat-mdc-hint-");static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["mat-hint"]],hostAttrs:[1,"mat-mdc-form-field-hint","mat-mdc-form-field-bottom-align"],hostVars:4,hostBindings:function(i,n){i&2&&(Zt("id",n.id),X("align",null),E("mat-mdc-form-field-hint-end",n.align==="end"))},inputs:{align:"align",id:"id"}})}return o})(),ag=new ne("MatPrefix"),go=(()=>{class o{set _isTextSelector(e){this._isText=!0}_isText=!1;static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["","matPrefix",""],["","matIconPrefix",""],["","matTextPrefix",""]],inputs:{_isTextSelector:[0,"matTextPrefix","_isTextSelector"]},features:[qe([{provide:ag,useExisting:o}])]})}return o})(),Gy=new ne("MatSuffix");var sg=new ne("FloatingLabelParent"),eg=(()=>{class o{_elementRef=m(ie);get floating(){return this._floating}set floating(e){this._floating=e,this.monitorResize&&this._handleResize()}_floating=!1;get monitorResize(){return this._monitorResize}set monitorResize(e){this._monitorResize=e,this._monitorResize?this._subscribeToResize():this._resizeSubscription.unsubscribe()}_monitorResize=!1;_resizeObserver=m(Qu);_ngZone=m(de);_parent=m(sg);_resizeSubscription=new Pi;constructor(){}ngOnDestroy(){this._resizeSubscription.unsubscribe()}getWidth(){return Yy(this._elementRef.nativeElement)}get element(){return this._elementRef.nativeElement}_handleResize(){setTimeout(()=>this._parent._handleLabelResized())}_subscribeToResize(){this._resizeSubscription.unsubscribe(),this._ngZone.runOutsideAngular(()=>{this._resizeSubscription=this._resizeObserver.observe(this._elementRef.nativeElement,{box:"border-box"}).subscribe(()=>this._handleResize())})}static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["label","matFormFieldFloatingLabel",""]],hostAttrs:[1,"mdc-floating-label","mat-mdc-floating-label"],hostVars:2,hostBindings:function(i,n){i&2&&E("mdc-floating-label--float-above",n.floating)},inputs:{floating:"floating",monitorResize:"monitorResize"}})}return o})();function Yy(o){let t=o;if(t.offsetParent!==null)return t.scrollWidth;let e=t.cloneNode(!0);e.style.setProperty("position","absolute"),e.style.setProperty("transform","translate(-9999px, -9999px)"),document.documentElement.appendChild(e);let i=e.scrollWidth;return e.remove(),i}var tg="mdc-line-ripple--active",bl="mdc-line-ripple--deactivating",ig=(()=>{class o{_elementRef=m(ie);_cleanupTransitionEnd;constructor(){let e=m(de),i=m(yt);e.runOutsideAngular(()=>{this._cleanupTransitionEnd=i.listen(this._elementRef.nativeElement,"transitionend",this._handleTransitionEnd)})}activate(){let e=this._elementRef.nativeElement.classList;e.remove(bl),e.add(tg)}deactivate(){this._elementRef.nativeElement.classList.add(bl)}_handleTransitionEnd=e=>{let i=this._elementRef.nativeElement.classList,n=i.contains(bl);e.propertyName==="opacity"&&n&&i.remove(tg,bl)};ngOnDestroy(){this._cleanupTransitionEnd()}static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["div","matFormFieldLineRipple",""]],hostAttrs:[1,"mdc-line-ripple"]})}return o})(),ng=(()=>{class o{_elementRef=m(ie);_ngZone=m(de);open=!1;_notch;ngAfterViewInit(){let e=this._elementRef.nativeElement,i=e.querySelector(".mdc-floating-label");i?(e.classList.add("mdc-notched-outline--upgraded"),typeof requestAnimationFrame=="function"&&(i.style.transitionDuration="0s",this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>i.style.transitionDuration="")}))):e.classList.add("mdc-notched-outline--no-label")}_setNotchWidth(e){let i=this._notch.nativeElement;!this.open||!e?i.style.width="":i.style.width=`calc(${e}px * var(--mat-mdc-form-field-floating-label-scale, 0.75) + 9px)`}_setMaxWidth(e){this._notch.nativeElement.style.setProperty("--mat-form-field-notch-max-width",`calc(100% - ${e}px)`)}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["div","matFormFieldNotchedOutline",""]],viewQuery:function(i,n){if(i&1&&Q(wy,5),i&2){let r;H(r=W())&&(n._notch=r.first)}},hostAttrs:[1,"mdc-notched-outline"],hostVars:2,hostBindings:function(i,n){i&2&&E("mdc-notched-outline--notched",n.open)},inputs:{open:[0,"matFormFieldNotchedOutlineOpen","open"]},attrs:Sy,ngContentSelectors:ky,decls:5,vars:0,consts:[["notch",""],[1,"mat-mdc-notch-piece","mdc-notched-outline__leading"],[1,"mat-mdc-notch-piece","mdc-notched-outline__notch"],[1,"mat-mdc-notch-piece","mdc-notched-outline__trailing"]],template:function(i,n){i&1&&(Be(),Zn(0,"div",1),ii(1,"div",2,0),me(3),ni(),Zn(4,"div",3))},encapsulation:2,changeDetection:0})}return o})(),pa=(()=>{class o{value;stateChanges;id;placeholder;ngControl;focused;empty;shouldLabelFloat;required;disabled;errorState;controlType;autofilled;userAriaDescribedBy;disableAutomaticLabeling;describedByIds;static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o})}return o})();var ha=new ne("MatFormField"),Qy=new ne("MAT_FORM_FIELD_DEFAULT_OPTIONS"),og="fill",Xy="auto",rg="fixed",Ky="translateY(-50%)",jt=(()=>{class o{_elementRef=m(ie);_changeDetectorRef=m(Ge);_platform=m(et);_idGenerator=m(Re);_ngZone=m(de);_defaults=m(Qy,{optional:!0});_currentDirection;_textField;_iconPrefixContainer;_textPrefixContainer;_iconSuffixContainer;_textSuffixContainer;_floatingLabel;_notchedOutline;_lineRipple;_iconPrefixContainerSignal=Ar("iconPrefixContainer");_textPrefixContainerSignal=Ar("textPrefixContainer");_iconSuffixContainerSignal=Ar("iconSuffixContainer");_textSuffixContainerSignal=Ar("textSuffixContainer");_prefixSuffixContainers=hi(()=>[this._iconPrefixContainerSignal(),this._textPrefixContainerSignal(),this._iconSuffixContainerSignal(),this._textSuffixContainerSignal()].map(e=>e?.nativeElement).filter(e=>e!==void 0));_formFieldControl;_prefixChildren;_suffixChildren;_errorChildren;_hintChildren;_labelChild=wm(zt);get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(e){this._hideRequiredMarker=Tt(e)}_hideRequiredMarker=!1;color="primary";get floatLabel(){return this._floatLabel||this._defaults?.floatLabel||Xy}set floatLabel(e){e!==this._floatLabel&&(this._floatLabel=e,this._changeDetectorRef.markForCheck())}_floatLabel;get appearance(){return this._appearanceSignal()}set appearance(e){let i=e||this._defaults?.appearance||og;this._appearanceSignal.set(i)}_appearanceSignal=Ee(og);get subscriptSizing(){return this._subscriptSizing||this._defaults?.subscriptSizing||rg}set subscriptSizing(e){this._subscriptSizing=e||this._defaults?.subscriptSizing||rg}_subscriptSizing=null;get hintLabel(){return this._hintLabel}set hintLabel(e){this._hintLabel=e,this._processHints()}_hintLabel="";_hasIconPrefix=!1;_hasTextPrefix=!1;_hasIconSuffix=!1;_hasTextSuffix=!1;_labelId=this._idGenerator.getId("mat-mdc-form-field-label-");_hintLabelId=this._idGenerator.getId("mat-mdc-hint-");_describedByIds;get _control(){return this._explicitFormFieldControl||this._formFieldControl}set _control(e){this._explicitFormFieldControl=e}_destroyed=new R;_isFocused=null;_explicitFormFieldControl;_previousControl=null;_previousControlValidatorFn=null;_stateChanges;_valueChanges;_describedByChanges;_outlineLabelOffsetResizeObserver=null;_animationsDisabled=He();constructor(){let e=this._defaults,i=m(ft);e&&(e.appearance&&(this.appearance=e.appearance),this._hideRequiredMarker=!!e?.hideRequiredMarker,e.color&&(this.color=e.color)),Or(()=>this._currentDirection=i.valueSignal()),this._syncOutlineLabelOffset()}ngAfterViewInit(){this._updateFocusState(),this._animationsDisabled||this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{this._elementRef.nativeElement.classList.add("mat-form-field-animations-enabled")},300)}),this._changeDetectorRef.detectChanges()}ngAfterContentInit(){this._assertFormFieldControl(),this._initializeSubscript(),this._initializePrefixAndSuffix()}ngAfterContentChecked(){this._assertFormFieldControl(),this._control!==this._previousControl&&(this._initializeControl(this._previousControl),this._control.ngControl&&this._control.ngControl.control&&(this._previousControlValidatorFn=this._control.ngControl.control.validator),this._previousControl=this._control),this._control.ngControl&&this._control.ngControl.control&&this._control.ngControl.control.validator!==this._previousControlValidatorFn&&this._changeDetectorRef.markForCheck()}ngOnDestroy(){this._outlineLabelOffsetResizeObserver?.disconnect(),this._stateChanges?.unsubscribe(),this._valueChanges?.unsubscribe(),this._describedByChanges?.unsubscribe(),this._destroyed.next(),this._destroyed.complete()}getLabelId=hi(()=>this._hasFloatingLabel()?this._labelId:null);getConnectedOverlayOrigin(){return this._textField||this._elementRef}_animateAndLockLabel(){this._hasFloatingLabel()&&(this.floatLabel="always")}_initializeControl(e){let i=this._control,n="mat-mdc-form-field-type-";e&&this._elementRef.nativeElement.classList.remove(n+e.controlType),i.controlType&&this._elementRef.nativeElement.classList.add(n+i.controlType),this._stateChanges?.unsubscribe(),this._stateChanges=i.stateChanges.subscribe(()=>{this._updateFocusState(),this._changeDetectorRef.markForCheck()}),this._describedByChanges?.unsubscribe(),this._describedByChanges=i.stateChanges.pipe(kt([void 0,void 0]),_e(()=>[i.errorState,i.userAriaDescribedBy]),Eo(),ce(([[r,a],[c,h]])=>r!==c||a!==h)).subscribe(()=>this._syncDescribedByIds()),this._valueChanges?.unsubscribe(),i.ngControl&&i.ngControl.valueChanges&&(this._valueChanges=i.ngControl.valueChanges.pipe(L(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()))}_checkPrefixAndSuffixTypes(){this._hasIconPrefix=!!this._prefixChildren.find(e=>!e._isText),this._hasTextPrefix=!!this._prefixChildren.find(e=>e._isText),this._hasIconSuffix=!!this._suffixChildren.find(e=>!e._isText),this._hasTextSuffix=!!this._suffixChildren.find(e=>e._isText)}_initializePrefixAndSuffix(){this._checkPrefixAndSuffixTypes(),Ai(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._checkPrefixAndSuffixTypes(),this._changeDetectorRef.markForCheck()})}_initializeSubscript(){this._hintChildren.changes.subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._validateHints(),this._syncDescribedByIds()}_assertFormFieldControl(){this._control}_updateFocusState(){let e=this._control.focused;e&&!this._isFocused?(this._isFocused=!0,this._lineRipple?.activate()):!e&&(this._isFocused||this._isFocused===null)&&(this._isFocused=!1,this._lineRipple?.deactivate()),this._elementRef.nativeElement.classList.toggle("mat-focused",e),this._textField?.nativeElement.classList.toggle("mdc-text-field--focused",e)}_syncOutlineLabelOffset(){Sm({earlyRead:()=>{if(this._appearanceSignal()!=="outline")return this._outlineLabelOffsetResizeObserver?.disconnect(),null;if(globalThis.ResizeObserver){this._outlineLabelOffsetResizeObserver||=new globalThis.ResizeObserver(()=>{this._writeOutlinedLabelStyles(this._getOutlinedLabelOffset())});for(let e of this._prefixSuffixContainers())this._outlineLabelOffsetResizeObserver.observe(e,{box:"border-box"})}return this._getOutlinedLabelOffset()},write:e=>this._writeOutlinedLabelStyles(e())})}_shouldAlwaysFloat(){return this.floatLabel==="always"}_hasOutline(){return this.appearance==="outline"}_forceDisplayInfixLabel(){return!this._platform.isBrowser&&this._prefixChildren.length&&!this._shouldLabelFloat()}_hasFloatingLabel=hi(()=>!!this._labelChild());_shouldLabelFloat(){return this._hasFloatingLabel()?this._control.shouldLabelFloat||this._shouldAlwaysFloat():!1}_shouldForward(e){let i=this._control?this._control.ngControl:null;return i&&i[e]}_getSubscriptMessageType(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"}_handleLabelResized(){this._refreshOutlineNotchWidth()}_refreshOutlineNotchWidth(){!this._hasOutline()||!this._floatingLabel||!this._shouldLabelFloat()?this._notchedOutline?._setNotchWidth(0):this._notchedOutline?._setNotchWidth(this._floatingLabel.getWidth())}_processHints(){this._validateHints(),this._syncDescribedByIds()}_validateHints(){this._hintChildren}_syncDescribedByIds(){if(this._control){let e=[];if(this._control.userAriaDescribedBy&&typeof this._control.userAriaDescribedBy=="string"&&e.push(...this._control.userAriaDescribedBy.split(" ")),this._getSubscriptMessageType()==="hint"){let r=this._hintChildren?this._hintChildren.find(c=>c.align==="start"):null,a=this._hintChildren?this._hintChildren.find(c=>c.align==="end"):null;r?e.push(r.id):this._hintLabel&&e.push(this._hintLabelId),a&&e.push(a.id)}else this._errorChildren&&e.push(...this._errorChildren.map(r=>r.id));let i=this._control.describedByIds,n;if(i){let r=this._describedByIds||e;n=e.concat(i.filter(a=>a&&!r.includes(a)))}else n=e;this._control.setDescribedByIds(n),this._describedByIds=e}}_getOutlinedLabelOffset(){if(!this._hasOutline()||!this._floatingLabel)return null;if(!this._iconPrefixContainer&&!this._textPrefixContainer)return["",null];if(!this._isAttachedToDom())return null;let e=this._iconPrefixContainer?.nativeElement,i=this._textPrefixContainer?.nativeElement,n=this._iconSuffixContainer?.nativeElement,r=this._textSuffixContainer?.nativeElement,a=e?.getBoundingClientRect().width??0,c=i?.getBoundingClientRect().width??0,h=n?.getBoundingClientRect().width??0,g=r?.getBoundingClientRect().width??0,b=this._currentDirection==="rtl"?"-1":"1",S=`${a+c}px`,N=`calc(${b} * (${S} + var(--mat-mdc-form-field-label-offset-x, 0px)))`,k=`var(--mat-mdc-form-field-label-transform, ${Ky} translateX(${N}))`,I=a+c+h+g;return[k,I]}_writeOutlinedLabelStyles(e){if(e!==null){let[i,n]=e;this._floatingLabel&&(this._floatingLabel.element.style.transform=i),n!==null&&this._notchedOutline?._setMaxWidth(n)}}_isAttachedToDom(){let e=this._elementRef.nativeElement;if(e.getRootNode){let i=e.getRootNode();return i&&i!==e}return document.documentElement.contains(e)}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["mat-form-field"]],contentQueries:function(i,n,r){if(i&1&&(bm(r,n._labelChild,zt,5),Ct(r,pa,5),Ct(r,ag,5),Ct(r,Gy,5),Ct(r,qy,5),Ct(r,yn,5)),i&2){Zl();let a;H(a=W())&&(n._formFieldControl=a.first),H(a=W())&&(n._prefixChildren=a),H(a=W())&&(n._suffixChildren=a),H(a=W())&&(n._errorChildren=a),H(a=W())&&(n._hintChildren=a)}},viewQuery:function(i,n){if(i&1&&(Er(n._iconPrefixContainerSignal,Xu,5),Er(n._textPrefixContainerSignal,Ku,5),Er(n._iconSuffixContainerSignal,Zu,5),Er(n._textSuffixContainerSignal,Ju,5),Q(My,5),Q(Xu,5),Q(Ku,5),Q(Zu,5),Q(Ju,5),Q(eg,5),Q(ng,5),Q(ig,5)),i&2){Zl(4);let r;H(r=W())&&(n._textField=r.first),H(r=W())&&(n._iconPrefixContainer=r.first),H(r=W())&&(n._textPrefixContainer=r.first),H(r=W())&&(n._iconSuffixContainer=r.first),H(r=W())&&(n._textSuffixContainer=r.first),H(r=W())&&(n._floatingLabel=r.first),H(r=W())&&(n._notchedOutline=r.first),H(r=W())&&(n._lineRipple=r.first)}},hostAttrs:[1,"mat-mdc-form-field"],hostVars:38,hostBindings:function(i,n){i&2&&E("mat-mdc-form-field-label-always-float",n._shouldAlwaysFloat())("mat-mdc-form-field-has-icon-prefix",n._hasIconPrefix)("mat-mdc-form-field-has-icon-suffix",n._hasIconSuffix)("mat-form-field-invalid",n._control.errorState)("mat-form-field-disabled",n._control.disabled)("mat-form-field-autofilled",n._control.autofilled)("mat-form-field-appearance-fill",n.appearance=="fill")("mat-form-field-appearance-outline",n.appearance=="outline")("mat-form-field-hide-placeholder",n._hasFloatingLabel()&&!n._shouldLabelFloat())("mat-primary",n.color!=="accent"&&n.color!=="warn")("mat-accent",n.color==="accent")("mat-warn",n.color==="warn")("ng-untouched",n._shouldForward("untouched"))("ng-touched",n._shouldForward("touched"))("ng-pristine",n._shouldForward("pristine"))("ng-dirty",n._shouldForward("dirty"))("ng-valid",n._shouldForward("valid"))("ng-invalid",n._shouldForward("invalid"))("ng-pending",n._shouldForward("pending"))},inputs:{hideRequiredMarker:"hideRequiredMarker",color:"color",floatLabel:"floatLabel",appearance:"appearance",subscriptSizing:"subscriptSizing",hintLabel:"hintLabel"},exportAs:["matFormField"],features:[qe([{provide:ha,useExisting:o},{provide:sg,useExisting:o}])],ngContentSelectors:Ey,decls:18,vars:21,consts:[["labelTemplate",""],["textField",""],["iconPrefixContainer",""],["textPrefixContainer",""],["textSuffixContainer",""],["iconSuffixContainer",""],[1,"mat-mdc-text-field-wrapper","mdc-text-field",3,"click"],[1,"mat-mdc-form-field-focus-overlay"],[1,"mat-mdc-form-field-flex"],["matFormFieldNotchedOutline","",3,"matFormFieldNotchedOutlineOpen"],[1,"mat-mdc-form-field-icon-prefix"],[1,"mat-mdc-form-field-text-prefix"],[1,"mat-mdc-form-field-infix"],[3,"ngTemplateOutlet"],[1,"mat-mdc-form-field-text-suffix"],[1,"mat-mdc-form-field-icon-suffix"],["matFormFieldLineRipple",""],["aria-atomic","true","aria-live","polite",1,"mat-mdc-form-field-subscript-wrapper","mat-mdc-form-field-bottom-align"],[1,"mat-mdc-form-field-error-wrapper"],[1,"mat-mdc-form-field-hint-wrapper"],["matFormFieldFloatingLabel","",3,"floating","monitorResize","id"],["aria-hidden","true",1,"mat-mdc-form-field-required-marker","mdc-floating-label--required"],[3,"id"],[1,"mat-mdc-form-field-hint-spacer"]],template:function(i,n){if(i&1){let r=M();Be(Ty),$e(0,Ay,1,1,"ng-template",null,0,Ra),s(2,"div",6,1),_("click",function(c){return v(r),y(n._control.onContainerClick(c))}),C(4,Iy,1,0,"div",7),s(5,"div",8),C(6,Fy,2,2,"div",9),C(7,Ny,3,0,"div",10),C(8,Ly,3,0,"div",11),s(9,"div",12),C(10,zy,1,1,null,13),me(11),l(),C(12,jy,3,0,"div",14),C(13,By,3,0,"div",15),l(),C(14,Hy,1,0,"div",16),l(),s(15,"div",17),C(16,Wy,2,0,"div",18)(17,$y,5,1,"div",19),l()}if(i&2){let r;d(2),E("mdc-text-field--filled",!n._hasOutline())("mdc-text-field--outlined",n._hasOutline())("mdc-text-field--no-label",!n._hasFloatingLabel())("mdc-text-field--disabled",n._control.disabled)("mdc-text-field--invalid",n._control.errorState),d(2),x(!n._hasOutline()&&!n._control.disabled?4:-1),d(2),x(n._hasOutline()?6:-1),d(),x(n._hasIconPrefix?7:-1),d(),x(n._hasTextPrefix?8:-1),d(2),x(!n._hasOutline()||n._forceDisplayInfixLabel()?10:-1),d(2),x(n._hasTextSuffix?12:-1),d(),x(n._hasIconSuffix?13:-1),d(),x(n._hasOutline()?-1:14),d(),E("mat-mdc-form-field-subscript-dynamic-size",n.subscriptSizing==="dynamic");let a=n._getSubscriptMessageType();d(),x((r=a)==="error"?16:r==="hint"?17:-1)}},dependencies:[eg,ng,La,ig,yn],styles:[`.mdc-text-field{display:inline-flex;align-items:baseline;padding:0 16px;position:relative;box-sizing:border-box;overflow:hidden;will-change:opacity,transform,color;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.mdc-text-field__input{width:100%;min-width:0;border:none;border-radius:0;background:none;padding:0;-moz-appearance:none;-webkit-appearance:none;height:28px}.mdc-text-field__input::-webkit-calendar-picker-indicator,.mdc-text-field__input::-webkit-search-cancel-button{display:none}.mdc-text-field__input::-ms-clear{display:none}.mdc-text-field__input:focus{outline:none}.mdc-text-field__input:invalid{box-shadow:none}.mdc-text-field__input::placeholder{opacity:0}.mdc-text-field__input::-moz-placeholder{opacity:0}.mdc-text-field__input::-webkit-input-placeholder{opacity:0}.mdc-text-field__input:-ms-input-placeholder{opacity:0}.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mdc-text-field--focused .mdc-text-field__input::placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder,.mdc-text-field--focused .mdc-text-field__input::-moz-placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder,.mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{opacity:1}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-moz-placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-webkit-input-placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive:-ms-input-placeholder{opacity:0}.mdc-text-field--outlined .mdc-text-field__input,.mdc-text-field--filled.mdc-text-field--no-label .mdc-text-field__input{height:100%}.mdc-text-field--outlined .mdc-text-field__input{display:flex;border:none !important;background-color:rgba(0,0,0,0)}.mdc-text-field--disabled .mdc-text-field__input{pointer-events:auto}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mat-form-field-filled-input-text-color, var(--mat-sys-on-surface));caret-color:var(--mat-form-field-filled-caret-color, var(--mat-sys-primary))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mat-form-field-outlined-input-text-color, var(--mat-sys-on-surface));caret-color:var(--mat-form-field-outlined-caret-color, var(--mat-sys-primary))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mat-form-field-filled-error-caret-color, var(--mat-sys-error))}.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mat-form-field-outlined-error-caret-color, var(--mat-sys-error))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-text-field__input{color:var(--mat-form-field-filled-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-text-field__input{color:var(--mat-form-field-outlined-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-text-field--disabled .mdc-text-field__input{background-color:Window}}.mdc-text-field--filled{height:56px;border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-left-radius:var(--mat-form-field-filled-container-shape, var(--mat-sys-corner-extra-small));border-top-right-radius:var(--mat-form-field-filled-container-shape, var(--mat-sys-corner-extra-small))}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:var(--mat-form-field-filled-container-color, var(--mat-sys-surface-variant))}.mdc-text-field--filled.mdc-text-field--disabled{background-color:var(--mat-form-field-filled-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 4%, transparent))}.mdc-text-field--outlined{height:56px;overflow:visible;padding-right:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)));padding-left:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)) + 4px)}[dir=rtl] .mdc-text-field--outlined{padding-right:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)) + 4px);padding-left:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)))}.mdc-floating-label{position:absolute;left:0;transform-origin:left top;line-height:1.15rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform}[dir=rtl] .mdc-floating-label{right:0;left:auto;transform-origin:right top;text-align:right}.mdc-text-field .mdc-floating-label{top:50%;transform:translateY(-50%);pointer-events:none}.mdc-notched-outline .mdc-floating-label{display:inline-block;position:relative;max-width:100%}.mdc-text-field--outlined .mdc-floating-label{left:4px;right:auto}[dir=rtl] .mdc-text-field--outlined .mdc-floating-label{left:auto;right:4px}.mdc-text-field--filled .mdc-floating-label{left:16px;right:auto}[dir=rtl] .mdc-text-field--filled .mdc-floating-label{left:auto;right:16px}.mdc-text-field--disabled .mdc-floating-label{cursor:default}@media(forced-colors: active){.mdc-text-field--disabled .mdc-floating-label{z-index:1}}.mdc-text-field--filled.mdc-text-field--no-label .mdc-floating-label{display:none}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-floating-label{color:var(--mat-form-field-filled-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-filled-focus-label-text-color, var(--mat-sys-primary))}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label{color:var(--mat-form-field-filled-hover-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-floating-label{color:var(--mat-form-field-filled-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label{color:var(--mat-form-field-filled-error-label-text-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-filled-error-focus-label-text-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label{color:var(--mat-form-field-filled-error-hover-label-text-color, var(--mat-sys-on-error-container))}.mdc-text-field--filled .mdc-floating-label{font-family:var(--mat-form-field-filled-label-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-form-field-filled-label-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-form-field-filled-label-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-form-field-filled-label-text-tracking, var(--mat-sys-body-large-tracking))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-floating-label{color:var(--mat-form-field-outlined-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-outlined-focus-label-text-color, var(--mat-sys-primary))}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label{color:var(--mat-form-field-outlined-hover-label-text-color, var(--mat-sys-on-surface))}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-floating-label{color:var(--mat-form-field-outlined-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label{color:var(--mat-form-field-outlined-error-label-text-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-outlined-error-focus-label-text-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label{color:var(--mat-form-field-outlined-error-hover-label-text-color, var(--mat-sys-on-error-container))}.mdc-text-field--outlined .mdc-floating-label{font-family:var(--mat-form-field-outlined-label-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-form-field-outlined-label-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-form-field-outlined-label-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-form-field-outlined-label-text-tracking, var(--mat-sys-body-large-tracking))}.mdc-floating-label--float-above{cursor:auto;transform:translateY(-106%) scale(0.75)}.mdc-text-field--filled .mdc-floating-label--float-above{transform:translateY(-106%) scale(0.75)}.mdc-text-field--outlined .mdc-floating-label--float-above{transform:translateY(-37.25px) scale(1);font-size:.75rem}.mdc-notched-outline .mdc-floating-label--float-above{text-overflow:clip}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:133.3333333333%}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) scale(0.75)}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:1px;margin-right:0;content:"*"}[dir=rtl] .mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:0;margin-right:1px}.mdc-notched-outline{display:flex;position:absolute;top:0;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] .mdc-notched-outline{text-align:right}.mdc-text-field--outlined .mdc-notched-outline{z-index:1}.mat-mdc-notch-piece{box-sizing:border-box;height:100%;pointer-events:none;border-top:1px solid;border-bottom:1px solid}.mdc-text-field--focused .mat-mdc-notch-piece{border-width:2px}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-outline-color, var(--mat-sys-outline));border-width:var(--mat-form-field-outlined-outline-width, 1px)}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-hover-outline-color, var(--mat-sys-on-surface))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-focus-outline-color, var(--mat-sys-primary))}.mdc-text-field--outlined.mdc-text-field--disabled .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-outline-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-notched-outline .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-hover-outline-color, var(--mat-sys-on-error-container))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-focus-outline-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline .mat-mdc-notch-piece{border-width:var(--mat-form-field-outlined-focus-outline-width, 2px)}.mdc-notched-outline__leading{border-left:1px solid;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading{width:max(12px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)))}[dir=rtl] .mdc-notched-outline__leading{border-left:none;border-right:1px solid;border-bottom-left-radius:0;border-top-left-radius:0;border-top-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-notched-outline__trailing{flex-grow:1;border-left:none;border-right:1px solid;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}[dir=rtl] .mdc-notched-outline__trailing{border-left:1px solid;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-notched-outline__notch{flex:0 0 auto;width:auto}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__notch{max-width:min(var(--mat-form-field-notch-max-width, 100%),calc(100% - max(12px, var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))) * 2))}.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{max-width:min(100%,calc(100% - max(12px, var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))) * 2))}.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:1px}.mdc-text-field--focused.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:2px}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:0;padding-right:8px;border-top:none}[dir=rtl] .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:8px;padding-right:0}.mdc-notched-outline--no-label .mdc-notched-outline__notch{display:none}.mdc-line-ripple::before,.mdc-line-ripple::after{position:absolute;bottom:0;left:0;width:100%;border-bottom-style:solid;content:""}.mdc-line-ripple::before{z-index:1;border-bottom-width:var(--mat-form-field-filled-active-indicator-height, 1px)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-active-indicator-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-hover-active-indicator-color, var(--mat-sys-on-surface))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-disabled-active-indicator-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-error-active-indicator-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-error-hover-active-indicator-color, var(--mat-sys-on-error-container))}.mdc-line-ripple::after{transform:scaleX(0);opacity:0;z-index:2}.mdc-text-field--filled .mdc-line-ripple::after{border-bottom-width:var(--mat-form-field-filled-focus-active-indicator-height, 2px)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mat-form-field-filled-focus-active-indicator-color, var(--mat-sys-primary))}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mat-form-field-filled-error-focus-active-indicator-color, var(--mat-sys-error))}.mdc-line-ripple--active::after{transform:scaleX(1);opacity:1}.mdc-line-ripple--deactivating::after{opacity:0}.mdc-text-field--disabled{pointer-events:none}.mat-mdc-form-field-textarea-control{vertical-align:middle;resize:vertical;box-sizing:border-box;height:auto;margin:0;padding:0;border:none;overflow:auto}.mat-mdc-form-field-input-control.mat-mdc-form-field-input-control{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font:inherit;letter-spacing:inherit;text-decoration:inherit;text-transform:inherit;border:none}.mat-mdc-form-field .mat-mdc-floating-label.mdc-floating-label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;line-height:normal;pointer-events:all;will-change:auto}.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-floating-label.mdc-floating-label{cursor:inherit}.mdc-text-field--no-label:not(.mdc-text-field--textarea) .mat-mdc-form-field-input-control.mdc-text-field__input,.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control{height:auto}.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control.mdc-text-field__input[type=color]{height:23px}.mat-mdc-text-field-wrapper{height:auto;flex:auto;will-change:auto}.mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-left:0;--mat-mdc-form-field-label-offset-x: -16px}.mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-right:0}[dir=rtl] .mat-mdc-text-field-wrapper{padding-left:16px;padding-right:16px}[dir=rtl] .mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-left:0}[dir=rtl] .mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-right:0}.mat-form-field-disabled .mdc-text-field__input::placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-label-always-float .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms;opacity:1}.mat-mdc-text-field-wrapper .mat-mdc-form-field-infix .mat-mdc-floating-label{left:auto;right:auto}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-text-field__input{display:inline-block}.mat-mdc-form-field .mat-mdc-text-field-wrapper.mdc-text-field .mdc-notched-outline__notch{padding-top:0}.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:1px solid rgba(0,0,0,0)}[dir=rtl] .mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:none;border-right:1px solid rgba(0,0,0,0)}.mat-mdc-form-field-infix{min-height:var(--mat-form-field-container-height, 56px);padding-top:var(--mat-form-field-filled-with-label-container-padding-top, 24px);padding-bottom:var(--mat-form-field-filled-with-label-container-padding-bottom, 8px)}.mdc-text-field--outlined .mat-mdc-form-field-infix,.mdc-text-field--no-label .mat-mdc-form-field-infix{padding-top:var(--mat-form-field-container-vertical-padding, 16px);padding-bottom:var(--mat-form-field-container-vertical-padding, 16px)}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:calc(var(--mat-form-field-container-height, 56px)/2)}.mdc-text-field--filled .mat-mdc-floating-label{display:var(--mat-form-field-filled-label-display, block)}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{--mat-mdc-form-field-label-transform: translateY(calc(calc(6.75px + var(--mat-form-field-container-height, 56px) / 2) * -1)) scale(var(--mat-mdc-form-field-floating-label-scale, 0.75));transform:var(--mat-mdc-form-field-label-transform)}@keyframes _mat-form-field-subscript-animation{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}.mat-mdc-form-field-subscript-wrapper{box-sizing:border-box;width:100%;position:relative}.mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-error-wrapper{position:absolute;top:0;left:0;right:0;padding:0 16px;opacity:1;transform:translateY(0);animation:_mat-form-field-subscript-animation 0ms cubic-bezier(0.55, 0, 0.55, 0.2)}.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-error-wrapper{position:static}.mat-mdc-form-field-bottom-align::before{content:"";display:inline-block;height:16px}.mat-mdc-form-field-bottom-align.mat-mdc-form-field-subscript-dynamic-size::before{content:unset}.mat-mdc-form-field-hint-end{order:1}.mat-mdc-form-field-hint-wrapper{display:flex}.mat-mdc-form-field-hint-spacer{flex:1 0 1em}.mat-mdc-form-field-error{display:block;color:var(--mat-form-field-error-text-color, var(--mat-sys-error))}.mat-mdc-form-field-subscript-wrapper,.mat-mdc-form-field-bottom-align::before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-subscript-text-font, var(--mat-sys-body-small-font));line-height:var(--mat-form-field-subscript-text-line-height, var(--mat-sys-body-small-line-height));font-size:var(--mat-form-field-subscript-text-size, var(--mat-sys-body-small-size));letter-spacing:var(--mat-form-field-subscript-text-tracking, var(--mat-sys-body-small-tracking));font-weight:var(--mat-form-field-subscript-text-weight, var(--mat-sys-body-small-weight))}.mat-mdc-form-field-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;opacity:0;pointer-events:none;background-color:var(--mat-form-field-state-layer-color, var(--mat-sys-on-surface))}.mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-form-field.mat-focused .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-focus-state-layer-opacity, 0)}select.mat-mdc-form-field-input-control{-moz-appearance:none;-webkit-appearance:none;background-color:rgba(0,0,0,0);display:inline-flex;box-sizing:border-box}select.mat-mdc-form-field-input-control:not(:disabled){cursor:pointer}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option{color:var(--mat-form-field-select-option-text-color, var(--mat-sys-neutral10))}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option:disabled{color:var(--mat-form-field-select-disabled-option-text-color, color-mix(in srgb, var(--mat-sys-neutral10) 38%, transparent))}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{content:"";width:0;height:0;border-left:5px solid rgba(0,0,0,0);border-right:5px solid rgba(0,0,0,0);border-top:5px solid;position:absolute;right:0;top:50%;margin-top:-2.5px;pointer-events:none;color:var(--mat-form-field-enabled-select-arrow-color, var(--mat-sys-on-surface-variant))}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{right:auto;left:0}.mat-mdc-form-field-type-mat-native-select.mat-focused .mat-mdc-form-field-infix::after{color:var(--mat-form-field-focus-select-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field-type-mat-native-select.mat-form-field-disabled .mat-mdc-form-field-infix::after{color:var(--mat-form-field-disabled-select-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:15px}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:0;padding-left:15px}@media(forced-colors: active){.mat-form-field-appearance-fill .mat-mdc-text-field-wrapper{outline:solid 1px}}@media(forced-colors: active){.mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-text-field-wrapper{outline-color:GrayText}}@media(forced-colors: active){.mat-form-field-appearance-fill.mat-focused .mat-mdc-text-field-wrapper{outline:dashed 3px}}@media(forced-colors: active){.mat-mdc-form-field.mat-focused .mdc-notched-outline{border:dashed 3px}}.mat-mdc-form-field-input-control[type=date],.mat-mdc-form-field-input-control[type=datetime],.mat-mdc-form-field-input-control[type=datetime-local],.mat-mdc-form-field-input-control[type=month],.mat-mdc-form-field-input-control[type=week],.mat-mdc-form-field-input-control[type=time]{line-height:1}.mat-mdc-form-field-input-control::-webkit-datetime-edit{line-height:1;padding:0;margin-bottom:-2px}.mat-mdc-form-field{--mat-mdc-form-field-floating-label-scale: 0.75;display:inline-flex;flex-direction:column;min-width:0;text-align:left;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-container-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-form-field-container-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-form-field-container-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-form-field-container-text-tracking, var(--mat-sys-body-large-tracking));font-weight:var(--mat-form-field-container-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-floating-label--float-above{font-size:calc(var(--mat-form-field-outlined-label-text-populated-size)*var(--mat-mdc-form-field-floating-label-scale))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:var(--mat-form-field-outlined-label-text-populated-size)}[dir=rtl] .mat-mdc-form-field{text-align:right}.mat-mdc-form-field-flex{display:inline-flex;align-items:baseline;box-sizing:border-box;width:100%}.mat-mdc-text-field-wrapper{width:100%;z-index:0}.mat-mdc-form-field-icon-prefix,.mat-mdc-form-field-icon-suffix{align-self:center;line-height:0;pointer-events:auto;position:relative;z-index:1}.mat-mdc-form-field-icon-prefix>.mat-icon,.mat-mdc-form-field-icon-suffix>.mat-icon{padding:0 12px;box-sizing:content-box}.mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-leading-icon-color, var(--mat-sys-on-surface-variant))}.mat-form-field-disabled .mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-disabled-leading-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-trailing-icon-color, var(--mat-sys-on-surface-variant))}.mat-form-field-disabled .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-disabled-trailing-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-invalid .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-trailing-icon-color, var(--mat-sys-error))}.mat-form-field-invalid:not(.mat-focused):not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-hover-trailing-icon-color, var(--mat-sys-on-error-container))}.mat-form-field-invalid.mat-focused .mat-mdc-text-field-wrapper .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-focus-trailing-icon-color, var(--mat-sys-error))}.mat-mdc-form-field-icon-prefix,[dir=rtl] .mat-mdc-form-field-icon-suffix{padding:0 4px 0 0}.mat-mdc-form-field-icon-suffix,[dir=rtl] .mat-mdc-form-field-icon-prefix{padding:0 0 0 4px}.mat-mdc-form-field-subscript-wrapper .mat-icon,.mat-mdc-form-field label .mat-icon{width:1em;height:1em;font-size:inherit}.mat-mdc-form-field-infix{flex:auto;min-width:0;width:180px;position:relative;box-sizing:border-box}.mat-mdc-form-field-infix:has(textarea[cols]){width:auto}.mat-mdc-form-field .mdc-notched-outline__notch{margin-left:-1px;-webkit-clip-path:inset(-9em -999em -9em 1px);clip-path:inset(-9em -999em -9em 1px)}[dir=rtl] .mat-mdc-form-field .mdc-notched-outline__notch{margin-left:0;margin-right:-1px;-webkit-clip-path:inset(-9em 1px -9em -999em);clip-path:inset(-9em 1px -9em -999em)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-floating-label{transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input{transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::-moz-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::-webkit-input-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input:-ms-input-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::-moz-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field--filled:not(.mdc-ripple-upgraded):focus .mdc-text-field__ripple::before{transition-duration:75ms}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-line-ripple::after{transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field.mat-form-field-animations-enabled .mat-mdc-form-field-error-wrapper{animation-duration:300ms}.mdc-notched-outline .mdc-floating-label{max-width:calc(100% + 1px)}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:calc(133.3333333333% + 1px)}
|
|
370
|
-
`],encapsulation:2,changeDetection:0})}return o})();var vl=(()=>{class o{isErrorState(e,i){return!!(e&&e.invalid&&(e.touched||i&&i.submitted))}static \u0275fac=function(i){return new(i||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var br=class{_defaultMatcher;ngControl;_parentFormGroup;_parentForm;_stateChanges;errorState=!1;matcher;constructor(t,e,i,n,r){this._defaultMatcher=t,this.ngControl=e,this._parentFormGroup=i,this._parentForm=n,this._stateChanges=r}updateErrorState(){let t=this.errorState,e=this._parentFormGroup||this._parentForm,i=this.matcher||this._defaultMatcher,n=this.ngControl?this.ngControl.control:null,r=i?.isErrorState(n,e)??!1;r!==t&&(this.errorState=r,this._stateChanges.next())}};var ct=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({imports:[ae,Nm,jt,ae]})}return o})();var Zy=["button","checkbox","file","hidden","image","radio","range","reset","submit"],Jy=new ne("MAT_INPUT_CONFIG"),di=(()=>{class o{_elementRef=m(ie);_platform=m(et);ngControl=m(Xa,{optional:!0,self:!0});_autofillMonitor=m(qu);_ngZone=m(de);_formField=m(ha,{optional:!0});_renderer=m(yt);_uid=m(Re).getId("mat-input-");_previousNativeValue;_inputValueAccessor;_signalBasedValueAccessor;_previousPlaceholder;_errorStateTracker;_config=m(Jy,{optional:!0});_cleanupIosKeyup;_cleanupWebkitWheel;_isServer;_isNativeSelect;_isTextarea;_isInFormField;focused=!1;stateChanges=new R;controlType="mat-input";autofilled=!1;get disabled(){return this._disabled}set disabled(e){this._disabled=Tt(e),this.focused&&(this.focused=!1,this.stateChanges.next())}_disabled=!1;get id(){return this._id}set id(e){this._id=e||this._uid}_id;placeholder;name;get required(){return this._required??this.ngControl?.control?.hasValidator(Qa.required)??!1}set required(e){this._required=Tt(e)}_required;get type(){return this._type}set type(e){this._type=e||"text",this._validateType(),!this._isTextarea&&ic().has(this._type)&&(this._elementRef.nativeElement.type=this._type)}_type="text";get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}userAriaDescribedBy;get value(){return this._signalBasedValueAccessor?this._signalBasedValueAccessor.value():this._inputValueAccessor.value}set value(e){e!==this.value&&(this._signalBasedValueAccessor?this._signalBasedValueAccessor.value.set(e):this._inputValueAccessor.value=e,this.stateChanges.next())}get readonly(){return this._readonly}set readonly(e){this._readonly=Tt(e)}_readonly=!1;disabledInteractive;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}_neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(e=>ic().has(e));constructor(){let e=m(Ka,{optional:!0}),i=m(Ja,{optional:!0}),n=m(vl),r=m(Yu,{optional:!0,self:!0}),a=this._elementRef.nativeElement,c=a.nodeName.toLowerCase();r?Ia(r.value)?this._signalBasedValueAccessor=r:this._inputValueAccessor=r:this._inputValueAccessor=a,this._previousNativeValue=this.value,this.id=this.id,this._platform.IOS&&this._ngZone.runOutsideAngular(()=>{this._cleanupIosKeyup=this._renderer.listen(a,"keyup",this._iOSKeyupListener)}),this._errorStateTracker=new br(n,this.ngControl,i,e,this.stateChanges),this._isServer=!this._platform.isBrowser,this._isNativeSelect=c==="select",this._isTextarea=c==="textarea",this._isInFormField=!!this._formField,this.disabledInteractive=this._config?.disabledInteractive||!1,this._isNativeSelect&&(this.controlType=a.multiple?"mat-native-select-multiple":"mat-native-select"),this._signalBasedValueAccessor&&Or(()=>{this._signalBasedValueAccessor.value(),this.stateChanges.next()})}ngAfterViewInit(){this._platform.isBrowser&&this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(e=>{this.autofilled=e.isAutofilled,this.stateChanges.next()})}ngOnChanges(){this.stateChanges.next()}ngOnDestroy(){this.stateChanges.complete(),this._platform.isBrowser&&this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement),this._cleanupIosKeyup?.(),this._cleanupWebkitWheel?.()}ngDoCheck(){this.ngControl&&(this.updateErrorState(),this.ngControl.disabled!==null&&this.ngControl.disabled!==this.disabled&&(this.disabled=this.ngControl.disabled,this.stateChanges.next())),this._dirtyCheckNativeValue(),this._dirtyCheckPlaceholder()}focus(e){this._elementRef.nativeElement.focus(e)}updateErrorState(){this._errorStateTracker.updateErrorState()}_focusChanged(e){if(e!==this.focused){if(!this._isNativeSelect&&e&&this.disabled&&this.disabledInteractive){let i=this._elementRef.nativeElement;i.type==="number"?(i.type="text",i.setSelectionRange(0,0),i.type="number"):i.setSelectionRange(0,0)}this.focused=e,this.stateChanges.next()}}_onInput(){}_dirtyCheckNativeValue(){let e=this._elementRef.nativeElement.value;this._previousNativeValue!==e&&(this._previousNativeValue=e,this.stateChanges.next())}_dirtyCheckPlaceholder(){let e=this._getPlaceholder();if(e!==this._previousPlaceholder){let i=this._elementRef.nativeElement;this._previousPlaceholder=e,e?i.setAttribute("placeholder",e):i.removeAttribute("placeholder")}}_getPlaceholder(){return this.placeholder||null}_validateType(){Zy.indexOf(this._type)>-1}_isNeverEmpty(){return this._neverEmptyInputTypes.indexOf(this._type)>-1}_isBadInput(){let e=this._elementRef.nativeElement.validity;return e&&e.badInput}get empty(){return!this._isNeverEmpty()&&!this._elementRef.nativeElement.value&&!this._isBadInput()&&!this.autofilled}get shouldLabelFloat(){if(this._isNativeSelect){let e=this._elementRef.nativeElement,i=e.options[0];return this.focused||e.multiple||!this.empty||!!(e.selectedIndex>-1&&i&&i.label)}else return this.focused&&!this.disabled||!this.empty}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){let i=this._elementRef.nativeElement;e.length?i.setAttribute("aria-describedby",e.join(" ")):i.removeAttribute("aria-describedby")}onContainerClick(){this.focused||this.focus()}_isInlineSelect(){let e=this._elementRef.nativeElement;return this._isNativeSelect&&(e.multiple||e.size>1)}_iOSKeyupListener=e=>{let i=e.target;!i.value&&i.selectionStart===0&&i.selectionEnd===0&&(i.setSelectionRange(1,1),i.setSelectionRange(0,0))};_getReadonlyAttribute(){return this._isNativeSelect?null:this.readonly||this.disabled&&this.disabledInteractive?"true":null}static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-mdc-input-element"],hostVars:21,hostBindings:function(i,n){i&1&&_("focus",function(){return n._focusChanged(!0)})("blur",function(){return n._focusChanged(!1)})("input",function(){return n._onInput()}),i&2&&(Zt("id",n.id)("disabled",n.disabled&&!n.disabledInteractive)("required",n.required),
|
|
371
|
-
|
|
372
|
-
`+(e.summary||""):e.summary||"")("matTooltipDisabled",!e.summary),d(),x(e.name?1:2),d(2),x(i.isSharedThread(e)?3:-1)}}function cC(o,t){if(o&1){let e=M();s(0,"button",24),_("click",function(n){v(e);let r=u().$implicit,a=u(4);return y(a.startEditingThreadName(n,r))}),s(1,"mat-icon"),p(2,"edit"),l()()}}function dC(o,t){if(o&1){let e=M();s(0,"div",10),C(1,oC,3,3,"div",11)(2,lC,4,4,"a",12),s(3,"div",13),C(4,cC,3,0,"button",14),s(5,"button",15),_("click",function(n){let r=v(e).$implicit,a=u(4);return y(a.toggleStar(n,r))}),s(6,"mat-icon"),p(7),l()(),s(8,"button",16),_("click",function(n){let r=v(e).$implicit,a=u(4);return y(a.deleteThread(n,r))}),s(9,"mat-icon"),p(10,"delete"),l()()()()}if(o&2){let e,i=t.$implicit,n=u(4);E("current",i.id===((e=n.currentThread())==null?null:e.id)),d(),x(n.editingThreadId===i.id?1:2),d(3),x(n.editingThreadId!==i.id&&i.name?4:-1),d(),E("starred",n.isStarred(i)),w("title",n.isStarred(i)?"Unstar thread":"Star thread"),d(2),F(n.isStarred(i)?"star":"star_outline")}}function mC(o,t){if(o&1&&(s(0,"div",6)(1,"div",8),p(2),l(),xe(3,dC,11,8,"div",9,tC),l()),o&2){let e=t.$implicit;d(2),F(e.label),d(),we(e.threads)}}function pC(o,t){o&1&&(s(0,"div",7),p(1,"No existing threads"),l())}function hC(o,t){if(o&1&&(s(0,"div",7),p(1),l()),o&2){let e=u(3);d(),te('No threads matching "',e.searchQuery,'"')}}function uC(o,t){if(o&1&&(xe(0,mC,5,1,"div",6,eC),C(2,pC,2,0,"div",7)(3,hC,2,1,"div",7)),o&2){let e,i=u(2);we(i.getGroupedThreads()),d(2),x(!((e=i.threads())!=null&&e.length)&&!i.searchQuery?2:i.searchQuery&&i.getGroupedThreads().length===0?3:-1)}}function gC(o,t){if(o&1&&(s(0,"div",1),C(1,iC,4,0,"div",3)(2,uC,4,1),l()),o&2){let e=u();d(),x(e.isLoadingThreadList()?1:2)}}function fC(o,t){o&1&&(s(0,"span",25),p(1,"No project selected"),l())}function _C(o,t){o&1&&(s(0,"span",25),p(1,"Loading..."),l())}function bC(o,t){if(o&1&&(s(0,"div",2),C(1,fC,2,0,"span",25)(2,_C,2,0,"span",25),l()),o&2){let e,i=u();d(),x((e=i.currentProject())!=null&&e.name?2:1)}}var yl=class o{projects=null;searchMode=!1;searchQuery="";searchModeChange=new U;projectStateService=m(Se);threadStateService=m(Pt);threadApiService=m(Yi);userService=m(fr);router=m(On);currentThread=_t(this.threadStateService.selectedThread$);currentProject=_t(this.projectStateService.selectedProject$);threads=_t(this.threadStateService.threadList$);isLoadingThreadList=_t(this.threadStateService.isLoadingThreadList$);username=_t(this.userService.username$);editingThreadId=null;editingThreadName="";isRenamingThread=!1;renameErrorMessage="";expandedParents=new Set;ngOnInit(){this.userService.fetchCurrentUser().subscribe({error:t=>{console.error("[THREAD-SELECTOR] Failed to load current user:",t)}})}selectThread(t){this.threadStateService.selectThread(t),this.router.navigate(["project",this.currentProject()?.name,"thread",t])}getGroupedThreads(){let t=this.threads();if(!t?.length)return[];let e=t.filter(k=>!k.parentThreadId),i=t.filter(k=>!!k.parentThreadId),n=new Map;for(let k of i){let I=k.parentThreadId;n.has(I)||n.set(I,[]),n.get(I).push(k)}let r=e;if(this.searchQuery&&this.searchQuery.trim()){let k=this.searchQuery.toLowerCase().trim();r=r.filter(I=>I.name.toLowerCase().includes(k)||I.summary&&I.summary.toLowerCase().includes(k))}if(!r.length)return[];let a=this.username();if(!a)return[];let c=r.map(k=>ut(Z({},k),{subThreads:(n.get(k.id)||[]).sort((I,pe)=>I.modifiedDate>pe.modifiedDate?-1:1)})),h=c.filter(k=>k.starring&&k.starring.includes(a)),g=c.filter(k=>!k.starring||!k.starring.includes(a)),b=new Map,S=new Date;S.setHours(0,0,0,0);for(let k of g){let I=new Date(k.modifiedDate);I.setHours(0,0,0,0);let pe=S.getTime()-I.getTime(),ke=Math.floor(pe/(1e3*60*60*24)),ve;ke===0?ve="Today":ke===1?ve="Yesterday":ke<7?ve="This Week":ke<30?ve="This Month":ke<90?ve="Last 3 Months":ve="Older",b.has(ve)||b.set(ve,[]),b.get(ve).push(k)}let P=[];if(h.length>0){let k=[...h].sort((I,pe)=>I.modifiedDate>pe.modifiedDate?-1:1);P.push({label:"Starred",threads:k})}return["Today","Yesterday","This Week","This Month","Last 3 Months","Older"].filter(k=>b.has(k)).forEach(k=>{P.push({label:k,threads:b.get(k)})}),P}isParentExpanded(t){return this.expandedParents.has(t)}toggleSubThreads(t,e){t.stopPropagation(),this.expandedParents.has(e)?this.expandedParents.delete(e):this.expandedParents.add(e)}isSubThread(t){return!!t.parentThreadId}isSharedThread(t){return t.users&&t.users.length>1}isStarred(t){let e=this.username();return!!e&&t.starring&&t.starring.includes(e)}toggleStar(t,e){t.stopPropagation();let i=this.username();if(!i)return;(e.starring&&e.starring.includes(i)?this.threadApiService.unstarThread(e.id):this.threadApiService.starThread(e.id)).subscribe({next:()=>{this.threadStateService.refreshThreadList()},error:a=>{console.error("Error toggling star:",a)}})}deleteThread(t,e){t.stopPropagation();let i=this.currentProject()?.name;!i||!confirm(`Are you sure you want to delete the thread "${e.name}"?`)||this.threadApiService.deleteThread(e.id).subscribe({next:()=>{this.currentThread()?.id===e.id&&(this.threadStateService.clearSelection(),this.router.navigate(["project",i])),this.threadStateService.refreshThreadList()},error:r=>{console.error("Error deleting thread:",r),alert("Failed to delete thread. Please try again.")}})}formatDate(t){try{let e=new Date(t),n=new Date().getTime()-e.getTime(),r=Math.floor(n/(1e3*60*60*24));return r===0?"Today":r===1?"Yesterday":r<7?`${r} days ago`:e.toLocaleDateString("en-EN",{day:"numeric",month:"short"})}catch{return"No date"}}startEditingThreadName(t,e){t.stopPropagation(),this.editingThreadId=e.id,this.editingThreadName=e.name||"",this.renameErrorMessage="",setTimeout(()=>{let i=document.querySelector(".thread-name-input");i&&(i.focus(),i.select())},0)}cancelEditingThreadName(){this.editingThreadId=null,this.editingThreadName="",this.renameErrorMessage=""}saveThreadName(t){if(t&&t.stopPropagation(),!this.editingThreadId)return;let e=this.editingThreadName.trim();if(!e){this.renameErrorMessage="Thread name cannot be empty";return}if(e.length>200){this.renameErrorMessage="Thread name is too long (max 200 characters)";return}let i=this.editingThreadId;this.isRenamingThread=!0,this.renameErrorMessage="",this.threadStateService.renameThread(i,e).subscribe({next:()=>{console.log("[THREAD-SELECTOR] Thread renamed successfully"),this.cancelEditingThreadName(),this.isRenamingThread=!1},error:n=>{console.error("[THREAD-SELECTOR] Error renaming thread:",n),this.renameErrorMessage=n.message||"Failed to rename thread",this.isRenamingThread=!1}})}onEditKeydown(t){t.key==="Enter"?(t.preventDefault(),t.stopPropagation(),this.saveThreadName()):t.key==="Escape"&&(t.preventDefault(),t.stopPropagation(),this.cancelEditingThreadName())}onEditBlur(){setTimeout(()=>{this.editingThreadId&&!this.isRenamingThread&&this.saveThreadName()},200)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-thread-selector"]],inputs:{searchMode:"searchMode",searchQuery:"searchQuery"},outputs:{searchModeChange:"searchModeChange"},decls:3,vars:1,consts:[["tabindex","0","role","application","aria-label","Thread selector",1,"thread-selector",3,"click","keydown"],["role","menu","aria-label","Thread selection",1,"thread-list"],[1,"thread-disabled"],[1,"thread-loading"],[1,"loading-spinner"],[1,"loading-text"],[1,"thread-group"],[1,"thread-empty"],[1,"thread-group-header"],[1,"thread-item-wrapper",3,"current"],[1,"thread-item-wrapper"],[1,"thread-name-edit-wrapper"],["matTooltipShowDelay","1000","role","menuitem","tabindex","0",1,"thread-item",3,"matTooltip","matTooltipDisabled"],[1,"action-buttons"],["mat-icon-button","","title","Rename thread","type","button",1,"action-button","edit-button"],["mat-icon-button","","type","button",1,"action-button","star-button",3,"click","title"],["mat-icon-button","","title","Delete thread","type","button",1,"action-button","delete-button",3,"click"],["type","text","maxlength","200",1,"thread-name-input",3,"ngModelChange","keydown","blur","click","ngModel","disabled"],[1,"rename-error"],["matTooltipShowDelay","1000","role","menuitem","tabindex","0",1,"thread-item",3,"click","keydown.enter","keydown.space","matTooltip","matTooltipDisabled"],[1,"thread-name"],["matTooltip","Shared thread",1,"shared-indicator"],[1,"thread-name-spinner",3,"diameter"],[1,"thread-name","thread-name-generating"],["mat-icon-button","","title","Rename thread","type","button",1,"action-button","edit-button",3,"click"],[1,"disabled-text"]],template:function(e,i){if(e&1&&(s(0,"div",0),_("click",function(r){return r.stopPropagation()})("keydown",function(r){return r.stopPropagation()}),C(1,gC,3,1,"div",1)(2,bC,3,1,"div",2),l()),e&2){let n;d(),x((n=i.currentProject())!=null&&n.name?1:2)}},dependencies:[Pe,je,Le,Ve,Gm,ze,Oe,he,it,Qe,Xt,ct,nr,ir,sa,xd],styles:[".thread-selector[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;min-height:0}.sidenav-thread-selector[_nghost-%COMP%] .thread-selector[_ngcontent-%COMP%], .sidenav-thread-selector [_nghost-%COMP%] .thread-selector[_ngcontent-%COMP%]{flex:1;min-height:0}.thread-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:0;max-height:none;overflow:visible}.thread-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin-bottom:.5rem}.thread-group[_ngcontent-%COMP%]:last-child{margin-bottom:0}.thread-group-header[_ngcontent-%COMP%]{padding:.5rem 1rem .25rem;font-size:.75rem;font-weight:600;color:var(--color-text-secondary);text-transform:uppercase;letter-spacing:.5px;position:sticky;top:0;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);z-index:1}.thread-item-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;position:relative;width:100%;border-radius:0;min-width:0;gap:.25rem}.thread-item-wrapper[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.thread-item-wrapper[_ngcontent-%COMP%]:hover .action-buttons[_ngcontent-%COMP%]{display:flex}.thread-item-wrapper.current[_ngcontent-%COMP%]{background:var(--color-primary-light)}.thread-item-wrapper.current[_ngcontent-%COMP%] .thread-item[_ngcontent-%COMP%]{color:var(--color-primary-text);font-weight:600}.thread-item[_ngcontent-%COMP%]{display:flex;align-items:center;flex:1;min-width:0;padding:.75rem 1rem;text-decoration:none;cursor:pointer;transition:all .2s ease;background:transparent;border:none;border-radius:0;color:var(--color-text);text-align:left;justify-content:flex-start}.thread-item.new-thread-item[_ngcontent-%COMP%]{margin-bottom:.25rem}.thread-item[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.thread-item[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary);outline-offset:-2px}.action-buttons[_ngcontent-%COMP%]{display:none;align-items:center;gap:.25rem;flex-shrink:0;margin-right:.5rem}.thread-item-wrapper[_ngcontent-%COMP%]:hover .action-buttons[_ngcontent-%COMP%], .thread-item-wrapper.current[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%]{display:flex}.action-button[_ngcontent-%COMP%]{flex-shrink:0;border-radius:4px!important;width:28px!important;height:28px!important;padding:0!important}.action-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple{border-radius:4px!important}.action-button[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)!important}.action-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.action-button.edit-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.action-button.edit-button[_ngcontent-%COMP%]:hover{background-color:var(--color-primary-hover)!important}.action-button.edit-button[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:var(--color-primary)}.action-button.star-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{transition:color .2s ease}.action-button.star-button.starred[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#fbbf24}.action-button.star-button[_ngcontent-%COMP%]:not(.starred):hover mat-icon[_ngcontent-%COMP%]{color:#fbbf24}.action-button.delete-button[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:#ef4444}.thread-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;background:transparent;border:none;text-decoration:none;cursor:pointer;transition:all .2s ease;gap:.5rem;font-size:.875rem;font-weight:400;padding:0 1rem;min-width:0}.thread-link[_ngcontent-%COMP%]:hover:not(.new-thread-link){color:var(--color-primary-hover, var(--color-primary));text-decoration:underline;text-decoration-thickness:1.5px;text-underline-offset:3px}.thread-link[_ngcontent-%COMP%]:focus{outline:2px solid var(--color-primary);outline-offset:2px}.thread-link.new-thread-link[_ngcontent-%COMP%]{margin-bottom:.5rem;font-weight:600;font-size:.95rem}.thread-link.new-thread-link[_ngcontent-%COMP%] .thread-name[_ngcontent-%COMP%]{background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% auto;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:_ngcontent-%COMP%_gradientShift 3s ease-in-out infinite}.thread-link.new-thread-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--color-primary);animation:_ngcontent-%COMP%_iconPulse 3s ease-in-out infinite}.thread-link.new-thread-link[_ngcontent-%COMP%]:hover{transform:translate(4px)}.thread-link.new-thread-link[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_iconPulse 1.5s ease-in-out infinite}.thread-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0 center}50%{background-position:100% center}to{background-position:0 center}}@keyframes _ngcontent-%COMP%_iconPulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.05)}}.thread-name[_ngcontent-%COMP%]{flex:1;font-size:.875rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left}.thread-name.thread-name-generating[_ngcontent-%COMP%]{color:var(--color-text-muted);font-style:italic}.thread-name-edit-wrapper[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;padding:0 .5rem}.thread-name-input[_ngcontent-%COMP%]{width:100%;padding:.5rem;border:1px solid var(--color-border);border-radius:4px;background:var(--color-bg-secondary);color:var(--color-text-primary);font-size:.9rem;font-family:inherit}.thread-name-input[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary);box-shadow:0 0 0 2px #3b82f61a}.thread-name-input[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.rename-error[_ngcontent-%COMP%]{color:var(--color-error);font-size:.75rem;margin-top:.25rem;padding-left:.5rem}.thread-name-spinner[_ngcontent-%COMP%]{flex-shrink:0;margin-right:.5rem}.thread-name-spinner[_ngcontent-%COMP%] .mat-mdc-progress-spinner circle{stroke:var(--color-primary)!important}.current-indicator[_ngcontent-%COMP%]{color:var(--color-success);font-weight:700;flex-shrink:0;font-size:1rem}.thread-separator[_ngcontent-%COMP%]{height:1px;background:var(--color-border);margin:.25rem 0}.thread-empty[_ngcontent-%COMP%]{padding:1.5rem 1rem;text-align:center;color:var(--color-text-muted);font-size:.8rem;font-style:italic}.thread-loading[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:2rem 1rem;gap:.75rem}.thread-loading[_ngcontent-%COMP%] .loading-spinner[_ngcontent-%COMP%]{width:24px;height:24px;border:3px solid var(--color-border);border-top-color:var(--color-primary);border-radius:50%;animation:_ngcontent-%COMP%_spin .8s linear infinite}.thread-loading[_ngcontent-%COMP%] .loading-text[_ngcontent-%COMP%]{color:var(--color-text-muted);font-size:.8rem}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.thread-disabled[_ngcontent-%COMP%]{padding:1.5rem 1rem}.thread-disabled[_ngcontent-%COMP%] .disabled-text[_ngcontent-%COMP%]{display:block;color:var(--color-text-muted);font-size:.85rem;font-style:italic;text-align:center}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%]{padding-left:1rem}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%] .sub-thread-item[_ngcontent-%COMP%]{padding:.4rem .75rem;gap:.35rem;font-size:.8rem;color:var(--color-text-secondary)}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%] .sub-thread-item[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%] .sub-thread-icon[_ngcontent-%COMP%]{font-size:14px;width:14px;height:14px;color:var(--color-text-muted);flex-shrink:0}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%] .sub-thread-agent[_ngcontent-%COMP%]{font-weight:600;color:var(--color-primary);white-space:nowrap;flex-shrink:0;font-size:.8rem}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%] .sub-thread-task[_ngcontent-%COMP%]{color:var(--color-text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.75rem}.sub-thread-toggle[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;flex-shrink:0;cursor:pointer;color:var(--color-text-secondary);margin-right:.25rem}.sub-thread-toggle[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.shared-indicator[_ngcontent-%COMP%]{font-size:14px;width:14px;height:14px;color:var(--color-text-secondary);flex-shrink:0;margin-left:.25rem}@media (max-width: 768px){.thread-item[_ngcontent-%COMP%]{padding:.6rem .8rem}.thread-name[_ngcontent-%COMP%]{font-size:.8rem}}"]})};function vC(o,t){if(o&1){let e=M();s(0,"button",9),_("click",function(){v(e);let n=u();return y(n.start())}),s(1,"mat-icon"),p(2,"play_arrow"),l()()}if(o&2){let e=u();w("disabled",!e.hasPreviewCommand()||e.isLoading())}}function yC(o,t){if(o&1){let e=M();s(0,"button",10),_("click",function(){v(e);let n=u();return y(n.stop())}),s(1,"mat-icon"),p(2,"stop"),l()()}if(o&2){let e=u();w("disabled",e.isLoading())}}function CC(o,t){if(o&1&&(s(0,"a",5)(1,"mat-icon",11),p(2,"open_in_new"),l(),s(3,"span",12),p(4),l()()),o&2){let e=u();w("href",e.previewUrl(),Sn)("title",e.previewUrl()),d(4),F(e.previewUrl())}}function xC(o,t){if(o&1&&(s(0,"div",7),p(1),l()),o&2){let e=u();d(),F(e.errorMessage())}}function wC(o,t){if(o&1){let e=M();s(0,"div",8)(1,"div",13)(2,"span",14),p(3,"Logs"),l(),s(4,"button",15),_("click",function(){v(e);let n=u();return y(n.refreshLogs())}),s(5,"mat-icon"),p(6,"refresh"),l()()(),s(7,"pre",16),p(8),l()()}if(o&2){let e=u();d(8),F(e.logs()||"(empty)")}}var Cl=class o{destroyRef=m(Yl);projectState=m(Se);hasPreviewCommand=_t(this.projectState.selectedProject$.pipe(_e(t=>!!t?.config?.preview?.command)),{initialValue:!1});status=Ee("stopped");previewUrl=Ee(null);logs=Ee("");isLoading=Ee(!1);showLogs=Ee(!1);errorMessage=Ee("");ngOnInit(){try{this.projectState.getPreviewStatus().pipe(nn(this.destroyRef)).subscribe({next:t=>this.applyStatus(t),error:()=>{}})}catch{}}start(){this.isLoading.set(!0),this.errorMessage.set(""),this.projectState.startPreview().pipe(nn(this.destroyRef)).subscribe({next:t=>{this.applyStatus(t),this.isLoading.set(!1)},error:t=>{this.errorMessage.set(t?.error?.error??"Failed to start preview"),this.isLoading.set(!1)}})}stop(){this.isLoading.set(!0),this.errorMessage.set(""),this.projectState.stopPreview().pipe(nn(this.destroyRef)).subscribe({next:()=>{this.status.set("stopped"),this.previewUrl.set(null),this.isLoading.set(!1)},error:t=>{this.errorMessage.set(t?.error?.error??"Failed to stop preview"),this.isLoading.set(!1)}})}refreshLogs(){this.projectState.getPreviewLogs().pipe(nn(this.destroyRef)).subscribe({next:t=>this.logs.set(t.logs),error:()=>this.logs.set("(failed to load logs)")})}toggleLogs(){this.showLogs.update(t=>!t),this.showLogs()&&this.refreshLogs()}applyStatus(t){this.status.set(t.status),this.previewUrl.set(t.url??null)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-preview-panel"]],decls:12,vars:10,consts:[[1,"preview-panel"],[1,"preview-controls"],["mat-icon-button","","title","Start preview server","type","button",1,"preview-action-btn","start",3,"disabled"],["mat-icon-button","","title","Stop preview server","type","button",1,"preview-action-btn","stop",3,"disabled"],[1,"status-pill"],["target","_blank","rel","noopener noreferrer",1,"preview-url",3,"href","title"],["mat-icon-button","","type","button",1,"logs-btn",3,"click","title"],[1,"preview-error"],[1,"logs-container"],["mat-icon-button","","title","Start preview server","type","button",1,"preview-action-btn","start",3,"click","disabled"],["mat-icon-button","","title","Stop preview server","type","button",1,"preview-action-btn","stop",3,"click","disabled"],[1,"link-icon"],[1,"url-text"],[1,"logs-header"],[1,"logs-title"],["mat-icon-button","","title","Refresh logs","type","button",1,"refresh-btn",3,"click"],[1,"logs-content"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1),C(2,vC,3,1,"button",2),C(3,yC,3,1,"button",3),s(4,"span",4),p(5),l(),C(6,CC,5,3,"a",5),s(7,"button",6),_("click",function(){return i.toggleLogs()}),s(8,"mat-icon"),p(9),l()()(),C(10,xC,2,1,"div",7),C(11,wC,9,1,"div",8),l()),e&2&&(d(2),x(i.status()==="stopped"?2:-1),d(),x(i.status()==="running"?3:-1),d(),E("running",i.status()==="running"),d(),te(" ",i.status()==="running"?"Running":"Stopped"," "),d(),x(i.status()==="running"&&i.previewUrl()?6:-1),d(),w("title",i.showLogs()?"Hide logs":"Show logs"),d(2),F(i.showLogs()?"expand_less":"terminal"),d(),x(i.errorMessage()?10:-1),d(),x(i.showLogs()?11:-1))},dependencies:[it,Qe,Oe,he],styles:["[_nghost-%COMP%]{display:block}.preview-panel[_ngcontent-%COMP%]{padding:.5rem 1rem;display:flex;flex-direction:column;gap:.5rem}.preview-controls[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;flex-wrap:nowrap;min-width:0}.preview-action-btn[_ngcontent-%COMP%]{flex-shrink:0}.preview-action-btn.start[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--color-primary)}.preview-action-btn.stop[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#e53935}.preview-action-btn[disabled][_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.status-pill[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:2px 8px;border-radius:12px;font-size:.72rem;font-weight:600;letter-spacing:.02em;flex-shrink:0;background:var(--color-bg-hover);color:var(--color-text-secondary);border:1px solid var(--color-border)}.status-pill.running[_ngcontent-%COMP%]{background:#22c55e26;color:#16a34a;border-color:#22c55e66}.preview-url[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:2px;text-decoration:none;color:var(--color-primary);font-size:.8rem;font-weight:500;min-width:0;overflow:hidden;flex-shrink:1}.preview-url[_ngcontent-%COMP%]:hover{text-decoration:underline}.preview-url[_ngcontent-%COMP%] .link-icon[_ngcontent-%COMP%]{font-size:14px;width:14px;height:14px;flex-shrink:0}.preview-url[_ngcontent-%COMP%] .url-text[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.logs-btn[_ngcontent-%COMP%]{margin-left:auto;flex-shrink:0}.logs-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;color:var(--color-text-secondary)}.preview-error[_ngcontent-%COMP%]{font-size:.78rem;color:#c00;padding:0 .25rem}.logs-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;background:var(--color-bg-hover);border-radius:8px;overflow:hidden;border:1px solid var(--color-border)}.logs-header[_ngcontent-%COMP%]{display:flex;align-items:center;padding:.25rem .75rem;border-bottom:1px solid var(--color-border)}.logs-header[_ngcontent-%COMP%] .logs-title[_ngcontent-%COMP%]{flex:1;font-size:.75rem;font-weight:600;color:var(--color-text-secondary);text-transform:uppercase;letter-spacing:.05em}.logs-header[_ngcontent-%COMP%] .refresh-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px}.logs-content[_ngcontent-%COMP%]{margin:0;padding:.5rem .75rem;font-family:Courier New,Courier,monospace;font-size:.72rem;line-height:1.5;color:var(--color-text);white-space:pre-wrap;word-break:break-all;max-height:200px;overflow-y:auto}.logs-content[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px}.logs-content[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.logs-content[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-text-secondary);border-radius:3px}"]})};function SC(o,t){if(o&1&&(s(0,"div",3),p(1),l()),o&2){let e=u();d(),te("\u274C ",e.errorMessage)}}var ua=class o{dialogRef=m(ei);data=m(ji);jsonContent;errorMessage="";title;constructor(){this.jsonContent=this.data.initialContent,this.title=this.data.title||this.getDefaultTitle(this.data.configType,this.data.projectName)}getDefaultTitle(t,e){return t==="user"?"User Configuration":`Project Configuration: ${e||"Unknown"}`}onSave(){this.errorMessage="";let t;try{t=JSON.parse(this.jsonContent)}catch(e){this.errorMessage=`Invalid JSON syntax: ${e instanceof Error?e.message:"Unknown error"}`;return}this.dialogRef.close(t)}onCancel(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-json-editor"]],decls:13,vars:3,consts:[["mat-dialog-title",""],["mat-icon-button","","title","Close",1,"close-button",3,"click"],["spellcheck","false","placeholder","Enter JSON configuration...",1,"json-textarea",3,"ngModelChange","ngModel"],[1,"error-message"],["align","end"],["matButton","",3,"click"],["matButton","filled","color","primary",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0),p(1),s(2,"button",1),_("click",function(){return i.onCancel()}),s(3,"mat-icon"),p(4,"close"),l()()(),s(5,"mat-dialog-content")(6,"textarea",2),B("ngModelChange",function(r){return j(i.jsonContent,r)||(i.jsonContent=r),r}),l(),C(7,SC,2,1,"div",3),l(),s(8,"mat-dialog-actions",4)(9,"button",5),_("click",function(){return i.onCancel()}),p(10,"Cancel"),l(),s(11,"button",6),_("click",function(){return i.onSave()}),p(12,"Save"),l()()),e&2&&(d(),te(" ",i.title," "),d(5),z("ngModel",i.jsonContent),d(),x(i.errorMessage?7:-1))},dependencies:[Pe,je,Le,Ve,ze,he,Qe,Et,pn,hn,un],styles:["[mat-dialog-title][_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}[mat-dialog-title][_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]{margin-left:auto}mat-dialog-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;min-height:400px}.json-textarea[_ngcontent-%COMP%]{flex:1;min-height:300px;max-height:80vh;padding:1rem;font-family:Monaco,Menlo,Ubuntu Mono,Consolas,monospace;font-size:.875rem;line-height:1.5;background:var(--color-code-bg);color:var(--color-text);border:1px solid var(--color-border);border-radius:4px;resize:vertical;outline:none;transition:border-color .2s}.json-textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.json-textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);opacity:.6}.error-message[_ngcontent-%COMP%]{padding:.75rem 1rem;border-radius:4px;font-size:.875rem;line-height:1.4;background:#dc26261a;color:#dc2626;border:1px solid rgba(220,38,38,.3)}"]})};function kC(o,t){if(o&1){let e=M();s(0,"div",9)(1,"mat-form-field",18)(2,"mat-label"),p(3),l(),s(4,"textarea",19),B("ngModelChange",function(n){let r=v(e).$index,a=u();return j(a.commands[r],n)||(a.commands[r]=n),y(n)}),l(),s(5,"mat-hint"),p(6,"Use placeholder for dynamic values"),l()(),s(7,"button",20),_("click",function(){let n=v(e).$index,r=u();return y(r.removeCommand(n))}),s(8,"mat-icon"),p(9,"delete"),l()()()}if(o&2){let e=t.$index,i=u();d(3),te("Prompt ",e+1),d(),z("ngModel",i.commands[e]),d(3),w("disabled",i.commands.length===1)}}function MC(o,t){if(o&1){let e=M();s(0,"div",10)(1,"h3"),p(2,"Save to"),l(),s(3,"div",21)(4,"label",22)(5,"input",23),B("ngModelChange",function(n){v(e);let r=u();return j(r.source,n)||(r.source=n),y(n)}),l(),s(6,"div",24)(7,"div",25)(8,"span",26),p(9,"\u{1F464}"),l(),s(10,"span",27),p(11,"Local"),l()(),s(12,"p",28),p(13,"Personal prompt in ~/.coday/... (not committed)"),l()()(),s(14,"label",22)(15,"input",29),B("ngModelChange",function(n){v(e);let r=u();return j(r.source,n)||(r.source=n),y(n)}),l(),s(16,"div",24)(17,"div",25)(18,"span",26),p(19,"\u{1F4E6}"),l(),s(20,"span",27),p(21,"Project"),l()(),s(22,"p",28),p(23,"Shared prompt in ./prompts/ (committable)"),l()()()(),s(24,"p",30),p(25,"Storage location is permanent and cannot be changed after creation"),l()()}if(o&2){let e=u();d(4),E("selected",e.source==="local"),d(),z("ngModel",e.source),d(9),E("selected",e.source==="project"),d(),z("ngModel",e.source)}}function TC(o,t){if(o&1&&(s(0,"div",11)(1,"h3"),p(2,"Storage Location"),l(),s(3,"div",31)(4,"span",26),p(5),l(),s(6,"span",27),p(7),l()(),s(8,"p",30),p(9,"Cannot be changed after creation"),l()()),o&2){let e=u();d(3),E("badge-local",e.source==="local")("badge-project",e.source==="project"),d(2),F(e.source==="local"?"\u{1F464}":"\u{1F4E6}"),d(2),F(e.source==="local"?"Local":"Project")}}function EC(o,t){if(o&1){let e=M();s(0,"div",12)(1,"label",32)(2,"input",33),B("ngModelChange",function(n){v(e);let r=u();return j(r.webhookEnabled,n)||(r.webhookEnabled=n),y(n)}),l(),s(3,"span"),p(4,"Enable webhook"),l()(),s(5,"p",30),p(6,"Enable webhook to trigger this prompt via HTTP POST"),l()()}if(o&2){let e=u();d(2),z("ngModel",e.webhookEnabled)}}function PC(o,t){if(o&1){let e=M();s(0,"div",13)(1,"div",34)(2,"mat-icon",35),p(3,"link"),l(),s(4,"h4"),p(5,"Webhook URL"),l()(),s(6,"div",36)(7,"p",37),p(8),l(),s(9,"button",38),_("click",function(){v(e);let n=u();return y(n.copyWebhookUrl())}),s(10,"mat-icon"),p(11,"content_copy"),l(),s(12,"span"),p(13,"Copy URL"),l()()(),s(14,"p",30),p(15,"Use this URL to trigger the prompt via HTTP POST"),l()()}if(o&2){let e=u();d(8),F(e.getWebhookUrl())}}function OC(o,t){if(o&1&&(s(0,"div",14)(1,"mat-icon"),p(2,"error"),l(),s(3,"span"),p(4),l()()),o&2){let e=u();d(4),F(e.errorMessage)}}var ga=class o{promptApi=m(ci);dialogRef=m(ei);configApi=m(Qi);snackBar=m(qr);name="";description="";commands=[""];webhookEnabled=!1;threadLifetime="";source="local";isSaving=!1;errorMessage="";isAdmin=!1;isEditMode=!1;promptId="";data=m(ji);constructor(){this.isEditMode=this.data.mode==="edit"}ngOnInit(){this.configApi.getUserConfig().subscribe({next:t=>{this.isAdmin=t.groups?.includes("CODAY_ADMIN")??!1},error:t=>{console.error("[PROMPT_FORM] Error loading user config:",t),this.isAdmin=!1}}),this.isEditMode&&this.data.prompt&&(this.promptId=this.data.prompt.id,this.name=this.data.prompt.name,this.description=this.data.prompt.description,this.commands=[...this.data.prompt.commands],this.webhookEnabled=this.data.prompt.webhookEnabled,this.source=this.data.prompt.source)}addCommand(){this.commands.push("")}removeCommand(t){this.commands.length>1&&this.commands.splice(t,1)}trackByIndex(t){return t}normalizeName(){this.name=this.name.replace(/[\s_.,;:!?()[\]{}]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase()}validateForm(){return this.name.trim()?this.description.trim()?this.commands.filter(e=>e.trim()).length===0?(this.errorMessage="At least one command is required",!1):!0:(this.errorMessage="Description is required",!1):(this.errorMessage="Name is required",!1)}save(){if(this.errorMessage="",!this.validateForm())return;let t=this.commands.filter(e=>e.trim());if(this.isSaving=!0,this.isEditMode&&this.data.prompt){let e={name:this.name.trim(),description:this.description.trim(),commands:t,webhookEnabled:this.webhookEnabled};this.promptApi.updatePrompt(this.data.prompt.id,e).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:i=>{console.error("Error updating prompt:",i),this.errorMessage=i?.error?.error||i?.message||"Failed to update prompt",this.isSaving=!1}})}else{let e={name:this.name.trim(),description:this.description.trim(),commands:t,webhookEnabled:this.webhookEnabled,source:this.source};this.promptApi.createPrompt(e).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:i=>{console.error("Error creating prompt:",i),this.errorMessage=i?.error?.error||i?.message||"Failed to create prompt",this.isSaving=!1}})}}cancel(){this.dialogRef.close(!1)}getWebhookUrl(){return`${window.location.origin}/api/webhooks/${this.promptId}/execute`}copyWebhookUrl(){if(!this.webhookEnabled){this.snackBar.open("Webhook is not enabled","Close",{duration:3e3});return}if(!this.promptId){this.snackBar.open("Prompt must be saved before getting webhook URL","Close",{duration:3e3});return}let t=this.getWebhookUrl();navigator.clipboard.writeText(t).then(()=>{this.snackBar.open("Webhook URL copied to clipboard!","Close",{duration:3e3})}).catch(e=>{console.error("Failed to copy webhook URL:",e),this.snackBar.open("Failed to copy URL","Close",{duration:3e3})})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-prompt-form"]],decls:36,vars:11,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","my-prompt","required","",3,"ngModelChange","blur","ngModel"],["matInput","","placeholder","What does this prompt do?","rows","3","required","",3,"ngModelChange","ngModel"],[1,"commands-section"],[1,"section-header"],["mat-icon-button","","type","button","title","Add command",3,"click"],[1,"commands-list"],[1,"command-item"],[1,"source-section"],[1,"source-display"],[1,"webhook-section"],[1,"webhook-url-section"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],["appearance","outline",1,"command-field"],["matInput","","placeholder","Enter command with placeholders like \\{\\{key\\}\\}","rows","2",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove command",1,"remove-btn",3,"click","disabled"],[1,"source-options"],[1,"source-option"],["type","radio","name","source","value","local",3,"ngModelChange","ngModel"],[1,"source-content"],[1,"source-header"],[1,"source-icon"],[1,"source-label"],[1,"source-description"],["type","radio","name","source","value","project",3,"ngModelChange","ngModel"],[1,"hint"],[1,"source-badge"],[1,"checkbox-label"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"webhook-url-header"],[1,"webhook-icon"],[1,"webhook-url-content"],[1,"url-text"],["mat-raised-button","","color","accent","type","button",3,"click"]],template:function(e,i){e&1&&(s(0,"h2",0),p(1),l(),s(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),p(6,"Name"),l(),s(7,"input",3),B("ngModelChange",function(r){return j(i.name,r)||(i.name=r),r}),_("blur",function(){return i.normalizeName()}),l(),s(8,"mat-hint"),p(9,"A descriptive name (spaces and punctuation will be replaced with hyphens), will be used as command name"),l()(),s(10,"mat-form-field",2)(11,"mat-label"),p(12,"Description"),l(),s(13,"textarea",4),B("ngModelChange",function(r){return j(i.description,r)||(i.description=r),r}),l(),s(14,"mat-hint"),p(15,"Explain the purpose of this prompt, helps for searchability"),l()(),s(16,"div",5)(17,"div",6)(18,"h3"),p(19,"Prompts"),l(),s(20,"button",7),_("click",function(){return i.addCommand()}),s(21,"mat-icon"),p(22,"add"),l()()(),s(23,"div",8),xe(24,kC,10,3,"div",9,Kn),l()(),C(26,MC,26,6,"div",10),C(27,TC,10,6,"div",11),C(28,EC,7,1,"div",12),C(29,PC,16,1,"div",13),C(30,OC,5,1,"div",14),l()(),s(31,"mat-dialog-actions",15)(32,"button",16),_("click",function(){return i.cancel()}),p(33,"Cancel"),l(),s(34,"button",17),_("click",function(){return i.save()}),p(35),l()()),e&2&&(d(),F(i.isEditMode?"Edit Prompt":"Create Prompt"),d(6),z("ngModel",i.name),d(6),z("ngModel",i.description),d(11),we(i.commands),d(2),x(i.isEditMode?-1:26),d(),x(i.isEditMode?27:-1),d(),x(i.isAdmin?28:-1),d(),x(i.isEditMode&&i.webhookEnabled&&i.isAdmin?29:-1),d(),x(i.errorMessage?30:-1),d(2),w("disabled",i.isSaving),d(2),w("disabled",i.isSaving),d(),te(" ",i.isSaving?"Saving...":"Save"," "))},dependencies:[Pe,je,Le,Wm,Ro,Ve,Fo,ze,ao,pn,un,hn,it,Et,Qe,Xt,di,jt,zt,yn,ct,Oe,he,$o],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:500px}@media (max-width: 768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.commands-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:.5rem}.commands-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.commands-section[_ngcontent-%COMP%] .commands-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .command-field[_ngcontent-%COMP%]{flex:1}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{margin-top:8px}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:not-allowed}.webhook-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{width:18px;height:18px;cursor:pointer}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.95rem}.webhook-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.85rem;color:var(--color-text-secondary)}.webhook-url-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.75rem}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%] .webhook-icon[_ngcontent-%COMP%]{color:var(--color-primary)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;margin-bottom:.5rem}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%] .url-text[_ngcontent-%COMP%]{flex:1;margin:0;padding:.75rem;background:var(--color-bg);border:1px solid var(--color-border);border-radius:4px;font-family:monospace;font-size:.85rem;word-break:break-all;color:var(--color-text)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{white-space:nowrap;display:flex;align-items:center;gap:.5rem}.webhook-url-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}.source-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.source-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 1rem;font-size:1rem;font-weight:600}.source-section[_ngcontent-%COMP%] .source-options[_ngcontent-%COMP%]{display:flex;gap:1rem;margin-bottom:.75rem}@media (max-width: 768px){.source-section[_ngcontent-%COMP%] .source-options[_ngcontent-%COMP%]{flex-direction:column}}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%]{flex:1;display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:var(--color-bg);border:2px solid var(--color-border);border-radius:8px;cursor:pointer;transition:all .2s ease}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%]:hover{border-color:var(--color-primary);background:var(--color-bg-hover)}.source-section[_ngcontent-%COMP%] .source-option.selected[_ngcontent-%COMP%]{border-color:var(--color-primary);background:var(--color-bg-hover);box-shadow:0 0 0 1px var(--color-primary)}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin-top:2px;cursor:pointer}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%]{flex:1}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.25rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-label[_ngcontent-%COMP%]{font-weight:600;font-size:.95rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-description[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);line-height:1.4}.source-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.thread-lifetime-disabled[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:#2196f30d;border:1px solid rgba(33,150,243,.2);border-radius:8px;margin-bottom:1rem}.thread-lifetime-disabled[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#2196f3cc;font-size:1.25rem;width:1.25rem;height:1.25rem;margin-top:2px}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;flex:1}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:.95rem;color:var(--color-text)}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{display:block;margin-top:.25rem;font-size:.85rem;color:var(--color-text-secondary);line-height:1.4}.source-display[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.source-display[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1rem;font-weight:600}.source-display[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem 1rem;border-radius:6px;font-size:.9rem;font-weight:500;margin-bottom:.5rem}.source-display[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.1rem}.source-display[_ngcontent-%COMP%] .source-badge.badge-local[_ngcontent-%COMP%]{background:#2196f31a;color:#2196f3;border:1px solid rgba(33,150,243,.3)}.source-display[_ngcontent-%COMP%] .source-badge.badge-project[_ngcontent-%COMP%]{background:#4caf501a;color:#4caf50;border:1px solid rgba(76,175,80,.3)}.source-display[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}"]})};function AC(o,t){o&1&&(s(0,"div",12),p(1,"Loading prompts..."),l())}function IC(o,t){if(o&1&&(s(0,"div",13),p(1),l()),o&2){let e=u();d(),F(e.errorMessage)}}function DC(o,t){o&1&&(s(0,"div",14),p(1," No prompts found. Create your first prompt to get started. "),l())}function RC(o,t){o&1&&(s(0,"div",14),p(1," No prompts match your search. "),l())}function FC(o,t){if(o&1&&(s(0,"span",31),p(1),l()),o&2){let e=u().$implicit;w("title",Tn("Created by ",e.createdBy)),d(),te(" \u{1F464} ",e.createdBy," ")}}function NC(o,t){if(o&1){let e=M();s(0,"button",32),_("click",function(){v(e);let n=u().$implicit,r=u(2);return y(r.toggleWebhook(n))}),p(1),l()}if(o&2){let e=u().$implicit;E("btn-webhook-enabled",e.webhookEnabled)("btn-webhook-disabled",!e.webhookEnabled),d(),te(" ",e.webhookEnabled?"Disable Webhook":"Enable Webhook"," ")}}function LC(o,t){if(o&1){let e=M();s(0,"div",17)(1,"div",18)(2,"div",19)(3,"h3"),p(4),l(),s(5,"div",20)(6,"span",21),p(7),l(),$e(8,FC,2,3,"span",22),l()(),s(9,"p",23),p(10),l(),s(11,"div",24)(12,"span",25),p(13),l(),s(14,"span",26),p(15),l()()(),s(16,"div",27)(17,"button",28),_("click",function(){let n=v(e).$implicit,r=u(2);return y(r.editPrompt(n))}),p(18,"Edit"),l(),$e(19,NC,2,5,"button",29),s(20,"button",30),_("click",function(){let n=v(e).$implicit,r=u(2);return y(r.deletePrompt(n.id))}),p(21,"Delete"),l()()()}if(o&2){let e=t.$implicit,i=u(2);d(4),F(e.name),d(2),E("badge-local",e.source==="local")("badge-project",e.source==="project"),w("title",e.source==="local"?"Local prompt (~/.coday/)":"Project prompt (./prompts/)"),d(),te(" ",e.source==="local"?"\u{1F464}":"\u{1F4E6}"," "),d(),w("ngIf",e.createdBy!==i.getCurrentUsername()),d(2),F(e.description),d(3),te("ID: ",e.id),d(),E("enabled",e.webhookEnabled),d(),te(" Webhook: ",e.webhookEnabled?"Enabled":"Disabled"," "),d(4),w("ngIf",i.isAdmin)}}function VC(o,t){if(o&1&&(s(0,"div",15),$e(1,LC,22,14,"div",16),l()),o&2){let e=u();d(),w("ngForOf",e.filteredPrompts)}}var xl=class o{promptApi=m(ci);dialog=m(yi);configApi=m(Qi);prompts=[];filteredPrompts=[];searchQuery="";showOnlyMine=!0;isLoading=!1;errorMessage="";isAdmin=!1;currentUsername="";ngOnInit(){this.configApi.getUserConfig().subscribe({next:t=>{this.isAdmin=t.groups?.includes("CODAY_ADMIN")??!1,this.currentUsername=t.username??"",console.log("[PROMPT_MANAGER] Current username:",this.currentUsername)},error:t=>{console.error("[PROMPT_MANAGER] Error loading user config:",t),this.isAdmin=!1}}),this.loadPrompts()}loadPrompts(){this.isLoading=!0,this.promptApi.listPrompts().subscribe({next:t=>{this.prompts=t,this.applyFilter(),this.isLoading=!1},error:t=>{console.error("Error loading prompts:",t),this.errorMessage="Failed to load prompts",this.isLoading=!1}})}deletePrompt(t){confirm("Are you sure you want to delete this prompt?")&&this.promptApi.deletePrompt(t).subscribe({next:()=>{this.loadPrompts()},error:e=>{console.error("Error deleting prompt:",e);let i=e?.error?.error??e?.message??"Failed to delete prompt";alert(`Failed to delete prompt: ${i}`)}})}toggleWebhook(t){(t.webhookEnabled?this.promptApi.disableWebhook(t.id):this.promptApi.enableWebhook(t.id)).subscribe({next:()=>{this.loadPrompts()},error:i=>{console.error("Error toggling webhook:",i);let n=i?.error?.error??i?.message??"Failed to toggle webhook";alert(`Failed to toggle webhook: ${n}`)}})}createPrompt(){this.dialog.open(ga,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadPrompts()})}getCurrentUsername(){return this.currentUsername}normalizeUsername(t){return t.replace(/[.\s]+/g,"_")}isMyPrompt(t){if(!this.currentUsername)return!1;let e=this.normalizeUsername(this.currentUsername.toLowerCase());return this.normalizeUsername(t.createdBy.toLowerCase())===e}applyFilter(){let t=this.searchQuery.toLowerCase().trim(),e=this.showOnlyMine&&this.currentUsername?this.prompts.filter(i=>this.isMyPrompt(i)):[...this.prompts];t&&(e=e.filter(i=>i.name.toLowerCase().includes(t)||i.description.toLowerCase().includes(t)?!0:i.createdBy.toLowerCase().includes(t))),this.filteredPrompts=e}onSearchChange(){this.applyFilter()}editPrompt(t){this.promptApi.getPrompt(t.id).subscribe({next:e=>{this.dialog.open(ga,{width:"700px",maxHeight:"90vh",data:{mode:"edit",prompt:e}}).afterClosed().subscribe(n=>{n&&this.loadPrompts()})},error:e=>{console.error("Error loading prompt details:",e);let i=e?.error?.error??e?.message??"Failed to load prompt details";alert(`Failed to load prompt details: ${i}`)}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-prompt-manager"]],decls:23,vars:7,consts:[[1,"prompt-manager"],[1,"header"],[1,"header-actions"],["appearance","outline",1,"search-field"],["matInput","","placeholder","Name, description, author...",3,"ngModelChange","input","ngModel"],["matPrefix",""],["color","primary",1,"mine-toggle",3,"ngModelChange","change","ngModel"],[1,"btn-create",3,"click"],["class","loading",4,"ngIf"],["class","error",4,"ngIf"],["class","empty",4,"ngIf"],["class","prompt-list",4,"ngIf"],[1,"loading"],[1,"error"],[1,"empty"],[1,"prompt-list"],["class","prompt-item",4,"ngFor","ngForOf"],[1,"prompt-item"],[1,"prompt-info"],[1,"prompt-header"],[1,"badges"],[1,"source-badge",3,"title"],["class","owner-badge",3,"title",4,"ngIf"],[1,"description"],[1,"meta"],["title","Prompt ID",1,"prompt-id"],[1,"webhook-status"],[1,"prompt-actions"],[1,"btn-primary",3,"click"],[3,"btn-webhook-enabled","btn-webhook-disabled","click",4,"ngIf"],[1,"btn-danger",3,"click"],[1,"owner-badge",3,"title"],[3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"h2"),p(3,"Prompts"),l(),s(4,"div",2)(5,"mat-form-field",3)(6,"mat-label"),p(7,"Search"),l(),s(8,"input",4),B("ngModelChange",function(r){return j(i.searchQuery,r)||(i.searchQuery=r),r}),_("input",function(){return i.onSearchChange()}),l(),s(9,"mat-icon",5),p(10,"search"),l()(),s(11,"mat-slide-toggle",6),B("ngModelChange",function(r){return j(i.showOnlyMine,r)||(i.showOnlyMine=r),r}),_("change",function(){return i.applyFilter()}),p(12," Mine "),l(),s(13,"button",7),_("click",function(){return i.createPrompt()}),s(14,"mat-icon"),p(15,"add"),l(),s(16,"span"),p(17,"Create Prompt"),l()()()(),$e(18,AC,2,0,"div",8)(19,IC,2,1,"div",9)(20,DC,2,0,"div",10)(21,RC,2,0,"div",10)(22,VC,2,1,"div",11),l()),e&2&&(d(8),z("ngModel",i.searchQuery),d(3),z("ngModel",i.showOnlyMine),d(7),w("ngIf",i.isLoading),d(),w("ngIf",i.errorMessage),d(),w("ngIf",!i.isLoading&&i.prompts.length===0),d(),w("ngIf",!i.isLoading&&i.prompts.length>0&&i.filteredPrompts.length===0),d(),w("ngIf",!i.isLoading&&i.filteredPrompts.length>0))},dependencies:[Pe,Fa,Na,je,Le,Ve,ze,Oe,he,Xt,di,jt,zt,go,ct,_l,uo],styles:[".prompt-manager[_ngcontent-%COMP%]{padding:1.5rem .5rem 1.5rem 1.5rem}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem;padding-right:1rem}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .search-field[_ngcontent-%COMP%]{width:300px;margin-bottom:-1.25em}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .mine-toggle[_ngcontent-%COMP%]{margin-bottom:-1.25em}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1.5rem;border:none;border-radius:4px;background:var(--color-primary);color:#fff;cursor:pointer;font-size:1rem;font-weight:500;white-space:nowrap}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]:hover{opacity:.9}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.loading[_ngcontent-%COMP%], .error[_ngcontent-%COMP%], .empty[_ngcontent-%COMP%]{padding:1rem 1.5rem 1rem 1rem;text-align:center;color:var(--color-text-secondary)}.error[_ngcontent-%COMP%]{color:var(--color-error)}.prompt-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding-right:1rem}.prompt-item[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;padding:1rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-surface)}.prompt-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.prompt-info[_ngcontent-%COMP%]{flex:1}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:.5rem}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1.1rem;flex:1}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] .badges[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] .badges[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:6px;font-size:1rem;cursor:help}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] .badges[_ngcontent-%COMP%] .source-badge.badge-local[_ngcontent-%COMP%]{background:#2196f31a;border:1px solid rgba(33,150,243,.3)}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] .badges[_ngcontent-%COMP%] .source-badge.badge-project[_ngcontent-%COMP%]{background:#4caf501a;border:1px solid rgba(76,175,80,.3)}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] .badges[_ngcontent-%COMP%] .owner-badge[_ngcontent-%COMP%]{font-size:.75rem;padding:.25rem .5rem;background:#2196f3;color:#fff;border-radius:4px;font-weight:400;white-space:nowrap}.prompt-info[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{margin:0 0 .5rem;color:var(--color-text-secondary)}.prompt-info[_ngcontent-%COMP%] .meta[_ngcontent-%COMP%]{display:flex;gap:1rem;font-size:.85rem;color:var(--color-text-secondary)}.prompt-info[_ngcontent-%COMP%] .meta[_ngcontent-%COMP%] .prompt-id[_ngcontent-%COMP%]{font-family:monospace;opacity:.7}.prompt-info[_ngcontent-%COMP%] .meta[_ngcontent-%COMP%] .webhook-status.enabled[_ngcontent-%COMP%]{color:var(--color-success);font-weight:600}.prompt-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.prompt-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:.5rem 1rem;border:none;border-radius:4px;cursor:pointer;font-size:.9rem}.prompt-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]{background:var(--color-primary);color:#fff}.prompt-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover{opacity:.9}.prompt-actions[_ngcontent-%COMP%] button.btn-secondary[_ngcontent-%COMP%]{background:var(--color-secondary);color:#fff}.prompt-actions[_ngcontent-%COMP%] button.btn-secondary[_ngcontent-%COMP%]:hover{opacity:.9}.prompt-actions[_ngcontent-%COMP%] button.btn-webhook-enabled[_ngcontent-%COMP%]{background:#ff9800;color:#fff}.prompt-actions[_ngcontent-%COMP%] button.btn-webhook-enabled[_ngcontent-%COMP%]:hover{opacity:.9}.prompt-actions[_ngcontent-%COMP%] button.btn-webhook-disabled[_ngcontent-%COMP%]{background:#9e9e9e;color:#fff}.prompt-actions[_ngcontent-%COMP%] button.btn-webhook-disabled[_ngcontent-%COMP%]:hover{opacity:.9}.prompt-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]{background:var(--color-error);color:#fff}.prompt-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]:hover{opacity:.9}"]})};var yr=class o{http=m(Ye);projectState=m(Se);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/schedulers`}listSchedulers(){return this.http.get(this.getBaseUrl())}getScheduler(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createScheduler(t){return this.http.post(this.getBaseUrl(),t)}updateScheduler(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,e)}deleteScheduler(t){return this.http.delete(`${this.getBaseUrl()}/${t}`)}enableScheduler(t){return this.http.post(`${this.getBaseUrl()}/${t}/enable`,{})}disableScheduler(t){return this.http.post(`${this.getBaseUrl()}/${t}/disable`,{})}runSchedulerNow(t){return this.http.post(`${this.getBaseUrl()}/${t}/run-now`,{})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var wl=(()=>{class o{_animationsDisabled=He();state="unchecked";disabled=!1;appearance="full";constructor(){}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:12,hostBindings:function(i,n){i&2&&E("mat-pseudo-checkbox-indeterminate",n.state==="indeterminate")("mat-pseudo-checkbox-checked",n.state==="checked")("mat-pseudo-checkbox-disabled",n.disabled)("mat-pseudo-checkbox-minimal",n.appearance==="minimal")("mat-pseudo-checkbox-full",n.appearance==="full")("_mat-animation-noopable",n._animationsDisabled)},inputs:{state:"state",disabled:"disabled",appearance:"appearance"},decls:0,vars:0,template:function(i,n){},styles:[`.mat-pseudo-checkbox{border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:"";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox._mat-animation-noopable{transition:none !important;animation:none !important}.mat-pseudo-checkbox._mat-animation-noopable::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{left:1px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{left:1px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-pseudo-checkbox-minimal-selected-checkmark-color, var(--mat-sys-primary))}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full{border-color:var(--mat-pseudo-checkbox-full-unselected-icon-color, var(--mat-sys-on-surface-variant));border-width:2px;border-style:solid}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-disabled{border-color:var(--mat-pseudo-checkbox-full-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate{background-color:var(--mat-pseudo-checkbox-full-selected-icon-color, var(--mat-sys-primary));border-color:rgba(0,0,0,0)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-pseudo-checkbox-full-selected-checkmark-color, var(--mat-sys-on-primary))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled{background-color:var(--mat-pseudo-checkbox-full-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-pseudo-checkbox-full-disabled-selected-checkmark-color, var(--mat-sys-surface))}.mat-pseudo-checkbox{width:18px;height:18px}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after{width:14px;height:6px;transform-origin:center;top:-4.2426406871px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{top:8px;width:16px}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after{width:10px;height:4px;transform-origin:center;top:-2.8284271247px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{top:6px;width:12px}
|
|
373
|
-
`],encapsulation:2,changeDetection:0})}return o})();var zC=["text"],jC=[[["mat-icon"]],"*"],BC=["mat-icon","*"];function HC(o,t){if(o&1&&
|
|
374
|
-
`],encapsulation:2,changeDetection:0})}return o})();function lg(o,t,e){if(e.length){let i=t.toArray(),n=e.toArray(),r=0;for(let a=0;a<o+1;a++)i[a].group&&i[a].group===n[r]&&r++;return r}return 0}function cg(o,t,e,i){return o<e?o:o+t>e+i?Math.max(0,o-i+t):e}var _o=class{_multiple;_emitChanges;compareWith;_selection=new Set;_deselectedToEmit=[];_selectedToEmit=[];_selected;get selected(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}changed=new R;constructor(t=!1,e,i=!0,n){this._multiple=t,this._emitChanges=i,this.compareWith=n,e&&e.length&&(t?e.forEach(r=>this._markSelected(r)):this._markSelected(e[0]),this._selectedToEmit.length=0)}select(...t){this._verifyValueAssignment(t),t.forEach(i=>this._markSelected(i));let e=this._hasQueuedChanges();return this._emitChangeEvent(),e}deselect(...t){this._verifyValueAssignment(t),t.forEach(i=>this._unmarkSelected(i));let e=this._hasQueuedChanges();return this._emitChangeEvent(),e}setSelection(...t){this._verifyValueAssignment(t);let e=this.selected,i=new Set(t.map(r=>this._getConcreteValue(r)));t.forEach(r=>this._markSelected(r)),e.filter(r=>!i.has(this._getConcreteValue(r,i))).forEach(r=>this._unmarkSelected(r));let n=this._hasQueuedChanges();return this._emitChangeEvent(),n}toggle(t){return this.isSelected(t)?this.deselect(t):this.select(t)}clear(t=!0){this._unmarkAll();let e=this._hasQueuedChanges();return t&&this._emitChangeEvent(),e}isSelected(t){return this._selection.has(this._getConcreteValue(t))}isEmpty(){return this._selection.size===0}hasValue(){return!this.isEmpty()}sort(t){this._multiple&&this.selected&&this._selected.sort(t)}isMultipleSelection(){return this._multiple}_emitChangeEvent(){this._selected=null,(this._selectedToEmit.length||this._deselectedToEmit.length)&&(this.changed.next({source:this,added:this._selectedToEmit,removed:this._deselectedToEmit}),this._deselectedToEmit=[],this._selectedToEmit=[])}_markSelected(t){t=this._getConcreteValue(t),this.isSelected(t)||(this._multiple||this._unmarkAll(),this.isSelected(t)||this._selection.add(t),this._emitChanges&&this._selectedToEmit.push(t))}_unmarkSelected(t){t=this._getConcreteValue(t),this.isSelected(t)&&(this._selection.delete(t),this._emitChanges&&this._deselectedToEmit.push(t))}_unmarkAll(){this.isEmpty()||this._selection.forEach(t=>this._unmarkSelected(t))}_verifyValueAssignment(t){t.length>1&&this._multiple}_hasQueuedChanges(){return!!(this._deselectedToEmit.length||this._selectedToEmit.length)}_getConcreteValue(t,e){if(this.compareWith){e=e??this._selection;for(let i of e)if(this.compareWith(t,i))return i;return t}else return t}};var dg=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({imports:[ae]})}return o})();var Pd=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({imports:[qa,ae,dg,fo]})}return o})();var qC=["trigger"],GC=["panel"],YC=[[["mat-select-trigger"]],"*"],QC=["mat-select-trigger","*"];function XC(o,t){if(o&1&&(s(0,"span",4),p(1),l()),o&2){let e=u();d(),F(e.placeholder)}}function KC(o,t){o&1&&me(0)}function ZC(o,t){if(o&1&&(s(0,"span",11),p(1),l()),o&2){let e=u(2);d(),F(e.triggerValue)}}function JC(o,t){if(o&1&&(s(0,"span",5),C(1,KC,1,0)(2,ZC,2,1,"span",11),l()),o&2){let e=u();d(),x(e.customTrigger?1:2)}}function ex(o,t){if(o&1){let e=M();s(0,"div",12,1),_("keydown",function(n){v(e);let r=u();return y(r._handleKeydown(n))}),me(2,1),l()}if(o&2){let e=u();tn(Tn("mat-mdc-select-panel mdc-menu-surface mdc-menu-surface--open ",e._getPanelTheme())),E("mat-select-panel-animations-enabled",!e._animationsDisabled),w("ngClass",e.panelClass),X("id",e.id+"-panel")("aria-multiselectable",e.multiple)("aria-label",e.ariaLabel||null)("aria-labelledby",e._getPanelAriaLabelledby())}}var Id=new ne("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let o=m(be);return()=>zi(o)}});function mg(o){let t=m(be);return()=>zi(t)}var pg=new ne("MAT_SELECT_CONFIG"),hg={provide:Id,deps:[],useFactory:mg},ug=new ne("MatSelectTrigger"),Ml=class{source;value;constructor(t,e){this.source=t,this.value=e}},Dd=(()=>{class o{_viewportRuler=m(Vi);_changeDetectorRef=m(Ge);_elementRef=m(ie);_dir=m(ft,{optional:!0});_idGenerator=m(Re);_renderer=m(yt);_parentFormField=m(ha,{optional:!0});ngControl=m(Xa,{self:!0,optional:!0});_liveAnnouncer=m(Wa);_defaultOptions=m(pg,{optional:!0});_animationsDisabled=He();_initialized=new R;_cleanupDetach;options;optionGroups;customTrigger;_positions=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"}];_scrollOptionIntoView(e){let i=this.options.toArray()[e];if(i){let n=this.panel.nativeElement,r=lg(e,this.options,this.optionGroups),a=i._getHostElement();e===0&&r===1?n.scrollTop=0:n.scrollTop=cg(a.offsetTop,a.offsetHeight,n.scrollTop,n.offsetHeight)}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0)}_getChangeEvent(e){return new Ml(this,e)}_scrollStrategyFactory=m(Id);_panelOpen=!1;_compareWith=(e,i)=>e===i;_uid=this._idGenerator.getId("mat-select-");_triggerAriaLabelledBy=null;_previousControl;_destroy=new R;_errorStateTracker;stateChanges=new R;disableAutomaticLabeling=!0;userAriaDescribedBy;_selectionModel;_keyManager;_preferredOverlayOrigin;_overlayWidth;_onChange=()=>{};_onTouched=()=>{};_valueId=this._idGenerator.getId("mat-select-value-");_scrollStrategy;_overlayPanelClass=this._defaultOptions?.overlayPanelClass||"";get focused(){return this._focused||this._panelOpen}_focused=!1;controlType="mat-select";trigger;panel;_overlayDir;panelClass;disabled=!1;get disableRipple(){return this._disableRipple()}set disableRipple(e){this._disableRipple.set(e)}_disableRipple=Ee(!1);tabIndex=0;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties()}_hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??!1;get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.stateChanges.next()}_placeholder;get required(){return this._required??this.ngControl?.control?.hasValidator(Qa.required)??!1}set required(e){this._required=e,this.stateChanges.next()}_required;get multiple(){return this._multiple}set multiple(e){this._selectionModel,this._multiple=e}_multiple=!1;disableOptionCentering=this._defaultOptions?.disableOptionCentering??!1;get compareWith(){return this._compareWith}set compareWith(e){this._compareWith=e,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(e){this._assignValue(e)&&this._onChange(e)}_value;ariaLabel="";ariaLabelledby;get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}typeaheadDebounceInterval;sortComparator;get id(){return this._id}set id(e){this._id=e||this._uid,this.stateChanges.next()}_id;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}panelWidth=this._defaultOptions&&typeof this._defaultOptions.panelWidth<"u"?this._defaultOptions.panelWidth:"auto";canSelectNullableOptions=this._defaultOptions?.canSelectNullableOptions??!1;optionSelectionChanges=To(()=>{let e=this.options;return e?e.changes.pipe(kt(e),Yn(()=>Ai(...e.map(i=>i.onSelectionChange)))):this._initialized.pipe(Yn(()=>this.optionSelectionChanges))});openedChange=new U;_openedStream=this.openedChange.pipe(ce(e=>e),_e(()=>{}));_closedStream=this.openedChange.pipe(ce(e=>!e),_e(()=>{}));selectionChange=new U;valueChange=new U;constructor(){let e=m(vl),i=m(Ka,{optional:!0}),n=m(Ja,{optional:!0}),r=m(new En("tabindex"),{optional:!0});this.ngControl&&(this.ngControl.valueAccessor=this),this._defaultOptions?.typeaheadDebounceInterval!=null&&(this.typeaheadDebounceInterval=this._defaultOptions.typeaheadDebounceInterval),this._errorStateTracker=new br(e,this.ngControl,n,i,this.stateChanges),this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=r==null?0:parseInt(r)||0,this.id=this.id}ngOnInit(){this._selectionModel=new _o(this.multiple),this.stateChanges.next(),this._viewportRuler.change().pipe(L(this._destroy)).subscribe(()=>{this.panelOpen&&(this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._changeDetectorRef.detectChanges())})}ngAfterContentInit(){this._initialized.next(),this._initialized.complete(),this._initKeyManager(),this._selectionModel.changed.pipe(L(this._destroy)).subscribe(e=>{e.added.forEach(i=>i.select()),e.removed.forEach(i=>i.deselect())}),this.options.changes.pipe(kt(null),L(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){let e=this._getTriggerAriaLabelledby(),i=this.ngControl;if(e!==this._triggerAriaLabelledBy){let n=this._elementRef.nativeElement;this._triggerAriaLabelledBy=e,e?n.setAttribute("aria-labelledby",e):n.removeAttribute("aria-labelledby")}i&&(this._previousControl!==i.control&&(this._previousControl!==void 0&&i.disabled!==null&&i.disabled!==this.disabled&&(this.disabled=i.disabled),this._previousControl=i.control),this.updateErrorState())}ngOnChanges(e){(e.disabled||e.userAriaDescribedBy)&&this.stateChanges.next(),e.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this.typeaheadDebounceInterval)}ngOnDestroy(){this._cleanupDetach?.(),this._keyManager?.destroy(),this._destroy.next(),this._destroy.complete(),this.stateChanges.complete(),this._clearFromModal()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._parentFormField&&(this._preferredOverlayOrigin=this._parentFormField.getConnectedOverlayOrigin()),this._cleanupDetach?.(),this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._applyModalPanelOwnership(),this._panelOpen=!0,this._overlayDir.positionChange.pipe(Ut(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()}),this._overlayDir.attachOverlay(),this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!0)))}_trackedModal=null;_applyModalPanelOwnership(){let e=this._elementRef.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!e)return;let i=`${this.id}-panel`;this._trackedModal&&ec(this._trackedModal,"aria-owns",i),Vm(e,"aria-owns",i),this._trackedModal=e}_clearFromModal(){if(!this._trackedModal)return;let e=`${this.id}-panel`;ec(this._trackedModal,"aria-owns",e),this._trackedModal=null}close(){this._panelOpen&&(this._panelOpen=!1,this._exitAndDetach(),this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!1)))}_exitAndDetach(){if(this._animationsDisabled||!this.panel){this._detachOverlay();return}this._cleanupDetach?.(),this._cleanupDetach=()=>{i(),clearTimeout(n),this._cleanupDetach=void 0};let e=this.panel.nativeElement,i=this._renderer.listen(e,"animationend",r=>{r.animationName==="_mat-select-exit"&&(this._cleanupDetach?.(),this._detachOverlay())}),n=setTimeout(()=>{this._cleanupDetach?.(),this._detachOverlay()},200);e.classList.add("mat-select-panel-exit")}_detachOverlay(){this._overlayDir.detachOverlay(),this._changeDetectorRef.markForCheck()}writeValue(e){this._assignValue(e)}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel?.selected||[]:this._selectionModel?.selected[0]}get triggerValue(){if(this.empty)return"";if(this._multiple){let e=this._selectionModel.selected.map(i=>i.viewValue);return this._isRtl()&&e.reverse(),e.join(", ")}return this._selectionModel.selected[0].viewValue}updateErrorState(){this._errorStateTracker.updateErrorState()}_isRtl(){return this._dir?this._dir.value==="rtl":!1}_handleKeydown(e){this.disabled||(this.panelOpen?this._handleOpenKeydown(e):this._handleClosedKeydown(e))}_handleClosedKeydown(e){let i=e.keyCode,n=i===40||i===38||i===37||i===39,r=i===13||i===32,a=this._keyManager;if(!a.isTyping()&&r&&!gt(e)||(this.multiple||e.altKey)&&n)e.preventDefault(),this.open();else if(!this.multiple){let c=this.selected;a.onKeydown(e);let h=this.selected;h&&c!==h&&this._liveAnnouncer.announce(h.viewValue,1e4)}}_handleOpenKeydown(e){let i=this._keyManager,n=e.keyCode,r=n===40||n===38,a=i.isTyping();if(r&&e.altKey)e.preventDefault(),this.close();else if(!a&&(n===13||n===32)&&i.activeItem&&!gt(e))e.preventDefault(),i.activeItem._selectViaInteraction();else if(!a&&this._multiple&&n===65&&e.ctrlKey){e.preventDefault();let c=this.options.some(h=>!h.disabled&&!h.selected);this.options.forEach(h=>{h.disabled||(c?h.select():h.deselect())})}else{let c=i.activeItemIndex;i.onKeydown(e),this._multiple&&r&&e.shiftKey&&i.activeItem&&i.activeItemIndex!==c&&i.activeItem._selectViaInteraction()}}_handleOverlayKeydown(e){e.keyCode===27&&!gt(e)&&(e.preventDefault(),this.close())}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,this._keyManager?.cancelTypeahead(),!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}_getPanelTheme(){return this._parentFormField?`mat-${this._parentFormField.color}`:""}get empty(){return!this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this.ngControl&&(this._value=this.ngControl.value),this._setSelectionByValue(this._value),this.stateChanges.next()})}_setSelectionByValue(e){if(this.options.forEach(i=>i.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&e)Array.isArray(e),e.forEach(i=>this._selectOptionByValue(i)),this._sortValues();else{let i=this._selectOptionByValue(e);i?this._keyManager.updateActiveItem(i):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectOptionByValue(e){let i=this.options.find(n=>{if(this._selectionModel.isSelected(n))return!1;try{return(n.value!=null||this.canSelectNullableOptions)&&this._compareWith(n.value,e)}catch{return!1}});return i&&this._selectionModel.select(i),i}_assignValue(e){return e!==this._value||this._multiple&&Array.isArray(e)?(this.options&&this._setSelectionByValue(e),this._value=e,!0):!1}_skipPredicate=e=>this.panelOpen?!1:e.disabled;_getOverlayWidth(e){return this.panelWidth==="auto"?(e instanceof Ho?e.elementRef:e||this._elementRef).nativeElement.getBoundingClientRect().width:this.panelWidth===null?"":this.panelWidth}_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck()}_initKeyManager(){this._keyManager=new Lm(this.options).withTypeAhead(this.typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withPageUpDown().withAllowedModifierKeys(["shiftKey"]).skipPredicate(this._skipPredicate),this._keyManager.tabOut.subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction()})}_resetOptions(){let e=Ai(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(L(e)).subscribe(i=>{this._onSelect(i.source,i.isUserInput),i.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),Ai(...this.options.map(i=>i._stateChanges)).pipe(L(e)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this.stateChanges.next()})}_onSelect(e,i){let n=this._selectionModel.isSelected(e);!this.canSelectNullableOptions&&e.value==null&&!this._multiple?(e.deselect(),this._selectionModel.clear(),this.value!=null&&this._propagateChanges(e.value)):(n!==e.selected&&(e.selected?this._selectionModel.select(e):this._selectionModel.deselect(e)),i&&this._keyManager.setActiveItem(e),this.multiple&&(this._sortValues(),i&&this.focus())),n!==this._selectionModel.isSelected(e)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){let e=this.options.toArray();this._selectionModel.sort((i,n)=>this.sortComparator?this.sortComparator(i,n,e):e.indexOf(i)-e.indexOf(n)),this.stateChanges.next()}}_propagateChanges(e){let i;this.multiple?i=this.selected.map(n=>n.value):i=this.selected?this.selected.value:e,this._value=i,this.valueChange.emit(i),this._onChange(i),this.selectionChange.emit(this._getChangeEvent(i)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){if(this._keyManager)if(this.empty){let e=-1;for(let i=0;i<this.options.length;i++)if(!this.options.get(i).disabled){e=i;break}this._keyManager.setActiveItem(e)}else this._keyManager.setActiveItem(this._selectionModel.selected[0])}_canOpen(){return!this._panelOpen&&!this.disabled&&this.options?.length>0&&!!this._overlayDir}focus(e){this._elementRef.nativeElement.focus(e)}_getPanelAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||null,i=e?e+" ":"";return this.ariaLabelledby?i+this.ariaLabelledby:e}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||"";return this.ariaLabelledby&&(e+=" "+this.ariaLabelledby),e||(e=this._valueId),e}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){e.length?this._elementRef.nativeElement.setAttribute("aria-describedby",e.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}onContainerClick(){this.focus(),this.open()}get shouldLabelFloat(){return this.panelOpen||!this.empty||this.focused&&!!this.placeholder}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["mat-select"]],contentQueries:function(i,n,r){if(i&1&&(Ct(r,ug,5),Ct(r,fo,5),Ct(r,Ed,5)),i&2){let a;H(a=W())&&(n.customTrigger=a.first),H(a=W())&&(n.options=a),H(a=W())&&(n.optionGroups=a)}},viewQuery:function(i,n){if(i&1&&(Q(qC,5),Q(GC,5),Q(Ds,5)),i&2){let r;H(r=W())&&(n.trigger=r.first),H(r=W())&&(n.panel=r.first),H(r=W())&&(n._overlayDir=r.first)}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:21,hostBindings:function(i,n){i&1&&_("keydown",function(a){return n._handleKeydown(a)})("focus",function(){return n._onFocus()})("blur",function(){return n._onBlur()}),i&2&&(X("id",n.id)("tabindex",n.disabled?-1:n.tabIndex)("aria-controls",n.panelOpen?n.id+"-panel":null)("aria-expanded",n.panelOpen)("aria-label",n.ariaLabel||null)("aria-required",n.required.toString())("aria-disabled",n.disabled.toString())("aria-invalid",n.errorState)("aria-activedescendant",n._getAriaActiveDescendant()),E("mat-mdc-select-disabled",n.disabled)("mat-mdc-select-invalid",n.errorState)("mat-mdc-select-required",n.required)("mat-mdc-select-empty",n.empty)("mat-mdc-select-multiple",n.multiple)("mat-select-open",n.panelOpen))},inputs:{userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],panelClass:"panelClass",disabled:[2,"disabled","disabled",J],disableRipple:[2,"disableRipple","disableRipple",J],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:ui(e)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",J],placeholder:"placeholder",required:[2,"required","required",J],multiple:[2,"multiple","multiple",J],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",J],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",ui],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth",canSelectNullableOptions:[2,"canSelectNullableOptions","canSelectNullableOptions",J]},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],features:[qe([{provide:pa,useExisting:o},{provide:Td,useExisting:o}]),tt],ngContentSelectors:QC,decls:11,vars:9,consts:[["fallbackOverlayOrigin","cdkOverlayOrigin","trigger",""],["panel",""],["cdk-overlay-origin","",1,"mat-mdc-select-trigger",3,"click"],[1,"mat-mdc-select-value"],[1,"mat-mdc-select-placeholder","mat-mdc-select-min-line"],[1,"mat-mdc-select-value-text"],[1,"mat-mdc-select-arrow-wrapper"],[1,"mat-mdc-select-arrow"],["viewBox","0 0 24 24","width","24px","height","24px","focusable","false","aria-hidden","true"],["d","M7 10l5 5 5-5z"],["cdk-connected-overlay","","cdkConnectedOverlayLockPosition","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"detach","backdropClick","overlayKeydown","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayWidth","cdkConnectedOverlayFlexibleDimensions"],[1,"mat-mdc-select-min-line"],["role","listbox","tabindex","-1",3,"keydown","ngClass"]],template:function(i,n){if(i&1){let r=M();Be(YC),s(0,"div",2,0),_("click",function(){return v(r),y(n.open())}),s(3,"div",3),C(4,XC,2,1,"span",4)(5,JC,3,1,"span",5),l(),s(6,"div",6)(7,"div",7),en(),s(8,"svg",8),A(9,"path",9),l()()()(),$e(10,ex,3,10,"ng-template",10),_("detach",function(){return v(r),y(n.close())})("backdropClick",function(){return v(r),y(n.close())})("overlayKeydown",function(c){return v(r),y(n._handleOverlayKeydown(c))})}if(i&2){let r=Jt(1);d(3),X("id",n._valueId),d(),x(n.empty?4:5),d(6),w("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",n._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",n._scrollStrategy)("cdkConnectedOverlayOrigin",n._preferredOverlayOrigin||r)("cdkConnectedOverlayPositions",n._positions)("cdkConnectedOverlayWidth",n._overlayWidth)("cdkConnectedOverlayFlexibleDimensions",!0)}},dependencies:[Ho,Ds,Pn],styles:[`@keyframes _mat-select-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}@keyframes _mat-select-exit{from{opacity:1}to{opacity:0}}.mat-mdc-select{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-sys-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-sys-body-large-tracking))}div.mat-mdc-select-panel{box-shadow:var(--mat-select-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))}.mat-mdc-select-disabled{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-disabled .mat-mdc-select-placeholder{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-trigger{display:inline-flex;align-items:center;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.mat-mdc-select-disabled .mat-mdc-select-trigger{-webkit-user-select:none;user-select:none;cursor:default}.mat-mdc-select-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-mdc-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-mdc-select-arrow-wrapper{height:24px;flex-shrink:0;display:inline-flex;align-items:center}.mat-form-field-appearance-fill .mdc-text-field--no-label .mat-mdc-select-arrow-wrapper{transform:none}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-invalid .mat-mdc-select-arrow,.mat-form-field-invalid:not(.mat-form-field-disabled) .mat-mdc-form-field-infix::after{color:var(--mat-select-invalid-arrow-color, var(--mat-sys-error))}.mat-mdc-select-arrow{width:10px;height:5px;position:relative;color:var(--mat-select-enabled-arrow-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--mat-select-focused-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-disabled .mat-mdc-select-arrow{color:var(--mat-select-disabled-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-select-open .mat-mdc-select-arrow{transform:rotate(180deg)}.mat-form-field-animations-enabled .mat-mdc-select-arrow{transition:transform 80ms linear}.mat-mdc-select-arrow svg{fill:currentColor;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}@media(forced-colors: active){.mat-mdc-select-arrow svg{fill:CanvasText}.mat-mdc-select-disabled .mat-mdc-select-arrow svg{fill:GrayText}}div.mat-mdc-select-panel{width:100%;max-height:275px;outline:0;overflow:auto;padding:8px 0;border-radius:4px;box-sizing:border-box;position:relative;background-color:var(--mat-select-panel-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-select-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-select-panel-above) div.mat-mdc-select-panel{border-top-left-radius:0;border-top-right-radius:0;transform-origin:top center}.mat-mdc-select-panel-above div.mat-mdc-select-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:bottom center}.mat-select-panel-animations-enabled{animation:_mat-select-enter 120ms cubic-bezier(0, 0, 0.2, 1)}.mat-select-panel-animations-enabled.mat-select-panel-exit{animation:_mat-select-exit 100ms linear}.mat-mdc-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1);color:var(--mat-select-placeholder-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field:not(.mat-form-field-animations-enabled) .mat-mdc-select-placeholder,._mat-animation-noopable .mat-mdc-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-mdc-select-placeholder{color:rgba(0,0,0,0);-webkit-text-fill-color:rgba(0,0,0,0);transition:none;display:block}.mat-mdc-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mat-mdc-floating-label{max-width:calc(100% - 18px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 24px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-text-field--label-floating .mdc-notched-outline__notch{max-width:calc(100% - 24px)}.mat-mdc-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;visibility:hidden}.mat-form-field-appearance-fill .mat-mdc-select-arrow-wrapper{transform:var(--mat-select-arrow-transform, translateY(-8px))}
|
|
375
|
-
`],encapsulation:2,changeDetection:0})}return o})();var fa=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({providers:[hg],imports:[vi,Pd,ae,Li,ct,Pd,ae]})}return o})();var ix=["input"],nx=["label"],ox=["*"],rx=new ne("mat-checkbox-default-options",{providedIn:"root",factory:fg});function fg(){return{color:"accent",clickAction:"check-indeterminate",disabledInteractive:!1}}var Ot=(function(o){return o[o.Init=0]="Init",o[o.Checked=1]="Checked",o[o.Unchecked=2]="Unchecked",o[o.Indeterminate=3]="Indeterminate",o})(Ot||{}),Rd=class{source;checked},gg=fg(),Fd=(()=>{class o{_elementRef=m(ie);_changeDetectorRef=m(Ge);_ngZone=m(de);_animationsDisabled=He();_options=m(rx,{optional:!0});focus(){this._inputElement.nativeElement.focus()}_createChangeEvent(e){let i=new Rd;return i.source=this,i.checked=e,i}_getAnimationTargetElement(){return this._inputElement?.nativeElement}_animationClasses={uncheckedToChecked:"mdc-checkbox--anim-unchecked-checked",uncheckedToIndeterminate:"mdc-checkbox--anim-unchecked-indeterminate",checkedToUnchecked:"mdc-checkbox--anim-checked-unchecked",checkedToIndeterminate:"mdc-checkbox--anim-checked-indeterminate",indeterminateToChecked:"mdc-checkbox--anim-indeterminate-checked",indeterminateToUnchecked:"mdc-checkbox--anim-indeterminate-unchecked"};ariaLabel="";ariaLabelledby=null;ariaDescribedby;ariaExpanded;ariaControls;ariaOwns;_uniqueId;id;get inputId(){return`${this.id||this._uniqueId}-input`}required;labelPosition="after";name=null;change=new U;indeterminateChange=new U;value;disableRipple;_inputElement;_labelElement;tabIndex;color;disabledInteractive;_onTouched=()=>{};_currentAnimationClass="";_currentCheckState=Ot.Init;_controlValueAccessorChangeFn=()=>{};_validatorChangeFn=()=>{};constructor(){m(Rt).load(In);let e=m(new En("tabindex"),{optional:!0});this._options=this._options||gg,this.color=this._options.color||gg.color,this.tabIndex=e==null?0:parseInt(e)||0,this.id=this._uniqueId=m(Re).getId("mat-mdc-checkbox-"),this.disabledInteractive=this._options?.disabledInteractive??!1}ngOnChanges(e){e.required&&this._validatorChangeFn()}ngAfterViewInit(){this._syncIndeterminate(this.indeterminate)}get checked(){return this._checked}set checked(e){e!=this.checked&&(this._checked=e,this._changeDetectorRef.markForCheck())}_checked=!1;get disabled(){return this._disabled}set disabled(e){e!==this.disabled&&(this._disabled=e,this._changeDetectorRef.markForCheck())}_disabled=!1;get indeterminate(){return this._indeterminate()}set indeterminate(e){let i=e!=this._indeterminate();this._indeterminate.set(e),i&&(e?this._transitionCheckState(Ot.Indeterminate):this._transitionCheckState(this.checked?Ot.Checked:Ot.Unchecked),this.indeterminateChange.emit(e)),this._syncIndeterminate(e)}_indeterminate=Ee(!1);_isRippleDisabled(){return this.disableRipple||this.disabled}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}writeValue(e){this.checked=!!e}registerOnChange(e){this._controlValueAccessorChangeFn=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e}validate(e){return this.required&&e.value!==!0?{required:!0}:null}registerOnValidatorChange(e){this._validatorChangeFn=e}_transitionCheckState(e){let i=this._currentCheckState,n=this._getAnimationTargetElement();if(!(i===e||!n)&&(this._currentAnimationClass&&n.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(i,e),this._currentCheckState=e,this._currentAnimationClass.length>0)){n.classList.add(this._currentAnimationClass);let r=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{n.classList.remove(r)},1e3)})}}_emitChangeEvent(){this._controlValueAccessorChangeFn(this.checked),this.change.emit(this._createChangeEvent(this.checked)),this._inputElement&&(this._inputElement.nativeElement.checked=this.checked)}toggle(){this.checked=!this.checked,this._controlValueAccessorChangeFn(this.checked)}_handleInputClick(){let e=this._options?.clickAction;!this.disabled&&e!=="noop"?(this.indeterminate&&e!=="check"&&Promise.resolve().then(()=>{this._indeterminate.set(!1),this.indeterminateChange.emit(!1)}),this._checked=!this._checked,this._transitionCheckState(this._checked?Ot.Checked:Ot.Unchecked),this._emitChangeEvent()):(this.disabled&&this.disabledInteractive||!this.disabled&&e==="noop")&&(this._inputElement.nativeElement.checked=this.checked,this._inputElement.nativeElement.indeterminate=this.indeterminate)}_onInteractionEvent(e){e.stopPropagation()}_onBlur(){Promise.resolve().then(()=>{this._onTouched(),this._changeDetectorRef.markForCheck()})}_getAnimationClassForCheckStateTransition(e,i){if(this._animationsDisabled)return"";switch(e){case Ot.Init:if(i===Ot.Checked)return this._animationClasses.uncheckedToChecked;if(i==Ot.Indeterminate)return this._checked?this._animationClasses.checkedToIndeterminate:this._animationClasses.uncheckedToIndeterminate;break;case Ot.Unchecked:return i===Ot.Checked?this._animationClasses.uncheckedToChecked:this._animationClasses.uncheckedToIndeterminate;case Ot.Checked:return i===Ot.Unchecked?this._animationClasses.checkedToUnchecked:this._animationClasses.checkedToIndeterminate;case Ot.Indeterminate:return i===Ot.Checked?this._animationClasses.indeterminateToChecked:this._animationClasses.indeterminateToUnchecked}return""}_syncIndeterminate(e){let i=this._inputElement;i&&(i.nativeElement.indeterminate=e)}_onInputClick(){this._handleInputClick()}_onTouchTargetClick(){this._handleInputClick(),this.disabled||this._inputElement.nativeElement.focus()}_preventBubblingFromLabel(e){e.target&&this._labelElement.nativeElement.contains(e.target)&&e.stopPropagation()}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["mat-checkbox"]],viewQuery:function(i,n){if(i&1&&(Q(ix,5),Q(nx,5)),i&2){let r;H(r=W())&&(n._inputElement=r.first),H(r=W())&&(n._labelElement=r.first)}},hostAttrs:[1,"mat-mdc-checkbox"],hostVars:16,hostBindings:function(i,n){i&2&&(Zt("id",n.id),X("tabindex",null)("aria-label",null)("aria-labelledby",null),tn(n.color?"mat-"+n.color:"mat-accent"),E("_mat-animation-noopable",n._animationsDisabled)("mdc-checkbox--disabled",n.disabled)("mat-mdc-checkbox-disabled",n.disabled)("mat-mdc-checkbox-checked",n.checked)("mat-mdc-checkbox-disabled-interactive",n.disabledInteractive))},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],ariaExpanded:[2,"aria-expanded","ariaExpanded",J],ariaControls:[0,"aria-controls","ariaControls"],ariaOwns:[0,"aria-owns","ariaOwns"],id:"id",required:[2,"required","required",J],labelPosition:"labelPosition",name:"name",value:"value",disableRipple:[2,"disableRipple","disableRipple",J],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?void 0:ui(e)],color:"color",disabledInteractive:[2,"disabledInteractive","disabledInteractive",J],checked:[2,"checked","checked",J],disabled:[2,"disabled","disabled",J],indeterminate:[2,"indeterminate","indeterminate",J]},outputs:{change:"change",indeterminateChange:"indeterminateChange"},exportAs:["matCheckbox"],features:[qe([{provide:Do,useExisting:Qn(()=>o),multi:!0},{provide:Ya,useExisting:o,multi:!0}]),tt],ngContentSelectors:ox,decls:15,vars:23,consts:[["checkbox",""],["input",""],["label",""],["mat-internal-form-field","",3,"click","labelPosition"],[1,"mdc-checkbox"],[1,"mat-mdc-checkbox-touch-target",3,"click"],["type","checkbox",1,"mdc-checkbox__native-control",3,"blur","click","change","checked","indeterminate","disabled","id","required","tabIndex"],[1,"mdc-checkbox__ripple"],[1,"mdc-checkbox__background"],["focusable","false","viewBox","0 0 24 24","aria-hidden","true",1,"mdc-checkbox__checkmark"],["fill","none","d","M1.73,12.91 8.1,19.28 22.79,4.59",1,"mdc-checkbox__checkmark-path"],[1,"mdc-checkbox__mixedmark"],["mat-ripple","",1,"mat-mdc-checkbox-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-label",3,"for"]],template:function(i,n){if(i&1){let r=M();Be(),s(0,"div",3),_("click",function(c){return v(r),y(n._preventBubblingFromLabel(c))}),s(1,"div",4,0)(3,"div",5),_("click",function(){return v(r),y(n._onTouchTargetClick())}),l(),s(4,"input",6,1),_("blur",function(){return v(r),y(n._onBlur())})("click",function(){return v(r),y(n._onInputClick())})("change",function(c){return v(r),y(n._onInteractionEvent(c))}),l(),A(6,"div",7),s(7,"div",8),en(),s(8,"svg",9),A(9,"path",10),l(),Aa(),A(10,"div",11),l(),A(11,"div",12),l(),s(12,"label",13,2),me(14),l()()}if(i&2){let r=Jt(2);w("labelPosition",n.labelPosition),d(4),E("mdc-checkbox--selected",n.checked),w("checked",n.checked)("indeterminate",n.indeterminate)("disabled",n.disabled&&!n.disabledInteractive)("id",n.inputId)("required",n.required)("tabIndex",n.disabled&&!n.disabledInteractive?-1:n.tabIndex),X("aria-label",n.ariaLabel||null)("aria-labelledby",n.ariaLabelledby)("aria-describedby",n.ariaDescribedby)("aria-checked",n.indeterminate?"mixed":null)("aria-controls",n.ariaControls)("aria-disabled",n.disabled&&n.disabledInteractive?!0:null)("aria-expanded",n.ariaExpanded)("aria-owns",n.ariaOwns)("name",n.name)("value",n.value),d(7),w("matRippleTrigger",r)("matRippleDisabled",n.disableRipple||n.disabled)("matRippleCentered",!0),d(),w("for",n.inputId)}},dependencies:[An,gl],styles:[`.mdc-checkbox{display:inline-block;position:relative;flex:0 0 18px;box-sizing:content-box;width:18px;height:18px;line-height:0;white-space:nowrap;cursor:pointer;vertical-align:bottom;padding:calc((var(--mat-checkbox-state-layer-size, 40px) - 18px)/2);margin:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2)}.mdc-checkbox:hover>.mdc-checkbox__ripple{opacity:var(--mat-checkbox-unselected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity));background-color:var(--mat-checkbox-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox:hover>.mat-mdc-checkbox-ripple>.mat-ripple-element{background-color:var(--mat-checkbox-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox .mdc-checkbox__native-control:focus+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-unselected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity));background-color:var(--mat-checkbox-unselected-focus-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox .mdc-checkbox__native-control:focus~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-unselected-focus-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox:active>.mdc-checkbox__native-control+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));background-color:var(--mat-checkbox-unselected-pressed-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:active>.mdc-checkbox__native-control~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-unselected-pressed-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:hover .mdc-checkbox__native-control:checked+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity));background-color:var(--mat-checkbox-selected-hover-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:hover .mdc-checkbox__native-control:checked~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-selected-hover-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox .mdc-checkbox__native-control:focus:checked+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity));background-color:var(--mat-checkbox-selected-focus-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox .mdc-checkbox__native-control:focus:checked~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-selected-focus-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:active>.mdc-checkbox__native-control:checked+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));background-color:var(--mat-checkbox-selected-pressed-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox:active>.mdc-checkbox__native-control:checked~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-selected-pressed-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control~.mat-mdc-checkbox-ripple .mat-ripple-element,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control+.mdc-checkbox__ripple{background-color:var(--mat-checkbox-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox .mdc-checkbox__native-control{position:absolute;margin:0;padding:0;opacity:0;cursor:inherit;z-index:1;width:var(--mat-checkbox-state-layer-size, 40px);height:var(--mat-checkbox-state-layer-size, 40px);top:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2);right:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2);left:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2)}.mdc-checkbox--disabled{cursor:default;pointer-events:none}.mdc-checkbox__background{display:inline-flex;position:absolute;align-items:center;justify-content:center;box-sizing:border-box;width:18px;height:18px;border:2px solid currentColor;border-radius:2px;background-color:rgba(0,0,0,0);pointer-events:none;will-change:background-color,border-color;transition:background-color 90ms cubic-bezier(0.4, 0, 0.6, 1),border-color 90ms cubic-bezier(0.4, 0, 0.6, 1);-webkit-print-color-adjust:exact;color-adjust:exact;border-color:var(--mat-checkbox-unselected-icon-color, var(--mat-sys-on-surface-variant));top:calc((var(--mat-checkbox-state-layer-size, 40px) - 18px)/2);left:calc((var(--mat-checkbox-state-layer-size, 40px) - 18px)/2)}.mdc-checkbox__native-control:enabled:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:enabled:indeterminate~.mdc-checkbox__background{border-color:var(--mat-checkbox-selected-icon-color, var(--mat-sys-primary));background-color:var(--mat-checkbox-selected-icon-color, var(--mat-sys-primary))}.mdc-checkbox--disabled .mdc-checkbox__background{border-color:var(--mat-checkbox-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-checkbox--disabled .mdc-checkbox__background{border-color:GrayText}}.mdc-checkbox__native-control:disabled:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:disabled:indeterminate~.mdc-checkbox__background{background-color:var(--mat-checkbox-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:rgba(0,0,0,0)}@media(forced-colors: active){.mdc-checkbox__native-control:disabled:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:disabled:indeterminate~.mdc-checkbox__background{border-color:GrayText}}.mdc-checkbox:hover>.mdc-checkbox__native-control:not(:checked)~.mdc-checkbox__background,.mdc-checkbox:hover>.mdc-checkbox__native-control:not(:indeterminate)~.mdc-checkbox__background{border-color:var(--mat-checkbox-unselected-hover-icon-color, var(--mat-sys-on-surface));background-color:rgba(0,0,0,0)}.mdc-checkbox:hover>.mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox:hover>.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background{border-color:var(--mat-checkbox-selected-hover-icon-color, var(--mat-sys-primary));background-color:var(--mat-checkbox-selected-hover-icon-color, var(--mat-sys-primary))}.mdc-checkbox__native-control:focus:focus:not(:checked)~.mdc-checkbox__background,.mdc-checkbox__native-control:focus:focus:not(:indeterminate)~.mdc-checkbox__background{border-color:var(--mat-checkbox-unselected-focus-icon-color, var(--mat-sys-on-surface))}.mdc-checkbox__native-control:focus:focus:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:focus:focus:indeterminate~.mdc-checkbox__background{border-color:var(--mat-checkbox-selected-focus-icon-color, var(--mat-sys-primary));background-color:var(--mat-checkbox-selected-focus-icon-color, var(--mat-sys-primary))}.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox:hover>.mdc-checkbox__native-control~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control:focus~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__background{border-color:var(--mat-checkbox-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox:hover>.mdc-checkbox__native-control~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control:focus~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__background{border-color:GrayText}}.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background{background-color:var(--mat-checkbox-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:rgba(0,0,0,0)}.mdc-checkbox__checkmark{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;opacity:0;transition:opacity 180ms cubic-bezier(0.4, 0, 0.6, 1);color:var(--mat-checkbox-selected-checkmark-color, var(--mat-sys-on-primary))}@media(forced-colors: active){.mdc-checkbox__checkmark{color:CanvasText}}.mdc-checkbox--disabled .mdc-checkbox__checkmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__checkmark{color:var(--mat-checkbox-disabled-selected-checkmark-color, var(--mat-sys-surface))}@media(forced-colors: active){.mdc-checkbox--disabled .mdc-checkbox__checkmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__checkmark{color:GrayText}}.mdc-checkbox__checkmark-path{transition:stroke-dashoffset 180ms cubic-bezier(0.4, 0, 0.6, 1);stroke:currentColor;stroke-width:3.12px;stroke-dashoffset:29.7833385;stroke-dasharray:29.7833385}.mdc-checkbox__mixedmark{width:100%;height:0;transform:scaleX(0) rotate(0deg);border-width:1px;border-style:solid;opacity:0;transition:opacity 90ms cubic-bezier(0.4, 0, 0.6, 1),transform 90ms cubic-bezier(0.4, 0, 0.6, 1);border-color:var(--mat-checkbox-selected-checkmark-color, var(--mat-sys-on-primary))}@media(forced-colors: active){.mdc-checkbox__mixedmark{margin:0 1px}}.mdc-checkbox--disabled .mdc-checkbox__mixedmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__mixedmark{border-color:var(--mat-checkbox-disabled-selected-checkmark-color, var(--mat-sys-surface))}@media(forced-colors: active){.mdc-checkbox--disabled .mdc-checkbox__mixedmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__mixedmark{border-color:GrayText}}.mdc-checkbox--anim-unchecked-checked .mdc-checkbox__background,.mdc-checkbox--anim-unchecked-indeterminate .mdc-checkbox__background,.mdc-checkbox--anim-checked-unchecked .mdc-checkbox__background,.mdc-checkbox--anim-indeterminate-unchecked .mdc-checkbox__background{animation-duration:180ms;animation-timing-function:linear}.mdc-checkbox--anim-unchecked-checked .mdc-checkbox__checkmark-path{animation:mdc-checkbox-unchecked-checked-checkmark-path 180ms linear;transition:none}.mdc-checkbox--anim-unchecked-indeterminate .mdc-checkbox__mixedmark{animation:mdc-checkbox-unchecked-indeterminate-mixedmark 90ms linear;transition:none}.mdc-checkbox--anim-checked-unchecked .mdc-checkbox__checkmark-path{animation:mdc-checkbox-checked-unchecked-checkmark-path 90ms linear;transition:none}.mdc-checkbox--anim-checked-indeterminate .mdc-checkbox__checkmark{animation:mdc-checkbox-checked-indeterminate-checkmark 90ms linear;transition:none}.mdc-checkbox--anim-checked-indeterminate .mdc-checkbox__mixedmark{animation:mdc-checkbox-checked-indeterminate-mixedmark 90ms linear;transition:none}.mdc-checkbox--anim-indeterminate-checked .mdc-checkbox__checkmark{animation:mdc-checkbox-indeterminate-checked-checkmark 500ms linear;transition:none}.mdc-checkbox--anim-indeterminate-checked .mdc-checkbox__mixedmark{animation:mdc-checkbox-indeterminate-checked-mixedmark 500ms linear;transition:none}.mdc-checkbox--anim-indeterminate-unchecked .mdc-checkbox__mixedmark{animation:mdc-checkbox-indeterminate-unchecked-mixedmark 300ms linear;transition:none}.mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background{transition:border-color 90ms cubic-bezier(0, 0, 0.2, 1),background-color 90ms cubic-bezier(0, 0, 0.2, 1)}.mdc-checkbox__native-control:checked~.mdc-checkbox__background>.mdc-checkbox__checkmark>.mdc-checkbox__checkmark-path,.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background>.mdc-checkbox__checkmark>.mdc-checkbox__checkmark-path{stroke-dashoffset:0}.mdc-checkbox__native-control:checked~.mdc-checkbox__background>.mdc-checkbox__checkmark{transition:opacity 180ms cubic-bezier(0, 0, 0.2, 1),transform 180ms cubic-bezier(0, 0, 0.2, 1);opacity:1}.mdc-checkbox__native-control:checked~.mdc-checkbox__background>.mdc-checkbox__mixedmark{transform:scaleX(1) rotate(-45deg)}.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background>.mdc-checkbox__checkmark{transform:rotate(45deg);opacity:0;transition:opacity 90ms cubic-bezier(0.4, 0, 0.6, 1),transform 90ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background>.mdc-checkbox__mixedmark{transform:scaleX(1) rotate(0deg);opacity:1}@keyframes mdc-checkbox-unchecked-checked-checkmark-path{0%,50%{stroke-dashoffset:29.7833385}50%{animation-timing-function:cubic-bezier(0, 0, 0.2, 1)}100%{stroke-dashoffset:0}}@keyframes mdc-checkbox-unchecked-indeterminate-mixedmark{0%,68.2%{transform:scaleX(0)}68.2%{animation-timing-function:cubic-bezier(0, 0, 0, 1)}100%{transform:scaleX(1)}}@keyframes mdc-checkbox-checked-unchecked-checkmark-path{from{animation-timing-function:cubic-bezier(0.4, 0, 1, 1);opacity:1;stroke-dashoffset:0}to{opacity:0;stroke-dashoffset:-29.7833385}}@keyframes mdc-checkbox-checked-indeterminate-checkmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 1);transform:rotate(0deg);opacity:1}to{transform:rotate(45deg);opacity:0}}@keyframes mdc-checkbox-indeterminate-checked-checkmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);transform:rotate(45deg);opacity:0}to{transform:rotate(360deg);opacity:1}}@keyframes mdc-checkbox-checked-indeterminate-mixedmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 1);transform:rotate(-45deg);opacity:0}to{transform:rotate(0deg);opacity:1}}@keyframes mdc-checkbox-indeterminate-checked-mixedmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);transform:rotate(0deg);opacity:1}to{transform:rotate(315deg);opacity:0}}@keyframes mdc-checkbox-indeterminate-unchecked-mixedmark{0%{animation-timing-function:linear;transform:scaleX(1);opacity:1}32.8%,100%{transform:scaleX(0);opacity:0}}.mat-mdc-checkbox{display:inline-block;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mat-mdc-checkbox-touch-target,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__native-control,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__ripple,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mat-mdc-checkbox-ripple::before,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background>.mdc-checkbox__checkmark,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background>.mdc-checkbox__checkmark>.mdc-checkbox__checkmark-path,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background>.mdc-checkbox__mixedmark{transition:none !important;animation:none !important}.mat-mdc-checkbox label{cursor:pointer}.mat-mdc-checkbox .mat-internal-form-field{color:var(--mat-checkbox-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-checkbox-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-checkbox-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-checkbox-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-checkbox-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-checkbox-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-checkbox.mat-mdc-checkbox-disabled.mat-mdc-checkbox-disabled-interactive{pointer-events:auto}.mat-mdc-checkbox.mat-mdc-checkbox-disabled.mat-mdc-checkbox-disabled-interactive input{cursor:default}.mat-mdc-checkbox.mat-mdc-checkbox-disabled label{cursor:default;color:var(--mat-checkbox-disabled-label-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mat-mdc-checkbox.mat-mdc-checkbox-disabled label{color:GrayText}}.mat-mdc-checkbox label:empty{display:none}.mat-mdc-checkbox .mdc-checkbox__ripple{opacity:0}.mat-mdc-checkbox .mat-mdc-checkbox-ripple,.mdc-checkbox__ripple{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-checkbox .mat-mdc-checkbox-ripple:not(:empty),.mdc-checkbox__ripple:not(:empty){transform:translateZ(0)}.mat-mdc-checkbox-ripple .mat-ripple-element{opacity:.1}.mat-mdc-checkbox-touch-target{position:absolute;top:50%;left:50%;height:var(--mat-checkbox-touch-target-size, 48px);width:var(--mat-checkbox-touch-target-size, 48px);transform:translate(-50%, -50%);display:var(--mat-checkbox-touch-target-display, block)}.mat-mdc-checkbox .mat-mdc-checkbox-ripple::before{border-radius:50%}.mdc-checkbox__native-control:focus~.mat-focus-indicator::before{content:""}
|
|
376
|
-
`],encapsulation:2,changeDetection:0})}return o})(),_g=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({imports:[Fd,ae,ae]})}return o})();var sx=["button"],lx=["*"];function cx(o,t){if(o&1&&(s(0,"div",2),A(1,"mat-pseudo-checkbox",6),l()),o&2){let e=u();d(),w("disabled",e.disabled)}}var bg=new ne("MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS",{providedIn:"root",factory:dx});function dx(){return{hideSingleSelectionIndicator:!1,hideMultipleSelectionIndicator:!1,disabledInteractive:!1}}var vg=new ne("MatButtonToggleGroup"),mx={provide:Do,useExisting:Qn(()=>Nd),multi:!0},Tl=class{source;value;constructor(t,e){this.source=t,this.value=e}},Nd=(()=>{class o{_changeDetector=m(Ge);_dir=m(ft,{optional:!0});_multiple=!1;_disabled=!1;_disabledInteractive=!1;_selectionModel;_rawValue;_controlValueAccessorChangeFn=()=>{};_onTouched=()=>{};_buttonToggles;appearance;get name(){return this._name}set name(e){this._name=e,this._markButtonsForCheck()}_name=m(Re).getId("mat-button-toggle-group-");vertical;get value(){let e=this._selectionModel?this._selectionModel.selected:[];return this.multiple?e.map(i=>i.value):e[0]?e[0].value:void 0}set value(e){this._setSelectionByValue(e),this.valueChange.emit(this.value)}valueChange=new U;get selected(){let e=this._selectionModel?this._selectionModel.selected:[];return this.multiple?e:e[0]||null}get multiple(){return this._multiple}set multiple(e){this._multiple=e,this._markButtonsForCheck()}get disabled(){return this._disabled}set disabled(e){this._disabled=e,this._markButtonsForCheck()}get disabledInteractive(){return this._disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e,this._markButtonsForCheck()}get dir(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}change=new U;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._markButtonsForCheck()}_hideSingleSelectionIndicator;get hideMultipleSelectionIndicator(){return this._hideMultipleSelectionIndicator}set hideMultipleSelectionIndicator(e){this._hideMultipleSelectionIndicator=e,this._markButtonsForCheck()}_hideMultipleSelectionIndicator;constructor(){let e=m(bg,{optional:!0});this.appearance=e&&e.appearance?e.appearance:"standard",this.hideSingleSelectionIndicator=e?.hideSingleSelectionIndicator??!1,this.hideMultipleSelectionIndicator=e?.hideMultipleSelectionIndicator??!1}ngOnInit(){this._selectionModel=new _o(this.multiple,void 0,!1)}ngAfterContentInit(){this._selectionModel.select(...this._buttonToggles.filter(e=>e.checked)),this.multiple||this._initializeTabIndex()}writeValue(e){this.value=e,this._changeDetector.markForCheck()}registerOnChange(e){this._controlValueAccessorChangeFn=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e}_keydown(e){if(this.multiple||this.disabled||gt(e))return;let n=e.target.id,r=this._buttonToggles.toArray().findIndex(c=>c.buttonId===n),a=null;switch(e.keyCode){case 32:case 13:a=this._buttonToggles.get(r)||null;break;case 38:a=this._getNextButton(r,-1);break;case 37:a=this._getNextButton(r,this.dir==="ltr"?-1:1);break;case 40:a=this._getNextButton(r,1);break;case 39:a=this._getNextButton(r,this.dir==="ltr"?1:-1);break;default:return}a&&(e.preventDefault(),a._onButtonClick(),a.focus())}_emitChangeEvent(e){let i=new Tl(e,this.value);this._rawValue=i.value,this._controlValueAccessorChangeFn(i.value),this.change.emit(i)}_syncButtonToggle(e,i,n=!1,r=!1){!this.multiple&&this.selected&&!e.checked&&(this.selected.checked=!1),this._selectionModel?i?this._selectionModel.select(e):this._selectionModel.deselect(e):r=!0,r?Promise.resolve().then(()=>this._updateModelValue(e,n)):this._updateModelValue(e,n)}_isSelected(e){return this._selectionModel&&this._selectionModel.isSelected(e)}_isPrechecked(e){return typeof this._rawValue>"u"?!1:this.multiple&&Array.isArray(this._rawValue)?this._rawValue.some(i=>e.value!=null&&i===e.value):e.value===this._rawValue}_initializeTabIndex(){if(this._buttonToggles.forEach(e=>{e.tabIndex=-1}),this.selected)this.selected.tabIndex=0;else for(let e=0;e<this._buttonToggles.length;e++){let i=this._buttonToggles.get(e);if(!i.disabled){i.tabIndex=0;break}}}_getNextButton(e,i){let n=this._buttonToggles;for(let r=1;r<=n.length;r++){let a=(e+i*r+n.length)%n.length,c=n.get(a);if(c&&!c.disabled)return c}return null}_setSelectionByValue(e){if(this._rawValue=e,!this._buttonToggles)return;let i=this._buttonToggles.toArray();if(this.multiple&&e?(Array.isArray(e),this._clearSelection(),e.forEach(n=>this._selectValue(n,i))):(this._clearSelection(),this._selectValue(e,i)),!this.multiple&&i.every(n=>n.tabIndex===-1)){for(let n of i)if(!n.disabled){n.tabIndex=0;break}}}_clearSelection(){this._selectionModel.clear(),this._buttonToggles.forEach(e=>{e.checked=!1,this.multiple||(e.tabIndex=-1)})}_selectValue(e,i){for(let n of i)if(n.value===e){n.checked=!0,this._selectionModel.select(n),this.multiple||(n.tabIndex=0);break}}_updateModelValue(e,i){i&&this._emitChangeEvent(e),this.valueChange.emit(this.value)}_markButtonsForCheck(){this._buttonToggles?.forEach(e=>e._markForCheck())}static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["mat-button-toggle-group"]],contentQueries:function(i,n,r){if(i&1&&Ct(r,El,5),i&2){let a;H(a=W())&&(n._buttonToggles=a)}},hostAttrs:[1,"mat-button-toggle-group"],hostVars:6,hostBindings:function(i,n){i&1&&_("keydown",function(a){return n._keydown(a)}),i&2&&(X("role",n.multiple?"group":"radiogroup")("aria-disabled",n.disabled),E("mat-button-toggle-vertical",n.vertical)("mat-button-toggle-group-appearance-standard",n.appearance==="standard"))},inputs:{appearance:"appearance",name:"name",vertical:[2,"vertical","vertical",J],value:"value",multiple:[2,"multiple","multiple",J],disabled:[2,"disabled","disabled",J],disabledInteractive:[2,"disabledInteractive","disabledInteractive",J],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",J],hideMultipleSelectionIndicator:[2,"hideMultipleSelectionIndicator","hideMultipleSelectionIndicator",J]},outputs:{valueChange:"valueChange",change:"change"},exportAs:["matButtonToggleGroup"],features:[qe([mx,{provide:vg,useExisting:o}])]})}return o})(),El=(()=>{class o{_changeDetectorRef=m(Ge);_elementRef=m(ie);_focusMonitor=m(Ri);_idGenerator=m(Re);_animationDisabled=He();_checked=!1;ariaLabel;ariaLabelledby=null;_buttonElement;buttonToggleGroup;get buttonId(){return`${this.id}-button`}id;name;value;get tabIndex(){return this._tabIndex()}set tabIndex(e){this._tabIndex.set(e)}_tabIndex;disableRipple;get appearance(){return this.buttonToggleGroup?this.buttonToggleGroup.appearance:this._appearance}set appearance(e){this._appearance=e}_appearance;get checked(){return this.buttonToggleGroup?this.buttonToggleGroup._isSelected(this):this._checked}set checked(e){e!==this._checked&&(this._checked=e,this.buttonToggleGroup&&this.buttonToggleGroup._syncButtonToggle(this,this._checked),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled||this.buttonToggleGroup&&this.buttonToggleGroup.disabled}set disabled(e){this._disabled=e}_disabled=!1;get disabledInteractive(){return this._disabledInteractive||this.buttonToggleGroup!==null&&this.buttonToggleGroup.disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e}_disabledInteractive;change=new U;constructor(){m(Rt).load(In);let e=m(vg,{optional:!0}),i=m(new En("tabindex"),{optional:!0})||"",n=m(bg,{optional:!0});this._tabIndex=Ee(parseInt(i)||0),this.buttonToggleGroup=e,this.appearance=n&&n.appearance?n.appearance:"standard",this.disabledInteractive=n?.disabledInteractive??!1}ngOnInit(){let e=this.buttonToggleGroup;this.id=this.id||this._idGenerator.getId("mat-button-toggle-"),e&&(e._isPrechecked(this)?this.checked=!0:e._isSelected(this)!==this._checked&&e._syncButtonToggle(this,this._checked))}ngAfterViewInit(){this._animationDisabled||this._elementRef.nativeElement.classList.add("mat-button-toggle-animations-enabled"),this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){let e=this.buttonToggleGroup;this._focusMonitor.stopMonitoring(this._elementRef),e&&e._isSelected(this)&&e._syncButtonToggle(this,!1,!1,!0)}focus(e){this._buttonElement.nativeElement.focus(e)}_onButtonClick(){if(this.disabled)return;let e=this.isSingleSelector()?!0:!this._checked;if(e!==this._checked&&(this._checked=e,this.buttonToggleGroup&&(this.buttonToggleGroup._syncButtonToggle(this,this._checked,!0),this.buttonToggleGroup._onTouched())),this.isSingleSelector()){let i=this.buttonToggleGroup._buttonToggles.find(n=>n.tabIndex===0);i&&(i.tabIndex=-1),this.tabIndex=0}this.change.emit(new Tl(this,this.value))}_markForCheck(){this._changeDetectorRef.markForCheck()}_getButtonName(){return this.isSingleSelector()?this.buttonToggleGroup.name:this.name||null}isSingleSelector(){return this.buttonToggleGroup&&!this.buttonToggleGroup.multiple}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["mat-button-toggle"]],viewQuery:function(i,n){if(i&1&&Q(sx,5),i&2){let r;H(r=W())&&(n._buttonElement=r.first)}},hostAttrs:["role","presentation",1,"mat-button-toggle"],hostVars:14,hostBindings:function(i,n){i&1&&_("focus",function(){return n.focus()}),i&2&&(X("aria-label",null)("aria-labelledby",null)("id",n.id)("name",null),E("mat-button-toggle-standalone",!n.buttonToggleGroup)("mat-button-toggle-checked",n.checked)("mat-button-toggle-disabled",n.disabled)("mat-button-toggle-disabled-interactive",n.disabledInteractive)("mat-button-toggle-appearance-standard",n.appearance==="standard"))},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],id:"id",name:"name",value:"value",tabIndex:"tabIndex",disableRipple:[2,"disableRipple","disableRipple",J],appearance:"appearance",checked:[2,"checked","checked",J],disabled:[2,"disabled","disabled",J],disabledInteractive:[2,"disabledInteractive","disabledInteractive",J]},outputs:{change:"change"},exportAs:["matButtonToggle"],ngContentSelectors:lx,decls:7,vars:13,consts:[["button",""],["type","button",1,"mat-button-toggle-button","mat-focus-indicator",3,"click","id","disabled"],[1,"mat-button-toggle-checkbox-wrapper"],[1,"mat-button-toggle-label-content"],[1,"mat-button-toggle-focus-overlay"],["matRipple","",1,"mat-button-toggle-ripple",3,"matRippleTrigger","matRippleDisabled"],["state","checked","aria-hidden","true","appearance","minimal",3,"disabled"]],template:function(i,n){if(i&1){let r=M();Be(),s(0,"button",1,0),_("click",function(){return v(r),y(n._onButtonClick())}),C(2,cx,2,1,"div",2),s(3,"span",3),me(4),l()(),A(5,"span",4)(6,"span",5)}if(i&2){let r=Jt(1);w("id",n.buttonId)("disabled",n.disabled&&!n.disabledInteractive||null),X("role",n.isSingleSelector()?"radio":"button")("tabindex",n.disabled&&!n.disabledInteractive?-1:n.tabIndex)("aria-pressed",n.isSingleSelector()?null:n.checked)("aria-checked",n.isSingleSelector()?n.checked:null)("name",n._getButtonName())("aria-label",n.ariaLabel)("aria-labelledby",n.ariaLabelledby)("aria-disabled",n.disabled&&n.disabledInteractive?"true":null),d(2),x(n.buttonToggleGroup&&(!n.buttonToggleGroup.multiple&&!n.buttonToggleGroup.hideSingleSelectionIndicator||n.buttonToggleGroup.multiple&&!n.buttonToggleGroup.hideMultipleSelectionIndicator)?2:-1),d(4),w("matRippleTrigger",r)("matRippleDisabled",n.disableRipple||n.disabled)}},dependencies:[An,wl],styles:[`.mat-button-toggle-standalone,.mat-button-toggle-group{position:relative;display:inline-flex;flex-direction:row;white-space:nowrap;overflow:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0);border-radius:var(--mat-button-toggle-legacy-shape);transform:translateZ(0)}.mat-button-toggle-standalone:not([class*=mat-elevation-z]),.mat-button-toggle-group:not([class*=mat-elevation-z]){box-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)}@media(forced-colors: active){.mat-button-toggle-standalone,.mat-button-toggle-group{outline:solid 1px}}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{border-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard .mat-pseudo-checkbox,.mat-button-toggle-group-appearance-standard .mat-pseudo-checkbox{--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-button-toggle-selected-state-text-color, var(--mat-sys-on-secondary-container))}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard:not([class*=mat-elevation-z]),.mat-button-toggle-group-appearance-standard:not([class*=mat-elevation-z]){box-shadow:none}@media(forced-colors: active){.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{outline:0}}.mat-button-toggle-vertical{flex-direction:column}.mat-button-toggle-vertical .mat-button-toggle-label-content{display:block}.mat-button-toggle{white-space:nowrap;position:relative;color:var(--mat-button-toggle-legacy-text-color);font-family:var(--mat-button-toggle-legacy-label-text-font);font-size:var(--mat-button-toggle-legacy-label-text-size);line-height:var(--mat-button-toggle-legacy-label-text-line-height);font-weight:var(--mat-button-toggle-legacy-label-text-weight);letter-spacing:var(--mat-button-toggle-legacy-label-text-tracking);--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-button-toggle-legacy-selected-state-text-color)}.mat-button-toggle.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:var(--mat-button-toggle-legacy-focus-state-layer-opacity)}.mat-button-toggle .mat-icon svg{vertical-align:top}.mat-button-toggle-checkbox-wrapper{display:inline-block;justify-content:flex-start;align-items:center;width:0;height:18px;line-height:18px;overflow:hidden;box-sizing:border-box;position:absolute;top:50%;left:16px;transform:translate3d(0, -50%, 0)}[dir=rtl] .mat-button-toggle-checkbox-wrapper{left:auto;right:16px}.mat-button-toggle-appearance-standard .mat-button-toggle-checkbox-wrapper{left:12px}[dir=rtl] .mat-button-toggle-appearance-standard .mat-button-toggle-checkbox-wrapper{left:auto;right:12px}.mat-button-toggle-checked .mat-button-toggle-checkbox-wrapper{width:18px}.mat-button-toggle-animations-enabled .mat-button-toggle-checkbox-wrapper{transition:width 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-button-toggle-vertical .mat-button-toggle-checkbox-wrapper{transition:none}.mat-button-toggle-checked{color:var(--mat-button-toggle-legacy-selected-state-text-color);background-color:var(--mat-button-toggle-legacy-selected-state-background-color)}.mat-button-toggle-disabled{pointer-events:none;color:var(--mat-button-toggle-legacy-disabled-state-text-color);background-color:var(--mat-button-toggle-legacy-disabled-state-background-color);--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color: var(--mat-button-toggle-legacy-disabled-state-text-color)}.mat-button-toggle-disabled.mat-button-toggle-checked{background-color:var(--mat-button-toggle-legacy-disabled-selected-state-background-color)}.mat-button-toggle-disabled-interactive{pointer-events:auto}.mat-button-toggle-appearance-standard{color:var(--mat-button-toggle-text-color, var(--mat-sys-on-surface));background-color:var(--mat-button-toggle-background-color, transparent);font-family:var(--mat-button-toggle-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-button-toggle-label-text-size, var(--mat-sys-label-large-size));line-height:var(--mat-button-toggle-label-text-line-height, var(--mat-sys-label-large-line-height));font-weight:var(--mat-button-toggle-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mat-button-toggle-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-button-toggle-group-appearance-standard .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}[dir=rtl] .mat-button-toggle-group-appearance-standard .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:none;border-right:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:none;border-right:none;border-top:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-appearance-standard.mat-button-toggle-checked{color:var(--mat-button-toggle-selected-state-text-color, var(--mat-sys-on-secondary-container));background-color:var(--mat-button-toggle-selected-state-background-color, var(--mat-sys-secondary-container))}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled{color:var(--mat-button-toggle-disabled-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-button-toggle-disabled-state-background-color, transparent)}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled .mat-pseudo-checkbox{--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color: var(--mat-button-toggle-disabled-selected-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled.mat-button-toggle-checked{color:var(--mat-button-toggle-disabled-selected-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-button-toggle-disabled-selected-state-background-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{background-color:var(--mat-button-toggle-state-layer-color, var(--mat-sys-on-surface))}.mat-button-toggle-appearance-standard:hover .mat-button-toggle-focus-overlay{opacity:var(--mat-button-toggle-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-button-toggle-appearance-standard.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:var(--mat-button-toggle-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}@media(hover: none){.mat-button-toggle-appearance-standard:hover .mat-button-toggle-focus-overlay{display:none}}.mat-button-toggle-label-content{-webkit-user-select:none;user-select:none;display:inline-block;padding:0 16px;line-height:var(--mat-button-toggle-legacy-height);position:relative}.mat-button-toggle-appearance-standard .mat-button-toggle-label-content{padding:0 12px;line-height:var(--mat-button-toggle-height, 40px)}.mat-button-toggle-label-content>*{vertical-align:middle}.mat-button-toggle-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit;pointer-events:none;opacity:0;background-color:var(--mat-button-toggle-legacy-state-layer-color)}@media(forced-colors: active){.mat-button-toggle-checked .mat-button-toggle-focus-overlay{border-bottom:solid 500px;opacity:.5;height:0}.mat-button-toggle-checked:hover .mat-button-toggle-focus-overlay{opacity:.6}.mat-button-toggle-checked.mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{border-bottom:solid 500px}}.mat-button-toggle .mat-button-toggle-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-button-toggle-button{border:0;background:none;color:inherit;padding:0;margin:0;font:inherit;outline:none;width:100%;cursor:pointer}.mat-button-toggle-animations-enabled .mat-button-toggle-button{transition:padding 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-button-toggle-vertical .mat-button-toggle-button{transition:none}.mat-button-toggle-disabled .mat-button-toggle-button{cursor:default}.mat-button-toggle-button::-moz-focus-inner{border:0}.mat-button-toggle-checked .mat-button-toggle-button:has(.mat-button-toggle-checkbox-wrapper){padding-left:30px}[dir=rtl] .mat-button-toggle-checked .mat-button-toggle-button:has(.mat-button-toggle-checkbox-wrapper){padding-left:0;padding-right:30px}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard{--mat-focus-indicator-border-radius: var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard:not(.mat-button-toggle-vertical) .mat-button-toggle:last-of-type .mat-button-toggle-button::before{border-top-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-bottom-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard:not(.mat-button-toggle-vertical) .mat-button-toggle:first-of-type .mat-button-toggle-button::before{border-top-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-bottom-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle:last-of-type .mat-button-toggle-button::before{border-bottom-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-bottom-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle:first-of-type .mat-button-toggle-button::before{border-top-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-top-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}
|
|
377
|
-
`],encapsulation:2,changeDetection:0})}return o})(),yg=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({imports:[ae,qa,El,ae]})}return o})();var hx=(o,t)=>t.id,ux=(o,t)=>t.value;function gx(o,t){if(o&1&&(s(0,"mat-option",5),p(1),l()),o&2){let e=t.$implicit;w("value",e.id),d(),te(" ",e.name," ")}}function fx(o,t){if(o&1){let e=M();s(0,"mat-checkbox",35),_("change",function(){let n=v(e).$implicit,r=u();return y(r.toggleDayOfWeek(n.value))}),p(1),l()}if(o&2){let e=t.$implicit,i=u();w("checked",i.isDaySelected(e.value)),d(),te(" ",e.label," ")}}function _x(o,t){if(o&1){let e=M();s(0,"mat-form-field",2)(1,"mat-label"),p(2,"Number of Occurrences"),l(),s(3,"input",10),B("ngModelChange",function(n){v(e);let r=u();return j(r.endOccurrences,n)||(r.endOccurrences=n),y(n)}),l()()}if(o&2){let e=u();d(3),z("ngModel",e.endOccurrences)}}function bx(o,t){if(o&1){let e=M();s(0,"mat-form-field",2)(1,"mat-label"),p(2,"End Date"),l(),s(3,"input",36),B("ngModelChange",function(n){v(e);let r=u();return j(r.endTimestamp,n)||(r.endTimestamp=n),y(n)}),l()()}if(o&2){let e=u();d(3),z("ngModel",e.endTimestamp)}}function vx(o,t){if(o&1){let e=M();s(0,"div")(1,"mat-form-field",2)(2,"mat-label"),p(3,"Parameter Value"),l(),s(4,"input",37),B("ngModelChange",function(n){v(e);let r=u();return j(r.simpleParameter,n)||(r.simpleParameter=n),y(n)}),l(),s(5,"mat-hint"),p(6),l()()()}if(o&2){let e=u();d(4),z("ngModel",e.simpleParameter),d(2),te("Simple value for ","{{PARAMETERS}}"," placeholder or appended to first command")}}function yx(o,t){if(o&1){let e=M();s(0,"div",40)(1,"mat-form-field",41)(2,"mat-label"),p(3,"Key"),l(),s(4,"input",42),B("ngModelChange",function(n){let r=v(e).$implicit;return j(r.key,n)||(r.key=n),y(n)}),l()(),s(5,"mat-form-field",43)(6,"mat-label"),p(7,"Value"),l(),s(8,"input",44),B("ngModelChange",function(n){let r=v(e).$implicit;return j(r.value,n)||(r.value=n),y(n)}),l()(),s(9,"button",45),_("click",function(){let n=v(e).$index,r=u(3);return y(r.removeParameter(n))}),s(10,"mat-icon"),p(11,"delete"),l()()()}if(o&2){let e=t.$implicit;d(4),z("ngModel",e.key),d(4),z("ngModel",e.value)}}function Cx(o,t){if(o&1&&(s(0,"div",39),xe(1,yx,12,2,"div",40,Kn),l()),o&2){let e=u(2);d(),we(e.parameters)}}function xx(o,t){if(o&1){let e=M();s(0,"div")(1,"div",26)(2,"button",38),_("click",function(){v(e);let n=u();return y(n.addParameter())}),s(3,"mat-icon"),p(4,"add"),l()()(),C(5,Cx,3,0,"div",39),s(6,"p",19),p(7),l()()}if(o&2){let e=u();d(5),x(e.parameters.length>0?5:-1),d(2),te("Key-value pairs for ","{{key}}"," placeholders in prompt commands")}}function wx(o,t){if(o&1&&(s(0,"div",31)(1,"mat-icon"),p(2,"error"),l(),s(3,"span"),p(4),l()()),o&2){let e=u();d(4),F(e.errorMessage)}}var _a=class o{schedulerApi=m(yr);promptApi=m(ci);dialogRef=m(ei);availablePrompts=[];isLoadingPrompts=!1;name="";promptId="";enabled=!0;startTimestamp="";intervalValue=1;intervalUnit="h";daysOfWeek=[];endConditionType="none";endOccurrences=10;endTimestamp="";parameterMode="simple";simpleParameter="";parameters=[];isSaving=!1;errorMessage="";isEditMode=!1;schedulerId="";data=m(ji);daysOfWeekOptions=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:2,label:"Tuesday"},{value:3,label:"Wednesday"},{value:4,label:"Thursday"},{value:5,label:"Friday"},{value:6,label:"Saturday"}];constructor(){this.isEditMode=this.data.mode==="edit"}ngOnInit(){if(this.loadPrompts(),this.isEditMode||(this.startTimestamp=this.formatDateForInput(new Date)),this.isEditMode&&this.data.scheduler){if(this.schedulerId=this.data.scheduler.id,this.name=this.data.scheduler.name,this.promptId=this.data.scheduler.promptId,this.enabled=this.data.scheduler.enabled,this.data.scheduler.schedule.startTimestamp){let e=new Date(this.data.scheduler.schedule.startTimestamp);this.startTimestamp=this.formatDateForInput(e)}let t=this.data.scheduler.schedule.interval.match(/^(\d+)(min|h|d|M)$/);t&&t[1]&&t[2]&&(this.intervalValue=parseInt(t[1],10),this.intervalUnit=t[2]),this.daysOfWeek=this.data.scheduler.schedule.daysOfWeek||[],this.data.scheduler.schedule.endCondition&&(this.endConditionType=this.data.scheduler.schedule.endCondition.type,this.endConditionType==="occurrences"?this.endOccurrences=this.data.scheduler.schedule.endCondition.value:this.endConditionType==="endTimestamp"&&(this.endTimestamp=this.data.scheduler.schedule.endCondition.value)),this.data.scheduler.parameters&&(typeof this.data.scheduler.parameters=="object"&&Object.keys(this.data.scheduler.parameters).length===1&&"PARAMETERS"in this.data.scheduler.parameters?(this.parameterMode="simple",this.simpleParameter=String(this.data.scheduler.parameters.PARAMETERS)):(this.parameterMode="structured",this.parameters=Object.entries(this.data.scheduler.parameters).map(([e,i])=>({key:e,value:String(i)}))))}}loadPrompts(){this.isLoadingPrompts=!0,this.promptApi.listPrompts().subscribe({next:t=>{this.availablePrompts=t,this.isLoadingPrompts=!1},error:t=>{console.error("Error loading prompts:",t),this.errorMessage="Failed to load prompts",this.isLoadingPrompts=!1}})}toggleDayOfWeek(t){let e=this.daysOfWeek.indexOf(t);e>-1?this.daysOfWeek.splice(e,1):this.daysOfWeek.push(t),this.daysOfWeek.sort()}isDaySelected(t){return this.daysOfWeek.includes(t)}addParameter(){this.parameters.push({key:"",value:""})}removeParameter(t){this.parameters.splice(t,1)}trackByIndex(t){return t}formatDateForInput(t){let e=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),r=String(t.getHours()).padStart(2,"0"),a=String(t.getMinutes()).padStart(2,"0");return`${e}-${i}-${n}T${r}:${a}`}validateForm(){if(!this.name.trim())return this.errorMessage="Name is required",!1;if(!this.promptId)return this.errorMessage="Prompt is required",!1;if(this.intervalValue<1)return this.errorMessage="Interval must be at least 1",!1;switch(this.intervalUnit){case"min":if(this.intervalValue>59)return this.errorMessage="Minutes interval must be between 1 and 59 (use hours for longer)",!1;break;case"h":if(this.intervalValue>24)return this.errorMessage="Hours interval must be between 1 and 24 (use days for longer)",!1;break;case"d":if(this.intervalValue>31)return this.errorMessage="Days interval must be between 1 and 31 (use months for longer)",!1;break;case"M":if(this.intervalValue>12)return this.errorMessage="Months interval must be between 1 and 12",!1;break}return this.endConditionType==="occurrences"&&this.endOccurrences<1?(this.errorMessage="Occurrences must be at least 1",!1):this.endConditionType==="endTimestamp"&&!this.endTimestamp?(this.errorMessage="End date is required",!1):!0}buildSchedule(){let e={startTimestamp:(this.startTimestamp?new Date(this.startTimestamp):new Date).toISOString(),interval:`${this.intervalValue}${this.intervalUnit}`};return this.daysOfWeek.length>0&&(e.daysOfWeek=[...this.daysOfWeek]),this.endConditionType==="occurrences"?e.endCondition={type:"occurrences",value:this.endOccurrences}:this.endConditionType==="endTimestamp"&&(e.endCondition={type:"endTimestamp",value:this.endTimestamp}),e}buildParameters(){if(this.parameterMode==="simple")return this.simpleParameter.trim()?{PARAMETERS:this.simpleParameter.trim()}:void 0;let t=this.parameters.filter(i=>i.key.trim());if(t.length===0)return;let e={};return t.forEach(i=>{e[i.key]=i.value}),e}save(){if(this.errorMessage="",!this.validateForm())return;let t=this.buildSchedule(),e=this.buildParameters();this.isSaving=!0,this.isEditMode&&this.schedulerId?this.schedulerApi.updateScheduler(this.schedulerId,{name:this.name.trim(),enabled:this.enabled,promptId:this.promptId,schedule:t,parameters:e}).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:i=>{console.error("Error updating scheduler:",i),this.errorMessage=i?.error?.error||i?.message||"Failed to update scheduler",this.isSaving=!1}}):this.schedulerApi.createScheduler({name:this.name.trim(),promptId:this.promptId,schedule:t,parameters:e,enabled:this.enabled}).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:i=>{console.error("Error creating scheduler:",i),this.errorMessage=i?.error?.error||i?.message||"Failed to create scheduler",this.isSaving=!1}})}cancel(){this.dialogRef.close(!1)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-scheduler-form"]],decls:89,vars:17,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","My Scheduler","required","",3,"ngModelChange","ngModel"],["required","",3,"ngModelChange","ngModel"],[3,"value"],["matInput","","type","datetime-local",3,"ngModelChange","ngModel"],[1,"interval-section"],[1,"interval-fields"],["appearance","outline",1,"interval-value"],["matInput","","type","number","min","1","required","",3,"ngModelChange","ngModel"],["appearance","outline",1,"interval-unit"],["value","min"],["value","h"],["value","d"],["value","M"],[1,"days-section"],[1,"days-checkboxes"],[3,"checked"],[1,"hint"],[1,"end-condition-section"],[3,"ngModelChange","ngModel"],["value","none"],["value","occurrences"],["value","endTimestamp"],[1,"parameters-section"],[1,"section-header"],[1,"mode-toggle",3,"ngModelChange","ngModel"],["value","simple"],["value","structured"],[1,"enabled-section"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],[3,"change","checked"],["matInput","","type","datetime-local","required","",3,"ngModelChange","ngModel"],["matInput","","placeholder","e.g., 1234 or staging",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Add parameter",3,"click"],[1,"parameters-list"],[1,"parameter-item"],["appearance","outline",1,"param-key"],["matInput","","placeholder","parameterName",3,"ngModelChange","ngModel"],["appearance","outline",1,"param-value"],["matInput","","placeholder","value",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove parameter",1,"remove-btn",3,"click"]],template:function(e,i){e&1&&(s(0,"h2",0),p(1),l(),s(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),p(6,"Name"),l(),s(7,"input",3),B("ngModelChange",function(r){return j(i.name,r)||(i.name=r),r}),l(),s(8,"mat-hint"),p(9,"A descriptive name for this scheduler"),l()(),s(10,"mat-form-field",2)(11,"mat-label"),p(12,"Prompt"),l(),s(13,"mat-select",4),B("ngModelChange",function(r){return j(i.promptId,r)||(i.promptId=r),r}),xe(14,gx,2,2,"mat-option",5,hx),l(),s(16,"mat-hint"),p(17,"Select the prompt to execute"),l()(),s(18,"mat-form-field",2)(19,"mat-label"),p(20,"Start Date & Time"),l(),s(21,"input",6),B("ngModelChange",function(r){return j(i.startTimestamp,r)||(i.startTimestamp=r),r}),l(),s(22,"mat-hint"),p(23,"When to start the scheduler (leave empty for now)"),l()(),s(24,"div",7)(25,"h3"),p(26,"Schedule Interval"),l(),s(27,"div",8)(28,"mat-form-field",9)(29,"mat-label"),p(30,"Every"),l(),s(31,"input",10),B("ngModelChange",function(r){return j(i.intervalValue,r)||(i.intervalValue=r),r}),l()(),s(32,"mat-form-field",11)(33,"mat-label"),p(34,"Unit"),l(),s(35,"mat-select",4),B("ngModelChange",function(r){return j(i.intervalUnit,r)||(i.intervalUnit=r),r}),s(36,"mat-option",12),p(37,"Minutes (1-59)"),l(),s(38,"mat-option",13),p(39,"Hours (1-24)"),l(),s(40,"mat-option",14),p(41,"Days (1-31)"),l(),s(42,"mat-option",15),p(43,"Months (1-12)"),l()()()()(),s(44,"div",16)(45,"h3"),p(46,"Days of Week (Optional)"),l(),s(47,"div",17),xe(48,fx,2,2,"mat-checkbox",18,ux),l(),s(50,"p",19),p(51,"Leave empty to run every day"),l()(),s(52,"div",20)(53,"h3"),p(54,"End Condition (Optional)"),l(),s(55,"mat-form-field",2)(56,"mat-label"),p(57,"End Type"),l(),s(58,"mat-select",21),B("ngModelChange",function(r){return j(i.endConditionType,r)||(i.endConditionType=r),r}),s(59,"mat-option",22),p(60,"Never (run indefinitely)"),l(),s(61,"mat-option",23),p(62,"After X occurrences"),l(),s(63,"mat-option",24),p(64,"Until specific date"),l()()(),C(65,_x,4,1,"mat-form-field",2),C(66,bx,4,1,"mat-form-field",2),l(),s(67,"div",25)(68,"div",26)(69,"h3"),p(70,"Parameters (Optional)"),l(),s(71,"mat-button-toggle-group",27),B("ngModelChange",function(r){return j(i.parameterMode,r)||(i.parameterMode=r),r}),s(72,"mat-button-toggle",28),p(73,"Simple"),l(),s(74,"mat-button-toggle",29),p(75,"Structured"),l()()(),C(76,vx,7,2,"div"),C(77,xx,8,2,"div"),l(),s(78,"div",30)(79,"mat-checkbox",21),B("ngModelChange",function(r){return j(i.enabled,r)||(i.enabled=r),r}),p(80,"Enabled"),l(),s(81,"p",19),p(82,"Scheduler will only run if enabled"),l()(),C(83,wx,5,1,"div",31),l()(),s(84,"mat-dialog-actions",32)(85,"button",33),_("click",function(){return i.cancel()}),p(86,"Cancel"),l(),s(87,"button",34),_("click",function(){return i.save()}),p(88),l()()),e&2&&(d(),F(i.isEditMode?"Edit Scheduler":"Create Scheduler"),d(6),z("ngModel",i.name),d(6),z("ngModel",i.promptId),d(),we(i.availablePrompts),d(7),z("ngModel",i.startTimestamp),d(10),z("ngModel",i.intervalValue),d(4),z("ngModel",i.intervalUnit),d(13),we(i.daysOfWeekOptions),d(10),z("ngModel",i.endConditionType),d(7),x(i.endConditionType==="occurrences"?65:-1),d(),x(i.endConditionType==="endTimestamp"?66:-1),d(5),z("ngModel",i.parameterMode),d(5),x(i.parameterMode==="simple"?76:-1),d(),x(i.parameterMode==="structured"?77:-1),d(2),z("ngModel",i.enabled),d(4),x(i.errorMessage?83:-1),d(2),w("disabled",i.isSaving),d(2),w("disabled",i.isSaving),d(),te(" ",i.isSaving?"Saving...":"Save"," "))},dependencies:[Pe,je,Le,Za,Ve,Fo,is,ze,ao,pn,un,hn,it,Et,Qe,Xt,di,jt,zt,yn,ct,Oe,he,fa,Dd,fo,_g,Fd,yg,Nd,El],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:600px}@media (max-width: 768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.interval-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem;font-weight:600}.interval-section[_ngcontent-%COMP%] .interval-fields[_ngcontent-%COMP%]{display:flex;gap:1rem}.interval-section[_ngcontent-%COMP%] .interval-fields[_ngcontent-%COMP%] .interval-value[_ngcontent-%COMP%], .interval-section[_ngcontent-%COMP%] .interval-fields[_ngcontent-%COMP%] .interval-unit[_ngcontent-%COMP%]{flex:1}.days-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem;font-weight:600}.days-section[_ngcontent-%COMP%] .days-checkboxes[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem;margin-bottom:.5rem}.days-section[_ngcontent-%COMP%] .days-checkboxes[_ngcontent-%COMP%] mat-checkbox[_ngcontent-%COMP%]{min-width:120px}.days-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary)}.end-condition-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem;font-weight:600}.parameters-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:.5rem}.parameters-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.parameters-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] .mode-toggle[_ngcontent-%COMP%]{height:32px}.parameters-section[_ngcontent-%COMP%] .parameters-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%] .param-key[_ngcontent-%COMP%]{flex:1}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%] .param-value[_ngcontent-%COMP%]{flex:2}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{margin-top:8px}.parameters-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.85rem;color:var(--color-text-secondary)}.enabled-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.enabled-section[_ngcontent-%COMP%] mat-checkbox[_ngcontent-%COMP%]{display:block;margin-bottom:.5rem}.enabled-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}"]})};function Sx(o,t){o&1&&(s(0,"div",12),p(1,"Loading schedulers..."),l())}function kx(o,t){if(o&1&&(s(0,"div",13),p(1),l()),o&2){let e=u();d(),F(e.errorMessage)}}function Mx(o,t){o&1&&(s(0,"div",14),p(1," No schedulers found. Create your first scheduler to automate prompt execution. "),l())}function Tx(o,t){o&1&&(s(0,"div",14),p(1," No schedulers match your search. "),l())}function Ex(o,t){if(o&1&&(s(0,"span",31),p(1),l()),o&2){let e=u().$implicit;w("title",Tn("Created by ",e.createdBy)),d(),te(" \u{1F464} ",e.createdBy," ")}}function Px(o,t){if(o&1&&(s(0,"div",22)(1,"span",23),p(2,"Last Run:"),l(),s(3,"span",24),p(4),Jn(5,"date"),l()()),o&2){let e=u().$implicit;d(4),F(Pr(5,1,e.lastRun,"short"))}}function Ox(o,t){if(o&1){let e=M();s(0,"div",17)(1,"div",18)(2,"h3"),p(3),s(4,"span",19),p(5),l(),$e(6,Ex,2,3,"span",20),l(),s(7,"div",21)(8,"div",22)(9,"span",23),p(10,"Prompt:"),l(),s(11,"span",24),p(12),l()(),s(13,"div",22)(14,"span",23),p(15,"Schedule:"),l(),s(16,"span",24),p(17),l()(),s(18,"div",22)(19,"span",23),p(20,"Next Run:"),l(),s(21,"span",24),p(22),l()(),$e(23,Px,6,4,"div",25),l()(),s(24,"div",26)(25,"button",27),_("click",function(){let n=v(e).$implicit,r=u(2);return y(r.editScheduler(n))}),p(26,"Edit"),l(),s(27,"button",28),_("click",function(){let n=v(e).$implicit,r=u(2);return y(r.toggleEnabled(n))}),p(28),l(),s(29,"button",29),_("click",function(){let n=v(e).$implicit,r=u(2);return y(r.runNow(n.id))}),p(30,"Run Now"),l(),s(31,"button",30),_("click",function(){let n=v(e).$implicit,r=u(2);return y(r.deleteScheduler(n.id))}),p(32,"Delete"),l()()()}if(o&2){let e=t.$implicit,i=u(2);d(3),te(" ",e.name," "),d(),E("enabled",e.enabled),d(),te(" ",e.enabled?"Enabled":"Disabled"," "),d(),w("ngIf",e.createdBy!==i.getCurrentUsername()),d(6),F(i.getPromptName(e.promptId)),d(5),F(i.formatInterval(e.schedule.interval)),d(5),F(i.formatNextRun(e.nextRun)),d(),w("ngIf",e.lastRun),d(4),E("btn-enabled",e.enabled)("btn-disabled",!e.enabled),d(),te(" ",e.enabled?"Disable":"Enable"," ")}}function Ax(o,t){if(o&1&&(s(0,"div",15),$e(1,Ox,33,14,"div",16),l()),o&2){let e=u();d(),w("ngForOf",e.filteredSchedulers)}}var Pl=class o{schedulerApi=m(yr);promptApi=m(ci);configApi=m(Qi);dialog=m(yi);schedulers=[];filteredSchedulers=[];prompts=[];searchQuery="";showOnlyMine=!0;isLoading=!1;errorMessage="";currentUsername="";ngOnInit(){this.configApi.getUserConfig().subscribe({next:t=>{this.currentUsername=t.username??"",console.log("[SCHEDULER_MANAGER] Current username:",this.currentUsername)},error:t=>{console.error("[SCHEDULER_MANAGER] Error loading user config:",t)}}),this.loadPrompts(),this.loadSchedulers()}loadPrompts(){this.promptApi.listPrompts().subscribe({next:t=>{this.prompts=t},error:t=>{console.error("Error loading prompts:",t)}})}loadSchedulers(){this.isLoading=!0,this.schedulerApi.listSchedulers().subscribe({next:t=>{this.schedulers=t,this.applyFilter(),this.isLoading=!1},error:t=>{console.error("Error loading schedulers:",t),this.errorMessage="Failed to load schedulers",this.isLoading=!1}})}deleteScheduler(t){confirm("Are you sure you want to delete this scheduler?")&&this.schedulerApi.deleteScheduler(t).subscribe({next:()=>{this.loadSchedulers()},error:e=>{console.error("Error deleting scheduler:",e);let i=e?.error?.error??e?.message??"Failed to delete scheduler";alert(`Failed to delete scheduler: ${i}`)}})}toggleEnabled(t){(t.enabled?this.schedulerApi.disableScheduler(t.id):this.schedulerApi.enableScheduler(t.id)).subscribe({next:()=>{this.loadSchedulers()},error:i=>{console.error("Error toggling scheduler:",i);let n=i?.error?.error??i?.message??"Failed to toggle scheduler";alert(`Failed to toggle scheduler: ${n}`)}})}runNow(t){this.schedulerApi.runSchedulerNow(t).subscribe({next:e=>{alert(`Scheduler executed successfully! Thread ID: ${e.threadId}`),this.loadSchedulers()},error:e=>{console.error("Error running scheduler:",e);let i=e?.error?.error??e?.message??"Failed to run scheduler";alert(`Failed to run scheduler: ${i}`)}})}formatNextRun(t){return t?new Date(t).toLocaleString():"Expired or completed"}getCurrentUsername(){return this.currentUsername}getPromptName(t){let e=this.prompts.find(i=>i.id===t);return e?e.name:t}formatInterval(t){let e=RegExp(/^(\d+)(min|h|d|M)$/).exec(t);if(!e)return t;let[,i,n]=e;if(!i||!n)return t;let a={min:"minute",h:"hour",d:"day",M:"month"}[n]??n;return`Every ${i} ${a}${parseInt(i,10)>1?"s":""}`}normalizeUsername(t){return t.replace(/[.\s]+/g,"_")}isMyScheduler(t){if(!this.currentUsername)return!1;let e=this.normalizeUsername(this.currentUsername.toLowerCase());return this.normalizeUsername(t.createdBy.toLowerCase())===e}applyFilter(){let t=this.searchQuery.toLowerCase().trim(),e=this.showOnlyMine&&this.currentUsername?this.schedulers.filter(i=>this.isMyScheduler(i)):[...this.schedulers];t&&(e=e.filter(i=>i.name.toLowerCase().includes(t)||i.promptId.toLowerCase().includes(t)||this.getPromptName(i.promptId).toLowerCase().includes(t)?!0:i.createdBy.toLowerCase().includes(t))),this.filteredSchedulers=e}onSearchChange(){this.applyFilter()}createScheduler(){this.dialog.open(_a,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadSchedulers()})}editScheduler(t){this.schedulerApi.getScheduler(t.id).subscribe({next:e=>{this.dialog.open(_a,{width:"700px",maxHeight:"90vh",data:{mode:"edit",scheduler:e}}).afterClosed().subscribe(n=>{n&&this.loadSchedulers()})},error:e=>{console.error("Error loading scheduler details:",e);let i=e?.error?.error??e?.message??"Failed to load scheduler details";alert(`Failed to load scheduler details: ${i}`)}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-scheduler-manager"]],decls:23,vars:7,consts:[[1,"scheduler-manager"],[1,"header"],[1,"header-actions"],["appearance","outline",1,"search-field"],["matInput","","placeholder","Name, prompt, author...",3,"ngModelChange","input","ngModel"],["matPrefix",""],["color","primary",1,"mine-toggle",3,"ngModelChange","change","ngModel"],[1,"btn-create",3,"click"],["class","loading",4,"ngIf"],["class","error",4,"ngIf"],["class","empty",4,"ngIf"],["class","scheduler-list",4,"ngIf"],[1,"loading"],[1,"error"],[1,"empty"],[1,"scheduler-list"],["class","scheduler-item",4,"ngFor","ngForOf"],[1,"scheduler-item"],[1,"scheduler-info"],[1,"status-badge"],["class","owner-badge",3,"title",4,"ngIf"],[1,"details"],[1,"detail-row"],[1,"label"],[1,"value"],["class","detail-row",4,"ngIf"],[1,"scheduler-actions"],[1,"btn-primary",3,"click"],[3,"click"],[1,"btn-accent",3,"click"],[1,"btn-danger",3,"click"],[1,"owner-badge",3,"title"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"h2"),p(3,"Schedulers"),l(),s(4,"div",2)(5,"mat-form-field",3)(6,"mat-label"),p(7,"Search"),l(),s(8,"input",4),B("ngModelChange",function(r){return j(i.searchQuery,r)||(i.searchQuery=r),r}),_("input",function(){return i.onSearchChange()}),l(),s(9,"mat-icon",5),p(10,"search"),l()(),s(11,"mat-slide-toggle",6),B("ngModelChange",function(r){return j(i.showOnlyMine,r)||(i.showOnlyMine=r),r}),_("change",function(){return i.applyFilter()}),p(12," Mine "),l(),s(13,"button",7),_("click",function(){return i.createScheduler()}),s(14,"mat-icon"),p(15,"add"),l(),s(16,"span"),p(17,"Create Scheduler"),l()()()(),$e(18,Sx,2,0,"div",8)(19,kx,2,1,"div",9)(20,Mx,2,0,"div",10)(21,Tx,2,0,"div",10)(22,Ax,2,1,"div",11),l()),e&2&&(d(8),z("ngModel",i.searchQuery),d(3),z("ngModel",i.showOnlyMine),d(7),w("ngIf",i.isLoading),d(),w("ngIf",i.errorMessage),d(),w("ngIf",!i.isLoading&&i.schedulers.length===0),d(),w("ngIf",!i.isLoading&&i.schedulers.length>0&&i.filteredSchedulers.length===0),d(),w("ngIf",!i.isLoading&&i.filteredSchedulers.length>0))},dependencies:[Pe,Fa,Na,je,Le,Ve,ze,Oe,he,Xt,di,jt,zt,go,ct,_l,uo,Ir],styles:[".scheduler-manager[_ngcontent-%COMP%]{padding:1.5rem .5rem 1.5rem 1.5rem}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem;padding-right:1rem}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .search-field[_ngcontent-%COMP%]{width:300px;margin-bottom:-1.25em}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .mine-toggle[_ngcontent-%COMP%]{margin-bottom:-1.25em}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1.5rem;border:none;border-radius:4px;background:var(--color-primary);color:#fff;cursor:pointer;font-size:1rem;font-weight:500;white-space:nowrap}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.loading[_ngcontent-%COMP%], .error[_ngcontent-%COMP%], .empty[_ngcontent-%COMP%]{padding:1rem 1.5rem 1rem 1rem;text-align:center;color:var(--color-text-secondary)}.error[_ngcontent-%COMP%]{color:var(--color-error)}.scheduler-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding-right:1rem}.scheduler-item[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;padding:1rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-surface)}.scheduler-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.scheduler-info[_ngcontent-%COMP%]{flex:1}.scheduler-info[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.1rem;display:flex;align-items:center;gap:.5rem}.scheduler-info[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] .owner-badge[_ngcontent-%COMP%]{font-size:.75rem;padding:.25rem .5rem;background:#2196f3;color:#fff;border-radius:4px;font-weight:400}.scheduler-info[_ngcontent-%COMP%] .status-badge[_ngcontent-%COMP%]{padding:.25rem .5rem;font-size:.75rem;border-radius:4px;background:var(--color-text-secondary);color:#fff}.scheduler-info[_ngcontent-%COMP%] .status-badge.enabled[_ngcontent-%COMP%]{background:var(--color-success)}.scheduler-info[_ngcontent-%COMP%] .details[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.scheduler-info[_ngcontent-%COMP%] .detail-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;font-size:.9rem}.scheduler-info[_ngcontent-%COMP%] .detail-row[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{font-weight:600;min-width:100px;color:var(--color-text-secondary)}.scheduler-info[_ngcontent-%COMP%] .detail-row[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{color:var(--color-text)}.scheduler-actions[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.scheduler-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:.5rem 1rem;border:none;border-radius:4px;cursor:pointer;font-size:.9rem;white-space:nowrap}.scheduler-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]{background:var(--color-primary);color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-secondary[_ngcontent-%COMP%]{background:var(--color-secondary);color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-secondary[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-enabled[_ngcontent-%COMP%]{background:#4caf50;color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-enabled[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-disabled[_ngcontent-%COMP%]{background:#9e9e9e;color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-disabled[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-accent[_ngcontent-%COMP%]{background:#ff9800;color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-accent[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]{background:var(--color-error);color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]:hover{opacity:.9}"]})};var wr=class o{http=m(Ye);projectState=m(Se);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/agents`}listEditableAgents(){return this.http.get(`${this.getBaseUrl()}/editable`)}getAgent(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createAgent(t,e){return this.http.post(this.getBaseUrl(),{location:e,definition:t})}updateAgent(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,{definition:e})}listDocuments(t){return this.http.get(`${this.getBaseUrl()}/documents`,{params:{location:t}})}uploadDocument(t,e){return new Oi(i=>{let n=new FileReader;n.onload=()=>{let r=n.result.split(",")[1];this.http.post(`${this.getBaseUrl()}/documents`,{filename:e.name,content:r,mimeType:e.type},{params:{location:t}}).subscribe(i)},n.onerror=()=>i.error(n.error),n.readAsDataURL(e)})}deleteAgent(t){return this.http.delete(`${this.getBaseUrl()}/${t}`)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};function Ix(o,t){o&1&&(s(0,"p",15),p(1,"No integrations defined \u2014 agent will have access to all tools."),l())}function Dx(o,t){if(o&1){let e=M();s(0,"div",16)(1,"mat-form-field",22)(2,"mat-label"),p(3,"Integration"),l(),s(4,"input",23),B("ngModelChange",function(n){let r=v(e).$implicit;return j(r.integration,n)||(r.integration=n),y(n)}),l()(),s(5,"mat-form-field",24)(6,"mat-label"),p(7,"Tools (comma-separated)"),l(),s(8,"input",25),B("ngModelChange",function(n){let r=v(e).$implicit;return j(r.tools,n)||(r.tools=n),y(n)}),l()(),s(9,"button",26),_("click",function(){let n=v(e).$index,r=u();return y(r.removeIntegrationRow(n))}),s(10,"mat-icon"),p(11,"delete"),l()()()}if(o&2){let e=t.$implicit;d(4),z("ngModel",e.integration),d(4),z("ngModel",e.tools)}}function Rx(o,t){if(o&1&&(s(0,"p",30),p(1),l()),o&2){let e=u(2);d(),F(e.docUploadError)}}function Fx(o,t){o&1&&(s(0,"p",15),p(1,"No mandatory documents defined."),l())}function Nx(o,t){if(o&1&&A(0,"option",35),o&2){let e=t.$implicit;w("value","documents/"+e)}}function Lx(o,t){if(o&1){let e=M();s(0,"div",31)(1,"mat-form-field",32)(2,"mat-label"),p(3,"Document path"),l(),s(4,"input",33),B("ngModelChange",function(n){let r=v(e).$index,a=u(2);return j(a.mandatoryDocs[r],n)||(a.mandatoryDocs[r]=n),y(n)}),l(),s(5,"datalist",34),xe(6,Nx,1,1,"option",35,_m),l()(),s(8,"button",26),_("click",function(){let n=v(e).$index,r=u(2);return y(r.removeDocRow(n))}),s(9,"mat-icon"),p(10,"delete"),l()()()}if(o&2){let e=t.$index,i=u(2);d(4),z("ngModel",i.mandatoryDocs[e]),X("list","docs-list-"+e),d(),w("id","docs-list-"+e),d(),we(i.availableDocuments)}}function Vx(o,t){if(o&1){let e=M();s(0,"div",6)(1,"span"),p(2,"Mandatory Documents"),l(),s(3,"button",27),_("click",function(){v(e);let n=u();return y(n.addDocRow())}),s(4,"mat-icon"),p(5,"add"),l()(),s(6,"label",28)(7,"mat-icon"),p(8,"upload_file"),l(),s(9,"input",29),_("change",function(n){v(e);let r=u();return y(r.onDocFileSelected(n))}),l()()(),C(10,Rx,2,1,"p",30),C(11,Fx,2,0,"p",15),xe(12,Lx,11,3,"div",31,Kn)}if(o&2){let e=u();d(6),E("uploading",e.isUploadingDoc),d(3),w("disabled",e.isUploadingDoc),d(),x(e.docUploadError?10:-1),d(),x(e.mandatoryDocs.length===0?11:-1),d(),we(e.mandatoryDocs)}}function zx(o,t){o&1&&(s(0,"p",15),p(1,"\u{1F4A1} Documents can be added after the agent is created."),l())}function jx(o,t){if(o&1){let e=M();s(0,"div",6),p(1,"Save to"),l(),s(2,"div",36)(3,"label",37)(4,"input",38),B("ngModelChange",function(n){v(e);let r=u();return j(r.location,n)||(r.location=n),y(n)}),l(),s(5,"div",39)(6,"div",40)(7,"span",41),p(8,"\u{1F464}"),l(),s(9,"span",42),p(10,"Project config"),l()(),s(11,"p",43),p(12),l()()(),s(13,"label",37)(14,"input",44),B("ngModelChange",function(n){v(e);let r=u();return j(r.location,n)||(r.location=n),y(n)}),l(),s(15,"div",39)(16,"div",40)(17,"span",41),p(18,"\u{1F4E6}"),l(),s(19,"span",42),p(20,"Colocated"),l()(),s(21,"p",43),p(22,"Next to coday.yaml in ./agents/ (committable)"),l()()()(),s(23,"p",15),p(24,"Storage location is permanent and cannot be changed after creation."),l()}if(o&2){let e=u();d(3),E("selected",e.location==="project"),d(),z("ngModel",e.location),d(8),Mn("~/.coday/projects/","{","name","}","/agents/ (not committed)"),d(),E("selected",e.location==="colocated"),d(),z("ngModel",e.location)}}function Bx(o,t){if(o&1&&(s(0,"div",17)(1,"span",6),p(2,"Storage Location"),l(),s(3,"span",45),p(4),l(),s(5,"p",15),p(6,"Cannot be changed after creation."),l()()),o&2){let e=u();d(3),E("badge-project",e.location==="project")("badge-colocated",e.location==="colocated"),d(),te(" ",e.location==="project"?"\u{1F464} Project config":"\u{1F4E6} Colocated"," ")}}function Hx(o,t){if(o&1&&(s(0,"div",18)(1,"mat-icon"),p(2,"error"),l(),s(3,"span"),p(4),l()()),o&2){let e=u();d(4),F(e.errorMessage)}}var ba=class o{agentCrudApi=m(wr);agentApi=m(Jo);dialogRef=m(ei);data=m(ji);name="";description="";instructions="";aiProvider="";modelName="";temperature=null;maxOutputTokens=null;openaiAssistantId="";integrationRows=[];mandatoryDocs=[];availableDocuments=[];isUploadingDoc=!1;docUploadError="";location="project";isSaving=!1;errorMessage="";isEditMode=!1;ngOnInit(){if(this.isEditMode=this.data.mode==="edit",this.isEditMode&&this.data.agent){let t=this.data.agent.definition;this.name=t.name,this.description=t.description,this.instructions=t.instructions??"",this.aiProvider=t.aiProvider??"",this.modelName=t.modelName??"",this.temperature=t.temperature??null,this.maxOutputTokens=t.maxOutputTokens??null,this.openaiAssistantId=t.openaiAssistantId??"",this.location=this.data.agent.source,t.integrations&&(this.integrationRows=Object.entries(t.integrations).map(([e,i])=>({integration:e,tools:i?.join(", ")??""}))),this.mandatoryDocs=[...t.mandatoryDocs??[]],this.loadAvailableDocuments()}}loadAvailableDocuments(){this.agentCrudApi.listDocuments(this.location).subscribe({next:t=>this.availableDocuments=t,error:()=>this.availableDocuments=[]})}addDocRow(){this.mandatoryDocs.push("")}removeDocRow(t){this.mandatoryDocs.splice(t,1)}onDocFileSelected(t){let e=t.target,i=e.files?.[0];i&&(this.isUploadingDoc=!0,this.docUploadError="",this.agentCrudApi.uploadDocument(this.location,i).subscribe({next:n=>{this.isUploadingDoc=!1,this.mandatoryDocs.push(n.relativePath),this.loadAvailableDocuments(),e.value=""},error:n=>{this.isUploadingDoc=!1,this.docUploadError=n?.error?.error??n?.message??"Upload failed",e.value=""}}))}addIntegrationRow(){this.integrationRows.push({integration:"",tools:""})}removeIntegrationRow(t){this.integrationRows.splice(t,1)}trackByIndex(t){return t}validateForm(){if(!this.name.trim())return this.errorMessage="Name is required",!1;if(!/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/.test(this.name.trim()))return this.errorMessage="Name must start with alphanumeric and contain only letters, digits, hyphens or underscores",!1;if(!this.description.trim())return this.errorMessage="Description is required",!1;for(let t of this.integrationRows)if(!t.integration.trim())return this.errorMessage="Integration name cannot be empty",!1;return!0}buildDefinition(){let t=this.mandatoryDocs.map(i=>i.trim()).filter(Boolean),e=this.integrationRows.length>0?Object.fromEntries(this.integrationRows.filter(i=>i.integration.trim()).map(i=>[i.integration.trim(),i.tools.split(",").map(n=>n.trim()).filter(Boolean)])):void 0;return{name:this.name.trim(),description:this.description.trim(),instructions:this.instructions.trim()||void 0,aiProvider:this.aiProvider.trim()||void 0,modelName:this.modelName.trim()||void 0,temperature:this.temperature??void 0,maxOutputTokens:this.maxOutputTokens??void 0,openaiAssistantId:this.openaiAssistantId.trim()||void 0,integrations:e,mandatoryDocs:t.length>0?t:void 0}}save(){if(this.errorMessage="",!this.validateForm())return;let t=this.buildDefinition();this.isSaving=!0,(this.isEditMode?this.agentCrudApi.updateAgent(this.name.trim(),t):this.agentCrudApi.createAgent(t,this.location)).subscribe({next:()=>{this.isSaving=!1,this.agentApi.clearAllCache(),this.dialogRef.close(!0)},error:i=>{this.isSaving=!1,this.errorMessage=i?.error?.error||i?.message||"Failed to save agent"}})}cancel(){this.dialogRef.close(!1)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-agent-form"]],decls:69,vars:18,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","my-agent","required","",3,"ngModelChange","ngModel","readonly"],["matInput","","placeholder","What does this agent do?","rows","2","required","",3,"ngModelChange","ngModel"],["matInput","","placeholder","System instructions for the agent...","rows","6",3,"ngModelChange","ngModel"],[1,"section-title"],[1,"row-2col"],["appearance","outline"],["matInput","","placeholder","e.g. anthropic, openai",3,"ngModelChange","ngModel"],["matInput","","placeholder","e.g. claude-sonnet-4-5",3,"ngModelChange","ngModel"],["matInput","","type","number","min","0","max","2","step","0.1","placeholder","0.0 \u2013 2.0",3,"ngModelChange","ngModel"],["matInput","","type","number","min","1","placeholder","e.g. 4096",3,"ngModelChange","ngModel"],["matInput","","placeholder","asst_...",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Add integration",3,"click"],[1,"hint"],[1,"integration-row"],[1,"source-display"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],["appearance","outline",1,"integration-name"],["matInput","","placeholder","e.g. GITHUB",3,"ngModelChange","ngModel"],["appearance","outline",1,"integration-tools"],["matInput","","placeholder","Leave empty for all tools",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove",3,"click"],["mat-icon-button","","type","button","title","Add document path",3,"click"],["title","Upload a document to the pool",1,"upload-btn"],["type","file","hidden","",3,"change","disabled"],[1,"doc-upload-error"],[1,"doc-row"],["appearance","outline",1,"doc-field"],["matInput","","placeholder","documents/guide.md",3,"ngModelChange","ngModel"],[3,"id"],[3,"value"],[1,"source-options"],[1,"source-option"],["type","radio","name","location","value","project",3,"ngModelChange","ngModel"],[1,"source-content"],[1,"source-header"],[1,"source-icon"],[1,"source-label"],[1,"source-description"],["type","radio","name","location","value","colocated",3,"ngModelChange","ngModel"],[1,"source-badge"]],template:function(e,i){e&1&&(s(0,"h2",0),p(1),l(),s(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),p(6,"Name"),l(),s(7,"input",3),B("ngModelChange",function(r){return j(i.name,r)||(i.name=r),r}),l(),s(8,"mat-hint"),p(9,"Alphanumeric, hyphens and underscores only. Cannot be changed after creation."),l()(),s(10,"mat-form-field",2)(11,"mat-label"),p(12,"Description"),l(),s(13,"textarea",4),B("ngModelChange",function(r){return j(i.description,r)||(i.description=r),r}),l()(),s(14,"mat-form-field",2)(15,"mat-label"),p(16,"Instructions"),l(),s(17,"textarea",5),B("ngModelChange",function(r){return j(i.instructions,r)||(i.instructions=r),r}),l(),s(18,"mat-hint"),p(19,"System prompt / instructions sent to the AI model"),l()(),s(20,"div",6),p(21,"AI Configuration"),l(),s(22,"div",7)(23,"mat-form-field",8)(24,"mat-label"),p(25,"AI Provider"),l(),s(26,"input",9),B("ngModelChange",function(r){return j(i.aiProvider,r)||(i.aiProvider=r),r}),l()(),s(27,"mat-form-field",8)(28,"mat-label"),p(29,"Model Name"),l(),s(30,"input",10),B("ngModelChange",function(r){return j(i.modelName,r)||(i.modelName=r),r}),l()()(),s(31,"div",7)(32,"mat-form-field",8)(33,"mat-label"),p(34,"Temperature"),l(),s(35,"input",11),B("ngModelChange",function(r){return j(i.temperature,r)||(i.temperature=r),r}),l(),s(36,"mat-hint"),p(37,"Leave empty for model default"),l()(),s(38,"mat-form-field",8)(39,"mat-label"),p(40,"Max Output Tokens"),l(),s(41,"input",12),B("ngModelChange",function(r){return j(i.maxOutputTokens,r)||(i.maxOutputTokens=r),r}),l(),s(42,"mat-hint"),p(43,"Leave empty for model default"),l()()(),s(44,"mat-form-field",2)(45,"mat-label"),p(46,"OpenAI Assistant ID"),l(),s(47,"input",13),B("ngModelChange",function(r){return j(i.openaiAssistantId,r)||(i.openaiAssistantId=r),r}),l(),s(48,"mat-hint"),p(49,"If set, forces aiProvider to openai"),l()(),s(50,"div",6)(51,"span"),p(52,"Integrations"),l(),s(53,"button",14),_("click",function(){return i.addIntegrationRow()}),s(54,"mat-icon"),p(55,"add"),l()()(),C(56,Ix,2,0,"p",15),xe(57,Dx,12,2,"div",16,Kn),C(59,Vx,14,5)(60,zx,2,0,"p",15),C(61,jx,25,8),C(62,Bx,7,5,"div",17),C(63,Hx,5,1,"div",18),l()(),s(64,"mat-dialog-actions",19)(65,"button",20),_("click",function(){return i.cancel()}),p(66,"Cancel"),l(),s(67,"button",21),_("click",function(){return i.save()}),p(68),l()()),e&2&&(d(),F(i.isEditMode?"Edit Agent":"Create Agent"),d(6),z("ngModel",i.name),w("readonly",i.isEditMode),d(6),z("ngModel",i.description),d(4),z("ngModel",i.instructions),d(9),z("ngModel",i.aiProvider),d(4),z("ngModel",i.modelName),d(5),z("ngModel",i.temperature),d(6),z("ngModel",i.maxOutputTokens),d(6),z("ngModel",i.openaiAssistantId),d(9),x(i.integrationRows.length===0?56:-1),d(),we(i.integrationRows),d(2),x(i.isEditMode?59:60),d(2),x(i.isEditMode?-1:61),d(),x(i.isEditMode?62:-1),d(),x(i.errorMessage?63:-1),d(2),w("disabled",i.isSaving),d(2),w("disabled",i.isSaving),d(),te(" ",i.isSaving?"Saving...":"Save"," "))},dependencies:[je,es,ts,Le,Za,Ro,Ve,Fo,is,qm,ze,ao,pn,un,hn,it,Et,Qe,Xt,di,jt,zt,yn,ct,Oe,he,fa,$o],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:560px}@media (max-width: 768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.section-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;font-size:1rem;font-weight:600;margin-top:.5rem;margin-bottom:-.25rem}.row-2col[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}@media (max-width: 768px){.row-2col[_ngcontent-%COMP%]{grid-template-columns:1fr}}.integration-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.integration-row[_ngcontent-%COMP%] .integration-name[_ngcontent-%COMP%]{flex:0 0 180px}.integration-row[_ngcontent-%COMP%] .integration-tools[_ngcontent-%COMP%]{flex:1}.hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.source-options[_ngcontent-%COMP%]{display:flex;gap:1rem;margin-bottom:.5rem}@media (max-width: 768px){.source-options[_ngcontent-%COMP%]{flex-direction:column}}.source-option[_ngcontent-%COMP%]{flex:1;display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:var(--color-bg);border:2px solid var(--color-border);border-radius:8px;cursor:pointer;transition:all .2s ease}.source-option[_ngcontent-%COMP%]:hover{border-color:var(--color-primary);background:var(--color-bg-hover)}.source-option.selected[_ngcontent-%COMP%]{border-color:var(--color-primary);background:var(--color-bg-hover);box-shadow:0 0 0 1px var(--color-primary)}.source-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin-top:2px;cursor:pointer}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%]{flex:1}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.25rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-label[_ngcontent-%COMP%]{font-weight:600;font-size:.95rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-description[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-family:monospace;line-height:1.4}.source-display[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem 1rem;border-radius:6px;font-size:.9rem;font-weight:500}.source-badge.badge-project[_ngcontent-%COMP%]{background:#2196f31a;color:#2196f3;border:1px solid rgba(33,150,243,.3)}.source-badge.badge-colocated[_ngcontent-%COMP%]{background:#4caf501a;color:#4caf50;border:1px solid rgba(76,175,80,.3)}.doc-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.doc-row[_ngcontent-%COMP%] .doc-field[_ngcontent-%COMP%]{flex:1}.upload-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;cursor:pointer;color:var(--color-text-secondary);transition:background .2s}.upload-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);color:var(--color-primary)}.upload-btn.uploading[_ngcontent-%COMP%]{opacity:.5;cursor:wait}.upload-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.doc-upload-error[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-error)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}"]})};var Wx=(o,t)=>t.name;function Ux(o,t){o&1&&(s(0,"div",7),p(1,"Loading agents..."),l())}function $x(o,t){if(o&1&&(s(0,"div",8),p(1),l()),o&2){let e=u();d(),F(e.errorMessage)}}function qx(o,t){o&1&&(s(0,"div",9),p(1,"No file-based agents found. Create your first agent to get started."),l())}function Gx(o,t){o&1&&(s(0,"div",9),p(1,"No agents match your search."),l())}function Yx(o,t){if(o&1){let e=M();s(0,"div",11)(1,"div",12)(2,"div",13)(3,"h3"),p(4),l(),s(5,"span",14),p(6),l()(),s(7,"p",15),p(8),l()(),s(9,"div",16)(10,"button",17),_("click",function(){let n=v(e).$implicit,r=u(2);return y(r.editAgent(n))}),p(11,"Edit"),l(),s(12,"button",18),_("click",function(){let n=v(e).$implicit,r=u(2);return y(r.deleteAgent(n))}),p(13,"Delete"),l()()()}if(o&2){let e=t.$implicit;d(4),F(e.name),d(),E("badge-project",e.source==="project")("badge-colocated",e.source==="colocated"),w("title",e.source==="project"?"Project config (~/.coday/)":"Colocated (next to coday.yaml)"),d(),te(" ",e.source==="project"?"\u{1F464}":"\u{1F4E6}"," "),d(2),F(e.description)}}function Qx(o,t){if(o&1&&(s(0,"div",10),xe(1,Yx,14,8,"div",11,Wx),l()),o&2){let e=u();d(),we(e.filteredAgents)}}var Ol=class o{agentCrudApi=m(wr);dialog=m(yi);agents=[];filteredAgents=[];searchQuery="";isLoading=!1;errorMessage="";ngOnInit(){this.loadAgents()}loadAgents(){this.isLoading=!0,this.errorMessage="",this.agentCrudApi.listEditableAgents().subscribe({next:t=>{this.agents=t,this.applyFilter(),this.isLoading=!1},error:t=>{console.error("Error loading agents:",t),this.errorMessage="Failed to load agents",this.isLoading=!1}})}applyFilter(){let t=this.searchQuery.toLowerCase().trim();this.filteredAgents=t?this.agents.filter(e=>e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)):[...this.agents]}onSearchChange(){this.applyFilter()}createAgent(){this.dialog.open(ba,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadAgents()})}editAgent(t){this.errorMessage="",this.agentCrudApi.getAgent(t.name).subscribe({next:e=>{this.dialog.open(ba,{width:"700px",maxHeight:"90vh",data:{mode:"edit",agent:e}}).afterClosed().subscribe(n=>{n&&this.loadAgents()})},error:e=>{console.error("Error loading agent:",e),this.errorMessage=e?.error?.error??e?.message??"Failed to load agent"}})}deleteAgent(t){confirm(`Are you sure you want to delete agent "${t.name}"?`)&&(this.errorMessage="",this.agentCrudApi.deleteAgent(t.name).subscribe({next:()=>this.loadAgents(),error:e=>{console.error("Error deleting agent:",e),this.errorMessage=e?.error?.error??e?.message??"Failed to delete agent"}}))}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-agent-manager"]],decls:21,vars:6,consts:[[1,"agent-manager"],[1,"header"],[1,"header-actions"],["appearance","outline",1,"search-field"],["matInput","","placeholder","Name or description...",3,"ngModelChange","input","ngModel"],["matPrefix",""],[1,"btn-create",3,"click"],[1,"loading"],[1,"error"],[1,"empty"],[1,"agent-list"],[1,"agent-item"],[1,"agent-info"],[1,"agent-header"],[1,"source-badge",3,"title"],[1,"description"],[1,"agent-actions"],[1,"btn-primary",3,"click"],[1,"btn-danger",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"h2"),p(3,"Agents"),l(),s(4,"div",2)(5,"mat-form-field",3)(6,"mat-label"),p(7,"Search"),l(),s(8,"input",4),B("ngModelChange",function(r){return j(i.searchQuery,r)||(i.searchQuery=r),r}),_("input",function(){return i.onSearchChange()}),l(),s(9,"mat-icon",5),p(10,"search"),l()(),s(11,"button",6),_("click",function(){return i.createAgent()}),s(12,"mat-icon"),p(13,"add"),l(),s(14,"span"),p(15,"Create Agent"),l()()()(),C(16,Ux,2,0,"div",7),C(17,$x,2,1,"div",8),C(18,qx,2,0,"div",9),C(19,Gx,2,0,"div",9),C(20,Qx,3,0,"div",10),l()),e&2&&(d(8),z("ngModel",i.searchQuery),d(8),x(i.isLoading?16:-1),d(),x(i.errorMessage?17:-1),d(),x(!i.isLoading&&i.agents.length===0?18:-1),d(),x(!i.isLoading&&i.agents.length>0&&i.filteredAgents.length===0?19:-1),d(),x(!i.isLoading&&i.filteredAgents.length>0?20:-1))},dependencies:[je,Le,Ve,ze,Oe,he,Xt,di,jt,zt,go,ct],styles:[".agent-manager[_ngcontent-%COMP%]{padding:1.5rem .5rem 1.5rem 1.5rem}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem;padding-right:1rem}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .search-field[_ngcontent-%COMP%]{width:300px;margin-bottom:-1.25em}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1.5rem;border:none;border-radius:4px;background:var(--color-primary);color:#fff;cursor:pointer;font-size:1rem;font-weight:500;white-space:nowrap}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]:hover{opacity:.9}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.loading[_ngcontent-%COMP%], .error[_ngcontent-%COMP%], .empty[_ngcontent-%COMP%]{padding:1rem 1.5rem 1rem 1rem;text-align:center;color:var(--color-text-secondary)}.error[_ngcontent-%COMP%]{color:var(--color-error)}.agent-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding-right:1rem}.agent-item[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;padding:1rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-surface)}.agent-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.agent-info[_ngcontent-%COMP%]{flex:1}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;margin-bottom:.5rem}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1.1rem}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:6px;font-size:1rem;cursor:help}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%] .source-badge.badge-project[_ngcontent-%COMP%]{background:#2196f31a;border:1px solid rgba(33,150,243,.3)}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%] .source-badge.badge-colocated[_ngcontent-%COMP%]{background:#4caf501a;border:1px solid rgba(76,175,80,.3)}.agent-info[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{margin:0;color:var(--color-text-secondary)}.agent-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.agent-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:.5rem 1rem;border:none;border-radius:4px;cursor:pointer;font-size:.9rem}.agent-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]{background:var(--color-primary);color:#fff}.agent-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover{opacity:.9}.agent-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]{background:var(--color-error);color:#fff}.agent-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]:hover{opacity:.9}"]})};var Xx=["threadSearchInput"],Kx=["*"];function Zx(o,t){o&1&&(s(0,"a",28),A(1,"img",29),l()),o&2&&(d(),X("src","CODAY-Logo.png",Sn))}function Jx(o,t){if(o&1){let e=M();s(0,"button",26),_("click",function(){v(e);let n=u();return y(n.toggle())}),s(1,"mat-icon"),p(2,"menu"),l()(),s(3,"button",27),_("click",function(){v(e);let n=u();return y(n.createNewThread())}),s(4,"mat-icon",10),p(5,"play_circle"),l()(),C(6,Zx,2,1,"a",28)}if(o&2){let e=u();d(3),w("disabled",!e.selectedProjectName()),d(3),x(e.isOpen?-1:6)}}function ew(o,t){if(o&1){let e=M();s(0,"div",14)(1,"mat-icon",30),p(2,"search"),l(),s(3,"input",31,0),B("ngModelChange",function(n){v(e);let r=u();return j(r.threadSearchQuery,n)||(r.threadSearchQuery=n),y(n)}),_("input",function(){v(e);let n=u();return y(n.onThreadSearchInput())}),l(),s(5,"button",32),_("click",function(){v(e);let n=u();return y(n.closeThreadSearch())}),s(6,"mat-icon"),p(7,"close"),l()()()}if(o&2){let e=u();d(3),z("ngModel",e.threadSearchQuery)}}function tw(o,t){o&1&&(s(0,"mat-icon",18),p(1,"keyboard_arrow_up"),l())}function iw(o,t){o&1&&(s(0,"mat-icon",19),p(1,"forum"),l())}function nw(o,t){if(o&1){let e=M();s(0,"button",34),_("click",function(n){v(e);let r=u(2);return y(r.toggleThreadSearch(n))}),s(1,"mat-icon"),p(2,"search"),l()()}}function ow(o,t){if(o&1){let e=M();s(0,"a",17),_("click",function(n){return v(e),u().toggleSection("threads"),y(n.preventDefault())}),C(1,tw,2,0,"mat-icon",18)(2,iw,2,0,"mat-icon",19),s(3,"span",20),p(4,"Threads"),l(),C(5,nw,3,0,"button",33),l()}if(o&2){let e=u();E("active",e.expandedSections.threads),d(),x(e.expandedSections.threads?1:2),d(4),x(e.expandedSections.threads?5:-1)}}function rw(o,t){if(o&1){let e=M();s(0,"div",16)(1,"app-thread-selector",35),_("searchModeChange",function(n){v(e);let r=u();return y(r.onThreadSearchModeChange(n))}),l()()}if(o&2){let e=u();d(),w("searchMode",e.isThreadSearchActive)("searchQuery",e.threadSearchQuery)}}function aw(o,t){o&1&&(s(0,"mat-icon",18),p(1,"keyboard_arrow_up"),l())}function sw(o,t){o&1&&(s(0,"mat-icon",19),p(1,"tune"),l())}function lw(o,t){o&1&&(s(0,"div",21)(1,"div",36),A(2,"app-options-panel",37),l()())}function cw(o,t){if(o&1){let e=M();s(0,"div",13)(1,"a",17),_("click",function(n){return v(e),u(2).openProjectConfig(),n.preventDefault(),y(n.stopPropagation())}),s(2,"mat-icon",19),p(3,"settings_applications"),l(),s(4,"span",20),p(5,"Project Configuration"),l()()()}}function dw(o,t){o&1&&(s(0,"div",13)(1,"a",38)(2,"mat-icon",19),p(3,"settings_applications"),l(),s(4,"span",20),p(5,"Project config (No project)"),l()()())}function mw(o,t){if(o&1&&C(0,cw,6,0,"div",13)(1,dw,6,0,"div",13),o&2){let e=u();x(e.selectedProjectName()?0:1)}}function pw(o,t){if(o&1){let e=M();s(0,"div",13)(1,"a",17),_("click",function(n){return v(e),u().openAgents(),n.preventDefault(),y(n.stopPropagation())}),s(2,"mat-icon",19),p(3,"smart_toy"),l(),s(4,"span",20),p(5,"Agents"),l()()()}}function hw(o,t){o&1&&(s(0,"div",13)(1,"a",38)(2,"mat-icon",19),p(3,"smart_toy"),l(),s(4,"span",20),p(5,"Agents (No project)"),l()()())}function uw(o,t){if(o&1){let e=M();s(0,"div",13)(1,"a",17),_("click",function(n){return v(e),u().openPrompts(),n.preventDefault(),y(n.stopPropagation())}),s(2,"mat-icon",19),p(3,"description"),l(),s(4,"span",20),p(5,"Prompts"),l()()()}}function gw(o,t){o&1&&(s(0,"div",13)(1,"a",38)(2,"mat-icon",19),p(3,"description"),l(),s(4,"span",20),p(5,"Prompts (No project)"),l()()())}function fw(o,t){if(o&1){let e=M();s(0,"div",13)(1,"a",17),_("click",function(n){return v(e),u().openSchedulers(),n.preventDefault(),y(n.stopPropagation())}),s(2,"mat-icon",19),p(3,"schedule"),l(),s(4,"span",20),p(5,"Schedulers"),l()()()}}function _w(o,t){o&1&&(s(0,"div",13)(1,"a",38)(2,"mat-icon",19),p(3,"schedule"),l(),s(4,"span",20),p(5,"Schedulers (No project)"),l()()())}function bw(o,t){o&1&&(s(0,"mat-icon",18),p(1,"keyboard_arrow_up"),l())}function vw(o,t){o&1&&(s(0,"mat-icon",19),p(1,"rocket_launch"),l())}function yw(o,t){o&1&&(s(0,"div",21),A(1,"app-preview-panel"),l())}function Cw(o,t){if(o&1){let e=M();s(0,"div",13)(1,"a",17),_("click",function(n){return v(e),u().toggleSection("preview"),n.preventDefault(),y(n.stopPropagation())}),C(2,bw,2,0,"mat-icon",18)(3,vw,2,0,"mat-icon",19),s(4,"span",20),p(5,"Preview Server"),l()(),C(6,yw,2,0,"div",21),l()}if(o&2){let e=u();E("expanded",e.expandedSections.preview),d(),E("active",e.expandedSections.preview),d(),x(e.expandedSections.preview?2:3),d(4),x(e.expandedSections.preview?6:-1)}}function xw(o,t){if(o&1){let e=M();s(0,"div",25)(1,"mat-icon",39),p(2,"warning"),l(),s(3,"span",40),p(4),l(),s(5,"button",41),_("click",function(){v(e);let n=u();return y(n.configErrorMessage="")}),s(6,"mat-icon"),p(7,"close"),l()()()}if(o&2){let e=u();d(4),F(e.configErrorMessage)}}var Al=class o{destroy$=new R;isOpen=!0;isAdmin=!1;configErrorMessage="";expandedSections={threads:!0,config:!1,preview:!1};isThreadSearchActive=!1;threadSearchQuery="";threadSearchInput;dialog=m(yi);configApi=m(Qi);projectStateService=m(Se);projectApi=m(Hm);router=m(On);preferences=m(nt);threadStateService=m(Pt);projects=_t(this.projectStateService.projectList$);selectedProject=_t(this.projectStateService.selectedProject$);selectedProjectName=_t(this.projectStateService.selectedProject$.pipe(_e(t=>t?.name)));isProjectVolatile=_t(this.projectStateService.selectedProject$.pipe(_e(t=>t?.config?.volatile||!1)));forcedProject=_t(this.projectStateService.forcedProject$);hasPreviewConfig=_t(this.projectStateService.selectedProject$.pipe(_e(t=>!!t?.config?.preview?.command)),{initialValue:!1});ngOnInit(){let t=this.preferences.getPreference("sidenavOpen",!0);this.isOpen=t??!0,console.log("[SIDENAV] Loaded sidenav state from preferences:",this.isOpen),this.configApi.getUserConfig().pipe(L(this.destroy$)).subscribe({next:e=>{this.isAdmin=e.groups?.includes("CODAY_ADMIN")??!1,console.log("[SIDENAV] User admin status:",this.isAdmin)},error:e=>{console.error("[SIDENAV] Error loading user config for roles:",e),this.isAdmin=!1}})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}toggle(){this.isOpen=!this.isOpen,this.saveSidenavState()}close(){this.isOpen=!1,this.saveSidenavState()}saveSidenavState(){this.preferences.setPreference("sidenavOpen",this.isOpen),console.log("[SIDENAV] Saved sidenav state:",this.isOpen)}openTokenUsage(){this.configErrorMessage="",this.router.navigate(["/token-usage"]),this.close()}openUserConfig(){console.log("[SIDENAV] openUserConfig called"),this.configErrorMessage="",this.configApi.getUserConfig().pipe(L(this.destroy$)).subscribe({next:t=>{console.log("[SIDENAV] User config loaded, opening dialog"),this.dialog.open(ua,{data:{configType:"user",initialContent:JSON.stringify(t,null,2)}}).afterClosed().subscribe(i=>{i&&this.saveUserConfig(i)})},error:t=>{console.error("[SIDENAV] Error loading user config:",t),this.configErrorMessage=t?.error?.error||"Failed to load user configuration"}})}saveUserConfig(t){this.configApi.updateUserConfig(t).pipe(L(this.destroy$)).subscribe({next:e=>{console.log("[SIDENAV] User config saved successfully")},error:e=>{console.error("[SIDENAV] Error saving user config:",e),this.configErrorMessage=e?.error?.error||"Failed to save user configuration"}})}openProjectConfig(){let t=this.selectedProjectName();if(!t){console.error("[SIDENAV] No project selected"),this.configErrorMessage="No project selected. Please select a project first.";return}this.configErrorMessage="",this.projectApi.getProjectConfig(t).pipe(L(this.destroy$)).subscribe({next:e=>{console.log("[SIDENAV] Project config loaded, opening dialog"),this.dialog.open(ua,{data:{configType:"project",projectName:t,initialContent:JSON.stringify(e,null,2)}}).afterClosed().subscribe(n=>{n&&this.saveProjectConfig(t,n)})},error:e=>{console.error("[SIDENAV] Error loading project config:",e),this.configErrorMessage=e?.error?.error||"Failed to load project configuration"}})}saveProjectConfig(t,e){this.projectApi.updateProjectConfig(t,e).pipe(L(this.destroy$)).subscribe({next:i=>{console.log("[SIDENAV] Project config saved successfully")},error:i=>{console.error("[SIDENAV] Error saving project config:",i),this.configErrorMessage=i?.error?.error||"Failed to save project configuration"}})}requireProjectSelection(t){return this.selectedProjectName()?!0:(console.error(`[SIDENAV] No project selected, cannot ${t}`),this.configErrorMessage="Please select a project first",!1)}openManagerDialog(t,e){console.log(`[SIDENAV] ${e}`),this.dialog.open(t,{width:"90vw",maxWidth:"1200px",height:"90vh",maxHeight:"900px"})}openAgents(){this.requireProjectSelection("open agents")&&this.openManagerDialog(Ol,"Opening agent manager dialog")}openPrompts(){this.requireProjectSelection("open prompts")&&this.openManagerDialog(xl,"Opening prompt manager dialog")}openSchedulers(){this.requireProjectSelection("open schedulers")&&this.openManagerDialog(Pl,`Opening scheduler manager dialog for project: ${this.selectedProjectName()}`)}toggleSection(t){let e=this.expandedSections[t];Object.keys(this.expandedSections).forEach(i=>{this.expandedSections[i]=!1}),this.expandedSections[t]=!e}navigateToHome(){if(this.forcedProject()){console.log("[SIDENAV] Cannot navigate to home - forced project active");return}console.log("[SIDENAV] Navigating to home (project selection)"),this.projectStateService.clearSelection(),this.router.navigate(["/"])}createNewThread(){let t=this.selectedProjectName();if(!t){console.error("[SIDENAV] No project selected, cannot create new thread"),this.configErrorMessage="Please select a project first";return}console.log("[SIDENAV] Navigating to welcome view for new thread"),this.threadStateService.clearSelection(),this.router.navigate(["project",t])}toggleThreadSearch(t){t.stopPropagation(),this.isThreadSearchActive=!0,this.threadSearchQuery="",console.log("[SIDENAV] Thread search active:",this.isThreadSearchActive),setTimeout(()=>{this.threadSearchInput?.nativeElement.focus()},0)}closeThreadSearch(){this.isThreadSearchActive=!1,this.threadSearchQuery="",console.log("[SIDENAV] Thread search closed")}onThreadSearchInput(){console.log("[SIDENAV] Search query:",this.threadSearchQuery)}onThreadSearchModeChange(t){t||this.closeThreadSearch()}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-sidenav"]],viewQuery:function(e,i){if(e&1&&Q(Xx,5),e&2){let n;H(n=W())&&(i.threadSearchInput=n.first)}},ngContentSelectors:Kx,decls:57,vars:36,consts:[["threadSearchInput",""],[1,"sidenav-container",3,"hasBackdrop"],["mode","push","position","start",1,"app-sidenav",3,"closed","opened","disableClose"],[1,"sidenav-header"],["mat-icon-button","","title","Close menu",3,"click"],["alt","coday",3,"click","keydown.enter","keydown.space","title"],[1,"header-title-section"],[1,"sidenav-title"],[1,"new-thread-section"],["role","button","tabindex","0",1,"new-thread-link",3,"click"],["fontSet","material-icons-outlined"],[1,"new-thread-text"],[1,"sidenav-sections"],[1,"section-container"],[1,"search-header"],["role","button","tabindex","0",1,"section-toggle",3,"active"],[1,"section-content","threads"],["role","button","tabindex","0",1,"section-toggle",3,"click"],[1,"arrow-icon","expanded"],[1,"section-icon"],[1,"section-label"],[1,"section-content"],[1,"section-container",3,"expanded"],["href","https://github.com/whoz-oss/coday","target","_blank","rel","noopener noreferrer","title","Contribute on GitHub",1,"section-toggle","contribute-btn"],["alt","Coday",1,"contribute-logo"],["role","alert",1,"error-notification"],["mat-icon-button","","title","Menu","type","button",1,"sidenav-toggle-btn",3,"click"],["mat-icon-button","","title","Start a new thread","type","button",1,"sidenav-new-thread-btn",3,"click","disabled"],["href","https://github.com/whoz-oss/coday","target","_blank","rel","noopener noreferrer","title","Contribute on GitHub",1,"sidenav-logo-btn"],["alt","Coday",1,"logo"],[1,"search-icon"],["type","text","placeholder","Search threads...",1,"search-input",3,"ngModelChange","input","ngModel"],["mat-icon-button","","title","Close search","type","button",1,"close-search-btn",3,"click"],["mat-icon-button","","title","Search threads","type","button",1,"search-button"],["mat-icon-button","","title","Search threads","type","button",1,"search-button",3,"click"],[1,"sidenav-thread-selector",3,"searchModeChange","searchMode","searchQuery"],[1,"preference-item"],[1,"inline-panel"],["role","button","tabindex","-1","aria-disabled","true",1,"section-toggle","disabled"],[1,"error-icon"],[1,"error-text"],["mat-icon-button","","aria-label","Close error message",1,"error-close",3,"click"]],template:function(e,i){e&1&&(Be(),C(0,Jx,7,2),s(1,"mat-sidenav-container",1)(2,"mat-sidenav",2),_("closed",function(){return i.close()}),s(3,"div",3)(4,"button",4),_("click",function(){return i.close()}),s(5,"mat-icon"),p(6,"chevron_left"),l()(),s(7,"img",5),_("click",function(r){return i.navigateToHome(),r.stopPropagation()})("keydown.enter",function(r){return i.navigateToHome(),r.preventDefault(),r.stopPropagation()})("keydown.space",function(r){return i.navigateToHome(),r.preventDefault(),r.stopPropagation()}),l(),s(8,"div",6)(9,"h2",7),p(10),l()()(),s(11,"div",8)(12,"a",9),_("click",function(r){return i.createNewThread(),r.preventDefault()}),s(13,"mat-icon",10),p(14,"play_circle"),l(),s(15,"span",11),p(16,"Start a new thread"),l()()(),s(17,"div",12)(18,"div",13),C(19,ew,8,1,"div",14)(20,ow,6,4,"a",15),C(21,rw,2,2,"div",16),l(),s(22,"div",13)(23,"a",17),_("click",function(r){return i.toggleSection("config"),r.preventDefault()}),C(24,aw,2,0,"mat-icon",18)(25,sw,2,0,"mat-icon",19),s(26,"span",20),p(27,"Preferences"),l()(),C(28,lw,3,0,"div",21),l(),s(29,"div",13)(30,"a",17),_("click",function(r){return i.openTokenUsage(),r.preventDefault(),r.stopPropagation()}),s(31,"mat-icon",19),p(32,"data_usage"),l(),s(33,"span",20),p(34,"Token Usage"),l()()(),s(35,"div",13)(36,"a",17),_("click",function(r){return i.openUserConfig(),r.preventDefault(),r.stopPropagation()}),s(37,"mat-icon",19),p(38,"settings"),l(),s(39,"span",20),p(40,"User Configuration"),l()()(),C(41,mw,2,1),C(42,pw,6,0,"div",13)(43,hw,6,0,"div",13),C(44,uw,6,0,"div",13)(45,gw,6,0,"div",13),C(46,fw,6,0,"div",13)(47,_w,6,0,"div",13),C(48,Cw,7,6,"div",22),s(49,"div",13)(50,"a",23),A(51,"img",24),s(52,"span",20),p(53,"Contribute on GitHub"),l()()()()(),s(54,"mat-sidenav-content"),me(55),l()(),C(56,xw,8,1,"div",25)),e&2&&(x(i.isOpen?-1:0),d(),w("hasBackdrop",!1),d(),w("opened",i.isOpen)("disableClose",!0),d(5),E("sidenav-logo",!0)("clickable",!i.forcedProject())("disabled",i.forcedProject()),w("title",i.forcedProject()?"Project selection disabled":"Go to project selection"),X("src","CODAY-Logo.png",Sn)("role",i.forcedProject()?null:"button")("tabindex",i.forcedProject()?null:"0"),d(3),F(i.selectedProjectName()),d(7),E("has-footer",!0)("is-admin",i.isAdmin),d(),E("expanded",i.expandedSections.threads),d(),x(i.isThreadSearchActive&&i.expandedSections.threads?19:20),d(2),x(i.expandedSections.threads?21:-1),d(),E("expanded",i.expandedSections.config),d(),E("active",i.expandedSections.config),d(),x(i.expandedSections.config?24:25),d(4),x(i.expandedSections.config?28:-1),d(13),x(i.isAdmin?41:-1),d(),x(i.selectedProjectName()?42:43),d(2),x(i.selectedProjectName()?44:45),d(2),x(i.selectedProjectName()?46:47),d(2),x(i.hasPreviewConfig()?48:-1),d(3),X("src","CODAY-Logo.png",Sn),d(5),x(i.configErrorMessage?56:-1))},dependencies:[je,Le,Ve,ze,pl,Sd,Vu,dl,Oe,he,it,Qe,Wu,Uu,ma,yl,Cl],styles:['[_nghost-%COMP%]{display:block;width:100%;height:100%;position:relative}.sidenav-container[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:1400;transition:width;display:flex}.sidenav-container[_ngcontent-%COMP%] mat-sidenav[_ngcontent-%COMP%]{position:relative!important;transition:width;width:310px;flex-shrink:0}.sidenav-container[_ngcontent-%COMP%] mat-sidenav[_ngcontent-%COMP%]:not(.mat-drawer-opened){width:0!important}.sidenav-container[_ngcontent-%COMP%] mat-sidenav-content[_ngcontent-%COMP%]{width:100%;margin:0!important}[_nghost-%COMP%] .mat-drawer-backdrop{pointer-events:auto}[_nghost-%COMP%] .mat-drawer-content{pointer-events:auto!important;background:transparent!important;overflow:visible!important}.sidenav-toggle-btn[_ngcontent-%COMP%]{position:fixed!important;top:1rem!important;left:1rem!important;z-index:1500!important}.sidenav-new-thread-btn[_ngcontent-%COMP%]{position:fixed!important;top:4.5rem!important;left:1rem!important;z-index:1500!important}.sidenav-new-thread-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--color-primary)!important}.sidenav-new-thread-btn[_ngcontent-%COMP%]:disabled{opacity:.5!important}.sidenav-new-thread-btn[_ngcontent-%COMP%]:disabled mat-icon[_ngcontent-%COMP%]{color:var(--color-text-secondary)!important}.sidenav-logo-btn[_ngcontent-%COMP%]{position:fixed!important;bottom:1rem!important;left:1rem!important;z-index:1500!important;width:56px!important;height:56px!important;border-radius:50%!important;border:1px solid var(--glass-border)!important;padding:4px!important;background:var(--glass-bg)!important;backdrop-filter:var(--glass-backdrop-blur)!important;-webkit-backdrop-filter:var(--glass-backdrop-blur)!important;box-shadow:var(--glass-shadow)!important;transition:all .3s cubic-bezier(.4,0,.2,1)!important;cursor:pointer!important;pointer-events:auto!important;display:flex!important;align-items:center!important;justify-content:center!important;overflow:hidden!important;text-decoration:none!important}.sidenav-logo-btn[_ngcontent-%COMP%]:hover{transform:scale(1.08) translateY(-2px)!important;box-shadow:0 16px 48px #0003!important;border-color:var(--color-primary)!important}.sidenav-logo-btn[_ngcontent-%COMP%]:active{transform:scale(.96)!important}.sidenav-logo-btn[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:2px}.app-sidenav[_ngcontent-%COMP%]{width:310px;height:100%;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border-radius:0;overflow:hidden;display:flex;flex-direction:column}.app-sidenav[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.app-sidenav[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.app-sidenav[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-text-secondary);border-radius:4px}.app-sidenav[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text)}.sidenav-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:1.5rem 1rem .5rem;flex-shrink:0}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:4px;flex-shrink:0;transition:all .2s ease}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]{cursor:pointer}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]:hover{transform:scale(1.1);filter:drop-shadow(0 4px 12px rgba(0,0,0,.15))}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]:active{transform:scale(.95)}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]:focus{outline:2px solid var(--color-primary);outline-offset:2px}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.disabled[_ngcontent-%COMP%]{opacity:.5;cursor:not-allowed;pointer-events:none}.sidenav-header[_ngcontent-%COMP%] .header-title-section[_ngcontent-%COMP%]{flex:1;display:flex;align-items:center;min-width:0}.sidenav-header[_ngcontent-%COMP%] .header-title-section[_ngcontent-%COMP%] .sidenav-title[_ngcontent-%COMP%]{margin:0;font-size:1.25rem;font-weight:600;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.loading-section[_ngcontent-%COMP%]{padding:2rem 1rem;display:flex;align-items:center;justify-content:center}.loading-content[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:1rem;align-items:center}.loading-content[_ngcontent-%COMP%] mat-progress-bar[_ngcontent-%COMP%]{width:100%;height:4px;border-radius:2px}.loading-content[_ngcontent-%COMP%] .loading-text[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary);text-align:center}.new-thread-section[_ngcontent-%COMP%]{padding:1rem 1rem .5rem;flex-shrink:0}.new-thread-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;background:transparent;border:none;text-decoration:none;cursor:pointer;transition:all .2s ease;gap:.5rem;font-size:.95rem;font-weight:600;padding:0}.new-thread-link[_ngcontent-%COMP%] .new-thread-text[_ngcontent-%COMP%]{background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% auto;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:_ngcontent-%COMP%_gradientShift 3s ease-in-out infinite}.new-thread-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-primary);animation:_ngcontent-%COMP%_iconPulse 3s ease-in-out infinite}.new-thread-link[_ngcontent-%COMP%]:hover{transform:translate(4px)}.new-thread-link[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_iconPulse 1.5s ease-in-out infinite}.new-thread-link[_ngcontent-%COMP%]:focus{transform:scale(1.1)}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0% center}50%{background-position:100% center}to{background-position:0% center}}@keyframes _ngcontent-%COMP%_iconPulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.05)}}.sidenav-sections[_ngcontent-%COMP%]{flex:1;min-height:0;overflow:hidden;display:flex;flex-direction:column;padding:0;height:100%;max-height:calc(100vh - 122px)}.sidenav-sections[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.sidenav-sections[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.sidenav-sections[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-text-secondary);border-radius:4px}.sidenav-sections[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text)}.contribute-btn[_ngcontent-%COMP%] .contribute-logo[_ngcontent-%COMP%]{width:20px;height:20px;border-radius:2px;flex-shrink:0}.section-container[_ngcontent-%COMP%]{flex-shrink:0;display:flex;flex-direction:column}.section-container.expanded[_ngcontent-%COMP%]{flex:1;min-height:0;overflow:hidden}.section-container.expanded[_ngcontent-%COMP%] .section-content[_ngcontent-%COMP%]{flex:1;overflow-y:auto;overflow-x:hidden;border-bottom:none;position:relative}.section-container.expanded[_ngcontent-%COMP%] .section-content[_ngcontent-%COMP%]:after{content:"";position:sticky;bottom:0;left:0;right:0;height:60px;background:linear-gradient(to bottom,transparent 0%,var(--glass-bg) 100%);pointer-events:none;opacity:1;transition:opacity .3s ease;z-index:10;flex-shrink:0}.section-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;width:100%;padding:.5rem 1rem;height:50px;text-decoration:none;cursor:pointer;transition:all .2s ease;background:transparent;border:none;border-radius:0;color:var(--color-text);flex-shrink:0}.section-toggle.active[_ngcontent-%COMP%]{border-top:1px solid var(--color-border)}.section-toggle.disabled[_ngcontent-%COMP%]{opacity:.5;cursor:not-allowed;pointer-events:none}.section-toggle[_ngcontent-%COMP%] .arrow-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-text-secondary);transition:transform .2s ease;transform:rotate(0);flex-shrink:0}.section-toggle[_ngcontent-%COMP%] .section-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-text-secondary);flex-shrink:0}.section-toggle[_ngcontent-%COMP%] .section-label[_ngcontent-%COMP%]{flex:1;font-size:.9rem;color:var(--color-text);text-align:left}.section-toggle[_ngcontent-%COMP%] .search-button[_ngcontent-%COMP%]{margin-left:auto;flex-shrink:0}.section-toggle[_ngcontent-%COMP%] .search-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.section-toggle[_ngcontent-%COMP%]:hover:not(.disabled){background:var(--color-bg-hover)}.section-toggle[_ngcontent-%COMP%]:active:not(.disabled){transform:scale(.98)}.section-toggle[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary);outline-offset:-2px}.search-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem;height:50px;background:var(--color-bg-hover);border-top:1px solid var(--color-border);transition:all .2s ease}.search-header[_ngcontent-%COMP%] .search-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-text-secondary);flex-shrink:0}.search-header[_ngcontent-%COMP%] .search-input[_ngcontent-%COMP%]{flex:1;border:none;outline:none;background:transparent;color:var(--color-text);font-size:.9rem;padding:0;min-width:0}.search-header[_ngcontent-%COMP%] .search-input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-muted)}.search-header[_ngcontent-%COMP%] .close-search-btn[_ngcontent-%COMP%]{flex-shrink:0}.search-header[_ngcontent-%COMP%] .close-search-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.section-content[_ngcontent-%COMP%]{padding:.5rem 0 0;animation:_ngcontent-%COMP%_slideDown .2s ease;border-bottom:1px solid var(--color-border);display:flex;flex-direction:column}.section-content.threads[_ngcontent-%COMP%]{padding:0}@keyframes _ngcontent-%COMP%_slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.config-links[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:.5rem 1rem;margin-bottom:1rem}.sidenav-item[_ngcontent-%COMP%]{width:100%}.sidenav-item[_ngcontent-%COMP%] .item-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-text-secondary)}.sidenav-item[_ngcontent-%COMP%] .item-text[_ngcontent-%COMP%]{flex:1;font-size:.9rem}.sidenav-item[_ngcontent-%COMP%] .disabled-hint[_ngcontent-%COMP%]{font-size:.7rem;color:var(--color-text-secondary);font-style:italic}.sidenav-link.disabled[_ngcontent-%COMP%]{opacity:.5;cursor:not-allowed;color:var(--color-text-secondary)}.sidenav-link.disabled[_ngcontent-%COMP%] .item-icon[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.sidenav-link[_ngcontent-%COMP%] .item-icon[_ngcontent-%COMP%], .sidenav-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;color:var(--color-primary)}.sidenav-link[_ngcontent-%COMP%] .item-text[_ngcontent-%COMP%]{font-size:.875rem}.preference-item[_ngcontent-%COMP%]{padding-bottom:1rem;margin-bottom:1rem;border-bottom:1px solid var(--color-border)}.preference-item[_ngcontent-%COMP%]:last-child{margin-bottom:0;padding-bottom:0;border-bottom:none}.preference-item[_ngcontent-%COMP%] .preference-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;margin-bottom:.75rem;padding:0 1rem}.preference-item[_ngcontent-%COMP%] .preference-header[_ngcontent-%COMP%] .item-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.preference-item[_ngcontent-%COMP%] .preference-header[_ngcontent-%COMP%] .item-text[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.preference-item[_ngcontent-%COMP%] .preference-content[_ngcontent-%COMP%]{padding:0 1rem}.error-notification[_ngcontent-%COMP%]{position:fixed;top:5rem;left:50%;transform:translate(-50%);z-index:2000;display:flex;align-items:center;gap:.75rem;background:#ff3b3026;backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid rgba(255,59,48,.3);border-radius:16px;padding:1rem 1.5rem;box-shadow:var(--glass-shadow);animation:_ngcontent-%COMP%_errorSlideDown .3s cubic-bezier(.4,0,.2,1)}.error-notification[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{font-size:1.2rem;flex-shrink:0;color:#c00}.error-notification[_ngcontent-%COMP%] .error-text[_ngcontent-%COMP%]{flex:1;color:#c00;font-size:.9rem;font-weight:500}@keyframes _ngcontent-%COMP%_errorSlideDown{0%{opacity:0;transform:translate(-50%,-10px)}to{opacity:1;transform:translate(-50%)}}@media (max-width: 480px){.app-sidenav[_ngcontent-%COMP%]{width:280px}.sidenav-toggle-btn[_ngcontent-%COMP%]{left:.75rem!important;top:.75rem!important}.error-notification[_ngcontent-%COMP%]{left:1rem;right:1rem;transform:none;max-width:calc(100vw - 2rem)}}body.dark[_nghost-%COMP%] .app-sidenav[_ngcontent-%COMP%], body.dark [_nghost-%COMP%] .app-sidenav[_ngcontent-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .app-sidenav[_ngcontent-%COMP%]{background:#242830f2;border-right-color:#b4c8ff17}body.dark[_nghost-%COMP%] .sidenav-header[_ngcontent-%COMP%], body.dark [_nghost-%COMP%] .sidenav-header[_ngcontent-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .sidenav-header[_ngcontent-%COMP%]{background:#242830b3}']})};var Il=class o{destroy$=new R;isSetup=!1;codayService=m(Qt);preferencesService=m(nt);setup(){if(this.isSetup){console.warn("[AGENT-NOTIFICATION] Service already set up");return}console.log("[AGENT-NOTIFICATION] Setting up agent notification service"),this.codayService.isThinking$.pipe(L(this.destroy$),Eo(),ce(([t,e])=>t===!0&&e===!1)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Agent stopped thinking, notifying task finished"),this.notifyTaskFinishedIfEnabled()}),this.preferencesService.browserNotificationEnabled$.pipe(L(this.destroy$),Eo(),ce(([t,e])=>t===!1&&e===!0)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Browser notifications enabled, checking permission"),this.handleBrowserNotificationEnabled()}),this.isSetup=!0}notifyTaskFinishedIfEnabled(){this.preferencesService.getAgentNotificationEnabled()&&(this.preferencesService.getNotificationSoundEnabled()&&this.playCompletionSound(),this.preferencesService.getBrowserNotificationEnabled()&&this.sendBrowserNotification())}playCompletionSound(){try{let t=new(window.AudioContext||window.webkitAudioContext),e=t.createOscillator(),i=t.createGain();e.connect(i),i.connect(t.destination),e.frequency.setValueAtTime(700,t.currentTime),i.gain.setValueAtTime(.1,t.currentTime),i.gain.exponentialRampToValueAtTime(.01,t.currentTime+.08),e.start(t.currentTime),e.stop(t.currentTime+.08);let n=t.createOscillator(),r=t.createGain();n.connect(r),r.connect(t.destination);let a=t.currentTime+.11;n.frequency.setValueAtTime(950,a),r.gain.setValueAtTime(.1,a),r.gain.exponentialRampToValueAtTime(.01,a+.09),n.start(a),n.stop(a+.09),console.log("[AGENT-NOTIFICATION] Completion sound played")}catch(t){console.error("[AGENT-NOTIFICATION] Failed to play completion sound:",t)}}handleBrowserNotificationEnabled(){return ee(this,null,function*(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications"),this.preferencesService.setBrowserNotificationEnabled(!1);return}if(Notification.permission==="denied"){console.warn("[AGENT-NOTIFICATION] Permission denied, disabling browser notifications"),this.preferencesService.setBrowserNotificationEnabled(!1);return}if(Notification.permission==="granted"){console.log("[AGENT-NOTIFICATION] Permission already granted, showing confirmation"),this.createConfirmationNotification();return}try{(yield Notification.requestPermission())==="granted"?(console.log("[AGENT-NOTIFICATION] Permission granted, showing confirmation"),this.createConfirmationNotification()):(console.log("[AGENT-NOTIFICATION] Permission denied or dismissed"),this.preferencesService.setBrowserNotificationEnabled(!1))}catch(t){console.error("[AGENT-NOTIFICATION] Error requesting permission:",t),this.preferencesService.setBrowserNotificationEnabled(!1)}})}sendBrowserNotification(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications");return}if(document.hasFocus()){console.warn("[AGENT-NOTIFICATION] Document is focused, skipping browser notification");return}Notification.permission==="granted"?this.createTaskCompleteNotification():console.warn("[AGENT-NOTIFICATION] Permission not granted, cannot send notification")}createConfirmationNotification(){let t=new Notification("Coday - Notifications Enabled",{body:"You will be notified when the agent completes tasks",icon:"/favicon.ico",tag:"coday-notifications-enabled",requireInteraction:!1});setTimeout(()=>t.close(),4e3),t.onclick=()=>{window.focus(),t.close()},console.log("[AGENT-NOTIFICATION] Confirmation notification sent")}createTaskCompleteNotification(){let t=new Notification("Coday - Task Complete",{body:"The agent has finished and is waiting for your input",icon:"/favicon.ico",tag:"coday-task-complete",requireInteraction:!1});setTimeout(()=>t.close(),5e3),t.onclick=()=>{window.focus(),t.close()},console.log("[AGENT-NOTIFICATION] Task complete notification sent")}ngOnDestroy(){console.log("[AGENT-NOTIFICATION] Service destroyed"),this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var ww=["inputSection"];function Sw(o,t){if(o&1&&A(0,"app-thread",2),o&2){let e=u();w("projectName",e.projectName)("threadId",e.threadId)}}function kw(o,t){if(o&1){let e=M();s(0,"div",3),A(1,"app-welcome-message"),l(),s(2,"div",4,0)(4,"div",5)(5,"div",6)(6,"app-chat-textarea",7),_("messageSubmitted",function(n){v(e);let r=u();return y(r.onMessageSubmitted(n))})("voiceRecordingToggled",function(n){v(e);let r=u();return y(r.onVoiceToggled(n))})("heightChanged",function(n){v(e);let r=u();return y(r.onInputHeightChanged(n))}),l()()()()}if(o&2){let e=u();d(6),w("isDisabled",e.isSessionInitializing)("isSessionInitializing",e.isSessionInitializing)("showWelcome",!0)("isThinking",!1)("isStarting",e.isStartingFirstMessage)}}var va=class o{destroy$=new R;inputSection;projectName="";threadId=null;isSessionInitializing=!1;isStartingFirstMessage=!1;inputSectionHeight=80;codayService=m(Qt);titleService=m(ur);preferencesService=m(nt);route=m(Va);router=m(On);threadApiService=m(Yi);agentNotificationService=m(Il);firstMessageState=m(gr);constructor(){console.log("[MAIN-APP] Using new thread-based architecture (no clientId needed)")}ngOnInit(){this.agentNotificationService.setup(),this.setupPrintHandlers(),this.route.params.pipe(L(this.destroy$)).subscribe(t=>{let e=t.projectName,i=t.threadId||null;console.log("[MAIN-APP] Route params updated:",{project:e,thread:i,previousProject:this.projectName,previousThread:this.threadId}),this.projectName=e,this.threadId=i,this.threadId?console.log("[MAIN-APP] Thread selected - ThreadComponent will display"):(console.log("[MAIN-APP] No thread selected - showing welcome view"),this.initializeWelcomeView())})}initializeWelcomeView(){this.codayService.setTabTitleService(this.titleService)}ngAfterViewInit(){setTimeout(()=>this.updateInputSectionHeight(),100)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),window.removeEventListener("beforeprint",this.handleBeforePrint),window.removeEventListener("afterprint",this.handleAfterPrint)}onMessageSubmitted(t){console.log("[MAIN-APP] First message submitted from welcome view:",t),this.isSessionInitializing=!0,this.isStartingFirstMessage=!0,this.threadApiService.createThread().subscribe({next:e=>{console.log("[MAIN-APP] Thread created:",e.thread.id),this.firstMessageState.setPendingFirstMessage(t),this.router.navigate(["project",this.projectName,"thread",e.thread.id])},error:e=>{console.error("[MAIN-APP] Failed to create thread:",e),this.isSessionInitializing=!1,this.isStartingFirstMessage=!1,alert("Failed to create conversation: "+(e.message||"Unknown error"))}})}onVoiceToggled(t){console.log("[VOICE] Recording in welcome view:",t)}onInputHeightChanged(t){console.log("[MAIN-APP] Input height changed:",t),this.inputSectionHeight=t}updateInputSectionHeight(){if(this.inputSection?.nativeElement){let t=this.inputSection.nativeElement.offsetHeight;t!==this.inputSectionHeight&&(console.log("[MAIN-APP] Input section height updated:",t),this.inputSectionHeight=t)}}setupPrintHandlers(){window.addEventListener("beforeprint",this.handleBeforePrint),window.addEventListener("afterprint",this.handleAfterPrint)}handleBeforePrint=()=>{console.log("[PRINT] Before print event triggered");let t=this.preferencesService.getPrintTechnicalMessages();console.log("[PRINT] Print technical messages:",t),t?document.body.classList.add("print-include-technical"):document.body.classList.remove("print-include-technical")};handleAfterPrint=()=>{console.log("[PRINT] After print event triggered"),document.body.classList.remove("print-include-technical")};static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-main"]],viewQuery:function(e,i){if(e&1&&Q(ww,5),e&2){let n;H(n=W())&&(i.inputSection=n.first)}},decls:4,vars:1,consts:[["inputSection",""],[1,"app"],[3,"projectName","threadId"],[1,"welcome-section"],[1,"input-section"],[1,"input-center"],[1,"input-glass"],[3,"messageSubmitted","voiceRecordingToggled","heightChanged","isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"]],template:function(e,i){e&1&&(s(0,"app-sidenav")(1,"div",1),C(2,Sw,1,2,"app-thread",2)(3,kw,7,5),l()()),e&2&&(d(2),x(i.threadId?2:3))},dependencies:[er,ul,Yo,Al],styles:["[_nghost-%COMP%]{display:flex;height:100vh;width:100%;overflow:hidden;justify-content:center}.app[_ngcontent-%COMP%]{width:100%;max-width:100%;height:100%;display:flex;flex-direction:column;background:var(--color-bg);color:var(--color-text);transition:all .3s ease;position:relative;justify-content:center}.chat-wrapper[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;background:transparent;width:100%;padding:2.5rem 0 1.5rem;display:flex;justify-content:center}.chat-wrapper[_ngcontent-%COMP%] .chat-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 1rem}.welcome-section[_ngcontent-%COMP%]{flex-shrink:0;text-align:center;padding:2rem 1rem;animation:_ngcontent-%COMP%_fadeInUp .8s ease-out;display:flex;justify-content:center;align-items:center;width:100%}@keyframes _ngcontent-%COMP%_fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.input-section[_ngcontent-%COMP%]{flex-shrink:0;position:relative;border-top:none;background:transparent;box-shadow:none;padding:2.5rem 0 2rem;overflow-y:visible;max-height:none;width:100%;z-index:10;pointer-events:none;display:flex;justify-content:center}.input-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 1rem;display:flex;justify-content:center;align-items:end;position:relative;pointer-events:auto}.input-glass[_ngcontent-%COMP%]{background:none;box-shadow:none;width:100%;min-height:64px;display:flex;align-items:stretch;gap:0;pointer-events:auto;position:relative;overflow:visible}.input-glass[_ngcontent-%COMP%] app-chat-textarea[_ngcontent-%COMP%]{width:100%;min-width:0;flex:1 1 auto;align-self:stretch;display:flex}body.dark[_nghost-%COMP%], body.dark [_nghost-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .input-glass[_ngcontent-%COMP%]{background:#24283073;border-color:#b4c8ff17;box-shadow:0 8px 32px #0000002b,0 1.5px 8px #00000012}.choice-overlay[_ngcontent-%COMP%]{z-index:10;width:100%;display:flex;justify-content:center;align-items:center}.upload-status[_ngcontent-%COMP%]{position:fixed;bottom:100px;left:50%;transform:translate(-50%);z-index:1000;display:flex;align-items:center;padding:12px 20px;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);border-radius:16px;font-size:.9em;color:var(--color-text);box-shadow:var(--glass-shadow);max-width:300px;text-align:center}.upload-status.error[_ngcontent-%COMP%]{background:#ff3b3026;color:var(--color-error);border-color:#ff3b304d}@media (max-width: 768px){.welcome-section[_ngcontent-%COMP%]{padding:1.5rem 1rem}.input-section[_ngcontent-%COMP%]{padding:1.5rem .75rem 1rem}.input-center[_ngcontent-%COMP%]{padding:0 .5rem}}@media print{[_nghost-%COMP%]{display:block!important;height:auto!important;overflow:visible!important}.app[_ngcontent-%COMP%]{height:auto!important;overflow:visible!important;display:block!important}.input-section[_ngcontent-%COMP%], .welcome-section[_ngcontent-%COMP%]{display:none!important}}"],data:{animation:[nc("slideIn",[os(":enter",[Dn({transform:"translateY(100%)",opacity:0}),ns("300ms ease-out",Dn({transform:"translateY(0)",opacity:1}))]),os(":leave",[ns("200ms ease-in",Dn({transform:"translateY(100%)",opacity:0}))])])]}})};var Dl=class o{route=m(Va);ngOnInit(){console.log("[OAuth Callback] Component initialized");let t=this.route.snapshot.queryParamMap.get("code"),e=this.route.snapshot.queryParamMap.get("state"),i=this.route.snapshot.queryParamMap.get("error"),n=this.route.snapshot.queryParamMap.get("error_description");if(console.log("[OAuth Callback] Code:",t,"State:",e,"Error:",i,"Opener:",!!window.opener),i){if(console.log("[OAuth Callback] OAuth error received:",i,n),!window.opener){alert(`OAuth error: ${i}${n?" - "+n:""}. Please close this window.`);return}try{window.opener.postMessage({error:i,state:e,errorDescription:n},window.location.origin),console.log("[OAuth Callback] Error postMessage sent successfully"),setTimeout(()=>{console.log("[OAuth Callback] Closing popup after error"),window.close()},1e3)}catch(r){console.error("[OAuth Callback] Error sending error postMessage:",r),alert("OAuth error: Failed to communicate with parent window")}return}if(!t||!e){console.error("[OAuth Callback] Missing code or state");return}if(!window.opener){console.error("[OAuth Callback] No window.opener - popup may have been opened incorrectly"),alert("OAuth callback error: No parent window found. Please close this window and try again.");return}try{console.log("[OAuth Callback] Sending postMessage to parent"),window.opener.postMessage({code:t,state:e},window.location.origin),console.log("[OAuth Callback] postMessage sent successfully"),setTimeout(()=>{console.log("[OAuth Callback] Closing popup"),window.close()},1e3)}catch(r){console.error("[OAuth Callback] Error sending postMessage:",r),alert("OAuth callback error: Failed to communicate with parent window")}}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-oauth-callback"]],decls:2,vars:0,template:function(e,i){e&1&&(ii(0,"p"),p(1,"Authentication in progress..."),ni())},encapsulation:2})};var Ld=o=>ee(null,null,function*(){let t=m(Se),e=o.params.projectName;return e?t.getSelectedProjectId()===e?!0:(t.selectProject(e),(yield rm(t.selectedProject$.pipe(lm(n=>n?.name===e))))?.name===e):(console.log("[PROJECT GUARD] no project id in route"),!1)});var Cg=o=>ee(null,null,function*(){let t=m(Pt),e=o.params.threadId;if(!e)return console.log("[THREAD GUARD] no threadId in route"),!1;if(console.log("[THREAD GUARD] Checking thread:",e),console.log("[THREAD GUARD] Current selected thread:",t.getSelectedThreadId()),t.getSelectedThreadId()===e)return console.log("[THREAD GUARD] Thread already selected, allowing navigation"),!0;console.log("[THREAD GUARD] Selecting thread:",e),t.selectThread(e);try{let i=yield om(Gn([t.isLoading$,t.selectedThread$]).pipe(vt(([r,a])=>console.log(`\u{1F43C} [${r?"loading":"loaded"}]`,a?.id)),ce(([r,a])=>!r&&!!a),Ut(1),_e(([r,a])=>a?.id))),n=i===e;return n?console.log("[THREAD GUARD] Thread validated, allowing navigation"):console.error("[THREAD GUARD] Thread ID mismatch - route:",e,"loaded:",i),n}catch(i){return console.error("[THREAD GUARD] Error loading thread:",i),!1}});var xg=[{path:"",component:$s},{path:"oauth/callback",component:Dl},{path:"project/:projectName",component:va,canActivate:[Ld]},{path:"project/:projectName/thread/:threadId",component:va,canActivate:[Ld,Cg]},{path:"token-usage",loadComponent:()=>import("./chunk-NP6WQ37J.js").then(o=>o.TokenUsageComponent)},{path:"agentos",loadChildren:()=>import("./chunk-HJGQW7YN.js").then(o=>o.AGENTOS_ROUTES)},{path:"**",redirectTo:""}];var Rl=class o{eventStream=m(Gi);messageApi=m(Zo);pendingStates=new Map;popupCheckInterval=null;constructor(){this.eventStream.events$.pipe(ce(t=>t.type==="oauth_request")).subscribe(t=>this.handleOAuthRequest(t)),window.addEventListener("message",t=>this.handlePopupMessage(t))}startPopupMonitoring(t,e){this.popupCheckInterval&&clearInterval(this.popupCheckInterval),this.popupCheckInterval=setInterval(()=>{if(t.closed&&(console.log("[OAuth Service] Popup closed by user"),clearInterval(this.popupCheckInterval),this.popupCheckInterval=null,this.pendingStates.has(e))){console.warn("[OAuth Service] OAuth cancelled - popup closed without completing authentication");let i=this.pendingStates.get(e);if(this.pendingStates.delete(e),i){let n=new qi({state:e,integrationName:i,error:"user_cancelled",errorDescription:"User closed the popup without completing authentication"});this.messageApi.sendMessage(n).subscribe({next:()=>console.log("[OAuth Service] Cancellation sent to backend"),error:r=>console.error("[OAuth Service] Failed to send cancellation:",r)})}}},500)}handleOAuthRequest(t){console.log("[OAuth Service] Received OAuthRequestEvent:",t.integrationName,t.state),this.pendingStates.set(t.state,t.integrationName),console.log("[OAuth Service] Pending states:",Array.from(this.pendingStates.keys()));let e=600,i=900,n=window.screenX+(window.outerWidth-e)/2,r=window.screenY+(window.outerHeight-i)/2,a=`width=${e},height=${i},left=${n},top=${r},popup=yes,resizable=yes,scrollbars=yes`,c=window.open(t.authUrl,"oauth_popup",a);console.log("[OAuth Service] Popup opened:",!!c),c&&(c.focus(),this.startPopupMonitoring(c,t.state))}handlePopupMessage(t){if(console.log("[OAuth Service] Received postMessage:",t.origin,t.data),t.origin!==window.location.origin){console.warn("[OAuth Service] Rejected message from different origin:",t.origin);return}let{code:e,state:i,error:n,errorDescription:r}=t.data??{};if(n){console.log("[OAuth Service] OAuth error received:",n,r);let h=this.pendingStates.get(i);if(h){this.pendingStates.delete(i),this.popupCheckInterval&&(clearInterval(this.popupCheckInterval),this.popupCheckInterval=null);let g=new qi({state:i,integrationName:h,error:n,errorDescription:r});this.messageApi.sendMessage(g).subscribe({next:()=>console.log("[OAuth Service] Error callback sent to backend"),error:b=>console.error("[OAuth Service] Failed to send error callback:",b)})}return}if(!e||!i){console.warn("[OAuth Service] Message missing code or state:",t.data);return}console.log("[OAuth Service] Processing callback - code:",e,"state:",i);let a=this.pendingStates.get(i);if(!a){console.warn("[OAuth Service] Unknown state received:",i,"Pending states:",Array.from(this.pendingStates.keys()));return}console.log("[OAuth Service] Found integration:",a),this.pendingStates.delete(i),this.popupCheckInterval&&(clearInterval(this.popupCheckInterval),this.popupCheckInterval=null);let c=new qi({code:e,state:i,integrationName:a});console.log("[OAuth Service] Sending callback to backend..."),this.messageApi.sendMessage(c).subscribe({next:()=>console.log("[OAuth Service] Callback sent to backend successfully"),error:h=>console.error("[OAuth Service] Failed to send callback:",h)})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};function Mw(o){return()=>o.initializeDefaultProject()}function Tw(o){return()=>{console.log("[APP_INIT] OAuthService initialized")}}var wg={providers:[mm(),xm({eventCoalescing:!0}),Im(xg),Om(),Gp(),dm($o),{provide:Xl,useFactory:Mw,deps:[Se],multi:!0},{provide:Xl,useFactory:Tw,deps:[Rl],multi:!0},Bm({basePath:"/api/agentos"}),{provide:Rs,useValue:{width:"80vw",maxWidth:"80vw",maxHeight:"80vh"}}]};var Fl=class o{title="client";themeService=m(_r);ngOnInit(){console.log("[APP] Application initialized with theme:",this.themeService.getCurrentTheme())}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-root"]],decls:1,vars:0,template:function(e,i){e&1&&A(0,"router-outlet")},dependencies:[Dm,Am],encapsulation:2})};Pm(Fl,wg).catch(o=>console.error(o));
|
|
364
|
+
`;var Gv=new ne("MAT_DRAWER_DEFAULT_AUTOSIZE",{providedIn:"root",factory:Yv}),wd=new ne("MAT_DRAWER_CONTAINER");function Yv(){return!1}var hr=(()=>{class o extends ln{_platform=m(et);_changeDetectorRef=m(Ge);_container=m(da);constructor(){let e=m(ie),i=m(sn),n=m(de);super(e,i,n)}ngAfterContentInit(){this._container._contentMarginChanges.subscribe(()=>{this._changeDetectorRef.markForCheck()})}_shouldBeHidden(){if(this._platform.isBrowser)return!1;let{start:e,end:i}=this._container;return e!=null&&e.mode!=="over"&&e.opened||i!=null&&i.mode!=="over"&&i.opened}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["mat-drawer-content"]],hostAttrs:[1,"mat-drawer-content"],hostVars:6,hostBindings:function(i,n){i&2&&(Ii("margin-left",n._container._contentMargins.left,"px")("margin-right",n._container._contentMargins.right,"px"),E("mat-drawer-content-hidden",n._shouldBeHidden()))},features:[qe([{provide:ln,useExisting:o}]),Mt],ngContentSelectors:ml,decls:1,vars:0,template:function(i,n){i&1&&(Be(),me(0))},encapsulation:2,changeDetection:0})}return o})(),ca=(()=>{class o{_elementRef=m(ie);_focusTrapFactory=m(Ha);_focusMonitor=m(Ri);_platform=m(et);_ngZone=m(de);_renderer=m(yt);_interactivityChecker=m(Po);_doc=m(Je);_container=m(wd,{optional:!0});_focusTrap=null;_elementFocusedBeforeDrawerWasOpened=null;_eventCleanups;_isAttached;_anchor;get position(){return this._position}set position(e){e=e==="end"?"end":"start",e!==this._position&&(this._isAttached&&this._updatePositionInParent(e),this._position=e,this.onPositionChanged.emit())}_position="start";get mode(){return this._mode}set mode(e){this._mode=e,this._updateFocusTrapState(),this._modeChanged.next()}_mode="over";get disableClose(){return this._disableClose}set disableClose(e){this._disableClose=Tt(e)}_disableClose=!1;get autoFocus(){let e=this._autoFocus;return e??(this.mode==="side"?"dialog":"first-tabbable")}set autoFocus(e){(e==="true"||e==="false"||e==null)&&(e=Tt(e)),this._autoFocus=e}_autoFocus;get opened(){return this._opened()}set opened(e){this.toggle(Tt(e))}_opened=Ee(!1);_openedVia;_animationStarted=new R;_animationEnd=new R;openedChange=new U(!0);_openedStream=this.openedChange.pipe(ce(e=>e),_e(()=>{}));openedStart=this._animationStarted.pipe(ce(()=>this.opened),Gl(void 0));_closedStream=this.openedChange.pipe(ce(e=>!e),_e(()=>{}));closedStart=this._animationStarted.pipe(ce(()=>!this.opened),Gl(void 0));_destroyed=new R;onPositionChanged=new U;_content;_modeChanged=new R;_injector=m(be);_changeDetectorRef=m(Ge);constructor(){this.openedChange.pipe(L(this._destroyed)).subscribe(e=>{e?(this._elementFocusedBeforeDrawerWasOpened=this._doc.activeElement,this._takeFocus()):this._isFocusWithinDrawer()&&this._restoreFocus(this._openedVia||"program")}),this._ngZone.runOutsideAngular(()=>{let e=this._elementRef.nativeElement;am(e,"keydown").pipe(ce(i=>i.keyCode===27&&!this.disableClose&&!gt(i)),L(this._destroyed)).subscribe(i=>this._ngZone.run(()=>{this.close(),i.stopPropagation(),i.preventDefault()})),this._eventCleanups=[this._renderer.listen(e,"transitionrun",this._handleTransitionEvent),this._renderer.listen(e,"transitionend",this._handleTransitionEvent),this._renderer.listen(e,"transitioncancel",this._handleTransitionEvent)]}),this._animationEnd.subscribe(()=>{this.openedChange.emit(this.opened)})}_forceFocus(e,i){this._interactivityChecker.isFocusable(e)||(e.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{let n=()=>{r(),a(),e.removeAttribute("tabindex")},r=this._renderer.listen(e,"blur",n),a=this._renderer.listen(e,"mousedown",n)})),e.focus(i)}_focusByCssSelector(e,i){let n=this._elementRef.nativeElement.querySelector(e);n&&this._forceFocus(n,i)}_takeFocus(){if(!this._focusTrap)return;let e=this._elementRef.nativeElement;switch(this.autoFocus){case!1:case"dialog":return;case!0:case"first-tabbable":Dt(()=>{!this._focusTrap.focusInitialElement()&&typeof e.focus=="function"&&e.focus()},{injector:this._injector});break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]');break;default:this._focusByCssSelector(this.autoFocus);break}}_restoreFocus(e){this.autoFocus!=="dialog"&&(this._elementFocusedBeforeDrawerWasOpened?this._focusMonitor.focusVia(this._elementFocusedBeforeDrawerWasOpened,e):this._elementRef.nativeElement.blur(),this._elementFocusedBeforeDrawerWasOpened=null)}_isFocusWithinDrawer(){let e=this._doc.activeElement;return!!e&&this._elementRef.nativeElement.contains(e)}ngAfterViewInit(){this._isAttached=!0,this._position==="end"&&this._updatePositionInParent("end"),this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._updateFocusTrapState())}ngOnDestroy(){this._eventCleanups.forEach(e=>e()),this._focusTrap?.destroy(),this._anchor?.remove(),this._anchor=null,this._animationStarted.complete(),this._animationEnd.complete(),this._modeChanged.complete(),this._destroyed.next(),this._destroyed.complete()}open(e){return this.toggle(!0,e)}close(){return this.toggle(!1)}_closeViaBackdropClick(){return this._setOpen(!1,!0,"mouse")}toggle(e=!this.opened,i){e&&i&&(this._openedVia=i);let n=this._setOpen(e,!e&&this._isFocusWithinDrawer(),this._openedVia||"program");return e||(this._openedVia=null),n}_setOpen(e,i,n){return e===this.opened?Promise.resolve(e?"open":"close"):(this._opened.set(e),this._container?._transitionsEnabled?this._setIsAnimating(!0):setTimeout(()=>{this._animationStarted.next(),this._animationEnd.next()}),this._elementRef.nativeElement.classList.toggle("mat-drawer-opened",e),!e&&i&&this._restoreFocus(n),this._changeDetectorRef.markForCheck(),this._updateFocusTrapState(),new Promise(r=>{this.openedChange.pipe(Ut(1)).subscribe(a=>r(a?"open":"close"))}))}_setIsAnimating(e){this._elementRef.nativeElement.classList.toggle("mat-drawer-animating",e)}_getWidth(){return this._elementRef.nativeElement.offsetWidth||0}_updateFocusTrapState(){this._focusTrap&&(this._focusTrap.enabled=!!this._container?.hasBackdrop&&this.opened)}_updatePositionInParent(e){if(!this._platform.isBrowser)return;let i=this._elementRef.nativeElement,n=i.parentNode;e==="end"?(this._anchor||(this._anchor=this._doc.createComment("mat-drawer-anchor"),n.insertBefore(this._anchor,i)),n.appendChild(i)):this._anchor&&this._anchor.parentNode.insertBefore(i,this._anchor)}_handleTransitionEvent=e=>{let i=this._elementRef.nativeElement;e.target===i&&this._ngZone.run(()=>{e.type==="transitionrun"?this._animationStarted.next(e):(e.type==="transitionend"&&this._setIsAnimating(!1),this._animationEnd.next(e))})};static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["mat-drawer"]],viewQuery:function(i,n){if(i&1&&Q(Lv,5),i&2){let r;H(r=W())&&(n._content=r.first)}},hostAttrs:[1,"mat-drawer"],hostVars:12,hostBindings:function(i,n){i&2&&(K("align",null)("tabIndex",n.mode!=="side"?"-1":null),Ii("visibility",!n._container&&!n.opened?"hidden":null),E("mat-drawer-end",n.position==="end")("mat-drawer-over",n.mode==="over")("mat-drawer-push",n.mode==="push")("mat-drawer-side",n.mode==="side"))},inputs:{position:"position",mode:"mode",disableClose:"disableClose",autoFocus:"autoFocus",opened:"opened"},outputs:{openedChange:"openedChange",_openedStream:"opened",openedStart:"openedStart",_closedStream:"closed",closedStart:"closedStart",onPositionChanged:"positionChanged"},exportAs:["matDrawer"],ngContentSelectors:ml,decls:3,vars:0,consts:[["content",""],["cdkScrollable","",1,"mat-drawer-inner-container"]],template:function(i,n){i&1&&(Be(),s(0,"div",1,0),me(2),l())},dependencies:[ln],encapsulation:2,changeDetection:0})}return o})(),da=(()=>{class o{_dir=m(ft,{optional:!0});_element=m(ie);_ngZone=m(de);_changeDetectorRef=m(Ge);_animationDisabled=He();_transitionsEnabled=!1;_allDrawers;_drawers=new pm;_content;_userContent;get start(){return this._start}get end(){return this._end}get autosize(){return this._autosize}set autosize(e){this._autosize=Tt(e)}_autosize=m(Gv);get hasBackdrop(){return this._drawerHasBackdrop(this._start)||this._drawerHasBackdrop(this._end)}set hasBackdrop(e){this._backdropOverride=e==null?null:Tt(e)}_backdropOverride;backdropClick=new U;_start;_end;_left;_right;_destroyed=new R;_doCheckSubject=new R;_contentMargins={left:null,right:null};_contentMarginChanges=new R;get scrollable(){return this._userContent||this._content}_injector=m(be);constructor(){let e=m(et),i=m(Vi);this._dir?.change.pipe(L(this._destroyed)).subscribe(()=>{this._validateDrawers(),this.updateContentMargins()}),i.change().pipe(L(this._destroyed)).subscribe(()=>this.updateContentMargins()),!this._animationDisabled&&e.isBrowser&&this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{this._element.nativeElement.classList.add("mat-drawer-transition"),this._transitionsEnabled=!0},200)})}ngAfterContentInit(){this._allDrawers.changes.pipe(kt(this._allDrawers),L(this._destroyed)).subscribe(e=>{this._drawers.reset(e.filter(i=>!i._container||i._container===this)),this._drawers.notifyOnChanges()}),this._drawers.changes.pipe(kt(null)).subscribe(()=>{this._validateDrawers(),this._drawers.forEach(e=>{this._watchDrawerToggle(e),this._watchDrawerPosition(e),this._watchDrawerMode(e)}),(!this._drawers.length||this._isDrawerOpen(this._start)||this._isDrawerOpen(this._end))&&this.updateContentMargins(),this._changeDetectorRef.markForCheck()}),this._ngZone.runOutsideAngular(()=>{this._doCheckSubject.pipe(sm(10),L(this._destroyed)).subscribe(()=>this.updateContentMargins())})}ngOnDestroy(){this._contentMarginChanges.complete(),this._doCheckSubject.complete(),this._drawers.destroy(),this._destroyed.next(),this._destroyed.complete()}open(){this._drawers.forEach(e=>e.open())}close(){this._drawers.forEach(e=>e.close())}updateContentMargins(){let e=0,i=0;if(this._left&&this._left.opened){if(this._left.mode=="side")e+=this._left._getWidth();else if(this._left.mode=="push"){let n=this._left._getWidth();e+=n,i-=n}}if(this._right&&this._right.opened){if(this._right.mode=="side")i+=this._right._getWidth();else if(this._right.mode=="push"){let n=this._right._getWidth();i+=n,e-=n}}e=e||null,i=i||null,(e!==this._contentMargins.left||i!==this._contentMargins.right)&&(this._contentMargins={left:e,right:i},this._ngZone.run(()=>this._contentMarginChanges.next(this._contentMargins)))}ngDoCheck(){this._autosize&&this._isPushed()&&this._ngZone.runOutsideAngular(()=>this._doCheckSubject.next())}_watchDrawerToggle(e){e._animationStarted.pipe(L(this._drawers.changes)).subscribe(()=>{this.updateContentMargins(),this._changeDetectorRef.markForCheck()}),e.mode!=="side"&&e.openedChange.pipe(L(this._drawers.changes)).subscribe(()=>this._setContainerClass(e.opened))}_watchDrawerPosition(e){e.onPositionChanged.pipe(L(this._drawers.changes)).subscribe(()=>{Dt({read:()=>this._validateDrawers()},{injector:this._injector})})}_watchDrawerMode(e){e._modeChanged.pipe(L(Ai(this._drawers.changes,this._destroyed))).subscribe(()=>{this.updateContentMargins(),this._changeDetectorRef.markForCheck()})}_setContainerClass(e){let i=this._element.nativeElement.classList,n="mat-drawer-container-has-open";e?i.add(n):i.remove(n)}_validateDrawers(){this._start=this._end=null,this._drawers.forEach(e=>{e.position=="end"?(this._end!=null,this._end=e):(this._start!=null,this._start=e)}),this._right=this._left=null,this._dir&&this._dir.value==="rtl"?(this._left=this._end,this._right=this._start):(this._left=this._start,this._right=this._end)}_isPushed(){return this._isDrawerOpen(this._start)&&this._start.mode!="over"||this._isDrawerOpen(this._end)&&this._end.mode!="over"}_onBackdropClicked(){this.backdropClick.emit(),this._closeModalDrawersViaBackdrop()}_closeModalDrawersViaBackdrop(){[this._start,this._end].filter(e=>e&&!e.disableClose&&this._drawerHasBackdrop(e)).forEach(e=>e._closeViaBackdropClick())}_isShowingBackdrop(){return this._isDrawerOpen(this._start)&&this._drawerHasBackdrop(this._start)||this._isDrawerOpen(this._end)&&this._drawerHasBackdrop(this._end)}_isDrawerOpen(e){return e!=null&&e.opened}_drawerHasBackdrop(e){return this._backdropOverride==null?!!e&&e.mode!=="side":this._backdropOverride}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["mat-drawer-container"]],contentQueries:function(i,n,r){if(i&1&&(Ct(r,hr,5),Ct(r,ca,5)),i&2){let a;H(a=W())&&(n._content=a.first),H(a=W())&&(n._allDrawers=a)}},viewQuery:function(i,n){if(i&1&&Q(hr,5),i&2){let r;H(r=W())&&(n._userContent=r.first)}},hostAttrs:[1,"mat-drawer-container"],hostVars:2,hostBindings:function(i,n){i&2&&E("mat-drawer-container-explicit-backdrop",n._backdropOverride)},inputs:{autosize:"autosize",hasBackdrop:"hasBackdrop"},outputs:{backdropClick:"backdropClick"},exportAs:["matDrawerContainer"],features:[qe([{provide:wd,useExisting:o}])],ngContentSelectors:zv,decls:4,vars:2,consts:[[1,"mat-drawer-backdrop",3,"mat-drawer-shown"],[1,"mat-drawer-backdrop",3,"click"]],template:function(i,n){i&1&&(Be(Vv),C(0,jv,1,2,"div",0),me(1),me(2,1),C(3,Bv,2,0,"mat-drawer-content")),i&2&&(x(n.hasBackdrop?0:-1),d(3),x(n._content?-1:3))},dependencies:[hr],styles:[`.mat-drawer-container{position:relative;z-index:1;color:var(--mat-sidenav-content-text-color, var(--mat-sys-on-background));background-color:var(--mat-sidenav-content-background-color, var(--mat-sys-background));box-sizing:border-box;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-container-has-open{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-container.ng-animate-disabled .mat-drawer-backdrop,.mat-drawer-container.ng-animate-disabled .mat-drawer-content,.ng-animate-disabled .mat-drawer-container .mat-drawer-backdrop,.ng-animate-disabled .mat-drawer-container .mat-drawer-content{transition:none}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible;background-color:var(--mat-sidenav-scrim-color, color-mix(in srgb, var(--mat-sys-neutral-variant20) 40%, transparent))}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:background-color,visibility}@media(forced-colors: active){.mat-drawer-backdrop{opacity:.5}}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-content.mat-drawer-content-hidden{opacity:0}.mat-drawer-transition .mat-drawer-content{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;color:var(--mat-sidenav-container-text-color, var(--mat-sys-on-surface-variant));box-shadow:var(--mat-sidenav-container-elevation-shadow, none);background-color:var(--mat-sidenav-container-background-color, var(--mat-sys-surface));border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));width:var(--mat-sidenav-container-width, 360px);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%, 0, 0)}@media(forced-colors: active){.mat-drawer,[dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}}@media(forced-colors: active){[dir=rtl] .mat-drawer,.mat-drawer.mat-drawer-end{border-left:solid 1px currentColor;border-right:none}}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%, 0, 0);border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .mat-drawer{border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer.mat-drawer-end{border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%, 0, 0)}.mat-drawer-transition .mat-drawer{transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating){visibility:hidden;box-shadow:none}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating) .mat-drawer-inner-container{display:none}.mat-drawer.mat-drawer-opened.mat-drawer-opened{transform:none}.mat-drawer-side{box-shadow:none;border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid}.mat-drawer-side.mat-drawer-end{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side.mat-drawer-end{border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid;border-left:none}.mat-drawer-inner-container{width:100%;height:100%;overflow:auto}.mat-sidenav-fixed{position:fixed}
|
|
365
|
+
`],encapsulation:2,changeDetection:0})}return o})(),dl=(()=>{class o extends hr{static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275cmp=T({type:o,selectors:[["mat-sidenav-content"]],hostAttrs:[1,"mat-drawer-content","mat-sidenav-content"],features:[qe([{provide:ln,useExisting:o}]),Mt],ngContentSelectors:ml,decls:1,vars:0,template:function(i,n){i&1&&(Be(),me(0))},encapsulation:2,changeDetection:0})}return o})(),Sd=(()=>{class o extends ca{get fixedInViewport(){return this._fixedInViewport}set fixedInViewport(e){this._fixedInViewport=Tt(e)}_fixedInViewport=!1;get fixedTopGap(){return this._fixedTopGap}set fixedTopGap(e){this._fixedTopGap=gi(e)}_fixedTopGap=0;get fixedBottomGap(){return this._fixedBottomGap}set fixedBottomGap(e){this._fixedBottomGap=gi(e)}_fixedBottomGap=0;static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275cmp=T({type:o,selectors:[["mat-sidenav"]],hostAttrs:[1,"mat-drawer","mat-sidenav"],hostVars:16,hostBindings:function(i,n){i&2&&(K("tabIndex",n.mode!=="side"?"-1":null)("align",null),Ii("top",n.fixedInViewport?n.fixedTopGap:null,"px")("bottom",n.fixedInViewport?n.fixedBottomGap:null,"px"),E("mat-drawer-end",n.position==="end")("mat-drawer-over",n.mode==="over")("mat-drawer-push",n.mode==="push")("mat-drawer-side",n.mode==="side")("mat-sidenav-fixed",n.fixedInViewport))},inputs:{fixedInViewport:"fixedInViewport",fixedTopGap:"fixedTopGap",fixedBottomGap:"fixedBottomGap"},exportAs:["matSidenav"],features:[qe([{provide:ca,useExisting:o}]),Mt],ngContentSelectors:ml,decls:3,vars:0,consts:[["content",""],["cdkScrollable","",1,"mat-drawer-inner-container"]],template:function(i,n){i&1&&(Be(),s(0,"div",1,0),me(2),l())},dependencies:[ln],encapsulation:2,changeDetection:0})}return o})(),Vu=(()=>{class o extends da{_allDrawers=void 0;_content=void 0;static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275cmp=T({type:o,selectors:[["mat-sidenav-container"]],contentQueries:function(i,n,r){if(i&1&&(Ct(r,dl,5),Ct(r,Sd,5)),i&2){let a;H(a=W())&&(n._content=a.first),H(a=W())&&(n._allDrawers=a)}},hostAttrs:[1,"mat-drawer-container","mat-sidenav-container"],hostVars:2,hostBindings:function(i,n){i&2&&E("mat-drawer-container-explicit-backdrop",n._backdropOverride)},exportAs:["matSidenavContainer"],features:[qe([{provide:wd,useExisting:o},{provide:da,useExisting:o}]),Mt],ngContentSelectors:Wv,decls:4,vars:2,consts:[[1,"mat-drawer-backdrop",3,"mat-drawer-shown"],[1,"mat-drawer-backdrop",3,"click"]],template:function(i,n){i&1&&(Be(Hv),C(0,Uv,1,2,"div",0),me(1),me(2,1),C(3,$v,2,0,"mat-sidenav-content")),i&2&&(x(n.hasBackdrop?0:-1),d(3),x(n._content?-1:3))},dependencies:[dl],styles:[qv],encapsulation:2,changeDetection:0})}return o})(),pl=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({imports:[ae,Li,Li,ae]})}return o})();var ju="mat-badge-content",Qv=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["ng-component"]],decls:0,vars:0,template:function(i,n){},styles:[`.mat-badge{position:relative}.mat-badge.mat-badge{overflow:visible}.mat-badge-content{position:absolute;text-align:center;display:inline-block;transition:transform 200ms ease-in-out;transform:scale(0.6);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box;pointer-events:none;background-color:var(--mat-badge-background-color, var(--mat-sys-error));color:var(--mat-badge-text-color, var(--mat-sys-on-error));font-family:var(--mat-badge-text-font, var(--mat-sys-label-small-font));font-weight:var(--mat-badge-text-weight, var(--mat-sys-label-small-weight));border-radius:var(--mat-badge-container-shape, var(--mat-sys-corner-full))}.mat-badge-above .mat-badge-content{bottom:100%}.mat-badge-below .mat-badge-content{top:100%}.mat-badge-before .mat-badge-content{right:100%}[dir=rtl] .mat-badge-before .mat-badge-content{right:auto;left:100%}.mat-badge-after .mat-badge-content{left:100%}[dir=rtl] .mat-badge-after .mat-badge-content{left:auto;right:100%}@media(forced-colors: active){.mat-badge-content{outline:solid 1px;border-radius:0}}.mat-badge-disabled .mat-badge-content{background-color:var(--mat-badge-disabled-state-background-color, color-mix(in srgb, var(--mat-sys-error) 38%, transparent));color:var(--mat-badge-disabled-state-text-color, var(--mat-sys-on-error))}.mat-badge-hidden .mat-badge-content{display:none}.ng-animate-disabled .mat-badge-content,.mat-badge-content._mat-animation-noopable{transition:none}.mat-badge-content.mat-badge-active{transform:none}.mat-badge-small .mat-badge-content{width:var(--mat-badge-legacy-small-size-container-size, unset);height:var(--mat-badge-legacy-small-size-container-size, unset);min-width:var(--mat-badge-small-size-container-size, 6px);min-height:var(--mat-badge-small-size-container-size, 6px);line-height:var(--mat-badge-small-size-line-height, 6px);padding:var(--mat-badge-small-size-container-padding, 0);font-size:var(--mat-badge-small-size-text-size, 0);margin:var(--mat-badge-small-size-container-offset, -6px 0)}.mat-badge-small.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-small-size-container-overlap-offset, -6px)}.mat-badge-medium .mat-badge-content{width:var(--mat-badge-legacy-container-size, unset);height:var(--mat-badge-legacy-container-size, unset);min-width:var(--mat-badge-container-size, 16px);min-height:var(--mat-badge-container-size, 16px);line-height:var(--mat-badge-line-height, 16px);padding:var(--mat-badge-container-padding, 0 4px);font-size:var(--mat-badge-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-container-offset, -12px 0)}.mat-badge-medium.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-container-overlap-offset, -12px)}.mat-badge-large .mat-badge-content{width:var(--mat-badge-legacy-large-size-container-size, unset);height:var(--mat-badge-legacy-large-size-container-size, unset);min-width:var(--mat-badge-large-size-container-size, 16px);min-height:var(--mat-badge-large-size-container-size, 16px);line-height:var(--mat-badge-large-size-line-height, 16px);padding:var(--mat-badge-large-size-container-padding, 0 4px);font-size:var(--mat-badge-large-size-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-large-size-container-offset, -12px 0)}.mat-badge-large.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-large-size-container-overlap-offset, -12px)}
|
|
366
|
+
`],encapsulation:2,changeDetection:0})}return o})(),Bu=(()=>{class o{_ngZone=m(de);_elementRef=m(ie);_ariaDescriber=m(Ua);_renderer=m(yt);_animationsDisabled=He();_idGenerator=m(Re);get color(){return this._color}set color(e){this._setColor(e),this._color=e}_color="primary";overlap=!0;disabled;position="above after";get content(){return this._content}set content(e){this._updateRenderedContent(e)}_content;get description(){return this._description}set description(e){this._updateDescription(e)}_description;size="medium";hidden;_badgeElement;_inlineBadgeDescription;_isInitialized=!1;_interactivityChecker=m(Po);_document=m(Je);constructor(){let e=m(Rt);e.load(Qv),e.load(Ba)}isAbove(){return this.position.indexOf("below")===-1}isAfter(){return this.position.indexOf("before")===-1}getBadgeElement(){return this._badgeElement}ngOnInit(){this._clearExistingBadges(),this.content&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement(),this._updateRenderedContent(this.content)),this._isInitialized=!0}ngOnDestroy(){this._renderer.destroyNode&&(this._renderer.destroyNode(this._badgeElement),this._inlineBadgeDescription?.remove()),this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description)}_isHostInteractive(){return this._interactivityChecker.isFocusable(this._elementRef.nativeElement,{ignoreVisibility:!0})}_createBadgeElement(){let e=this._renderer.createElement("span"),i="mat-badge-active";return e.setAttribute("id",this._idGenerator.getId("mat-badge-content-")),e.setAttribute("aria-hidden","true"),e.classList.add(ju),this._animationsDisabled&&e.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(e),typeof requestAnimationFrame=="function"&&!this._animationsDisabled?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{e.classList.add(i)})}):e.classList.add(i),e}_updateRenderedContent(e){let i=`${e??""}`.trim();this._isInitialized&&i&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=i),this._content=i}_updateDescription(e){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!e||this._isHostInteractive())&&this._removeInlineDescription(),this._description=e,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,e):this._updateInlineDescription()}_updateInlineDescription(){this._inlineBadgeDescription||(this._inlineBadgeDescription=this._document.createElement("span"),this._inlineBadgeDescription.classList.add("cdk-visually-hidden")),this._inlineBadgeDescription.textContent=this.description,this._badgeElement?.appendChild(this._inlineBadgeDescription)}_removeInlineDescription(){this._inlineBadgeDescription?.remove(),this._inlineBadgeDescription=void 0}_setColor(e){let i=this._elementRef.nativeElement.classList;i.remove(`mat-badge-${this._color}`),e&&i.add(`mat-badge-${e}`)}_clearExistingBadges(){let e=this._elementRef.nativeElement.querySelectorAll(`:scope > .${ju}`);for(let i of Array.from(e))i!==this._badgeElement&&i.remove()}static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(i,n){i&2&&E("mat-badge-overlap",n.overlap)("mat-badge-above",n.isAbove())("mat-badge-below",!n.isAbove())("mat-badge-before",!n.isAfter())("mat-badge-after",n.isAfter())("mat-badge-small",n.size==="small")("mat-badge-medium",n.size==="medium")("mat-badge-large",n.size==="large")("mat-badge-hidden",n.hidden||!n.content)("mat-badge-disabled",n.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",J],disabled:[2,"matBadgeDisabled","disabled",J],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",J]}})}return o})(),Hu=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({imports:[Oo,ae,ae]})}return o})();var ur=class o{ATTENTION_EMOJI="\u{1F534}";isSystemActive=!1;systemActiveTimer=null;SYSTEM_ACTIVE_TIMEOUT=4e3;unreadService=m(or);project=m(Se);constructor(){this.initializeTitleUpdates()}initializeTitleUpdates(){qn([this.project.selectedProject$,this.unreadService.unreadCount$]).subscribe(([t,e])=>{this.updateTitle(t?.name??"...",e)})}updateTitle(t,e){let i;this.isSystemActive?i=`\u23F3${e>0?` (${e}) `:" "}${t}`:e>0?i=`${this.ATTENTION_EMOJI} (${e}) ${t}`:i=t,document.title=i,console.log("[TAB-TITLE] Updated to:",i)}setSystemActive(){console.log("[TAB-TITLE] System active - showing hourglass"),this.isSystemActive=!0,this.systemActiveTimer&&clearTimeout(this.systemActiveTimer),this.systemActiveTimer=setTimeout(()=>{console.log("[TAB-TITLE] System active timeout - hiding hourglass"),this.isSystemActive=!1,this.forceUpdateTitle()},this.SYSTEM_ACTIVE_TIMEOUT),this.forceUpdateTitle()}setSystemInactive(){console.log("[TAB-TITLE] System inactive - hiding hourglass"),this.isSystemActive=!1,this.systemActiveTimer&&(clearTimeout(this.systemActiveTimer),this.systemActiveTimer=null),this.forceUpdateTitle()}forceUpdateTitle(){let t=this.project.getSelectedProjectId()??"...",e=this.unreadService.getCurrentCount();this.updateTitle(t,e)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var hl=class o{http=m(Ye);maxFileSize=5*1024*1024;supportedTypes=["image/png","image/jpeg","image/gif","image/webp"];validateFile(t){if(!this.supportedTypes.includes(t.type))throw new Error(`Unsupported file type: ${t.type}`);if(t.size>this.maxFileSize)throw new Error(`File too large: ${(t.size/1024/1024).toFixed(1)}MB exceeds 5MB limit`)}fileToBase64(t){return ee(this,null,function*(){return new Promise((e,i)=>{let n=new FileReader;n.onload=()=>{let r=n.result;if(!r){i(new Error("Failed to read file"));return}let a=r.split(",")[1];if(!a){i(new Error("Invalid file format"));return}e(a)},n.onerror=i,n.readAsDataURL(t)})})}getUploadUrl(t,e){return`/api/projects/${t}/threads/${e}/upload`}uploadImage(t,e,i){console.log("[IMAGE-UPLOAD] uploadImage - file:",t.name,t.type,t.size),console.log("[IMAGE-UPLOAD] uploadImage - project:",e,"thread:",i);try{console.log("[IMAGE-UPLOAD] Validating file..."),this.validateFile(t)}catch(n){return console.log("[IMAGE-UPLOAD] Validation failed:",n),It({success:!1,error:n instanceof Error?n.message:"Validation failed"})}return new Oi(n=>{console.log("[IMAGE-UPLOAD] Converting to base64..."),this.fileToBase64(t).then(r=>{console.log("[IMAGE-UPLOAD] Base64 length:",r.length),console.log("[IMAGE-UPLOAD] Sending upload request..."),this.http.post(this.getUploadUrl(e,i),{content:r,mimeType:t.type,filename:t.name}).pipe(_e(a=>(console.log("[IMAGE-UPLOAD] Upload success result:",a),{success:!0,processedSize:a.processedSize,dimensions:a.dimensions})),wn(a=>{console.log("[IMAGE-UPLOAD] Upload failed:",a);let c=a.error?.error||a.message||"Upload failed";return It({success:!1,error:c})})).subscribe({next:a=>{n.next(a),n.complete()},error:a=>n.error(a)})}).catch(r=>{console.log("[IMAGE-UPLOAD] Base64 conversion failed:",r),n.next({success:!1,error:r instanceof Error?r.message:"Failed to read file"}),n.complete()})})}hasImageFiles(t){if(console.log("[IMAGE-UPLOAD] hasImageFiles - dataTransfer:",t),!t)return console.log("[IMAGE-UPLOAD] hasImageFiles - no dataTransfer"),!1;if(console.log("[IMAGE-UPLOAD] hasImageFiles - types:",Array.from(t.types)),!Array.from(t.types).includes("Files"))return console.log("[IMAGE-UPLOAD] hasImageFiles - no Files type"),!1;let e=Array.from(t.files||[]);console.log("[IMAGE-UPLOAD] hasImageFiles - files:",e.map(n=>({name:n.name,type:n.type})));let i=e.some(n=>this.supportedTypes.includes(n.type));return console.log("[IMAGE-UPLOAD] hasImageFiles - result:",i),i}filterImageFiles(t){return Array.from(t).filter(i=>this.supportedTypes.includes(i.type))}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var gr=class o{pendingFirstMessage=null;setPendingFirstMessage(t){console.log("[FIRST-MESSAGE-STATE] Storing pending first message:",t.substring(0,50)+"..."),this.pendingFirstMessage=t}consumePendingFirstMessage(){let t=this.pendingFirstMessage;return t?(console.log("[FIRST-MESSAGE-STATE] Consuming pending first message:",t.substring(0,50)+"..."),this.pendingFirstMessage=null):console.log("[FIRST-MESSAGE-STATE] No pending first message to consume"),t}hasPendingFirstMessage(){return this.pendingFirstMessage!==null}clear(){this.pendingFirstMessage&&(console.log("[FIRST-MESSAGE-STATE] Clearing pending first message"),this.pendingFirstMessage=null)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var fr=class o{http=m(Ye);usernameSubject=new le(null);username$=this.usernameSubject.asObservable();fetchCurrentUser(){return this.http.get("/api/user/me").pipe(vt(t=>{this.usernameSubject.next(t.username)}))}getUsername(){return this.usernameSubject.value}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var Kv=["inputSection"],Zv=()=>[];function Jv(o,t){if(o&1){let e=M();s(0,"button",19),_("click",function(){v(e);let n=u();return y(n.toggleFileDrawer())}),s(1,"mat-icon"),p(2,"folder_open"),l()()}if(o&2){let e=u();E("has-files",e.fileCount>0),w("title",Mn("Files Exchange",e.fileCount>0?" ("+e.fileCount+" file"+(e.fileCount>1?"s":"")+")":""))("matBadge",e.fileCount>0?e.fileCount:null)}}function ey(o,t){if(o&1){let e=M();s(0,"button",20),_("click",function(){v(e);let n=u();return y(n.toggleSharePanel())}),s(1,"mat-icon"),p(2,"group"),l()()}if(o&2){let e=u();E("has-shared-users",((e.threadDetails==null||e.threadDetails.users==null?null:e.threadDetails.users.length)??0)>1)}}function ty(o,t){if(o&1&&(s(0,"div",6),p(1),l()),o&2){let e=u();d(),kn(" \u26A0\uFE0F Connection lost. Reconnecting... (",e.connectionStatus.reconnectAttempts,"/",e.connectionStatus.maxAttempts,") ")}}function iy(o,t){if(o&1&&(s(0,"div",21),p(1),l()),o&2){let e=u();E("error",e.uploadStatus.isError),d(),te(" ",e.uploadStatus.message," ")}}function ny(o,t){if(o&1){let e=M();s(0,"app-chat-textarea",22),_("messageSubmitted",function(n){v(e);let r=u();return y(r.onMessageSubmitted(n))})("voiceRecordingToggled",function(n){v(e);let r=u();return y(r.onVoiceToggled(n))})("heightChanged",function(n){v(e);let r=u();return y(r.onInputHeightChanged(n))})("stopRequested",function(){v(e);let n=u();return y(n.onStopRequested())})("filesPasted",function(n){v(e);let r=u();return y(r.onFilesPasted(n))}),l()}if(o&2){let e=u();w("isDisabled",!e.isConnected)("isSessionInitializing",!1)("showWelcome",!1)("isThinking",e.isThinking)("isStarting",!1)}}function oy(o,t){if(o&1){let e=M();s(0,"app-choice-select",23),_("choiceSelected",function(n){v(e);let r=u();return y(r.onChoiceSelected(n))}),l()}if(o&2){let e=u();w("options",e.currentChoice.options)("labelHtml",e.currentChoice.label)("isVisible",!!e.currentChoice)("allowFreeText",e.currentChoice.allowFreeText)}}function ry(o,t){if(o&1){let e=M();s(0,"app-file-exchange-drawer",24),_("closeDrawer",function(){v(e);let n=u();return y(n.closeDrawer())}),l()}if(o&2){let e=u();w("projectName",e.projectName)("threadId",e.threadId)}}function ay(o,t){if(o&1){let e=M();s(0,"div",17)(1,"div",25)(2,"h3",26),p(3,"Share"),l(),s(4,"button",27),_("click",function(){v(e);let n=u();return y(n.closeDrawer())}),s(5,"mat-icon"),p(6,"chevron_right"),l()()(),s(7,"app-thread-share",28),_("userAdded",function(n){v(e);let r=u();return y(r.onUserAdded(n))})("userRemoved",function(n){v(e);let r=u();return y(r.onUserRemoved(n))}),l()()}if(o&2){let e=u();d(7),w("threadId",e.threadId)("users",e.threadDetails.users||vm(4,Zv))("ownerUsername",e.threadDetails.username)("currentUsername",e.currentUsername)}}function sy(o,t){o&1&&(s(0,"div",18)(1,"div",29)(2,"div",30),p(3,"\u{1F4CE}"),l(),s(4,"div",31),p(5,"Drop files here to upload"),l(),s(6,"div",32),p(7,"Images will be added to conversation, other files to exchange space"),l()()())}var ul=class o{projectName;threadId;destroy$=new R;inputSection;messages=[];streamingText="";isThinking=!1;currentChoice=null;connectionStatus=null;isConnected=!1;showConnectionStatus=!1;hasEverConnected=!1;inputSectionHeight=80;uploadStatus={message:"",isError:!1};isDragOver=!1;drawerMode="none";get isDrawerOpen(){return this.drawerMode!=="none"}threadDetails=null;threadShareRef;get fileCount(){return this.fileExchangeState.fileCount()}get currentUsername(){return this.userService.getUsername()??""}pendingFirstMessage=null;subscriptions=[];codayService=m(Qt);preferencesService=m(nt);titleService=m(ur);elementRef=m(ie);threadState=m(Pt);userService=m(fr);imageUploadService=m(hl);fileExchangeState=m(ar);firstMessageState=m(gr);ngOnInit(){if(console.log("[THREAD] Initializing with project:",this.projectName,"thread:",this.threadId),!this.projectName||!this.threadId){console.error("[THREAD] Missing required inputs: projectName or threadId");return}this.setupPrintHandlers(),this.initializeThreadConnection()}ngOnChanges(t){console.log("[THREAD] ngOnChanges called",t),t.threadId&&(console.log("[THREAD] threadId changed:",{firstChange:t.threadId.firstChange,previousValue:t.threadId.previousValue,currentValue:t.threadId.currentValue}),t.threadId.firstChange||(console.log("[THREAD] Reconnecting to new thread"),this.initializeThreadConnection()))}initializeThreadConnection(){console.log("[THREAD] Initializing connection for thread:",this.threadId),this.fileExchangeState.initializeForThread(this.projectName,this.threadId),this.codayService.messages$.pipe(L(this.destroy$)).subscribe(e=>{console.log("[THREAD] Messages updated:",e.length),this.messages=e}),this.codayService.streamingText$.pipe(L(this.destroy$)).subscribe(e=>{this.streamingText=e}),this.codayService.isThinking$.pipe(L(this.destroy$)).subscribe(e=>{this.isThinking=e}),this.codayService.currentChoice$.pipe(L(this.destroy$)).subscribe(e=>{this.currentChoice=e}),this.codayService.connectionStatus$.pipe(L(this.destroy$)).subscribe(e=>{this.connectionStatus=e,this.isConnected=e.connected,e.connected&&!this.hasEverConnected&&(this.hasEverConnected=!0,this.showConnectionStatus=!0),!e.connected&&!this.hasEverConnected?setTimeout(()=>{!this.isConnected&&!this.hasEverConnected&&(this.showConnectionStatus=!0)},2e3):!e.connected&&this.hasEverConnected?this.showConnectionStatus=!0:e.connected&&(this.showConnectionStatus=!0)}),this.codayService.threadUpdateEvent$.pipe(L(this.destroy$)).subscribe(e=>{e&&(console.log("[THREAD] Thread update event received:",e),this.threadState.refreshThreadList())}),this.threadState.selectedThread$.pipe(L(this.destroy$)).subscribe(e=>{this.threadDetails=e}),this.codayService.resetMessages(),this.codayService.setTabTitleService(this.titleService),console.log("[THREAD] Connecting to thread event stream"),this.codayService.connectToThread(this.projectName,this.threadId);let t=this.firstMessageState.consumePendingFirstMessage();t?(console.log("[THREAD] First message pending:",t.substring(0,50)+"..."),this.pendingFirstMessage=t,this.codayService.setThinkingForPendingMessage(),this.subscribeToFirstInvite()):console.log("[THREAD] No first message found in state service")}ngAfterViewChecked(){if(this.inputSection?.nativeElement){let t=this.inputSection.nativeElement.offsetHeight;t!==this.inputSectionHeight&&t>0&&(this.inputSectionHeight=t)}}ngOnDestroy(){console.log("[THREAD] Destroying component"),this.destroy$.next(),this.destroy$.complete(),this.fileExchangeState.clear(),this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[],window.removeEventListener("beforeprint",this.handleBeforePrint),window.removeEventListener("afterprint",this.handleAfterPrint)}onMessageSubmitted(t){console.log("[THREAD] Sending message:",t),this.codayService.sendMessage(t)}onVoiceToggled(t){console.log("[VOICE] Recording:",t)}onChoiceSelected(t){console.log("[THREAD] Choice selected:",t),this.codayService.sendChoice(t)}onCopyMessage(t){console.log("[COPY] Message copied:",t.id)}onStopRequested(){this.threadState.stop()}onInputHeightChanged(t){console.log("[THREAD] Input height changed:",t),this.inputSectionHeight=t}onFilesPasted(t){console.log("[THREAD] File(s) pasted:",t.length);let e=this.imageUploadService.filterImageFiles(t),i=t.filter(n=>!n.type.startsWith("image/"));e.length&&this.uploadFilesSequentially(e,0),i.length&&this.uploadFilesToExchangeSpace(i),!e.length&&!i.length&&this.showUploadError("No supported files found")}toggleFileDrawer(){this.drawerMode=this.drawerMode==="files"?"none":"files"}toggleSharePanel(){this.drawerMode=this.drawerMode==="share"?"none":"share"}closeDrawer(){this.drawerMode="none"}onUserAdded(t){if(console.log("[THREAD] Adding user to thread:",t),!this.threadDetails)return;let e=this.threadDetails.users||[];if(e.some(n=>n.userId===t)){this.threadShareRef?.setError("User already has access to this thread");return}this.threadShareRef?.setAdding(!0);let i=[...e,{userId:t}];this.threadState.updateThreadUsers(this.threadId,i).pipe(L(this.destroy$)).subscribe({next:()=>{console.log("[THREAD] User added successfully"),this.threadShareRef?.setAdding(!1),this.threadState.refreshSelectedThread()},error:n=>{console.error("[THREAD] Error adding user:",n),this.threadShareRef?.setError(n?.error?.error||"Failed to add user")}})}onUserRemoved(t){if(console.log("[THREAD] Removing user from thread:",t),!this.threadDetails)return;let e=(this.threadDetails.users||[]).filter(i=>i.userId!==t);this.threadState.updateThreadUsers(this.threadId,e).pipe(L(this.destroy$)).subscribe({next:()=>{console.log("[THREAD] User removed successfully"),this.threadState.refreshSelectedThread()},error:i=>{console.error("[THREAD] Error removing user:",i)}})}onDragEnter(t){t.preventDefault(),t.dataTransfer?.types.includes("Files")&&(console.log("[THREAD] Image files detected - showing drag overlay"),this.isDragOver=!0)}onDragOver(t){t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="copy")}onDragLeave(t){this.elementRef.nativeElement.contains(t.relatedTarget)||(console.log("[THREAD] Leaving component area - hiding drag overlay"),this.isDragOver=!1)}onDrop(t){t.preventDefault(),this.isDragOver=!1,console.log("[THREAD] Files dropped:",t.dataTransfer?.files?.length||0);let e=t.dataTransfer?.files;if(!e||e.length===0){console.log("[THREAD] No files in drop event");return}let i=this.imageUploadService.filterImageFiles(e),n=Array.from(e).filter(r=>!r.type.startsWith("image/"));console.log("[THREAD] Image files:",i.length,"Other files:",n.length),i.length>0&&this.uploadFilesSequentially(i,0),n.length>0&&this.uploadFilesToExchangeSpace(n),i.length===0&&n.length===0&&this.showUploadError("No supported files found")}uploadFilesSequentially(t,e){if(e>=t.length)return;let i=t[e];if(!i){console.error("[THREAD] File at index",e,"is undefined");return}console.log("[THREAD] Uploading file:",i.name),this.uploadStatus={message:`Uploading ${i.name}...`,isError:!1},this.imageUploadService.uploadImage(i,this.projectName,this.threadId).subscribe({next:n=>{n.success?(console.log("[THREAD] Upload successful:",i.name),this.uploadStatus={message:`\u2713 ${i.name} uploaded (${(n.processedSize/1024).toFixed(1)} KB)`,isError:!1},setTimeout(()=>{this.uploadStatus.isError||(this.uploadStatus={message:"",isError:!1})},3e3),this.uploadFilesSequentially(t,e+1)):(console.error("[THREAD] Upload failed:",i.name,n.error),this.showUploadError(`Failed to upload ${i.name}: ${n.error}`))},error:n=>{console.error("[THREAD] Upload error:",i.name,n),this.showUploadError(`Failed to upload ${i.name}: ${n.message||"Unknown error"}`)}})}showUploadError(t){this.uploadStatus={message:t,isError:!0},setTimeout(()=>{this.uploadStatus={message:"",isError:!1}},5e3)}uploadFilesToExchangeSpace(t){return ee(this,null,function*(){for(let e of t){console.log("[THREAD] Uploading to exchange space:",e.name),this.uploadStatus={message:`Uploading ${e.name}...`,isError:!1};let i=yield this.fileExchangeState.uploadFile(e);if(i.success)console.log("[THREAD] Upload to exchange space successful:",e.name),this.uploadStatus={message:`\u2713 ${e.name} uploaded to exchange space`,isError:!1},setTimeout(()=>{this.uploadStatus.isError||(this.uploadStatus={message:"",isError:!1})},3e3);else{console.error("[THREAD] Upload to exchange space failed:",e.name,i.error),this.showUploadError(`Failed to upload ${e.name}: ${i.error}`);break}}})}subscribeToFirstInvite(){console.log("[THREAD] Subscribing to wait for InviteEvent"),this.subscriptions.push(this.codayService.currentInviteEvent$.subscribe(t=>{if(t&&this.pendingFirstMessage){console.log("[THREAD] Received InviteEvent, sending pending message");let e=this.pendingFirstMessage;this.pendingFirstMessage=null,this.codayService.sendMessage(e)}}))}setupPrintHandlers(){window.addEventListener("beforeprint",this.handleBeforePrint),window.addEventListener("afterprint",this.handleAfterPrint)}handleBeforePrint=()=>{console.log("[PRINT] Before print event triggered");let t=this.preferencesService.getPrintTechnicalMessages();console.log("[PRINT] Print technical messages:",t),t?document.body.classList.add("print-include-technical"):document.body.classList.remove("print-include-technical")};handleAfterPrint=()=>{console.log("[PRINT] After print event triggered"),document.body.classList.remove("print-include-technical")};static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-thread"]],viewQuery:function(e,i){if(e&1&&(Q(Kv,5),Q(la,5)),e&2){let n;H(n=W())&&(i.inputSection=n.first),H(n=W())&&(i.threadShareRef=n.first)}},inputs:{projectName:"projectName",threadId:"threadId"},features:[tt],decls:20,vars:14,consts:[["inputSection",""],[1,"drag-drop-wrapper",3,"dragenter","dragover","dragleave","drop"],[1,"file-drawer-container",3,"hasBackdrop"],[1,"thread-container"],["matFab","","type","button",1,"file-drawer-toggle-btn",3,"has-files","matBadge","title"],["matFab","","title","Share thread","type","button",1,"share-toggle-btn",3,"has-shared-users"],[1,"connection-status"],[1,"chat-wrapper"],[1,"chat-center"],[3,"copyRequested","stopRequested","messages","streamingText","isThinking"],[1,"upload-status",3,"error"],[1,"input-section"],[1,"input-center"],[3,"isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"],[1,"choice-overlay",3,"options","labelHtml","isVisible","allowFreeText"],["mode","side","position","end",3,"closed","opened"],[3,"projectName","threadId"],[1,"share-drawer-container"],[1,"drag-overlay"],["matFab","","type","button",1,"file-drawer-toggle-btn",3,"click","matBadge","title"],["matFab","","title","Share thread","type","button",1,"share-toggle-btn",3,"click"],[1,"upload-status"],[3,"messageSubmitted","voiceRecordingToggled","heightChanged","stopRequested","filesPasted","isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"],[1,"choice-overlay",3,"choiceSelected","options","labelHtml","isVisible","allowFreeText"],[3,"closeDrawer","projectName","threadId"],[1,"drawer-header"],[1,"drawer-title"],["mat-icon-button","","title","Close","type","button",1,"close-btn",3,"click"],[3,"userAdded","userRemoved","threadId","users","ownerUsername","currentUsername"],[1,"drag-overlay-content"],[1,"drag-icon"],[1,"drag-text"],[1,"drag-hint"]],template:function(e,i){if(e&1){let n=M();s(0,"div",1),_("dragenter",function(a){return v(n),y(i.onDragEnter(a))})("dragover",function(a){return v(n),y(i.onDragOver(a))})("dragleave",function(a){return v(n),y(i.onDragLeave(a))})("drop",function(a){return v(n),y(i.onDrop(a))}),s(1,"mat-drawer-container",2)(2,"mat-drawer-content")(3,"div",3),C(4,Jv,3,5,"button",4),C(5,ey,3,2,"button",5),C(6,ty,2,2,"div",6),s(7,"div",7)(8,"div",8)(9,"app-chat-history",9),_("copyRequested",function(a){return v(n),y(i.onCopyMessage(a))})("stopRequested",function(){return v(n),y(i.onStopRequested())}),l(),C(10,iy,2,3,"div",10),l()(),s(11,"div",11,0)(13,"div",12),C(14,ny,1,5,"app-chat-textarea",13),C(15,oy,1,4,"app-choice-select",14),l()()()(),s(16,"mat-drawer",15),_("closed",function(){return v(n),y(i.closeDrawer())}),C(17,ry,1,2,"app-file-exchange-drawer",16),C(18,ay,8,5,"div",17),l()(),C(19,sy,8,0,"div",18),l()}e&2&&(d(),w("hasBackdrop",!1),d(3),x(i.drawerMode!=="files"?4:-1),d(),x(i.drawerMode!=="share"?5:-1),d(),x(i.showConnectionStatus&&i.connectionStatus&&!i.connectionStatus.connected?6:-1),d(3),w("messages",i.messages)("streamingText",i.streamingText)("isThinking",i.isThinking),d(),x(i.uploadStatus.message?10:-1),d(4),x(i.currentChoice?-1:14),d(),x(i.currentChoice?15:-1),d(),w("opened",i.isDrawerOpen),d(),x(i.drawerMode==="files"?17:-1),d(),x(i.drawerMode==="share"&&i.threadDetails?18:-1),d(),x(i.isDragOver?19:-1))},dependencies:[Zs,er,Go,sl,la,pl,ca,da,hr,Oe,he,it,Qe,Ga,Hu,Bu],styles:[".drag-drop-wrapper[_ngcontent-%COMP%]{height:100vh;width:100%;position:relative}.thread-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;width:100%;position:relative;background:transparent}.file-drawer-toggle-btn[_ngcontent-%COMP%]{position:fixed!important;top:1rem!important;right:1rem!important;z-index:100!important}.file-drawer-toggle-btn.has-files[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_pulse-subtle 3s infinite}.share-toggle-btn[_ngcontent-%COMP%]{position:fixed!important;top:5rem!important;right:1rem!important;z-index:100!important}.share-toggle-btn.has-shared-users[_ngcontent-%COMP%]{color:var(--color-primary)!important}.share-drawer-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);color:var(--color-text)}.share-drawer-container[_ngcontent-%COMP%] .drawer-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;border-bottom:1px solid var(--color-border);flex-shrink:0}.share-drawer-container[_ngcontent-%COMP%] .drawer-title[_ngcontent-%COMP%]{margin:0;font-size:1.25rem;font-weight:600;color:var(--color-text)}.share-drawer-container[_ngcontent-%COMP%] .close-btn[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.share-drawer-container[_ngcontent-%COMP%] .close-btn[_ngcontent-%COMP%]:hover{color:var(--color-text);background:var(--color-bg-hover)}@keyframes _ngcontent-%COMP%_pulse-subtle{0%,to{box-shadow:0 2px 8px #00000026}50%{box-shadow:0 4px 16px rgba(var(--color-primary-rgb, 25, 118, 210),.3)}}.file-drawer-container[_ngcontent-%COMP%]{height:100vh;width:100%;background:var(--color-bg)}.file-drawer-container[_ngcontent-%COMP%] .mat-drawer-content{display:flex;flex-direction:column;height:100%;overflow:hidden;background:transparent}.file-drawer-container[_ngcontent-%COMP%] .mat-drawer{width:35vw;max-width:90vw;box-shadow:-2px 0 8px #0000001a}@media (max-width: 768px){.file-drawer-container[_ngcontent-%COMP%] .mat-drawer{width:100vw;max-width:100vw}}.file-drawer-container[_ngcontent-%COMP%] .mat-drawer-backdrop{display:none}.connection-status[_ngcontent-%COMP%]{position:fixed;top:0;left:0;right:0;z-index:1000;background:var(--color-warning);color:var(--color-text);padding:.5rem 1rem;text-align:center;font-size:.9rem;box-shadow:0 2px 4px #0000001a}.chat-wrapper[_ngcontent-%COMP%]{flex:1;overflow-y:auto;overflow-x:hidden;display:flex;flex-direction:column;width:100%;padding:1rem 0}.chat-center[_ngcontent-%COMP%]{max-width:800px;width:100%;margin:0 auto;padding:0 1rem;display:flex;flex-direction:column;gap:1rem}.input-section[_ngcontent-%COMP%]{width:100%;padding:1rem 0;background:transparent;position:relative}.input-center[_ngcontent-%COMP%]{max-width:800px;width:100%;margin:0 auto;padding:0 1rem}.choice-overlay[_ngcontent-%COMP%]{display:block;width:100%}.upload-status[_ngcontent-%COMP%]{padding:.75rem 1rem;border-radius:8px;background:var(--color-success-light);color:var(--color-text);font-size:.9rem;text-align:center}.upload-status.error[_ngcontent-%COMP%]{background:var(--color-error-light)}@media print{.file-drawer-toggle-btn[_ngcontent-%COMP%], .share-toggle-btn[_ngcontent-%COMP%], .connection-status[_ngcontent-%COMP%]{display:none}.thread-container[_ngcontent-%COMP%]{background:#fff}.input-section[_ngcontent-%COMP%]{display:none}}"]})};var Wu=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({imports:[ae,ae]})}return o})();var Uu=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({imports:[ae]})}return o})();var Qi=class o{http=m(Ye);getUserConfig(){return this.http.get("/api/config/user").pipe(vt(t=>console.log("[CONFIG-API] User config retrieved:",t)))}updateUserConfig(t){return this.http.put("/api/config/user",t).pipe(vt(e=>console.log("[CONFIG-API] User config updated:",e)))}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var _r=class o{currentThemeSubject=new le("light");currentTheme$=this.currentThemeSubject.asObservable();preferences=m(nt);constructor(){console.log("[THEME] Initializing theme service"),this.initializeTheme(),this.setupSystemThemeListener()}initializeTheme(){let t=this.preferences.getPreference("theme","light")??"light";console.log("[THEME] Loaded saved theme:",t),this.applyTheme(t),setTimeout(()=>{let e=this.preferences.getPreference("theme","light")??"light";e!==t&&(console.log("[THEME] Theme updated after async load:",e),this.applyTheme(e))},100)}setTheme(t){this.preferences.setPreference("theme",t),this.applyTheme(t)}getCurrentTheme(){return this.currentThemeSubject.value}applyTheme(t){if(console.log("[THEME] Applying theme:",t),this.currentThemeSubject.next(t),t==="system")if(typeof window<"u"&&window.matchMedia){let i=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";console.log("[THEME] System theme resolved to:",i),this.setDocumentTheme(i)}else console.log("[THEME] matchMedia not available, defaulting to light theme"),this.setDocumentTheme("light");else this.setDocumentTheme(t)}setDocumentTheme(t){console.log("[THEME] Setting document theme to:",t),typeof document<"u"&&document.documentElement&&(t==="dark"?document.documentElement.setAttribute("data-theme","dark"):document.documentElement.removeAttribute("data-theme"))}setupSystemThemeListener(){typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{this.getCurrentTheme()==="system"&&this.setDocumentTheme(t.matches?"dark":"light")})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var ly=["mat-internal-form-field",""],cy=["*"],gl=(()=>{class o{labelPosition;static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["div","mat-internal-form-field",""]],hostAttrs:[1,"mdc-form-field","mat-internal-form-field"],hostVars:2,hostBindings:function(i,n){i&2&&E("mdc-form-field--align-end",n.labelPosition==="before")},inputs:{labelPosition:"labelPosition"},attrs:ly,ngContentSelectors:cy,decls:1,vars:0,template:function(i,n){i&1&&(Be(),me(0))},styles:[`.mat-internal-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;vertical-align:middle}.mat-internal-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mat-internal-form-field>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end .mdc-form-field--align-end label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0}
|
|
367
|
+
`],encapsulation:2,changeDetection:0})}return o})();var dy=["switch"],my=["*"];function py(o,t){o&1&&(s(0,"span",11),en(),s(1,"svg",13),I(2,"path",14),l(),s(3,"svg",15),I(4,"path",16),l()())}var hy=new ne("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1,hideIcon:!1,disabledInteractive:!1})}),fl=class{source;checked;constructor(t,e){this.source=t,this.checked=e}},uo=(()=>{class o{_elementRef=m(ie);_focusMonitor=m(Ri);_changeDetectorRef=m(Ge);defaults=m(hy);_onChange=e=>{};_onTouched=()=>{};_validatorOnChange=()=>{};_uniqueId;_checked=!1;_createChangeEvent(e){return new fl(this,e)}_labelId;get buttonId(){return`${this.id||this._uniqueId}-button`}_switchElement;focus(){this._switchElement.nativeElement.focus()}_noopAnimations=He();_focused;name=null;id;labelPosition="after";ariaLabel=null;ariaLabelledby=null;ariaDescribedby;required;color;disabled=!1;disableRipple=!1;tabIndex=0;get checked(){return this._checked}set checked(e){this._checked=e,this._changeDetectorRef.markForCheck()}hideIcon;disabledInteractive;change=new U;toggleChange=new U;get inputId(){return`${this.id||this._uniqueId}-input`}constructor(){m(Rt).load(An);let e=m(new Tn("tabindex"),{optional:!0}),i=this.defaults;this.tabIndex=e==null?0:parseInt(e)||0,this.color=i.color||"accent",this.id=this._uniqueId=m(Re).getId("mat-mdc-slide-toggle-"),this.hideIcon=i.hideIcon??!1,this.disabledInteractive=i.disabledInteractive??!1,this._labelId=this._uniqueId+"-label"}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(e=>{e==="keyboard"||e==="program"?(this._focused=!0,this._changeDetectorRef.markForCheck()):e||Promise.resolve().then(()=>{this._focused=!1,this._onTouched(),this._changeDetectorRef.markForCheck()})})}ngOnChanges(e){e.required&&this._validatorOnChange()}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}writeValue(e){this.checked=!!e}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}validate(e){return this.required&&e.value!==!0?{required:!0}:null}registerOnValidatorChange(e){this._validatorOnChange=e}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck()}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(this._createChangeEvent(this.checked))}_handleClick(){this.disabled||(this.toggleChange.emit(),this.defaults.disableToggleValue||(this.checked=!this.checked,this._onChange(this.checked),this.change.emit(new fl(this,this.checked))))}_getAriaLabelledBy(){return this.ariaLabelledby?this.ariaLabelledby:this.ariaLabel?null:this._labelId}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["mat-slide-toggle"]],viewQuery:function(i,n){if(i&1&&Q(dy,5),i&2){let r;H(r=W())&&(n._switchElement=r.first)}},hostAttrs:[1,"mat-mdc-slide-toggle"],hostVars:13,hostBindings:function(i,n){i&2&&(Zt("id",n.id),K("tabindex",null)("aria-label",null)("name",null)("aria-labelledby",null),tn(n.color?"mat-"+n.color:""),E("mat-mdc-slide-toggle-focused",n._focused)("mat-mdc-slide-toggle-checked",n.checked)("_mat-animation-noopable",n._noopAnimations))},inputs:{name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],required:[2,"required","required",J],color:"color",disabled:[2,"disabled","disabled",J],disableRipple:[2,"disableRipple","disableRipple",J],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:ui(e)],checked:[2,"checked","checked",J],hideIcon:[2,"hideIcon","hideIcon",J],disabledInteractive:[2,"disabledInteractive","disabledInteractive",J]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[qe([{provide:Do,useExisting:Yn(()=>o),multi:!0},{provide:Ya,useExisting:o,multi:!0}]),tt],ngContentSelectors:my,decls:14,vars:27,consts:[["switch",""],["mat-internal-form-field","",3,"labelPosition"],["role","switch","type","button",1,"mdc-switch",3,"click","tabIndex","disabled"],[1,"mat-mdc-slide-toggle-touch-target"],[1,"mdc-switch__track"],[1,"mdc-switch__handle-track"],[1,"mdc-switch__handle"],[1,"mdc-switch__shadow"],[1,"mdc-elevation-overlay"],[1,"mdc-switch__ripple"],["mat-ripple","",1,"mat-mdc-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-switch__icons"],[1,"mdc-label",3,"click","for"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--on"],["d","M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--off"],["d","M20 13H4v-2h16v2z"]],template:function(i,n){if(i&1){let r=M();Be(),s(0,"div",1)(1,"button",2,0),_("click",function(){return v(r),y(n._handleClick())}),I(3,"div",3)(4,"span",4),s(5,"span",5)(6,"span",6)(7,"span",7),I(8,"span",8),l(),s(9,"span",9),I(10,"span",10),l(),C(11,py,5,0,"span",11),l()()(),s(12,"label",12),_("click",function(c){return v(r),y(c.stopPropagation())}),me(13),l()()}if(i&2){let r=Jt(2);w("labelPosition",n.labelPosition),d(),E("mdc-switch--selected",n.checked)("mdc-switch--unselected",!n.checked)("mdc-switch--checked",n.checked)("mdc-switch--disabled",n.disabled)("mat-mdc-slide-toggle-disabled-interactive",n.disabledInteractive),w("tabIndex",n.disabled&&!n.disabledInteractive?-1:n.tabIndex)("disabled",n.disabled&&!n.disabledInteractive),K("id",n.buttonId)("name",n.name)("aria-label",n.ariaLabel)("aria-labelledby",n._getAriaLabelledBy())("aria-describedby",n.ariaDescribedby)("aria-required",n.required||null)("aria-checked",n.checked)("aria-disabled",n.disabled&&n.disabledInteractive?"true":null),d(9),w("matRippleTrigger",r)("matRippleDisabled",n.disableRipple||n.disabled)("matRippleCentered",!0),d(),x(n.hideIcon?-1:11),d(),w("for",n.buttonId),K("id",n._labelId)}},dependencies:[On,gl],styles:[`.mdc-switch{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;flex-shrink:0;margin:0;outline:none;overflow:visible;padding:0;position:relative;width:var(--mat-slide-toggle-track-width, 52px)}.mdc-switch.mdc-switch--disabled{cursor:default;pointer-events:none}.mdc-switch.mat-mdc-slide-toggle-disabled-interactive{pointer-events:auto}.mdc-switch__track{overflow:hidden;position:relative;width:100%;height:var(--mat-slide-toggle-track-height, 32px);border-radius:var(--mat-slide-toggle-track-shape, var(--mat-sys-corner-full))}.mdc-switch--disabled.mdc-switch .mdc-switch__track{opacity:var(--mat-slide-toggle-disabled-track-opacity, 0.12)}.mdc-switch__track::before,.mdc-switch__track::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";height:100%;left:0;position:absolute;width:100%;border-width:var(--mat-slide-toggle-track-outline-width, 2px);border-color:var(--mat-slide-toggle-track-outline-color, var(--mat-sys-outline))}.mdc-switch--selected .mdc-switch__track::before,.mdc-switch--selected .mdc-switch__track::after{border-width:var(--mat-slide-toggle-selected-track-outline-width, 2px);border-color:var(--mat-slide-toggle-selected-track-outline-color, transparent)}.mdc-switch--disabled .mdc-switch__track::before,.mdc-switch--disabled .mdc-switch__track::after{border-width:var(--mat-slide-toggle-disabled-unselected-track-outline-width, 2px);border-color:var(--mat-slide-toggle-disabled-unselected-track-outline-color, var(--mat-sys-on-surface))}@media(forced-colors: active){.mdc-switch__track{border-color:currentColor}}.mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:translateX(0);background:var(--mat-slide-toggle-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1);transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch--selected .mdc-switch__track::before{transform:translateX(-100%)}.mdc-switch--selected .mdc-switch__track::before{opacity:var(--mat-slide-toggle-hidden-track-opacity, 0);transition:var(--mat-slide-toggle-hidden-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::before{opacity:var(--mat-slide-toggle-visible-track-opacity, 1);transition:var(--mat-slide-toggle-visible-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-hover-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-focus-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:active .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-pressed-track-color, var(--mat-sys-surface-variant))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::before,.mdc-switch.mdc-switch--disabled .mdc-switch__track::before{background:var(--mat-slide-toggle-disabled-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch__track::after{transform:translateX(-100%);background:var(--mat-slide-toggle-selected-track-color, var(--mat-sys-primary))}[dir=rtl] .mdc-switch__track::after{transform:translateX(100%)}.mdc-switch--selected .mdc-switch__track::after{transform:translateX(0)}.mdc-switch--selected .mdc-switch__track::after{opacity:var(--mat-slide-toggle-visible-track-opacity, 1);transition:var(--mat-slide-toggle-visible-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::after{opacity:var(--mat-slide-toggle-hidden-track-opacity, 0);transition:var(--mat-slide-toggle-hidden-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-hover-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-focus-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:active .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-pressed-track-color, var(--mat-sys-primary))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::after,.mdc-switch.mdc-switch--disabled .mdc-switch__track::after{background:var(--mat-slide-toggle-disabled-selected-track-color, var(--mat-sys-on-surface))}.mdc-switch__handle-track{height:100%;pointer-events:none;position:absolute;top:0;transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);left:0;right:auto;transform:translateX(0);width:calc(100% - var(--mat-slide-toggle-handle-width))}[dir=rtl] .mdc-switch__handle-track{left:auto;right:0}.mdc-switch--selected .mdc-switch__handle-track{transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch__handle-track{transform:translateX(-100%)}.mdc-switch__handle{display:flex;pointer-events:auto;position:absolute;top:50%;transform:translateY(-50%);left:0;right:auto;transition:width 75ms cubic-bezier(0.4, 0, 0.2, 1),height 75ms cubic-bezier(0.4, 0, 0.2, 1),margin 75ms cubic-bezier(0.4, 0, 0.2, 1);width:var(--mat-slide-toggle-handle-width);height:var(--mat-slide-toggle-handle-height);border-radius:var(--mat-slide-toggle-handle-shape, var(--mat-sys-corner-full))}[dir=rtl] .mdc-switch__handle{left:auto;right:0}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle{width:var(--mat-slide-toggle-unselected-handle-size, 16px);height:var(--mat-slide-toggle-unselected-handle-size, 16px);margin:var(--mat-slide-toggle-unselected-handle-horizontal-margin, 0 8px)}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-slide-toggle-unselected-with-icon-handle-horizontal-margin, 0 4px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle{width:var(--mat-slide-toggle-selected-handle-size, 24px);height:var(--mat-slide-toggle-selected-handle-size, 24px);margin:var(--mat-slide-toggle-selected-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-slide-toggle-selected-with-icon-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch__handle:has(.mdc-switch__icons){width:var(--mat-slide-toggle-with-icon-handle-size, 24px);height:var(--mat-slide-toggle-with-icon-handle-size, 24px)}.mat-mdc-slide-toggle .mdc-switch:active:not(.mdc-switch--disabled) .mdc-switch__handle{width:var(--mat-slide-toggle-pressed-handle-size, 28px);height:var(--mat-slide-toggle-pressed-handle-size, 28px)}.mat-mdc-slide-toggle .mdc-switch--selected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-slide-toggle-selected-pressed-handle-horizontal-margin, 0 22px)}.mat-mdc-slide-toggle .mdc-switch--unselected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-slide-toggle-unselected-pressed-handle-horizontal-margin, 0 2px)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__handle::after{opacity:var(--mat-slide-toggle-disabled-selected-handle-opacity, 1)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__handle::after{opacity:var(--mat-slide-toggle-disabled-unselected-handle-opacity, 0.38)}.mdc-switch__handle::before,.mdc-switch__handle::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";width:100%;height:100%;left:0;position:absolute;top:0;transition:background-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1),border-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);z-index:-1}@media(forced-colors: active){.mdc-switch__handle::before,.mdc-switch__handle::after{border-color:currentColor}}.mdc-switch--selected:enabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-handle-color, var(--mat-sys-on-primary))}.mdc-switch--selected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-hover-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-focus-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:active .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-pressed-handle-color, var(--mat-sys-primary-container))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:hover:not(:focus):not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:focus:not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:active .mdc-switch__handle::after,.mdc-switch--selected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-disabled-selected-handle-color, var(--mat-sys-surface))}.mdc-switch--unselected:enabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-handle-color, var(--mat-sys-outline))}.mdc-switch--unselected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-hover-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-focus-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:active .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-pressed-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-disabled-unselected-handle-color, var(--mat-sys-on-surface))}.mdc-switch__handle::before{background:var(--mat-slide-toggle-handle-surface-color)}.mdc-switch__shadow{border-radius:inherit;bottom:0;left:0;position:absolute;right:0;top:0}.mdc-switch:enabled .mdc-switch__shadow{box-shadow:var(--mat-slide-toggle-handle-elevation-shadow)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__shadow,.mdc-switch.mdc-switch--disabled .mdc-switch__shadow{box-shadow:var(--mat-slide-toggle-disabled-handle-elevation-shadow)}.mdc-switch__ripple{left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);z-index:-1;width:var(--mat-slide-toggle-state-layer-size, 40px);height:var(--mat-slide-toggle-state-layer-size, 40px)}.mdc-switch__ripple::after{content:"";opacity:0}.mdc-switch--disabled .mdc-switch__ripple::after{display:none}.mat-mdc-slide-toggle-disabled-interactive .mdc-switch__ripple::after{display:block}.mdc-switch:hover .mdc-switch__ripple::after{transition:75ms opacity cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:focus .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:active .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:hover:not(:focus) .mdc-switch__ripple::after,.mdc-switch--unselected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-hover-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mdc-switch--unselected:enabled:focus .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-focus-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-switch--unselected:enabled:active .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-pressed-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch--selected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-hover-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mdc-switch--selected:enabled:focus .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-focus-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-switch--selected:enabled:active .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-pressed-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch__icons{position:relative;height:100%;width:100%;z-index:1;transform:translateZ(0)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__icons{opacity:var(--mat-slide-toggle-disabled-unselected-icon-opacity, 0.38)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__icons{opacity:var(--mat-slide-toggle-disabled-selected-icon-opacity, 0.38)}.mdc-switch__icon{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;opacity:0;transition:opacity 30ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-switch--unselected .mdc-switch__icon{width:var(--mat-slide-toggle-unselected-icon-size, 16px);height:var(--mat-slide-toggle-unselected-icon-size, 16px);fill:var(--mat-slide-toggle-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mat-slide-toggle-disabled-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__icon{width:var(--mat-slide-toggle-selected-icon-size, 16px);height:var(--mat-slide-toggle-selected-icon-size, 16px);fill:var(--mat-slide-toggle-selected-icon-color, var(--mat-sys-on-primary-container))}.mdc-switch--selected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mat-slide-toggle-disabled-selected-icon-color, var(--mat-sys-on-surface))}.mdc-switch--selected .mdc-switch__icon--on,.mdc-switch--unselected .mdc-switch__icon--off{opacity:1;transition:opacity 45ms 30ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle{-webkit-user-select:none;user-select:none;display:inline-block;-webkit-tap-highlight-color:rgba(0,0,0,0);outline:0}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple,.mat-mdc-slide-toggle .mdc-switch__ripple::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple:not(:empty),.mat-mdc-slide-toggle .mdc-switch__ripple::after:not(:empty){transform:translateZ(0)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mat-focus-indicator::before{content:""}.mat-mdc-slide-toggle .mat-internal-form-field{color:var(--mat-slide-toggle-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-slide-toggle-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-slide-toggle-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-slide-toggle-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-slide-toggle-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-slide-toggle-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-slide-toggle .mat-ripple-element{opacity:.12}.mat-mdc-slide-toggle .mat-focus-indicator::before{border-radius:50%}.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle-track,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__icon,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::after,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::after{transition:none}.mat-mdc-slide-toggle .mdc-switch:enabled+.mdc-label{cursor:pointer}.mat-mdc-slide-toggle .mdc-switch--disabled+label{color:var(--mat-slide-toggle-disabled-label-text-color, var(--mat-sys-on-surface))}.mat-mdc-slide-toggle-touch-target{position:absolute;top:50%;left:50%;height:var(--mat-slide-toggle-touch-target-size, 48px);width:100%;transform:translate(-50%, -50%);display:var(--mat-slide-toggle-touch-target-display, block)}[dir=rtl] .mat-mdc-slide-toggle-touch-target{left:auto;right:50%;transform:translate(50%, -50%)}
|
|
368
|
+
`],encapsulation:2,changeDetection:0})}return o})(),_l=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({imports:[uo,ae,ae]})}return o})();var uy=(o,t)=>t.code,gy=(o,t)=>t.name+t.lang;function fy(o,t){o&1&&(s(0,"div",15)(1,"mat-icon",32),p(2,"warning"),l(),s(3,"span",33),p(4," Browser notifications have been blocked. To enable them, please reset the site permissions in your browser settings. "),l()())}function _y(o,t){if(o&1&&(s(0,"option",18),p(1),l()),o&2){let e=t.$implicit;w("value",e.code),d(),kn("",e.flag," ",e.label)}}function by(o,t){o&1&&(s(0,"option",25),p(1,"Loading voices..."),l())}function vy(o,t){o&1&&(s(0,"option",25),p(1,"No voice available"),l())}function yy(o,t){if(o&1&&(s(0,"option",18),p(1),l()),o&2){let e=t.$implicit;w("value",e.name+"|"+e.lang),d(),te(" ",e.displayName," ")}}var ma=class o{destroy$=new R;selectedTheme="light";selectedVoiceLanguage="en-US";useEnterToSend=!1;printTechnicalMessages=!1;showTechnicalMessages=!0;showWarningMessages=!0;voiceAnnounceEnabled=!1;voiceMode="speech";voiceReadFullText=!1;voiceVolume=80;voiceRate=120;agentNotificationEnabled=!1;notificationSoundEnabled=!0;browserNotificationEnabled=!1;browserNotificationDenied=!1;availableVoices=[];selectedVoiceId=null;loadingVoices=!1;voiceLanguageOptions=[{code:"fr-FR",label:"Fran\xE7ais",flag:"\u{1F1EB}\u{1F1F7}"},{code:"en-US",label:"English (US)",flag:"\u{1F1FA}\u{1F1F8}"},{code:"en-GB",label:"English (UK)",flag:"\u{1F1EC}\u{1F1E7}"},{code:"es-ES",label:"Espa\xF1ol",flag:"\u{1F1EA}\u{1F1F8}"},{code:"de-DE",label:"Deutsch",flag:"\u{1F1E9}\u{1F1EA}"},{code:"it-IT",label:"Italiano",flag:"\u{1F1EE}\u{1F1F9}"},{code:"pt-BR",label:"Portugu\xEAs",flag:"\u{1F1E7}\u{1F1F7}"},{code:"ja-JP",label:"\u65E5\u672C\u8A9E",flag:"\u{1F1EF}\u{1F1F5}"},{code:"ko-KR",label:"\uD55C\uAD6D\uC5B4",flag:"\u{1F1F0}\u{1F1F7}"},{code:"zh-CN",label:"\u4E2D\u6587 (\u7B80\u4F53)",flag:"\u{1F1E8}\u{1F1F3}"},{code:"ru-RU",label:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",flag:"\u{1F1F7}\u{1F1FA}"},{code:"ar-SA",label:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",flag:"\u{1F1F8}\u{1F1E6}"}];preferencesService=m(nt);voiceSynthesisService=m(rr);themeService=m(_r);ngOnInit(){this.selectedTheme=this.themeService.getCurrentTheme(),this.selectedVoiceLanguage=this.preferencesService.getVoiceLanguage(),this.useEnterToSend=this.preferencesService.getEnterToSend(),this.printTechnicalMessages=this.preferencesService.getPrintTechnicalMessages(),this.showTechnicalMessages=!this.preferencesService.getHideTechnicalMessages(),this.showWarningMessages=!this.preferencesService.getHideWarningMessages(),this.voiceAnnounceEnabled=this.preferencesService.getVoiceAnnounceEnabled(),this.voiceMode=this.preferencesService.getVoiceMode(),this.voiceReadFullText=this.preferencesService.getVoiceReadFullText(),this.voiceVolume=Math.round(this.preferencesService.getVoiceVolume()*100),this.voiceRate=Math.round(this.preferencesService.getVoiceRate()*100),this.selectedVoiceId=this.preferencesService.getSelectedVoice(),this.agentNotificationEnabled=this.preferencesService.getAgentNotificationEnabled(),this.notificationSoundEnabled=this.preferencesService.getNotificationSoundEnabled(),this.browserNotificationEnabled=this.preferencesService.getBrowserNotificationEnabled(),this.loadAvailableVoices(),this.themeService.currentTheme$.pipe(L(this.destroy$)).subscribe(t=>{this.selectedTheme=t}),this.preferencesService.voiceLanguage$.pipe(L(this.destroy$)).subscribe(t=>{this.selectedVoiceLanguage=t}),this.preferencesService.enterToSend$.pipe(L(this.destroy$)).subscribe(t=>{this.useEnterToSend=t}),this.preferencesService.printTechnicalMessages$.pipe(L(this.destroy$)).subscribe(t=>{this.printTechnicalMessages=t}),this.preferencesService.hideTechnicalMessages$.pipe(L(this.destroy$)).subscribe(t=>{this.showTechnicalMessages=!t}),this.preferencesService.hideWarningMessages$.pipe(L(this.destroy$)).subscribe(t=>{this.showWarningMessages=!t}),this.preferencesService.voiceAnnounceEnabled$.pipe(L(this.destroy$)).subscribe(t=>{this.voiceAnnounceEnabled=t}),this.preferencesService.voiceMode$.pipe(L(this.destroy$)).subscribe(t=>{this.voiceMode=t}),this.preferencesService.voiceReadFullText$.pipe(L(this.destroy$)).subscribe(t=>{this.voiceReadFullText=t}),this.preferencesService.voiceVolume$.pipe(L(this.destroy$)).subscribe(t=>{this.voiceVolume=Math.round(t*100)}),this.preferencesService.voiceRate$.pipe(L(this.destroy$)).subscribe(t=>{this.voiceRate=Math.round(t*100)}),this.preferencesService.selectedVoice$.pipe(L(this.destroy$)).subscribe(t=>{this.selectedVoiceId=t}),this.preferencesService.voiceLanguage$.pipe(L(this.destroy$)).subscribe(()=>{this.loadAvailableVoices()}),this.preferencesService.agentNotificationEnabled$.pipe(L(this.destroy$)).subscribe(t=>{this.agentNotificationEnabled=t}),this.preferencesService.notificationSoundEnabled$.pipe(L(this.destroy$)).subscribe(t=>{this.notificationSoundEnabled=t}),this.preferencesService.browserNotificationEnabled$.pipe(L(this.destroy$)).subscribe(t=>{this.browserNotificationEnabled=t,this.checkNotificationPermission()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}onThemeChange(){console.log("[OPTIONS] Theme changed to:",this.selectedTheme),this.themeService.setTheme(this.selectedTheme)}onVoiceLanguageChange(){console.log("[OPTIONS] Voice language changed to:",this.selectedVoiceLanguage),this.preferencesService.setVoiceLanguage(this.selectedVoiceLanguage)}onEnterToSendChange(){console.log("[OPTIONS] Enter to send changed to:",this.useEnterToSend),this.preferencesService.setEnterToSend(this.useEnterToSend)}onPrintTechnicalMessagesChange(){console.log("[OPTIONS] Print technical messages changed to:",this.printTechnicalMessages),this.preferencesService.setPrintTechnicalMessages(this.printTechnicalMessages)}onShowTechnicalMessagesChange(){let t=!this.showTechnicalMessages;console.log("[OPTIONS] Show technical messages changed to:",this.showTechnicalMessages,"(hide:",t,")"),this.preferencesService.setHideTechnicalMessages(t)}onShowWarningMessagesChange(){let t=!this.showWarningMessages;console.log("[OPTIONS] Show warning messages changed to:",this.showWarningMessages,"(hide:",t,")"),this.preferencesService.setHideWarningMessages(t)}onVoiceAnnounceEnabledChange(){console.log("[OPTIONS] Voice announce enabled changed to:",this.voiceAnnounceEnabled),this.preferencesService.setVoiceAnnounceEnabled(this.voiceAnnounceEnabled)}onVoiceModeChange(){console.log("[OPTIONS] Voice mode changed to:",this.voiceMode),this.preferencesService.setVoiceMode(this.voiceMode)}onVoiceReadFullTextChange(){console.log("[OPTIONS] Voice read full text changed to:",this.voiceReadFullText),this.preferencesService.setVoiceReadFullText(this.voiceReadFullText)}onVoiceVolumeChange(){let t=this.voiceVolume/100;console.log("[OPTIONS] Voice volume changed to:",t),this.preferencesService.setVoiceVolume(t)}onVoiceRateChange(){let t=this.voiceRate/100;console.log("[OPTIONS] Voice rate changed to:",t),this.preferencesService.setVoiceRate(t)}loadAvailableVoices(){return ee(this,null,function*(){this.loadingVoices=!0;try{this.availableVoices=yield this.voiceSynthesisService.getVoicesForLanguage(),console.log("[OPTIONS] Loaded",this.availableVoices.length,"voices for current language")}catch(t){console.error("[OPTIONS] Error loading voices:",t),this.availableVoices=[]}finally{this.loadingVoices=!1}})}onSelectedVoiceChange(){console.log("[OPTIONS] Selected voice changed to:",this.selectedVoiceId),this.preferencesService.setSelectedVoice(this.selectedVoiceId)}testVoice(){console.log("[OPTIONS] Testing voice with current settings"),this.voiceSynthesisService.testSelectedVoice()}onAgentNotificationEnabledChange(){console.log("[OPTIONS] Agent notification enabled changed to:",this.agentNotificationEnabled),this.preferencesService.setAgentNotificationEnabled(this.agentNotificationEnabled)}onNotificationSoundEnabledChange(){console.log("[OPTIONS] Notification sound enabled changed to:",this.notificationSoundEnabled),this.preferencesService.setNotificationSoundEnabled(this.notificationSoundEnabled)}onBrowserNotificationEnabledChange(){console.log("[OPTIONS] Browser notification enabled changed to:",this.browserNotificationEnabled),this.preferencesService.setBrowserNotificationEnabled(this.browserNotificationEnabled)}checkNotificationPermission(){"Notification"in window&&(this.browserNotificationDenied=Notification.permission==="denied",console.log("[OPTIONS] Notification permission status:",Notification.permission))}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-options-panel"]],decls:144,vars:35,consts:[[1,"options-content"],[1,"option-section"],[1,"section-title"],[1,"option-group"],[1,"radio-group"],[1,"option-radio"],["type","radio","name","theme","value","light",3,"ngModelChange","change","ngModel"],[1,"radio-mark"],["type","radio","name","theme","value","dark",3,"ngModelChange","change","ngModel"],["type","radio","name","theme","value","system",3,"ngModelChange","change","ngModel"],[1,"option-label"],["type","radio","name","enterBehavior",3,"ngModelChange","change","value","ngModel"],[1,"toggle-option"],["color","primary",3,"ngModelChange","change","ngModel"],["color","primary",3,"ngModelChange","change","ngModel","disabled"],[1,"notification-error"],["for","voice-language-select",1,"option-label"],["id","voice-language-select",1,"option-select",3,"ngModelChange","change","ngModel"],[3,"value"],["type","radio","name","voiceAnnounce",3,"ngModelChange","change","value","ngModel"],["type","radio","name","voiceMode","value","speech",3,"ngModelChange","change","ngModel"],["type","radio","name","voiceMode","value","notification",3,"ngModelChange","change","ngModel"],["type","radio","name","voiceReadFull",3,"ngModelChange","change","value","ngModel"],["for","voice-select",1,"option-label"],["id","voice-select",1,"option-select",3,"ngModelChange","change","ngModel","disabled"],["value",""],["role","button","tabindex","0","title","Test voice with current settings",1,"test-voice-link",3,"click"],[1,"thread-name"],["for","voice-volume-slider",1,"option-label"],["id","voice-volume-slider","type","range","min","0","max","100","step","5",1,"option-slider",3,"ngModelChange","input","ngModel"],["for","voice-rate-slider",1,"option-label"],["id","voice-rate-slider","type","range","min","50","max","200","step","10",1,"option-slider",3,"ngModelChange","input","ngModel"],[1,"error-icon"],[1,"error-message"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"mat-icon"),p(4,"palette"),l(),s(5,"span"),p(6,"Appearance"),l()(),s(7,"div",3)(8,"div",4)(9,"label",5)(10,"input",6),B("ngModelChange",function(r){return j(i.selectedTheme,r)||(i.selectedTheme=r),r}),_("change",function(){return i.onThemeChange()}),l(),I(11,"span",7),p(12," Light "),l(),s(13,"label",5)(14,"input",8),B("ngModelChange",function(r){return j(i.selectedTheme,r)||(i.selectedTheme=r),r}),_("change",function(){return i.onThemeChange()}),l(),I(15,"span",7),p(16," Dark "),l(),s(17,"label",5)(18,"input",9),B("ngModelChange",function(r){return j(i.selectedTheme,r)||(i.selectedTheme=r),r}),_("change",function(){return i.onThemeChange()}),l(),I(19,"span",7),p(20," System "),l()()()(),s(21,"div",1)(22,"div",2)(23,"mat-icon"),p(24,"chat_bubble_outline"),l(),s(25,"span"),p(26,"Messaging"),l()(),s(27,"div",3)(28,"span",10),p(29,"Send message behavior:"),l(),s(30,"div",4)(31,"label",5)(32,"input",11),B("ngModelChange",function(r){return j(i.useEnterToSend,r)||(i.useEnterToSend=r),r}),_("change",function(){return i.onEnterToSendChange()}),l(),I(33,"span",7),p(34," Enter to send "),l(),s(35,"label",5)(36,"input",11),B("ngModelChange",function(r){return j(i.useEnterToSend,r)||(i.useEnterToSend=r),r}),_("change",function(){return i.onEnterToSendChange()}),l(),I(37,"span",7),p(38," Enter for new line "),l()()(),s(39,"div",3)(40,"div",12)(41,"span",10),p(42,"Show technical messages"),l(),s(43,"mat-slide-toggle",13),B("ngModelChange",function(r){return j(i.showTechnicalMessages,r)||(i.showTechnicalMessages=r),r}),_("change",function(){return i.onShowTechnicalMessagesChange()}),l()()(),s(44,"div",3)(45,"div",12)(46,"span",10),p(47,"Show warning messages"),l(),s(48,"mat-slide-toggle",13),B("ngModelChange",function(r){return j(i.showWarningMessages,r)||(i.showWarningMessages=r),r}),_("change",function(){return i.onShowWarningMessagesChange()}),l()()(),s(49,"div",3)(50,"div",12)(51,"span",10),p(52,"Include technical messages in print"),l(),s(53,"mat-slide-toggle",13),B("ngModelChange",function(r){return j(i.printTechnicalMessages,r)||(i.printTechnicalMessages=r),r}),_("change",function(){return i.onPrintTechnicalMessagesChange()}),l()()()(),s(54,"div",1)(55,"div",2)(56,"mat-icon"),p(57,"notifications"),l(),s(58,"span"),p(59,"Notifications"),l()(),s(60,"div",3)(61,"div",12)(62,"span",10),p(63,"Notify when the agent answers or requests input"),l(),s(64,"mat-slide-toggle",13),B("ngModelChange",function(r){return j(i.agentNotificationEnabled,r)||(i.agentNotificationEnabled=r),r}),_("change",function(){return i.onAgentNotificationEnabledChange()}),l()()(),s(65,"div",3)(66,"div",12)(67,"span",10),p(68,"Notification sound"),l(),s(69,"mat-slide-toggle",14),B("ngModelChange",function(r){return j(i.notificationSoundEnabled,r)||(i.notificationSoundEnabled=r),r}),_("change",function(){return i.onNotificationSoundEnabledChange()}),l()()(),s(70,"div",3)(71,"div",12)(72,"span",10),p(73,"Browser notification"),l(),s(74,"mat-slide-toggle",14),B("ngModelChange",function(r){return j(i.browserNotificationEnabled,r)||(i.browserNotificationEnabled=r),r}),_("change",function(){return i.onBrowserNotificationEnabledChange()}),l()(),C(75,fy,5,0,"div",15),l()(),s(76,"div",1)(77,"div",2)(78,"mat-icon"),p(79,"record_voice_over"),l(),s(80,"span"),p(81,"Voice & Speech"),l()(),s(82,"div",3)(83,"label",16),p(84,"Voice recognition language:"),l(),s(85,"select",17),B("ngModelChange",function(r){return j(i.selectedVoiceLanguage,r)||(i.selectedVoiceLanguage=r),r}),_("change",function(){return i.onVoiceLanguageChange()}),xe(86,_y,2,3,"option",18,uy),l()(),s(88,"div",3)(89,"span",10),p(90,"Automatic announcement:"),l(),s(91,"div",4)(92,"label",5)(93,"input",19),B("ngModelChange",function(r){return j(i.voiceAnnounceEnabled,r)||(i.voiceAnnounceEnabled=r),r}),_("change",function(){return i.onVoiceAnnounceEnabledChange()}),l(),I(94,"span",7),p(95," Enabled "),l(),s(96,"label",5)(97,"input",19),B("ngModelChange",function(r){return j(i.voiceAnnounceEnabled,r)||(i.voiceAnnounceEnabled=r),r}),_("change",function(){return i.onVoiceAnnounceEnabledChange()}),l(),I(98,"span",7),p(99," Disabled "),l()()(),s(100,"div",3)(101,"span",10),p(102,"Voice mode:"),l(),s(103,"div",4)(104,"label",5)(105,"input",20),B("ngModelChange",function(r){return j(i.voiceMode,r)||(i.voiceMode=r),r}),_("change",function(){return i.onVoiceModeChange()}),l(),I(106,"span",7),p(107," Voice synthesis "),l(),s(108,"label",5)(109,"input",21),B("ngModelChange",function(r){return j(i.voiceMode,r)||(i.voiceMode=r),r}),_("change",function(){return i.onVoiceModeChange()}),l(),I(110,"span",7),p(111," Sound notification "),l()()(),s(112,"div",3)(113,"span",10),p(114,"Message reading:"),l(),s(115,"div",4)(116,"label",5)(117,"input",22),B("ngModelChange",function(r){return j(i.voiceReadFullText,r)||(i.voiceReadFullText=r),r}),_("change",function(){return i.onVoiceReadFullTextChange()}),l(),I(118,"span",7),p(119," Full message "),l(),s(120,"label",5)(121,"input",22),B("ngModelChange",function(r){return j(i.voiceReadFullText,r)||(i.voiceReadFullText=r),r}),_("change",function(){return i.onVoiceReadFullTextChange()}),l(),I(122,"span",7),p(123," First paragraphs only "),l()()(),s(124,"div",3)(125,"label",23),p(126,"Selected voice:"),l(),s(127,"select",24),B("ngModelChange",function(r){return j(i.selectedVoiceId,r)||(i.selectedVoiceId=r),r}),_("change",function(){return i.onSelectedVoiceChange()}),C(128,by,2,0,"option",25),C(129,vy,2,0,"option",25),xe(130,yy,2,2,"option",18,gy),l(),I(132,"div",10),s(133,"a",26),_("click",function(){return i.testVoice()}),s(134,"span",27),p(135,"Test voice"),l()()(),s(136,"div",3)(137,"label",28),p(138),l(),s(139,"input",29),B("ngModelChange",function(r){return j(i.voiceVolume,r)||(i.voiceVolume=r),r}),_("input",function(){return i.onVoiceVolumeChange()}),l()(),s(140,"div",3)(141,"label",30),p(142),l(),s(143,"input",31),B("ngModelChange",function(r){return j(i.voiceRate,r)||(i.voiceRate=r),r}),_("input",function(){return i.onVoiceRateChange()}),l()()()()),e&2&&(d(10),z("ngModel",i.selectedTheme),d(4),z("ngModel",i.selectedTheme),d(4),z("ngModel",i.selectedTheme),d(14),w("value",!0),z("ngModel",i.useEnterToSend),d(4),w("value",!1),z("ngModel",i.useEnterToSend),d(7),z("ngModel",i.showTechnicalMessages),d(5),z("ngModel",i.showWarningMessages),d(5),z("ngModel",i.printTechnicalMessages),d(11),z("ngModel",i.agentNotificationEnabled),d(5),z("ngModel",i.notificationSoundEnabled),w("disabled",!i.agentNotificationEnabled),d(5),z("ngModel",i.browserNotificationEnabled),w("disabled",!i.agentNotificationEnabled||i.browserNotificationDenied),d(),x(i.browserNotificationDenied?75:-1),d(10),z("ngModel",i.selectedVoiceLanguage),d(),we(i.voiceLanguageOptions),d(7),w("value",!0),z("ngModel",i.voiceAnnounceEnabled),d(4),w("value",!1),z("ngModel",i.voiceAnnounceEnabled),d(8),z("ngModel",i.voiceMode),d(4),z("ngModel",i.voiceMode),d(8),w("value",!0),z("ngModel",i.voiceReadFullText),d(4),w("value",!1),z("ngModel",i.voiceReadFullText),d(6),z("ngModel",i.selectedVoiceId),w("disabled",i.loadingVoices||i.availableVoices.length===0),d(),x(i.loadingVoices?128:-1),d(),x(!i.loadingVoices&&i.availableVoices.length===0?129:-1),d(),we(i.availableVoices),d(8),te("Volume: ",i.voiceVolume,"%"),d(),z("ngModel",i.voiceVolume),d(3),te("Speed: ",i.voiceRate,"%"),d(),z("ngModel",i.voiceRate))},dependencies:[je,es,ts,Le,Um,$m,Ro,Ve,ze,he,uo],styles:['.options-content[_ngcontent-%COMP%]{padding:0;width:100%}.option-group[_ngcontent-%COMP%]{padding:0 1rem 1rem;margin-bottom:1rem;border-bottom:1px solid var(--color-border-light)}.option-group[_ngcontent-%COMP%]:last-child{margin-bottom:0;padding-bottom:0;border-bottom:none}.option-label[_ngcontent-%COMP%]{display:block;margin-bottom:.5rem;font-weight:500;color:var(--color-text);font-size:.875rem}.toggle-option[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:1rem}.toggle-option[_ngcontent-%COMP%] .option-label[_ngcontent-%COMP%]{margin-bottom:0;flex:1}.toggle-option[_ngcontent-%COMP%] mat-slide-toggle[_ngcontent-%COMP%]{flex-shrink:0}.option-select[_ngcontent-%COMP%]{width:100%;padding:.5rem;border:1px solid var(--color-border);border-radius:4px;background:var(--color-input-bg);color:var(--color-text);font-size:.875rem;cursor:pointer}.option-select[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary);box-shadow:0 0 0 3px #7064fb1a}.option-select[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.option-select[_ngcontent-%COMP%] option[_ngcontent-%COMP%]{padding:.5rem}.option-checkbox[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;font-size:.875rem;color:var(--color-text);-webkit-user-select:none;user-select:none}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{display:none}.option-checkbox[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]{width:18px;height:18px;border:2px solid var(--color-border);border-radius:3px;margin-right:.75rem;display:flex;align-items:center;justify-content:center;transition:all .2s ease;flex-shrink:0}.option-checkbox[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]:after{content:"";width:10px;height:6px;border-left:2px solid transparent;border-bottom:2px solid transparent;transform:rotate(-45deg);transition:all .2s ease;opacity:0}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + .checkmark[_ngcontent-%COMP%]{background-color:var(--color-primary);border-color:var(--color-primary)}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + .checkmark[_ngcontent-%COMP%]:after{border-left-color:#fff;border-bottom-color:#fff;opacity:1}.option-checkbox[_ngcontent-%COMP%]:hover .checkmark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-checkbox[_ngcontent-%COMP%]:focus-within .checkmark[_ngcontent-%COMP%]{box-shadow:0 0 0 3px #7064fb1a}.option-section[_ngcontent-%COMP%]{padding-top:1rem;margin-top:1rem;border-top:2px solid var(--color-border)}.option-section[_ngcontent-%COMP%]:first-child{border-top:none;padding-top:0;margin-top:0}.section-title[_ngcontent-%COMP%]{margin:0 0 1rem;padding:0 1rem;font-size:.9rem;font-weight:600;color:var(--color-text);display:flex;align-items:center;gap:.5rem}.section-title[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.option-radio[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;font-size:.875rem;color:var(--color-text);-webkit-user-select:none;user-select:none}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{display:none}.option-radio[_ngcontent-%COMP%] .radio-mark[_ngcontent-%COMP%]{width:16px;height:16px;border:2px solid var(--color-border);border-radius:50%;margin-right:.5rem;display:flex;align-items:center;justify-content:center;transition:all .2s ease;flex-shrink:0;position:relative}.option-radio[_ngcontent-%COMP%] .radio-mark[_ngcontent-%COMP%]:after{content:"";width:8px;height:8px;border-radius:50%;background-color:var(--color-primary);transition:all .2s ease;opacity:0;transform:scale(0)}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + .radio-mark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + .radio-mark[_ngcontent-%COMP%]:after{opacity:1;transform:scale(1)}.option-radio[_ngcontent-%COMP%]:hover .radio-mark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-radio[_ngcontent-%COMP%]:focus-within .radio-mark[_ngcontent-%COMP%]{box-shadow:0 0 0 3px #7064fb1a}.option-slider[_ngcontent-%COMP%]{width:100%;height:6px;border-radius:3px;background:var(--color-bg-solid);outline:none;cursor:pointer;-webkit-appearance:none;appearance:none}.option-slider[_ngcontent-%COMP%]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;border-radius:50%;background:var(--color-primary);cursor:pointer;border:2px solid white;box-shadow:0 2px 6px #0003;transition:all .2s ease}.option-slider[_ngcontent-%COMP%]::-webkit-slider-thumb:hover{transform:scale(1.1);box-shadow:0 2px 8px #0000004d}.option-slider[_ngcontent-%COMP%]::-moz-range-thumb{width:20px;height:20px;border-radius:50%;background:var(--color-primary);cursor:pointer;border:2px solid white;box-shadow:0 2px 6px #0003;transition:all .2s ease}.option-slider[_ngcontent-%COMP%]::-moz-range-thumb:hover{transform:scale(1.1);box-shadow:0 2px 8px #0000004d}.option-slider[_ngcontent-%COMP%]::-webkit-slider-track{height:6px;border-radius:3px;background:var(--color-bg-secondary)}.option-slider[_ngcontent-%COMP%]::-moz-range-track{height:6px;border-radius:3px;background:var(--color-bg-secondary);border:none}.option-slider[_ngcontent-%COMP%]:focus{outline:none}.option-slider[_ngcontent-%COMP%]:focus::-webkit-slider-thumb{box-shadow:0 0 0 3px #7064fb4d,0 2px 6px #0003}.option-slider[_ngcontent-%COMP%]:focus::-moz-range-thumb{box-shadow:0 0 0 3px #7064fb4d,0 2px 6px #0003}.test-voice-btn[_ngcontent-%COMP%]{width:100%;padding:.75rem 1rem;background:var(--color-primary);color:#fff;border:none;border-radius:6px;font-size:.875rem;font-weight:500;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;justify-content:center;gap:.5rem}.test-voice-btn[_ngcontent-%COMP%]:hover{background:var(--color-primary-hover);transform:translateY(-1px);box-shadow:0 2px 8px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:active{transform:translateY(0);box-shadow:0 1px 4px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:focus{outline:none;box-shadow:0 0 0 3px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:disabled{background:var(--color-bg-secondary);color:var(--color-text-secondary);cursor:not-allowed;transform:none;box-shadow:none}.test-voice-link[_ngcontent-%COMP%]{text-decoration-thickness:1.5px;text-underline-offset:3px;background:transparent;border:none;padding:0;font-size:.775rem;font-weight:400;cursor:pointer;transition:all .2s ease;display:inline-flex;align-items:center;justify-content:center;gap:.5rem;text-decoration:underline}.test-voice-link[_ngcontent-%COMP%]:hover{color:var(--color-primary-hover, var(--color-primary));text-decoration-thickness:2px}.test-voice-link[_ngcontent-%COMP%]:active{opacity:.8}.test-voice-link[_ngcontent-%COMP%]:focus{outline:2px solid var(--color-primary);outline-offset:2px}.test-voice-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.notification-error[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem;padding:.75rem;margin-top:.75rem;background-color:#d32f2f1a;border:1px solid rgba(211,47,47,.3);border-radius:6px;font-size:.8125rem;line-height:1.5}.notification-error[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{color:#d32f2f;font-size:20px;width:20px;height:20px;flex-shrink:0;margin-top:2px}.notification-error[_ngcontent-%COMP%] .error-message[_ngcontent-%COMP%]{color:var(--color-text);flex:1}.notification-error[_ngcontent-%COMP%]{margin-top:.75rem;padding:.75rem;background-color:#f443361a;border:1px solid rgba(244,67,54,.3);border-radius:6px;display:flex;align-items:flex-start;gap:.5rem}.notification-error[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{color:#f44336;font-size:20px;width:20px;height:20px;flex-shrink:0;margin-top:2px}.notification-error[_ngcontent-%COMP%] .error-message[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-text);line-height:1.5;flex:1}']})};var Cy=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["ng-component"]],hostAttrs:["cdk-text-field-style-loader",""],decls:0,vars:0,template:function(i,n){},styles:[`textarea.cdk-textarea-autosize{resize:none}textarea.cdk-textarea-autosize-measuring{padding:2px 0 !important;box-sizing:content-box !important;height:auto !important;overflow:hidden !important}textarea.cdk-textarea-autosize-measuring-firefox{padding:2px 0 !important;box-sizing:content-box !important;height:0 !important}@keyframes cdk-text-field-autofill-start{/*!*/}@keyframes cdk-text-field-autofill-end{/*!*/}.cdk-text-field-autofill-monitored:-webkit-autofill{animation:cdk-text-field-autofill-start 0s 1ms}.cdk-text-field-autofill-monitored:not(:-webkit-autofill){animation:cdk-text-field-autofill-end 0s 1ms}
|
|
369
|
+
`],encapsulation:2,changeDetection:0})}return o})(),xy={passive:!0},qu=(()=>{class o{_platform=m(et);_ngZone=m(de);_renderer=m(pi).createRenderer(null,null);_styleLoader=m(Rt);_monitoredElements=new Map;constructor(){}monitor(e){if(!this._platform.isBrowser)return nm;this._styleLoader.load(Cy);let i=Dr(e),n=this._monitoredElements.get(i);if(n)return n.subject;let r=new R,a="cdk-text-field-autofilled",c=g=>{g.animationName==="cdk-text-field-autofill-start"&&!i.classList.contains(a)?(i.classList.add(a),this._ngZone.run(()=>r.next({target:g.target,isAutofilled:!0}))):g.animationName==="cdk-text-field-autofill-end"&&i.classList.contains(a)&&(i.classList.remove(a),this._ngZone.run(()=>r.next({target:g.target,isAutofilled:!1})))},h=this._ngZone.runOutsideAngular(()=>(i.classList.add("cdk-text-field-autofill-monitored"),this._renderer.listen(i,"animationstart",c,xy)));return this._monitoredElements.set(i,{subject:r,unlisten:h}),r}stopMonitoring(e){let i=Dr(e),n=this._monitoredElements.get(i);n&&(n.unlisten(),n.subject.complete(),i.classList.remove("cdk-text-field-autofill-monitored"),i.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(i))}ngOnDestroy(){this._monitoredElements.forEach((e,i)=>this.stopMonitoring(i))}static \u0275fac=function(i){return new(i||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var Gu=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({})}return o})();var Yu=new ne("MAT_INPUT_VALUE_ACCESSOR");var kd=class{_box;_destroyed=new R;_resizeSubject=new R;_resizeObserver;_elementObservables=new Map;constructor(t){this._box=t,typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(e=>this._resizeSubject.next(e)))}observe(t){return this._elementObservables.has(t)||this._elementObservables.set(t,new Oi(e=>{let i=this._resizeSubject.subscribe(e);return this._resizeObserver?.observe(t,{box:this._box}),()=>{this._resizeObserver?.unobserve(t),i.unsubscribe(),this._elementObservables.delete(t)}}).pipe(ce(e=>e.some(i=>i.target===t)),Mr({bufferSize:1,refCount:!0}),L(this._destroyed))),this._elementObservables.get(t)}destroy(){this._destroyed.next(),this._destroyed.complete(),this._resizeSubject.complete(),this._elementObservables.clear()}},Qu=(()=>{class o{_cleanupErrorListener;_observers=new Map;_ngZone=m(de);constructor(){typeof ResizeObserver<"u"}ngOnDestroy(){for(let[,e]of this._observers)e.destroy();this._observers.clear(),this._cleanupErrorListener?.()}observe(e,i){let n=i?.box||"content-box";return this._observers.has(n)||this._observers.set(n,new kd(n)),this._observers.get(n).observe(e)}static \u0275fac=function(i){return new(i||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var wy=["notch"],Sy=["matFormFieldNotchedOutline",""],ky=["*"],Xu=["iconPrefixContainer"],Ku=["textPrefixContainer"],Zu=["iconSuffixContainer"],Ju=["textSuffixContainer"],My=["textField"],Ty=["*",[["mat-label"]],[["","matPrefix",""],["","matIconPrefix",""]],[["","matTextPrefix",""]],[["","matTextSuffix",""]],[["","matSuffix",""],["","matIconSuffix",""]],[["mat-error"],["","matError",""]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],Ey=["*","mat-label","[matPrefix], [matIconPrefix]","[matTextPrefix]","[matTextSuffix]","[matSuffix], [matIconSuffix]","mat-error, [matError]","mat-hint:not([align='end'])","mat-hint[align='end']"];function Py(o,t){o&1&&I(0,"span",21)}function Oy(o,t){if(o&1&&(s(0,"label",20),me(1,1),C(2,Py,1,0,"span",21),l()),o&2){let e=u(2);w("floating",e._shouldLabelFloat())("monitorResize",e._hasOutline())("id",e._labelId),K("for",e._control.disableAutomaticLabeling?null:e._control.id),d(2),x(!e.hideRequiredMarker&&e._control.required?2:-1)}}function Ay(o,t){if(o&1&&C(0,Oy,3,5,"label",20),o&2){let e=u();x(e._hasFloatingLabel()?0:-1)}}function Iy(o,t){o&1&&I(0,"div",7)}function Dy(o,t){}function Ry(o,t){if(o&1&&$e(0,Dy,0,0,"ng-template",13),o&2){u(2);let e=Jt(1);w("ngTemplateOutlet",e)}}function Fy(o,t){if(o&1&&(s(0,"div",9),C(1,Ry,1,1,null,13),l()),o&2){let e=u();w("matFormFieldNotchedOutlineOpen",e._shouldLabelFloat()),d(),x(e._forceDisplayInfixLabel()?-1:1)}}function Ny(o,t){o&1&&(s(0,"div",10,2),me(2,2),l())}function Ly(o,t){o&1&&(s(0,"div",11,3),me(2,3),l())}function Vy(o,t){}function zy(o,t){if(o&1&&$e(0,Vy,0,0,"ng-template",13),o&2){u();let e=Jt(1);w("ngTemplateOutlet",e)}}function jy(o,t){o&1&&(s(0,"div",14,4),me(2,4),l())}function By(o,t){o&1&&(s(0,"div",15,5),me(2,5),l())}function Hy(o,t){o&1&&I(0,"div",16)}function Wy(o,t){o&1&&(s(0,"div",18),me(1,6),l())}function Uy(o,t){if(o&1&&(s(0,"mat-hint",22),p(1),l()),o&2){let e=u(2);w("id",e._hintLabelId),d(),F(e.hintLabel)}}function $y(o,t){if(o&1&&(s(0,"div",19),C(1,Uy,2,2,"mat-hint",22),me(2,7),I(3,"div",23),me(4,8),l()),o&2){let e=u();d(),x(e.hintLabel?1:-1)}}var zt=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["mat-label"]]})}return o})(),qy=new ne("MatError");var yn=(()=>{class o{align="start";id=m(Re).getId("mat-mdc-hint-");static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["mat-hint"]],hostAttrs:[1,"mat-mdc-form-field-hint","mat-mdc-form-field-bottom-align"],hostVars:4,hostBindings:function(i,n){i&2&&(Zt("id",n.id),K("align",null),E("mat-mdc-form-field-hint-end",n.align==="end"))},inputs:{align:"align",id:"id"}})}return o})(),ag=new ne("MatPrefix"),go=(()=>{class o{set _isTextSelector(e){this._isText=!0}_isText=!1;static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["","matPrefix",""],["","matIconPrefix",""],["","matTextPrefix",""]],inputs:{_isTextSelector:[0,"matTextPrefix","_isTextSelector"]},features:[qe([{provide:ag,useExisting:o}])]})}return o})(),Gy=new ne("MatSuffix");var sg=new ne("FloatingLabelParent"),eg=(()=>{class o{_elementRef=m(ie);get floating(){return this._floating}set floating(e){this._floating=e,this.monitorResize&&this._handleResize()}_floating=!1;get monitorResize(){return this._monitorResize}set monitorResize(e){this._monitorResize=e,this._monitorResize?this._subscribeToResize():this._resizeSubscription.unsubscribe()}_monitorResize=!1;_resizeObserver=m(Qu);_ngZone=m(de);_parent=m(sg);_resizeSubscription=new Pi;constructor(){}ngOnDestroy(){this._resizeSubscription.unsubscribe()}getWidth(){return Yy(this._elementRef.nativeElement)}get element(){return this._elementRef.nativeElement}_handleResize(){setTimeout(()=>this._parent._handleLabelResized())}_subscribeToResize(){this._resizeSubscription.unsubscribe(),this._ngZone.runOutsideAngular(()=>{this._resizeSubscription=this._resizeObserver.observe(this._elementRef.nativeElement,{box:"border-box"}).subscribe(()=>this._handleResize())})}static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["label","matFormFieldFloatingLabel",""]],hostAttrs:[1,"mdc-floating-label","mat-mdc-floating-label"],hostVars:2,hostBindings:function(i,n){i&2&&E("mdc-floating-label--float-above",n.floating)},inputs:{floating:"floating",monitorResize:"monitorResize"}})}return o})();function Yy(o){let t=o;if(t.offsetParent!==null)return t.scrollWidth;let e=t.cloneNode(!0);e.style.setProperty("position","absolute"),e.style.setProperty("transform","translate(-9999px, -9999px)"),document.documentElement.appendChild(e);let i=e.scrollWidth;return e.remove(),i}var tg="mdc-line-ripple--active",bl="mdc-line-ripple--deactivating",ig=(()=>{class o{_elementRef=m(ie);_cleanupTransitionEnd;constructor(){let e=m(de),i=m(yt);e.runOutsideAngular(()=>{this._cleanupTransitionEnd=i.listen(this._elementRef.nativeElement,"transitionend",this._handleTransitionEnd)})}activate(){let e=this._elementRef.nativeElement.classList;e.remove(bl),e.add(tg)}deactivate(){this._elementRef.nativeElement.classList.add(bl)}_handleTransitionEnd=e=>{let i=this._elementRef.nativeElement.classList,n=i.contains(bl);e.propertyName==="opacity"&&n&&i.remove(tg,bl)};ngOnDestroy(){this._cleanupTransitionEnd()}static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["div","matFormFieldLineRipple",""]],hostAttrs:[1,"mdc-line-ripple"]})}return o})(),ng=(()=>{class o{_elementRef=m(ie);_ngZone=m(de);open=!1;_notch;ngAfterViewInit(){let e=this._elementRef.nativeElement,i=e.querySelector(".mdc-floating-label");i?(e.classList.add("mdc-notched-outline--upgraded"),typeof requestAnimationFrame=="function"&&(i.style.transitionDuration="0s",this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>i.style.transitionDuration="")}))):e.classList.add("mdc-notched-outline--no-label")}_setNotchWidth(e){let i=this._notch.nativeElement;!this.open||!e?i.style.width="":i.style.width=`calc(${e}px * var(--mat-mdc-form-field-floating-label-scale, 0.75) + 9px)`}_setMaxWidth(e){this._notch.nativeElement.style.setProperty("--mat-form-field-notch-max-width",`calc(100% - ${e}px)`)}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["div","matFormFieldNotchedOutline",""]],viewQuery:function(i,n){if(i&1&&Q(wy,5),i&2){let r;H(r=W())&&(n._notch=r.first)}},hostAttrs:[1,"mdc-notched-outline"],hostVars:2,hostBindings:function(i,n){i&2&&E("mdc-notched-outline--notched",n.open)},inputs:{open:[0,"matFormFieldNotchedOutlineOpen","open"]},attrs:Sy,ngContentSelectors:ky,decls:5,vars:0,consts:[["notch",""],[1,"mat-mdc-notch-piece","mdc-notched-outline__leading"],[1,"mat-mdc-notch-piece","mdc-notched-outline__notch"],[1,"mat-mdc-notch-piece","mdc-notched-outline__trailing"]],template:function(i,n){i&1&&(Be(),Zn(0,"div",1),ii(1,"div",2,0),me(3),ni(),Zn(4,"div",3))},encapsulation:2,changeDetection:0})}return o})(),pa=(()=>{class o{value;stateChanges;id;placeholder;ngControl;focused;empty;shouldLabelFloat;required;disabled;errorState;controlType;autofilled;userAriaDescribedBy;disableAutomaticLabeling;describedByIds;static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o})}return o})();var ha=new ne("MatFormField"),Qy=new ne("MAT_FORM_FIELD_DEFAULT_OPTIONS"),og="fill",Xy="auto",rg="fixed",Ky="translateY(-50%)",jt=(()=>{class o{_elementRef=m(ie);_changeDetectorRef=m(Ge);_platform=m(et);_idGenerator=m(Re);_ngZone=m(de);_defaults=m(Qy,{optional:!0});_currentDirection;_textField;_iconPrefixContainer;_textPrefixContainer;_iconSuffixContainer;_textSuffixContainer;_floatingLabel;_notchedOutline;_lineRipple;_iconPrefixContainerSignal=Ar("iconPrefixContainer");_textPrefixContainerSignal=Ar("textPrefixContainer");_iconSuffixContainerSignal=Ar("iconSuffixContainer");_textSuffixContainerSignal=Ar("textSuffixContainer");_prefixSuffixContainers=hi(()=>[this._iconPrefixContainerSignal(),this._textPrefixContainerSignal(),this._iconSuffixContainerSignal(),this._textSuffixContainerSignal()].map(e=>e?.nativeElement).filter(e=>e!==void 0));_formFieldControl;_prefixChildren;_suffixChildren;_errorChildren;_hintChildren;_labelChild=wm(zt);get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(e){this._hideRequiredMarker=Tt(e)}_hideRequiredMarker=!1;color="primary";get floatLabel(){return this._floatLabel||this._defaults?.floatLabel||Xy}set floatLabel(e){e!==this._floatLabel&&(this._floatLabel=e,this._changeDetectorRef.markForCheck())}_floatLabel;get appearance(){return this._appearanceSignal()}set appearance(e){let i=e||this._defaults?.appearance||og;this._appearanceSignal.set(i)}_appearanceSignal=Ee(og);get subscriptSizing(){return this._subscriptSizing||this._defaults?.subscriptSizing||rg}set subscriptSizing(e){this._subscriptSizing=e||this._defaults?.subscriptSizing||rg}_subscriptSizing=null;get hintLabel(){return this._hintLabel}set hintLabel(e){this._hintLabel=e,this._processHints()}_hintLabel="";_hasIconPrefix=!1;_hasTextPrefix=!1;_hasIconSuffix=!1;_hasTextSuffix=!1;_labelId=this._idGenerator.getId("mat-mdc-form-field-label-");_hintLabelId=this._idGenerator.getId("mat-mdc-hint-");_describedByIds;get _control(){return this._explicitFormFieldControl||this._formFieldControl}set _control(e){this._explicitFormFieldControl=e}_destroyed=new R;_isFocused=null;_explicitFormFieldControl;_previousControl=null;_previousControlValidatorFn=null;_stateChanges;_valueChanges;_describedByChanges;_outlineLabelOffsetResizeObserver=null;_animationsDisabled=He();constructor(){let e=this._defaults,i=m(ft);e&&(e.appearance&&(this.appearance=e.appearance),this._hideRequiredMarker=!!e?.hideRequiredMarker,e.color&&(this.color=e.color)),Or(()=>this._currentDirection=i.valueSignal()),this._syncOutlineLabelOffset()}ngAfterViewInit(){this._updateFocusState(),this._animationsDisabled||this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{this._elementRef.nativeElement.classList.add("mat-form-field-animations-enabled")},300)}),this._changeDetectorRef.detectChanges()}ngAfterContentInit(){this._assertFormFieldControl(),this._initializeSubscript(),this._initializePrefixAndSuffix()}ngAfterContentChecked(){this._assertFormFieldControl(),this._control!==this._previousControl&&(this._initializeControl(this._previousControl),this._control.ngControl&&this._control.ngControl.control&&(this._previousControlValidatorFn=this._control.ngControl.control.validator),this._previousControl=this._control),this._control.ngControl&&this._control.ngControl.control&&this._control.ngControl.control.validator!==this._previousControlValidatorFn&&this._changeDetectorRef.markForCheck()}ngOnDestroy(){this._outlineLabelOffsetResizeObserver?.disconnect(),this._stateChanges?.unsubscribe(),this._valueChanges?.unsubscribe(),this._describedByChanges?.unsubscribe(),this._destroyed.next(),this._destroyed.complete()}getLabelId=hi(()=>this._hasFloatingLabel()?this._labelId:null);getConnectedOverlayOrigin(){return this._textField||this._elementRef}_animateAndLockLabel(){this._hasFloatingLabel()&&(this.floatLabel="always")}_initializeControl(e){let i=this._control,n="mat-mdc-form-field-type-";e&&this._elementRef.nativeElement.classList.remove(n+e.controlType),i.controlType&&this._elementRef.nativeElement.classList.add(n+i.controlType),this._stateChanges?.unsubscribe(),this._stateChanges=i.stateChanges.subscribe(()=>{this._updateFocusState(),this._changeDetectorRef.markForCheck()}),this._describedByChanges?.unsubscribe(),this._describedByChanges=i.stateChanges.pipe(kt([void 0,void 0]),_e(()=>[i.errorState,i.userAriaDescribedBy]),Eo(),ce(([[r,a],[c,h]])=>r!==c||a!==h)).subscribe(()=>this._syncDescribedByIds()),this._valueChanges?.unsubscribe(),i.ngControl&&i.ngControl.valueChanges&&(this._valueChanges=i.ngControl.valueChanges.pipe(L(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()))}_checkPrefixAndSuffixTypes(){this._hasIconPrefix=!!this._prefixChildren.find(e=>!e._isText),this._hasTextPrefix=!!this._prefixChildren.find(e=>e._isText),this._hasIconSuffix=!!this._suffixChildren.find(e=>!e._isText),this._hasTextSuffix=!!this._suffixChildren.find(e=>e._isText)}_initializePrefixAndSuffix(){this._checkPrefixAndSuffixTypes(),Ai(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._checkPrefixAndSuffixTypes(),this._changeDetectorRef.markForCheck()})}_initializeSubscript(){this._hintChildren.changes.subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._validateHints(),this._syncDescribedByIds()}_assertFormFieldControl(){this._control}_updateFocusState(){let e=this._control.focused;e&&!this._isFocused?(this._isFocused=!0,this._lineRipple?.activate()):!e&&(this._isFocused||this._isFocused===null)&&(this._isFocused=!1,this._lineRipple?.deactivate()),this._elementRef.nativeElement.classList.toggle("mat-focused",e),this._textField?.nativeElement.classList.toggle("mdc-text-field--focused",e)}_syncOutlineLabelOffset(){Sm({earlyRead:()=>{if(this._appearanceSignal()!=="outline")return this._outlineLabelOffsetResizeObserver?.disconnect(),null;if(globalThis.ResizeObserver){this._outlineLabelOffsetResizeObserver||=new globalThis.ResizeObserver(()=>{this._writeOutlinedLabelStyles(this._getOutlinedLabelOffset())});for(let e of this._prefixSuffixContainers())this._outlineLabelOffsetResizeObserver.observe(e,{box:"border-box"})}return this._getOutlinedLabelOffset()},write:e=>this._writeOutlinedLabelStyles(e())})}_shouldAlwaysFloat(){return this.floatLabel==="always"}_hasOutline(){return this.appearance==="outline"}_forceDisplayInfixLabel(){return!this._platform.isBrowser&&this._prefixChildren.length&&!this._shouldLabelFloat()}_hasFloatingLabel=hi(()=>!!this._labelChild());_shouldLabelFloat(){return this._hasFloatingLabel()?this._control.shouldLabelFloat||this._shouldAlwaysFloat():!1}_shouldForward(e){let i=this._control?this._control.ngControl:null;return i&&i[e]}_getSubscriptMessageType(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"}_handleLabelResized(){this._refreshOutlineNotchWidth()}_refreshOutlineNotchWidth(){!this._hasOutline()||!this._floatingLabel||!this._shouldLabelFloat()?this._notchedOutline?._setNotchWidth(0):this._notchedOutline?._setNotchWidth(this._floatingLabel.getWidth())}_processHints(){this._validateHints(),this._syncDescribedByIds()}_validateHints(){this._hintChildren}_syncDescribedByIds(){if(this._control){let e=[];if(this._control.userAriaDescribedBy&&typeof this._control.userAriaDescribedBy=="string"&&e.push(...this._control.userAriaDescribedBy.split(" ")),this._getSubscriptMessageType()==="hint"){let r=this._hintChildren?this._hintChildren.find(c=>c.align==="start"):null,a=this._hintChildren?this._hintChildren.find(c=>c.align==="end"):null;r?e.push(r.id):this._hintLabel&&e.push(this._hintLabelId),a&&e.push(a.id)}else this._errorChildren&&e.push(...this._errorChildren.map(r=>r.id));let i=this._control.describedByIds,n;if(i){let r=this._describedByIds||e;n=e.concat(i.filter(a=>a&&!r.includes(a)))}else n=e;this._control.setDescribedByIds(n),this._describedByIds=e}}_getOutlinedLabelOffset(){if(!this._hasOutline()||!this._floatingLabel)return null;if(!this._iconPrefixContainer&&!this._textPrefixContainer)return["",null];if(!this._isAttachedToDom())return null;let e=this._iconPrefixContainer?.nativeElement,i=this._textPrefixContainer?.nativeElement,n=this._iconSuffixContainer?.nativeElement,r=this._textSuffixContainer?.nativeElement,a=e?.getBoundingClientRect().width??0,c=i?.getBoundingClientRect().width??0,h=n?.getBoundingClientRect().width??0,g=r?.getBoundingClientRect().width??0,b=this._currentDirection==="rtl"?"-1":"1",S=`${a+c}px`,N=`calc(${b} * (${S} + var(--mat-mdc-form-field-label-offset-x, 0px)))`,k=`var(--mat-mdc-form-field-label-transform, ${Ky} translateX(${N}))`,A=a+c+h+g;return[k,A]}_writeOutlinedLabelStyles(e){if(e!==null){let[i,n]=e;this._floatingLabel&&(this._floatingLabel.element.style.transform=i),n!==null&&this._notchedOutline?._setMaxWidth(n)}}_isAttachedToDom(){let e=this._elementRef.nativeElement;if(e.getRootNode){let i=e.getRootNode();return i&&i!==e}return document.documentElement.contains(e)}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["mat-form-field"]],contentQueries:function(i,n,r){if(i&1&&(bm(r,n._labelChild,zt,5),Ct(r,pa,5),Ct(r,ag,5),Ct(r,Gy,5),Ct(r,qy,5),Ct(r,yn,5)),i&2){Zl();let a;H(a=W())&&(n._formFieldControl=a.first),H(a=W())&&(n._prefixChildren=a),H(a=W())&&(n._suffixChildren=a),H(a=W())&&(n._errorChildren=a),H(a=W())&&(n._hintChildren=a)}},viewQuery:function(i,n){if(i&1&&(Er(n._iconPrefixContainerSignal,Xu,5),Er(n._textPrefixContainerSignal,Ku,5),Er(n._iconSuffixContainerSignal,Zu,5),Er(n._textSuffixContainerSignal,Ju,5),Q(My,5),Q(Xu,5),Q(Ku,5),Q(Zu,5),Q(Ju,5),Q(eg,5),Q(ng,5),Q(ig,5)),i&2){Zl(4);let r;H(r=W())&&(n._textField=r.first),H(r=W())&&(n._iconPrefixContainer=r.first),H(r=W())&&(n._textPrefixContainer=r.first),H(r=W())&&(n._iconSuffixContainer=r.first),H(r=W())&&(n._textSuffixContainer=r.first),H(r=W())&&(n._floatingLabel=r.first),H(r=W())&&(n._notchedOutline=r.first),H(r=W())&&(n._lineRipple=r.first)}},hostAttrs:[1,"mat-mdc-form-field"],hostVars:38,hostBindings:function(i,n){i&2&&E("mat-mdc-form-field-label-always-float",n._shouldAlwaysFloat())("mat-mdc-form-field-has-icon-prefix",n._hasIconPrefix)("mat-mdc-form-field-has-icon-suffix",n._hasIconSuffix)("mat-form-field-invalid",n._control.errorState)("mat-form-field-disabled",n._control.disabled)("mat-form-field-autofilled",n._control.autofilled)("mat-form-field-appearance-fill",n.appearance=="fill")("mat-form-field-appearance-outline",n.appearance=="outline")("mat-form-field-hide-placeholder",n._hasFloatingLabel()&&!n._shouldLabelFloat())("mat-primary",n.color!=="accent"&&n.color!=="warn")("mat-accent",n.color==="accent")("mat-warn",n.color==="warn")("ng-untouched",n._shouldForward("untouched"))("ng-touched",n._shouldForward("touched"))("ng-pristine",n._shouldForward("pristine"))("ng-dirty",n._shouldForward("dirty"))("ng-valid",n._shouldForward("valid"))("ng-invalid",n._shouldForward("invalid"))("ng-pending",n._shouldForward("pending"))},inputs:{hideRequiredMarker:"hideRequiredMarker",color:"color",floatLabel:"floatLabel",appearance:"appearance",subscriptSizing:"subscriptSizing",hintLabel:"hintLabel"},exportAs:["matFormField"],features:[qe([{provide:ha,useExisting:o},{provide:sg,useExisting:o}])],ngContentSelectors:Ey,decls:18,vars:21,consts:[["labelTemplate",""],["textField",""],["iconPrefixContainer",""],["textPrefixContainer",""],["textSuffixContainer",""],["iconSuffixContainer",""],[1,"mat-mdc-text-field-wrapper","mdc-text-field",3,"click"],[1,"mat-mdc-form-field-focus-overlay"],[1,"mat-mdc-form-field-flex"],["matFormFieldNotchedOutline","",3,"matFormFieldNotchedOutlineOpen"],[1,"mat-mdc-form-field-icon-prefix"],[1,"mat-mdc-form-field-text-prefix"],[1,"mat-mdc-form-field-infix"],[3,"ngTemplateOutlet"],[1,"mat-mdc-form-field-text-suffix"],[1,"mat-mdc-form-field-icon-suffix"],["matFormFieldLineRipple",""],["aria-atomic","true","aria-live","polite",1,"mat-mdc-form-field-subscript-wrapper","mat-mdc-form-field-bottom-align"],[1,"mat-mdc-form-field-error-wrapper"],[1,"mat-mdc-form-field-hint-wrapper"],["matFormFieldFloatingLabel","",3,"floating","monitorResize","id"],["aria-hidden","true",1,"mat-mdc-form-field-required-marker","mdc-floating-label--required"],[3,"id"],[1,"mat-mdc-form-field-hint-spacer"]],template:function(i,n){if(i&1){let r=M();Be(Ty),$e(0,Ay,1,1,"ng-template",null,0,Ra),s(2,"div",6,1),_("click",function(c){return v(r),y(n._control.onContainerClick(c))}),C(4,Iy,1,0,"div",7),s(5,"div",8),C(6,Fy,2,2,"div",9),C(7,Ny,3,0,"div",10),C(8,Ly,3,0,"div",11),s(9,"div",12),C(10,zy,1,1,null,13),me(11),l(),C(12,jy,3,0,"div",14),C(13,By,3,0,"div",15),l(),C(14,Hy,1,0,"div",16),l(),s(15,"div",17),C(16,Wy,2,0,"div",18)(17,$y,5,1,"div",19),l()}if(i&2){let r;d(2),E("mdc-text-field--filled",!n._hasOutline())("mdc-text-field--outlined",n._hasOutline())("mdc-text-field--no-label",!n._hasFloatingLabel())("mdc-text-field--disabled",n._control.disabled)("mdc-text-field--invalid",n._control.errorState),d(2),x(!n._hasOutline()&&!n._control.disabled?4:-1),d(2),x(n._hasOutline()?6:-1),d(),x(n._hasIconPrefix?7:-1),d(),x(n._hasTextPrefix?8:-1),d(2),x(!n._hasOutline()||n._forceDisplayInfixLabel()?10:-1),d(2),x(n._hasTextSuffix?12:-1),d(),x(n._hasIconSuffix?13:-1),d(),x(n._hasOutline()?-1:14),d(),E("mat-mdc-form-field-subscript-dynamic-size",n.subscriptSizing==="dynamic");let a=n._getSubscriptMessageType();d(),x((r=a)==="error"?16:r==="hint"?17:-1)}},dependencies:[eg,ng,La,ig,yn],styles:[`.mdc-text-field{display:inline-flex;align-items:baseline;padding:0 16px;position:relative;box-sizing:border-box;overflow:hidden;will-change:opacity,transform,color;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.mdc-text-field__input{width:100%;min-width:0;border:none;border-radius:0;background:none;padding:0;-moz-appearance:none;-webkit-appearance:none;height:28px}.mdc-text-field__input::-webkit-calendar-picker-indicator,.mdc-text-field__input::-webkit-search-cancel-button{display:none}.mdc-text-field__input::-ms-clear{display:none}.mdc-text-field__input:focus{outline:none}.mdc-text-field__input:invalid{box-shadow:none}.mdc-text-field__input::placeholder{opacity:0}.mdc-text-field__input::-moz-placeholder{opacity:0}.mdc-text-field__input::-webkit-input-placeholder{opacity:0}.mdc-text-field__input:-ms-input-placeholder{opacity:0}.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mdc-text-field--focused .mdc-text-field__input::placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder,.mdc-text-field--focused .mdc-text-field__input::-moz-placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder,.mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{opacity:1}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-moz-placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-webkit-input-placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive:-ms-input-placeholder{opacity:0}.mdc-text-field--outlined .mdc-text-field__input,.mdc-text-field--filled.mdc-text-field--no-label .mdc-text-field__input{height:100%}.mdc-text-field--outlined .mdc-text-field__input{display:flex;border:none !important;background-color:rgba(0,0,0,0)}.mdc-text-field--disabled .mdc-text-field__input{pointer-events:auto}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mat-form-field-filled-input-text-color, var(--mat-sys-on-surface));caret-color:var(--mat-form-field-filled-caret-color, var(--mat-sys-primary))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mat-form-field-outlined-input-text-color, var(--mat-sys-on-surface));caret-color:var(--mat-form-field-outlined-caret-color, var(--mat-sys-primary))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mat-form-field-filled-error-caret-color, var(--mat-sys-error))}.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mat-form-field-outlined-error-caret-color, var(--mat-sys-error))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-text-field__input{color:var(--mat-form-field-filled-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-text-field__input{color:var(--mat-form-field-outlined-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-text-field--disabled .mdc-text-field__input{background-color:Window}}.mdc-text-field--filled{height:56px;border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-left-radius:var(--mat-form-field-filled-container-shape, var(--mat-sys-corner-extra-small));border-top-right-radius:var(--mat-form-field-filled-container-shape, var(--mat-sys-corner-extra-small))}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:var(--mat-form-field-filled-container-color, var(--mat-sys-surface-variant))}.mdc-text-field--filled.mdc-text-field--disabled{background-color:var(--mat-form-field-filled-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 4%, transparent))}.mdc-text-field--outlined{height:56px;overflow:visible;padding-right:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)));padding-left:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)) + 4px)}[dir=rtl] .mdc-text-field--outlined{padding-right:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)) + 4px);padding-left:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)))}.mdc-floating-label{position:absolute;left:0;transform-origin:left top;line-height:1.15rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform}[dir=rtl] .mdc-floating-label{right:0;left:auto;transform-origin:right top;text-align:right}.mdc-text-field .mdc-floating-label{top:50%;transform:translateY(-50%);pointer-events:none}.mdc-notched-outline .mdc-floating-label{display:inline-block;position:relative;max-width:100%}.mdc-text-field--outlined .mdc-floating-label{left:4px;right:auto}[dir=rtl] .mdc-text-field--outlined .mdc-floating-label{left:auto;right:4px}.mdc-text-field--filled .mdc-floating-label{left:16px;right:auto}[dir=rtl] .mdc-text-field--filled .mdc-floating-label{left:auto;right:16px}.mdc-text-field--disabled .mdc-floating-label{cursor:default}@media(forced-colors: active){.mdc-text-field--disabled .mdc-floating-label{z-index:1}}.mdc-text-field--filled.mdc-text-field--no-label .mdc-floating-label{display:none}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-floating-label{color:var(--mat-form-field-filled-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-filled-focus-label-text-color, var(--mat-sys-primary))}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label{color:var(--mat-form-field-filled-hover-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-floating-label{color:var(--mat-form-field-filled-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label{color:var(--mat-form-field-filled-error-label-text-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-filled-error-focus-label-text-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label{color:var(--mat-form-field-filled-error-hover-label-text-color, var(--mat-sys-on-error-container))}.mdc-text-field--filled .mdc-floating-label{font-family:var(--mat-form-field-filled-label-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-form-field-filled-label-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-form-field-filled-label-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-form-field-filled-label-text-tracking, var(--mat-sys-body-large-tracking))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-floating-label{color:var(--mat-form-field-outlined-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-outlined-focus-label-text-color, var(--mat-sys-primary))}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label{color:var(--mat-form-field-outlined-hover-label-text-color, var(--mat-sys-on-surface))}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-floating-label{color:var(--mat-form-field-outlined-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label{color:var(--mat-form-field-outlined-error-label-text-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-outlined-error-focus-label-text-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label{color:var(--mat-form-field-outlined-error-hover-label-text-color, var(--mat-sys-on-error-container))}.mdc-text-field--outlined .mdc-floating-label{font-family:var(--mat-form-field-outlined-label-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-form-field-outlined-label-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-form-field-outlined-label-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-form-field-outlined-label-text-tracking, var(--mat-sys-body-large-tracking))}.mdc-floating-label--float-above{cursor:auto;transform:translateY(-106%) scale(0.75)}.mdc-text-field--filled .mdc-floating-label--float-above{transform:translateY(-106%) scale(0.75)}.mdc-text-field--outlined .mdc-floating-label--float-above{transform:translateY(-37.25px) scale(1);font-size:.75rem}.mdc-notched-outline .mdc-floating-label--float-above{text-overflow:clip}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:133.3333333333%}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) scale(0.75)}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:1px;margin-right:0;content:"*"}[dir=rtl] .mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:0;margin-right:1px}.mdc-notched-outline{display:flex;position:absolute;top:0;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] .mdc-notched-outline{text-align:right}.mdc-text-field--outlined .mdc-notched-outline{z-index:1}.mat-mdc-notch-piece{box-sizing:border-box;height:100%;pointer-events:none;border-top:1px solid;border-bottom:1px solid}.mdc-text-field--focused .mat-mdc-notch-piece{border-width:2px}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-outline-color, var(--mat-sys-outline));border-width:var(--mat-form-field-outlined-outline-width, 1px)}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-hover-outline-color, var(--mat-sys-on-surface))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-focus-outline-color, var(--mat-sys-primary))}.mdc-text-field--outlined.mdc-text-field--disabled .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-outline-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-notched-outline .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-hover-outline-color, var(--mat-sys-on-error-container))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-focus-outline-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline .mat-mdc-notch-piece{border-width:var(--mat-form-field-outlined-focus-outline-width, 2px)}.mdc-notched-outline__leading{border-left:1px solid;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading{width:max(12px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)))}[dir=rtl] .mdc-notched-outline__leading{border-left:none;border-right:1px solid;border-bottom-left-radius:0;border-top-left-radius:0;border-top-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-notched-outline__trailing{flex-grow:1;border-left:none;border-right:1px solid;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}[dir=rtl] .mdc-notched-outline__trailing{border-left:1px solid;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-notched-outline__notch{flex:0 0 auto;width:auto}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__notch{max-width:min(var(--mat-form-field-notch-max-width, 100%),calc(100% - max(12px, var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))) * 2))}.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{max-width:min(100%,calc(100% - max(12px, var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))) * 2))}.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:1px}.mdc-text-field--focused.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:2px}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:0;padding-right:8px;border-top:none}[dir=rtl] .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:8px;padding-right:0}.mdc-notched-outline--no-label .mdc-notched-outline__notch{display:none}.mdc-line-ripple::before,.mdc-line-ripple::after{position:absolute;bottom:0;left:0;width:100%;border-bottom-style:solid;content:""}.mdc-line-ripple::before{z-index:1;border-bottom-width:var(--mat-form-field-filled-active-indicator-height, 1px)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-active-indicator-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-hover-active-indicator-color, var(--mat-sys-on-surface))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-disabled-active-indicator-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-error-active-indicator-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-error-hover-active-indicator-color, var(--mat-sys-on-error-container))}.mdc-line-ripple::after{transform:scaleX(0);opacity:0;z-index:2}.mdc-text-field--filled .mdc-line-ripple::after{border-bottom-width:var(--mat-form-field-filled-focus-active-indicator-height, 2px)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mat-form-field-filled-focus-active-indicator-color, var(--mat-sys-primary))}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mat-form-field-filled-error-focus-active-indicator-color, var(--mat-sys-error))}.mdc-line-ripple--active::after{transform:scaleX(1);opacity:1}.mdc-line-ripple--deactivating::after{opacity:0}.mdc-text-field--disabled{pointer-events:none}.mat-mdc-form-field-textarea-control{vertical-align:middle;resize:vertical;box-sizing:border-box;height:auto;margin:0;padding:0;border:none;overflow:auto}.mat-mdc-form-field-input-control.mat-mdc-form-field-input-control{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font:inherit;letter-spacing:inherit;text-decoration:inherit;text-transform:inherit;border:none}.mat-mdc-form-field .mat-mdc-floating-label.mdc-floating-label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;line-height:normal;pointer-events:all;will-change:auto}.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-floating-label.mdc-floating-label{cursor:inherit}.mdc-text-field--no-label:not(.mdc-text-field--textarea) .mat-mdc-form-field-input-control.mdc-text-field__input,.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control{height:auto}.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control.mdc-text-field__input[type=color]{height:23px}.mat-mdc-text-field-wrapper{height:auto;flex:auto;will-change:auto}.mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-left:0;--mat-mdc-form-field-label-offset-x: -16px}.mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-right:0}[dir=rtl] .mat-mdc-text-field-wrapper{padding-left:16px;padding-right:16px}[dir=rtl] .mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-left:0}[dir=rtl] .mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-right:0}.mat-form-field-disabled .mdc-text-field__input::placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-label-always-float .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms;opacity:1}.mat-mdc-text-field-wrapper .mat-mdc-form-field-infix .mat-mdc-floating-label{left:auto;right:auto}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-text-field__input{display:inline-block}.mat-mdc-form-field .mat-mdc-text-field-wrapper.mdc-text-field .mdc-notched-outline__notch{padding-top:0}.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:1px solid rgba(0,0,0,0)}[dir=rtl] .mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:none;border-right:1px solid rgba(0,0,0,0)}.mat-mdc-form-field-infix{min-height:var(--mat-form-field-container-height, 56px);padding-top:var(--mat-form-field-filled-with-label-container-padding-top, 24px);padding-bottom:var(--mat-form-field-filled-with-label-container-padding-bottom, 8px)}.mdc-text-field--outlined .mat-mdc-form-field-infix,.mdc-text-field--no-label .mat-mdc-form-field-infix{padding-top:var(--mat-form-field-container-vertical-padding, 16px);padding-bottom:var(--mat-form-field-container-vertical-padding, 16px)}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:calc(var(--mat-form-field-container-height, 56px)/2)}.mdc-text-field--filled .mat-mdc-floating-label{display:var(--mat-form-field-filled-label-display, block)}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{--mat-mdc-form-field-label-transform: translateY(calc(calc(6.75px + var(--mat-form-field-container-height, 56px) / 2) * -1)) scale(var(--mat-mdc-form-field-floating-label-scale, 0.75));transform:var(--mat-mdc-form-field-label-transform)}@keyframes _mat-form-field-subscript-animation{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}.mat-mdc-form-field-subscript-wrapper{box-sizing:border-box;width:100%;position:relative}.mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-error-wrapper{position:absolute;top:0;left:0;right:0;padding:0 16px;opacity:1;transform:translateY(0);animation:_mat-form-field-subscript-animation 0ms cubic-bezier(0.55, 0, 0.55, 0.2)}.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-error-wrapper{position:static}.mat-mdc-form-field-bottom-align::before{content:"";display:inline-block;height:16px}.mat-mdc-form-field-bottom-align.mat-mdc-form-field-subscript-dynamic-size::before{content:unset}.mat-mdc-form-field-hint-end{order:1}.mat-mdc-form-field-hint-wrapper{display:flex}.mat-mdc-form-field-hint-spacer{flex:1 0 1em}.mat-mdc-form-field-error{display:block;color:var(--mat-form-field-error-text-color, var(--mat-sys-error))}.mat-mdc-form-field-subscript-wrapper,.mat-mdc-form-field-bottom-align::before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-subscript-text-font, var(--mat-sys-body-small-font));line-height:var(--mat-form-field-subscript-text-line-height, var(--mat-sys-body-small-line-height));font-size:var(--mat-form-field-subscript-text-size, var(--mat-sys-body-small-size));letter-spacing:var(--mat-form-field-subscript-text-tracking, var(--mat-sys-body-small-tracking));font-weight:var(--mat-form-field-subscript-text-weight, var(--mat-sys-body-small-weight))}.mat-mdc-form-field-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;opacity:0;pointer-events:none;background-color:var(--mat-form-field-state-layer-color, var(--mat-sys-on-surface))}.mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-form-field.mat-focused .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-focus-state-layer-opacity, 0)}select.mat-mdc-form-field-input-control{-moz-appearance:none;-webkit-appearance:none;background-color:rgba(0,0,0,0);display:inline-flex;box-sizing:border-box}select.mat-mdc-form-field-input-control:not(:disabled){cursor:pointer}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option{color:var(--mat-form-field-select-option-text-color, var(--mat-sys-neutral10))}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option:disabled{color:var(--mat-form-field-select-disabled-option-text-color, color-mix(in srgb, var(--mat-sys-neutral10) 38%, transparent))}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{content:"";width:0;height:0;border-left:5px solid rgba(0,0,0,0);border-right:5px solid rgba(0,0,0,0);border-top:5px solid;position:absolute;right:0;top:50%;margin-top:-2.5px;pointer-events:none;color:var(--mat-form-field-enabled-select-arrow-color, var(--mat-sys-on-surface-variant))}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{right:auto;left:0}.mat-mdc-form-field-type-mat-native-select.mat-focused .mat-mdc-form-field-infix::after{color:var(--mat-form-field-focus-select-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field-type-mat-native-select.mat-form-field-disabled .mat-mdc-form-field-infix::after{color:var(--mat-form-field-disabled-select-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:15px}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:0;padding-left:15px}@media(forced-colors: active){.mat-form-field-appearance-fill .mat-mdc-text-field-wrapper{outline:solid 1px}}@media(forced-colors: active){.mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-text-field-wrapper{outline-color:GrayText}}@media(forced-colors: active){.mat-form-field-appearance-fill.mat-focused .mat-mdc-text-field-wrapper{outline:dashed 3px}}@media(forced-colors: active){.mat-mdc-form-field.mat-focused .mdc-notched-outline{border:dashed 3px}}.mat-mdc-form-field-input-control[type=date],.mat-mdc-form-field-input-control[type=datetime],.mat-mdc-form-field-input-control[type=datetime-local],.mat-mdc-form-field-input-control[type=month],.mat-mdc-form-field-input-control[type=week],.mat-mdc-form-field-input-control[type=time]{line-height:1}.mat-mdc-form-field-input-control::-webkit-datetime-edit{line-height:1;padding:0;margin-bottom:-2px}.mat-mdc-form-field{--mat-mdc-form-field-floating-label-scale: 0.75;display:inline-flex;flex-direction:column;min-width:0;text-align:left;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-container-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-form-field-container-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-form-field-container-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-form-field-container-text-tracking, var(--mat-sys-body-large-tracking));font-weight:var(--mat-form-field-container-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-floating-label--float-above{font-size:calc(var(--mat-form-field-outlined-label-text-populated-size)*var(--mat-mdc-form-field-floating-label-scale))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:var(--mat-form-field-outlined-label-text-populated-size)}[dir=rtl] .mat-mdc-form-field{text-align:right}.mat-mdc-form-field-flex{display:inline-flex;align-items:baseline;box-sizing:border-box;width:100%}.mat-mdc-text-field-wrapper{width:100%;z-index:0}.mat-mdc-form-field-icon-prefix,.mat-mdc-form-field-icon-suffix{align-self:center;line-height:0;pointer-events:auto;position:relative;z-index:1}.mat-mdc-form-field-icon-prefix>.mat-icon,.mat-mdc-form-field-icon-suffix>.mat-icon{padding:0 12px;box-sizing:content-box}.mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-leading-icon-color, var(--mat-sys-on-surface-variant))}.mat-form-field-disabled .mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-disabled-leading-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-trailing-icon-color, var(--mat-sys-on-surface-variant))}.mat-form-field-disabled .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-disabled-trailing-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-invalid .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-trailing-icon-color, var(--mat-sys-error))}.mat-form-field-invalid:not(.mat-focused):not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-hover-trailing-icon-color, var(--mat-sys-on-error-container))}.mat-form-field-invalid.mat-focused .mat-mdc-text-field-wrapper .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-focus-trailing-icon-color, var(--mat-sys-error))}.mat-mdc-form-field-icon-prefix,[dir=rtl] .mat-mdc-form-field-icon-suffix{padding:0 4px 0 0}.mat-mdc-form-field-icon-suffix,[dir=rtl] .mat-mdc-form-field-icon-prefix{padding:0 0 0 4px}.mat-mdc-form-field-subscript-wrapper .mat-icon,.mat-mdc-form-field label .mat-icon{width:1em;height:1em;font-size:inherit}.mat-mdc-form-field-infix{flex:auto;min-width:0;width:180px;position:relative;box-sizing:border-box}.mat-mdc-form-field-infix:has(textarea[cols]){width:auto}.mat-mdc-form-field .mdc-notched-outline__notch{margin-left:-1px;-webkit-clip-path:inset(-9em -999em -9em 1px);clip-path:inset(-9em -999em -9em 1px)}[dir=rtl] .mat-mdc-form-field .mdc-notched-outline__notch{margin-left:0;margin-right:-1px;-webkit-clip-path:inset(-9em 1px -9em -999em);clip-path:inset(-9em 1px -9em -999em)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-floating-label{transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input{transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::-moz-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::-webkit-input-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input:-ms-input-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::-moz-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field--filled:not(.mdc-ripple-upgraded):focus .mdc-text-field__ripple::before{transition-duration:75ms}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-line-ripple::after{transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field.mat-form-field-animations-enabled .mat-mdc-form-field-error-wrapper{animation-duration:300ms}.mdc-notched-outline .mdc-floating-label{max-width:calc(100% + 1px)}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:calc(133.3333333333% + 1px)}
|
|
370
|
+
`],encapsulation:2,changeDetection:0})}return o})();var vl=(()=>{class o{isErrorState(e,i){return!!(e&&e.invalid&&(e.touched||i&&i.submitted))}static \u0275fac=function(i){return new(i||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var br=class{_defaultMatcher;ngControl;_parentFormGroup;_parentForm;_stateChanges;errorState=!1;matcher;constructor(t,e,i,n,r){this._defaultMatcher=t,this.ngControl=e,this._parentFormGroup=i,this._parentForm=n,this._stateChanges=r}updateErrorState(){let t=this.errorState,e=this._parentFormGroup||this._parentForm,i=this.matcher||this._defaultMatcher,n=this.ngControl?this.ngControl.control:null,r=i?.isErrorState(n,e)??!1;r!==t&&(this.errorState=r,this._stateChanges.next())}};var ct=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({imports:[ae,Nm,jt,ae]})}return o})();var Zy=["button","checkbox","file","hidden","image","radio","range","reset","submit"],Jy=new ne("MAT_INPUT_CONFIG"),di=(()=>{class o{_elementRef=m(ie);_platform=m(et);ngControl=m(Xa,{optional:!0,self:!0});_autofillMonitor=m(qu);_ngZone=m(de);_formField=m(ha,{optional:!0});_renderer=m(yt);_uid=m(Re).getId("mat-input-");_previousNativeValue;_inputValueAccessor;_signalBasedValueAccessor;_previousPlaceholder;_errorStateTracker;_config=m(Jy,{optional:!0});_cleanupIosKeyup;_cleanupWebkitWheel;_isServer;_isNativeSelect;_isTextarea;_isInFormField;focused=!1;stateChanges=new R;controlType="mat-input";autofilled=!1;get disabled(){return this._disabled}set disabled(e){this._disabled=Tt(e),this.focused&&(this.focused=!1,this.stateChanges.next())}_disabled=!1;get id(){return this._id}set id(e){this._id=e||this._uid}_id;placeholder;name;get required(){return this._required??this.ngControl?.control?.hasValidator(Qa.required)??!1}set required(e){this._required=Tt(e)}_required;get type(){return this._type}set type(e){this._type=e||"text",this._validateType(),!this._isTextarea&&ic().has(this._type)&&(this._elementRef.nativeElement.type=this._type)}_type="text";get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}userAriaDescribedBy;get value(){return this._signalBasedValueAccessor?this._signalBasedValueAccessor.value():this._inputValueAccessor.value}set value(e){e!==this.value&&(this._signalBasedValueAccessor?this._signalBasedValueAccessor.value.set(e):this._inputValueAccessor.value=e,this.stateChanges.next())}get readonly(){return this._readonly}set readonly(e){this._readonly=Tt(e)}_readonly=!1;disabledInteractive;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}_neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(e=>ic().has(e));constructor(){let e=m(Ka,{optional:!0}),i=m(Ja,{optional:!0}),n=m(vl),r=m(Yu,{optional:!0,self:!0}),a=this._elementRef.nativeElement,c=a.nodeName.toLowerCase();r?Ia(r.value)?this._signalBasedValueAccessor=r:this._inputValueAccessor=r:this._inputValueAccessor=a,this._previousNativeValue=this.value,this.id=this.id,this._platform.IOS&&this._ngZone.runOutsideAngular(()=>{this._cleanupIosKeyup=this._renderer.listen(a,"keyup",this._iOSKeyupListener)}),this._errorStateTracker=new br(n,this.ngControl,i,e,this.stateChanges),this._isServer=!this._platform.isBrowser,this._isNativeSelect=c==="select",this._isTextarea=c==="textarea",this._isInFormField=!!this._formField,this.disabledInteractive=this._config?.disabledInteractive||!1,this._isNativeSelect&&(this.controlType=a.multiple?"mat-native-select-multiple":"mat-native-select"),this._signalBasedValueAccessor&&Or(()=>{this._signalBasedValueAccessor.value(),this.stateChanges.next()})}ngAfterViewInit(){this._platform.isBrowser&&this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(e=>{this.autofilled=e.isAutofilled,this.stateChanges.next()})}ngOnChanges(){this.stateChanges.next()}ngOnDestroy(){this.stateChanges.complete(),this._platform.isBrowser&&this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement),this._cleanupIosKeyup?.(),this._cleanupWebkitWheel?.()}ngDoCheck(){this.ngControl&&(this.updateErrorState(),this.ngControl.disabled!==null&&this.ngControl.disabled!==this.disabled&&(this.disabled=this.ngControl.disabled,this.stateChanges.next())),this._dirtyCheckNativeValue(),this._dirtyCheckPlaceholder()}focus(e){this._elementRef.nativeElement.focus(e)}updateErrorState(){this._errorStateTracker.updateErrorState()}_focusChanged(e){if(e!==this.focused){if(!this._isNativeSelect&&e&&this.disabled&&this.disabledInteractive){let i=this._elementRef.nativeElement;i.type==="number"?(i.type="text",i.setSelectionRange(0,0),i.type="number"):i.setSelectionRange(0,0)}this.focused=e,this.stateChanges.next()}}_onInput(){}_dirtyCheckNativeValue(){let e=this._elementRef.nativeElement.value;this._previousNativeValue!==e&&(this._previousNativeValue=e,this.stateChanges.next())}_dirtyCheckPlaceholder(){let e=this._getPlaceholder();if(e!==this._previousPlaceholder){let i=this._elementRef.nativeElement;this._previousPlaceholder=e,e?i.setAttribute("placeholder",e):i.removeAttribute("placeholder")}}_getPlaceholder(){return this.placeholder||null}_validateType(){Zy.indexOf(this._type)>-1}_isNeverEmpty(){return this._neverEmptyInputTypes.indexOf(this._type)>-1}_isBadInput(){let e=this._elementRef.nativeElement.validity;return e&&e.badInput}get empty(){return!this._isNeverEmpty()&&!this._elementRef.nativeElement.value&&!this._isBadInput()&&!this.autofilled}get shouldLabelFloat(){if(this._isNativeSelect){let e=this._elementRef.nativeElement,i=e.options[0];return this.focused||e.multiple||!this.empty||!!(e.selectedIndex>-1&&i&&i.label)}else return this.focused&&!this.disabled||!this.empty}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){let i=this._elementRef.nativeElement;e.length?i.setAttribute("aria-describedby",e.join(" ")):i.removeAttribute("aria-describedby")}onContainerClick(){this.focused||this.focus()}_isInlineSelect(){let e=this._elementRef.nativeElement;return this._isNativeSelect&&(e.multiple||e.size>1)}_iOSKeyupListener=e=>{let i=e.target;!i.value&&i.selectionStart===0&&i.selectionEnd===0&&(i.setSelectionRange(1,1),i.setSelectionRange(0,0))};_getReadonlyAttribute(){return this._isNativeSelect?null:this.readonly||this.disabled&&this.disabledInteractive?"true":null}static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-mdc-input-element"],hostVars:21,hostBindings:function(i,n){i&1&&_("focus",function(){return n._focusChanged(!0)})("blur",function(){return n._focusChanged(!1)})("input",function(){return n._onInput()}),i&2&&(Zt("id",n.id)("disabled",n.disabled&&!n.disabledInteractive)("required",n.required),K("name",n.name||null)("readonly",n._getReadonlyAttribute())("aria-disabled",n.disabled&&n.disabledInteractive?"true":null)("aria-invalid",n.empty&&n.required?null:n.errorState)("aria-required",n.required)("id",n.id),E("mat-input-server",n._isServer)("mat-mdc-form-field-textarea-control",n._isInFormField&&n._isTextarea)("mat-mdc-form-field-input-control",n._isInFormField)("mat-mdc-input-disabled-interactive",n.disabledInteractive)("mdc-text-field__input",n._isInFormField)("mat-mdc-native-select-inline",n._isInlineSelect()))},inputs:{disabled:"disabled",id:"id",placeholder:"placeholder",name:"name",required:"required",type:"type",errorStateMatcher:"errorStateMatcher",userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],value:"value",readonly:"readonly",disabledInteractive:[2,"disabledInteractive","disabledInteractive",J]},exportAs:["matInput"],features:[qe([{provide:pa,useExisting:o}]),tt]})}return o})(),Xt=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({imports:[ae,ct,ct,Gu,ae]})}return o})();var eC=(o,t)=>t.label,tC=(o,t)=>t.id;function iC(o,t){o&1&&(s(0,"div",3),I(1,"span",4),s(2,"span",5),p(3,"Loading threads..."),l()())}function nC(o,t){if(o&1&&(s(0,"div",18),p(1),l()),o&2){let e=u(6);d(),F(e.renameErrorMessage)}}function oC(o,t){if(o&1){let e=M();s(0,"div",11)(1,"input",17),B("ngModelChange",function(n){v(e);let r=u(5);return j(r.editingThreadName,n)||(r.editingThreadName=n),y(n)}),_("keydown",function(n){v(e);let r=u(5);return y(r.onEditKeydown(n))})("blur",function(){v(e);let n=u(5);return y(n.onEditBlur())})("click",function(n){return v(e),y(n.stopPropagation())}),l(),C(2,nC,2,1,"div",18),l()}if(o&2){let e=u(5);d(),z("ngModel",e.editingThreadName),w("disabled",e.isRenamingThread),d(),x(e.renameErrorMessage?2:-1)}}function rC(o,t){if(o&1&&(s(0,"span",20),p(1),l()),o&2){let e=u(2).$implicit;d(),F(e.name)}}function aC(o,t){o&1&&(I(0,"mat-spinner",22),s(1,"span",23),p(2,"Generating name..."),l()),o&2&&w("diameter",16)}function sC(o,t){o&1&&(s(0,"mat-icon",21),p(1,"group"),l())}function lC(o,t){if(o&1){let e=M();s(0,"a",19),_("click",function(n){v(e);let r=u().$implicit;return u(4).selectThread(r.id),y(n.preventDefault())})("keydown.enter",function(n){v(e);let r=u().$implicit;return u(4).selectThread(r.id),y(n.preventDefault())})("keydown.space",function(n){v(e);let r=u().$implicit;return u(4).selectThread(r.id),y(n.preventDefault())}),C(1,rC,2,1,"span",20)(2,aC,3,1),C(3,sC,2,0,"mat-icon",21),l()}if(o&2){let e=u().$implicit,i=u(4);w("matTooltip",e.name?e.name+`
|
|
371
|
+
|
|
372
|
+
`+(e.summary||""):e.summary||"")("matTooltipDisabled",!e.summary),d(),x(e.name?1:2),d(2),x(i.isSharedThread(e)?3:-1)}}function cC(o,t){if(o&1){let e=M();s(0,"button",24),_("click",function(n){v(e);let r=u().$implicit,a=u(4);return y(a.startEditingThreadName(n,r))}),s(1,"mat-icon"),p(2,"edit"),l()()}}function dC(o,t){if(o&1){let e=M();s(0,"div",10),C(1,oC,3,3,"div",11)(2,lC,4,4,"a",12),s(3,"div",13),C(4,cC,3,0,"button",14),s(5,"button",15),_("click",function(n){let r=v(e).$implicit,a=u(4);return y(a.toggleStar(n,r))}),s(6,"mat-icon"),p(7),l()(),s(8,"button",16),_("click",function(n){let r=v(e).$implicit,a=u(4);return y(a.deleteThread(n,r))}),s(9,"mat-icon"),p(10,"delete"),l()()()()}if(o&2){let e,i=t.$implicit,n=u(4);E("current",i.id===((e=n.currentThread())==null?null:e.id)),d(),x(n.editingThreadId===i.id?1:2),d(3),x(n.editingThreadId!==i.id&&i.name?4:-1),d(),E("starred",n.isStarred(i)),w("title",n.isStarred(i)?"Unstar thread":"Star thread"),d(2),F(n.isStarred(i)?"star":"star_outline")}}function mC(o,t){if(o&1&&(s(0,"div",6)(1,"div",8),p(2),l(),xe(3,dC,11,8,"div",9,tC),l()),o&2){let e=t.$implicit;d(2),F(e.label),d(),we(e.threads)}}function pC(o,t){o&1&&(s(0,"div",7),p(1,"No existing threads"),l())}function hC(o,t){if(o&1&&(s(0,"div",7),p(1),l()),o&2){let e=u(3);d(),te('No threads matching "',e.searchQuery,'"')}}function uC(o,t){if(o&1&&(xe(0,mC,5,1,"div",6,eC),C(2,pC,2,0,"div",7)(3,hC,2,1,"div",7)),o&2){let e,i=u(2);we(i.getGroupedThreads()),d(2),x(!((e=i.threads())!=null&&e.length)&&!i.searchQuery?2:i.searchQuery&&i.getGroupedThreads().length===0?3:-1)}}function gC(o,t){if(o&1&&(s(0,"div",1),C(1,iC,4,0,"div",3)(2,uC,4,1),l()),o&2){let e=u();d(),x(e.isLoadingThreadList()?1:2)}}function fC(o,t){o&1&&(s(0,"span",25),p(1,"No project selected"),l())}function _C(o,t){o&1&&(s(0,"span",25),p(1,"Loading..."),l())}function bC(o,t){if(o&1&&(s(0,"div",2),C(1,fC,2,0,"span",25)(2,_C,2,0,"span",25),l()),o&2){let e,i=u();d(),x((e=i.currentProject())!=null&&e.name?2:1)}}var yl=class o{projects=null;searchMode=!1;searchQuery="";searchModeChange=new U;projectStateService=m(Se);threadStateService=m(Pt);threadApiService=m(Yi);userService=m(fr);router=m(Pn);currentThread=_t(this.threadStateService.selectedThread$);currentProject=_t(this.projectStateService.selectedProject$);threads=_t(this.threadStateService.threadList$);isLoadingThreadList=_t(this.threadStateService.isLoadingThreadList$);username=_t(this.userService.username$);editingThreadId=null;editingThreadName="";isRenamingThread=!1;renameErrorMessage="";expandedParents=new Set;ngOnInit(){this.userService.fetchCurrentUser().subscribe({error:t=>{console.error("[THREAD-SELECTOR] Failed to load current user:",t)}})}selectThread(t){this.threadStateService.selectThread(t),this.router.navigate(["project",this.currentProject()?.name,"thread",t])}getGroupedThreads(){let t=this.threads();if(!t?.length)return[];let e=t.filter(k=>!k.parentThreadId),i=t.filter(k=>!!k.parentThreadId),n=new Map;for(let k of i){let A=k.parentThreadId;n.has(A)||n.set(A,[]),n.get(A).push(k)}let r=e;if(this.searchQuery&&this.searchQuery.trim()){let k=this.searchQuery.toLowerCase().trim();r=r.filter(A=>A.name.toLowerCase().includes(k)||A.summary&&A.summary.toLowerCase().includes(k))}if(!r.length)return[];let a=this.username();if(!a)return[];let c=r.map(k=>ut(Z({},k),{subThreads:(n.get(k.id)||[]).sort((A,pe)=>A.modifiedDate>pe.modifiedDate?-1:1)})),h=c.filter(k=>k.starring&&k.starring.includes(a)),g=c.filter(k=>!k.starring||!k.starring.includes(a)),b=new Map,S=new Date;S.setHours(0,0,0,0);for(let k of g){let A=new Date(k.modifiedDate);A.setHours(0,0,0,0);let pe=S.getTime()-A.getTime(),ke=Math.floor(pe/(1e3*60*60*24)),ve;ke===0?ve="Today":ke===1?ve="Yesterday":ke<7?ve="This Week":ke<30?ve="This Month":ke<90?ve="Last 3 Months":ve="Older",b.has(ve)||b.set(ve,[]),b.get(ve).push(k)}let P=[];if(h.length>0){let k=[...h].sort((A,pe)=>A.modifiedDate>pe.modifiedDate?-1:1);P.push({label:"Starred",threads:k})}return["Today","Yesterday","This Week","This Month","Last 3 Months","Older"].filter(k=>b.has(k)).forEach(k=>{P.push({label:k,threads:b.get(k)})}),P}isParentExpanded(t){return this.expandedParents.has(t)}toggleSubThreads(t,e){t.stopPropagation(),this.expandedParents.has(e)?this.expandedParents.delete(e):this.expandedParents.add(e)}isSubThread(t){return!!t.parentThreadId}isSharedThread(t){return t.users&&t.users.length>1}isStarred(t){let e=this.username();return!!e&&t.starring&&t.starring.includes(e)}toggleStar(t,e){t.stopPropagation();let i=this.username();if(!i)return;(e.starring&&e.starring.includes(i)?this.threadApiService.unstarThread(e.id):this.threadApiService.starThread(e.id)).subscribe({next:()=>{this.threadStateService.refreshThreadList()},error:a=>{console.error("Error toggling star:",a)}})}deleteThread(t,e){t.stopPropagation();let i=this.currentProject()?.name;!i||!confirm(`Are you sure you want to delete the thread "${e.name}"?`)||this.threadApiService.deleteThread(e.id).subscribe({next:()=>{this.currentThread()?.id===e.id&&(this.threadStateService.clearSelection(),this.router.navigate(["project",i])),this.threadStateService.refreshThreadList()},error:r=>{console.error("Error deleting thread:",r),alert("Failed to delete thread. Please try again.")}})}formatDate(t){try{let e=new Date(t),n=new Date().getTime()-e.getTime(),r=Math.floor(n/(1e3*60*60*24));return r===0?"Today":r===1?"Yesterday":r<7?`${r} days ago`:e.toLocaleDateString("en-EN",{day:"numeric",month:"short"})}catch{return"No date"}}startEditingThreadName(t,e){t.stopPropagation(),this.editingThreadId=e.id,this.editingThreadName=e.name||"",this.renameErrorMessage="",setTimeout(()=>{let i=document.querySelector(".thread-name-input");i&&(i.focus(),i.select())},0)}cancelEditingThreadName(){this.editingThreadId=null,this.editingThreadName="",this.renameErrorMessage=""}saveThreadName(t){if(t&&t.stopPropagation(),!this.editingThreadId)return;let e=this.editingThreadName.trim();if(!e){this.renameErrorMessage="Thread name cannot be empty";return}if(e.length>200){this.renameErrorMessage="Thread name is too long (max 200 characters)";return}let i=this.editingThreadId;this.isRenamingThread=!0,this.renameErrorMessage="",this.threadStateService.renameThread(i,e).subscribe({next:()=>{console.log("[THREAD-SELECTOR] Thread renamed successfully"),this.cancelEditingThreadName(),this.isRenamingThread=!1},error:n=>{console.error("[THREAD-SELECTOR] Error renaming thread:",n),this.renameErrorMessage=n.message||"Failed to rename thread",this.isRenamingThread=!1}})}onEditKeydown(t){t.key==="Enter"?(t.preventDefault(),t.stopPropagation(),this.saveThreadName()):t.key==="Escape"&&(t.preventDefault(),t.stopPropagation(),this.cancelEditingThreadName())}onEditBlur(){setTimeout(()=>{this.editingThreadId&&!this.isRenamingThread&&this.saveThreadName()},200)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-thread-selector"]],inputs:{searchMode:"searchMode",searchQuery:"searchQuery"},outputs:{searchModeChange:"searchModeChange"},decls:3,vars:1,consts:[["tabindex","0","role","application","aria-label","Thread selector",1,"thread-selector",3,"click","keydown"],["role","menu","aria-label","Thread selection",1,"thread-list"],[1,"thread-disabled"],[1,"thread-loading"],[1,"loading-spinner"],[1,"loading-text"],[1,"thread-group"],[1,"thread-empty"],[1,"thread-group-header"],[1,"thread-item-wrapper",3,"current"],[1,"thread-item-wrapper"],[1,"thread-name-edit-wrapper"],["matTooltipShowDelay","1000","role","menuitem","tabindex","0",1,"thread-item",3,"matTooltip","matTooltipDisabled"],[1,"action-buttons"],["mat-icon-button","","title","Rename thread","type","button",1,"action-button","edit-button"],["mat-icon-button","","type","button",1,"action-button","star-button",3,"click","title"],["mat-icon-button","","title","Delete thread","type","button",1,"action-button","delete-button",3,"click"],["type","text","maxlength","200",1,"thread-name-input",3,"ngModelChange","keydown","blur","click","ngModel","disabled"],[1,"rename-error"],["matTooltipShowDelay","1000","role","menuitem","tabindex","0",1,"thread-item",3,"click","keydown.enter","keydown.space","matTooltip","matTooltipDisabled"],[1,"thread-name"],["matTooltip","Shared thread",1,"shared-indicator"],[1,"thread-name-spinner",3,"diameter"],[1,"thread-name","thread-name-generating"],["mat-icon-button","","title","Rename thread","type","button",1,"action-button","edit-button",3,"click"],[1,"disabled-text"]],template:function(e,i){if(e&1&&(s(0,"div",0),_("click",function(r){return r.stopPropagation()})("keydown",function(r){return r.stopPropagation()}),C(1,gC,3,1,"div",1)(2,bC,3,1,"div",2),l()),e&2){let n;d(),x((n=i.currentProject())!=null&&n.name?1:2)}},dependencies:[Pe,je,Le,Ve,Gm,ze,Oe,he,it,Qe,Xt,ct,nr,ir,sa,xd],styles:[".thread-selector[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;min-height:0}.sidenav-thread-selector[_nghost-%COMP%] .thread-selector[_ngcontent-%COMP%], .sidenav-thread-selector [_nghost-%COMP%] .thread-selector[_ngcontent-%COMP%]{flex:1;min-height:0}.thread-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:0;max-height:none;overflow:visible}.thread-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin-bottom:.5rem}.thread-group[_ngcontent-%COMP%]:last-child{margin-bottom:0}.thread-group-header[_ngcontent-%COMP%]{padding:.5rem 1rem .25rem;font-size:.75rem;font-weight:600;color:var(--color-text-secondary);text-transform:uppercase;letter-spacing:.5px;position:sticky;top:0;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);z-index:1}.thread-item-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;position:relative;width:100%;border-radius:0;min-width:0;gap:.25rem}.thread-item-wrapper[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.thread-item-wrapper[_ngcontent-%COMP%]:hover .action-buttons[_ngcontent-%COMP%]{display:flex}.thread-item-wrapper.current[_ngcontent-%COMP%]{background:var(--color-primary-light)}.thread-item-wrapper.current[_ngcontent-%COMP%] .thread-item[_ngcontent-%COMP%]{color:var(--color-primary-text);font-weight:600}.thread-item[_ngcontent-%COMP%]{display:flex;align-items:center;flex:1;min-width:0;padding:.75rem 1rem;text-decoration:none;cursor:pointer;transition:all .2s ease;background:transparent;border:none;border-radius:0;color:var(--color-text);text-align:left;justify-content:flex-start}.thread-item.new-thread-item[_ngcontent-%COMP%]{margin-bottom:.25rem}.thread-item[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.thread-item[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary);outline-offset:-2px}.action-buttons[_ngcontent-%COMP%]{display:none;align-items:center;gap:.25rem;flex-shrink:0;margin-right:.5rem}.thread-item-wrapper[_ngcontent-%COMP%]:hover .action-buttons[_ngcontent-%COMP%], .thread-item-wrapper.current[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%]{display:flex}.action-button[_ngcontent-%COMP%]{flex-shrink:0;border-radius:4px!important;width:28px!important;height:28px!important;padding:0!important}.action-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple{border-radius:4px!important}.action-button[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)!important}.action-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.action-button.edit-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.action-button.edit-button[_ngcontent-%COMP%]:hover{background-color:var(--color-primary-hover)!important}.action-button.edit-button[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:var(--color-primary)}.action-button.star-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{transition:color .2s ease}.action-button.star-button.starred[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#fbbf24}.action-button.star-button[_ngcontent-%COMP%]:not(.starred):hover mat-icon[_ngcontent-%COMP%]{color:#fbbf24}.action-button.delete-button[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:#ef4444}.thread-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;background:transparent;border:none;text-decoration:none;cursor:pointer;transition:all .2s ease;gap:.5rem;font-size:.875rem;font-weight:400;padding:0 1rem;min-width:0}.thread-link[_ngcontent-%COMP%]:hover:not(.new-thread-link){color:var(--color-primary-hover, var(--color-primary));text-decoration:underline;text-decoration-thickness:1.5px;text-underline-offset:3px}.thread-link[_ngcontent-%COMP%]:focus{outline:2px solid var(--color-primary);outline-offset:2px}.thread-link.new-thread-link[_ngcontent-%COMP%]{margin-bottom:.5rem;font-weight:600;font-size:.95rem}.thread-link.new-thread-link[_ngcontent-%COMP%] .thread-name[_ngcontent-%COMP%]{background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% auto;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:_ngcontent-%COMP%_gradientShift 3s ease-in-out infinite}.thread-link.new-thread-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--color-primary);animation:_ngcontent-%COMP%_iconPulse 3s ease-in-out infinite}.thread-link.new-thread-link[_ngcontent-%COMP%]:hover{transform:translate(4px)}.thread-link.new-thread-link[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_iconPulse 1.5s ease-in-out infinite}.thread-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0 center}50%{background-position:100% center}to{background-position:0 center}}@keyframes _ngcontent-%COMP%_iconPulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.05)}}.thread-name[_ngcontent-%COMP%]{flex:1;font-size:.875rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left}.thread-name.thread-name-generating[_ngcontent-%COMP%]{color:var(--color-text-muted);font-style:italic}.thread-name-edit-wrapper[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;padding:0 .5rem}.thread-name-input[_ngcontent-%COMP%]{width:100%;padding:.5rem;border:1px solid var(--color-border);border-radius:4px;background:var(--color-bg-secondary);color:var(--color-text-primary);font-size:.9rem;font-family:inherit}.thread-name-input[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary);box-shadow:0 0 0 2px #3b82f61a}.thread-name-input[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.rename-error[_ngcontent-%COMP%]{color:var(--color-error);font-size:.75rem;margin-top:.25rem;padding-left:.5rem}.thread-name-spinner[_ngcontent-%COMP%]{flex-shrink:0;margin-right:.5rem}.thread-name-spinner[_ngcontent-%COMP%] .mat-mdc-progress-spinner circle{stroke:var(--color-primary)!important}.current-indicator[_ngcontent-%COMP%]{color:var(--color-success);font-weight:700;flex-shrink:0;font-size:1rem}.thread-separator[_ngcontent-%COMP%]{height:1px;background:var(--color-border);margin:.25rem 0}.thread-empty[_ngcontent-%COMP%]{padding:1.5rem 1rem;text-align:center;color:var(--color-text-muted);font-size:.8rem;font-style:italic}.thread-loading[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:2rem 1rem;gap:.75rem}.thread-loading[_ngcontent-%COMP%] .loading-spinner[_ngcontent-%COMP%]{width:24px;height:24px;border:3px solid var(--color-border);border-top-color:var(--color-primary);border-radius:50%;animation:_ngcontent-%COMP%_spin .8s linear infinite}.thread-loading[_ngcontent-%COMP%] .loading-text[_ngcontent-%COMP%]{color:var(--color-text-muted);font-size:.8rem}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.thread-disabled[_ngcontent-%COMP%]{padding:1.5rem 1rem}.thread-disabled[_ngcontent-%COMP%] .disabled-text[_ngcontent-%COMP%]{display:block;color:var(--color-text-muted);font-size:.85rem;font-style:italic;text-align:center}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%]{padding-left:1rem}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%] .sub-thread-item[_ngcontent-%COMP%]{padding:.4rem .75rem;gap:.35rem;font-size:.8rem;color:var(--color-text-secondary)}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%] .sub-thread-item[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%] .sub-thread-icon[_ngcontent-%COMP%]{font-size:14px;width:14px;height:14px;color:var(--color-text-muted);flex-shrink:0}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%] .sub-thread-agent[_ngcontent-%COMP%]{font-weight:600;color:var(--color-primary);white-space:nowrap;flex-shrink:0;font-size:.8rem}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%] .sub-thread-task[_ngcontent-%COMP%]{color:var(--color-text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.75rem}.sub-thread-toggle[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;flex-shrink:0;cursor:pointer;color:var(--color-text-secondary);margin-right:.25rem}.sub-thread-toggle[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.shared-indicator[_ngcontent-%COMP%]{font-size:14px;width:14px;height:14px;color:var(--color-text-secondary);flex-shrink:0;margin-left:.25rem}@media (max-width: 768px){.thread-item[_ngcontent-%COMP%]{padding:.6rem .8rem}.thread-name[_ngcontent-%COMP%]{font-size:.8rem}}"]})};function vC(o,t){if(o&1){let e=M();s(0,"button",9),_("click",function(){v(e);let n=u();return y(n.start())}),s(1,"mat-icon"),p(2,"play_arrow"),l()()}if(o&2){let e=u();w("disabled",!e.hasPreviewCommand()||e.isLoading())}}function yC(o,t){if(o&1){let e=M();s(0,"button",10),_("click",function(){v(e);let n=u();return y(n.stop())}),s(1,"mat-icon"),p(2,"stop"),l()()}if(o&2){let e=u();w("disabled",e.isLoading())}}function CC(o,t){if(o&1&&(s(0,"a",5)(1,"mat-icon",11),p(2,"open_in_new"),l(),s(3,"span",12),p(4),l()()),o&2){let e=u();w("href",e.previewUrl(),Qn)("title",e.previewUrl()),d(4),F(e.previewUrl())}}function xC(o,t){if(o&1&&(s(0,"div",7),p(1),l()),o&2){let e=u();d(),F(e.errorMessage())}}function wC(o,t){if(o&1){let e=M();s(0,"div",8)(1,"div",13)(2,"span",14),p(3,"Logs"),l(),s(4,"button",15),_("click",function(){v(e);let n=u();return y(n.refreshLogs())}),s(5,"mat-icon"),p(6,"refresh"),l()()(),s(7,"pre",16),p(8),l()()}if(o&2){let e=u();d(8),F(e.logs()||"(empty)")}}var Cl=class o{destroyRef=m(Yl);projectState=m(Se);hasPreviewCommand=_t(this.projectState.selectedProject$.pipe(_e(t=>!!t?.config?.preview?.command)),{initialValue:!1});status=Ee("stopped");previewUrl=Ee(null);logs=Ee("");isLoading=Ee(!1);showLogs=Ee(!1);errorMessage=Ee("");ngOnInit(){try{this.projectState.getPreviewStatus().pipe(nn(this.destroyRef)).subscribe({next:t=>this.applyStatus(t),error:()=>{}})}catch{}}start(){this.isLoading.set(!0),this.errorMessage.set(""),this.projectState.startPreview().pipe(nn(this.destroyRef)).subscribe({next:t=>{this.applyStatus(t),this.isLoading.set(!1)},error:t=>{this.errorMessage.set(t?.error?.error??"Failed to start preview"),this.isLoading.set(!1)}})}stop(){this.isLoading.set(!0),this.errorMessage.set(""),this.projectState.stopPreview().pipe(nn(this.destroyRef)).subscribe({next:()=>{this.status.set("stopped"),this.previewUrl.set(null),this.isLoading.set(!1)},error:t=>{this.errorMessage.set(t?.error?.error??"Failed to stop preview"),this.isLoading.set(!1)}})}refreshLogs(){this.projectState.getPreviewLogs().pipe(nn(this.destroyRef)).subscribe({next:t=>this.logs.set(t.logs),error:()=>this.logs.set("(failed to load logs)")})}toggleLogs(){this.showLogs.update(t=>!t),this.showLogs()&&this.refreshLogs()}applyStatus(t){this.status.set(t.status),this.previewUrl.set(t.url??null)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-preview-panel"]],decls:12,vars:10,consts:[[1,"preview-panel"],[1,"preview-controls"],["mat-icon-button","","title","Start preview server","type","button",1,"preview-action-btn","start",3,"disabled"],["mat-icon-button","","title","Stop preview server","type","button",1,"preview-action-btn","stop",3,"disabled"],[1,"status-pill"],["target","_blank","rel","noopener noreferrer",1,"preview-url",3,"href","title"],["mat-icon-button","","type","button",1,"logs-btn",3,"click","title"],[1,"preview-error"],[1,"logs-container"],["mat-icon-button","","title","Start preview server","type","button",1,"preview-action-btn","start",3,"click","disabled"],["mat-icon-button","","title","Stop preview server","type","button",1,"preview-action-btn","stop",3,"click","disabled"],[1,"link-icon"],[1,"url-text"],[1,"logs-header"],[1,"logs-title"],["mat-icon-button","","title","Refresh logs","type","button",1,"refresh-btn",3,"click"],[1,"logs-content"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1),C(2,vC,3,1,"button",2),C(3,yC,3,1,"button",3),s(4,"span",4),p(5),l(),C(6,CC,5,3,"a",5),s(7,"button",6),_("click",function(){return i.toggleLogs()}),s(8,"mat-icon"),p(9),l()()(),C(10,xC,2,1,"div",7),C(11,wC,9,1,"div",8),l()),e&2&&(d(2),x(i.status()==="stopped"?2:-1),d(),x(i.status()==="running"?3:-1),d(),E("running",i.status()==="running"),d(),te(" ",i.status()==="running"?"Running":"Stopped"," "),d(),x(i.status()==="running"&&i.previewUrl()?6:-1),d(),w("title",i.showLogs()?"Hide logs":"Show logs"),d(2),F(i.showLogs()?"expand_less":"terminal"),d(),x(i.errorMessage()?10:-1),d(),x(i.showLogs()?11:-1))},dependencies:[it,Qe,Oe,he],styles:["[_nghost-%COMP%]{display:block}.preview-panel[_ngcontent-%COMP%]{padding:.5rem 1rem;display:flex;flex-direction:column;gap:.5rem}.preview-controls[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;flex-wrap:nowrap;min-width:0}.preview-action-btn[_ngcontent-%COMP%]{flex-shrink:0}.preview-action-btn.start[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--color-primary)}.preview-action-btn.stop[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#e53935}.preview-action-btn[disabled][_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.status-pill[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:2px 8px;border-radius:12px;font-size:.72rem;font-weight:600;letter-spacing:.02em;flex-shrink:0;background:var(--color-bg-hover);color:var(--color-text-secondary);border:1px solid var(--color-border)}.status-pill.running[_ngcontent-%COMP%]{background:#22c55e26;color:#16a34a;border-color:#22c55e66}.preview-url[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:2px;text-decoration:none;color:var(--color-primary);font-size:.8rem;font-weight:500;min-width:0;overflow:hidden;flex-shrink:1}.preview-url[_ngcontent-%COMP%]:hover{text-decoration:underline}.preview-url[_ngcontent-%COMP%] .link-icon[_ngcontent-%COMP%]{font-size:14px;width:14px;height:14px;flex-shrink:0}.preview-url[_ngcontent-%COMP%] .url-text[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.logs-btn[_ngcontent-%COMP%]{margin-left:auto;flex-shrink:0}.logs-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;color:var(--color-text-secondary)}.preview-error[_ngcontent-%COMP%]{font-size:.78rem;color:#c00;padding:0 .25rem}.logs-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;background:var(--color-bg-hover);border-radius:8px;overflow:hidden;border:1px solid var(--color-border)}.logs-header[_ngcontent-%COMP%]{display:flex;align-items:center;padding:.25rem .75rem;border-bottom:1px solid var(--color-border)}.logs-header[_ngcontent-%COMP%] .logs-title[_ngcontent-%COMP%]{flex:1;font-size:.75rem;font-weight:600;color:var(--color-text-secondary);text-transform:uppercase;letter-spacing:.05em}.logs-header[_ngcontent-%COMP%] .refresh-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px}.logs-content[_ngcontent-%COMP%]{margin:0;padding:.5rem .75rem;font-family:Courier New,Courier,monospace;font-size:.72rem;line-height:1.5;color:var(--color-text);white-space:pre-wrap;word-break:break-all;max-height:200px;overflow-y:auto}.logs-content[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px}.logs-content[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.logs-content[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-text-secondary);border-radius:3px}"]})};function SC(o,t){if(o&1&&(s(0,"div",3),p(1),l()),o&2){let e=u();d(),te("\u274C ",e.errorMessage)}}var ua=class o{dialogRef=m(ei);data=m(ji);jsonContent;errorMessage="";title;constructor(){this.jsonContent=this.data.initialContent,this.title=this.data.title||this.getDefaultTitle(this.data.configType,this.data.projectName)}getDefaultTitle(t,e){return t==="user"?"User Configuration":`Project Configuration: ${e||"Unknown"}`}onSave(){this.errorMessage="";let t;try{t=JSON.parse(this.jsonContent)}catch(e){this.errorMessage=`Invalid JSON syntax: ${e instanceof Error?e.message:"Unknown error"}`;return}this.dialogRef.close(t)}onCancel(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-json-editor"]],decls:13,vars:3,consts:[["mat-dialog-title",""],["mat-icon-button","","title","Close",1,"close-button",3,"click"],["spellcheck","false","placeholder","Enter JSON configuration...",1,"json-textarea",3,"ngModelChange","ngModel"],[1,"error-message"],["align","end"],["matButton","",3,"click"],["matButton","filled","color","primary",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0),p(1),s(2,"button",1),_("click",function(){return i.onCancel()}),s(3,"mat-icon"),p(4,"close"),l()()(),s(5,"mat-dialog-content")(6,"textarea",2),B("ngModelChange",function(r){return j(i.jsonContent,r)||(i.jsonContent=r),r}),l(),C(7,SC,2,1,"div",3),l(),s(8,"mat-dialog-actions",4)(9,"button",5),_("click",function(){return i.onCancel()}),p(10,"Cancel"),l(),s(11,"button",6),_("click",function(){return i.onSave()}),p(12,"Save"),l()()),e&2&&(d(),te(" ",i.title," "),d(5),z("ngModel",i.jsonContent),d(),x(i.errorMessage?7:-1))},dependencies:[Pe,je,Le,Ve,ze,he,Qe,Et,pn,hn,un],styles:["[mat-dialog-title][_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}[mat-dialog-title][_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]{margin-left:auto}mat-dialog-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;min-height:400px}.json-textarea[_ngcontent-%COMP%]{flex:1;min-height:300px;max-height:80vh;padding:1rem;font-family:Monaco,Menlo,Ubuntu Mono,Consolas,monospace;font-size:.875rem;line-height:1.5;background:var(--color-code-bg);color:var(--color-text);border:1px solid var(--color-border);border-radius:4px;resize:vertical;outline:none;transition:border-color .2s}.json-textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.json-textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);opacity:.6}.error-message[_ngcontent-%COMP%]{padding:.75rem 1rem;border-radius:4px;font-size:.875rem;line-height:1.4;background:#dc26261a;color:#dc2626;border:1px solid rgba(220,38,38,.3)}"]})};function kC(o,t){if(o&1){let e=M();s(0,"div",9)(1,"mat-form-field",18)(2,"mat-label"),p(3),l(),s(4,"textarea",19),B("ngModelChange",function(n){let r=v(e).$index,a=u();return j(a.commands[r],n)||(a.commands[r]=n),y(n)}),l(),s(5,"mat-hint"),p(6,"Use placeholder for dynamic values"),l()(),s(7,"button",20),_("click",function(){let n=v(e).$index,r=u();return y(r.removeCommand(n))}),s(8,"mat-icon"),p(9,"delete"),l()()()}if(o&2){let e=t.$index,i=u();d(3),te("Prompt ",e+1),d(),z("ngModel",i.commands[e]),d(3),w("disabled",i.commands.length===1)}}function MC(o,t){if(o&1){let e=M();s(0,"div",10)(1,"h3"),p(2,"Save to"),l(),s(3,"div",21)(4,"label",22)(5,"input",23),B("ngModelChange",function(n){v(e);let r=u();return j(r.source,n)||(r.source=n),y(n)}),l(),s(6,"div",24)(7,"div",25)(8,"span",26),p(9,"\u{1F464}"),l(),s(10,"span",27),p(11,"Local"),l()(),s(12,"p",28),p(13,"Personal prompt in ~/.coday/... (not committed)"),l()()(),s(14,"label",22)(15,"input",29),B("ngModelChange",function(n){v(e);let r=u();return j(r.source,n)||(r.source=n),y(n)}),l(),s(16,"div",24)(17,"div",25)(18,"span",26),p(19,"\u{1F4E6}"),l(),s(20,"span",27),p(21,"Project"),l()(),s(22,"p",28),p(23,"Shared prompt in ./prompts/ (committable)"),l()()()(),s(24,"p",30),p(25,"Storage location is permanent and cannot be changed after creation"),l()()}if(o&2){let e=u();d(4),E("selected",e.source==="local"),d(),z("ngModel",e.source),d(9),E("selected",e.source==="project"),d(),z("ngModel",e.source)}}function TC(o,t){if(o&1&&(s(0,"div",11)(1,"h3"),p(2,"Storage Location"),l(),s(3,"div",31)(4,"span",26),p(5),l(),s(6,"span",27),p(7),l()(),s(8,"p",30),p(9,"Cannot be changed after creation"),l()()),o&2){let e=u();d(3),E("badge-local",e.source==="local")("badge-project",e.source==="project"),d(2),F(e.source==="local"?"\u{1F464}":"\u{1F4E6}"),d(2),F(e.source==="local"?"Local":"Project")}}function EC(o,t){if(o&1){let e=M();s(0,"div",12)(1,"label",32)(2,"input",33),B("ngModelChange",function(n){v(e);let r=u();return j(r.webhookEnabled,n)||(r.webhookEnabled=n),y(n)}),l(),s(3,"span"),p(4,"Enable webhook"),l()(),s(5,"p",30),p(6,"Enable webhook to trigger this prompt via HTTP POST"),l()()}if(o&2){let e=u();d(2),z("ngModel",e.webhookEnabled)}}function PC(o,t){if(o&1){let e=M();s(0,"div",13)(1,"div",34)(2,"mat-icon",35),p(3,"link"),l(),s(4,"h4"),p(5,"Webhook URL"),l()(),s(6,"div",36)(7,"p",37),p(8),l(),s(9,"button",38),_("click",function(){v(e);let n=u();return y(n.copyWebhookUrl())}),s(10,"mat-icon"),p(11,"content_copy"),l(),s(12,"span"),p(13,"Copy URL"),l()()(),s(14,"p",30),p(15,"Use this URL to trigger the prompt via HTTP POST"),l()()}if(o&2){let e=u();d(8),F(e.getWebhookUrl())}}function OC(o,t){if(o&1&&(s(0,"div",14)(1,"mat-icon"),p(2,"error"),l(),s(3,"span"),p(4),l()()),o&2){let e=u();d(4),F(e.errorMessage)}}var ga=class o{promptApi=m(ci);dialogRef=m(ei);configApi=m(Qi);snackBar=m(qr);name="";description="";commands=[""];webhookEnabled=!1;threadLifetime="";source="local";isSaving=!1;errorMessage="";isAdmin=!1;isEditMode=!1;promptId="";data=m(ji);constructor(){this.isEditMode=this.data.mode==="edit"}ngOnInit(){this.configApi.getUserConfig().subscribe({next:t=>{this.isAdmin=t.groups?.includes("CODAY_ADMIN")??!1},error:t=>{console.error("[PROMPT_FORM] Error loading user config:",t),this.isAdmin=!1}}),this.isEditMode&&this.data.prompt&&(this.promptId=this.data.prompt.id,this.name=this.data.prompt.name,this.description=this.data.prompt.description,this.commands=[...this.data.prompt.commands],this.webhookEnabled=this.data.prompt.webhookEnabled,this.source=this.data.prompt.source)}addCommand(){this.commands.push("")}removeCommand(t){this.commands.length>1&&this.commands.splice(t,1)}trackByIndex(t){return t}normalizeName(){this.name=this.name.replace(/[\s_.,;:!?()[\]{}]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase()}validateForm(){return this.name.trim()?this.description.trim()?this.commands.filter(e=>e.trim()).length===0?(this.errorMessage="At least one command is required",!1):!0:(this.errorMessage="Description is required",!1):(this.errorMessage="Name is required",!1)}save(){if(this.errorMessage="",!this.validateForm())return;let t=this.commands.filter(e=>e.trim());if(this.isSaving=!0,this.isEditMode&&this.data.prompt){let e={name:this.name.trim(),description:this.description.trim(),commands:t,webhookEnabled:this.webhookEnabled};this.promptApi.updatePrompt(this.data.prompt.id,e).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:i=>{console.error("Error updating prompt:",i),this.errorMessage=i?.error?.error||i?.message||"Failed to update prompt",this.isSaving=!1}})}else{let e={name:this.name.trim(),description:this.description.trim(),commands:t,webhookEnabled:this.webhookEnabled,source:this.source};this.promptApi.createPrompt(e).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:i=>{console.error("Error creating prompt:",i),this.errorMessage=i?.error?.error||i?.message||"Failed to create prompt",this.isSaving=!1}})}}cancel(){this.dialogRef.close(!1)}getWebhookUrl(){return`${window.location.origin}/api/webhooks/${this.promptId}/execute`}copyWebhookUrl(){if(!this.webhookEnabled){this.snackBar.open("Webhook is not enabled","Close",{duration:3e3});return}if(!this.promptId){this.snackBar.open("Prompt must be saved before getting webhook URL","Close",{duration:3e3});return}let t=this.getWebhookUrl();navigator.clipboard.writeText(t).then(()=>{this.snackBar.open("Webhook URL copied to clipboard!","Close",{duration:3e3})}).catch(e=>{console.error("Failed to copy webhook URL:",e),this.snackBar.open("Failed to copy URL","Close",{duration:3e3})})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-prompt-form"]],decls:36,vars:11,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","my-prompt","required","",3,"ngModelChange","blur","ngModel"],["matInput","","placeholder","What does this prompt do?","rows","3","required","",3,"ngModelChange","ngModel"],[1,"commands-section"],[1,"section-header"],["mat-icon-button","","type","button","title","Add command",3,"click"],[1,"commands-list"],[1,"command-item"],[1,"source-section"],[1,"source-display"],[1,"webhook-section"],[1,"webhook-url-section"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],["appearance","outline",1,"command-field"],["matInput","","placeholder","Enter command with placeholders like \\{\\{key\\}\\}","rows","2",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove command",1,"remove-btn",3,"click","disabled"],[1,"source-options"],[1,"source-option"],["type","radio","name","source","value","local",3,"ngModelChange","ngModel"],[1,"source-content"],[1,"source-header"],[1,"source-icon"],[1,"source-label"],[1,"source-description"],["type","radio","name","source","value","project",3,"ngModelChange","ngModel"],[1,"hint"],[1,"source-badge"],[1,"checkbox-label"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"webhook-url-header"],[1,"webhook-icon"],[1,"webhook-url-content"],[1,"url-text"],["mat-raised-button","","color","accent","type","button",3,"click"]],template:function(e,i){e&1&&(s(0,"h2",0),p(1),l(),s(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),p(6,"Name"),l(),s(7,"input",3),B("ngModelChange",function(r){return j(i.name,r)||(i.name=r),r}),_("blur",function(){return i.normalizeName()}),l(),s(8,"mat-hint"),p(9,"A descriptive name (spaces and punctuation will be replaced with hyphens), will be used as command name"),l()(),s(10,"mat-form-field",2)(11,"mat-label"),p(12,"Description"),l(),s(13,"textarea",4),B("ngModelChange",function(r){return j(i.description,r)||(i.description=r),r}),l(),s(14,"mat-hint"),p(15,"Explain the purpose of this prompt, helps for searchability"),l()(),s(16,"div",5)(17,"div",6)(18,"h3"),p(19,"Prompts"),l(),s(20,"button",7),_("click",function(){return i.addCommand()}),s(21,"mat-icon"),p(22,"add"),l()()(),s(23,"div",8),xe(24,kC,10,3,"div",9,Kn),l()(),C(26,MC,26,6,"div",10),C(27,TC,10,6,"div",11),C(28,EC,7,1,"div",12),C(29,PC,16,1,"div",13),C(30,OC,5,1,"div",14),l()(),s(31,"mat-dialog-actions",15)(32,"button",16),_("click",function(){return i.cancel()}),p(33,"Cancel"),l(),s(34,"button",17),_("click",function(){return i.save()}),p(35),l()()),e&2&&(d(),F(i.isEditMode?"Edit Prompt":"Create Prompt"),d(6),z("ngModel",i.name),d(6),z("ngModel",i.description),d(11),we(i.commands),d(2),x(i.isEditMode?-1:26),d(),x(i.isEditMode?27:-1),d(),x(i.isAdmin?28:-1),d(),x(i.isEditMode&&i.webhookEnabled&&i.isAdmin?29:-1),d(),x(i.errorMessage?30:-1),d(2),w("disabled",i.isSaving),d(2),w("disabled",i.isSaving),d(),te(" ",i.isSaving?"Saving...":"Save"," "))},dependencies:[Pe,je,Le,Wm,Ro,Ve,Fo,ze,ao,pn,un,hn,it,Et,Qe,Xt,di,jt,zt,yn,ct,Oe,he,$o],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:500px}@media (max-width: 768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.commands-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:.5rem}.commands-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.commands-section[_ngcontent-%COMP%] .commands-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .command-field[_ngcontent-%COMP%]{flex:1}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{margin-top:8px}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:not-allowed}.webhook-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{width:18px;height:18px;cursor:pointer}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.95rem}.webhook-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.85rem;color:var(--color-text-secondary)}.webhook-url-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.75rem}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%] .webhook-icon[_ngcontent-%COMP%]{color:var(--color-primary)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;margin-bottom:.5rem}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%] .url-text[_ngcontent-%COMP%]{flex:1;margin:0;padding:.75rem;background:var(--color-bg);border:1px solid var(--color-border);border-radius:4px;font-family:monospace;font-size:.85rem;word-break:break-all;color:var(--color-text)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{white-space:nowrap;display:flex;align-items:center;gap:.5rem}.webhook-url-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}.source-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.source-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 1rem;font-size:1rem;font-weight:600}.source-section[_ngcontent-%COMP%] .source-options[_ngcontent-%COMP%]{display:flex;gap:1rem;margin-bottom:.75rem}@media (max-width: 768px){.source-section[_ngcontent-%COMP%] .source-options[_ngcontent-%COMP%]{flex-direction:column}}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%]{flex:1;display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:var(--color-bg);border:2px solid var(--color-border);border-radius:8px;cursor:pointer;transition:all .2s ease}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%]:hover{border-color:var(--color-primary);background:var(--color-bg-hover)}.source-section[_ngcontent-%COMP%] .source-option.selected[_ngcontent-%COMP%]{border-color:var(--color-primary);background:var(--color-bg-hover);box-shadow:0 0 0 1px var(--color-primary)}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin-top:2px;cursor:pointer}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%]{flex:1}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.25rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-label[_ngcontent-%COMP%]{font-weight:600;font-size:.95rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-description[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);line-height:1.4}.source-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.thread-lifetime-disabled[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:#2196f30d;border:1px solid rgba(33,150,243,.2);border-radius:8px;margin-bottom:1rem}.thread-lifetime-disabled[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#2196f3cc;font-size:1.25rem;width:1.25rem;height:1.25rem;margin-top:2px}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;flex:1}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:.95rem;color:var(--color-text)}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{display:block;margin-top:.25rem;font-size:.85rem;color:var(--color-text-secondary);line-height:1.4}.source-display[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.source-display[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1rem;font-weight:600}.source-display[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem 1rem;border-radius:6px;font-size:.9rem;font-weight:500;margin-bottom:.5rem}.source-display[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.1rem}.source-display[_ngcontent-%COMP%] .source-badge.badge-local[_ngcontent-%COMP%]{background:#2196f31a;color:#2196f3;border:1px solid rgba(33,150,243,.3)}.source-display[_ngcontent-%COMP%] .source-badge.badge-project[_ngcontent-%COMP%]{background:#4caf501a;color:#4caf50;border:1px solid rgba(76,175,80,.3)}.source-display[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}"]})};function AC(o,t){o&1&&(s(0,"div",12),p(1,"Loading prompts..."),l())}function IC(o,t){if(o&1&&(s(0,"div",13),p(1),l()),o&2){let e=u();d(),F(e.errorMessage)}}function DC(o,t){o&1&&(s(0,"div",14),p(1," No prompts found. Create your first prompt to get started. "),l())}function RC(o,t){o&1&&(s(0,"div",14),p(1," No prompts match your search. "),l())}function FC(o,t){if(o&1&&(s(0,"span",31),p(1),l()),o&2){let e=u().$implicit;w("title",Mn("Created by ",e.createdBy)),d(),te(" \u{1F464} ",e.createdBy," ")}}function NC(o,t){if(o&1){let e=M();s(0,"button",32),_("click",function(){v(e);let n=u().$implicit,r=u(2);return y(r.toggleWebhook(n))}),p(1),l()}if(o&2){let e=u().$implicit;E("btn-webhook-enabled",e.webhookEnabled)("btn-webhook-disabled",!e.webhookEnabled),d(),te(" ",e.webhookEnabled?"Disable Webhook":"Enable Webhook"," ")}}function LC(o,t){if(o&1){let e=M();s(0,"div",17)(1,"div",18)(2,"div",19)(3,"h3"),p(4),l(),s(5,"div",20)(6,"span",21),p(7),l(),$e(8,FC,2,3,"span",22),l()(),s(9,"p",23),p(10),l(),s(11,"div",24)(12,"span",25),p(13),l(),s(14,"span",26),p(15),l()()(),s(16,"div",27)(17,"button",28),_("click",function(){let n=v(e).$implicit,r=u(2);return y(r.editPrompt(n))}),p(18,"Edit"),l(),$e(19,NC,2,5,"button",29),s(20,"button",30),_("click",function(){let n=v(e).$implicit,r=u(2);return y(r.deletePrompt(n.id))}),p(21,"Delete"),l()()()}if(o&2){let e=t.$implicit,i=u(2);d(4),F(e.name),d(2),E("badge-local",e.source==="local")("badge-project",e.source==="project"),w("title",e.source==="local"?"Local prompt (~/.coday/)":"Project prompt (./prompts/)"),d(),te(" ",e.source==="local"?"\u{1F464}":"\u{1F4E6}"," "),d(),w("ngIf",e.createdBy!==i.getCurrentUsername()),d(2),F(e.description),d(3),te("ID: ",e.id),d(),E("enabled",e.webhookEnabled),d(),te(" Webhook: ",e.webhookEnabled?"Enabled":"Disabled"," "),d(4),w("ngIf",i.isAdmin)}}function VC(o,t){if(o&1&&(s(0,"div",15),$e(1,LC,22,14,"div",16),l()),o&2){let e=u();d(),w("ngForOf",e.filteredPrompts)}}var xl=class o{promptApi=m(ci);dialog=m(yi);configApi=m(Qi);prompts=[];filteredPrompts=[];searchQuery="";showOnlyMine=!0;isLoading=!1;errorMessage="";isAdmin=!1;currentUsername="";ngOnInit(){this.configApi.getUserConfig().subscribe({next:t=>{this.isAdmin=t.groups?.includes("CODAY_ADMIN")??!1,this.currentUsername=t.username??"",console.log("[PROMPT_MANAGER] Current username:",this.currentUsername)},error:t=>{console.error("[PROMPT_MANAGER] Error loading user config:",t),this.isAdmin=!1}}),this.loadPrompts()}loadPrompts(){this.isLoading=!0,this.promptApi.listPrompts().subscribe({next:t=>{this.prompts=t,this.applyFilter(),this.isLoading=!1},error:t=>{console.error("Error loading prompts:",t),this.errorMessage="Failed to load prompts",this.isLoading=!1}})}deletePrompt(t){confirm("Are you sure you want to delete this prompt?")&&this.promptApi.deletePrompt(t).subscribe({next:()=>{this.loadPrompts()},error:e=>{console.error("Error deleting prompt:",e);let i=e?.error?.error??e?.message??"Failed to delete prompt";alert(`Failed to delete prompt: ${i}`)}})}toggleWebhook(t){(t.webhookEnabled?this.promptApi.disableWebhook(t.id):this.promptApi.enableWebhook(t.id)).subscribe({next:()=>{this.loadPrompts()},error:i=>{console.error("Error toggling webhook:",i);let n=i?.error?.error??i?.message??"Failed to toggle webhook";alert(`Failed to toggle webhook: ${n}`)}})}createPrompt(){this.dialog.open(ga,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadPrompts()})}getCurrentUsername(){return this.currentUsername}normalizeUsername(t){return t.replace(/[.\s]+/g,"_")}isMyPrompt(t){if(!this.currentUsername)return!1;let e=this.normalizeUsername(this.currentUsername.toLowerCase());return this.normalizeUsername(t.createdBy.toLowerCase())===e}applyFilter(){let t=this.searchQuery.toLowerCase().trim(),e=this.showOnlyMine&&this.currentUsername?this.prompts.filter(i=>this.isMyPrompt(i)):[...this.prompts];t&&(e=e.filter(i=>i.name.toLowerCase().includes(t)||i.description.toLowerCase().includes(t)?!0:i.createdBy.toLowerCase().includes(t))),this.filteredPrompts=e}onSearchChange(){this.applyFilter()}editPrompt(t){this.promptApi.getPrompt(t.id).subscribe({next:e=>{this.dialog.open(ga,{width:"700px",maxHeight:"90vh",data:{mode:"edit",prompt:e}}).afterClosed().subscribe(n=>{n&&this.loadPrompts()})},error:e=>{console.error("Error loading prompt details:",e);let i=e?.error?.error??e?.message??"Failed to load prompt details";alert(`Failed to load prompt details: ${i}`)}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-prompt-manager"]],decls:23,vars:7,consts:[[1,"prompt-manager"],[1,"header"],[1,"header-actions"],["appearance","outline",1,"search-field"],["matInput","","placeholder","Name, description, author...",3,"ngModelChange","input","ngModel"],["matPrefix",""],["color","primary",1,"mine-toggle",3,"ngModelChange","change","ngModel"],[1,"btn-create",3,"click"],["class","loading",4,"ngIf"],["class","error",4,"ngIf"],["class","empty",4,"ngIf"],["class","prompt-list",4,"ngIf"],[1,"loading"],[1,"error"],[1,"empty"],[1,"prompt-list"],["class","prompt-item",4,"ngFor","ngForOf"],[1,"prompt-item"],[1,"prompt-info"],[1,"prompt-header"],[1,"badges"],[1,"source-badge",3,"title"],["class","owner-badge",3,"title",4,"ngIf"],[1,"description"],[1,"meta"],["title","Prompt ID",1,"prompt-id"],[1,"webhook-status"],[1,"prompt-actions"],[1,"btn-primary",3,"click"],[3,"btn-webhook-enabled","btn-webhook-disabled","click",4,"ngIf"],[1,"btn-danger",3,"click"],[1,"owner-badge",3,"title"],[3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"h2"),p(3,"Prompts"),l(),s(4,"div",2)(5,"mat-form-field",3)(6,"mat-label"),p(7,"Search"),l(),s(8,"input",4),B("ngModelChange",function(r){return j(i.searchQuery,r)||(i.searchQuery=r),r}),_("input",function(){return i.onSearchChange()}),l(),s(9,"mat-icon",5),p(10,"search"),l()(),s(11,"mat-slide-toggle",6),B("ngModelChange",function(r){return j(i.showOnlyMine,r)||(i.showOnlyMine=r),r}),_("change",function(){return i.applyFilter()}),p(12," Mine "),l(),s(13,"button",7),_("click",function(){return i.createPrompt()}),s(14,"mat-icon"),p(15,"add"),l(),s(16,"span"),p(17,"Create Prompt"),l()()()(),$e(18,AC,2,0,"div",8)(19,IC,2,1,"div",9)(20,DC,2,0,"div",10)(21,RC,2,0,"div",10)(22,VC,2,1,"div",11),l()),e&2&&(d(8),z("ngModel",i.searchQuery),d(3),z("ngModel",i.showOnlyMine),d(7),w("ngIf",i.isLoading),d(),w("ngIf",i.errorMessage),d(),w("ngIf",!i.isLoading&&i.prompts.length===0),d(),w("ngIf",!i.isLoading&&i.prompts.length>0&&i.filteredPrompts.length===0),d(),w("ngIf",!i.isLoading&&i.filteredPrompts.length>0))},dependencies:[Pe,Fa,Na,je,Le,Ve,ze,Oe,he,Xt,di,jt,zt,go,ct,_l,uo],styles:[".prompt-manager[_ngcontent-%COMP%]{padding:1.5rem .5rem 1.5rem 1.5rem}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem;padding-right:1rem}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .search-field[_ngcontent-%COMP%]{width:300px;margin-bottom:-1.25em}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .mine-toggle[_ngcontent-%COMP%]{margin-bottom:-1.25em}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1.5rem;border:none;border-radius:4px;background:var(--color-primary);color:#fff;cursor:pointer;font-size:1rem;font-weight:500;white-space:nowrap}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]:hover{opacity:.9}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.loading[_ngcontent-%COMP%], .error[_ngcontent-%COMP%], .empty[_ngcontent-%COMP%]{padding:1rem 1.5rem 1rem 1rem;text-align:center;color:var(--color-text-secondary)}.error[_ngcontent-%COMP%]{color:var(--color-error)}.prompt-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding-right:1rem}.prompt-item[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;padding:1rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-surface)}.prompt-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.prompt-info[_ngcontent-%COMP%]{flex:1}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:.5rem}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1.1rem;flex:1}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] .badges[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] .badges[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:6px;font-size:1rem;cursor:help}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] .badges[_ngcontent-%COMP%] .source-badge.badge-local[_ngcontent-%COMP%]{background:#2196f31a;border:1px solid rgba(33,150,243,.3)}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] .badges[_ngcontent-%COMP%] .source-badge.badge-project[_ngcontent-%COMP%]{background:#4caf501a;border:1px solid rgba(76,175,80,.3)}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] .badges[_ngcontent-%COMP%] .owner-badge[_ngcontent-%COMP%]{font-size:.75rem;padding:.25rem .5rem;background:#2196f3;color:#fff;border-radius:4px;font-weight:400;white-space:nowrap}.prompt-info[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{margin:0 0 .5rem;color:var(--color-text-secondary)}.prompt-info[_ngcontent-%COMP%] .meta[_ngcontent-%COMP%]{display:flex;gap:1rem;font-size:.85rem;color:var(--color-text-secondary)}.prompt-info[_ngcontent-%COMP%] .meta[_ngcontent-%COMP%] .prompt-id[_ngcontent-%COMP%]{font-family:monospace;opacity:.7}.prompt-info[_ngcontent-%COMP%] .meta[_ngcontent-%COMP%] .webhook-status.enabled[_ngcontent-%COMP%]{color:var(--color-success);font-weight:600}.prompt-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.prompt-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:.5rem 1rem;border:none;border-radius:4px;cursor:pointer;font-size:.9rem}.prompt-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]{background:var(--color-primary);color:#fff}.prompt-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover{opacity:.9}.prompt-actions[_ngcontent-%COMP%] button.btn-secondary[_ngcontent-%COMP%]{background:var(--color-secondary);color:#fff}.prompt-actions[_ngcontent-%COMP%] button.btn-secondary[_ngcontent-%COMP%]:hover{opacity:.9}.prompt-actions[_ngcontent-%COMP%] button.btn-webhook-enabled[_ngcontent-%COMP%]{background:#ff9800;color:#fff}.prompt-actions[_ngcontent-%COMP%] button.btn-webhook-enabled[_ngcontent-%COMP%]:hover{opacity:.9}.prompt-actions[_ngcontent-%COMP%] button.btn-webhook-disabled[_ngcontent-%COMP%]{background:#9e9e9e;color:#fff}.prompt-actions[_ngcontent-%COMP%] button.btn-webhook-disabled[_ngcontent-%COMP%]:hover{opacity:.9}.prompt-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]{background:var(--color-error);color:#fff}.prompt-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]:hover{opacity:.9}"]})};var yr=class o{http=m(Ye);projectState=m(Se);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/schedulers`}listSchedulers(){return this.http.get(this.getBaseUrl())}getScheduler(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createScheduler(t){return this.http.post(this.getBaseUrl(),t)}updateScheduler(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,e)}deleteScheduler(t){return this.http.delete(`${this.getBaseUrl()}/${t}`)}enableScheduler(t){return this.http.post(`${this.getBaseUrl()}/${t}/enable`,{})}disableScheduler(t){return this.http.post(`${this.getBaseUrl()}/${t}/disable`,{})}runSchedulerNow(t){return this.http.post(`${this.getBaseUrl()}/${t}/run-now`,{})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var wl=(()=>{class o{_animationsDisabled=He();state="unchecked";disabled=!1;appearance="full";constructor(){}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:12,hostBindings:function(i,n){i&2&&E("mat-pseudo-checkbox-indeterminate",n.state==="indeterminate")("mat-pseudo-checkbox-checked",n.state==="checked")("mat-pseudo-checkbox-disabled",n.disabled)("mat-pseudo-checkbox-minimal",n.appearance==="minimal")("mat-pseudo-checkbox-full",n.appearance==="full")("_mat-animation-noopable",n._animationsDisabled)},inputs:{state:"state",disabled:"disabled",appearance:"appearance"},decls:0,vars:0,template:function(i,n){},styles:[`.mat-pseudo-checkbox{border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:"";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox._mat-animation-noopable{transition:none !important;animation:none !important}.mat-pseudo-checkbox._mat-animation-noopable::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{left:1px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{left:1px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-pseudo-checkbox-minimal-selected-checkmark-color, var(--mat-sys-primary))}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full{border-color:var(--mat-pseudo-checkbox-full-unselected-icon-color, var(--mat-sys-on-surface-variant));border-width:2px;border-style:solid}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-disabled{border-color:var(--mat-pseudo-checkbox-full-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate{background-color:var(--mat-pseudo-checkbox-full-selected-icon-color, var(--mat-sys-primary));border-color:rgba(0,0,0,0)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-pseudo-checkbox-full-selected-checkmark-color, var(--mat-sys-on-primary))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled{background-color:var(--mat-pseudo-checkbox-full-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-pseudo-checkbox-full-disabled-selected-checkmark-color, var(--mat-sys-surface))}.mat-pseudo-checkbox{width:18px;height:18px}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after{width:14px;height:6px;transform-origin:center;top:-4.2426406871px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{top:8px;width:16px}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after{width:10px;height:4px;transform-origin:center;top:-2.8284271247px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{top:6px;width:12px}
|
|
373
|
+
`],encapsulation:2,changeDetection:0})}return o})();var zC=["text"],jC=[[["mat-icon"]],"*"],BC=["mat-icon","*"];function HC(o,t){if(o&1&&I(0,"mat-pseudo-checkbox",1),o&2){let e=u();w("disabled",e.disabled)("state",e.selected?"checked":"unchecked")}}function WC(o,t){if(o&1&&I(0,"mat-pseudo-checkbox",3),o&2){let e=u();w("disabled",e.disabled)}}function UC(o,t){if(o&1&&(s(0,"span",4),p(1),l()),o&2){let e=u();d(),te("(",e.group.label,")")}}var Td=new ne("MAT_OPTION_PARENT_COMPONENT"),Ed=new ne("MatOptgroup");var Md=class{source;isUserInput;constructor(t,e=!1){this.source=t,this.isUserInput=e}},fo=(()=>{class o{_element=m(ie);_changeDetectorRef=m(Ge);_parent=m(Td,{optional:!0});group=m(Ed,{optional:!0});_signalDisableRipple=!1;_selected=!1;_active=!1;_mostRecentViewValue="";get multiple(){return this._parent&&this._parent.multiple}get selected(){return this._selected}value;id=m(Re).getId("mat-option-");get disabled(){return this.group&&this.group.disabled||this._disabled()}set disabled(e){this._disabled.set(e)}_disabled=Ee(!1);get disableRipple(){return this._signalDisableRipple?this._parent.disableRipple():!!this._parent?.disableRipple}get hideSingleSelectionIndicator(){return!!(this._parent&&this._parent.hideSingleSelectionIndicator)}onSelectionChange=new U;_text;_stateChanges=new R;constructor(){let e=m(Rt);e.load(An),e.load(Ba),this._signalDisableRipple=!!this._parent&&Ia(this._parent.disableRipple)}get active(){return this._active}get viewValue(){return(this._text?.nativeElement.textContent||"").trim()}select(e=!0){this._selected||(this._selected=!0,this._changeDetectorRef.markForCheck(),e&&this._emitSelectionChangeEvent())}deselect(e=!0){this._selected&&(this._selected=!1,this._changeDetectorRef.markForCheck(),e&&this._emitSelectionChangeEvent())}focus(e,i){let n=this._getHostElement();typeof n.focus=="function"&&n.focus(i)}setActiveStyles(){this._active||(this._active=!0,this._changeDetectorRef.markForCheck())}setInactiveStyles(){this._active&&(this._active=!1,this._changeDetectorRef.markForCheck())}getLabel(){return this.viewValue}_handleKeydown(e){(e.keyCode===13||e.keyCode===32)&&!gt(e)&&(this._selectViaInteraction(),e.preventDefault())}_selectViaInteraction(){this.disabled||(this._selected=this.multiple?!this._selected:!0,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent(!0))}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._element.nativeElement}ngAfterViewChecked(){if(this._selected){let e=this.viewValue;e!==this._mostRecentViewValue&&(this._mostRecentViewValue&&this._stateChanges.next(),this._mostRecentViewValue=e)}}ngOnDestroy(){this._stateChanges.complete()}_emitSelectionChangeEvent(e=!1){this.onSelectionChange.emit(new Md(this,e))}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["mat-option"]],viewQuery:function(i,n){if(i&1&&Q(zC,7),i&2){let r;H(r=W())&&(n._text=r.first)}},hostAttrs:["role","option",1,"mat-mdc-option","mdc-list-item"],hostVars:11,hostBindings:function(i,n){i&1&&_("click",function(){return n._selectViaInteraction()})("keydown",function(a){return n._handleKeydown(a)}),i&2&&(Zt("id",n.id),K("aria-selected",n.selected)("aria-disabled",n.disabled.toString()),E("mdc-list-item--selected",n.selected)("mat-mdc-option-multiple",n.multiple)("mat-mdc-option-active",n.active)("mdc-list-item--disabled",n.disabled))},inputs:{value:"value",id:"id",disabled:[2,"disabled","disabled",J]},outputs:{onSelectionChange:"onSelectionChange"},exportAs:["matOption"],ngContentSelectors:BC,decls:8,vars:5,consts:[["text",""],["aria-hidden","true",1,"mat-mdc-option-pseudo-checkbox",3,"disabled","state"],[1,"mdc-list-item__primary-text"],["state","checked","aria-hidden","true","appearance","minimal",1,"mat-mdc-option-pseudo-checkbox",3,"disabled"],[1,"cdk-visually-hidden"],["aria-hidden","true","mat-ripple","",1,"mat-mdc-option-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled"]],template:function(i,n){i&1&&(Be(jC),C(0,HC,1,2,"mat-pseudo-checkbox",1),me(1),s(2,"span",2,0),me(4,1),l(),C(5,WC,1,1,"mat-pseudo-checkbox",3),C(6,UC,2,1,"span",4),I(7,"div",5)),i&2&&(x(n.multiple?0:-1),d(5),x(!n.multiple&&n.selected&&!n.hideSingleSelectionIndicator?5:-1),d(),x(n.group&&n.group._inert?6:-1),d(),w("matRippleTrigger",n._getHostElement())("matRippleDisabled",n.disabled||n.disableRipple))},dependencies:[wl,On],styles:[`.mat-mdc-option{-webkit-user-select:none;user-select:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--mat-option-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-option-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-option-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-option-label-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-option-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-option-label-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-option:hover:not(.mdc-list-item--disabled){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}.mat-mdc-option:focus.mdc-list-item,.mat-mdc-option.mat-mdc-option-active.mdc-list-item{background-color:var(--mat-option-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent));outline:0}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple){background-color:var(--mat-option-selected-state-layer-color, var(--mat-sys-secondary-container))}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple) .mdc-list-item__primary-text{color:var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option .mat-pseudo-checkbox{--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option.mdc-list-item{align-items:center;background:rgba(0,0,0,0)}.mat-mdc-option.mdc-list-item--disabled{cursor:default;pointer-events:none}.mat-mdc-option.mdc-list-item--disabled .mat-mdc-option-pseudo-checkbox,.mat-mdc-option.mdc-list-item--disabled .mdc-list-item__primary-text,.mat-mdc-option.mdc-list-item--disabled>mat-icon{opacity:.38}.mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:32px}[dir=rtl] .mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:16px;padding-right:32px}.mat-mdc-option .mat-icon,.mat-mdc-option .mat-pseudo-checkbox-full{margin-right:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-icon,[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-full{margin-right:0;margin-left:16px}.mat-mdc-option .mat-pseudo-checkbox-minimal{margin-left:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-minimal{margin-right:16px;margin-left:0}.mat-mdc-option .mat-mdc-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-mdc-option .mdc-list-item__primary-text{white-space:normal;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;margin-right:auto}[dir=rtl] .mat-mdc-option .mdc-list-item__primary-text{margin-right:0;margin-left:auto}@media(forced-colors: active){.mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{content:"";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}[dir=rtl] .mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{right:auto;left:16px}}.mat-mdc-option-multiple{--mat-list-list-item-selected-container-color: var(--mat-list-list-item-container-color, transparent)}.mat-mdc-option-active .mat-focus-indicator::before{content:""}
|
|
374
|
+
`],encapsulation:2,changeDetection:0})}return o})();function lg(o,t,e){if(e.length){let i=t.toArray(),n=e.toArray(),r=0;for(let a=0;a<o+1;a++)i[a].group&&i[a].group===n[r]&&r++;return r}return 0}function cg(o,t,e,i){return o<e?o:o+t>e+i?Math.max(0,o-i+t):e}var _o=class{_multiple;_emitChanges;compareWith;_selection=new Set;_deselectedToEmit=[];_selectedToEmit=[];_selected;get selected(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}changed=new R;constructor(t=!1,e,i=!0,n){this._multiple=t,this._emitChanges=i,this.compareWith=n,e&&e.length&&(t?e.forEach(r=>this._markSelected(r)):this._markSelected(e[0]),this._selectedToEmit.length=0)}select(...t){this._verifyValueAssignment(t),t.forEach(i=>this._markSelected(i));let e=this._hasQueuedChanges();return this._emitChangeEvent(),e}deselect(...t){this._verifyValueAssignment(t),t.forEach(i=>this._unmarkSelected(i));let e=this._hasQueuedChanges();return this._emitChangeEvent(),e}setSelection(...t){this._verifyValueAssignment(t);let e=this.selected,i=new Set(t.map(r=>this._getConcreteValue(r)));t.forEach(r=>this._markSelected(r)),e.filter(r=>!i.has(this._getConcreteValue(r,i))).forEach(r=>this._unmarkSelected(r));let n=this._hasQueuedChanges();return this._emitChangeEvent(),n}toggle(t){return this.isSelected(t)?this.deselect(t):this.select(t)}clear(t=!0){this._unmarkAll();let e=this._hasQueuedChanges();return t&&this._emitChangeEvent(),e}isSelected(t){return this._selection.has(this._getConcreteValue(t))}isEmpty(){return this._selection.size===0}hasValue(){return!this.isEmpty()}sort(t){this._multiple&&this.selected&&this._selected.sort(t)}isMultipleSelection(){return this._multiple}_emitChangeEvent(){this._selected=null,(this._selectedToEmit.length||this._deselectedToEmit.length)&&(this.changed.next({source:this,added:this._selectedToEmit,removed:this._deselectedToEmit}),this._deselectedToEmit=[],this._selectedToEmit=[])}_markSelected(t){t=this._getConcreteValue(t),this.isSelected(t)||(this._multiple||this._unmarkAll(),this.isSelected(t)||this._selection.add(t),this._emitChanges&&this._selectedToEmit.push(t))}_unmarkSelected(t){t=this._getConcreteValue(t),this.isSelected(t)&&(this._selection.delete(t),this._emitChanges&&this._deselectedToEmit.push(t))}_unmarkAll(){this.isEmpty()||this._selection.forEach(t=>this._unmarkSelected(t))}_verifyValueAssignment(t){t.length>1&&this._multiple}_hasQueuedChanges(){return!!(this._deselectedToEmit.length||this._selectedToEmit.length)}_getConcreteValue(t,e){if(this.compareWith){e=e??this._selection;for(let i of e)if(this.compareWith(t,i))return i;return t}else return t}};var dg=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({imports:[ae]})}return o})();var Pd=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({imports:[qa,ae,dg,fo]})}return o})();var qC=["trigger"],GC=["panel"],YC=[[["mat-select-trigger"]],"*"],QC=["mat-select-trigger","*"];function XC(o,t){if(o&1&&(s(0,"span",4),p(1),l()),o&2){let e=u();d(),F(e.placeholder)}}function KC(o,t){o&1&&me(0)}function ZC(o,t){if(o&1&&(s(0,"span",11),p(1),l()),o&2){let e=u(2);d(),F(e.triggerValue)}}function JC(o,t){if(o&1&&(s(0,"span",5),C(1,KC,1,0)(2,ZC,2,1,"span",11),l()),o&2){let e=u();d(),x(e.customTrigger?1:2)}}function ex(o,t){if(o&1){let e=M();s(0,"div",12,1),_("keydown",function(n){v(e);let r=u();return y(r._handleKeydown(n))}),me(2,1),l()}if(o&2){let e=u();tn(Mn("mat-mdc-select-panel mdc-menu-surface mdc-menu-surface--open ",e._getPanelTheme())),E("mat-select-panel-animations-enabled",!e._animationsDisabled),w("ngClass",e.panelClass),K("id",e.id+"-panel")("aria-multiselectable",e.multiple)("aria-label",e.ariaLabel||null)("aria-labelledby",e._getPanelAriaLabelledby())}}var Id=new ne("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let o=m(be);return()=>zi(o)}});function mg(o){let t=m(be);return()=>zi(t)}var pg=new ne("MAT_SELECT_CONFIG"),hg={provide:Id,deps:[],useFactory:mg},ug=new ne("MatSelectTrigger"),Ml=class{source;value;constructor(t,e){this.source=t,this.value=e}},Dd=(()=>{class o{_viewportRuler=m(Vi);_changeDetectorRef=m(Ge);_elementRef=m(ie);_dir=m(ft,{optional:!0});_idGenerator=m(Re);_renderer=m(yt);_parentFormField=m(ha,{optional:!0});ngControl=m(Xa,{self:!0,optional:!0});_liveAnnouncer=m(Wa);_defaultOptions=m(pg,{optional:!0});_animationsDisabled=He();_initialized=new R;_cleanupDetach;options;optionGroups;customTrigger;_positions=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"}];_scrollOptionIntoView(e){let i=this.options.toArray()[e];if(i){let n=this.panel.nativeElement,r=lg(e,this.options,this.optionGroups),a=i._getHostElement();e===0&&r===1?n.scrollTop=0:n.scrollTop=cg(a.offsetTop,a.offsetHeight,n.scrollTop,n.offsetHeight)}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0)}_getChangeEvent(e){return new Ml(this,e)}_scrollStrategyFactory=m(Id);_panelOpen=!1;_compareWith=(e,i)=>e===i;_uid=this._idGenerator.getId("mat-select-");_triggerAriaLabelledBy=null;_previousControl;_destroy=new R;_errorStateTracker;stateChanges=new R;disableAutomaticLabeling=!0;userAriaDescribedBy;_selectionModel;_keyManager;_preferredOverlayOrigin;_overlayWidth;_onChange=()=>{};_onTouched=()=>{};_valueId=this._idGenerator.getId("mat-select-value-");_scrollStrategy;_overlayPanelClass=this._defaultOptions?.overlayPanelClass||"";get focused(){return this._focused||this._panelOpen}_focused=!1;controlType="mat-select";trigger;panel;_overlayDir;panelClass;disabled=!1;get disableRipple(){return this._disableRipple()}set disableRipple(e){this._disableRipple.set(e)}_disableRipple=Ee(!1);tabIndex=0;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties()}_hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??!1;get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.stateChanges.next()}_placeholder;get required(){return this._required??this.ngControl?.control?.hasValidator(Qa.required)??!1}set required(e){this._required=e,this.stateChanges.next()}_required;get multiple(){return this._multiple}set multiple(e){this._selectionModel,this._multiple=e}_multiple=!1;disableOptionCentering=this._defaultOptions?.disableOptionCentering??!1;get compareWith(){return this._compareWith}set compareWith(e){this._compareWith=e,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(e){this._assignValue(e)&&this._onChange(e)}_value;ariaLabel="";ariaLabelledby;get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}typeaheadDebounceInterval;sortComparator;get id(){return this._id}set id(e){this._id=e||this._uid,this.stateChanges.next()}_id;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}panelWidth=this._defaultOptions&&typeof this._defaultOptions.panelWidth<"u"?this._defaultOptions.panelWidth:"auto";canSelectNullableOptions=this._defaultOptions?.canSelectNullableOptions??!1;optionSelectionChanges=To(()=>{let e=this.options;return e?e.changes.pipe(kt(e),Gn(()=>Ai(...e.map(i=>i.onSelectionChange)))):this._initialized.pipe(Gn(()=>this.optionSelectionChanges))});openedChange=new U;_openedStream=this.openedChange.pipe(ce(e=>e),_e(()=>{}));_closedStream=this.openedChange.pipe(ce(e=>!e),_e(()=>{}));selectionChange=new U;valueChange=new U;constructor(){let e=m(vl),i=m(Ka,{optional:!0}),n=m(Ja,{optional:!0}),r=m(new Tn("tabindex"),{optional:!0});this.ngControl&&(this.ngControl.valueAccessor=this),this._defaultOptions?.typeaheadDebounceInterval!=null&&(this.typeaheadDebounceInterval=this._defaultOptions.typeaheadDebounceInterval),this._errorStateTracker=new br(e,this.ngControl,n,i,this.stateChanges),this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=r==null?0:parseInt(r)||0,this.id=this.id}ngOnInit(){this._selectionModel=new _o(this.multiple),this.stateChanges.next(),this._viewportRuler.change().pipe(L(this._destroy)).subscribe(()=>{this.panelOpen&&(this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._changeDetectorRef.detectChanges())})}ngAfterContentInit(){this._initialized.next(),this._initialized.complete(),this._initKeyManager(),this._selectionModel.changed.pipe(L(this._destroy)).subscribe(e=>{e.added.forEach(i=>i.select()),e.removed.forEach(i=>i.deselect())}),this.options.changes.pipe(kt(null),L(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){let e=this._getTriggerAriaLabelledby(),i=this.ngControl;if(e!==this._triggerAriaLabelledBy){let n=this._elementRef.nativeElement;this._triggerAriaLabelledBy=e,e?n.setAttribute("aria-labelledby",e):n.removeAttribute("aria-labelledby")}i&&(this._previousControl!==i.control&&(this._previousControl!==void 0&&i.disabled!==null&&i.disabled!==this.disabled&&(this.disabled=i.disabled),this._previousControl=i.control),this.updateErrorState())}ngOnChanges(e){(e.disabled||e.userAriaDescribedBy)&&this.stateChanges.next(),e.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this.typeaheadDebounceInterval)}ngOnDestroy(){this._cleanupDetach?.(),this._keyManager?.destroy(),this._destroy.next(),this._destroy.complete(),this.stateChanges.complete(),this._clearFromModal()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._parentFormField&&(this._preferredOverlayOrigin=this._parentFormField.getConnectedOverlayOrigin()),this._cleanupDetach?.(),this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._applyModalPanelOwnership(),this._panelOpen=!0,this._overlayDir.positionChange.pipe(Ut(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()}),this._overlayDir.attachOverlay(),this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!0)))}_trackedModal=null;_applyModalPanelOwnership(){let e=this._elementRef.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!e)return;let i=`${this.id}-panel`;this._trackedModal&&ec(this._trackedModal,"aria-owns",i),Vm(e,"aria-owns",i),this._trackedModal=e}_clearFromModal(){if(!this._trackedModal)return;let e=`${this.id}-panel`;ec(this._trackedModal,"aria-owns",e),this._trackedModal=null}close(){this._panelOpen&&(this._panelOpen=!1,this._exitAndDetach(),this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!1)))}_exitAndDetach(){if(this._animationsDisabled||!this.panel){this._detachOverlay();return}this._cleanupDetach?.(),this._cleanupDetach=()=>{i(),clearTimeout(n),this._cleanupDetach=void 0};let e=this.panel.nativeElement,i=this._renderer.listen(e,"animationend",r=>{r.animationName==="_mat-select-exit"&&(this._cleanupDetach?.(),this._detachOverlay())}),n=setTimeout(()=>{this._cleanupDetach?.(),this._detachOverlay()},200);e.classList.add("mat-select-panel-exit")}_detachOverlay(){this._overlayDir.detachOverlay(),this._changeDetectorRef.markForCheck()}writeValue(e){this._assignValue(e)}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel?.selected||[]:this._selectionModel?.selected[0]}get triggerValue(){if(this.empty)return"";if(this._multiple){let e=this._selectionModel.selected.map(i=>i.viewValue);return this._isRtl()&&e.reverse(),e.join(", ")}return this._selectionModel.selected[0].viewValue}updateErrorState(){this._errorStateTracker.updateErrorState()}_isRtl(){return this._dir?this._dir.value==="rtl":!1}_handleKeydown(e){this.disabled||(this.panelOpen?this._handleOpenKeydown(e):this._handleClosedKeydown(e))}_handleClosedKeydown(e){let i=e.keyCode,n=i===40||i===38||i===37||i===39,r=i===13||i===32,a=this._keyManager;if(!a.isTyping()&&r&&!gt(e)||(this.multiple||e.altKey)&&n)e.preventDefault(),this.open();else if(!this.multiple){let c=this.selected;a.onKeydown(e);let h=this.selected;h&&c!==h&&this._liveAnnouncer.announce(h.viewValue,1e4)}}_handleOpenKeydown(e){let i=this._keyManager,n=e.keyCode,r=n===40||n===38,a=i.isTyping();if(r&&e.altKey)e.preventDefault(),this.close();else if(!a&&(n===13||n===32)&&i.activeItem&&!gt(e))e.preventDefault(),i.activeItem._selectViaInteraction();else if(!a&&this._multiple&&n===65&&e.ctrlKey){e.preventDefault();let c=this.options.some(h=>!h.disabled&&!h.selected);this.options.forEach(h=>{h.disabled||(c?h.select():h.deselect())})}else{let c=i.activeItemIndex;i.onKeydown(e),this._multiple&&r&&e.shiftKey&&i.activeItem&&i.activeItemIndex!==c&&i.activeItem._selectViaInteraction()}}_handleOverlayKeydown(e){e.keyCode===27&&!gt(e)&&(e.preventDefault(),this.close())}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,this._keyManager?.cancelTypeahead(),!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}_getPanelTheme(){return this._parentFormField?`mat-${this._parentFormField.color}`:""}get empty(){return!this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this.ngControl&&(this._value=this.ngControl.value),this._setSelectionByValue(this._value),this.stateChanges.next()})}_setSelectionByValue(e){if(this.options.forEach(i=>i.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&e)Array.isArray(e),e.forEach(i=>this._selectOptionByValue(i)),this._sortValues();else{let i=this._selectOptionByValue(e);i?this._keyManager.updateActiveItem(i):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectOptionByValue(e){let i=this.options.find(n=>{if(this._selectionModel.isSelected(n))return!1;try{return(n.value!=null||this.canSelectNullableOptions)&&this._compareWith(n.value,e)}catch{return!1}});return i&&this._selectionModel.select(i),i}_assignValue(e){return e!==this._value||this._multiple&&Array.isArray(e)?(this.options&&this._setSelectionByValue(e),this._value=e,!0):!1}_skipPredicate=e=>this.panelOpen?!1:e.disabled;_getOverlayWidth(e){return this.panelWidth==="auto"?(e instanceof Ho?e.elementRef:e||this._elementRef).nativeElement.getBoundingClientRect().width:this.panelWidth===null?"":this.panelWidth}_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck()}_initKeyManager(){this._keyManager=new Lm(this.options).withTypeAhead(this.typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withPageUpDown().withAllowedModifierKeys(["shiftKey"]).skipPredicate(this._skipPredicate),this._keyManager.tabOut.subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction()})}_resetOptions(){let e=Ai(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(L(e)).subscribe(i=>{this._onSelect(i.source,i.isUserInput),i.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),Ai(...this.options.map(i=>i._stateChanges)).pipe(L(e)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this.stateChanges.next()})}_onSelect(e,i){let n=this._selectionModel.isSelected(e);!this.canSelectNullableOptions&&e.value==null&&!this._multiple?(e.deselect(),this._selectionModel.clear(),this.value!=null&&this._propagateChanges(e.value)):(n!==e.selected&&(e.selected?this._selectionModel.select(e):this._selectionModel.deselect(e)),i&&this._keyManager.setActiveItem(e),this.multiple&&(this._sortValues(),i&&this.focus())),n!==this._selectionModel.isSelected(e)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){let e=this.options.toArray();this._selectionModel.sort((i,n)=>this.sortComparator?this.sortComparator(i,n,e):e.indexOf(i)-e.indexOf(n)),this.stateChanges.next()}}_propagateChanges(e){let i;this.multiple?i=this.selected.map(n=>n.value):i=this.selected?this.selected.value:e,this._value=i,this.valueChange.emit(i),this._onChange(i),this.selectionChange.emit(this._getChangeEvent(i)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){if(this._keyManager)if(this.empty){let e=-1;for(let i=0;i<this.options.length;i++)if(!this.options.get(i).disabled){e=i;break}this._keyManager.setActiveItem(e)}else this._keyManager.setActiveItem(this._selectionModel.selected[0])}_canOpen(){return!this._panelOpen&&!this.disabled&&this.options?.length>0&&!!this._overlayDir}focus(e){this._elementRef.nativeElement.focus(e)}_getPanelAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||null,i=e?e+" ":"";return this.ariaLabelledby?i+this.ariaLabelledby:e}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||"";return this.ariaLabelledby&&(e+=" "+this.ariaLabelledby),e||(e=this._valueId),e}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){e.length?this._elementRef.nativeElement.setAttribute("aria-describedby",e.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}onContainerClick(){this.focus(),this.open()}get shouldLabelFloat(){return this.panelOpen||!this.empty||this.focused&&!!this.placeholder}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["mat-select"]],contentQueries:function(i,n,r){if(i&1&&(Ct(r,ug,5),Ct(r,fo,5),Ct(r,Ed,5)),i&2){let a;H(a=W())&&(n.customTrigger=a.first),H(a=W())&&(n.options=a),H(a=W())&&(n.optionGroups=a)}},viewQuery:function(i,n){if(i&1&&(Q(qC,5),Q(GC,5),Q(Ds,5)),i&2){let r;H(r=W())&&(n.trigger=r.first),H(r=W())&&(n.panel=r.first),H(r=W())&&(n._overlayDir=r.first)}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:21,hostBindings:function(i,n){i&1&&_("keydown",function(a){return n._handleKeydown(a)})("focus",function(){return n._onFocus()})("blur",function(){return n._onBlur()}),i&2&&(K("id",n.id)("tabindex",n.disabled?-1:n.tabIndex)("aria-controls",n.panelOpen?n.id+"-panel":null)("aria-expanded",n.panelOpen)("aria-label",n.ariaLabel||null)("aria-required",n.required.toString())("aria-disabled",n.disabled.toString())("aria-invalid",n.errorState)("aria-activedescendant",n._getAriaActiveDescendant()),E("mat-mdc-select-disabled",n.disabled)("mat-mdc-select-invalid",n.errorState)("mat-mdc-select-required",n.required)("mat-mdc-select-empty",n.empty)("mat-mdc-select-multiple",n.multiple)("mat-select-open",n.panelOpen))},inputs:{userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],panelClass:"panelClass",disabled:[2,"disabled","disabled",J],disableRipple:[2,"disableRipple","disableRipple",J],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:ui(e)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",J],placeholder:"placeholder",required:[2,"required","required",J],multiple:[2,"multiple","multiple",J],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",J],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",ui],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth",canSelectNullableOptions:[2,"canSelectNullableOptions","canSelectNullableOptions",J]},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],features:[qe([{provide:pa,useExisting:o},{provide:Td,useExisting:o}]),tt],ngContentSelectors:QC,decls:11,vars:9,consts:[["fallbackOverlayOrigin","cdkOverlayOrigin","trigger",""],["panel",""],["cdk-overlay-origin","",1,"mat-mdc-select-trigger",3,"click"],[1,"mat-mdc-select-value"],[1,"mat-mdc-select-placeholder","mat-mdc-select-min-line"],[1,"mat-mdc-select-value-text"],[1,"mat-mdc-select-arrow-wrapper"],[1,"mat-mdc-select-arrow"],["viewBox","0 0 24 24","width","24px","height","24px","focusable","false","aria-hidden","true"],["d","M7 10l5 5 5-5z"],["cdk-connected-overlay","","cdkConnectedOverlayLockPosition","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"detach","backdropClick","overlayKeydown","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayWidth","cdkConnectedOverlayFlexibleDimensions"],[1,"mat-mdc-select-min-line"],["role","listbox","tabindex","-1",3,"keydown","ngClass"]],template:function(i,n){if(i&1){let r=M();Be(YC),s(0,"div",2,0),_("click",function(){return v(r),y(n.open())}),s(3,"div",3),C(4,XC,2,1,"span",4)(5,JC,3,1,"span",5),l(),s(6,"div",6)(7,"div",7),en(),s(8,"svg",8),I(9,"path",9),l()()()(),$e(10,ex,3,10,"ng-template",10),_("detach",function(){return v(r),y(n.close())})("backdropClick",function(){return v(r),y(n.close())})("overlayKeydown",function(c){return v(r),y(n._handleOverlayKeydown(c))})}if(i&2){let r=Jt(1);d(3),K("id",n._valueId),d(),x(n.empty?4:5),d(6),w("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",n._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",n._scrollStrategy)("cdkConnectedOverlayOrigin",n._preferredOverlayOrigin||r)("cdkConnectedOverlayPositions",n._positions)("cdkConnectedOverlayWidth",n._overlayWidth)("cdkConnectedOverlayFlexibleDimensions",!0)}},dependencies:[Ho,Ds,En],styles:[`@keyframes _mat-select-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}@keyframes _mat-select-exit{from{opacity:1}to{opacity:0}}.mat-mdc-select{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-sys-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-sys-body-large-tracking))}div.mat-mdc-select-panel{box-shadow:var(--mat-select-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))}.mat-mdc-select-disabled{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-disabled .mat-mdc-select-placeholder{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-trigger{display:inline-flex;align-items:center;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.mat-mdc-select-disabled .mat-mdc-select-trigger{-webkit-user-select:none;user-select:none;cursor:default}.mat-mdc-select-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-mdc-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-mdc-select-arrow-wrapper{height:24px;flex-shrink:0;display:inline-flex;align-items:center}.mat-form-field-appearance-fill .mdc-text-field--no-label .mat-mdc-select-arrow-wrapper{transform:none}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-invalid .mat-mdc-select-arrow,.mat-form-field-invalid:not(.mat-form-field-disabled) .mat-mdc-form-field-infix::after{color:var(--mat-select-invalid-arrow-color, var(--mat-sys-error))}.mat-mdc-select-arrow{width:10px;height:5px;position:relative;color:var(--mat-select-enabled-arrow-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--mat-select-focused-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-disabled .mat-mdc-select-arrow{color:var(--mat-select-disabled-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-select-open .mat-mdc-select-arrow{transform:rotate(180deg)}.mat-form-field-animations-enabled .mat-mdc-select-arrow{transition:transform 80ms linear}.mat-mdc-select-arrow svg{fill:currentColor;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}@media(forced-colors: active){.mat-mdc-select-arrow svg{fill:CanvasText}.mat-mdc-select-disabled .mat-mdc-select-arrow svg{fill:GrayText}}div.mat-mdc-select-panel{width:100%;max-height:275px;outline:0;overflow:auto;padding:8px 0;border-radius:4px;box-sizing:border-box;position:relative;background-color:var(--mat-select-panel-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-select-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-select-panel-above) div.mat-mdc-select-panel{border-top-left-radius:0;border-top-right-radius:0;transform-origin:top center}.mat-mdc-select-panel-above div.mat-mdc-select-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:bottom center}.mat-select-panel-animations-enabled{animation:_mat-select-enter 120ms cubic-bezier(0, 0, 0.2, 1)}.mat-select-panel-animations-enabled.mat-select-panel-exit{animation:_mat-select-exit 100ms linear}.mat-mdc-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1);color:var(--mat-select-placeholder-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field:not(.mat-form-field-animations-enabled) .mat-mdc-select-placeholder,._mat-animation-noopable .mat-mdc-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-mdc-select-placeholder{color:rgba(0,0,0,0);-webkit-text-fill-color:rgba(0,0,0,0);transition:none;display:block}.mat-mdc-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mat-mdc-floating-label{max-width:calc(100% - 18px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 24px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-text-field--label-floating .mdc-notched-outline__notch{max-width:calc(100% - 24px)}.mat-mdc-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;visibility:hidden}.mat-form-field-appearance-fill .mat-mdc-select-arrow-wrapper{transform:var(--mat-select-arrow-transform, translateY(-8px))}
|
|
375
|
+
`],encapsulation:2,changeDetection:0})}return o})();var fa=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({providers:[hg],imports:[vi,Pd,ae,Li,ct,Pd,ae]})}return o})();var ix=["input"],nx=["label"],ox=["*"],rx=new ne("mat-checkbox-default-options",{providedIn:"root",factory:fg});function fg(){return{color:"accent",clickAction:"check-indeterminate",disabledInteractive:!1}}var Ot=(function(o){return o[o.Init=0]="Init",o[o.Checked=1]="Checked",o[o.Unchecked=2]="Unchecked",o[o.Indeterminate=3]="Indeterminate",o})(Ot||{}),Rd=class{source;checked},gg=fg(),Fd=(()=>{class o{_elementRef=m(ie);_changeDetectorRef=m(Ge);_ngZone=m(de);_animationsDisabled=He();_options=m(rx,{optional:!0});focus(){this._inputElement.nativeElement.focus()}_createChangeEvent(e){let i=new Rd;return i.source=this,i.checked=e,i}_getAnimationTargetElement(){return this._inputElement?.nativeElement}_animationClasses={uncheckedToChecked:"mdc-checkbox--anim-unchecked-checked",uncheckedToIndeterminate:"mdc-checkbox--anim-unchecked-indeterminate",checkedToUnchecked:"mdc-checkbox--anim-checked-unchecked",checkedToIndeterminate:"mdc-checkbox--anim-checked-indeterminate",indeterminateToChecked:"mdc-checkbox--anim-indeterminate-checked",indeterminateToUnchecked:"mdc-checkbox--anim-indeterminate-unchecked"};ariaLabel="";ariaLabelledby=null;ariaDescribedby;ariaExpanded;ariaControls;ariaOwns;_uniqueId;id;get inputId(){return`${this.id||this._uniqueId}-input`}required;labelPosition="after";name=null;change=new U;indeterminateChange=new U;value;disableRipple;_inputElement;_labelElement;tabIndex;color;disabledInteractive;_onTouched=()=>{};_currentAnimationClass="";_currentCheckState=Ot.Init;_controlValueAccessorChangeFn=()=>{};_validatorChangeFn=()=>{};constructor(){m(Rt).load(An);let e=m(new Tn("tabindex"),{optional:!0});this._options=this._options||gg,this.color=this._options.color||gg.color,this.tabIndex=e==null?0:parseInt(e)||0,this.id=this._uniqueId=m(Re).getId("mat-mdc-checkbox-"),this.disabledInteractive=this._options?.disabledInteractive??!1}ngOnChanges(e){e.required&&this._validatorChangeFn()}ngAfterViewInit(){this._syncIndeterminate(this.indeterminate)}get checked(){return this._checked}set checked(e){e!=this.checked&&(this._checked=e,this._changeDetectorRef.markForCheck())}_checked=!1;get disabled(){return this._disabled}set disabled(e){e!==this.disabled&&(this._disabled=e,this._changeDetectorRef.markForCheck())}_disabled=!1;get indeterminate(){return this._indeterminate()}set indeterminate(e){let i=e!=this._indeterminate();this._indeterminate.set(e),i&&(e?this._transitionCheckState(Ot.Indeterminate):this._transitionCheckState(this.checked?Ot.Checked:Ot.Unchecked),this.indeterminateChange.emit(e)),this._syncIndeterminate(e)}_indeterminate=Ee(!1);_isRippleDisabled(){return this.disableRipple||this.disabled}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}writeValue(e){this.checked=!!e}registerOnChange(e){this._controlValueAccessorChangeFn=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e}validate(e){return this.required&&e.value!==!0?{required:!0}:null}registerOnValidatorChange(e){this._validatorChangeFn=e}_transitionCheckState(e){let i=this._currentCheckState,n=this._getAnimationTargetElement();if(!(i===e||!n)&&(this._currentAnimationClass&&n.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(i,e),this._currentCheckState=e,this._currentAnimationClass.length>0)){n.classList.add(this._currentAnimationClass);let r=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{n.classList.remove(r)},1e3)})}}_emitChangeEvent(){this._controlValueAccessorChangeFn(this.checked),this.change.emit(this._createChangeEvent(this.checked)),this._inputElement&&(this._inputElement.nativeElement.checked=this.checked)}toggle(){this.checked=!this.checked,this._controlValueAccessorChangeFn(this.checked)}_handleInputClick(){let e=this._options?.clickAction;!this.disabled&&e!=="noop"?(this.indeterminate&&e!=="check"&&Promise.resolve().then(()=>{this._indeterminate.set(!1),this.indeterminateChange.emit(!1)}),this._checked=!this._checked,this._transitionCheckState(this._checked?Ot.Checked:Ot.Unchecked),this._emitChangeEvent()):(this.disabled&&this.disabledInteractive||!this.disabled&&e==="noop")&&(this._inputElement.nativeElement.checked=this.checked,this._inputElement.nativeElement.indeterminate=this.indeterminate)}_onInteractionEvent(e){e.stopPropagation()}_onBlur(){Promise.resolve().then(()=>{this._onTouched(),this._changeDetectorRef.markForCheck()})}_getAnimationClassForCheckStateTransition(e,i){if(this._animationsDisabled)return"";switch(e){case Ot.Init:if(i===Ot.Checked)return this._animationClasses.uncheckedToChecked;if(i==Ot.Indeterminate)return this._checked?this._animationClasses.checkedToIndeterminate:this._animationClasses.uncheckedToIndeterminate;break;case Ot.Unchecked:return i===Ot.Checked?this._animationClasses.uncheckedToChecked:this._animationClasses.uncheckedToIndeterminate;case Ot.Checked:return i===Ot.Unchecked?this._animationClasses.checkedToUnchecked:this._animationClasses.checkedToIndeterminate;case Ot.Indeterminate:return i===Ot.Checked?this._animationClasses.indeterminateToChecked:this._animationClasses.indeterminateToUnchecked}return""}_syncIndeterminate(e){let i=this._inputElement;i&&(i.nativeElement.indeterminate=e)}_onInputClick(){this._handleInputClick()}_onTouchTargetClick(){this._handleInputClick(),this.disabled||this._inputElement.nativeElement.focus()}_preventBubblingFromLabel(e){e.target&&this._labelElement.nativeElement.contains(e.target)&&e.stopPropagation()}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["mat-checkbox"]],viewQuery:function(i,n){if(i&1&&(Q(ix,5),Q(nx,5)),i&2){let r;H(r=W())&&(n._inputElement=r.first),H(r=W())&&(n._labelElement=r.first)}},hostAttrs:[1,"mat-mdc-checkbox"],hostVars:16,hostBindings:function(i,n){i&2&&(Zt("id",n.id),K("tabindex",null)("aria-label",null)("aria-labelledby",null),tn(n.color?"mat-"+n.color:"mat-accent"),E("_mat-animation-noopable",n._animationsDisabled)("mdc-checkbox--disabled",n.disabled)("mat-mdc-checkbox-disabled",n.disabled)("mat-mdc-checkbox-checked",n.checked)("mat-mdc-checkbox-disabled-interactive",n.disabledInteractive))},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],ariaExpanded:[2,"aria-expanded","ariaExpanded",J],ariaControls:[0,"aria-controls","ariaControls"],ariaOwns:[0,"aria-owns","ariaOwns"],id:"id",required:[2,"required","required",J],labelPosition:"labelPosition",name:"name",value:"value",disableRipple:[2,"disableRipple","disableRipple",J],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?void 0:ui(e)],color:"color",disabledInteractive:[2,"disabledInteractive","disabledInteractive",J],checked:[2,"checked","checked",J],disabled:[2,"disabled","disabled",J],indeterminate:[2,"indeterminate","indeterminate",J]},outputs:{change:"change",indeterminateChange:"indeterminateChange"},exportAs:["matCheckbox"],features:[qe([{provide:Do,useExisting:Yn(()=>o),multi:!0},{provide:Ya,useExisting:o,multi:!0}]),tt],ngContentSelectors:ox,decls:15,vars:23,consts:[["checkbox",""],["input",""],["label",""],["mat-internal-form-field","",3,"click","labelPosition"],[1,"mdc-checkbox"],[1,"mat-mdc-checkbox-touch-target",3,"click"],["type","checkbox",1,"mdc-checkbox__native-control",3,"blur","click","change","checked","indeterminate","disabled","id","required","tabIndex"],[1,"mdc-checkbox__ripple"],[1,"mdc-checkbox__background"],["focusable","false","viewBox","0 0 24 24","aria-hidden","true",1,"mdc-checkbox__checkmark"],["fill","none","d","M1.73,12.91 8.1,19.28 22.79,4.59",1,"mdc-checkbox__checkmark-path"],[1,"mdc-checkbox__mixedmark"],["mat-ripple","",1,"mat-mdc-checkbox-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-label",3,"for"]],template:function(i,n){if(i&1){let r=M();Be(),s(0,"div",3),_("click",function(c){return v(r),y(n._preventBubblingFromLabel(c))}),s(1,"div",4,0)(3,"div",5),_("click",function(){return v(r),y(n._onTouchTargetClick())}),l(),s(4,"input",6,1),_("blur",function(){return v(r),y(n._onBlur())})("click",function(){return v(r),y(n._onInputClick())})("change",function(c){return v(r),y(n._onInteractionEvent(c))}),l(),I(6,"div",7),s(7,"div",8),en(),s(8,"svg",9),I(9,"path",10),l(),Aa(),I(10,"div",11),l(),I(11,"div",12),l(),s(12,"label",13,2),me(14),l()()}if(i&2){let r=Jt(2);w("labelPosition",n.labelPosition),d(4),E("mdc-checkbox--selected",n.checked),w("checked",n.checked)("indeterminate",n.indeterminate)("disabled",n.disabled&&!n.disabledInteractive)("id",n.inputId)("required",n.required)("tabIndex",n.disabled&&!n.disabledInteractive?-1:n.tabIndex),K("aria-label",n.ariaLabel||null)("aria-labelledby",n.ariaLabelledby)("aria-describedby",n.ariaDescribedby)("aria-checked",n.indeterminate?"mixed":null)("aria-controls",n.ariaControls)("aria-disabled",n.disabled&&n.disabledInteractive?!0:null)("aria-expanded",n.ariaExpanded)("aria-owns",n.ariaOwns)("name",n.name)("value",n.value),d(7),w("matRippleTrigger",r)("matRippleDisabled",n.disableRipple||n.disabled)("matRippleCentered",!0),d(),w("for",n.inputId)}},dependencies:[On,gl],styles:[`.mdc-checkbox{display:inline-block;position:relative;flex:0 0 18px;box-sizing:content-box;width:18px;height:18px;line-height:0;white-space:nowrap;cursor:pointer;vertical-align:bottom;padding:calc((var(--mat-checkbox-state-layer-size, 40px) - 18px)/2);margin:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2)}.mdc-checkbox:hover>.mdc-checkbox__ripple{opacity:var(--mat-checkbox-unselected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity));background-color:var(--mat-checkbox-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox:hover>.mat-mdc-checkbox-ripple>.mat-ripple-element{background-color:var(--mat-checkbox-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox .mdc-checkbox__native-control:focus+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-unselected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity));background-color:var(--mat-checkbox-unselected-focus-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox .mdc-checkbox__native-control:focus~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-unselected-focus-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox:active>.mdc-checkbox__native-control+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));background-color:var(--mat-checkbox-unselected-pressed-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:active>.mdc-checkbox__native-control~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-unselected-pressed-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:hover .mdc-checkbox__native-control:checked+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity));background-color:var(--mat-checkbox-selected-hover-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:hover .mdc-checkbox__native-control:checked~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-selected-hover-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox .mdc-checkbox__native-control:focus:checked+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity));background-color:var(--mat-checkbox-selected-focus-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox .mdc-checkbox__native-control:focus:checked~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-selected-focus-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:active>.mdc-checkbox__native-control:checked+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));background-color:var(--mat-checkbox-selected-pressed-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox:active>.mdc-checkbox__native-control:checked~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-selected-pressed-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control~.mat-mdc-checkbox-ripple .mat-ripple-element,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control+.mdc-checkbox__ripple{background-color:var(--mat-checkbox-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox .mdc-checkbox__native-control{position:absolute;margin:0;padding:0;opacity:0;cursor:inherit;z-index:1;width:var(--mat-checkbox-state-layer-size, 40px);height:var(--mat-checkbox-state-layer-size, 40px);top:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2);right:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2);left:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2)}.mdc-checkbox--disabled{cursor:default;pointer-events:none}.mdc-checkbox__background{display:inline-flex;position:absolute;align-items:center;justify-content:center;box-sizing:border-box;width:18px;height:18px;border:2px solid currentColor;border-radius:2px;background-color:rgba(0,0,0,0);pointer-events:none;will-change:background-color,border-color;transition:background-color 90ms cubic-bezier(0.4, 0, 0.6, 1),border-color 90ms cubic-bezier(0.4, 0, 0.6, 1);-webkit-print-color-adjust:exact;color-adjust:exact;border-color:var(--mat-checkbox-unselected-icon-color, var(--mat-sys-on-surface-variant));top:calc((var(--mat-checkbox-state-layer-size, 40px) - 18px)/2);left:calc((var(--mat-checkbox-state-layer-size, 40px) - 18px)/2)}.mdc-checkbox__native-control:enabled:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:enabled:indeterminate~.mdc-checkbox__background{border-color:var(--mat-checkbox-selected-icon-color, var(--mat-sys-primary));background-color:var(--mat-checkbox-selected-icon-color, var(--mat-sys-primary))}.mdc-checkbox--disabled .mdc-checkbox__background{border-color:var(--mat-checkbox-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-checkbox--disabled .mdc-checkbox__background{border-color:GrayText}}.mdc-checkbox__native-control:disabled:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:disabled:indeterminate~.mdc-checkbox__background{background-color:var(--mat-checkbox-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:rgba(0,0,0,0)}@media(forced-colors: active){.mdc-checkbox__native-control:disabled:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:disabled:indeterminate~.mdc-checkbox__background{border-color:GrayText}}.mdc-checkbox:hover>.mdc-checkbox__native-control:not(:checked)~.mdc-checkbox__background,.mdc-checkbox:hover>.mdc-checkbox__native-control:not(:indeterminate)~.mdc-checkbox__background{border-color:var(--mat-checkbox-unselected-hover-icon-color, var(--mat-sys-on-surface));background-color:rgba(0,0,0,0)}.mdc-checkbox:hover>.mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox:hover>.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background{border-color:var(--mat-checkbox-selected-hover-icon-color, var(--mat-sys-primary));background-color:var(--mat-checkbox-selected-hover-icon-color, var(--mat-sys-primary))}.mdc-checkbox__native-control:focus:focus:not(:checked)~.mdc-checkbox__background,.mdc-checkbox__native-control:focus:focus:not(:indeterminate)~.mdc-checkbox__background{border-color:var(--mat-checkbox-unselected-focus-icon-color, var(--mat-sys-on-surface))}.mdc-checkbox__native-control:focus:focus:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:focus:focus:indeterminate~.mdc-checkbox__background{border-color:var(--mat-checkbox-selected-focus-icon-color, var(--mat-sys-primary));background-color:var(--mat-checkbox-selected-focus-icon-color, var(--mat-sys-primary))}.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox:hover>.mdc-checkbox__native-control~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control:focus~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__background{border-color:var(--mat-checkbox-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox:hover>.mdc-checkbox__native-control~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control:focus~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__background{border-color:GrayText}}.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background{background-color:var(--mat-checkbox-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:rgba(0,0,0,0)}.mdc-checkbox__checkmark{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;opacity:0;transition:opacity 180ms cubic-bezier(0.4, 0, 0.6, 1);color:var(--mat-checkbox-selected-checkmark-color, var(--mat-sys-on-primary))}@media(forced-colors: active){.mdc-checkbox__checkmark{color:CanvasText}}.mdc-checkbox--disabled .mdc-checkbox__checkmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__checkmark{color:var(--mat-checkbox-disabled-selected-checkmark-color, var(--mat-sys-surface))}@media(forced-colors: active){.mdc-checkbox--disabled .mdc-checkbox__checkmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__checkmark{color:GrayText}}.mdc-checkbox__checkmark-path{transition:stroke-dashoffset 180ms cubic-bezier(0.4, 0, 0.6, 1);stroke:currentColor;stroke-width:3.12px;stroke-dashoffset:29.7833385;stroke-dasharray:29.7833385}.mdc-checkbox__mixedmark{width:100%;height:0;transform:scaleX(0) rotate(0deg);border-width:1px;border-style:solid;opacity:0;transition:opacity 90ms cubic-bezier(0.4, 0, 0.6, 1),transform 90ms cubic-bezier(0.4, 0, 0.6, 1);border-color:var(--mat-checkbox-selected-checkmark-color, var(--mat-sys-on-primary))}@media(forced-colors: active){.mdc-checkbox__mixedmark{margin:0 1px}}.mdc-checkbox--disabled .mdc-checkbox__mixedmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__mixedmark{border-color:var(--mat-checkbox-disabled-selected-checkmark-color, var(--mat-sys-surface))}@media(forced-colors: active){.mdc-checkbox--disabled .mdc-checkbox__mixedmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__mixedmark{border-color:GrayText}}.mdc-checkbox--anim-unchecked-checked .mdc-checkbox__background,.mdc-checkbox--anim-unchecked-indeterminate .mdc-checkbox__background,.mdc-checkbox--anim-checked-unchecked .mdc-checkbox__background,.mdc-checkbox--anim-indeterminate-unchecked .mdc-checkbox__background{animation-duration:180ms;animation-timing-function:linear}.mdc-checkbox--anim-unchecked-checked .mdc-checkbox__checkmark-path{animation:mdc-checkbox-unchecked-checked-checkmark-path 180ms linear;transition:none}.mdc-checkbox--anim-unchecked-indeterminate .mdc-checkbox__mixedmark{animation:mdc-checkbox-unchecked-indeterminate-mixedmark 90ms linear;transition:none}.mdc-checkbox--anim-checked-unchecked .mdc-checkbox__checkmark-path{animation:mdc-checkbox-checked-unchecked-checkmark-path 90ms linear;transition:none}.mdc-checkbox--anim-checked-indeterminate .mdc-checkbox__checkmark{animation:mdc-checkbox-checked-indeterminate-checkmark 90ms linear;transition:none}.mdc-checkbox--anim-checked-indeterminate .mdc-checkbox__mixedmark{animation:mdc-checkbox-checked-indeterminate-mixedmark 90ms linear;transition:none}.mdc-checkbox--anim-indeterminate-checked .mdc-checkbox__checkmark{animation:mdc-checkbox-indeterminate-checked-checkmark 500ms linear;transition:none}.mdc-checkbox--anim-indeterminate-checked .mdc-checkbox__mixedmark{animation:mdc-checkbox-indeterminate-checked-mixedmark 500ms linear;transition:none}.mdc-checkbox--anim-indeterminate-unchecked .mdc-checkbox__mixedmark{animation:mdc-checkbox-indeterminate-unchecked-mixedmark 300ms linear;transition:none}.mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background{transition:border-color 90ms cubic-bezier(0, 0, 0.2, 1),background-color 90ms cubic-bezier(0, 0, 0.2, 1)}.mdc-checkbox__native-control:checked~.mdc-checkbox__background>.mdc-checkbox__checkmark>.mdc-checkbox__checkmark-path,.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background>.mdc-checkbox__checkmark>.mdc-checkbox__checkmark-path{stroke-dashoffset:0}.mdc-checkbox__native-control:checked~.mdc-checkbox__background>.mdc-checkbox__checkmark{transition:opacity 180ms cubic-bezier(0, 0, 0.2, 1),transform 180ms cubic-bezier(0, 0, 0.2, 1);opacity:1}.mdc-checkbox__native-control:checked~.mdc-checkbox__background>.mdc-checkbox__mixedmark{transform:scaleX(1) rotate(-45deg)}.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background>.mdc-checkbox__checkmark{transform:rotate(45deg);opacity:0;transition:opacity 90ms cubic-bezier(0.4, 0, 0.6, 1),transform 90ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background>.mdc-checkbox__mixedmark{transform:scaleX(1) rotate(0deg);opacity:1}@keyframes mdc-checkbox-unchecked-checked-checkmark-path{0%,50%{stroke-dashoffset:29.7833385}50%{animation-timing-function:cubic-bezier(0, 0, 0.2, 1)}100%{stroke-dashoffset:0}}@keyframes mdc-checkbox-unchecked-indeterminate-mixedmark{0%,68.2%{transform:scaleX(0)}68.2%{animation-timing-function:cubic-bezier(0, 0, 0, 1)}100%{transform:scaleX(1)}}@keyframes mdc-checkbox-checked-unchecked-checkmark-path{from{animation-timing-function:cubic-bezier(0.4, 0, 1, 1);opacity:1;stroke-dashoffset:0}to{opacity:0;stroke-dashoffset:-29.7833385}}@keyframes mdc-checkbox-checked-indeterminate-checkmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 1);transform:rotate(0deg);opacity:1}to{transform:rotate(45deg);opacity:0}}@keyframes mdc-checkbox-indeterminate-checked-checkmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);transform:rotate(45deg);opacity:0}to{transform:rotate(360deg);opacity:1}}@keyframes mdc-checkbox-checked-indeterminate-mixedmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 1);transform:rotate(-45deg);opacity:0}to{transform:rotate(0deg);opacity:1}}@keyframes mdc-checkbox-indeterminate-checked-mixedmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);transform:rotate(0deg);opacity:1}to{transform:rotate(315deg);opacity:0}}@keyframes mdc-checkbox-indeterminate-unchecked-mixedmark{0%{animation-timing-function:linear;transform:scaleX(1);opacity:1}32.8%,100%{transform:scaleX(0);opacity:0}}.mat-mdc-checkbox{display:inline-block;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mat-mdc-checkbox-touch-target,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__native-control,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__ripple,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mat-mdc-checkbox-ripple::before,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background>.mdc-checkbox__checkmark,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background>.mdc-checkbox__checkmark>.mdc-checkbox__checkmark-path,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background>.mdc-checkbox__mixedmark{transition:none !important;animation:none !important}.mat-mdc-checkbox label{cursor:pointer}.mat-mdc-checkbox .mat-internal-form-field{color:var(--mat-checkbox-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-checkbox-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-checkbox-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-checkbox-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-checkbox-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-checkbox-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-checkbox.mat-mdc-checkbox-disabled.mat-mdc-checkbox-disabled-interactive{pointer-events:auto}.mat-mdc-checkbox.mat-mdc-checkbox-disabled.mat-mdc-checkbox-disabled-interactive input{cursor:default}.mat-mdc-checkbox.mat-mdc-checkbox-disabled label{cursor:default;color:var(--mat-checkbox-disabled-label-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mat-mdc-checkbox.mat-mdc-checkbox-disabled label{color:GrayText}}.mat-mdc-checkbox label:empty{display:none}.mat-mdc-checkbox .mdc-checkbox__ripple{opacity:0}.mat-mdc-checkbox .mat-mdc-checkbox-ripple,.mdc-checkbox__ripple{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-checkbox .mat-mdc-checkbox-ripple:not(:empty),.mdc-checkbox__ripple:not(:empty){transform:translateZ(0)}.mat-mdc-checkbox-ripple .mat-ripple-element{opacity:.1}.mat-mdc-checkbox-touch-target{position:absolute;top:50%;left:50%;height:var(--mat-checkbox-touch-target-size, 48px);width:var(--mat-checkbox-touch-target-size, 48px);transform:translate(-50%, -50%);display:var(--mat-checkbox-touch-target-display, block)}.mat-mdc-checkbox .mat-mdc-checkbox-ripple::before{border-radius:50%}.mdc-checkbox__native-control:focus~.mat-focus-indicator::before{content:""}
|
|
376
|
+
`],encapsulation:2,changeDetection:0})}return o})(),_g=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({imports:[Fd,ae,ae]})}return o})();var sx=["button"],lx=["*"];function cx(o,t){if(o&1&&(s(0,"div",2),I(1,"mat-pseudo-checkbox",6),l()),o&2){let e=u();d(),w("disabled",e.disabled)}}var bg=new ne("MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS",{providedIn:"root",factory:dx});function dx(){return{hideSingleSelectionIndicator:!1,hideMultipleSelectionIndicator:!1,disabledInteractive:!1}}var vg=new ne("MatButtonToggleGroup"),mx={provide:Do,useExisting:Yn(()=>Nd),multi:!0},Tl=class{source;value;constructor(t,e){this.source=t,this.value=e}},Nd=(()=>{class o{_changeDetector=m(Ge);_dir=m(ft,{optional:!0});_multiple=!1;_disabled=!1;_disabledInteractive=!1;_selectionModel;_rawValue;_controlValueAccessorChangeFn=()=>{};_onTouched=()=>{};_buttonToggles;appearance;get name(){return this._name}set name(e){this._name=e,this._markButtonsForCheck()}_name=m(Re).getId("mat-button-toggle-group-");vertical;get value(){let e=this._selectionModel?this._selectionModel.selected:[];return this.multiple?e.map(i=>i.value):e[0]?e[0].value:void 0}set value(e){this._setSelectionByValue(e),this.valueChange.emit(this.value)}valueChange=new U;get selected(){let e=this._selectionModel?this._selectionModel.selected:[];return this.multiple?e:e[0]||null}get multiple(){return this._multiple}set multiple(e){this._multiple=e,this._markButtonsForCheck()}get disabled(){return this._disabled}set disabled(e){this._disabled=e,this._markButtonsForCheck()}get disabledInteractive(){return this._disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e,this._markButtonsForCheck()}get dir(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}change=new U;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._markButtonsForCheck()}_hideSingleSelectionIndicator;get hideMultipleSelectionIndicator(){return this._hideMultipleSelectionIndicator}set hideMultipleSelectionIndicator(e){this._hideMultipleSelectionIndicator=e,this._markButtonsForCheck()}_hideMultipleSelectionIndicator;constructor(){let e=m(bg,{optional:!0});this.appearance=e&&e.appearance?e.appearance:"standard",this.hideSingleSelectionIndicator=e?.hideSingleSelectionIndicator??!1,this.hideMultipleSelectionIndicator=e?.hideMultipleSelectionIndicator??!1}ngOnInit(){this._selectionModel=new _o(this.multiple,void 0,!1)}ngAfterContentInit(){this._selectionModel.select(...this._buttonToggles.filter(e=>e.checked)),this.multiple||this._initializeTabIndex()}writeValue(e){this.value=e,this._changeDetector.markForCheck()}registerOnChange(e){this._controlValueAccessorChangeFn=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e}_keydown(e){if(this.multiple||this.disabled||gt(e))return;let n=e.target.id,r=this._buttonToggles.toArray().findIndex(c=>c.buttonId===n),a=null;switch(e.keyCode){case 32:case 13:a=this._buttonToggles.get(r)||null;break;case 38:a=this._getNextButton(r,-1);break;case 37:a=this._getNextButton(r,this.dir==="ltr"?-1:1);break;case 40:a=this._getNextButton(r,1);break;case 39:a=this._getNextButton(r,this.dir==="ltr"?1:-1);break;default:return}a&&(e.preventDefault(),a._onButtonClick(),a.focus())}_emitChangeEvent(e){let i=new Tl(e,this.value);this._rawValue=i.value,this._controlValueAccessorChangeFn(i.value),this.change.emit(i)}_syncButtonToggle(e,i,n=!1,r=!1){!this.multiple&&this.selected&&!e.checked&&(this.selected.checked=!1),this._selectionModel?i?this._selectionModel.select(e):this._selectionModel.deselect(e):r=!0,r?Promise.resolve().then(()=>this._updateModelValue(e,n)):this._updateModelValue(e,n)}_isSelected(e){return this._selectionModel&&this._selectionModel.isSelected(e)}_isPrechecked(e){return typeof this._rawValue>"u"?!1:this.multiple&&Array.isArray(this._rawValue)?this._rawValue.some(i=>e.value!=null&&i===e.value):e.value===this._rawValue}_initializeTabIndex(){if(this._buttonToggles.forEach(e=>{e.tabIndex=-1}),this.selected)this.selected.tabIndex=0;else for(let e=0;e<this._buttonToggles.length;e++){let i=this._buttonToggles.get(e);if(!i.disabled){i.tabIndex=0;break}}}_getNextButton(e,i){let n=this._buttonToggles;for(let r=1;r<=n.length;r++){let a=(e+i*r+n.length)%n.length,c=n.get(a);if(c&&!c.disabled)return c}return null}_setSelectionByValue(e){if(this._rawValue=e,!this._buttonToggles)return;let i=this._buttonToggles.toArray();if(this.multiple&&e?(Array.isArray(e),this._clearSelection(),e.forEach(n=>this._selectValue(n,i))):(this._clearSelection(),this._selectValue(e,i)),!this.multiple&&i.every(n=>n.tabIndex===-1)){for(let n of i)if(!n.disabled){n.tabIndex=0;break}}}_clearSelection(){this._selectionModel.clear(),this._buttonToggles.forEach(e=>{e.checked=!1,this.multiple||(e.tabIndex=-1)})}_selectValue(e,i){for(let n of i)if(n.value===e){n.checked=!0,this._selectionModel.select(n),this.multiple||(n.tabIndex=0);break}}_updateModelValue(e,i){i&&this._emitChangeEvent(e),this.valueChange.emit(this.value)}_markButtonsForCheck(){this._buttonToggles?.forEach(e=>e._markForCheck())}static \u0275fac=function(i){return new(i||o)};static \u0275dir=Ce({type:o,selectors:[["mat-button-toggle-group"]],contentQueries:function(i,n,r){if(i&1&&Ct(r,El,5),i&2){let a;H(a=W())&&(n._buttonToggles=a)}},hostAttrs:[1,"mat-button-toggle-group"],hostVars:6,hostBindings:function(i,n){i&1&&_("keydown",function(a){return n._keydown(a)}),i&2&&(K("role",n.multiple?"group":"radiogroup")("aria-disabled",n.disabled),E("mat-button-toggle-vertical",n.vertical)("mat-button-toggle-group-appearance-standard",n.appearance==="standard"))},inputs:{appearance:"appearance",name:"name",vertical:[2,"vertical","vertical",J],value:"value",multiple:[2,"multiple","multiple",J],disabled:[2,"disabled","disabled",J],disabledInteractive:[2,"disabledInteractive","disabledInteractive",J],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",J],hideMultipleSelectionIndicator:[2,"hideMultipleSelectionIndicator","hideMultipleSelectionIndicator",J]},outputs:{valueChange:"valueChange",change:"change"},exportAs:["matButtonToggleGroup"],features:[qe([mx,{provide:vg,useExisting:o}])]})}return o})(),El=(()=>{class o{_changeDetectorRef=m(Ge);_elementRef=m(ie);_focusMonitor=m(Ri);_idGenerator=m(Re);_animationDisabled=He();_checked=!1;ariaLabel;ariaLabelledby=null;_buttonElement;buttonToggleGroup;get buttonId(){return`${this.id}-button`}id;name;value;get tabIndex(){return this._tabIndex()}set tabIndex(e){this._tabIndex.set(e)}_tabIndex;disableRipple;get appearance(){return this.buttonToggleGroup?this.buttonToggleGroup.appearance:this._appearance}set appearance(e){this._appearance=e}_appearance;get checked(){return this.buttonToggleGroup?this.buttonToggleGroup._isSelected(this):this._checked}set checked(e){e!==this._checked&&(this._checked=e,this.buttonToggleGroup&&this.buttonToggleGroup._syncButtonToggle(this,this._checked),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled||this.buttonToggleGroup&&this.buttonToggleGroup.disabled}set disabled(e){this._disabled=e}_disabled=!1;get disabledInteractive(){return this._disabledInteractive||this.buttonToggleGroup!==null&&this.buttonToggleGroup.disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e}_disabledInteractive;change=new U;constructor(){m(Rt).load(An);let e=m(vg,{optional:!0}),i=m(new Tn("tabindex"),{optional:!0})||"",n=m(bg,{optional:!0});this._tabIndex=Ee(parseInt(i)||0),this.buttonToggleGroup=e,this.appearance=n&&n.appearance?n.appearance:"standard",this.disabledInteractive=n?.disabledInteractive??!1}ngOnInit(){let e=this.buttonToggleGroup;this.id=this.id||this._idGenerator.getId("mat-button-toggle-"),e&&(e._isPrechecked(this)?this.checked=!0:e._isSelected(this)!==this._checked&&e._syncButtonToggle(this,this._checked))}ngAfterViewInit(){this._animationDisabled||this._elementRef.nativeElement.classList.add("mat-button-toggle-animations-enabled"),this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){let e=this.buttonToggleGroup;this._focusMonitor.stopMonitoring(this._elementRef),e&&e._isSelected(this)&&e._syncButtonToggle(this,!1,!1,!0)}focus(e){this._buttonElement.nativeElement.focus(e)}_onButtonClick(){if(this.disabled)return;let e=this.isSingleSelector()?!0:!this._checked;if(e!==this._checked&&(this._checked=e,this.buttonToggleGroup&&(this.buttonToggleGroup._syncButtonToggle(this,this._checked,!0),this.buttonToggleGroup._onTouched())),this.isSingleSelector()){let i=this.buttonToggleGroup._buttonToggles.find(n=>n.tabIndex===0);i&&(i.tabIndex=-1),this.tabIndex=0}this.change.emit(new Tl(this,this.value))}_markForCheck(){this._changeDetectorRef.markForCheck()}_getButtonName(){return this.isSingleSelector()?this.buttonToggleGroup.name:this.name||null}isSingleSelector(){return this.buttonToggleGroup&&!this.buttonToggleGroup.multiple}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=T({type:o,selectors:[["mat-button-toggle"]],viewQuery:function(i,n){if(i&1&&Q(sx,5),i&2){let r;H(r=W())&&(n._buttonElement=r.first)}},hostAttrs:["role","presentation",1,"mat-button-toggle"],hostVars:14,hostBindings:function(i,n){i&1&&_("focus",function(){return n.focus()}),i&2&&(K("aria-label",null)("aria-labelledby",null)("id",n.id)("name",null),E("mat-button-toggle-standalone",!n.buttonToggleGroup)("mat-button-toggle-checked",n.checked)("mat-button-toggle-disabled",n.disabled)("mat-button-toggle-disabled-interactive",n.disabledInteractive)("mat-button-toggle-appearance-standard",n.appearance==="standard"))},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],id:"id",name:"name",value:"value",tabIndex:"tabIndex",disableRipple:[2,"disableRipple","disableRipple",J],appearance:"appearance",checked:[2,"checked","checked",J],disabled:[2,"disabled","disabled",J],disabledInteractive:[2,"disabledInteractive","disabledInteractive",J]},outputs:{change:"change"},exportAs:["matButtonToggle"],ngContentSelectors:lx,decls:7,vars:13,consts:[["button",""],["type","button",1,"mat-button-toggle-button","mat-focus-indicator",3,"click","id","disabled"],[1,"mat-button-toggle-checkbox-wrapper"],[1,"mat-button-toggle-label-content"],[1,"mat-button-toggle-focus-overlay"],["matRipple","",1,"mat-button-toggle-ripple",3,"matRippleTrigger","matRippleDisabled"],["state","checked","aria-hidden","true","appearance","minimal",3,"disabled"]],template:function(i,n){if(i&1){let r=M();Be(),s(0,"button",1,0),_("click",function(){return v(r),y(n._onButtonClick())}),C(2,cx,2,1,"div",2),s(3,"span",3),me(4),l()(),I(5,"span",4)(6,"span",5)}if(i&2){let r=Jt(1);w("id",n.buttonId)("disabled",n.disabled&&!n.disabledInteractive||null),K("role",n.isSingleSelector()?"radio":"button")("tabindex",n.disabled&&!n.disabledInteractive?-1:n.tabIndex)("aria-pressed",n.isSingleSelector()?null:n.checked)("aria-checked",n.isSingleSelector()?n.checked:null)("name",n._getButtonName())("aria-label",n.ariaLabel)("aria-labelledby",n.ariaLabelledby)("aria-disabled",n.disabled&&n.disabledInteractive?"true":null),d(2),x(n.buttonToggleGroup&&(!n.buttonToggleGroup.multiple&&!n.buttonToggleGroup.hideSingleSelectionIndicator||n.buttonToggleGroup.multiple&&!n.buttonToggleGroup.hideMultipleSelectionIndicator)?2:-1),d(4),w("matRippleTrigger",r)("matRippleDisabled",n.disableRipple||n.disabled)}},dependencies:[On,wl],styles:[`.mat-button-toggle-standalone,.mat-button-toggle-group{position:relative;display:inline-flex;flex-direction:row;white-space:nowrap;overflow:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0);border-radius:var(--mat-button-toggle-legacy-shape);transform:translateZ(0)}.mat-button-toggle-standalone:not([class*=mat-elevation-z]),.mat-button-toggle-group:not([class*=mat-elevation-z]){box-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)}@media(forced-colors: active){.mat-button-toggle-standalone,.mat-button-toggle-group{outline:solid 1px}}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{border-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard .mat-pseudo-checkbox,.mat-button-toggle-group-appearance-standard .mat-pseudo-checkbox{--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-button-toggle-selected-state-text-color, var(--mat-sys-on-secondary-container))}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard:not([class*=mat-elevation-z]),.mat-button-toggle-group-appearance-standard:not([class*=mat-elevation-z]){box-shadow:none}@media(forced-colors: active){.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{outline:0}}.mat-button-toggle-vertical{flex-direction:column}.mat-button-toggle-vertical .mat-button-toggle-label-content{display:block}.mat-button-toggle{white-space:nowrap;position:relative;color:var(--mat-button-toggle-legacy-text-color);font-family:var(--mat-button-toggle-legacy-label-text-font);font-size:var(--mat-button-toggle-legacy-label-text-size);line-height:var(--mat-button-toggle-legacy-label-text-line-height);font-weight:var(--mat-button-toggle-legacy-label-text-weight);letter-spacing:var(--mat-button-toggle-legacy-label-text-tracking);--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-button-toggle-legacy-selected-state-text-color)}.mat-button-toggle.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:var(--mat-button-toggle-legacy-focus-state-layer-opacity)}.mat-button-toggle .mat-icon svg{vertical-align:top}.mat-button-toggle-checkbox-wrapper{display:inline-block;justify-content:flex-start;align-items:center;width:0;height:18px;line-height:18px;overflow:hidden;box-sizing:border-box;position:absolute;top:50%;left:16px;transform:translate3d(0, -50%, 0)}[dir=rtl] .mat-button-toggle-checkbox-wrapper{left:auto;right:16px}.mat-button-toggle-appearance-standard .mat-button-toggle-checkbox-wrapper{left:12px}[dir=rtl] .mat-button-toggle-appearance-standard .mat-button-toggle-checkbox-wrapper{left:auto;right:12px}.mat-button-toggle-checked .mat-button-toggle-checkbox-wrapper{width:18px}.mat-button-toggle-animations-enabled .mat-button-toggle-checkbox-wrapper{transition:width 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-button-toggle-vertical .mat-button-toggle-checkbox-wrapper{transition:none}.mat-button-toggle-checked{color:var(--mat-button-toggle-legacy-selected-state-text-color);background-color:var(--mat-button-toggle-legacy-selected-state-background-color)}.mat-button-toggle-disabled{pointer-events:none;color:var(--mat-button-toggle-legacy-disabled-state-text-color);background-color:var(--mat-button-toggle-legacy-disabled-state-background-color);--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color: var(--mat-button-toggle-legacy-disabled-state-text-color)}.mat-button-toggle-disabled.mat-button-toggle-checked{background-color:var(--mat-button-toggle-legacy-disabled-selected-state-background-color)}.mat-button-toggle-disabled-interactive{pointer-events:auto}.mat-button-toggle-appearance-standard{color:var(--mat-button-toggle-text-color, var(--mat-sys-on-surface));background-color:var(--mat-button-toggle-background-color, transparent);font-family:var(--mat-button-toggle-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-button-toggle-label-text-size, var(--mat-sys-label-large-size));line-height:var(--mat-button-toggle-label-text-line-height, var(--mat-sys-label-large-line-height));font-weight:var(--mat-button-toggle-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mat-button-toggle-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-button-toggle-group-appearance-standard .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}[dir=rtl] .mat-button-toggle-group-appearance-standard .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:none;border-right:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:none;border-right:none;border-top:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-appearance-standard.mat-button-toggle-checked{color:var(--mat-button-toggle-selected-state-text-color, var(--mat-sys-on-secondary-container));background-color:var(--mat-button-toggle-selected-state-background-color, var(--mat-sys-secondary-container))}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled{color:var(--mat-button-toggle-disabled-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-button-toggle-disabled-state-background-color, transparent)}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled .mat-pseudo-checkbox{--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color: var(--mat-button-toggle-disabled-selected-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled.mat-button-toggle-checked{color:var(--mat-button-toggle-disabled-selected-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-button-toggle-disabled-selected-state-background-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{background-color:var(--mat-button-toggle-state-layer-color, var(--mat-sys-on-surface))}.mat-button-toggle-appearance-standard:hover .mat-button-toggle-focus-overlay{opacity:var(--mat-button-toggle-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-button-toggle-appearance-standard.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:var(--mat-button-toggle-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}@media(hover: none){.mat-button-toggle-appearance-standard:hover .mat-button-toggle-focus-overlay{display:none}}.mat-button-toggle-label-content{-webkit-user-select:none;user-select:none;display:inline-block;padding:0 16px;line-height:var(--mat-button-toggle-legacy-height);position:relative}.mat-button-toggle-appearance-standard .mat-button-toggle-label-content{padding:0 12px;line-height:var(--mat-button-toggle-height, 40px)}.mat-button-toggle-label-content>*{vertical-align:middle}.mat-button-toggle-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit;pointer-events:none;opacity:0;background-color:var(--mat-button-toggle-legacy-state-layer-color)}@media(forced-colors: active){.mat-button-toggle-checked .mat-button-toggle-focus-overlay{border-bottom:solid 500px;opacity:.5;height:0}.mat-button-toggle-checked:hover .mat-button-toggle-focus-overlay{opacity:.6}.mat-button-toggle-checked.mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{border-bottom:solid 500px}}.mat-button-toggle .mat-button-toggle-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-button-toggle-button{border:0;background:none;color:inherit;padding:0;margin:0;font:inherit;outline:none;width:100%;cursor:pointer}.mat-button-toggle-animations-enabled .mat-button-toggle-button{transition:padding 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-button-toggle-vertical .mat-button-toggle-button{transition:none}.mat-button-toggle-disabled .mat-button-toggle-button{cursor:default}.mat-button-toggle-button::-moz-focus-inner{border:0}.mat-button-toggle-checked .mat-button-toggle-button:has(.mat-button-toggle-checkbox-wrapper){padding-left:30px}[dir=rtl] .mat-button-toggle-checked .mat-button-toggle-button:has(.mat-button-toggle-checkbox-wrapper){padding-left:0;padding-right:30px}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard{--mat-focus-indicator-border-radius: var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard:not(.mat-button-toggle-vertical) .mat-button-toggle:last-of-type .mat-button-toggle-button::before{border-top-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-bottom-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard:not(.mat-button-toggle-vertical) .mat-button-toggle:first-of-type .mat-button-toggle-button::before{border-top-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-bottom-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle:last-of-type .mat-button-toggle-button::before{border-bottom-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-bottom-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle:first-of-type .mat-button-toggle-button::before{border-top-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-top-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}
|
|
377
|
+
`],encapsulation:2,changeDetection:0})}return o})(),yg=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=re({type:o});static \u0275inj=oe({imports:[ae,qa,El,ae]})}return o})();var hx=(o,t)=>t.id,ux=(o,t)=>t.value;function gx(o,t){if(o&1&&(s(0,"mat-option",5),p(1),l()),o&2){let e=t.$implicit;w("value",e.id),d(),te(" ",e.name," ")}}function fx(o,t){if(o&1){let e=M();s(0,"mat-checkbox",35),_("change",function(){let n=v(e).$implicit,r=u();return y(r.toggleDayOfWeek(n.value))}),p(1),l()}if(o&2){let e=t.$implicit,i=u();w("checked",i.isDaySelected(e.value)),d(),te(" ",e.label," ")}}function _x(o,t){if(o&1){let e=M();s(0,"mat-form-field",2)(1,"mat-label"),p(2,"Number of Occurrences"),l(),s(3,"input",10),B("ngModelChange",function(n){v(e);let r=u();return j(r.endOccurrences,n)||(r.endOccurrences=n),y(n)}),l()()}if(o&2){let e=u();d(3),z("ngModel",e.endOccurrences)}}function bx(o,t){if(o&1){let e=M();s(0,"mat-form-field",2)(1,"mat-label"),p(2,"End Date"),l(),s(3,"input",36),B("ngModelChange",function(n){v(e);let r=u();return j(r.endTimestamp,n)||(r.endTimestamp=n),y(n)}),l()()}if(o&2){let e=u();d(3),z("ngModel",e.endTimestamp)}}function vx(o,t){if(o&1){let e=M();s(0,"div")(1,"mat-form-field",2)(2,"mat-label"),p(3,"Parameter Value"),l(),s(4,"input",37),B("ngModelChange",function(n){v(e);let r=u();return j(r.simpleParameter,n)||(r.simpleParameter=n),y(n)}),l(),s(5,"mat-hint"),p(6),l()()()}if(o&2){let e=u();d(4),z("ngModel",e.simpleParameter),d(2),te("Simple value for ","{{PARAMETERS}}"," placeholder or appended to first command")}}function yx(o,t){if(o&1){let e=M();s(0,"div",40)(1,"mat-form-field",41)(2,"mat-label"),p(3,"Key"),l(),s(4,"input",42),B("ngModelChange",function(n){let r=v(e).$implicit;return j(r.key,n)||(r.key=n),y(n)}),l()(),s(5,"mat-form-field",43)(6,"mat-label"),p(7,"Value"),l(),s(8,"input",44),B("ngModelChange",function(n){let r=v(e).$implicit;return j(r.value,n)||(r.value=n),y(n)}),l()(),s(9,"button",45),_("click",function(){let n=v(e).$index,r=u(3);return y(r.removeParameter(n))}),s(10,"mat-icon"),p(11,"delete"),l()()()}if(o&2){let e=t.$implicit;d(4),z("ngModel",e.key),d(4),z("ngModel",e.value)}}function Cx(o,t){if(o&1&&(s(0,"div",39),xe(1,yx,12,2,"div",40,Kn),l()),o&2){let e=u(2);d(),we(e.parameters)}}function xx(o,t){if(o&1){let e=M();s(0,"div")(1,"div",26)(2,"button",38),_("click",function(){v(e);let n=u();return y(n.addParameter())}),s(3,"mat-icon"),p(4,"add"),l()()(),C(5,Cx,3,0,"div",39),s(6,"p",19),p(7),l()()}if(o&2){let e=u();d(5),x(e.parameters.length>0?5:-1),d(2),te("Key-value pairs for ","{{key}}"," placeholders in prompt commands")}}function wx(o,t){if(o&1&&(s(0,"div",31)(1,"mat-icon"),p(2,"error"),l(),s(3,"span"),p(4),l()()),o&2){let e=u();d(4),F(e.errorMessage)}}var _a=class o{schedulerApi=m(yr);promptApi=m(ci);dialogRef=m(ei);availablePrompts=[];isLoadingPrompts=!1;name="";promptId="";enabled=!0;startTimestamp="";intervalValue=1;intervalUnit="h";daysOfWeek=[];endConditionType="none";endOccurrences=10;endTimestamp="";parameterMode="simple";simpleParameter="";parameters=[];isSaving=!1;errorMessage="";isEditMode=!1;schedulerId="";data=m(ji);daysOfWeekOptions=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:2,label:"Tuesday"},{value:3,label:"Wednesday"},{value:4,label:"Thursday"},{value:5,label:"Friday"},{value:6,label:"Saturday"}];constructor(){this.isEditMode=this.data.mode==="edit"}ngOnInit(){if(this.loadPrompts(),this.isEditMode||(this.startTimestamp=this.formatDateForInput(new Date)),this.isEditMode&&this.data.scheduler){if(this.schedulerId=this.data.scheduler.id,this.name=this.data.scheduler.name,this.promptId=this.data.scheduler.promptId,this.enabled=this.data.scheduler.enabled,this.data.scheduler.schedule.startTimestamp){let e=new Date(this.data.scheduler.schedule.startTimestamp);this.startTimestamp=this.formatDateForInput(e)}let t=this.data.scheduler.schedule.interval.match(/^(\d+)(min|h|d|M)$/);t&&t[1]&&t[2]&&(this.intervalValue=parseInt(t[1],10),this.intervalUnit=t[2]),this.daysOfWeek=this.data.scheduler.schedule.daysOfWeek||[],this.data.scheduler.schedule.endCondition&&(this.endConditionType=this.data.scheduler.schedule.endCondition.type,this.endConditionType==="occurrences"?this.endOccurrences=this.data.scheduler.schedule.endCondition.value:this.endConditionType==="endTimestamp"&&(this.endTimestamp=this.data.scheduler.schedule.endCondition.value)),this.data.scheduler.parameters&&(typeof this.data.scheduler.parameters=="object"&&Object.keys(this.data.scheduler.parameters).length===1&&"PARAMETERS"in this.data.scheduler.parameters?(this.parameterMode="simple",this.simpleParameter=String(this.data.scheduler.parameters.PARAMETERS)):(this.parameterMode="structured",this.parameters=Object.entries(this.data.scheduler.parameters).map(([e,i])=>({key:e,value:String(i)}))))}}loadPrompts(){this.isLoadingPrompts=!0,this.promptApi.listPrompts().subscribe({next:t=>{this.availablePrompts=t,this.isLoadingPrompts=!1},error:t=>{console.error("Error loading prompts:",t),this.errorMessage="Failed to load prompts",this.isLoadingPrompts=!1}})}toggleDayOfWeek(t){let e=this.daysOfWeek.indexOf(t);e>-1?this.daysOfWeek.splice(e,1):this.daysOfWeek.push(t),this.daysOfWeek.sort()}isDaySelected(t){return this.daysOfWeek.includes(t)}addParameter(){this.parameters.push({key:"",value:""})}removeParameter(t){this.parameters.splice(t,1)}trackByIndex(t){return t}formatDateForInput(t){let e=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),r=String(t.getHours()).padStart(2,"0"),a=String(t.getMinutes()).padStart(2,"0");return`${e}-${i}-${n}T${r}:${a}`}validateForm(){if(!this.name.trim())return this.errorMessage="Name is required",!1;if(!this.promptId)return this.errorMessage="Prompt is required",!1;if(this.intervalValue<1)return this.errorMessage="Interval must be at least 1",!1;switch(this.intervalUnit){case"min":if(this.intervalValue>59)return this.errorMessage="Minutes interval must be between 1 and 59 (use hours for longer)",!1;break;case"h":if(this.intervalValue>24)return this.errorMessage="Hours interval must be between 1 and 24 (use days for longer)",!1;break;case"d":if(this.intervalValue>31)return this.errorMessage="Days interval must be between 1 and 31 (use months for longer)",!1;break;case"M":if(this.intervalValue>12)return this.errorMessage="Months interval must be between 1 and 12",!1;break}return this.endConditionType==="occurrences"&&this.endOccurrences<1?(this.errorMessage="Occurrences must be at least 1",!1):this.endConditionType==="endTimestamp"&&!this.endTimestamp?(this.errorMessage="End date is required",!1):!0}buildSchedule(){let e={startTimestamp:(this.startTimestamp?new Date(this.startTimestamp):new Date).toISOString(),interval:`${this.intervalValue}${this.intervalUnit}`};return this.daysOfWeek.length>0&&(e.daysOfWeek=[...this.daysOfWeek]),this.endConditionType==="occurrences"?e.endCondition={type:"occurrences",value:this.endOccurrences}:this.endConditionType==="endTimestamp"&&(e.endCondition={type:"endTimestamp",value:this.endTimestamp}),e}buildParameters(){if(this.parameterMode==="simple")return this.simpleParameter.trim()?{PARAMETERS:this.simpleParameter.trim()}:void 0;let t=this.parameters.filter(i=>i.key.trim());if(t.length===0)return;let e={};return t.forEach(i=>{e[i.key]=i.value}),e}save(){if(this.errorMessage="",!this.validateForm())return;let t=this.buildSchedule(),e=this.buildParameters();this.isSaving=!0,this.isEditMode&&this.schedulerId?this.schedulerApi.updateScheduler(this.schedulerId,{name:this.name.trim(),enabled:this.enabled,promptId:this.promptId,schedule:t,parameters:e}).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:i=>{console.error("Error updating scheduler:",i),this.errorMessage=i?.error?.error||i?.message||"Failed to update scheduler",this.isSaving=!1}}):this.schedulerApi.createScheduler({name:this.name.trim(),promptId:this.promptId,schedule:t,parameters:e,enabled:this.enabled}).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:i=>{console.error("Error creating scheduler:",i),this.errorMessage=i?.error?.error||i?.message||"Failed to create scheduler",this.isSaving=!1}})}cancel(){this.dialogRef.close(!1)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-scheduler-form"]],decls:89,vars:17,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","My Scheduler","required","",3,"ngModelChange","ngModel"],["required","",3,"ngModelChange","ngModel"],[3,"value"],["matInput","","type","datetime-local",3,"ngModelChange","ngModel"],[1,"interval-section"],[1,"interval-fields"],["appearance","outline",1,"interval-value"],["matInput","","type","number","min","1","required","",3,"ngModelChange","ngModel"],["appearance","outline",1,"interval-unit"],["value","min"],["value","h"],["value","d"],["value","M"],[1,"days-section"],[1,"days-checkboxes"],[3,"checked"],[1,"hint"],[1,"end-condition-section"],[3,"ngModelChange","ngModel"],["value","none"],["value","occurrences"],["value","endTimestamp"],[1,"parameters-section"],[1,"section-header"],[1,"mode-toggle",3,"ngModelChange","ngModel"],["value","simple"],["value","structured"],[1,"enabled-section"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],[3,"change","checked"],["matInput","","type","datetime-local","required","",3,"ngModelChange","ngModel"],["matInput","","placeholder","e.g., 1234 or staging",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Add parameter",3,"click"],[1,"parameters-list"],[1,"parameter-item"],["appearance","outline",1,"param-key"],["matInput","","placeholder","parameterName",3,"ngModelChange","ngModel"],["appearance","outline",1,"param-value"],["matInput","","placeholder","value",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove parameter",1,"remove-btn",3,"click"]],template:function(e,i){e&1&&(s(0,"h2",0),p(1),l(),s(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),p(6,"Name"),l(),s(7,"input",3),B("ngModelChange",function(r){return j(i.name,r)||(i.name=r),r}),l(),s(8,"mat-hint"),p(9,"A descriptive name for this scheduler"),l()(),s(10,"mat-form-field",2)(11,"mat-label"),p(12,"Prompt"),l(),s(13,"mat-select",4),B("ngModelChange",function(r){return j(i.promptId,r)||(i.promptId=r),r}),xe(14,gx,2,2,"mat-option",5,hx),l(),s(16,"mat-hint"),p(17,"Select the prompt to execute"),l()(),s(18,"mat-form-field",2)(19,"mat-label"),p(20,"Start Date & Time"),l(),s(21,"input",6),B("ngModelChange",function(r){return j(i.startTimestamp,r)||(i.startTimestamp=r),r}),l(),s(22,"mat-hint"),p(23,"When to start the scheduler (leave empty for now)"),l()(),s(24,"div",7)(25,"h3"),p(26,"Schedule Interval"),l(),s(27,"div",8)(28,"mat-form-field",9)(29,"mat-label"),p(30,"Every"),l(),s(31,"input",10),B("ngModelChange",function(r){return j(i.intervalValue,r)||(i.intervalValue=r),r}),l()(),s(32,"mat-form-field",11)(33,"mat-label"),p(34,"Unit"),l(),s(35,"mat-select",4),B("ngModelChange",function(r){return j(i.intervalUnit,r)||(i.intervalUnit=r),r}),s(36,"mat-option",12),p(37,"Minutes (1-59)"),l(),s(38,"mat-option",13),p(39,"Hours (1-24)"),l(),s(40,"mat-option",14),p(41,"Days (1-31)"),l(),s(42,"mat-option",15),p(43,"Months (1-12)"),l()()()()(),s(44,"div",16)(45,"h3"),p(46,"Days of Week (Optional)"),l(),s(47,"div",17),xe(48,fx,2,2,"mat-checkbox",18,ux),l(),s(50,"p",19),p(51,"Leave empty to run every day"),l()(),s(52,"div",20)(53,"h3"),p(54,"End Condition (Optional)"),l(),s(55,"mat-form-field",2)(56,"mat-label"),p(57,"End Type"),l(),s(58,"mat-select",21),B("ngModelChange",function(r){return j(i.endConditionType,r)||(i.endConditionType=r),r}),s(59,"mat-option",22),p(60,"Never (run indefinitely)"),l(),s(61,"mat-option",23),p(62,"After X occurrences"),l(),s(63,"mat-option",24),p(64,"Until specific date"),l()()(),C(65,_x,4,1,"mat-form-field",2),C(66,bx,4,1,"mat-form-field",2),l(),s(67,"div",25)(68,"div",26)(69,"h3"),p(70,"Parameters (Optional)"),l(),s(71,"mat-button-toggle-group",27),B("ngModelChange",function(r){return j(i.parameterMode,r)||(i.parameterMode=r),r}),s(72,"mat-button-toggle",28),p(73,"Simple"),l(),s(74,"mat-button-toggle",29),p(75,"Structured"),l()()(),C(76,vx,7,2,"div"),C(77,xx,8,2,"div"),l(),s(78,"div",30)(79,"mat-checkbox",21),B("ngModelChange",function(r){return j(i.enabled,r)||(i.enabled=r),r}),p(80,"Enabled"),l(),s(81,"p",19),p(82,"Scheduler will only run if enabled"),l()(),C(83,wx,5,1,"div",31),l()(),s(84,"mat-dialog-actions",32)(85,"button",33),_("click",function(){return i.cancel()}),p(86,"Cancel"),l(),s(87,"button",34),_("click",function(){return i.save()}),p(88),l()()),e&2&&(d(),F(i.isEditMode?"Edit Scheduler":"Create Scheduler"),d(6),z("ngModel",i.name),d(6),z("ngModel",i.promptId),d(),we(i.availablePrompts),d(7),z("ngModel",i.startTimestamp),d(10),z("ngModel",i.intervalValue),d(4),z("ngModel",i.intervalUnit),d(13),we(i.daysOfWeekOptions),d(10),z("ngModel",i.endConditionType),d(7),x(i.endConditionType==="occurrences"?65:-1),d(),x(i.endConditionType==="endTimestamp"?66:-1),d(5),z("ngModel",i.parameterMode),d(5),x(i.parameterMode==="simple"?76:-1),d(),x(i.parameterMode==="structured"?77:-1),d(2),z("ngModel",i.enabled),d(4),x(i.errorMessage?83:-1),d(2),w("disabled",i.isSaving),d(2),w("disabled",i.isSaving),d(),te(" ",i.isSaving?"Saving...":"Save"," "))},dependencies:[Pe,je,Le,Za,Ve,Fo,is,ze,ao,pn,un,hn,it,Et,Qe,Xt,di,jt,zt,yn,ct,Oe,he,fa,Dd,fo,_g,Fd,yg,Nd,El],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:600px}@media (max-width: 768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.interval-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem;font-weight:600}.interval-section[_ngcontent-%COMP%] .interval-fields[_ngcontent-%COMP%]{display:flex;gap:1rem}.interval-section[_ngcontent-%COMP%] .interval-fields[_ngcontent-%COMP%] .interval-value[_ngcontent-%COMP%], .interval-section[_ngcontent-%COMP%] .interval-fields[_ngcontent-%COMP%] .interval-unit[_ngcontent-%COMP%]{flex:1}.days-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem;font-weight:600}.days-section[_ngcontent-%COMP%] .days-checkboxes[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem;margin-bottom:.5rem}.days-section[_ngcontent-%COMP%] .days-checkboxes[_ngcontent-%COMP%] mat-checkbox[_ngcontent-%COMP%]{min-width:120px}.days-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary)}.end-condition-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem;font-weight:600}.parameters-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:.5rem}.parameters-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.parameters-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] .mode-toggle[_ngcontent-%COMP%]{height:32px}.parameters-section[_ngcontent-%COMP%] .parameters-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%] .param-key[_ngcontent-%COMP%]{flex:1}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%] .param-value[_ngcontent-%COMP%]{flex:2}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{margin-top:8px}.parameters-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.85rem;color:var(--color-text-secondary)}.enabled-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.enabled-section[_ngcontent-%COMP%] mat-checkbox[_ngcontent-%COMP%]{display:block;margin-bottom:.5rem}.enabled-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}"]})};function Sx(o,t){o&1&&(s(0,"div",12),p(1,"Loading schedulers..."),l())}function kx(o,t){if(o&1&&(s(0,"div",13),p(1),l()),o&2){let e=u();d(),F(e.errorMessage)}}function Mx(o,t){o&1&&(s(0,"div",14),p(1," No schedulers found. Create your first scheduler to automate prompt execution. "),l())}function Tx(o,t){o&1&&(s(0,"div",14),p(1," No schedulers match your search. "),l())}function Ex(o,t){if(o&1&&(s(0,"span",31),p(1),l()),o&2){let e=u().$implicit;w("title",Mn("Created by ",e.createdBy)),d(),te(" \u{1F464} ",e.createdBy," ")}}function Px(o,t){if(o&1&&(s(0,"div",22)(1,"span",23),p(2,"Last Run:"),l(),s(3,"span",24),p(4),Jn(5,"date"),l()()),o&2){let e=u().$implicit;d(4),F(Pr(5,1,e.lastRun,"short"))}}function Ox(o,t){if(o&1){let e=M();s(0,"div",17)(1,"div",18)(2,"h3"),p(3),s(4,"span",19),p(5),l(),$e(6,Ex,2,3,"span",20),l(),s(7,"div",21)(8,"div",22)(9,"span",23),p(10,"Prompt:"),l(),s(11,"span",24),p(12),l()(),s(13,"div",22)(14,"span",23),p(15,"Schedule:"),l(),s(16,"span",24),p(17),l()(),s(18,"div",22)(19,"span",23),p(20,"Next Run:"),l(),s(21,"span",24),p(22),l()(),$e(23,Px,6,4,"div",25),l()(),s(24,"div",26)(25,"button",27),_("click",function(){let n=v(e).$implicit,r=u(2);return y(r.editScheduler(n))}),p(26,"Edit"),l(),s(27,"button",28),_("click",function(){let n=v(e).$implicit,r=u(2);return y(r.toggleEnabled(n))}),p(28),l(),s(29,"button",29),_("click",function(){let n=v(e).$implicit,r=u(2);return y(r.runNow(n.id))}),p(30,"Run Now"),l(),s(31,"button",30),_("click",function(){let n=v(e).$implicit,r=u(2);return y(r.deleteScheduler(n.id))}),p(32,"Delete"),l()()()}if(o&2){let e=t.$implicit,i=u(2);d(3),te(" ",e.name," "),d(),E("enabled",e.enabled),d(),te(" ",e.enabled?"Enabled":"Disabled"," "),d(),w("ngIf",e.createdBy!==i.getCurrentUsername()),d(6),F(i.getPromptName(e.promptId)),d(5),F(i.formatInterval(e.schedule.interval)),d(5),F(i.formatNextRun(e.nextRun)),d(),w("ngIf",e.lastRun),d(4),E("btn-enabled",e.enabled)("btn-disabled",!e.enabled),d(),te(" ",e.enabled?"Disable":"Enable"," ")}}function Ax(o,t){if(o&1&&(s(0,"div",15),$e(1,Ox,33,14,"div",16),l()),o&2){let e=u();d(),w("ngForOf",e.filteredSchedulers)}}var Pl=class o{schedulerApi=m(yr);promptApi=m(ci);configApi=m(Qi);dialog=m(yi);schedulers=[];filteredSchedulers=[];prompts=[];searchQuery="";showOnlyMine=!0;isLoading=!1;errorMessage="";currentUsername="";ngOnInit(){this.configApi.getUserConfig().subscribe({next:t=>{this.currentUsername=t.username??"",console.log("[SCHEDULER_MANAGER] Current username:",this.currentUsername)},error:t=>{console.error("[SCHEDULER_MANAGER] Error loading user config:",t)}}),this.loadPrompts(),this.loadSchedulers()}loadPrompts(){this.promptApi.listPrompts().subscribe({next:t=>{this.prompts=t},error:t=>{console.error("Error loading prompts:",t)}})}loadSchedulers(){this.isLoading=!0,this.schedulerApi.listSchedulers().subscribe({next:t=>{this.schedulers=t,this.applyFilter(),this.isLoading=!1},error:t=>{console.error("Error loading schedulers:",t),this.errorMessage="Failed to load schedulers",this.isLoading=!1}})}deleteScheduler(t){confirm("Are you sure you want to delete this scheduler?")&&this.schedulerApi.deleteScheduler(t).subscribe({next:()=>{this.loadSchedulers()},error:e=>{console.error("Error deleting scheduler:",e);let i=e?.error?.error??e?.message??"Failed to delete scheduler";alert(`Failed to delete scheduler: ${i}`)}})}toggleEnabled(t){(t.enabled?this.schedulerApi.disableScheduler(t.id):this.schedulerApi.enableScheduler(t.id)).subscribe({next:()=>{this.loadSchedulers()},error:i=>{console.error("Error toggling scheduler:",i);let n=i?.error?.error??i?.message??"Failed to toggle scheduler";alert(`Failed to toggle scheduler: ${n}`)}})}runNow(t){this.schedulerApi.runSchedulerNow(t).subscribe({next:e=>{alert(`Scheduler executed successfully! Thread ID: ${e.threadId}`),this.loadSchedulers()},error:e=>{console.error("Error running scheduler:",e);let i=e?.error?.error??e?.message??"Failed to run scheduler";alert(`Failed to run scheduler: ${i}`)}})}formatNextRun(t){return t?new Date(t).toLocaleString():"Expired or completed"}getCurrentUsername(){return this.currentUsername}getPromptName(t){let e=this.prompts.find(i=>i.id===t);return e?e.name:t}formatInterval(t){let e=RegExp(/^(\d+)(min|h|d|M)$/).exec(t);if(!e)return t;let[,i,n]=e;if(!i||!n)return t;let a={min:"minute",h:"hour",d:"day",M:"month"}[n]??n;return`Every ${i} ${a}${parseInt(i,10)>1?"s":""}`}normalizeUsername(t){return t.replace(/[.\s]+/g,"_")}isMyScheduler(t){if(!this.currentUsername)return!1;let e=this.normalizeUsername(this.currentUsername.toLowerCase());return this.normalizeUsername(t.createdBy.toLowerCase())===e}applyFilter(){let t=this.searchQuery.toLowerCase().trim(),e=this.showOnlyMine&&this.currentUsername?this.schedulers.filter(i=>this.isMyScheduler(i)):[...this.schedulers];t&&(e=e.filter(i=>i.name.toLowerCase().includes(t)||i.promptId.toLowerCase().includes(t)||this.getPromptName(i.promptId).toLowerCase().includes(t)?!0:i.createdBy.toLowerCase().includes(t))),this.filteredSchedulers=e}onSearchChange(){this.applyFilter()}createScheduler(){this.dialog.open(_a,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadSchedulers()})}editScheduler(t){this.schedulerApi.getScheduler(t.id).subscribe({next:e=>{this.dialog.open(_a,{width:"700px",maxHeight:"90vh",data:{mode:"edit",scheduler:e}}).afterClosed().subscribe(n=>{n&&this.loadSchedulers()})},error:e=>{console.error("Error loading scheduler details:",e);let i=e?.error?.error??e?.message??"Failed to load scheduler details";alert(`Failed to load scheduler details: ${i}`)}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-scheduler-manager"]],decls:23,vars:7,consts:[[1,"scheduler-manager"],[1,"header"],[1,"header-actions"],["appearance","outline",1,"search-field"],["matInput","","placeholder","Name, prompt, author...",3,"ngModelChange","input","ngModel"],["matPrefix",""],["color","primary",1,"mine-toggle",3,"ngModelChange","change","ngModel"],[1,"btn-create",3,"click"],["class","loading",4,"ngIf"],["class","error",4,"ngIf"],["class","empty",4,"ngIf"],["class","scheduler-list",4,"ngIf"],[1,"loading"],[1,"error"],[1,"empty"],[1,"scheduler-list"],["class","scheduler-item",4,"ngFor","ngForOf"],[1,"scheduler-item"],[1,"scheduler-info"],[1,"status-badge"],["class","owner-badge",3,"title",4,"ngIf"],[1,"details"],[1,"detail-row"],[1,"label"],[1,"value"],["class","detail-row",4,"ngIf"],[1,"scheduler-actions"],[1,"btn-primary",3,"click"],[3,"click"],[1,"btn-accent",3,"click"],[1,"btn-danger",3,"click"],[1,"owner-badge",3,"title"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"h2"),p(3,"Schedulers"),l(),s(4,"div",2)(5,"mat-form-field",3)(6,"mat-label"),p(7,"Search"),l(),s(8,"input",4),B("ngModelChange",function(r){return j(i.searchQuery,r)||(i.searchQuery=r),r}),_("input",function(){return i.onSearchChange()}),l(),s(9,"mat-icon",5),p(10,"search"),l()(),s(11,"mat-slide-toggle",6),B("ngModelChange",function(r){return j(i.showOnlyMine,r)||(i.showOnlyMine=r),r}),_("change",function(){return i.applyFilter()}),p(12," Mine "),l(),s(13,"button",7),_("click",function(){return i.createScheduler()}),s(14,"mat-icon"),p(15,"add"),l(),s(16,"span"),p(17,"Create Scheduler"),l()()()(),$e(18,Sx,2,0,"div",8)(19,kx,2,1,"div",9)(20,Mx,2,0,"div",10)(21,Tx,2,0,"div",10)(22,Ax,2,1,"div",11),l()),e&2&&(d(8),z("ngModel",i.searchQuery),d(3),z("ngModel",i.showOnlyMine),d(7),w("ngIf",i.isLoading),d(),w("ngIf",i.errorMessage),d(),w("ngIf",!i.isLoading&&i.schedulers.length===0),d(),w("ngIf",!i.isLoading&&i.schedulers.length>0&&i.filteredSchedulers.length===0),d(),w("ngIf",!i.isLoading&&i.filteredSchedulers.length>0))},dependencies:[Pe,Fa,Na,je,Le,Ve,ze,Oe,he,Xt,di,jt,zt,go,ct,_l,uo,Ir],styles:[".scheduler-manager[_ngcontent-%COMP%]{padding:1.5rem .5rem 1.5rem 1.5rem}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem;padding-right:1rem}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .search-field[_ngcontent-%COMP%]{width:300px;margin-bottom:-1.25em}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .mine-toggle[_ngcontent-%COMP%]{margin-bottom:-1.25em}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1.5rem;border:none;border-radius:4px;background:var(--color-primary);color:#fff;cursor:pointer;font-size:1rem;font-weight:500;white-space:nowrap}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.loading[_ngcontent-%COMP%], .error[_ngcontent-%COMP%], .empty[_ngcontent-%COMP%]{padding:1rem 1.5rem 1rem 1rem;text-align:center;color:var(--color-text-secondary)}.error[_ngcontent-%COMP%]{color:var(--color-error)}.scheduler-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding-right:1rem}.scheduler-item[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;padding:1rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-surface)}.scheduler-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.scheduler-info[_ngcontent-%COMP%]{flex:1}.scheduler-info[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.1rem;display:flex;align-items:center;gap:.5rem}.scheduler-info[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] .owner-badge[_ngcontent-%COMP%]{font-size:.75rem;padding:.25rem .5rem;background:#2196f3;color:#fff;border-radius:4px;font-weight:400}.scheduler-info[_ngcontent-%COMP%] .status-badge[_ngcontent-%COMP%]{padding:.25rem .5rem;font-size:.75rem;border-radius:4px;background:var(--color-text-secondary);color:#fff}.scheduler-info[_ngcontent-%COMP%] .status-badge.enabled[_ngcontent-%COMP%]{background:var(--color-success)}.scheduler-info[_ngcontent-%COMP%] .details[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.scheduler-info[_ngcontent-%COMP%] .detail-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;font-size:.9rem}.scheduler-info[_ngcontent-%COMP%] .detail-row[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{font-weight:600;min-width:100px;color:var(--color-text-secondary)}.scheduler-info[_ngcontent-%COMP%] .detail-row[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{color:var(--color-text)}.scheduler-actions[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.scheduler-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:.5rem 1rem;border:none;border-radius:4px;cursor:pointer;font-size:.9rem;white-space:nowrap}.scheduler-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]{background:var(--color-primary);color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-secondary[_ngcontent-%COMP%]{background:var(--color-secondary);color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-secondary[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-enabled[_ngcontent-%COMP%]{background:#4caf50;color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-enabled[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-disabled[_ngcontent-%COMP%]{background:#9e9e9e;color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-disabled[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-accent[_ngcontent-%COMP%]{background:#ff9800;color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-accent[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]{background:var(--color-error);color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]:hover{opacity:.9}"]})};var wr=class o{http=m(Ye);projectState=m(Se);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/agents`}listEditableAgents(){return this.http.get(`${this.getBaseUrl()}/editable`)}getAgent(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createAgent(t,e){return this.http.post(this.getBaseUrl(),{location:e,definition:t})}updateAgent(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,{definition:e})}listDocuments(t){return this.http.get(`${this.getBaseUrl()}/documents`,{params:{location:t}})}uploadDocument(t,e){return new Oi(i=>{let n=new FileReader;n.onload=()=>{let r=n.result.split(",")[1];this.http.post(`${this.getBaseUrl()}/documents`,{filename:e.name,content:r,mimeType:e.type},{params:{location:t}}).subscribe(i)},n.onerror=()=>i.error(n.error),n.readAsDataURL(e)})}deleteAgent(t){return this.http.delete(`${this.getBaseUrl()}/${t}`)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};function Ix(o,t){o&1&&(s(0,"p",15),p(1,"No integrations defined \u2014 agent will have access to all tools."),l())}function Dx(o,t){if(o&1){let e=M();s(0,"div",16)(1,"mat-form-field",22)(2,"mat-label"),p(3,"Integration"),l(),s(4,"input",23),B("ngModelChange",function(n){let r=v(e).$implicit;return j(r.integration,n)||(r.integration=n),y(n)}),l()(),s(5,"mat-form-field",24)(6,"mat-label"),p(7,"Tools (comma-separated)"),l(),s(8,"input",25),B("ngModelChange",function(n){let r=v(e).$implicit;return j(r.tools,n)||(r.tools=n),y(n)}),l()(),s(9,"button",26),_("click",function(){let n=v(e).$index,r=u();return y(r.removeIntegrationRow(n))}),s(10,"mat-icon"),p(11,"delete"),l()()()}if(o&2){let e=t.$implicit;d(4),z("ngModel",e.integration),d(4),z("ngModel",e.tools)}}function Rx(o,t){if(o&1&&(s(0,"p",30),p(1),l()),o&2){let e=u(2);d(),F(e.docUploadError)}}function Fx(o,t){o&1&&(s(0,"p",15),p(1,"No mandatory documents defined."),l())}function Nx(o,t){if(o&1&&I(0,"option",35),o&2){let e=t.$implicit;w("value","documents/"+e)}}function Lx(o,t){if(o&1){let e=M();s(0,"div",31)(1,"mat-form-field",32)(2,"mat-label"),p(3,"Document path"),l(),s(4,"input",33),B("ngModelChange",function(n){let r=v(e).$index,a=u(2);return j(a.mandatoryDocs[r],n)||(a.mandatoryDocs[r]=n),y(n)}),l(),s(5,"datalist",34),xe(6,Nx,1,1,"option",35,_m),l()(),s(8,"button",26),_("click",function(){let n=v(e).$index,r=u(2);return y(r.removeDocRow(n))}),s(9,"mat-icon"),p(10,"delete"),l()()()}if(o&2){let e=t.$index,i=u(2);d(4),z("ngModel",i.mandatoryDocs[e]),K("list","docs-list-"+e),d(),w("id","docs-list-"+e),d(),we(i.availableDocuments)}}function Vx(o,t){if(o&1){let e=M();s(0,"div",6)(1,"span"),p(2,"Mandatory Documents"),l(),s(3,"button",27),_("click",function(){v(e);let n=u();return y(n.addDocRow())}),s(4,"mat-icon"),p(5,"add"),l()(),s(6,"label",28)(7,"mat-icon"),p(8,"upload_file"),l(),s(9,"input",29),_("change",function(n){v(e);let r=u();return y(r.onDocFileSelected(n))}),l()()(),C(10,Rx,2,1,"p",30),C(11,Fx,2,0,"p",15),xe(12,Lx,11,3,"div",31,Kn)}if(o&2){let e=u();d(6),E("uploading",e.isUploadingDoc),d(3),w("disabled",e.isUploadingDoc),d(),x(e.docUploadError?10:-1),d(),x(e.mandatoryDocs.length===0?11:-1),d(),we(e.mandatoryDocs)}}function zx(o,t){o&1&&(s(0,"p",15),p(1,"\u{1F4A1} Documents can be added after the agent is created."),l())}function jx(o,t){if(o&1){let e=M();s(0,"div",6),p(1,"Save to"),l(),s(2,"div",36)(3,"label",37)(4,"input",38),B("ngModelChange",function(n){v(e);let r=u();return j(r.location,n)||(r.location=n),y(n)}),l(),s(5,"div",39)(6,"div",40)(7,"span",41),p(8,"\u{1F464}"),l(),s(9,"span",42),p(10,"Project config"),l()(),s(11,"p",43),p(12),l()()(),s(13,"label",37)(14,"input",44),B("ngModelChange",function(n){v(e);let r=u();return j(r.location,n)||(r.location=n),y(n)}),l(),s(15,"div",39)(16,"div",40)(17,"span",41),p(18,"\u{1F4E6}"),l(),s(19,"span",42),p(20,"Colocated"),l()(),s(21,"p",43),p(22,"Next to coday.yaml in ./agents/ (committable)"),l()()()(),s(23,"p",15),p(24,"Storage location is permanent and cannot be changed after creation."),l()}if(o&2){let e=u();d(3),E("selected",e.location==="project"),d(),z("ngModel",e.location),d(8),kn("~/.coday/projects/","{","name","}","/agents/ (not committed)"),d(),E("selected",e.location==="colocated"),d(),z("ngModel",e.location)}}function Bx(o,t){if(o&1&&(s(0,"div",17)(1,"span",6),p(2,"Storage Location"),l(),s(3,"span",45),p(4),l(),s(5,"p",15),p(6,"Cannot be changed after creation."),l()()),o&2){let e=u();d(3),E("badge-project",e.location==="project")("badge-colocated",e.location==="colocated"),d(),te(" ",e.location==="project"?"\u{1F464} Project config":"\u{1F4E6} Colocated"," ")}}function Hx(o,t){if(o&1&&(s(0,"div",18)(1,"mat-icon"),p(2,"error"),l(),s(3,"span"),p(4),l()()),o&2){let e=u();d(4),F(e.errorMessage)}}var ba=class o{agentCrudApi=m(wr);agentApi=m(Jo);dialogRef=m(ei);data=m(ji);name="";description="";instructions="";aiProvider="";modelName="";temperature=null;maxOutputTokens=null;openaiAssistantId="";integrationRows=[];mandatoryDocs=[];availableDocuments=[];isUploadingDoc=!1;docUploadError="";location="project";isSaving=!1;errorMessage="";isEditMode=!1;ngOnInit(){if(this.isEditMode=this.data.mode==="edit",this.isEditMode&&this.data.agent){let t=this.data.agent.definition;this.name=t.name,this.description=t.description,this.instructions=t.instructions??"",this.aiProvider=t.aiProvider??"",this.modelName=t.modelName??"",this.temperature=t.temperature??null,this.maxOutputTokens=t.maxOutputTokens??null,this.openaiAssistantId=t.openaiAssistantId??"",this.location=this.data.agent.source,t.integrations&&(this.integrationRows=Object.entries(t.integrations).map(([e,i])=>({integration:e,tools:i?.join(", ")??""}))),this.mandatoryDocs=[...t.mandatoryDocs??[]],this.loadAvailableDocuments()}}loadAvailableDocuments(){this.agentCrudApi.listDocuments(this.location).subscribe({next:t=>this.availableDocuments=t,error:()=>this.availableDocuments=[]})}addDocRow(){this.mandatoryDocs.push("")}removeDocRow(t){this.mandatoryDocs.splice(t,1)}onDocFileSelected(t){let e=t.target,i=e.files?.[0];i&&(this.isUploadingDoc=!0,this.docUploadError="",this.agentCrudApi.uploadDocument(this.location,i).subscribe({next:n=>{this.isUploadingDoc=!1,this.mandatoryDocs.push(n.relativePath),this.loadAvailableDocuments(),e.value=""},error:n=>{this.isUploadingDoc=!1,this.docUploadError=n?.error?.error??n?.message??"Upload failed",e.value=""}}))}addIntegrationRow(){this.integrationRows.push({integration:"",tools:""})}removeIntegrationRow(t){this.integrationRows.splice(t,1)}trackByIndex(t){return t}validateForm(){if(!this.name.trim())return this.errorMessage="Name is required",!1;if(!/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/.test(this.name.trim()))return this.errorMessage="Name must start with alphanumeric and contain only letters, digits, hyphens or underscores",!1;if(!this.description.trim())return this.errorMessage="Description is required",!1;for(let t of this.integrationRows)if(!t.integration.trim())return this.errorMessage="Integration name cannot be empty",!1;return!0}buildDefinition(){let t=this.mandatoryDocs.map(i=>i.trim()).filter(Boolean),e=this.integrationRows.length>0?Object.fromEntries(this.integrationRows.filter(i=>i.integration.trim()).map(i=>[i.integration.trim(),i.tools.split(",").map(n=>n.trim()).filter(Boolean)])):void 0;return{name:this.name.trim(),description:this.description.trim(),instructions:this.instructions.trim()||void 0,aiProvider:this.aiProvider.trim()||void 0,modelName:this.modelName.trim()||void 0,temperature:this.temperature??void 0,maxOutputTokens:this.maxOutputTokens??void 0,openaiAssistantId:this.openaiAssistantId.trim()||void 0,integrations:e,mandatoryDocs:t.length>0?t:void 0}}save(){if(this.errorMessage="",!this.validateForm())return;let t=this.buildDefinition();this.isSaving=!0,(this.isEditMode?this.agentCrudApi.updateAgent(this.name.trim(),t):this.agentCrudApi.createAgent(t,this.location)).subscribe({next:()=>{this.isSaving=!1,this.agentApi.clearAllCache(),this.dialogRef.close(!0)},error:i=>{this.isSaving=!1,this.errorMessage=i?.error?.error||i?.message||"Failed to save agent"}})}cancel(){this.dialogRef.close(!1)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-agent-form"]],decls:69,vars:18,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","my-agent","required","",3,"ngModelChange","ngModel","readonly"],["matInput","","placeholder","What does this agent do?","rows","2","required","",3,"ngModelChange","ngModel"],["matInput","","placeholder","System instructions for the agent...","rows","6",3,"ngModelChange","ngModel"],[1,"section-title"],[1,"row-2col"],["appearance","outline"],["matInput","","placeholder","e.g. anthropic, openai",3,"ngModelChange","ngModel"],["matInput","","placeholder","e.g. claude-sonnet-4-5",3,"ngModelChange","ngModel"],["matInput","","type","number","min","0","max","2","step","0.1","placeholder","0.0 \u2013 2.0",3,"ngModelChange","ngModel"],["matInput","","type","number","min","1","placeholder","e.g. 4096",3,"ngModelChange","ngModel"],["matInput","","placeholder","asst_...",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Add integration",3,"click"],[1,"hint"],[1,"integration-row"],[1,"source-display"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],["appearance","outline",1,"integration-name"],["matInput","","placeholder","e.g. GITHUB",3,"ngModelChange","ngModel"],["appearance","outline",1,"integration-tools"],["matInput","","placeholder","Leave empty for all tools",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove",3,"click"],["mat-icon-button","","type","button","title","Add document path",3,"click"],["title","Upload a document to the pool",1,"upload-btn"],["type","file","hidden","",3,"change","disabled"],[1,"doc-upload-error"],[1,"doc-row"],["appearance","outline",1,"doc-field"],["matInput","","placeholder","documents/guide.md",3,"ngModelChange","ngModel"],[3,"id"],[3,"value"],[1,"source-options"],[1,"source-option"],["type","radio","name","location","value","project",3,"ngModelChange","ngModel"],[1,"source-content"],[1,"source-header"],[1,"source-icon"],[1,"source-label"],[1,"source-description"],["type","radio","name","location","value","colocated",3,"ngModelChange","ngModel"],[1,"source-badge"]],template:function(e,i){e&1&&(s(0,"h2",0),p(1),l(),s(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),p(6,"Name"),l(),s(7,"input",3),B("ngModelChange",function(r){return j(i.name,r)||(i.name=r),r}),l(),s(8,"mat-hint"),p(9,"Alphanumeric, hyphens and underscores only. Cannot be changed after creation."),l()(),s(10,"mat-form-field",2)(11,"mat-label"),p(12,"Description"),l(),s(13,"textarea",4),B("ngModelChange",function(r){return j(i.description,r)||(i.description=r),r}),l()(),s(14,"mat-form-field",2)(15,"mat-label"),p(16,"Instructions"),l(),s(17,"textarea",5),B("ngModelChange",function(r){return j(i.instructions,r)||(i.instructions=r),r}),l(),s(18,"mat-hint"),p(19,"System prompt / instructions sent to the AI model"),l()(),s(20,"div",6),p(21,"AI Configuration"),l(),s(22,"div",7)(23,"mat-form-field",8)(24,"mat-label"),p(25,"AI Provider"),l(),s(26,"input",9),B("ngModelChange",function(r){return j(i.aiProvider,r)||(i.aiProvider=r),r}),l()(),s(27,"mat-form-field",8)(28,"mat-label"),p(29,"Model Name"),l(),s(30,"input",10),B("ngModelChange",function(r){return j(i.modelName,r)||(i.modelName=r),r}),l()()(),s(31,"div",7)(32,"mat-form-field",8)(33,"mat-label"),p(34,"Temperature"),l(),s(35,"input",11),B("ngModelChange",function(r){return j(i.temperature,r)||(i.temperature=r),r}),l(),s(36,"mat-hint"),p(37,"Leave empty for model default"),l()(),s(38,"mat-form-field",8)(39,"mat-label"),p(40,"Max Output Tokens"),l(),s(41,"input",12),B("ngModelChange",function(r){return j(i.maxOutputTokens,r)||(i.maxOutputTokens=r),r}),l(),s(42,"mat-hint"),p(43,"Leave empty for model default"),l()()(),s(44,"mat-form-field",2)(45,"mat-label"),p(46,"OpenAI Assistant ID"),l(),s(47,"input",13),B("ngModelChange",function(r){return j(i.openaiAssistantId,r)||(i.openaiAssistantId=r),r}),l(),s(48,"mat-hint"),p(49,"If set, forces aiProvider to openai"),l()(),s(50,"div",6)(51,"span"),p(52,"Integrations"),l(),s(53,"button",14),_("click",function(){return i.addIntegrationRow()}),s(54,"mat-icon"),p(55,"add"),l()()(),C(56,Ix,2,0,"p",15),xe(57,Dx,12,2,"div",16,Kn),C(59,Vx,14,5)(60,zx,2,0,"p",15),C(61,jx,25,8),C(62,Bx,7,5,"div",17),C(63,Hx,5,1,"div",18),l()(),s(64,"mat-dialog-actions",19)(65,"button",20),_("click",function(){return i.cancel()}),p(66,"Cancel"),l(),s(67,"button",21),_("click",function(){return i.save()}),p(68),l()()),e&2&&(d(),F(i.isEditMode?"Edit Agent":"Create Agent"),d(6),z("ngModel",i.name),w("readonly",i.isEditMode),d(6),z("ngModel",i.description),d(4),z("ngModel",i.instructions),d(9),z("ngModel",i.aiProvider),d(4),z("ngModel",i.modelName),d(5),z("ngModel",i.temperature),d(6),z("ngModel",i.maxOutputTokens),d(6),z("ngModel",i.openaiAssistantId),d(9),x(i.integrationRows.length===0?56:-1),d(),we(i.integrationRows),d(2),x(i.isEditMode?59:60),d(2),x(i.isEditMode?-1:61),d(),x(i.isEditMode?62:-1),d(),x(i.errorMessage?63:-1),d(2),w("disabled",i.isSaving),d(2),w("disabled",i.isSaving),d(),te(" ",i.isSaving?"Saving...":"Save"," "))},dependencies:[je,es,ts,Le,Za,Ro,Ve,Fo,is,qm,ze,ao,pn,un,hn,it,Et,Qe,Xt,di,jt,zt,yn,ct,Oe,he,fa,$o],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:560px}@media (max-width: 768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.section-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;font-size:1rem;font-weight:600;margin-top:.5rem;margin-bottom:-.25rem}.row-2col[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}@media (max-width: 768px){.row-2col[_ngcontent-%COMP%]{grid-template-columns:1fr}}.integration-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.integration-row[_ngcontent-%COMP%] .integration-name[_ngcontent-%COMP%]{flex:0 0 180px}.integration-row[_ngcontent-%COMP%] .integration-tools[_ngcontent-%COMP%]{flex:1}.hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.source-options[_ngcontent-%COMP%]{display:flex;gap:1rem;margin-bottom:.5rem}@media (max-width: 768px){.source-options[_ngcontent-%COMP%]{flex-direction:column}}.source-option[_ngcontent-%COMP%]{flex:1;display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:var(--color-bg);border:2px solid var(--color-border);border-radius:8px;cursor:pointer;transition:all .2s ease}.source-option[_ngcontent-%COMP%]:hover{border-color:var(--color-primary);background:var(--color-bg-hover)}.source-option.selected[_ngcontent-%COMP%]{border-color:var(--color-primary);background:var(--color-bg-hover);box-shadow:0 0 0 1px var(--color-primary)}.source-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin-top:2px;cursor:pointer}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%]{flex:1}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.25rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-label[_ngcontent-%COMP%]{font-weight:600;font-size:.95rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-description[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-family:monospace;line-height:1.4}.source-display[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem 1rem;border-radius:6px;font-size:.9rem;font-weight:500}.source-badge.badge-project[_ngcontent-%COMP%]{background:#2196f31a;color:#2196f3;border:1px solid rgba(33,150,243,.3)}.source-badge.badge-colocated[_ngcontent-%COMP%]{background:#4caf501a;color:#4caf50;border:1px solid rgba(76,175,80,.3)}.doc-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.doc-row[_ngcontent-%COMP%] .doc-field[_ngcontent-%COMP%]{flex:1}.upload-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;cursor:pointer;color:var(--color-text-secondary);transition:background .2s}.upload-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);color:var(--color-primary)}.upload-btn.uploading[_ngcontent-%COMP%]{opacity:.5;cursor:wait}.upload-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.doc-upload-error[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-error)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}"]})};var Wx=(o,t)=>t.name;function Ux(o,t){o&1&&(s(0,"div",7),p(1,"Loading agents..."),l())}function $x(o,t){if(o&1&&(s(0,"div",8),p(1),l()),o&2){let e=u();d(),F(e.errorMessage)}}function qx(o,t){o&1&&(s(0,"div",9),p(1,"No file-based agents found. Create your first agent to get started."),l())}function Gx(o,t){o&1&&(s(0,"div",9),p(1,"No agents match your search."),l())}function Yx(o,t){if(o&1){let e=M();s(0,"div",11)(1,"div",12)(2,"div",13)(3,"h3"),p(4),l(),s(5,"span",14),p(6),l()(),s(7,"p",15),p(8),l()(),s(9,"div",16)(10,"button",17),_("click",function(){let n=v(e).$implicit,r=u(2);return y(r.editAgent(n))}),p(11,"Edit"),l(),s(12,"button",18),_("click",function(){let n=v(e).$implicit,r=u(2);return y(r.deleteAgent(n))}),p(13,"Delete"),l()()()}if(o&2){let e=t.$implicit;d(4),F(e.name),d(),E("badge-project",e.source==="project")("badge-colocated",e.source==="colocated"),w("title",e.source==="project"?"Project config (~/.coday/)":"Colocated (next to coday.yaml)"),d(),te(" ",e.source==="project"?"\u{1F464}":"\u{1F4E6}"," "),d(2),F(e.description)}}function Qx(o,t){if(o&1&&(s(0,"div",10),xe(1,Yx,14,8,"div",11,Wx),l()),o&2){let e=u();d(),we(e.filteredAgents)}}var Ol=class o{agentCrudApi=m(wr);dialog=m(yi);agents=[];filteredAgents=[];searchQuery="";isLoading=!1;errorMessage="";ngOnInit(){this.loadAgents()}loadAgents(){this.isLoading=!0,this.errorMessage="",this.agentCrudApi.listEditableAgents().subscribe({next:t=>{this.agents=t,this.applyFilter(),this.isLoading=!1},error:t=>{console.error("Error loading agents:",t),this.errorMessage="Failed to load agents",this.isLoading=!1}})}applyFilter(){let t=this.searchQuery.toLowerCase().trim();this.filteredAgents=t?this.agents.filter(e=>e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)):[...this.agents]}onSearchChange(){this.applyFilter()}createAgent(){this.dialog.open(ba,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadAgents()})}editAgent(t){this.errorMessage="",this.agentCrudApi.getAgent(t.name).subscribe({next:e=>{this.dialog.open(ba,{width:"700px",maxHeight:"90vh",data:{mode:"edit",agent:e}}).afterClosed().subscribe(n=>{n&&this.loadAgents()})},error:e=>{console.error("Error loading agent:",e),this.errorMessage=e?.error?.error??e?.message??"Failed to load agent"}})}deleteAgent(t){confirm(`Are you sure you want to delete agent "${t.name}"?`)&&(this.errorMessage="",this.agentCrudApi.deleteAgent(t.name).subscribe({next:()=>this.loadAgents(),error:e=>{console.error("Error deleting agent:",e),this.errorMessage=e?.error?.error??e?.message??"Failed to delete agent"}}))}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-agent-manager"]],decls:21,vars:6,consts:[[1,"agent-manager"],[1,"header"],[1,"header-actions"],["appearance","outline",1,"search-field"],["matInput","","placeholder","Name or description...",3,"ngModelChange","input","ngModel"],["matPrefix",""],[1,"btn-create",3,"click"],[1,"loading"],[1,"error"],[1,"empty"],[1,"agent-list"],[1,"agent-item"],[1,"agent-info"],[1,"agent-header"],[1,"source-badge",3,"title"],[1,"description"],[1,"agent-actions"],[1,"btn-primary",3,"click"],[1,"btn-danger",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"h2"),p(3,"Agents"),l(),s(4,"div",2)(5,"mat-form-field",3)(6,"mat-label"),p(7,"Search"),l(),s(8,"input",4),B("ngModelChange",function(r){return j(i.searchQuery,r)||(i.searchQuery=r),r}),_("input",function(){return i.onSearchChange()}),l(),s(9,"mat-icon",5),p(10,"search"),l()(),s(11,"button",6),_("click",function(){return i.createAgent()}),s(12,"mat-icon"),p(13,"add"),l(),s(14,"span"),p(15,"Create Agent"),l()()()(),C(16,Ux,2,0,"div",7),C(17,$x,2,1,"div",8),C(18,qx,2,0,"div",9),C(19,Gx,2,0,"div",9),C(20,Qx,3,0,"div",10),l()),e&2&&(d(8),z("ngModel",i.searchQuery),d(8),x(i.isLoading?16:-1),d(),x(i.errorMessage?17:-1),d(),x(!i.isLoading&&i.agents.length===0?18:-1),d(),x(!i.isLoading&&i.agents.length>0&&i.filteredAgents.length===0?19:-1),d(),x(!i.isLoading&&i.filteredAgents.length>0?20:-1))},dependencies:[je,Le,Ve,ze,Oe,he,Xt,di,jt,zt,go,ct],styles:[".agent-manager[_ngcontent-%COMP%]{padding:1.5rem .5rem 1.5rem 1.5rem}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem;padding-right:1rem}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .search-field[_ngcontent-%COMP%]{width:300px;margin-bottom:-1.25em}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1.5rem;border:none;border-radius:4px;background:var(--color-primary);color:#fff;cursor:pointer;font-size:1rem;font-weight:500;white-space:nowrap}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]:hover{opacity:.9}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.loading[_ngcontent-%COMP%], .error[_ngcontent-%COMP%], .empty[_ngcontent-%COMP%]{padding:1rem 1.5rem 1rem 1rem;text-align:center;color:var(--color-text-secondary)}.error[_ngcontent-%COMP%]{color:var(--color-error)}.agent-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding-right:1rem}.agent-item[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;padding:1rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-surface)}.agent-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.agent-info[_ngcontent-%COMP%]{flex:1}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;margin-bottom:.5rem}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1.1rem}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:6px;font-size:1rem;cursor:help}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%] .source-badge.badge-project[_ngcontent-%COMP%]{background:#2196f31a;border:1px solid rgba(33,150,243,.3)}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%] .source-badge.badge-colocated[_ngcontent-%COMP%]{background:#4caf501a;border:1px solid rgba(76,175,80,.3)}.agent-info[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{margin:0;color:var(--color-text-secondary)}.agent-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.agent-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:.5rem 1rem;border:none;border-radius:4px;cursor:pointer;font-size:.9rem}.agent-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]{background:var(--color-primary);color:#fff}.agent-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover{opacity:.9}.agent-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]{background:var(--color-error);color:#fff}.agent-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]:hover{opacity:.9}"]})};var Xx=["threadSearchInput"],Kx=["*"];function Zx(o,t){if(o&1){let e=M();s(0,"button",26),_("click",function(){v(e);let n=u();return y(n.toggle())}),s(1,"mat-icon"),p(2,"menu"),l()(),s(3,"button",27),_("click",function(){v(e);let n=u();return y(n.createNewThread())}),s(4,"mat-icon",10),p(5,"play_circle"),l()()}if(o&2){let e=u();d(3),w("disabled",!e.selectedProjectName())}}function Jx(o,t){if(o&1){let e=M();s(0,"div",14)(1,"mat-icon",28),p(2,"search"),l(),s(3,"input",29,0),B("ngModelChange",function(n){v(e);let r=u();return j(r.threadSearchQuery,n)||(r.threadSearchQuery=n),y(n)}),_("input",function(){v(e);let n=u();return y(n.onThreadSearchInput())}),l(),s(5,"button",30),_("click",function(){v(e);let n=u();return y(n.closeThreadSearch())}),s(6,"mat-icon"),p(7,"close"),l()()()}if(o&2){let e=u();d(3),z("ngModel",e.threadSearchQuery)}}function ew(o,t){o&1&&(s(0,"mat-icon",18),p(1,"keyboard_arrow_up"),l())}function tw(o,t){o&1&&(s(0,"mat-icon",19),p(1,"forum"),l())}function iw(o,t){if(o&1){let e=M();s(0,"button",32),_("click",function(n){v(e);let r=u(2);return y(r.toggleThreadSearch(n))}),s(1,"mat-icon"),p(2,"search"),l()()}}function nw(o,t){if(o&1){let e=M();s(0,"a",17),_("click",function(n){return v(e),u().toggleSection("threads"),y(n.preventDefault())}),C(1,ew,2,0,"mat-icon",18)(2,tw,2,0,"mat-icon",19),s(3,"span",20),p(4,"Threads"),l(),C(5,iw,3,0,"button",31),l()}if(o&2){let e=u();E("active",e.expandedSections.threads),d(),x(e.expandedSections.threads?1:2),d(4),x(e.expandedSections.threads?5:-1)}}function ow(o,t){if(o&1){let e=M();s(0,"div",16)(1,"app-thread-selector",33),_("searchModeChange",function(n){v(e);let r=u();return y(r.onThreadSearchModeChange(n))}),l()()}if(o&2){let e=u();d(),w("searchMode",e.isThreadSearchActive)("searchQuery",e.threadSearchQuery)}}function rw(o,t){o&1&&(s(0,"mat-icon",18),p(1,"keyboard_arrow_up"),l())}function aw(o,t){o&1&&(s(0,"mat-icon",19),p(1,"tune"),l())}function sw(o,t){o&1&&(s(0,"div",21)(1,"div",34),I(2,"app-options-panel",35),l()())}function lw(o,t){if(o&1){let e=M();s(0,"div",13)(1,"a",17),_("click",function(n){return v(e),u(2).openProjectConfig(),n.preventDefault(),y(n.stopPropagation())}),s(2,"mat-icon",19),p(3,"settings_applications"),l(),s(4,"span",20),p(5,"Project Configuration"),l()()()}}function cw(o,t){o&1&&(s(0,"div",13)(1,"a",36)(2,"mat-icon",19),p(3,"settings_applications"),l(),s(4,"span",20),p(5,"Project config (No project)"),l()()())}function dw(o,t){if(o&1&&C(0,lw,6,0,"div",13)(1,cw,6,0,"div",13),o&2){let e=u();x(e.selectedProjectName()?0:1)}}function mw(o,t){if(o&1){let e=M();s(0,"div",13)(1,"a",17),_("click",function(n){return v(e),u().openAgents(),n.preventDefault(),y(n.stopPropagation())}),s(2,"mat-icon",19),p(3,"smart_toy"),l(),s(4,"span",20),p(5,"Agents"),l()()()}}function pw(o,t){o&1&&(s(0,"div",13)(1,"a",36)(2,"mat-icon",19),p(3,"smart_toy"),l(),s(4,"span",20),p(5,"Agents (No project)"),l()()())}function hw(o,t){if(o&1){let e=M();s(0,"div",13)(1,"a",17),_("click",function(n){return v(e),u().openPrompts(),n.preventDefault(),y(n.stopPropagation())}),s(2,"mat-icon",19),p(3,"description"),l(),s(4,"span",20),p(5,"Prompts"),l()()()}}function uw(o,t){o&1&&(s(0,"div",13)(1,"a",36)(2,"mat-icon",19),p(3,"description"),l(),s(4,"span",20),p(5,"Prompts (No project)"),l()()())}function gw(o,t){if(o&1){let e=M();s(0,"div",13)(1,"a",17),_("click",function(n){return v(e),u().openSchedulers(),n.preventDefault(),y(n.stopPropagation())}),s(2,"mat-icon",19),p(3,"schedule"),l(),s(4,"span",20),p(5,"Schedulers"),l()()()}}function fw(o,t){o&1&&(s(0,"div",13)(1,"a",36)(2,"mat-icon",19),p(3,"schedule"),l(),s(4,"span",20),p(5,"Schedulers (No project)"),l()()())}function _w(o,t){o&1&&(s(0,"mat-icon",18),p(1,"keyboard_arrow_up"),l())}function bw(o,t){o&1&&(s(0,"mat-icon",19),p(1,"rocket_launch"),l())}function vw(o,t){o&1&&(s(0,"div",21),I(1,"app-preview-panel"),l())}function yw(o,t){if(o&1){let e=M();s(0,"div",13)(1,"a",17),_("click",function(n){return v(e),u().toggleSection("preview"),n.preventDefault(),y(n.stopPropagation())}),C(2,_w,2,0,"mat-icon",18)(3,bw,2,0,"mat-icon",19),s(4,"span",20),p(5,"Preview Server"),l()(),C(6,vw,2,0,"div",21),l()}if(o&2){let e=u();E("expanded",e.expandedSections.preview),d(),E("active",e.expandedSections.preview),d(),x(e.expandedSections.preview?2:3),d(4),x(e.expandedSections.preview?6:-1)}}function Cw(o,t){if(o&1){let e=M();s(0,"div",25)(1,"mat-icon",37),p(2,"warning"),l(),s(3,"span",38),p(4),l(),s(5,"button",39),_("click",function(){v(e);let n=u();return y(n.configErrorMessage="")}),s(6,"mat-icon"),p(7,"close"),l()()()}if(o&2){let e=u();d(4),F(e.configErrorMessage)}}var Al=class o{destroy$=new R;isOpen=!0;isAdmin=!1;configErrorMessage="";expandedSections={threads:!0,config:!1,preview:!1};isThreadSearchActive=!1;threadSearchQuery="";threadSearchInput;dialog=m(yi);configApi=m(Qi);projectStateService=m(Se);projectApi=m(Hm);router=m(Pn);preferences=m(nt);threadStateService=m(Pt);projects=_t(this.projectStateService.projectList$);selectedProject=_t(this.projectStateService.selectedProject$);selectedProjectName=_t(this.projectStateService.selectedProject$.pipe(_e(t=>t?.name)));isProjectVolatile=_t(this.projectStateService.selectedProject$.pipe(_e(t=>t?.config?.volatile||!1)));forcedProject=_t(this.projectStateService.forcedProject$);hasPreviewConfig=_t(this.projectStateService.selectedProject$.pipe(_e(t=>!!t?.config?.preview?.command)),{initialValue:!1});ngOnInit(){let t=this.preferences.getPreference("sidenavOpen",!0);this.isOpen=t??!0,console.log("[SIDENAV] Loaded sidenav state from preferences:",this.isOpen),this.configApi.getUserConfig().pipe(L(this.destroy$)).subscribe({next:e=>{this.isAdmin=e.groups?.includes("CODAY_ADMIN")??!1,console.log("[SIDENAV] User admin status:",this.isAdmin)},error:e=>{console.error("[SIDENAV] Error loading user config for roles:",e),this.isAdmin=!1}})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}toggle(){this.isOpen=!this.isOpen,this.saveSidenavState()}close(){this.isOpen=!1,this.saveSidenavState()}saveSidenavState(){this.preferences.setPreference("sidenavOpen",this.isOpen),console.log("[SIDENAV] Saved sidenav state:",this.isOpen)}openTokenUsage(){this.configErrorMessage="",this.router.navigate(["/token-usage"]),this.close()}openUserConfig(){console.log("[SIDENAV] openUserConfig called"),this.configErrorMessage="",this.configApi.getUserConfig().pipe(L(this.destroy$)).subscribe({next:t=>{console.log("[SIDENAV] User config loaded, opening dialog"),this.dialog.open(ua,{data:{configType:"user",initialContent:JSON.stringify(t,null,2)}}).afterClosed().subscribe(i=>{i&&this.saveUserConfig(i)})},error:t=>{console.error("[SIDENAV] Error loading user config:",t),this.configErrorMessage=t?.error?.error||"Failed to load user configuration"}})}saveUserConfig(t){this.configApi.updateUserConfig(t).pipe(L(this.destroy$)).subscribe({next:e=>{console.log("[SIDENAV] User config saved successfully")},error:e=>{console.error("[SIDENAV] Error saving user config:",e),this.configErrorMessage=e?.error?.error||"Failed to save user configuration"}})}openProjectConfig(){let t=this.selectedProjectName();if(!t){console.error("[SIDENAV] No project selected"),this.configErrorMessage="No project selected. Please select a project first.";return}this.configErrorMessage="",this.projectApi.getProjectConfig(t).pipe(L(this.destroy$)).subscribe({next:e=>{console.log("[SIDENAV] Project config loaded, opening dialog"),this.dialog.open(ua,{data:{configType:"project",projectName:t,initialContent:JSON.stringify(e,null,2)}}).afterClosed().subscribe(n=>{n&&this.saveProjectConfig(t,n)})},error:e=>{console.error("[SIDENAV] Error loading project config:",e),this.configErrorMessage=e?.error?.error||"Failed to load project configuration"}})}saveProjectConfig(t,e){this.projectApi.updateProjectConfig(t,e).pipe(L(this.destroy$)).subscribe({next:i=>{console.log("[SIDENAV] Project config saved successfully")},error:i=>{console.error("[SIDENAV] Error saving project config:",i),this.configErrorMessage=i?.error?.error||"Failed to save project configuration"}})}requireProjectSelection(t){return this.selectedProjectName()?!0:(console.error(`[SIDENAV] No project selected, cannot ${t}`),this.configErrorMessage="Please select a project first",!1)}openManagerDialog(t,e){console.log(`[SIDENAV] ${e}`),this.dialog.open(t,{width:"90vw",maxWidth:"1200px",height:"90vh",maxHeight:"900px"})}openAgents(){this.requireProjectSelection("open agents")&&this.openManagerDialog(Ol,"Opening agent manager dialog")}openPrompts(){this.requireProjectSelection("open prompts")&&this.openManagerDialog(xl,"Opening prompt manager dialog")}openSchedulers(){this.requireProjectSelection("open schedulers")&&this.openManagerDialog(Pl,`Opening scheduler manager dialog for project: ${this.selectedProjectName()}`)}toggleSection(t){let e=this.expandedSections[t];Object.keys(this.expandedSections).forEach(i=>{this.expandedSections[i]=!1}),this.expandedSections[t]=!e}navigateToHome(){if(this.forcedProject()){console.log("[SIDENAV] Cannot navigate to home - forced project active");return}console.log("[SIDENAV] Navigating to home (project selection)"),this.projectStateService.clearSelection(),this.router.navigate(["/"])}createNewThread(){let t=this.selectedProjectName();if(!t){console.error("[SIDENAV] No project selected, cannot create new thread"),this.configErrorMessage="Please select a project first";return}console.log("[SIDENAV] Navigating to welcome view for new thread"),this.threadStateService.clearSelection(),this.router.navigate(["project",t])}toggleThreadSearch(t){t.stopPropagation(),this.isThreadSearchActive=!0,this.threadSearchQuery="",console.log("[SIDENAV] Thread search active:",this.isThreadSearchActive),setTimeout(()=>{this.threadSearchInput?.nativeElement.focus()},0)}closeThreadSearch(){this.isThreadSearchActive=!1,this.threadSearchQuery="",console.log("[SIDENAV] Thread search closed")}onThreadSearchInput(){console.log("[SIDENAV] Search query:",this.threadSearchQuery)}onThreadSearchModeChange(t){t||this.closeThreadSearch()}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-sidenav"]],viewQuery:function(e,i){if(e&1&&Q(Xx,5),e&2){let n;H(n=W())&&(i.threadSearchInput=n.first)}},ngContentSelectors:Kx,decls:57,vars:36,consts:[["threadSearchInput",""],[1,"sidenav-container",3,"hasBackdrop"],["mode","push","position","start",1,"app-sidenav",3,"closed","opened","disableClose"],[1,"sidenav-header"],["mat-icon-button","","title","Close menu",3,"click"],["alt","coday",3,"click","keydown.enter","keydown.space","title"],[1,"header-title-section"],[1,"sidenav-title"],[1,"new-thread-section"],["role","button","tabindex","0",1,"new-thread-link",3,"click"],["fontSet","material-icons-outlined"],[1,"new-thread-text"],[1,"sidenav-sections"],[1,"section-container"],[1,"search-header"],["role","button","tabindex","0",1,"section-toggle",3,"active"],[1,"section-content","threads"],["role","button","tabindex","0",1,"section-toggle",3,"click"],[1,"arrow-icon","expanded"],[1,"section-icon"],[1,"section-label"],[1,"section-content"],[1,"section-container",3,"expanded"],["href","https://github.com/whoz-oss/coday","target","_blank","rel","noopener noreferrer","title","Contribute on GitHub",1,"section-toggle","contribute-btn"],["alt","Coday",1,"contribute-logo"],["role","alert",1,"error-notification"],["mat-icon-button","","title","Menu","type","button",1,"sidenav-toggle-btn",3,"click"],["mat-icon-button","","title","Start a new thread","type","button",1,"sidenav-new-thread-btn",3,"click","disabled"],[1,"search-icon"],["type","text","placeholder","Search threads...",1,"search-input",3,"ngModelChange","input","ngModel"],["mat-icon-button","","title","Close search","type","button",1,"close-search-btn",3,"click"],["mat-icon-button","","title","Search threads","type","button",1,"search-button"],["mat-icon-button","","title","Search threads","type","button",1,"search-button",3,"click"],[1,"sidenav-thread-selector",3,"searchModeChange","searchMode","searchQuery"],[1,"preference-item"],[1,"inline-panel"],["role","button","tabindex","-1","aria-disabled","true",1,"section-toggle","disabled"],[1,"error-icon"],[1,"error-text"],["mat-icon-button","","aria-label","Close error message",1,"error-close",3,"click"]],template:function(e,i){e&1&&(Be(),C(0,Zx,6,1),s(1,"mat-sidenav-container",1)(2,"mat-sidenav",2),_("closed",function(){return i.close()}),s(3,"div",3)(4,"button",4),_("click",function(){return i.close()}),s(5,"mat-icon"),p(6,"chevron_left"),l()(),s(7,"img",5),_("click",function(r){return i.navigateToHome(),r.stopPropagation()})("keydown.enter",function(r){return i.navigateToHome(),r.preventDefault(),r.stopPropagation()})("keydown.space",function(r){return i.navigateToHome(),r.preventDefault(),r.stopPropagation()}),l(),s(8,"div",6)(9,"h2",7),p(10),l()()(),s(11,"div",8)(12,"a",9),_("click",function(r){return i.createNewThread(),r.preventDefault()}),s(13,"mat-icon",10),p(14,"play_circle"),l(),s(15,"span",11),p(16,"Start a new thread"),l()()(),s(17,"div",12)(18,"div",13),C(19,Jx,8,1,"div",14)(20,nw,6,4,"a",15),C(21,ow,2,2,"div",16),l(),s(22,"div",13)(23,"a",17),_("click",function(r){return i.toggleSection("config"),r.preventDefault()}),C(24,rw,2,0,"mat-icon",18)(25,aw,2,0,"mat-icon",19),s(26,"span",20),p(27,"Preferences"),l()(),C(28,sw,3,0,"div",21),l(),s(29,"div",13)(30,"a",17),_("click",function(r){return i.openTokenUsage(),r.preventDefault(),r.stopPropagation()}),s(31,"mat-icon",19),p(32,"data_usage"),l(),s(33,"span",20),p(34,"Token Usage"),l()()(),s(35,"div",13)(36,"a",17),_("click",function(r){return i.openUserConfig(),r.preventDefault(),r.stopPropagation()}),s(37,"mat-icon",19),p(38,"settings"),l(),s(39,"span",20),p(40,"User Configuration"),l()()(),C(41,dw,2,1),C(42,mw,6,0,"div",13)(43,pw,6,0,"div",13),C(44,hw,6,0,"div",13)(45,uw,6,0,"div",13),C(46,gw,6,0,"div",13)(47,fw,6,0,"div",13),C(48,yw,7,6,"div",22),s(49,"div",13)(50,"a",23),I(51,"img",24),s(52,"span",20),p(53,"Contribute on GitHub"),l()()()()(),s(54,"mat-sidenav-content"),me(55),l()(),C(56,Cw,8,1,"div",25)),e&2&&(x(i.isOpen?-1:0),d(),w("hasBackdrop",!1),d(),w("opened",i.isOpen)("disableClose",!0),d(5),E("sidenav-logo",!0)("clickable",!i.forcedProject())("disabled",i.forcedProject()),w("title",i.forcedProject()?"Project selection disabled":"Go to project selection"),K("src","CODAY-Logo.png",Qn)("role",i.forcedProject()?null:"button")("tabindex",i.forcedProject()?null:"0"),d(3),F(i.selectedProjectName()),d(7),E("has-footer",!0)("is-admin",i.isAdmin),d(),E("expanded",i.expandedSections.threads),d(),x(i.isThreadSearchActive&&i.expandedSections.threads?19:20),d(2),x(i.expandedSections.threads?21:-1),d(),E("expanded",i.expandedSections.config),d(),E("active",i.expandedSections.config),d(),x(i.expandedSections.config?24:25),d(4),x(i.expandedSections.config?28:-1),d(13),x(i.isAdmin?41:-1),d(),x(i.selectedProjectName()?42:43),d(2),x(i.selectedProjectName()?44:45),d(2),x(i.selectedProjectName()?46:47),d(2),x(i.hasPreviewConfig()?48:-1),d(3),K("src","CODAY-Logo.png",Qn),d(5),x(i.configErrorMessage?56:-1))},dependencies:[je,Le,Ve,ze,pl,Sd,Vu,dl,Oe,he,it,Qe,Wu,Uu,ma,yl,Cl],styles:['[_nghost-%COMP%]{display:block;width:100%;height:100%;position:relative}.sidenav-container[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:1400;transition:width;display:flex}.sidenav-container[_ngcontent-%COMP%] mat-sidenav[_ngcontent-%COMP%]{position:relative!important;transition:width;width:310px;flex-shrink:0}.sidenav-container[_ngcontent-%COMP%] mat-sidenav[_ngcontent-%COMP%]:not(.mat-drawer-opened){width:0!important}.sidenav-container[_ngcontent-%COMP%] mat-sidenav-content[_ngcontent-%COMP%]{width:100%;margin:0!important}[_nghost-%COMP%] .mat-drawer-backdrop{pointer-events:auto}[_nghost-%COMP%] .mat-drawer-content{pointer-events:auto!important;background:transparent!important;overflow:visible!important}.sidenav-toggle-btn[_ngcontent-%COMP%]{position:fixed!important;top:1rem!important;left:1rem!important;z-index:1500!important}.sidenav-new-thread-btn[_ngcontent-%COMP%]{position:fixed!important;top:4.5rem!important;left:1rem!important;z-index:1500!important}.sidenav-new-thread-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--color-primary)!important}.sidenav-new-thread-btn[_ngcontent-%COMP%]:disabled{opacity:.5!important}.sidenav-new-thread-btn[_ngcontent-%COMP%]:disabled mat-icon[_ngcontent-%COMP%]{color:var(--color-text-secondary)!important}.sidenav-logo-btn[_ngcontent-%COMP%]{position:fixed!important;bottom:1rem!important;left:1rem!important;z-index:1500!important;width:56px!important;height:56px!important;border-radius:50%!important;border:1px solid var(--glass-border)!important;padding:4px!important;background:var(--glass-bg)!important;backdrop-filter:var(--glass-backdrop-blur)!important;-webkit-backdrop-filter:var(--glass-backdrop-blur)!important;box-shadow:var(--glass-shadow)!important;transition:all .3s cubic-bezier(.4,0,.2,1)!important;cursor:pointer!important;pointer-events:auto!important;display:flex!important;align-items:center!important;justify-content:center!important;overflow:hidden!important;text-decoration:none!important}.sidenav-logo-btn[_ngcontent-%COMP%]:hover{transform:scale(1.08) translateY(-2px)!important;box-shadow:0 16px 48px #0003!important;border-color:var(--color-primary)!important}.sidenav-logo-btn[_ngcontent-%COMP%]:active{transform:scale(.96)!important}.sidenav-logo-btn[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:2px}.app-sidenav[_ngcontent-%COMP%]{width:310px;height:100%;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border-radius:0;overflow:hidden;display:flex;flex-direction:column}.app-sidenav[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.app-sidenav[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.app-sidenav[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-text-secondary);border-radius:4px}.app-sidenav[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text)}.sidenav-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:1.5rem 1rem .5rem;flex-shrink:0}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:4px;flex-shrink:0;transition:all .2s ease}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]{cursor:pointer}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]:hover{transform:scale(1.1);filter:drop-shadow(0 4px 12px rgba(0,0,0,.15))}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]:active{transform:scale(.95)}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]:focus{outline:2px solid var(--color-primary);outline-offset:2px}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.disabled[_ngcontent-%COMP%]{opacity:.5;cursor:not-allowed;pointer-events:none}.sidenav-header[_ngcontent-%COMP%] .header-title-section[_ngcontent-%COMP%]{flex:1;display:flex;align-items:center;min-width:0}.sidenav-header[_ngcontent-%COMP%] .header-title-section[_ngcontent-%COMP%] .sidenav-title[_ngcontent-%COMP%]{margin:0;font-size:1.25rem;font-weight:600;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.loading-section[_ngcontent-%COMP%]{padding:2rem 1rem;display:flex;align-items:center;justify-content:center}.loading-content[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:1rem;align-items:center}.loading-content[_ngcontent-%COMP%] mat-progress-bar[_ngcontent-%COMP%]{width:100%;height:4px;border-radius:2px}.loading-content[_ngcontent-%COMP%] .loading-text[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary);text-align:center}.new-thread-section[_ngcontent-%COMP%]{padding:1rem 1rem .5rem;flex-shrink:0}.new-thread-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;background:transparent;border:none;text-decoration:none;cursor:pointer;transition:all .2s ease;gap:.5rem;font-size:.95rem;font-weight:600;padding:0}.new-thread-link[_ngcontent-%COMP%] .new-thread-text[_ngcontent-%COMP%]{background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% auto;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:_ngcontent-%COMP%_gradientShift 3s ease-in-out infinite}.new-thread-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-primary);animation:_ngcontent-%COMP%_iconPulse 3s ease-in-out infinite}.new-thread-link[_ngcontent-%COMP%]:hover{transform:translate(4px)}.new-thread-link[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_iconPulse 1.5s ease-in-out infinite}.new-thread-link[_ngcontent-%COMP%]:focus{transform:scale(1.1)}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0% center}50%{background-position:100% center}to{background-position:0% center}}@keyframes _ngcontent-%COMP%_iconPulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.05)}}.sidenav-sections[_ngcontent-%COMP%]{flex:1;min-height:0;overflow:hidden;display:flex;flex-direction:column;padding:0;height:100%;max-height:calc(100vh - 122px)}.sidenav-sections[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.sidenav-sections[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.sidenav-sections[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-text-secondary);border-radius:4px}.sidenav-sections[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text)}.contribute-btn[_ngcontent-%COMP%] .contribute-logo[_ngcontent-%COMP%]{width:20px;height:20px;border-radius:2px;flex-shrink:0}.section-container[_ngcontent-%COMP%]{flex-shrink:0;display:flex;flex-direction:column}.section-container.expanded[_ngcontent-%COMP%]{flex:1;min-height:0;overflow:hidden}.section-container.expanded[_ngcontent-%COMP%] .section-content[_ngcontent-%COMP%]{flex:1;overflow-y:auto;overflow-x:hidden;border-bottom:none;position:relative}.section-container.expanded[_ngcontent-%COMP%] .section-content[_ngcontent-%COMP%]:after{content:"";position:sticky;bottom:0;left:0;right:0;height:60px;background:linear-gradient(to bottom,transparent 0%,var(--glass-bg) 100%);pointer-events:none;opacity:1;transition:opacity .3s ease;z-index:10;flex-shrink:0}.section-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;width:100%;padding:.5rem 1rem;height:50px;text-decoration:none;cursor:pointer;transition:all .2s ease;background:transparent;border:none;border-radius:0;color:var(--color-text);flex-shrink:0}.section-toggle.active[_ngcontent-%COMP%]{border-top:1px solid var(--color-border)}.section-toggle.disabled[_ngcontent-%COMP%]{opacity:.5;cursor:not-allowed;pointer-events:none}.section-toggle[_ngcontent-%COMP%] .arrow-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-text-secondary);transition:transform .2s ease;transform:rotate(0);flex-shrink:0}.section-toggle[_ngcontent-%COMP%] .section-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-text-secondary);flex-shrink:0}.section-toggle[_ngcontent-%COMP%] .section-label[_ngcontent-%COMP%]{flex:1;font-size:.9rem;color:var(--color-text);text-align:left}.section-toggle[_ngcontent-%COMP%] .search-button[_ngcontent-%COMP%]{margin-left:auto;flex-shrink:0}.section-toggle[_ngcontent-%COMP%] .search-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.section-toggle[_ngcontent-%COMP%]:hover:not(.disabled){background:var(--color-bg-hover)}.section-toggle[_ngcontent-%COMP%]:active:not(.disabled){transform:scale(.98)}.section-toggle[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary);outline-offset:-2px}.search-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem;height:50px;background:var(--color-bg-hover);border-top:1px solid var(--color-border);transition:all .2s ease}.search-header[_ngcontent-%COMP%] .search-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-text-secondary);flex-shrink:0}.search-header[_ngcontent-%COMP%] .search-input[_ngcontent-%COMP%]{flex:1;border:none;outline:none;background:transparent;color:var(--color-text);font-size:.9rem;padding:0;min-width:0}.search-header[_ngcontent-%COMP%] .search-input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-muted)}.search-header[_ngcontent-%COMP%] .close-search-btn[_ngcontent-%COMP%]{flex-shrink:0}.search-header[_ngcontent-%COMP%] .close-search-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.section-content[_ngcontent-%COMP%]{padding:.5rem 0 0;animation:_ngcontent-%COMP%_slideDown .2s ease;border-bottom:1px solid var(--color-border);display:flex;flex-direction:column}.section-content.threads[_ngcontent-%COMP%]{padding:0}@keyframes _ngcontent-%COMP%_slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.config-links[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:.5rem 1rem;margin-bottom:1rem}.sidenav-item[_ngcontent-%COMP%]{width:100%}.sidenav-item[_ngcontent-%COMP%] .item-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-text-secondary)}.sidenav-item[_ngcontent-%COMP%] .item-text[_ngcontent-%COMP%]{flex:1;font-size:.9rem}.sidenav-item[_ngcontent-%COMP%] .disabled-hint[_ngcontent-%COMP%]{font-size:.7rem;color:var(--color-text-secondary);font-style:italic}.sidenav-link.disabled[_ngcontent-%COMP%]{opacity:.5;cursor:not-allowed;color:var(--color-text-secondary)}.sidenav-link.disabled[_ngcontent-%COMP%] .item-icon[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.sidenav-link[_ngcontent-%COMP%] .item-icon[_ngcontent-%COMP%], .sidenav-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;color:var(--color-primary)}.sidenav-link[_ngcontent-%COMP%] .item-text[_ngcontent-%COMP%]{font-size:.875rem}.preference-item[_ngcontent-%COMP%]{padding-bottom:1rem;margin-bottom:1rem;border-bottom:1px solid var(--color-border)}.preference-item[_ngcontent-%COMP%]:last-child{margin-bottom:0;padding-bottom:0;border-bottom:none}.preference-item[_ngcontent-%COMP%] .preference-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;margin-bottom:.75rem;padding:0 1rem}.preference-item[_ngcontent-%COMP%] .preference-header[_ngcontent-%COMP%] .item-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.preference-item[_ngcontent-%COMP%] .preference-header[_ngcontent-%COMP%] .item-text[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.preference-item[_ngcontent-%COMP%] .preference-content[_ngcontent-%COMP%]{padding:0 1rem}.error-notification[_ngcontent-%COMP%]{position:fixed;top:5rem;left:50%;transform:translate(-50%);z-index:2000;display:flex;align-items:center;gap:.75rem;background:#ff3b3026;backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid rgba(255,59,48,.3);border-radius:16px;padding:1rem 1.5rem;box-shadow:var(--glass-shadow);animation:_ngcontent-%COMP%_errorSlideDown .3s cubic-bezier(.4,0,.2,1)}.error-notification[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{font-size:1.2rem;flex-shrink:0;color:#c00}.error-notification[_ngcontent-%COMP%] .error-text[_ngcontent-%COMP%]{flex:1;color:#c00;font-size:.9rem;font-weight:500}@keyframes _ngcontent-%COMP%_errorSlideDown{0%{opacity:0;transform:translate(-50%,-10px)}to{opacity:1;transform:translate(-50%)}}@media (max-width: 480px){.app-sidenav[_ngcontent-%COMP%]{width:280px}.sidenav-toggle-btn[_ngcontent-%COMP%]{left:.75rem!important;top:.75rem!important}.error-notification[_ngcontent-%COMP%]{left:1rem;right:1rem;transform:none;max-width:calc(100vw - 2rem)}}body.dark[_nghost-%COMP%] .app-sidenav[_ngcontent-%COMP%], body.dark [_nghost-%COMP%] .app-sidenav[_ngcontent-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .app-sidenav[_ngcontent-%COMP%]{background:#242830f2;border-right-color:#b4c8ff17}body.dark[_nghost-%COMP%] .sidenav-header[_ngcontent-%COMP%], body.dark [_nghost-%COMP%] .sidenav-header[_ngcontent-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .sidenav-header[_ngcontent-%COMP%]{background:#242830b3}']})};var Il=class o{destroy$=new R;isSetup=!1;codayService=m(Qt);preferencesService=m(nt);setup(){if(this.isSetup){console.warn("[AGENT-NOTIFICATION] Service already set up");return}console.log("[AGENT-NOTIFICATION] Setting up agent notification service"),this.codayService.isThinking$.pipe(L(this.destroy$),Eo(),ce(([t,e])=>t===!0&&e===!1)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Agent stopped thinking, notifying task finished"),this.notifyTaskFinishedIfEnabled()}),this.preferencesService.browserNotificationEnabled$.pipe(L(this.destroy$),Eo(),ce(([t,e])=>t===!1&&e===!0)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Browser notifications enabled, checking permission"),this.handleBrowserNotificationEnabled()}),this.isSetup=!0}notifyTaskFinishedIfEnabled(){this.preferencesService.getAgentNotificationEnabled()&&(this.preferencesService.getNotificationSoundEnabled()&&this.playCompletionSound(),this.preferencesService.getBrowserNotificationEnabled()&&this.sendBrowserNotification())}playCompletionSound(){try{let t=new(window.AudioContext||window.webkitAudioContext),e=t.createOscillator(),i=t.createGain();e.connect(i),i.connect(t.destination),e.frequency.setValueAtTime(700,t.currentTime),i.gain.setValueAtTime(.1,t.currentTime),i.gain.exponentialRampToValueAtTime(.01,t.currentTime+.08),e.start(t.currentTime),e.stop(t.currentTime+.08);let n=t.createOscillator(),r=t.createGain();n.connect(r),r.connect(t.destination);let a=t.currentTime+.11;n.frequency.setValueAtTime(950,a),r.gain.setValueAtTime(.1,a),r.gain.exponentialRampToValueAtTime(.01,a+.09),n.start(a),n.stop(a+.09),console.log("[AGENT-NOTIFICATION] Completion sound played")}catch(t){console.error("[AGENT-NOTIFICATION] Failed to play completion sound:",t)}}handleBrowserNotificationEnabled(){return ee(this,null,function*(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications"),this.preferencesService.setBrowserNotificationEnabled(!1);return}if(Notification.permission==="denied"){console.warn("[AGENT-NOTIFICATION] Permission denied, disabling browser notifications"),this.preferencesService.setBrowserNotificationEnabled(!1);return}if(Notification.permission==="granted"){console.log("[AGENT-NOTIFICATION] Permission already granted, showing confirmation"),this.createConfirmationNotification();return}try{(yield Notification.requestPermission())==="granted"?(console.log("[AGENT-NOTIFICATION] Permission granted, showing confirmation"),this.createConfirmationNotification()):(console.log("[AGENT-NOTIFICATION] Permission denied or dismissed"),this.preferencesService.setBrowserNotificationEnabled(!1))}catch(t){console.error("[AGENT-NOTIFICATION] Error requesting permission:",t),this.preferencesService.setBrowserNotificationEnabled(!1)}})}sendBrowserNotification(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications");return}if(document.hasFocus()){console.warn("[AGENT-NOTIFICATION] Document is focused, skipping browser notification");return}Notification.permission==="granted"?this.createTaskCompleteNotification():console.warn("[AGENT-NOTIFICATION] Permission not granted, cannot send notification")}createConfirmationNotification(){let t=new Notification("Coday - Notifications Enabled",{body:"You will be notified when the agent completes tasks",icon:"/favicon.ico",tag:"coday-notifications-enabled",requireInteraction:!1});setTimeout(()=>t.close(),4e3),t.onclick=()=>{window.focus(),t.close()},console.log("[AGENT-NOTIFICATION] Confirmation notification sent")}createTaskCompleteNotification(){let t=new Notification("Coday - Task Complete",{body:"The agent has finished and is waiting for your input",icon:"/favicon.ico",tag:"coday-task-complete",requireInteraction:!1});setTimeout(()=>t.close(),5e3),t.onclick=()=>{window.focus(),t.close()},console.log("[AGENT-NOTIFICATION] Task complete notification sent")}ngOnDestroy(){console.log("[AGENT-NOTIFICATION] Service destroyed"),this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var xw=["inputSection"];function ww(o,t){if(o&1&&I(0,"app-thread",2),o&2){let e=u();w("projectName",e.projectName)("threadId",e.threadId)}}function Sw(o,t){if(o&1){let e=M();s(0,"div",3),I(1,"app-welcome-message"),l(),s(2,"div",4,0)(4,"div",5)(5,"div",6)(6,"app-chat-textarea",7),_("messageSubmitted",function(n){v(e);let r=u();return y(r.onMessageSubmitted(n))})("voiceRecordingToggled",function(n){v(e);let r=u();return y(r.onVoiceToggled(n))})("heightChanged",function(n){v(e);let r=u();return y(r.onInputHeightChanged(n))}),l()()()()}if(o&2){let e=u();d(6),w("isDisabled",e.isSessionInitializing)("isSessionInitializing",e.isSessionInitializing)("showWelcome",!0)("isThinking",!1)("isStarting",e.isStartingFirstMessage)}}var va=class o{destroy$=new R;inputSection;projectName="";threadId=null;isSessionInitializing=!1;isStartingFirstMessage=!1;inputSectionHeight=80;codayService=m(Qt);titleService=m(ur);preferencesService=m(nt);route=m(Va);router=m(Pn);threadApiService=m(Yi);agentNotificationService=m(Il);firstMessageState=m(gr);constructor(){console.log("[MAIN-APP] Using new thread-based architecture (no clientId needed)")}ngOnInit(){this.agentNotificationService.setup(),this.setupPrintHandlers(),this.route.params.pipe(L(this.destroy$)).subscribe(t=>{let e=t.projectName,i=t.threadId||null;console.log("[MAIN-APP] Route params updated:",{project:e,thread:i,previousProject:this.projectName,previousThread:this.threadId}),this.projectName=e,this.threadId=i,this.threadId?console.log("[MAIN-APP] Thread selected - ThreadComponent will display"):(console.log("[MAIN-APP] No thread selected - showing welcome view"),this.initializeWelcomeView())})}initializeWelcomeView(){this.codayService.setTabTitleService(this.titleService)}ngAfterViewInit(){setTimeout(()=>this.updateInputSectionHeight(),100)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),window.removeEventListener("beforeprint",this.handleBeforePrint),window.removeEventListener("afterprint",this.handleAfterPrint)}onMessageSubmitted(t){console.log("[MAIN-APP] First message submitted from welcome view:",t),this.isSessionInitializing=!0,this.isStartingFirstMessage=!0,this.threadApiService.createThread().subscribe({next:e=>{console.log("[MAIN-APP] Thread created:",e.thread.id),this.firstMessageState.setPendingFirstMessage(t),this.router.navigate(["project",this.projectName,"thread",e.thread.id])},error:e=>{console.error("[MAIN-APP] Failed to create thread:",e),this.isSessionInitializing=!1,this.isStartingFirstMessage=!1,alert("Failed to create conversation: "+(e.message||"Unknown error"))}})}onVoiceToggled(t){console.log("[VOICE] Recording in welcome view:",t)}onInputHeightChanged(t){console.log("[MAIN-APP] Input height changed:",t),this.inputSectionHeight=t}updateInputSectionHeight(){if(this.inputSection?.nativeElement){let t=this.inputSection.nativeElement.offsetHeight;t!==this.inputSectionHeight&&(console.log("[MAIN-APP] Input section height updated:",t),this.inputSectionHeight=t)}}setupPrintHandlers(){window.addEventListener("beforeprint",this.handleBeforePrint),window.addEventListener("afterprint",this.handleAfterPrint)}handleBeforePrint=()=>{console.log("[PRINT] Before print event triggered");let t=this.preferencesService.getPrintTechnicalMessages();console.log("[PRINT] Print technical messages:",t),t?document.body.classList.add("print-include-technical"):document.body.classList.remove("print-include-technical")};handleAfterPrint=()=>{console.log("[PRINT] After print event triggered"),document.body.classList.remove("print-include-technical")};static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-main"]],viewQuery:function(e,i){if(e&1&&Q(xw,5),e&2){let n;H(n=W())&&(i.inputSection=n.first)}},decls:4,vars:1,consts:[["inputSection",""],[1,"app"],[3,"projectName","threadId"],[1,"welcome-section"],[1,"input-section"],[1,"input-center"],[1,"input-glass"],[3,"messageSubmitted","voiceRecordingToggled","heightChanged","isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"]],template:function(e,i){e&1&&(s(0,"app-sidenav")(1,"div",1),C(2,ww,1,2,"app-thread",2)(3,Sw,7,5),l()()),e&2&&(d(2),x(i.threadId?2:3))},dependencies:[er,ul,Yo,Al],styles:["[_nghost-%COMP%]{display:flex;height:100vh;width:100%;overflow:hidden;justify-content:center}.app[_ngcontent-%COMP%]{width:100%;max-width:100%;height:100%;display:flex;flex-direction:column;background:var(--color-bg);color:var(--color-text);transition:all .3s ease;position:relative;justify-content:center}.chat-wrapper[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;background:transparent;width:100%;padding:2.5rem 0 1.5rem;display:flex;justify-content:center}.chat-wrapper[_ngcontent-%COMP%] .chat-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 1rem}.welcome-section[_ngcontent-%COMP%]{flex-shrink:0;text-align:center;padding:2rem 1rem;animation:_ngcontent-%COMP%_fadeInUp .8s ease-out;display:flex;justify-content:center;align-items:center;width:100%}@keyframes _ngcontent-%COMP%_fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.input-section[_ngcontent-%COMP%]{flex-shrink:0;position:relative;border-top:none;background:transparent;box-shadow:none;padding:2.5rem 0 2rem;overflow-y:visible;max-height:none;width:100%;z-index:10;pointer-events:none;display:flex;justify-content:center}.input-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 1rem;display:flex;justify-content:center;align-items:end;position:relative;pointer-events:auto}.input-glass[_ngcontent-%COMP%]{background:none;box-shadow:none;width:100%;min-height:64px;display:flex;align-items:stretch;gap:0;pointer-events:auto;position:relative;overflow:visible}.input-glass[_ngcontent-%COMP%] app-chat-textarea[_ngcontent-%COMP%]{width:100%;min-width:0;flex:1 1 auto;align-self:stretch;display:flex}body.dark[_nghost-%COMP%], body.dark [_nghost-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .input-glass[_ngcontent-%COMP%]{background:#24283073;border-color:#b4c8ff17;box-shadow:0 8px 32px #0000002b,0 1.5px 8px #00000012}.choice-overlay[_ngcontent-%COMP%]{z-index:10;width:100%;display:flex;justify-content:center;align-items:center}.upload-status[_ngcontent-%COMP%]{position:fixed;bottom:100px;left:50%;transform:translate(-50%);z-index:1000;display:flex;align-items:center;padding:12px 20px;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);border-radius:16px;font-size:.9em;color:var(--color-text);box-shadow:var(--glass-shadow);max-width:300px;text-align:center}.upload-status.error[_ngcontent-%COMP%]{background:#ff3b3026;color:var(--color-error);border-color:#ff3b304d}@media (max-width: 768px){.welcome-section[_ngcontent-%COMP%]{padding:1.5rem 1rem}.input-section[_ngcontent-%COMP%]{padding:1.5rem .75rem 1rem}.input-center[_ngcontent-%COMP%]{padding:0 .5rem}}@media print{[_nghost-%COMP%]{display:block!important;height:auto!important;overflow:visible!important}.app[_ngcontent-%COMP%]{height:auto!important;overflow:visible!important;display:block!important}.input-section[_ngcontent-%COMP%], .welcome-section[_ngcontent-%COMP%]{display:none!important}}"],data:{animation:[nc("slideIn",[os(":enter",[In({transform:"translateY(100%)",opacity:0}),ns("300ms ease-out",In({transform:"translateY(0)",opacity:1}))]),os(":leave",[ns("200ms ease-in",In({transform:"translateY(100%)",opacity:0}))])])]}})};var Dl=class o{route=m(Va);ngOnInit(){console.log("[OAuth Callback] Component initialized");let t=this.route.snapshot.queryParamMap.get("code"),e=this.route.snapshot.queryParamMap.get("state"),i=this.route.snapshot.queryParamMap.get("error"),n=this.route.snapshot.queryParamMap.get("error_description");if(console.log("[OAuth Callback] Code:",t,"State:",e,"Error:",i,"Opener:",!!window.opener),i){if(console.log("[OAuth Callback] OAuth error received:",i,n),!window.opener){alert(`OAuth error: ${i}${n?" - "+n:""}. Please close this window.`);return}try{window.opener.postMessage({error:i,state:e,errorDescription:n},window.location.origin),console.log("[OAuth Callback] Error postMessage sent successfully"),setTimeout(()=>{console.log("[OAuth Callback] Closing popup after error"),window.close()},1e3)}catch(r){console.error("[OAuth Callback] Error sending error postMessage:",r),alert("OAuth error: Failed to communicate with parent window")}return}if(!t||!e){console.error("[OAuth Callback] Missing code or state");return}if(!window.opener){console.error("[OAuth Callback] No window.opener - popup may have been opened incorrectly"),alert("OAuth callback error: No parent window found. Please close this window and try again.");return}try{console.log("[OAuth Callback] Sending postMessage to parent"),window.opener.postMessage({code:t,state:e},window.location.origin),console.log("[OAuth Callback] postMessage sent successfully"),setTimeout(()=>{console.log("[OAuth Callback] Closing popup"),window.close()},1e3)}catch(r){console.error("[OAuth Callback] Error sending postMessage:",r),alert("OAuth callback error: Failed to communicate with parent window")}}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-oauth-callback"]],decls:2,vars:0,template:function(e,i){e&1&&(ii(0,"p"),p(1,"Authentication in progress..."),ni())},encapsulation:2})};var Ld=o=>ee(null,null,function*(){let t=m(Se),e=o.params.projectName;return e?t.getSelectedProjectId()===e?!0:(t.selectProject(e),(yield rm(t.selectedProject$.pipe(lm(n=>n?.name===e))))?.name===e):(console.log("[PROJECT GUARD] no project id in route"),!1)});var Cg=o=>ee(null,null,function*(){let t=m(Pt),e=o.params.threadId;if(!e)return console.log("[THREAD GUARD] no threadId in route"),!1;if(console.log("[THREAD GUARD] Checking thread:",e),console.log("[THREAD GUARD] Current selected thread:",t.getSelectedThreadId()),t.getSelectedThreadId()===e)return console.log("[THREAD GUARD] Thread already selected, allowing navigation"),!0;console.log("[THREAD GUARD] Selecting thread:",e),t.selectThread(e);try{let i=yield om(qn([t.isLoading$,t.selectedThread$]).pipe(vt(([r,a])=>console.log(`\u{1F43C} [${r?"loading":"loaded"}]`,a?.id)),ce(([r,a])=>!r&&!!a),Ut(1),_e(([r,a])=>a?.id))),n=i===e;return n?console.log("[THREAD GUARD] Thread validated, allowing navigation"):console.error("[THREAD GUARD] Thread ID mismatch - route:",e,"loaded:",i),n}catch(i){return console.error("[THREAD GUARD] Error loading thread:",i),!1}});var xg=[{path:"",component:$s},{path:"oauth/callback",component:Dl},{path:"project/:projectName",component:va,canActivate:[Ld]},{path:"project/:projectName/thread/:threadId",component:va,canActivate:[Ld,Cg]},{path:"token-usage",loadComponent:()=>import("./chunk-NP6WQ37J.js").then(o=>o.TokenUsageComponent)},{path:"agentos",loadChildren:()=>import("./chunk-HJGQW7YN.js").then(o=>o.AGENTOS_ROUTES)},{path:"**",redirectTo:""}];var Rl=class o{eventStream=m(Gi);messageApi=m(Zo);pendingStates=new Map;popupCheckInterval=null;constructor(){this.eventStream.events$.pipe(ce(t=>t.type==="oauth_request")).subscribe(t=>this.handleOAuthRequest(t)),window.addEventListener("message",t=>this.handlePopupMessage(t))}startPopupMonitoring(t,e){this.popupCheckInterval&&clearInterval(this.popupCheckInterval),this.popupCheckInterval=setInterval(()=>{if(t.closed&&(console.log("[OAuth Service] Popup closed by user"),clearInterval(this.popupCheckInterval),this.popupCheckInterval=null,this.pendingStates.has(e))){console.warn("[OAuth Service] OAuth cancelled - popup closed without completing authentication");let i=this.pendingStates.get(e);if(this.pendingStates.delete(e),i){let n=new qi({state:e,integrationName:i,error:"user_cancelled",errorDescription:"User closed the popup without completing authentication"});this.messageApi.sendMessage(n).subscribe({next:()=>console.log("[OAuth Service] Cancellation sent to backend"),error:r=>console.error("[OAuth Service] Failed to send cancellation:",r)})}}},500)}handleOAuthRequest(t){console.log("[OAuth Service] Received OAuthRequestEvent:",t.integrationName,t.state),this.pendingStates.set(t.state,t.integrationName),console.log("[OAuth Service] Pending states:",Array.from(this.pendingStates.keys()));let e=600,i=900,n=window.screenX+(window.outerWidth-e)/2,r=window.screenY+(window.outerHeight-i)/2,a=`width=${e},height=${i},left=${n},top=${r},popup=yes,resizable=yes,scrollbars=yes`,c=window.open(t.authUrl,"oauth_popup",a);console.log("[OAuth Service] Popup opened:",!!c),c&&(c.focus(),this.startPopupMonitoring(c,t.state))}handlePopupMessage(t){if(console.log("[OAuth Service] Received postMessage:",t.origin,t.data),t.origin!==window.location.origin){console.warn("[OAuth Service] Rejected message from different origin:",t.origin);return}let{code:e,state:i,error:n,errorDescription:r}=t.data??{};if(n){console.log("[OAuth Service] OAuth error received:",n,r);let h=this.pendingStates.get(i);if(h){this.pendingStates.delete(i),this.popupCheckInterval&&(clearInterval(this.popupCheckInterval),this.popupCheckInterval=null);let g=new qi({state:i,integrationName:h,error:n,errorDescription:r});this.messageApi.sendMessage(g).subscribe({next:()=>console.log("[OAuth Service] Error callback sent to backend"),error:b=>console.error("[OAuth Service] Failed to send error callback:",b)})}return}if(!e||!i){console.warn("[OAuth Service] Message missing code or state:",t.data);return}console.log("[OAuth Service] Processing callback - code:",e,"state:",i);let a=this.pendingStates.get(i);if(!a){console.warn("[OAuth Service] Unknown state received:",i,"Pending states:",Array.from(this.pendingStates.keys()));return}console.log("[OAuth Service] Found integration:",a),this.pendingStates.delete(i),this.popupCheckInterval&&(clearInterval(this.popupCheckInterval),this.popupCheckInterval=null);let c=new qi({code:e,state:i,integrationName:a});console.log("[OAuth Service] Sending callback to backend..."),this.messageApi.sendMessage(c).subscribe({next:()=>console.log("[OAuth Service] Callback sent to backend successfully"),error:h=>console.error("[OAuth Service] Failed to send callback:",h)})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};function kw(o){return()=>o.initializeDefaultProject()}function Mw(o){return()=>{console.log("[APP_INIT] OAuthService initialized")}}var wg={providers:[mm(),xm({eventCoalescing:!0}),Im(xg),Om(),Gp(),dm($o),{provide:Xl,useFactory:kw,deps:[Se],multi:!0},{provide:Xl,useFactory:Mw,deps:[Rl],multi:!0},Bm({basePath:"/api/agentos"}),{provide:Rs,useValue:{width:"80vw",maxWidth:"80vw",maxHeight:"80vh"}}]};var Fl=class o{title="client";themeService=m(_r);ngOnInit(){console.log("[APP] Application initialized with theme:",this.themeService.getCurrentTheme())}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=T({type:o,selectors:[["app-root"]],decls:1,vars:0,template:function(e,i){e&1&&I(0,"router-outlet")},dependencies:[Dm,Am],encapsulation:2})};Pm(Fl,wg).catch(o=>console.error(o));
|