@whoz-oss/coday-client 0.79.2 → 0.80.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.
- package/3rdpartylicenses.txt +26 -26
- package/browser/chunk-2HJUHP2O.js +1 -0
- package/browser/chunk-2I7BVCFA.js +1 -0
- package/browser/chunk-5CECNE3W.js +1 -0
- package/browser/chunk-ADPUMZCL.js +1 -0
- package/browser/chunk-ASTXTNCW.js +1 -0
- package/browser/chunk-EN34LXVI.js +5 -0
- package/browser/chunk-FYYZME5V.js +10 -0
- package/browser/chunk-JNUPIL7A.js +1 -0
- package/browser/chunk-LRXH43AD.js +1 -0
- package/browser/chunk-M3IE5IWD.js +1 -0
- package/browser/chunk-NP5QKZ3S.js +1 -0
- package/browser/chunk-OM6QEVE5.js +1 -0
- package/browser/chunk-SSDNZR7U.js +1 -0
- package/browser/chunk-TWBSKSZ6.js +1 -0
- package/browser/index.html +1 -1
- package/browser/main-IFLXFZMY.js +374 -0
- package/package.json +1 -1
- package/browser/chunk-C64HFRBU.js +0 -14
- package/browser/chunk-ND7OBRS6.js +0 -1
- package/browser/chunk-PA7BQGOR.js +0 -1
- package/browser/chunk-XDVJJE6Q.js +0 -1
- package/browser/main-T7FHRFIU.js +0 -374
package/browser/main-T7FHRFIU.js
DELETED
|
@@ -1,374 +0,0 @@
|
|
|
1
|
-
import{$ as gp,$a as uu,$b as Rp,$c as bu,A as dp,Aa as go,Ab as Op,Ac as Yp,B as Zn,Ba as xp,Bb as Ta,Bc as ti,C as le,Ca as m,Cb as mu,Cc as ll,D as iu,Da as qi,Db as hn,Dc as cl,E as on,Ea as Fn,Eb as ei,Ec as pt,F as vr,Fa as et,Fb as R,Fc as Xi,G as up,Ga as De,Gb as wi,Gc as Aa,H as ru,Ha as wp,Hb as h,Hc as Ki,I as lt,Ia as yr,Ib as U,Ic as $t,J as ou,Ja as el,Jb as ue,Jc as dl,K as Xs,Ka as lu,Kb as Gi,Kc as gu,L as Ks,La as Sp,Lb as j,Lc as Qp,M as Jn,Ma as tl,Mb as z,Mc as Xp,N as au,Na as P,Nb as B,Nc as bo,O as mp,Oa as de,Ob as Yi,Oc as ul,P as po,Pa as ne,Pb as Ce,Pc as ml,Q as hp,Qa as kp,Qb as Pp,Qc as hl,R as Wi,Ra as ke,Rb as Sr,Rc as He,S as At,Sa as Mp,Sb as Ap,Sc as Lt,T as Je,Ta as tt,Tb as Oa,Tc as Kp,U as L,Ua as H,Ub as rl,Uc as Zp,V as pp,Va as fe,Vb as Dp,Vc as fu,W as ve,Wa as Vt,Wb as Ip,Wc as Jp,X as J,Xa as Ep,Xb as Mt,Xc as vo,Y as dt,Ya as nl,Yb as Ct,Yc as pl,Z as O,Za as cu,Zb as fo,Zc as yo,_ as ce,_a as du,_b as Si,_c as _u,a as M,aa as q,ab as Cr,ac as Pa,ad as eg,b as be,ba as Cn,bb as K,bc as Fp,bd as tg,c as ip,ca as u,cb as w,cc as ze,cd as ut,d as re,da as fp,db as S,dc as ie,dd as gt,e as yn,ea as _p,eb as xr,ec as Nn,ed as pn,f as rp,fa as Rn,fb as Tp,fc as Np,fd as Zi,g as nn,ga as xn,gb as Le,gc as Vp,gd as Ji,h as Jd,ha as y,hb as je,hc as Lp,hd as Et,i as eu,ia as C,ib as x,ic as hu,id as jt,j as I,ja as Ci,jb as l,jc as jp,jd as Da,k as Z,ka as Zs,kb as c,kc as pu,kd as pe,l as In,la as we,lb as F,lc as zp,ld as gl,m as Nt,ma as ct,mb as wn,mc as Qi,md as zt,n as $,na as xi,nb as Sn,nc as Bp,nd as fl,o as Xn,oa as su,ob as wr,oc as _o,od as Tt,p as tu,pa as bp,pb as il,pc as ol,pd as Ee,q as op,qa as Js,qb as A,qc as al,qd as it,r as ap,ra as Me,rb as mn,rc as sl,rd as ng,s as sp,sa as vp,sb as b,sc as Hp,t as X,ta as Ne,tb as g,tc as Up,u as dn,ua as We,ub as Qe,uc as Be,v as rn,va as ae,vb as _e,vc as $p,w as nu,wa as yp,wb as kt,wc as Wp,x as lp,xa as Ea,xb as se,xc as qp,y as Kn,ya as Cp,yb as G,yc as nt,z as cp,za as un,zb as Y,zc as Gp}from"./chunk-C64HFRBU.js";var he="primary",Wa=Symbol("RouteTitle"),wu=class{params;constructor(t){this.params=t||{}}has(t){return Object.prototype.hasOwnProperty.call(this.params,t)}get(t){if(this.has(t)){let e=this.params[t];return Array.isArray(e)?e[0]:e}return null}getAll(t){if(this.has(t)){let e=this.params[t];return Array.isArray(e)?e:[e]}return[]}get keys(){return Object.keys(this.params)}};function Er(i){return new wu(i)}function dg(i,t,e){let n=e.path.split("/");if(n.length>i.length||e.pathMatch==="full"&&(t.hasChildren()||n.length<i.length))return null;let r={};for(let o=0;o<n.length;o++){let a=n[o],s=i[o];if(a[0]===":")r[a.substring(1)]=s;else if(a!==s.path)return null}return{consumed:i.slice(0,n.length),posParams:r}}function m0(i,t){if(i.length!==t.length)return!1;for(let e=0;e<i.length;++e)if(!ni(i[e],t[e]))return!1;return!0}function ni(i,t){let e=i?Su(i):void 0,n=t?Su(t):void 0;if(!e||!n||e.length!=n.length)return!1;let r;for(let o=0;o<e.length;o++)if(r=e[o],!ug(i[r],t[r]))return!1;return!0}function Su(i){return[...Object.keys(i),...Object.getOwnPropertySymbols(i)]}function ug(i,t){if(Array.isArray(i)&&Array.isArray(t)){if(i.length!==t.length)return!1;let e=[...i].sort(),n=[...t].sort();return e.every((r,o)=>n[o]===r)}else return i===t}function mg(i){return i.length>0?i[i.length-1]:null}function ki(i){return tu(i)?i:nl(i)?Nt(Promise.resolve(i)):$(i)}var h0={exact:pg,subset:gg},hg={exact:p0,subset:g0,ignored:()=>!0};function ig(i,t,e){return h0[e.paths](i.root,t.root,e.matrixParams)&&hg[e.queryParams](i.queryParams,t.queryParams)&&!(e.fragment==="exact"&&i.fragment!==t.fragment)}function p0(i,t){return ni(i,t)}function pg(i,t,e){if(!kr(i.segments,t.segments)||!vl(i.segments,t.segments,e)||i.numberOfChildren!==t.numberOfChildren)return!1;for(let n in t.children)if(!i.children[n]||!pg(i.children[n],t.children[n],e))return!1;return!0}function g0(i,t){return Object.keys(t).length<=Object.keys(i).length&&Object.keys(t).every(e=>ug(i[e],t[e]))}function gg(i,t,e){return fg(i,t,t.segments,e)}function fg(i,t,e,n){if(i.segments.length>e.length){let r=i.segments.slice(0,e.length);return!(!kr(r,e)||t.hasChildren()||!vl(r,e,n))}else if(i.segments.length===e.length){if(!kr(i.segments,e)||!vl(i.segments,e,n))return!1;for(let r in t.children)if(!i.children[r]||!gg(i.children[r],t.children[r],n))return!1;return!0}else{let r=e.slice(0,i.segments.length),o=e.slice(i.segments.length);return!kr(i.segments,r)||!vl(i.segments,r,n)||!i.children[he]?!1:fg(i.children[he],t,o,n)}}function vl(i,t,e){return t.every((n,r)=>hg[e](i[r].parameters,n.parameters))}var ri=class{root;queryParams;fragment;_queryParamMap;constructor(t=new Oe([],{}),e={},n=null){this.root=t,this.queryParams=e,this.fragment=n}get queryParamMap(){return this._queryParamMap??=Er(this.queryParams),this._queryParamMap}toString(){return b0.serialize(this)}},Oe=class{segments;children;parent=null;constructor(t,e){this.segments=t,this.children=e,Object.values(e).forEach(n=>n.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return yl(this)}},er=class{path;parameters;_parameterMap;constructor(t,e){this.path=t,this.parameters=e}get parameterMap(){return this._parameterMap??=Er(this.parameters),this._parameterMap}toString(){return bg(this)}};function f0(i,t){return kr(i,t)&&i.every((e,n)=>ni(e.parameters,t[n].parameters))}function kr(i,t){return i.length!==t.length?!1:i.every((e,n)=>e.path===t[n].path)}function _0(i,t){let e=[];return Object.entries(i.children).forEach(([n,r])=>{n===he&&(e=e.concat(t(r,n)))}),Object.entries(i.children).forEach(([n,r])=>{n!==he&&(e=e.concat(t(r,n)))}),e}var Tr=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275prov=O({token:i,factory:()=>new tr,providedIn:"root"})}return i})(),tr=class{parse(t){let e=new Mu(t);return new ri(e.parseRootSegment(),e.parseQueryParams(),e.parseFragment())}serialize(t){let e=`/${Ia(t.root,!0)}`,n=C0(t.queryParams),r=typeof t.fragment=="string"?`#${v0(t.fragment)}`:"";return`${e}${n}${r}`}},b0=new tr;function yl(i){return i.segments.map(t=>bg(t)).join("/")}function Ia(i,t){if(!i.hasChildren())return yl(i);if(t){let e=i.children[he]?Ia(i.children[he],!1):"",n=[];return Object.entries(i.children).forEach(([r,o])=>{r!==he&&n.push(`${r}:${Ia(o,!1)}`)}),n.length>0?`${e}(${n.join("//")})`:e}else{let e=_0(i,(n,r)=>r===he?[Ia(i.children[he],!1)]:[`${r}:${Ia(n,!1)}`]);return Object.keys(i.children).length===1&&i.children[he]!=null?`${yl(i)}/${e[0]}`:`${yl(i)}/(${e.join("//")})`}}function _g(i){return encodeURIComponent(i).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function _l(i){return _g(i).replace(/%3B/gi,";")}function v0(i){return encodeURI(i)}function ku(i){return _g(i).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function Cl(i){return decodeURIComponent(i)}function rg(i){return Cl(i.replace(/\+/g,"%20"))}function bg(i){return`${ku(i.path)}${y0(i.parameters)}`}function y0(i){return Object.entries(i).map(([t,e])=>`;${ku(t)}=${ku(e)}`).join("")}function C0(i){let t=Object.entries(i).map(([e,n])=>Array.isArray(n)?n.map(r=>`${_l(e)}=${_l(r)}`).join("&"):`${_l(e)}=${_l(n)}`).filter(e=>e);return t.length?`?${t.join("&")}`:""}var x0=/^[^\/()?;#]+/;function vu(i){let t=i.match(x0);return t?t[0]:""}var w0=/^[^\/()?;=#]+/;function S0(i){let t=i.match(w0);return t?t[0]:""}var k0=/^[^=?&#]+/;function M0(i){let t=i.match(k0);return t?t[0]:""}var E0=/^[^&#]+/;function T0(i){let t=i.match(E0);return t?t[0]:""}var Mu=class{url;remaining;constructor(t){this.url=t,this.remaining=t}parseRootSegment(){return this.consumeOptional("/"),this.remaining===""||this.peekStartsWith("?")||this.peekStartsWith("#")?new Oe([],{}):new Oe([],this.parseChildren())}parseQueryParams(){let t={};if(this.consumeOptional("?"))do this.parseQueryParam(t);while(this.consumeOptional("&"));return t}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(this.remaining==="")return{};this.consumeOptional("/");let t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());let e={};this.peekStartsWith("/(")&&(this.capture("/"),e=this.parseParens(!0));let n={};return this.peekStartsWith("(")&&(n=this.parseParens(!1)),(t.length>0||Object.keys(e).length>0)&&(n[he]=new Oe(t,e)),n}parseSegment(){let t=vu(this.remaining);if(t===""&&this.peekStartsWith(";"))throw new J(4009,!1);return this.capture(t),new er(Cl(t),this.parseMatrixParams())}parseMatrixParams(){let t={};for(;this.consumeOptional(";");)this.parseParam(t);return t}parseParam(t){let e=S0(this.remaining);if(!e)return;this.capture(e);let n="";if(this.consumeOptional("=")){let r=vu(this.remaining);r&&(n=r,this.capture(n))}t[Cl(e)]=Cl(n)}parseQueryParam(t){let e=M0(this.remaining);if(!e)return;this.capture(e);let n="";if(this.consumeOptional("=")){let a=T0(this.remaining);a&&(n=a,this.capture(n))}let r=rg(e),o=rg(n);if(t.hasOwnProperty(r)){let a=t[r];Array.isArray(a)||(a=[a],t[r]=a),a.push(o)}else t[r]=o}parseParens(t){let e={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){let n=vu(this.remaining),r=this.remaining[n.length];if(r!=="/"&&r!==")"&&r!==";")throw new J(4010,!1);let o;n.indexOf(":")>-1?(o=n.slice(0,n.indexOf(":")),this.capture(o),this.capture(":")):t&&(o=he);let a=this.parseChildren();e[o]=Object.keys(a).length===1?a[he]:new Oe([],a),this.consumeOptional("//")}return e}peekStartsWith(t){return this.remaining.startsWith(t)}consumeOptional(t){return this.peekStartsWith(t)?(this.remaining=this.remaining.substring(t.length),!0):!1}capture(t){if(!this.consumeOptional(t))throw new J(4011,!1)}};function vg(i){return i.segments.length>0?new Oe([],{[he]:i}):i}function yg(i){let t={};for(let[n,r]of Object.entries(i.children)){let o=yg(r);if(n===he&&o.segments.length===0&&o.hasChildren())for(let[a,s]of Object.entries(o.children))t[a]=s;else(o.segments.length>0||o.hasChildren())&&(t[n]=o)}let e=new Oe(i.segments,t);return O0(e)}function O0(i){if(i.numberOfChildren===1&&i.children[he]){let t=i.children[he];return new Oe(i.segments.concat(t.segments),t.children)}return i}function Mo(i){return i instanceof ri}function Cg(i,t,e=null,n=null){let r=xg(i);return wg(r,t,e,n)}function xg(i){let t;function e(o){let a={};for(let d of o.children){let p=e(d);a[d.outlet]=p}let s=new Oe(o.url,a);return o===i&&(t=s),s}let n=e(i.root),r=vg(n);return t??r}function wg(i,t,e,n){let r=i;for(;r.parent;)r=r.parent;if(t.length===0)return yu(r,r,r,e,n);let o=P0(t);if(o.toRoot())return yu(r,r,new Oe([],{}),e,n);let a=A0(o,r,i),s=a.processChildren?Fa(a.segmentGroup,a.index,o.commands):kg(a.segmentGroup,a.index,o.commands);return yu(r,a.segmentGroup,s,e,n)}function xl(i){return typeof i=="object"&&i!=null&&!i.outlets&&!i.segmentPath}function Va(i){return typeof i=="object"&&i!=null&&i.outlets}function yu(i,t,e,n,r){let o={};n&&Object.entries(n).forEach(([d,p])=>{o[d]=Array.isArray(p)?p.map(f=>`${f}`):`${p}`});let a;i===t?a=e:a=Sg(i,t,e);let s=vg(yg(a));return new ri(s,o,r)}function Sg(i,t,e){let n={};return Object.entries(i.children).forEach(([r,o])=>{o===t?n[r]=e:n[r]=Sg(o,t,e)}),new Oe(i.segments,n)}var wl=class{isAbsolute;numberOfDoubleDots;commands;constructor(t,e,n){if(this.isAbsolute=t,this.numberOfDoubleDots=e,this.commands=n,t&&n.length>0&&xl(n[0]))throw new J(4003,!1);let r=n.find(Va);if(r&&r!==mg(n))throw new J(4004,!1)}toRoot(){return this.isAbsolute&&this.commands.length===1&&this.commands[0]=="/"}};function P0(i){if(typeof i[0]=="string"&&i.length===1&&i[0]==="/")return new wl(!0,0,i);let t=0,e=!1,n=i.reduce((r,o,a)=>{if(typeof o=="object"&&o!=null){if(o.outlets){let s={};return Object.entries(o.outlets).forEach(([d,p])=>{s[d]=typeof p=="string"?p.split("/"):p}),[...r,{outlets:s}]}if(o.segmentPath)return[...r,o.segmentPath]}return typeof o!="string"?[...r,o]:a===0?(o.split("/").forEach((s,d)=>{d==0&&s==="."||(d==0&&s===""?e=!0:s===".."?t++:s!=""&&r.push(s))}),r):[...r,o]},[]);return new wl(e,t,n)}var wo=class{segmentGroup;processChildren;index;constructor(t,e,n){this.segmentGroup=t,this.processChildren=e,this.index=n}};function A0(i,t,e){if(i.isAbsolute)return new wo(t,!0,0);if(!e)return new wo(t,!1,NaN);if(e.parent===null)return new wo(e,!0,0);let n=xl(i.commands[0])?0:1,r=e.segments.length-1+n;return D0(e,r,i.numberOfDoubleDots)}function D0(i,t,e){let n=i,r=t,o=e;for(;o>r;){if(o-=r,n=n.parent,!n)throw new J(4005,!1);r=n.segments.length}return new wo(n,!1,r-o)}function I0(i){return Va(i[0])?i[0].outlets:{[he]:i}}function kg(i,t,e){if(i??=new Oe([],{}),i.segments.length===0&&i.hasChildren())return Fa(i,t,e);let n=R0(i,t,e),r=e.slice(n.commandIndex);if(n.match&&n.pathIndex<i.segments.length){let o=new Oe(i.segments.slice(0,n.pathIndex),{});return o.children[he]=new Oe(i.segments.slice(n.pathIndex),i.children),Fa(o,0,r)}else return n.match&&r.length===0?new Oe(i.segments,{}):n.match&&!i.hasChildren()?Eu(i,t,e):n.match?Fa(i,0,r):Eu(i,t,e)}function Fa(i,t,e){if(e.length===0)return new Oe(i.segments,{});{let n=I0(e),r={};if(Object.keys(n).some(o=>o!==he)&&i.children[he]&&i.numberOfChildren===1&&i.children[he].segments.length===0){let o=Fa(i.children[he],t,e);return new Oe(i.segments,o.children)}return Object.entries(n).forEach(([o,a])=>{typeof a=="string"&&(a=[a]),a!==null&&(r[o]=kg(i.children[o],t,a))}),Object.entries(i.children).forEach(([o,a])=>{n[o]===void 0&&(r[o]=a)}),new Oe(i.segments,r)}}function R0(i,t,e){let n=0,r=t,o={match:!1,pathIndex:0,commandIndex:0};for(;r<i.segments.length;){if(n>=e.length)return o;let a=i.segments[r],s=e[n];if(Va(s))break;let d=`${s}`,p=n<e.length-1?e[n+1]:null;if(r>0&&d===void 0)break;if(d&&p&&typeof p=="object"&&p.outlets===void 0){if(!ag(d,p,a))return o;n+=2}else{if(!ag(d,{},a))return o;n++}r++}return{match:!0,pathIndex:r,commandIndex:n}}function Eu(i,t,e){let n=i.segments.slice(0,t),r=0;for(;r<e.length;){let o=e[r];if(Va(o)){let d=F0(o.outlets);return new Oe(n,d)}if(r===0&&xl(e[0])){let d=i.segments[t];n.push(new er(d.path,og(e[0]))),r++;continue}let a=Va(o)?o.outlets[he]:`${o}`,s=r<e.length-1?e[r+1]:null;a&&s&&xl(s)?(n.push(new er(a,og(s))),r+=2):(n.push(new er(a,{})),r++)}return new Oe(n,{})}function F0(i){let t={};return Object.entries(i).forEach(([e,n])=>{typeof n=="string"&&(n=[n]),n!==null&&(t[e]=Eu(new Oe([],{}),0,n))}),t}function og(i){let t={};return Object.entries(i).forEach(([e,n])=>t[e]=`${n}`),t}function ag(i,t,e){return i==e.path&&ni(t,e.parameters)}var So="imperative",xt=(function(i){return i[i.NavigationStart=0]="NavigationStart",i[i.NavigationEnd=1]="NavigationEnd",i[i.NavigationCancel=2]="NavigationCancel",i[i.NavigationError=3]="NavigationError",i[i.RoutesRecognized=4]="RoutesRecognized",i[i.ResolveStart=5]="ResolveStart",i[i.ResolveEnd=6]="ResolveEnd",i[i.GuardsCheckStart=7]="GuardsCheckStart",i[i.GuardsCheckEnd=8]="GuardsCheckEnd",i[i.RouteConfigLoadStart=9]="RouteConfigLoadStart",i[i.RouteConfigLoadEnd=10]="RouteConfigLoadEnd",i[i.ChildActivationStart=11]="ChildActivationStart",i[i.ChildActivationEnd=12]="ChildActivationEnd",i[i.ActivationStart=13]="ActivationStart",i[i.ActivationEnd=14]="ActivationEnd",i[i.Scroll=15]="Scroll",i[i.NavigationSkipped=16]="NavigationSkipped",i})(xt||{}),fn=class{id;url;constructor(t,e){this.id=t,this.url=e}},nr=class extends fn{type=xt.NavigationStart;navigationTrigger;restoredState;constructor(t,e,n="imperative",r=null){super(t,e),this.navigationTrigger=n,this.restoredState=r}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}},Ln=class extends fn{urlAfterRedirects;type=xt.NavigationEnd;constructor(t,e,n){super(t,e),this.urlAfterRedirects=n}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}},Wt=(function(i){return i[i.Redirect=0]="Redirect",i[i.SupersededByNewNavigation=1]="SupersededByNewNavigation",i[i.NoDataFromResolver=2]="NoDataFromResolver",i[i.GuardRejected=3]="GuardRejected",i[i.Aborted=4]="Aborted",i})(Wt||{}),Eo=(function(i){return i[i.IgnoredSameUrlNavigation=0]="IgnoredSameUrlNavigation",i[i.IgnoredByUrlHandlingStrategy=1]="IgnoredByUrlHandlingStrategy",i})(Eo||{}),ii=class extends fn{reason;code;type=xt.NavigationCancel;constructor(t,e,n,r){super(t,e),this.reason=n,this.code=r}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}},oi=class extends fn{reason;code;type=xt.NavigationSkipped;constructor(t,e,n,r){super(t,e),this.reason=n,this.code=r}},To=class extends fn{error;target;type=xt.NavigationError;constructor(t,e,n,r){super(t,e),this.error=n,this.target=r}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}},La=class extends fn{urlAfterRedirects;state;type=xt.RoutesRecognized;constructor(t,e,n,r){super(t,e),this.urlAfterRedirects=n,this.state=r}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},Sl=class extends fn{urlAfterRedirects;state;type=xt.GuardsCheckStart;constructor(t,e,n,r){super(t,e),this.urlAfterRedirects=n,this.state=r}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},kl=class extends fn{urlAfterRedirects;state;shouldActivate;type=xt.GuardsCheckEnd;constructor(t,e,n,r,o){super(t,e),this.urlAfterRedirects=n,this.state=r,this.shouldActivate=o}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}},Ml=class extends fn{urlAfterRedirects;state;type=xt.ResolveStart;constructor(t,e,n,r){super(t,e),this.urlAfterRedirects=n,this.state=r}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},El=class extends fn{urlAfterRedirects;state;type=xt.ResolveEnd;constructor(t,e,n,r){super(t,e),this.urlAfterRedirects=n,this.state=r}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},Tl=class{route;type=xt.RouteConfigLoadStart;constructor(t){this.route=t}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}},Ol=class{route;type=xt.RouteConfigLoadEnd;constructor(t){this.route=t}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}},Pl=class{snapshot;type=xt.ChildActivationStart;constructor(t){this.snapshot=t}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},Al=class{snapshot;type=xt.ChildActivationEnd;constructor(t){this.snapshot=t}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},Dl=class{snapshot;type=xt.ActivationStart;constructor(t){this.snapshot=t}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},Il=class{snapshot;type=xt.ActivationEnd;constructor(t){this.snapshot=t}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},Oo=class{routerEvent;position;anchor;type=xt.Scroll;constructor(t,e,n){this.routerEvent=t,this.position=e,this.anchor=n}toString(){let t=this.position?`${this.position[0]}, ${this.position[1]}`:null;return`Scroll(anchor: '${this.anchor}', position: '${t}')`}},ja=class{},Po=class{url;navigationBehaviorOptions;constructor(t,e){this.url=t,this.navigationBehaviorOptions=e}};function N0(i){return!(i instanceof ja)&&!(i instanceof Po)}function V0(i,t){return i.providers&&!i._injector&&(i._injector=tl(i.providers,t,`Route: ${i.path}`)),i._injector??t}function Vn(i){return i.outlet||he}function L0(i,t){let e=i.filter(n=>Vn(n)===t);return e.push(...i.filter(n=>Vn(n)!==t)),e}function Io(i){if(!i)return null;if(i.routeConfig?._injector)return i.routeConfig._injector;for(let t=i.parent;t;t=t.parent){let e=t.routeConfig;if(e?._loadedInjector)return e._loadedInjector;if(e?._injector)return e._injector}return null}var Rl=class{rootInjector;outlet=null;route=null;children;attachRef=null;get injector(){return Io(this.route?.snapshot)??this.rootInjector}constructor(t){this.rootInjector=t,this.children=new Or(this.rootInjector)}},Or=(()=>{class i{rootInjector;contexts=new Map;constructor(e){this.rootInjector=e}onChildOutletCreated(e,n){let r=this.getOrCreateContext(e);r.outlet=n,this.contexts.set(e,r)}onChildOutletDestroyed(e){let n=this.getContext(e);n&&(n.outlet=null,n.attachRef=null)}onOutletDeactivated(){let e=this.contexts;return this.contexts=new Map,e}onOutletReAttached(e){this.contexts=e}getOrCreateContext(e){let n=this.getContext(e);return n||(n=new Rl(this.rootInjector),this.contexts.set(e,n)),n}getContext(e){return this.contexts.get(e)||null}static \u0275fac=function(n){return new(n||i)(Cn(Rn))};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),Fl=class{_root;constructor(t){this._root=t}get root(){return this._root.value}parent(t){let e=this.pathFromRoot(t);return e.length>1?e[e.length-2]:null}children(t){let e=Tu(t,this._root);return e?e.children.map(n=>n.value):[]}firstChild(t){let e=Tu(t,this._root);return e&&e.children.length>0?e.children[0].value:null}siblings(t){let e=Ou(t,this._root);return e.length<2?[]:e[e.length-2].children.map(r=>r.value).filter(r=>r!==t)}pathFromRoot(t){return Ou(t,this._root).map(e=>e.value)}};function Tu(i,t){if(i===t.value)return t;for(let e of t.children){let n=Tu(i,e);if(n)return n}return null}function Ou(i,t){if(i===t.value)return[t];for(let e of t.children){let n=Ou(i,e);if(n.length)return n.unshift(t),n}return[]}var gn=class{value;children;constructor(t,e){this.value=t,this.children=e}toString(){return`TreeNode(${this.value})`}};function xo(i){let t={};return i&&i.children.forEach(e=>t[e.value.outlet]=e),t}var za=class extends Fl{snapshot;constructor(t,e){super(t),this.snapshot=e,Vu(this,t)}toString(){return this.snapshot.toString()}};function Mg(i){let t=j0(i),e=new Z([new er("",{})]),n=new Z({}),r=new Z({}),o=new Z({}),a=new Z(""),s=new _n(e,n,o,a,r,he,i,t.root);return s.snapshot=t.root,new za(new gn(s,[]),t)}function j0(i){let t={},e={},n={},o=new Mr([],t,n,"",e,he,i,null,{});return new Ba("",new gn(o,[]))}var _n=class{urlSubject;paramsSubject;queryParamsSubject;fragmentSubject;dataSubject;outlet;component;snapshot;_futureSnapshot;_routerState;_paramMap;_queryParamMap;title;url;params;queryParams;fragment;data;constructor(t,e,n,r,o,a,s,d){this.urlSubject=t,this.paramsSubject=e,this.queryParamsSubject=n,this.fragmentSubject=r,this.dataSubject=o,this.outlet=a,this.component=s,this._futureSnapshot=d,this.title=this.dataSubject?.pipe(X(p=>p[Wa]))??$(void 0),this.url=t,this.params=e,this.queryParams=n,this.fragment=r,this.data=o}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=this.params.pipe(X(t=>Er(t))),this._paramMap}get queryParamMap(){return this._queryParamMap??=this.queryParams.pipe(X(t=>Er(t))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}};function Nl(i,t,e="emptyOnly"){let n,{routeConfig:r}=i;return t!==null&&(e==="always"||r?.path===""||!t.component&&!t.routeConfig?.loadComponent)?n={params:M(M({},t.params),i.params),data:M(M({},t.data),i.data),resolve:M(M(M(M({},i.data),t.data),r?.data),i._resolvedData)}:n={params:M({},i.params),data:M({},i.data),resolve:M(M({},i.data),i._resolvedData??{})},r&&Tg(r)&&(n.resolve[Wa]=r.title),n}var Mr=class{url;params;queryParams;fragment;data;outlet;component;routeConfig;_resolve;_resolvedData;_routerState;_paramMap;_queryParamMap;get title(){return this.data?.[Wa]}constructor(t,e,n,r,o,a,s,d,p){this.url=t,this.params=e,this.queryParams=n,this.fragment=r,this.data=o,this.outlet=a,this.component=s,this.routeConfig=d,this._resolve=p}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=Er(this.params),this._paramMap}get queryParamMap(){return this._queryParamMap??=Er(this.queryParams),this._queryParamMap}toString(){let t=this.url.map(n=>n.toString()).join("/"),e=this.routeConfig?this.routeConfig.path:"";return`Route(url:'${t}', path:'${e}')`}},Ba=class extends Fl{url;constructor(t,e){super(e),this.url=t,Vu(this,e)}toString(){return Eg(this._root)}};function Vu(i,t){t.value._routerState=i,t.children.forEach(e=>Vu(i,e))}function Eg(i){let t=i.children.length>0?` { ${i.children.map(Eg).join(", ")} } `:"";return`${i.value}${t}`}function Cu(i){if(i.snapshot){let t=i.snapshot,e=i._futureSnapshot;i.snapshot=e,ni(t.queryParams,e.queryParams)||i.queryParamsSubject.next(e.queryParams),t.fragment!==e.fragment&&i.fragmentSubject.next(e.fragment),ni(t.params,e.params)||i.paramsSubject.next(e.params),m0(t.url,e.url)||i.urlSubject.next(e.url),ni(t.data,e.data)||i.dataSubject.next(e.data)}else i.snapshot=i._futureSnapshot,i.dataSubject.next(i._futureSnapshot.data)}function Pu(i,t){let e=ni(i.params,t.params)&&f0(i.url,t.url),n=!i.parent!=!t.parent;return e&&!n&&(!i.parent||Pu(i.parent,t.parent))}function Tg(i){return typeof i.title=="string"||i.title===null}var Og=new q(""),qa=(()=>{class i{activated=null;get activatedComponentRef(){return this.activated}_activatedRoute=null;name=he;activateEvents=new H;deactivateEvents=new H;attachEvents=new H;detachEvents=new H;routerOutletData=Rp(void 0);parentContexts=u(Or);location=u(yr);changeDetector=u(ze);inputBinder=u(Ga,{optional:!0});supportsBindingToComponentInputs=!0;ngOnChanges(e){if(e.name){let{firstChange:n,previousValue:r}=e.name;if(n)return;this.isTrackedInParentContexts(r)&&(this.deactivate(),this.parentContexts.onChildOutletDestroyed(r)),this.initializeOutletWithName()}}ngOnDestroy(){this.isTrackedInParentContexts(this.name)&&this.parentContexts.onChildOutletDestroyed(this.name),this.inputBinder?.unsubscribeFromRouteData(this)}isTrackedInParentContexts(e){return this.parentContexts.getContext(e)?.outlet===this}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(this.parentContexts.onChildOutletCreated(this.name,this),this.activated)return;let e=this.parentContexts.getContext(this.name);e?.route&&(e.attachRef?this.attach(e.attachRef,e.route):this.activateWith(e.route,e.injector))}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new J(4012,!1);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new J(4012,!1);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new J(4012,!1);this.location.detach();let e=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(e.instance),e}attach(e,n){this.activated=e,this._activatedRoute=n,this.location.insert(e.hostView),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.attachEvents.emit(e.instance)}deactivate(){if(this.activated){let e=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(e)}}activateWith(e,n){if(this.isActivated)throw new J(4013,!1);this._activatedRoute=e;let r=this.location,a=e.snapshot.component,s=this.parentContexts.getOrCreateContext(this.name).children,d=new Au(e,s,r.injector,this.routerOutletData);this.activated=r.createComponent(a,{index:r.length,injector:d,environmentInjector:n}),this.changeDetector.markForCheck(),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.activateEvents.emit(this.activated.instance)}static \u0275fac=function(n){return new(n||i)};static \u0275dir=ne({type:i,selectors:[["router-outlet"]],inputs:{name:"name",routerOutletData:[1,"routerOutletData"]},outputs:{activateEvents:"activate",deactivateEvents:"deactivate",attachEvents:"attach",detachEvents:"detach"},exportAs:["outlet"],features:[Ne]})}return i})(),Au=class{route;childContexts;parent;outletData;constructor(t,e,n,r){this.route=t,this.childContexts=e,this.parent=n,this.outletData=r}get(t,e){return t===_n?this.route:t===Or?this.childContexts:t===Og?this.outletData:this.parent.get(t,e)}},Ga=new q(""),Lu=(()=>{class i{outletDataSubscriptions=new Map;bindActivatedRouteToOutletComponent(e){this.unsubscribeFromRouteData(e),this.subscribeToRouteData(e)}unsubscribeFromRouteData(e){this.outletDataSubscriptions.get(e)?.unsubscribe(),this.outletDataSubscriptions.delete(e)}subscribeToRouteData(e){let{activatedRoute:n}=e,r=dn([n.queryParams,n.params,n.data]).pipe(Je(([o,a,s],d)=>(s=M(M(M({},o),a),s),d===0?$(s):Promise.resolve(s)))).subscribe(o=>{if(!e.isActivated||!e.activatedComponentRef||e.activatedRoute!==n||n.component===null){this.unsubscribeFromRouteData(e);return}let a=Lp(n.component);if(!a){this.unsubscribeFromRouteData(e);return}for(let{templateName:s}of a.inputs)e.activatedComponentRef.setInput(s,o[s])});this.outletDataSubscriptions.set(e,r)}static \u0275fac=function(n){return new(n||i)};static \u0275prov=O({token:i,factory:i.\u0275fac})}return i})(),ju=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["ng-component"]],exportAs:["emptyRouterOutlet"],decls:1,vars:0,template:function(n,r){n&1&&F(0,"router-outlet")},dependencies:[qa],encapsulation:2})}return i})();function zu(i){let t=i.children&&i.children.map(zu),e=t?be(M({},i),{children:t}):M({},i);return!e.component&&!e.loadComponent&&(t||e.loadChildren)&&e.outlet&&e.outlet!==he&&(e.component=ju),e}function z0(i,t,e){let n=Ha(i,t._root,e?e._root:void 0);return new za(n,t)}function Ha(i,t,e){if(e&&i.shouldReuseRoute(t.value,e.value.snapshot)){let n=e.value;n._futureSnapshot=t.value;let r=B0(i,t,e);return new gn(n,r)}else{if(i.shouldAttach(t.value)){let o=i.retrieve(t.value);if(o!==null){let a=o.route;return a.value._futureSnapshot=t.value,a.children=t.children.map(s=>Ha(i,s)),a}}let n=H0(t.value),r=t.children.map(o=>Ha(i,o));return new gn(n,r)}}function B0(i,t,e){return t.children.map(n=>{for(let r of e.children)if(i.shouldReuseRoute(n.value,r.value.snapshot))return Ha(i,n,r);return Ha(i,n)})}function H0(i){return new _n(new Z(i.url),new Z(i.params),new Z(i.queryParams),new Z(i.fragment),new Z(i.data),i.outlet,i.component,i)}var Ao=class{redirectTo;navigationBehaviorOptions;constructor(t,e){this.redirectTo=t,this.navigationBehaviorOptions=e}},Pg="ngNavigationCancelingError";function Vl(i,t){let{redirectTo:e,navigationBehaviorOptions:n}=Mo(t)?{redirectTo:t,navigationBehaviorOptions:void 0}:t,r=Ag(!1,Wt.Redirect);return r.url=e,r.navigationBehaviorOptions=n,r}function Ag(i,t){let e=new Error(`NavigationCancelingError: ${i||""}`);return e[Pg]=!0,e.cancellationCode=t,e}function U0(i){return Dg(i)&&Mo(i.url)}function Dg(i){return!!i&&i[Pg]}var $0=(i,t,e,n)=>X(r=>(new Du(t,r.targetRouterState,r.currentRouterState,e,n).activate(i),r)),Du=class{routeReuseStrategy;futureState;currState;forwardEvent;inputBindingEnabled;constructor(t,e,n,r,o){this.routeReuseStrategy=t,this.futureState=e,this.currState=n,this.forwardEvent=r,this.inputBindingEnabled=o}activate(t){let e=this.futureState._root,n=this.currState?this.currState._root:null;this.deactivateChildRoutes(e,n,t),Cu(this.futureState.root),this.activateChildRoutes(e,n,t)}deactivateChildRoutes(t,e,n){let r=xo(e);t.children.forEach(o=>{let a=o.value.outlet;this.deactivateRoutes(o,r[a],n),delete r[a]}),Object.values(r).forEach(o=>{this.deactivateRouteAndItsChildren(o,n)})}deactivateRoutes(t,e,n){let r=t.value,o=e?e.value:null;if(r===o)if(r.component){let a=n.getContext(r.outlet);a&&this.deactivateChildRoutes(t,e,a.children)}else this.deactivateChildRoutes(t,e,n);else o&&this.deactivateRouteAndItsChildren(e,n)}deactivateRouteAndItsChildren(t,e){t.value.component&&this.routeReuseStrategy.shouldDetach(t.value.snapshot)?this.detachAndStoreRouteSubtree(t,e):this.deactivateRouteAndOutlet(t,e)}detachAndStoreRouteSubtree(t,e){let n=e.getContext(t.value.outlet),r=n&&t.value.component?n.children:e,o=xo(t);for(let a of Object.values(o))this.deactivateRouteAndItsChildren(a,r);if(n&&n.outlet){let a=n.outlet.detach(),s=n.children.onOutletDeactivated();this.routeReuseStrategy.store(t.value.snapshot,{componentRef:a,route:t,contexts:s})}}deactivateRouteAndOutlet(t,e){let n=e.getContext(t.value.outlet),r=n&&t.value.component?n.children:e,o=xo(t);for(let a of Object.values(o))this.deactivateRouteAndItsChildren(a,r);n&&(n.outlet&&(n.outlet.deactivate(),n.children.onOutletDeactivated()),n.attachRef=null,n.route=null)}activateChildRoutes(t,e,n){let r=xo(e);t.children.forEach(o=>{this.activateRoutes(o,r[o.value.outlet],n),this.forwardEvent(new Il(o.value.snapshot))}),t.children.length&&this.forwardEvent(new Al(t.value.snapshot))}activateRoutes(t,e,n){let r=t.value,o=e?e.value:null;if(Cu(r),r===o)if(r.component){let a=n.getOrCreateContext(r.outlet);this.activateChildRoutes(t,e,a.children)}else this.activateChildRoutes(t,e,n);else if(r.component){let a=n.getOrCreateContext(r.outlet);if(this.routeReuseStrategy.shouldAttach(r.snapshot)){let s=this.routeReuseStrategy.retrieve(r.snapshot);this.routeReuseStrategy.store(r.snapshot,null),a.children.onOutletReAttached(s.contexts),a.attachRef=s.componentRef,a.route=s.route.value,a.outlet&&a.outlet.attach(s.componentRef,s.route.value),Cu(s.route.value),this.activateChildRoutes(t,null,a.children)}else a.attachRef=null,a.route=r,a.outlet&&a.outlet.activateWith(r,a.injector),this.activateChildRoutes(t,null,a.children)}else this.activateChildRoutes(t,null,n)}},Ll=class{path;route;constructor(t){this.path=t,this.route=this.path[this.path.length-1]}},ko=class{component;route;constructor(t,e){this.component=t,this.route=e}};function W0(i,t,e){let n=i._root,r=t?t._root:null;return Ra(n,r,e,[n.value])}function q0(i){let t=i.routeConfig?i.routeConfig.canActivateChild:null;return!t||t.length===0?null:{node:i,guards:t}}function Ro(i,t){let e=Symbol(),n=t.get(i,e);return n===e?typeof i=="function"&&!gp(i)?i:t.get(i):n}function Ra(i,t,e,n,r={canDeactivateChecks:[],canActivateChecks:[]}){let o=xo(t);return i.children.forEach(a=>{G0(a,o[a.value.outlet],e,n.concat([a.value]),r),delete o[a.value.outlet]}),Object.entries(o).forEach(([a,s])=>Na(s,e.getContext(a),r)),r}function G0(i,t,e,n,r={canDeactivateChecks:[],canActivateChecks:[]}){let o=i.value,a=t?t.value:null,s=e?e.getContext(i.value.outlet):null;if(a&&o.routeConfig===a.routeConfig){let d=Y0(a,o,o.routeConfig.runGuardsAndResolvers);d?r.canActivateChecks.push(new Ll(n)):(o.data=a.data,o._resolvedData=a._resolvedData),o.component?Ra(i,t,s?s.children:null,n,r):Ra(i,t,e,n,r),d&&s&&s.outlet&&s.outlet.isActivated&&r.canDeactivateChecks.push(new ko(s.outlet.component,a))}else a&&Na(t,s,r),r.canActivateChecks.push(new Ll(n)),o.component?Ra(i,null,s?s.children:null,n,r):Ra(i,null,e,n,r);return r}function Y0(i,t,e){if(typeof e=="function")return e(i,t);switch(e){case"pathParamsChange":return!kr(i.url,t.url);case"pathParamsOrQueryParamsChange":return!kr(i.url,t.url)||!ni(i.queryParams,t.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!Pu(i,t)||!ni(i.queryParams,t.queryParams);case"paramsChange":default:return!Pu(i,t)}}function Na(i,t,e){let n=xo(i),r=i.value;Object.entries(n).forEach(([o,a])=>{r.component?t?Na(a,t.children.getContext(o),e):Na(a,null,e):Na(a,t,e)}),r.component?t&&t.outlet&&t.outlet.isActivated?e.canDeactivateChecks.push(new ko(t.outlet.component,r)):e.canDeactivateChecks.push(new ko(null,r)):e.canDeactivateChecks.push(new ko(null,r))}function Ya(i){return typeof i=="function"}function Q0(i){return typeof i=="boolean"}function X0(i){return i&&Ya(i.canLoad)}function K0(i){return i&&Ya(i.canActivate)}function Z0(i){return i&&Ya(i.canActivateChild)}function J0(i){return i&&Ya(i.canDeactivate)}function ey(i){return i&&Ya(i.canMatch)}function Ig(i){return i instanceof op||i?.name==="EmptyError"}var bl=Symbol("INITIAL_VALUE");function Do(){return Je(i=>dn(i.map(t=>t.pipe(lt(1),At(bl)))).pipe(X(t=>{for(let e of t)if(e!==!0){if(e===bl)return bl;if(e===!1||ty(e))return e}return!0}),le(t=>t!==bl),lt(1)))}function ty(i){return Mo(i)||i instanceof Ao}function ny(i,t){return rn(e=>{let{targetSnapshot:n,currentSnapshot:r,guards:{canActivateChecks:o,canDeactivateChecks:a}}=e;return a.length===0&&o.length===0?$(be(M({},e),{guardsResult:!0})):iy(a,n,r,i).pipe(rn(s=>s&&Q0(s)?ry(n,o,i,t):$(s)),X(s=>be(M({},e),{guardsResult:s})))})}function iy(i,t,e,n){return Nt(i).pipe(rn(r=>cy(r.component,r.route,e,t,n)),Jn(r=>r!==!0,!0))}function ry(i,t,e,n){return Nt(t).pipe(vr(r=>lp(ay(r.route.parent,n),oy(r.route,n),ly(i,r.path,e),sy(i,r.route,e))),Jn(r=>r!==!0,!0))}function oy(i,t){return i!==null&&t&&t(new Dl(i)),$(!0)}function ay(i,t){return i!==null&&t&&t(new Pl(i)),$(!0)}function sy(i,t,e){let n=t.routeConfig?t.routeConfig.canActivate:null;if(!n||n.length===0)return $(!0);let r=n.map(o=>Kn(()=>{let a=Io(t)??e,s=Ro(o,a),d=K0(s)?s.canActivate(t,i):xn(a,()=>s(t,i));return ki(d).pipe(Jn())}));return $(r).pipe(Do())}function ly(i,t,e){let n=t[t.length-1],o=t.slice(0,t.length-1).reverse().map(a=>q0(a)).filter(a=>a!==null).map(a=>Kn(()=>{let s=a.guards.map(d=>{let p=Io(a.node)??e,f=Ro(d,p),v=Z0(f)?f.canActivateChild(n,i):xn(p,()=>f(n,i));return ki(v).pipe(Jn())});return $(s).pipe(Do())}));return $(o).pipe(Do())}function cy(i,t,e,n,r){let o=t&&t.routeConfig?t.routeConfig.canDeactivate:null;if(!o||o.length===0)return $(!0);let a=o.map(s=>{let d=Io(t)??r,p=Ro(s,d),f=J0(p)?p.canDeactivate(i,t,e,n):xn(d,()=>p(i,t,e,n));return ki(f).pipe(Jn())});return $(a).pipe(Do())}function dy(i,t,e,n){let r=t.canLoad;if(r===void 0||r.length===0)return $(!0);let o=r.map(a=>{let s=Ro(a,i),d=X0(s)?s.canLoad(t,e):xn(i,()=>s(t,e));return ki(d)});return $(o).pipe(Do(),Rg(n))}function Rg(i){return rp(ve(t=>{if(typeof t!="boolean")throw Vl(i,t)}),X(t=>t===!0))}function uy(i,t,e,n){let r=t.canMatch;if(!r||r.length===0)return $(!0);let o=r.map(a=>{let s=Ro(a,i),d=ey(s)?s.canMatch(t,e):xn(i,()=>s(t,e));return ki(d)});return $(o).pipe(Do(),Rg(n))}var Ua=class{segmentGroup;constructor(t){this.segmentGroup=t||null}},$a=class extends Error{urlTree;constructor(t){super(),this.urlTree=t}};function Co(i){return Xn(new Ua(i))}function my(i){return Xn(new J(4e3,!1))}function hy(i){return Xn(Ag(!1,Wt.GuardRejected))}var Iu=class{urlSerializer;urlTree;constructor(t,e){this.urlSerializer=t,this.urlTree=e}lineralizeSegments(t,e){let n=[],r=e.root;for(;;){if(n=n.concat(r.segments),r.numberOfChildren===0)return $(n);if(r.numberOfChildren>1||!r.children[he])return my(`${t.redirectTo}`);r=r.children[he]}}applyRedirectCommands(t,e,n,r,o){return py(e,r,o).pipe(X(a=>{if(a instanceof ri)throw new $a(a);let s=this.applyRedirectCreateUrlTree(a,this.urlSerializer.parse(a),t,n);if(a[0]==="/")throw new $a(s);return s}))}applyRedirectCreateUrlTree(t,e,n,r){let o=this.createSegmentGroup(t,e.root,n,r);return new ri(o,this.createQueryParams(e.queryParams,this.urlTree.queryParams),e.fragment)}createQueryParams(t,e){let n={};return Object.entries(t).forEach(([r,o])=>{if(typeof o=="string"&&o[0]===":"){let s=o.substring(1);n[r]=e[s]}else n[r]=o}),n}createSegmentGroup(t,e,n,r){let o=this.createSegments(t,e.segments,n,r),a={};return Object.entries(e.children).forEach(([s,d])=>{a[s]=this.createSegmentGroup(t,d,n,r)}),new Oe(o,a)}createSegments(t,e,n,r){return e.map(o=>o.path[0]===":"?this.findPosParam(t,o,r):this.findOrReturn(o,n))}findPosParam(t,e,n){let r=n[e.path.substring(1)];if(!r)throw new J(4001,!1);return r}findOrReturn(t,e){let n=0;for(let r of e){if(r.path===t.path)return e.splice(n),r;n++}return t}};function py(i,t,e){if(typeof i=="string")return $(i);let n=i,{queryParams:r,fragment:o,routeConfig:a,url:s,outlet:d,params:p,data:f,title:v}=t;return ki(xn(e,()=>n({params:p,data:f,queryParams:r,fragment:o,routeConfig:a,url:s,outlet:d,title:v})))}var Ru={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function gy(i,t,e,n,r){let o=Fg(i,t,e);return o.matched?(n=V0(t,n),uy(n,t,e,r).pipe(X(a=>a===!0?o:M({},Ru)))):$(o)}function Fg(i,t,e){if(t.path==="**")return fy(e);if(t.path==="")return t.pathMatch==="full"&&(i.hasChildren()||e.length>0)?M({},Ru):{matched:!0,consumedSegments:[],remainingSegments:e,parameters:{},positionalParamSegments:{}};let r=(t.matcher||dg)(e,i,t);if(!r)return M({},Ru);let o={};Object.entries(r.posParams??{}).forEach(([s,d])=>{o[s]=d.path});let a=r.consumed.length>0?M(M({},o),r.consumed[r.consumed.length-1].parameters):o;return{matched:!0,consumedSegments:r.consumed,remainingSegments:e.slice(r.consumed.length),parameters:a,positionalParamSegments:r.posParams??{}}}function fy(i){return{matched:!0,parameters:i.length>0?mg(i).parameters:{},consumedSegments:i,remainingSegments:[],positionalParamSegments:{}}}function sg(i,t,e,n){return e.length>0&&vy(i,e,n)?{segmentGroup:new Oe(t,by(n,new Oe(e,i.children))),slicedSegments:[]}:e.length===0&&yy(i,e,n)?{segmentGroup:new Oe(i.segments,_y(i,e,n,i.children)),slicedSegments:e}:{segmentGroup:new Oe(i.segments,i.children),slicedSegments:e}}function _y(i,t,e,n){let r={};for(let o of e)if(zl(i,t,o)&&!n[Vn(o)]){let a=new Oe([],{});r[Vn(o)]=a}return M(M({},n),r)}function by(i,t){let e={};e[he]=t;for(let n of i)if(n.path===""&&Vn(n)!==he){let r=new Oe([],{});e[Vn(n)]=r}return e}function vy(i,t,e){return e.some(n=>zl(i,t,n)&&Vn(n)!==he)}function yy(i,t,e){return e.some(n=>zl(i,t,n))}function zl(i,t,e){return(i.hasChildren()||t.length>0)&&e.pathMatch==="full"?!1:e.path===""}function Cy(i,t,e){return t.length===0&&!i.children[e]}var Fu=class{};function xy(i,t,e,n,r,o,a="emptyOnly"){return new Nu(i,t,e,n,r,a,o).recognize()}var wy=31,Nu=class{injector;configLoader;rootComponentType;config;urlTree;paramsInheritanceStrategy;urlSerializer;applyRedirects;absoluteRedirectCount=0;allowRedirects=!0;constructor(t,e,n,r,o,a,s){this.injector=t,this.configLoader=e,this.rootComponentType=n,this.config=r,this.urlTree=o,this.paramsInheritanceStrategy=a,this.urlSerializer=s,this.applyRedirects=new Iu(this.urlSerializer,this.urlTree)}noMatchError(t){return new J(4002,`'${t.segmentGroup}'`)}recognize(){let t=sg(this.urlTree.root,[],[],this.config).segmentGroup;return this.match(t).pipe(X(({children:e,rootSnapshot:n})=>{let r=new gn(n,e),o=new Ba("",r),a=Cg(n,[],this.urlTree.queryParams,this.urlTree.fragment);return a.queryParams=this.urlTree.queryParams,o.url=this.urlSerializer.serialize(a),{state:o,tree:a}}))}match(t){let e=new Mr([],Object.freeze({}),Object.freeze(M({},this.urlTree.queryParams)),this.urlTree.fragment,Object.freeze({}),he,this.rootComponentType,null,{});return this.processSegmentGroup(this.injector,this.config,t,he,e).pipe(X(n=>({children:n,rootSnapshot:e})),on(n=>{if(n instanceof $a)return this.urlTree=n.urlTree,this.match(n.urlTree.root);throw n instanceof Ua?this.noMatchError(n):n}))}processSegmentGroup(t,e,n,r,o){return n.segments.length===0&&n.hasChildren()?this.processChildren(t,e,n,o):this.processSegment(t,e,n,n.segments,r,!0,o).pipe(X(a=>a instanceof gn?[a]:[]))}processChildren(t,e,n,r){let o=[];for(let a of Object.keys(n.children))a==="primary"?o.unshift(a):o.push(a);return Nt(o).pipe(vr(a=>{let s=n.children[a],d=L0(e,a);return this.processSegmentGroup(t,d,s,a,r)}),hp((a,s)=>(a.push(...s),a)),ru(null),mp(),rn(a=>{if(a===null)return Co(n);let s=Ng(a);return Sy(s),$(s)}))}processSegment(t,e,n,r,o,a,s){return Nt(e).pipe(vr(d=>this.processSegmentAgainstRoute(d._injector??t,e,d,n,r,o,a,s).pipe(on(p=>{if(p instanceof Ua)return $(null);throw p}))),Jn(d=>!!d),on(d=>{if(Ig(d))return Cy(n,r,o)?$(new Fu):Co(n);throw d}))}processSegmentAgainstRoute(t,e,n,r,o,a,s,d){return Vn(n)!==a&&(a===he||!zl(r,o,n))?Co(r):n.redirectTo===void 0?this.matchSegmentAgainstRoute(t,r,n,o,a,d):this.allowRedirects&&s?this.expandSegmentAgainstRouteUsingRedirect(t,r,e,n,o,a,d):Co(r)}expandSegmentAgainstRouteUsingRedirect(t,e,n,r,o,a,s){let{matched:d,parameters:p,consumedSegments:f,positionalParamSegments:v,remainingSegments:E}=Fg(e,r,o);if(!d)return Co(e);typeof r.redirectTo=="string"&&r.redirectTo[0]==="/"&&(this.absoluteRedirectCount++,this.absoluteRedirectCount>wy&&(this.allowRedirects=!1));let T=new Mr(o,p,Object.freeze(M({},this.urlTree.queryParams)),this.urlTree.fragment,lg(r),Vn(r),r.component??r._loadedComponent??null,r,cg(r)),k=Nl(T,s,this.paramsInheritanceStrategy);return T.params=Object.freeze(k.params),T.data=Object.freeze(k.data),this.applyRedirects.applyRedirectCommands(f,r.redirectTo,v,T,t).pipe(Je(ge=>this.applyRedirects.lineralizeSegments(r,ge)),rn(ge=>this.processSegment(t,n,e,ge.concat(E),a,!1,s)))}matchSegmentAgainstRoute(t,e,n,r,o,a){let s=gy(e,n,r,t,this.urlSerializer);return n.path==="**"&&(e.children={}),s.pipe(Je(d=>d.matched?(t=n._injector??t,this.getChildConfig(t,n,r).pipe(Je(({routes:p})=>{let f=n._loadedInjector??t,{parameters:v,consumedSegments:E,remainingSegments:T}=d,k=new Mr(E,v,Object.freeze(M({},this.urlTree.queryParams)),this.urlTree.fragment,lg(n),Vn(n),n.component??n._loadedComponent??null,n,cg(n)),V=Nl(k,a,this.paramsInheritanceStrategy);k.params=Object.freeze(V.params),k.data=Object.freeze(V.data);let{segmentGroup:ge,slicedSegments:Re}=sg(e,E,T,p);if(Re.length===0&&ge.hasChildren())return this.processChildren(f,p,ge,k).pipe(X(Ve=>new gn(k,Ve)));if(p.length===0&&Re.length===0)return $(new gn(k,[]));let Ye=Vn(n)===o;return this.processSegment(f,p,ge,Re,Ye?he:o,!0,k).pipe(X(Ve=>new gn(k,Ve instanceof gn?[Ve]:[])))}))):Co(e)))}getChildConfig(t,e,n){return e.children?$({routes:e.children,injector:t}):e.loadChildren?e._loadedRoutes!==void 0?$({routes:e._loadedRoutes,injector:e._loadedInjector}):dy(t,e,n,this.urlSerializer).pipe(rn(r=>r?this.configLoader.loadChildren(t,e).pipe(ve(o=>{e._loadedRoutes=o.routes,e._loadedInjector=o.injector})):hy(e))):$({routes:[],injector:t})}};function Sy(i){i.sort((t,e)=>t.value.outlet===he?-1:e.value.outlet===he?1:t.value.outlet.localeCompare(e.value.outlet))}function ky(i){let t=i.value.routeConfig;return t&&t.path===""}function Ng(i){let t=[],e=new Set;for(let n of i){if(!ky(n)){t.push(n);continue}let r=t.find(o=>n.value.routeConfig===o.value.routeConfig);r!==void 0?(r.children.push(...n.children),e.add(r)):t.push(n)}for(let n of e){let r=Ng(n.children);t.push(new gn(n.value,r))}return t.filter(n=>!e.has(n))}function lg(i){return i.data||{}}function cg(i){return i.resolve||{}}function My(i,t,e,n,r,o){return rn(a=>xy(i,t,e,n,a.extractedUrl,r,o).pipe(X(({state:s,tree:d})=>be(M({},a),{targetSnapshot:s,urlAfterRedirects:d}))))}function Ey(i,t){return rn(e=>{let{targetSnapshot:n,guards:{canActivateChecks:r}}=e;if(!r.length)return $(e);let o=new Set(r.map(d=>d.route)),a=new Set;for(let d of o)if(!a.has(d))for(let p of Vg(d))a.add(p);let s=0;return Nt(a).pipe(vr(d=>o.has(d)?Ty(d,n,i,t):(d.data=Nl(d,d.parent,i).resolve,$(void 0))),ve(()=>s++),au(1),rn(d=>s===a.size?$(e):In))})}function Vg(i){let t=i.children.map(e=>Vg(e)).flat();return[i,...t]}function Ty(i,t,e,n){let r=i.routeConfig,o=i._resolve;return r?.title!==void 0&&!Tg(r)&&(o[Wa]=r.title),Kn(()=>(i.data=Nl(i,i.parent,e).resolve,Oy(o,i,t,n).pipe(X(a=>(i._resolvedData=a,i.data=M(M({},i.data),a),null)))))}function Oy(i,t,e,n){let r=Su(i);if(r.length===0)return $({});let o={};return Nt(r).pipe(rn(a=>Py(i[a],t,e,n).pipe(Jn(),ve(s=>{if(s instanceof Ao)throw Vl(new tr,s);o[a]=s}))),au(1),X(()=>o),on(a=>Ig(a)?In:Xn(a)))}function Py(i,t,e,n){let r=Io(t)??n,o=Ro(i,r),a=o.resolve?o.resolve(t,e):xn(r,()=>o(t,e));return ki(a)}function xu(i){return Je(t=>{let e=i(t);return e?Nt(e).pipe(X(()=>t)):$(t)})}var Bu=(()=>{class i{buildTitle(e){let n,r=e.root;for(;r!==void 0;)n=this.getResolvedTitleForRoute(r)??n,r=r.children.find(o=>o.outlet===he);return n}getResolvedTitleForRoute(e){return e.data[Wa]}static \u0275fac=function(n){return new(n||i)};static \u0275prov=O({token:i,factory:()=>u(Lg),providedIn:"root"})}return i})(),Lg=(()=>{class i extends Bu{title;constructor(e){super(),this.title=e}updateTitle(e){let n=this.buildTitle(e);n!==void 0&&this.title.setTitle(n)}static \u0275fac=function(n){return new(n||i)(Cn(Yp))};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),Pr=new q("",{providedIn:"root",factory:()=>({})}),Ar=new q(""),Bl=(()=>{class i{componentLoaders=new WeakMap;childrenLoaders=new WeakMap;onLoadStartListener;onLoadEndListener;compiler=u(Dp);loadComponent(e,n){if(this.componentLoaders.get(n))return this.componentLoaders.get(n);if(n._loadedComponent)return $(n._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(n);let r=ki(xn(e,()=>n.loadComponent())).pipe(X(zg),Je(Bg),ve(a=>{this.onLoadEndListener&&this.onLoadEndListener(n),n._loadedComponent=a}),Ks(()=>{this.componentLoaders.delete(n)})),o=new eu(r,()=>new I).pipe(Jd());return this.componentLoaders.set(n,o),o}loadChildren(e,n){if(this.childrenLoaders.get(n))return this.childrenLoaders.get(n);if(n._loadedRoutes)return $({routes:n._loadedRoutes,injector:n._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(n);let o=jg(n,this.compiler,e,this.onLoadEndListener).pipe(Ks(()=>{this.childrenLoaders.delete(n)})),a=new eu(o,()=>new I).pipe(Jd());return this.childrenLoaders.set(n,a),a}static \u0275fac=function(n){return new(n||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function jg(i,t,e,n){return ki(xn(e,()=>i.loadChildren())).pipe(X(zg),Je(Bg),rn(r=>r instanceof Sp||Array.isArray(r)?$(r):Nt(t.compileModuleAsync(r))),X(r=>{n&&n(i);let o,a,s=!1;return Array.isArray(r)?(a=r,s=!0):(o=r.create(e).injector,a=o.get(Ar,[],{optional:!0,self:!0}).flat()),{routes:a.map(zu),injector:o}}))}function Ay(i){return i&&typeof i=="object"&&"default"in i}function zg(i){return Ay(i)?i.default:i}function Bg(i){return $(i)}var Hl=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275prov=O({token:i,factory:()=>u(Dy),providedIn:"root"})}return i})(),Dy=(()=>{class i{shouldProcessUrl(e){return!0}extract(e){return e}merge(e,n){return e}static \u0275fac=function(n){return new(n||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),Hu=new q(""),Uu=new q("");function Hg(i,t,e){let n=i.get(Uu),r=i.get(ct);if(!r.startViewTransition||n.skipNextTransition)return n.skipNextTransition=!1,new Promise(p=>setTimeout(p));let o,a=new Promise(p=>{o=p}),s=r.startViewTransition(()=>(o(),Iy(i)));s.ready.catch(p=>{});let{onViewTransitionCreated:d}=n;return d&&xn(i,()=>d({transition:s,from:t,to:e})),a}function Iy(i){return new Promise(t=>{Vt({read:()=>setTimeout(t)},{injector:i})})}var $u=new q(""),Ul=(()=>{class i{currentNavigation=Me(null,{equal:()=>!1});currentTransition=null;lastSuccessfulNavigation=null;events=new I;transitionAbortWithErrorSubject=new I;configLoader=u(Bl);environmentInjector=u(Rn);destroyRef=u(xi);urlSerializer=u(Tr);rootContexts=u(Or);location=u(Qi);inputBindingEnabled=u(Ga,{optional:!0})!==null;titleStrategy=u(Bu);options=u(Pr,{optional:!0})||{};paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly";urlHandlingStrategy=u(Hl);createViewTransition=u(Hu,{optional:!0});navigationErrorHandler=u($u,{optional:!0});navigationId=0;get hasRequestedNavigation(){return this.navigationId!==0}transitions;afterPreactivation=()=>$(void 0);rootComponentType=null;destroyed=!1;constructor(){let e=r=>this.events.next(new Tl(r)),n=r=>this.events.next(new Ol(r));this.configLoader.onLoadEndListener=n,this.configLoader.onLoadStartListener=e,this.destroyRef.onDestroy(()=>{this.destroyed=!0})}complete(){this.transitions?.complete()}handleNavigationRequest(e){let n=++this.navigationId;Mt(()=>{this.transitions?.next(be(M({},e),{extractedUrl:this.urlHandlingStrategy.extract(e.rawUrl),targetSnapshot:null,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null,abortController:new AbortController,id:n}))})}setupNavigations(e){return this.transitions=new Z(null),this.transitions.pipe(le(n=>n!==null),Je(n=>{let r=!1;return $(n).pipe(Je(o=>{if(this.navigationId>n.id)return this.cancelNavigationTransition(n,"",Wt.SupersededByNewNavigation),In;this.currentTransition=n,this.currentNavigation.set({id:o.id,initialUrl:o.rawUrl,extractedUrl:o.extractedUrl,targetBrowserUrl:typeof o.extras.browserUrl=="string"?this.urlSerializer.parse(o.extras.browserUrl):o.extras.browserUrl,trigger:o.source,extras:o.extras,previousNavigation:this.lastSuccessfulNavigation?be(M({},this.lastSuccessfulNavigation),{previousNavigation:null}):null,abort:()=>o.abortController.abort()});let a=!e.navigated||this.isUpdatingInternalState()||this.isUpdatedBrowserUrl(),s=o.extras.onSameUrlNavigation??e.onSameUrlNavigation;if(!a&&s!=="reload")return this.events.next(new oi(o.id,this.urlSerializer.serialize(o.rawUrl),"",Eo.IgnoredSameUrlNavigation)),o.resolve(!1),In;if(this.urlHandlingStrategy.shouldProcessUrl(o.rawUrl))return $(o).pipe(Je(d=>(this.events.next(new nr(d.id,this.urlSerializer.serialize(d.extractedUrl),d.source,d.restoredState)),d.id!==this.navigationId?In:Promise.resolve(d))),My(this.environmentInjector,this.configLoader,this.rootComponentType,e.config,this.urlSerializer,this.paramsInheritanceStrategy),ve(d=>{n.targetSnapshot=d.targetSnapshot,n.urlAfterRedirects=d.urlAfterRedirects,this.currentNavigation.update(f=>(f.finalUrl=d.urlAfterRedirects,f));let p=new La(d.id,this.urlSerializer.serialize(d.extractedUrl),this.urlSerializer.serialize(d.urlAfterRedirects),d.targetSnapshot);this.events.next(p)}));if(a&&this.urlHandlingStrategy.shouldProcessUrl(o.currentRawUrl)){let{id:d,extractedUrl:p,source:f,restoredState:v,extras:E}=o,T=new nr(d,this.urlSerializer.serialize(p),f,v);this.events.next(T);let k=Mg(this.rootComponentType).snapshot;return this.currentTransition=n=be(M({},o),{targetSnapshot:k,urlAfterRedirects:p,extras:be(M({},E),{skipLocationChange:!1,replaceUrl:!1})}),this.currentNavigation.update(V=>(V.finalUrl=p,V)),$(n)}else return this.events.next(new oi(o.id,this.urlSerializer.serialize(o.extractedUrl),"",Eo.IgnoredByUrlHandlingStrategy)),o.resolve(!1),In}),ve(o=>{let a=new Sl(o.id,this.urlSerializer.serialize(o.extractedUrl),this.urlSerializer.serialize(o.urlAfterRedirects),o.targetSnapshot);this.events.next(a)}),X(o=>(this.currentTransition=n=be(M({},o),{guards:W0(o.targetSnapshot,o.currentSnapshot,this.rootContexts)}),n)),ny(this.environmentInjector,o=>this.events.next(o)),ve(o=>{if(n.guardsResult=o.guardsResult,o.guardsResult&&typeof o.guardsResult!="boolean")throw Vl(this.urlSerializer,o.guardsResult);let a=new kl(o.id,this.urlSerializer.serialize(o.extractedUrl),this.urlSerializer.serialize(o.urlAfterRedirects),o.targetSnapshot,!!o.guardsResult);this.events.next(a)}),le(o=>o.guardsResult?!0:(this.cancelNavigationTransition(o,"",Wt.GuardRejected),!1)),xu(o=>{if(o.guards.canActivateChecks.length!==0)return $(o).pipe(ve(a=>{let s=new Ml(a.id,this.urlSerializer.serialize(a.extractedUrl),this.urlSerializer.serialize(a.urlAfterRedirects),a.targetSnapshot);this.events.next(s)}),Je(a=>{let s=!1;return $(a).pipe(Ey(this.paramsInheritanceStrategy,this.environmentInjector),ve({next:()=>s=!0,complete:()=>{s||this.cancelNavigationTransition(a,"",Wt.NoDataFromResolver)}}))}),ve(a=>{let s=new El(a.id,this.urlSerializer.serialize(a.extractedUrl),this.urlSerializer.serialize(a.urlAfterRedirects),a.targetSnapshot);this.events.next(s)}))}),xu(o=>{let a=s=>{let d=[];if(s.routeConfig?.loadComponent){let p=Io(s)??this.environmentInjector;d.push(this.configLoader.loadComponent(p,s.routeConfig).pipe(ve(f=>{s.component=f}),X(()=>{})))}for(let p of s.children)d.push(...a(p));return d};return dn(a(o.targetSnapshot.root)).pipe(ru(null),lt(1))}),xu(()=>this.afterPreactivation()),Je(()=>{let{currentSnapshot:o,targetSnapshot:a}=n,s=this.createViewTransition?.(this.environmentInjector,o.root,a.root);return s?Nt(s).pipe(X(()=>n)):$(n)}),X(o=>{let a=z0(e.routeReuseStrategy,o.targetSnapshot,o.currentRouterState);return this.currentTransition=n=be(M({},o),{targetRouterState:a}),this.currentNavigation.update(s=>(s.targetRouterState=a,s)),n}),ve(()=>{this.events.next(new ja)}),$0(this.rootContexts,e.routeReuseStrategy,o=>this.events.next(o),this.inputBindingEnabled),lt(1),L(new nn(o=>{let a=n.abortController.signal,s=()=>o.next();return a.addEventListener("abort",s),()=>a.removeEventListener("abort",s)}).pipe(le(()=>!r&&!n.targetRouterState),ve(()=>{this.cancelNavigationTransition(n,n.abortController.signal.reason+"",Wt.Aborted)}))),ve({next:o=>{r=!0,this.lastSuccessfulNavigation=Mt(this.currentNavigation),this.events.next(new Ln(o.id,this.urlSerializer.serialize(o.extractedUrl),this.urlSerializer.serialize(o.urlAfterRedirects))),this.titleStrategy?.updateTitle(o.targetRouterState.snapshot),o.resolve(!0)},complete:()=>{r=!0}}),L(this.transitionAbortWithErrorSubject.pipe(ve(o=>{throw o}))),Ks(()=>{r||this.cancelNavigationTransition(n,"",Wt.SupersededByNewNavigation),this.currentTransition?.id===n.id&&(this.currentNavigation.set(null),this.currentTransition=null)}),on(o=>{if(this.destroyed)return n.resolve(!1),In;if(r=!0,Dg(o))this.events.next(new ii(n.id,this.urlSerializer.serialize(n.extractedUrl),o.message,o.cancellationCode)),U0(o)?this.events.next(new Po(o.url,o.navigationBehaviorOptions)):n.resolve(!1);else{let a=new To(n.id,this.urlSerializer.serialize(n.extractedUrl),o,n.targetSnapshot??void 0);try{let s=xn(this.environmentInjector,()=>this.navigationErrorHandler?.(a));if(s instanceof Ao){let{message:d,cancellationCode:p}=Vl(this.urlSerializer,s);this.events.next(new ii(n.id,this.urlSerializer.serialize(n.extractedUrl),d,p)),this.events.next(new Po(s.redirectTo,s.navigationBehaviorOptions))}else throw this.events.next(a),o}catch(s){this.options.resolveNavigationPromiseOnError?n.resolve(!1):n.reject(s)}}return In}))}))}cancelNavigationTransition(e,n,r){let o=new ii(e.id,this.urlSerializer.serialize(e.extractedUrl),n,r);this.events.next(o),e.resolve(!1)}isUpdatingInternalState(){return this.currentTransition?.extractedUrl.toString()!==this.currentTransition?.currentUrlTree.toString()}isUpdatedBrowserUrl(){let e=this.urlHandlingStrategy.extract(this.urlSerializer.parse(this.location.path(!0))),n=Mt(this.currentNavigation),r=n?.targetBrowserUrl??n?.extractedUrl;return e.toString()!==r?.toString()&&!n?.extras.skipLocationChange}static \u0275fac=function(n){return new(n||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function Ry(i){return i!==So}var Ug=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275prov=O({token:i,factory:()=>u(Fy),providedIn:"root"})}return i})(),jl=class{shouldDetach(t){return!1}store(t,e){}shouldAttach(t){return!1}retrieve(t){return null}shouldReuseRoute(t,e){return t.routeConfig===e.routeConfig}},Fy=(()=>{class i extends jl{static \u0275fac=(()=>{let e;return function(r){return(e||(e=We(i)))(r||i)}})();static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),$g=(()=>{class i{urlSerializer=u(Tr);options=u(Pr,{optional:!0})||{};canceledNavigationResolution=this.options.canceledNavigationResolution||"replace";location=u(Qi);urlHandlingStrategy=u(Hl);urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred";currentUrlTree=new ri;getCurrentUrlTree(){return this.currentUrlTree}rawUrlTree=this.currentUrlTree;getRawUrlTree(){return this.rawUrlTree}createBrowserPath({finalUrl:e,initialUrl:n,targetBrowserUrl:r}){let o=e!==void 0?this.urlHandlingStrategy.merge(e,n):n,a=r??o;return a instanceof ri?this.urlSerializer.serialize(a):a}commitTransition({targetRouterState:e,finalUrl:n,initialUrl:r}){n&&e?(this.currentUrlTree=n,this.rawUrlTree=this.urlHandlingStrategy.merge(n,r),this.routerState=e):this.rawUrlTree=r}routerState=Mg(null);getRouterState(){return this.routerState}stateMemento=this.createStateMemento();updateStateMemento(){this.stateMemento=this.createStateMemento()}createStateMemento(){return{rawUrlTree:this.rawUrlTree,currentUrlTree:this.currentUrlTree,routerState:this.routerState}}resetInternalState({finalUrl:e}){this.routerState=this.stateMemento.routerState,this.currentUrlTree=this.stateMemento.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,e??this.rawUrlTree)}static \u0275fac=function(n){return new(n||i)};static \u0275prov=O({token:i,factory:()=>u(Ny),providedIn:"root"})}return i})(),Ny=(()=>{class i extends $g{currentPageId=0;lastSuccessfulId=-1;restoredState(){return this.location.getState()}get browserPageId(){return this.canceledNavigationResolution!=="computed"?this.currentPageId:this.restoredState()?.\u0275routerPageId??this.currentPageId}registerNonRouterCurrentEntryChangeListener(e){return this.location.subscribe(n=>{n.type==="popstate"&&setTimeout(()=>{e(n.url,n.state,"popstate")})})}handleRouterEvent(e,n){e instanceof nr?this.updateStateMemento():e instanceof oi?this.commitTransition(n):e instanceof La?this.urlUpdateStrategy==="eager"&&(n.extras.skipLocationChange||this.setBrowserUrl(this.createBrowserPath(n),n)):e instanceof ja?(this.commitTransition(n),this.urlUpdateStrategy==="deferred"&&!n.extras.skipLocationChange&&this.setBrowserUrl(this.createBrowserPath(n),n)):e instanceof ii&&e.code!==Wt.SupersededByNewNavigation&&e.code!==Wt.Redirect?this.restoreHistory(n):e instanceof To?this.restoreHistory(n,!0):e instanceof Ln&&(this.lastSuccessfulId=e.id,this.currentPageId=this.browserPageId)}setBrowserUrl(e,{extras:n,id:r}){let{replaceUrl:o,state:a}=n;if(this.location.isCurrentPathEqualTo(e)||o){let s=this.browserPageId,d=M(M({},a),this.generateNgRouterState(r,s));this.location.replaceState(e,"",d)}else{let s=M(M({},a),this.generateNgRouterState(r,this.browserPageId+1));this.location.go(e,"",s)}}restoreHistory(e,n=!1){if(this.canceledNavigationResolution==="computed"){let r=this.browserPageId,o=this.currentPageId-r;o!==0?this.location.historyGo(o):this.getCurrentUrlTree()===e.finalUrl&&o===0&&(this.resetInternalState(e),this.resetUrlToCurrentUrlTree())}else this.canceledNavigationResolution==="replace"&&(n&&this.resetInternalState(e),this.resetUrlToCurrentUrlTree())}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.getRawUrlTree()),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}generateNgRouterState(e,n){return this.canceledNavigationResolution==="computed"?{navigationId:e,\u0275routerPageId:n}:{navigationId:e}}static \u0275fac=(()=>{let e;return function(r){return(e||(e=We(i)))(r||i)}})();static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function $l(i,t){i.events.pipe(le(e=>e instanceof Ln||e instanceof ii||e instanceof To||e instanceof oi),X(e=>e instanceof Ln||e instanceof oi?0:(e instanceof ii?e.code===Wt.Redirect||e.code===Wt.SupersededByNewNavigation:!1)?2:1),le(e=>e!==2),lt(1)).subscribe(()=>{t()})}var Vy={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},Ly={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"},Dt=(()=>{class i{get currentUrlTree(){return this.stateManager.getCurrentUrlTree()}get rawUrlTree(){return this.stateManager.getRawUrlTree()}disposed=!1;nonRouterCurrentEntryChangeSubscription;console=u(Ep);stateManager=u($g);options=u(Pr,{optional:!0})||{};pendingTasks=u(vp);urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred";navigationTransitions=u(Ul);urlSerializer=u(Tr);location=u(Qi);urlHandlingStrategy=u(Hl);injector=u(Rn);_events=new I;get events(){return this._events}get routerState(){return this.stateManager.getRouterState()}navigated=!1;routeReuseStrategy=u(Ug);onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore";config=u(Ar,{optional:!0})?.flat()??[];componentInputBindingEnabled=!!u(Ga,{optional:!0});currentNavigation=this.navigationTransitions.currentNavigation.asReadonly();constructor(){this.resetConfig(this.config),this.navigationTransitions.setupNavigations(this).subscribe({error:e=>{this.console.warn(e)}}),this.subscribeToNavigationEvents()}eventsSubscription=new yn;subscribeToNavigationEvents(){let e=this.navigationTransitions.events.subscribe(n=>{try{let r=this.navigationTransitions.currentTransition,o=Mt(this.navigationTransitions.currentNavigation);if(r!==null&&o!==null){if(this.stateManager.handleRouterEvent(n,o),n instanceof ii&&n.code!==Wt.Redirect&&n.code!==Wt.SupersededByNewNavigation)this.navigated=!0;else if(n instanceof Ln)this.navigated=!0;else if(n instanceof Po){let a=n.navigationBehaviorOptions,s=this.urlHandlingStrategy.merge(n.url,r.currentRawUrl),d=M({browserUrl:r.extras.browserUrl,info:r.extras.info,skipLocationChange:r.extras.skipLocationChange,replaceUrl:r.extras.replaceUrl||this.urlUpdateStrategy==="eager"||Ry(r.source)},a);this.scheduleNavigation(s,So,null,d,{resolve:r.resolve,reject:r.reject,promise:r.promise})}}N0(n)&&this._events.next(n)}catch(r){this.navigationTransitions.transitionAbortWithErrorSubject.next(r)}});this.eventsSubscription.add(e)}resetRootComponentType(e){this.routerState.root.component=e,this.navigationTransitions.rootComponentType=e}initialNavigation(){this.setUpLocationChangeListener(),this.navigationTransitions.hasRequestedNavigation||this.navigateToSyncWithBrowser(this.location.path(!0),So,this.stateManager.restoredState())}setUpLocationChangeListener(){this.nonRouterCurrentEntryChangeSubscription??=this.stateManager.registerNonRouterCurrentEntryChangeListener((e,n,r)=>{this.navigateToSyncWithBrowser(e,r,n)})}navigateToSyncWithBrowser(e,n,r){let o={replaceUrl:!0},a=r?.navigationId?r:null;if(r){let d=M({},r);delete d.navigationId,delete d.\u0275routerPageId,Object.keys(d).length!==0&&(o.state=d)}let s=this.parseUrl(e);this.scheduleNavigation(s,n,a,o).catch(d=>{this.disposed||this.injector.get(su)(d)})}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return Mt(this.navigationTransitions.currentNavigation)}get lastSuccessfulNavigation(){return this.navigationTransitions.lastSuccessfulNavigation}resetConfig(e){this.config=e.map(zu),this.navigated=!1}ngOnDestroy(){this.dispose()}dispose(){this._events.unsubscribe(),this.navigationTransitions.complete(),this.nonRouterCurrentEntryChangeSubscription&&(this.nonRouterCurrentEntryChangeSubscription.unsubscribe(),this.nonRouterCurrentEntryChangeSubscription=void 0),this.disposed=!0,this.eventsSubscription.unsubscribe()}createUrlTree(e,n={}){let{relativeTo:r,queryParams:o,fragment:a,queryParamsHandling:s,preserveFragment:d}=n,p=d?this.currentUrlTree.fragment:a,f=null;switch(s??this.options.defaultQueryParamsHandling){case"merge":f=M(M({},this.currentUrlTree.queryParams),o);break;case"preserve":f=this.currentUrlTree.queryParams;break;default:f=o||null}f!==null&&(f=this.removeEmptyProps(f));let v;try{let E=r?r.snapshot:this.routerState.snapshot.root;v=xg(E)}catch{(typeof e[0]!="string"||e[0][0]!=="/")&&(e=[]),v=this.currentUrlTree.root}return wg(v,e,f,p??null)}navigateByUrl(e,n={skipLocationChange:!1}){let r=Mo(e)?e:this.parseUrl(e),o=this.urlHandlingStrategy.merge(r,this.rawUrlTree);return this.scheduleNavigation(o,So,null,n)}navigate(e,n={skipLocationChange:!1}){return jy(e),this.navigateByUrl(this.createUrlTree(e,n),n)}serializeUrl(e){return this.urlSerializer.serialize(e)}parseUrl(e){try{return this.urlSerializer.parse(e)}catch{return this.urlSerializer.parse("/")}}isActive(e,n){let r;if(n===!0?r=M({},Vy):n===!1?r=M({},Ly):r=n,Mo(e))return ig(this.currentUrlTree,e,r);let o=this.parseUrl(e);return ig(this.currentUrlTree,o,r)}removeEmptyProps(e){return Object.entries(e).reduce((n,[r,o])=>(o!=null&&(n[r]=o),n),{})}scheduleNavigation(e,n,r,o,a){if(this.disposed)return Promise.resolve(!1);let s,d,p;a?(s=a.resolve,d=a.reject,p=a.promise):p=new Promise((v,E)=>{s=v,d=E});let f=this.pendingTasks.add();return $l(this,()=>{queueMicrotask(()=>this.pendingTasks.remove(f))}),this.navigationTransitions.handleNavigationRequest({source:n,restoredState:r,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,rawUrl:e,extras:o,resolve:s,reject:d,promise:p,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),p.catch(v=>Promise.reject(v))}static \u0275fac=function(n){return new(n||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function jy(i){for(let t=0;t<i.length;t++)if(i[t]==null)throw new J(4008,!1)}var Qa=class{};var Wg=(()=>{class i{router;injector;preloadingStrategy;loader;subscription;constructor(e,n,r,o){this.router=e,this.injector=n,this.preloadingStrategy=r,this.loader=o}setUpPreloading(){this.subscription=this.router.events.pipe(le(e=>e instanceof Ln),vr(()=>this.preload())).subscribe(()=>{})}preload(){return this.processRoutes(this.injector,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(e,n){let r=[];for(let o of n){o.providers&&!o._injector&&(o._injector=tl(o.providers,e,`Route: ${o.path}`));let a=o._injector??e,s=o._loadedInjector??a;(o.loadChildren&&!o._loadedRoutes&&o.canLoad===void 0||o.loadComponent&&!o._loadedComponent)&&r.push(this.preloadConfig(a,o)),(o.children||o._loadedRoutes)&&r.push(this.processRoutes(s,o.children??o._loadedRoutes))}return Nt(r).pipe(nu())}preloadConfig(e,n){return this.preloadingStrategy.preload(n,()=>{let r;n.loadChildren&&n.canLoad===void 0?r=this.loader.loadChildren(e,n):r=$(null);let o=r.pipe(rn(a=>a===null?$(void 0):(n._loadedRoutes=a.routes,n._loadedInjector=a.injector,this.processRoutes(a.injector??e,a.routes))));if(n.loadComponent&&!n._loadedComponent){let a=this.loader.loadComponent(e,n);return Nt([o,a]).pipe(nu())}else return o})}static \u0275fac=function(n){return new(n||i)(Cn(Dt),Cn(Rn),Cn(Qa),Cn(Bl))};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),qg=new q(""),zy=(()=>{class i{urlSerializer;transitions;viewportScroller;zone;options;routerEventsSubscription;scrollEventsSubscription;lastId=0;lastSource=So;restoredId=0;store={};constructor(e,n,r,o,a={}){this.urlSerializer=e,this.transitions=n,this.viewportScroller=r,this.zone=o,this.options=a,a.scrollPositionRestoration||="disabled",a.anchorScrolling||="disabled"}init(){this.options.scrollPositionRestoration!=="disabled"&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.transitions.events.subscribe(e=>{e instanceof nr?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=e.navigationTrigger,this.restoredId=e.restoredState?e.restoredState.navigationId:0):e instanceof Ln?(this.lastId=e.id,this.scheduleScrollEvent(e,this.urlSerializer.parse(e.urlAfterRedirects).fragment)):e instanceof oi&&e.code===Eo.IgnoredSameUrlNavigation&&(this.lastSource=void 0,this.restoredId=0,this.scheduleScrollEvent(e,this.urlSerializer.parse(e.url).fragment))})}consumeScrollEvents(){return this.transitions.events.subscribe(e=>{e instanceof Oo&&(e.position?this.options.scrollPositionRestoration==="top"?this.viewportScroller.scrollToPosition([0,0]):this.options.scrollPositionRestoration==="enabled"&&this.viewportScroller.scrollToPosition(e.position):e.anchor&&this.options.anchorScrolling==="enabled"?this.viewportScroller.scrollToAnchor(e.anchor):this.options.scrollPositionRestoration!=="disabled"&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(e,n){this.zone.runOutsideAngular(()=>re(this,null,function*(){yield new Promise(r=>{setTimeout(r),typeof requestAnimationFrame<"u"&&requestAnimationFrame(r)}),this.zone.run(()=>{this.transitions.events.next(new Oo(e,this.lastSource==="popstate"?this.store[this.restoredId]:null,n))})}))}ngOnDestroy(){this.routerEventsSubscription?.unsubscribe(),this.scrollEventsSubscription?.unsubscribe()}static \u0275fac=function(n){wp()};static \u0275prov=O({token:i,factory:i.\u0275fac})}return i})();function qu(i,...t){return fp([{provide:Ar,multi:!0,useValue:i},[],{provide:_n,useFactory:Gg,deps:[Dt]},{provide:uu,multi:!0,useFactory:Yg},t.map(e=>e.\u0275providers)])}function Gg(i){return i.routerState.root}function Xa(i,t){return{\u0275kind:i,\u0275providers:t}}function Yg(){let i=u(we);return t=>{let e=i.get(Cr);if(t!==e.components[0])return;let n=i.get(Dt),r=i.get(Qg);i.get(Gu)===1&&n.initialNavigation(),i.get(Zg,null,{optional:!0})?.setUpPreloading(),i.get(qg,null,{optional:!0})?.init(),n.resetRootComponentType(e.componentTypes[0]),r.closed||(r.next(),r.complete(),r.unsubscribe())}}var Qg=new q("",{factory:()=>new I}),Gu=new q("",{providedIn:"root",factory:()=>1});function Xg(){let i=[{provide:Cp,useValue:!0},{provide:Gu,useValue:0},du(()=>{let t=u(we);return t.get(jp,Promise.resolve()).then(()=>new Promise(n=>{let r=t.get(Dt),o=t.get(Qg);$l(r,()=>{n(!0)}),t.get(Ul).afterPreactivation=()=>(n(!0),o.closed?$(void 0):o),r.initialNavigation()}))})];return Xa(2,i)}function Kg(){let i=[du(()=>{u(Dt).setUpLocationChangeListener()}),{provide:Gu,useValue:2}];return Xa(3,i)}var Zg=new q("");function Jg(i){return Xa(0,[{provide:Zg,useExisting:Wg},{provide:Qa,useExisting:i}])}function ef(){return Xa(8,[Lu,{provide:Ga,useExisting:Lu}])}function tf(i){el("NgRouterViewTransitions");let t=[{provide:Hu,useValue:Hg},{provide:Uu,useValue:M({skipNextTransition:!!i?.skipInitialTransition},i)}];return Xa(9,t)}var nf=[Qi,{provide:Tr,useClass:tr},Dt,Or,{provide:_n,useFactory:Gg,deps:[Dt]},Bl,[]],Yu=(()=>{class i{constructor(){}static forRoot(e,n){return{ngModule:i,providers:[nf,[],{provide:Ar,multi:!0,useValue:e},[],n?.errorHandler?{provide:$u,useValue:n.errorHandler}:[],{provide:Pr,useValue:n||{}},n?.useHash?Hy():Uy(),By(),n?.preloadingStrategy?Jg(n.preloadingStrategy).\u0275providers:[],n?.initialNavigation?$y(n):[],n?.bindToComponentInputs?ef().\u0275providers:[],n?.enableViewTransitions?tf().\u0275providers:[],Wy()]}}static forChild(e){return{ngModule:i,providers:[{provide:Ar,multi:!0,useValue:e}]}}static \u0275fac=function(n){return new(n||i)};static \u0275mod=de({type:i});static \u0275inj=ce({})}return i})();function By(){return{provide:qg,useFactory:()=>{let i=u($p),t=u(fe),e=u(Pr),n=u(Ul),r=u(Tr);return e.scrollOffset&&i.setOffset(e.scrollOffset),new zy(r,n,i,t,e)}}}function Hy(){return{provide:pu,useClass:Bp}}function Uy(){return{provide:pu,useClass:zp}}function $y(i){return[i.initialNavigation==="disabled"?Kg().\u0275providers:[],i.initialNavigation==="enabledBlocking"?Xg().\u0275providers:[]]}var Wu=new q("");function Wy(){return[{provide:Wu,useFactory:Yg},{provide:uu,multi:!0,useExisting:Wu}]}var me=(function(i){return i[i.State=0]="State",i[i.Transition=1]="Transition",i[i.Sequence=2]="Sequence",i[i.Group=3]="Group",i[i.Animate=4]="Animate",i[i.Keyframes=5]="Keyframes",i[i.Style=6]="Style",i[i.Trigger=7]="Trigger",i[i.Reference=8]="Reference",i[i.AnimateChild=9]="AnimateChild",i[i.AnimateRef=10]="AnimateRef",i[i.Query=11]="Query",i[i.Stagger=12]="Stagger",i})(me||{}),kn="*";function Qu(i,t){return{type:me.Trigger,name:i,definitions:t,options:{}}}function Wl(i,t=null){return{type:me.Animate,styles:t,timings:i}}function rf(i,t=null){return{type:me.Sequence,steps:i,options:t}}function ir(i){return{type:me.Style,styles:i,offset:null}}function ql(i,t,e=null){return{type:me.Transition,expr:i,animation:t,options:e}}var ai=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(n=>n()),e.length=0}},Dr=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(t){this.players=t;let e=0,n=0,r=0,o=this.players.length;o==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(a=>{a.onDone(()=>{++e==o&&this._onFinish()}),a.onDestroy(()=>{++n==o&&this._onDestroy()}),a.onStart(()=>{++r==o&&this._onStart()})}),this.totalTime=this.players.reduce((a,s)=>Math.max(a,s.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(n=>{let r=n.totalTime?Math.min(1,e/n.totalTime):1;n.setPosition(r)})}getPosition(){let t=this.players.reduce((e,n)=>e===null||n.totalTime>e.totalTime?n: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(n=>n()),e.length=0}},Fo="!";function of(i){return new J(3e3,!1)}function Yy(){return new J(3100,!1)}function Qy(){return new J(3101,!1)}function Xy(i){return new J(3001,!1)}function Ky(i){return new J(3003,!1)}function Zy(i){return new J(3004,!1)}function sf(i,t){return new J(3005,!1)}function lf(){return new J(3006,!1)}function cf(){return new J(3007,!1)}function df(i,t){return new J(3008,!1)}function uf(i){return new J(3002,!1)}function mf(i,t,e,n,r){return new J(3010,!1)}function hf(){return new J(3011,!1)}function pf(){return new J(3012,!1)}function gf(){return new J(3200,!1)}function ff(){return new J(3202,!1)}function _f(){return new J(3013,!1)}function bf(i){return new J(3014,!1)}function vf(i){return new J(3015,!1)}function yf(i){return new J(3016,!1)}function Cf(i,t){return new J(3404,!1)}function Jy(i){return new J(3502,!1)}function xf(i){return new J(3503,!1)}function wf(){return new J(3300,!1)}function Sf(i){return new J(3504,!1)}function kf(i){return new J(3301,!1)}function Mf(i,t){return new J(3302,!1)}function Ef(i){return new J(3303,!1)}function Tf(i,t){return new J(3400,!1)}function Of(i){return new J(3401,!1)}function Pf(i){return new J(3402,!1)}function Af(i,t){return new J(3505,!1)}function Mi(i){switch(i.length){case 0:return new ai;case 1:return i[0];default:return new Dr(i)}}function Ju(i,t,e=new Map,n=new Map){let r=[],o=[],a=-1,s=null;if(t.forEach(d=>{let p=d.get("offset"),f=p==a,v=f&&s||new Map;d.forEach((E,T)=>{let k=T,V=E;if(T!=="offset")switch(k=i.normalizePropertyName(k,r),V){case Fo:V=e.get(T);break;case kn:V=n.get(T);break;default:V=i.normalizeStyleValue(T,k,V,r);break}v.set(k,V)}),f||o.push(v),s=v,a=p}),r.length)throw Jy(r);return o}function Gl(i,t,e,n){switch(t){case"start":i.onStart(()=>n(e&&Xu(e,"start",i)));break;case"done":i.onDone(()=>n(e&&Xu(e,"done",i)));break;case"destroy":i.onDestroy(()=>n(e&&Xu(e,"destroy",i)));break}}function Xu(i,t,e){let n=e.totalTime,r=!!e.disabled,o=Yl(i.element,i.triggerName,i.fromState,i.toState,t||i.phaseName,n??i.totalTime,r),a=i._data;return a!=null&&(o._data=a),o}function Yl(i,t,e,n,r="",o=0,a){return{element:i,triggerName:t,fromState:e,toState:n,phaseName:r,totalTime:o,disabled:!!a}}function an(i,t,e){let n=i.get(t);return n||i.set(t,n=e),n}function em(i){let t=i.indexOf(":"),e=i.substring(1,t),n=i.slice(t+1);return[e,n]}var eC=typeof document>"u"?null:document.documentElement;function Ql(i){let t=i.parentNode||i.host||null;return t===eC?null:t}function tC(i){return i.substring(1,6)=="ebkit"}var Ir=null,af=!1;function Df(i){Ir||(Ir=nC()||{},af=Ir.style?"WebkitAppearance"in Ir.style:!1);let t=!0;return Ir.style&&!tC(i)&&(t=i in Ir.style,!t&&af&&(t="Webkit"+i.charAt(0).toUpperCase()+i.slice(1)in Ir.style)),t}function nC(){return typeof document<"u"?document.body:null}function tm(i,t){for(;t;){if(t===i)return!0;t=Ql(t)}return!1}function nm(i,t,e){if(e)return Array.from(i.querySelectorAll(t));let n=i.querySelector(t);return n?[n]:[]}var iC=1e3,im="{{",rC="}}",rm="ng-enter",Xl="ng-leave",Ka="ng-trigger",Za=".ng-trigger",om="ng-animating",Kl=".ng-animating";function si(i){if(typeof i=="number")return i;let t=i.match(/^(-?[\.\d]+)(m?s)/);return!t||t.length<2?0:Ku(parseFloat(t[1]),t[2])}function Ku(i,t){switch(t){case"s":return i*iC;default:return i}}function Ja(i,t,e){return i.hasOwnProperty("duration")?i:aC(i,t,e)}var oC=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;function aC(i,t,e){let n,r=0,o="";if(typeof i=="string"){let a=i.match(oC);if(a===null)return t.push(of(i)),{duration:0,delay:0,easing:""};n=Ku(parseFloat(a[1]),a[2]);let s=a[3];s!=null&&(r=Ku(parseFloat(s),a[4]));let d=a[5];d&&(o=d)}else n=i;if(!e){let a=!1,s=t.length;n<0&&(t.push(Yy()),a=!0),r<0&&(t.push(Qy()),a=!0),a&&t.splice(s,0,of(i))}return{duration:n,delay:r,easing:o}}function If(i){return i.length?i[0]instanceof Map?i:i.map(t=>new Map(Object.entries(t))):[]}function jn(i,t,e){t.forEach((n,r)=>{let o=Zl(r);e&&!e.has(r)&&e.set(r,i.style[o]),i.style[o]=n})}function rr(i,t){t.forEach((e,n)=>{let r=Zl(n);i.style[r]=""})}function No(i){return Array.isArray(i)?i.length==1?i[0]:rf(i):i}function Rf(i,t,e){let n=t.params||{},r=am(i);r.length&&r.forEach(o=>{n.hasOwnProperty(o)||e.push(Xy(o))})}var Zu=new RegExp(`${im}\\s*(.+?)\\s*${rC}`,"g");function am(i){let t=[];if(typeof i=="string"){let e;for(;e=Zu.exec(i);)t.push(e[1]);Zu.lastIndex=0}return t}function Vo(i,t,e){let n=`${i}`,r=n.replace(Zu,(o,a)=>{let s=t[a];return s==null&&(e.push(Ky(a)),s=""),s.toString()});return r==n?i:r}var sC=/-+([a-z0-9])/g;function Zl(i){return i.replace(sC,(...t)=>t[1].toUpperCase())}function Ff(i,t){return i===0||t===0}function Nf(i,t,e){if(e.size&&t.length){let n=t[0],r=[];if(e.forEach((o,a)=>{n.has(a)||r.push(a),n.set(a,o)}),r.length)for(let o=1;o<t.length;o++){let a=t[o];r.forEach(s=>a.set(s,Jl(i,s)))}}return t}function sn(i,t,e){switch(t.type){case me.Trigger:return i.visitTrigger(t,e);case me.State:return i.visitState(t,e);case me.Transition:return i.visitTransition(t,e);case me.Sequence:return i.visitSequence(t,e);case me.Group:return i.visitGroup(t,e);case me.Animate:return i.visitAnimate(t,e);case me.Keyframes:return i.visitKeyframes(t,e);case me.Style:return i.visitStyle(t,e);case me.Reference:return i.visitReference(t,e);case me.AnimateChild:return i.visitAnimateChild(t,e);case me.AnimateRef:return i.visitAnimateRef(t,e);case me.Query:return i.visitQuery(t,e);case me.Stagger:return i.visitStagger(t,e);default:throw Zy(t.type)}}function Jl(i,t){return window.getComputedStyle(i)[t]}var wm=(()=>{class i{validateStyleProperty(e){return Df(e)}containsElement(e,n){return tm(e,n)}getParentElement(e){return Ql(e)}query(e,n,r){return nm(e,n,r)}computeStyle(e,n,r){return r||""}animate(e,n,r,o,a,s=[],d){return new ai(r,o)}static \u0275fac=function(n){return new(n||i)};static \u0275prov=O({token:i,factory:i.\u0275fac})}return i})(),Fr=class{static NOOP=new wm},Nr=class{};var lC=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"]),rc=class extends Nr{normalizePropertyName(t,e){return Zl(t)}normalizeStyleValue(t,e,n,r){let o="",a=n.toString().trim();if(lC.has(e)&&n!==0&&n!=="0")if(typeof n=="number")o="px";else{let s=n.match(/^[+-]?[\d\.]+([a-z]*)$/);s&&s[1].length==0&&r.push(sf(t,n))}return a+o}};var oc="*";function cC(i,t){let e=[];return typeof i=="string"?i.split(/\s*,\s*/).forEach(n=>dC(n,e,t)):e.push(i),e}function dC(i,t,e){if(i[0]==":"){let d=uC(i,e);if(typeof d=="function"){t.push(d);return}i=d}let n=i.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(n==null||n.length<4)return e.push(vf(i)),t;let r=n[1],o=n[2],a=n[3];t.push(Vf(r,a));let s=r==oc&&a==oc;o[0]=="<"&&!s&&t.push(Vf(a,r))}function uC(i,t){switch(i){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(e,n)=>parseFloat(n)>parseFloat(e);case":decrement":return(e,n)=>parseFloat(n)<parseFloat(e);default:return t.push(yf(i)),"* => *"}}var ec=new Set(["true","1"]),tc=new Set(["false","0"]);function Vf(i,t){let e=ec.has(i)||tc.has(i),n=ec.has(t)||tc.has(t);return(r,o)=>{let a=i==oc||i==r,s=t==oc||t==o;return!a&&e&&typeof r=="boolean"&&(a=r?ec.has(i):tc.has(i)),!s&&n&&typeof o=="boolean"&&(s=o?ec.has(t):tc.has(t)),a&&s}}var Gf=":self",mC=new RegExp(`s*${Gf}s*,?`,"g");function Yf(i,t,e,n){return new mm(i).build(t,e,n)}var Lf="",mm=class{_driver;constructor(t){this._driver=t}build(t,e,n){let r=new hm(e);return this._resetContextStyleTimingState(r),sn(this,No(t),r)}_resetContextStyleTimingState(t){t.currentQuerySelector=Lf,t.collectedStyles=new Map,t.collectedStyles.set(Lf,new Map),t.currentTime=0}visitTrigger(t,e){let n=e.queryCount=0,r=e.depCount=0,o=[],a=[];return t.name.charAt(0)=="@"&&e.errors.push(lf()),t.definitions.forEach(s=>{if(this._resetContextStyleTimingState(e),s.type==me.State){let d=s,p=d.name;p.toString().split(/\s*,\s*/).forEach(f=>{d.name=f,o.push(this.visitState(d,e))}),d.name=p}else if(s.type==me.Transition){let d=this.visitTransition(s,e);n+=d.queryCount,r+=d.depCount,a.push(d)}else e.errors.push(cf())}),{type:me.Trigger,name:t.name,states:o,transitions:a,queryCount:n,depCount:r,options:null}}visitState(t,e){let n=this.visitStyle(t.styles,e),r=t.options&&t.options.params||null;if(n.containsDynamicStyles){let o=new Set,a=r||{};n.styles.forEach(s=>{s instanceof Map&&s.forEach(d=>{am(d).forEach(p=>{a.hasOwnProperty(p)||o.add(p)})})}),o.size&&e.errors.push(df(t.name,[...o.values()]))}return{type:me.State,name:t.name,style:n,options:r?{params:r}:null}}visitTransition(t,e){e.queryCount=0,e.depCount=0;let n=sn(this,No(t.animation),e),r=cC(t.expr,e.errors);return{type:me.Transition,matchers:r,animation:n,queryCount:e.queryCount,depCount:e.depCount,options:Rr(t.options)}}visitSequence(t,e){return{type:me.Sequence,steps:t.steps.map(n=>sn(this,n,e)),options:Rr(t.options)}}visitGroup(t,e){let n=e.currentTime,r=0,o=t.steps.map(a=>{e.currentTime=n;let s=sn(this,a,e);return r=Math.max(r,e.currentTime),s});return e.currentTime=r,{type:me.Group,steps:o,options:Rr(t.options)}}visitAnimate(t,e){let n=fC(t.timings,e.errors);e.currentAnimateTimings=n;let r,o=t.styles?t.styles:ir({});if(o.type==me.Keyframes)r=this.visitKeyframes(o,e);else{let a=t.styles,s=!1;if(!a){s=!0;let p={};n.easing&&(p.easing=n.easing),a=ir(p)}e.currentTime+=n.duration+n.delay;let d=this.visitStyle(a,e);d.isEmptyStep=s,r=d}return e.currentAnimateTimings=null,{type:me.Animate,timings:n,style:r,options:null}}visitStyle(t,e){let n=this._makeStyleAst(t,e);return this._validateStyleAst(n,e),n}_makeStyleAst(t,e){let n=[],r=Array.isArray(t.styles)?t.styles:[t.styles];for(let s of r)typeof s=="string"?s===kn?n.push(s):e.errors.push(uf(s)):n.push(new Map(Object.entries(s)));let o=!1,a=null;return n.forEach(s=>{if(s instanceof Map&&(s.has("easing")&&(a=s.get("easing"),s.delete("easing")),!o)){for(let d of s.values())if(d.toString().indexOf(im)>=0){o=!0;break}}}),{type:me.Style,styles:n,easing:a,offset:t.offset,containsDynamicStyles:o,options:null}}_validateStyleAst(t,e){let n=e.currentAnimateTimings,r=e.currentTime,o=e.currentTime;n&&o>0&&(o-=n.duration+n.delay),t.styles.forEach(a=>{typeof a!="string"&&a.forEach((s,d)=>{let p=e.collectedStyles.get(e.currentQuerySelector),f=p.get(d),v=!0;f&&(o!=r&&o>=f.startTime&&r<=f.endTime&&(e.errors.push(mf(d,f.startTime,f.endTime,o,r)),v=!1),o=f.startTime),v&&p.set(d,{startTime:o,endTime:r}),e.options&&Rf(s,e.options,e.errors)})})}visitKeyframes(t,e){let n={type:me.Keyframes,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push(hf()),n;let r=1,o=0,a=[],s=!1,d=!1,p=0,f=t.steps.map(Re=>{let Ye=this._makeStyleAst(Re,e),Ve=Ye.offset!=null?Ye.offset:gC(Ye.styles),xe=0;return Ve!=null&&(o++,xe=Ye.offset=Ve),d=d||xe<0||xe>1,s=s||xe<p,p=xe,a.push(xe),Ye});d&&e.errors.push(pf()),s&&e.errors.push(gf());let v=t.steps.length,E=0;o>0&&o<v?e.errors.push(ff()):o==0&&(E=r/(v-1));let T=v-1,k=e.currentTime,V=e.currentAnimateTimings,ge=V.duration;return f.forEach((Re,Ye)=>{let Ve=E>0?Ye==T?1:E*Ye:a[Ye],xe=Ve*ge;e.currentTime=k+V.delay+xe,V.duration=xe,this._validateStyleAst(Re,e),Re.offset=Ve,n.styles.push(Re)}),n}visitReference(t,e){return{type:me.Reference,animation:sn(this,No(t.animation),e),options:Rr(t.options)}}visitAnimateChild(t,e){return e.depCount++,{type:me.AnimateChild,options:Rr(t.options)}}visitAnimateRef(t,e){return{type:me.AnimateRef,animation:this.visitReference(t.animation,e),options:Rr(t.options)}}visitQuery(t,e){let n=e.currentQuerySelector,r=t.options||{};e.queryCount++,e.currentQuery=t;let[o,a]=hC(t.selector);e.currentQuerySelector=n.length?n+" "+o:o,an(e.collectedStyles,e.currentQuerySelector,new Map);let s=sn(this,No(t.animation),e);return e.currentQuery=null,e.currentQuerySelector=n,{type:me.Query,selector:o,limit:r.limit||0,optional:!!r.optional,includeSelf:a,animation:s,originalSelector:t.selector,options:Rr(t.options)}}visitStagger(t,e){e.currentQuery||e.errors.push(_f());let n=t.timings==="full"?{duration:0,delay:0,easing:"full"}:Ja(t.timings,e.errors,!0);return{type:me.Stagger,animation:sn(this,No(t.animation),e),timings:n,options:null}}};function hC(i){let t=!!i.split(/\s*,\s*/).find(e=>e==Gf);return t&&(i=i.replace(mC,"")),i=i.replace(/@\*/g,Za).replace(/@\w+/g,e=>Za+"-"+e.slice(1)).replace(/:animating/g,Kl),[i,t]}function pC(i){return i?M({},i):null}var hm=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 gC(i){if(typeof i=="string")return null;let t=null;if(Array.isArray(i))i.forEach(e=>{if(e instanceof Map&&e.has("offset")){let n=e;t=parseFloat(n.get("offset")),n.delete("offset")}});else if(i instanceof Map&&i.has("offset")){let e=i;t=parseFloat(e.get("offset")),e.delete("offset")}return t}function fC(i,t){if(i.hasOwnProperty("duration"))return i;if(typeof i=="number"){let o=Ja(i,t).duration;return sm(o,0,"")}let e=i;if(e.split(/\s+/).some(o=>o.charAt(0)=="{"&&o.charAt(1)=="{")){let o=sm(0,0,"");return o.dynamic=!0,o.strValue=e,o}let r=Ja(e,t);return sm(r.duration,r.delay,r.easing)}function Rr(i){return i?(i=M({},i),i.params&&(i.params=pC(i.params))):i={},i}function sm(i,t,e){return{duration:i,delay:t,easing:e}}function Sm(i,t,e,n,r,o,a=null,s=!1){return{type:1,element:i,keyframes:t,preStyleProps:e,postStyleProps:n,duration:r,delay:o,totalTime:r+o,easing:a,subTimeline:s}}var ts=class{_map=new Map;get(t){return this._map.get(t)||[]}append(t,e){let n=this._map.get(t);n||this._map.set(t,n=[]),n.push(...e)}has(t){return this._map.has(t)}clear(){this._map.clear()}},_C=1,bC=":enter",vC=new RegExp(bC,"g"),yC=":leave",CC=new RegExp(yC,"g");function Qf(i,t,e,n,r,o=new Map,a=new Map,s,d,p=[]){return new pm().buildKeyframes(i,t,e,n,r,o,a,s,d,p)}var pm=class{buildKeyframes(t,e,n,r,o,a,s,d,p,f=[]){p=p||new ts;let v=new gm(t,e,p,r,o,f,[]);v.options=d;let E=d.delay?si(d.delay):0;v.currentTimeline.delayNextStep(E),v.currentTimeline.setStyles([a],null,v.errors,d),sn(this,n,v);let T=v.timelines.filter(k=>k.containsAnimation());if(T.length&&s.size){let k;for(let V=T.length-1;V>=0;V--){let ge=T[V];if(ge.element===e){k=ge;break}}k&&!k.allowOnlyTimelineStyles()&&k.setStyles([s],null,v.errors,d)}return T.length?T.map(k=>k.buildKeyframes()):[Sm(e,[],[],[],0,E,"",!1)]}visitTrigger(t,e){}visitState(t,e){}visitTransition(t,e){}visitAnimateChild(t,e){let n=e.subInstructions.get(e.element);if(n){let r=e.createSubContext(t.options),o=e.currentTimeline.currentTime,a=this._visitSubInstructions(n,r,r.options);o!=a&&e.transformIntoNewTimeline(a)}e.previousNode=t}visitAnimateRef(t,e){let n=e.createSubContext(t.options);n.transformIntoNewTimeline(),this._applyAnimationRefDelays([t.options,t.animation.options],e,n),this.visitReference(t.animation,n),e.transformIntoNewTimeline(n.currentTimeline.currentTime),e.previousNode=t}_applyAnimationRefDelays(t,e,n){for(let r of t){let o=r?.delay;if(o){let a=typeof o=="number"?o:si(Vo(o,r?.params??{},e.errors));n.delayNextStep(a)}}}_visitSubInstructions(t,e,n){let o=e.currentTimeline.currentTime,a=n.duration!=null?si(n.duration):null,s=n.delay!=null?si(n.delay):null;return a!==0&&t.forEach(d=>{let p=e.appendInstructionToTimeline(d,a,s);o=Math.max(o,p.duration+p.delay)}),o}visitReference(t,e){e.updateOptions(t.options,!0),sn(this,t.animation,e),e.previousNode=t}visitSequence(t,e){let n=e.subContextCount,r=e,o=t.options;if(o&&(o.params||o.delay)&&(r=e.createSubContext(o),r.transformIntoNewTimeline(),o.delay!=null)){r.previousNode.type==me.Style&&(r.currentTimeline.snapshotCurrentStyles(),r.previousNode=ac);let a=si(o.delay);r.delayNextStep(a)}t.steps.length&&(t.steps.forEach(a=>sn(this,a,r)),r.currentTimeline.applyStylesToKeyframe(),r.subContextCount>n&&r.transformIntoNewTimeline()),e.previousNode=t}visitGroup(t,e){let n=[],r=e.currentTimeline.currentTime,o=t.options&&t.options.delay?si(t.options.delay):0;t.steps.forEach(a=>{let s=e.createSubContext(t.options);o&&s.delayNextStep(o),sn(this,a,s),r=Math.max(r,s.currentTimeline.currentTime),n.push(s.currentTimeline)}),n.forEach(a=>e.currentTimeline.mergeTimelineCollectedStyles(a)),e.transformIntoNewTimeline(r),e.previousNode=t}_visitTiming(t,e){if(t.dynamic){let n=t.strValue,r=e.params?Vo(n,e.params,e.errors):n;return Ja(r,e.errors)}else return{duration:t.duration,delay:t.delay,easing:t.easing}}visitAnimate(t,e){let n=e.currentAnimateTimings=this._visitTiming(t.timings,e),r=e.currentTimeline;n.delay&&(e.incrementTime(n.delay),r.snapshotCurrentStyles());let o=t.style;o.type==me.Keyframes?this.visitKeyframes(o,e):(e.incrementTime(n.duration),this.visitStyle(o,e),r.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=t}visitStyle(t,e){let n=e.currentTimeline,r=e.currentAnimateTimings;!r&&n.hasCurrentStyleProperties()&&n.forwardFrame();let o=r&&r.easing||t.easing;t.isEmptyStep?n.applyEmptyStep(o):n.setStyles(t.styles,o,e.errors,e.options),e.previousNode=t}visitKeyframes(t,e){let n=e.currentAnimateTimings,r=e.currentTimeline.duration,o=n.duration,s=e.createSubContext().currentTimeline;s.easing=n.easing,t.styles.forEach(d=>{let p=d.offset||0;s.forwardTime(p*o),s.setStyles(d.styles,d.easing,e.errors,e.options),s.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(s),e.transformIntoNewTimeline(r+o),e.previousNode=t}visitQuery(t,e){let n=e.currentTimeline.currentTime,r=t.options||{},o=r.delay?si(r.delay):0;o&&(e.previousNode.type===me.Style||n==0&&e.currentTimeline.hasCurrentStyleProperties())&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=ac);let a=n,s=e.invokeQuery(t.selector,t.originalSelector,t.limit,t.includeSelf,!!r.optional,e.errors);e.currentQueryTotal=s.length;let d=null;s.forEach((p,f)=>{e.currentQueryIndex=f;let v=e.createSubContext(t.options,p);o&&v.delayNextStep(o),p===e.element&&(d=v.currentTimeline),sn(this,t.animation,v),v.currentTimeline.applyStylesToKeyframe();let E=v.currentTimeline.currentTime;a=Math.max(a,E)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(a),d&&(e.currentTimeline.mergeTimelineCollectedStyles(d),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=t}visitStagger(t,e){let n=e.parentContext,r=e.currentTimeline,o=t.timings,a=Math.abs(o.duration),s=a*(e.currentQueryTotal-1),d=a*e.currentQueryIndex;switch(o.duration<0?"reverse":o.easing){case"reverse":d=s-d;break;case"full":d=n.currentStaggerTime;break}let f=e.currentTimeline;d&&f.delayNextStep(d);let v=f.currentTime;sn(this,t.animation,e),e.previousNode=t,n.currentStaggerTime=r.currentTime-v+(r.startTime-n.currentTimeline.startTime)}},ac={},gm=class i{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=ac;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(t,e,n,r,o,a,s,d){this._driver=t,this.element=e,this.subInstructions=n,this._enterClassName=r,this._leaveClassName=o,this.errors=a,this.timelines=s,this.currentTimeline=d||new sc(this._driver,e,0),s.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(t,e){if(!t)return;let n=t,r=this.options;n.duration!=null&&(r.duration=si(n.duration)),n.delay!=null&&(r.delay=si(n.delay));let o=n.params;if(o){let a=r.params;a||(a=this.options.params={}),Object.keys(o).forEach(s=>{(!e||!a.hasOwnProperty(s))&&(a[s]=Vo(o[s],a,this.errors))})}}_copyOptions(){let t={};if(this.options){let e=this.options.params;if(e){let n=t.params={};Object.keys(e).forEach(r=>{n[r]=e[r]})}}return t}createSubContext(t=null,e,n){let r=e||this.element,o=new i(this._driver,r,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(r,n||0));return o.previousNode=this.previousNode,o.currentAnimateTimings=this.currentAnimateTimings,o.options=this._copyOptions(),o.updateOptions(t),o.currentQueryIndex=this.currentQueryIndex,o.currentQueryTotal=this.currentQueryTotal,o.parentContext=this,this.subContextCount++,o}transformIntoNewTimeline(t){return this.previousNode=ac,this.currentTimeline=this.currentTimeline.fork(this.element,t),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(t,e,n){let r={duration:e??t.duration,delay:this.currentTimeline.currentTime+(n??0)+t.delay,easing:""},o=new fm(this._driver,t.element,t.keyframes,t.preStyleProps,t.postStyleProps,r,t.stretchStartingKeyframe);return this.timelines.push(o),r}incrementTime(t){this.currentTimeline.forwardTime(this.currentTimeline.duration+t)}delayNextStep(t){t>0&&this.currentTimeline.delayNextStep(t)}invokeQuery(t,e,n,r,o,a){let s=[];if(r&&s.push(this.element),t.length>0){t=t.replace(vC,"."+this._enterClassName),t=t.replace(CC,"."+this._leaveClassName);let d=n!=1,p=this._driver.query(this.element,t,d);n!==0&&(p=n<0?p.slice(p.length+n,p.length):p.slice(0,n)),s.push(...p)}return!o&&s.length==0&&a.push(bf(e)),s}},sc=class i{_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,n,r){this._driver=t,this.element=e,this.startTime=n,this._elementTimelineStylesLookup=r,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 i(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+=_C,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,n]of this._globalTimelineStyles)this._backFill.set(e,n||kn),this._currentKeyframe.set(e,kn);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(t,e,n,r){e&&this._previousKeyframe.set("easing",e);let o=r&&r.params||{},a=xC(t,this._globalTimelineStyles);for(let[s,d]of a){let p=Vo(d,o,n);this._pendingStyles.set(s,p),this._localTimelineStyles.has(s)||this._backFill.set(s,this._globalTimelineStyles.get(s)??kn),this._updateStyle(s,p)}}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,n)=>{let r=this._styleSummary.get(n);(!r||e.time>r.time)&&this._updateStyle(n,e.value)})}buildKeyframes(){this.applyStylesToKeyframe();let t=new Set,e=new Set,n=this._keyframes.size===1&&this.duration===0,r=[];this._keyframes.forEach((s,d)=>{let p=new Map([...this._backFill,...s]);p.forEach((f,v)=>{f===Fo?t.add(v):f===kn&&e.add(v)}),n||p.set("offset",d/this.duration),r.push(p)});let o=[...t.values()],a=[...e.values()];if(n){let s=r[0],d=new Map(s);s.set("offset",0),d.set("offset",1),r=[s,d]}return Sm(this.element,r,o,a,this.duration,this.startTime,this.easing,!1)}},fm=class extends sc{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(t,e,n,r,o,a,s=!1){super(t,e,a.delay),this.keyframes=n,this.preStyleProps=r,this.postStyleProps=o,this._stretchStartingKeyframe=s,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:n,easing:r}=this.timings;if(this._stretchStartingKeyframe&&e){let o=[],a=n+e,s=e/a,d=new Map(t[0]);d.set("offset",0),o.push(d);let p=new Map(t[0]);p.set("offset",jf(s)),o.push(p);let f=t.length-1;for(let v=1;v<=f;v++){let E=new Map(t[v]),T=E.get("offset"),k=e+T*n;E.set("offset",jf(k/a)),o.push(E)}n=a,e=0,r="",t=o}return Sm(this.element,t,this.preStyleProps,this.postStyleProps,n,e,r,!0)}};function jf(i,t=3){let e=Math.pow(10,t-1);return Math.round(i*e)/e}function xC(i,t){let e=new Map,n;return i.forEach(r=>{if(r==="*"){n??=t.keys();for(let o of n)e.set(o,kn)}else for(let[o,a]of r)e.set(o,a)}),e}function zf(i,t,e,n,r,o,a,s,d,p,f,v,E){return{type:0,element:i,triggerName:t,isRemovalTransition:r,fromState:e,fromStyles:o,toState:n,toStyles:a,timelines:s,queriedElements:d,preStyleProps:p,postStyleProps:f,totalTime:v,errors:E}}var lm={},lc=class{_triggerName;ast;_stateStyles;constructor(t,e,n){this._triggerName=t,this.ast=e,this._stateStyles=n}match(t,e,n,r){return wC(this.ast.matchers,t,e,n,r)}buildStyles(t,e,n){let r=this._stateStyles.get("*");return t!==void 0&&(r=this._stateStyles.get(t?.toString())||r),r?r.buildStyles(e,n):new Map}build(t,e,n,r,o,a,s,d,p,f){let v=[],E=this.ast.options&&this.ast.options.params||lm,T=s&&s.params||lm,k=this.buildStyles(n,T,v),V=d&&d.params||lm,ge=this.buildStyles(r,V,v),Re=new Set,Ye=new Map,Ve=new Map,xe=r==="void",Jt={params:Xf(V,E),delay:this.ast.options?.delay},wt=f?[]:Qf(t,e,this.ast.animation,o,a,k,ge,Jt,p,v),st=0;return wt.forEach(It=>{st=Math.max(It.duration+It.delay,st)}),v.length?zf(e,this._triggerName,n,r,xe,k,ge,[],[],Ye,Ve,st,v):(wt.forEach(It=>{let _i=It.element,Ui=an(Ye,_i,new Set);It.preStyleProps.forEach(Dn=>Ui.add(Dn));let St=an(Ve,_i,new Set);It.postStyleProps.forEach(Dn=>St.add(Dn)),_i!==e&&Re.add(_i)}),zf(e,this._triggerName,n,r,xe,k,ge,wt,[...Re.values()],Ye,Ve,st))}};function wC(i,t,e,n,r){return i.some(o=>o(t,e,n,r))}function Xf(i,t){let e=M({},t);return Object.entries(i).forEach(([n,r])=>{r!=null&&(e[n]=r)}),e}var _m=class{styles;defaultParams;normalizer;constructor(t,e,n){this.styles=t,this.defaultParams=e,this.normalizer=n}buildStyles(t,e){let n=new Map,r=Xf(t,this.defaultParams);return this.styles.styles.forEach(o=>{typeof o!="string"&&o.forEach((a,s)=>{a&&(a=Vo(a,r,e));let d=this.normalizer.normalizePropertyName(s,e);a=this.normalizer.normalizeStyleValue(s,d,a,e),n.set(s,a)})}),n}};function SC(i,t,e){return new bm(i,t,e)}var bm=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(t,e,n){this.name=t,this.ast=e,this._normalizer=n,e.states.forEach(r=>{let o=r.options&&r.options.params||{};this.states.set(r.name,new _m(r.style,o,n))}),Bf(this.states,"true","1"),Bf(this.states,"false","0"),e.transitions.forEach(r=>{this.transitionFactories.push(new lc(t,r,this.states))}),this.fallbackTransition=kC(t,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(t,e,n,r){return this.transitionFactories.find(a=>a.match(t,e,n,r))||null}matchStyles(t,e,n){return this.fallbackTransition.buildStyles(t,e,n)}};function kC(i,t,e){let n=[(a,s)=>!0],r={type:me.Sequence,steps:[],options:null},o={type:me.Transition,animation:r,matchers:n,options:null,queryCount:0,depCount:0};return new lc(i,o,t)}function Bf(i,t,e){i.has(t)?i.has(e)||i.set(e,i.get(t)):i.has(e)&&i.set(t,i.get(e))}var MC=new ts,vm=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(t,e,n){this.bodyNode=t,this._driver=e,this._normalizer=n}register(t,e){let n=[],r=[],o=Yf(this._driver,e,n,r);if(n.length)throw xf(n);this._animations.set(t,o)}_buildPlayer(t,e,n){let r=t.element,o=Ju(this._normalizer,t.keyframes,e,n);return this._driver.animate(r,o,t.duration,t.delay,t.easing,[],!0)}create(t,e,n={}){let r=[],o=this._animations.get(t),a,s=new Map;if(o?(a=Qf(this._driver,e,o,rm,Xl,new Map,new Map,n,MC,r),a.forEach(f=>{let v=an(s,f.element,new Map);f.postStyleProps.forEach(E=>v.set(E,null))})):(r.push(wf()),a=[]),r.length)throw Sf(r);s.forEach((f,v)=>{f.forEach((E,T)=>{f.set(T,this._driver.computeStyle(v,T,kn))})});let d=a.map(f=>{let v=s.get(f.element);return this._buildPlayer(f,new Map,v)}),p=Mi(d);return this._playersById.set(t,p),p.onDestroy(()=>this.destroy(t)),this.players.push(p),p}destroy(t){let e=this._getPlayer(t);e.destroy(),this._playersById.delete(t);let n=this.players.indexOf(e);n>=0&&this.players.splice(n,1)}_getPlayer(t){let e=this._playersById.get(t);if(!e)throw kf(t);return e}listen(t,e,n,r){let o=Yl(e,"","","");return Gl(this._getPlayer(t),n,o,r),()=>{}}command(t,e,n,r){if(n=="register"){this.register(t,r[0]);return}if(n=="create"){let a=r[0]||{};this.create(t,e,a);return}let o=this._getPlayer(t);switch(n){case"play":o.play();break;case"pause":o.pause();break;case"reset":o.reset();break;case"restart":o.restart();break;case"finish":o.finish();break;case"init":o.init();break;case"setPosition":o.setPosition(parseFloat(r[0]));break;case"destroy":this.destroy(t);break}}},Hf="ng-animate-queued",EC=".ng-animate-queued",cm="ng-animate-disabled",TC=".ng-animate-disabled",OC="ng-star-inserted",PC=".ng-star-inserted",AC=[],Kf={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},DC={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},zn="__ng_removed",ns=class{namespaceId;value;options;get params(){return this.options.params}constructor(t,e=""){this.namespaceId=e;let n=t&&t.hasOwnProperty("value"),r=n?t.value:t;if(this.value=RC(r),n){let o=t,{value:a}=o,s=ip(o,["value"]);this.options=s}else this.options={};this.options.params||(this.options.params={})}absorbOptions(t){let e=t.params;if(e){let n=this.options.params;Object.keys(e).forEach(r=>{n[r]==null&&(n[r]=e[r])})}}},es="void",dm=new ns(es),ym=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(t,e,n){this.id=t,this.hostElement=e,this._engine=n,this._hostClassName="ng-tns-"+t,Mn(e,this._hostClassName)}listen(t,e,n,r){if(!this._triggers.has(e))throw Mf(n,e);if(n==null||n.length==0)throw Ef(e);if(!FC(n))throw Tf(n,e);let o=an(this._elementListeners,t,[]),a={name:e,phase:n,callback:r};o.push(a);let s=an(this._engine.statesByElement,t,new Map);return s.has(e)||(Mn(t,Ka),Mn(t,Ka+"-"+e),s.set(e,dm)),()=>{this._engine.afterFlush(()=>{let d=o.indexOf(a);d>=0&&o.splice(d,1),this._triggers.has(e)||s.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 Of(t);return e}trigger(t,e,n,r=!0){let o=this._getTrigger(e),a=new is(this.id,e,t),s=this._engine.statesByElement.get(t);s||(Mn(t,Ka),Mn(t,Ka+"-"+e),this._engine.statesByElement.set(t,s=new Map));let d=s.get(e),p=new ns(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&d&&p.absorbOptions(d.options),s.set(e,p),d||(d=dm),!(p.value===es)&&d.value===p.value){if(!LC(d.params,p.params)){let V=[],ge=o.matchStyles(d.value,d.params,V),Re=o.matchStyles(p.value,p.params,V);V.length?this._engine.reportError(V):this._engine.afterFlush(()=>{rr(t,ge),jn(t,Re)})}return}let E=an(this._engine.playersByElement,t,[]);E.forEach(V=>{V.namespaceId==this.id&&V.triggerName==e&&V.queued&&V.destroy()});let T=o.matchTransition(d.value,p.value,t,p.params),k=!1;if(!T){if(!r)return;T=o.fallbackTransition,k=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:e,transition:T,fromState:d,toState:p,player:a,isFallbackTransition:k}),k||(Mn(t,Hf),a.onStart(()=>{Lo(t,Hf)})),a.onDone(()=>{let V=this.players.indexOf(a);V>=0&&this.players.splice(V,1);let ge=this._engine.playersByElement.get(t);if(ge){let Re=ge.indexOf(a);Re>=0&&ge.splice(Re,1)}}),this.players.push(a),E.push(a),a}deregister(t){this._triggers.delete(t),this._engine.statesByElement.forEach(e=>e.delete(t)),this._elementListeners.forEach((e,n)=>{this._elementListeners.set(n,e.filter(r=>r.name!=t))})}clearElementCache(t){this._engine.statesByElement.delete(t),this._elementListeners.delete(t);let e=this._engine.playersByElement.get(t);e&&(e.forEach(n=>n.destroy()),this._engine.playersByElement.delete(t))}_signalRemovalForInnerTriggers(t,e){let n=this._engine.driver.query(t,Za,!0);n.forEach(r=>{if(r[zn])return;let o=this._engine.fetchNamespacesByElement(r);o.size?o.forEach(a=>a.triggerLeaveAnimation(r,e,!1,!0)):this.clearElementCache(r)}),this._engine.afterFlushAnimationsDone(()=>n.forEach(r=>this.clearElementCache(r)))}triggerLeaveAnimation(t,e,n,r){let o=this._engine.statesByElement.get(t),a=new Map;if(o){let s=[];if(o.forEach((d,p)=>{if(a.set(p,d.value),this._triggers.has(p)){let f=this.trigger(t,p,es,r);f&&s.push(f)}}),s.length)return this._engine.markElementAsRemoved(this.id,t,!0,e,a),n&&Mi(s).onDone(()=>this._engine.processLeaveNode(t)),!0}return!1}prepareLeaveAnimationListeners(t){let e=this._elementListeners.get(t),n=this._engine.statesByElement.get(t);if(e&&n){let r=new Set;e.forEach(o=>{let a=o.name;if(r.has(a))return;r.add(a);let d=this._triggers.get(a).fallbackTransition,p=n.get(a)||dm,f=new ns(es),v=new is(this.id,a,t);this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:a,transition:d,fromState:p,toState:f,player:v,isFallbackTransition:!0})})}}removeNode(t,e){let n=this._engine;if(t.childElementCount&&this._signalRemovalForInnerTriggers(t,e),this.triggerLeaveAnimation(t,e,!0))return;let r=!1;if(n.totalAnimations){let o=n.players.length?n.playersByQueriedElement.get(t):[];if(o&&o.length)r=!0;else{let a=t;for(;a=a.parentNode;)if(n.statesByElement.get(a)){r=!0;break}}}if(this.prepareLeaveAnimationListeners(t),r)n.markElementAsRemoved(this.id,t,!1,e);else{let o=t[zn];(!o||o===Kf)&&(n.afterFlush(()=>this.clearElementCache(t)),n.destroyInnerAnimations(t),n._onRemovalComplete(t,e))}}insertNode(t,e){Mn(t,this._hostClassName)}drainQueuedTransitions(t){let e=[];return this._queue.forEach(n=>{let r=n.player;if(r.destroyed)return;let o=n.element,a=this._elementListeners.get(o);a&&a.forEach(s=>{if(s.name==n.triggerName){let d=Yl(o,n.triggerName,n.fromState.value,n.toState.value);d._data=t,Gl(n.player,s.phase,d,s.callback)}}),r.markedForDestroy?this._engine.afterFlush(()=>{r.destroy()}):e.push(n)}),this._queue=[],e.sort((n,r)=>{let o=n.transition.ast.depCount,a=r.transition.ast.depCount;return o==0||a==0?o-a:this._engine.driver.containsElement(n.element,r.element)?1:-1})}destroy(t){this.players.forEach(e=>e.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,t)}},Cm=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,n){this.bodyNode=t,this.driver=e,this._normalizer=n}get queuedPlayers(){let t=[];return this._namespaceList.forEach(e=>{e.players.forEach(n=>{n.queued&&t.push(n)})}),t}createNamespace(t,e){let n=new ym(t,e,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,e)?this._balanceNamespaceList(n,e):(this.newHostElements.set(e,n),this.collectEnterElement(e)),this._namespaceLookup[t]=n}_balanceNamespaceList(t,e){let n=this._namespaceList,r=this.namespacesByHostElement;if(n.length-1>=0){let a=!1,s=this.driver.getParentElement(e);for(;s;){let d=r.get(s);if(d){let p=n.indexOf(d);n.splice(p+1,0,t),a=!0;break}s=this.driver.getParentElement(s)}a||n.unshift(t)}else n.push(t);return r.set(e,t),t}register(t,e){let n=this._namespaceLookup[t];return n||(n=this.createNamespace(t,e)),n}registerTrigger(t,e,n){let r=this._namespaceLookup[t];r&&r.register(e,n)&&this.totalAnimations++}destroy(t,e){t&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let n=this._fetchNamespace(t);this.namespacesByHostElement.delete(n.hostElement);let r=this._namespaceList.indexOf(n);r>=0&&this._namespaceList.splice(r,1),n.destroy(e),delete this._namespaceLookup[t]}))}_fetchNamespace(t){return this._namespaceLookup[t]}fetchNamespacesByElement(t){let e=new Set,n=this.statesByElement.get(t);if(n){for(let r of n.values())if(r.namespaceId){let o=this._fetchNamespace(r.namespaceId);o&&e.add(o)}}return e}trigger(t,e,n,r){if(nc(e)){let o=this._fetchNamespace(t);if(o)return o.trigger(e,n,r),!0}return!1}insertNode(t,e,n,r){if(!nc(e))return;let o=e[zn];if(o&&o.setForRemoval){o.setForRemoval=!1,o.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,n)}r&&this.collectEnterElement(e)}collectEnterElement(t){this.collectedEnterElements.push(t)}markElementAsDisabled(t,e){e?this.disabledNodes.has(t)||(this.disabledNodes.add(t),Mn(t,cm)):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),Lo(t,cm))}removeNode(t,e,n){if(nc(e)){let r=t?this._fetchNamespace(t):null;r?r.removeNode(e,n):this.markElementAsRemoved(t,e,!1,n);let o=this.namespacesByHostElement.get(e);o&&o.id!==t&&o.removeNode(e,n)}else this._onRemovalComplete(e,n)}markElementAsRemoved(t,e,n,r,o){this.collectedLeaveElements.push(e),e[zn]={namespaceId:t,setForRemoval:r,hasAnimation:n,removedBeforeQueried:!1,previousTriggersValues:o}}listen(t,e,n,r,o){return nc(e)?this._fetchNamespace(t).listen(e,n,r,o):()=>{}}_buildInstruction(t,e,n,r,o){return t.transition.build(this.driver,t.element,t.fromState.value,t.toState.value,n,r,t.fromState.options,t.toState.options,e,o)}destroyInnerAnimations(t){let e=this.driver.query(t,Za,!0);e.forEach(n=>this.destroyActiveAnimationsForElement(n)),this.playersByQueriedElement.size!=0&&(e=this.driver.query(t,Kl,!0),e.forEach(n=>this.finishActiveQueriedAnimationOnElement(n)))}destroyActiveAnimationsForElement(t){let e=this.playersByElement.get(t);e&&e.forEach(n=>{n.queued?n.markedForDestroy=!0:n.destroy()})}finishActiveQueriedAnimationOnElement(t){let e=this.playersByQueriedElement.get(t);e&&e.forEach(n=>n.finish())}whenRenderingDone(){return new Promise(t=>{if(this.players.length)return Mi(this.players).onDone(()=>t());t()})}processLeaveNode(t){let e=t[zn];if(e&&e.setForRemoval){if(t[zn]=Kf,e.namespaceId){this.destroyInnerAnimations(t);let n=this._fetchNamespace(e.namespaceId);n&&n.clearElementCache(t)}this._onRemovalComplete(t,e.setForRemoval)}t.classList?.contains(cm)&&this.markElementAsDisabled(t,!1),this.driver.query(t,TC,!0).forEach(n=>{this.markElementAsDisabled(n,!1)})}flush(t=-1){let e=[];if(this.newHostElements.size&&(this.newHostElements.forEach((n,r)=>this._balanceNamespaceList(n,r)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let n=0;n<this.collectedEnterElements.length;n++){let r=this.collectedEnterElements[n];Mn(r,OC)}if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){let n=[];try{e=this._flushAnimations(n,t)}finally{for(let r=0;r<n.length;r++)n[r]()}}else for(let n=0;n<this.collectedLeaveElements.length;n++){let r=this.collectedLeaveElements[n];this.processLeaveNode(r)}if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(n=>n()),this._flushFns=[],this._whenQuietFns.length){let n=this._whenQuietFns;this._whenQuietFns=[],e.length?Mi(e).onDone(()=>{n.forEach(r=>r())}):n.forEach(r=>r())}}reportError(t){throw Pf(t)}_flushAnimations(t,e){let n=new ts,r=[],o=new Map,a=[],s=new Map,d=new Map,p=new Map,f=new Set;this.disabledNodes.forEach(W=>{f.add(W);let ee=this.driver.query(W,EC,!0);for(let oe=0;oe<ee.length;oe++)f.add(ee[oe])});let v=this.bodyNode,E=Array.from(this.statesByElement.keys()),T=Wf(E,this.collectedEnterElements),k=new Map,V=0;T.forEach((W,ee)=>{let oe=rm+V++;k.set(ee,oe),W.forEach(Se=>Mn(Se,oe))});let ge=[],Re=new Set,Ye=new Set;for(let W=0;W<this.collectedLeaveElements.length;W++){let ee=this.collectedLeaveElements[W],oe=ee[zn];oe&&oe.setForRemoval&&(ge.push(ee),Re.add(ee),oe.hasAnimation?this.driver.query(ee,PC,!0).forEach(Se=>Re.add(Se)):Ye.add(ee))}let Ve=new Map,xe=Wf(E,Array.from(Re));xe.forEach((W,ee)=>{let oe=Xl+V++;Ve.set(ee,oe),W.forEach(Se=>Mn(Se,oe))}),t.push(()=>{T.forEach((W,ee)=>{let oe=k.get(ee);W.forEach(Se=>Lo(Se,oe))}),xe.forEach((W,ee)=>{let oe=Ve.get(ee);W.forEach(Se=>Lo(Se,oe))}),ge.forEach(W=>{this.processLeaveNode(W)})});let Jt=[],wt=[];for(let W=this._namespaceList.length-1;W>=0;W--)this._namespaceList[W].drainQueuedTransitions(e).forEach(oe=>{let Se=oe.player,ht=oe.element;if(Jt.push(Se),this.collectedEnterElements.length){let ft=ht[zn];if(ft&&ft.setForMove){if(ft.previousTriggersValues&&ft.previousTriggersValues.has(oe.triggerName)){let en=ft.previousTriggersValues.get(oe.triggerName),Ut=this.statesByElement.get(oe.element);if(Ut&&Ut.has(oe.triggerName)){let $i=Ut.get(oe.triggerName);$i.value=en,Ut.set(oe.triggerName,$i)}}Se.destroy();return}}let Fe=!v||!this.driver.containsElement(v,ht),Rt=Ve.get(ht),Ue=k.get(ht),$e=this._buildInstruction(oe,n,Ue,Rt,Fe);if($e.errors&&$e.errors.length){wt.push($e);return}if(Fe){Se.onStart(()=>rr(ht,$e.fromStyles)),Se.onDestroy(()=>jn(ht,$e.toStyles)),r.push(Se);return}if(oe.isFallbackTransition){Se.onStart(()=>rr(ht,$e.fromStyles)),Se.onDestroy(()=>jn(ht,$e.toStyles)),r.push(Se);return}let Ke=[];$e.timelines.forEach(ft=>{ft.stretchStartingKeyframe=!0,this.disabledNodes.has(ft.element)||Ke.push(ft)}),$e.timelines=Ke,n.append(ht,$e.timelines);let fr={instruction:$e,player:Se,element:ht};a.push(fr),$e.queriedElements.forEach(ft=>an(s,ft,[]).push(Se)),$e.preStyleProps.forEach((ft,en)=>{if(ft.size){let Ut=d.get(en);Ut||d.set(en,Ut=new Set),ft.forEach(($i,ao)=>Ut.add(ao))}}),$e.postStyleProps.forEach((ft,en)=>{let Ut=p.get(en);Ut||p.set(en,Ut=new Set),ft.forEach(($i,ao)=>Ut.add(ao))})});if(wt.length){let W=[];wt.forEach(ee=>{W.push(Af(ee.triggerName,ee.errors))}),Jt.forEach(ee=>ee.destroy()),this.reportError(W)}let st=new Map,It=new Map;a.forEach(W=>{let ee=W.element;n.has(ee)&&(It.set(ee,ee),this._beforeAnimationBuild(W.player.namespaceId,W.instruction,st))}),r.forEach(W=>{let ee=W.element;this._getPreviousPlayers(ee,!1,W.namespaceId,W.triggerName,null).forEach(Se=>{an(st,ee,[]).push(Se),Se.destroy()})});let _i=ge.filter(W=>qf(W,d,p)),Ui=new Map;$f(Ui,this.driver,Ye,p,kn).forEach(W=>{qf(W,d,p)&&_i.push(W)});let Dn=new Map;T.forEach((W,ee)=>{$f(Dn,this.driver,new Set(W),d,Fo)}),_i.forEach(W=>{let ee=Ui.get(W),oe=Dn.get(W);Ui.set(W,new Map([...ee?.entries()??[],...oe?.entries()??[]]))});let gr=[],oo=[],Hs={};a.forEach(W=>{let{element:ee,player:oe,instruction:Se}=W;if(n.has(ee)){if(f.has(ee)){oe.onDestroy(()=>jn(ee,Se.toStyles)),oe.disabled=!0,oe.overrideTotalTime(Se.totalTime),r.push(oe);return}let ht=Hs;if(It.size>1){let Rt=ee,Ue=[];for(;Rt=Rt.parentNode;){let $e=It.get(Rt);if($e){ht=$e;break}Ue.push(Rt)}Ue.forEach($e=>It.set($e,ht))}let Fe=this._buildAnimation(oe.namespaceId,Se,st,o,Dn,Ui);if(oe.setRealPlayer(Fe),ht===Hs)gr.push(oe);else{let Rt=this.playersByElement.get(ht);Rt&&Rt.length&&(oe.parentPlayer=Mi(Rt)),r.push(oe)}}else rr(ee,Se.fromStyles),oe.onDestroy(()=>jn(ee,Se.toStyles)),oo.push(oe),f.has(ee)&&r.push(oe)}),oo.forEach(W=>{let ee=o.get(W.element);if(ee&&ee.length){let oe=Mi(ee);W.setRealPlayer(oe)}}),r.forEach(W=>{W.parentPlayer?W.syncPlayerEvents(W.parentPlayer):W.destroy()});for(let W=0;W<ge.length;W++){let ee=ge[W],oe=ee[zn];if(Lo(ee,Xl),oe&&oe.hasAnimation)continue;let Se=[];if(s.size){let Fe=s.get(ee);Fe&&Fe.length&&Se.push(...Fe);let Rt=this.driver.query(ee,Kl,!0);for(let Ue=0;Ue<Rt.length;Ue++){let $e=s.get(Rt[Ue]);$e&&$e.length&&Se.push(...$e)}}let ht=Se.filter(Fe=>!Fe.destroyed);ht.length?NC(this,ee,ht):this.processLeaveNode(ee)}return ge.length=0,gr.forEach(W=>{this.players.push(W),W.onDone(()=>{W.destroy();let ee=this.players.indexOf(W);this.players.splice(ee,1)}),W.play()}),gr}afterFlush(t){this._flushFns.push(t)}afterFlushAnimationsDone(t){this._whenQuietFns.push(t)}_getPreviousPlayers(t,e,n,r,o){let a=[];if(e){let s=this.playersByQueriedElement.get(t);s&&(a=s)}else{let s=this.playersByElement.get(t);if(s){let d=!o||o==es;s.forEach(p=>{p.queued||!d&&p.triggerName!=r||a.push(p)})}}return(n||r)&&(a=a.filter(s=>!(n&&n!=s.namespaceId||r&&r!=s.triggerName))),a}_beforeAnimationBuild(t,e,n){let r=e.triggerName,o=e.element,a=e.isRemovalTransition?void 0:t,s=e.isRemovalTransition?void 0:r;for(let d of e.timelines){let p=d.element,f=p!==o,v=an(n,p,[]);this._getPreviousPlayers(p,f,a,s,e.toState).forEach(T=>{let k=T.getRealPlayer();k.beforeDestroy&&k.beforeDestroy(),T.destroy(),v.push(T)})}rr(o,e.fromStyles)}_buildAnimation(t,e,n,r,o,a){let s=e.triggerName,d=e.element,p=[],f=new Set,v=new Set,E=e.timelines.map(k=>{let V=k.element;f.add(V);let ge=V[zn];if(ge&&ge.removedBeforeQueried)return new ai(k.duration,k.delay);let Re=V!==d,Ye=VC((n.get(V)||AC).map(st=>st.getRealPlayer())).filter(st=>{let It=st;return It.element?It.element===V:!1}),Ve=o.get(V),xe=a.get(V),Jt=Ju(this._normalizer,k.keyframes,Ve,xe),wt=this._buildPlayer(k,Jt,Ye);if(k.subTimeline&&r&&v.add(V),Re){let st=new is(t,s,V);st.setRealPlayer(wt),p.push(st)}return wt});p.forEach(k=>{an(this.playersByQueriedElement,k.element,[]).push(k),k.onDone(()=>IC(this.playersByQueriedElement,k.element,k))}),f.forEach(k=>Mn(k,om));let T=Mi(E);return T.onDestroy(()=>{f.forEach(k=>Lo(k,om)),jn(d,e.toStyles)}),v.forEach(k=>{an(r,k,[]).push(T)}),T}_buildPlayer(t,e,n){return e.length>0?this.driver.animate(t.element,e,t.duration,t.delay,t.easing,n):new ai(t.duration,t.delay)}},is=class{namespaceId;triggerName;element;_player=new ai;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(t,e,n){this.namespaceId=t,this.triggerName=e,this.element=n}setRealPlayer(t){this._containsRealPlayer||(this._player=t,this._queuedCallbacks.forEach((e,n)=>{e.forEach(r=>Gl(t,n,void 0,r))}),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){an(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 IC(i,t,e){let n=i.get(t);if(n){if(n.length){let r=n.indexOf(e);n.splice(r,1)}n.length==0&&i.delete(t)}return n}function RC(i){return i??null}function nc(i){return i&&i.nodeType===1}function FC(i){return i=="start"||i=="done"}function Uf(i,t){let e=i.style.display;return i.style.display=t??"none",e}function $f(i,t,e,n,r){let o=[];e.forEach(d=>o.push(Uf(d)));let a=[];n.forEach((d,p)=>{let f=new Map;d.forEach(v=>{let E=t.computeStyle(p,v,r);f.set(v,E),(!E||E.length==0)&&(p[zn]=DC,a.push(p))}),i.set(p,f)});let s=0;return e.forEach(d=>Uf(d,o[s++])),a}function Wf(i,t){let e=new Map;if(i.forEach(s=>e.set(s,[])),t.length==0)return e;let n=1,r=new Set(t),o=new Map;function a(s){if(!s)return n;let d=o.get(s);if(d)return d;let p=s.parentNode;return e.has(p)?d=p:r.has(p)?d=n:d=a(p),o.set(s,d),d}return t.forEach(s=>{let d=a(s);d!==n&&e.get(d).push(s)}),e}function Mn(i,t){i.classList?.add(t)}function Lo(i,t){i.classList?.remove(t)}function NC(i,t,e){Mi(e).onDone(()=>i.processLeaveNode(t))}function VC(i){let t=[];return Zf(i,t),t}function Zf(i,t){for(let e=0;e<i.length;e++){let n=i[e];n instanceof Dr?Zf(n.players,t):t.push(n)}}function LC(i,t){let e=Object.keys(i),n=Object.keys(t);if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++){let o=e[r];if(!t.hasOwnProperty(o)||i[o]!==t[o])return!1}return!0}function qf(i,t,e){let n=e.get(i);if(!n)return!1;let r=t.get(i);return r?n.forEach(o=>r.add(o)):t.set(i,n),e.delete(i),!0}var jo=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(t,e)=>{};constructor(t,e,n){this._driver=e,this._normalizer=n,this._transitionEngine=new Cm(t.body,e,n),this._timelineEngine=new vm(t.body,e,n),this._transitionEngine.onRemovalComplete=(r,o)=>this.onRemovalComplete(r,o)}registerTrigger(t,e,n,r,o){let a=t+"-"+r,s=this._triggerCache[a];if(!s){let d=[],p=[],f=Yf(this._driver,o,d,p);if(d.length)throw Cf(r,d);s=SC(r,f,this._normalizer),this._triggerCache[a]=s}this._transitionEngine.registerTrigger(e,r,s)}register(t,e){this._transitionEngine.register(t,e)}destroy(t,e){this._transitionEngine.destroy(t,e)}onInsert(t,e,n,r){this._transitionEngine.insertNode(t,e,n,r)}onRemove(t,e,n){this._transitionEngine.removeNode(t,e,n)}disableAnimations(t,e){this._transitionEngine.markElementAsDisabled(t,e)}process(t,e,n,r){if(n.charAt(0)=="@"){let[o,a]=em(n),s=r;this._timelineEngine.command(o,e,a,s)}else this._transitionEngine.trigger(t,e,n,r)}listen(t,e,n,r,o){if(n.charAt(0)=="@"){let[a,s]=em(n);return this._timelineEngine.listen(a,e,s,o)}return this._transitionEngine.listen(t,e,n,r,o)}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 jC(i,t){let e=null,n=null;return Array.isArray(t)&&t.length?(e=um(t[0]),t.length>1&&(n=um(t[t.length-1]))):t instanceof Map&&(e=um(t)),e||n?new zC(i,e,n):null}var zC=(()=>{class i{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(e,n,r){this._element=e,this._startStyles=n,this._endStyles=r;let o=i.initialStylesByElement.get(e);o||i.initialStylesByElement.set(e,o=new Map),this._initialStyles=o}start(){this._state<1&&(this._startStyles&&jn(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(jn(this._element,this._initialStyles),this._endStyles&&(jn(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(i.initialStylesByElement.delete(this._element),this._startStyles&&(rr(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(rr(this._element,this._endStyles),this._endStyles=null),jn(this._element,this._initialStyles),this._state=3)}}return i})();function um(i){let t=null;return i.forEach((e,n)=>{BC(n)&&(t=t||new Map,t.set(n,e))}),t}function BC(i){return i==="display"||i==="position"}var cc=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,n,r){this.element=t,this.keyframes=e,this.options=n,this._specialStyles=r,this._duration=n.duration,this._delay=n.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(n=>{e.push(Object.fromEntries(n))}),e}_triggerWebAnimation(t,e,n){return t.animate(this._convertKeyframesToObject(e),n)}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((n,r)=>{r!=="offset"&&t.set(r,this._finished?n:Jl(this.element,r))}),this.currentSnapshot=t}triggerCallback(t){let e=t==="start"?this._onStartFns:this._onDoneFns;e.forEach(n=>n()),e.length=0}},dc=class{validateStyleProperty(t){return!0}validateAnimatableStyleProperty(t){return!0}containsElement(t,e){return tm(t,e)}getParentElement(t){return Ql(t)}query(t,e,n){return nm(t,e,n)}computeStyle(t,e,n){return Jl(t,e)}animate(t,e,n,r,o,a=[]){let s=r==0?"both":"forwards",d={duration:n,delay:r,fill:s};o&&(d.easing=o);let p=new Map,f=a.filter(T=>T instanceof cc);Ff(n,r)&&f.forEach(T=>{T.currentSnapshot.forEach((k,V)=>p.set(V,k))});let v=If(e).map(T=>new Map(T));v=Nf(t,v,p);let E=jC(t,v);return new cc(t,v,d,E)}};var ic="@",Jf="@.disabled",uc=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(t,e,n,r){this.namespaceId=t,this.delegate=e,this.engine=n,this._onDestroy=r}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,n,r=!0){this.delegate.insertBefore(t,e,n),this.engine.onInsert(this.namespaceId,e,t,r)}removeChild(t,e,n,r){if(r){this.delegate.removeChild(t,e,n);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,n,r){this.delegate.setAttribute(t,e,n,r)}removeAttribute(t,e,n){this.delegate.removeAttribute(t,e,n)}addClass(t,e){this.delegate.addClass(t,e)}removeClass(t,e){this.delegate.removeClass(t,e)}setStyle(t,e,n,r){this.delegate.setStyle(t,e,n,r)}removeStyle(t,e,n){this.delegate.removeStyle(t,e,n)}setProperty(t,e,n){e.charAt(0)==ic&&e==Jf?this.disableAnimations(t,!!n):this.delegate.setProperty(t,e,n)}setValue(t,e){this.delegate.setValue(t,e)}listen(t,e,n,r){return this.delegate.listen(t,e,n,r)}disableAnimations(t,e){this.engine.disableAnimations(t,e)}},xm=class extends uc{factory;constructor(t,e,n,r,o){super(e,n,r,o),this.factory=t,this.namespaceId=e}setProperty(t,e,n){e.charAt(0)==ic?e.charAt(1)=="."&&e==Jf?(n=n===void 0?!0:!!n,this.disableAnimations(t,n)):this.engine.process(this.namespaceId,t,e.slice(1),n):this.delegate.setProperty(t,e,n)}listen(t,e,n,r){if(e.charAt(0)==ic){let o=HC(t),a=e.slice(1),s="";return a.charAt(0)!=ic&&([a,s]=UC(a)),this.engine.listen(this.namespaceId,o,a,s,d=>{let p=d._data||-1;this.factory.scheduleListenerCallback(p,n,d)})}return this.delegate.listen(t,e,n,r)}};function HC(i){switch(i){case"body":return document.body;case"document":return document;case"window":return window;default:return i}}function UC(i){let t=i.indexOf("."),e=i.substring(0,t),n=i.slice(t+1);return[e,n]}var mc=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(t,e,n){this.delegate=t,this.engine=e,this._zone=n,e.onRemovalComplete=(r,o)=>{o?.removeChild(null,r)}}createRenderer(t,e){let r=this.delegate.createRenderer(t,e);if(!t||!e?.data?.animation){let p=this._rendererCache,f=p.get(r);if(!f){let v=()=>p.delete(r);f=new uc("",r,this.engine,v),p.set(r,f)}return f}let o=e.id,a=e.id+"-"+this._currentId;this._currentId++,this.engine.register(a,t);let s=p=>{Array.isArray(p)?p.forEach(s):this.engine.registerTrigger(o,a,t,p.name,p)};return e.data.animation.forEach(s),new xm(this,a,r,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(t,e,n){if(t>=0&&t<this._microtaskId){this._zone.run(()=>e(n));return}let r=this._animationCallbacksBuffer;r.length==0&&queueMicrotask(()=>{this._zone.run(()=>{r.forEach(o=>{let[a,s]=o;a(s)}),this._animationCallbacksBuffer=[]})}),r.push([e,n])}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 WC=(()=>{class i extends jo{constructor(e,n,r){super(e,n,r)}ngOnDestroy(){this.flush()}static \u0275fac=function(n){return new(n||i)(Cn(ct),Cn(Fr),Cn(Nr))};static \u0275prov=O({token:i,factory:i.\u0275fac})}return i})();function qC(){return new rc}function GC(i,t,e){return new mc(i,t,e)}var e_=[{provide:Nr,useFactory:qC},{provide:jo,useClass:WC},{provide:Fn,useFactory:GC,deps:[Wp,jo,fe]}],aP=[{provide:Fr,useClass:wm},{provide:Ea,useValue:"NoopAnimations"},...e_],YC=[{provide:Fr,useFactory:()=>new dc},{provide:Ea,useFactory:()=>"BrowserAnimations"},...e_];function t_(){return el("NgEagerAnimations"),[...YC]}var rs=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}},Ei=class extends rs{component;viewContainerRef;injector;projectableNodes;constructor(t,e,n,r){super(),this.component=t,this.viewContainerRef=e,this.injector=n,this.projectableNodes=r}},Ti=class extends rs{templateRef;viewContainerRef;context;injector;constructor(t,e,n,r){super(),this.templateRef=t,this.viewContainerRef=e,this.context=n,this.injector=r}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()}},km=class extends rs{element;constructor(t){super(),this.element=t instanceof ae?t.nativeElement:t}},or=class{_attachedPortal;_disposeFn;_isDisposed=!1;hasAttached(){return!!this._attachedPortal}attach(t){if(t instanceof Ei)return this._attachedPortal=t,this.attachComponentPortal(t);if(t instanceof Ti)return this._attachedPortal=t,this.attachTemplatePortal(t);if(this.attachDomPortal&&t instanceof km)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)}},hc=class extends or{outletElement;_appRef;_defaultInjector;constructor(t,e,n){super(),this.outletElement=t,this._appRef=e,this._defaultInjector=n}attachComponentPortal(t){let e;if(t.viewContainerRef){let n=t.injector||t.viewContainerRef.injector,r=n.get(lu,null,{optional:!0})||void 0;e=t.viewContainerRef.createComponent(t.component,{index:t.viewContainerRef.length,injector:n,ngModuleRef:r,projectableNodes:t.projectableNodes||void 0}),this.setDisposeFn(()=>e.destroy())}else{let n=this._appRef,r=t.injector||this._defaultInjector||we.NULL,o=r.get(Rn,n.injector);e=Vp(t.component,{elementInjector:r,environmentInjector:o,projectableNodes:t.projectableNodes||void 0}),n.attachView(e.hostView),this.setDisposeFn(()=>{n.viewCount>0&&n.detachView(e.hostView),e.destroy()})}return this.outletElement.appendChild(this._getComponentRootNode(e)),this._attachedPortal=t,e}attachTemplatePortal(t){let e=t.viewContainerRef,n=e.createEmbeddedView(t.templateRef,t.context,{injector:t.injector});return n.rootNodes.forEach(r=>this.outletElement.appendChild(r)),n.detectChanges(),this.setDisposeFn(()=>{let r=e.indexOf(n);r!==-1&&e.remove(r)}),this._attachedPortal=t,n}attachDomPortal=t=>{let e=t.element;e.parentNode;let n=this.outletElement.ownerDocument.createComment("dom-portal");e.parentNode.insertBefore(n,e),this.outletElement.appendChild(e),this._attachedPortal=t,super.setDisposeFn(()=>{n.parentNode&&n.parentNode.replaceChild(e,n)})};dispose(){super.dispose(),this.outletElement.remove()}_getComponentRootNode(t){return t.hostView.rootNodes[0]}};var ar=(()=>{class i extends or{_moduleRef=u(lu,{optional:!0});_document=u(ct);_viewContainerRef=u(yr);_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 H;get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedRef=this._attachedPortal=null}attachComponentPortal(e){e.setAttachedHost(this);let n=e.viewContainerRef!=null?e.viewContainerRef:this._viewContainerRef,r=n.createComponent(e.component,{index:n.length,injector:e.injector||n.injector,projectableNodes:e.projectableNodes||void 0,ngModuleRef:this._moduleRef||void 0});return n!==this._viewContainerRef&&this._getRootNode().appendChild(r.hostView.rootNodes[0]),super.setDisposeFn(()=>r.destroy()),this._attachedPortal=e,this._attachedRef=r,this.attached.emit(r),r}attachTemplatePortal(e){e.setAttachedHost(this);let n=this._viewContainerRef.createEmbeddedView(e.templateRef,e.context,{injector:e.injector});return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=e,this._attachedRef=n,this.attached.emit(n),n}attachDomPortal=e=>{let n=e.element;n.parentNode;let r=this._document.createComment("dom-portal");e.setAttachedHost(this),n.parentNode.insertBefore(r,n),this._getRootNode().appendChild(n),this._attachedPortal=e,super.setDisposeFn(()=>{r.parentNode&&r.parentNode.replaceChild(n,r)})};_getRootNode(){let e=this._viewContainerRef.element.nativeElement;return e.nodeType===e.ELEMENT_NODE?e:e.parentNode}static \u0275fac=function(n){return new(n||i)};static \u0275dir=ne({type:i,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:[0,"cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[ke]})}return i})();var Oi=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=de({type:i});static \u0275inj=ce({})}return i})();var QC=20,zo=(()=>{class i{_ngZone=u(fe);_platform=u(pt);_renderer=u(Fn).createRenderer(null,null);_cleanupGlobalListener;constructor(){}_scrolled=new I;_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 n=this.scrollContainers.get(e);n&&(n.unsubscribe(),this.scrollContainers.delete(e))}scrolled(e=QC){return this._platform.isBrowser?new nn(n=>{this._cleanupGlobalListener||(this._cleanupGlobalListener=this._ngZone.runOutsideAngular(()=>this._renderer.listen("document","scroll",()=>this._scrolled.next())));let r=e>0?this._scrolled.pipe(iu(e)).subscribe(n):this._scrolled.subscribe(n);return this._scrolledCount++,()=>{r.unsubscribe(),this._scrolledCount--,this._scrolledCount||(this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0)}}):$()}ngOnDestroy(){this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0,this.scrollContainers.forEach((e,n)=>this.deregister(n)),this._scrolled.complete()}ancestorScrolled(e,n){let r=this.getAncestorScrollContainers(e);return this.scrolled(n).pipe(le(o=>!o||r.indexOf(o)>-1))}getAncestorScrollContainers(e){let n=[];return this.scrollContainers.forEach((r,o)=>{this._scrollableContainsElement(o,e)&&n.push(o)}),n}_scrollableContainsElement(e,n){let r=Aa(n),o=e.getElementRef().nativeElement;do if(r==o)return!0;while(r=r.parentElement);return!1}static \u0275fac=function(n){return new(n||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),sr=(()=>{class i{elementRef=u(ae);scrollDispatcher=u(zo);ngZone=u(fe);dir=u(jt,{optional:!0});_scrollElement=this.elementRef.nativeElement;_destroyed=new I;_renderer=u(et);_cleanupScroll;_elementScrolled=new I;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 n=this.elementRef.nativeElement,r=this.dir&&this.dir.value=="rtl";e.left==null&&(e.left=r?e.end:e.start),e.right==null&&(e.right=r?e.start:e.end),e.bottom!=null&&(e.top=n.scrollHeight-n.clientHeight-e.bottom),r&&yo()!=vo.NORMAL?(e.left!=null&&(e.right=n.scrollWidth-n.clientWidth-e.left),yo()==vo.INVERTED?e.left=e.right:yo()==vo.NEGATED&&(e.left=e.right?-e.right:e.right)):e.right!=null&&(e.left=n.scrollWidth-n.clientWidth-e.right),this._applyScrollToOptions(e)}_applyScrollToOptions(e){let n=this.elementRef.nativeElement;pl()?n.scrollTo(e):(e.top!=null&&(n.scrollTop=e.top),e.left!=null&&(n.scrollLeft=e.left))}measureScrollOffset(e){let n="left",r="right",o=this.elementRef.nativeElement;if(e=="top")return o.scrollTop;if(e=="bottom")return o.scrollHeight-o.clientHeight-o.scrollTop;let a=this.dir&&this.dir.value=="rtl";return e=="start"?e=a?r:n:e=="end"&&(e=a?n:r),a&&yo()==vo.INVERTED?e==n?o.scrollWidth-o.clientWidth-o.scrollLeft:o.scrollLeft:a&&yo()==vo.NEGATED?e==n?o.scrollLeft+o.scrollWidth-o.clientWidth:-o.scrollLeft:e==n?o.scrollLeft:o.scrollWidth-o.clientWidth-o.scrollLeft}static \u0275fac=function(n){return new(n||i)};static \u0275dir=ne({type:i,selectors:[["","cdk-scrollable",""],["","cdkScrollable",""]]})}return i})(),XC=20,Pi=(()=>{class i{_platform=u(pt);_listeners;_viewportSize;_change=new I;_document=u(ct);constructor(){let e=u(fe),n=u(Fn).createRenderer(null,null);e.runOutsideAngular(()=>{if(this._platform.isBrowser){let r=o=>this._change.next(o);this._listeners=[n.listen("window","resize",r),n.listen("window","orientationchange",r)]}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:n,height:r}=this.getViewportSize();return{top:e.top,left:e.left,bottom:e.top+r,right:e.left+n,height:r,width:n}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let e=this._document,n=this._getWindow(),r=e.documentElement,o=r.getBoundingClientRect(),a=-o.top||e.body.scrollTop||n.scrollY||r.scrollTop||0,s=-o.left||e.body.scrollLeft||n.scrollX||r.scrollLeft||0;return{top:a,left:s}}change(e=XC){return e>0?this._change.pipe(iu(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(n){return new(n||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var Vr=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=de({type:i});static \u0275inj=ce({})}return i})(),Mm=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=de({type:i});static \u0275inj=ce({imports:[Da,Vr,Da,Vr]})}return i})();var n_=pl();function Uo(i){return new pc(i.get(Pi),i.get(ct))}var pc=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=gt(-this._previousScrollPosition.left),t.style.top=gt(-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,n=t.style,r=e.style,o=n.scrollBehavior||"",a=r.scrollBehavior||"";this._isEnabled=!1,n.left=this._previousHTMLStyles.left,n.top=this._previousHTMLStyles.top,t.classList.remove("cdk-global-scrollblock"),n_&&(n.scrollBehavior=r.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),n_&&(n.scrollBehavior=o,r.scrollBehavior=a)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;let e=this._document.documentElement,n=this._viewportRuler.getViewportSize();return e.scrollHeight>n.height||e.scrollWidth>n.width}};function c_(i,t){return new gc(i.get(zo),i.get(fe),i.get(Pi),t)}var gc=class{_scrollDispatcher;_ngZone;_viewportRuler;_config;_scrollSubscription=null;_overlayRef;_initialScrollPosition;constructor(t,e,n,r){this._scrollDispatcher=t,this._ngZone=e,this._viewportRuler=n,this._config=r}attach(t){this._overlayRef,this._overlayRef=t}enable(){if(this._scrollSubscription)return;let t=this._scrollDispatcher.scrolled(0).pipe(le(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 os=class{enable(){}disable(){}attach(){}};function Em(i,t){return t.some(e=>{let n=i.bottom<e.top,r=i.top>e.bottom,o=i.right<e.left,a=i.left>e.right;return n||r||o||a})}function i_(i,t){return t.some(e=>{let n=i.top<e.top,r=i.bottom>e.bottom,o=i.left<e.left,a=i.right>e.right;return n||r||o||a})}function zr(i,t){return new fc(i.get(zo),i.get(Pi),i.get(fe),t)}var fc=class{_scrollDispatcher;_viewportRuler;_ngZone;_config;_scrollSubscription=null;_overlayRef;constructor(t,e,n,r){this._scrollDispatcher=t,this._viewportRuler=e,this._ngZone=n,this._config=r}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:n,height:r}=this._viewportRuler.getViewportSize();Em(e,[{width:n,height:r,bottom:r,right:n,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}},d_=(()=>{class i{_injector=u(we);constructor(){}noop=()=>new os;close=e=>c_(this._injector,e);block=()=>Uo(this._injector);reposition=e=>zr(this._injector,e);static \u0275fac=function(n){return new(n||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),Ai=class{positionStrategy;scrollStrategy=new os;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 n of e)t[n]!==void 0&&(this[n]=t[n])}}};var _c=class{connectionPair;scrollableViewProperties;constructor(t,e){this.connectionPair=t,this.scrollableViewProperties=e}};var u_=(()=>{class i{_attachedOverlays=[];_document=u(ct);_isAttached;constructor(){}ngOnDestroy(){this.detach()}add(e){this.remove(e),this._attachedOverlays.push(e)}remove(e){let n=this._attachedOverlays.indexOf(e);n>-1&&this._attachedOverlays.splice(n,1),this._attachedOverlays.length===0&&this.detach()}static \u0275fac=function(n){return new(n||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),m_=(()=>{class i extends u_{_ngZone=u(fe);_renderer=u(Fn).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 n=this._attachedOverlays;for(let r=n.length-1;r>-1;r--)if(n[r]._keydownEvents.observers.length>0){this._ngZone.run(()=>n[r]._keydownEvents.next(e));break}};static \u0275fac=(()=>{let e;return function(r){return(e||(e=We(i)))(r||i)}})();static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),h_=(()=>{class i extends u_{_platform=u(pt);_ngZone=u(fe);_renderer=u(Fn).createRenderer(null,null);_cursorOriginalValue;_cursorStyleIsSet=!1;_pointerDownEventTarget;_cleanups;add(e){if(super.add(e),!this._isAttached){let n=this._document.body,r={capture:!0},o=this._renderer;this._cleanups=this._ngZone.runOutsideAngular(()=>[o.listen(n,"pointerdown",this._pointerDownListener,r),o.listen(n,"click",this._clickListener,r),o.listen(n,"auxclick",this._clickListener,r),o.listen(n,"contextmenu",this._clickListener,r)]),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=n.style.cursor,n.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=cl(e)};_clickListener=e=>{let n=cl(e),r=e.type==="click"&&this._pointerDownEventTarget?this._pointerDownEventTarget:n;this._pointerDownEventTarget=null;let o=this._attachedOverlays.slice();for(let a=o.length-1;a>-1;a--){let s=o[a];if(s._outsidePointerEvents.observers.length<1||!s.hasAttached())continue;if(r_(s.overlayElement,n)||r_(s.overlayElement,r))break;let d=s._outsidePointerEvents;this._ngZone?this._ngZone.run(()=>d.next(e)):d.next(e)}};static \u0275fac=(()=>{let e;return function(r){return(e||(e=We(i)))(r||i)}})();static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function r_(i,t){let e=typeof ShadowRoot<"u"&&ShadowRoot,n=t;for(;n;){if(n===i)return!0;n=e&&n instanceof ShadowRoot?n.host:n.parentNode}return!1}var p_=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["ng-component"]],hostAttrs:["cdk-overlay-style-loader",""],decls:0,vars:0,template:function(n,r){},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 i})(),yc=(()=>{class i{_platform=u(pt);_containerElement;_document=u(ct);_styleLoader=u($t);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||_u()){let r=this._document.querySelectorAll(`.${e}[platform="server"], .${e}[platform="test"]`);for(let o=0;o<r.length;o++)r[o].remove()}let n=this._document.createElement("div");n.classList.add(e),_u()?n.setAttribute("platform","test"):this._platform.isBrowser||n.setAttribute("platform","server"),this._document.body.appendChild(n),this._containerElement=n}_loadStyles(){this._styleLoader.load(p_)}static \u0275fac=function(n){return new(n||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),Tm=class{_renderer;_ngZone;element;_cleanupClick;_cleanupTransitionEnd;_fallbackTimeout;constructor(t,e,n,r){this._renderer=e,this._ngZone=n,this.element=t.createElement("div"),this.element.classList.add("cdk-overlay-backdrop"),this._cleanupClick=e.listen(this.element,"click",r)}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 I;_attachments=new I;_detachments=new I;_positionStrategy;_scrollStrategy;_locationChanges=yn.EMPTY;_backdropRef=null;_detachContentMutationObserver;_detachContentAfterRenderRef;_previousHostParent;_keydownEvents=new I;_outsidePointerEvents=new I;_afterNextRenderRef;constructor(t,e,n,r,o,a,s,d,p,f=!1,v,E){this._portalOutlet=t,this._host=e,this._pane=n,this._config=r,this._ngZone=o,this._keyboardDispatcher=a,this._document=s,this._location=d,this._outsideClickDispatcher=p,this._animationsDisabled=f,this._injector=v,this._renderer=E,r.scrollStrategy&&(this._scrollStrategy=r.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=r.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=Vt(()=>{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=M(M({},this._config),t),this._updateElementSize()}setDirection(t){this._config=be(M({},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=gt(this._config.width),t.height=gt(this._config.height),t.minWidth=gt(this._config.minWidth),t.minHeight=gt(this._config.minHeight),t.maxWidth=gt(this._config.maxWidth),t.maxHeight=gt(this._config.maxHeight)}_togglePointerEvents(t){this._pane.style.pointerEvents=t?"":"none"}_attachBackdrop(){let t="cdk-overlay-backdrop-showing";this._backdropRef?.dispose(),this._backdropRef=new Tm(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,n){let r=gu(e||[]).filter(o=>!!o);r.length&&(n?t.classList.add(...r):t.classList.remove(...r))}_detachContentWhenEmpty(){let t=!1;try{this._detachContentAfterRenderRef=Vt(()=>{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?.()}},o_="cdk-overlay-connected-position-bounding-box",ZC=/([A-Za-z%]+)$/;function Om(i,t){return new bc(t,i.get(Pi),i.get(ct),i.get(pt),i.get(yc))}var bc=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 I;_resizeSubscription=yn.EMPTY;_offsetX=0;_offsetY=0;_transformOriginSelector;_appliedPanelClasses=[];_previousPushAmount;positionChanges=this._positionChanges;get positions(){return this._preferredPositions}constructor(t,e,n,r,o){this._viewportRuler=e,this._document=n,this._platform=r,this._overlayContainer=o,this.setOrigin(t)}attach(t){this._overlayRef&&this._overlayRef,this._validatePositions(),t.hostElement.classList.add(o_),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,n=this._viewportRect,r=this._containerRect,o=[],a;for(let s of this._preferredPositions){let d=this._getOriginPoint(t,r,s),p=this._getOverlayPoint(d,e,s),f=this._getOverlayFit(p,e,n,s);if(f.isCompletelyWithinViewport){this._isPushed=!1,this._applyPosition(s,d);return}if(this._canFitWithFlexibleDimensions(f,p,n)){o.push({position:s,origin:d,overlayRect:e,boundingBoxRect:this._calculateBoundingBoxRect(d,s)});continue}(!a||a.overlayFit.visibleArea<f.visibleArea)&&(a={overlayFit:f,overlayPoint:p,originPoint:d,position:s,overlayRect:e})}if(o.length){let s=null,d=-1;for(let p of o){let f=p.boundingBoxRect.width*p.boundingBoxRect.height*(p.position.weight||1);f>d&&(d=f,s=p)}this._isPushed=!1,this._applyPosition(s.position,s.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&&Lr(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(o_),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,n){let r;if(n.originX=="center")r=t.left+t.width/2;else{let a=this._isRtl()?t.right:t.left,s=this._isRtl()?t.left:t.right;r=n.originX=="start"?a:s}e.left<0&&(r-=e.left);let o;return n.originY=="center"?o=t.top+t.height/2:o=n.originY=="top"?t.top:t.bottom,e.top<0&&(o-=e.top),{x:r,y:o}}_getOverlayPoint(t,e,n){let r;n.overlayX=="center"?r=-e.width/2:n.overlayX==="start"?r=this._isRtl()?-e.width:0:r=this._isRtl()?0:-e.width;let o;return n.overlayY=="center"?o=-e.height/2:o=n.overlayY=="top"?0:-e.height,{x:t.x+r,y:t.y+o}}_getOverlayFit(t,e,n,r){let o=s_(e),{x:a,y:s}=t,d=this._getOffset(r,"x"),p=this._getOffset(r,"y");d&&(a+=d),p&&(s+=p);let f=0-a,v=a+o.width-n.width,E=0-s,T=s+o.height-n.height,k=this._subtractOverflows(o.width,f,v),V=this._subtractOverflows(o.height,E,T),ge=k*V;return{visibleArea:ge,isCompletelyWithinViewport:o.width*o.height===ge,fitsInViewportVertically:V===o.height,fitsInViewportHorizontally:k==o.width}}_canFitWithFlexibleDimensions(t,e,n){if(this._hasFlexibleDimensions){let r=n.bottom-e.y,o=n.right-e.x,a=a_(this._overlayRef.getConfig().minHeight),s=a_(this._overlayRef.getConfig().minWidth),d=t.fitsInViewportVertically||a!=null&&a<=r,p=t.fitsInViewportHorizontally||s!=null&&s<=o;return d&&p}return!1}_pushOverlayOnScreen(t,e,n){if(this._previousPushAmount&&this._positionLocked)return{x:t.x+this._previousPushAmount.x,y:t.y+this._previousPushAmount.y};let r=s_(e),o=this._viewportRect,a=Math.max(t.x+r.width-o.width,0),s=Math.max(t.y+r.height-o.height,0),d=Math.max(o.top-n.top-t.y,0),p=Math.max(o.left-n.left-t.x,0),f=0,v=0;return r.width<=o.width?f=p||-a:f=t.x<this._viewportMargin?o.left-n.left-t.x:0,r.height<=o.height?v=d||-s:v=t.y<this._viewportMargin?o.top-n.top-t.y:0,this._previousPushAmount={x:f,y:v},{x:t.x+f,y:t.y+v}}_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 n=this._getScrollVisibility();if(t!==this._lastPosition||!this._lastScrollVisibility||!JC(this._lastScrollVisibility,n)){let r=new _c(t,n);this._positionChanges.next(r)}this._lastScrollVisibility=n}this._lastPosition=t,this._isInitialRender=!1}_setTransformOrigin(t){if(!this._transformOriginSelector)return;let e=this._boundingBox.querySelectorAll(this._transformOriginSelector),n,r=t.overlayY;t.overlayX==="center"?n="center":this._isRtl()?n=t.overlayX==="start"?"right":"left":n=t.overlayX==="start"?"left":"right";for(let o=0;o<e.length;o++)e[o].style.transformOrigin=`${n} ${r}`}_calculateBoundingBoxRect(t,e){let n=this._viewportRect,r=this._isRtl(),o,a,s;if(e.overlayY==="top")a=t.y,o=n.height-a+this._viewportMargin;else if(e.overlayY==="bottom")s=n.height-t.y+this._viewportMargin*2,o=n.height-s+this._viewportMargin;else{let T=Math.min(n.bottom-t.y+n.top,t.y),k=this._lastBoundingBoxSize.height;o=T*2,a=t.y-T,o>k&&!this._isInitialRender&&!this._growAfterOpen&&(a=t.y-k/2)}let d=e.overlayX==="start"&&!r||e.overlayX==="end"&&r,p=e.overlayX==="end"&&!r||e.overlayX==="start"&&r,f,v,E;if(p)E=n.width-t.x+this._viewportMargin*2,f=t.x-this._viewportMargin;else if(d)v=t.x,f=n.right-t.x;else{let T=Math.min(n.right-t.x+n.left,t.x),k=this._lastBoundingBoxSize.width;f=T*2,v=t.x-T,f>k&&!this._isInitialRender&&!this._growAfterOpen&&(v=t.x-k/2)}return{top:a,left:v,bottom:s,right:E,width:f,height:o}}_setBoundingBoxStyles(t,e){let n=this._calculateBoundingBoxRect(t,e);!this._isInitialRender&&!this._growAfterOpen&&(n.height=Math.min(n.height,this._lastBoundingBoxSize.height),n.width=Math.min(n.width,this._lastBoundingBoxSize.width));let r={};if(this._hasExactPosition())r.top=r.left="0",r.bottom=r.right=r.maxHeight=r.maxWidth="",r.width=r.height="100%";else{let o=this._overlayRef.getConfig().maxHeight,a=this._overlayRef.getConfig().maxWidth;r.height=gt(n.height),r.top=gt(n.top),r.bottom=gt(n.bottom),r.width=gt(n.width),r.left=gt(n.left),r.right=gt(n.right),e.overlayX==="center"?r.alignItems="center":r.alignItems=e.overlayX==="end"?"flex-end":"flex-start",e.overlayY==="center"?r.justifyContent="center":r.justifyContent=e.overlayY==="bottom"?"flex-end":"flex-start",o&&(r.maxHeight=gt(o)),a&&(r.maxWidth=gt(a))}this._lastBoundingBoxSize=n,Lr(this._boundingBox.style,r)}_resetBoundingBoxStyles(){Lr(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){Lr(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(t,e){let n={},r=this._hasExactPosition(),o=this._hasFlexibleDimensions,a=this._overlayRef.getConfig();if(r){let f=this._viewportRuler.getViewportScrollPosition();Lr(n,this._getExactOverlayY(e,t,f)),Lr(n,this._getExactOverlayX(e,t,f))}else n.position="static";let s="",d=this._getOffset(e,"x"),p=this._getOffset(e,"y");d&&(s+=`translateX(${d}px) `),p&&(s+=`translateY(${p}px)`),n.transform=s.trim(),a.maxHeight&&(r?n.maxHeight=gt(a.maxHeight):o&&(n.maxHeight="")),a.maxWidth&&(r?n.maxWidth=gt(a.maxWidth):o&&(n.maxWidth="")),Lr(this._pane.style,n)}_getExactOverlayY(t,e,n){let r={top:"",bottom:""},o=this._getOverlayPoint(e,this._overlayRect,t);if(this._isPushed&&(o=this._pushOverlayOnScreen(o,this._overlayRect,n)),t.overlayY==="bottom"){let a=this._document.documentElement.clientHeight;r.bottom=`${a-(o.y+this._overlayRect.height)}px`}else r.top=gt(o.y);return r}_getExactOverlayX(t,e,n){let r={left:"",right:""},o=this._getOverlayPoint(e,this._overlayRect,t);this._isPushed&&(o=this._pushOverlayOnScreen(o,this._overlayRect,n));let a;if(this._isRtl()?a=t.overlayX==="end"?"left":"right":a=t.overlayX==="end"?"right":"left",a==="right"){let s=this._document.documentElement.clientWidth;r.right=`${s-(o.x+this._overlayRect.width)}px`}else r.left=gt(o.x);return r}_getScrollVisibility(){let t=this._getOriginRect(),e=this._pane.getBoundingClientRect(),n=this._scrollables.map(r=>r.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:i_(t,n),isOriginOutsideView:Em(t,n),isOverlayClipped:i_(e,n),isOverlayOutsideView:Em(e,n)}}_subtractOverflows(t,...e){return e.reduce((n,r)=>n-Math.max(r,0),t)}_getNarrowedViewportRect(){let t=this._document.documentElement.clientWidth,e=this._document.documentElement.clientHeight,n=this._viewportRuler.getViewportScrollPosition();return{top:n.top+this._viewportMargin,left:n.left+this._viewportMargin,right:n.left+t-this._viewportMargin,bottom:n.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&&gu(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 ae)return t.nativeElement.getBoundingClientRect();if(t instanceof Element)return t.getBoundingClientRect();let e=t.width||0,n=t.height||0;return{top:t.y,bottom:t.y+n,left:t.x,right:t.x+e,height:n,width:e}}};function Lr(i,t){for(let e in t)t.hasOwnProperty(e)&&(i[e]=t[e]);return i}function a_(i){if(typeof i!="number"&&i!=null){let[t,e]=i.split(ZC);return!e||e==="px"?parseFloat(t):null}return i||null}function s_(i){return{top:Math.floor(i.top),right:Math.floor(i.right),bottom:Math.floor(i.bottom),left:Math.floor(i.left),width:Math.floor(i.width),height:Math.floor(i.height)}}function JC(i,t){return i===t?!0:i.isOriginClipped===t.isOriginClipped&&i.isOriginOutsideView===t.isOriginOutsideView&&i.isOverlayClipped===t.isOverlayClipped&&i.isOverlayOutsideView===t.isOverlayOutsideView}var l_="cdk-global-overlay-wrapper";function lr(i){return new vc}var vc=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(l_),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,n=this._overlayRef.getConfig(),{width:r,height:o,maxWidth:a,maxHeight:s}=n,d=(r==="100%"||r==="100vw")&&(!a||a==="100%"||a==="100vw"),p=(o==="100%"||o==="100vh")&&(!s||s==="100%"||s==="100vh"),f=this._xPosition,v=this._xOffset,E=this._overlayRef.getConfig().direction==="rtl",T="",k="",V="";d?V="flex-start":f==="center"?(V="center",E?k=v:T=v):E?f==="left"||f==="end"?(V="flex-end",T=v):(f==="right"||f==="start")&&(V="flex-start",k=v):f==="left"||f==="start"?(V="flex-start",T=v):(f==="right"||f==="end")&&(V="flex-end",k=v),t.position=this._cssPosition,t.marginLeft=d?"0":T,t.marginTop=p?"0":this._topOffset,t.marginBottom=this._bottomOffset,t.marginRight=d?"0":k,e.justifyContent=V,e.alignItems=p?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;let t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement,n=e.style;e.classList.remove(l_),n.justifyContent=n.alignItems=t.marginTop=t.marginBottom=t.marginLeft=t.marginRight=t.position="",this._overlayRef=null,this._isDisposed=!0}},g_=(()=>{class i{_injector=u(we);constructor(){}global(){return lr()}flexibleConnectedTo(e){return Om(this._injector,e)}static \u0275fac=function(n){return new(n||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function Br(i,t){i.get($t).load(p_);let e=i.get(yc),n=i.get(ct),r=i.get(He),o=i.get(Cr),a=i.get(jt),s=n.createElement("div"),d=n.createElement("div");d.id=r.getId("cdk-overlay-"),d.classList.add("cdk-overlay-pane"),s.appendChild(d),e.getContainerElement().appendChild(s);let p=new hc(d,o,i),f=new Ai(t),v=i.get(et,null,{optional:!0})||i.get(Fn).createRenderer(null,null);return f.direction=f.direction||a.value,new Bo(p,s,d,f,i.get(fe),i.get(m_),n,i.get(Qi),i.get(h_),t?.disableAnimations??i.get(Ea,null,{optional:!0})==="NoopAnimations",i.get(Rn),v)}var f_=(()=>{class i{scrollStrategies=u(d_);_positionBuilder=u(g_);_injector=u(we);constructor(){}create(e){return Br(this._injector,e)}position(){return this._positionBuilder}static \u0275fac=function(n){return new(n||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),ex=[{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"}],__=new q("cdk-connected-overlay-scroll-strategy",{providedIn:"root",factory:()=>{let i=u(we);return()=>zr(i)}}),Ho=(()=>{class i{elementRef=u(ae);constructor(){}static \u0275fac=function(n){return new(n||i)};static \u0275dir=ne({type:i,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]})}return i})(),Cc=(()=>{class i{_dir=u(jt,{optional:!0});_injector=u(we);_overlayRef;_templatePortal;_backdropSubscription=yn.EMPTY;_attachSubscription=yn.EMPTY;_detachSubscription=yn.EMPTY;_positionSubscription=yn.EMPTY;_offsetX;_offsetY;_position;_scrollStrategyFactory=u(__);_disposeOnNavigation=!1;_ngZone=u(fe);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 H;positionChange=new H;attach=new H;detach=new H;overlayKeydown=new H;overlayOutsideClick=new H;constructor(){let e=u(qi),n=u(yr);this._templatePortal=new Ti(e,n),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=ex);let e=this._overlayRef=Br(this._injector,this._buildConfig());this._attachSubscription=e.attachments().subscribe(()=>this.attach.emit()),this._detachSubscription=e.detachments().subscribe(()=>this.detach.emit()),e.keydownEvents().subscribe(n=>{this.overlayKeydown.next(n),n.keyCode===27&&!this.disableClose&&!Lt(n)&&(n.preventDefault(),this.detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(n=>{let r=this._getOriginElement(),o=cl(n);(!r||r!==o&&!r.contains(o))&&this.overlayOutsideClick.next(n)})}_buildConfig(){let e=this._position=this.positionStrategy||this._createPositionStrategy(),n=new Ai({direction:this._dir||"ltr",positionStrategy:e,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop,disposeOnNavigation:this.disposeOnNavigation});return(this.width||this.width===0)&&(n.width=this.width),(this.height||this.height===0)&&(n.height=this.height),(this.minWidth||this.minWidth===0)&&(n.minWidth=this.minWidth),(this.minHeight||this.minHeight===0)&&(n.minHeight=this.minHeight),this.backdropClass&&(n.backdropClass=this.backdropClass),this.panelClass&&(n.panelClass=this.panelClass),n}_updatePositionStrategy(e){let n=this.positions.map(r=>({originX:r.originX,originY:r.originY,overlayX:r.overlayX,overlayY:r.overlayY,offsetX:r.offsetX||this.offsetX,offsetY:r.offsetY||this.offsetY,panelClass:r.panelClass||void 0}));return e.setOrigin(this._getOrigin()).withPositions(n).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector)}_createPositionStrategy(){let e=Om(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 ae?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(pp(()=>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(n){return new(n||i)};static \u0275dir=ne({type:i,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",ie],lockPosition:[2,"cdkConnectedOverlayLockPosition","lockPosition",ie],flexibleDimensions:[2,"cdkConnectedOverlayFlexibleDimensions","flexibleDimensions",ie],growAfterOpen:[2,"cdkConnectedOverlayGrowAfterOpen","growAfterOpen",ie],push:[2,"cdkConnectedOverlayPush","push",ie],disposeOnNavigation:[2,"cdkConnectedOverlayDisposeOnNavigation","disposeOnNavigation",ie]},outputs:{backdropClick:"backdropClick",positionChange:"positionChange",attach:"attach",detach:"detach",overlayKeydown:"overlayKeydown",overlayOutsideClick:"overlayOutsideClick"},exportAs:["cdkConnectedOverlay"],features:[Ne]})}return i})();function tx(i){let t=u(we);return()=>zr(t)}var nx={provide:__,useFactory:tx},Di=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=de({type:i});static \u0275inj=ce({providers:[f_,nx],imports:[Da,Oi,Mm,Mm]})}return i})();function ix(i,t){if(i&1){let e=A();l(0,"div",1)(1,"button",2),b("click",function(){y(e);let r=g();return C(r.action())}),h(2),c()()}if(i&2){let e=g();m(2),ue(" ",e.data.action," ")}}var rx=["label"];function ox(i,t){}var ax=Math.pow(2,31)-1,as=class{_overlayRef;instance;containerInstance;_afterDismissed=new I;_afterOpened=new I;_onAction=new I;_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,ax))}_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}},b_=new q("MatSnackBarData"),$o=class{politeness="polite";announcementMessage="";viewContainerRef;duration=0;panelClass;direction;data=null;horizontalPosition="center";verticalPosition="bottom"},sx=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275dir=ne({type:i,selectors:[["","matSnackBarLabel",""]],hostAttrs:[1,"mat-mdc-snack-bar-label","mdc-snackbar__label"]})}return i})(),lx=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275dir=ne({type:i,selectors:[["","matSnackBarActions",""]],hostAttrs:[1,"mat-mdc-snack-bar-actions","mdc-snackbar__actions"]})}return i})(),cx=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275dir=ne({type:i,selectors:[["","matSnackBarAction",""]],hostAttrs:[1,"mat-mdc-snack-bar-action","mdc-snackbar__action"]})}return i})(),v_=(()=>{class i{snackBarRef=u(as);data=u(b_);constructor(){}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,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(n,r){n&1&&(l(0,"div",0),h(1),c(),w(2,ix,3,1,"div",1)),n&2&&(m(),ue(" ",r.data.message,`
|
|
3
|
-
`),m(),S(r.hasAction?2:-1))},dependencies:[zt,sx,lx,cx],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 i})(),Pm="_mat-snack-bar-enter",Am="_mat-snack-bar-exit",dx=(()=>{class i extends or{_ngZone=u(fe);_elementRef=u(ae);_changeDetectorRef=u(ze);_platform=u(pt);_animationsDisabled=ut();snackBarConfig=u($o);_document=u(ct);_trackedModals=new Set;_enterFallback;_exitFallback;_injector=u(we);_announceDelay=150;_announceTimeoutId;_destroyed=!1;_portalOutlet;_onAnnounce=new I;_onExit=new I;_onEnter=new I;_animationState="void";_live;_label;_role;_liveElementId=u(He).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 n=this._portalOutlet.attachComponentPortal(e);return this._afterPortalAttached(),n}attachTemplatePortal(e){this._assertNotAttached();let n=this._portalOutlet.attachTemplatePortal(e);return this._afterPortalAttached(),n}attachDomPortal=e=>{this._assertNotAttached();let n=this._portalOutlet.attachDomPortal(e);return this._afterPortalAttached(),n};onAnimationEnd(e){e===Am?this._completeExit():e===Pm&&(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?Vt(()=>{this._ngZone.run(()=>queueMicrotask(()=>this.onAnimationEnd(Pm)))},{injector:this._injector}):(clearTimeout(this._enterFallback),this._enterFallback=setTimeout(()=>{this._elementRef.nativeElement.classList.add("mat-snack-bar-fallback-visible"),this.onAnimationEnd(Pm)},200)))}exit(){return this._destroyed?$(void 0):(this._ngZone.run(()=>{this._animationState="hidden",this._changeDetectorRef.markForCheck(),this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId),this._animationsDisabled?Vt(()=>{this._ngZone.run(()=>queueMicrotask(()=>this.onAnimationEnd(Am)))},{injector:this._injector}):(clearTimeout(this._exitFallback),this._exitFallback=setTimeout(()=>this.onAnimationEnd(Am),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,n=this.snackBarConfig.panelClass;n&&(Array.isArray(n)?n.forEach(a=>e.classList.add(a)):e.classList.add(n)),this._exposeToModals();let r=this._label.nativeElement,o="mdc-snackbar__label";r.classList.toggle(o,!r.querySelector(`.${o}`))}_exposeToModals(){let e=this._liveElementId,n=this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]');for(let r=0;r<n.length;r++){let o=n[r],a=o.getAttribute("aria-owns");this._trackedModals.add(o),a?a.indexOf(e)===-1&&o.setAttribute("aria-owns",a+" "+e):o.setAttribute("aria-owns",e)}}_clearFromModals(){this._trackedModals.forEach(e=>{let n=e.getAttribute("aria-owns");if(n){let r=n.replace(this._liveElementId,"").trim();r.length>0?e.setAttribute("aria-owns",r):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,n=e.querySelector("[aria-hidden]"),r=e.querySelector("[aria-live]");if(n&&r){let o=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&n.contains(document.activeElement)&&(o=document.activeElement),n.removeAttribute("aria-hidden"),r.appendChild(n),o?.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["mat-snack-bar-container"]],viewQuery:function(n,r){if(n&1&&(se(ar,7),se(rx,7)),n&2){let o;G(o=Y())&&(r._portalOutlet=o.first),G(o=Y())&&(r._label=o.first)}},hostAttrs:[1,"mdc-snackbar","mat-mdc-snack-bar-container"],hostVars:6,hostBindings:function(n,r){n&1&&b("animationend",function(a){return r.onAnimationEnd(a.animationName)})("animationcancel",function(a){return r.onAnimationEnd(a.animationName)}),n&2&&R("mat-snack-bar-container-enter",r._animationState==="visible")("mat-snack-bar-container-exit",r._animationState==="hidden")("mat-snack-bar-container-animations-enabled",!r._animationsDisabled)},features:[ke],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(n,r){n&1&&(l(0,"div",1)(1,"div",2,0)(3,"div",3),tt(4,ox,0,0,"ng-template",4),c(),F(5,"div"),c()()),n&2&&(m(5),K("aria-live",r._live)("role",r._role)("id",r._liveElementId))},dependencies:[ar],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 i})();function ux(){return new $o}var mx=new q("mat-snack-bar-default-options",{providedIn:"root",factory:ux}),ss=(()=>{class i{_live=u(ml);_injector=u(we);_breakpointObserver=u(Qp);_parentSnackBar=u(i,{optional:!0,skipSelf:!0});_defaultConfig=u(mx);_animationsDisabled=ut();_snackBarRefAtThisLevel=null;simpleSnackBarComponent=v_;snackBarContainerComponent=dx;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,n){return this._attach(e,n)}openFromTemplate(e,n){return this._attach(e,n)}open(e,n="",r){let o=M(M({},this._defaultConfig),r);return o.data={message:e,action:n},o.announcementMessage===e&&(o.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,o)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(e,n){let r=n&&n.viewContainerRef&&n.viewContainerRef.injector,o=we.create({parent:r||this._injector,providers:[{provide:$o,useValue:n}]}),a=new Ei(this.snackBarContainerComponent,n.viewContainerRef,o),s=e.attach(a);return s.instance.snackBarConfig=n,s.instance}_attach(e,n){let r=M(M(M({},new $o),this._defaultConfig),n),o=this._createOverlay(r),a=this._attachSnackBarContainer(o,r),s=new as(a,o);if(e instanceof qi){let d=new Ti(e,null,{$implicit:r.data,snackBarRef:s});s.instance=a.attachTemplatePortal(d)}else{let d=this._createInjector(r,s),p=new Ei(e,void 0,d),f=a.attachComponentPortal(p);s.instance=f.instance}return this._breakpointObserver.observe(eg.HandsetPortrait).pipe(L(o.detachments())).subscribe(d=>{o.overlayElement.classList.toggle(this.handsetCssClass,d.matches)}),r.announcementMessage&&a._onAnnounce.subscribe(()=>{this._live.announce(r.announcementMessage,r.politeness)}),this._animateSnackBar(s,r),this._openedSnackBarRef=s,this._openedSnackBarRef}_animateSnackBar(e,n){e.afterDismissed().subscribe(()=>{this._openedSnackBarRef==e&&(this._openedSnackBarRef=null),n.announcementMessage&&this._live.clear()}),n.duration&&n.duration>0&&e.afterOpened().subscribe(()=>e._dismissAfter(n.duration)),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{e.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):e.containerInstance.enter()}_createOverlay(e){let n=new Ai;n.direction=e.direction;let r=lr(this._injector),o=e.direction==="rtl",a=e.horizontalPosition==="left"||e.horizontalPosition==="start"&&!o||e.horizontalPosition==="end"&&o,s=!a&&e.horizontalPosition!=="center";return a?r.left("0"):s?r.right("0"):r.centerHorizontally(),e.verticalPosition==="top"?r.top("0"):r.bottom("0"),n.positionStrategy=r,n.disableAnimations=this._animationsDisabled,Br(this._injector,n)}_createInjector(e,n){let r=e&&e.viewContainerRef&&e.viewContainerRef.injector;return we.create({parent:r||this._injector,providers:[{provide:as,useValue:n},{provide:b_,useValue:e.data}]})}static \u0275fac=function(n){return new(n||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var Wo=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=de({type:i});static \u0275inj=ce({providers:[ss],imports:[Di,Oi,Tt,pe,v_,pe]})}return i})();function hx(i,t){}var cr=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 Im=(()=>{class i extends or{_elementRef=u(ae);_focusTrapFactory=u(ul);_config;_interactivityChecker=u(bo);_ngZone=u(fe);_focusMonitor=u(Ki);_renderer=u(et);_changeDetectorRef=u(ze);_injector=u(we);_platform=u(pt);_document=u(ct);_portalOutlet;_focusTrapped=new I;_focusTrap=null;_elementFocusedBeforeDialogWasOpened=null;_closeInteractionType=null;_ariaLabelledByQueue=[];_isDestroyed=!1;constructor(){super(),this._config=u(cr,{optional:!0})||new cr,this._config.ariaLabelledBy&&this._ariaLabelledByQueue.push(this._config.ariaLabelledBy)}_addAriaLabelledBy(e){this._ariaLabelledByQueue.push(e),this._changeDetectorRef.markForCheck()}_removeAriaLabelledBy(e){let n=this._ariaLabelledByQueue.indexOf(e);n>-1&&(this._ariaLabelledByQueue.splice(n,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 n=this._portalOutlet.attachComponentPortal(e);return this._contentAttached(),n}attachTemplatePortal(e){this._portalOutlet.hasAttached();let n=this._portalOutlet.attachTemplatePortal(e);return this._contentAttached(),n}attachDomPortal=e=>{this._portalOutlet.hasAttached();let n=this._portalOutlet.attachDomPortal(e);return this._contentAttached(),n};_recaptureFocus(){this._containsFocus()||this._trapFocus()}_forceFocus(e,n){this._interactivityChecker.isFocusable(e)||(e.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{let r=()=>{o(),a(),e.removeAttribute("tabindex")},o=this._renderer.listen(e,"blur",r),a=this._renderer.listen(e,"mousedown",r)})),e.focus(n)}_focusByCssSelector(e,n){let r=this._elementRef.nativeElement.querySelector(e);r&&this._forceFocus(r,n)}_trapFocus(e){this._isDestroyed||Vt(()=>{let n=this._elementRef.nativeElement;switch(this._config.autoFocus){case!1:case"dialog":this._containsFocus()||n.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,n=null;if(typeof e=="string"?n=this._document.querySelector(e):typeof e=="boolean"?n=e?this._elementFocusedBeforeDialogWasOpened:null:e&&(n=e),this._config.restoreFocus&&n&&typeof n.focus=="function"){let r=ll(),o=this._elementRef.nativeElement;(!r||r===this._document.body||r===o||o.contains(r))&&(this._focusMonitor?(this._focusMonitor.focusVia(n,this._closeInteractionType),this._closeInteractionType=null):n.focus())}this._focusTrap&&this._focusTrap.destroy()}_focusDialogContainer(e){this._elementRef.nativeElement.focus?.(e)}_containsFocus(){let e=this._elementRef.nativeElement,n=ll();return e===n||e.contains(n)}_initializeFocusTrap(){this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._document&&(this._elementFocusedBeforeDialogWasOpened=ll()))}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["cdk-dialog-container"]],viewQuery:function(n,r){if(n&1&&se(ar,7),n&2){let o;G(o=Y())&&(r._portalOutlet=o.first)}},hostAttrs:["tabindex","-1",1,"cdk-dialog-container"],hostVars:6,hostBindings:function(n,r){n&2&&K("id",r._config.id||null)("role",r._config.role)("aria-modal",r._config.ariaModal)("aria-labelledby",r._config.ariaLabel?null:r._ariaLabelledByQueue[0])("aria-label",r._config.ariaLabel)("aria-describedby",r._config.ariaDescribedBy||null)},features:[ke],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(n,r){n&1&&tt(0,hx,0,0,"ng-template",0)},dependencies:[ar],styles:[`.cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit}
|
|
6
|
-
`],encapsulation:2})}return i})(),ls=class{overlayRef;config;componentInstance;componentRef;containerInstance;disableClose;closed=new I;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(n=>{n.keyCode===27&&!this.disableClose&&!Lt(n)&&(n.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 n=this.closed;this.containerInstance._closeInteractionType=e?.focusOrigin||"program",this._detachSubscription.unsubscribe(),this.overlayRef.dispose(),n.next(t),n.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))}},px=new q("DialogScrollStrategy",{providedIn:"root",factory:()=>{let i=u(we);return()=>Uo(i)}}),gx=new q("DialogData"),fx=new q("DefaultDialogConfig");function _x(i){let t=Me(i),e=new H;return{valueSignal:t,get value(){return t()},change:e,ngOnDestroy(){e.complete()}}}var Rm=(()=>{class i{_injector=u(we);_defaultOptions=u(fx,{optional:!0});_parentDialog=u(i,{optional:!0,skipSelf:!0});_overlayContainer=u(yc);_idGenerator=u(He);_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new I;_afterOpenedAtThisLevel=new I;_ariaHiddenElements=new Map;_scrollStrategy=u(px);get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}afterAllClosed=Kn(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(At(void 0)));constructor(){}open(e,n){let r=this._defaultOptions||new cr;n=M(M({},r),n),n.id=n.id||this._idGenerator.getId("cdk-dialog-"),n.id&&this.getDialogById(n.id);let o=this._getOverlayConfig(n),a=Br(this._injector,o),s=new ls(a,n),d=this._attachContainer(a,s,n);if(s.containerInstance=d,!this.openDialogs.length){let p=this._overlayContainer.getContainerElement();d._focusTrapped?d._focusTrapped.pipe(lt(1)).subscribe(()=>{this._hideNonDialogContentFromAssistiveTechnology(p)}):this._hideNonDialogContentFromAssistiveTechnology(p)}return this._attachDialogContent(e,s,d,n),this.openDialogs.push(s),s.closed.subscribe(()=>this._removeOpenDialog(s,!0)),this.afterOpened.next(s),s}closeAll(){Dm(this.openDialogs,e=>e.close())}getDialogById(e){return this.openDialogs.find(n=>n.id===e)}ngOnDestroy(){Dm(this._openDialogsAtThisLevel,e=>{e.config.closeOnDestroy===!1&&this._removeOpenDialog(e,!1)}),Dm(this._openDialogsAtThisLevel,e=>e.close()),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete(),this._openDialogsAtThisLevel=[]}_getOverlayConfig(e){let n=new Ai({positionStrategy:e.positionStrategy||lr().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&&(n.backdropClass=e.backdropClass),n}_attachContainer(e,n,r){let o=r.injector||r.viewContainerRef?.injector,a=[{provide:cr,useValue:r},{provide:ls,useValue:n},{provide:Bo,useValue:e}],s;r.container?typeof r.container=="function"?s=r.container:(s=r.container.type,a.push(...r.container.providers(r))):s=Im;let d=new Ei(s,r.viewContainerRef,we.create({parent:o||this._injector,providers:a}));return e.attach(d).instance}_attachDialogContent(e,n,r,o){if(e instanceof qi){let a=this._createInjector(o,n,r,void 0),s={$implicit:o.data,dialogRef:n};o.templateContext&&(s=M(M({},s),typeof o.templateContext=="function"?o.templateContext():o.templateContext)),r.attachTemplatePortal(new Ti(e,null,s,a))}else{let a=this._createInjector(o,n,r,this._injector),s=r.attachComponentPortal(new Ei(e,o.viewContainerRef,a));n.componentRef=s,n.componentInstance=s.instance}}_createInjector(e,n,r,o){let a=e.injector||e.viewContainerRef?.injector,s=[{provide:gx,useValue:e.data},{provide:ls,useValue:n}];return e.providers&&(typeof e.providers=="function"?s.push(...e.providers(n,e,r)):s.push(...e.providers)),e.direction&&(!a||!a.get(jt,null,{optional:!0}))&&s.push({provide:jt,useValue:_x(e.direction)}),we.create({parent:a||o,providers:s})}_removeOpenDialog(e,n){let r=this.openDialogs.indexOf(e);r>-1&&(this.openDialogs.splice(r,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((o,a)=>{o?a.setAttribute("aria-hidden",o):a.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),n&&this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(e){if(e.parentElement){let n=e.parentElement.children;for(let r=n.length-1;r>-1;r--){let o=n[r];o!==e&&o.nodeName!=="SCRIPT"&&o.nodeName!=="STYLE"&&!o.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(o,o.getAttribute("aria-hidden")),o.setAttribute("aria-hidden","true"))}}}_getAfterAllClosed(){let e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}static \u0275fac=function(n){return new(n||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function Dm(i,t){let e=i.length;for(;e--;)t(i[e])}var y_=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=de({type:i});static \u0275inj=ce({providers:[Rm],imports:[Di,Oi,hl,Oi]})}return i})();function bx(i,t){}var ds=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},Fm="mdc-dialog--open",C_="mdc-dialog--opening",x_="mdc-dialog--closing",vx=150,yx=75,k_=(()=>{class i extends Im{_animationStateChanged=new H;_animationsEnabled=!ut();_actionSectionCount=0;_hostElement=this._elementRef.nativeElement;_enterAnimationDuration=this._animationsEnabled?S_(this._config.enterAnimationDuration)??vx:0;_exitAnimationDuration=this._animationsEnabled?S_(this._config.exitAnimationDuration)??yx:0;_animationTimer=null;_contentAttached(){super._contentAttached(),this._startOpenAnimation()}_startOpenAnimation(){this._animationStateChanged.emit({state:"opening",totalTime:this._enterAnimationDuration}),this._animationsEnabled?(this._hostElement.style.setProperty(w_,`${this._enterAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(C_,Fm)),this._waitForAnimationToComplete(this._enterAnimationDuration,this._finishDialogOpen)):(this._hostElement.classList.add(Fm),Promise.resolve().then(()=>this._finishDialogOpen()))}_startExitAnimation(){this._animationStateChanged.emit({state:"closing",totalTime:this._exitAnimationDuration}),this._hostElement.classList.remove(Fm),this._animationsEnabled?(this._hostElement.style.setProperty(w_,`${this._exitAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(x_)),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(C_,x_)}_waitForAnimationToComplete(e,n){this._animationTimer!==null&&clearTimeout(this._animationTimer),this._animationTimer=setTimeout(n,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 n=super.attachComponentPortal(e);return n.location.nativeElement.classList.add("mat-mdc-dialog-component-host"),n}static \u0275fac=(()=>{let e;return function(r){return(e||(e=We(i)))(r||i)}})();static \u0275cmp=P({type:i,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1",1,"mat-mdc-dialog-container","mdc-dialog"],hostVars:10,hostBindings:function(n,r){n&2&&(mn("id",r._config.id),K("aria-modal",r._config.ariaModal)("role",r._config.role)("aria-labelledby",r._config.ariaLabel?null:r._ariaLabelledByQueue[0])("aria-label",r._config.ariaLabel)("aria-describedby",r._config.ariaDescribedBy||null),R("_mat-animation-noopable",!r._animationsEnabled)("mat-mdc-dialog-container-with-actions",r._actionSectionCount>0))},features:[ke],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(n,r){n&1&&(l(0,"div",0)(1,"div",1),tt(2,bx,0,0,"ng-template",2),c()())},dependencies:[ar],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 i})(),w_="--mat-dialog-transition-duration";function S_(i){return i==null?null:typeof i=="number"?i:i.endsWith("ms")?Xi(i.substring(0,i.length-2)):i.endsWith("s")?Xi(i.substring(0,i.length-1))*1e3:i==="0"?0:null}var cs=(function(i){return i[i.OPEN=0]="OPEN",i[i.CLOSING=1]="CLOSING",i[i.CLOSED=2]="CLOSED",i})(cs||{}),bn=class{_ref;_config;_containerInstance;componentInstance;componentRef;disableClose;id;_afterOpened=new I;_beforeClosed=new I;_result;_closeFallbackTimeout;_state=cs.OPEN;_closeInteractionType;constructor(t,e,n){this._ref=t,this._config=e,this._containerInstance=n,this.disableClose=e.disableClose,this.id=t.id,t.addPanelClass("mat-mdc-dialog-panel"),n._animationStateChanged.pipe(le(r=>r.state==="opened"),lt(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),n._animationStateChanged.pipe(le(r=>r.state==="closed"),lt(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),t.overlayRef.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._finishDialogClose()}),Zn(this.backdropClick(),this.keydownEvents().pipe(le(r=>r.keyCode===27&&!this.disableClose&&!Lt(r)))).subscribe(r=>{this.disableClose||(r.preventDefault(),M_(this,r.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(le(n=>n.state==="closing"),lt(1)).subscribe(n=>{this._beforeClosed.next(t),this._beforeClosed.complete(),this._ref.overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),n.totalTime+100)}),this._state=cs.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=cs.CLOSED,this._ref.close(this._result,{focusOrigin:this._closeInteractionType}),this.componentInstance=null}};function M_(i,t,e){return i._closeInteractionType=t,i.close(e)}var li=new q("MatMdcDialogData"),xc=new q("mat-mdc-dialog-default-options"),E_=new q("mat-mdc-dialog-scroll-strategy",{providedIn:"root",factory:()=>{let i=u(we);return()=>Uo(i)}}),Bn=(()=>{class i{_defaultOptions=u(xc,{optional:!0});_scrollStrategy=u(E_);_parentDialog=u(i,{optional:!0,skipSelf:!0});_idGenerator=u(He);_injector=u(we);_dialog=u(Rm);_animationsDisabled=ut();_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new I;_afterOpenedAtThisLevel=new I;dialogConfigClass=ds;_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=Kn(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(At(void 0)));constructor(){this._dialogRefConstructor=bn,this._dialogContainerType=k_,this._dialogDataToken=li}open(e,n){let r;n=M(M({},this._defaultOptions||new ds),n),n.id=n.id||this._idGenerator.getId("mat-mdc-dialog-"),n.scrollStrategy=n.scrollStrategy||this._scrollStrategy();let o=this._dialog.open(e,be(M({},n),{positionStrategy:lr(this._injector).centerHorizontally().centerVertically(),disableClose:!0,closePredicate:void 0,closeOnDestroy:!1,closeOnOverlayDetachments:!1,disableAnimations:this._animationsDisabled||n.enterAnimationDuration?.toLocaleString()==="0"||n.exitAnimationDuration?.toString()==="0",container:{type:this._dialogContainerType,providers:()=>[{provide:this.dialogConfigClass,useValue:n},{provide:cr,useValue:n}]},templateContext:()=>({dialogRef:r}),providers:(a,s,d)=>(r=new this._dialogRefConstructor(a,n,d),r.updatePosition(n?.position),[{provide:this._dialogContainerType,useValue:d},{provide:this._dialogDataToken,useValue:s.data},{provide:this._dialogRefConstructor,useValue:r}])}));return r.componentRef=o.componentRef,r.componentInstance=o.componentInstance,this.openDialogs.push(r),this.afterOpened.next(r),r.afterClosed().subscribe(()=>{let a=this.openDialogs.indexOf(r);a>-1&&(this.openDialogs.splice(a,1),this.openDialogs.length||this._getAfterAllClosed().next())}),r}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(e){return this.openDialogs.find(n=>n.id===e)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_closeDialogs(e){let n=e.length;for(;n--;)e[n].close()}static \u0275fac=function(n){return new(n||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var T_=(()=>{class i{_dialogRef=u(bn,{optional:!0});_elementRef=u(ae);_dialog=u(Bn);constructor(){}ngOnInit(){this._dialogRef||(this._dialogRef=Cx(this._elementRef,this._dialog.openDialogs)),this._dialogRef&&Promise.resolve().then(()=>{this._onAdd()})}ngOnDestroy(){this._dialogRef?._containerInstance&&Promise.resolve().then(()=>{this._onRemove()})}static \u0275fac=function(n){return new(n||i)};static \u0275dir=ne({type:i})}return i})(),Ii=(()=>{class i extends T_{id=u(He).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(r){return(e||(e=We(i)))(r||i)}})();static \u0275dir=ne({type:i,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-mdc-dialog-title","mdc-dialog__title"],hostVars:1,hostBindings:function(n,r){n&2&&mn("id",r.id)},inputs:{id:"id"},exportAs:["matDialogTitle"],features:[ke]})}return i})(),Ri=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275dir=ne({type:i,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-mdc-dialog-content","mdc-dialog__content"],features:[Mp([sr])]})}return i})(),Fi=(()=>{class i extends T_{align;_onAdd(){this._dialogRef._containerInstance?._updateActionSectionCount?.(1)}_onRemove(){this._dialogRef._containerInstance?._updateActionSectionCount?.(-1)}static \u0275fac=(()=>{let e;return function(r){return(e||(e=We(i)))(r||i)}})();static \u0275dir=ne({type:i,selectors:[["","mat-dialog-actions",""],["mat-dialog-actions"],["","matDialogActions",""]],hostAttrs:[1,"mat-mdc-dialog-actions","mdc-dialog__actions"],hostVars:6,hostBindings:function(n,r){n&2&&R("mat-mdc-dialog-actions-align-start",r.align==="start")("mat-mdc-dialog-actions-align-center",r.align==="center")("mat-mdc-dialog-actions-align-end",r.align==="end")},inputs:{align:"align"},features:[ke]})}return i})();function Cx(i,t){let e=i.nativeElement.parentElement;for(;e&&!e.classList.contains("mat-mdc-dialog-container");)e=e.parentElement;return e?t.find(n=>n.id===e.id):null}var Hr=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=de({type:i});static \u0275inj=ce({providers:[Bn],imports:[y_,Di,Oi,pe,pe]})}return i})();var qo=class i{baseUrl="/api/projects";http=u(nt);listProjects(){return this.http.get(this.baseUrl)}getProject(t){return this.http.get(`${this.baseUrl}/${t}`)}getProjectConfig(t){return this.http.get(`${this.baseUrl}/${t}/config`)}updateProjectConfig(t,e){return this.http.put(`${this.baseUrl}/${t}/config`,e)}createProject(t,e){return this.http.post(this.baseUrl,{name:t,path:e})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})};var Te=class i{selectedProjectIdSubject=new Z(null);isLoadingSubject=new Z(!1);refreshTriggerSubject=new Z(void 0);hasInitialized=!1;isLoading$=this.isLoadingSubject.asObservable();projectApi=u(qo);projectListCall=this.refreshTriggerSubject.pipe(Je(()=>this.projectApi.listProjects()),Wi({bufferSize:1,refCount:!0}));projectList$=this.projectListCall.pipe(X(t=>t.projects));forcedProject$=this.projectListCall.pipe(X(t=>t.forcedProject));selectedProject$=dn([this.selectedProjectIdSubject,this.forcedProject$]).pipe(Je(([t,e])=>{let n=e??t;return n?this.projectApi.getProject(n):$(null)}),ve(t=>{t&&t.name!==this.selectedProjectIdSubject.value&&(console.log("[PROJECT-STATE] Backend returned different project name:",t.name),this.selectedProjectIdSubject.next(t.name))}),Wi({bufferSize:1,refCount:!0}));selectProject(t){console.log("[PROJECT-STATE] Explicit project selection:",t),this.forcedProject$.pipe(lt(1)).subscribe(e=>this.selectedProjectIdSubject.next(e??t))}getSelectedProjectId(){return this.selectedProjectIdSubject.value}getSelectedProjectIdOrThrow(){let t=this.selectedProjectIdSubject.value;if(!t)throw new Error("[PROJECT_STATE] No project selected");return t}clearSelection(){console.log("[PROJECT-STATE] Clearing project selection"),this.selectedProjectIdSubject.next(null)}initializeDefaultProject(){return re(this,null,function*(){if(this.hasInitialized){console.log("[PROJECT-STATE] Already initialized, skipping");return}this.hasInitialized=!0;let t=yield this.projectApi.listProjects().pipe(lt(1)).toPromise();if(!t){console.log("[PROJECT-STATE] No response from project API");return}let{defaultProject:e,forcedProject:n}=t;e&&!n?(console.log("[PROJECT-STATE] Initializing with default project:",e),this.selectedProjectIdSubject.next(e)):n?(console.log("[PROJECT-STATE] Initializing with forced project:",n),this.selectedProjectIdSubject.next(n)):console.log("[PROJECT-STATE] No default project, staying on selection page")})}createProject(t,e){return this.isLoadingSubject.next(!0),this.projectApi.createProject(t,e).pipe(ve(()=>{this.isLoadingSubject.next(!1),this.refreshTriggerSubject.next()}))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})};function wc(i){i||(i=u(xi));let t=new nn(e=>{if(i.destroyed){e.next();return}return i.onDestroy(e.next.bind(e))});return e=>e.pipe(L(t))}function qt(i,t){let n=!t?.manualCleanup?t?.injector?.get(xi)??u(xi):null,r=xx(t?.equal),o;t?.requireSync?o=Me({kind:0},{equal:r}):o=Me({kind:1,value:t?.initialValue},{equal:r});let a,s=i.subscribe({next:d=>o.set({kind:1,value:d}),error:d=>{o.set({kind:2,error:d}),a?.()},complete:()=>{a?.()}});if(t?.requireSync&&o().kind===0)throw new J(601,!1);return a=n?.onDestroy(s.unsubscribe.bind(s)),Ct(()=>{let d=o();switch(d.kind){case 1:return d.value;case 2:throw d.error;case 0:throw new J(601,!1)}},{equal:t?.equal})}function xx(i=Object.is){return(t,e)=>t.kind===1&&e.kind===1&&i(t.value,e.value)}function zm(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var $r=zm();function F_(i){$r=i}var ps={exec:()=>null};function Pe(i,t=""){let e=typeof i=="string"?i:i.source,n={replace:(r,o)=>{let a=typeof o=="string"?o:o.source;return a=a.replace(Gt.caret,"$1"),e=e.replace(r,a),n},getRegex:()=>new RegExp(e,t)};return n}var Gt={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:i=>new RegExp(`^( {0,3}${i})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}#`),htmlBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}<(?:[a-z].*>|!--)`,"i")},wx=/^(?:[ \t]*(?:\n|$))+/,Sx=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,kx=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,gs=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Mx=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Bm=/(?:[*+-]|\d{1,9}[.)])/,N_=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,V_=Pe(N_).replace(/bull/g,Bm).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(),Ex=Pe(N_).replace(/bull/g,Bm).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(),Hm=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Tx=/^[^\n]+/,Um=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ox=Pe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Um).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Px=Pe(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Bm).getRegex(),Ec="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",$m=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ax=Pe("^ {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",$m).replace("tag",Ec).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),L_=Pe(Hm).replace("hr",gs).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",Ec).getRegex(),Dx=Pe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",L_).getRegex(),Wm={blockquote:Dx,code:Sx,def:Ox,fences:kx,heading:Mx,hr:gs,html:Ax,lheading:V_,list:Px,newline:wx,paragraph:L_,table:ps,text:Tx},O_=Pe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",gs).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",Ec).getRegex(),Ix=be(M({},Wm),{lheading:Ex,table:O_,paragraph:Pe(Hm).replace("hr",gs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",O_).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",Ec).getRegex()}),Rx=be(M({},Wm),{html:Pe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",$m).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:ps,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Pe(Hm).replace("hr",gs).replace("heading",` *#{1,6} *[^
|
|
8
|
-
]`).replace("lheading",V_).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),Fx=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Nx=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,j_=/^( {2,}|\\)\n(?!\s*$)/,Vx=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Tc=/[\p{P}\p{S}]/u,qm=/[\s\p{P}\p{S}]/u,z_=/[^\s\p{P}\p{S}]/u,Lx=Pe(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,qm).getRegex(),B_=/(?!~)[\p{P}\p{S}]/u,jx=/(?!~)[\s\p{P}\p{S}]/u,zx=/(?:[^\s\p{P}\p{S}]|~)/u,Bx=/\[(?:[^\[\]`]|`[^`]*?`)*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,H_=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Hx=Pe(H_,"u").replace(/punct/g,Tc).getRegex(),Ux=Pe(H_,"u").replace(/punct/g,B_).getRegex(),U_="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",$x=Pe(U_,"gu").replace(/notPunctSpace/g,z_).replace(/punctSpace/g,qm).replace(/punct/g,Tc).getRegex(),Wx=Pe(U_,"gu").replace(/notPunctSpace/g,zx).replace(/punctSpace/g,jx).replace(/punct/g,B_).getRegex(),qx=Pe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,z_).replace(/punctSpace/g,qm).replace(/punct/g,Tc).getRegex(),Gx=Pe(/\\(punct)/,"gu").replace(/punct/g,Tc).getRegex(),Yx=Pe(/^<(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(),Qx=Pe($m).replace("(?:-->|$)","-->").getRegex(),Xx=Pe("^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",Qx).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),kc=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Kx=Pe(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",kc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),$_=Pe(/^!?\[(label)\]\[(ref)\]/).replace("label",kc).replace("ref",Um).getRegex(),W_=Pe(/^!?\[(ref)\](?:\[\])?/).replace("ref",Um).getRegex(),Zx=Pe("reflink|nolink(?!\\()","g").replace("reflink",$_).replace("nolink",W_).getRegex(),P_=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Gm={_backpedal:ps,anyPunctuation:Gx,autolink:Yx,blockSkip:Bx,br:j_,code:Nx,del:ps,emStrongLDelim:Hx,emStrongRDelimAst:$x,emStrongRDelimUnd:qx,escape:Fx,link:Kx,nolink:W_,punctuation:Lx,reflink:$_,reflinkSearch:Zx,tag:Xx,text:Vx,url:ps},Jx=be(M({},Gm),{link:Pe(/^!?\[(label)\]\((.*?)\)/).replace("label",kc).getRegex(),reflink:Pe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",kc).getRegex()}),Vm=be(M({},Gm),{emStrongRDelimAst:Wx,emStrongLDelim:Ux,url:Pe(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",P_).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:Pe(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",P_).getRegex()}),ew=be(M({},Vm),{br:Pe(j_).replace("{2,}","*").getRegex(),text:Pe(Vm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),Sc={normal:Wm,gfm:Ix,pedantic:Rx},us={normal:Gm,gfm:Vm,breaks:ew,pedantic:Jx},tw={"&":"&","<":"<",">":">",'"':""","'":"'"},A_=i=>tw[i];function ci(i,t){if(t){if(Gt.escapeTest.test(i))return i.replace(Gt.escapeReplace,A_)}else if(Gt.escapeTestNoEncode.test(i))return i.replace(Gt.escapeReplaceNoEncode,A_);return i}function D_(i){try{i=encodeURI(i).replace(Gt.percentDecode,"%")}catch{return null}return i}function I_(i,t){let e=i.replace(Gt.findPipe,(o,a,s)=>{let d=!1,p=a;for(;--p>=0&&s[p]==="\\";)d=!d;return d?"|":" |"}),n=e.split(Gt.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(Gt.slashPipe,"|");return n}function ms(i,t,e){let n=i.length;if(n===0)return"";let r=0;for(;r<n;){let o=i.charAt(n-r-1);if(o===t&&!e)r++;else if(o!==t&&e)r++;else break}return i.slice(0,n-r)}function nw(i,t){if(i.indexOf(t[1])===-1)return-1;let e=0;for(let n=0;n<i.length;n++)if(i[n]==="\\")n++;else if(i[n]===t[0])e++;else if(i[n]===t[1]&&(e--,e<0))return n;return e>0?-2:-1}function R_(i,t,e,n,r){let o=t.href,a=t.title||null,s=i[1].replace(r.other.outputLinkReplace,"$1");n.state.inLink=!0;let d={type:i[0].charAt(0)==="!"?"image":"link",raw:e,href:o,title:a,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,d}function iw(i,t,e){let n=i.match(e.other.indentCodeCompensation);if(n===null)return t;let r=n[1];return t.split(`
|
|
9
|
-
`).map(o=>{let a=o.match(e.other.beginningSpace);if(a===null)return o;let[s]=a;return s.length>=r.length?o.slice(r.length):o}).join(`
|
|
10
|
-
`)}var Mc=class{options;rules;lexer;constructor(i){this.options=i||$r}space(i){let t=this.rules.block.newline.exec(i);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(i){let t=this.rules.block.code.exec(i);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:ms(e,`
|
|
11
|
-
`)}}}fences(i){let t=this.rules.block.fences.exec(i);if(t){let e=t[0],n=iw(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(i){let t=this.rules.block.heading.exec(i);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let n=ms(e,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(e=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(i){let t=this.rules.block.hr.exec(i);if(t)return{type:"hr",raw:ms(t[0],`
|
|
12
|
-
`)}}blockquote(i){let t=this.rules.block.blockquote.exec(i);if(t){let e=ms(t[0],`
|
|
13
|
-
`).split(`
|
|
14
|
-
`),n="",r="",o=[];for(;e.length>0;){let a=!1,s=[],d;for(d=0;d<e.length;d++)if(this.rules.other.blockquoteStart.test(e[d]))s.push(e[d]),a=!0;else if(!a)s.push(e[d]);else break;e=e.slice(d);let p=s.join(`
|
|
15
|
-
`),f=p.replace(this.rules.other.blockquoteSetextReplace,`
|
|
16
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
|
|
17
|
-
${p}`:p,r=r?`${r}
|
|
18
|
-
${f}`:f;let v=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(f,o,!0),this.lexer.state.top=v,e.length===0)break;let E=o.at(-1);if(E?.type==="code")break;if(E?.type==="blockquote"){let T=E,k=T.raw+`
|
|
19
|
-
`+e.join(`
|
|
20
|
-
`),V=this.blockquote(k);o[o.length-1]=V,n=n.substring(0,n.length-T.raw.length)+V.raw,r=r.substring(0,r.length-T.text.length)+V.text;break}else if(E?.type==="list"){let T=E,k=T.raw+`
|
|
21
|
-
`+e.join(`
|
|
22
|
-
`),V=this.list(k);o[o.length-1]=V,n=n.substring(0,n.length-E.raw.length)+V.raw,r=r.substring(0,r.length-T.raw.length)+V.raw,e=k.substring(o.at(-1).raw.length).split(`
|
|
23
|
-
`);continue}}return{type:"blockquote",raw:n,tokens:o,text:r}}}list(i){let t=this.rules.block.list.exec(i);if(t){let e=t[1].trim(),n=e.length>1,r={type:"list",raw:"",ordered:n,start:n?+e.slice(0,-1):"",loose:!1,items:[]};e=n?`\\d{1,9}\\${e.slice(-1)}`:`\\${e}`,this.options.pedantic&&(e=n?e:"[*+-]");let o=this.rules.other.listItemRegex(e),a=!1;for(;i;){let d=!1,p="",f="";if(!(t=o.exec(i))||this.rules.block.hr.test(i))break;p=t[0],i=i.substring(p.length);let v=t[2].split(`
|
|
24
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,Re=>" ".repeat(3*Re.length)),E=i.split(`
|
|
25
|
-
`,1)[0],T=!v.trim(),k=0;if(this.options.pedantic?(k=2,f=v.trimStart()):T?k=t[1].length+1:(k=t[2].search(this.rules.other.nonSpaceChar),k=k>4?1:k,f=v.slice(k),k+=t[1].length),T&&this.rules.other.blankLine.test(E)&&(p+=E+`
|
|
26
|
-
`,i=i.substring(E.length+1),d=!0),!d){let Re=this.rules.other.nextBulletRegex(k),Ye=this.rules.other.hrRegex(k),Ve=this.rules.other.fencesBeginRegex(k),xe=this.rules.other.headingBeginRegex(k),Jt=this.rules.other.htmlBeginRegex(k);for(;i;){let wt=i.split(`
|
|
27
|
-
`,1)[0],st;if(E=wt,this.options.pedantic?(E=E.replace(this.rules.other.listReplaceNesting," "),st=E):st=E.replace(this.rules.other.tabCharGlobal," "),Ve.test(E)||xe.test(E)||Jt.test(E)||Re.test(E)||Ye.test(E))break;if(st.search(this.rules.other.nonSpaceChar)>=k||!E.trim())f+=`
|
|
28
|
-
`+st.slice(k);else{if(T||v.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||Ve.test(v)||xe.test(v)||Ye.test(v))break;f+=`
|
|
29
|
-
`+E}!T&&!E.trim()&&(T=!0),p+=wt+`
|
|
30
|
-
`,i=i.substring(wt.length+1),v=st.slice(k)}}r.loose||(a?r.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(a=!0));let V=null,ge;this.options.gfm&&(V=this.rules.other.listIsTask.exec(f),V&&(ge=V[0]!=="[ ] ",f=f.replace(this.rules.other.listReplaceTask,""))),r.items.push({type:"list_item",raw:p,task:!!V,checked:ge,loose:!1,text:f,tokens:[]}),r.raw+=p}let s=r.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let d=0;d<r.items.length;d++)if(this.lexer.state.top=!1,r.items[d].tokens=this.lexer.blockTokens(r.items[d].text,[]),!r.loose){let p=r.items[d].tokens.filter(v=>v.type==="space"),f=p.length>0&&p.some(v=>this.rules.other.anyLine.test(v.raw));r.loose=f}if(r.loose)for(let d=0;d<r.items.length;d++)r.items[d].loose=!0;return r}}html(i){let t=this.rules.block.html.exec(i);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(i){let t=this.rules.block.def.exec(i);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=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:n,title:r}}}table(i){let t=this.rules.block.table.exec(i);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let e=I_(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
31
|
-
`):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(e.length===n.length){for(let a of n)this.rules.other.tableAlignRight.test(a)?o.align.push("right"):this.rules.other.tableAlignCenter.test(a)?o.align.push("center"):this.rules.other.tableAlignLeft.test(a)?o.align.push("left"):o.align.push(null);for(let a=0;a<e.length;a++)o.header.push({text:e[a],tokens:this.lexer.inline(e[a]),header:!0,align:o.align[a]});for(let a of r)o.rows.push(I_(a,o.header.length).map((s,d)=>({text:s,tokens:this.lexer.inline(s),header:!1,align:o.align[d]})));return o}}lheading(i){let t=this.rules.block.lheading.exec(i);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(i){let t=this.rules.block.paragraph.exec(i);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
32
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(i){let t=this.rules.block.text.exec(i);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(i){let t=this.rules.inline.escape.exec(i);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(i){let t=this.rules.inline.tag.exec(i);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(i){let t=this.rules.inline.link.exec(i);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 o=ms(e.slice(0,-1),"\\");if((e.length-o.length)%2===0)return}else{let o=nw(t[2],"()");if(o===-2)return;if(o>-1){let a=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(n);o&&(n=o[1],r=o[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n=n.slice(1):n=n.slice(1,-1)),R_(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(i,t){let e;if((e=this.rules.inline.reflink.exec(i))||(e=this.rules.inline.nolink.exec(i))){let n=(e[2]||e[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=t[n.toLowerCase()];if(!r){let o=e[0].charAt(0);return{type:"text",raw:o,text:o}}return R_(e,r,e[0],this.lexer,this.rules)}}emStrong(i,t,e=""){let n=this.rules.inline.emStrongLDelim.exec(i);if(!(!n||n[3]&&e.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[2])||!e||this.rules.inline.punctuation.exec(e))){let r=[...n[0]].length-1,o,a,s=r,d=0,p=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,t=t.slice(-1*i.length+r);(n=p.exec(t))!=null;){if(o=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!o)continue;if(a=[...o].length,n[3]||n[4]){s+=a;continue}else if((n[5]||n[6])&&r%3&&!((r+a)%3)){d+=a;continue}if(s-=a,s>0)continue;a=Math.min(a,a+s+d);let f=[...n[0]][0].length,v=i.slice(0,r+n.index+f+a);if(Math.min(r,a)%2){let T=v.slice(1,-1);return{type:"em",raw:v,text:T,tokens:this.lexer.inlineTokens(T)}}let E=v.slice(2,-2);return{type:"strong",raw:v,text:E,tokens:this.lexer.inlineTokens(E)}}}}codespan(i){let t=this.rules.inline.code.exec(i);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(i){let t=this.rules.inline.br.exec(i);if(t)return{type:"br",raw:t[0]}}del(i){let t=this.rules.inline.del.exec(i);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(i){let t=this.rules.inline.autolink.exec(i);if(t){let e,n;return t[2]==="@"?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(i){let t;if(t=this.rules.inline.url.exec(i)){let e,n;if(t[2]==="@")e=t[0],n="mailto:"+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(r!==t[0]);e=t[0],t[1]==="www."?n="http://"+t[0]:n=t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(i){let t=this.rules.inline.text.exec(i);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},Hn=class Lm{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||$r,this.options.tokenizer=this.options.tokenizer||new Mc,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:Gt,block:Sc.normal,inline:us.normal};this.options.pedantic?(e.block=Sc.pedantic,e.inline=us.pedantic):this.options.gfm&&(e.block=Sc.gfm,this.options.breaks?e.inline=us.breaks:e.inline=us.gfm),this.tokenizer.rules=e}static get rules(){return{block:Sc,inline:us}}static lex(t,e){return new Lm(e).lex(t)}static lexInline(t,e){return new Lm(e).inlineTokens(t)}lex(t){t=t.replace(Gt.carriageReturn,`
|
|
33
|
-
`),this.blockTokens(t,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let n=this.inlineQueue[e];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,e=[],n=!1){for(this.options.pedantic&&(t=t.replace(Gt.tabCharGlobal," ").replace(Gt.spaceLine,""));t;){let r;if(this.options.extensions?.block?.some(a=>(r=a.call({lexer:this},t,e))?(t=t.substring(r.raw.length),e.push(r),!0):!1))continue;if(r=this.tokenizer.space(t)){t=t.substring(r.raw.length);let a=e.at(-1);r.raw.length===1&&a!==void 0?a.raw+=`
|
|
34
|
-
`:e.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length);let a=e.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
35
|
-
`)?"":`
|
|
36
|
-
`)+r.raw,a.text+=`
|
|
37
|
-
`+r.text,this.inlineQueue.at(-1).src=a.text):e.push(r);continue}if(r=this.tokenizer.fences(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.heading(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.hr(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.blockquote(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.list(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.html(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.def(t)){t=t.substring(r.raw.length);let a=e.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
38
|
-
`)?"":`
|
|
39
|
-
`)+r.raw,a.text+=`
|
|
40
|
-
`+r.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},e.push(r));continue}if(r=this.tokenizer.table(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),e.push(r);continue}let o=t;if(this.options.extensions?.startBlock){let a=1/0,s=t.slice(1),d;this.options.extensions.startBlock.forEach(p=>{d=p.call({lexer:this},s),typeof d=="number"&&d>=0&&(a=Math.min(a,d))}),a<1/0&&a>=0&&(o=t.substring(0,a+1))}if(this.state.top&&(r=this.tokenizer.paragraph(o))){let a=e.at(-1);n&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
|
|
41
|
-
`)?"":`
|
|
42
|
-
`)+r.raw,a.text+=`
|
|
43
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):e.push(r),n=o.length!==t.length,t=t.substring(r.raw.length);continue}if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length);let a=e.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
44
|
-
`)?"":`
|
|
45
|
-
`)+r.raw,a.text+=`
|
|
46
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):e.push(r);continue}if(t){let a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,e}inline(t,e=[]){return this.inlineQueue.push({src:t,tokens:e}),e}inlineTokens(t,e=[]){let n=t,r=null;if(this.tokens.links){let s=Object.keys(this.tokens.links);if(s.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)s.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let o=!1,a="";for(;t;){o||(a=""),o=!1;let s;if(this.options.extensions?.inline?.some(p=>(s=p.call({lexer:this},t,e))?(t=t.substring(s.raw.length),e.push(s),!0):!1))continue;if(s=this.tokenizer.escape(t)){t=t.substring(s.raw.length),e.push(s);continue}if(s=this.tokenizer.tag(t)){t=t.substring(s.raw.length),e.push(s);continue}if(s=this.tokenizer.link(t)){t=t.substring(s.raw.length),e.push(s);continue}if(s=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(s.raw.length);let p=e.at(-1);s.type==="text"&&p?.type==="text"?(p.raw+=s.raw,p.text+=s.text):e.push(s);continue}if(s=this.tokenizer.emStrong(t,n,a)){t=t.substring(s.raw.length),e.push(s);continue}if(s=this.tokenizer.codespan(t)){t=t.substring(s.raw.length),e.push(s);continue}if(s=this.tokenizer.br(t)){t=t.substring(s.raw.length),e.push(s);continue}if(s=this.tokenizer.del(t)){t=t.substring(s.raw.length),e.push(s);continue}if(s=this.tokenizer.autolink(t)){t=t.substring(s.raw.length),e.push(s);continue}if(!this.state.inLink&&(s=this.tokenizer.url(t))){t=t.substring(s.raw.length),e.push(s);continue}let d=t;if(this.options.extensions?.startInline){let p=1/0,f=t.slice(1),v;this.options.extensions.startInline.forEach(E=>{v=E.call({lexer:this},f),typeof v=="number"&&v>=0&&(p=Math.min(p,v))}),p<1/0&&p>=0&&(d=t.substring(0,p+1))}if(s=this.tokenizer.inlineText(d)){t=t.substring(s.raw.length),s.raw.slice(-1)!=="_"&&(a=s.raw.slice(-1)),o=!0;let p=e.at(-1);p?.type==="text"?(p.raw+=s.raw,p.text+=s.text):e.push(s);continue}if(t){let p="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return e}},Go=class{options;parser;constructor(i){this.options=i||$r}space(i){return""}code({text:i,lang:t,escaped:e}){let n=(t||"").match(Gt.notSpaceStart)?.[0],r=i.replace(Gt.endingNewline,"")+`
|
|
47
|
-
`;return n?'<pre><code class="language-'+ci(n)+'">'+(e?r:ci(r,!0))+`</code></pre>
|
|
48
|
-
`:"<pre><code>"+(e?r:ci(r,!0))+`</code></pre>
|
|
49
|
-
`}blockquote({tokens:i}){return`<blockquote>
|
|
50
|
-
${this.parser.parse(i)}</blockquote>
|
|
51
|
-
`}html({text:i}){return i}def(i){return""}heading({tokens:i,depth:t}){return`<h${t}>${this.parser.parseInline(i)}</h${t}>
|
|
52
|
-
`}hr(i){return`<hr>
|
|
53
|
-
`}list(i){let t=i.ordered,e=i.start,n="";for(let a=0;a<i.items.length;a++){let s=i.items[a];n+=this.listitem(s)}let r=t?"ol":"ul",o=t&&e!==1?' start="'+e+'"':"";return"<"+r+o+`>
|
|
54
|
-
`+n+"</"+r+`>
|
|
55
|
-
`}listitem(i){let t="";if(i.task){let e=this.checkbox({checked:!!i.checked});i.loose?i.tokens[0]?.type==="paragraph"?(i.tokens[0].text=e+" "+i.tokens[0].text,i.tokens[0].tokens&&i.tokens[0].tokens.length>0&&i.tokens[0].tokens[0].type==="text"&&(i.tokens[0].tokens[0].text=e+" "+ci(i.tokens[0].tokens[0].text),i.tokens[0].tokens[0].escaped=!0)):i.tokens.unshift({type:"text",raw:e+" ",text:e+" ",escaped:!0}):t+=e+" "}return t+=this.parser.parse(i.tokens,!!i.loose),`<li>${t}</li>
|
|
56
|
-
`}checkbox({checked:i}){return"<input "+(i?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:i}){return`<p>${this.parser.parseInline(i)}</p>
|
|
57
|
-
`}table(i){let t="",e="";for(let r=0;r<i.header.length;r++)e+=this.tablecell(i.header[r]);t+=this.tablerow({text:e});let n="";for(let r=0;r<i.rows.length;r++){let o=i.rows[r];e="";for(let a=0;a<o.length;a++)e+=this.tablecell(o[a]);n+=this.tablerow({text:e})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
|
|
58
|
-
<thead>
|
|
59
|
-
`+t+`</thead>
|
|
60
|
-
`+n+`</table>
|
|
61
|
-
`}tablerow({text:i}){return`<tr>
|
|
62
|
-
${i}</tr>
|
|
63
|
-
`}tablecell(i){let t=this.parser.parseInline(i.tokens),e=i.header?"th":"td";return(i.align?`<${e} align="${i.align}">`:`<${e}>`)+t+`</${e}>
|
|
64
|
-
`}strong({tokens:i}){return`<strong>${this.parser.parseInline(i)}</strong>`}em({tokens:i}){return`<em>${this.parser.parseInline(i)}</em>`}codespan({text:i}){return`<code>${ci(i,!0)}</code>`}br(i){return"<br>"}del({tokens:i}){return`<del>${this.parser.parseInline(i)}</del>`}link({href:i,title:t,tokens:e}){let n=this.parser.parseInline(e),r=D_(i);if(r===null)return n;i=r;let o='<a href="'+i+'"';return t&&(o+=' title="'+ci(t)+'"'),o+=">"+n+"</a>",o}image({href:i,title:t,text:e,tokens:n}){n&&(e=this.parser.parseInline(n,this.parser.textRenderer));let r=D_(i);if(r===null)return ci(e);i=r;let o=`<img src="${i}" alt="${e}"`;return t&&(o+=` title="${ci(t)}"`),o+=">",o}text(i){return"tokens"in i&&i.tokens?this.parser.parseInline(i.tokens):"escaped"in i&&i.escaped?i.text:ci(i.text)}},Ym=class{strong({text:i}){return i}em({text:i}){return i}codespan({text:i}){return i}del({text:i}){return i}html({text:i}){return i}text({text:i}){return i}link({text:i}){return""+i}image({text:i}){return""+i}br(){return""}},Un=class jm{options;renderer;textRenderer;constructor(t){this.options=t||$r,this.options.renderer=this.options.renderer||new Go,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ym}static parse(t,e){return new jm(e).parse(t)}static parseInline(t,e){return new jm(e).parseInline(t)}parse(t,e=!0){let n="";for(let r=0;r<t.length;r++){let o=t[r];if(this.options.extensions?.renderers?.[o.type]){let s=o,d=this.options.extensions.renderers[s.type].call({parser:this},s);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(s.type)){n+=d||"";continue}}let a=o;switch(a.type){case"space":{n+=this.renderer.space(a);continue}case"hr":{n+=this.renderer.hr(a);continue}case"heading":{n+=this.renderer.heading(a);continue}case"code":{n+=this.renderer.code(a);continue}case"table":{n+=this.renderer.table(a);continue}case"blockquote":{n+=this.renderer.blockquote(a);continue}case"list":{n+=this.renderer.list(a);continue}case"html":{n+=this.renderer.html(a);continue}case"def":{n+=this.renderer.def(a);continue}case"paragraph":{n+=this.renderer.paragraph(a);continue}case"text":{let s=a,d=this.renderer.text(s);for(;r+1<t.length&&t[r+1].type==="text";)s=t[++r],d+=`
|
|
65
|
-
`+this.renderer.text(s);e?n+=this.renderer.paragraph({type:"paragraph",raw:d,text:d,tokens:[{type:"text",raw:d,text:d,escaped:!0}]}):n+=d;continue}default:{let s='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}parseInline(t,e=this.renderer){let n="";for(let r=0;r<t.length;r++){let o=t[r];if(this.options.extensions?.renderers?.[o.type]){let s=this.options.extensions.renderers[o.type].call({parser:this},o);if(s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=s||"";continue}}let a=o;switch(a.type){case"escape":{n+=e.text(a);break}case"html":{n+=e.html(a);break}case"link":{n+=e.link(a);break}case"image":{n+=e.image(a);break}case"strong":{n+=e.strong(a);break}case"em":{n+=e.em(a);break}case"codespan":{n+=e.codespan(a);break}case"br":{n+=e.br(a);break}case"del":{n+=e.del(a);break}case"text":{n+=e.text(a);break}default:{let s='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}},hs=class{options;block;constructor(i){this.options=i||$r}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(i){return i}postprocess(i){return i}processAllTokens(i){return i}emStrongMask(i){return i}provideLexer(){return this.block?Hn.lex:Hn.lexInline}provideParser(){return this.block?Un.parse:Un.parseInline}},rw=class{defaults=zm();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Un;Renderer=Go;TextRenderer=Ym;Lexer=Hn;Tokenizer=Mc;Hooks=hs;constructor(...i){this.use(...i)}walkTokens(i,t){let e=[];for(let n of i)switch(e=e.concat(t.call(this,n)),n.type){case"table":{let r=n;for(let o of r.header)e=e.concat(this.walkTokens(o.tokens,t));for(let o of r.rows)for(let a of o)e=e.concat(this.walkTokens(a.tokens,t));break}case"list":{let r=n;e=e.concat(this.walkTokens(r.items,t));break}default:{let r=n;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(o=>{let a=r[o].flat(1/0);e=e.concat(this.walkTokens(a,t))}):r.tokens&&(e=e.concat(this.walkTokens(r.tokens,t)))}}return e}use(...i){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return i.forEach(e=>{let n=M({},e);if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let o=t.renderers[r.name];o?t.renderers[r.name]=function(...a){let s=r.renderer.apply(this,a);return s===!1&&(s=o.apply(this,a)),s}:t.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=t[r.level];o?o.unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level==="block"?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level==="inline"&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),n.extensions=t),e.renderer){let r=this.defaults.renderer||new Go(this.defaults);for(let o in e.renderer){if(!(o in r))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let a=o,s=e.renderer[a],d=r[a];r[a]=(...p)=>{let f=s.apply(r,p);return f===!1&&(f=d.apply(r,p)),f||""}}n.renderer=r}if(e.tokenizer){let r=this.defaults.tokenizer||new Mc(this.defaults);for(let o in e.tokenizer){if(!(o in r))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let a=o,s=e.tokenizer[a],d=r[a];r[a]=(...p)=>{let f=s.apply(r,p);return f===!1&&(f=d.apply(r,p)),f}}n.tokenizer=r}if(e.hooks){let r=this.defaults.hooks||new hs;for(let o in e.hooks){if(!(o in r))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let a=o,s=e.hooks[a],d=r[a];hs.passThroughHooks.has(o)?r[a]=p=>{if(this.defaults.async&&hs.passThroughHooksRespectAsync.has(o))return re(this,null,function*(){let v=yield s.call(r,p);return d.call(r,v)});let f=s.call(r,p);return d.call(r,f)}:r[a]=(...p)=>{if(this.defaults.async)return re(this,null,function*(){let v=yield s.apply(r,p);return v===!1&&(v=yield d.apply(r,p)),v});let f=s.apply(r,p);return f===!1&&(f=d.apply(r,p)),f}}n.hooks=r}if(e.walkTokens){let r=this.defaults.walkTokens,o=e.walkTokens;n.walkTokens=function(a){let s=[];return s.push(o.call(this,a)),r&&(s=s.concat(r.call(this,a))),s}}this.defaults=M(M({},this.defaults),n)}),this}setOptions(i){return this.defaults=M(M({},this.defaults),i),this}lexer(i,t){return Hn.lex(i,t??this.defaults)}parser(i,t){return Un.parse(i,t??this.defaults)}parseMarkdown(i){return(t,e)=>{let n=M({},e),r=M(M({},this.defaults),n),o=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&n.async===!1)return o(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 o(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=i),r.async)return re(this,null,function*(){let a=r.hooks?yield r.hooks.preprocess(t):t,s=yield(r.hooks?yield r.hooks.provideLexer():i?Hn.lex:Hn.lexInline)(a,r),d=r.hooks?yield r.hooks.processAllTokens(s):s;r.walkTokens&&(yield Promise.all(this.walkTokens(d,r.walkTokens)));let p=yield(r.hooks?yield r.hooks.provideParser():i?Un.parse:Un.parseInline)(d,r);return r.hooks?yield r.hooks.postprocess(p):p}).catch(o);try{r.hooks&&(t=r.hooks.preprocess(t));let a=(r.hooks?r.hooks.provideLexer():i?Hn.lex:Hn.lexInline)(t,r);r.hooks&&(a=r.hooks.processAllTokens(a)),r.walkTokens&&this.walkTokens(a,r.walkTokens);let s=(r.hooks?r.hooks.provideParser():i?Un.parse:Un.parseInline)(a,r);return r.hooks&&(s=r.hooks.postprocess(s)),s}catch(a){return o(a)}}}onError(i,t){return e=>{if(e.message+=`
|
|
66
|
-
Please report this to https://github.com/markedjs/marked.`,i){let n="<p>An error occurred:</p><pre>"+ci(e.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(e);throw e}}},Ur=new rw;function Ie(i,t){return Ur.parse(i,t)}Ie.options=Ie.setOptions=function(i){return Ur.setOptions(i),Ie.defaults=Ur.defaults,F_(Ie.defaults),Ie};Ie.getDefaults=zm;Ie.defaults=$r;Ie.use=function(...i){return Ur.use(...i),Ie.defaults=Ur.defaults,F_(Ie.defaults),Ie};Ie.walkTokens=function(i,t){return Ur.walkTokens(i,t)};Ie.parseInline=Ur.parseInline;Ie.Parser=Un;Ie.parser=Un.parse;Ie.Renderer=Go;Ie.TextRenderer=Ym;Ie.Lexer=Hn;Ie.lexer=Hn.lex;Ie.Tokenizer=Mc;Ie.Hooks=hs;Ie.parse=Ie;var XD=Ie.options,KD=Ie.setOptions,ZD=Ie.use,JD=Ie.walkTokens,eI=Ie.parseInline;var tI=Un.parse,nI=Hn.lex;var{entries:eb,setPrototypeOf:q_,isFrozen:ow,getPrototypeOf:aw,getOwnPropertyDescriptor:sw}=Object,{freeze:Qt,seal:En,create:th}=Object,{apply:nh,construct:ih}=typeof Reflect<"u"&&Reflect;Qt||(Qt=function(t){return t});En||(En=function(t){return t});nh||(nh=function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return t.apply(e,r)});ih||(ih=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return new t(...n)});var Oc=Xt(Array.prototype.forEach),lw=Xt(Array.prototype.lastIndexOf),G_=Xt(Array.prototype.pop),fs=Xt(Array.prototype.push),cw=Xt(Array.prototype.splice),Ac=Xt(String.prototype.toLowerCase),Qm=Xt(String.prototype.toString),Xm=Xt(String.prototype.match),_s=Xt(String.prototype.replace),dw=Xt(String.prototype.indexOf),uw=Xt(String.prototype.trim),$n=Xt(Object.prototype.hasOwnProperty),Yt=Xt(RegExp.prototype.test),bs=mw(TypeError);function Xt(i){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return nh(i,t,n)}}function mw(i){return function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return ih(i,e)}}function ye(i,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ac;q_&&q_(i,null);let n=t.length;for(;n--;){let r=t[n];if(typeof r=="string"){let o=e(r);o!==r&&(ow(t)||(t[n]=o),r=o)}i[r]=!0}return i}function hw(i){for(let t=0;t<i.length;t++)$n(i,t)||(i[t]=null);return i}function di(i){let t=th(null);for(let[e,n]of eb(i))$n(i,e)&&(Array.isArray(n)?t[e]=hw(n):n&&typeof n=="object"&&n.constructor===Object?t[e]=di(n):t[e]=n);return t}function vs(i,t){for(;i!==null;){let n=sw(i,t);if(n){if(n.get)return Xt(n.get);if(typeof n.value=="function")return Xt(n.value)}i=aw(i)}function e(){return null}return e}var Y_=Qt(["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"]),Km=Qt(["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"]),Zm=Qt(["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"]),pw=Qt(["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"]),Jm=Qt(["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"]),gw=Qt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Q_=Qt(["#text"]),X_=Qt(["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"]),eh=Qt(["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"]),K_=Qt(["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"]),Pc=Qt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),fw=En(/\{\{[\w\W]*|[\w\W]*\}\}/gm),_w=En(/<%[\w\W]*|[\w\W]*%>/gm),bw=En(/\$\{[\w\W]*/gm),vw=En(/^data-[\-\w.\u00B7-\uFFFF]+$/),yw=En(/^aria-[\-\w]+$/),tb=En(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Cw=En(/^(?:\w+script|data):/i),xw=En(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),nb=En(/^html$/i),ww=En(/^[a-z][.\w]*(-[.\w]+)+$/i),Z_=Object.freeze({__proto__:null,ARIA_ATTR:yw,ATTR_WHITESPACE:xw,CUSTOM_ELEMENT:ww,DATA_ATTR:vw,DOCTYPE_NAME:nb,ERB_EXPR:_w,IS_ALLOWED_URI:tb,IS_SCRIPT_OR_DATA:Cw,MUSTACHE_EXPR:fw,TMPLIT_EXPR:bw}),ys={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Sw=function(){return typeof window>"u"?null:window},kw=function(t,e){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null,r="data-tt-policy-suffix";e&&e.hasAttribute(r)&&(n=e.getAttribute(r));let o="dompurify"+(n?"#"+n:"");try{return t.createPolicy(o,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},J_=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function ib(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Sw(),t=te=>ib(te);if(t.version="3.3.1",t.removed=[],!i||!i.document||i.document.nodeType!==ys.document||!i.Element)return t.isSupported=!1,t;let{document:e}=i,n=e,r=n.currentScript,{DocumentFragment:o,HTMLTemplateElement:a,Node:s,Element:d,NodeFilter:p,NamedNodeMap:f=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:v,DOMParser:E,trustedTypes:T}=i,k=d.prototype,V=vs(k,"cloneNode"),ge=vs(k,"remove"),Re=vs(k,"nextSibling"),Ye=vs(k,"childNodes"),Ve=vs(k,"parentNode");if(typeof a=="function"){let te=e.createElement("template");te.content&&te.content.ownerDocument&&(e=te.content.ownerDocument)}let xe,Jt="",{implementation:wt,createNodeIterator:st,createDocumentFragment:It,getElementsByTagName:_i}=e,{importNode:Ui}=n,St=J_();t.isSupported=typeof eb=="function"&&typeof Ve=="function"&&wt&&wt.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:Dn,ERB_EXPR:gr,TMPLIT_EXPR:oo,DATA_ATTR:Hs,ARIA_ATTR:W,IS_SCRIPT_OR_DATA:ee,ATTR_WHITESPACE:oe,CUSTOM_ELEMENT:Se}=Z_,{IS_ALLOWED_URI:ht}=Z_,Fe=null,Rt=ye({},[...Y_,...Km,...Zm,...Jm,...Q_]),Ue=null,$e=ye({},[...X_,...eh,...K_,...Pc]),Ke=Object.seal(th(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}})),fr=null,ft=null,en=Object.seal(th(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Ut=!0,$i=!0,ao=!1,jh=!0,so=!1,Us=!0,_r=!1,Ud=!1,$d=!1,lo=!1,$s=!1,Ws=!1,zh=!0,Bh=!1,r0="user-content-",Wd=!0,ka=!1,co={},Yn=null,qd=ye({},["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"]),Hh=null,Uh=ye({},["audio","video","img","source","image","track"]),Gd=null,$h=ye({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),qs="http://www.w3.org/1998/Math/MathML",Gs="http://www.w3.org/2000/svg",bi="http://www.w3.org/1999/xhtml",uo=bi,Yd=!1,Qd=null,o0=ye({},[qs,Gs,bi],Qm),Ys=ye({},["mi","mo","mn","ms","mtext"]),Qs=ye({},["annotation-xml"]),a0=ye({},["title","style","font","a","script"]),Ma=null,s0=["application/xhtml+xml","text/html"],l0="text/html",yt=null,mo=null,c0=e.createElement("form"),Wh=function(_){return _ instanceof RegExp||_ instanceof Function},Xd=function(){let _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(mo&&mo===_)){if((!_||typeof _!="object")&&(_={}),_=di(_),Ma=s0.indexOf(_.PARSER_MEDIA_TYPE)===-1?l0:_.PARSER_MEDIA_TYPE,yt=Ma==="application/xhtml+xml"?Qm:Ac,Fe=$n(_,"ALLOWED_TAGS")?ye({},_.ALLOWED_TAGS,yt):Rt,Ue=$n(_,"ALLOWED_ATTR")?ye({},_.ALLOWED_ATTR,yt):$e,Qd=$n(_,"ALLOWED_NAMESPACES")?ye({},_.ALLOWED_NAMESPACES,Qm):o0,Gd=$n(_,"ADD_URI_SAFE_ATTR")?ye(di($h),_.ADD_URI_SAFE_ATTR,yt):$h,Hh=$n(_,"ADD_DATA_URI_TAGS")?ye(di(Uh),_.ADD_DATA_URI_TAGS,yt):Uh,Yn=$n(_,"FORBID_CONTENTS")?ye({},_.FORBID_CONTENTS,yt):qd,fr=$n(_,"FORBID_TAGS")?ye({},_.FORBID_TAGS,yt):di({}),ft=$n(_,"FORBID_ATTR")?ye({},_.FORBID_ATTR,yt):di({}),co=$n(_,"USE_PROFILES")?_.USE_PROFILES:!1,Ut=_.ALLOW_ARIA_ATTR!==!1,$i=_.ALLOW_DATA_ATTR!==!1,ao=_.ALLOW_UNKNOWN_PROTOCOLS||!1,jh=_.ALLOW_SELF_CLOSE_IN_ATTR!==!1,so=_.SAFE_FOR_TEMPLATES||!1,Us=_.SAFE_FOR_XML!==!1,_r=_.WHOLE_DOCUMENT||!1,lo=_.RETURN_DOM||!1,$s=_.RETURN_DOM_FRAGMENT||!1,Ws=_.RETURN_TRUSTED_TYPE||!1,$d=_.FORCE_BODY||!1,zh=_.SANITIZE_DOM!==!1,Bh=_.SANITIZE_NAMED_PROPS||!1,Wd=_.KEEP_CONTENT!==!1,ka=_.IN_PLACE||!1,ht=_.ALLOWED_URI_REGEXP||tb,uo=_.NAMESPACE||bi,Ys=_.MATHML_TEXT_INTEGRATION_POINTS||Ys,Qs=_.HTML_INTEGRATION_POINTS||Qs,Ke=_.CUSTOM_ELEMENT_HANDLING||{},_.CUSTOM_ELEMENT_HANDLING&&Wh(_.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ke.tagNameCheck=_.CUSTOM_ELEMENT_HANDLING.tagNameCheck),_.CUSTOM_ELEMENT_HANDLING&&Wh(_.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ke.attributeNameCheck=_.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),_.CUSTOM_ELEMENT_HANDLING&&typeof _.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Ke.allowCustomizedBuiltInElements=_.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),so&&($i=!1),$s&&(lo=!0),co&&(Fe=ye({},Q_),Ue=[],co.html===!0&&(ye(Fe,Y_),ye(Ue,X_)),co.svg===!0&&(ye(Fe,Km),ye(Ue,eh),ye(Ue,Pc)),co.svgFilters===!0&&(ye(Fe,Zm),ye(Ue,eh),ye(Ue,Pc)),co.mathMl===!0&&(ye(Fe,Jm),ye(Ue,K_),ye(Ue,Pc))),_.ADD_TAGS&&(typeof _.ADD_TAGS=="function"?en.tagCheck=_.ADD_TAGS:(Fe===Rt&&(Fe=di(Fe)),ye(Fe,_.ADD_TAGS,yt))),_.ADD_ATTR&&(typeof _.ADD_ATTR=="function"?en.attributeCheck=_.ADD_ATTR:(Ue===$e&&(Ue=di(Ue)),ye(Ue,_.ADD_ATTR,yt))),_.ADD_URI_SAFE_ATTR&&ye(Gd,_.ADD_URI_SAFE_ATTR,yt),_.FORBID_CONTENTS&&(Yn===qd&&(Yn=di(Yn)),ye(Yn,_.FORBID_CONTENTS,yt)),_.ADD_FORBID_CONTENTS&&(Yn===qd&&(Yn=di(Yn)),ye(Yn,_.ADD_FORBID_CONTENTS,yt)),Wd&&(Fe["#text"]=!0),_r&&ye(Fe,["html","head","body"]),Fe.table&&(ye(Fe,["tbody"]),delete fr.tbody),_.TRUSTED_TYPES_POLICY){if(typeof _.TRUSTED_TYPES_POLICY.createHTML!="function")throw bs('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof _.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw bs('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');xe=_.TRUSTED_TYPES_POLICY,Jt=xe.createHTML("")}else xe===void 0&&(xe=kw(T,r)),xe!==null&&typeof Jt=="string"&&(Jt=xe.createHTML(""));Qt&&Qt(_),mo=_}},qh=ye({},[...Km,...Zm,...pw]),Gh=ye({},[...Jm,...gw]),d0=function(_){let D=Ve(_);(!D||!D.tagName)&&(D={namespaceURI:uo,tagName:"template"});let Q=Ac(_.tagName),Ze=Ac(D.tagName);return Qd[_.namespaceURI]?_.namespaceURI===Gs?D.namespaceURI===bi?Q==="svg":D.namespaceURI===qs?Q==="svg"&&(Ze==="annotation-xml"||Ys[Ze]):!!qh[Q]:_.namespaceURI===qs?D.namespaceURI===bi?Q==="math":D.namespaceURI===Gs?Q==="math"&&Qs[Ze]:!!Gh[Q]:_.namespaceURI===bi?D.namespaceURI===Gs&&!Qs[Ze]||D.namespaceURI===qs&&!Ys[Ze]?!1:!Gh[Q]&&(a0[Q]||!qh[Q]):!!(Ma==="application/xhtml+xml"&&Qd[_.namespaceURI]):!1},Qn=function(_){fs(t.removed,{element:_});try{Ve(_).removeChild(_)}catch{ge(_)}},br=function(_,D){try{fs(t.removed,{attribute:D.getAttributeNode(_),from:D})}catch{fs(t.removed,{attribute:null,from:D})}if(D.removeAttribute(_),_==="is")if(lo||$s)try{Qn(D)}catch{}else try{D.setAttribute(_,"")}catch{}},Yh=function(_){let D=null,Q=null;if($d)_="<remove></remove>"+_;else{let _t=Xm(_,/^[\r\n\t ]+/);Q=_t&&_t[0]}Ma==="application/xhtml+xml"&&uo===bi&&(_='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+_+"</body></html>");let Ze=xe?xe.createHTML(_):_;if(uo===bi)try{D=new E().parseFromString(Ze,Ma)}catch{}if(!D||!D.documentElement){D=wt.createDocument(uo,"template",null);try{D.documentElement.innerHTML=Yd?Jt:Ze}catch{}}let Ft=D.body||D.documentElement;return _&&Q&&Ft.insertBefore(e.createTextNode(Q),Ft.childNodes[0]||null),uo===bi?_i.call(D,_r?"html":"body")[0]:_r?D.documentElement:Ft},Qh=function(_){return st.call(_.ownerDocument||_,_,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},Kd=function(_){return _ instanceof v&&(typeof _.nodeName!="string"||typeof _.textContent!="string"||typeof _.removeChild!="function"||!(_.attributes instanceof f)||typeof _.removeAttribute!="function"||typeof _.setAttribute!="function"||typeof _.namespaceURI!="string"||typeof _.insertBefore!="function"||typeof _.hasChildNodes!="function")},Xh=function(_){return typeof s=="function"&&_ instanceof s};function vi(te,_,D){Oc(te,Q=>{Q.call(t,_,D,mo)})}let Kh=function(_){let D=null;if(vi(St.beforeSanitizeElements,_,null),Kd(_))return Qn(_),!0;let Q=yt(_.nodeName);if(vi(St.uponSanitizeElement,_,{tagName:Q,allowedTags:Fe}),Us&&_.hasChildNodes()&&!Xh(_.firstElementChild)&&Yt(/<[/\w!]/g,_.innerHTML)&&Yt(/<[/\w!]/g,_.textContent)||_.nodeType===ys.progressingInstruction||Us&&_.nodeType===ys.comment&&Yt(/<[/\w]/g,_.data))return Qn(_),!0;if(!(en.tagCheck instanceof Function&&en.tagCheck(Q))&&(!Fe[Q]||fr[Q])){if(!fr[Q]&&Jh(Q)&&(Ke.tagNameCheck instanceof RegExp&&Yt(Ke.tagNameCheck,Q)||Ke.tagNameCheck instanceof Function&&Ke.tagNameCheck(Q)))return!1;if(Wd&&!Yn[Q]){let Ze=Ve(_)||_.parentNode,Ft=Ye(_)||_.childNodes;if(Ft&&Ze){let _t=Ft.length;for(let tn=_t-1;tn>=0;--tn){let yi=V(Ft[tn],!0);yi.__removalCount=(_.__removalCount||0)+1,Ze.insertBefore(yi,Re(_))}}}return Qn(_),!0}return _ instanceof d&&!d0(_)||(Q==="noscript"||Q==="noembed"||Q==="noframes")&&Yt(/<\/no(script|embed|frames)/i,_.innerHTML)?(Qn(_),!0):(so&&_.nodeType===ys.text&&(D=_.textContent,Oc([Dn,gr,oo],Ze=>{D=_s(D,Ze," ")}),_.textContent!==D&&(fs(t.removed,{element:_.cloneNode()}),_.textContent=D)),vi(St.afterSanitizeElements,_,null),!1)},Zh=function(_,D,Q){if(zh&&(D==="id"||D==="name")&&(Q in e||Q in c0))return!1;if(!($i&&!ft[D]&&Yt(Hs,D))){if(!(Ut&&Yt(W,D))){if(!(en.attributeCheck instanceof Function&&en.attributeCheck(D,_))){if(!Ue[D]||ft[D]){if(!(Jh(_)&&(Ke.tagNameCheck instanceof RegExp&&Yt(Ke.tagNameCheck,_)||Ke.tagNameCheck instanceof Function&&Ke.tagNameCheck(_))&&(Ke.attributeNameCheck instanceof RegExp&&Yt(Ke.attributeNameCheck,D)||Ke.attributeNameCheck instanceof Function&&Ke.attributeNameCheck(D,_))||D==="is"&&Ke.allowCustomizedBuiltInElements&&(Ke.tagNameCheck instanceof RegExp&&Yt(Ke.tagNameCheck,Q)||Ke.tagNameCheck instanceof Function&&Ke.tagNameCheck(Q))))return!1}else if(!Gd[D]){if(!Yt(ht,_s(Q,oe,""))){if(!((D==="src"||D==="xlink:href"||D==="href")&&_!=="script"&&dw(Q,"data:")===0&&Hh[_])){if(!(ao&&!Yt(ee,_s(Q,oe,"")))){if(Q)return!1}}}}}}}return!0},Jh=function(_){return _!=="annotation-xml"&&Xm(_,Se)},ep=function(_){vi(St.beforeSanitizeAttributes,_,null);let{attributes:D}=_;if(!D||Kd(_))return;let Q={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ue,forceKeepAttr:void 0},Ze=D.length;for(;Ze--;){let Ft=D[Ze],{name:_t,namespaceURI:tn,value:yi}=Ft,ho=yt(_t),Zd=yi,Pt=_t==="value"?Zd:uw(Zd);if(Q.attrName=ho,Q.attrValue=Pt,Q.keepAttr=!0,Q.forceKeepAttr=void 0,vi(St.uponSanitizeAttribute,_,Q),Pt=Q.attrValue,Bh&&(ho==="id"||ho==="name")&&(br(_t,_),Pt=r0+Pt),Us&&Yt(/((--!?|])>)|<\/(style|title|textarea)/i,Pt)){br(_t,_);continue}if(ho==="attributename"&&Xm(Pt,"href")){br(_t,_);continue}if(Q.forceKeepAttr)continue;if(!Q.keepAttr){br(_t,_);continue}if(!jh&&Yt(/\/>/i,Pt)){br(_t,_);continue}so&&Oc([Dn,gr,oo],np=>{Pt=_s(Pt,np," ")});let tp=yt(_.nodeName);if(!Zh(tp,ho,Pt)){br(_t,_);continue}if(xe&&typeof T=="object"&&typeof T.getAttributeType=="function"&&!tn)switch(T.getAttributeType(tp,ho)){case"TrustedHTML":{Pt=xe.createHTML(Pt);break}case"TrustedScriptURL":{Pt=xe.createScriptURL(Pt);break}}if(Pt!==Zd)try{tn?_.setAttributeNS(tn,_t,Pt):_.setAttribute(_t,Pt),Kd(_)?Qn(_):G_(t.removed)}catch{br(_t,_)}}vi(St.afterSanitizeAttributes,_,null)},u0=function te(_){let D=null,Q=Qh(_);for(vi(St.beforeSanitizeShadowDOM,_,null);D=Q.nextNode();)vi(St.uponSanitizeShadowNode,D,null),Kh(D),ep(D),D.content instanceof o&&te(D.content);vi(St.afterSanitizeShadowDOM,_,null)};return t.sanitize=function(te){let _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},D=null,Q=null,Ze=null,Ft=null;if(Yd=!te,Yd&&(te="<!-->"),typeof te!="string"&&!Xh(te))if(typeof te.toString=="function"){if(te=te.toString(),typeof te!="string")throw bs("dirty is not a string, aborting")}else throw bs("toString is not a function");if(!t.isSupported)return te;if(Ud||Xd(_),t.removed=[],typeof te=="string"&&(ka=!1),ka){if(te.nodeName){let yi=yt(te.nodeName);if(!Fe[yi]||fr[yi])throw bs("root node is forbidden and cannot be sanitized in-place")}}else if(te instanceof s)D=Yh("<!---->"),Q=D.ownerDocument.importNode(te,!0),Q.nodeType===ys.element&&Q.nodeName==="BODY"||Q.nodeName==="HTML"?D=Q:D.appendChild(Q);else{if(!lo&&!so&&!_r&&te.indexOf("<")===-1)return xe&&Ws?xe.createHTML(te):te;if(D=Yh(te),!D)return lo?null:Ws?Jt:""}D&&$d&&Qn(D.firstChild);let _t=Qh(ka?te:D);for(;Ze=_t.nextNode();)Kh(Ze),ep(Ze),Ze.content instanceof o&&u0(Ze.content);if(ka)return te;if(lo){if($s)for(Ft=It.call(D.ownerDocument);D.firstChild;)Ft.appendChild(D.firstChild);else Ft=D;return(Ue.shadowroot||Ue.shadowrootmode)&&(Ft=Ui.call(n,Ft,!0)),Ft}let tn=_r?D.outerHTML:D.innerHTML;return _r&&Fe["!doctype"]&&D.ownerDocument&&D.ownerDocument.doctype&&D.ownerDocument.doctype.name&&Yt(nb,D.ownerDocument.doctype.name)&&(tn="<!DOCTYPE "+D.ownerDocument.doctype.name+`>
|
|
67
|
-
`+tn),so&&Oc([Dn,gr,oo],yi=>{tn=_s(tn,yi," ")}),xe&&Ws?xe.createHTML(tn):tn},t.setConfig=function(){let te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Xd(te),Ud=!0},t.clearConfig=function(){mo=null,Ud=!1},t.isValidAttribute=function(te,_,D){mo||Xd({});let Q=yt(te),Ze=yt(_);return Zh(Q,Ze,D)},t.addHook=function(te,_){typeof _=="function"&&fs(St[te],_)},t.removeHook=function(te,_){if(_!==void 0){let D=lw(St[te],_);return D===-1?void 0:cw(St[te],D,1)[0]}return G_(St[te])},t.removeHooks=function(te){St[te]=[]},t.removeAllHooks=function(){St=J_()},t}var rb=ib();var ui=class i{renderer;constructor(){this.renderer=new Go,this.configureRenderer()}configureRenderer(){let t=this.renderer.link.bind(this.renderer);this.renderer.link=e=>{let n=this.isExternalLink(e.href),r=t(e);if(n){r=r.replace("<a ",'<a target="_blank" rel="noopener noreferrer" ');let o=e.title?`${e.text} - ${e.title} (opens in new tab)`:`${e.text} (opens in new tab)`;r=r.replace("<a ",`<a aria-label="${this.escapeHtml(o)}" `),r=r.replace("</a>",'<span class="external-link-icon" aria-hidden="true">\u2197</span></a>')}return r}}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,n=>e[n]||n)}parse(t){return re(this,null,function*(){let e=yield Ie.parse(t,{renderer:this.renderer,breaks:!0,gfm:!0});return rb.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||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})};var Mw=["buttonContainer"],Ew=(i,t)=>t.value;function Tw(i,t){i&1&&(l(0,"mat-icon",8),h(1,"keyboard_return"),c())}function Ow(i,t){if(i&1){let e=A();l(0,"button",6),b("click",function(){let r=y(e).$implicit,o=g(2);return C(o.onOptionClick(r.value))}),l(1,"span",7),h(2),c(),w(3,Tw,2,0,"mat-icon",8),c()}if(i&2){let e=t.$implicit,n=t.$index,r=g(2);R("highlighted",n===r.highlightedIndex),x("disabled",e.disabled)("id","choice-option-"+n),K("aria-selected",n===r.highlightedIndex),m(2),U(e.label),m(),S(n===r.highlightedIndex?3:-1)}}function Pw(i,t){if(i&1&&(l(0,"div",5)(1,"mat-icon"),h(2,"search"),c(),l(3,"span"),h(4),c()()),i&2){let e=g(2);m(4),U(e.searchText)}}function Aw(i,t){if(i&1){let e=A();l(0,"div",1),F(1,"div",2),Sr(2,"async"),l(3,"div",3,0),b("keydown",function(r){y(e);let o=g();return C(o.onKeyDown(r))}),Le(5,Ow,4,7,"button",4,Ew),c(),w(7,Pw,5,1,"div",5),c()}if(i&2){let e=g();m(),x("innerHTML",Ap(2,3,e.renderedLabel$),un),m(2),K("aria-activedescendant","choice-option-"+e.highlightedIndex),m(2),je(e.options),m(2),S(e.searchText?7:-1)}}var Yo=class i{options=[];set labelHtml(t){typeof t=="object"?this.renderedLabelSubject.next(t):this.renderLabelMarkdown(t)}isVisible=!1;choiceSelected=new H;buttonContainer;highlightedIndex=0;searchText="";searchTimeout;destroy$=new I;renderedLabelSubject=new Z("");renderedLabel$=this.renderedLabelSubject.asObservable();sanitizer=u(ti);markdownService=u(ui);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&&(console.log("[CHOICE-SELECT] isVisible changed:",t.isVisible.previousValue,"->",t.isVisible.currentValue),t.isVisible.currentValue&&!t.isVisible.previousValue&&(console.log("[CHOICE-SELECT] Component becoming visible, setting focus..."),this.highlightedIndex=0,setTimeout(()=>this.focusContainer(),150))),t.options&&!t.options.firstChange&&(this.highlightedIndex=0)}focusContainer(){this.buttonContainer?.nativeElement&&(this.buttonContainer.nativeElement.focus(),console.log("[CHOICE-SELECT] Focus set on button container"))}onKeyDown(t){if(this.options.filter(n=>!n.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((o,a)=>({opt:o,idx:a})).filter(({opt:o})=>!o.disabled).map(({idx:o})=>o);if(e.length===0)return;let r=e.findIndex(o=>o===this.highlightedIndex)+t;if(r>=0&&r<e.length){let o=e[r];o!==void 0&&(this.highlightedIndex=o,this.scrollToHighlighted())}else if(t===1&&r>=e.length){let o=e[0];o!==void 0&&(this.highlightedIndex=o,this.scrollToHighlighted())}else if(t===-1&&r<0){let o=e[e.length-1];o!==void 0&&(this.highlightedIndex=o,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,n)=>({opt:e,idx:n})).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(n=>!n.disabled&&n.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){console.log("[CHOICE-SELECT] Choice selected:",t),this.choiceSelected.emit(t)}renderLabelMarkdown(t){return re(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||i)};static \u0275cmp=P({type:i,selectors:[["app-choice-select"]],viewQuery:function(e,n){if(e&1&&se(Mw,5),e&2){let r;G(r=Y())&&(n.buttonContainer=r.first)}},inputs:{options:"options",labelHtml:"labelHtml",isVisible:"isVisible"},outputs:{choiceSelected:"choiceSelected"},features:[Ne],decls:1,vars:1,consts:[["buttonContainer",""],[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,"search-indicator"],["type","button","role","option",1,"choice-button",3,"click","disabled","id"],[1,"choice-button-label"],[1,"choice-button-icon"]],template:function(e,n){e&1&&w(0,Aw,8,5,"div",1),e&2&&S(n.isVisible?0:-1)},dependencies:[it,Ee,Hp],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}.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 Qo=class i{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||i)};static \u0275cmp=P({type:i,selectors:[["app-welcome-message"]],decls:2,vars:1,consts:[[1,"welcome-title"]],template:function(e,n){e&1&&(wn(0,"h1",0),h(1),Sn()),e&2&&(m(),U(n.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 hb=(()=>{class i{_renderer;_elementRef;onChange=e=>{};onTouched=()=>{};constructor(e,n){this._renderer=e,this._elementRef=n}setProperty(e,n){this._renderer.setProperty(this._elementRef.nativeElement,e,n)}registerOnTouched(e){this.onTouched=e}registerOnChange(e){this.onChange=e}setDisabledState(e){this.setProperty("disabled",e)}static \u0275fac=function(n){return new(n||i)(De(et),De(ae))};static \u0275dir=ne({type:i})}return i})(),qr=(()=>{class i extends hb{static \u0275fac=(()=>{let e;return function(r){return(e||(e=We(i)))(r||i)}})();static \u0275dir=ne({type:i,features:[ke]})}return i})(),ln=new q(""),Dw={provide:ln,useExisting:dt(()=>ah),multi:!0},ah=(()=>{class i extends qr{writeValue(e){this.setProperty("checked",e)}static \u0275fac=(()=>{let e;return function(r){return(e||(e=We(i)))(r||i)}})();static \u0275dir=ne({type:i,selectors:[["input","type","checkbox","formControlName",""],["input","type","checkbox","formControl",""],["input","type","checkbox","ngModel",""]],hostBindings:function(n,r){n&1&&b("change",function(a){return r.onChange(a.target.checked)})("blur",function(){return r.onTouched()})},standalone:!1,features:[Ce([Dw]),ke]})}return i})(),Iw={provide:ln,useExisting:dt(()=>Ge),multi:!0};function Rw(){let i=hu()?hu().getUserAgent():"";return/android (\d+)/.test(i.toLowerCase())}var Fw=new q(""),Ge=(()=>{class i extends hb{_compositionMode;_composing=!1;constructor(e,n,r){super(e,n),this._compositionMode=r,this._compositionMode==null&&(this._compositionMode=!Rw())}writeValue(e){let n=e??"";this.setProperty("value",n)}_handleInput(e){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}_compositionStart(){this._composing=!0}_compositionEnd(e){this._composing=!1,this._compositionMode&&this.onChange(e)}static \u0275fac=function(n){return new(n||i)(De(et),De(ae),De(Fw,8))};static \u0275dir=ne({type:i,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(n,r){n&1&&b("input",function(a){return r._handleInput(a.target.value)})("blur",function(){return r.onTouched()})("compositionstart",function(){return r._compositionStart()})("compositionend",function(a){return r._compositionEnd(a.target.value)})},standalone:!1,features:[Ce([Iw]),ke]})}return i})();function sh(i){return i==null||lh(i)===0}function lh(i){return i==null?null:Array.isArray(i)||typeof i=="string"?i.length:i instanceof Set?i.size:null}var qn=new q(""),ch=new q(""),Nw=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[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])?)*$/,Zo=class{static min(t){return pb(t)}static max(t){return gb(t)}static required(t){return fb(t)}static requiredTrue(t){return Vw(t)}static email(t){return Lw(t)}static minLength(t){return jw(t)}static maxLength(t){return _b(t)}static pattern(t){return zw(t)}static nullValidator(t){return Ic()}static compose(t){return wb(t)}static composeAsync(t){return Sb(t)}};function pb(i){return t=>{if(t.value==null||i==null)return null;let e=parseFloat(t.value);return!isNaN(e)&&e<i?{min:{min:i,actual:t.value}}:null}}function gb(i){return t=>{if(t.value==null||i==null)return null;let e=parseFloat(t.value);return!isNaN(e)&&e>i?{max:{max:i,actual:t.value}}:null}}function fb(i){return sh(i.value)?{required:!0}:null}function Vw(i){return i.value===!0?null:{required:!0}}function Lw(i){return sh(i.value)||Nw.test(i.value)?null:{email:!0}}function jw(i){return t=>{let e=t.value?.length??lh(t.value);return e===null||e===0?null:e<i?{minlength:{requiredLength:i,actualLength:e}}:null}}function _b(i){return t=>{let e=t.value?.length??lh(t.value);return e!==null&&e>i?{maxlength:{requiredLength:i,actualLength:e}}:null}}function zw(i){if(!i)return Ic;let t,e;return typeof i=="string"?(e="",i.charAt(0)!=="^"&&(e+="^"),e+=i,i.charAt(i.length-1)!=="$"&&(e+="$"),t=new RegExp(e)):(e=i.toString(),t=i),n=>{if(sh(n.value))return null;let r=n.value;return t.test(r)?null:{pattern:{requiredPattern:e,actualValue:r}}}}function Ic(i){return null}function bb(i){return i!=null}function vb(i){return nl(i)?Nt(i):i}function yb(i){let t={};return i.forEach(e=>{t=e!=null?M(M({},t),e):t}),Object.keys(t).length===0?null:t}function Cb(i,t){return t.map(e=>e(i))}function Bw(i){return!i.validate}function xb(i){return i.map(t=>Bw(t)?t:e=>t.validate(e))}function wb(i){if(!i)return null;let t=i.filter(bb);return t.length==0?null:function(e){return yb(Cb(e,t))}}function dh(i){return i!=null?wb(xb(i)):null}function Sb(i){if(!i)return null;let t=i.filter(bb);return t.length==0?null:function(e){let n=Cb(e,t).map(vb);return cp(n).pipe(X(yb))}}function uh(i){return i!=null?Sb(xb(i)):null}function ob(i,t){return i===null?[t]:Array.isArray(i)?[...i,t]:[i,t]}function kb(i){return i._rawValidators}function Mb(i){return i._rawAsyncValidators}function rh(i){return i?Array.isArray(i)?i:[i]:[]}function Rc(i,t){return Array.isArray(i)?i.includes(t):i===t}function ab(i,t){let e=rh(t);return rh(i).forEach(r=>{Rc(e,r)||e.push(r)}),e}function sb(i,t){return rh(t).filter(e=>!Rc(i,e))}var Fc=class{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=dh(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=uh(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t=void 0){this.control&&this.control.reset(t)}hasError(t,e){return this.control?this.control.hasError(t,e):!1}getError(t,e){return this.control?this.control.getError(t,e):null}},Wr=class extends Fc{name;get formDirective(){return null}get path(){return null}},mi=class extends Fc{_parent=null;name=null;valueAccessor=null},oh=class{_cd;constructor(t){this._cd=t}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}},Hw={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},JI=be(M({},Hw),{"[class.ng-submitted]":"isSubmitted"}),rt=(()=>{class i extends oh{constructor(e){super(e)}static \u0275fac=function(n){return new(n||i)(De(mi,2))};static \u0275dir=ne({type:i,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(n,r){n&2&&R("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending)},standalone:!1,features:[ke]})}return i})();var Cs="VALID",Dc="INVALID",Xo="PENDING",xs="DISABLED",dr=class{},Nc=class extends dr{value;source;constructor(t,e){super(),this.value=t,this.source=e}},Ss=class extends dr{pristine;source;constructor(t,e){super(),this.pristine=t,this.source=e}},ks=class extends dr{touched;source;constructor(t,e){super(),this.touched=t,this.source=e}},Ko=class extends dr{status;source;constructor(t,e){super(),this.status=t,this.source=e}},Vc=class extends dr{source;constructor(t){super(),this.source=t}},Lc=class extends dr{source;constructor(t){super(),this.source=t}};function Eb(i){return($c(i)?i.validators:i)||null}function Uw(i){return Array.isArray(i)?dh(i):i||null}function Tb(i,t){return($c(t)?t.asyncValidators:i)||null}function $w(i){return Array.isArray(i)?uh(i):i||null}function $c(i){return i!=null&&!Array.isArray(i)&&typeof i=="object"}function Ww(i,t,e){let n=i.controls;if(!(t?Object.keys(n):n).length)throw new J(1e3,"");if(!n[e])throw new J(1001,"")}function qw(i,t,e){i._forEachChild((n,r)=>{if(e[r]===void 0)throw new J(1002,"")})}var jc=class{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(t,e){this._assignValidators(t),this._assignAsyncValidators(e)}get validator(){return this._composedValidatorFn}set validator(t){this._rawValidators=this._composedValidatorFn=t}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(t){this._rawAsyncValidators=this._composedAsyncValidatorFn=t}get parent(){return this._parent}get status(){return Mt(this.statusReactive)}set status(t){Mt(()=>this.statusReactive.set(t))}_status=Ct(()=>this.statusReactive());statusReactive=Me(void 0);get valid(){return this.status===Cs}get invalid(){return this.status===Dc}get pending(){return this.status==Xo}get disabled(){return this.status===xs}get enabled(){return this.status!==xs}errors;get pristine(){return Mt(this.pristineReactive)}set pristine(t){Mt(()=>this.pristineReactive.set(t))}_pristine=Ct(()=>this.pristineReactive());pristineReactive=Me(!0);get dirty(){return!this.pristine}get touched(){return Mt(this.touchedReactive)}set touched(t){Mt(()=>this.touchedReactive.set(t))}_touched=Ct(()=>this.touchedReactive());touchedReactive=Me(!1);get untouched(){return!this.touched}_events=new I;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(t){this._assignValidators(t)}setAsyncValidators(t){this._assignAsyncValidators(t)}addValidators(t){this.setValidators(ab(t,this._rawValidators))}addAsyncValidators(t){this.setAsyncValidators(ab(t,this._rawAsyncValidators))}removeValidators(t){this.setValidators(sb(t,this._rawValidators))}removeAsyncValidators(t){this.setAsyncValidators(sb(t,this._rawAsyncValidators))}hasValidator(t){return Rc(this._rawValidators,t)}hasAsyncValidator(t){return Rc(this._rawAsyncValidators,t)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(t={}){let e=this.touched===!1;this.touched=!0;let n=t.sourceControl??this;this._parent&&!t.onlySelf&&this._parent.markAsTouched(be(M({},t),{sourceControl:n})),e&&t.emitEvent!==!1&&this._events.next(new ks(!0,n))}markAllAsDirty(t={}){this.markAsDirty({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsDirty(t))}markAllAsTouched(t={}){this.markAsTouched({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsTouched(t))}markAsUntouched(t={}){let e=this.touched===!0;this.touched=!1,this._pendingTouched=!1;let n=t.sourceControl??this;this._forEachChild(r=>{r.markAsUntouched({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:n})}),this._parent&&!t.onlySelf&&this._parent._updateTouched(t,n),e&&t.emitEvent!==!1&&this._events.next(new ks(!1,n))}markAsDirty(t={}){let e=this.pristine===!0;this.pristine=!1;let n=t.sourceControl??this;this._parent&&!t.onlySelf&&this._parent.markAsDirty(be(M({},t),{sourceControl:n})),e&&t.emitEvent!==!1&&this._events.next(new Ss(!1,n))}markAsPristine(t={}){let e=this.pristine===!1;this.pristine=!0,this._pendingDirty=!1;let n=t.sourceControl??this;this._forEachChild(r=>{r.markAsPristine({onlySelf:!0,emitEvent:t.emitEvent})}),this._parent&&!t.onlySelf&&this._parent._updatePristine(t,n),e&&t.emitEvent!==!1&&this._events.next(new Ss(!0,n))}markAsPending(t={}){this.status=Xo;let e=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new Ko(this.status,e)),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.markAsPending(be(M({},t),{sourceControl:e}))}disable(t={}){let e=this._parentMarkedDirty(t.onlySelf);this.status=xs,this.errors=null,this._forEachChild(r=>{r.disable(be(M({},t),{onlySelf:!0}))}),this._updateValue();let n=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new Nc(this.value,n)),this._events.next(new Ko(this.status,n)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(be(M({},t),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(r=>r(!0))}enable(t={}){let e=this._parentMarkedDirty(t.onlySelf);this.status=Cs,this._forEachChild(n=>{n.enable(be(M({},t),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors(be(M({},t),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(n=>n(!1))}_updateAncestors(t,e){this._parent&&!t.onlySelf&&(this._parent.updateValueAndValidity(t),t.skipPristineCheck||this._parent._updatePristine({},e),this._parent._updateTouched({},e))}setParent(t){this._parent=t}getRawValue(){return this.value}updateValueAndValidity(t={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){let n=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===Cs||this.status===Xo)&&this._runAsyncValidator(n,t.emitEvent)}let e=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new Nc(this.value,e)),this._events.next(new Ko(this.status,e)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.updateValueAndValidity(be(M({},t),{sourceControl:e}))}_updateTreeValidity(t={emitEvent:!0}){this._forEachChild(e=>e._updateTreeValidity(t)),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?xs:Cs}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t,e){if(this.asyncValidator){this.status=Xo,this._hasOwnPendingAsyncValidator={emitEvent:e!==!1,shouldHaveEmitted:t!==!1};let n=vb(this.asyncValidator(this));this._asyncValidationSubscription=n.subscribe(r=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(r,{emitEvent:e,shouldHaveEmitted:t})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();let t=(this._hasOwnPendingAsyncValidator?.emitEvent||this._hasOwnPendingAsyncValidator?.shouldHaveEmitted)??!1;return this._hasOwnPendingAsyncValidator=null,t}return!1}setErrors(t,e={}){this.errors=t,this._updateControlsErrors(e.emitEvent!==!1,this,e.shouldHaveEmitted)}get(t){let e=t;return e==null||(Array.isArray(e)||(e=e.split(".")),e.length===0)?null:e.reduce((n,r)=>n&&n._find(r),this)}getError(t,e){let n=e?this.get(e):this;return n&&n.errors?n.errors[t]:null}hasError(t,e){return!!this.getError(t,e)}get root(){let t=this;for(;t._parent;)t=t._parent;return t}_updateControlsErrors(t,e,n){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),(t||n)&&this._events.next(new Ko(this.status,e)),this._parent&&this._parent._updateControlsErrors(t,e,n)}_initObservables(){this.valueChanges=new H,this.statusChanges=new H}_calculateStatus(){return this._allControlsDisabled()?xs:this.errors?Dc:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(Xo)?Xo:this._anyControlsHaveStatus(Dc)?Dc:Cs}_anyControlsHaveStatus(t){return this._anyControls(e=>e.status===t)}_anyControlsDirty(){return this._anyControls(t=>t.dirty)}_anyControlsTouched(){return this._anyControls(t=>t.touched)}_updatePristine(t,e){let n=!this._anyControlsDirty(),r=this.pristine!==n;this.pristine=n,this._parent&&!t.onlySelf&&this._parent._updatePristine(t,e),r&&this._events.next(new Ss(this.pristine,e))}_updateTouched(t={},e){this.touched=this._anyControlsTouched(),this._events.next(new ks(this.touched,e)),this._parent&&!t.onlySelf&&this._parent._updateTouched(t,e)}_onDisabledChange=[];_registerOnCollectionChange(t){this._onCollectionChange=t}_setUpdateStrategy(t){$c(t)&&t.updateOn!=null&&(this._updateOn=t.updateOn)}_parentMarkedDirty(t){let e=this._parent&&this._parent.dirty;return!t&&!!e&&!this._parent._anyControlsDirty()}_find(t){return null}_assignValidators(t){this._rawValidators=Array.isArray(t)?t.slice():t,this._composedValidatorFn=Uw(this._rawValidators)}_assignAsyncValidators(t){this._rawAsyncValidators=Array.isArray(t)?t.slice():t,this._composedAsyncValidatorFn=$w(this._rawAsyncValidators)}},zc=class extends jc{constructor(t,e,n){super(Eb(e),Tb(n,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;registerControl(t,e){return this.controls[t]?this.controls[t]:(this.controls[t]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)}addControl(t,e,n={}){this.registerControl(t,e),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}removeControl(t,e={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}setControl(t,e,n={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],e&&this.registerControl(t,e),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}contains(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled}setValue(t,e={}){qw(this,!0,t),Object.keys(t).forEach(n=>{Ww(this,!0,n),this.controls[n].setValue(t[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){t!=null&&(Object.keys(t).forEach(n=>{let r=this.controls[n];r&&r.patchValue(t[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(t={},e={}){this._forEachChild((n,r)=>{n.reset(t?t[r]:null,{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e,this),this._updateTouched(e,this),this.updateValueAndValidity(e),e?.emitEvent!==!1&&this._events.next(new Lc(this))}getRawValue(){return this._reduceChildren({},(t,e,n)=>(t[n]=e.getRawValue(),t))}_syncPendingControls(){let t=this._reduceChildren(!1,(e,n)=>n._syncPendingControls()?!0:e);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_forEachChild(t){Object.keys(this.controls).forEach(e=>{let n=this.controls[e];n&&t(n,e)})}_setUpControls(){this._forEachChild(t=>{t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(t){for(let[e,n]of Object.entries(this.controls))if(this.contains(e)&&t(n))return!0;return!1}_reduceValue(){let t={};return this._reduceChildren(t,(e,n,r)=>((n.enabled||this.disabled)&&(e[r]=n.value),e))}_reduceChildren(t,e){let n=t;return this._forEachChild((r,o)=>{n=e(n,r,o)}),n}_allControlsDisabled(){for(let t of Object.keys(this.controls))if(this.controls[t].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(t){return this.controls.hasOwnProperty(t)?this.controls[t]:null}};var Ms=new q("",{providedIn:"root",factory:()=>Wc}),Wc="always";function Gw(i,t){return[...t.path,i]}function Bc(i,t,e=Wc){mh(i,t),t.valueAccessor.writeValue(i.value),(i.disabled||e==="always")&&t.valueAccessor.setDisabledState?.(i.disabled),Qw(i,t),Kw(i,t),Xw(i,t),Yw(i,t)}function lb(i,t,e=!0){let n=()=>{};t.valueAccessor&&(t.valueAccessor.registerOnChange(n),t.valueAccessor.registerOnTouched(n)),Uc(i,t),i&&(t._invokeOnDestroyCallbacks(),i._registerOnCollectionChange(()=>{}))}function Hc(i,t){i.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(t)})}function Yw(i,t){if(t.valueAccessor.setDisabledState){let e=n=>{t.valueAccessor.setDisabledState(n)};i.registerOnDisabledChange(e),t._registerOnDestroy(()=>{i._unregisterOnDisabledChange(e)})}}function mh(i,t){let e=kb(i);t.validator!==null?i.setValidators(ob(e,t.validator)):typeof e=="function"&&i.setValidators([e]);let n=Mb(i);t.asyncValidator!==null?i.setAsyncValidators(ob(n,t.asyncValidator)):typeof n=="function"&&i.setAsyncValidators([n]);let r=()=>i.updateValueAndValidity();Hc(t._rawValidators,r),Hc(t._rawAsyncValidators,r)}function Uc(i,t){let e=!1;if(i!==null){if(t.validator!==null){let r=kb(i);if(Array.isArray(r)&&r.length>0){let o=r.filter(a=>a!==t.validator);o.length!==r.length&&(e=!0,i.setValidators(o))}}if(t.asyncValidator!==null){let r=Mb(i);if(Array.isArray(r)&&r.length>0){let o=r.filter(a=>a!==t.asyncValidator);o.length!==r.length&&(e=!0,i.setAsyncValidators(o))}}}let n=()=>{};return Hc(t._rawValidators,n),Hc(t._rawAsyncValidators,n),e}function Qw(i,t){t.valueAccessor.registerOnChange(e=>{i._pendingValue=e,i._pendingChange=!0,i._pendingDirty=!0,i.updateOn==="change"&&Ob(i,t)})}function Xw(i,t){t.valueAccessor.registerOnTouched(()=>{i._pendingTouched=!0,i.updateOn==="blur"&&i._pendingChange&&Ob(i,t),i.updateOn!=="submit"&&i.markAsTouched()})}function Ob(i,t){i._pendingDirty&&i.markAsDirty(),i.setValue(i._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(i._pendingValue),i._pendingChange=!1}function Kw(i,t){let e=(n,r)=>{t.valueAccessor.writeValue(n),r&&t.viewToModelUpdate(n)};i.registerOnChange(e),t._registerOnDestroy(()=>{i._unregisterOnChange(e)})}function Pb(i,t){i==null,mh(i,t)}function Zw(i,t){return Uc(i,t)}function Jw(i,t){if(!i.hasOwnProperty("model"))return!1;let e=i.model;return e.isFirstChange()?!0:!Object.is(t,e.currentValue)}function eS(i){return Object.getPrototypeOf(i.constructor)===qr}function Ab(i,t){i._syncPendingControls(),t.forEach(e=>{let n=e.control;n.updateOn==="submit"&&n._pendingChange&&(e.viewToModelUpdate(n._pendingValue),n._pendingChange=!1)})}function tS(i,t){if(!t)return null;Array.isArray(t);let e,n,r;return t.forEach(o=>{o.constructor===Ge?e=o:eS(o)?n=o:r=o}),r||n||e||null}function nS(i,t){let e=i.indexOf(t);e>-1&&i.splice(e,1)}var iS={provide:Wr,useExisting:dt(()=>Es)},ws=Promise.resolve(),Es=(()=>{class i extends Wr{callSetDisabledState;get submitted(){return Mt(this.submittedReactive)}_submitted=Ct(()=>this.submittedReactive());submittedReactive=Me(!1);_directives=new Set;form;ngSubmit=new H;options;constructor(e,n,r){super(),this.callSetDisabledState=r,this.form=new zc({},dh(e),uh(n))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(e){ws.then(()=>{let n=this._findContainer(e.path);e.control=n.registerControl(e.name,e.control),Bc(e.control,e,this.callSetDisabledState),e.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(e)})}getControl(e){return this.form.get(e.path)}removeControl(e){ws.then(()=>{let n=this._findContainer(e.path);n&&n.removeControl(e.name),this._directives.delete(e)})}addFormGroup(e){ws.then(()=>{let n=this._findContainer(e.path),r=new zc({});Pb(r,e),n.registerControl(e.name,r),r.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(e){ws.then(()=>{let n=this._findContainer(e.path);n&&n.removeControl(e.name)})}getFormGroup(e){return this.form.get(e.path)}updateModel(e,n){ws.then(()=>{this.form.get(e.path).setValue(n)})}setValue(e){this.control.setValue(e)}onSubmit(e){return this.submittedReactive.set(!0),Ab(this.form,this._directives),this.ngSubmit.emit(e),this.form._events.next(new Vc(this.control)),e?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(e=void 0){this.form.reset(e),this.submittedReactive.set(!1)}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.form._updateOn=this.options.updateOn)}_findContainer(e){return e.pop(),e.length?this.form.get(e):this.form}static \u0275fac=function(n){return new(n||i)(De(qn,10),De(ch,10),De(Ms,8))};static \u0275dir=ne({type:i,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(n,r){n&1&&b("submit",function(a){return r.onSubmit(a)})("reset",function(){return r.onReset()})},inputs:{options:[0,"ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[Ce([iS]),ke]})}return i})();function cb(i,t){let e=i.indexOf(t);e>-1&&i.splice(e,1)}function db(i){return typeof i=="object"&&i!==null&&Object.keys(i).length===2&&"value"in i&&"disabled"in i}var Db=class extends jc{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(t=null,e,n){super(Eb(e),Tb(n,e)),this._applyFormState(t),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),$c(e)&&(e.nonNullable||e.initialValueIsDefault)&&(db(t)?this.defaultValue=t.value:this.defaultValue=t)}setValue(t,e={}){this.value=this._pendingValue=t,this._onChange.length&&e.emitModelToViewChange!==!1&&this._onChange.forEach(n=>n(this.value,e.emitViewToModelChange!==!1)),this.updateValueAndValidity(e)}patchValue(t,e={}){this.setValue(t,e)}reset(t=this.defaultValue,e={}){this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),this._pendingChange=!1,e?.emitEvent!==!1&&this._events.next(new Lc(this))}_updateValue(){}_anyControls(t){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(t){this._onChange.push(t)}_unregisterOnChange(t){cb(this._onChange,t)}registerOnDisabledChange(t){this._onDisabledChange.push(t)}_unregisterOnDisabledChange(t){cb(this._onDisabledChange,t)}_forEachChild(t){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(t){db(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=t}};var rS=i=>i instanceof Db;var oS={provide:mi,useExisting:dt(()=>Xe)},ub=Promise.resolve(),Xe=(()=>{class i extends mi{_changeDetectorRef;callSetDisabledState;control=new Db;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new H;constructor(e,n,r,o,a,s){super(),this._changeDetectorRef=a,this.callSetDisabledState=s,this._parent=e,this._setValidators(n),this._setAsyncValidators(r),this.valueAccessor=tS(this,o)}ngOnChanges(e){if(this._checkForErrors(),!this._registered||"name"in e){if(this._registered&&(this._checkName(),this.formDirective)){let n=e.name.previousValue;this.formDirective.removeControl({name:n,path:this._getPath(n)})}this._setUpControl()}"isDisabled"in e&&this._updateDisabled(e),Jw(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){Bc(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._checkName()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(e){ub.then(()=>{this.control.setValue(e,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(e){let n=e.isDisabled.currentValue,r=n!==0&&ie(n);ub.then(()=>{r&&!this.control.disabled?this.control.disable():!r&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(e){return this._parent?Gw(e,this._parent):[e]}static \u0275fac=function(n){return new(n||i)(De(Wr,9),De(qn,10),De(ch,10),De(ln,10),De(ze,8),De(Ms,8))};static \u0275dir=ne({type:i,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:!1,features:[Ce([oS]),ke,Ne]})}return i})();var aS={provide:ln,useExisting:dt(()=>Ts),multi:!0},Ts=(()=>{class i extends qr{writeValue(e){let n=e??"";this.setProperty("value",n)}registerOnChange(e){this.onChange=n=>{e(n==""?null:parseFloat(n))}}static \u0275fac=(()=>{let e;return function(r){return(e||(e=We(i)))(r||i)}})();static \u0275dir=ne({type:i,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(n,r){n&1&&b("input",function(a){return r.onChange(a.target.value)})("blur",function(){return r.onTouched()})},standalone:!1,features:[Ce([aS]),ke]})}return i})(),sS={provide:ln,useExisting:dt(()=>Gr),multi:!0};var lS=(()=>{class i{_accessors=[];add(e,n){this._accessors.push([e,n])}remove(e){for(let n=this._accessors.length-1;n>=0;--n)if(this._accessors[n][1]===e){this._accessors.splice(n,1);return}}select(e){this._accessors.forEach(n=>{this._isSameGroup(n,e)&&n[1]!==e&&n[1].fireUncheck(e.value)})}_isSameGroup(e,n){return e[0].control?e[0]._parent===n._control._parent&&e[1].name===n.name:!1}static \u0275fac=function(n){return new(n||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),Gr=(()=>{class i extends qr{_registry;_injector;_state;_control;_fn;setDisabledStateFired=!1;onChange=()=>{};name;formControlName;value;callSetDisabledState=u(Ms,{optional:!0})??Wc;constructor(e,n,r,o){super(e,n),this._registry=r,this._injector=o}ngOnInit(){this._control=this._injector.get(mi),this._checkName(),this._registry.add(this._control,this)}ngOnDestroy(){this._registry.remove(this)}writeValue(e){this._state=e===this.value,this.setProperty("checked",this._state)}registerOnChange(e){this._fn=e,this.onChange=()=>{e(this.value),this._registry.select(this)}}setDisabledState(e){(this.setDisabledStateFired||e||this.callSetDisabledState==="whenDisabledForLegacyCode")&&this.setProperty("disabled",e),this.setDisabledStateFired=!0}fireUncheck(e){this.writeValue(e)}_checkName(){this.name&&this.formControlName&&(this.name,this.formControlName),!this.name&&this.formControlName&&(this.name=this.formControlName)}static \u0275fac=function(n){return new(n||i)(De(et),De(ae),De(lS),De(we))};static \u0275dir=ne({type:i,selectors:[["input","type","radio","formControlName",""],["input","type","radio","formControl",""],["input","type","radio","ngModel",""]],hostBindings:function(n,r){n&1&&b("change",function(){return r.onChange()})("blur",function(){return r.onTouched()})},inputs:{name:"name",formControlName:"formControlName",value:"value"},standalone:!1,features:[Ce([sS]),ke]})}return i})(),cS={provide:ln,useExisting:dt(()=>hh),multi:!0},hh=(()=>{class i extends qr{writeValue(e){this.setProperty("value",parseFloat(e))}registerOnChange(e){this.onChange=n=>{e(n==""?null:parseFloat(n))}}static \u0275fac=(()=>{let e;return function(r){return(e||(e=We(i)))(r||i)}})();static \u0275dir=ne({type:i,selectors:[["input","type","range","formControlName",""],["input","type","range","formControl",""],["input","type","range","ngModel",""]],hostBindings:function(n,r){n&1&&b("change",function(a){return r.onChange(a.target.value)})("input",function(a){return r.onChange(a.target.value)})("blur",function(){return r.onTouched()})},standalone:!1,features:[Ce([cS]),ke]})}return i})();var dS={provide:Wr,useExisting:dt(()=>Os)},Os=(()=>{class i extends Wr{callSetDisabledState;get submitted(){return Mt(this._submittedReactive)}set submitted(e){this._submittedReactive.set(e)}_submitted=Ct(()=>this._submittedReactive());_submittedReactive=Me(!1);_oldForm;_onCollectionChange=()=>this._updateDomValue();directives=[];form=null;ngSubmit=new H;constructor(e,n,r){super(),this.callSetDisabledState=r,this._setValidators(e),this._setAsyncValidators(n)}ngOnChanges(e){e.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(Uc(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(e){let n=this.form.get(e.path);return Bc(n,e,this.callSetDisabledState),n.updateValueAndValidity({emitEvent:!1}),this.directives.push(e),n}getControl(e){return this.form.get(e.path)}removeControl(e){lb(e.control||null,e,!1),nS(this.directives,e)}addFormGroup(e){this._setUpFormContainer(e)}removeFormGroup(e){this._cleanUpFormContainer(e)}getFormGroup(e){return this.form.get(e.path)}addFormArray(e){this._setUpFormContainer(e)}removeFormArray(e){this._cleanUpFormContainer(e)}getFormArray(e){return this.form.get(e.path)}updateModel(e,n){this.form.get(e.path).setValue(n)}onSubmit(e){return this._submittedReactive.set(!0),Ab(this.form,this.directives),this.ngSubmit.emit(e),this.form._events.next(new Vc(this.control)),e?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(e=void 0,n={}){this.form.reset(e,n),this._submittedReactive.set(!1)}_updateDomValue(){this.directives.forEach(e=>{let n=e.control,r=this.form.get(e.path);n!==r&&(lb(n||null,e),rS(r)&&(Bc(r,e,this.callSetDisabledState),e.control=r))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(e){let n=this.form.get(e.path);Pb(n,e),n.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(e){if(this.form){let n=this.form.get(e.path);n&&Zw(n,e)&&n.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){mh(this.form,this),this._oldForm&&Uc(this._oldForm,this)}static \u0275fac=function(n){return new(n||i)(De(qn,10),De(ch,10),De(Ms,8))};static \u0275dir=ne({type:i,selectors:[["","formGroup",""]],hostBindings:function(n,r){n&1&&b("submit",function(a){return r.onSubmit(a)})("reset",function(){return r.onReset()})},inputs:{form:[0,"formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[Ce([dS]),ke,Ne]})}return i})();var uS={provide:ln,useExisting:dt(()=>qc),multi:!0};function Ib(i,t){return i==null?`${t}`:(t&&typeof t=="object"&&(t="Object"),`${i}: ${t}`.slice(0,50))}function mS(i){return i.split(":")[0]}var qc=(()=>{class i extends qr{value;_optionMap=new Map;_idCounter=0;set compareWith(e){this._compareWith=e}_compareWith=Object.is;appRefInjector=u(Cr).injector;destroyRef=u(xi);cdr=u(ze);_queuedWrite=!1;_writeValueAfterRender(){this._queuedWrite||this.appRefInjector.destroyed||(this._queuedWrite=!0,Vt({write:()=>{this.destroyRef.destroyed||(this._queuedWrite=!1,this.writeValue(this.value))}},{injector:this.appRefInjector}))}writeValue(e){this.cdr.markForCheck(),this.value=e;let n=this._getOptionId(e),r=Ib(n,e);this.setProperty("value",r)}registerOnChange(e){this.onChange=n=>{this.value=this._getOptionValue(n),e(this.value)}}_registerOption(){return(this._idCounter++).toString()}_getOptionId(e){for(let n of this._optionMap.keys())if(this._compareWith(this._optionMap.get(n),e))return n;return null}_getOptionValue(e){let n=mS(e);return this._optionMap.has(n)?this._optionMap.get(n):e}static \u0275fac=(()=>{let e;return function(r){return(e||(e=We(i)))(r||i)}})();static \u0275dir=ne({type:i,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(n,r){n&1&&b("change",function(a){return r.onChange(a.target.value)})("blur",function(){return r.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[Ce([uS]),ke]})}return i})(),Gc=(()=>{class i{_element;_renderer;_select;id;constructor(e,n,r){this._element=e,this._renderer=n,this._select=r,this._select&&(this.id=this._select._registerOption())}set ngValue(e){this._select!=null&&(this._select._optionMap.set(this.id,e),this._setElementValue(Ib(this.id,e)),this._select._writeValueAfterRender())}set value(e){this._setElementValue(e),this._select&&this._select._writeValueAfterRender()}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select._writeValueAfterRender())}static \u0275fac=function(n){return new(n||i)(De(ae),De(et),De(qc,9))};static \u0275dir=ne({type:i,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return i})(),hS={provide:ln,useExisting:dt(()=>Rb),multi:!0};function mb(i,t){return i==null?`${t}`:(typeof t=="string"&&(t=`'${t}'`),t&&typeof t=="object"&&(t="Object"),`${i}: ${t}`.slice(0,50))}function pS(i){return i.split(":")[0]}var Rb=(()=>{class i extends qr{value;_optionMap=new Map;_idCounter=0;set compareWith(e){this._compareWith=e}_compareWith=Object.is;writeValue(e){this.value=e;let n;if(Array.isArray(e)){let r=e.map(o=>this._getOptionId(o));n=(o,a)=>{o._setSelected(r.indexOf(a.toString())>-1)}}else n=(r,o)=>{r._setSelected(!1)};this._optionMap.forEach(n)}registerOnChange(e){this.onChange=n=>{let r=[],o=n.selectedOptions;if(o!==void 0){let a=o;for(let s=0;s<a.length;s++){let d=a[s],p=this._getOptionValue(d.value);r.push(p)}}else{let a=n.options;for(let s=0;s<a.length;s++){let d=a[s];if(d.selected){let p=this._getOptionValue(d.value);r.push(p)}}}this.value=r,e(r)}}_registerOption(e){let n=(this._idCounter++).toString();return this._optionMap.set(n,e),n}_getOptionId(e){for(let n of this._optionMap.keys())if(this._compareWith(this._optionMap.get(n)._value,e))return n;return null}_getOptionValue(e){let n=pS(e);return this._optionMap.has(n)?this._optionMap.get(n)._value:e}static \u0275fac=(()=>{let e;return function(r){return(e||(e=We(i)))(r||i)}})();static \u0275dir=ne({type:i,selectors:[["select","multiple","","formControlName",""],["select","multiple","","formControl",""],["select","multiple","","ngModel",""]],hostBindings:function(n,r){n&1&&b("change",function(a){return r.onChange(a.target)})("blur",function(){return r.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[Ce([hS]),ke]})}return i})(),Yc=(()=>{class i{_element;_renderer;_select;id;_value;constructor(e,n,r){this._element=e,this._renderer=n,this._select=r,this._select&&(this.id=this._select._registerOption(this))}set ngValue(e){this._select!=null&&(this._value=e,this._setElementValue(mb(this.id,e)),this._select.writeValue(this._select.value))}set value(e){this._select?(this._value=e,this._setElementValue(mb(this.id,e)),this._select.writeValue(this._select.value)):this._setElementValue(e)}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e)}_setSelected(e){this._renderer.setProperty(this._element.nativeElement,"selected",e)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}static \u0275fac=function(n){return new(n||i)(De(ae),De(et),De(Rb,9))};static \u0275dir=ne({type:i,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return i})();function gS(i){return typeof i=="number"?i:parseInt(i,10)}function Fb(i){return typeof i=="number"?i:parseFloat(i)}var Qc=(()=>{class i{_validator=Ic;_onChange;_enabled;ngOnChanges(e){if(this.inputName in e){let n=this.normalizeInput(e[this.inputName].currentValue);this._enabled=this.enabled(n),this._validator=this._enabled?this.createValidator(n):Ic,this._onChange&&this._onChange()}}validate(e){return this._validator(e)}registerOnValidatorChange(e){this._onChange=e}enabled(e){return e!=null}static \u0275fac=function(n){return new(n||i)};static \u0275dir=ne({type:i,features:[Ne]})}return i})(),fS={provide:qn,useExisting:dt(()=>ph),multi:!0},ph=(()=>{class i extends Qc{max;inputName="max";normalizeInput=e=>Fb(e);createValidator=e=>gb(e);static \u0275fac=(()=>{let e;return function(r){return(e||(e=We(i)))(r||i)}})();static \u0275dir=ne({type:i,selectors:[["input","type","number","max","","formControlName",""],["input","type","number","max","","formControl",""],["input","type","number","max","","ngModel",""]],hostVars:1,hostBindings:function(n,r){n&2&&K("max",r._enabled?r.max:null)},inputs:{max:"max"},standalone:!1,features:[Ce([fS]),ke]})}return i})(),_S={provide:qn,useExisting:dt(()=>Ps),multi:!0},Ps=(()=>{class i extends Qc{min;inputName="min";normalizeInput=e=>Fb(e);createValidator=e=>pb(e);static \u0275fac=(()=>{let e;return function(r){return(e||(e=We(i)))(r||i)}})();static \u0275dir=ne({type:i,selectors:[["input","type","number","min","","formControlName",""],["input","type","number","min","","formControl",""],["input","type","number","min","","ngModel",""]],hostVars:1,hostBindings:function(n,r){n&2&&K("min",r._enabled?r.min:null)},inputs:{min:"min"},standalone:!1,features:[Ce([_S]),ke]})}return i})(),bS={provide:qn,useExisting:dt(()=>Yr),multi:!0};var Yr=(()=>{class i extends Qc{required;inputName="required";normalizeInput=ie;createValidator=e=>fb;enabled(e){return e}static \u0275fac=(()=>{let e;return function(r){return(e||(e=We(i)))(r||i)}})();static \u0275dir=ne({type:i,selectors:[["","required","","formControlName","",3,"type","checkbox"],["","required","","formControl","",3,"type","checkbox"],["","required","","ngModel","",3,"type","checkbox"]],hostVars:1,hostBindings:function(n,r){n&2&&K("required",r._enabled?"":null)},inputs:{required:"required"},standalone:!1,features:[Ce([bS]),ke]})}return i})();var vS={provide:qn,useExisting:dt(()=>gh),multi:!0},gh=(()=>{class i extends Qc{maxlength;inputName="maxlength";normalizeInput=e=>gS(e);createValidator=e=>_b(e);static \u0275fac=(()=>{let e;return function(r){return(e||(e=We(i)))(r||i)}})();static \u0275dir=ne({type:i,selectors:[["","maxlength","","formControlName",""],["","maxlength","","formControl",""],["","maxlength","","ngModel",""]],hostVars:1,hostBindings:function(n,r){n&2&&K("maxlength",r._enabled?r.maxlength:null)},inputs:{maxlength:"maxlength"},standalone:!1,features:[Ce([vS]),ke]})}return i})();var yS=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=de({type:i});static \u0275inj=ce({})}return i})();var ot=(()=>{class i{static withConfig(e){return{ngModule:i,providers:[{provide:Ms,useValue:e.callSetDisabledState??Wc}]}}static \u0275fac=function(n){return new(n||i)};static \u0275mod=de({type:i});static \u0275inj=ce({imports:[yS]})}return i})();var CS=["inputElement"];function xS(i,t){if(i&1&&(l(0,"span",3),h(1),c()),i&2){let e=g();m(),U(e.label)}}function wS(i,t){if(i&1&&(l(0,"small",5),h(1),c()),i&2){let e=g();m(),U(e.hint)}}var Xc=class i{label="";placeholder="";hint="";isDisabled=!1;value="";autoFocus=!0;valueChange=new H;enterPressed=new H;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||i)};static \u0275cmp=P({type:i,selectors:[["app-text-input"]],viewQuery:function(e,n){if(e&1&&se(CS,5),e&2){let r;G(r=Y())&&(n.inputElement=r.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,n){if(e&1){let r=A();l(0,"div",1)(1,"label",2),w(2,xS,2,1,"span",3),l(3,"input",4,0),B("ngModelChange",function(a){return y(r),z(n.inputValue,a)||(n.inputValue=a),C(a)}),b("ngModelChange",function(a){return y(r),C(n.onValueChange(a))})("keydown.enter",function(){return y(r),C(n.onEnter())}),c()(),w(5,wS,2,1,"small",5),c()}e&2&&(m(2),S(n.label?2:-1),m(),j("ngModel",n.inputValue),x("placeholder",n.placeholder)("disabled",n.isDisabled),m(2),S(n.hint?5:-1))},dependencies:[ot,Ge,rt,Xe,Be],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 SS=["nameInput"],kS=["pathInput"];function MS(i,t){if(i&1&&(l(0,"div",7),h(1),c()),i&2){let e=g();m(),U(e.errorMessage)}}var Kc=class i{isCreating=!1;create=new H;cancelled=new H;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||i)};static \u0275cmp=P({type:i,selectors:[["app-project-create"]],viewQuery:function(e,n){if(e&1&&(se(SS,5),se(kS,5)),e&2){let r;G(r=Y())&&(n.nameInput=r.first),G(r=Y())&&(n.pathInput=r.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,n){if(e&1){let r=A();l(0,"div",2)(1,"h3",3),h(2,"Create New Project"),c(),l(3,"div",4)(4,"app-text-input",5,0),b("valueChange",function(a){return y(r),C(n.projectName=a)})("enterPressed",function(){return y(r),C(n.onNameEnter())}),c(),l(6,"app-text-input",6,1),b("valueChange",function(a){return y(r),C(n.projectPath=a)})("enterPressed",function(){return y(r),C(n.onCreate())}),c(),w(8,MS,2,1,"div",7),c(),l(9,"div",8)(10,"button",9),b("click",function(){return y(r),C(n.onCancel())}),h(11,"Cancel"),c(),l(12,"button",10),b("click",function(){return y(r),C(n.onCreate())}),h(13),c()()()}e&2&&(m(4),x("value",n.projectName)("isDisabled",n.isCreating)("autoFocus",!0),m(2),x("value",n.projectPath)("isDisabled",n.isCreating)("autoFocus",!1),m(2),S(n.errorMessage?8:-1),m(2),x("disabled",n.isCreating),m(2),x("disabled",!n.isValid()||n.isCreating),m(),ue(" ",n.isCreating?"Creating...":"Create Project"," "))},dependencies:[Be,Xc,zt],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 ES(i,t){if(i&1){let e=A();l(0,"app-project-create",10),b("create",function(r){y(e);let o=g();return C(o.onCreateProject(r))})("cancelled",function(){y(e);let r=g();return C(r.closeCreateForm())}),c()}if(i&2){let e=g();x("isCreating",e.isCreating)}}function TS(i,t){i&1&&(l(0,"div",6),F(1,"div",11),l(2,"p",12),h(3,"Loading projects..."),c()())}function OS(i,t){if(i&1&&(l(0,"div",7)(1,"p",13),h(2),c()()),i&2){let e=g();m(2),U(e.error)}}function PS(i,t){if(i&1){let e=A();l(0,"app-choice-select",14),b("choiceSelected",function(r){y(e);let o=g();return C(o.selectProject(r))}),c()}if(i&2){let e=g();x("options",e.projectOptions())("labelHtml","Select a project to continue")("isVisible",!0)}}function AS(i,t){if(i&1){let e=A();l(0,"div",9)(1,"p",15),h(2,"No projects available."),c(),l(3,"button",16),b("click",function(){y(e);let r=g();return C(r.openCreateForm())}),h(4,"Create your first project"),c()()}}var Zc=class i{isLoading=!1;error=null;showCreateForm=!1;isCreating=!1;router=u(Dt);projectStateService=u(Te);projects=qt(this.projectStateService.projectList$);forcedProject=qt(this.projectStateService.forcedProject$);projectOptions=Ct(()=>{let t=this.projects();if(!t)return[];let e=t.filter(a=>!a.volatile),n=t.filter(a=>a.volatile),o=[...e,...n].map(a=>({value:a.name,label:a.volatile?`${a.name} \u{1F538}temp`:a.name}));return t.length>0&&o.push({value:"__new_project__",label:"New project..."}),o});showCreateButton=Ct(()=>!this.forcedProject());constructor(){this.projectStateService.selectedProject$.pipe(wc(),le(t=>!!t),le(()=>this.router.url.split("?")[0]==="/"),lt(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||i)};static \u0275cmp=P({type:i,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,n){e&1&&(l(0,"div",0)(1,"div",1)(2,"div",2),F(3,"app-welcome-message"),c(),l(4,"div",3)(5,"div",4),w(6,ES,1,1,"app-project-create",5)(7,TS,4,0,"div",6)(8,OS,3,1,"div",7)(9,PS,1,3,"app-choice-select",8)(10,AS,5,0,"div",9),c()()()()),e&2&&(m(6),S(n.showCreateForm?6:n.isLoading?7:n.error?8:n.projects()&&n.projects().length>0?9:10))},dependencies:[Be,Yo,Qo,Kc,zt],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 mt=class i{STORAGE_KEY="coday-preferences";isDesktopApp=!1;electronStorage=null;voiceLanguageSubject=new Z("en-US");voiceLanguage$=this.voiceLanguageSubject.asObservable();enterToSendSubject=new Z(!0);enterToSend$=this.enterToSendSubject.asObservable();voiceAnnounceEnabledSubject=new Z(!1);voiceAnnounceEnabled$=this.voiceAnnounceEnabledSubject.asObservable();voiceModeSubject=new Z("speech");voiceMode$=this.voiceModeSubject.asObservable();voiceReadFullTextSubject=new Z(!1);voiceReadFullText$=this.voiceReadFullTextSubject.asObservable();voiceVolumeSubject=new Z(.8);voiceVolume$=this.voiceVolumeSubject.asObservable();voiceRateSubject=new Z(1.2);voiceRate$=this.voiceRateSubject.asObservable();selectedVoiceSubject=new Z(null);selectedVoice$=this.selectedVoiceSubject.asObservable();printTechnicalMessagesSubject=new Z(!1);printTechnicalMessages$=this.printTechnicalMessagesSubject.asObservable();hideTechnicalMessagesSubject=new Z(!0);hideTechnicalMessages$=this.hideTechnicalMessagesSubject.asObservable();hideWarningMessagesSubject=new Z(!1);hideWarningMessages$=this.hideWarningMessagesSubject.asObservable();agentNotificationEnabledSubject=new Z(!1);agentNotificationEnabled$=this.agentNotificationEnabledSubject.asObservable();notificationSoundEnabledSubject=new Z(!1);notificationSoundEnabled$=this.notificationSoundEnabledSubject.asObservable();browserNotificationEnabledSubject=new Z(!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 n=this.getPreferenceSync("voiceAnnounceEnabled",!1)??!1;this.voiceAnnounceEnabledSubject.next(n);let r=this.getPreferenceSync("voiceMode","speech")??"speech";this.voiceModeSubject.next(r);let o=this.getPreferenceSync("voiceReadFullText",!1)??!1;this.voiceReadFullTextSubject.next(o);let a=this.getPreferenceSync("voiceVolume",.8)??.8;this.voiceVolumeSubject.next(a);let s=this.getPreferenceSync("voiceRate",1.2)??1.2;this.voiceRateSubject.next(s);let d=this.getPreferenceSync("selectedVoice",null)??null;this.selectedVoiceSubject.next(d);let p=this.getPreferenceSync("printTechnicalMessages",!1)??!1;this.printTechnicalMessagesSubject.next(p);let f=this.getPreferenceSync("hideTechnicalMessages",!0)??!0;this.hideTechnicalMessagesSubject.next(f);let v=this.getPreferenceSync("hideWarningMessages",!1)??!1;this.hideWarningMessagesSubject.next(v);let E=this.getPreferenceSync("agentNotificationEnabled",!1)??!1;this.agentNotificationEnabledSubject.next(E);let T=this.getPreferenceSync("notificationSoundEnabled",!0)??!0;this.notificationSoundEnabledSubject.next(T);let k=this.getPreferenceSync("browserNotificationEnabled",!1)??!1;this.browserNotificationEnabledSubject.next(k),console.log("[PREFERENCES] All preferences initialized successfully")}loadPreferencesAsync(){return re(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 n=(yield this.getPreferenceAsync("voiceAnnounceEnabled",!1))??!1;this.voiceAnnounceEnabledSubject.next(n);let r=(yield this.getPreferenceAsync("voiceMode","speech"))??"speech";this.voiceModeSubject.next(r);let o=(yield this.getPreferenceAsync("voiceReadFullText",!1))??!1;this.voiceReadFullTextSubject.next(o);let a=(yield this.getPreferenceAsync("voiceVolume",.8))??.8;this.voiceVolumeSubject.next(a);let s=(yield this.getPreferenceAsync("voiceRate",1.2))??1.2;this.voiceRateSubject.next(s);let d=(yield this.getPreferenceAsync("selectedVoice",null))??null;this.selectedVoiceSubject.next(d);let p=(yield this.getPreferenceAsync("printTechnicalMessages",!1))??!1;this.printTechnicalMessagesSubject.next(p);let f=(yield this.getPreferenceAsync("hideTechnicalMessages",!0))??!0;this.hideTechnicalMessagesSubject.next(f);let v=(yield this.getPreferenceAsync("hideWarningMessages",!1))??!1;this.hideWarningMessagesSubject.next(v);let E=(yield this.getPreferenceAsync("agentNotificationEnabled",!1))??!1;this.agentNotificationEnabledSubject.next(E);let T=(yield this.getPreferenceAsync("notificationSoundEnabled",!0))??!0;this.notificationSoundEnabledSubject.next(T);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 n=localStorage.getItem(this.STORAGE_KEY);if(!n)return e;let r=JSON.parse(n);return r[t]!==void 0?r[t]:e}catch{return e}}getPreferenceAsync(t,e){return re(this,null,function*(){if(!this.electronStorage)return this.getPreferenceSync(t,e);try{let n=yield this.electronStorage.get(this.STORAGE_KEY);if(!n)return e;let r=JSON.parse(n);return r[t]!==void 0?r[t]:e}catch{return e}})}setPreference(t,e){this.isDesktopApp?this.setPreferenceAsync(t,e):this.setPreferenceSync(t,e)}setPreferenceSync(t,e){try{let n=localStorage.getItem(this.STORAGE_KEY),r=n?JSON.parse(n):{};r[t]=e,localStorage.setItem(this.STORAGE_KEY,JSON.stringify(r)),this.updateSubject(t,e)}catch(n){console.error("Failed to set preference:",n)}}setPreferenceAsync(t,e){return re(this,null,function*(){if(!this.electronStorage){this.setPreferenceSync(t,e);return}try{let n=yield this.electronStorage.get(this.STORAGE_KEY),r=n?JSON.parse(n):{};r[t]=e,yield this.electronStorage.set(this.STORAGE_KEY,JSON.stringify(r)),this.updateSubject(t,e)}catch(n){console.error("Failed to set preference:",n)}})}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||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})};function fh(i,t=80){if(i.length<=t)return i;try{if(i.trim().startsWith("{")||i.trim().startsWith("[")){let e=JSON.parse(i),n=JSON.stringify(e);return n.length<=t?n:n.substring(0,t)+`...(${n.length} chars)`}}catch{}return i.substring(0,t)+"..."}var Ot=class{constructor(t,e){this.type=e;if(t.timestamp)this.timestamp=t.timestamp;else{let n=Math.random().toString(36).substring(2,7);this.timestamp=`${new Date().toISOString()}-${n}`}this.parentKey=t.parentKey,this.length=0}timestamp;parentKey;static type;length},Jc=class extends Ot{invite;constructor(t,e){super(t,e),this.invite=t.invite}buildAnswer(t){return new vn({answer:t,parentKey:this.timestamp,invite:this.invite})}},Jo=class i extends Ot{static type="heartbeat";constructor(t){super(t,i.type)}},Ni=class i extends Jc{defaultValue;static type="invite";constructor(t){super(t,i.type),this.defaultValue=t.defaultValue}},_h="InviteEventDefault",vn=class i extends Ot{answer;invite;static type="answer";constructor(t){super(t,i.type),this.answer=t.answer??"No answer",this.invite=t.invite}},Qr=class i extends Ot{speaker;text;static type="text";constructor(t){super(t,i.type),this.speaker=t.speaker,this.text=t.text}},ea=class i extends Ot{chunk;static type="text_chunk";constructor(t){super(t,i.type),this.chunk=t.chunk,this.length=this.chunk.length}},Xr=class i extends Ot{warning;static type="warn";constructor(t){super(t,i.type),this.warning=t.warning}},Gn=class i extends Ot{error;static type="error";constructor(t){super(t,i.type),this.error=t.error}},Vi=class i extends Jc{options;optionalQuestion;static type="choice";constructor(t){super(t,i.type),this.options=t.options,this.optionalQuestion=t.optionalQuestion}},Li=class i extends Ot{toolRequestId;name;args;static type="tool_request";constructor(t){super(t,i.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 hi({output:t,toolRequestId:this.toolRequestId,parentKey:this.timestamp})}toSingleLineString(t=50){let e=fh(this.args,t);return`\u{1F527} ${this.name}(${e})`}},hi=class i extends Ot{toolRequestId;output;static type="tool_response";constructor(t){if(super(t,i.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(),n=fh(e,t),r=typeof this.output!="string"&&this.output.type==="image"?" [image]":"";return`\u2B91 ${n}${r}`}},ur=class i extends Ot{static type="thinking";static debounce=5e3;constructor(t){super(t,i.type)}},Kr=class i extends Ot{summary;static type="summary";constructor(t){super(t,i.type),this.summary=t.summary,this.length=this.summary.length}toSingleLineString(t=80){return`\u{1F4CB} Summary: ${fh(this.summary,t)}`}},ji=class i extends Ot{role;name;content;static type="message";constructor(t){super(t,i.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 n=(e.width||0)*(e.height||0)/750;return n?n*3.5:e.content.length}return 0}).reduce((e,n)=>e+n,0)}getTextContent(){return this.content.filter(t=>t.type==="text").map(t=>t.content).join(`
|
|
68
|
-
`)}},ta=class i extends Ot{threadId;name;static type="thread_update";constructor(t){super(t,i.type),this.threadId=t.threadId,this.name=t.name}},mr=class i extends Ot{filename;operation;size;mimeType;static type="file";constructor(t){super(t,i.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}`}},na=class i extends Ot{authUrl;state;integrationName;static type="oauth_request";constructor(t){super(t,i.type),this.authUrl=t.authUrl,this.state=t.state,this.integrationName=t.integrationName}},pi=class i extends Ot{code;state;integrationName;error;errorDescription;static type="oauth_callback";constructor(t){super(t,i.type),this.code=t.code,this.state=t.state,this.integrationName=t.integrationName,this.error=t.error,this.errorDescription=t.errorDescription}},DS={[ji.type]:ji,[vn.type]:vn,[Vi.type]:Vi,[Gn.type]:Gn,[Jo.type]:Jo,[Ni.type]:Ni,[Li.type]:Li,[hi.type]:hi,[Qr.type]:Qr,[ea.type]:ea,[ur.type]:ur,[Xr.type]:Xr,[ta.type]:ta,[Kr.type]:Kr,[mr.type]:mr,[na.type]:na,[pi.type]:pi};function bh(i){let t=DS[i.type];return t?new t(i):void 0}var JR=[{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
|
-
|
|
70
|
-
<task>
|
|
71
|
-
{{PARAMETERS}}
|
|
72
|
-
</task>
|
|
73
|
-
|
|
74
|
-
There will be 3 phases:
|
|
75
|
-
1. Research and understanding
|
|
76
|
-
2. Clarifying questions
|
|
77
|
-
3. Plan creation
|
|
78
|
-
|
|
79
|
-
Do not try to do all at once, wait for my request at each time.
|
|
80
|
-
|
|
81
|
-
Now we start with phase 1:
|
|
82
|
-
|
|
83
|
-
1. **Analyze the request** to identify:
|
|
84
|
-
- Core requirements and objectives
|
|
85
|
-
- Implicit assumptions or expectations
|
|
86
|
-
- Technical scope and constraints
|
|
87
|
-
|
|
88
|
-
2. **Research relevant context** using available tools:
|
|
89
|
-
- Use whatever tools you have available (file reading, API calls, search, etc.)
|
|
90
|
-
- Gather information about existing patterns, structures, and conventions
|
|
91
|
-
- Identify relevant files, modules, or resources
|
|
92
|
-
- Document key findings briefly
|
|
93
|
-
|
|
94
|
-
3. **Assess feasibility**:
|
|
95
|
-
- Identify potential challenges or blockers
|
|
96
|
-
- Note any dependencies or prerequisites
|
|
97
|
-
- Consider alternative approaches if applicable
|
|
98
|
-
|
|
99
|
-
Do not assume you have specific tools - use what's available to you.
|
|
100
|
-
|
|
101
|
-
Do not produce any document at this stage as you will have access to the accumulated research results later.
|
|
102
|
-
`,`@ let's continue with Phase 2: Clarifying Questions regarding the initial task.
|
|
103
|
-
|
|
104
|
-
<task>
|
|
105
|
-
{{PARAMETERS}}
|
|
106
|
-
</task>
|
|
107
|
-
|
|
108
|
-
Based on your research and understanding:
|
|
109
|
-
|
|
110
|
-
1. **Identify ambiguities** or missing information that could impact the completion of the task
|
|
111
|
-
- no boundaries
|
|
112
|
-
- insufficient definition of done
|
|
113
|
-
- lack of pre-requisites
|
|
114
|
-
|
|
115
|
-
2. **Ask focused questions** if clarification is needed:
|
|
116
|
-
- Use the 'invite' or 'choice' tools for user input
|
|
117
|
-
- Keep questions concise and specific
|
|
118
|
-
- Prioritize questions that significantly impact the approach
|
|
119
|
-
|
|
120
|
-
3. **Skip this phase** if the requirements are clear enough to proceed
|
|
121
|
-
|
|
122
|
-
Remember: Only ask questions that are truly necessary to create a solid plan.`,`@ finish with Phase 3: Plan Creation
|
|
123
|
-
|
|
124
|
-
Break down the task into 3-10 clear, actionable steps. Each step should be substantial enough to represent meaningful progress, but focused enough to be completed in one session.
|
|
125
|
-
|
|
126
|
-
Create a detailed execution plan:
|
|
127
|
-
- if you have access to the exchange area, save the plan there as 'plan.md'.
|
|
128
|
-
- otherwise, output the plan in the conversation.
|
|
129
|
-
- do not write any other document
|
|
130
|
-
|
|
131
|
-
The plan must follow this Markdown structure:
|
|
132
|
-
|
|
133
|
-
# Execution Plan: [Task Title]
|
|
134
|
-
|
|
135
|
-
## Overview
|
|
136
|
-
1-2 sentence summary of what will be accomplished.
|
|
137
|
-
|
|
138
|
-
## Context
|
|
139
|
-
Key information and constraints identified during research:
|
|
140
|
-
- Relevant patterns/conventions found
|
|
141
|
-
- Constraints or limitations
|
|
142
|
-
- Dependencies or prerequisites
|
|
143
|
-
- Key resources or materials involved
|
|
144
|
-
|
|
145
|
-
## Steps
|
|
146
|
-
|
|
147
|
-
### Step 1: [Step Title]
|
|
148
|
-
- **What to do**: Clear description of the action to take
|
|
149
|
-
- **Resources needed**: List files, tools, information, or materials required
|
|
150
|
-
- **Expected outcome**: What should be produced or achieved
|
|
151
|
-
- **Validation**: How to verify this step is complete
|
|
152
|
-
- **Dependencies**: Which previous steps must complete first (or "None")
|
|
153
|
-
|
|
154
|
-
### Step 2: [Step Title]
|
|
155
|
-
[Same structure as Step 1]
|
|
156
|
-
|
|
157
|
-
[Continue for all steps...]
|
|
158
|
-
|
|
159
|
-
## Success Criteria
|
|
160
|
-
How to verify the task is fully complete:
|
|
161
|
-
1. Objective measures of completion
|
|
162
|
-
2. Quality checks or review points
|
|
163
|
-
3. Final validation steps
|
|
164
|
-
|
|
165
|
-
## Risks & Considerations
|
|
166
|
-
- Potential challenges or obstacles
|
|
167
|
-
- Alternative approaches considered
|
|
168
|
-
- Areas requiring special attention
|
|
169
|
-
- Future improvements or follow-up items
|
|
170
|
-
|
|
171
|
-
---
|
|
172
|
-
|
|
173
|
-
After outputting the plan in the right place (in exchange or in conversation or according to user directives):
|
|
174
|
-
- do not produce other outputs nor documents
|
|
175
|
-
- do not start executing the plan`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""},{id:"builtin-execute-plan",name:"execute-plan",description:"Execute a previously created plan step by step, with validation and progress tracking.",source:"builtin",commands:[`@ Execute the plan from the exchange area or outlined previously in the conversation:
|
|
176
|
-
|
|
177
|
-
## Preparation
|
|
178
|
-
1. **Load the plan**: Read from exchange area (plan.md) or use previously discussed plan
|
|
179
|
-
2. **Review**: Understand the overall objective, context, and step sequence
|
|
180
|
-
3. **Pre-check**: Verify prerequisites are met; report any obvious issues
|
|
181
|
-
|
|
182
|
-
## Step-by-Step Execution
|
|
183
|
-
|
|
184
|
-
For each step in order:
|
|
185
|
-
|
|
186
|
-
1. **Announce**: State which step you're starting and what you'll do
|
|
187
|
-
2. **Check dependencies**: Verify required previous steps are complete
|
|
188
|
-
3. **Execute**: Perform the actions specified in the step
|
|
189
|
-
4. **Validate**: Apply the validation criteria from the plan
|
|
190
|
-
5. **Report**: Confirm completion and note any deviations
|
|
191
|
-
|
|
192
|
-
**For significant or risky steps**: Ask user confirmation before proceeding (use 'choice' tool)
|
|
193
|
-
|
|
194
|
-
## Issue Handling
|
|
195
|
-
|
|
196
|
-
If a step fails:
|
|
197
|
-
- Report the issue clearly
|
|
198
|
-
- Suggest solutions (retry, skip if non-critical, or stop)
|
|
199
|
-
- Use 'choice' tool to ask how to proceed if needed
|
|
200
|
-
|
|
201
|
-
## Completion
|
|
202
|
-
|
|
203
|
-
1. **Final verification**: Apply success criteria from the plan
|
|
204
|
-
2. **Summary**: Report what was accomplished, any deviations, validation results, and next steps
|
|
205
|
-
|
|
206
|
-
## Guidelines
|
|
207
|
-
- Follow the plan's order unless circumstances require adaptation
|
|
208
|
-
- Communicate progress clearly at each step, without excessive details
|
|
209
|
-
- Ask for guidance when the plan is unclear or issues arise`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""},{id:"builtin-re-prompt",name:"re-prompt",description:"Transform a vague request into a detailed, actionable prompt",source:"builtin",commands:[`@ I need you to analyze and reformulate the following request to make it more precise and actionable.
|
|
210
|
-
|
|
211
|
-
## User's initial request
|
|
212
|
-
|
|
213
|
-
{{PARAMETERS}}
|
|
214
|
-
|
|
215
|
-
## Your task
|
|
216
|
-
|
|
217
|
-
1. **Analyze the request** to identify:
|
|
218
|
-
- What is explicitly stated
|
|
219
|
-
- What is implicit or assumed
|
|
220
|
-
- What information is missing or ambiguous
|
|
221
|
-
- The likely intent behind the request
|
|
222
|
-
|
|
223
|
-
2. **Ask clarifying questions** if needed:
|
|
224
|
-
- If the request is too vague or has multiple interpretations
|
|
225
|
-
- If critical information is missing
|
|
226
|
-
- Use the 'invite' or 'choice' tools to gather necessary details
|
|
227
|
-
|
|
228
|
-
3. **Reformulate the request** into a clear, detailed, and actionable prompt:
|
|
229
|
-
- Make implicit requirements explicit
|
|
230
|
-
- Add relevant context from the current project
|
|
231
|
-
- Specify expected outcomes or deliverables
|
|
232
|
-
- Break down complex requests into clear steps if needed
|
|
233
|
-
- Use precise technical terminology when appropriate
|
|
234
|
-
|
|
235
|
-
4. **Present the reformulated request** and ask for confirmation:
|
|
236
|
-
- Show the enhanced version clearly
|
|
237
|
-
- Explain key changes or additions you made
|
|
238
|
-
- Ask if this matches the user's intent
|
|
239
|
-
|
|
240
|
-
The goal is to transform a rough idea into a well-defined request that will produce better AI responses.`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""},{id:"builtin-memory-learn",name:"memory-learn",description:"Extract and memorize new knowledge gained from recent context",source:"builtin",commands:[`@ Learn about the following topic and memorize relevant insights if defined:
|
|
241
|
-
|
|
242
|
-
<topic>
|
|
243
|
-
{{PARAMETERS}}
|
|
244
|
-
</topic>
|
|
245
|
-
|
|
246
|
-
If no specific topic is provided, extract learnings from the entire recent conversation context.
|
|
247
|
-
|
|
248
|
-
## Process
|
|
249
|
-
|
|
250
|
-
1. **Identify new knowledge**: From the recent conversation context, identify what you learned that:
|
|
251
|
-
- Was not in the initially given context
|
|
252
|
-
- Is specific to this user or project (not generic knowledge)
|
|
253
|
-
- Is useful and worth remembering
|
|
254
|
-
- Represents understanding, not just file copies
|
|
255
|
-
|
|
256
|
-
2. **Organize insights**: Split the knowledge into cohesive subjects, each with:
|
|
257
|
-
- **Title**: Short and descriptive (one sentence maximum)
|
|
258
|
-
- **Content**: Detailed explanation of what was learned
|
|
259
|
-
- Length: at most 3 paragraphs or short extracts and notes
|
|
260
|
-
- Format: Well-structured markdown
|
|
261
|
-
- Focus: Specific patterns, decisions, constraints, or insights
|
|
262
|
-
|
|
263
|
-
3. **Check for redundancy**: Before memorizing:
|
|
264
|
-
- Review the list of existing memories to avoid duplication
|
|
265
|
-
- If a similar memory exists, consider updating it instead of creating a new one
|
|
266
|
-
- delete memories if needed
|
|
267
|
-
|
|
268
|
-
4. **Memorize**: Use the memorization tools to save each subject:
|
|
269
|
-
- Choose appropriate level if available (PROJECT or USER)
|
|
270
|
-
- Ensure clear structure and completeness
|
|
271
|
-
- Memorize one subject at a time
|
|
272
|
-
|
|
273
|
-
## Guidelines
|
|
274
|
-
- Focus on actionable insights, not generic facts
|
|
275
|
-
- Ensure memories are self-contained and clear
|
|
276
|
-
- Avoid redundancy with existing memories
|
|
277
|
-
- Prioritize quality over quantity`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""},{id:"builtin-memory-curate",name:"memory-curate",description:"Analyze and clean up the memory system by consolidating redundancies and removing outdated information",source:"builtin",commands:[`@ we start a 4 phase memory curation process. Complete only the requested phase at each time.
|
|
278
|
-
|
|
279
|
-
Phase 1: Analyze redundancies
|
|
280
|
-
|
|
281
|
-
Review all current memories to identify:
|
|
282
|
-
|
|
283
|
-
1. **Redundant memories** that:
|
|
284
|
-
- Cover similar or overlapping topics
|
|
285
|
-
- Contain duplicate information
|
|
286
|
-
- Could be consolidated for better clarity
|
|
287
|
-
|
|
288
|
-
2. **For each group of redundant memories**:
|
|
289
|
-
- List the memory titles involved
|
|
290
|
-
- Explain the redundancy briefly
|
|
291
|
-
- Propose a consolidation approach
|
|
292
|
-
|
|
293
|
-
Do not make changes yet - just analyze and report findings.`,`@ Phase 2: Consolidate redundancies
|
|
294
|
-
|
|
295
|
-
Based on the analysis from Phase 1:
|
|
296
|
-
|
|
297
|
-
1. **For each identified redundancy**:
|
|
298
|
-
- Delete the individual redundant memories using deleteMemory
|
|
299
|
-
- Create a new consolidated memory that:
|
|
300
|
-
- Maintains all critical details from the originals
|
|
301
|
-
- Provides clear, well-structured content
|
|
302
|
-
- Uses appropriate level (PROJECT or USER)
|
|
303
|
-
- Explain your consolidation reasoning
|
|
304
|
-
|
|
305
|
-
2. **Be proactive but careful**: Preserve important details while eliminating duplication.`,`@ Phase 3: Check for outdated information
|
|
306
|
-
|
|
307
|
-
Review remaining memories for accuracy and relevance:
|
|
308
|
-
|
|
309
|
-
1. **Compare each memory against**:
|
|
310
|
-
- Other memories for inconsistencies
|
|
311
|
-
- Current project context for outdated information
|
|
312
|
-
- Core documentation for misalignments
|
|
313
|
-
|
|
314
|
-
2. **For each problematic memory**:
|
|
315
|
-
- List the memory title with brief explanation of the issue
|
|
316
|
-
- Take appropriate action:
|
|
317
|
-
- Delete if outdated or incorrect
|
|
318
|
-
- Update if incomplete or partially incorrect
|
|
319
|
-
- Consolidate if it fits better elsewhere
|
|
320
|
-
- Explain your reasoning clearly
|
|
321
|
-
|
|
322
|
-
Be thorough in your analysis.`,`@ Phase 4: Final verification
|
|
323
|
-
|
|
324
|
-
Verify the memory system's overall health:
|
|
325
|
-
|
|
326
|
-
1. **Review the current state**:
|
|
327
|
-
- Check overall structure and organization
|
|
328
|
-
- Verify each memory for completeness and validity
|
|
329
|
-
- Confirm proper categorization (PROJECT vs USER)
|
|
330
|
-
|
|
331
|
-
2. **Document the results**:
|
|
332
|
-
- Summarize what was consolidated or removed
|
|
333
|
-
- List any remaining issues or concerns
|
|
334
|
-
- Provide recommendations for maintaining memory quality
|
|
335
|
-
|
|
336
|
-
This ensures the memory system stays efficient and valuable.`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""}];var mF=[ji.type,Li.type,hi.type,Kr.type,Ni.type,Vi.type,vn.type];var Nb={CONFLUENCE:[],GIT:[],GITLAB:[],JIRA:[],SLACK:[],ZENDESK:[],BASECAMP:[]},PF=Object.keys(Nb).filter(i=>Nb[i]?.length===0);var gi=class i{eventSource=null;eventsSubject=new I;connectionStatusSubject=new Z({connected:!1,reconnectAttempts:0,maxAttempts:3});reconnectAttempts=0;MAX_RECONNECT_ATTEMPTS=3;RECONNECT_DELAY=2e3;events$=this.eventsSubject.asObservable();connectionStatus$=this.connectionStatusSubject.asObservable();ngZone=u(fe);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 n=`/api/projects/${t}/threads/${e}/event-stream`;console.log("[SSE] EventSource URL:",n),this.eventSource=new EventSource(n),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),n=bh(e);n?(console.log("[SSE] Event:",n.type),this.eventsSubject.next(n)):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 Gn({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 Gn({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||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})};var hr=class i{http=u(nt);projectState=u(Te);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})}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`,{})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})};var Bt=class i{selectedThreadIdSubject=new Z(null);isLoadingSubject=new Z(!1);isLoadingThreadListSubject=new Z(!1);refreshThreadListSubject=new I;threadListSubject=new Z([]);hasLoadedOncePerProject=new Map;currentProjectName=null;isLoading$=this.isLoadingSubject.asObservable();isLoadingThreadList$=this.isLoadingThreadListSubject.asObservable();threadApi=u(hr);projectStateService=u(Te);projectName$=this.projectStateService.selectedProject$.pipe(X(t=>t?.name),Xs());constructor(){dn([this.projectName$,this.refreshThreadListSubject.asObservable().pipe(At(void 0))]).pipe(ve(([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))}),Je(([t])=>t?(console.log("[THREAD_STATE] Fetching threads for project:",t),this.threadApi.listThreads().pipe(X(e=>({threads:e,projectName:t})),on(e=>(console.error("[THREAD_STATE] Error loading thread list:",e),$({threads:[],projectName:t}))))):(console.log("[THREAD_STATE] No project selected, returning empty list"),$({threads:[],projectName:null}))),ve(({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();selectedThread$=dn([this.projectName$,this.selectedThreadIdSubject.pipe(Xs())]).pipe(ve(([t,e])=>{console.log("\u{1F43C} combineLatest emitted:",{projectName:t,threadId:e})}),Je(([t,e])=>!t||!e?(console.log("\u{1F43C} null"),$(null)):(console.log("\u{1F43C} loading thread:",e),this.isLoadingSubject.next(!0),this.threadApi.getThread(e).pipe(ve(n=>{console.log("\u{1F43C} loaded thread:",n?.id)}),Wi({bufferSize:1,refCount:!0})))),ve(()=>{console.log("\u{1F43C} finished loading"),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()}renameThread(t,e){let n=e.trim();return!n||n.length===0?(console.error("[THREAD_STATE] Cannot rename thread: name is empty after trimming"),Xn(()=>new Error("Thread name cannot be empty"))):(console.log("[THREAD_STATE] Renaming thread:",t,"to:",n),this.threadApi.updateThread(t,n).pipe(ve(r=>{console.log("[THREAD_STATE] Thread renamed successfully:",r),this.refreshThreadList()}),on(r=>(console.error("[THREAD_STATE] Error renaming thread:",r),Xn(()=>r)))))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})};var ia=class i{http=u(nt);projectState=u(Te);threadState=u(Bt);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"})}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||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})};var On=class i{destroy$=new I;currentProject=null;currentThread=null;messagesSubject=new Z([]);isThinkingSubject=new Z(!1);currentChoiceSubject=new Z(null);projectTitleSubject=new Z("Coday");currentInviteEventSubject=new Z(null);messageToRestoreSubject=new Z("");threadUpdateEventSubject=new Z(null);currentChoiceEvent=null;thinkingTimeout=null;accumulatedChunks="";streamingTextSubject=new Z("");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=u(gi);messageApi=u(ia);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),setTimeout(()=>this.processUnansweredInvites(),500)}processUnansweredInvites(){let t=this.messagesSubject.value,e=t.filter(n=>n.type==="text"&&n.parentKey===void 0&&n.invite!==void 0).filter(n=>!t.some(r=>r.type==="text"&&r.role==="user"&&r.parentKey===n.id));e.length>0&&console.log("[CODAY] Found",e.length,"unanswered invite(s)")}resetMessages(){this.messagesSubject.next([]),this.currentChoiceSubject.next(null),this.currentInviteEventSubject.next(null),this.currentChoiceEvent=null,this.accumulatedChunks="",this.streamingTextSubject.next(""),this.stopThinking()}sendMessage(t){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send message: no project or thread selected");return}this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive();let e=this.currentInviteEventSubject.value;if(e){let n=e.buildAnswer(t);this.currentInviteEventSubject.next(null),this.messageApi.sendMessage(n).subscribe({error:r=>{console.error("[CODAY] Send error:",r),this.stopThinking()}})}else{let n=new vn({answer:t});this.messageApi.sendMessage(n).subscribe({error:r=>{console.error("[CODAY] Send error:",r),this.stopThinking()}})}}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:n=>{console.error("[CODAY-CHOICE] Choice error:",n),this.stopThinking()}})}else console.error("[CODAY-CHOICE] No choice event available for choice:",t)}deleteMessage(t){let e=this.messagesSubject.value.find(r=>r.id===t),n=this.extractTextContentFromMessage(e);return this.messageApi.deleteMessage(t).pipe(ve(r=>{r.success&&(this.removeMessagesFromIndex(t),n.trim()&&this.messageToRestoreSubject.next(n))}))}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){t instanceof ji?this.handleMessageEvent(t):t instanceof ea?this.handleTextChunkEvent(t):t instanceof Qr?this.handleTextEvent(t):t instanceof vn?this.handleAnswerEvent(t):t instanceof Gn?this.handleErrorEvent(t):t instanceof Xr?this.handleWarnEvent(t):t instanceof ur?this.handleThinkingEvent(t):t instanceof Li?this.handleToolRequestEvent(t):t instanceof hi?this.handleToolResponseEvent(t):t instanceof Vi?this.handleChoiceEvent(t):t instanceof Jo?this.handleHeartBeatEvent(t):t instanceof Ni?this.handleInviteEvent(t):t instanceof ta?this.handleThreadUpdateEvent(t):t instanceof na||t instanceof pi||console.warn("[CODAY] Unhandled event type:",t.type)}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:new 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:new 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:new 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:new 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:new 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()},ur.debounce+1e3))}handleToolRequestEvent(t){let e={id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:t.toSingleLineString()}],timestamp:new 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:new Date,type:"technical",eventId:t.timestamp};this.addMessage(e)}handleChoiceEvent(t){this.stopThinking(),this.currentChoiceEvent=t,this.tabTitleService?.setSystemInactive();let e=t.options.map(r=>({value:r,label:r})),n=t.optionalQuestion?`${t.optionalQuestion} ${t.invite}`:t.invite;this.currentChoiceSubject.next({options:e,label:n})}handleHeartBeatEvent(t){}handleInviteEvent(t){this.stopThinking();let e=this.messagesSubject.value,n=e[e.length-1];if(!(!(t.invite===_h)&&n&&n.role==="assistant"&&n.content.some(a=>a.type==="text"&&a.content.includes(t.invite)))&&t.invite!==_h){let a={id:t.timestamp,role:"assistant",speaker:"Assistant",content:[{type:"text",content:t.invite}],timestamp:new Date,type:"text"};this.addMessage(a)}this.currentInviteEventSubject.next(t),this.tabTitleService?.setSystemInactive()}addMessage(t){let n=[...this.messagesSubject.value,t];this.messagesSubject.next(n)}removeMessagesFromIndex(t){let e=this.messagesSubject.value,n=e.findIndex(o=>o.id===t);if(n===-1||n===0)return;let r=e.slice(0,n);this.messagesSubject.next(r),this.stopThinking()}extractTextContentFromMessage(t){return t?t.content.filter(e=>e.type==="text").map(e=>e.content).join(`
|
|
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||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})};var ra=class i{http=u(nt);agentsCache=new Map;getAgents(t){let e=this.agentsCache.get(t);return e?$(e):this.http.get(`/api/projects/${t}/agents`).pipe(ve(n=>{this.agentsCache.set(t,n)}))}getAgentsAutocomplete(t,e){return this.getAgents(t).pipe(X(n=>{if(!e)return n;let r=e.toLowerCase();return n.filter(o=>{let a=o.name.toLowerCase(),s=o.description?.toLowerCase()||"";return a.includes(r)||s.includes(r)})}))}clearCache(t){this.agentsCache.delete(t)}clearAllCache(){this.agentsCache.clear()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})};var Pn=class i{http=u(nt);projectState=u(Te);promptsCache=new Map;getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/prompts`}listPrompts(){return this.http.get(this.getBaseUrl())}getPromptsAutocomplete(t,e){let n=this.promptsCache.get(t);return n?$(this.filterPromptsForAutocomplete(n,e)):this.http.get(`/api/projects/${t}/prompts`).pipe(X(r=>(this.promptsCache.set(t,r),this.filterPromptsForAutocomplete(r,e))))}filterPromptsForAutocomplete(t,e){let n=e.toLowerCase();return t.filter(o=>o.name.toLowerCase().includes(n)||o.description.toLowerCase().includes(n)).map(o=>({name:o.name,description:o.description,parameterFormat:o.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(X(e=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),e)))}updatePrompt(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,e).pipe(X(n=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),n)))}deletePrompt(t){return this.http.delete(`${this.getBaseUrl()}/${t}`).pipe(X(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||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})};var ed=class i{sanitizer=u(ti);transform(t,e){if(!e||!t)return t;let n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`(${n})`,"gi"),o=t.replace(r,"<strong>$1</strong>");return this.sanitizer.bypassSecurityTrustHtml(o)}static \u0275fac=function(e){return new(e||i)};static \u0275pipe=kp({name:"highlight",type:i,pure:!0})};var RS=["messageInput"],FS=["fileInput"],NS=(i,t)=>t.name;function VS(i,t){i&1&&(l(0,"div",3),F(1,"span",7),h(2," Recording... Click mic to stop "),c())}function LS(i,t){if(i&1&&(l(0,"span",12),h(1),c()),i&2){let e=g().$implicit,n=g(2);m(),U(" "+(n.getParameterFormat(e)||""))}}function jS(i,t){if(i&1){let e=A();l(0,"div",9),b("click",function(){let r=y(e).$index,o=g(2);return C(o.selectAutocompleteItemByClick(r))})("keydown.enter",function(){let r=y(e).$index,o=g(2);return C(o.selectAutocompleteItemByClick(r))})("keydown.space",function(){let r=y(e).$index,o=g(2);return C(o.selectAutocompleteItemByClick(r))})("mouseenter",function(){let r=y(e).$index,o=g(2);return C(o.selectedAutocompleteIndex=r)}),l(1,"div",10),F(2,"span",11),Sr(3,"highlight"),w(4,LS,2,1,"span",12),c(),F(5,"div",13),Sr(6,"highlight"),c()}if(i&2){let e=t.$implicit,n=t.$index,r=g(2);R("selected",n===r.selectedAutocompleteIndex),K("aria-selected",n===r.selectedAutocompleteIndex),m(2),x("innerHTML",Oa(3,6,r.autocompleteTrigger+e.name,r.getAutocompleteQuery()),un),m(2),S(r.hasParameterFormat(e)?4:-1),m(),x("innerHTML",Oa(6,9,e.description,r.getAutocompleteQuery()),un)}}function zS(i,t){if(i&1&&(l(0,"div",4),Le(1,jS,7,12,"div",8,NS),c()),i&2){let e=g();m(),je(e.autocompleteItems)}}function BS(i,t){if(i&1){let e=A();l(0,"ds-icon-button",15),b("action",function(){y(e);let r=g(2);return C(r.onStopClick())}),c()}}function HS(i,t){if(i&1){let e=A();l(0,"ds-icon-button",18),b("action",function(){y(e);let r=g(3);return C(r.triggerFileUpload())}),c(),l(1,"input",19,1),b("change",function(r){y(e);let o=g(3);return C(o.onFileInputChange(r))}),c()}if(i&2){let e=g(3);x("disabled",e.isDisabled||e.isLocallyDisabled)}}function US(i,t){if(i&1){let e=A();l(0,"ds-icon-button",16),b("action",function(){y(e);let r=g(2);return C(r.sendMessage())}),c(),w(1,HS,3,1),l(2,"ds-icon-button",17),b("action",function(){y(e);let r=g(2);return C(r.toggleRecording())}),c()}if(i&2){let e=g(2);R("hidden",e.isDisabled||!e.message.trim()||e.isLocallyDisabled)("active",!!e.message.trim()&&!e.isDisabled&&!e.isLocallyDisabled),x("title",e.getSendButtonTooltip())("disabled",e.isDisabled||!e.message.trim()||e.isLocallyDisabled),m(),S(e.showWelcome?-1:1),m(),R("recording",e.isRecording)("hidden",e.message.trim()),x("icon",e.isRecording?"fiber_manual_record":"mic")("title",e.isRecording?"Click to stop recording":"Click to start recording")}}function $S(i,t){if(i&1&&w(0,BS,1,0,"ds-icon-button",14)(1,US,3,13),i&2){let e=g();S(e.isThinking?0:1)}}var oa=class i{static MIN_TEXTAREA_LINES=2;static MAX_TEXTAREA_LINES=15;isDisabled=!1;showWelcome=!1;isThinking=!1;isStarting=!1;isSessionInitializing=!1;isStopping=!1;isLocallyDisabled=!1;filesPasted=new H;messageSubmitted=new H;voiceRecordingToggled=new H;heightChanged=new H;stopRequested=new H;messageInput;fileInput;message="";isRecording=!1;isFocused=!1;recognition=null;sessionHadTranscript=!1;pendingLineBreaksTimeout=null;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=u(mt);codayService=u(On);agentApiService=u(ra);promptApiService=u(Pn);projectStateService=u(Te);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,this.isLocallyDisabled=!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"),this.isLocallyDisabled=!1,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 n=Array.from(e).filter(o=>o.kind==="file");if(!n.length)return;t.preventDefault();let r=n.reduce((o,a)=>{let s=a.getAsFile();return s?[...o,s]:o},[]);r.length&&this.filesPasted.emit(r)}triggerFileUpload(){console.log("[CHAT-TEXTAREA] Triggering file upload"),this.fileInput?.nativeElement?.click()}onFileInputChange(t){let e=t.target,n=e.files;if(!n||n.length===0){console.log("[CHAT-TEXTAREA] No files selected");return}console.log("[CHAT-TEXTAREA] Files selected:",n.length);let r=Array.from(n);this.filesPasted.emit(r),e.value=""}onDocumentClick(t){if(!this.autocompleteVisible)return;let e=t.target,n=document.querySelector(".autocomplete-popup"),r=this.messageInput?.nativeElement;n&&!n.contains(e)&&r&&!r.contains(e)&&this.hideAutocomplete()}sendMessage(t=!1){let e=this.message.trim();!this.isDisabled&&!this.isLocallyDisabled&&(t||e)&&(this.isLocallyDisabled=!0,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 n="";for(let r=e.resultIndex;r<e.results.length;r++){let o=e.results[r][0].transcript;e.results[r].isFinal&&(n+=o)}if(n){let r=this.improveTranscriptPunctuation(n.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.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.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 re(this,null,function*(){if(!(!this.recognition||this.isRecording))try{this.isRecording=!0,this.sessionHadTranscript=!1,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 n=this.message.length;this.messageInput.nativeElement.setSelectionRange(n,n)}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
|
-
|
|
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),n=parseFloat(e.fontSize),r=parseFloat(e.lineHeight)||n*1.5,o=r*i.MIN_TEXTAREA_LINES+parseFloat(e.paddingTop)+parseFloat(e.paddingBottom),a=r*i.MAX_TEXTAREA_LINES+parseFloat(e.paddingTop)+parseFloat(e.paddingBottom);t.style.height="auto";let s=t.scrollHeight;s<o?s=o:s>a&&(s=a),t.style.height=`${s}px`;let d=t.parentElement?.offsetHeight??s+32;this.heightChanged.emit(d)}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,this.isLocallyDisabled=!1,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,n=this.message.length;e.setSelectionRange(n,n)},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:n=>{this.autocompleteItems=n,this.autocompleteVisible=n.length>0,this.selectedAutocompleteIndex=0},error:n=>{console.error("[AUTOCOMPLETE] Error loading agents:",n),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:n=>{this.autocompleteItems=n,this.autocompleteVisible=n.length>0,this.selectedAutocompleteIndex=0},error:n=>{console.error("[AUTOCOMPLETE] Error loading prompts:",n),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 n=t,r=n.parameterFormat;if(console.log(n),r===void 0)this.message=`/${t.name}`;else if(r==="")this.message=`/${t.name} `;else{this.message=`/${t.name} ${r}`;let o=this.message.indexOf('=""');o!==-1&&(e=o+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 n=this.message.length;this.messageInput.nativeElement.setSelectionRange(n,n)}},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||i)};static \u0275cmp=P({type:i,selectors:[["app-chat-textarea"]],viewQuery:function(e,n){if(e&1&&(se(RS,7),se(FS,5)),e&2){let r;G(r=Y())&&(n.messageInput=r.first),G(r=Y())&&(n.fileInput=r.first)}},hostBindings:function(e,n){e&1&&b("paste",function(o){return n.onPaste(o)})("click",function(o){return n.onDocumentClick(o)},xp)},inputs:{isDisabled:"isDisabled",showWelcome:"showWelcome",isThinking:"isThinking",isStarting:"isStarting",isSessionInitializing:"isSessionInitializing"},outputs:{filesPasted:"filesPasted",messageSubmitted:"messageSubmitted",voiceRecordingToggled:"voiceRecordingToggled",heightChanged:"heightChanged",stopRequested:"stopRequested"},features:[Ne],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","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,n){if(e&1){let r=A();l(0,"div",2),w(1,VS,3,0,"div",3),w(2,zS,3,0,"div",4),l(3,"div",5)(4,"textarea",6,0),B("ngModelChange",function(a){return y(r),z(n.message,a)||(n.message=a),C(a)}),b("keydown",function(a){return y(r),C(n.onKeyDown(a))})("input",function(){return y(r),C(n.onInput())})("focus",function(){return y(r),C(n.isFocused=!0)})("blur",function(){return y(r),C(n.isFocused=!1)}),c(),w(6,$S,2,1),c()()}e&2&&(m(),S(n.isRecording?1:-1),m(),S(n.autocompleteVisible?2:-1),m(),R("focused",n.isFocused)("welcome-mode",n.showWelcome)("is-thinking",n.isThinking),m(),j("ngModel",n.message),x("placeholder",n.getPlaceholder())("disabled",n.isDisabled||n.isThinking||n.isLocallyDisabled),m(2),S(n.isSessionInitializing?-1:6))},dependencies:[ot,Ge,rt,Xe,ng,ed],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 WS=(i,t)=>t.label;function qS(i,t){if(i&1){let e=A();l(0,"button",2),b("click",function(r){let o=y(e).$implicit,a=g();return C(a.executeAction(o,r))}),l(1,"mat-icon"),h(2),c()()}if(i&2){let e=t.$implicit;K("title",e.tooltip||e.label),m(),K("aria-label",e.label),m(),U(e.icon)}}var td=class i{actions=[];executeAction(t,e){e.stopPropagation(),t.action()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=P({type:i,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,n){e&1&&(l(0,"div",0),Le(1,qS,3,3,"button",1,WS),c()),e&2&&(m(),je(n.actions))},dependencies:[Be,Et,Ee],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 nd=class i{snackBar=u(ss);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||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})};var GS=i=>({"user-message-wrapper":i});function YS(i,t){if(i&1&&(l(0,"div",5)(1,"div",8),h(2),c()()),i&2){let e=g(2);m(2),ue(" ",e.message.speaker," ")}}function QS(i,t){if(i&1&&(l(0,"div",7),F(1,"app-message-context-menu",9),c()),i&2){let e=g(2);m(),x("actions",e.actions)}}function XS(i,t){if(i&1&&(w(0,YS,3,1,"div",5),F(1,"div",6),w(2,QS,2,1,"div",7)),i&2){let e=g();S(e.shouldShowSpeaker?0:-1),m(),x("innerHTML",e.renderedContent,un),m(),S(e.isLongMessage&&e.shouldShowActions&&e.message.role==="assistant"?2:-1)}}function KS(i,t){if(i&1&&(l(0,"a",11),h(1,"view"),c()),i&2){let e=g(2);x("href",e.eventLink,go)}}function ZS(i,t){if(i&1&&(l(0,"div",2),F(1,"span",10),w(2,KS,2,1,"a",11),c()),i&2){let e=g();m(),x("innerHTML",e.renderedContent,un),m(),S(e.eventLink?2:-1)}}function JS(i,t){if(i&1&&(l(0,"div",3),F(1,"app-message-context-menu",9),c()),i&2){let e=g();m(),x("actions",e.actions)}}function ek(i,t){if(i&1&&(l(0,"div",4),F(1,"app-message-context-menu",9),c()),i&2){let e=g();m(),x("actions",e.actions)}}var id=class i{destroy$=new I;message;canDelete=!0;copyRequested=new H;deleteRequested=new H;renderedContent="";shouldHideTechnical=!1;shouldHideWarning=!1;sanitizer=u(ti);notificationService=u(nd);preferencesService=u(mt);projectState=u(Te);threadState=u(Bt);markdownService=u(ui);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 re(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"}get isLongMessage(){let t=this.extractTextContent();return t.length>1e3||t.split(`
|
|
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 re(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 re(this,null,function*(){let e=[];for(let n of t)if(n.type==="text"){let r=yield this.markdownService.parse(n.content);e.push(`<div class="text-part">${r}</div>`)}else if(n.type==="image"){let r=`data:${n.mimeType};base64,${n.content}`,o=n.source||"Image",a=`
|
|
342
|
-
<div class="image-content">
|
|
343
|
-
<img src="${r}"
|
|
344
|
-
alt="${o}"
|
|
345
|
-
class="message-image"
|
|
346
|
-
style="max-width: 100%; height: auto; margin: 8px 0; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.2s ease, box-shadow 0.2s ease;"
|
|
347
|
-
onclick="window.open(this.src, '_blank')" />
|
|
348
|
-
</div>
|
|
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
|
-
|
|
351
|
-
`)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=P({type:i,selectors:[["app-chat-message"]],inputs:{message:"message",canDelete:"canDelete"},outputs:{copyRequested:"copyRequested",deleteRequested:"deleteRequested"},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,"actions","bottom-actions"],[1,"speaker"],[3,"actions"],[3,"innerHTML"],["target","_blank",1,"event-link",3,"href"]],template:function(e,n){e&1&&(l(0,"div",0)(1,"div",1),w(2,XS,3,3),w(3,ZS,3,2,"div",2),c(),w(4,JS,2,1,"div",3),w(5,ek,2,1,"div",4),c()),e&2&&(x("ngClass",Pp(6,GS,n.message.role==="user")),m(),x("ngClass",n.messageClasses),m(),S(n.isSimplified?-1:2),m(),S(n.isSimplified?3:-1),m(),S(!n.isLongMessage&&n.shouldShowActions&&n.message.role==="assistant"?4:-1),m(),S(n.shouldShowActions&&n.message.role==="user"?5:-1))},dependencies:[td,_o],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;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%]: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 aa=class i{unreadCountSubject=new Z(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||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})};var sa=class i{destroy$=new I;voices;currentUtterance=null;currentOnEndCallback=null;speakingSubject=new Z(!1);speaking$=this.speakingSubject.asObservable();volume=.8;rate=1.2;language="en-US";selectedVoice;preferencesService=u(mt);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 n=speechSynthesis.getVoices();if(n.length)t(n);else{let r=setTimeout(()=>{e("no voices found")},2e3);speechSynthesis.addEventListener("voiceschanged",()=>{let o=speechSynthesis.getVoices();o.length&&(clearTimeout(r),t(o))})}}),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 re(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 n=this.extractPlainText(t);if(!n.trim())return console.warn("[VOICE-SERVICE] No text to speak after markdown cleaning"),!1;this.stopSpeech();try{let r=new SpeechSynthesisUtterance(n);r.voice=this.selectedVoice,r.lang=this.selectedVoice.lang,r.volume=this.volume,r.rate=this.rate,this.currentOnEndCallback=e||null,e&&(r.onend=()=>{this.currentOnEndCallback===e&&(this.currentOnEndCallback=null,e())},r.onerror=()=>{this.currentOnEndCallback===e&&(this.currentOnEndCallback=null,e())}),this.currentUtterance=r,this.speakingSubject.next(!0);let o=r.onend,a=r.onerror;return r.onend=s=>{this.speakingSubject.next(!1),o&&o.call(r,s)},r.onerror=s=>{this.speakingSubject.next(!1),a&&a.call(r,s)},speechSynthesis.speak(r),console.log("[VOICE-SERVICE] Started speaking:",t.substring(0,50)+"..."),!0}catch(r){return console.error("[VOICE-SERVICE] Error speaking:",r),!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(),n=t.createGain();e.connect(n),n.connect(t.destination),e.frequency.setValueAtTime(800,t.currentTime),n.gain.setValueAtTime(.1,t.currentTime),n.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 re(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 n=e.filter(r=>r.lang.toLowerCase().startsWith(t)).sort((r,o)=>r.localService&&!o.localService?-1:!r.localService&&o.localService?1:r.name.localeCompare(o.name));return console.log("[VOICE-SERVICE] Found matching voices:",n.length,"for language:",t),n.map(r=>({name:r.name,lang:r.lang,localService:r.localService,default:r.default,displayName:this.formatVoiceDisplayName(r)}))}catch(t){return console.error("[VOICE-SERVICE] Error getting voices for language:",t),[]}})}formatVoiceDisplayName(t){let e=t.localService?"\u{1F3E0}":"\u2601\uFE0F",n=t.default?" \u2B50":"";return`${e} ${t.name} (${t.lang})${n}`}setSelectedVoice(t){return re(this,null,function*(){if(!t){this.selectedVoice=void 0;return}let[e,n]=t.split("|");if(!e||!n){this.selectedVoice=void 0;return}let r=(yield this.voices)?.find(o=>o.name===e&&o.lang===n);r?(this.selectedVoice=r,console.log("[VOICE-SERVICE] Selected voice:",r.name,r.lang)):(this.selectedVoice=void 0,console.warn("[VOICE-SERVICE] Voice not found:",e,n))})}updateSelectedVoiceForLanguage(){return re(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[r,o]=e.split("|"),a=o?.slice(0,2),s=this.language.slice(0,2);if(a===s&&t.some(p=>p.name===r&&p.lang===o)){console.log("[VOICE-SERVICE] Keeping current voice for language:",e);return}}let n=t[0];if(n){let r=`${n.name}|${n.lang}`;this.preferencesService.setSelectedVoice(r),console.log("[VOICE-SERVICE] Auto-selected voice for language change:",n.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,`
|
|
352
|
-
`).split(`
|
|
353
|
-
`).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||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})};var rd=class i{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||i)};static \u0275cmp=P({type:i,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,n){e&1&&(wn(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),wr(5,"img",5),Sn(),wn(6,"p",6),h(7),Sn()()()()()),e&2&&(m(7),U(n.currentThinkingPhrase))},dependencies:[Be],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 tk=(i,t)=>t.id;function nk(i,t){if(i&1){let e=A();l(0,"app-chat-message",4),b("copyRequested",function(r){y(e);let o=g();return C(o.onCopyMessage(r))})("deleteRequested",function(r){y(e);let o=g();return C(o.onDeleteMessage(r))}),c()}if(i&2){let e=t.$implicit,n=t.$index,r=g();x("message",e)("canDelete",r.canDeleteMessage(n))}}function ik(i,t){if(i&1&&(l(0,"div",2),F(1,"div",5),c()),i&2){let e=g();m(),x("innerHTML",e.renderedStreamingText,un)}}function rk(i,t){i&1&&F(0,"app-thinking-loader")}function ok(i,t){if(i&1){let e=A();l(0,"button",6),b("click",function(){y(e);let r=g();return C(r.goToBottom())}),l(1,"mat-icon",7),h(2,"arrow_downward"),c()()}}var od=class i{messages=[];streamingText="";isThinking=!1;copyRequested=new H;stopRequested=new H;lastMessageCount=0;destroy$=new I;renderedStreamingText="";isTracking=!0;showGoToBottom=!1;scrollContainer=null;lastScrollTop=0;NEAR_BOTTOM_THRESHOLD=100;scrollCheckTimeout;isProgrammaticScroll=!1;MESSAGE_FRESHNESS_THRESHOLD=300*1e3;elementRef=u(ae);unreadService=u(aa);voiceSynthesisService=u(sa);preferencesService=u(mt);codayService=u(On);markdownService=u(ui);sanitizer=u(ti);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(n=>n.type==="text").map(n=>n.content).join(`
|
|
354
|
-
|
|
355
|
-
`);navigator.clipboard.writeText(e).then(()=>console.log("Message copied")).catch(n=>console.error("Failed to copy:",n)),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(r=>r.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?
|
|
356
|
-
|
|
357
|
-
This action cannot be undone once you post another message.`)&&(console.log("[CHAT-HISTORY] Proceeding with message deletion"),this.codayService.deleteMessage(t.id).subscribe({next:r=>{r.success?console.log("[CHAT-HISTORY] Message deleted successfully"):(console.error("[CHAT-HISTORY] Failed to delete message:",r.error),alert(`Failed to delete message: ${r.error}`))},error:r=>{console.error("[CHAT-HISTORY] Error deleting message:",r),alert(`Error deleting message: ${r.message||"Unknown error"}`)}}))}onScroll(){}findScrollContainer(){let t=this.elementRef.nativeElement;this.scrollContainer=t.closest(".chat-wrapper"),this.scrollContainer?(console.log("[CHAT-HISTORY] Scroll container found"),this.scrollContainer.addEventListener("scroll",this.handleScroll.bind(this)),this.lastScrollTop=this.scrollContainer.scrollTop,this.checkScrollPosition()):(console.warn("[CHAT-HISTORY] Scroll container not found"),setTimeout(()=>this.findScrollContainer(),100))}handleScroll=()=>{if(!this.scrollContainer)return;let t=this.scrollContainer.scrollTop;if(Math.abs(t-this.lastScrollTop)<1){this.lastScrollTop=t;return}if(this.isProgrammaticScroll){this.lastScrollTop=t;return}console.log("[CHAT-HISTORY] User scroll detected - disabling auto-scroll"),this.isTracking&&(this.isTracking=!1,this.showGoToBottom=!0),clearTimeout(this.scrollCheckTimeout),this.scrollCheckTimeout=setTimeout(()=>{this.checkScrollPosition()},500),this.lastScrollTop=t};checkScrollPosition(){if(!this.scrollContainer)return;let{scrollTop:t,scrollHeight:e,clientHeight:n}=this.scrollContainer,o=e-t-n<=this.NEAR_BOTTOM_THRESHOLD;o&&!this.isTracking&&(console.log("[CHAT-HISTORY] Near bottom - re-enabling auto-scroll"),this.isTracking=!0,this.showGoToBottom=!1,this.unreadService.markAllAsRead()),!this.isTracking&&!o&&(this.showGoToBottom=!0)}goToBottom(){console.log("[CHAT-HISTORY] Go to bottom clicked - re-enabling auto-scroll"),this.scrollToBottom(),this.isTracking=!0,this.showGoToBottom=!1,this.unreadService.markAllAsRead()}handleNewMessages(t){let n=this.messages.slice(-t).filter(o=>o.role==="assistant");if(n.length===0){console.log("[CHAT-HISTORY] No new assistant messages to count");return}if(this.shouldMarkNewMessagesAsUnread()){console.log("[CHAT-HISTORY] Marking",n.length,"new assistant messages as unread");for(let o=0;o<n.length;o++)this.unreadService.addUnread()}else console.log("[CHAT-HISTORY] New assistant messages are considered read (user is focused and tracking)")}shouldMarkNewMessagesAsUnread(){return document.hasFocus()?this.isTracking?!1:(console.log("[CHAT-HISTORY] User is not tracking (scrolled up) -> unread"),!0):(console.log("[CHAT-HISTORY] Tab does not have focus -> unread"),!0)}setupFocusListeners(){window.addEventListener("focus",this.handleWindowFocus),window.addEventListener("blur",this.handleWindowBlur)}handleWindowFocus=()=>{console.log("[CHAT-HISTORY] Window gained focus"),this.isTracking&&(console.log("[CHAT-HISTORY] User is tracking and focused -> marking messages as read"),this.unreadService.markAllAsRead())};handleWindowBlur=()=>{console.log("[CHAT-HISTORY] Window lost focus")};handleVoiceAnnouncement(t){if(!this.preferencesService.getVoiceAnnounceEnabled())return;let r=this.messages.slice(-t).filter(s=>s.role==="assistant");if(r.length===0){console.log("[CHAT-HISTORY] No new assistant messages to announce");return}let o=r[r.length-1];if(!o){console.warn("[CHAT-HISTORY] No last assistant message found");return}if(!this.isMessageRecentEnoughForAnnouncement(o)){console.log("[CHAT-HISTORY] Message too old for voice announcement");return}if(this.preferencesService.getVoiceMode()==="notification")console.log("[CHAT-HISTORY] Playing notification sound for new assistant message"),this.voiceSynthesisService.ding();else{let s=this.extractTextContentFromMessage(o);if(s.trim()){console.log("[CHAT-HISTORY] Announcing new assistant message via speech");let p=this.preferencesService.getVoiceReadFullText()?s:this.extractPartialText(s);this.voiceSynthesisService.speak(p).then(f=>{f||console.warn("[CHAT-HISTORY] Failed to announce message via speech")}).catch(f=>{console.error("[CHAT-HISTORY] Error during voice announcement:",f)})}}}isMessageRecentEnoughForAnnouncement(t){try{let e=t.timestamp.getTime();return Date.now()-e<=this.MESSAGE_FRESHNESS_THRESHOLD}catch(e){return console.warn("[CHAT-HISTORY] Error checking message freshness:",e),!0}}extractTextContentFromMessage(t){return t.content.filter(e=>e.type==="text").map(e=>e.content).join(`
|
|
358
|
-
|
|
359
|
-
`)}extractPartialText(t){return t.split(`
|
|
360
|
-
`).filter(a=>a.trim().length>0).reduce((a,s)=>{if(a.paragraphs>=3)return a;let d=s.length>80?1:0;return{paragraphs:a.paragraphs+d,text:a.text+(a.text?`
|
|
361
|
-
`:"")+s}},{paragraphs:0,text:""}).text||t}renderStreamingText(){return re(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||i)};static \u0275cmp=P({type:i,selectors:[["app-chat-history"]],hostBindings:function(e,n){e&1&&b("scroll",function(){return n.onScroll()})},inputs:{messages:"messages",streamingText:"streamingText",isThinking:"isThinking"},outputs:{copyRequested:"copyRequested",stopRequested:"stopRequested"},features:[Ne],decls:6,vars:3,consts:[[1,"chat-history"],[3,"message","canDelete"],[1,"streaming-message","message","assistant"],["mat-fab","","color","primary","title","Go to bottom",1,"go-to-bottom-btn"],[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,n){e&1&&(l(0,"div",0),Le(1,nk,1,2,"app-chat-message",1,tk),w(3,ik,2,1,"div",2),w(4,rk,1,0,"app-thinking-loader"),w(5,ok,3,0,"button",3),c()),e&2&&(m(),je(n.messages),m(2),S(n.streamingText?3:-1),m(),S(n.isThinking?4:-1),m(),S(n.showGoToBottom?5:-1))},dependencies:[id,Ee,rd,fl],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 ad=class i{http=u(nt);projectState=u(Te);threadState=u(Bt);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads/${this.threadState.getSelectedThreadIdOrThrow()}/files`}uploadFile(t){let e=this.projectState.getSelectedProjectIdOrThrow(),n=this.threadState.getSelectedThreadIdOrThrow();return new nn(r=>{let o=new FileReader;o.onload=()=>{let s=o.result.split(",")[1];this.http.post(`/api/projects/${e}/threads/${n}/upload`,{content:s,mimeType:t.type||"application/octet-stream",filename:t.name}).subscribe({next:d=>{r.next({success:d.success,filename:d.filename}),r.complete()},error:d=>r.error(d)})},o.onerror=()=>r.error(new Error("Failed to read file")),o.readAsDataURL(t)})}listFiles(){return this.http.get(this.getBaseUrl()).pipe(X(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||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})};var la=class i{fileApi=u(ad);eventStream=u(gi);filesSignal=Me([]);isLoadingSignal=Me(!1);currentProjectSignal=Me(null);currentThreadSignal=Me(null);files=Ct(()=>this.filesSignal());isLoading=Ct(()=>this.isLoadingSignal());fileCount=Ct(()=>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(n=>be(M({},n),{lastModified:new Date(n.lastModified)})).sort((n,r)=>r.lastModified.getTime()-n.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 re(this,null,function*(){return new Promise(e=>{this.fileApi.uploadFile(t).subscribe({next:()=>{this.refreshFileList(),e({success:!0})},error:n=>{console.error("[FILE_EXCHANGE_STATE] Upload error:",n),e({success:!1,error:n.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,n)=>{setTimeout(()=>{this.downloadFile(e.filename)},n*300)})}downloadFile(t){this.fileApi.downloadFile(t).subscribe({next:e=>{let n=window.URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=t,r.click(),window.URL.revokeObjectURL(n)},error:e=>{console.error("[FILE_EXCHANGE_STATE] Download error:",e)}})}deleteFile(t){return re(this,null,function*(){return new Promise(e=>{this.fileApi.deleteFile(t).subscribe({next:()=>{this.refreshFileList(),e({success:!0})},error:n=>{console.error("[FILE_EXCHANGE_STATE] Delete error:",n),e({success:!1,error:n.message||"Delete failed"})}})})})}subscribeToFileEvents(){this.eventStream.events$.pipe(le(t=>t instanceof mr),wc()).subscribe(t=>{this.handleFileEvent(t)})}handleFileEvent(t){let e=this.filesSignal();switch(t.operation){case"created":{let n=t.timestamp,r=t.timestamp.lastIndexOf("-");if(r>0){let a=t.timestamp.substring(r+1);a.length===5&&/^[a-z0-9]+$/.test(a)&&(n=t.timestamp.substring(0,r))}let o={filename:t.filename,size:t.size||0,lastModified:new Date(n)};this.filesSignal.set([o,...e]);break}case"updated":{let n=e.filter(d=>d.filename!==t.filename),r=e.find(d=>d.filename===t.filename),o=t.timestamp,a=t.timestamp.lastIndexOf("-");if(a>0){let d=t.timestamp.substring(a+1);d.length===5&&/^[a-z0-9]+$/.test(d)&&(o=t.timestamp.substring(0,a))}let s={filename:t.filename,size:t.size||r?.size||0,lastModified:new Date(o)};this.filesSignal.set([s,...n]);break}case"deleted":{let n=e.filter(r=>r.filename!==t.filename);this.filesSignal.set(n);break}}}static \u0275fac=function(e){return new(e||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})};var ak=["determinateSpinner"];function sk(i,t){if(i&1&&(Ci(),l(0,"svg",11),F(1,"circle",12),c()),i&2){let e=g();K("viewBox",e._viewBox()),m(),ei("stroke-dasharray",e._strokeCircumference(),"px")("stroke-dashoffset",e._strokeCircumference()/2,"px")("stroke-width",e._circleStrokeWidth(),"%"),K("r",e._circleRadius())}}var lk=new q("mat-progress-spinner-default-options",{providedIn:"root",factory:ck});function ck(){return{diameter:Vb}}var Vb=100,dk=10,sd=(()=>{class i{_elementRef=u(ae);_noopAnimations;get color(){return this._color||this._defaultColor}set color(e){this._color=e}_color;_defaultColor="primary";_determinateCircle;constructor(){let e=u(lk),n=tg(),r=this._elementRef.nativeElement;this._noopAnimations=n==="di-disabled"&&!!e&&!e._forceAnimations,this.mode=r.nodeName.toLowerCase()==="mat-spinner"?"indeterminate":"determinate",!this._noopAnimations&&n==="reduced-motion"&&r.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=Vb;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(e){this._strokeWidth=e||0}_strokeWidth;_circleRadius(){return(this.diameter-dk)/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(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(n,r){if(n&1&&se(ak,5),n&2){let o;G(o=Y())&&(r._determinateCircle=o.first)}},hostAttrs:["role","progressbar","tabindex","-1",1,"mat-mdc-progress-spinner","mdc-circular-progress"],hostVars:18,hostBindings:function(n,r){n&2&&(K("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",r.mode==="determinate"?r.value:null)("mode",r.mode),wi("mat-"+r.color),ei("width",r.diameter,"px")("height",r.diameter,"px")("--mat-progress-spinner-size",r.diameter+"px")("--mat-progress-spinner-active-indicator-width",r.diameter+"px"),R("_mat-animation-noopable",r._noopAnimations)("mdc-circular-progress--indeterminate",r.mode==="indeterminate"))},inputs:{color:"color",mode:"mode",value:[2,"value","value",Nn],diameter:[2,"diameter","diameter",Nn],strokeWidth:[2,"strokeWidth","strokeWidth",Nn]},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(n,r){if(n&1&&(tt(0,sk,2,8,"ng-template",null,0,rl),l(2,"div",2,1),Ci(),l(4,"svg",3),F(5,"circle",4),c()(),Zs(),l(6,"div",5)(7,"div",6)(8,"div",7),il(9,8),c(),l(10,"div",9),il(11,8),c(),l(12,"div",10),il(13,8),c()()()),n&2){let o=hn(1);m(4),K("viewBox",r._viewBox()),m(),ei("stroke-dasharray",r._strokeCircumference(),"px")("stroke-dashoffset",r._strokeDashOffset(),"px")("stroke-width",r._circleStrokeWidth(),"%"),K("r",r._circleRadius()),m(4),x("ngTemplateOutlet",o),m(2),x("ngTemplateOutlet",o),m(2),x("ngTemplateOutlet",o)}},dependencies:[sl],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)}}
|
|
362
|
-
`],encapsulation:2,changeDetection:0})}return i})();var ld=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=de({type:i});static \u0275inj=ce({imports:[pe]})}return i})();function uk(i,t){if(i&1&&F(0,"div",1),i&2){let e=g();x("innerHTML",e.renderedContent,un)}}function mk(i,t){if(i&1&&F(0,"iframe",2),i&2){let e=g();x("srcdoc",e.content,un)}}function hk(i,t){if(i&1&&(l(0,"pre",3),h(1),c()),i&2){let e=g();m(),U(e.content)}}var cd=class i{content="";format="text";renderedContent="";sanitizer=u(ti);markdownService=u(ui);ngOnChanges(t){(t.content||t.format)&&this.renderContent()}renderContent(){this.format==="markdown"?this.renderMarkdown():this.format==="json"&&this.formatJson()}renderMarkdown(){return re(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||i)};static \u0275cmp=P({type:i,selectors:[["app-content-renderer"]],inputs:{content:"content",format:"format"},features:[Ne],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,n){e&1&&(l(0,"div",0),w(1,uk,1,1,"div",1)(2,mk,1,1,"iframe",2)(3,hk,2,1,"pre",3),c()),e&2&&(x("ngClass","format-"+n.format),m(),S(n.format==="markdown"?1:n.format==="html"?2:3))},dependencies:[Be,_o],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 ca=class i{http=u(nt);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,n){let r=`/api/projects/${t}/threads/${e}/files/${encodeURIComponent(n)}`,o=this.detectFormat(n);return this.http.get(r,{responseType:"text",observe:"response"}).pipe(X(a=>{let s=a.body||"",d=new Blob([s]).size;return{content:s,format:o,filename:n,size:d}}),on(a=>(console.error("[CONTENT_VIEWER] Error loading file:",n,a),Xn(()=>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||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})};function pk(i,t){if(i&1){let e=A();l(0,"button",12),b("click",function(){y(e);let r=g();return C(r.download())}),l(1,"mat-icon"),h(2,"download"),c()()}}function gk(i,t){i&1&&(l(0,"div",9),F(1,"mat-spinner",13),l(2,"p"),h(3,"Loading file content..."),c()())}function fk(i,t){if(i&1){let e=A();l(0,"div",10)(1,"mat-icon",14),h(2,"error_outline"),c(),l(3,"p",15),h(4),c(),l(5,"button",16),b("click",function(){y(e);let r=g();return C(r.download())}),l(6,"mat-icon"),h(7,"download"),c(),h(8," Download instead "),c()()}if(i&2){let e=g();m(4),U(e.error)}}function _k(i,t){if(i&1&&F(0,"app-content-renderer",11),i&2){let e=g();x("content",e.fileContent.content)("format",e.fileContent.format)}}var dd=class i{destroy$=new I;file;projectName;threadId;closeViewer=new H;contentService=u(ca);eventStream=u(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),n=document.createElement("a");n.href=e,n.download=this.file.filename,n.click(),window.URL.revokeObjectURL(e)}formatSize(t){return this.contentService.formatSize(t)}subscribeToFileEvents(){this.eventStream.events$.pipe(le(t=>t instanceof mr),le(t=>t.filename===this.file.filename),le(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||i)};static \u0275cmp=P({type:i,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,n){e&1&&(l(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),h(4),c(),l(5,"span",4),h(6),c()(),l(7,"div",5),w(8,pk,3,0,"button",6),l(9,"button",7),b("click",function(){return n.onClose()}),l(10,"mat-icon"),h(11,"chevron_right"),c()()()(),l(12,"div",8),w(13,gk,4,0,"div",9),w(14,fk,9,1,"div",10),w(15,_k,1,2,"app-content-renderer",11),c()()),e&2&&(m(4),U(n.file.filename),m(2),U(n.formatSize(n.file.size)),m(2),S(n.fileContent&&!n.isLoading&&!n.error?8:-1),m(5),S(n.isLoading?13:-1),m(),S(n.error?14:-1),m(),S(n.fileContent&&!n.isLoading&&!n.error?15:-1))},dependencies:[Be,it,Ee,Tt,zt,Et,ld,sd,cd],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 bk=Math.pow(10,8)*24*60*60*1e3,Tj=-bk,ud=6048e5,zb=864e5;var vk=3600;var Bb=vk*24,Oj=Bb*7,yk=Bb*365.2425,Ck=yk/12,Pj=Ck*3,vh=Symbol.for("constructDateFrom");function bt(i,t){return typeof i=="function"?i(t):i&&typeof i=="object"&&vh in i?i[vh](t):i instanceof Date?new i.constructor(t):new Date(t)}function at(i,t){return bt(t||i,i)}function Hb(i,t,e){let n=at(i,e?.in);return isNaN(t)?bt(e?.in||i,NaN):(t&&n.setDate(n.getDate()+t),n)}var xk={};function pr(){return xk}function zi(i,t){let e=pr(),n=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=at(i,t?.in),o=r.getDay(),a=(o<n?7:0)+o-n;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}function Jr(i,t){return zi(i,be(M({},t),{weekStartsOn:1}))}function md(i,t){let e=at(i,t?.in),n=e.getFullYear(),r=bt(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);let o=Jr(r),a=bt(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);let s=Jr(a);return e.getTime()>=o.getTime()?n+1:e.getTime()>=s.getTime()?n:n-1}function yh(i){let t=at(i),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+i-+e}function da(i,...t){let e=bt.bind(null,i||t.find(n=>typeof n=="object"));return t.map(e)}function ua(i,t){let e=at(i,t?.in);return e.setHours(0,0,0,0),e}function hd(i,t,e){let[n,r]=da(e?.in,i,t),o=ua(n),a=ua(r),s=+o-yh(o),d=+a-yh(a);return Math.round((s-d)/zb)}function Ub(i,t){let e=md(i,t),n=bt(t?.in||i,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),Jr(n)}function $b(i){return bt(i,Date.now())}function Wb(i,t,e){let[n,r]=da(e?.in,i,t);return+ua(n)==+ua(r)}function qb(i){return i instanceof Date||typeof i=="object"&&Object.prototype.toString.call(i)==="[object Date]"}function Gb(i){return!(!qb(i)&&typeof i!="number"||isNaN(+at(i)))}function Qb(i,t,e){let[n,r]=da(e?.in,i,t),o=Yb(n,r),a=Math.abs(hd(n,r));n.setDate(n.getDate()-o*a);let s=+(Yb(n,r)===-o),d=o*(a-s);return d===0?0:d}function Yb(i,t){let e=i.getFullYear()-t.getFullYear()||i.getMonth()-t.getMonth()||i.getDate()-t.getDate()||i.getHours()-t.getHours()||i.getMinutes()-t.getMinutes()||i.getSeconds()-t.getSeconds()||i.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function Xb(i,t){let e=at(i,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}var wk={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"}},Kb=(i,t,e)=>{let n,r=wk[i];return typeof r=="string"?n=r:t===1?n=r.one:n=r.other.replace("{{count}}",t.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+n:n+" ago":n};function pd(i){return(t={})=>{let e=t.width?String(t.width):i.defaultWidth;return i.formats[e]||i.formats[i.defaultWidth]}}var Sk={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},kk={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Mk={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Zb={date:pd({formats:Sk,defaultWidth:"full"}),time:pd({formats:kk,defaultWidth:"full"}),dateTime:pd({formats:Mk,defaultWidth:"full"})};var Ek={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Jb=(i,t,e,n)=>Ek[i];function ma(i){return(t,e)=>{let n=e?.context?String(e.context):"standalone",r;if(n==="formatting"&&i.formattingValues){let a=i.defaultFormattingWidth||i.defaultWidth,s=e?.width?String(e.width):a;r=i.formattingValues[s]||i.formattingValues[a]}else{let a=i.defaultWidth,s=e?.width?String(e.width):i.defaultWidth;r=i.values[s]||i.values[a]}let o=i.argumentCallback?i.argumentCallback(t):t;return r[o]}}var Tk={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ok={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Pk={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"]},Ak={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"]},Dk={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"}},Ik={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"}},Rk=(i,t)=>{let e=Number(i),n=e%100;if(n>20||n<10)switch(n%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},ev={ordinalNumber:Rk,era:ma({values:Tk,defaultWidth:"wide"}),quarter:ma({values:Ok,defaultWidth:"wide",argumentCallback:i=>i-1}),month:ma({values:Pk,defaultWidth:"wide"}),day:ma({values:Ak,defaultWidth:"wide"}),dayPeriod:ma({values:Dk,defaultWidth:"wide",formattingValues:Ik,defaultFormattingWidth:"wide"})};function ha(i){return(t,e={})=>{let n=e.width,r=n&&i.matchPatterns[n]||i.matchPatterns[i.defaultMatchWidth],o=t.match(r);if(!o)return null;let a=o[0],s=n&&i.parsePatterns[n]||i.parsePatterns[i.defaultParseWidth],d=Array.isArray(s)?Nk(s,v=>v.test(a)):Fk(s,v=>v.test(a)),p;p=i.valueCallback?i.valueCallback(d):d,p=e.valueCallback?e.valueCallback(p):p;let f=t.slice(a.length);return{value:p,rest:f}}}function Fk(i,t){for(let e in i)if(Object.prototype.hasOwnProperty.call(i,e)&&t(i[e]))return e}function Nk(i,t){for(let e=0;e<i.length;e++)if(t(i[e]))return e}function tv(i){return(t,e={})=>{let n=t.match(i.matchPattern);if(!n)return null;let r=n[0],o=t.match(i.parsePattern);if(!o)return null;let a=i.valueCallback?i.valueCallback(o[0]):o[0];a=e.valueCallback?e.valueCallback(a):a;let s=t.slice(r.length);return{value:a,rest:s}}}var Vk=/^(\d+)(th|st|nd|rd)?/i,Lk=/\d+/i,jk={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},zk={any:[/^b/i,/^(a|c)/i]},Bk={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Hk={any:[/1/i,/2/i,/3/i,/4/i]},Uk={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},$k={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]},Wk={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},qk={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]},Gk={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},Yk={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}},nv={ordinalNumber:tv({matchPattern:Vk,parsePattern:Lk,valueCallback:i=>parseInt(i,10)}),era:ha({matchPatterns:jk,defaultMatchWidth:"wide",parsePatterns:zk,defaultParseWidth:"any"}),quarter:ha({matchPatterns:Bk,defaultMatchWidth:"wide",parsePatterns:Hk,defaultParseWidth:"any",valueCallback:i=>i+1}),month:ha({matchPatterns:Uk,defaultMatchWidth:"wide",parsePatterns:$k,defaultParseWidth:"any"}),day:ha({matchPatterns:Wk,defaultMatchWidth:"wide",parsePatterns:qk,defaultParseWidth:"any"}),dayPeriod:ha({matchPatterns:Gk,defaultMatchWidth:"any",parsePatterns:Yk,defaultParseWidth:"any"})};var Ch={code:"en-US",formatDistance:Kb,formatLong:Zb,formatRelative:Jb,localize:ev,match:nv,options:{weekStartsOn:0,firstWeekContainsDate:1}};function iv(i,t){let e=at(i,t?.in);return hd(e,Xb(e))+1}function rv(i,t){let e=at(i,t?.in),n=+Jr(e)-+Ub(e);return Math.round(n/ud)+1}function gd(i,t){let e=at(i,t?.in),n=e.getFullYear(),r=pr(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=bt(t?.in||i,0);a.setFullYear(n+1,0,o),a.setHours(0,0,0,0);let s=zi(a,t),d=bt(t?.in||i,0);d.setFullYear(n,0,o),d.setHours(0,0,0,0);let p=zi(d,t);return+e>=+s?n+1:+e>=+p?n:n-1}function ov(i,t){let e=pr(),n=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,r=gd(i,t),o=bt(t?.in||i,0);return o.setFullYear(r,0,n),o.setHours(0,0,0,0),zi(o,t)}function av(i,t){let e=at(i,t?.in),n=+zi(e,t)-+ov(e,t);return Math.round(n/ud)+1}function Ae(i,t){let e=i<0?"-":"",n=Math.abs(i).toString().padStart(t,"0");return e+n}var Bi={y(i,t){let e=i.getFullYear(),n=e>0?e:1-e;return Ae(t==="yy"?n%100:n,t.length)},M(i,t){let e=i.getMonth();return t==="M"?String(e+1):Ae(e+1,2)},d(i,t){return Ae(i.getDate(),t.length)},a(i,t){let e=i.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(i,t){return Ae(i.getHours()%12||12,t.length)},H(i,t){return Ae(i.getHours(),t.length)},m(i,t){return Ae(i.getMinutes(),t.length)},s(i,t){return Ae(i.getSeconds(),t.length)},S(i,t){let e=t.length,n=i.getMilliseconds(),r=Math.trunc(n*Math.pow(10,e-3));return Ae(r,t.length)}};var pa={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},xh={G:function(i,t,e){let n=i.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(n,{width:"abbreviated"});case"GGGGG":return e.era(n,{width:"narrow"});case"GGGG":default:return e.era(n,{width:"wide"})}},y:function(i,t,e){if(t==="yo"){let n=i.getFullYear(),r=n>0?n:1-n;return e.ordinalNumber(r,{unit:"year"})}return Bi.y(i,t)},Y:function(i,t,e,n){let r=gd(i,n),o=r>0?r:1-r;if(t==="YY"){let a=o%100;return Ae(a,2)}return t==="Yo"?e.ordinalNumber(o,{unit:"year"}):Ae(o,t.length)},R:function(i,t){let e=md(i);return Ae(e,t.length)},u:function(i,t){let e=i.getFullYear();return Ae(e,t.length)},Q:function(i,t,e){let n=Math.ceil((i.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return Ae(n,2);case"Qo":return e.ordinalNumber(n,{unit:"quarter"});case"QQQ":return e.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(n,{width:"wide",context:"formatting"})}},q:function(i,t,e){let n=Math.ceil((i.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return Ae(n,2);case"qo":return e.ordinalNumber(n,{unit:"quarter"});case"qqq":return e.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(n,{width:"wide",context:"standalone"})}},M:function(i,t,e){let n=i.getMonth();switch(t){case"M":case"MM":return Bi.M(i,t);case"Mo":return e.ordinalNumber(n+1,{unit:"month"});case"MMM":return e.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(n,{width:"wide",context:"formatting"})}},L:function(i,t,e){let n=i.getMonth();switch(t){case"L":return String(n+1);case"LL":return Ae(n+1,2);case"Lo":return e.ordinalNumber(n+1,{unit:"month"});case"LLL":return e.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(n,{width:"wide",context:"standalone"})}},w:function(i,t,e,n){let r=av(i,n);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):Ae(r,t.length)},I:function(i,t,e){let n=rv(i);return t==="Io"?e.ordinalNumber(n,{unit:"week"}):Ae(n,t.length)},d:function(i,t,e){return t==="do"?e.ordinalNumber(i.getDate(),{unit:"date"}):Bi.d(i,t)},D:function(i,t,e){let n=iv(i);return t==="Do"?e.ordinalNumber(n,{unit:"dayOfYear"}):Ae(n,t.length)},E:function(i,t,e){let n=i.getDay();switch(t){case"E":case"EE":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"})}},e:function(i,t,e,n){let r=i.getDay(),o=(r-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Ae(o,2);case"eo":return e.ordinalNumber(o,{unit:"day"});case"eee":return e.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(r,{width:"short",context:"formatting"});case"eeee":default:return e.day(r,{width:"wide",context:"formatting"})}},c:function(i,t,e,n){let r=i.getDay(),o=(r-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Ae(o,t.length);case"co":return e.ordinalNumber(o,{unit:"day"});case"ccc":return e.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(r,{width:"narrow",context:"standalone"});case"cccccc":return e.day(r,{width:"short",context:"standalone"});case"cccc":default:return e.day(r,{width:"wide",context:"standalone"})}},i:function(i,t,e){let n=i.getDay(),r=n===0?7:n;switch(t){case"i":return String(r);case"ii":return Ae(r,t.length);case"io":return e.ordinalNumber(r,{unit:"day"});case"iii":return e.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(n,{width:"short",context:"formatting"});case"iiii":default:return e.day(n,{width:"wide",context:"formatting"})}},a:function(i,t,e){let r=i.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(i,t,e){let n=i.getHours(),r;switch(n===12?r=pa.noon:n===0?r=pa.midnight:r=n/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(i,t,e){let n=i.getHours(),r;switch(n>=17?r=pa.evening:n>=12?r=pa.afternoon:n>=4?r=pa.morning:r=pa.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(i,t,e){if(t==="ho"){let n=i.getHours()%12;return n===0&&(n=12),e.ordinalNumber(n,{unit:"hour"})}return Bi.h(i,t)},H:function(i,t,e){return t==="Ho"?e.ordinalNumber(i.getHours(),{unit:"hour"}):Bi.H(i,t)},K:function(i,t,e){let n=i.getHours()%12;return t==="Ko"?e.ordinalNumber(n,{unit:"hour"}):Ae(n,t.length)},k:function(i,t,e){let n=i.getHours();return n===0&&(n=24),t==="ko"?e.ordinalNumber(n,{unit:"hour"}):Ae(n,t.length)},m:function(i,t,e){return t==="mo"?e.ordinalNumber(i.getMinutes(),{unit:"minute"}):Bi.m(i,t)},s:function(i,t,e){return t==="so"?e.ordinalNumber(i.getSeconds(),{unit:"second"}):Bi.s(i,t)},S:function(i,t){return Bi.S(i,t)},X:function(i,t,e){let n=i.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return lv(n);case"XXXX":case"XX":return eo(n);case"XXXXX":case"XXX":default:return eo(n,":")}},x:function(i,t,e){let n=i.getTimezoneOffset();switch(t){case"x":return lv(n);case"xxxx":case"xx":return eo(n);case"xxxxx":case"xxx":default:return eo(n,":")}},O:function(i,t,e){let n=i.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+sv(n,":");case"OOOO":default:return"GMT"+eo(n,":")}},z:function(i,t,e){let n=i.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+sv(n,":");case"zzzz":default:return"GMT"+eo(n,":")}},t:function(i,t,e){let n=Math.trunc(+i/1e3);return Ae(n,t.length)},T:function(i,t,e){return Ae(+i,t.length)}};function sv(i,t=""){let e=i>0?"-":"+",n=Math.abs(i),r=Math.trunc(n/60),o=n%60;return o===0?e+String(r):e+String(r)+t+Ae(o,2)}function lv(i,t){return i%60===0?(i>0?"-":"+")+Ae(Math.abs(i)/60,2):eo(i,t)}function eo(i,t=""){let e=i>0?"-":"+",n=Math.abs(i),r=Ae(Math.trunc(n/60),2),o=Ae(n%60,2);return e+r+t+o}var cv=(i,t)=>{switch(i){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"})}},dv=(i,t)=>{switch(i){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"})}},Qk=(i,t)=>{let e=i.match(/(P+)(p+)?/)||[],n=e[1],r=e[2];if(!r)return cv(i,t);let o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",cv(n,t)).replace("{{time}}",dv(r,t))},uv={p:dv,P:Qk};var Xk=/^D+$/,Kk=/^Y+$/,Zk=["D","DD","YY","YYYY"];function mv(i){return Xk.test(i)}function hv(i){return Kk.test(i)}function pv(i,t,e){let n=Jk(i,t,e);if(console.warn(n),Zk.includes(i))throw new RangeError(n)}function Jk(i,t,e){let n=i[0]==="Y"?"years":"days of the month";return`Use \`${i.toLowerCase()}\` instead of \`${i}\` (in \`${t}\`) for formatting ${n} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var eM=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,tM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,nM=/^'([^]*?)'?$/,iM=/''/g,rM=/[a-zA-Z]/;function wh(i,t,e){let n=pr(),r=e?.locale??n.locale??Ch,o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=at(i,e?.in);if(!Gb(s))throw new RangeError("Invalid time value");let d=t.match(tM).map(f=>{let v=f[0];if(v==="p"||v==="P"){let E=uv[v];return E(f,r.formatLong)}return f}).join("").match(eM).map(f=>{if(f==="''")return{isToken:!1,value:"'"};let v=f[0];if(v==="'")return{isToken:!1,value:oM(f)};if(xh[v])return{isToken:!0,value:f};if(v.match(rM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+v+"`");return{isToken:!1,value:f}});r.localize.preprocessor&&(d=r.localize.preprocessor(s,d));let p={firstWeekContainsDate:o,weekStartsOn:a,locale:r};return d.map(f=>{if(!f.isToken)return f.value;let v=f.value;(!e?.useAdditionalWeekYearTokens&&hv(v)||!e?.useAdditionalDayOfYearTokens&&mv(v))&&pv(v,t,String(i));let E=xh[v[0]];return E(s,v,r.localize,p)}).join("")}function oM(i){let t=i.match(nM);return t?t[1].replace(iM,"'"):i}function gv(i,t,e){return Hb(i,-t,e)}function fv(i,t){return Wb(bt(t?.in||i,i),gv($b(t?.in||i),1))}function _v(i){if(!i||isNaN(i.getTime()))return"unknown";let t=new Date,e=wh(i,"HH:mm:ss"),n=t.getTime()-i.getTime(),r=Math.floor(n/(1e3*60));if(r<1)return`just now (${e})`;if(r<60)return`${r} min ago (${e})`;let o=Math.floor(n/(1e3*60*60));if(o<24)return`${o}h ago (${e})`;if(fv(i))return`yesterday ${e}`;let a=Qb(t,i);return a<7?`${a}d ago ${e}`:`${wh(i,"dd/MM/yyyy")} ${e}`}var aM=(i,t)=>t.filename;function sM(i,t){if(i&1){let e=A();l(0,"button",11),b("click",function(){y(e);let r=g(2);return C(r.downloadAll())}),l(1,"mat-icon"),h(2,"download_for_offline"),c()()}}function lM(i,t){i&1&&(l(0,"div",10),F(1,"span",12),l(2,"span",13),h(3,"Loading files..."),c()())}function cM(i,t){i&1&&(l(0,"div",14)(1,"mat-icon",15),h(2,"folder_open"),c(),l(3,"p",16),h(4,"No files in exchange space"),c(),l(5,"p",17),h(6,"Upload files to share with the agent"),c()())}function dM(i,t){if(i&1){let e=A();l(0,"button",28),b("click",function(){y(e);let r=g().$implicit,o=g(4);return C(o.viewFile(r))}),l(1,"mat-icon"),h(2,"visibility"),c()()}}function uM(i,t){if(i&1){let e=A();l(0,"div",18)(1,"div",19)(2,"mat-icon",20),h(3),c(),l(4,"div",21)(5,"span",22),h(6),c(),l(7,"span",23),h(8),c()()(),l(9,"div",24),w(10,dM,3,0,"button",25),l(11,"button",26),b("click",function(){let r=y(e).$implicit,o=g(4);return C(o.download(r))}),l(12,"mat-icon"),h(13,"download"),c()(),l(14,"button",27),b("click",function(){let r=y(e).$implicit,o=g(4);return C(o.delete(r))}),l(15,"mat-icon"),h(16,"delete"),c()()()()}if(i&2){let e=t.$implicit,n=g(4);m(3),U(n.getFileIcon(e.filename)),m(2),x("title",e.filename),m(),U(e.filename),m(2),Gi("",n.formatSize(e.size)," \u2022 ",n.formatDate(e.lastModified)),m(2),S(n.canViewFile(e)?10:-1)}}function mM(i,t){if(i&1&&Le(0,uM,17,6,"div",18,aM),i&2){let e=g(3);je(e.files())}}function hM(i,t){if(i&1&&w(0,cM,7,0,"div",14)(1,mM,2,0),i&2){let e=g(2);S(e.files().length===0?0:1)}}function pM(i,t){if(i&1){let e=A();l(0,"div",0)(1,"div",2)(2,"div",3)(3,"h3",4),h(4,"Exchange"),c(),l(5,"span",5),h(6),c()(),l(7,"div",6),w(8,sM,3,0,"button",7),l(9,"button",8),b("click",function(){y(e);let r=g();return C(r.close())}),l(10,"mat-icon"),h(11,"chevron_right"),c()()()(),l(12,"div",9),w(13,lM,4,0,"div",10)(14,hM,2,1),c()()}if(i&2){let e=g();m(6),ue("(",e.files().length,")"),m(2),S(e.files().length>0?8:-1),m(5),S(e.isLoading()?13:14)}}function gM(i,t){if(i&1){let e=A();l(0,"app-content-viewer",29),b("closeViewer",function(){y(e);let r=g();return C(r.backToList())}),c()}if(i&2){let e=g();x("file",e.currentFile)("projectName",e.projectName)("threadId",e.threadId)}}var fd=class i{projectName;threadId;closeDrawer=new H;fileExchangeState=u(la);contentViewerService=u(ca);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 re(this,null,function*(){if(!confirm(`Delete file "${t.filename}"?`))return;let n=yield this.fileExchangeState.deleteFile(t.filename);n.success||alert(`Failed to delete file: ${n.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 _v(t)}canViewFile(t){return this.contentViewerService.isFormatViewable(t.filename)&&this.contentViewerService.isViewable(t.size)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=P({type:i,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,n){e&1&&(w(0,pM,15,3,"div",0),w(1,gM,1,3,"app-content-viewer",1)),e&2&&(S(n.viewerState==="list"?0:-1),m(),S(n.viewerState==="content"&&n.currentFile?1:-1))},dependencies:[Be,it,Ee,Tt,Et,dd],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 bd=["*"],fM=["content"],_M=[[["mat-drawer"]],[["mat-drawer-content"]],"*"],bM=["mat-drawer","mat-drawer-content","*"];function vM(i,t){if(i&1){let e=A();l(0,"div",1),b("click",function(){y(e);let r=g();return C(r._onBackdropClicked())}),c()}if(i&2){let e=g();R("mat-drawer-shown",e._isShowingBackdrop())}}function yM(i,t){i&1&&(l(0,"mat-drawer-content"),_e(1,2),c())}var CM=[[["mat-sidenav"]],[["mat-sidenav-content"]],"*"],xM=["mat-sidenav","mat-sidenav-content","*"];function wM(i,t){if(i&1){let e=A();l(0,"div",1),b("click",function(){y(e);let r=g();return C(r._onBackdropClicked())}),c()}if(i&2){let e=g();R("mat-drawer-shown",e._isShowingBackdrop())}}function SM(i,t){i&1&&(l(0,"mat-sidenav-content"),_e(1,2),c())}var kM=`.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}
|
|
363
|
-
`;var MM=new q("MAT_DRAWER_DEFAULT_AUTOSIZE",{providedIn:"root",factory:EM}),Sh=new q("MAT_DRAWER_CONTAINER");function EM(){return!1}var ga=(()=>{class i extends sr{_platform=u(pt);_changeDetectorRef=u(ze);_container=u(Ds);constructor(){let e=u(ae),n=u(zo),r=u(fe);super(e,n,r)}ngAfterContentInit(){this._container._contentMarginChanges.subscribe(()=>{this._changeDetectorRef.markForCheck()})}_shouldBeHidden(){if(this._platform.isBrowser)return!1;let{start:e,end:n}=this._container;return e!=null&&e.mode!=="over"&&e.opened||n!=null&&n.mode!=="over"&&n.opened}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["mat-drawer-content"]],hostAttrs:[1,"mat-drawer-content"],hostVars:6,hostBindings:function(n,r){n&2&&(ei("margin-left",r._container._contentMargins.left,"px")("margin-right",r._container._contentMargins.right,"px"),R("mat-drawer-content-hidden",r._shouldBeHidden()))},features:[Ce([{provide:sr,useExisting:i}]),ke],ngContentSelectors:bd,decls:1,vars:0,template:function(n,r){n&1&&(Qe(),_e(0))},encapsulation:2,changeDetection:0})}return i})(),As=(()=>{class i{_elementRef=u(ae);_focusTrapFactory=u(ul);_focusMonitor=u(Ki);_platform=u(pt);_ngZone=u(fe);_renderer=u(et);_interactivityChecker=u(bo);_doc=u(ct);_container=u(Sh,{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=pn(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=pn(e)),this._autoFocus=e}_autoFocus;get opened(){return this._opened()}set opened(e){this.toggle(pn(e))}_opened=Me(!1);_openedVia;_animationStarted=new I;_animationEnd=new I;openedChange=new H(!0);_openedStream=this.openedChange.pipe(le(e=>e),X(()=>{}));openedStart=this._animationStarted.pipe(le(()=>this.opened),ou(void 0));_closedStream=this.openedChange.pipe(le(e=>!e),X(()=>{}));closedStart=this._animationStarted.pipe(le(()=>!this.opened),ou(void 0));_destroyed=new I;onPositionChanged=new H;_content;_modeChanged=new I;_injector=u(we);_changeDetectorRef=u(ze);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;dp(e,"keydown").pipe(le(n=>n.keyCode===27&&!this.disableClose&&!Lt(n)),L(this._destroyed)).subscribe(n=>this._ngZone.run(()=>{this.close(),n.stopPropagation(),n.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,n){this._interactivityChecker.isFocusable(e)||(e.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{let r=()=>{o(),a(),e.removeAttribute("tabindex")},o=this._renderer.listen(e,"blur",r),a=this._renderer.listen(e,"mousedown",r)})),e.focus(n)}_focusByCssSelector(e,n){let r=this._elementRef.nativeElement.querySelector(e);r&&this._forceFocus(r,n)}_takeFocus(){if(!this._focusTrap)return;let e=this._elementRef.nativeElement;switch(this.autoFocus){case!1:case"dialog":return;case!0:case"first-tabbable":Vt(()=>{!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,n){e&&n&&(this._openedVia=n);let r=this._setOpen(e,!e&&this._isFocusWithinDrawer(),this._openedVia||"program");return e||(this._openedVia=null),r}_setOpen(e,n,r){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&&n&&this._restoreFocus(r),this._changeDetectorRef.markForCheck(),this._updateFocusTrapState(),new Promise(o=>{this.openedChange.pipe(lt(1)).subscribe(a=>o(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 n=this._elementRef.nativeElement,r=n.parentNode;e==="end"?(this._anchor||(this._anchor=this._doc.createComment("mat-drawer-anchor"),r.insertBefore(this._anchor,n)),r.appendChild(n)):this._anchor&&this._anchor.parentNode.insertBefore(n,this._anchor)}_handleTransitionEvent=e=>{let n=this._elementRef.nativeElement;e.target===n&&this._ngZone.run(()=>{e.type==="transitionrun"?this._animationStarted.next(e):(e.type==="transitionend"&&this._setIsAnimating(!1),this._animationEnd.next(e))})};static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["mat-drawer"]],viewQuery:function(n,r){if(n&1&&se(fM,5),n&2){let o;G(o=Y())&&(r._content=o.first)}},hostAttrs:[1,"mat-drawer"],hostVars:12,hostBindings:function(n,r){n&2&&(K("align",null)("tabIndex",r.mode!=="side"?"-1":null),ei("visibility",!r._container&&!r.opened?"hidden":null),R("mat-drawer-end",r.position==="end")("mat-drawer-over",r.mode==="over")("mat-drawer-push",r.mode==="push")("mat-drawer-side",r.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:bd,decls:3,vars:0,consts:[["content",""],["cdkScrollable","",1,"mat-drawer-inner-container"]],template:function(n,r){n&1&&(Qe(),l(0,"div",1,0),_e(2),c())},dependencies:[sr],encapsulation:2,changeDetection:0})}return i})(),Ds=(()=>{class i{_dir=u(jt,{optional:!0});_element=u(ae);_ngZone=u(fe);_changeDetectorRef=u(ze);_animationDisabled=ut();_transitionsEnabled=!1;_allDrawers;_drawers=new yp;_content;_userContent;get start(){return this._start}get end(){return this._end}get autosize(){return this._autosize}set autosize(e){this._autosize=pn(e)}_autosize=u(MM);get hasBackdrop(){return this._drawerHasBackdrop(this._start)||this._drawerHasBackdrop(this._end)}set hasBackdrop(e){this._backdropOverride=e==null?null:pn(e)}_backdropOverride;backdropClick=new H;_start;_end;_left;_right;_destroyed=new I;_doCheckSubject=new I;_contentMargins={left:null,right:null};_contentMarginChanges=new I;get scrollable(){return this._userContent||this._content}_injector=u(we);constructor(){let e=u(pt),n=u(Pi);this._dir?.change.pipe(L(this._destroyed)).subscribe(()=>{this._validateDrawers(),this.updateContentMargins()}),n.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(At(this._allDrawers),L(this._destroyed)).subscribe(e=>{this._drawers.reset(e.filter(n=>!n._container||n._container===this)),this._drawers.notifyOnChanges()}),this._drawers.changes.pipe(At(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(up(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,n=0;if(this._left&&this._left.opened){if(this._left.mode=="side")e+=this._left._getWidth();else if(this._left.mode=="push"){let r=this._left._getWidth();e+=r,n-=r}}if(this._right&&this._right.opened){if(this._right.mode=="side")n+=this._right._getWidth();else if(this._right.mode=="push"){let r=this._right._getWidth();n+=r,e-=r}}e=e||null,n=n||null,(e!==this._contentMargins.left||n!==this._contentMargins.right)&&(this._contentMargins={left:e,right:n},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(()=>{Vt({read:()=>this._validateDrawers()},{injector:this._injector})})}_watchDrawerMode(e){e._modeChanged.pipe(L(Zn(this._drawers.changes,this._destroyed))).subscribe(()=>{this.updateContentMargins(),this._changeDetectorRef.markForCheck()})}_setContainerClass(e){let n=this._element.nativeElement.classList,r="mat-drawer-container-has-open";e?n.add(r):n.remove(r)}_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(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["mat-drawer-container"]],contentQueries:function(n,r,o){if(n&1&&(kt(o,ga,5),kt(o,As,5)),n&2){let a;G(a=Y())&&(r._content=a.first),G(a=Y())&&(r._allDrawers=a)}},viewQuery:function(n,r){if(n&1&&se(ga,5),n&2){let o;G(o=Y())&&(r._userContent=o.first)}},hostAttrs:[1,"mat-drawer-container"],hostVars:2,hostBindings:function(n,r){n&2&&R("mat-drawer-container-explicit-backdrop",r._backdropOverride)},inputs:{autosize:"autosize",hasBackdrop:"hasBackdrop"},outputs:{backdropClick:"backdropClick"},exportAs:["matDrawerContainer"],features:[Ce([{provide:Sh,useExisting:i}])],ngContentSelectors:bM,decls:4,vars:2,consts:[[1,"mat-drawer-backdrop",3,"mat-drawer-shown"],[1,"mat-drawer-backdrop",3,"click"]],template:function(n,r){n&1&&(Qe(_M),w(0,vM,1,2,"div",0),_e(1),_e(2,1),w(3,yM,2,0,"mat-drawer-content")),n&2&&(S(r.hasBackdrop?0:-1),m(3),S(r._content?-1:3))},dependencies:[ga],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}
|
|
364
|
-
`],encapsulation:2,changeDetection:0})}return i})(),_d=(()=>{class i extends ga{static \u0275fac=(()=>{let e;return function(r){return(e||(e=We(i)))(r||i)}})();static \u0275cmp=P({type:i,selectors:[["mat-sidenav-content"]],hostAttrs:[1,"mat-drawer-content","mat-sidenav-content"],features:[Ce([{provide:sr,useExisting:i}]),ke],ngContentSelectors:bd,decls:1,vars:0,template:function(n,r){n&1&&(Qe(),_e(0))},encapsulation:2,changeDetection:0})}return i})(),kh=(()=>{class i extends As{get fixedInViewport(){return this._fixedInViewport}set fixedInViewport(e){this._fixedInViewport=pn(e)}_fixedInViewport=!1;get fixedTopGap(){return this._fixedTopGap}set fixedTopGap(e){this._fixedTopGap=Xi(e)}_fixedTopGap=0;get fixedBottomGap(){return this._fixedBottomGap}set fixedBottomGap(e){this._fixedBottomGap=Xi(e)}_fixedBottomGap=0;static \u0275fac=(()=>{let e;return function(r){return(e||(e=We(i)))(r||i)}})();static \u0275cmp=P({type:i,selectors:[["mat-sidenav"]],hostAttrs:[1,"mat-drawer","mat-sidenav"],hostVars:16,hostBindings:function(n,r){n&2&&(K("tabIndex",r.mode!=="side"?"-1":null)("align",null),ei("top",r.fixedInViewport?r.fixedTopGap:null,"px")("bottom",r.fixedInViewport?r.fixedBottomGap:null,"px"),R("mat-drawer-end",r.position==="end")("mat-drawer-over",r.mode==="over")("mat-drawer-push",r.mode==="push")("mat-drawer-side",r.mode==="side")("mat-sidenav-fixed",r.fixedInViewport))},inputs:{fixedInViewport:"fixedInViewport",fixedTopGap:"fixedTopGap",fixedBottomGap:"fixedBottomGap"},exportAs:["matSidenav"],features:[Ce([{provide:As,useExisting:i}]),ke],ngContentSelectors:bd,decls:3,vars:0,consts:[["content",""],["cdkScrollable","",1,"mat-drawer-inner-container"]],template:function(n,r){n&1&&(Qe(),l(0,"div",1,0),_e(2),c())},dependencies:[sr],encapsulation:2,changeDetection:0})}return i})(),bv=(()=>{class i extends Ds{_allDrawers=void 0;_content=void 0;static \u0275fac=(()=>{let e;return function(r){return(e||(e=We(i)))(r||i)}})();static \u0275cmp=P({type:i,selectors:[["mat-sidenav-container"]],contentQueries:function(n,r,o){if(n&1&&(kt(o,_d,5),kt(o,kh,5)),n&2){let a;G(a=Y())&&(r._content=a.first),G(a=Y())&&(r._allDrawers=a)}},hostAttrs:[1,"mat-drawer-container","mat-sidenav-container"],hostVars:2,hostBindings:function(n,r){n&2&&R("mat-drawer-container-explicit-backdrop",r._backdropOverride)},exportAs:["matSidenavContainer"],features:[Ce([{provide:Sh,useExisting:i},{provide:Ds,useExisting:i}]),ke],ngContentSelectors:xM,decls:4,vars:2,consts:[[1,"mat-drawer-backdrop",3,"mat-drawer-shown"],[1,"mat-drawer-backdrop",3,"click"]],template:function(n,r){n&1&&(Qe(CM),w(0,wM,1,2,"div",0),_e(1),_e(2,1),w(3,SM,2,0,"mat-sidenav-content")),n&2&&(S(r.hasBackdrop?0:-1),m(3),S(r._content?-1:3))},dependencies:[_d],styles:[kM],encapsulation:2,changeDetection:0})}return i})(),vd=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=de({type:i});static \u0275inj=ce({imports:[pe,Vr,Vr,pe]})}return i})();var yv="mat-badge-content",TM=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["ng-component"]],decls:0,vars:0,template:function(n,r){},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)}
|
|
365
|
-
`],encapsulation:2,changeDetection:0})}return i})(),Cv=(()=>{class i{_ngZone=u(fe);_elementRef=u(ae);_ariaDescriber=u(Jp);_renderer=u(et);_animationsDisabled=ut();_idGenerator=u(He);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=u(bo);_document=u(ct);constructor(){let e=u($t);e.load(TM),e.load(dl)}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"),n="mat-badge-active";return e.setAttribute("id",this._idGenerator.getId("mat-badge-content-")),e.setAttribute("aria-hidden","true"),e.classList.add(yv),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(n)})}):e.classList.add(n),e}_updateRenderedContent(e){let n=`${e??""}`.trim();this._isInitialized&&n&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=n),this._content=n}_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 n=this._elementRef.nativeElement.classList;n.remove(`mat-badge-${this._color}`),e&&n.add(`mat-badge-${e}`)}_clearExistingBadges(){let e=this._elementRef.nativeElement.querySelectorAll(`:scope > .${yv}`);for(let n of Array.from(e))n!==this._badgeElement&&n.remove()}static \u0275fac=function(n){return new(n||i)};static \u0275dir=ne({type:i,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(n,r){n&2&&R("mat-badge-overlap",r.overlap)("mat-badge-above",r.isAbove())("mat-badge-below",!r.isAbove())("mat-badge-before",!r.isAfter())("mat-badge-after",r.isAfter())("mat-badge-small",r.size==="small")("mat-badge-medium",r.size==="medium")("mat-badge-large",r.size==="large")("mat-badge-hidden",r.hidden||!r.content)("mat-badge-disabled",r.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",ie],disabled:[2,"matBadgeDisabled","disabled",ie],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",ie]}})}return i})(),xv=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=de({type:i});static \u0275inj=ce({imports:[hl,pe,pe]})}return i})();var fa=class i{ATTENTION_EMOJI="\u{1F534}";isSystemActive=!1;systemActiveTimer=null;SYSTEM_ACTIVE_TIMEOUT=4e3;unreadService=u(aa);project=u(Te);constructor(){this.initializeTitleUpdates()}initializeTitleUpdates(){dn([this.project.selectedProject$,this.unreadService.unreadCount$]).subscribe(([t,e])=>{this.updateTitle(t?.name??"...",e)})}updateTitle(t,e){let n;this.isSystemActive?n=`\u23F3${e>0?` (${e}) `:" "}${t}`:e>0?n=`${this.ATTENTION_EMOJI} (${e}) ${t}`:n=t,document.title=n,console.log("[TAB-TITLE] Updated to:",n)}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||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})};var yd=class i{http=u(nt);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 re(this,null,function*(){return new Promise((e,n)=>{let r=new FileReader;r.onload=()=>{let o=r.result;if(!o){n(new Error("Failed to read file"));return}let a=o.split(",")[1];if(!a){n(new Error("Invalid file format"));return}e(a)},r.onerror=n,r.readAsDataURL(t)})})}getUploadUrl(t,e){return`/api/projects/${t}/threads/${e}/upload`}uploadImage(t,e,n){console.log("[IMAGE-UPLOAD] uploadImage - file:",t.name,t.type,t.size),console.log("[IMAGE-UPLOAD] uploadImage - project:",e,"thread:",n);try{console.log("[IMAGE-UPLOAD] Validating file..."),this.validateFile(t)}catch(r){return console.log("[IMAGE-UPLOAD] Validation failed:",r),$({success:!1,error:r instanceof Error?r.message:"Validation failed"})}return new nn(r=>{console.log("[IMAGE-UPLOAD] Converting to base64..."),this.fileToBase64(t).then(o=>{console.log("[IMAGE-UPLOAD] Base64 length:",o.length),console.log("[IMAGE-UPLOAD] Sending upload request..."),this.http.post(this.getUploadUrl(e,n),{content:o,mimeType:t.type,filename:t.name}).pipe(X(a=>(console.log("[IMAGE-UPLOAD] Upload success result:",a),{success:!0,processedSize:a.processedSize,dimensions:a.dimensions})),on(a=>{console.log("[IMAGE-UPLOAD] Upload failed:",a);let s=a.error?.error||a.message||"Upload failed";return $({success:!1,error:s})})).subscribe({next:a=>{r.next(a),r.complete()},error:a=>r.error(a)})}).catch(o=>{console.log("[IMAGE-UPLOAD] Base64 conversion failed:",o),r.next({success:!1,error:o instanceof Error?o.message:"Failed to read file"}),r.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(r=>({name:r.name,type:r.type})));let n=e.some(r=>this.supportedTypes.includes(r.type));return console.log("[IMAGE-UPLOAD] hasImageFiles - result:",n),n}filterImageFiles(t){return Array.from(t).filter(n=>this.supportedTypes.includes(n.type))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})};var _a=class i{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||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})};var PM=["inputSection"];function AM(i,t){if(i&1){let e=A();l(0,"button",18),b("click",function(){y(e);let r=g();return C(r.toggleFileDrawer())}),l(1,"mat-icon"),h(2,"folder_open"),c()()}if(i&2){let e=g();R("has-files",e.fileCount>0),x("title",Yi("Files Exchange",e.fileCount>0?" ("+e.fileCount+" file"+(e.fileCount>1?"s":"")+")":""))("matBadge",e.fileCount>0?e.fileCount:null)}}function DM(i,t){if(i&1&&(l(0,"div",5),h(1),c()),i&2){let e=g();m(),Gi(" \u26A0\uFE0F Connection lost. Reconnecting... (",e.connectionStatus.reconnectAttempts,"/",e.connectionStatus.maxAttempts,") ")}}function IM(i,t){if(i&1&&(l(0,"div",19),h(1),c()),i&2){let e=g();R("error",e.uploadStatus.isError),m(),ue(" ",e.uploadStatus.message," ")}}function RM(i,t){if(i&1){let e=A();l(0,"app-chat-textarea",20),b("messageSubmitted",function(r){y(e);let o=g();return C(o.onMessageSubmitted(r))})("voiceRecordingToggled",function(r){y(e);let o=g();return C(o.onVoiceToggled(r))})("heightChanged",function(r){y(e);let o=g();return C(o.onInputHeightChanged(r))})("stopRequested",function(){y(e);let r=g();return C(r.onStopRequested())})("filesPasted",function(r){y(e);let o=g();return C(o.onFilesPasted(r))}),c()}if(i&2){let e=g();x("isDisabled",!e.isConnected)("isSessionInitializing",!1)("showWelcome",!1)("isThinking",e.isThinking)("isStarting",!1)}}function FM(i,t){if(i&1){let e=A();l(0,"app-choice-select",21),b("choiceSelected",function(r){y(e);let o=g();return C(o.onChoiceSelected(r))}),c()}if(i&2){let e=g();x("options",e.currentChoice.options)("labelHtml",e.currentChoice.label)("isVisible",!!e.currentChoice)}}function NM(i,t){i&1&&(l(0,"div",17)(1,"div",22)(2,"div",23),h(3,"\u{1F4CE}"),c(),l(4,"div",24),h(5,"Drop files here to upload"),c(),l(6,"div",25),h(7,"Images will be added to conversation, other files to exchange space"),c()()())}var Cd=class i{projectName;threadId;destroy$=new I;inputSection;messages=[];streamingText="";isThinking=!1;currentChoice=null;connectionStatus=null;isConnected=!1;showConnectionStatus=!1;hasEverConnected=!1;inputSectionHeight=80;uploadStatus={message:"",isError:!1};isDragOver=!1;isFileDrawerOpen=!1;get fileCount(){return this.fileExchangeState.fileCount()}pendingFirstMessage=null;subscriptions=[];codayService=u(On);preferencesService=u(mt);titleService=u(fa);elementRef=u(ae);threadState=u(Bt);imageUploadService=u(yd);fileExchangeState=u(la);firstMessageState=u(_a);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.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),n=t.filter(r=>!r.type.startsWith("image/"));e.length&&this.uploadFilesSequentially(e,0),n.length&&this.uploadFilesToExchangeSpace(n),!e.length&&!n.length&&this.showUploadError("No supported files found")}toggleFileDrawer(){console.log("[THREAD] Toggling file drawer"),this.isFileDrawerOpen=!this.isFileDrawerOpen}closeFileDrawer(){console.log("[THREAD] Closing file drawer"),this.isFileDrawerOpen=!1}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 n=this.imageUploadService.filterImageFiles(e),r=Array.from(e).filter(o=>!o.type.startsWith("image/"));console.log("[THREAD] Image files:",n.length,"Other files:",r.length),n.length>0&&this.uploadFilesSequentially(n,0),r.length>0&&this.uploadFilesToExchangeSpace(r),n.length===0&&r.length===0&&this.showUploadError("No supported files found")}uploadFilesSequentially(t,e){if(e>=t.length)return;let n=t[e];if(!n){console.error("[THREAD] File at index",e,"is undefined");return}console.log("[THREAD] Uploading file:",n.name),this.uploadStatus={message:`Uploading ${n.name}...`,isError:!1},this.imageUploadService.uploadImage(n,this.projectName,this.threadId).subscribe({next:r=>{r.success?(console.log("[THREAD] Upload successful:",n.name),this.uploadStatus={message:`\u2713 ${n.name} uploaded (${(r.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:",n.name,r.error),this.showUploadError(`Failed to upload ${n.name}: ${r.error}`))},error:r=>{console.error("[THREAD] Upload error:",n.name,r),this.showUploadError(`Failed to upload ${n.name}: ${r.message||"Unknown error"}`)}})}showUploadError(t){this.uploadStatus={message:t,isError:!0},setTimeout(()=>{this.uploadStatus={message:"",isError:!1}},5e3)}uploadFilesToExchangeSpace(t){return re(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 n=yield this.fileExchangeState.uploadFile(e);if(n.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,n.error),this.showUploadError(`Failed to upload ${e.name}: ${n.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||i)};static \u0275cmp=P({type:i,selectors:[["app-thread"]],viewQuery:function(e,n){if(e&1&&se(PM,5),e&2){let r;G(r=Y())&&(n.inputSection=r.first)}},inputs:{projectName:"projectName",threadId:"threadId"},features:[Ne],decls:19,vars:13,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"],[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"],["mode","side","position","end",3,"closed","opened"],[3,"closeDrawer","projectName","threadId"],[1,"drag-overlay"],["matFab","","type","button",1,"file-drawer-toggle-btn",3,"click","matBadge","title"],[1,"upload-status"],[3,"messageSubmitted","voiceRecordingToggled","heightChanged","stopRequested","filesPasted","isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"],[1,"choice-overlay",3,"choiceSelected","options","labelHtml","isVisible"],[1,"drag-overlay-content"],[1,"drag-icon"],[1,"drag-text"],[1,"drag-hint"]],template:function(e,n){if(e&1){let r=A();l(0,"div",1),b("dragenter",function(a){return y(r),C(n.onDragEnter(a))})("dragover",function(a){return y(r),C(n.onDragOver(a))})("dragleave",function(a){return y(r),C(n.onDragLeave(a))})("drop",function(a){return y(r),C(n.onDrop(a))}),l(1,"mat-drawer-container",2)(2,"mat-drawer-content")(3,"div",3),w(4,AM,3,5,"button",4),w(5,DM,2,2,"div",5),l(6,"div",6)(7,"div",7)(8,"app-chat-history",8),b("copyRequested",function(a){return y(r),C(n.onCopyMessage(a))})("stopRequested",function(){return y(r),C(n.onStopRequested())}),c(),w(9,IM,2,3,"div",9),c()(),l(10,"div",10,0)(12,"div",11)(13,"div",12),w(14,RM,1,5,"app-chat-textarea",13),w(15,FM,1,3,"app-choice-select",14),c()()()()(),l(16,"mat-drawer",15),b("closed",function(){return y(r),C(n.closeFileDrawer())}),l(17,"app-file-exchange-drawer",16),b("closeDrawer",function(){return y(r),C(n.closeFileDrawer())}),c()()(),w(18,NM,8,0,"div",17),c()}e&2&&(m(),x("hasBackdrop",!1),m(3),S(n.isFileDrawerOpen?-1:4),m(),S(n.showConnectionStatus&&n.connectionStatus&&!n.connectionStatus.connected?5:-1),m(3),x("messages",n.messages)("streamingText",n.streamingText)("isThinking",n.isThinking),m(),S(n.uploadStatus.message?9:-1),m(5),S(n.currentChoice?-1:14),m(),S(n.currentChoice?15:-1),m(),x("opened",n.isFileDrawerOpen),m(),x("projectName",n.projectName)("threadId",n.threadId),m(),S(n.isDragOver?18:-1))},dependencies:[od,oa,Yo,fd,vd,As,Ds,ga,it,Ee,Tt,fl,xv,Cv],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}@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}.upload-status[_ngcontent-%COMP%]{padding:.75rem 1rem;border-radius:8px;background:var(--color-primary-light);color:var(--color-text);text-align:center;font-size:.9rem;margin-top:1rem}.upload-status.error[_ngcontent-%COMP%]{background:var(--color-error);color:#fff}.input-section[_ngcontent-%COMP%]{flex-shrink:0;width:100%;padding:1rem 0;background:var(--color-background)}.input-center[_ngcontent-%COMP%]{max-width:800px;width:100%;margin:0 auto;padding:0 1rem}.input-glass[_ngcontent-%COMP%]{position:relative;background:transparent;border-radius:12px;display:flex;flex-direction:column}.choice-overlay[_ngcontent-%COMP%]{width:100%;background:var(--color-bg-solid);border-radius:12px;padding:1.5rem;box-shadow:0 4px 12px #00000026}.drag-overlay[_ngcontent-%COMP%]{position:absolute;inset:0;background:#000000b3;z-index:10000;display:flex;align-items:center;justify-content:center;pointer-events:none}.drag-overlay-content[_ngcontent-%COMP%]{text-align:center;color:#fff;padding:2rem;border:3px dashed white;border-radius:12px;background:#00000080}.drag-icon[_ngcontent-%COMP%]{font-size:4rem;margin-bottom:1rem}.drag-text[_ngcontent-%COMP%]{font-size:1.5rem;font-weight:500}.drag-hint[_ngcontent-%COMP%]{font-size:.9rem;margin-top:.5rem;opacity:.8}@media (max-width: 768px){.chat-center[_ngcontent-%COMP%], .input-center[_ngcontent-%COMP%]{padding:0 .5rem}.drag-text[_ngcontent-%COMP%]{font-size:1.2rem}.drag-icon[_ngcontent-%COMP%]{font-size:3rem}.file-drawer-container[_ngcontent-%COMP%] .mat-drawer{width:100vw;max-width:100vw}.file-drawer-toggle-btn[_ngcontent-%COMP%]{top:.75rem!important;right:.75rem!important}}@media print{.connection-status[_ngcontent-%COMP%], .input-section[_ngcontent-%COMP%], .drag-overlay[_ngcontent-%COMP%], .file-drawer-toggle-btn[_ngcontent-%COMP%], .file-drawer-container[_ngcontent-%COMP%]{display:none!important}.chat-wrapper[_ngcontent-%COMP%]{overflow:visible;height:auto}.thread-container[_ngcontent-%COMP%]{height:auto}}"]})};var wv=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=de({type:i});static \u0275inj=ce({imports:[pe,pe]})}return i})();var Sv=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=de({type:i});static \u0275inj=ce({imports:[pe]})}return i})();var fi=class i{http=u(nt);getUserConfig(){return this.http.get("/api/config/user").pipe(ve(t=>console.log("[CONFIG-API] User config retrieved:",t)))}updateUserConfig(t){return this.http.put("/api/config/user",t).pipe(ve(e=>console.log("[CONFIG-API] User config updated:",e)))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})};var ba=class i{currentThemeSubject=new Z("light");currentTheme$=this.currentThemeSubject.asObservable();preferences=u(mt);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 n=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";console.log("[THEME] System theme resolved to:",n),this.setDocumentTheme(n)}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||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})};var VM=["mat-internal-form-field",""],LM=["*"],xd=(()=>{class i{labelPosition;static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["div","mat-internal-form-field",""]],hostAttrs:[1,"mdc-form-field","mat-internal-form-field"],hostVars:2,hostBindings:function(n,r){n&2&&R("mdc-form-field--align-end",r.labelPosition==="before")},inputs:{labelPosition:"labelPosition"},attrs:VM,ngContentSelectors:LM,decls:1,vars:0,template:function(n,r){n&1&&(Qe(),_e(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}
|
|
366
|
-
`],encapsulation:2,changeDetection:0})}return i})();var jM=["switch"],zM=["*"];function BM(i,t){i&1&&(l(0,"span",11),Ci(),l(1,"svg",13),F(2,"path",14),c(),l(3,"svg",15),F(4,"path",16),c()())}var HM=new q("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1,hideIcon:!1,disabledInteractive:!1})}),wd=class{source;checked;constructor(t,e){this.source=t,this.checked=e}},to=(()=>{class i{_elementRef=u(ae);_focusMonitor=u(Ki);_changeDetectorRef=u(ze);defaults=u(HM);_onChange=e=>{};_onTouched=()=>{};_validatorOnChange=()=>{};_uniqueId;_checked=!1;_createChangeEvent(e){return new wd(this,e)}_labelId;get buttonId(){return`${this.id||this._uniqueId}-button`}_switchElement;focus(){this._switchElement.nativeElement.focus()}_noopAnimations=ut();_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 H;toggleChange=new H;get inputId(){return`${this.id||this._uniqueId}-input`}constructor(){u($t).load(Ji);let e=u(new Si("tabindex"),{optional:!0}),n=this.defaults;this.tabIndex=e==null?0:parseInt(e)||0,this.color=n.color||"accent",this.id=this._uniqueId=u(He).getId("mat-mdc-slide-toggle-"),this.hideIcon=n.hideIcon??!1,this.disabledInteractive=n.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 wd(this,this.checked))))}_getAriaLabelledBy(){return this.ariaLabelledby?this.ariaLabelledby:this.ariaLabel?null:this._labelId}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["mat-slide-toggle"]],viewQuery:function(n,r){if(n&1&&se(jM,5),n&2){let o;G(o=Y())&&(r._switchElement=o.first)}},hostAttrs:[1,"mat-mdc-slide-toggle"],hostVars:13,hostBindings:function(n,r){n&2&&(mn("id",r.id),K("tabindex",null)("aria-label",null)("name",null)("aria-labelledby",null),wi(r.color?"mat-"+r.color:""),R("mat-mdc-slide-toggle-focused",r._focused)("mat-mdc-slide-toggle-checked",r.checked)("_mat-animation-noopable",r._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",ie],color:"color",disabled:[2,"disabled","disabled",ie],disableRipple:[2,"disableRipple","disableRipple",ie],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:Nn(e)],checked:[2,"checked","checked",ie],hideIcon:[2,"hideIcon","hideIcon",ie],disabledInteractive:[2,"disabledInteractive","disabledInteractive",ie]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[Ce([{provide:ln,useExisting:dt(()=>i),multi:!0},{provide:qn,useExisting:i,multi:!0}]),Ne],ngContentSelectors:zM,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(n,r){if(n&1){let o=A();Qe(),l(0,"div",1)(1,"button",2,0),b("click",function(){return y(o),C(r._handleClick())}),F(3,"div",3)(4,"span",4),l(5,"span",5)(6,"span",6)(7,"span",7),F(8,"span",8),c(),l(9,"span",9),F(10,"span",10),c(),w(11,BM,5,0,"span",11),c()()(),l(12,"label",12),b("click",function(s){return y(o),C(s.stopPropagation())}),_e(13),c()()}if(n&2){let o=hn(2);x("labelPosition",r.labelPosition),m(),R("mdc-switch--selected",r.checked)("mdc-switch--unselected",!r.checked)("mdc-switch--checked",r.checked)("mdc-switch--disabled",r.disabled)("mat-mdc-slide-toggle-disabled-interactive",r.disabledInteractive),x("tabIndex",r.disabled&&!r.disabledInteractive?-1:r.tabIndex)("disabled",r.disabled&&!r.disabledInteractive),K("id",r.buttonId)("name",r.name)("aria-label",r.ariaLabel)("aria-labelledby",r._getAriaLabelledBy())("aria-describedby",r.ariaDescribedby)("aria-required",r.required||null)("aria-checked",r.checked)("aria-disabled",r.disabled&&r.disabledInteractive?"true":null),m(9),x("matRippleTrigger",o)("matRippleDisabled",r.disableRipple||r.disabled)("matRippleCentered",!0),m(),S(r.hideIcon?-1:11),m(),x("for",r.buttonId),K("id",r._labelId)}},dependencies:[Zi,xd],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%)}
|
|
367
|
-
`],encapsulation:2,changeDetection:0})}return i})(),Sd=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=de({type:i});static \u0275inj=ce({imports:[to,pe,pe]})}return i})();var UM=(i,t)=>t.code,$M=(i,t)=>t.name+t.lang;function WM(i,t){i&1&&(l(0,"div",15)(1,"mat-icon",32),h(2,"warning"),c(),l(3,"span",33),h(4," Browser notifications have been blocked. To enable them, please reset the site permissions in your browser settings. "),c()())}function qM(i,t){if(i&1&&(l(0,"option",18),h(1),c()),i&2){let e=t.$implicit;x("value",e.code),m(),Gi("",e.flag," ",e.label)}}function GM(i,t){i&1&&(l(0,"option",25),h(1,"Loading voices..."),c())}function YM(i,t){i&1&&(l(0,"option",25),h(1,"No voice available"),c())}function QM(i,t){if(i&1&&(l(0,"option",18),h(1),c()),i&2){let e=t.$implicit;x("value",e.name+"|"+e.lang),m(),ue(" ",e.displayName," ")}}var Is=class i{destroy$=new I;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=u(mt);voiceSynthesisService=u(sa);themeService=u(ba);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 re(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||i)};static \u0275cmp=P({type:i,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,n){e&1&&(l(0,"div",0)(1,"div",1)(2,"div",2)(3,"mat-icon"),h(4,"palette"),c(),l(5,"span"),h(6,"Appearance"),c()(),l(7,"div",3)(8,"div",4)(9,"label",5)(10,"input",6),B("ngModelChange",function(o){return z(n.selectedTheme,o)||(n.selectedTheme=o),o}),b("change",function(){return n.onThemeChange()}),c(),F(11,"span",7),h(12," Light "),c(),l(13,"label",5)(14,"input",8),B("ngModelChange",function(o){return z(n.selectedTheme,o)||(n.selectedTheme=o),o}),b("change",function(){return n.onThemeChange()}),c(),F(15,"span",7),h(16," Dark "),c(),l(17,"label",5)(18,"input",9),B("ngModelChange",function(o){return z(n.selectedTheme,o)||(n.selectedTheme=o),o}),b("change",function(){return n.onThemeChange()}),c(),F(19,"span",7),h(20," System "),c()()()(),l(21,"div",1)(22,"div",2)(23,"mat-icon"),h(24,"chat_bubble_outline"),c(),l(25,"span"),h(26,"Messaging"),c()(),l(27,"div",3)(28,"span",10),h(29,"Send message behavior:"),c(),l(30,"div",4)(31,"label",5)(32,"input",11),B("ngModelChange",function(o){return z(n.useEnterToSend,o)||(n.useEnterToSend=o),o}),b("change",function(){return n.onEnterToSendChange()}),c(),F(33,"span",7),h(34," Enter to send "),c(),l(35,"label",5)(36,"input",11),B("ngModelChange",function(o){return z(n.useEnterToSend,o)||(n.useEnterToSend=o),o}),b("change",function(){return n.onEnterToSendChange()}),c(),F(37,"span",7),h(38," Enter for new line "),c()()(),l(39,"div",3)(40,"div",12)(41,"span",10),h(42,"Show technical messages"),c(),l(43,"mat-slide-toggle",13),B("ngModelChange",function(o){return z(n.showTechnicalMessages,o)||(n.showTechnicalMessages=o),o}),b("change",function(){return n.onShowTechnicalMessagesChange()}),c()()(),l(44,"div",3)(45,"div",12)(46,"span",10),h(47,"Show warning messages"),c(),l(48,"mat-slide-toggle",13),B("ngModelChange",function(o){return z(n.showWarningMessages,o)||(n.showWarningMessages=o),o}),b("change",function(){return n.onShowWarningMessagesChange()}),c()()(),l(49,"div",3)(50,"div",12)(51,"span",10),h(52,"Include technical messages in print"),c(),l(53,"mat-slide-toggle",13),B("ngModelChange",function(o){return z(n.printTechnicalMessages,o)||(n.printTechnicalMessages=o),o}),b("change",function(){return n.onPrintTechnicalMessagesChange()}),c()()()(),l(54,"div",1)(55,"div",2)(56,"mat-icon"),h(57,"notifications"),c(),l(58,"span"),h(59,"Notifications"),c()(),l(60,"div",3)(61,"div",12)(62,"span",10),h(63,"Notify when the agent answers or requests input"),c(),l(64,"mat-slide-toggle",13),B("ngModelChange",function(o){return z(n.agentNotificationEnabled,o)||(n.agentNotificationEnabled=o),o}),b("change",function(){return n.onAgentNotificationEnabledChange()}),c()()(),l(65,"div",3)(66,"div",12)(67,"span",10),h(68,"Notification sound"),c(),l(69,"mat-slide-toggle",14),B("ngModelChange",function(o){return z(n.notificationSoundEnabled,o)||(n.notificationSoundEnabled=o),o}),b("change",function(){return n.onNotificationSoundEnabledChange()}),c()()(),l(70,"div",3)(71,"div",12)(72,"span",10),h(73,"Browser notification"),c(),l(74,"mat-slide-toggle",14),B("ngModelChange",function(o){return z(n.browserNotificationEnabled,o)||(n.browserNotificationEnabled=o),o}),b("change",function(){return n.onBrowserNotificationEnabledChange()}),c()(),w(75,WM,5,0,"div",15),c()(),l(76,"div",1)(77,"div",2)(78,"mat-icon"),h(79,"record_voice_over"),c(),l(80,"span"),h(81,"Voice & Speech"),c()(),l(82,"div",3)(83,"label",16),h(84,"Voice recognition language:"),c(),l(85,"select",17),B("ngModelChange",function(o){return z(n.selectedVoiceLanguage,o)||(n.selectedVoiceLanguage=o),o}),b("change",function(){return n.onVoiceLanguageChange()}),Le(86,qM,2,3,"option",18,UM),c()(),l(88,"div",3)(89,"span",10),h(90,"Automatic announcement:"),c(),l(91,"div",4)(92,"label",5)(93,"input",19),B("ngModelChange",function(o){return z(n.voiceAnnounceEnabled,o)||(n.voiceAnnounceEnabled=o),o}),b("change",function(){return n.onVoiceAnnounceEnabledChange()}),c(),F(94,"span",7),h(95," Enabled "),c(),l(96,"label",5)(97,"input",19),B("ngModelChange",function(o){return z(n.voiceAnnounceEnabled,o)||(n.voiceAnnounceEnabled=o),o}),b("change",function(){return n.onVoiceAnnounceEnabledChange()}),c(),F(98,"span",7),h(99," Disabled "),c()()(),l(100,"div",3)(101,"span",10),h(102,"Voice mode:"),c(),l(103,"div",4)(104,"label",5)(105,"input",20),B("ngModelChange",function(o){return z(n.voiceMode,o)||(n.voiceMode=o),o}),b("change",function(){return n.onVoiceModeChange()}),c(),F(106,"span",7),h(107," Voice synthesis "),c(),l(108,"label",5)(109,"input",21),B("ngModelChange",function(o){return z(n.voiceMode,o)||(n.voiceMode=o),o}),b("change",function(){return n.onVoiceModeChange()}),c(),F(110,"span",7),h(111," Sound notification "),c()()(),l(112,"div",3)(113,"span",10),h(114,"Message reading:"),c(),l(115,"div",4)(116,"label",5)(117,"input",22),B("ngModelChange",function(o){return z(n.voiceReadFullText,o)||(n.voiceReadFullText=o),o}),b("change",function(){return n.onVoiceReadFullTextChange()}),c(),F(118,"span",7),h(119," Full message "),c(),l(120,"label",5)(121,"input",22),B("ngModelChange",function(o){return z(n.voiceReadFullText,o)||(n.voiceReadFullText=o),o}),b("change",function(){return n.onVoiceReadFullTextChange()}),c(),F(122,"span",7),h(123," First paragraphs only "),c()()(),l(124,"div",3)(125,"label",23),h(126,"Selected voice:"),c(),l(127,"select",24),B("ngModelChange",function(o){return z(n.selectedVoiceId,o)||(n.selectedVoiceId=o),o}),b("change",function(){return n.onSelectedVoiceChange()}),w(128,GM,2,0,"option",25),w(129,YM,2,0,"option",25),Le(130,QM,2,2,"option",18,$M),c(),F(132,"div",10),l(133,"a",26),b("click",function(){return n.testVoice()}),l(134,"span",27),h(135,"Test voice"),c()()(),l(136,"div",3)(137,"label",28),h(138),c(),l(139,"input",29),B("ngModelChange",function(o){return z(n.voiceVolume,o)||(n.voiceVolume=o),o}),b("input",function(){return n.onVoiceVolumeChange()}),c()(),l(140,"div",3)(141,"label",30),h(142),c(),l(143,"input",31),B("ngModelChange",function(o){return z(n.voiceRate,o)||(n.voiceRate=o),o}),b("input",function(){return n.onVoiceRateChange()}),c()()()()),e&2&&(m(10),j("ngModel",n.selectedTheme),m(4),j("ngModel",n.selectedTheme),m(4),j("ngModel",n.selectedTheme),m(14),x("value",!0),j("ngModel",n.useEnterToSend),m(4),x("value",!1),j("ngModel",n.useEnterToSend),m(7),j("ngModel",n.showTechnicalMessages),m(5),j("ngModel",n.showWarningMessages),m(5),j("ngModel",n.printTechnicalMessages),m(11),j("ngModel",n.agentNotificationEnabled),m(5),j("ngModel",n.notificationSoundEnabled),x("disabled",!n.agentNotificationEnabled),m(5),j("ngModel",n.browserNotificationEnabled),x("disabled",!n.agentNotificationEnabled||n.browserNotificationDenied),m(),S(n.browserNotificationDenied?75:-1),m(10),j("ngModel",n.selectedVoiceLanguage),m(),je(n.voiceLanguageOptions),m(7),x("value",!0),j("ngModel",n.voiceAnnounceEnabled),m(4),x("value",!1),j("ngModel",n.voiceAnnounceEnabled),m(8),j("ngModel",n.voiceMode),m(4),j("ngModel",n.voiceMode),m(8),x("value",!0),j("ngModel",n.voiceReadFullText),m(4),x("value",!1),j("ngModel",n.voiceReadFullText),m(6),j("ngModel",n.selectedVoiceId),x("disabled",n.loadingVoices||n.availableVoices.length===0),m(),S(n.loadingVoices?128:-1),m(),S(!n.loadingVoices&&n.availableVoices.length===0?129:-1),m(),je(n.availableVoices),m(8),ue("Volume: ",n.voiceVolume,"%"),m(),j("ngModel",n.voiceVolume),m(3),ue("Speed: ",n.voiceRate,"%"),m(),j("ngModel",n.voiceRate))},dependencies:[ot,Gc,Yc,Ge,hh,qc,Gr,rt,Xe,Ee,to],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 XM=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["ng-component"]],hostAttrs:["cdk-text-field-style-loader",""],decls:0,vars:0,template:function(n,r){},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}
|
|
368
|
-
`],encapsulation:2,changeDetection:0})}return i})(),KM={passive:!0},Mv=(()=>{class i{_platform=u(pt);_ngZone=u(fe);_renderer=u(Fn).createRenderer(null,null);_styleLoader=u($t);_monitoredElements=new Map;constructor(){}monitor(e){if(!this._platform.isBrowser)return In;this._styleLoader.load(XM);let n=Aa(e),r=this._monitoredElements.get(n);if(r)return r.subject;let o=new I,a="cdk-text-field-autofilled",s=p=>{p.animationName==="cdk-text-field-autofill-start"&&!n.classList.contains(a)?(n.classList.add(a),this._ngZone.run(()=>o.next({target:p.target,isAutofilled:!0}))):p.animationName==="cdk-text-field-autofill-end"&&n.classList.contains(a)&&(n.classList.remove(a),this._ngZone.run(()=>o.next({target:p.target,isAutofilled:!1})))},d=this._ngZone.runOutsideAngular(()=>(n.classList.add("cdk-text-field-autofill-monitored"),this._renderer.listen(n,"animationstart",s,KM)));return this._monitoredElements.set(n,{subject:o,unlisten:d}),o}stopMonitoring(e){let n=Aa(e),r=this._monitoredElements.get(n);r&&(r.unlisten(),r.subject.complete(),n.classList.remove("cdk-text-field-autofill-monitored"),n.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(n))}ngOnDestroy(){this._monitoredElements.forEach((e,n)=>this.stopMonitoring(n))}static \u0275fac=function(n){return new(n||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var Ev=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=de({type:i});static \u0275inj=ce({})}return i})();var Tv=new q("MAT_INPUT_VALUE_ACCESSOR");var Mh=class{_box;_destroyed=new I;_resizeSubject=new I;_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 nn(e=>{let n=this._resizeSubject.subscribe(e);return this._resizeObserver?.observe(t,{box:this._box}),()=>{this._resizeObserver?.unobserve(t),n.unsubscribe(),this._elementObservables.delete(t)}}).pipe(le(e=>e.some(n=>n.target===t)),Wi({bufferSize:1,refCount:!0}),L(this._destroyed))),this._elementObservables.get(t)}destroy(){this._destroyed.next(),this._destroyed.complete(),this._resizeSubject.complete(),this._elementObservables.clear()}},Ov=(()=>{class i{_cleanupErrorListener;_observers=new Map;_ngZone=u(fe);constructor(){typeof ResizeObserver<"u"}ngOnDestroy(){for(let[,e]of this._observers)e.destroy();this._observers.clear(),this._cleanupErrorListener?.()}observe(e,n){let r=n?.box||"content-box";return this._observers.has(r)||this._observers.set(r,new Mh(r)),this._observers.get(r).observe(e)}static \u0275fac=function(n){return new(n||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var ZM=["notch"],JM=["matFormFieldNotchedOutline",""],e1=["*"],Pv=["iconPrefixContainer"],Av=["textPrefixContainer"],Dv=["iconSuffixContainer"],Iv=["textSuffixContainer"],t1=["textField"],n1=["*",[["mat-label"]],[["","matPrefix",""],["","matIconPrefix",""]],[["","matTextPrefix",""]],[["","matTextSuffix",""]],[["","matSuffix",""],["","matIconSuffix",""]],[["mat-error"],["","matError",""]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],i1=["*","mat-label","[matPrefix], [matIconPrefix]","[matTextPrefix]","[matTextSuffix]","[matSuffix], [matIconSuffix]","mat-error, [matError]","mat-hint:not([align='end'])","mat-hint[align='end']"];function r1(i,t){i&1&&F(0,"span",21)}function o1(i,t){if(i&1&&(l(0,"label",20),_e(1,1),w(2,r1,1,0,"span",21),c()),i&2){let e=g(2);x("floating",e._shouldLabelFloat())("monitorResize",e._hasOutline())("id",e._labelId),K("for",e._control.disableAutomaticLabeling?null:e._control.id),m(2),S(!e.hideRequiredMarker&&e._control.required?2:-1)}}function a1(i,t){if(i&1&&w(0,o1,3,5,"label",20),i&2){let e=g();S(e._hasFloatingLabel()?0:-1)}}function s1(i,t){i&1&&F(0,"div",7)}function l1(i,t){}function c1(i,t){if(i&1&&tt(0,l1,0,0,"ng-template",13),i&2){g(2);let e=hn(1);x("ngTemplateOutlet",e)}}function d1(i,t){if(i&1&&(l(0,"div",9),w(1,c1,1,1,null,13),c()),i&2){let e=g();x("matFormFieldNotchedOutlineOpen",e._shouldLabelFloat()),m(),S(e._forceDisplayInfixLabel()?-1:1)}}function u1(i,t){i&1&&(l(0,"div",10,2),_e(2,2),c())}function m1(i,t){i&1&&(l(0,"div",11,3),_e(2,3),c())}function h1(i,t){}function p1(i,t){if(i&1&&tt(0,h1,0,0,"ng-template",13),i&2){g();let e=hn(1);x("ngTemplateOutlet",e)}}function g1(i,t){i&1&&(l(0,"div",14,4),_e(2,4),c())}function f1(i,t){i&1&&(l(0,"div",15,5),_e(2,5),c())}function _1(i,t){i&1&&F(0,"div",16)}function b1(i,t){i&1&&(l(0,"div",18),_e(1,6),c())}function v1(i,t){if(i&1&&(l(0,"mat-hint",22),h(1),c()),i&2){let e=g(2);x("id",e._hintLabelId),m(),U(e.hintLabel)}}function y1(i,t){if(i&1&&(l(0,"div",19),w(1,v1,2,2,"mat-hint",22),_e(2,7),F(3,"div",23),_e(4,8),c()),i&2){let e=g();m(),S(e.hintLabel?1:-1)}}var Kt=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275dir=ne({type:i,selectors:[["mat-label"]]})}return i})(),C1=new q("MatError");var Hi=(()=>{class i{align="start";id=u(He).getId("mat-mdc-hint-");static \u0275fac=function(n){return new(n||i)};static \u0275dir=ne({type:i,selectors:[["mat-hint"]],hostAttrs:[1,"mat-mdc-form-field-hint","mat-mdc-form-field-bottom-align"],hostVars:4,hostBindings:function(n,r){n&2&&(mn("id",r.id),K("align",null),R("mat-mdc-form-field-hint-end",r.align==="end"))},inputs:{align:"align",id:"id"}})}return i})(),zv=new q("MatPrefix"),no=(()=>{class i{set _isTextSelector(e){this._isText=!0}_isText=!1;static \u0275fac=function(n){return new(n||i)};static \u0275dir=ne({type:i,selectors:[["","matPrefix",""],["","matIconPrefix",""],["","matTextPrefix",""]],inputs:{_isTextSelector:[0,"matTextPrefix","_isTextSelector"]},features:[Ce([{provide:zv,useExisting:i}])]})}return i})(),x1=new q("MatSuffix");var Bv=new q("FloatingLabelParent"),Rv=(()=>{class i{_elementRef=u(ae);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=u(Ov);_ngZone=u(fe);_parent=u(Bv);_resizeSubscription=new yn;constructor(){}ngOnDestroy(){this._resizeSubscription.unsubscribe()}getWidth(){return w1(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(n){return new(n||i)};static \u0275dir=ne({type:i,selectors:[["label","matFormFieldFloatingLabel",""]],hostAttrs:[1,"mdc-floating-label","mat-mdc-floating-label"],hostVars:2,hostBindings:function(n,r){n&2&&R("mdc-floating-label--float-above",r.floating)},inputs:{floating:"floating",monitorResize:"monitorResize"}})}return i})();function w1(i){let t=i;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 n=e.scrollWidth;return e.remove(),n}var Fv="mdc-line-ripple--active",kd="mdc-line-ripple--deactivating",Nv=(()=>{class i{_elementRef=u(ae);_cleanupTransitionEnd;constructor(){let e=u(fe),n=u(et);e.runOutsideAngular(()=>{this._cleanupTransitionEnd=n.listen(this._elementRef.nativeElement,"transitionend",this._handleTransitionEnd)})}activate(){let e=this._elementRef.nativeElement.classList;e.remove(kd),e.add(Fv)}deactivate(){this._elementRef.nativeElement.classList.add(kd)}_handleTransitionEnd=e=>{let n=this._elementRef.nativeElement.classList,r=n.contains(kd);e.propertyName==="opacity"&&r&&n.remove(Fv,kd)};ngOnDestroy(){this._cleanupTransitionEnd()}static \u0275fac=function(n){return new(n||i)};static \u0275dir=ne({type:i,selectors:[["div","matFormFieldLineRipple",""]],hostAttrs:[1,"mdc-line-ripple"]})}return i})(),Vv=(()=>{class i{_elementRef=u(ae);_ngZone=u(fe);open=!1;_notch;ngAfterViewInit(){let e=this._elementRef.nativeElement,n=e.querySelector(".mdc-floating-label");n?(e.classList.add("mdc-notched-outline--upgraded"),typeof requestAnimationFrame=="function"&&(n.style.transitionDuration="0s",this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>n.style.transitionDuration="")}))):e.classList.add("mdc-notched-outline--no-label")}_setNotchWidth(e){let n=this._notch.nativeElement;!this.open||!e?n.style.width="":n.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(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["div","matFormFieldNotchedOutline",""]],viewQuery:function(n,r){if(n&1&&se(ZM,5),n&2){let o;G(o=Y())&&(r._notch=o.first)}},hostAttrs:[1,"mdc-notched-outline"],hostVars:2,hostBindings:function(n,r){n&2&&R("mdc-notched-outline--notched",r.open)},inputs:{open:[0,"matFormFieldNotchedOutlineOpen","open"]},attrs:JM,ngContentSelectors:e1,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(n,r){n&1&&(Qe(),wr(0,"div",1),wn(1,"div",2,0),_e(3),Sn(),wr(4,"div",3))},encapsulation:2,changeDetection:0})}return i})(),Rs=(()=>{class i{value;stateChanges;id;placeholder;ngControl;focused;empty;shouldLabelFloat;required;disabled;errorState;controlType;autofilled;userAriaDescribedBy;disableAutomaticLabeling;describedByIds;static \u0275fac=function(n){return new(n||i)};static \u0275dir=ne({type:i})}return i})();var Fs=new q("MatFormField"),S1=new q("MAT_FORM_FIELD_DEFAULT_OPTIONS"),Lv="fill",k1="auto",jv="fixed",M1="translateY(-50%)",Zt=(()=>{class i{_elementRef=u(ae);_changeDetectorRef=u(ze);_platform=u(pt);_idGenerator=u(He);_ngZone=u(fe);_defaults=u(S1,{optional:!0});_currentDirection;_textField;_iconPrefixContainer;_textPrefixContainer;_iconSuffixContainer;_textSuffixContainer;_floatingLabel;_notchedOutline;_lineRipple;_iconPrefixContainerSignal=Pa("iconPrefixContainer");_textPrefixContainerSignal=Pa("textPrefixContainer");_iconSuffixContainerSignal=Pa("iconSuffixContainer");_textSuffixContainerSignal=Pa("textSuffixContainer");_prefixSuffixContainers=Ct(()=>[this._iconPrefixContainerSignal(),this._textPrefixContainerSignal(),this._iconSuffixContainerSignal(),this._textSuffixContainerSignal()].map(e=>e?.nativeElement).filter(e=>e!==void 0));_formFieldControl;_prefixChildren;_suffixChildren;_errorChildren;_hintChildren;_labelChild=Fp(Kt);get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(e){this._hideRequiredMarker=pn(e)}_hideRequiredMarker=!1;color="primary";get floatLabel(){return this._floatLabel||this._defaults?.floatLabel||k1}set floatLabel(e){e!==this._floatLabel&&(this._floatLabel=e,this._changeDetectorRef.markForCheck())}_floatLabel;get appearance(){return this._appearanceSignal()}set appearance(e){let n=e||this._defaults?.appearance||Lv;this._appearanceSignal.set(n)}_appearanceSignal=Me(Lv);get subscriptSizing(){return this._subscriptSizing||this._defaults?.subscriptSizing||jv}set subscriptSizing(e){this._subscriptSizing=e||this._defaults?.subscriptSizing||jv}_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 I;_isFocused=null;_explicitFormFieldControl;_previousControl=null;_previousControlValidatorFn=null;_stateChanges;_valueChanges;_describedByChanges;_outlineLabelOffsetResizeObserver=null;_animationsDisabled=ut();constructor(){let e=this._defaults,n=u(jt);e&&(e.appearance&&(this.appearance=e.appearance),this._hideRequiredMarker=!!e?.hideRequiredMarker,e.color&&(this.color=e.color)),fo(()=>this._currentDirection=n.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=Ct(()=>this._hasFloatingLabel()?this._labelId:null);getConnectedOverlayOrigin(){return this._textField||this._elementRef}_animateAndLockLabel(){this._hasFloatingLabel()&&(this.floatLabel="always")}_initializeControl(e){let n=this._control,r="mat-mdc-form-field-type-";e&&this._elementRef.nativeElement.classList.remove(r+e.controlType),n.controlType&&this._elementRef.nativeElement.classList.add(r+n.controlType),this._stateChanges?.unsubscribe(),this._stateChanges=n.stateChanges.subscribe(()=>{this._updateFocusState(),this._changeDetectorRef.markForCheck()}),this._describedByChanges?.unsubscribe(),this._describedByChanges=n.stateChanges.pipe(At([void 0,void 0]),X(()=>[n.errorState,n.userAriaDescribedBy]),po(),le(([[o,a],[s,d]])=>o!==s||a!==d)).subscribe(()=>this._syncDescribedByIds()),this._valueChanges?.unsubscribe(),n.ngControl&&n.ngControl.valueChanges&&(this._valueChanges=n.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(),Zn(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(){Np({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=Ct(()=>!!this._labelChild());_shouldLabelFloat(){return this._hasFloatingLabel()?this._control.shouldLabelFloat||this._shouldAlwaysFloat():!1}_shouldForward(e){let n=this._control?this._control.ngControl:null;return n&&n[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 o=this._hintChildren?this._hintChildren.find(s=>s.align==="start"):null,a=this._hintChildren?this._hintChildren.find(s=>s.align==="end"):null;o?e.push(o.id):this._hintLabel&&e.push(this._hintLabelId),a&&e.push(a.id)}else this._errorChildren&&e.push(...this._errorChildren.map(o=>o.id));let n=this._control.describedByIds,r;if(n){let o=this._describedByIds||e;r=e.concat(n.filter(a=>a&&!o.includes(a)))}else r=e;this._control.setDescribedByIds(r),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,n=this._textPrefixContainer?.nativeElement,r=this._iconSuffixContainer?.nativeElement,o=this._textSuffixContainer?.nativeElement,a=e?.getBoundingClientRect().width??0,s=n?.getBoundingClientRect().width??0,d=r?.getBoundingClientRect().width??0,p=o?.getBoundingClientRect().width??0,f=this._currentDirection==="rtl"?"-1":"1",v=`${a+s}px`,T=`calc(${f} * (${v} + var(--mat-mdc-form-field-label-offset-x, 0px)))`,k=`var(--mat-mdc-form-field-label-transform, ${M1} translateX(${T}))`,V=a+s+d+p;return[k,V]}_writeOutlinedLabelStyles(e){if(e!==null){let[n,r]=e;this._floatingLabel&&(this._floatingLabel.element.style.transform=n),r!==null&&this._notchedOutline?._setMaxWidth(r)}}_isAttachedToDom(){let e=this._elementRef.nativeElement;if(e.getRootNode){let n=e.getRootNode();return n&&n!==e}return document.documentElement.contains(e)}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["mat-form-field"]],contentQueries:function(n,r,o){if(n&1&&(Op(o,r._labelChild,Kt,5),kt(o,Rs,5),kt(o,zv,5),kt(o,x1,5),kt(o,C1,5),kt(o,Hi,5)),n&2){mu();let a;G(a=Y())&&(r._formFieldControl=a.first),G(a=Y())&&(r._prefixChildren=a),G(a=Y())&&(r._suffixChildren=a),G(a=Y())&&(r._errorChildren=a),G(a=Y())&&(r._hintChildren=a)}},viewQuery:function(n,r){if(n&1&&(Ta(r._iconPrefixContainerSignal,Pv,5),Ta(r._textPrefixContainerSignal,Av,5),Ta(r._iconSuffixContainerSignal,Dv,5),Ta(r._textSuffixContainerSignal,Iv,5),se(t1,5),se(Pv,5),se(Av,5),se(Dv,5),se(Iv,5),se(Rv,5),se(Vv,5),se(Nv,5)),n&2){mu(4);let o;G(o=Y())&&(r._textField=o.first),G(o=Y())&&(r._iconPrefixContainer=o.first),G(o=Y())&&(r._textPrefixContainer=o.first),G(o=Y())&&(r._iconSuffixContainer=o.first),G(o=Y())&&(r._textSuffixContainer=o.first),G(o=Y())&&(r._floatingLabel=o.first),G(o=Y())&&(r._notchedOutline=o.first),G(o=Y())&&(r._lineRipple=o.first)}},hostAttrs:[1,"mat-mdc-form-field"],hostVars:38,hostBindings:function(n,r){n&2&&R("mat-mdc-form-field-label-always-float",r._shouldAlwaysFloat())("mat-mdc-form-field-has-icon-prefix",r._hasIconPrefix)("mat-mdc-form-field-has-icon-suffix",r._hasIconSuffix)("mat-form-field-invalid",r._control.errorState)("mat-form-field-disabled",r._control.disabled)("mat-form-field-autofilled",r._control.autofilled)("mat-form-field-appearance-fill",r.appearance=="fill")("mat-form-field-appearance-outline",r.appearance=="outline")("mat-form-field-hide-placeholder",r._hasFloatingLabel()&&!r._shouldLabelFloat())("mat-primary",r.color!=="accent"&&r.color!=="warn")("mat-accent",r.color==="accent")("mat-warn",r.color==="warn")("ng-untouched",r._shouldForward("untouched"))("ng-touched",r._shouldForward("touched"))("ng-pristine",r._shouldForward("pristine"))("ng-dirty",r._shouldForward("dirty"))("ng-valid",r._shouldForward("valid"))("ng-invalid",r._shouldForward("invalid"))("ng-pending",r._shouldForward("pending"))},inputs:{hideRequiredMarker:"hideRequiredMarker",color:"color",floatLabel:"floatLabel",appearance:"appearance",subscriptSizing:"subscriptSizing",hintLabel:"hintLabel"},exportAs:["matFormField"],features:[Ce([{provide:Fs,useExisting:i},{provide:Bv,useExisting:i}])],ngContentSelectors:i1,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(n,r){if(n&1){let o=A();Qe(n1),tt(0,a1,1,1,"ng-template",null,0,rl),l(2,"div",6,1),b("click",function(s){return y(o),C(r._control.onContainerClick(s))}),w(4,s1,1,0,"div",7),l(5,"div",8),w(6,d1,2,2,"div",9),w(7,u1,3,0,"div",10),w(8,m1,3,0,"div",11),l(9,"div",12),w(10,p1,1,1,null,13),_e(11),c(),w(12,g1,3,0,"div",14),w(13,f1,3,0,"div",15),c(),w(14,_1,1,0,"div",16),c(),l(15,"div",17),w(16,b1,2,0,"div",18)(17,y1,5,1,"div",19),c()}if(n&2){let o;m(2),R("mdc-text-field--filled",!r._hasOutline())("mdc-text-field--outlined",r._hasOutline())("mdc-text-field--no-label",!r._hasFloatingLabel())("mdc-text-field--disabled",r._control.disabled)("mdc-text-field--invalid",r._control.errorState),m(2),S(!r._hasOutline()&&!r._control.disabled?4:-1),m(2),S(r._hasOutline()?6:-1),m(),S(r._hasIconPrefix?7:-1),m(),S(r._hasTextPrefix?8:-1),m(2),S(!r._hasOutline()||r._forceDisplayInfixLabel()?10:-1),m(2),S(r._hasTextSuffix?12:-1),m(),S(r._hasIconSuffix?13:-1),m(),S(r._hasOutline()?-1:14),m(),R("mat-mdc-form-field-subscript-dynamic-size",r.subscriptSizing==="dynamic");let a=r._getSubscriptMessageType();m(),S((o=a)==="error"?16:o==="hint"?17:-1)}},dependencies:[Rv,Vv,sl,Nv,Hi],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)}
|
|
369
|
-
`],encapsulation:2,changeDetection:0})}return i})();var Md=(()=>{class i{isErrorState(e,n){return!!(e&&e.invalid&&(e.touched||n&&n.submitted))}static \u0275fac=function(n){return new(n||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var va=class{_defaultMatcher;ngControl;_parentFormGroup;_parentForm;_stateChanges;errorState=!1;matcher;constructor(t,e,n,r,o){this._defaultMatcher=t,this.ngControl=e,this._parentFormGroup=n,this._parentForm=r,this._stateChanges=o}updateErrorState(){let t=this.errorState,e=this._parentFormGroup||this._parentForm,n=this.matcher||this._defaultMatcher,r=this.ngControl?this.ngControl.control:null,o=n?.isErrorState(r,e)??!1;o!==t&&(this.errorState=o,this._stateChanges.next())}};var vt=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=de({type:i});static \u0275inj=ce({imports:[pe,Xp,Zt,pe]})}return i})();var E1=["button","checkbox","file","hidden","image","radio","range","reset","submit"],T1=new q("MAT_INPUT_CONFIG"),An=(()=>{class i{_elementRef=u(ae);_platform=u(pt);ngControl=u(mi,{optional:!0,self:!0});_autofillMonitor=u(Mv);_ngZone=u(fe);_formField=u(Fs,{optional:!0});_renderer=u(et);_uid=u(He).getId("mat-input-");_previousNativeValue;_inputValueAccessor;_signalBasedValueAccessor;_previousPlaceholder;_errorStateTracker;_config=u(T1,{optional:!0});_cleanupIosKeyup;_cleanupWebkitWheel;_isServer;_isNativeSelect;_isTextarea;_isInFormField;focused=!1;stateChanges=new I;controlType="mat-input";autofilled=!1;get disabled(){return this._disabled}set disabled(e){this._disabled=pn(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(Zo.required)??!1}set required(e){this._required=pn(e)}_required;get type(){return this._type}set type(e){this._type=e||"text",this._validateType(),!this._isTextarea&&bu().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=pn(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=>bu().has(e));constructor(){let e=u(Es,{optional:!0}),n=u(Os,{optional:!0}),r=u(Md),o=u(Tv,{optional:!0,self:!0}),a=this._elementRef.nativeElement,s=a.nodeName.toLowerCase();o?Js(o.value)?this._signalBasedValueAccessor=o:this._inputValueAccessor=o: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 va(r,this.ngControl,n,e,this.stateChanges),this._isServer=!this._platform.isBrowser,this._isNativeSelect=s==="select",this._isTextarea=s==="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&&fo(()=>{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 n=this._elementRef.nativeElement;n.type==="number"?(n.type="text",n.setSelectionRange(0,0),n.type="number"):n.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 n=this._elementRef.nativeElement;this._previousPlaceholder=e,e?n.setAttribute("placeholder",e):n.removeAttribute("placeholder")}}_getPlaceholder(){return this.placeholder||null}_validateType(){E1.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,n=e.options[0];return this.focused||e.multiple||!this.empty||!!(e.selectedIndex>-1&&n&&n.label)}else return this.focused&&!this.disabled||!this.empty}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){let n=this._elementRef.nativeElement;e.length?n.setAttribute("aria-describedby",e.join(" ")):n.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 n=e.target;!n.value&&n.selectionStart===0&&n.selectionEnd===0&&(n.setSelectionRange(1,1),n.setSelectionRange(0,0))};_getReadonlyAttribute(){return this._isNativeSelect?null:this.readonly||this.disabled&&this.disabledInteractive?"true":null}static \u0275fac=function(n){return new(n||i)};static \u0275dir=ne({type:i,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-mdc-input-element"],hostVars:21,hostBindings:function(n,r){n&1&&b("focus",function(){return r._focusChanged(!0)})("blur",function(){return r._focusChanged(!1)})("input",function(){return r._onInput()}),n&2&&(mn("id",r.id)("disabled",r.disabled&&!r.disabledInteractive)("required",r.required),K("name",r.name||null)("readonly",r._getReadonlyAttribute())("aria-disabled",r.disabled&&r.disabledInteractive?"true":null)("aria-invalid",r.empty&&r.required?null:r.errorState)("aria-required",r.required)("id",r.id),R("mat-input-server",r._isServer)("mat-mdc-form-field-textarea-control",r._isInFormField&&r._isTextarea)("mat-mdc-form-field-input-control",r._isInFormField)("mat-mdc-input-disabled-interactive",r.disabledInteractive)("mdc-text-field__input",r._isInFormField)("mat-mdc-native-select-inline",r._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",ie]},exportAs:["matInput"],features:[Ce([{provide:Rs,useExisting:i}]),Ne]})}return i})(),cn=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=de({type:i});static \u0275inj=ce({imports:[pe,vt,vt,Ev,pe]})}return i})();var Ed=class i{http=u(nt);usernameSubject=new Z(null);username$=this.usernameSubject.asObservable();fetchCurrentUser(){return this.http.get("/api/user/me").pipe(ve(t=>{this.usernameSubject.next(t.username)}))}getUsername(){return this.usernameSubject.value}static \u0275fac=function(e){return new(e||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})};var O1=(i,t)=>t.label,P1=(i,t)=>t.id;function A1(i,t){i&1&&(l(0,"div",3),F(1,"span",4),l(2,"span",5),h(3,"Loading threads..."),c()())}function D1(i,t){if(i&1&&(l(0,"div",18),h(1),c()),i&2){let e=g(6);m(),U(e.renameErrorMessage)}}function I1(i,t){if(i&1){let e=A();l(0,"div",11)(1,"input",17),B("ngModelChange",function(r){y(e);let o=g(5);return z(o.editingThreadName,r)||(o.editingThreadName=r),C(r)}),b("keydown",function(r){y(e);let o=g(5);return C(o.onEditKeydown(r))})("blur",function(){y(e);let r=g(5);return C(r.onEditBlur())})("click",function(r){return y(e),C(r.stopPropagation())}),c(),w(2,D1,2,1,"div",18),c()}if(i&2){let e=g(5);m(),j("ngModel",e.editingThreadName),x("disabled",e.isRenamingThread),m(),S(e.renameErrorMessage?2:-1)}}function R1(i,t){if(i&1&&(l(0,"span",20),h(1),c()),i&2){let e=g(2).$implicit;m(),U(e.name)}}function F1(i,t){i&1&&(F(0,"mat-spinner",21),l(1,"span",22),h(2,"Generating name..."),c()),i&2&&x("diameter",16)}function N1(i,t){if(i&1){let e=A();l(0,"a",19),b("click",function(r){y(e);let o=g().$implicit;return g(4).selectThread(o.id),C(r.preventDefault())})("keydown.enter",function(r){y(e);let o=g().$implicit;return g(4).selectThread(o.id),C(r.preventDefault())})("keydown.space",function(r){y(e);let o=g().$implicit;return g(4).selectThread(o.id),C(r.preventDefault())}),w(1,R1,2,1,"span",20)(2,F1,3,1),c()}if(i&2){let e=g().$implicit;x("title",e.name||"Generating name..."),m(),S(e.name?1:2)}}function V1(i,t){if(i&1){let e=A();l(0,"button",23),b("click",function(r){y(e);let o=g().$implicit,a=g(4);return C(a.startEditingThreadName(r,o))}),l(1,"mat-icon"),h(2,"edit"),c()()}}function L1(i,t){if(i&1){let e=A();l(0,"div",10),w(1,I1,3,3,"div",11)(2,N1,3,2,"a",12),l(3,"div",13),w(4,V1,3,0,"button",14),l(5,"button",15),b("click",function(r){let o=y(e).$implicit,a=g(4);return C(a.toggleStar(r,o))}),l(6,"mat-icon"),h(7),c()(),l(8,"button",16),b("click",function(r){let o=y(e).$implicit,a=g(4);return C(a.deleteThread(r,o))}),l(9,"mat-icon"),h(10,"delete"),c()()()()}if(i&2){let e,n=t.$implicit,r=g(4);R("current",n.id===((e=r.currentThread())==null?null:e.id)),m(),S(r.editingThreadId===n.id?1:2),m(3),S(r.editingThreadId!==n.id&&n.name?4:-1),m(),R("starred",r.isStarred(n)),x("title",r.isStarred(n)?"Unstar thread":"Star thread"),m(2),U(r.isStarred(n)?"star":"star_outline")}}function j1(i,t){if(i&1&&(l(0,"div",6)(1,"div",8),h(2),c(),Le(3,L1,11,8,"div",9,P1),c()),i&2){let e=t.$implicit;m(2),U(e.label),m(),je(e.threads)}}function z1(i,t){i&1&&(l(0,"div",7),h(1,"No existing threads"),c())}function B1(i,t){if(i&1&&(l(0,"div",7),h(1),c()),i&2){let e=g(3);m(),ue('No threads matching "',e.searchQuery,'"')}}function H1(i,t){if(i&1&&(Le(0,j1,5,1,"div",6,O1),w(2,z1,2,0,"div",7)(3,B1,2,1,"div",7)),i&2){let e,n=g(2);je(n.getGroupedThreads()),m(2),S(!((e=n.threads())!=null&&e.length)&&!n.searchQuery?2:n.searchQuery&&n.getGroupedThreads().length===0?3:-1)}}function U1(i,t){if(i&1&&(l(0,"div",1),w(1,A1,4,0,"div",3)(2,H1,4,1),c()),i&2){let e=g();m(),S(e.isLoadingThreadList()?1:2)}}function $1(i,t){i&1&&(l(0,"span",24),h(1,"No project selected"),c())}function W1(i,t){i&1&&(l(0,"span",24),h(1,"Loading..."),c())}function q1(i,t){if(i&1&&(l(0,"div",2),w(1,$1,2,0,"span",24)(2,W1,2,0,"span",24),c()),i&2){let e,n=g();m(),S((e=n.currentProject())!=null&&e.name?2:1)}}var Td=class i{projects=null;searchMode=!1;searchQuery="";searchModeChange=new H;projectStateService=u(Te);threadStateService=u(Bt);threadApiService=u(hr);userService=u(Ed);router=u(Dt);currentThread=qt(this.threadStateService.selectedThread$);currentProject=qt(this.projectStateService.selectedProject$);threads=qt(this.threadStateService.threadList$);isLoadingThreadList=qt(this.threadStateService.isLoadingThreadList$);username=qt(this.userService.username$);editingThreadId=null;editingThreadName="";isRenamingThread=!1;renameErrorMessage="";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[];if(this.searchQuery&&this.searchQuery.trim()){let p=this.searchQuery.toLowerCase().trim();t=t.filter(f=>f.name.toLowerCase().includes(p))}if(!t.length)return[];let e=this.username();if(!e)return[];let n=t.filter(p=>p.starring&&p.starring.includes(e)),r=t.filter(p=>!p.starring||!p.starring.includes(e)),o=new Map,a=new Date;a.setHours(0,0,0,0);for(let p of r){let f=new Date(p.modifiedDate);f.setHours(0,0,0,0);let v=a.getTime()-f.getTime(),E=Math.floor(v/(1e3*60*60*24)),T;E===0?T="Today":E===1?T="Yesterday":E<7?T="This Week":E<30?T="This Month":E<90?T="Last 3 Months":T="Older",o.has(T)||o.set(T,[]),o.get(T).push(p)}let s=[];if(n.length>0){let p=[...n].sort((f,v)=>f.modifiedDate>v.modifiedDate?-1:1);s.push({label:"Starred",threads:p})}return["Today","Yesterday","This Week","This Month","Last 3 Months","Older"].filter(p=>o.has(p)).forEach(p=>{s.push({label:p,threads:o.get(p)})}),s}isStarred(t){let e=this.username();return!!e&&t.starring&&t.starring.includes(e)}toggleStar(t,e){t.stopPropagation();let n=this.username();if(!n)return;(e.starring&&e.starring.includes(n)?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 n=this.currentProject()?.name;!n||!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",n])),this.threadStateService.refreshThreadList()},error:o=>{console.error("Error deleting thread:",o),alert("Failed to delete thread. Please try again.")}})}formatDate(t){try{let e=new Date(t),r=new Date().getTime()-e.getTime(),o=Math.floor(r/(1e3*60*60*24));return o===0?"Today":o===1?"Yesterday":o<7?`${o} 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 n=document.querySelector(".thread-name-input");n&&(n.focus(),n.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 n=this.editingThreadId;this.isRenamingThread=!0,this.renameErrorMessage="",this.threadStateService.renameThread(n,e).subscribe({next:()=>{console.log("[THREAD-SELECTOR] Thread renamed successfully"),this.cancelEditingThreadName(),this.isRenamingThread=!1},error:r=>{console.error("[THREAD-SELECTOR] Error renaming thread:",r),this.renameErrorMessage=r.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||i)};static \u0275cmp=P({type:i,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"],["role","menuitem","tabindex","0",1,"thread-item",3,"title"],[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"],["role","menuitem","tabindex","0",1,"thread-item",3,"click","keydown.enter","keydown.space","title"],[1,"thread-name"],[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,n){if(e&1&&(l(0,"div",0),b("click",function(o){return o.stopPropagation()})("keydown",function(o){return o.stopPropagation()}),w(1,U1,3,1,"div",1)(2,q1,3,1,"div",2),c()),e&2){let r;m(),S((r=n.currentProject())!=null&&r.name?1:2)}},dependencies:[Be,ot,Ge,rt,gh,Xe,it,Ee,Tt,Et,cn,vt,ld,sd],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}@media (max-width: 768px){.thread-item[_ngcontent-%COMP%]{padding:.6rem .8rem}.thread-name[_ngcontent-%COMP%]{font-size:.8rem}}"]})};function G1(i,t){if(i&1&&(l(0,"div",3),h(1),c()),i&2){let e=g();m(),ue("\u274C ",e.errorMessage)}}var Ns=class i{dialogRef=u(bn);data=u(li);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||i)};static \u0275cmp=P({type:i,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,n){e&1&&(l(0,"div",0),h(1),l(2,"button",1),b("click",function(){return n.onCancel()}),l(3,"mat-icon"),h(4,"close"),c()()(),l(5,"mat-dialog-content")(6,"textarea",2),B("ngModelChange",function(o){return z(n.jsonContent,o)||(n.jsonContent=o),o}),c(),w(7,G1,2,1,"div",3),c(),l(8,"mat-dialog-actions",4)(9,"button",5),b("click",function(){return n.onCancel()}),h(10,"Cancel"),c(),l(11,"button",6),b("click",function(){return n.onSave()}),h(12,"Save"),c()()),e&2&&(m(),ue(" ",n.title," "),m(5),j("ngModel",n.jsonContent),m(),S(n.errorMessage?7:-1))},dependencies:[Be,ot,Ge,rt,Xe,Ee,Et,zt,Ii,Ri,Fi],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 Y1(i,t){if(i&1){let e=A();l(0,"div",9)(1,"mat-form-field",18)(2,"mat-label"),h(3),c(),l(4,"textarea",19),B("ngModelChange",function(r){let o=y(e).$index,a=g();return z(a.commands[o],r)||(a.commands[o]=r),C(r)}),c(),l(5,"mat-hint"),h(6,"Use placeholder for dynamic values"),c()(),l(7,"button",20),b("click",function(){let r=y(e).$index,o=g();return C(o.removeCommand(r))}),l(8,"mat-icon"),h(9,"delete"),c()()()}if(i&2){let e=t.$index,n=g();m(3),ue("Command ",e+1),m(),j("ngModel",n.commands[e]),m(3),x("disabled",n.commands.length===1)}}function Q1(i,t){if(i&1){let e=A();l(0,"div",10)(1,"h3"),h(2,"Save to"),c(),l(3,"div",21)(4,"label",22)(5,"input",23),B("ngModelChange",function(r){y(e);let o=g();return z(o.source,r)||(o.source=r),C(r)}),c(),l(6,"div",24)(7,"div",25)(8,"span",26),h(9,"\u{1F464}"),c(),l(10,"span",27),h(11,"Local"),c()(),l(12,"p",28),h(13,"Personal prompt in ~/.coday/... (not committed)"),c()()(),l(14,"label",22)(15,"input",29),B("ngModelChange",function(r){y(e);let o=g();return z(o.source,r)||(o.source=r),C(r)}),c(),l(16,"div",24)(17,"div",25)(18,"span",26),h(19,"\u{1F4E6}"),c(),l(20,"span",27),h(21,"Project"),c()(),l(22,"p",28),h(23,"Shared prompt in ./prompts/ (committable)"),c()()()(),l(24,"p",30),h(25,"Storage location is permanent and cannot be changed after creation"),c()()}if(i&2){let e=g();m(4),R("selected",e.source==="local"),m(),j("ngModel",e.source),m(9),R("selected",e.source==="project"),m(),j("ngModel",e.source)}}function X1(i,t){if(i&1&&(l(0,"div",11)(1,"h3"),h(2,"Storage Location"),c(),l(3,"div",31)(4,"span",26),h(5),c(),l(6,"span",27),h(7),c()(),l(8,"p",30),h(9,"Cannot be changed after creation"),c()()),i&2){let e=g();m(3),R("badge-local",e.source==="local")("badge-project",e.source==="project"),m(2),U(e.source==="local"?"\u{1F464}":"\u{1F4E6}"),m(2),U(e.source==="local"?"Local":"Project")}}function K1(i,t){if(i&1){let e=A();l(0,"div",12)(1,"label",32)(2,"input",33),B("ngModelChange",function(r){y(e);let o=g();return z(o.webhookEnabled,r)||(o.webhookEnabled=r),C(r)}),c(),l(3,"span"),h(4,"Enable webhook"),c()(),l(5,"p",30),h(6,"Enable webhook to trigger this prompt via HTTP POST"),c()()}if(i&2){let e=g();m(2),j("ngModel",e.webhookEnabled)}}function Z1(i,t){if(i&1){let e=A();l(0,"div",13)(1,"div",34)(2,"mat-icon",35),h(3,"link"),c(),l(4,"h4"),h(5,"Webhook URL"),c()(),l(6,"div",36)(7,"p",37),h(8),c(),l(9,"button",38),b("click",function(){y(e);let r=g();return C(r.copyWebhookUrl())}),l(10,"mat-icon"),h(11,"content_copy"),c(),l(12,"span"),h(13,"Copy URL"),c()()(),l(14,"p",30),h(15,"Use this URL to trigger the prompt via HTTP POST"),c()()}if(i&2){let e=g();m(8),U(e.getWebhookUrl())}}function J1(i,t){if(i&1&&(l(0,"div",14)(1,"mat-icon"),h(2,"error"),c(),l(3,"span"),h(4),c()()),i&2){let e=g();m(4),U(e.errorMessage)}}var Vs=class i{promptApi=u(Pn);dialogRef=u(bn);configApi=u(fi);snackBar=u(ss);name="";description="";commands=[""];webhookEnabled=!1;threadLifetime="";source="local";isSaving=!1;errorMessage="";isAdmin=!1;isEditMode=!1;promptId="";data=u(li);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:n=>{console.error("Error updating prompt:",n),this.errorMessage=n?.error?.error||n?.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:n=>{console.error("Error creating prompt:",n),this.errorMessage=n?.error?.error||n?.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||i)};static \u0275cmp=P({type:i,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,n){e&1&&(l(0,"h2",0),h(1),c(),l(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),h(6,"Name"),c(),l(7,"input",3),B("ngModelChange",function(o){return z(n.name,o)||(n.name=o),o}),b("blur",function(){return n.normalizeName()}),c(),l(8,"mat-hint"),h(9,"A descriptive name (spaces and punctuation will be replaced with hyphens)"),c()(),l(10,"mat-form-field",2)(11,"mat-label"),h(12,"Description"),c(),l(13,"textarea",4),B("ngModelChange",function(o){return z(n.description,o)||(n.description=o),o}),c(),l(14,"mat-hint"),h(15,"Explain the purpose of this prompt"),c()(),l(16,"div",5)(17,"div",6)(18,"h3"),h(19,"Commands"),c(),l(20,"button",7),b("click",function(){return n.addCommand()}),l(21,"mat-icon"),h(22,"add"),c()()(),l(23,"div",8),Le(24,Y1,10,3,"div",9,xr),c()(),w(26,Q1,26,6,"div",10),w(27,X1,10,6,"div",11),w(28,K1,7,1,"div",12),w(29,Z1,16,1,"div",13),w(30,J1,5,1,"div",14),c()(),l(31,"mat-dialog-actions",15)(32,"button",16),b("click",function(){return n.cancel()}),h(33,"Cancel"),c(),l(34,"button",17),b("click",function(){return n.save()}),h(35),c()()),e&2&&(m(),U(n.isEditMode?"Edit Prompt":"Create Prompt"),m(6),j("ngModel",n.name),m(6),j("ngModel",n.description),m(11),je(n.commands),m(2),S(n.isEditMode?-1:26),m(),S(n.isEditMode?27:-1),m(),S(n.isAdmin?28:-1),m(),S(n.isEditMode&&n.webhookEnabled&&n.isAdmin?29:-1),m(),S(n.errorMessage?30:-1),m(2),x("disabled",n.isSaving),m(2),x("disabled",n.isSaving),m(),ue(" ",n.isSaving?"Saving...":"Save"," "))},dependencies:[Be,ot,Ge,ah,Gr,rt,Yr,Xe,Hr,Ii,Fi,Ri,Tt,zt,Et,cn,An,Zt,Kt,Hi,vt,it,Ee,Wo],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 eE(i,t){i&1&&(l(0,"div",12),h(1,"Loading prompts..."),c())}function tE(i,t){if(i&1&&(l(0,"div",13),h(1),c()),i&2){let e=g();m(),U(e.errorMessage)}}function nE(i,t){i&1&&(l(0,"div",14),h(1," No prompts found. Create your first prompt to get started. "),c())}function iE(i,t){i&1&&(l(0,"div",14),h(1," No prompts match your search. "),c())}function rE(i,t){if(i&1&&(l(0,"span",31),h(1),c()),i&2){let e=g().$implicit;x("title",Yi("Created by ",e.createdBy)),m(),ue(" \u{1F464} ",e.createdBy," ")}}function oE(i,t){if(i&1){let e=A();l(0,"button",32),b("click",function(){y(e);let r=g().$implicit,o=g(2);return C(o.toggleWebhook(r))}),h(1),c()}if(i&2){let e=g().$implicit;R("btn-webhook-enabled",e.webhookEnabled)("btn-webhook-disabled",!e.webhookEnabled),m(),ue(" ",e.webhookEnabled?"Disable Webhook":"Enable Webhook"," ")}}function aE(i,t){if(i&1){let e=A();l(0,"div",17)(1,"div",18)(2,"div",19)(3,"h3"),h(4),c(),l(5,"div",20)(6,"span",21),h(7),c(),tt(8,rE,2,3,"span",22),c()(),l(9,"p",23),h(10),c(),l(11,"div",24)(12,"span",25),h(13),c(),l(14,"span",26),h(15),c()()(),l(16,"div",27)(17,"button",28),b("click",function(){let r=y(e).$implicit,o=g(2);return C(o.editPrompt(r))}),h(18,"Edit"),c(),tt(19,oE,2,5,"button",29),l(20,"button",30),b("click",function(){let r=y(e).$implicit,o=g(2);return C(o.deletePrompt(r.id))}),h(21,"Delete"),c()()()}if(i&2){let e=t.$implicit,n=g(2);m(4),U(e.name),m(2),R("badge-local",e.source==="local")("badge-project",e.source==="project"),x("title",e.source==="local"?"Local prompt (~/.coday/)":"Project prompt (./prompts/)"),m(),ue(" ",e.source==="local"?"\u{1F464}":"\u{1F4E6}"," "),m(),x("ngIf",e.createdBy!==n.getCurrentUsername()),m(2),U(e.description),m(3),ue("ID: ",e.id),m(),R("enabled",e.webhookEnabled),m(),ue(" Webhook: ",e.webhookEnabled?"Enabled":"Disabled"," "),m(4),x("ngIf",n.isAdmin)}}function sE(i,t){if(i&1&&(l(0,"div",15),tt(1,aE,22,14,"div",16),c()),i&2){let e=g();m(),x("ngForOf",e.filteredPrompts)}}var Od=class i{promptApi=u(Pn);dialog=u(Bn);configApi=u(fi);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 n=e?.error?.error??e?.message??"Failed to delete prompt";alert(`Failed to delete prompt: ${n}`)}})}toggleWebhook(t){(t.webhookEnabled?this.promptApi.disableWebhook(t.id):this.promptApi.enableWebhook(t.id)).subscribe({next:()=>{this.loadPrompts()},error:n=>{console.error("Error toggling webhook:",n);let r=n?.error?.error??n?.message??"Failed to toggle webhook";alert(`Failed to toggle webhook: ${r}`)}})}createPrompt(){this.dialog.open(Vs,{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(n=>this.isMyPrompt(n)):[...this.prompts];t&&(e=e.filter(n=>n.name.toLowerCase().includes(t)||n.description.toLowerCase().includes(t)?!0:n.createdBy.toLowerCase().includes(t))),this.filteredPrompts=e}onSearchChange(){this.applyFilter()}editPrompt(t){this.promptApi.getPrompt(t.id).subscribe({next:e=>{this.dialog.open(Vs,{width:"700px",maxHeight:"90vh",data:{mode:"edit",prompt:e}}).afterClosed().subscribe(r=>{r&&this.loadPrompts()})},error:e=>{console.error("Error loading prompt details:",e);let n=e?.error?.error??e?.message??"Failed to load prompt details";alert(`Failed to load prompt details: ${n}`)}})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=P({type:i,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,n){e&1&&(l(0,"div",0)(1,"div",1)(2,"h2"),h(3,"Prompts"),c(),l(4,"div",2)(5,"mat-form-field",3)(6,"mat-label"),h(7,"Search"),c(),l(8,"input",4),B("ngModelChange",function(o){return z(n.searchQuery,o)||(n.searchQuery=o),o}),b("input",function(){return n.onSearchChange()}),c(),l(9,"mat-icon",5),h(10,"search"),c()(),l(11,"mat-slide-toggle",6),B("ngModelChange",function(o){return z(n.showOnlyMine,o)||(n.showOnlyMine=o),o}),b("change",function(){return n.applyFilter()}),h(12," Mine "),c(),l(13,"button",7),b("click",function(){return n.createPrompt()}),l(14,"mat-icon"),h(15,"add"),c(),l(16,"span"),h(17,"Create Prompt"),c()()()(),tt(18,eE,2,0,"div",8)(19,tE,2,1,"div",9)(20,nE,2,0,"div",10)(21,iE,2,0,"div",10)(22,sE,2,1,"div",11),c()),e&2&&(m(8),j("ngModel",n.searchQuery),m(3),j("ngModel",n.showOnlyMine),m(7),x("ngIf",n.isLoading),m(),x("ngIf",n.errorMessage),m(),x("ngIf",!n.isLoading&&n.prompts.length===0),m(),x("ngIf",!n.isLoading&&n.prompts.length>0&&n.filteredPrompts.length===0),m(),x("ngIf",!n.isLoading&&n.filteredPrompts.length>0))},dependencies:[Be,ol,al,ot,Ge,rt,Xe,it,Ee,cn,An,Zt,Kt,no,vt,Sd,to],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 Ca=class i{http=u(nt);projectState=u(Te);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||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})};var Pd=(()=>{class i{_animationsDisabled=ut();state="unchecked";disabled=!1;appearance="full";constructor(){}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:12,hostBindings:function(n,r){n&2&&R("mat-pseudo-checkbox-indeterminate",r.state==="indeterminate")("mat-pseudo-checkbox-checked",r.state==="checked")("mat-pseudo-checkbox-disabled",r.disabled)("mat-pseudo-checkbox-minimal",r.appearance==="minimal")("mat-pseudo-checkbox-full",r.appearance==="full")("_mat-animation-noopable",r._animationsDisabled)},inputs:{state:"state",disabled:"disabled",appearance:"appearance"},decls:0,vars:0,template:function(n,r){},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}
|
|
370
|
-
`],encapsulation:2,changeDetection:0})}return i})();var lE=["text"],cE=[[["mat-icon"]],"*"],dE=["mat-icon","*"];function uE(i,t){if(i&1&&F(0,"mat-pseudo-checkbox",1),i&2){let e=g();x("disabled",e.disabled)("state",e.selected?"checked":"unchecked")}}function mE(i,t){if(i&1&&F(0,"mat-pseudo-checkbox",3),i&2){let e=g();x("disabled",e.disabled)}}function hE(i,t){if(i&1&&(l(0,"span",4),h(1),c()),i&2){let e=g();m(),ue("(",e.group.label,")")}}var Th=new q("MAT_OPTION_PARENT_COMPONENT"),Oh=new q("MatOptgroup");var Eh=class{source;isUserInput;constructor(t,e=!1){this.source=t,this.isUserInput=e}},io=(()=>{class i{_element=u(ae);_changeDetectorRef=u(ze);_parent=u(Th,{optional:!0});group=u(Oh,{optional:!0});_signalDisableRipple=!1;_selected=!1;_active=!1;_mostRecentViewValue="";get multiple(){return this._parent&&this._parent.multiple}get selected(){return this._selected}value;id=u(He).getId("mat-option-");get disabled(){return this.group&&this.group.disabled||this._disabled()}set disabled(e){this._disabled.set(e)}_disabled=Me(!1);get disableRipple(){return this._signalDisableRipple?this._parent.disableRipple():!!this._parent?.disableRipple}get hideSingleSelectionIndicator(){return!!(this._parent&&this._parent.hideSingleSelectionIndicator)}onSelectionChange=new H;_text;_stateChanges=new I;constructor(){let e=u($t);e.load(Ji),e.load(dl),this._signalDisableRipple=!!this._parent&&Js(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,n){let r=this._getHostElement();typeof r.focus=="function"&&r.focus(n)}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)&&!Lt(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 Eh(this,e))}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["mat-option"]],viewQuery:function(n,r){if(n&1&&se(lE,7),n&2){let o;G(o=Y())&&(r._text=o.first)}},hostAttrs:["role","option",1,"mat-mdc-option","mdc-list-item"],hostVars:11,hostBindings:function(n,r){n&1&&b("click",function(){return r._selectViaInteraction()})("keydown",function(a){return r._handleKeydown(a)}),n&2&&(mn("id",r.id),K("aria-selected",r.selected)("aria-disabled",r.disabled.toString()),R("mdc-list-item--selected",r.selected)("mat-mdc-option-multiple",r.multiple)("mat-mdc-option-active",r.active)("mdc-list-item--disabled",r.disabled))},inputs:{value:"value",id:"id",disabled:[2,"disabled","disabled",ie]},outputs:{onSelectionChange:"onSelectionChange"},exportAs:["matOption"],ngContentSelectors:dE,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(n,r){n&1&&(Qe(cE),w(0,uE,1,2,"mat-pseudo-checkbox",1),_e(1),l(2,"span",2,0),_e(4,1),c(),w(5,mE,1,1,"mat-pseudo-checkbox",3),w(6,hE,2,1,"span",4),F(7,"div",5)),n&2&&(S(r.multiple?0:-1),m(5),S(!r.multiple&&r.selected&&!r.hideSingleSelectionIndicator?5:-1),m(),S(r.group&&r.group._inert?6:-1),m(),x("matRippleTrigger",r._getHostElement())("matRippleDisabled",r.disabled||r.disableRipple))},dependencies:[Pd,Zi],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:""}
|
|
371
|
-
`],encapsulation:2,changeDetection:0})}return i})();function Hv(i,t,e){if(e.length){let n=t.toArray(),r=e.toArray(),o=0;for(let a=0;a<i+1;a++)n[a].group&&n[a].group===r[o]&&o++;return o}return 0}function Uv(i,t,e,n){return i<e?i:i+t>e+n?Math.max(0,i-n+t):e}var ro=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 I;constructor(t=!1,e,n=!0,r){this._multiple=t,this._emitChanges=n,this.compareWith=r,e&&e.length&&(t?e.forEach(o=>this._markSelected(o)):this._markSelected(e[0]),this._selectedToEmit.length=0)}select(...t){this._verifyValueAssignment(t),t.forEach(n=>this._markSelected(n));let e=this._hasQueuedChanges();return this._emitChangeEvent(),e}deselect(...t){this._verifyValueAssignment(t),t.forEach(n=>this._unmarkSelected(n));let e=this._hasQueuedChanges();return this._emitChangeEvent(),e}setSelection(...t){this._verifyValueAssignment(t);let e=this.selected,n=new Set(t.map(o=>this._getConcreteValue(o)));t.forEach(o=>this._markSelected(o)),e.filter(o=>!n.has(this._getConcreteValue(o,n))).forEach(o=>this._unmarkSelected(o));let r=this._hasQueuedChanges();return this._emitChangeEvent(),r}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 n of e)if(this.compareWith(t,n))return n;return t}else return t}};var $v=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=de({type:i});static \u0275inj=ce({imports:[pe]})}return i})();var Ph=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=de({type:i});static \u0275inj=ce({imports:[gl,pe,$v,io]})}return i})();var gE=["trigger"],fE=["panel"],_E=[[["mat-select-trigger"]],"*"],bE=["mat-select-trigger","*"];function vE(i,t){if(i&1&&(l(0,"span",4),h(1),c()),i&2){let e=g();m(),U(e.placeholder)}}function yE(i,t){i&1&&_e(0)}function CE(i,t){if(i&1&&(l(0,"span",11),h(1),c()),i&2){let e=g(2);m(),U(e.triggerValue)}}function xE(i,t){if(i&1&&(l(0,"span",5),w(1,yE,1,0)(2,CE,2,1,"span",11),c()),i&2){let e=g();m(),S(e.customTrigger?1:2)}}function wE(i,t){if(i&1){let e=A();l(0,"div",12,1),b("keydown",function(r){y(e);let o=g();return C(o._handleKeydown(r))}),_e(2,1),c()}if(i&2){let e=g();wi(Yi("mat-mdc-select-panel mdc-menu-surface mdc-menu-surface--open ",e._getPanelTheme())),R("mat-select-panel-animations-enabled",!e._animationsDisabled),x("ngClass",e.panelClass),K("id",e.id+"-panel")("aria-multiselectable",e.multiple)("aria-label",e.ariaLabel||null)("aria-labelledby",e._getPanelAriaLabelledby())}}var Ih=new q("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let i=u(we);return()=>zr(i)}});function Wv(i){let t=u(we);return()=>zr(t)}var qv=new q("MAT_SELECT_CONFIG"),Gv={provide:Ih,deps:[],useFactory:Wv},Yv=new q("MatSelectTrigger"),Id=class{source;value;constructor(t,e){this.source=t,this.value=e}},Rh=(()=>{class i{_viewportRuler=u(Pi);_changeDetectorRef=u(ze);_elementRef=u(ae);_dir=u(jt,{optional:!0});_idGenerator=u(He);_renderer=u(et);_parentFormField=u(Fs,{optional:!0});ngControl=u(mi,{self:!0,optional:!0});_liveAnnouncer=u(ml);_defaultOptions=u(qv,{optional:!0});_animationsDisabled=ut();_initialized=new I;_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 n=this.options.toArray()[e];if(n){let r=this.panel.nativeElement,o=Hv(e,this.options,this.optionGroups),a=n._getHostElement();e===0&&o===1?r.scrollTop=0:r.scrollTop=Uv(a.offsetTop,a.offsetHeight,r.scrollTop,r.offsetHeight)}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0)}_getChangeEvent(e){return new Id(this,e)}_scrollStrategyFactory=u(Ih);_panelOpen=!1;_compareWith=(e,n)=>e===n;_uid=this._idGenerator.getId("mat-select-");_triggerAriaLabelledBy=null;_previousControl;_destroy=new I;_errorStateTracker;stateChanges=new I;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=Me(!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(Zo.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=Kn(()=>{let e=this.options;return e?e.changes.pipe(At(e),Je(()=>Zn(...e.map(n=>n.onSelectionChange)))):this._initialized.pipe(Je(()=>this.optionSelectionChanges))});openedChange=new H;_openedStream=this.openedChange.pipe(le(e=>e),X(()=>{}));_closedStream=this.openedChange.pipe(le(e=>!e),X(()=>{}));selectionChange=new H;valueChange=new H;constructor(){let e=u(Md),n=u(Es,{optional:!0}),r=u(Os,{optional:!0}),o=u(new Si("tabindex"),{optional:!0});this.ngControl&&(this.ngControl.valueAccessor=this),this._defaultOptions?.typeaheadDebounceInterval!=null&&(this.typeaheadDebounceInterval=this._defaultOptions.typeaheadDebounceInterval),this._errorStateTracker=new va(e,this.ngControl,r,n,this.stateChanges),this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=o==null?0:parseInt(o)||0,this.id=this.id}ngOnInit(){this._selectionModel=new ro(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(n=>n.select()),e.removed.forEach(n=>n.deselect())}),this.options.changes.pipe(At(null),L(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){let e=this._getTriggerAriaLabelledby(),n=this.ngControl;if(e!==this._triggerAriaLabelledBy){let r=this._elementRef.nativeElement;this._triggerAriaLabelledBy=e,e?r.setAttribute("aria-labelledby",e):r.removeAttribute("aria-labelledby")}n&&(this._previousControl!==n.control&&(this._previousControl!==void 0&&n.disabled!==null&&n.disabled!==this.disabled&&(this.disabled=n.disabled),this._previousControl=n.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(lt(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 n=`${this.id}-panel`;this._trackedModal&&fu(this._trackedModal,"aria-owns",n),Zp(e,"aria-owns",n),this._trackedModal=e}_clearFromModal(){if(!this._trackedModal)return;let e=`${this.id}-panel`;fu(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=()=>{n(),clearTimeout(r),this._cleanupDetach=void 0};let e=this.panel.nativeElement,n=this._renderer.listen(e,"animationend",o=>{o.animationName==="_mat-select-exit"&&(this._cleanupDetach?.(),this._detachOverlay())}),r=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(n=>n.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 n=e.keyCode,r=n===40||n===38||n===37||n===39,o=n===13||n===32,a=this._keyManager;if(!a.isTyping()&&o&&!Lt(e)||(this.multiple||e.altKey)&&r)e.preventDefault(),this.open();else if(!this.multiple){let s=this.selected;a.onKeydown(e);let d=this.selected;d&&s!==d&&this._liveAnnouncer.announce(d.viewValue,1e4)}}_handleOpenKeydown(e){let n=this._keyManager,r=e.keyCode,o=r===40||r===38,a=n.isTyping();if(o&&e.altKey)e.preventDefault(),this.close();else if(!a&&(r===13||r===32)&&n.activeItem&&!Lt(e))e.preventDefault(),n.activeItem._selectViaInteraction();else if(!a&&this._multiple&&r===65&&e.ctrlKey){e.preventDefault();let s=this.options.some(d=>!d.disabled&&!d.selected);this.options.forEach(d=>{d.disabled||(s?d.select():d.deselect())})}else{let s=n.activeItemIndex;n.onKeydown(e),this._multiple&&o&&e.shiftKey&&n.activeItem&&n.activeItemIndex!==s&&n.activeItem._selectViaInteraction()}}_handleOverlayKeydown(e){e.keyCode===27&&!Lt(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(n=>n.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&e)Array.isArray(e),e.forEach(n=>this._selectOptionByValue(n)),this._sortValues();else{let n=this._selectOptionByValue(e);n?this._keyManager.updateActiveItem(n):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectOptionByValue(e){let n=this.options.find(r=>{if(this._selectionModel.isSelected(r))return!1;try{return(r.value!=null||this.canSelectNullableOptions)&&this._compareWith(r.value,e)}catch{return!1}});return n&&this._selectionModel.select(n),n}_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 Kp(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=Zn(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(L(e)).subscribe(n=>{this._onSelect(n.source,n.isUserInput),n.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),Zn(...this.options.map(n=>n._stateChanges)).pipe(L(e)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this.stateChanges.next()})}_onSelect(e,n){let r=this._selectionModel.isSelected(e);!this.canSelectNullableOptions&&e.value==null&&!this._multiple?(e.deselect(),this._selectionModel.clear(),this.value!=null&&this._propagateChanges(e.value)):(r!==e.selected&&(e.selected?this._selectionModel.select(e):this._selectionModel.deselect(e)),n&&this._keyManager.setActiveItem(e),this.multiple&&(this._sortValues(),n&&this.focus())),r!==this._selectionModel.isSelected(e)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){let e=this.options.toArray();this._selectionModel.sort((n,r)=>this.sortComparator?this.sortComparator(n,r,e):e.indexOf(n)-e.indexOf(r)),this.stateChanges.next()}}_propagateChanges(e){let n;this.multiple?n=this.selected.map(r=>r.value):n=this.selected?this.selected.value:e,this._value=n,this.valueChange.emit(n),this._onChange(n),this.selectionChange.emit(this._getChangeEvent(n)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){if(this._keyManager)if(this.empty){let e=-1;for(let n=0;n<this.options.length;n++)if(!this.options.get(n).disabled){e=n;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,n=e?e+" ":"";return this.ariaLabelledby?n+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(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["mat-select"]],contentQueries:function(n,r,o){if(n&1&&(kt(o,Yv,5),kt(o,io,5),kt(o,Oh,5)),n&2){let a;G(a=Y())&&(r.customTrigger=a.first),G(a=Y())&&(r.options=a),G(a=Y())&&(r.optionGroups=a)}},viewQuery:function(n,r){if(n&1&&(se(gE,5),se(fE,5),se(Cc,5)),n&2){let o;G(o=Y())&&(r.trigger=o.first),G(o=Y())&&(r.panel=o.first),G(o=Y())&&(r._overlayDir=o.first)}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:21,hostBindings:function(n,r){n&1&&b("keydown",function(a){return r._handleKeydown(a)})("focus",function(){return r._onFocus()})("blur",function(){return r._onBlur()}),n&2&&(K("id",r.id)("tabindex",r.disabled?-1:r.tabIndex)("aria-controls",r.panelOpen?r.id+"-panel":null)("aria-expanded",r.panelOpen)("aria-label",r.ariaLabel||null)("aria-required",r.required.toString())("aria-disabled",r.disabled.toString())("aria-invalid",r.errorState)("aria-activedescendant",r._getAriaActiveDescendant()),R("mat-mdc-select-disabled",r.disabled)("mat-mdc-select-invalid",r.errorState)("mat-mdc-select-required",r.required)("mat-mdc-select-empty",r.empty)("mat-mdc-select-multiple",r.multiple)("mat-select-open",r.panelOpen))},inputs:{userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],panelClass:"panelClass",disabled:[2,"disabled","disabled",ie],disableRipple:[2,"disableRipple","disableRipple",ie],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:Nn(e)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",ie],placeholder:"placeholder",required:[2,"required","required",ie],multiple:[2,"multiple","multiple",ie],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",ie],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",Nn],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth",canSelectNullableOptions:[2,"canSelectNullableOptions","canSelectNullableOptions",ie]},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],features:[Ce([{provide:Rs,useExisting:i},{provide:Th,useExisting:i}]),Ne],ngContentSelectors:bE,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(n,r){if(n&1){let o=A();Qe(_E),l(0,"div",2,0),b("click",function(){return y(o),C(r.open())}),l(3,"div",3),w(4,vE,2,1,"span",4)(5,xE,3,1,"span",5),c(),l(6,"div",6)(7,"div",7),Ci(),l(8,"svg",8),F(9,"path",9),c()()()(),tt(10,wE,3,10,"ng-template",10),b("detach",function(){return y(o),C(r.close())})("backdropClick",function(){return y(o),C(r.close())})("overlayKeydown",function(s){return y(o),C(r._handleOverlayKeydown(s))})}if(n&2){let o=hn(1);m(3),K("id",r._valueId),m(),S(r.empty?4:5),m(6),x("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",r._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",r._scrollStrategy)("cdkConnectedOverlayOrigin",r._preferredOverlayOrigin||o)("cdkConnectedOverlayPositions",r._positions)("cdkConnectedOverlayWidth",r._overlayWidth)("cdkConnectedOverlayFlexibleDimensions",!0)}},dependencies:[Ho,Cc,_o],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))}
|
|
372
|
-
`],encapsulation:2,changeDetection:0})}return i})();var Ls=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=de({type:i});static \u0275inj=ce({providers:[Gv],imports:[Di,Ph,pe,Vr,vt,Ph,pe]})}return i})();var kE=["input"],ME=["label"],EE=["*"],TE=new q("mat-checkbox-default-options",{providedIn:"root",factory:Xv});function Xv(){return{color:"accent",clickAction:"check-indeterminate",disabledInteractive:!1}}var Ht=(function(i){return i[i.Init=0]="Init",i[i.Checked=1]="Checked",i[i.Unchecked=2]="Unchecked",i[i.Indeterminate=3]="Indeterminate",i})(Ht||{}),Fh=class{source;checked},Qv=Xv(),Nh=(()=>{class i{_elementRef=u(ae);_changeDetectorRef=u(ze);_ngZone=u(fe);_animationsDisabled=ut();_options=u(TE,{optional:!0});focus(){this._inputElement.nativeElement.focus()}_createChangeEvent(e){let n=new Fh;return n.source=this,n.checked=e,n}_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 H;indeterminateChange=new H;value;disableRipple;_inputElement;_labelElement;tabIndex;color;disabledInteractive;_onTouched=()=>{};_currentAnimationClass="";_currentCheckState=Ht.Init;_controlValueAccessorChangeFn=()=>{};_validatorChangeFn=()=>{};constructor(){u($t).load(Ji);let e=u(new Si("tabindex"),{optional:!0});this._options=this._options||Qv,this.color=this._options.color||Qv.color,this.tabIndex=e==null?0:parseInt(e)||0,this.id=this._uniqueId=u(He).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 n=e!=this._indeterminate();this._indeterminate.set(e),n&&(e?this._transitionCheckState(Ht.Indeterminate):this._transitionCheckState(this.checked?Ht.Checked:Ht.Unchecked),this.indeterminateChange.emit(e)),this._syncIndeterminate(e)}_indeterminate=Me(!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 n=this._currentCheckState,r=this._getAnimationTargetElement();if(!(n===e||!r)&&(this._currentAnimationClass&&r.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(n,e),this._currentCheckState=e,this._currentAnimationClass.length>0)){r.classList.add(this._currentAnimationClass);let o=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{r.classList.remove(o)},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?Ht.Checked:Ht.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,n){if(this._animationsDisabled)return"";switch(e){case Ht.Init:if(n===Ht.Checked)return this._animationClasses.uncheckedToChecked;if(n==Ht.Indeterminate)return this._checked?this._animationClasses.checkedToIndeterminate:this._animationClasses.uncheckedToIndeterminate;break;case Ht.Unchecked:return n===Ht.Checked?this._animationClasses.uncheckedToChecked:this._animationClasses.uncheckedToIndeterminate;case Ht.Checked:return n===Ht.Unchecked?this._animationClasses.checkedToUnchecked:this._animationClasses.checkedToIndeterminate;case Ht.Indeterminate:return n===Ht.Checked?this._animationClasses.indeterminateToChecked:this._animationClasses.indeterminateToUnchecked}return""}_syncIndeterminate(e){let n=this._inputElement;n&&(n.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(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["mat-checkbox"]],viewQuery:function(n,r){if(n&1&&(se(kE,5),se(ME,5)),n&2){let o;G(o=Y())&&(r._inputElement=o.first),G(o=Y())&&(r._labelElement=o.first)}},hostAttrs:[1,"mat-mdc-checkbox"],hostVars:16,hostBindings:function(n,r){n&2&&(mn("id",r.id),K("tabindex",null)("aria-label",null)("aria-labelledby",null),wi(r.color?"mat-"+r.color:"mat-accent"),R("_mat-animation-noopable",r._animationsDisabled)("mdc-checkbox--disabled",r.disabled)("mat-mdc-checkbox-disabled",r.disabled)("mat-mdc-checkbox-checked",r.checked)("mat-mdc-checkbox-disabled-interactive",r.disabledInteractive))},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],ariaExpanded:[2,"aria-expanded","ariaExpanded",ie],ariaControls:[0,"aria-controls","ariaControls"],ariaOwns:[0,"aria-owns","ariaOwns"],id:"id",required:[2,"required","required",ie],labelPosition:"labelPosition",name:"name",value:"value",disableRipple:[2,"disableRipple","disableRipple",ie],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?void 0:Nn(e)],color:"color",disabledInteractive:[2,"disabledInteractive","disabledInteractive",ie],checked:[2,"checked","checked",ie],disabled:[2,"disabled","disabled",ie],indeterminate:[2,"indeterminate","indeterminate",ie]},outputs:{change:"change",indeterminateChange:"indeterminateChange"},exportAs:["matCheckbox"],features:[Ce([{provide:ln,useExisting:dt(()=>i),multi:!0},{provide:qn,useExisting:i,multi:!0}]),Ne],ngContentSelectors:EE,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(n,r){if(n&1){let o=A();Qe(),l(0,"div",3),b("click",function(s){return y(o),C(r._preventBubblingFromLabel(s))}),l(1,"div",4,0)(3,"div",5),b("click",function(){return y(o),C(r._onTouchTargetClick())}),c(),l(4,"input",6,1),b("blur",function(){return y(o),C(r._onBlur())})("click",function(){return y(o),C(r._onInputClick())})("change",function(s){return y(o),C(r._onInteractionEvent(s))}),c(),F(6,"div",7),l(7,"div",8),Ci(),l(8,"svg",9),F(9,"path",10),c(),Zs(),F(10,"div",11),c(),F(11,"div",12),c(),l(12,"label",13,2),_e(14),c()()}if(n&2){let o=hn(2);x("labelPosition",r.labelPosition),m(4),R("mdc-checkbox--selected",r.checked),x("checked",r.checked)("indeterminate",r.indeterminate)("disabled",r.disabled&&!r.disabledInteractive)("id",r.inputId)("required",r.required)("tabIndex",r.disabled&&!r.disabledInteractive?-1:r.tabIndex),K("aria-label",r.ariaLabel||null)("aria-labelledby",r.ariaLabelledby)("aria-describedby",r.ariaDescribedby)("aria-checked",r.indeterminate?"mixed":null)("aria-controls",r.ariaControls)("aria-disabled",r.disabled&&r.disabledInteractive?!0:null)("aria-expanded",r.ariaExpanded)("aria-owns",r.ariaOwns)("name",r.name)("value",r.value),m(7),x("matRippleTrigger",o)("matRippleDisabled",r.disableRipple||r.disabled)("matRippleCentered",!0),m(),x("for",r.inputId)}},dependencies:[Zi,xd],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:""}
|
|
373
|
-
`],encapsulation:2,changeDetection:0})}return i})(),Kv=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=de({type:i});static \u0275inj=ce({imports:[Nh,pe,pe]})}return i})();var PE=["button"],AE=["*"];function DE(i,t){if(i&1&&(l(0,"div",2),F(1,"mat-pseudo-checkbox",6),c()),i&2){let e=g();m(),x("disabled",e.disabled)}}var Zv=new q("MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS",{providedIn:"root",factory:IE});function IE(){return{hideSingleSelectionIndicator:!1,hideMultipleSelectionIndicator:!1,disabledInteractive:!1}}var Jv=new q("MatButtonToggleGroup"),RE={provide:ln,useExisting:dt(()=>Vh),multi:!0},Rd=class{source;value;constructor(t,e){this.source=t,this.value=e}},Vh=(()=>{class i{_changeDetector=u(ze);_dir=u(jt,{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=u(He).getId("mat-button-toggle-group-");vertical;get value(){let e=this._selectionModel?this._selectionModel.selected:[];return this.multiple?e.map(n=>n.value):e[0]?e[0].value:void 0}set value(e){this._setSelectionByValue(e),this.valueChange.emit(this.value)}valueChange=new H;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 H;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=u(Zv,{optional:!0});this.appearance=e&&e.appearance?e.appearance:"standard",this.hideSingleSelectionIndicator=e?.hideSingleSelectionIndicator??!1,this.hideMultipleSelectionIndicator=e?.hideMultipleSelectionIndicator??!1}ngOnInit(){this._selectionModel=new ro(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||Lt(e))return;let r=e.target.id,o=this._buttonToggles.toArray().findIndex(s=>s.buttonId===r),a=null;switch(e.keyCode){case 32:case 13:a=this._buttonToggles.get(o)||null;break;case 38:a=this._getNextButton(o,-1);break;case 37:a=this._getNextButton(o,this.dir==="ltr"?-1:1);break;case 40:a=this._getNextButton(o,1);break;case 39:a=this._getNextButton(o,this.dir==="ltr"?1:-1);break;default:return}a&&(e.preventDefault(),a._onButtonClick(),a.focus())}_emitChangeEvent(e){let n=new Rd(e,this.value);this._rawValue=n.value,this._controlValueAccessorChangeFn(n.value),this.change.emit(n)}_syncButtonToggle(e,n,r=!1,o=!1){!this.multiple&&this.selected&&!e.checked&&(this.selected.checked=!1),this._selectionModel?n?this._selectionModel.select(e):this._selectionModel.deselect(e):o=!0,o?Promise.resolve().then(()=>this._updateModelValue(e,r)):this._updateModelValue(e,r)}_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(n=>e.value!=null&&n===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 n=this._buttonToggles.get(e);if(!n.disabled){n.tabIndex=0;break}}}_getNextButton(e,n){let r=this._buttonToggles;for(let o=1;o<=r.length;o++){let a=(e+n*o+r.length)%r.length,s=r.get(a);if(s&&!s.disabled)return s}return null}_setSelectionByValue(e){if(this._rawValue=e,!this._buttonToggles)return;let n=this._buttonToggles.toArray();if(this.multiple&&e?(Array.isArray(e),this._clearSelection(),e.forEach(r=>this._selectValue(r,n))):(this._clearSelection(),this._selectValue(e,n)),!this.multiple&&n.every(r=>r.tabIndex===-1)){for(let r of n)if(!r.disabled){r.tabIndex=0;break}}}_clearSelection(){this._selectionModel.clear(),this._buttonToggles.forEach(e=>{e.checked=!1,this.multiple||(e.tabIndex=-1)})}_selectValue(e,n){for(let r of n)if(r.value===e){r.checked=!0,this._selectionModel.select(r),this.multiple||(r.tabIndex=0);break}}_updateModelValue(e,n){n&&this._emitChangeEvent(e),this.valueChange.emit(this.value)}_markButtonsForCheck(){this._buttonToggles?.forEach(e=>e._markForCheck())}static \u0275fac=function(n){return new(n||i)};static \u0275dir=ne({type:i,selectors:[["mat-button-toggle-group"]],contentQueries:function(n,r,o){if(n&1&&kt(o,Fd,5),n&2){let a;G(a=Y())&&(r._buttonToggles=a)}},hostAttrs:[1,"mat-button-toggle-group"],hostVars:6,hostBindings:function(n,r){n&1&&b("keydown",function(a){return r._keydown(a)}),n&2&&(K("role",r.multiple?"group":"radiogroup")("aria-disabled",r.disabled),R("mat-button-toggle-vertical",r.vertical)("mat-button-toggle-group-appearance-standard",r.appearance==="standard"))},inputs:{appearance:"appearance",name:"name",vertical:[2,"vertical","vertical",ie],value:"value",multiple:[2,"multiple","multiple",ie],disabled:[2,"disabled","disabled",ie],disabledInteractive:[2,"disabledInteractive","disabledInteractive",ie],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",ie],hideMultipleSelectionIndicator:[2,"hideMultipleSelectionIndicator","hideMultipleSelectionIndicator",ie]},outputs:{valueChange:"valueChange",change:"change"},exportAs:["matButtonToggleGroup"],features:[Ce([RE,{provide:Jv,useExisting:i}])]})}return i})(),Fd=(()=>{class i{_changeDetectorRef=u(ze);_elementRef=u(ae);_focusMonitor=u(Ki);_idGenerator=u(He);_animationDisabled=ut();_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 H;constructor(){u($t).load(Ji);let e=u(Jv,{optional:!0}),n=u(new Si("tabindex"),{optional:!0})||"",r=u(Zv,{optional:!0});this._tabIndex=Me(parseInt(n)||0),this.buttonToggleGroup=e,this.appearance=r&&r.appearance?r.appearance:"standard",this.disabledInteractive=r?.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 n=this.buttonToggleGroup._buttonToggles.find(r=>r.tabIndex===0);n&&(n.tabIndex=-1),this.tabIndex=0}this.change.emit(new Rd(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(n){return new(n||i)};static \u0275cmp=P({type:i,selectors:[["mat-button-toggle"]],viewQuery:function(n,r){if(n&1&&se(PE,5),n&2){let o;G(o=Y())&&(r._buttonElement=o.first)}},hostAttrs:["role","presentation",1,"mat-button-toggle"],hostVars:14,hostBindings:function(n,r){n&1&&b("focus",function(){return r.focus()}),n&2&&(K("aria-label",null)("aria-labelledby",null)("id",r.id)("name",null),R("mat-button-toggle-standalone",!r.buttonToggleGroup)("mat-button-toggle-checked",r.checked)("mat-button-toggle-disabled",r.disabled)("mat-button-toggle-disabled-interactive",r.disabledInteractive)("mat-button-toggle-appearance-standard",r.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",ie],appearance:"appearance",checked:[2,"checked","checked",ie],disabled:[2,"disabled","disabled",ie],disabledInteractive:[2,"disabledInteractive","disabledInteractive",ie]},outputs:{change:"change"},exportAs:["matButtonToggle"],ngContentSelectors:AE,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(n,r){if(n&1){let o=A();Qe(),l(0,"button",1,0),b("click",function(){return y(o),C(r._onButtonClick())}),w(2,DE,2,1,"div",2),l(3,"span",3),_e(4),c()(),F(5,"span",4)(6,"span",5)}if(n&2){let o=hn(1);x("id",r.buttonId)("disabled",r.disabled&&!r.disabledInteractive||null),K("role",r.isSingleSelector()?"radio":"button")("tabindex",r.disabled&&!r.disabledInteractive?-1:r.tabIndex)("aria-pressed",r.isSingleSelector()?null:r.checked)("aria-checked",r.isSingleSelector()?r.checked:null)("name",r._getButtonName())("aria-label",r.ariaLabel)("aria-labelledby",r.ariaLabelledby)("aria-disabled",r.disabled&&r.disabledInteractive?"true":null),m(2),S(r.buttonToggleGroup&&(!r.buttonToggleGroup.multiple&&!r.buttonToggleGroup.hideSingleSelectionIndicator||r.buttonToggleGroup.multiple&&!r.buttonToggleGroup.hideMultipleSelectionIndicator)?2:-1),m(4),x("matRippleTrigger",o)("matRippleDisabled",r.disableRipple||r.disabled)}},dependencies:[Zi,Pd],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))}
|
|
374
|
-
`],encapsulation:2,changeDetection:0})}return i})(),e0=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=de({type:i});static \u0275inj=ce({imports:[pe,gl,Fd,pe]})}return i})();var NE=(i,t)=>t.id,VE=(i,t)=>t.value;function LE(i,t){if(i&1&&(l(0,"mat-option",5),h(1),c()),i&2){let e=t.$implicit;x("value",e.id),m(),ue(" ",e.name," ")}}function jE(i,t){if(i&1){let e=A();l(0,"mat-checkbox",35),b("change",function(){let r=y(e).$implicit,o=g();return C(o.toggleDayOfWeek(r.value))}),h(1),c()}if(i&2){let e=t.$implicit,n=g();x("checked",n.isDaySelected(e.value)),m(),ue(" ",e.label," ")}}function zE(i,t){if(i&1){let e=A();l(0,"mat-form-field",2)(1,"mat-label"),h(2,"Number of Occurrences"),c(),l(3,"input",10),B("ngModelChange",function(r){y(e);let o=g();return z(o.endOccurrences,r)||(o.endOccurrences=r),C(r)}),c()()}if(i&2){let e=g();m(3),j("ngModel",e.endOccurrences)}}function BE(i,t){if(i&1){let e=A();l(0,"mat-form-field",2)(1,"mat-label"),h(2,"End Date"),c(),l(3,"input",36),B("ngModelChange",function(r){y(e);let o=g();return z(o.endTimestamp,r)||(o.endTimestamp=r),C(r)}),c()()}if(i&2){let e=g();m(3),j("ngModel",e.endTimestamp)}}function HE(i,t){if(i&1){let e=A();l(0,"div")(1,"mat-form-field",2)(2,"mat-label"),h(3,"Parameter Value"),c(),l(4,"input",37),B("ngModelChange",function(r){y(e);let o=g();return z(o.simpleParameter,r)||(o.simpleParameter=r),C(r)}),c(),l(5,"mat-hint"),h(6),c()()()}if(i&2){let e=g();m(4),j("ngModel",e.simpleParameter),m(2),ue("Simple value for ","{{PARAMETERS}}"," placeholder or appended to first command")}}function UE(i,t){if(i&1){let e=A();l(0,"div",40)(1,"mat-form-field",41)(2,"mat-label"),h(3,"Key"),c(),l(4,"input",42),B("ngModelChange",function(r){let o=y(e).$implicit;return z(o.key,r)||(o.key=r),C(r)}),c()(),l(5,"mat-form-field",43)(6,"mat-label"),h(7,"Value"),c(),l(8,"input",44),B("ngModelChange",function(r){let o=y(e).$implicit;return z(o.value,r)||(o.value=r),C(r)}),c()(),l(9,"button",45),b("click",function(){let r=y(e).$index,o=g(3);return C(o.removeParameter(r))}),l(10,"mat-icon"),h(11,"delete"),c()()()}if(i&2){let e=t.$implicit;m(4),j("ngModel",e.key),m(4),j("ngModel",e.value)}}function $E(i,t){if(i&1&&(l(0,"div",39),Le(1,UE,12,2,"div",40,xr),c()),i&2){let e=g(2);m(),je(e.parameters)}}function WE(i,t){if(i&1){let e=A();l(0,"div")(1,"div",26)(2,"button",38),b("click",function(){y(e);let r=g();return C(r.addParameter())}),l(3,"mat-icon"),h(4,"add"),c()()(),w(5,$E,3,0,"div",39),l(6,"p",19),h(7),c()()}if(i&2){let e=g();m(5),S(e.parameters.length>0?5:-1),m(2),ue("Key-value pairs for ","{{key}}"," placeholders in prompt commands")}}function qE(i,t){if(i&1&&(l(0,"div",31)(1,"mat-icon"),h(2,"error"),c(),l(3,"span"),h(4),c()()),i&2){let e=g();m(4),U(e.errorMessage)}}var js=class i{schedulerApi=u(Ca);promptApi=u(Pn);dialogRef=u(bn);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=u(li);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,n])=>({key:e,value:String(n)}))))}}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(),n=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0"),o=String(t.getHours()).padStart(2,"0"),a=String(t.getMinutes()).padStart(2,"0");return`${e}-${n}-${r}T${o}:${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(n=>n.key.trim());if(t.length===0)return;let e={};return t.forEach(n=>{e[n.key]=n.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:n=>{console.error("Error updating scheduler:",n),this.errorMessage=n?.error?.error||n?.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:n=>{console.error("Error creating scheduler:",n),this.errorMessage=n?.error?.error||n?.message||"Failed to create scheduler",this.isSaving=!1}})}cancel(){this.dialogRef.close(!1)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=P({type:i,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,n){e&1&&(l(0,"h2",0),h(1),c(),l(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),h(6,"Name"),c(),l(7,"input",3),B("ngModelChange",function(o){return z(n.name,o)||(n.name=o),o}),c(),l(8,"mat-hint"),h(9,"A descriptive name for this scheduler"),c()(),l(10,"mat-form-field",2)(11,"mat-label"),h(12,"Prompt"),c(),l(13,"mat-select",4),B("ngModelChange",function(o){return z(n.promptId,o)||(n.promptId=o),o}),Le(14,LE,2,2,"mat-option",5,NE),c(),l(16,"mat-hint"),h(17,"Select the prompt to execute"),c()(),l(18,"mat-form-field",2)(19,"mat-label"),h(20,"Start Date & Time"),c(),l(21,"input",6),B("ngModelChange",function(o){return z(n.startTimestamp,o)||(n.startTimestamp=o),o}),c(),l(22,"mat-hint"),h(23,"When to start the scheduler (leave empty for now)"),c()(),l(24,"div",7)(25,"h3"),h(26,"Schedule Interval"),c(),l(27,"div",8)(28,"mat-form-field",9)(29,"mat-label"),h(30,"Every"),c(),l(31,"input",10),B("ngModelChange",function(o){return z(n.intervalValue,o)||(n.intervalValue=o),o}),c()(),l(32,"mat-form-field",11)(33,"mat-label"),h(34,"Unit"),c(),l(35,"mat-select",4),B("ngModelChange",function(o){return z(n.intervalUnit,o)||(n.intervalUnit=o),o}),l(36,"mat-option",12),h(37,"Minutes (1-59)"),c(),l(38,"mat-option",13),h(39,"Hours (1-24)"),c(),l(40,"mat-option",14),h(41,"Days (1-31)"),c(),l(42,"mat-option",15),h(43,"Months (1-12)"),c()()()()(),l(44,"div",16)(45,"h3"),h(46,"Days of Week (Optional)"),c(),l(47,"div",17),Le(48,jE,2,2,"mat-checkbox",18,VE),c(),l(50,"p",19),h(51,"Leave empty to run every day"),c()(),l(52,"div",20)(53,"h3"),h(54,"End Condition (Optional)"),c(),l(55,"mat-form-field",2)(56,"mat-label"),h(57,"End Type"),c(),l(58,"mat-select",21),B("ngModelChange",function(o){return z(n.endConditionType,o)||(n.endConditionType=o),o}),l(59,"mat-option",22),h(60,"Never (run indefinitely)"),c(),l(61,"mat-option",23),h(62,"After X occurrences"),c(),l(63,"mat-option",24),h(64,"Until specific date"),c()()(),w(65,zE,4,1,"mat-form-field",2),w(66,BE,4,1,"mat-form-field",2),c(),l(67,"div",25)(68,"div",26)(69,"h3"),h(70,"Parameters (Optional)"),c(),l(71,"mat-button-toggle-group",27),B("ngModelChange",function(o){return z(n.parameterMode,o)||(n.parameterMode=o),o}),l(72,"mat-button-toggle",28),h(73,"Simple"),c(),l(74,"mat-button-toggle",29),h(75,"Structured"),c()()(),w(76,HE,7,2,"div"),w(77,WE,8,2,"div"),c(),l(78,"div",30)(79,"mat-checkbox",21),B("ngModelChange",function(o){return z(n.enabled,o)||(n.enabled=o),o}),h(80,"Enabled"),c(),l(81,"p",19),h(82,"Scheduler will only run if enabled"),c()(),w(83,qE,5,1,"div",31),c()(),l(84,"mat-dialog-actions",32)(85,"button",33),b("click",function(){return n.cancel()}),h(86,"Cancel"),c(),l(87,"button",34),b("click",function(){return n.save()}),h(88),c()()),e&2&&(m(),U(n.isEditMode?"Edit Scheduler":"Create Scheduler"),m(6),j("ngModel",n.name),m(6),j("ngModel",n.promptId),m(),je(n.availablePrompts),m(7),j("ngModel",n.startTimestamp),m(10),j("ngModel",n.intervalValue),m(4),j("ngModel",n.intervalUnit),m(13),je(n.daysOfWeekOptions),m(10),j("ngModel",n.endConditionType),m(7),S(n.endConditionType==="occurrences"?65:-1),m(),S(n.endConditionType==="endTimestamp"?66:-1),m(5),j("ngModel",n.parameterMode),m(5),S(n.parameterMode==="simple"?76:-1),m(),S(n.parameterMode==="structured"?77:-1),m(2),j("ngModel",n.enabled),m(4),S(n.errorMessage?83:-1),m(2),x("disabled",n.isSaving),m(2),x("disabled",n.isSaving),m(),ue(" ",n.isSaving?"Saving...":"Save"," "))},dependencies:[Be,ot,Ge,Ts,rt,Yr,Ps,Xe,Hr,Ii,Fi,Ri,Tt,zt,Et,cn,An,Zt,Kt,Hi,vt,it,Ee,Ls,Rh,io,Kv,Nh,e0,Vh,Fd],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 GE(i,t){i&1&&(l(0,"div",12),h(1,"Loading schedulers..."),c())}function YE(i,t){if(i&1&&(l(0,"div",13),h(1),c()),i&2){let e=g();m(),U(e.errorMessage)}}function QE(i,t){i&1&&(l(0,"div",14),h(1," No schedulers found. Create your first scheduler to automate prompt execution. "),c())}function XE(i,t){i&1&&(l(0,"div",14),h(1," No schedulers match your search. "),c())}function KE(i,t){if(i&1&&(l(0,"span",31),h(1),c()),i&2){let e=g().$implicit;x("title",Yi("Created by ",e.createdBy)),m(),ue(" \u{1F464} ",e.createdBy," ")}}function ZE(i,t){if(i&1&&(l(0,"div",22)(1,"span",23),h(2,"Last Run:"),c(),l(3,"span",24),h(4),Sr(5,"date"),c()()),i&2){let e=g().$implicit;m(4),U(Oa(5,1,e.lastRun,"short"))}}function JE(i,t){if(i&1){let e=A();l(0,"div",17)(1,"div",18)(2,"h3"),h(3),l(4,"span",19),h(5),c(),tt(6,KE,2,3,"span",20),c(),l(7,"div",21)(8,"div",22)(9,"span",23),h(10,"Prompt:"),c(),l(11,"span",24),h(12),c()(),l(13,"div",22)(14,"span",23),h(15,"Schedule:"),c(),l(16,"span",24),h(17),c()(),l(18,"div",22)(19,"span",23),h(20,"Next Run:"),c(),l(21,"span",24),h(22),c()(),tt(23,ZE,6,4,"div",25),c()(),l(24,"div",26)(25,"button",27),b("click",function(){let r=y(e).$implicit,o=g(2);return C(o.editScheduler(r))}),h(26,"Edit"),c(),l(27,"button",28),b("click",function(){let r=y(e).$implicit,o=g(2);return C(o.toggleEnabled(r))}),h(28),c(),l(29,"button",29),b("click",function(){let r=y(e).$implicit,o=g(2);return C(o.runNow(r.id))}),h(30,"Run Now"),c(),l(31,"button",30),b("click",function(){let r=y(e).$implicit,o=g(2);return C(o.deleteScheduler(r.id))}),h(32,"Delete"),c()()()}if(i&2){let e=t.$implicit,n=g(2);m(3),ue(" ",e.name," "),m(),R("enabled",e.enabled),m(),ue(" ",e.enabled?"Enabled":"Disabled"," "),m(),x("ngIf",e.createdBy!==n.getCurrentUsername()),m(6),U(n.getPromptName(e.promptId)),m(5),U(n.formatInterval(e.schedule.interval)),m(5),U(n.formatNextRun(e.nextRun)),m(),x("ngIf",e.lastRun),m(4),R("btn-enabled",e.enabled)("btn-disabled",!e.enabled),m(),ue(" ",e.enabled?"Disable":"Enable"," ")}}function eT(i,t){if(i&1&&(l(0,"div",15),tt(1,JE,33,14,"div",16),c()),i&2){let e=g();m(),x("ngForOf",e.filteredSchedulers)}}var Nd=class i{schedulerApi=u(Ca);promptApi=u(Pn);configApi=u(fi);dialog=u(Bn);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 n=e?.error?.error??e?.message??"Failed to delete scheduler";alert(`Failed to delete scheduler: ${n}`)}})}toggleEnabled(t){(t.enabled?this.schedulerApi.disableScheduler(t.id):this.schedulerApi.enableScheduler(t.id)).subscribe({next:()=>{this.loadSchedulers()},error:n=>{console.error("Error toggling scheduler:",n);let r=n?.error?.error??n?.message??"Failed to toggle scheduler";alert(`Failed to toggle scheduler: ${r}`)}})}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 n=e?.error?.error??e?.message??"Failed to run scheduler";alert(`Failed to run scheduler: ${n}`)}})}formatNextRun(t){return t?new Date(t).toLocaleString():"Expired or completed"}getCurrentUsername(){return this.currentUsername}getPromptName(t){let e=this.prompts.find(n=>n.id===t);return e?e.name:t}formatInterval(t){let e=RegExp(/^(\d+)(min|h|d|M)$/).exec(t);if(!e)return t;let[,n,r]=e;if(!n||!r)return t;let a={min:"minute",h:"hour",d:"day",M:"month"}[r]??r;return`Every ${n} ${a}${parseInt(n,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(n=>this.isMyScheduler(n)):[...this.schedulers];t&&(e=e.filter(n=>n.name.toLowerCase().includes(t)||n.promptId.toLowerCase().includes(t)||this.getPromptName(n.promptId).toLowerCase().includes(t)?!0:n.createdBy.toLowerCase().includes(t))),this.filteredSchedulers=e}onSearchChange(){this.applyFilter()}createScheduler(){this.dialog.open(js,{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(js,{width:"700px",maxHeight:"90vh",data:{mode:"edit",scheduler:e}}).afterClosed().subscribe(r=>{r&&this.loadSchedulers()})},error:e=>{console.error("Error loading scheduler details:",e);let n=e?.error?.error??e?.message??"Failed to load scheduler details";alert(`Failed to load scheduler details: ${n}`)}})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=P({type:i,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,n){e&1&&(l(0,"div",0)(1,"div",1)(2,"h2"),h(3,"Schedulers"),c(),l(4,"div",2)(5,"mat-form-field",3)(6,"mat-label"),h(7,"Search"),c(),l(8,"input",4),B("ngModelChange",function(o){return z(n.searchQuery,o)||(n.searchQuery=o),o}),b("input",function(){return n.onSearchChange()}),c(),l(9,"mat-icon",5),h(10,"search"),c()(),l(11,"mat-slide-toggle",6),B("ngModelChange",function(o){return z(n.showOnlyMine,o)||(n.showOnlyMine=o),o}),b("change",function(){return n.applyFilter()}),h(12," Mine "),c(),l(13,"button",7),b("click",function(){return n.createScheduler()}),l(14,"mat-icon"),h(15,"add"),c(),l(16,"span"),h(17,"Create Scheduler"),c()()()(),tt(18,GE,2,0,"div",8)(19,YE,2,1,"div",9)(20,QE,2,0,"div",10)(21,XE,2,0,"div",10)(22,eT,2,1,"div",11),c()),e&2&&(m(8),j("ngModel",n.searchQuery),m(3),j("ngModel",n.showOnlyMine),m(7),x("ngIf",n.isLoading),m(),x("ngIf",n.errorMessage),m(),x("ngIf",!n.isLoading&&n.schedulers.length===0),m(),x("ngIf",!n.isLoading&&n.schedulers.length>0&&n.filteredSchedulers.length===0),m(),x("ngIf",!n.isLoading&&n.filteredSchedulers.length>0))},dependencies:[Be,ol,al,ot,Ge,rt,Xe,it,Ee,cn,An,Zt,Kt,no,vt,Sd,to,Up],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 Sa=class i{http=u(nt);projectState=u(Te);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 nn(n=>{let r=new FileReader;r.onload=()=>{let o=r.result.split(",")[1];this.http.post(`${this.getBaseUrl()}/documents`,{filename:e.name,content:o,mimeType:e.type},{params:{location:t}}).subscribe(n)},r.onerror=()=>n.error(r.error),r.readAsDataURL(e)})}deleteAgent(t){return this.http.delete(`${this.getBaseUrl()}/${t}`)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})};function tT(i,t){i&1&&(l(0,"p",15),h(1,"No integrations defined \u2014 agent will have access to all tools."),c())}function nT(i,t){if(i&1){let e=A();l(0,"div",16)(1,"mat-form-field",22)(2,"mat-label"),h(3,"Integration"),c(),l(4,"input",23),B("ngModelChange",function(r){let o=y(e).$implicit;return z(o.integration,r)||(o.integration=r),C(r)}),c()(),l(5,"mat-form-field",24)(6,"mat-label"),h(7,"Tools (comma-separated)"),c(),l(8,"input",25),B("ngModelChange",function(r){let o=y(e).$implicit;return z(o.tools,r)||(o.tools=r),C(r)}),c()(),l(9,"button",26),b("click",function(){let r=y(e).$index,o=g();return C(o.removeIntegrationRow(r))}),l(10,"mat-icon"),h(11,"delete"),c()()()}if(i&2){let e=t.$implicit;m(4),j("ngModel",e.integration),m(4),j("ngModel",e.tools)}}function iT(i,t){if(i&1&&(l(0,"p",30),h(1),c()),i&2){let e=g(2);m(),U(e.docUploadError)}}function rT(i,t){i&1&&(l(0,"p",15),h(1,"No mandatory documents defined."),c())}function oT(i,t){if(i&1&&F(0,"option",35),i&2){let e=t.$implicit;x("value","documents/"+e)}}function aT(i,t){if(i&1){let e=A();l(0,"div",31)(1,"mat-form-field",32)(2,"mat-label"),h(3,"Document path"),c(),l(4,"input",33),B("ngModelChange",function(r){let o=y(e).$index,a=g(2);return z(a.mandatoryDocs[o],r)||(a.mandatoryDocs[o]=r),C(r)}),c(),l(5,"datalist",34),Le(6,oT,1,1,"option",35,Tp),c()(),l(8,"button",26),b("click",function(){let r=y(e).$index,o=g(2);return C(o.removeDocRow(r))}),l(9,"mat-icon"),h(10,"delete"),c()()()}if(i&2){let e=t.$index,n=g(2);m(4),j("ngModel",n.mandatoryDocs[e]),K("list","docs-list-"+e),m(),x("id","docs-list-"+e),m(),je(n.availableDocuments)}}function sT(i,t){if(i&1){let e=A();l(0,"div",6)(1,"span"),h(2,"Mandatory Documents"),c(),l(3,"button",27),b("click",function(){y(e);let r=g();return C(r.addDocRow())}),l(4,"mat-icon"),h(5,"add"),c()(),l(6,"label",28)(7,"mat-icon"),h(8,"upload_file"),c(),l(9,"input",29),b("change",function(r){y(e);let o=g();return C(o.onDocFileSelected(r))}),c()()(),w(10,iT,2,1,"p",30),w(11,rT,2,0,"p",15),Le(12,aT,11,3,"div",31,xr)}if(i&2){let e=g();m(6),R("uploading",e.isUploadingDoc),m(3),x("disabled",e.isUploadingDoc),m(),S(e.docUploadError?10:-1),m(),S(e.mandatoryDocs.length===0?11:-1),m(),je(e.mandatoryDocs)}}function lT(i,t){i&1&&(l(0,"p",15),h(1,"\u{1F4A1} Documents can be added after the agent is created."),c())}function cT(i,t){if(i&1){let e=A();l(0,"div",6),h(1,"Save to"),c(),l(2,"div",36)(3,"label",37)(4,"input",38),B("ngModelChange",function(r){y(e);let o=g();return z(o.location,r)||(o.location=r),C(r)}),c(),l(5,"div",39)(6,"div",40)(7,"span",41),h(8,"\u{1F464}"),c(),l(9,"span",42),h(10,"Project config"),c()(),l(11,"p",43),h(12),c()()(),l(13,"label",37)(14,"input",44),B("ngModelChange",function(r){y(e);let o=g();return z(o.location,r)||(o.location=r),C(r)}),c(),l(15,"div",39)(16,"div",40)(17,"span",41),h(18,"\u{1F4E6}"),c(),l(19,"span",42),h(20,"Colocated"),c()(),l(21,"p",43),h(22,"Next to coday.yaml in ./agents/ (committable)"),c()()()(),l(23,"p",15),h(24,"Storage location is permanent and cannot be changed after creation."),c()}if(i&2){let e=g();m(3),R("selected",e.location==="project"),m(),j("ngModel",e.location),m(8),Gi("~/.coday/projects/","{","name","}","/agents/ (not committed)"),m(),R("selected",e.location==="colocated"),m(),j("ngModel",e.location)}}function dT(i,t){if(i&1&&(l(0,"div",17)(1,"span",6),h(2,"Storage Location"),c(),l(3,"span",45),h(4),c(),l(5,"p",15),h(6,"Cannot be changed after creation."),c()()),i&2){let e=g();m(3),R("badge-project",e.location==="project")("badge-colocated",e.location==="colocated"),m(),ue(" ",e.location==="project"?"\u{1F464} Project config":"\u{1F4E6} Colocated"," ")}}function uT(i,t){if(i&1&&(l(0,"div",18)(1,"mat-icon"),h(2,"error"),c(),l(3,"span"),h(4),c()()),i&2){let e=g();m(4),U(e.errorMessage)}}var zs=class i{agentCrudApi=u(Sa);agentApi=u(ra);dialogRef=u(bn);data=u(li);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,n])=>({integration:e,tools:n?.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,n=e.files?.[0];n&&(this.isUploadingDoc=!0,this.docUploadError="",this.agentCrudApi.uploadDocument(this.location,n).subscribe({next:r=>{this.isUploadingDoc=!1,this.mandatoryDocs.push(r.relativePath),this.loadAvailableDocuments(),e.value=""},error:r=>{this.isUploadingDoc=!1,this.docUploadError=r?.error?.error??r?.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(n=>n.trim()).filter(Boolean),e=this.integrationRows.length>0?Object.fromEntries(this.integrationRows.filter(n=>n.integration.trim()).map(n=>[n.integration.trim(),n.tools.split(",").map(r=>r.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:n=>{this.isSaving=!1,this.errorMessage=n?.error?.error||n?.message||"Failed to save agent"}})}cancel(){this.dialogRef.close(!1)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=P({type:i,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,n){e&1&&(l(0,"h2",0),h(1),c(),l(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),h(6,"Name"),c(),l(7,"input",3),B("ngModelChange",function(o){return z(n.name,o)||(n.name=o),o}),c(),l(8,"mat-hint"),h(9,"Alphanumeric, hyphens and underscores only. Cannot be changed after creation."),c()(),l(10,"mat-form-field",2)(11,"mat-label"),h(12,"Description"),c(),l(13,"textarea",4),B("ngModelChange",function(o){return z(n.description,o)||(n.description=o),o}),c()(),l(14,"mat-form-field",2)(15,"mat-label"),h(16,"Instructions"),c(),l(17,"textarea",5),B("ngModelChange",function(o){return z(n.instructions,o)||(n.instructions=o),o}),c(),l(18,"mat-hint"),h(19,"System prompt / instructions sent to the AI model"),c()(),l(20,"div",6),h(21,"AI Configuration"),c(),l(22,"div",7)(23,"mat-form-field",8)(24,"mat-label"),h(25,"AI Provider"),c(),l(26,"input",9),B("ngModelChange",function(o){return z(n.aiProvider,o)||(n.aiProvider=o),o}),c()(),l(27,"mat-form-field",8)(28,"mat-label"),h(29,"Model Name"),c(),l(30,"input",10),B("ngModelChange",function(o){return z(n.modelName,o)||(n.modelName=o),o}),c()()(),l(31,"div",7)(32,"mat-form-field",8)(33,"mat-label"),h(34,"Temperature"),c(),l(35,"input",11),B("ngModelChange",function(o){return z(n.temperature,o)||(n.temperature=o),o}),c(),l(36,"mat-hint"),h(37,"Leave empty for model default"),c()(),l(38,"mat-form-field",8)(39,"mat-label"),h(40,"Max Output Tokens"),c(),l(41,"input",12),B("ngModelChange",function(o){return z(n.maxOutputTokens,o)||(n.maxOutputTokens=o),o}),c(),l(42,"mat-hint"),h(43,"Leave empty for model default"),c()()(),l(44,"mat-form-field",2)(45,"mat-label"),h(46,"OpenAI Assistant ID"),c(),l(47,"input",13),B("ngModelChange",function(o){return z(n.openaiAssistantId,o)||(n.openaiAssistantId=o),o}),c(),l(48,"mat-hint"),h(49,"If set, forces aiProvider to openai"),c()(),l(50,"div",6)(51,"span"),h(52,"Integrations"),c(),l(53,"button",14),b("click",function(){return n.addIntegrationRow()}),l(54,"mat-icon"),h(55,"add"),c()()(),w(56,tT,2,0,"p",15),Le(57,nT,12,2,"div",16,xr),w(59,sT,14,5)(60,lT,2,0,"p",15),w(61,cT,25,8),w(62,dT,7,5,"div",17),w(63,uT,5,1,"div",18),c()(),l(64,"mat-dialog-actions",19)(65,"button",20),b("click",function(){return n.cancel()}),h(66,"Cancel"),c(),l(67,"button",21),b("click",function(){return n.save()}),h(68),c()()),e&2&&(m(),U(n.isEditMode?"Edit Agent":"Create Agent"),m(6),j("ngModel",n.name),x("readonly",n.isEditMode),m(6),j("ngModel",n.description),m(4),j("ngModel",n.instructions),m(9),j("ngModel",n.aiProvider),m(4),j("ngModel",n.modelName),m(5),j("ngModel",n.temperature),m(6),j("ngModel",n.maxOutputTokens),m(6),j("ngModel",n.openaiAssistantId),m(9),S(n.integrationRows.length===0?56:-1),m(),je(n.integrationRows),m(2),S(n.isEditMode?59:60),m(2),S(n.isEditMode?-1:61),m(),S(n.isEditMode?62:-1),m(),S(n.errorMessage?63:-1),m(2),x("disabled",n.isSaving),m(2),x("disabled",n.isSaving),m(),ue(" ",n.isSaving?"Saving...":"Save"," "))},dependencies:[ot,Gc,Yc,Ge,Ts,Gr,rt,Yr,Ps,ph,Xe,Hr,Ii,Fi,Ri,Tt,zt,Et,cn,An,Zt,Kt,Hi,vt,it,Ee,Ls,Wo],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 mT=(i,t)=>t.name;function hT(i,t){i&1&&(l(0,"div",7),h(1,"Loading agents..."),c())}function pT(i,t){if(i&1&&(l(0,"div",8),h(1),c()),i&2){let e=g();m(),U(e.errorMessage)}}function gT(i,t){i&1&&(l(0,"div",9),h(1,"No file-based agents found. Create your first agent to get started."),c())}function fT(i,t){i&1&&(l(0,"div",9),h(1,"No agents match your search."),c())}function _T(i,t){if(i&1){let e=A();l(0,"div",11)(1,"div",12)(2,"div",13)(3,"h3"),h(4),c(),l(5,"span",14),h(6),c()(),l(7,"p",15),h(8),c()(),l(9,"div",16)(10,"button",17),b("click",function(){let r=y(e).$implicit,o=g(2);return C(o.editAgent(r))}),h(11,"Edit"),c(),l(12,"button",18),b("click",function(){let r=y(e).$implicit,o=g(2);return C(o.deleteAgent(r))}),h(13,"Delete"),c()()()}if(i&2){let e=t.$implicit;m(4),U(e.name),m(),R("badge-project",e.source==="project")("badge-colocated",e.source==="colocated"),x("title",e.source==="project"?"Project config (~/.coday/)":"Colocated (next to coday.yaml)"),m(),ue(" ",e.source==="project"?"\u{1F464}":"\u{1F4E6}"," "),m(2),U(e.description)}}function bT(i,t){if(i&1&&(l(0,"div",10),Le(1,_T,14,8,"div",11,mT),c()),i&2){let e=g();m(),je(e.filteredAgents)}}var Vd=class i{agentCrudApi=u(Sa);dialog=u(Bn);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(zs,{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(zs,{width:"700px",maxHeight:"90vh",data:{mode:"edit",agent:e}}).afterClosed().subscribe(r=>{r&&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||i)};static \u0275cmp=P({type:i,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,n){e&1&&(l(0,"div",0)(1,"div",1)(2,"h2"),h(3,"Agents"),c(),l(4,"div",2)(5,"mat-form-field",3)(6,"mat-label"),h(7,"Search"),c(),l(8,"input",4),B("ngModelChange",function(o){return z(n.searchQuery,o)||(n.searchQuery=o),o}),b("input",function(){return n.onSearchChange()}),c(),l(9,"mat-icon",5),h(10,"search"),c()(),l(11,"button",6),b("click",function(){return n.createAgent()}),l(12,"mat-icon"),h(13,"add"),c(),l(14,"span"),h(15,"Create Agent"),c()()()(),w(16,hT,2,0,"div",7),w(17,pT,2,1,"div",8),w(18,gT,2,0,"div",9),w(19,fT,2,0,"div",9),w(20,bT,3,0,"div",10),c()),e&2&&(m(8),j("ngModel",n.searchQuery),m(8),S(n.isLoading?16:-1),m(),S(n.errorMessage?17:-1),m(),S(!n.isLoading&&n.agents.length===0?18:-1),m(),S(!n.isLoading&&n.agents.length>0&&n.filteredAgents.length===0?19:-1),m(),S(!n.isLoading&&n.filteredAgents.length>0?20:-1))},dependencies:[ot,Ge,rt,Xe,it,Ee,cn,An,Zt,Kt,no,vt],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 vT=["threadSearchInput"],yT=["*"];function CT(i,t){i&1&&(l(0,"a",27),F(1,"img",28),c()),i&2&&(m(),K("src","CODAY-Logo.png",go))}function xT(i,t){if(i&1){let e=A();l(0,"button",25),b("click",function(){y(e);let r=g();return C(r.toggle())}),l(1,"mat-icon"),h(2,"menu"),c()(),l(3,"button",26),b("click",function(){y(e);let r=g();return C(r.createNewThread())}),l(4,"mat-icon",10),h(5,"play_circle"),c()(),w(6,CT,2,1,"a",27)}if(i&2){let e=g();m(3),x("disabled",!e.selectedProjectName()),m(3),S(e.isOpen?-1:6)}}function wT(i,t){if(i&1){let e=A();l(0,"div",14)(1,"mat-icon",29),h(2,"search"),c(),l(3,"input",30,0),B("ngModelChange",function(r){y(e);let o=g();return z(o.threadSearchQuery,r)||(o.threadSearchQuery=r),C(r)}),b("input",function(){y(e);let r=g();return C(r.onThreadSearchInput())}),c(),l(5,"button",31),b("click",function(){y(e);let r=g();return C(r.closeThreadSearch())}),l(6,"mat-icon"),h(7,"close"),c()()()}if(i&2){let e=g();m(3),j("ngModel",e.threadSearchQuery)}}function ST(i,t){i&1&&(l(0,"mat-icon",18),h(1,"keyboard_arrow_up"),c())}function kT(i,t){i&1&&(l(0,"mat-icon",19),h(1,"forum"),c())}function MT(i,t){if(i&1){let e=A();l(0,"button",33),b("click",function(r){y(e);let o=g(2);return C(o.toggleThreadSearch(r))}),l(1,"mat-icon"),h(2,"search"),c()()}}function ET(i,t){if(i&1){let e=A();l(0,"a",17),b("click",function(r){return y(e),g().toggleSection("threads"),C(r.preventDefault())}),w(1,ST,2,0,"mat-icon",18)(2,kT,2,0,"mat-icon",19),l(3,"span",20),h(4,"Threads"),c(),w(5,MT,3,0,"button",32),c()}if(i&2){let e=g();R("active",e.expandedSections.threads),m(),S(e.expandedSections.threads?1:2),m(4),S(e.expandedSections.threads?5:-1)}}function TT(i,t){if(i&1){let e=A();l(0,"div",16)(1,"app-thread-selector",34),b("searchModeChange",function(r){y(e);let o=g();return C(o.onThreadSearchModeChange(r))}),c()()}if(i&2){let e=g();m(),x("searchMode",e.isThreadSearchActive)("searchQuery",e.threadSearchQuery)}}function OT(i,t){i&1&&(l(0,"mat-icon",18),h(1,"keyboard_arrow_up"),c())}function PT(i,t){i&1&&(l(0,"mat-icon",19),h(1,"tune"),c())}function AT(i,t){i&1&&(l(0,"div",21)(1,"div",35),F(2,"app-options-panel",36),c()())}function DT(i,t){if(i&1){let e=A();l(0,"div",13)(1,"a",17),b("click",function(r){return y(e),g(2).openProjectConfig(),r.preventDefault(),C(r.stopPropagation())}),l(2,"mat-icon",19),h(3,"settings_applications"),c(),l(4,"span",20),h(5,"Project Configuration"),c()()()}}function IT(i,t){i&1&&(l(0,"div",13)(1,"a",37)(2,"mat-icon",19),h(3,"settings_applications"),c(),l(4,"span",20),h(5,"Project config (No project)"),c()()())}function RT(i,t){if(i&1&&w(0,DT,6,0,"div",13)(1,IT,6,0,"div",13),i&2){let e=g();S(e.selectedProjectName()?0:1)}}function FT(i,t){if(i&1){let e=A();l(0,"div",13)(1,"a",17),b("click",function(r){return y(e),g().openAgents(),r.preventDefault(),C(r.stopPropagation())}),l(2,"mat-icon",19),h(3,"smart_toy"),c(),l(4,"span",20),h(5,"Agents"),c()()()}}function NT(i,t){i&1&&(l(0,"div",13)(1,"a",37)(2,"mat-icon",19),h(3,"smart_toy"),c(),l(4,"span",20),h(5,"Agents (No project)"),c()()())}function VT(i,t){if(i&1){let e=A();l(0,"div",13)(1,"a",17),b("click",function(r){return y(e),g().openPrompts(),r.preventDefault(),C(r.stopPropagation())}),l(2,"mat-icon",19),h(3,"description"),c(),l(4,"span",20),h(5,"Prompts"),c()()()}}function LT(i,t){i&1&&(l(0,"div",13)(1,"a",37)(2,"mat-icon",19),h(3,"description"),c(),l(4,"span",20),h(5,"Prompts (No project)"),c()()())}function jT(i,t){if(i&1){let e=A();l(0,"div",13)(1,"a",17),b("click",function(r){return y(e),g().openSchedulers(),r.preventDefault(),C(r.stopPropagation())}),l(2,"mat-icon",19),h(3,"schedule"),c(),l(4,"span",20),h(5,"Schedulers"),c()()()}}function zT(i,t){i&1&&(l(0,"div",13)(1,"a",37)(2,"mat-icon",19),h(3,"schedule"),c(),l(4,"span",20),h(5,"Schedulers (No project)"),c()()())}function BT(i,t){if(i&1){let e=A();l(0,"div",24)(1,"mat-icon",38),h(2,"warning"),c(),l(3,"span",39),h(4),c(),l(5,"button",40),b("click",function(){y(e);let r=g();return C(r.configErrorMessage="")}),l(6,"mat-icon"),h(7,"close"),c()()()}if(i&2){let e=g();m(4),U(e.configErrorMessage)}}var Ld=class i{destroy$=new I;isOpen=!0;isAdmin=!1;configErrorMessage="";expandedSections={threads:!0,config:!1};isThreadSearchActive=!1;threadSearchQuery="";threadSearchInput;dialog=u(Bn);configApi=u(fi);projectStateService=u(Te);projectApi=u(qo);router=u(Dt);preferences=u(mt);threadStateService=u(Bt);projects=qt(this.projectStateService.projectList$);selectedProject=qt(this.projectStateService.selectedProject$);selectedProjectName=qt(this.projectStateService.selectedProject$.pipe(X(t=>t?.name)));isProjectVolatile=qt(this.projectStateService.selectedProject$.pipe(X(t=>t?.config?.volatile||!1)));forcedProject=qt(this.projectStateService.forcedProject$);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)}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(Ns,{data:{configType:"user",initialContent:JSON.stringify(t,null,2)}}).afterClosed().subscribe(n=>{n&&this.saveUserConfig(n)})},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(Ns,{data:{configType:"project",projectName:t,initialContent:JSON.stringify(e,null,2)}}).afterClosed().subscribe(r=>{r&&this.saveProjectConfig(t,r)})},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:n=>{console.log("[SIDENAV] Project config saved successfully")},error:n=>{console.error("[SIDENAV] Error saving project config:",n),this.configErrorMessage=n?.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(Vd,"Opening agent manager dialog")}openPrompts(){this.requireProjectSelection("open prompts")&&this.openManagerDialog(Od,"Opening prompt manager dialog")}openSchedulers(){this.requireProjectSelection("open schedulers")&&this.openManagerDialog(Nd,`Opening scheduler manager dialog for project: ${this.selectedProjectName()}`)}toggleSection(t){let e=this.expandedSections[t];Object.keys(this.expandedSections).forEach(n=>{this.expandedSections[n]=!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||i)};static \u0275cmp=P({type:i,selectors:[["app-sidenav"]],viewQuery:function(e,n){if(e&1&&se(vT,5),e&2){let r;G(r=Y())&&(n.threadSearchInput=r.first)}},ngContentSelectors:yT,decls:50,vars:35,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"],["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,n){e&1&&(Qe(),w(0,xT,7,2),l(1,"mat-sidenav-container",1)(2,"mat-sidenav",2),b("closed",function(){return n.close()}),l(3,"div",3)(4,"button",4),b("click",function(){return n.close()}),l(5,"mat-icon"),h(6,"chevron_left"),c()(),l(7,"img",5),b("click",function(o){return n.navigateToHome(),o.stopPropagation()})("keydown.enter",function(o){return n.navigateToHome(),o.preventDefault(),o.stopPropagation()})("keydown.space",function(o){return n.navigateToHome(),o.preventDefault(),o.stopPropagation()}),c(),l(8,"div",6)(9,"h2",7),h(10),c()()(),l(11,"div",8)(12,"a",9),b("click",function(o){return n.createNewThread(),o.preventDefault()}),l(13,"mat-icon",10),h(14,"play_circle"),c(),l(15,"span",11),h(16,"Start a new thread"),c()()(),l(17,"div",12)(18,"div",13),w(19,wT,8,1,"div",14)(20,ET,6,4,"a",15),w(21,TT,2,2,"div",16),c(),l(22,"div",13)(23,"a",17),b("click",function(o){return n.toggleSection("config"),o.preventDefault()}),w(24,OT,2,0,"mat-icon",18)(25,PT,2,0,"mat-icon",19),l(26,"span",20),h(27,"Preferences"),c()(),w(28,AT,3,0,"div",21),c(),l(29,"div",13)(30,"a",17),b("click",function(o){return n.openUserConfig(),o.preventDefault(),o.stopPropagation()}),l(31,"mat-icon",19),h(32,"settings"),c(),l(33,"span",20),h(34,"User Configuration"),c()()(),w(35,RT,2,1),w(36,FT,6,0,"div",13)(37,NT,6,0,"div",13),w(38,VT,6,0,"div",13)(39,LT,6,0,"div",13),w(40,jT,6,0,"div",13)(41,zT,6,0,"div",13),l(42,"div",13)(43,"a",22),F(44,"img",23),l(45,"span",20),h(46,"Contribute on GitHub"),c()()()()(),l(47,"mat-sidenav-content"),_e(48),c()(),w(49,BT,8,1,"div",24)),e&2&&(S(n.isOpen?-1:0),m(),x("hasBackdrop",!1),m(),x("opened",n.isOpen)("disableClose",!0),m(5),R("sidenav-logo",!0)("clickable",!n.forcedProject())("disabled",n.forcedProject()),x("title",n.forcedProject()?"Project selection disabled":"Go to project selection"),K("src","CODAY-Logo.png",go)("role",n.forcedProject()?null:"button")("tabindex",n.forcedProject()?null:"0"),m(3),U(n.selectedProjectName()),m(7),R("has-footer",!0)("is-admin",n.isAdmin),m(),R("expanded",n.expandedSections.threads),m(),S(n.isThreadSearchActive&&n.expandedSections.threads?19:20),m(2),S(n.expandedSections.threads?21:-1),m(),R("expanded",n.expandedSections.config),m(),R("active",n.expandedSections.config),m(),S(n.expandedSections.config?24:25),m(4),S(n.expandedSections.config?28:-1),m(7),S(n.isAdmin?35:-1),m(),S(n.selectedProjectName()?36:37),m(2),S(n.selectedProjectName()?38:39),m(2),S(n.selectedProjectName()?40:41),m(4),K("src","CODAY-Logo.png",go),m(5),S(n.configErrorMessage?49:-1))},dependencies:[ot,Ge,rt,Xe,vd,kh,bv,_d,it,Ee,Tt,Et,wv,Sv,Is,Td],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 jd=class i{destroy$=new I;isSetup=!1;codayService=u(On);preferencesService=u(mt);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$),po(),le(([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$),po(),le(([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(),n=t.createGain();e.connect(n),n.connect(t.destination),e.frequency.setValueAtTime(700,t.currentTime),n.gain.setValueAtTime(.1,t.currentTime),n.gain.exponentialRampToValueAtTime(.01,t.currentTime+.08),e.start(t.currentTime),e.stop(t.currentTime+.08);let r=t.createOscillator(),o=t.createGain();r.connect(o),o.connect(t.destination);let a=t.currentTime+.11;r.frequency.setValueAtTime(950,a),o.gain.setValueAtTime(.1,a),o.gain.exponentialRampToValueAtTime(.01,a+.09),r.start(a),r.stop(a+.09),console.log("[AGENT-NOTIFICATION] Completion sound played")}catch(t){console.error("[AGENT-NOTIFICATION] Failed to play completion sound:",t)}}handleBrowserNotificationEnabled(){return re(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||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})};var HT=["inputSection"];function UT(i,t){if(i&1&&F(0,"app-thread",2),i&2){let e=g();x("projectName",e.projectName)("threadId",e.threadId)}}function $T(i,t){if(i&1){let e=A();l(0,"div",3),F(1,"app-welcome-message"),c(),l(2,"div",4,0)(4,"div",5)(5,"div",6)(6,"app-chat-textarea",7),b("messageSubmitted",function(r){y(e);let o=g();return C(o.onMessageSubmitted(r))})("voiceRecordingToggled",function(r){y(e);let o=g();return C(o.onVoiceToggled(r))})("heightChanged",function(r){y(e);let o=g();return C(o.onInputHeightChanged(r))}),c()()()()}if(i&2){let e=g();m(6),x("isDisabled",e.isSessionInitializing)("isSessionInitializing",e.isSessionInitializing)("showWelcome",!0)("isThinking",!1)("isStarting",e.isStartingFirstMessage)}}var Bs=class i{destroy$=new I;inputSection;projectName="";threadId=null;isSessionInitializing=!1;isStartingFirstMessage=!1;inputSectionHeight=80;codayService=u(On);titleService=u(fa);preferencesService=u(mt);route=u(_n);router=u(Dt);threadApiService=u(hr);agentNotificationService=u(jd);firstMessageState=u(_a);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,n=t.threadId||null;console.log("[MAIN-APP] Route params updated:",{project:e,thread:n,previousProject:this.projectName,previousThread:this.threadId}),this.projectName=e,this.threadId=n,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||i)};static \u0275cmp=P({type:i,selectors:[["app-main"]],viewQuery:function(e,n){if(e&1&&se(HT,5),e&2){let r;G(r=Y())&&(n.inputSection=r.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,n){e&1&&(l(0,"app-sidenav")(1,"div",1),w(2,UT,1,2,"app-thread",2)(3,$T,7,5),c()()),e&2&&(m(2),S(n.threadId?2:3))},dependencies:[oa,Cd,Qo,Ld],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:[Qu("slideIn",[ql(":enter",[ir({transform:"translateY(100%)",opacity:0}),Wl("300ms ease-out",ir({transform:"translateY(0)",opacity:1}))]),ql(":leave",[Wl("200ms ease-in",ir({transform:"translateY(100%)",opacity:0}))])])]}})};var zd=class i{route=u(_n);ngOnInit(){console.log("[OAuth Callback] Component initialized");let t=this.route.snapshot.queryParamMap.get("code"),e=this.route.snapshot.queryParamMap.get("state"),n=this.route.snapshot.queryParamMap.get("error"),r=this.route.snapshot.queryParamMap.get("error_description");if(console.log("[OAuth Callback] Code:",t,"State:",e,"Error:",n,"Opener:",!!window.opener),n){if(console.log("[OAuth Callback] OAuth error received:",n,r),!window.opener){alert(`OAuth error: ${n}${r?" - "+r:""}. Please close this window.`);return}try{window.opener.postMessage({error:n,state:e,errorDescription:r},window.location.origin),console.log("[OAuth Callback] Error postMessage sent successfully"),setTimeout(()=>{console.log("[OAuth Callback] Closing popup after error"),window.close()},1e3)}catch(o){console.error("[OAuth Callback] Error sending error postMessage:",o),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(o){console.error("[OAuth Callback] Error sending postMessage:",o),alert("OAuth callback error: Failed to communicate with parent window")}}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=P({type:i,selectors:[["app-oauth-callback"]],decls:2,vars:0,template:function(e,n){e&1&&(wn(0,"p"),h(1,"Authentication in progress..."),Sn())},encapsulation:2})};var Lh=i=>re(null,null,function*(){let t=u(Te),e=i.params.projectName;return e?t.getSelectedProjectId()===e?!0:(t.selectProject(e),(yield sp(t.selectedProject$.pipe(Jn(r=>r?.name===e))))?.name===e):(console.log("[PROJECT GUARD] no project id in route"),!1)});var t0=i=>re(null,null,function*(){let t=u(Bt),e=i.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 n=yield ap(dn([t.isLoading$,t.selectedThread$]).pipe(ve(([o,a])=>console.log(`\u{1F43C} [${o?"loading":"loaded"}]`,a?.id)),le(([o,a])=>!o&&!!a),lt(1),X(([o,a])=>a?.id))),r=n===e;return r?console.log("[THREAD GUARD] Thread validated, allowing navigation"):console.error("[THREAD GUARD] Thread ID mismatch - route:",e,"loaded:",n),r}catch(n){return console.error("[THREAD GUARD] Error loading thread:",n),!1}});var n0=[{path:"",component:Zc},{path:"oauth/callback",component:zd},{path:"project/:projectName",component:Bs,canActivate:[Lh]},{path:"project/:projectName/thread/:threadId",component:Bs,canActivate:[Lh,t0]},{path:"agentos",loadChildren:()=>import("./chunk-PA7BQGOR.js").then(i=>i.AGENTOS_ROUTES)},{path:"**",redirectTo:""}];var Bd=class i{eventStream=u(gi);messageApi=u(ia);pendingStates=new Map;popupCheckInterval=null;constructor(){this.eventStream.events$.pipe(le(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 n=this.pendingStates.get(e);if(this.pendingStates.delete(e),n){let r=new pi({state:e,integrationName:n,error:"user_cancelled",errorDescription:"User closed the popup without completing authentication"});this.messageApi.sendMessage(r).subscribe({next:()=>console.log("[OAuth Service] Cancellation sent to backend"),error:o=>console.error("[OAuth Service] Failed to send cancellation:",o)})}}},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,n=900,r=window.screenX+(window.outerWidth-e)/2,o=window.screenY+(window.outerHeight-n)/2,a=`width=${e},height=${n},left=${r},top=${o},popup=yes,resizable=yes,scrollbars=yes`,s=window.open(t.authUrl,"oauth_popup",a);console.log("[OAuth Service] Popup opened:",!!s),s&&(s.focus(),this.startPopupMonitoring(s,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:n,error:r,errorDescription:o}=t.data??{};if(r){console.log("[OAuth Service] OAuth error received:",r,o);let d=this.pendingStates.get(n);if(d){this.pendingStates.delete(n),this.popupCheckInterval&&(clearInterval(this.popupCheckInterval),this.popupCheckInterval=null);let p=new pi({state:n,integrationName:d,error:r,errorDescription:o});this.messageApi.sendMessage(p).subscribe({next:()=>console.log("[OAuth Service] Error callback sent to backend"),error:f=>console.error("[OAuth Service] Failed to send error callback:",f)})}return}if(!e||!n){console.warn("[OAuth Service] Message missing code or state:",t.data);return}console.log("[OAuth Service] Processing callback - code:",e,"state:",n);let a=this.pendingStates.get(n);if(!a){console.warn("[OAuth Service] Unknown state received:",n,"Pending states:",Array.from(this.pendingStates.keys()));return}console.log("[OAuth Service] Found integration:",a),this.pendingStates.delete(n),this.popupCheckInterval&&(clearInterval(this.popupCheckInterval),this.popupCheckInterval=null);let s=new pi({code:e,state:n,integrationName:a});console.log("[OAuth Service] Sending callback to backend..."),this.messageApi.sendMessage(s).subscribe({next:()=>console.log("[OAuth Service] Callback sent to backend successfully"),error:d=>console.error("[OAuth Service] Failed to send callback:",d)})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})};function WT(i){return()=>i.initializeDefaultProject()}function qT(i){return()=>{console.log("[APP_INIT] OAuthService initialized")}}var i0={providers:[bp(),Ip({eventCoalescing:!0}),qu(n0),Gp(),t_(),_p(Wo),{provide:cu,useFactory:WT,deps:[Te],multi:!0},{provide:cu,useFactory:qT,deps:[Bd],multi:!0},{provide:xc,useValue:{width:"80vw",maxWidth:"80vw",maxHeight:"80vh"}}]};var Hd=class i{title="client";themeService=u(ba);ngOnInit(){console.log("[APP] Application initialized with theme:",this.themeService.getCurrentTheme())}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=P({type:i,selectors:[["app-root"]],decls:1,vars:0,template:function(e,n){e&1&&F(0,"router-outlet")},dependencies:[Yu,qa],encapsulation:2})};qp(Hd,i0).catch(i=>console.error(i));
|