@supanadit/morse-web 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,88 +0,0 @@
1
- var fx=Object.create;var Ja=Object.defineProperty,mx=Object.defineProperties,hx=Object.getOwnPropertyDescriptor,gx=Object.getOwnPropertyDescriptors,yx=Object.getOwnPropertyNames,hh=Object.getOwnPropertySymbols,vx=Object.getPrototypeOf,yh=Object.prototype.hasOwnProperty,_x=Object.prototype.propertyIsEnumerable;var gh=(t,e,n)=>e in t?Ja(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,V=(t,e)=>{for(var n in e||={})yh.call(e,n)&&gh(t,n,e[n]);if(hh)for(var n of hh(e))_x.call(e,n)&&gh(t,n,e[n]);return t},Q=(t,e)=>mx(t,gx(e));var bx=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},vh=(t,e)=>{for(var n in e)Ja(t,n,{get:e[n],enumerable:!0})},Ex=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of yx(e))!yh.call(t,r)&&r!==n&&Ja(t,r,{get:()=>e[r],enumerable:!(o=hx(e,r))||o.enumerable});return t};var xx=(t,e,n)=>(n=t!=null?fx(vx(t)):{},Ex(e||!t||!t.__esModule?Ja(n,"default",{value:t,enumerable:!0}):n,t));var W0=bx((xG,G0)=>{function A0(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{let n=t[e],o=typeof n;(o==="object"||o==="function")&&!Object.isFrozen(n)&&A0(n)}),t}var Md=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function R0(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function wr(t,...e){let n=Object.create(null);for(let o in t)n[o]=t[o];return e.forEach(function(o){for(let r in o)n[r]=o[r]}),n}var yk="</span>",M0=t=>!!t.scope,vk=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){let n=t.split(".");return[`${e}${n.shift()}`,...n.map((o,r)=>`${o}${"_".repeat(r+1)}`)].join(" ")}return`${e}${t}`},Fm=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=R0(e)}openNode(e){if(!M0(e))return;let n=vk(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){M0(e)&&(this.buffer+=yk)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},I0=(t={})=>{let e={children:[]};return Object.assign(e,t),e},Vm=class t{constructor(){this.rootNode=I0(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let n=I0({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(o=>this._walk(e,o)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{t._collapse(n)}))}},$m=class extends Vm{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){let o=e.root;n&&(o.scope=`language:${n}`),this.add(o)}toHTML(){return new Fm(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function La(t){return t?typeof t=="string"?t:t.source:null}function P0(t){return hi("(?=",t,")")}function _k(t){return hi("(?:",t,")*")}function bk(t){return hi("(?:",t,")?")}function hi(...t){return t.map(n=>La(n)).join("")}function Ek(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Dd(...t){return"("+(Ek(t).capture?"":"?:")+t.map(o=>La(o)).join("|")+")"}function L0(t){return new RegExp(t.toString()+"|").exec("").length-1}function xk(t,e){let n=t&&t.exec(e);return n&&n.index===0}var Ck=new RegExp(Dd(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));function Hm(t,{joinWith:e}){let n=0;return t.map(o=>{n+=1;let r=n,i=La(o),s="";for(;i.length>0;){let a=Ck.exec(i);if(!a){s+=i;break}s+=i.substring(0,a.index),i=i.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?s+="\\"+String(Number(a[1])+r):(s+=a[0],(a[0]==="("||/^\(\?[<']/.test(a[0]))&&n++)}return s}).map(o=>`(${o})`).join(e)}var wk=/\b\B/,F0="[a-zA-Z]\\w*",Bm="[a-zA-Z_]\\w*",V0="\\b\\d+(\\.\\d+)?",$0="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",j0="\\b(0b[01]+)",Sk="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Tk=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=hi(e,/.*\b/,t.binary,/\b.*/)),wr({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,o)=>{n.index!==0&&o.ignoreMatch()}},t)},Fa={begin:"\\\\[\\s\\S]",relevance:0},Mk={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Fa]},Ik={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Fa]},Dk={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},kd=function(t,e,n={}){let o=wr({scope:"comment",begin:t,end:e,contains:[]},n);o.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let r=Dd("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return o.contains.push({begin:hi(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),o},kk=kd("//","$"),Nk=kd("/\\*","\\*/"),Ok=kd("#","$"),Ak={scope:"number",begin:V0,relevance:0},Rk={scope:"number",begin:$0,relevance:0},Pk={scope:"number",begin:j0,relevance:0},Lk={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Fa,{begin:/\[/,end:/\]/,relevance:0,contains:[Fa]}]},Fk={scope:"title",begin:F0,relevance:0},Vk={scope:"title",begin:Bm,relevance:0},$k={begin:"\\.\\s*"+Bm,relevance:0},jk=function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})},Td=Object.freeze({__proto__:null,APOS_STRING_MODE:Mk,BACKSLASH_ESCAPE:Fa,BINARY_NUMBER_MODE:Pk,BINARY_NUMBER_RE:j0,COMMENT:kd,C_BLOCK_COMMENT_MODE:Nk,C_LINE_COMMENT_MODE:kk,C_NUMBER_MODE:Rk,C_NUMBER_RE:$0,END_SAME_AS_BEGIN:jk,HASH_COMMENT_MODE:Ok,IDENT_RE:F0,MATCH_NOTHING_RE:wk,METHOD_GUARD:$k,NUMBER_MODE:Ak,NUMBER_RE:V0,PHRASAL_WORDS_MODE:Dk,QUOTE_STRING_MODE:Ik,REGEXP_MODE:Lk,RE_STARTERS_RE:Sk,SHEBANG:Tk,TITLE_MODE:Fk,UNDERSCORE_IDENT_RE:Bm,UNDERSCORE_TITLE_MODE:Vk});function Hk(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function Bk(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function Uk(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=Hk,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function zk(t,e){Array.isArray(t.illegal)&&(t.illegal=Dd(...t.illegal))}function Gk(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function Wk(t,e){t.relevance===void 0&&(t.relevance=1)}var qk=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");let n=Object.assign({},t);Object.keys(t).forEach(o=>{delete t[o]}),t.keywords=n.keywords,t.begin=hi(n.beforeMatch,P0(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},Yk=["of","and","for","in","not","or","if","then","parent","list","value"],Zk="keyword";function H0(t,e,n=Zk){let o=Object.create(null);return typeof t=="string"?r(n,t.split(" ")):Array.isArray(t)?r(n,t):Object.keys(t).forEach(function(i){Object.assign(o,H0(t[i],e,i))}),o;function r(i,s){e&&(s=s.map(a=>a.toLowerCase())),s.forEach(function(a){let c=a.split("|");o[c[0]]=[i,Kk(c[0],c[1])]})}}function Kk(t,e){return e?Number(e):Qk(t)?0:1}function Qk(t){return Yk.includes(t.toLowerCase())}var D0={},mi=t=>{console.error(t)},k0=(t,...e)=>{console.log(`WARN: ${t}`,...e)},hs=(t,e)=>{D0[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),D0[`${t}/${e}`]=!0)},Id=new Error;function B0(t,e,{key:n}){let o=0,r=t[n],i={},s={};for(let a=1;a<=e.length;a++)s[a+o]=r[a],i[a+o]=!0,o+=L0(e[a-1]);t[n]=s,t[n]._emit=i,t[n]._multi=!0}function Xk(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw mi("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Id;if(typeof t.beginScope!="object"||t.beginScope===null)throw mi("beginScope must be object"),Id;B0(t,t.begin,{key:"beginScope"}),t.begin=Hm(t.begin,{joinWith:""})}}function Jk(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw mi("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Id;if(typeof t.endScope!="object"||t.endScope===null)throw mi("endScope must be object"),Id;B0(t,t.end,{key:"endScope"}),t.end=Hm(t.end,{joinWith:""})}}function eN(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function tN(t){eN(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),Xk(t),Jk(t)}function nN(t){function e(s,a){return new RegExp(La(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(a?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,a]),this.matchAt+=L0(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let a=this.regexes.map(c=>c[1]);this.matcherRe=e(Hm(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;let c=this.matcherRe.exec(a);if(!c)return null;let l=c.findIndex((u,m)=>m>0&&u!==void 0),d=this.matchIndexes[l];return c.splice(0,l),Object.assign(c,d)}}class o{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];let c=new n;return this.rules.slice(a).forEach(([l,d])=>c.addRule(l,d)),c.compile(),this.multiRegexes[a]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,c){this.rules.push([a,c]),c.type==="begin"&&this.count++}exec(a){let c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let l=c.exec(a);if(this.resumingScanAtSamePosition()&&!(l&&l.index===this.lastIndex)){let d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,l=d.exec(a)}return l&&(this.regexIndex+=l.position+1,this.regexIndex===this.count&&this.considerAll()),l}}function r(s){let a=new o;return s.contains.forEach(c=>a.addRule(c.begin,{rule:c,type:"begin"})),s.terminatorEnd&&a.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&a.addRule(s.illegal,{type:"illegal"}),a}function i(s,a){let c=s;if(s.isCompiled)return c;[Bk,Gk,tN,qk].forEach(d=>d(s,a)),t.compilerExtensions.forEach(d=>d(s,a)),s.__beforeBegin=null,[Uk,zk,Wk].forEach(d=>d(s,a)),s.isCompiled=!0;let l=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),l=s.keywords.$pattern,delete s.keywords.$pattern),l=l||/\w+/,s.keywords&&(s.keywords=H0(s.keywords,t.case_insensitive)),c.keywordPatternRe=e(l,!0),a&&(s.begin||(s.begin=/\B|\b/),c.beginRe=e(c.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(c.endRe=e(c.end)),c.terminatorEnd=La(c.end)||"",s.endsWithParent&&a.terminatorEnd&&(c.terminatorEnd+=(s.end?"|":"")+a.terminatorEnd)),s.illegal&&(c.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(d){return oN(d==="self"?s:d)})),s.contains.forEach(function(d){i(d,c)}),s.starts&&i(s.starts,a),c.matcher=r(c),c}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=wr(t.classNameAliases||{}),i(t)}function U0(t){return t?t.endsWithParent||U0(t.starts):!1}function oN(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return wr(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:U0(t)?wr(t,{starts:t.starts?wr(t.starts):null}):Object.isFrozen(t)?wr(t):t}var rN="11.12.0",jm=class extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}},Lm=R0,N0=wr,O0=Symbol("nomatch"),iN=7,z0=function(t){let e=Object.create(null),n=Object.create(null),o=[],r=!0,i="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]},a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:$m};function c(S){return a.noHighlightRe.test(S)}function l(S){let q=S.className+" ";q+=S.parentNode?S.parentNode.className:"";let B=a.languageDetectRe.exec(q);if(B){let I=Te(B[1]);return I||(k0(i.replace("{}",B[1])),k0("Falling back to no-highlight mode for this block.",S)),I?B[1]:"no-highlight"}return q.split(/\s+/).find(I=>c(I)||Te(I))}function d(S,q,B){let I="",K="";typeof q=="object"?(I=S,B=q.ignoreIllegals,K=q.language):(hs("10.7.0","highlight(lang, code, ...args) has been deprecated."),hs("10.7.0",`Please use highlight(code, options) instead.
2
- https://github.com/highlightjs/highlight.js/issues/2277`),K=S,I=q),B===void 0&&(B=!0);let we={code:I,language:K};qe("before:highlight",we);let Ye=we.result?we.result:u(we.language,we.code,B);return Ye.code=we.code,qe("after:highlight",Ye),Ye}function u(S,q,B,I){let K=Object.create(null);function we(N,L){return N.keywords[L]}function Ye(){if(!G.keywords){Ue.addText(te);return}let N=0;G.keywordPatternRe.lastIndex=0;let L=G.keywordPatternRe.exec(te),Z="";for(;L;){Z+=te.substring(N,L.index);let oe=Xe.case_insensitive?L[0].toLowerCase():L[0],ct=we(G,oe);if(ct){let[vt,jn]=ct;if(Ue.addText(Z),Z="",K[oe]=(K[oe]||0)+1,K[oe]<=iN&&(ht+=jn),vt.startsWith("_"))Z+=L[0];else{let ln=Xe.classNameAliases[vt]||vt;ft(L[0],ln)}}else Z+=L[0];N=G.keywordPatternRe.lastIndex,L=G.keywordPatternRe.exec(te)}Z+=te.substring(N),Ue.addText(Z)}function Ot(){if(te==="")return;let N=null;if(typeof G.subLanguage=="string"){if(!e[G.subLanguage]){Ue.addText(te);return}N=u(G.subLanguage,te,!0,ut[G.subLanguage]),ut[G.subLanguage]=N._top}else N=h(te,G.subLanguage.length?G.subLanguage:null);G.relevance>0&&(ht+=N.relevance),Ue.__addSublanguage(N._emitter,N.language)}function de(){G.subLanguage!=null?Ot():Ye(),te=""}function ft(N,L){N!==""&&(Ue.startScope(L),Ue.addText(N),Ue.endScope())}function Ne(N,L){let Z=1,oe=L.length-1;for(;Z<=oe;){if(!N._emit[Z]){Z++;continue}let ct=Xe.classNameAliases[N[Z]]||N[Z],vt=L[Z];ct?ft(vt,ct):(te=vt,Ye(),te=""),Z++}}function Xt(N,L){return N.scope&&typeof N.scope=="string"&&Ue.openNode(Xe.classNameAliases[N.scope]||N.scope),N.beginScope&&(N.beginScope._wrap?(ft(te,Xe.classNameAliases[N.beginScope._wrap]||N.beginScope._wrap),te=""):N.beginScope._multi&&(Ne(N.beginScope,L),te="")),G=Object.create(N,{parent:{value:G}}),G}function At(N,L,Z){let oe=xk(N.endRe,Z);if(oe){if(N["on:end"]){let ct=new Md(N);N["on:end"](L,ct),ct.isMatchIgnored&&(oe=!1)}if(oe){for(;N.endsParent&&N.parent;)N=N.parent;return N}}if(N.endsWithParent)return At(N.parent,L,Z)}function Ve(N){return G.matcher.regexIndex===0?(te+=N[0],1):(Oe=!0,0)}function Lt(N){let L=N[0],Z=N.rule,oe=new Md(Z),ct=[Z.__beforeBegin,Z["on:begin"]];for(let vt of ct)if(vt&&(vt(N,oe),oe.isMatchIgnored))return Ve(L);return Z.skip?te+=L:(Z.excludeBegin&&(te+=L),de(),!Z.returnBegin&&!Z.excludeBegin&&(te=L)),Xt(Z,N),Z.returnBegin?0:L.length}function Mt(N){let L=N[0],Z=q.substring(N.index),oe=At(G,N,Z);if(!oe)return O0;let ct=G;G.endScope&&G.endScope._wrap?(de(),ft(L,G.endScope._wrap)):G.endScope&&G.endScope._multi?(de(),Ne(G.endScope,N)):ct.skip?te+=L:(ct.returnEnd||ct.excludeEnd||(te+=L),de(),ct.excludeEnd&&(te=L));do G.scope&&Ue.closeNode(),!G.skip&&!G.subLanguage&&(ht+=G.relevance),G=G.parent;while(G!==oe.parent);return oe.starts&&Xt(oe.starts,N),ct.returnEnd?0:L.length}function Ce(){let N=[];for(let L=G;L!==Xe;L=L.parent)L.scope&&N.unshift(L.scope);N.forEach(L=>Ue.openNode(L))}let Ae={};function ye(N,L){let Z=L&&L[0];if(te+=N,Z==null)return de(),0;if(Ae.type==="begin"&&L.type==="end"&&Ae.index===L.index&&Z===""){if(te+=q.slice(L.index,L.index+1),!r){let oe=new Error(`0 width match regex (${S})`);throw oe.languageName=S,oe.badRule=Ae.rule,oe}return 1}if(Ae=L,L.type==="begin")return Lt(L);if(L.type==="illegal"&&!B){let oe=new Error('Illegal lexeme "'+Z+'" for mode "'+(G.scope||"<unnamed>")+'"');throw oe.mode=G,oe}else if(L.type==="end"){let oe=Mt(L);if(oe!==O0)return oe}if(L.type==="illegal"&&Z==="")return L.index===q.length||(te+=`
3
- `),1;if(nt>1e5&&nt>L.index*3)throw new Error("potential infinite loop, way more iterations than matches");return te+=Z,Z.length}let Xe=Te(S);if(!Xe)throw mi(i.replace("{}",S)),new Error('Unknown language: "'+S+'"');let ne=nN(Xe),rt="",G=I||ne,ut={},Ue=new a.__emitter(a);Ce();let te="",ht=0,ue=0,nt=0,Oe=!1;try{if(Xe.__emitTokens)Xe.__emitTokens(q,Ue);else{for(G.matcher.considerAll();;){nt++,Oe?Oe=!1:G.matcher.considerAll(),G.matcher.lastIndex=ue;let N=G.matcher.exec(q);if(!N)break;let L=q.substring(ue,N.index),Z=ye(L,N);ue=N.index+Z}ye(q.substring(ue))}return Ue.finalize(),rt=Ue.toHTML(),{language:S,value:rt,relevance:ht,illegal:!1,_emitter:Ue,_top:G}}catch(N){if(N.message&&N.message.includes("Illegal"))return{language:S,value:Lm(q),illegal:!0,relevance:0,_illegalBy:{message:N.message,index:ue,context:q.slice(ue-100,ue+100),mode:N.mode,resultSoFar:rt},_emitter:Ue};if(r)return{language:S,value:Lm(q),illegal:!1,relevance:0,errorRaised:N,_emitter:Ue,_top:G};throw N}}function m(S){let q={value:Lm(S),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return q._emitter.addText(S),q}function h(S,q){q=q||a.languages||Object.keys(e);let B=m(S),I=q.filter(Te).filter(at).map(de=>u(de,S,!1));I.unshift(B);let K=I.sort((de,ft)=>{if(de.relevance!==ft.relevance)return ft.relevance-de.relevance;if(de.language&&ft.language){if(Te(de.language).supersetOf===ft.language)return 1;if(Te(ft.language).supersetOf===de.language)return-1}return 0}),[we,Ye]=K,Ot=we;return Ot.secondBest=Ye,Ot}function y(S,q,B){let I=q&&n[q]||B;S.classList.add("hljs"),S.classList.add(`language-${I}`)}function E(S){let q=null,B=l(S);if(c(B))return;if(qe("before:highlightElement",{el:S,language:B}),S.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",S);return}if(S.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(S)),a.throwUnescapedHTML))throw new jm("One of your code blocks includes unescaped HTML.",S.innerHTML);q=S;let I=q.textContent,K=B?d(I,{language:B,ignoreIllegals:!0}):h(I);S.innerHTML=K.value,S.dataset.highlighted="yes",y(S,B,K.language),S.result={language:K.language,re:K.relevance,relevance:K.relevance},K.secondBest&&(S.secondBest={language:K.secondBest.language,relevance:K.secondBest.relevance}),qe("after:highlightElement",{el:S,result:K,text:I})}function M(S){a=N0(a,S)}let W=()=>{ae(),hs("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function z(){ae(),hs("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let me=!1;function ae(){function S(){ae()}if(document.readyState==="loading"){me||window.addEventListener("DOMContentLoaded",S,!1),me=!0;return}document.querySelectorAll(a.cssSelector).forEach(E)}function ge(S,q){let B=null;try{B=q(t)}catch(I){if(mi("Language definition for '{}' could not be registered.".replace("{}",S)),r)mi(I);else throw I;B=s}B.name||(B.name=S),e[S]=B,B.rawDefinition=q.bind(null,t),B.aliases&&De(B.aliases,{languageName:S})}function re(S){delete e[S];for(let q of Object.keys(n))n[q]===S&&delete n[q]}function We(){return Object.keys(e)}function Te(S){return S=(S||"").toLowerCase(),e[S]||e[n[S]]}function De(S,{languageName:q}){typeof S=="string"&&(S=[S]),S.forEach(B=>{n[B.toLowerCase()]=q})}function at(S){let q=Te(S);return q&&!q.disableAutodetect}function yt(S){S["before:highlightBlock"]&&!S["before:highlightElement"]&&(S["before:highlightElement"]=q=>{S["before:highlightBlock"](Object.assign({block:q.el},q))}),S["after:highlightBlock"]&&!S["after:highlightElement"]&&(S["after:highlightElement"]=q=>{S["after:highlightBlock"](Object.assign({block:q.el},q))})}function Tt(S){yt(S),o.push(S)}function _t(S){let q=o.indexOf(S);q!==-1&&o.splice(q,1)}function qe(S,q){let B=S;o.forEach(function(I){I[B]&&I[B](q)})}function pe(S){return hs("10.7.0","highlightBlock will be removed entirely in v12.0"),hs("10.7.0","Please use highlightElement now."),E(S)}Object.assign(t,{highlight:d,highlightAuto:h,highlightAll:ae,highlightElement:E,highlightBlock:pe,configure:M,initHighlighting:W,initHighlightingOnLoad:z,registerLanguage:ge,unregisterLanguage:re,listLanguages:We,getLanguage:Te,registerAliases:De,autoDetection:at,inherit:N0,addPlugin:Tt,removePlugin:_t}),t.debugMode=function(){r=!1},t.safeMode=function(){r=!0},t.versionString=rN,t.regex={concat:hi,lookahead:P0,either:Dd,optional:bk,anyNumberOfTimes:_k};for(let S in Td)typeof Td[S]=="object"&&A0(Td[S]);return Object.assign(t,Td),t},gs=z0({});gs.newInstance=()=>z0({});G0.exports=gs;gs.HighlightJS=gs;gs.default=gs});var hn=null,ec=!1,Dr=1,Cx=null,rn=Symbol("SIGNAL");function se(t){let e=hn;return hn=t,e}function rc(){return hn}var Nr={version:0,lastCleanEpoch:0,dirty:!1,producers:void 0,producersTail:void 0,consumers:void 0,consumersTail:void 0,recomputing:!1,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,kind:"unknown",producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function Or(t){if(ec)throw new Error("");if(hn===null)return;hn.consumerOnSignalRead(t);let e=hn.producersTail;if(e!==void 0&&e.producer===t)return;let n,o=hn.recomputing;if(o&&(n=e!==void 0?e.nextProducer:hn.producers,n!==void 0&&n.producer===t)){hn.producersTail=n,n.lastReadVersion=t.version,n.knownValidAtEpoch=Dr;return}let r=t.consumersTail;if(r!==void 0&&r.consumer===hn&&(!o||r.knownValidAtEpoch===Dr))return;let i=Ti(hn),s={producer:t,consumer:hn,nextProducer:n,prevConsumer:void 0,knownValidAtEpoch:Dr,lastReadVersion:t.version,nextConsumer:void 0};hn.producersTail=s,e!==void 0?e.nextProducer=s:hn.producers=s,i&&xh(t,s)}function _h(){Dr++}function Ts(t){if(!(Ti(t)&&!t.dirty)&&!(!t.dirty&&t.lastCleanEpoch===Dr)){if(!t.producerMustRecompute(t)&&!Ms(t)){oc(t);return}t.producerRecomputeValue(t),oc(t)}}function nu(t){if(t.consumers===void 0)return;let e=ec;ec=!0;try{for(let n=t.consumers;n!==void 0;n=n.nextConsumer){let o=n.consumer;o.dirty||wx(o)}}finally{ec=e}}function ou(){return hn?.consumerAllowSignalWrites!==!1}function wx(t){t.dirty=!0,nu(t),t.consumerMarkedDirty?.(t)}function oc(t){t.dirty=!1,t.lastCleanEpoch=Dr}function Ar(t){return t&&bh(t),se(t)}function bh(t){if(t.producersTail?.knownValidAtEpoch===Dr){let e=t.producers;for(;e!==void 0;)e.knownValidAtEpoch=null,e=e.nextProducer}t.producersTail=void 0,t.recomputing=!0}function Si(t,e){se(e),t&&Eh(t)}function Eh(t){t.recomputing=!1;let e=t.producersTail,n=e!==void 0?e.nextProducer:t.producers;if(n!==void 0){if(Ti(t))do n=ru(n);while(n!==void 0);e!==void 0?e.nextProducer=void 0:t.producers=void 0}}function Ms(t){for(let e=t.producers;e!==void 0;e=e.nextProducer){let n=e.producer,o=e.lastReadVersion;if(o!==n.version||(Ts(n),o!==n.version))return!0}return!1}function Rr(t){if(Ti(t)){let e=t.producers;for(;e!==void 0;)e=ru(e)}t.producers=void 0,t.producersTail=void 0,t.consumers=void 0,t.consumersTail=void 0}function xh(t,e){let n=t.consumersTail,o=Ti(t);if(n!==void 0?(e.nextConsumer=n.nextConsumer,n.nextConsumer=e):(e.nextConsumer=void 0,t.consumers=e),e.prevConsumer=n,t.consumersTail=e,!o)for(let r=t.producers;r!==void 0;r=r.nextProducer)xh(r.producer,r)}function ru(t){let e=t.producer,n=t.nextProducer,o=t.nextConsumer,r=t.prevConsumer;if(t.nextConsumer=void 0,t.prevConsumer=void 0,o!==void 0?o.prevConsumer=r:e.consumersTail=r,r!==void 0)r.nextConsumer=o;else if(e.consumers=o,!Ti(e)){let i=e.producers;for(;i!==void 0;)i=ru(i)}return n}function Ti(t){return t.consumerIsAlwaysLive||t.consumers!==void 0}function ic(t){Cx?.(t)}function sc(t,e){return Object.is(t,e)}function Is(t,e){let n=Object.create(Sx);n.computation=t,e!==void 0&&(n.equal=e);let o=()=>{if(Ts(n),Or(n),n.value===kr)throw n.error;return n.value};return o[rn]=n,ic(n),o}var tc=Symbol("UNSET"),nc=Symbol("COMPUTING"),kr=Symbol("ERRORED"),Sx=Q(V({},Nr),{value:tc,dirty:!0,error:null,equal:sc,kind:"computed",producerMustRecompute(t){return t.value===tc||t.value===nc},producerRecomputeValue(t){if(t.value===nc)throw new Error("");let e=t.value;t.value=nc;let n=Ar(t),o,r=!1;try{o=t.computation(),se(null),r=e!==tc&&e!==kr&&o!==kr&&t.equal(e,o)}catch(i){o=kr,t.error=i}finally{Si(t,n)}if(r){t.value=e;return}t.value=o,t.version++}});function Tx(){throw new Error}var Ch=Tx;function wh(t){Ch(t)}function iu(t){Ch=t}var Mx=null;function su(t,e){let n=Object.create(Ds);n.value=t,e!==void 0&&(n.equal=e);let o=()=>Sh(n);return o[rn]=n,ic(n),[o,s=>Pr(n,s),s=>au(n,s)]}function Sh(t){return Or(t),t.value}function Pr(t,e){ou()||wh(t),t.equal(t.value,e)||(t.value=e,Ix(t))}function au(t,e){ou()||wh(t),Pr(t,e(t.value))}var Ds=Q(V({},Nr),{equal:sc,value:void 0,kind:"signal"});function Ix(t){t.version++,_h(),nu(t),Mx?.(t)}var cu=Q(V({},Nr),{consumerIsAlwaysLive:!0,consumerAllowSignalWrites:!0,dirty:!0,kind:"effect"});function lu(t){if(t.dirty=!1,t.version>0&&!Ms(t))return;t.version++;let e=Ar(t);try{t.cleanup(),t.fn()}finally{Si(t,e)}}var du;function ac(){return du}function bo(t){let e=du;return du=t,e}var Th=Symbol("NotFound");function Mi(t){return t===Th||t?.name==="\u0275NotFound"}function Mh(t){let e=se(null);try{return t()}finally{se(e)}}function bn(t){return typeof t=="function"}function cc(t){let n=t(o=>{Error.call(o),o.stack=new Error().stack});return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var lc=cc(t=>function(n){t(this),this.message=n?`${n.length} errors occurred during unsubscription:
4
- ${n.map((o,r)=>`${r+1}) ${o.toString()}`).join(`
5
- `)}`:"",this.name="UnsubscriptionError",this.errors=n});function ks(t,e){if(t){let n=t.indexOf(e);0<=n&&t.splice(n,1)}}var gn=class t{constructor(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let e;if(!this.closed){this.closed=!0;let{_parentage:n}=this;if(n)if(this._parentage=null,Array.isArray(n))for(let i of n)i.remove(this);else n.remove(this);let{initialTeardown:o}=this;if(bn(o))try{o()}catch(i){e=i instanceof lc?i.errors:[i]}let{_finalizers:r}=this;if(r){this._finalizers=null;for(let i of r)try{Ih(i)}catch(s){e=e??[],s instanceof lc?e=[...e,...s.errors]:e.push(s)}}if(e)throw new lc(e)}}add(e){var n;if(e&&e!==this)if(this.closed)Ih(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}}_hasParent(e){let{_parentage:n}=this;return n===e||Array.isArray(n)&&n.includes(e)}_addParent(e){let{_parentage:n}=this;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e}_removeParent(e){let{_parentage:n}=this;n===e?this._parentage=null:Array.isArray(n)&&ks(n,e)}remove(e){let{_finalizers:n}=this;n&&ks(n,e),e instanceof t&&e._removeParent(this)}};gn.EMPTY=(()=>{let t=new gn;return t.closed=!0,t})();var uu=gn.EMPTY;function dc(t){return t instanceof gn||t&&"closed"in t&&bn(t.remove)&&bn(t.add)&&bn(t.unsubscribe)}function Ih(t){bn(t)?t():t.unsubscribe()}var ro={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Ii={setTimeout(t,e,...n){let{delegate:o}=Ii;return o?.setTimeout?o.setTimeout(t,e,...n):setTimeout(t,e,...n)},clearTimeout(t){let{delegate:e}=Ii;return(e?.clearTimeout||clearTimeout)(t)},delegate:void 0};function Dh(t){Ii.setTimeout(()=>{let{onUnhandledError:e}=ro;if(e)e(t);else throw t})}function pu(){}var kh=fu("C",void 0,void 0);function Nh(t){return fu("E",void 0,t)}function Oh(t){return fu("N",t,void 0)}function fu(t,e,n){return{kind:t,value:e,error:n}}var Lr=null;function Di(t){if(ro.useDeprecatedSynchronousErrorHandling){let e=!Lr;if(e&&(Lr={errorThrown:!1,error:null}),t(),e){let{errorThrown:n,error:o}=Lr;if(Lr=null,n)throw o}}else t()}function Ah(t){ro.useDeprecatedSynchronousErrorHandling&&Lr&&(Lr.errorThrown=!0,Lr.error=t)}var Fr=class extends gn{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,dc(e)&&e.add(this)):this.destination=Nx}static create(e,n,o){return new ki(e,n,o)}next(e){this.isStopped?hu(Oh(e),this):this._next(e)}error(e){this.isStopped?hu(Nh(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?hu(kh,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(e){this.destination.next(e)}_error(e){try{this.destination.error(e)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}},Dx=Function.prototype.bind;function mu(t,e){return Dx.call(t,e)}var gu=class{constructor(e){this.partialObserver=e}next(e){let{partialObserver:n}=this;if(n.next)try{n.next(e)}catch(o){uc(o)}}error(e){let{partialObserver:n}=this;if(n.error)try{n.error(e)}catch(o){uc(o)}else uc(e)}complete(){let{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(n){uc(n)}}},ki=class extends Fr{constructor(e,n,o){super();let r;if(bn(e)||!e)r={next:e??void 0,error:n??void 0,complete:o??void 0};else{let i;this&&ro.useDeprecatedNextContext?(i=Object.create(e),i.unsubscribe=()=>this.unsubscribe(),r={next:e.next&&mu(e.next,i),error:e.error&&mu(e.error,i),complete:e.complete&&mu(e.complete,i)}):r=e}this.destination=new gu(r)}};function uc(t){ro.useDeprecatedSynchronousErrorHandling?Ah(t):Dh(t)}function kx(t){throw t}function hu(t,e){let{onStoppedNotification:n}=ro;n&&Ii.setTimeout(()=>n(t,e))}var Nx={closed:!0,next:pu,error:kx,complete:pu};var Rh=typeof Symbol=="function"&&Symbol.observable||"@@observable";function Ph(t){return t}function Lh(t){return t.length===0?Ph:t.length===1?t[0]:function(n){return t.reduce((o,r)=>r(o),n)}}var Eo=class t{constructor(e){e&&(this._subscribe=e)}lift(e){let n=new t;return n.source=this,n.operator=e,n}subscribe(e,n,o){let r=Ax(e)?e:new ki(e,n,o);return Di(()=>{let{operator:i,source:s}=this;r.add(i?i.call(r,s):s?this._subscribe(r):this._trySubscribe(r))}),r}_trySubscribe(e){try{return this._subscribe(e)}catch(n){e.error(n)}}forEach(e,n){return n=Fh(n),new n((o,r)=>{let i=new ki({next:s=>{try{e(s)}catch(a){r(a),i.unsubscribe()}},error:r,complete:o});this.subscribe(i)})}_subscribe(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)}[Rh](){return this}pipe(...e){return Lh(e)(this)}toPromise(e){return e=Fh(e),new e((n,o)=>{let r;this.subscribe(i=>r=i,i=>o(i),()=>n(r))})}};Eo.create=t=>new Eo(t);function Fh(t){var e;return(e=t??ro.Promise)!==null&&e!==void 0?e:Promise}function Ox(t){return t&&bn(t.next)&&bn(t.error)&&bn(t.complete)}function Ax(t){return t&&t instanceof Fr||Ox(t)&&dc(t)}function Rx(t){return bn(t?.lift)}function Vh(t){return e=>{if(Rx(e))return e.lift(function(n){try{return t(n,this)}catch(o){this.error(o)}});throw new TypeError("Unable to lift unknown Observable type")}}function $h(t,e,n,o,r){return new yu(t,e,n,o,r)}var yu=class extends Fr{constructor(e,n,o,r,i,s){super(e),this.onFinalize=i,this.shouldUnsubscribe=s,this._next=n?function(a){try{n(a)}catch(c){e.error(c)}}:super._next,this._error=r?function(a){try{r(a)}catch(c){e.error(c)}finally{this.unsubscribe()}}:super._error,this._complete=o?function(){try{o()}catch(a){e.error(a)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){let{closed:n}=this;super.unsubscribe(),!n&&((e=this.onFinalize)===null||e===void 0||e.call(this))}}};var jh=cc(t=>function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var Bn=class extends Eo{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(e){let n=new pc(this,this);return n.operator=e,n}_throwIfClosed(){if(this.closed)throw new jh}next(e){Di(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let n of this.currentObservers)n.next(e)}})}error(e){Di(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=e;let{observers:n}=this;for(;n.length;)n.shift().error(e)}})}complete(){Di(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;let{observers:e}=this;for(;e.length;)e.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var e;return((e=this.observers)===null||e===void 0?void 0:e.length)>0}_trySubscribe(e){return this._throwIfClosed(),super._trySubscribe(e)}_subscribe(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)}_innerSubscribe(e){let{hasError:n,isStopped:o,observers:r}=this;return n||o?uu:(this.currentObservers=null,r.push(e),new gn(()=>{this.currentObservers=null,ks(r,e)}))}_checkFinalizedStatuses(e){let{hasError:n,thrownError:o,isStopped:r}=this;n?e.error(o):r&&e.complete()}asObservable(){let e=new Eo;return e.source=this,e}};Bn.create=(t,e)=>new pc(t,e);var pc=class extends Bn{constructor(e,n){super(),this.destination=e,this.source=n}next(e){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,e)}error(e){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,e)}complete(){var e,n;(n=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||n===void 0||n.call(e)}_subscribe(e){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(e))!==null&&o!==void 0?o:uu}};var Ns=class extends Bn{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){let n=super._subscribe(e);return!n.closed&&e.next(this._value),n}getValue(){let{hasError:e,thrownError:n,_value:o}=this;if(e)throw n;return this._throwIfClosed(),o}next(e){super.next(this._value=e)}};function vu(t,e){return Vh((n,o)=>{let r=0;n.subscribe($h(o,i=>{o.next(t.call(e,i,r++))}))})}var bc="https://angular.dev/best-practices/security#preventing-cross-site-scripting-xss",be=class extends Error{code;constructor(e,n){super(Ri(e,n)),this.code=e}};function Px(t){return`NG0${Math.abs(t)}`}function Ri(t,e){return`${Px(t)}${e?": "+e:""}`}function mt(t){for(let e in t)if(t[e]===mt)return e;throw Error("")}function Ec(t){if(typeof t=="string")return t;if(Array.isArray(t))return`[${t.map(Ec).join(", ")}]`;if(t==null)return""+t;let e=t.overriddenName||t.name;if(e)return`${e}`;let n=t.toString();if(n==null)return""+n;let o=n.indexOf(`
6
- `);return o>=0?n.slice(0,o):n}function xc(t,e){return t?e?`${t} ${e}`:t:e||""}var Lx=mt({__forward_ref__:mt});function Cc(t){return t.__forward_ref__=Cc,t}function kn(t){return Wh(t)?t():t}function Wh(t){return typeof t=="function"&&Object.hasOwn(t,Lx)&&t.__forward_ref__===Cc}function Pe(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function wc(t){return Fx(t,Sc)}function Fx(t,e){return Object.hasOwn(t,e)&&t[e]||null}function Vx(t){let e=t?.[Sc]??null;return e||null}function bu(t){return t&&Object.hasOwn(t,mc)?t[mc]:null}var Sc=mt({\u0275prov:mt}),mc=mt({\u0275inj:mt}),$e=class{_desc;ngMetadataName="InjectionToken";\u0275prov;constructor(e,n){this._desc=e,this.\u0275prov=void 0,typeof n=="number"?this.__NG_ELEMENT_ID__=n:n!==void 0&&(this.\u0275prov=Pe({token:this,providedIn:n.providedIn||"root",factory:n.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}};function Pu(t){return t&&!!t.\u0275providers}var Lu=mt({\u0275cmp:mt}),Fu=mt({\u0275dir:mt}),Vu=mt({\u0275pipe:mt});var Eu=mt({\u0275fac:mt}),Br=mt({__NG_ELEMENT_ID__:mt}),Hh=mt({__NG_ENV_ID__:mt});function Ur(t){return $u(t,"@Component"),t[Lu]||null}function Tc(t){return $u(t,"@Directive"),t[Fu]||null}function qh(t){return $u(t,"@Pipe"),t[Vu]||null}function $u(t,e){if(t==null)throw new be(-919,!1)}function zr(t){return typeof t=="string"?t:t==null?"":String(t)}var Yh=mt({ngErrorCode:mt}),$x=mt({ngErrorMessage:mt}),jx=mt({ngTokenPath:mt});function ju(t,e){return Zh("",-200,e)}function Mc(t,e){throw new be(-201,!1)}function Zh(t,e,n){let o=new be(e,t);return o[Yh]=e,o[$x]=t,n&&(o[jx]=n),o}function Hx(t){return t[Yh]}var xu;function Kh(){return xu}function Dn(t){let e=xu;return xu=t,e}function Hu(t,e,n){let o=wc(t);if(o&&o.providedIn=="root")return o.value===void 0?o.value=o.factory():o.value;if(n&8)return null;if(e!==void 0)return e;Mc(t,"")}var ar=globalThis;var Bx={},Vr=Bx,Ux="__NG_DI_FLAG__",Cu=class{injector;constructor(e){this.injector=e}retrieve(e,n){let o=$r(n)||0;try{return this.injector.get(e,o&8?null:Vr,o)}catch(r){if(Mi(r))return r;throw r}}};function zx(t,e=0){let n=ac();if(n===void 0)throw new be(-203,!1);if(n===null)return Hu(t,void 0,e);{let o=Gx(e),r=n.retrieve(t,o);if(Mi(r)){if(o.optional)return null;throw r}return r}}function it(t,e=0){return(Kh()||zx)(kn(t),e)}function O(t,e){return it(t,$r(e))}function $r(t){return typeof t>"u"||typeof t=="number"?t:0|(t.optional&&8)|(t.host&&1)|(t.self&&2)|(t.skipSelf&&4)}function Gx(t){return{optional:!!(t&8),host:!!(t&1),self:!!(t&2),skipSelf:!!(t&4)}}function wu(t){let e=[];for(let n=0;n<t.length;n++){let o=kn(t[n]);if(Array.isArray(o)){if(o.length===0)throw new be(900,!1);let r,i=0;for(let s=0;s<o.length;s++){let a=o[s],c=Wx(a);typeof c=="number"?c===-1?r=a.token:i|=c:r=a}e.push(it(r,i))}else e.push(it(o))}return e}function Wx(t){return t[Ux]}function Oi(t,e){let n=Object.hasOwn(t,Eu);return n?t[Eu]:null}function Qh(t,e,n){if(t.length!==e.length)return!1;for(let o=0;o<t.length;o++){let r=t[o],i=e[o];if(n&&(r=n(r),i=n(i)),i!==r)return!1}return!0}function Xh(t){return t.flat(Number.POSITIVE_INFINITY)}function Ic(t,e){t.forEach(n=>Array.isArray(n)?Ic(n,e):e(n))}function Bu(t,e,n){e>=t.length?t.push(n):t.splice(e,0,n)}function Fs(t,e){return e>=t.length-1?t.pop():t.splice(e,1)[0]}function Jh(t,e,n,o){let r=t.length;if(r==e)t.push(n,o);else if(r===1)t.push(o,t[0]),t[0]=n;else{for(r--,t.push(t[r-1],t[r]);r>e;){let i=r-2;t[r]=t[i],r--}t[e]=n,t[e+1]=o}}function Dc(t,e,n){let o=Pi(t,e);return o>=0?t[o|1]=n:(o=~o,Jh(t,o,e,n)),o}function kc(t,e){let n=Pi(t,e);if(n>=0)return t[n|1]}function Pi(t,e){return qx(t,e,1)}function qx(t,e,n){let o=0,r=t.length>>n;for(;r!==o;){let i=o+(r-o>>1),s=t[i<<n];if(e===s)return i<<n;s>e?r=i:o=i+1}return~(r<<n)}var Nc={},io=[],Gr=new $e(""),Oc=new $e("",-1),Uu=new $e(""),Ai=class{get(e,n=Vr){if(n===Vr){let r=Zh("",-201);throw r.name="\u0275NotFound",r}return n}};function Li(t){return{\u0275providers:t}}function eg(t){return Li([{provide:Gr,multi:!0,useValue:t}])}function tg(...t){return{\u0275providers:zu(!0,t),\u0275fromNgModule:!0}}function zu(t,...e){let n=[],o=new Set,r,i=s=>{n.push(s)};return Ic(e,s=>{let a=s;hc(a,i,[],o)&&(r||=[],r.push(a))}),r!==void 0&&ng(r,i),n}function ng(t,e){for(let n=0;n<t.length;n++){let{ngModule:o,providers:r}=t[n];Gu(r,i=>{e(i,o)})}}function hc(t,e,n,o){if(t=kn(t),!t)return!1;let r=null,i=bu(t),s=!i&&Ur(t);if(!i&&!s){let c=t.ngModule;if(i=bu(c),i)r=c;else return!1}else{if(s&&!s.standalone)return!1;r=t}let a=o.has(r);if(s){if(a)return!1;if(o.add(r),s.dependencies){let c=typeof s.dependencies=="function"?s.dependencies():s.dependencies;for(let l of c)hc(l,e,n,o)}}else if(i){if(i.imports!=null&&!a){o.add(r);let l;Ic(i.imports,d=>{hc(d,e,n,o)&&(l||=[],l.push(d))}),l!==void 0&&ng(l,e)}if(!a){let l=Oi(r)||(()=>new r);e({provide:r,useFactory:l,deps:io},r),e({provide:Uu,useValue:r,multi:!0},r),e({provide:Gr,useValue:()=>it(r),multi:!0},r)}let c=i.providers;if(c!=null&&!a){let l=t;Gu(c,d=>{e(d,l)})}}else return!1;return r!==t&&t.providers!==void 0}function Gu(t,e){for(let n of t)Pu(n)&&(n=n.\u0275providers),Array.isArray(n)?Gu(n,e):e(n)}var Yx=mt({provide:String,useValue:mt});function og(t){return t!==null&&typeof t=="object"&&Yx in t}function Zx(t){return!!(t&&t.useExisting)}function Kx(t){return!!(t&&t.useFactory)}function gc(t){return typeof t=="function"}var Vs=new $e(""),fc={},Bh={},_u;function $s(){return _u===void 0&&(_u=new Ai),_u}var so=class{},jr=class extends so{parent;source;scopes;records=new Map;_ngOnDestroyHooks=new Set;_onDestroyHooks=[];get destroyed(){return this._destroyed}_destroyed=!1;injectorDefTypes;constructor(e,n,o,r){super(),this.parent=n,this.source=o,this.scopes=r,Tu(e,s=>this.processProvider(s)),this.records.set(Oc,Ni(void 0,this)),r.has("environment")&&this.records.set(so,Ni(void 0,this));let i=this.records.get(Vs);i!=null&&typeof i.value=="string"&&this.scopes.add(i.value),this.injectorDefTypes=new Set(this.get(Uu,io,{self:!0}))}retrieve(e,n){let o=$r(n)||0;try{return this.get(e,Vr,o)}catch(r){if(Mi(r))return r;throw r}}destroy(){Os(this),this._destroyed=!0;let e=se(null);try{for(let o of this._ngOnDestroyHooks)o.ngOnDestroy();let n=this._onDestroyHooks;this._onDestroyHooks=[];for(let o of n)o()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),se(e)}}onDestroy(e){return Os(this),this._onDestroyHooks.push(e),()=>this.removeOnDestroy(e)}runInContext(e){Os(this);let n=bo(this),o=Dn(void 0),r;try{return e()}finally{bo(n),Dn(o)}}get(e,n=Vr,o){if(Os(this),Object.hasOwn(e,Hh))return e[Hh](this);let r=$r(o),i,s=bo(this),a=Dn(void 0);try{if(!(r&4)){let l=this.records.get(e);if(l===void 0){let d=tC(e)&&wc(e);d&&this.injectableDefInScope(d)?l=Ni(Su(e),fc):l=null,this.records.set(e,l)}if(l!=null)return this.hydrate(e,l,r)}let c=r&2?$s():this.parent;return n=r&8&&n===Vr?null:n,c.get(e,n)}catch(c){let l=Hx(c);throw l===-200||l===-201?new be(l,null):c}finally{Dn(a),bo(s)}}resolveInjectorInitializers(){let e=se(null),n=bo(this),o=Dn(void 0),r;try{let i=this.get(Gr,io,{self:!0});for(let s of i)s()}finally{bo(n),Dn(o),se(e)}}toString(){return"R3Injector[...]"}processProvider(e){e=kn(e);let n=gc(e)?e:kn(e&&e.provide),o=Xx(e);if(!gc(e)&&e.multi===!0){let r=this.records.get(n);r||(r=Ni(void 0,fc,!0),r.factory=()=>wu(r.multi),this.records.set(n,r)),n=e,r.multi.push(e)}this.records.set(n,o)}hydrate(e,n,o){let r=se(null);try{if(n.value===Bh)throw ju("");return n.value===fc&&(n.value=Bh,n.value=n.factory(void 0,o)),typeof n.value=="object"&&n.value&&eC(n.value)&&this._ngOnDestroyHooks.add(n.value),n.value}finally{se(r)}}injectableDefInScope(e){if(!e.providedIn)return!1;let n=kn(e.providedIn);return typeof n=="string"?n==="any"||this.scopes.has(n):this.injectorDefTypes.has(n)}removeOnDestroy(e){let n=this._onDestroyHooks.indexOf(e);n!==-1&&this._onDestroyHooks.splice(n,1)}};function Su(t){let e=wc(t),n=e!==null?e.factory:Oi(t);if(n!==null)return n;if(t instanceof $e)throw new be(-204,!1);if(t instanceof Function)return Qx(t);throw new be(-204,!1)}function Qx(t){if(t.length>0)throw new be(-204,!1);let n=Vx(t);return n!==null?()=>n.factory(t):()=>new t}function Xx(t){if(og(t))return Ni(void 0,t.useValue);{let e=rg(t);return Ni(e,fc)}}function rg(t,e,n){let o;if(gc(t)){let r=kn(t);return Oi(r)||Su(r)}else if(og(t))o=()=>kn(t.useValue);else if(Kx(t))o=()=>t.useFactory(...wu(t.deps||[]));else if(Zx(t))o=(r,i)=>it(kn(t.useExisting),i!==void 0&&i&8?8:void 0);else{let r=kn(t&&(t.useClass||t.provide));if(Jx(t))o=()=>new r(...wu(t.deps));else return Oi(r)||Su(r)}return o}function Os(t){if(t.destroyed)throw new be(-205,!1)}function Ni(t,e,n=!1){return{factory:t,value:e,multi:n?[]:void 0}}function Jx(t){return!!t.deps}function eC(t){return t!==null&&typeof t=="object"&&typeof t.ngOnDestroy=="function"}function tC(t){return typeof t=="function"||typeof t=="object"&&t.ngMetadataName==="InjectionToken"}function Tu(t,e){for(let n of t)Array.isArray(n)?Tu(n,e):n&&Pu(n)?Tu(n.\u0275providers,e):e(n)}function Ac(t,e){let n;t instanceof jr?(Os(t),n=t):n=new Cu(t);let o,r=bo(n),i=Dn(void 0);try{return e()}finally{bo(r),Dn(i)}}function ig(){return Kh()!==void 0||ac()!=null}var ao=0,ce=1,fe=2,Pt=3,Gn=4,xn=5,Fi=6,Vi=7,kt=8,Ho=9,co=10,wt=11,$i=12,Wu=13,cr=14,Nn=15,lr=16,Wr=17,xo=18,js=19,qu=20,Vo=21,Rc=22,$o=23,On=24,qr=25,sg=26,Hs=27,sn=28,ag=1,Yu=6,Yr=7,Bs=8,Zr=9,Nt=10;function dr(t){return Array.isArray(t)&&typeof t[ag]=="object"}function Wn(t){return Array.isArray(t)&&t[ag]===!0}function Zu(t){return(t.flags&4)!==0}function ur(t){return t.componentOffset>-1}function Pc(t){return(t.flags&1)===1}function Kr(t){return!!t.template}function ji(t){return(t[fe]&512)!==0}function Qr(t){return(t[fe]&256)===256}var Ct=(function(t){return t[t.NONE=0]="NONE",t[t.HTML=1]="HTML",t[t.STYLE=2]="STYLE",t[t.SCRIPT=3]="SCRIPT",t[t.URL=4]="URL",t[t.RESOURCE_URL=5]="RESOURCE_URL",t[t.ATTRIBUTE_NO_BINDING=6]="ATTRIBUTE_NO_BINDING",t})(Ct||{}),As,Hr="svg",Lc="math",Mu="",Uh="*",Iu=()=>Object.create(null);function nC(){return As||(As=Iu(),ir(Ct.HTML,void 0,[["iframe",["srcdoc"]],["*",["innerHTML","outerHTML"]]]),ir(Ct.STYLE,void 0,[["*",["style"]]]),ir(Ct.URL,void 0,[["*",["formAction"]],["area",["href"]],["a",["href","xlink:href"]],["form",["action"]],["img",["src"]],["video",["src"]]]),ir(Ct.URL,Lc,[["*",["href","xlink:href"]]]),ir(Ct.RESOURCE_URL,void 0,[["base",["href"]],["embed",["src"]],["frame",["src"]],["iframe",["src"]],["link",["href"]],["object",["codebase","data"]]]),ir(Ct.URL,Hr,[["a",["href","xlink:href"]]]),ir(Ct.ATTRIBUTE_NO_BINDING,Hr,[["animate",["attributeName","values","to","from"]],["set",["to","attributeName"]],["animateMotion",["attributeName"]],["animateTransform",["attributeName"]]]),ir(Ct.ATTRIBUTE_NO_BINDING,void 0,[["unknown",["attributeName","values","to","from","sandbox","allow","allowFullscreen","referrerPolicy","csp","fetchPriority","credentialless"]],["iframe",["sandbox","allow","allowFullscreen","referrerPolicy","csp","fetchPriority","credentialless"]]]),As)}function ir(t,e,n){let o=e??Mu;for(let[r,i]of n){let s=r.toLowerCase();for(let a of i){let c=a.toLowerCase(),l=As[c]??=Iu(),d=l[o]??=Iu();d[s]=t}}}function cg(t,e,n){let r=nC()[e.toLowerCase()];if(!r)return Ct.NONE;let i=t.toLowerCase(),s;if(n){let a=r[n];a&&(s=a[i]??a[Uh])}if(s===void 0){let a=r[Mu];a&&(s=a[i]??a[Uh])}if(s===void 0&&(!n||n===Mu)){let a=r[Hr];a&&(s=a[i])}return s??Ct.NONE}function an(t){for(;Array.isArray(t);)t=t[ao];return t}function Ku(t,e){return an(e[t])}function qn(t,e){return an(e[t.index])}function Fc(t,e){return t.data[e]}function Co(t,e){let n=e[t];return dr(n)?n:n[ao]}function Vc(t){return(t[fe]&128)===128}function lg(t){return Wn(t[Pt])}function wo(t,e){return e==null?null:t[e]}function Qu(t){t[Wr]=0}function Xu(t){t[fe]&1024||(t[fe]|=1024,Vc(t)&&Xr(t))}function dg(t,e){for(;t>0;)e=e[cr],t--;return e}function Us(t){return!!(t[fe]&9216||t[On]?.dirty)}function $c(t){t[co].changeDetectionScheduler?.notify(8),t[fe]&64&&(t[fe]|=1024),Us(t)&&Xr(t)}function Xr(t){t[co].changeDetectionScheduler?.notify(0);let e=jo(t);for(;e!==null&&!(e[fe]&8192||(e[fe]|=8192,!Vc(e)));)e=jo(e)}function jc(t,e){if(Qr(t))throw new be(911,!1);t[Vo]===null&&(t[Vo]=[]),t[Vo].push(e)}function ug(t,e){if(t[Vo]===null)return;let n=t[Vo].indexOf(e);n!==-1&&t[Vo].splice(n,1)}function jo(t){let e=t[Pt];return Wn(e)?e[Pt]:e}function Ju(t){return t[Vi]??=[]}function ep(t){return t.cleanup??=[]}function pg(t,e,n,o){let r=Ju(e);r.push(n),t.firstCreatePass&&ep(t).push(o,r.length-1)}var Me={lFrame:Ig(null),bindingsEnabled:!0,skipHydrationRootTNode:null};var Du=!1;function fg(){return Me.lFrame.elementDepthCount}function mg(){Me.lFrame.elementDepthCount++}function tp(){Me.lFrame.elementDepthCount--}function hg(){return Me.bindingsEnabled}function gg(){return Me.skipHydrationRootTNode!==null}function np(t){return Me.skipHydrationRootTNode===t}function op(){Me.skipHydrationRootTNode=null}function je(){return Me.lFrame.lView}function yn(){return Me.lFrame.tView}function D(t){return Me.lFrame.contextLView=t,t[kt]}function k(t){return Me.lFrame.contextLView=null,t}function Yn(){let t=rp();for(;t!==null&&t.type===64;)t=t.parent;return t}function rp(){return Me.lFrame.currentTNode}function yg(){let t=Me.lFrame,e=t.currentTNode;return t.isParent?e:e.parent}function Hi(t,e){let n=Me.lFrame;n.currentTNode=t,n.isParent=e}function ip(){return Me.lFrame.isParent}function vg(){Me.lFrame.isParent=!1}function sp(){return Du}function Rs(t){let e=Du;return Du=t,e}function _g(){let t=Me.lFrame,e=t.bindingRootIndex;return e===-1&&(e=t.bindingRootIndex=t.tView.bindingStartIndex),e}function bg(){return Me.lFrame.bindingIndex}function Eg(t){return Me.lFrame.bindingIndex=t}function Jr(){return Me.lFrame.bindingIndex++}function Hc(t){let e=Me.lFrame,n=e.bindingIndex;return e.bindingIndex=e.bindingIndex+t,n}function xg(){return Me.lFrame.inI18n}function Cg(t,e){let n=Me.lFrame;n.bindingIndex=n.bindingRootIndex=t,Bc(e)}function wg(){return Me.lFrame.currentDirectiveIndex}function Bc(t){Me.lFrame.currentDirectiveIndex=t}function Sg(t){let e=Me.lFrame.currentDirectiveIndex;return e===-1?null:t[e]}function Tg(){return Me.lFrame.currentQueryIndex}function Uc(t){Me.lFrame.currentQueryIndex=t}function oC(t){let e=t[ce];return e.type===2?e.declTNode:e.type===1?t[xn]:null}function ap(t,e,n){if(n&4){let r=e,i=t;for(;r=r.parent,r===null&&!(n&1);)if(r=oC(i),r===null||(i=i[cr],r.type&10))break;if(r===null)return!1;e=r,t=i}let o=Me.lFrame=Mg();return o.currentTNode=e,o.lView=t,!0}function zc(t){let e=Mg(),n=t[ce];Me.lFrame=e,e.currentTNode=n.firstChild,e.lView=t,e.tView=n,e.contextLView=t,e.bindingIndex=n.bindingStartIndex,e.inI18n=!1}function Mg(){let t=Me.lFrame,e=t===null?null:t.child;return e===null?Ig(t):e}function Ig(t){let e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:t,child:null,inI18n:!1};return t!==null&&(t.child=e),e}function Dg(){let t=Me.lFrame;return Me.lFrame=t.parent,t.currentTNode=null,t.lView=null,t}var cp=Dg;function Gc(){let t=Dg();t.isParent=!0,t.tView=null,t.selectedIndex=-1,t.contextLView=null,t.elementDepthCount=0,t.currentDirectiveIndex=-1,t.currentNamespace=null,t.bindingRootIndex=-1,t.bindingIndex=-1,t.currentQueryIndex=0}function kg(t){return(Me.lFrame.contextLView=dg(t,Me.lFrame.contextLView))[kt]}function lo(){return Me.lFrame.selectedIndex}function pr(t){Me.lFrame.selectedIndex=t}function zs(){let t=Me.lFrame;return Fc(t.tView,t.selectedIndex)}function vn(){Me.lFrame.currentNamespace=Hr}function So(){rC()}function rC(){Me.lFrame.currentNamespace=null}function lp(){return Me.lFrame.currentNamespace}var Ng=!0;function Wc(){return Ng}function qc(t){Ng=t}function ku(t,e=null,n=null,o){let r=Og(t,e,n,o);return r.resolveInjectorInitializers(),r}function Og(t,e=null,n=null,o,r=new Set){let i=[n||io,tg(t)],s;return new jr(i,e||$s(),s||null,r)}var Un=class t{static THROW_IF_NOT_FOUND=Vr;static NULL=new Ai;static create(e,n){if(Array.isArray(e))return ku({name:""},n,e,"");{let o=e.name??"";return ku({name:o},e.parent,e.providers,o)}}static \u0275prov=Pe({token:t,providedIn:"any",factory:()=>it(Oc)});static __NG_ELEMENT_ID__=-1},_n=new $e(""),zt=class{static __NG_ELEMENT_ID__=iC;static __NG_ENV_ID__=e=>e},yc=class extends zt{_lView;constructor(e){super(),this._lView=e}get destroyed(){return Qr(this._lView)}onDestroy(e){let n=this._lView;return jc(n,e),()=>ug(n,e)}};function iC(){return new yc(je())}var Ag=!1,Rg=new $e(""),Bi=(()=>{class t{taskId=0;pendingTasks=new Set;destroyed=!1;pendingTask=new Ns(!1);debugTaskTracker=O(Rg,{optional:!0});get hasPendingTasks(){return this.destroyed?!1:this.pendingTask.value}get hasPendingTasksObservable(){return this.destroyed?new Eo(n=>{n.next(!1),n.complete()}):this.pendingTask}add(){!this.hasPendingTasks&&!this.destroyed&&this.pendingTask.next(!0);let n=this.taskId++;return this.pendingTasks.add(n),this.debugTaskTracker?.add(n),n}has(n){return this.pendingTasks.has(n)}remove(n){this.pendingTasks.delete(n),this.debugTaskTracker?.remove(n),this.pendingTasks.size===0&&this.hasPendingTasks&&this.pendingTask.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this.hasPendingTasks&&this.pendingTask.next(!1),this.destroyed=!0,this.pendingTask.unsubscribe()}static \u0275prov=Pe({token:t,providedIn:"root",factory:()=>new t})}return t})(),Nu=class extends Bn{__isAsync;destroyRef=void 0;pendingTasks=void 0;constructor(e=!1){super(),this.__isAsync=e,ig()&&(this.destroyRef=O(zt,{optional:!0})??void 0,this.pendingTasks=O(Bi,{optional:!0})??void 0)}emit(e){let n=se(null);try{super.next(e)}finally{se(n)}}subscribe(e,n,o){let r=e,i=n||(()=>null),s=o;if(e&&typeof e=="object"){let c=e;r=c.next?.bind(c),i=c.error?.bind(c),s=c.complete?.bind(c)}this.__isAsync&&(i=this.wrapInTimeout(i),r&&(r=this.wrapInTimeout(r)),s&&(s=this.wrapInTimeout(s)));let a=super.subscribe({next:r,error:i,complete:s});return e instanceof gn&&e.add(a),a}wrapInTimeout(e){return n=>{let o=this.pendingTasks?.add();setTimeout(()=>{try{e(n)}finally{o!==void 0&&this.pendingTasks?.remove(o)}})}}},Fo=Nu;function vc(...t){}function dp(t){let e,n;function o(){t=vc;try{n!==void 0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(n),e!==void 0&&clearTimeout(e)}catch{}}return e=setTimeout(()=>{t(),o()}),typeof requestAnimationFrame=="function"&&(n=requestAnimationFrame(()=>{t(),o()})),()=>o()}function Pg(t){return queueMicrotask(()=>t()),()=>{t=vc}}var up="isAngularZone",Ps=up+"_ID",sC=0,En=class t{hasPendingMacrotasks=!1;hasPendingMicrotasks=!1;isStable=!0;onUnstable=new Fo(!1);onMicrotaskEmpty=new Fo(!1);onStable=new Fo(!1);onError=new Fo(!1);constructor(e){let{enableLongStackTrace:n=!1,shouldCoalesceEventChangeDetection:o=!1,shouldCoalesceRunChangeDetection:r=!1,scheduleInRootZone:i=Ag}=e;if(typeof Zone>"u")throw new be(908,!1);Zone.assertZonePatched();let s=this;s._nesting=0,s._outer=s._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(s._inner=s._inner.fork(new Zone.TaskTrackingZoneSpec)),n&&Zone.longStackTraceZoneSpec&&(s._inner=s._inner.fork(Zone.longStackTraceZoneSpec)),s.shouldCoalesceEventChangeDetection=!r&&o,s.shouldCoalesceRunChangeDetection=r,s.callbackScheduled=!1,s.scheduleInRootZone=i,lC(s)}static isInAngularZone(){return typeof Zone<"u"&&Zone.current.get(up)===!0}static assertInAngularZone(){if(!t.isInAngularZone())throw new be(909,!1)}static assertNotInAngularZone(){if(t.isInAngularZone())throw new be(909,!1)}run(e,n,o){return this._inner.run(e,n,o)}runTask(e,n,o,r){let i=this._inner,s=i.scheduleEventTask("NgZoneEvent: "+r,e,aC,vc,vc);try{return i.runTask(s,n,o)}finally{i.cancelTask(s)}}runGuarded(e,n,o){return this._inner.runGuarded(e,n,o)}runOutsideAngular(e){return this._outer.run(e)}},aC={};function pp(t){if(t._nesting==0&&!t.hasPendingMicrotasks&&!t.isStable)try{t._nesting++,t.onMicrotaskEmpty.emit(null)}finally{if(t._nesting--,!t.hasPendingMicrotasks)try{t.runOutsideAngular(()=>t.onStable.emit(null))}finally{t.isStable=!0}}}function cC(t){if(t.isCheckStableRunning||t.callbackScheduled)return;t.callbackScheduled=!0;function e(){dp(()=>{t.callbackScheduled=!1,Ou(t),t.isCheckStableRunning=!0,pp(t),t.isCheckStableRunning=!1})}t.scheduleInRootZone?Zone.root.run(()=>{e()}):t._outer.run(()=>{e()}),Ou(t)}function lC(t){let e=()=>{cC(t)},n=sC++;t._inner=t._inner.fork({name:"angular",properties:{[up]:!0,[Ps]:n,[Ps+n]:!0},onInvokeTask:(o,r,i,s,a,c)=>{if(dC(c))return o.invokeTask(i,s,a,c);try{return zh(t),o.invokeTask(i,s,a,c)}finally{(t.shouldCoalesceEventChangeDetection&&s.type==="eventTask"||t.shouldCoalesceRunChangeDetection)&&e(),Gh(t)}},onInvoke:(o,r,i,s,a,c,l)=>{try{return zh(t),o.invoke(i,s,a,c,l)}finally{t.shouldCoalesceRunChangeDetection&&!t.callbackScheduled&&!uC(c)&&e(),Gh(t)}},onHasTask:(o,r,i,s)=>{o.hasTask(i,s),r===i&&(s.change=="microTask"?(t._hasPendingMicrotasks=s.microTask,Ou(t),pp(t)):s.change=="macroTask"&&(t.hasPendingMacrotasks=s.macroTask))},onHandleError:(o,r,i,s)=>(o.handleError(i,s),t.runOutsideAngular(()=>t.onError.emit(s)),!1)})}function Ou(t){t._hasPendingMicrotasks||(t.shouldCoalesceEventChangeDetection||t.shouldCoalesceRunChangeDetection)&&t.callbackScheduled===!0?t.hasPendingMicrotasks=!0:t.hasPendingMicrotasks=!1}function zh(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function Gh(t){t._nesting--,pp(t)}var Ls=class{hasPendingMicrotasks=!1;hasPendingMacrotasks=!1;isStable=!0;onUnstable=new Fo;onMicrotaskEmpty=new Fo;onStable=new Fo;onError=new Fo;run(e,n,o){return e.apply(n,o)}runGuarded(e,n,o){return e.apply(n,o)}runOutsideAngular(e){return e()}runTask(e,n,o,r){return e.apply(n,o)}};function dC(t){return Lg(t,"__ignore_ng_zone__")}function uC(t){return Lg(t,"__scheduler_tick__")}function Lg(t,e){return!Array.isArray(t)||t.length!==1?!1:t[0]?.data?.[e]===!0}var zn=class{_console=console;handleError(e){this._console.error("ERROR",e)}};function Fg(t){return Vg(t)?t:new Au(t)}function Vg(t){return t instanceof Error||typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.message=="string"}var Au=class extends Error{constructor(e){super(String(e),{cause:e}),this.name="ErrorBoundaryWrappedError"}},ei=new $e("",{factory:()=>{let t=O(En),e=O(so),n;return o=>{t.runOutsideAngular(()=>{e.destroyed&&!n?setTimeout(()=>{throw o}):(n??=e.get(zn),n.handleError(o))})}}}),$g={provide:Gr,useValue:()=>{let t=O(zn,{optional:!0})},multi:!0},pC=new $e("",{factory:()=>{let t=O(_n).defaultView;if(!t)return;let e=O(ei),n=i=>{e(i.reason),i.preventDefault()},o=i=>{i.error?e(i.error):e(new Error(i.message,{cause:i})),i.preventDefault()},r=()=>{t.addEventListener("unhandledrejection",n),t.addEventListener("error",o)};typeof Zone<"u"?Zone.root.run(r):r(),O(zt).onDestroy(()=>{t.removeEventListener("error",o),t.removeEventListener("unhandledrejection",n)})}});function fp(){return Li([eg(()=>{O(pC)})])}function H(t,e){let[n,o,r]=su(t,e?.equal),i=n,s=i[rn];return i.set=o,i.update=r,i.asReadonly=mp.bind(i),i}function mp(){let t=this[rn];if(t.readonlyFn===void 0){let e=()=>this();e[rn]=t,t.readonlyFn=e}return t.readonlyFn}var Gs=new $e("",{factory:()=>fC}),fC="ng";var Yc=new $e(""),Ws=new $e("",{providedIn:"platform",factory:()=>"unknown"});var Zc=new $e("",{factory:()=>O(_n).body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});var qs=(()=>{class t{view;node;constructor(n,o){this.view=n,this.node=o}static __NG_ELEMENT_ID__=mC}return t})();function mC(){return new qs(je(),Yn())}var sr=class{},Ys=new $e("",{factory:()=>!0});var hp=new $e(""),Kc=(()=>{class t{static \u0275prov=Pe({token:t,providedIn:"root",factory:()=>new Ru})}return t})(),Ru=class{dirtyEffectCount=0;queues=new Map;add(e){this.enqueue(e),this.schedule(e)}schedule(e){e.dirty&&this.dirtyEffectCount++}remove(e){let n=e.zone,o=this.queues.get(n);o.has(e)&&(o.delete(e),e.dirty&&this.dirtyEffectCount--)}enqueue(e){let n=e.zone;this.queues.has(n)||this.queues.set(n,new Set);let o=this.queues.get(n);o.has(e)||o.add(e)}flush(){for(;this.dirtyEffectCount>0;){let e=!1;for(let[n,o]of this.queues)n===null?e||=this.flushQueue(o):e||=n.run(()=>this.flushQueue(o));e||(this.dirtyEffectCount=0)}}flushQueue(e){let n=!1;for(let o of e)o.dirty&&(this.dirtyEffectCount--,n=!0,o.run());return n}},_c=class{[rn];constructor(e){this[rn]=e}destroy(){this[rn].destroy()}};function ke(t,e){let n=e?.injector??O(Un),o=e?.manualCleanup!==!0?n.get(zt):null,r,i=n.get(qs,null,{optional:!0}),s=n.get(sr);return i!==null?(r=Hg(i.view,s,t),o instanceof yc&&o._lView===i.view&&(o=null)):r=yC(t,n.get(Kc),s),r.injector=n,o!==null&&(r.onDestroyFns=[o.onDestroy(()=>r.destroy())]),new _c(r)}var jg=Q(V({},cu),{cleanupFns:void 0,zone:null,onDestroyFns:null,run(){let t=Rs(!1);try{lu(this)}finally{Rs(t)}},cleanup(){if(!this.cleanupFns?.length)return;let t=se(null);try{for(;this.cleanupFns.length;)this.cleanupFns.pop()()}finally{this.cleanupFns=[],se(t)}}}),hC=Q(V({},jg),{consumerMarkedDirty(){this.scheduler.schedule(this),this.notifier.notify(12)},destroy(){if(Rr(this),this.onDestroyFns!==null)for(let t of this.onDestroyFns)t();this.cleanup(),this.scheduler.remove(this)}}),gC=Q(V({},jg),{consumerMarkedDirty(){this.view[fe]|=8192,Xr(this.view),this.notifier.notify(13)},destroy(){if(Rr(this),this.onDestroyFns!==null)for(let t of this.onDestroyFns)t();this.cleanup(),this.view[$o]?.delete(this)}});function Hg(t,e,n){let o=Object.create(gC);return o.view=t,o.zone=typeof Zone<"u"?Zone.current:null,o.notifier=e,o.userFn=n,o.fn=Bg(o,n),t[$o]??=new Set,t[$o].add(o),o.consumerMarkedDirty(o),o}function yC(t,e,n){let o=Object.create(hC);return o.userFn=t,o.fn=Bg(o,t),o.scheduler=e,o.notifier=n,o.zone=typeof Zone<"u"?Zone.current:null,o.scheduler.add(o),o.notifier.notify(12),o}function Bg(t,e){return()=>{e(n=>(t.cleanupFns??=[]).push(n))}}var rf=Symbol("InputSignalNode#UNSET"),Sy=Q(V({},Ds),{transformFn:void 0,applyValueToInputSignal(t,e){Pr(t,e)}});function sf(t){return{toString:t}.toString()}var Je=(function(t){return t[t.TemplateCreateStart=0]="TemplateCreateStart",t[t.TemplateCreateEnd=1]="TemplateCreateEnd",t[t.TemplateUpdateStart=2]="TemplateUpdateStart",t[t.TemplateUpdateEnd=3]="TemplateUpdateEnd",t[t.LifecycleHookStart=4]="LifecycleHookStart",t[t.LifecycleHookEnd=5]="LifecycleHookEnd",t[t.OutputStart=6]="OutputStart",t[t.OutputEnd=7]="OutputEnd",t[t.BootstrapApplicationStart=8]="BootstrapApplicationStart",t[t.BootstrapApplicationEnd=9]="BootstrapApplicationEnd",t[t.BootstrapComponentStart=10]="BootstrapComponentStart",t[t.BootstrapComponentEnd=11]="BootstrapComponentEnd",t[t.ChangeDetectionStart=12]="ChangeDetectionStart",t[t.ChangeDetectionEnd=13]="ChangeDetectionEnd",t[t.ChangeDetectionSyncStart=14]="ChangeDetectionSyncStart",t[t.ChangeDetectionSyncEnd=15]="ChangeDetectionSyncEnd",t[t.AfterRenderHooksStart=16]="AfterRenderHooksStart",t[t.AfterRenderHooksEnd=17]="AfterRenderHooksEnd",t[t.ComponentStart=18]="ComponentStart",t[t.ComponentEnd=19]="ComponentEnd",t[t.DeferBlockStateStart=20]="DeferBlockStateStart",t[t.DeferBlockStateEnd=21]="DeferBlockStateEnd",t[t.DynamicComponentStart=22]="DynamicComponentStart",t[t.DynamicComponentEnd=23]="DynamicComponentEnd",t[t.HostBindingsUpdateStart=24]="HostBindingsUpdateStart",t[t.HostBindingsUpdateEnd=25]="HostBindingsUpdateEnd",t})(Je||{});function NC(t,e,n,o){e!==null?e.applyValueToInputSignal(e,o):t[n]=o}var OC=null;function AC(){return OC}var Ug=[];var lt=function(t,e=null,n){for(let o=0;o<Ug.length;o++){let r=Ug[o];r(t,e,n)}};function RC(t,e,n){let{ngOnChanges:o,ngOnInit:r,ngDoCheck:i}=e.type.prototype;if(o){let s=AC()(e);(n.preOrderHooks??=[]).push(t,s),(n.preOrderCheckHooks??=[]).push(t,s)}r&&(n.preOrderHooks??=[]).push(0-t,r),i&&((n.preOrderHooks??=[]).push(t,i),(n.preOrderCheckHooks??=[]).push(t,i))}function PC(t,e){for(let n=e.directiveStart,o=e.directiveEnd;n<o;n++){let i=t.data[n].type.prototype,{ngAfterContentInit:s,ngAfterContentChecked:a,ngAfterViewInit:c,ngAfterViewChecked:l,ngOnDestroy:d}=i;s&&(t.contentHooks??=[]).push(-n,s),a&&((t.contentHooks??=[]).push(n,a),(t.contentCheckHooks??=[]).push(n,a)),c&&(t.viewHooks??=[]).push(-n,c),l&&((t.viewHooks??=[]).push(n,l),(t.viewCheckHooks??=[]).push(n,l)),d!=null&&(t.destroyHooks??=[]).push(n,d)}}function tl(t,e,n){Ty(t,e,3,n)}function nl(t,e,n,o){(t[fe]&3)===n&&Ty(t,e,n,o)}function gp(t,e){let n=t[fe];(n&3)===e&&(n&=16383,n+=1,t[fe]=n)}function Ty(t,e,n,o){let r=o!==void 0?t[Wr]&65535:0,i=o??-1,s=e.length-1,a=0;for(let c=r;c<s;c++)if(typeof e[c+1]=="number"){if(a=e[c],o!=null&&a>=o)break}else e[c]<0&&(t[Wr]+=65536),(a<i||i==-1)&&(LC(t,n,e,c),t[Wr]=(t[Wr]&4294901760)+c+2),c++}function zg(t,e){lt(Je.LifecycleHookStart,t,e);let n=se(null);try{e.call(t)}finally{se(n),lt(Je.LifecycleHookEnd,t,e)}}function LC(t,e,n,o){let r=n[o]<0,i=n[o+1],s=r?-n[o]:n[o],a=t[s];r?t[fe]>>14<t[Wr]>>16&&(t[fe]&3)===e&&(t[fe]+=16384,zg(a,i)):zg(a,i)}var Gi=-1,Qs=class{factory;name;injectImpl;resolving=!1;canSeeViewProviders;multi;componentProviders;index;providerFactory;constructor(e,n,o,r){this.factory=e,this.name=r,this.canSeeViewProviders=n,this.injectImpl=o}};function FC(t){return(t.flags&8)!==0}function VC(t){return(t.flags&16)!==0}function $C(t,e,n){let o=0;for(;o<n.length;){let r=n[o];if(typeof r=="number"){if(r!==0)break;o++;let i=n[o++],s=n[o++],a=n[o++];t.setAttribute(e,s,a,i)}else{let i=r,s=n[++o];HC(i)?t.setProperty(e,i,s):t.setAttribute(e,i,s),o++}}return o}function jC(t){return t===3||t===4||t===6}function HC(t){return t.charCodeAt(0)===64}function _l(t,e){if(!(e===null||e.length===0))if(t===null||t.length===0)t=e.slice();else{let n=-1;for(let o=0;o<e.length;o++){let r=e[o];typeof r=="number"?n=r:n===0||(n===-1||n===2?Gg(t,n,r,null,e[++o]):Gg(t,n,r,null,null))}}return t}function Gg(t,e,n,o,r){let i=0,s=t.length;if(e===-1)s=-1;else for(;i<t.length;){let a=t[i++];if(typeof a=="number"){if(a===e){s=-1;break}else if(a>e){s=i-1;break}}}for(;i<t.length;){let a=t[i];if(typeof a=="number")break;if(a===n){r!==null&&(t[i+1]=r);return}i++,r!==null&&i++}s!==-1&&(t.splice(s,0,e),i=s+1),t.splice(i++,0,n),r!==null&&t.splice(i++,0,r)}function My(t){return t!==Gi}function sl(t){return t&32767}function BC(t){return t>>16}function al(t,e){let n=BC(t),o=e;for(;n>0;)o=o[cr],n--;return o}var Cp=!0;function Wg(t){let e=Cp;return Cp=t,e}var UC=256,Iy=UC-1,Dy=5,zC=0,To={};function GC(t,e,n){let o;typeof n=="string"?o=n.charCodeAt(0)||0:Object.hasOwn(n,Br)&&(o=n[Br]),o==null&&(o=n[Br]=zC++);let r=o&Iy,i=1<<r;e.data[t+(r>>Dy)]|=i}function ky(t,e){let n=Ny(t,e);if(n!==-1)return n;let o=e[ce];o.firstCreatePass&&(t.injectorIndex=e.length,yp(o.data,t),yp(e,null),yp(o.blueprint,null));let r=af(t,e),i=t.injectorIndex;if(My(r)){let s=sl(r),a=al(r,e),c=a[ce].data;for(let l=0;l<8;l++)e[i+l]=a[s+l]|c[s+l]}return e[i+8]=r,i}function yp(t,e){t.push(0,0,0,0,0,0,0,0,e)}function Ny(t,e){return t.injectorIndex===-1||t.parent&&t.parent.injectorIndex===t.injectorIndex||e[t.injectorIndex+8]===null?-1:t.injectorIndex}function af(t,e){if(t.parent&&t.parent.injectorIndex!==-1)return t.parent.injectorIndex;let n=0,o=null,r=e;for(;r!==null;){if(o=Ly(r),o===null)return Gi;if(n++,r=r[cr],o.injectorIndex!==-1)return o.injectorIndex|n<<16}return Gi}function WC(t,e,n){GC(t,e,n)}function Oy(t,e,n){if(n&8||t!==void 0)return t;Mc(e,"NodeInjector")}function Ay(t,e,n,o){if(n&8&&o===void 0&&(o=null),(n&3)===0){let r=t[Ho],i=Dn(void 0);try{return r?r.get(e,o,n&8):Hu(e,o,n&8)}finally{Dn(i)}}return Oy(o,e,n)}function Ry(t,e,n,o=0,r){if(t!==null){if(e[fe]&2048&&!(o&2)){let s=KC(t,e,n,o,To);if(s!==To)return s}let i=Py(t,e,n,o,To);if(i!==To)return i}return Ay(e,n,o,r)}function Py(t,e,n,o,r){let i=YC(n);if(typeof i=="function"){if(!ap(e,t,o))return o&1?Oy(r,n,o):Ay(e,n,o,r);try{let s;if(s=i(o),s==null&&!(o&8))Mc(n);else return s}finally{cp()}}else if(typeof i=="number"){let s=null,a=Ny(t,e),c=Gi,l=o&1?e[Nn][xn]:null;for((a===-1||o&4)&&(c=a===-1?af(t,e):e[a+8],c===Gi||!Yg(o,!1)?a=-1:(s=e[ce],a=sl(c),e=al(c,e)));a!==-1;){let d=e[ce];if(qg(i,a,d.data)){let u=qC(a,e,n,s,o,l);if(u!==To)return u}c=e[a+8],c!==Gi&&Yg(o,e[ce].data[a+8]===l)&&qg(i,a,e)?(s=d,a=sl(c),e=al(c,e)):a=-1}}return r}function qC(t,e,n,o,r,i){let s=e[ce],a=s.data[t+8],c=o==null?ur(a)&&Cp:o!=s&&(a.type&3)!==0,l=r&1&&i===a,d=ol(a,s,n,c,l);return d!==null?cl(e,s,d,a,r):To}function ol(t,e,n,o,r){let i=t.providerIndexes,s=e.data,a=i&1048575,c=t.directiveStart,l=t.directiveEnd,d=i>>20,u=o?a:a+d,m=r?a+d:l;for(let h=u;h<m;h++){let y=s[h];if(h<c&&n===y||h>=c&&y.type===n)return h}if(r){let h=s[c];if(h&&Kr(h)&&h.type===n)return c}return null}function cl(t,e,n,o,r){let i=t[n],s=e.data;if(i instanceof Qs){let a=i;if(a.resolving)throw ju("");let c=Wg(a.canSeeViewProviders);a.resolving=!0;let l=s[n].type||s[n],d,u=a.injectImpl?Dn(a.injectImpl):null,m=ap(t,o,0);try{i=t[n]=a.factory(void 0,r,s,t,o),e.firstCreatePass&&n>=o.directiveStart&&RC(n,s[n],e)}finally{u!==null&&Dn(u),Wg(c),a.resolving=!1,cp()}}return i}function YC(t){if(typeof t=="string")return t.charCodeAt(0)||0;let e=Object.hasOwn(t,Br)?t[Br]:void 0;return typeof e=="number"?e>=0?e&Iy:ZC:e}function qg(t,e,n){let o=1<<t;return!!(n[e+(t>>Dy)]&o)}function Yg(t,e){return!(t&2)&&!(t&1&&e)}var Bo=class{_tNode;_lView;constructor(e,n){this._tNode=e,this._lView=n}get(e,n,o){return Ry(this._tNode,this._lView,e,$r(o),n)}};function ZC(){return new Bo(Yn(),je())}function KC(t,e,n,o,r){let i=t,s=e;for(;i!==null&&s!==null&&s[fe]&2048&&!ji(s);){let a=Py(i,s,n,o|2,To);if(a!==To)return a;o&=-5;let c=i.parent;if(!c){let l=s[qu];if(l){let d=l.get(n,To,o);if(d!==To)return d}c=Ly(s),s=s[cr]}i=c}return r}function Ly(t){let e=t[ce],n=e.type;return n===2?e.declTNode:n===1?t[xn]:null}function Zi(t){return{token:t.token,providedIn:t.autoProvided===!1?null:"root",factory:t.factory,value:void 0}}function QC(){return Ki(Yn(),je())}function Ki(t,e){return new Gt(qn(t,e))}var Gt=(()=>{class t{nativeElement;constructor(n){this.nativeElement=n}static __NG_ELEMENT_ID__=QC}return t})();function XC(t){return t instanceof Gt?t.nativeElement:t}function JC(){return this._results[Symbol.iterator]()}var ll=class{_emitDistinctChangesOnly;dirty=!0;_onDirty=void 0;_results=[];_changesDetected=!1;_changes=void 0;length=0;first=void 0;last=void 0;get changes(){return this._changes??=new Bn}constructor(e=!1){this._emitDistinctChangesOnly=e}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,n){return this._results.reduce(e,n)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,n){this.dirty=!1;let o=Xh(e);(this._changesDetected=!Qh(this._results,o,n))&&(this._results=o,this.length=o.length,this.last=o[this.length-1],this.first=o[0])}notifyOnChanges(){this._changes!==void 0&&(this._changesDetected||!this._emitDistinctChangesOnly)&&this._changes.next(this)}onDirty(e){this._onDirty=e}setDirty(){this.dirty=!0,this._onDirty?.()}destroy(){this._changes!==void 0&&(this._changes.complete(),this._changes.unsubscribe())}[Symbol.iterator]=JC};function Fy(t){return(t.flags&128)===128}var cf=(function(t){return t[t.OnPush=0]="OnPush",t[t.Eager=1]="Eager",t[t.Default=1]="Default",t})(cf||{}),Vy=new Map,ew=0;function tw(){return ew++}function nw(t){Vy.set(t[js],t)}function wp(t){Vy.delete(t[js])}var Zg="__ngContext__";function Wi(t,e){dr(e)?(t[Zg]=e[js],nw(e)):t[Zg]=e}function $y(t){return Hy(t[$i])}function jy(t){return Hy(t[Gn])}function Hy(t){for(;t!==null&&!Wn(t);)t=t[Gn];return t}var Sp;function lf(t){Sp=t}function df(){if(Sp!==void 0)return Sp;if(typeof document<"u")return document;throw new be(210,!1)}var By="r";var Uy="di";var zy=!1,Gy=new $e("",{factory:()=>zy});var Kg=new WeakMap;function ow(t,e){if(t==null||typeof t!="object")return;let n=Kg.get(t);n||(n=new WeakSet,Kg.set(t,n)),n.add(e)}var rw=(t,e,n,o)=>{};function iw(t,e,n,o){rw(t,e,n,o)}function uf(t){return(t.flags&32)===32}var sw=()=>null;function Wy(t,e,n=!1){return sw(t,e,n)}function qy(t,e){let n=t.contentQueries;if(n!==null){let o=se(null);try{for(let r=0;r<n.length;r+=2){let i=n[r],s=n[r+1];if(s!==-1){let a=t.data[s];Uc(i),a.contentQueries(2,e[s],s)}}}finally{se(o)}}}function Tp(t,e,n){Uc(0);let o=se(null);try{e(t,n)}finally{se(o)}}function Yy(t,e,n){if(Zu(e)){let o=se(null);try{let r=e.directiveStart,i=e.directiveEnd;for(let s=r;s<i;s++){let a=t.data[s];if(a.contentQueries){let c=n[s];a.contentQueries(1,c,s)}}}finally{se(o)}}}var fo=(function(t){return t[t.Emulated=0]="Emulated",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom",t[t.ExperimentalIsolatedShadowDom=4]="ExperimentalIsolatedShadowDom",t})(fo||{});var aw={"http://www.w3.org/2000/svg":Hr,"http://www.w3.org/1998/Math/MathML":Lc},Qc;function cw(){if(Qc===void 0&&(Qc=null,ar.trustedTypes))try{Qc=ar.trustedTypes.createPolicy("angular",{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t})}catch{}return Qc}function bl(t){return cw()?.createHTML(t)||t}var Xc;function lw(){if(Xc===void 0&&(Xc=null,ar.trustedTypes))try{Xc=ar.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t})}catch{}return Xc}function Qg(t){return lw()?.createHTML(t)||t}var Uo=class{changingThisBreaksApplicationSecurity;constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${bc})`}},Mp=class extends Uo{getTypeName(){return"HTML"}},Ip=class extends Uo{getTypeName(){return"Style"}},Dp=class extends Uo{getTypeName(){return"Script"}},kp=class extends Uo{getTypeName(){return"URL"}},Np=class extends Uo{getTypeName(){return"ResourceURL"}};function Zn(t){return t instanceof Uo?t.changingThisBreaksApplicationSecurity:t}function Wo(t,e){let n=Zy(t);if(n!=null&&n!==e){if(n==="ResourceURL"&&e==="URL")return!0;throw new Error(`Required a safe ${e}, got a ${n} (see ${bc})`)}return n===e}function Zy(t){return t instanceof Uo&&t.getTypeName()||null}function pf(t){return new Mp(t)}function ff(t){return new Ip(t)}function mf(t){return new Dp(t)}function hf(t){return new kp(t)}function gf(t){return new Np(t)}function dw(t){let e=new Ap(t);return uw()?new Op(e):e}var Op=class{inertDocumentHelper;constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e="<body><remove></remove>"+e;try{let n=new window.DOMParser().parseFromString(bl(e),"text/html").body;return n===null?this.inertDocumentHelper.getInertBodyElement(e):(n.firstChild?.remove(),n)}catch{return null}}},Ap=class{defaultDoc;inertDocument;constructor(e){this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert")}getInertBodyElement(e){let n=this.inertDocument.createElement("template");return n.innerHTML=bl(e),n}};function uw(){try{return!!new window.DOMParser().parseFromString(bl(""),"text/html")}catch{return!1}}var pw=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function ia(t){return t=String(t),t.match(pw)?t:"unsafe:"+t}function qo(t){let e=Object.create(null);for(let n of t.split(","))e[n]=!0;return e}function sa(...t){let e=Object.create(null);for(let n of t)for(let o in n)Object.hasOwn(n,o)&&(e[o]=!0);return e}var Ky=qo("area,br,col,hr,img,wbr"),Qy=qo("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),Xy=qo("rp,rt"),fw=sa(Xy,Qy),mw=sa(Qy,qo("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),hw=sa(Xy,qo("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),Xg=sa(Ky,mw,hw,fw),Jy=qo("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),gw=qo("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,srcset,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),yw=qo("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext"),vw=sa(Jy,gw,yw),_w=qo("script,style,template"),Rp=class{sanitizedSomething=!1;buf=[];sanitizeChildren(e){let n=e.firstChild,o=!0,r=[];for(;n;){if(n.nodeType===Node.ELEMENT_NODE?o=this.startElement(n):n.nodeType===Node.TEXT_NODE?this.chars(n.nodeValue):this.sanitizedSomething=!0,o&&n.firstChild){r.push(n),n=xw(n);continue}for(;n;){n.nodeType===Node.ELEMENT_NODE&&this.endElement(n);let i=Ew(n);if(i){n=i;break}n=r.pop()}}return this.buf.join("")}startElement(e){let n=Jg(e).toLowerCase();if(!Object.hasOwn(Xg,n))return this.sanitizedSomething=!0,!Object.hasOwn(_w,n);this.buf.push("<"),this.buf.push(n);let o=e.attributes;for(let r=0;r<o.length;r++){let i=o.item(r),s=i.name,a=s.toLowerCase();if(!Object.hasOwn(vw,a)){this.sanitizedSomething=!0;continue}let c=i.value;Jy[a]&&(c=ia(c)),this.buf.push(" ",s,'="',ey(c),'"')}return this.buf.push(">"),!0}endElement(e){let n=Jg(e).toLowerCase();Object.hasOwn(Xg,n)&&!Object.hasOwn(Ky,n)&&(this.buf.push("</"),this.buf.push(n),this.buf.push(">"))}chars(e){this.buf.push(ey(e))}};function bw(t,e){return(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)!==Node.DOCUMENT_POSITION_CONTAINED_BY}function Ew(t){let e=t.nextSibling;if(e&&t!==e.previousSibling)throw ev(e);return e}function xw(t){let e=t.firstChild;if(e&&bw(t,e))throw ev(e);return e}function Jg(t){let e=t.nodeName;return typeof e=="string"?e:"FORM"}function ev(t){return new Error(`Failed to sanitize html because the element is clobbered: ${t.outerHTML}`)}var Cw=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ww=/([^\#-~ |!])/g;function ey(t){return t.replace(/&/g,"&amp;").replace(Cw,function(e){let n=e.charCodeAt(0),o=e.charCodeAt(1);return"&#"+((n-55296)*1024+(o-56320)+65536)+";"}).replace(ww,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}var Jc;function El(t,e){let n=null;try{Jc=Jc||dw(t);let o=e?String(e):"";n=Jc.getInertBodyElement(o);let r=5,i=o;do{if(r===0)throw new Error("Failed to sanitize html because the input is unstable");r--,o=i,i=n.innerHTML,n=Jc.getInertBodyElement(o)}while(o!==i);let a=new Rp().sanitizeChildren(ty(n)||n);return bl(a)}finally{if(n){let o=ty(n)||n;for(;o.firstChild;)o.firstChild.remove()}}}function ty(t){return"content"in t&&Sw(t)?t.content:null}function Sw(t){return t.nodeType===Node.ELEMENT_NODE&&t.nodeName==="TEMPLATE"}function Tw(t,e){return t.createText(e)}function Mw(t,e,n){t.setValue(e,n)}function tv(t,e,n){return t.createElement(e,n)}function ti(t,e,n,o,r){t.insertBefore(e,n,o,r)}function nv(t,e,n){t.appendChild(e,n)}function ny(t,e,n,o,r){o!==null?ti(t,e,n,o,r):nv(t,e,n)}function ov(t,e,n,o){t.removeChild(null,e,n,o)}function Iw(t,e,n){t.setAttribute(e,"style",n)}function Dw(t,e,n){n===""?t.removeAttribute(e,"class"):t.setAttribute(e,"class",n)}function rv(t,e,n){let{mergedAttrs:o,classes:r,styles:i}=n;o!==null&&$C(t,e,o),r!==null&&Dw(t,e,r),i!==null&&Iw(t,e,i)}function kw(t,e=!0){if(t[0]!=":")return[null,t];let n=t.indexOf(":",1);if(n===-1){if(e)throw new Error(`Unsupported format "${t}" expecting ":namespace:name"`);return[null,t]}return[t.slice(1,n),t.slice(n+1)]}function yf(t,e,n){if(e!==void 0&&n!==void 0&&Nw(e,n)!==Ct.HTML)return t;let o=iv();return o?Qg(o.sanitize(Ct.HTML,t)||""):Wo(t,"HTML")?Qg(Zn(t)):El(df(),zr(t))}function Qi(t){let e=iv();return e?e.sanitize(Ct.URL,t)||"":Wo(t,"URL")?Zn(t):ia(zr(t))}function iv(){let t=je();return t&&t[co].sanitizer}function Nw(t,e){let[n,o]=Ow(t);return cg(o,e,n)}function Ow(t){t=t.toLowerCase();let e=kw(t,!1);if(e[0])return e;let o=lo()===-1?null:zs(),r=o?.namespace;if(t==="#host"&&o?.type===2){let i=qn(o,je());if(i.tagName&&(t=i.tagName.toLowerCase()),r==null){let s=i.namespaceURI;r=s&&aw[s]}}return[r,t]}function vf(t){return t.ownerDocument.defaultView}function An(t){return t.ownerDocument}function Aw(t,e,n){let o=t.length;for(;;){let r=t.indexOf(e,n);if(r===-1)return r;if(r===0||t.charCodeAt(r-1)<=32){let i=e.length;if(r+i===o||t.charCodeAt(r+i)<=32)return r}n=r+1}}var sv="ng-template";function Rw(t,e,n,o){let r=0;if(o){for(;r<e.length&&typeof e[r]=="string";r+=2)if(e[r]==="class"&&Aw(e[r+1].toLowerCase(),n,0)!==-1)return!0}else if(_f(t))return!1;if(r=e.indexOf(1,r),r>-1){let i;for(;++r<e.length&&typeof(i=e[r])=="string";)if(i.toLowerCase()===n)return!0}return!1}function _f(t){return t.type===4&&t.value!==sv}function Pw(t,e,n){let o=t.type===4&&!n?sv:t.value;return e===o}function Lw(t,e,n){let o=4,r=t.attrs,i=r!==null?$w(r):0,s=!1;for(let a=0;a<e.length;a++){let c=e[a];if(typeof c=="number"){if(!s&&!uo(o)&&!uo(c))return!1;if(s&&uo(c))continue;s=!1,o=c|o&1;continue}if(!s)if(o&4){if(o=2|o&1,c!==""&&!Pw(t,c,n)||c===""&&e.length===1){if(uo(o))return!1;s=!0}}else if(o&8){if(r===null||!Rw(t,r,c,n)){if(uo(o))return!1;s=!0}}else{let l=e[++a],d=Fw(c,r,_f(t),n);if(d===-1){if(uo(o))return!1;s=!0;continue}if(l!==""){let u;if(d>i?u="":u=r[d+1].toLowerCase(),o&2&&l!==u){if(uo(o))return!1;s=!0}}}}return uo(o)||s}function uo(t){return(t&1)===0}function Fw(t,e,n,o){if(e===null)return-1;let r=0;if(o||!n){let i=!1;for(;r<e.length;){let s=e[r];if(s===t)return r;if(s===3||s===6)i=!0;else if(s===1||s===2){let a=e[++r];for(;typeof a=="string";)a=e[++r];continue}else{if(s===4)break;if(s===0){r+=4;continue}}r+=i?1:2}return-1}else return jw(e,t)}function Vw(t,e,n=!1){for(let o=0;o<e.length;o++)if(Lw(t,e[o],n))return!0;return!1}function $w(t){for(let e=0;e<t.length;e++){let n=t[e];if(jC(n))return e}return t.length}function jw(t,e){let n=t.indexOf(4);if(n>-1)for(n++;n<t.length;){let o=t[n];if(typeof o=="number")return-1;if(o===e)return n;n++}return-1}function oy(t,e){return t?":not("+e.trim()+")":e}function Hw(t){let e=t[0],n=1,o=2,r="",i=!1;for(;n<t.length;){let s=t[n];if(typeof s=="string")if(o&2){let a=t[++n];r+="["+s+(a.length>0?'="'+a+'"':"")+"]"}else o&8?r+="."+s:o&4&&(r+=" "+s);else r!==""&&!uo(s)&&(e+=oy(i,r),r=""),o=s,i=i||!uo(o);n++}return r!==""&&(e+=oy(i,r)),e}function Bw(t){return t.map(Hw).join(",")}function Uw(t){let e=[],n=[],o=1,r=2;for(;o<t.length;){let i=t[o];if(typeof i=="string")r===2?i!==""&&e.push(i,t[++o]):r===8&&n.push(i);else{if(!uo(r))break;r=i}o++}return n.length&&e.push(1,...n),e}var Cn={},zo=(function(t){return t[t.Important=1]="Important",t[t.DashCase=2]="DashCase",t})(zo||{}),zw;function bf(t,e){return zw(t,e)}var Ef=new Set;var j2=typeof document<"u"&&typeof document?.documentElement?.getAnimations=="function";var Pp=new WeakMap;function av(t){return t?t[cr]??t:null}var Ui=new WeakSet;function Gw(t,e,n){let o=Pp.get(t);if(!o||o.length===0)return;let r=e.parentNode,i=e.previousSibling,s=av(n);for(let a=o.length-1;a>=0;a--){let{el:c,declarationView:l}=o[a],d=c.parentNode;c===e?(o.splice(a,1),Ui.add(c),c.dispatchEvent(new CustomEvent("animationend",{detail:{cancel:!0}}))):i&&c===i?(o.splice(a,1),c.dispatchEvent(new CustomEvent("animationend",{detail:{cancel:!0}})),c.parentNode?.removeChild(c)):d&&r&&d!==r&&(s===null||l===null||s===l)&&(o.splice(a,1),c.dispatchEvent(new CustomEvent("animationend",{detail:{cancel:!0}})),c.parentNode?.removeChild(c))}}function Ww(t,e,n){let o=av(n),r=Pp.get(t);r?r.some(i=>i.el===e)||r.push({el:e,declarationView:o}):Pp.set(t,[{el:e,declarationView:o}])}var xl=(function(t){return t[t.CHANGE_DETECTION=0]="CHANGE_DETECTION",t[t.AFTER_NEXT_RENDER=1]="AFTER_NEXT_RENDER",t})(xl||{}),Yo=new $e(""),ry=new Set;function oi(t){ry.has(t)||(ry.add(t),performance?.mark?.("mark_feature_usage",{detail:{feature:t}}))}var xf=(()=>{class t{impl=null;execute(){this.impl?.execute()}static \u0275prov=Pe({token:t,providedIn:"root",factory:()=>new t})}return t})(),cv=[0,1,2,3],lv=(()=>{class t{ngZone=O(En);scheduler=O(sr);errorHandler=O(zn,{optional:!0});sequences=new Set;deferredRegistrations=new Set;executing=!1;constructor(){O(Yo,{optional:!0})}execute(){let n=this.sequences.size>0;n&&lt(Je.AfterRenderHooksStart),this.executing=!0;for(let o of cv)for(let r of this.sequences)if(!(r.erroredOrDestroyed||!r.hooks[o]))try{r.pipelinedValue=this.ngZone.runOutsideAngular(()=>this.maybeTrace(()=>{let i=r.hooks[o];return i(r.pipelinedValue)},r.snapshot))}catch(i){r.erroredOrDestroyed=!0,this.errorHandler?.handleError(i)}this.executing=!1;for(let o of this.sequences)o.afterRun(),o.once&&(this.sequences.delete(o),o.destroy());for(let o of this.deferredRegistrations)this.sequences.add(o);this.deferredRegistrations.size>0&&this.scheduler.notify(7),this.deferredRegistrations.clear(),n&&lt(Je.AfterRenderHooksEnd)}register(n){let{view:o}=n;o!==void 0?((o[qr]??=[]).push(n),Xr(o),o[fe]|=8192):this.executing?this.deferredRegistrations.add(n):this.addSequence(n)}addSequence(n){this.sequences.add(n),this.scheduler.notify(7)}unregister(n){this.executing&&this.sequences.has(n)?(n.erroredOrDestroyed=!0,n.pipelinedValue=void 0,n.once=!0):(this.sequences.delete(n),this.deferredRegistrations.delete(n))}maybeTrace(n,o){return o?o.run(xl.AFTER_NEXT_RENDER,n):n()}static \u0275prov=Pe({token:t,providedIn:"root",factory:()=>new t})}return t})(),dl=class{impl;hooks;view;once;snapshot;erroredOrDestroyed=!1;pipelinedValue=void 0;unregisterOnDestroy;constructor(e,n,o,r,i,s=null){this.impl=e,this.hooks=n,this.view=o,this.once=r,this.snapshot=s,this.unregisterOnDestroy=i?.onDestroy(()=>this.destroy())}afterRun(){this.erroredOrDestroyed=!1,this.pipelinedValue=void 0,this.snapshot?.dispose(),this.snapshot=null}destroy(){this.impl.unregister(this),this.unregisterOnDestroy?.();let e=this.view?.[qr];e&&(this.view[qr]=e.filter(n=>n!==this))}};function aa(t,e){let n=e?.injector??O(Un);return oi("NgAfterNextRender"),Yw(t,n,e,!0)}function qw(t){return t instanceof Function?[void 0,void 0,t,void 0]:[t.earlyRead,t.write,t.mixedReadWrite,t.read]}function Yw(t,e,n,o){let r=e.get(xf);r.impl??=e.get(lv);let i=e.get(Yo,null,{optional:!0}),s=n?.manualCleanup!==!0?e.get(zt):null,a=e.get(qs,null,{optional:!0}),c=new dl(r.impl,qw(t),a?.view,o,s,i?.snapshot(null));return r.impl.register(c),c}var Lp=null,dv=null;function iy(t,e,n,o){Lp?.maybeQueueEnterAnimation(t,e,n,o)}function sy(t,e,n,o){Lp===null?o(!1):Lp.runLeaveAnimationsWithCallback(t,e,n,o)}function Zw(t){dv?.initViewDetachAnimations(t)}function Kw(t){dv?.clearViewDetachAnimations(t)}function zi(t,e,n,o,r,i,s,a){if(r!=null){let c,l=!1;Wn(r)?c=r:dr(r)&&(l=!0,r=r[ao]);let d=an(r);t===0&&o!==null?(iy(a,o,i,n),s==null?nv(e,o,d):ti(e,o,d,s||null,!0)):t===1&&o!==null?(ti(e,o,d,s||null,!0),Gw(i,d,a),Ui.has(d)||iy(a,o,i,n)):t===2?(a?.[sg]?.leave?.has(i.index)&&Ww(i,d,a),Ui.delete(d),sy(a,i,n,u=>{if(Ui.has(d)){Ui.delete(d);return}ov(e,d,l,u)})):t===3&&(Ui.delete(d),sy(a,i,n,()=>{e.destroyNode(d)})),c!=null&&lS(e,t,n,c,i,o,s)}}function Qw(t,e){uv(t,e),e[ao]=null,e[xn]=null}function Xw(t,e,n,o,r,i){o[ao]=r,o[xn]=e,wl(t,o,n,1,r,i)}function uv(t,e){e[co].changeDetectionScheduler?.notify(9),wl(t,e,e[wt],2,null,null)}function Jw(t){let e=t[$i];if(!e)return vp(t[ce],t);for(;e;){let n=null;if(dr(e))n=e[$i];else{let o=e[Nt];o&&(n=o)}if(!n){for(;e&&!e[Gn]&&e!==t;)dr(e)&&vp(e[ce],e),e=e[Pt];e===null&&(e=t),dr(e)&&vp(e[ce],e),n=e&&e[Gn]}e=n}}function Cf(t,e){let n=t[Zr],o=n.indexOf(e);n.splice(o,1)}function Cl(t,e){if(Qr(e))return;let n=e[wt];n.destroyNode&&wl(t,e,n,3,null,null),Jw(e)}function vp(t,e){if(Qr(e))return;let n=se(null);try{e[fe]&=-129,e[fe]|=256,e[On]&&Rr(e[On]),tS(t,e),eS(t,e),e[ce].type===1&&e[wt].destroy();let o=e[lr];if(o!==null&&Wn(e[Pt])){o!==e[Pt]&&Cf(o,e);let r=e[xo];r!==null&&r.detachView(t)}wp(e)}finally{se(n)}}function eS(t,e){let n=t.cleanup,o=e[Vi];if(n!==null)for(let s=0;s<n.length-1;s+=2)if(typeof n[s]=="string"){let a=n[s+3];a>=0?o[a]():o[-a].unsubscribe(),s+=2}else{let a=o[n[s+1]];n[s].call(a)}o!==null&&(e[Vi]=null);let r=e[Vo];if(r!==null){e[Vo]=null;for(let s=0;s<r.length;s++){let a=r[s];a()}}let i=e[$o];if(i!==null){e[$o]=null;for(let s of i)s.destroy()}}function tS(t,e){let n;if(t!=null&&(n=t.destroyHooks)!=null)for(let o=0;o<n.length;o+=2){let r=e[n[o]];if(!(r instanceof Qs)){let i=n[o+1];if(Array.isArray(i))for(let s=0;s<i.length;s+=2){let a=r[i[s]],c=i[s+1];lt(Je.LifecycleHookStart,a,c);try{c.call(a)}finally{lt(Je.LifecycleHookEnd,a,c)}}else{lt(Je.LifecycleHookStart,r,i);try{i.call(r)}finally{lt(Je.LifecycleHookEnd,r,i)}}}}}function nS(t,e,n){if(e===null)throw new be(510,!1);return oS(t,e.parent,n)}function oS(t,e,n){let o=e;for(;o!==null&&o.type&168;)e=o,o=e.parent;if(o===null)return n[ao];if(ur(o)){let{encapsulation:r}=t.data[o.directiveStart+o.componentOffset];if(r===fo.None||r===fo.Emulated)return null}return qn(o,n)}function rS(t,e,n){return sS(t,e,n)}function iS(t,e,n){return t.type&40?qn(t,n):null}var sS=iS,ay;function wf(t,e,n,o){let r=nS(t,o,e),i=e[wt],s=o.parent||e[xn],a=rS(s,o,e);if(r!=null)if(Array.isArray(n))for(let c=0;c<n.length;c++)ny(i,r,n[c],a,!1);else ny(i,r,n,a,!1);ay!==void 0&&ay(i,o,e,n,r)}function Zs(t,e){if(e!==null){let n=e.type;if(n&3)return qn(e,t);if(n&4)return Fp(-1,t[e.index]);if(n&8){let o=e.child;if(o!==null)return Zs(t,o);{let r=t[e.index];return Wn(r)?Fp(-1,r):an(r)}}else{if(n&128)return Zs(t,e.next);if(n&32)return bf(e,t)()||an(t[e.index]);{let o=pv(t,e);if(o!==null){if(Array.isArray(o))return o[0];let r=jo(t[Nn]);return Zs(r,o)}else return Zs(t,e.next)}}}return null}function pv(t,e){if(e!==null){let o=t[Nn][xn],r=e.projection;return o.projection[r]}return null}function Fp(t,e){let n=Nt+t+1;if(n<e.length){let o=e[n],r=o[ce].firstChild;if(r!==null)return Zs(o,r)}return e[Yr]}function Sf(t,e,n,o,r,i,s){for(;n!=null;){let a=o[Ho];if(n.type===128){n=n.next;continue}let c=o[n.index],l=n.type;if(s&&e===0&&(c&&Wi(an(c),o),n.flags|=2),!uf(n))if(l&8)Sf(t,e,n.child,o,r,i,!1),zi(e,t,a,r,c,n,i,o);else if(l&32){let d=bf(n,o),u;for(;u=d();)zi(e,t,a,r,u,n,i,o);zi(e,t,a,r,c,n,i,o)}else l&16?cS(t,e,o,n,r,i):zi(e,t,a,r,c,n,i,o);n=s?n.projectionNext:n.next}}function wl(t,e,n,o,r,i){t.type===3?aS(n,o,e,r,i):Sf(n,o,t.firstChild,e,r,i,!1)}function aS(t,e,n,o,r){let s=n[ce].firstChild,a=s.next,c=an(n[s.index]),l=an(n[a.index]),d=a.index+1,u=n[d];if(e===1||e===0)o!==null&&(u&&u.hasChildNodes()?ti(t,o,u,r,!0):(ti(t,o,c,r,!0),ti(t,o,l,r,!0)));else if(e===2){if(u||(u=document.createDocumentFragment(),n[d]=u),c&&c.parentNode===u)return;let m=c;for(;m!==null;){let h=m.nextSibling;if(u.appendChild(m),m===l)break;m=h}}}function cS(t,e,n,o,r,i){let s=n[Nn],c=s[xn].projection[o.projection];if(Array.isArray(c))for(let l=0;l<c.length;l++){let d=c[l];zi(e,t,n[Ho],r,d,o,i,n)}else{let l=c,d=s[Pt];Fy(o)&&(l.flags|=128),Sf(t,e,l,d,r,i,!0)}}function lS(t,e,n,o,r,i,s){let a=o[Yr],c=an(o);if(a!==c&&zi(e,t,n,i,a,r,s),(o[fe]&4)===0)for(let l=Nt;l<o.length;l++){let d=o[l];wl(d[ce],d,t,e,i,a)}}function dS(t,e,n,o,r){if(e)r?t.addClass(n,o):t.removeClass(n,o);else{let i=o.indexOf("-")===-1?void 0:zo.DashCase;r==null?t.removeStyle(n,o,i):(typeof r=="string"&&r.endsWith("!important")&&(r=r.slice(0,-10),i|=zo.Important),t.setStyle(n,o,r,i))}}function Tf(t,e,n,o,r,i,s,a,c,l,d){let u=sn+o,m=u+r,h=uS(u,m),y=typeof l=="function"?l():l;return h[ce]={type:t,blueprint:h,template:n,queries:null,viewQuery:a,declTNode:e,data:h.slice().fill(null,u),bindingStartIndex:u,expandoStartIndex:m,hostBindingOpCodes:null,firstCreatePass:!0,firstUpdatePass:!0,staticViewQueries:!1,staticContentQueries:!1,preOrderHooks:null,preOrderCheckHooks:null,contentHooks:null,contentCheckHooks:null,viewHooks:null,viewCheckHooks:null,destroyHooks:null,cleanup:null,contentQueries:null,components:null,directiveRegistry:typeof i=="function"?i():i,pipeRegistry:typeof s=="function"?s():s,firstChild:null,schemas:c,consts:y,incompleteFirstPass:!1,ssrId:d}}function uS(t,e){let n=[];for(let o=0;o<e;o++)n.push(o<t?null:Cn);return n}function pS(t){let e=t.tView;return e===null||e.incompleteFirstPass?t.tView=Tf(1,null,t.template,t.decls,t.vars,t.directiveDefs,t.pipeDefs,t.viewQuery,t.schemas,t.consts,t.id):e}function Mf(t,e,n,o,r,i,s,a,c,l,d){let u=e.blueprint.slice();return u[ao]=r,u[fe]=o|4|128|8|64|1024,(l!==null||t&&t[fe]&2048)&&(u[fe]|=2048),Qu(u),u[Pt]=u[cr]=t,u[kt]=n,u[co]=s||t&&t[co],u[wt]=a||t&&t[wt],u[Ho]=c||t&&t[Ho]||null,u[xn]=i,u[js]=tw(),u[Fi]=d,u[qu]=l,u[Nn]=e.type==2?t[Nn]:u,u}function fS(t,e,n){let o=qn(e,t),r=pS(n),i=t[co].rendererFactory,s=If(t,Mf(t,r,null,fv(n),o,e,null,i.createRenderer(o,n),null,null,null));return t[e.index]=s}function fv(t){let e=16;return t.signals?e=4096:t.onPush&&(e=64),e}function mv(t,e,n,o){if(n===0)return-1;let r=e.length;for(let i=0;i<n;i++)e.push(o),t.blueprint.push(o),t.data.push(null);return r}function If(t,e){return t[$i]?t[Wu][Gn]=e:t[$i]=e,t[Wu]=e,e}function f(t=1){hv(yn(),je(),lo()+t,!1)}function hv(t,e,n,o){if(!o)if((e[fe]&3)===3){let i=t.preOrderCheckHooks;i!==null&&tl(e,i,n)}else{let i=t.preOrderHooks;i!==null&&nl(e,i,0,n)}pr(n)}var Sl=(function(t){return t[t.None=0]="None",t[t.SignalBased=1]="SignalBased",t[t.HasDecoratorInputTransform=2]="HasDecoratorInputTransform",t})(Sl||{});function Vp(t,e,n,o){let r=se(null);try{let[i,s,a]=t.inputs[n],c=null;(s&Sl.SignalBased)!==0&&(c=e[i][rn]),c!==null&&c.transformFn!==void 0?o=c.transformFn(o):a!==null&&(o=a.call(e,o)),t.setInput!==null?t.setInput(e,c,o,n,i):NC(e,c,i,o)}finally{se(r)}}function gv(t,e,n,o,r){let i=lo(),s=o&2;try{pr(-1),s&&e.length>sn&&hv(t,e,sn,!1);let a=s?Je.TemplateUpdateStart:Je.TemplateCreateStart;lt(a,r,n),n(o,r)}finally{pr(i);let a=s?Je.TemplateUpdateEnd:Je.TemplateCreateEnd;lt(a,r,n)}}function yv(t,e,n){bS(t,e,n),(n.flags&64)===64&&ES(t,e,n)}function Df(t,e,n=qn){let o=e.localNames;if(o!==null){let r=e.index+1;for(let i=0;i<o.length;i+=2){let s=o[i+1],a=s===-1?n(e,t):t[s];t[r++]=a}}}function mS(t,e,n,o){let i=o.get(Gy,zy)||n===fo.ShadowDom||n===fo.ExperimentalIsolatedShadowDom,s=t.selectRootElement(e,i);return hS(s),s}function hS(t){gS(t)}var gS=()=>null;function yS(t){return t==="class"?"className":t==="for"?"htmlFor":t==="formaction"?"formAction":t==="innerHtml"?"innerHTML":t==="readonly"?"readOnly":t==="tabindex"?"tabIndex":t}function vS(t,e,n,o,r,i){let s=e[ce];if(kf(t,s,e,n,o)){ur(t)&&_S(e,t.index);return}t.type&3&&(n=yS(n)),vv(t,e,n,o,r,i)}function vv(t,e,n,o,r,i){if(t.type&3){let s=qn(t,e);o=i!=null?i(o,t.value||"",n):o,r.setProperty(s,n,o)}else t.type&12}function _S(t,e){let n=Co(e,t);n[fe]&16||(n[fe]|=64)}function bS(t,e,n){let o=n.directiveStart,r=n.directiveEnd;ur(n)&&fS(e,n,t.data[o+n.componentOffset]),t.firstCreatePass||ky(n,e);let i=n.initialInputs;for(let s=o;s<r;s++){let a=t.data[s],c=cl(e,t,s,n);if(Wi(c,e),i!==null&&TS(e,s-o,c,a,n,i),Kr(a)){let l=Co(n.index,e);l[kt]=cl(e,t,s,n)}}}function ES(t,e,n){let o=n.directiveStart,r=n.directiveEnd,i=n.index,s=wg();try{pr(i);for(let a=o;a<r;a++){let c=t.data[a],l=e[a];Bc(a),(c.hostBindings!==null||c.hostVars!==0||c.hostAttrs!==null)&&xS(c,l)}}finally{pr(-1),Bc(s)}}function xS(t,e){t.hostBindings!==null&&t.hostBindings(1,e)}function CS(t,e){let n=t.directiveRegistry,o=null;if(n)for(let r=0;r<n.length;r++){let i=n[r];Vw(e,i.selectors,!1)&&(o??=[],Kr(i)?o.unshift(i):o.push(i))}return o}function wS(t,e,n,o,r,i){let s=qn(t,e);SS(e[wt],s,i,t.value,n,o,r)}function SS(t,e,n,o,r,i,s){if(i==null)s?.(i,o||"",r),t.removeAttribute(e,r,n);else{let a=s==null?zr(i):s(i,o||"",r);t.setAttribute(e,r,a,n)}}function TS(t,e,n,o,r,i){let s=i[e];if(s!==null)for(let a=0;a<s.length;a+=2){let c=s[a],l=s[a+1];Vp(o,n,c,l)}}function _v(t,e,n,o,r){let i=sn+n,s=e[ce],a=r(s,e,t,o,n);e[i]=a,Hi(t,!0);let c=t.type===2;return c?(rv(e[wt],a,t),(fg()===0||Pc(t))&&Wi(a,e),mg()):Wi(a,e),Wc()&&(!c||!uf(t))&&wf(s,e,a,t),t}function bv(t){let e=t;return ip()?vg():(e=e.parent,Hi(e,!1)),e}function MS(t,e){let n=t[Ho];if(!n)return;let o;try{o=n.get(ei,null)}catch{o=null}o?.(e)}function kf(t,e,n,o,r){let i=t.inputs?.[o],s=t.hostDirectiveInputs?.[o],a=!1;if(s)for(let c=0;c<s.length;c+=2){let l=s[c],d=s[c+1],u=e.data[l];Vp(u,n[l],d,r),a=!0}if(i)for(let c of i){let l=n[c],d=e.data[c];Vp(d,l,o,r),a=!0}return a}function IS(t,e){let n=Co(e,t),o=n[ce];DS(o,n);let r=n[ao];r!==null&&n[Fi]===null&&(n[Fi]=Wy(r,n[Ho])),lt(Je.ComponentStart);try{Nf(o,n,n[kt])}finally{lt(Je.ComponentEnd,n[kt])}}function DS(t,e){for(let n=e.length;n<t.blueprint.length;n++)e.push(t.blueprint[n])}function Nf(t,e,n){zc(e);try{let o=t.viewQuery;o!==null&&Tp(1,o,n);let r=t.template;r!==null&&gv(t,e,r,1,n),t.firstCreatePass&&(t.firstCreatePass=!1),e[xo]?.finishViewCreation(t),t.staticContentQueries&&qy(t,e),t.staticViewQueries&&Tp(2,t.viewQuery,n);let i=t.components;i!==null&&kS(e,i)}catch(o){throw t.firstCreatePass&&(t.incompleteFirstPass=!0,t.firstCreatePass=!1),o}finally{e[fe]&=-5,Gc()}}function kS(t,e){for(let n=0;n<e.length;n++)IS(t,e[n])}function Tl(t,e,n,o){let r=se(null);try{let i=e.tView,a=t[fe]&4096?4096:16,c=Mf(t,i,n,a,null,e,null,null,o?.injector??null,o?.embeddedViewInjector??null,o?.dehydratedView??null),l=t[e.index];c[lr]=l;let d=t[xo];return d!==null&&(c[xo]=d.createEmbeddedView(i)),Nf(i,c,n),c}finally{se(r)}}function Xs(t,e){return!e||e.firstChild===null||Fy(t)}function Js(t,e,n,o,r=!1){if(t.type===3){let i=t.firstChild,s=i.next,a=an(e[i.index]),c=an(e[s.index]),l=a;for(;l!==null&&(o.push(l),l!==c);)l=l.nextSibling;return o}for(;n!==null;){if(n.type===128){n=r?n.projectionNext:n.next;continue}let i=e[n.index];if(i!==null)if(Wn(i)){let a=i[Yr];a!==i[ao]&&o.push(an(i)),i[fe]&4||Ev(i,o),o.push(a)}else o.push(an(i));let s=n.type;if(s&8)Js(t,e,n.child,o);else if(s&32){let a=bf(n,e),c;for(;c=a();)o.push(c)}else if(s&16){let a=pv(e,n);if(Array.isArray(a))o.push(...a);else{let c=jo(e[Nn]);Js(c[ce],c,a,o,!0)}}n=r?n.projectionNext:n.next}return o}function Ev(t,e){for(let n=Nt;n<t.length;n++){let o=t[n],r=o[ce].firstChild;r!==null&&Js(o[ce],o,r,e)}}function xv(t){if(t[qr]!==null){for(let e of t[qr])e.impl.addSequence(e);t[qr].length=0}}var Cv=[];function NS(t){return t[On]??OS(t)}function OS(t){let e=Cv.pop()??Object.create(RS);return e.lView=t,e}function AS(t){t.lView[On]!==t&&(t.lView=null,Cv.push(t))}var RS=Q(V({},Nr),{consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:t=>{Xr(t.lView)},consumerOnSignalRead(){this.lView[On]=this}});function PS(t){let e=t[On]??Object.create(LS);return e.lView=t,e}var LS=Q(V({},Nr),{consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:t=>{let e=jo(t.lView);for(;e&&!wv(e[ce]);)e=jo(e);e&&Xu(e)},consumerOnSignalRead(){this.lView[On]=this}});function wv(t){return t.type!==2}function Sv(t){if(t[$o]===null)return;let e=!0;for(;e;){let n=!1;for(let o of t[$o])if(o.dirty&&(n=!0,o.zone===null||Zone.current===o.zone?o.run():o.zone.run(()=>o.run()),t[$o]===null))return;e=n&&!!(t[fe]&8192)}}var FS=100;function Tv(t,e=0){let o=t[co].rendererFactory,r=!1;r||o.begin?.();try{VS(t,e)}finally{r||o.end?.()}}function VS(t,e){let n=sp();try{Rs(!0),$p(t,e);let o=0;for(;Us(t);){if(o===FS)throw new be(103,!1);o++,$p(t,1)}}finally{Rs(n)}}function $S(t,e,n,o){if(Qr(e))return;let r=e[fe],i=!1,s=!1;zc(e);let a=!0,c=null,l=null;i||(wv(t)?(l=NS(e),c=Ar(l)):rc()===null?(a=!1,l=PS(e),c=Ar(l)):e[On]&&(Rr(e[On]),e[On]=null));try{Qu(e),Eg(t.bindingStartIndex),n!==null&&gv(t,e,n,2,o);let d=(r&3)===3;if(!i)if(d){let h=t.preOrderCheckHooks;h!==null&&tl(e,h,null)}else{let h=t.preOrderHooks;h!==null&&nl(e,h,0,null),gp(e,0)}if(s||jS(e),Sv(e),Mv(e,0),t.contentQueries!==null&&qy(t,e),!i)if(d){let h=t.contentCheckHooks;h!==null&&tl(e,h)}else{let h=t.contentHooks;h!==null&&nl(e,h,1),gp(e,1)}BS(t,e);let u=t.components;u!==null&&Dv(e,u,0);let m=t.viewQuery;if(m!==null&&Tp(2,m,o),!i)if(d){let h=t.viewCheckHooks;h!==null&&tl(e,h)}else{let h=t.viewHooks;h!==null&&nl(e,h,2),gp(e,2)}if(t.firstUpdatePass===!0&&(t.firstUpdatePass=!1),e[Rc]){for(let h of e[Rc])h();e[Rc]=null}i||(xv(e),e[fe]&=-73)}catch(d){let u=!1,m=d,h=e;for(;h!==null;){if(Wn(h)){h=h[Pt];continue}let y=h[Hs];if(y)try{let E=e[Nn][kt],M=E?.constructor,W={declarationInstance:E,declarationType:M,caughtBy:y};y(Fg(m),W),u=!0;break}catch(E){m=E}h=h[Pt]}if(!u)throw i||Xr(e),m}finally{l!==null&&(Si(l,c),a&&AS(l)),Gc()}}function Mv(t,e){for(let n=$y(t);n!==null;n=jy(n))for(let o=Nt;o<n.length;o++){let r=n[o];Iv(r,e)}}function jS(t){for(let e=$y(t);e!==null;e=jy(e)){if(!(e[fe]&2))continue;let n=e[Zr];for(let o=0;o<n.length;o++){let r=n[o];Xu(r)}}}function HS(t,e,n){lt(Je.ComponentStart);let o=Co(e,t);try{Iv(o,n)}finally{lt(Je.ComponentEnd,o[kt])}}function Iv(t,e){Vc(t)&&$p(t,e)}function $p(t,e){let o=t[ce],r=t[fe],i=t[On],s=!!(e===0&&r&16);if(s||=!!(r&64&&e===0),s||=!!(r&1024),s||=!!(i?.dirty&&Ms(i)),s||=!1,i&&(i.dirty=!1),t[fe]&=-9217,s)$S(o,t,o.template,t[kt]);else if(r&8192){let a=se(null);try{Sv(t),Mv(t,1);let c=o.components;c!==null&&Dv(t,c,1),xv(t)}finally{se(a)}}}function Dv(t,e,n){for(let o=0;o<e.length;o++)HS(t,e[o],n)}function BS(t,e){let n=t.hostBindingOpCodes;if(n!==null)try{for(let o=0;o<n.length;o++){let r=n[o];if(r<0)pr(~r);else{let i=r,s=n[++o],a=n[++o];Cg(s,i);let c=e[i];lt(Je.HostBindingsUpdateStart,c);try{a(2,c)}finally{lt(Je.HostBindingsUpdateEnd,c)}}}}finally{pr(-1)}}function Of(t,e){let n=sp()?64:1088;for(t[co].changeDetectionScheduler?.notify(e);t;){t[fe]|=n;let o=jo(t);if(ji(t)&&!o)return t;t=o}return null}function kv(t,e,n,o){return[t,!0,0,e,null,o,null,n,null,null]}function Nv(t,e){let n=Nt+e;if(n<t.length)return t[n]}function Ml(t,e,n,o=!0){let r=e[ce];if(US(r,e,t,n),o){let s=Fp(n,t),a=e[wt],c=a.parentNode(t[Yr]);c!==null&&Xw(r,t[xn],a,e,c,s)}let i=e[Fi];i!==null&&i.firstChild!==null&&(i.firstChild=null)}function Ov(t,e){let n=ea(t,e);return n!==void 0&&Cl(n[ce],n),n}function ea(t,e){if(t.length<=Nt)return;let n=Nt+e,o=t[n];if(o){let r=o[lr];r!==null&&r!==t&&Cf(r,o),e>0&&(t[n-1][Gn]=o[Gn]);let i=Fs(t,Nt+e);Qw(o[ce],o);let s=i[xo];s!==null&&s.detachView(i[ce]),o[Pt]=null,o[Gn]=null,o[fe]&=-129}return o}function US(t,e,n,o){let r=Nt+o,i=n.length;o>0&&(n[r-1][Gn]=e),o<i-Nt?(e[Gn]=n[r],Bu(n,Nt+o,e)):(n.push(e),e[Gn]=null),e[Pt]=n;let s=e[lr];s!==null&&n!==s&&Av(s,e);let a=e[xo];a!==null&&a.insertView(t),$c(e),e[fe]|=128}function Av(t,e){let n=t[Zr],o=e[Pt];if(dr(o))t[fe]|=2;else{let r=o[Pt][Nn];e[Nn]!==r&&(t[fe]|=2)}n===null?t[Zr]=[e]:n.push(e)}var qi=class{_lView;_cdRefInjectingView;_appRef=null;_attachedToViewContainer=!1;exhaustive;get rootNodes(){let e=this._lView,n=e[ce];return Js(n,e,n.firstChild,[])}constructor(e,n){this._lView=e,this._cdRefInjectingView=n}get context(){return this._lView[kt]}set context(e){this._lView[kt]=e}get destroyed(){return Qr(this._lView)}destroy(){if(this._appRef)this._appRef.detachView(this);else if(this._attachedToViewContainer){let e=this._lView[Pt];if(Wn(e)){let n=e[Bs],o=n?n.indexOf(this):-1;o>-1&&(ea(e,o),Fs(n,o))}this._attachedToViewContainer=!1}Cl(this._lView[ce],this._lView)}onDestroy(e){jc(this._lView,e)}markForCheck(){Of(this._cdRefInjectingView||this._lView,4)}detach(){this._lView[fe]&=-129}reattach(){$c(this._lView),this._lView[fe]|=128}detectChanges(){this._lView[fe]|=1024,Tv(this._lView)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new be(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null;let e=ji(this._lView),n=this._lView[lr];n!==null&&!e&&Cf(n,this._lView),uv(this._lView[ce],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new be(902,!1);this._appRef=e;let n=ji(this._lView),o=this._lView[lr];o!==null&&!n&&Av(o,this._lView),$c(this._lView)}};var ta=(()=>{class t{_declarationLView;_declarationTContainer;elementRef;static __NG_ELEMENT_ID__=zS;constructor(n,o,r){this._declarationLView=n,this._declarationTContainer=o,this.elementRef=r}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(n,o){return this.createEmbeddedViewImpl(n,o)}createEmbeddedViewImpl(n,o,r){let i=Tl(this._declarationLView,this._declarationTContainer,n,{embeddedViewInjector:o,dehydratedView:r});return new qi(i)}}return t})();function zS(){return Af(Yn(),je())}function Af(t,e){return t.type&4?new ta(e,t,Ki(t,e)):null}function Il(t,e,n,o,r){let i=t.data[e];if(i===null)i=GS(t,e,n,o,r),xg()&&(i.flags|=32);else if(i.type&64){i.type=n,i.value=o,i.attrs=r;let s=yg();i.injectorIndex=s===null?-1:s.injectorIndex}return Hi(i,!0),i}function GS(t,e,n,o,r){let i=rp(),s=ip(),a=s?i:i&&i.parent,c=t.data[e]=qS(t,a,n,e,o,r);return WS(t,c,i,s),c}function WS(t,e,n,o){t.firstChild===null&&(t.firstChild=e),n!==null&&(o?n.child==null&&e.parent!==null&&(n.child=e):n.next===null&&(n.next=e,e.prev=n))}function qS(t,e,n,o,r,i){let s=e?e.injectorIndex:-1,a=0;return gg()&&(a|=128),{type:n,index:o,insertBeforeIndex:null,injectorIndex:s,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,controlDirectiveIndex:-1,customControlIndex:-1,propertyBindings:null,flags:a,providerIndexes:0,value:r,namespace:lp(),attrs:i,mergedAttrs:null,localNames:null,initialInputs:null,inputs:null,hostDirectiveInputs:null,outputs:null,hostDirectiveOutputs:null,directiveToIndex:null,tView:null,next:null,prev:null,projectionNext:null,child:null,parent:e,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}function YS(t){let e=t[Yu]??[],o=t[Pt][wt],r=[];for(let i of e)i.data[Uy]!==void 0?r.push(i):ZS(i,o);t[Yu]=r}function ZS(t,e){let n=0,o=t.firstChild;if(o){let r=t.data[By];for(;n<r;){let i=o.nextSibling;ov(e,o,!1),o=i,n++}}}var KS=()=>null,QS=()=>null;function jp(t,e){return KS(t,e)}function Rv(t,e,n){return QS(t,e,n)}var Pv=class{},Go=class{};var Lv=(()=>{class t{static \u0275prov=Pe({token:t,providedIn:"root",factory:()=>null})}return t})();function Fv(t){return t.debugInfo?.className||t.type.name||null}var rl={},ul=class{injector;parentInjector;constructor(e,n){this.injector=e,this.parentInjector=n}get(e,n,o){let r=this.injector.get(e,rl,o);return r!==rl||n===rl?r:this.parentInjector.get(e,n,o)}};function XS(t,e,n){return t[e]=n}function JS(t,e){return t[e]}function Mo(t,e,n){if(n===Cn)return!1;let o=t[e];return Object.is(o,n)?!1:(t[e]=n,!0)}function eT(t,e,n,o){let r=Mo(t,e,n);return Mo(t,e+1,o)||r}function il(t,e,n){return function o(r){let i=o.__ngNativeEl__;i!==void 0&&ow(r,i);let s=ur(t)?Co(t.index,e):e;Of(s,5);let a=e[kt],c=cy(e,a,n,r),l=o.__ngNextListenerFn__;for(;l;)c=cy(e,a,l,r)&&c,l=l.__ngNextListenerFn__;return c}}function cy(t,e,n,o){let r=se(null);try{return lt(Je.OutputStart,e,n),n(o)!==!1}catch(i){return MS(t,i),!1}finally{lt(Je.OutputEnd,e,n),se(r)}}function Vv(t,e,n,o,r,i,s,a){let c=Pc(t),l=!1,d=null;if(!o&&c&&(d=nT(e,n,i,t.index)),d!==null){let u=d.__ngLastListenerFn__||d;u.__ngNextListenerFn__=s,d.__ngLastListenerFn__=s,l=!0}else{let u=qn(t,n),m=o?o(u):u;iw(n,m,i,a),o||(a.__ngNativeEl__=u);let h=r.listen(m,i,a);if(!tT(i)){let y=o?E=>o(an(E[t.index])):t.index;$v(y,e,n,i,a,h,!1)}}return l}function tT(t){return t.startsWith("animation")||t.startsWith("transition")}function nT(t,e,n,o){let r=t.cleanup;if(r!=null)for(let i=0;i<r.length-1;i+=2){let s=r[i];if(s===n&&r[i+1]===o){let a=e[Vi],c=r[i+2];return a&&a.length>c?a[c]:null}typeof s=="string"&&(i+=2)}return null}function $v(t,e,n,o,r,i,s){let a=e.firstCreatePass?ep(e):null,c=Ju(n),l=c.length;c.push(r,i),a&&a.push(o,t,l,(l+1)*(s?-1:1))}function ly(t,e,n,o,r,i){let s=e[n],a=e[ce],l=a.data[n].outputs[o],u=s[l].subscribe(i);$v(t.index,a,e,r,i,u,!0)}var Hp=Symbol("BINDING");var ri=new $e("");function pl(t,e,n){let o=n?t.styles:null,r=n?t.classes:null,i=0;if(e!==null)for(let s=0;s<e.length;s++){let a=e[s];if(typeof a=="number")i=a;else if(i==1)r=xc(r,a);else if(i==2){let c=a,l=e[++s];o=xc(o,c+": "+l+";")}}n?t.styles=o:t.stylesWithoutHost=o,n?t.classes=r:t.classesWithoutHost=r}function jv(t,e=0){let n=je();if(n===null)return it(t,e);let o=Yn();return Ry(o,n,kn(t),e)}function oT(t,e,n,o,r){let i=o===null?null:{"":-1},s=r(t,n);if(s!==null){let a=s,c=null,l=null;for(let d of s)if(d.resolveHostDirectives!==null){[a,c,l]=d.resolveHostDirectives(s);break}sT(t,e,n,a,i,c,l)}i!==null&&o!==null&&rT(n,o,i)}function rT(t,e,n){let o=t.localNames=[];for(let r=0;r<e.length;r+=2){let i=n[e[r+1]];if(i==null)throw new be(-301,!1);o.push(e[r],i)}}function iT(t,e,n){e.componentOffset=n,(t.components??=[]).push(e.index)}function sT(t,e,n,o,r,i,s){let a=o.length,c=null;for(let m=0;m<a;m++){let h=o[m];c===null&&Kr(h)&&(c=h,iT(t,n,m)),WC(ky(n,e),t,h.type)}pT(n,t.data.length,a),c?.viewProvidersResolver&&c.viewProvidersResolver(c);for(let m=0;m<a;m++){let h=o[m];h.providersResolver&&h.providersResolver(h)}let l=!1,d=!1,u=mv(t,e,a,null);a>0&&(n.directiveToIndex=new Map);for(let m=0;m<a;m++){let h=o[m];if(n.mergedAttrs=_l(n.mergedAttrs,h.hostAttrs),cT(t,n,e,u,h),uT(u,h,r),s!==null&&s.has(h)){let[E,M]=s.get(h);n.directiveToIndex.set(h.type,[u,E+n.directiveStart,M+n.directiveStart])}else(i===null||!i.has(h))&&n.directiveToIndex.set(h.type,u);h.contentQueries!==null&&(n.flags|=4),(h.hostBindings!==null||h.hostAttrs!==null||h.hostVars!==0)&&(n.flags|=64);let y=h.type.prototype;!l&&(y.ngOnChanges||y.ngOnInit||y.ngDoCheck)&&((t.preOrderHooks??=[]).push(n.index),l=!0),!d&&(y.ngOnChanges||y.ngDoCheck)&&((t.preOrderCheckHooks??=[]).push(n.index),d=!0),u++}aT(t,n,i)}function aT(t,e,n){for(let o=e.directiveStart;o<e.directiveEnd;o++){let r=t.data[o];if(n===null||!n.has(r))dy(0,e,r,o),dy(1,e,r,o),py(e,o,!1);else{let i=n.get(r);uy(0,e,i,o),uy(1,e,i,o),py(e,o,!0)}}}function dy(t,e,n,o){let r=t===0?n.inputs:n.outputs;for(let i in r)if(Object.hasOwn(r,i)){let s;t===0?s=e.inputs??={}:s=e.outputs??={},s[i]??=[],s[i].push(o),Hv(e,i)}}function uy(t,e,n,o){let r=t===0?n.inputs:n.outputs;for(let i in r)if(Object.hasOwn(r,i)){let s=r[i],a;t===0?a=e.hostDirectiveInputs??={}:a=e.hostDirectiveOutputs??={},a[s]??=[],a[s].push(o,i),Hv(e,s)}}function Hv(t,e){e==="class"?t.flags|=8:e==="style"&&(t.flags|=16)}function py(t,e,n){let{attrs:o,inputs:r,hostDirectiveInputs:i}=t;if(o===null||!n&&r===null||n&&i===null||_f(t)){t.initialInputs??=[],t.initialInputs.push(null);return}let s=null,a=0;for(;a<o.length;){let c=o[a];if(c===0){a+=4;continue}else if(c===5){a+=2;continue}else if(typeof c=="number")break;if(!n&&Object.hasOwn(r,c)){let l=r[c];for(let d of l)if(d===e){s??=[],s.push(c,o[a+1]);break}}else if(n&&Object.hasOwn(i,c)){let l=i[c];for(let d=0;d<l.length;d+=2)if(l[d]===e){s??=[],s.push(l[d+1],o[a+1]);break}}a+=2}t.initialInputs??=[],t.initialInputs.push(s)}function cT(t,e,n,o,r){t.data[o]=r;let i=r.factory||(r.factory=Oi(r.type,!0)),s=new Qs(i,Kr(r),jv,null);t.blueprint[o]=s,n[o]=s,lT(t,e,o,mv(t,n,r.hostVars,Cn),r)}function lT(t,e,n,o,r){let i=r.hostBindings;if(i){let s=t.hostBindingOpCodes;s===null&&(s=t.hostBindingOpCodes=[]);let a=~e.index;dT(s)!=a&&s.push(a),s.push(n,o,i)}}function dT(t){let e=t.length;for(;e>0;){let n=t[--e];if(typeof n=="number"&&n<0)return n}return 0}function uT(t,e,n){if(n){if(e.exportAs)for(let o=0;o<e.exportAs.length;o++)n[e.exportAs[o]]=t;Kr(e)&&(n[""]=t)}}function pT(t,e,n){t.flags|=1,t.directiveStart=e,t.directiveEnd=e+n,t.providerIndexes=e}function Bv(t,e,n,o,r,i,s,a){let c=e[ce],l=c.consts,d=wo(l,s),u=Il(c,t,n,o,d);return i&&oT(c,e,u,wo(l,a),r),u.mergedAttrs=_l(u.mergedAttrs,u.attrs),u.attrs!==null&&pl(u,u.attrs,!1),u.mergedAttrs!==null&&pl(u,u.mergedAttrs,!0),c.queries!==null&&c.queries.elementStart(c,u),u}function Uv(t,e){PC(t,e),Zu(e)&&t.queries.elementEnd(e)}function fT(t,e,n,o,r,i){let s=e.consts,a=wo(s,r),c=Il(e,t,n,o,a);if(c.mergedAttrs=_l(c.mergedAttrs,c.attrs),i!=null){let l=wo(s,i);c.localNames=[];for(let d=0;d<l.length;d+=2)c.localNames.push(l[d],-1)}return c.attrs!==null&&pl(c,c.attrs,!1),c.mergedAttrs!==null&&pl(c,c.mergedAttrs,!0),e.queries!==null&&e.queries.elementStart(e,c),c}var zv=typeof ShadowRoot<"u",mT=typeof Document<"u";function hT(t){return Object.keys(t).map(e=>{let[n,o,r]=t[e],i={propName:n,templateName:e,isSignal:(o&Sl.SignalBased)!==0};return r&&(i.transform=r),i})}function gT(t){return Object.keys(t).map(e=>({propName:t[e],templateName:e}))}function yT(t,e,n){let o=e instanceof so?e:e?.injector;return o&&t.getStandaloneInjector!==null&&(o=t.getStandaloneInjector(o)||o),o?new ul(n,o):n}function vT(t){let e=t.get(Go,null);if(e===null)throw new be(407,!1);let n=t.get(Lv,null),o=t.get(sr,null),r=t.get(Yo,null,{optional:!0});return{rendererFactory:e,sanitizer:n,changeDetectionScheduler:o,ngReflect:!1,tracingService:r}}function _T(t,e,n){let o=Gv(t);return tv(e,o,o==="svg"?Hr:o==="math"?Lc:n)}function bT(t){if((t&&"localName"in t&&typeof t.localName=="string"?t.localName:t?.tagName)?.toLowerCase()==="script")throw new be(905,!1)}function Gv(t){return(t.selectors[0][0]||"div").toLowerCase()}var na=class{componentDef;ngModule;selector;componentType;ngContentSelectors;isBoundToModule;cachedInputs=null;cachedOutputs=null;get inputs(){return this.cachedInputs??=hT(this.componentDef.inputs),this.cachedInputs}get outputs(){return this.cachedOutputs??=gT(this.componentDef.outputs),this.cachedOutputs}constructor(e,n){this.componentDef=e,this.ngModule=n,this.componentType=e.type,this.selector=Bw(e.selectors),this.ngContentSelectors=e.ngContentSelectors??[],this.isBoundToModule=!!n}create(e,n,o,r,i,s,a,c){lt(Je.DynamicComponentStart);let l=se(null);try{let d=this.componentDef,u=yT(d,r||this.ngModule,e),m=vT(u),h=m.tracingService;return h&&h.componentCreate?h.componentCreate(Fv(d),()=>this.createComponentRef(m,u,n,o,i,s,a,c)):this.createComponentRef(m,u,n,o,i,s,a,c)}finally{se(l)}}createComponentRef(e,n,o,r,i,s,a,c){let l=this.componentDef,d=ET(r,l,s,i,c),u=e.rendererFactory.createRenderer(null,l),m=r?mS(u,r,l.encapsulation,n):_T(l,u,a??null);bT(m);let h=n.get(ri,null),y=xT(m,()=>n.get(_n,null)??df());h&&h.addHost(y);let E=s?.some(fy)||i?.some(z=>typeof z!="function"&&z.bindings.some(fy)),M=Mf(null,d,null,512|fv(l),null,null,e,u,n,null,Wy(m,n,!0));h&&zv&&y instanceof ShadowRoot&&jc(M,()=>{h.removeHost(y)}),M[sn]=m,zc(M);let W=null;try{let z=Bv(sn,M,2,"#host",()=>d.directiveRegistry,!0,0);rv(u,m,z),Wi(m,M),yv(d,M,z),Yy(d,z,M),Uv(d,z),o!==void 0&&wT(z,this.ngContentSelectors,o),W=Co(z.index,M),M[kt]=W[kt],Nf(d,M,null)}catch(z){throw W!==null&&wp(W),wp(M),z}finally{lt(Je.DynamicComponentEnd),Gc()}return new fl(this.componentType,M,!!E)}};function ET(t,e,n,o,r){let i=t?["ng-version","22.2.1"]:Uw(e.selectors[0]),s=null,a=null,c=0;if(n)for(let u of n)c+=u[Hp].requiredVars,u.create&&(u.targetIdx=0,(s??=[]).push(u)),u.update&&(u.targetIdx=0,(a??=[]).push(u));if(o)for(let u=0;u<o.length;u++){let m=o[u];if(typeof m!="function")for(let h of m.bindings){c+=h[Hp].requiredVars;let y=u+1;h.create&&(h.targetIdx=y,(s??=[]).push(h)),h.update&&(h.targetIdx=y,(a??=[]).push(h))}}let l=[e];if(o)for(let u of o){let m=typeof u=="function"?u:u.type,h=Tc(m);l.push(h)}return Tf(0,null,CT(s,a),1,c,l,null,null,null,[i],null)}function xT(t,e){let n=t.getRootNode?.();return mT&&n instanceof Document?n.head:n&&zv&&n instanceof ShadowRoot?n:e().head}function CT(t,e){return!t&&!e?null:n=>{if(n&1&&t)for(let o of t)o.create();if(n&2&&e)for(let o of e)o.update()}}function fy(t){let e=t[Hp].kind;return e==="input"||e==="twoWay"}var fl=class extends Pv{_rootLView;_hasInputBindings;instance;hostView;changeDetectorRef;componentType;location;previousInputValues=null;_tNode;constructor(e,n,o){super(),this._rootLView=n,this._hasInputBindings=o,this._tNode=Fc(n[ce],sn),this.location=Ki(this._tNode,n),this.instance=Co(this._tNode.index,n)[kt],this.hostView=this.changeDetectorRef=new qi(n,void 0),this.componentType=e}setInput(e,n){this._hasInputBindings;let o=this._tNode;if(this.previousInputValues??=new Map,this.previousInputValues.has(e)&&Object.is(this.previousInputValues.get(e),n))return;let r=this._rootLView,i=kf(o,r[ce],r,e,n);this.previousInputValues.set(e,n);let s=Co(o.index,r);Of(s,1)}get injector(){return new Bo(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}};function wT(t,e,n){let o=t.projection=[];for(let r=0;r<e.length;r++){let i=n[r];o.push(i!=null&&i.length?Array.from(i):null)}}var Dl=(()=>{class t{static __NG_ELEMENT_ID__=ST}return t})();function ST(){let t=Yn();return Wv(t,je())}var Bp=class t extends Dl{_lContainer;_hostTNode;_hostLView;constructor(e,n,o){super(),this._lContainer=e,this._hostTNode=n,this._hostLView=o}get element(){return Ki(this._hostTNode,this._hostLView)}get injector(){return new Bo(this._hostTNode,this._hostLView)}get parentInjector(){let e=af(this._hostTNode,this._hostLView);if(My(e)){let n=al(e,this._hostLView),o=sl(e),r=n[ce].data[o+8];return new Bo(r,n)}else return new Bo(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){let n=my(this._lContainer);return n!==null&&n[e]||null}get length(){return this._lContainer.length-Nt}createEmbeddedView(e,n,o){let r,i,s;typeof o=="number"?r=o:o!=null&&(r=o.index,i=o.injector,s=o.onError);let a=jp(this._lContainer,e.ssrId),c=e.createEmbeddedViewImpl(n||{},i,a);return s&&(c._lView[Hs]=s),this.insertImpl(c,r,Xs(this._hostTNode,a)),c}createComponent(e,n,o,r,i,s,a){let c,l,d=n||{};c=d.index,o=d.injector,r=d.projectableNodes,i=d.environmentInjector||d.ngModuleRef,s=d.directives,a=d.bindings,l=d.onError;let u=new na(Ur(e)),m=o||this.parentInjector;if(!i&&u.ngModule==null){let z=this.parentInjector.get(so,null);z&&(i=z)}let h=Ur(u.componentType??{}),y=jp(this._lContainer,h?.id??null),E=y?.firstChild??null,M=u.create(m,r,E,i,s,a,this._getHostElementNamespace());return l&&(M.hostView._lView[Hs]=l),this.insertImpl(M.hostView,c,Xs(this._hostTNode,y)),M}_getHostElementNamespace(){if(this._hostTNode.type&2){let e=this._hostTNode.parent??this._hostLView[xn];return e!==null&&e.type&2&&typeof e.value=="string"&&e.value.toLowerCase()==="foreignobject"?null:e?.namespace??null}return this._hostTNode.namespace}insert(e,n){return this.insertImpl(e,n,!0)}insertImpl(e,n,o){let r=e._lView;if(lg(r)){let a=this.indexOf(e);if(a!==-1)this.detach(a);else{let c=r[Pt],l=new t(c,c[xn],c[Pt]);l.detach(l.indexOf(e))}}let i=this._adjustIndex(n),s=this._lContainer;return Ml(s,r,i,o),e.attachToViewContainerRef(),Bu(_p(s),i,e),e}move(e,n){return this.insert(e,n)}indexOf(e){let n=my(this._lContainer);return n!==null?n.indexOf(e):-1}remove(e){let n=this._adjustIndex(e,-1),o=ea(this._lContainer,n);o&&(Fs(_p(this._lContainer),n),Cl(o[ce],o))}detach(e){let n=this._adjustIndex(e,-1),o=ea(this._lContainer,n);return o&&Fs(_p(this._lContainer),n)!=null?new qi(o):null}_adjustIndex(e,n=0){return e??this.length+n}};function my(t){return t[Bs]}function _p(t){return t[Bs]||(t[Bs]=[])}function Wv(t,e){let n,o=e[t.index];return Wn(o)?n=o:(n=kv(o,e,null,t),e[t.index]=n,If(e,n)),MT(n,e,t,o),new Bp(n,t,e)}function TT(t,e){let n=t[wt],o=n.createComment(""),r=qn(e,t),i=n.parentNode(r);return ti(n,i,o,n.nextSibling(r),!1),o}var MT=kT,IT=()=>!1;function DT(t,e,n){return IT(t,e,n)}function kT(t,e,n,o){if(t[Yr])return;let r;n.type&8?r=an(o):r=TT(e,n),t[Yr]=r}var Up=class t{queryList;matches=null;constructor(e){this.queryList=e}clone(){return new t(this.queryList)}setDirty(){this.queryList.setDirty()}},zp=class t{queries;constructor(e=[]){this.queries=e}createEmbeddedView(e){let n=e.queries;if(n!==null){let o=e.contentQueries!==null?e.contentQueries[0]:n.length,r=[];for(let i=0;i<o;i++){let s=n.getByIndex(i),a=this.queries[s.indexInDeclarationView];r.push(a.clone())}return new t(r)}return null}insertView(e){this.dirtyQueriesWithMatches(e)}detachView(e){this.dirtyQueriesWithMatches(e)}finishViewCreation(e){this.dirtyQueriesWithMatches(e)}dirtyQueriesWithMatches(e){for(let n=0;n<this.queries.length;n++)Zv(e,n).matches!==null&&this.queries[n].setDirty()}},Gp=class{flags;read;predicate;constructor(e,n,o=null){this.flags=n,this.read=o,typeof e=="string"?this.predicate=FT(e):this.predicate=e}},Wp=class t{queries;constructor(e=[]){this.queries=e}elementStart(e,n){for(let o=0;o<this.queries.length;o++)this.queries[o].elementStart(e,n)}elementEnd(e){for(let n=0;n<this.queries.length;n++)this.queries[n].elementEnd(e)}embeddedTView(e){let n=null;for(let o=0;o<this.length;o++){let r=n!==null?n.length:0,i=this.getByIndex(o).embeddedTView(e,r);i&&(i.indexInDeclarationView=o,n!==null?n.push(i):n=[i])}return n!==null?new t(n):null}template(e,n){for(let o=0;o<this.queries.length;o++)this.queries[o].template(e,n)}getByIndex(e){return this.queries[e]}get length(){return this.queries.length}track(e){this.queries.push(e)}},qp=class t{metadata;matches=null;indexInDeclarationView=-1;crossesNgTemplate=!1;_declarationNodeIndex;_appliesToNextNode=!0;constructor(e,n=-1){this.metadata=e,this._declarationNodeIndex=n}elementStart(e,n){this.isApplyingToNode(n)&&this.matchTNode(e,n)}elementEnd(e){this._declarationNodeIndex===e.index&&(this._appliesToNextNode=!1)}template(e,n){this.elementStart(e,n)}embeddedTView(e,n){return this.isApplyingToNode(e)?(this.crossesNgTemplate=!0,this.addMatch(-e.index,n),new t(this.metadata)):null}isApplyingToNode(e){if(this._appliesToNextNode&&(this.metadata.flags&1)!==1){let n=this._declarationNodeIndex,o=e.parent;for(;o!==null&&o.type&8&&o.index!==n;)o=o.parent;return n===(o!==null?o.index:-1)}return this._appliesToNextNode}matchTNode(e,n){let o=this.metadata.predicate;if(Array.isArray(o))for(let r=0;r<o.length;r++){let i=o[r];this.matchTNodeWithReadOption(e,n,NT(n,i)),this.matchTNodeWithReadOption(e,n,ol(n,e,i,!1,!1))}else o===ta?n.type&4&&this.matchTNodeWithReadOption(e,n,-1):this.matchTNodeWithReadOption(e,n,ol(n,e,o,!1,!1))}matchTNodeWithReadOption(e,n,o){if(o!==null){let r=this.metadata.read;if(r!==null)if(r===Gt||r===Dl||r===Un||r===ta&&n.type&4)this.addMatch(n.index,-2);else{let i=ol(n,e,r,!1,!1);i!==null&&this.addMatch(n.index,i)}else this.addMatch(n.index,o)}}addMatch(e,n){this.matches===null?this.matches=[e,n]:this.matches.push(e,n)}};function NT(t,e){let n=t.localNames;if(n!==null){for(let o=0;o<n.length;o+=2)if(n[o]===e)return n[o+1]}return null}function OT(t,e){return t.type&11?Ki(t,e):t.type&4?Af(t,e):null}function AT(t,e,n,o){return n===-1?OT(e,t):n===-2?RT(t,e,o):cl(t,t[ce],n,e)}function RT(t,e,n){if(n===Gt)return Ki(e,t);if(n===ta)return Af(e,t);if(n===Dl)return Wv(e,t);if(n===Un)return new Bo(e,t)}function qv(t,e,n,o){let r=e[xo].queries[o];if(r.matches===null){let i=t.data,s=n.matches,a=[];for(let c=0;s!==null&&c<s.length;c+=2){let l=s[c];if(l<0)a.push(null);else{let d=i[l];a.push(AT(e,d,s[c+1],n.metadata.read))}}r.matches=a}return r.matches}function Yp(t,e,n,o){let r=t.queries.getByIndex(n),i=r.matches;if(i!==null){let s=qv(t,e,r,n);for(let a=0;a<i.length;a+=2){let c=i[a];if(c>0)o.push(s[a/2]);else{let l=i[a+1],d=e[-c];for(let u=Nt;u<d.length;u++){let m=d[u];m[lr]===m[Pt]&&Yp(m[ce],m,l,o)}if(d[Zr]!==null){let u=d[Zr];for(let m=0;m<u.length;m++){let h=u[m];Yp(h[ce],h,l,o)}}}}}return o}function Yv(t,e){return t[xo].queries[e].queryList}function PT(t,e,n){let o=new ll((n&4)===4);return pg(t,e,o,o.destroy),(e[xo]??=new zp).queries.push(new Up(o))-1}function LT(t,e,n){let o=yn();return o.firstCreatePass&&(VT(o,new Gp(t,e,n),-1),(e&2)===2&&(o.staticViewQueries=!0)),PT(o,je(),e)}function FT(t){return t.split(",").map(e=>e.trim())}function VT(t,e,n){t.queries===null&&(t.queries=new Wp),t.queries.track(new qp(e,n))}function Zv(t,e){return t.queries.getByIndex(e)}function $T(t,e){let n=t[ce],o=Zv(n,e);return o.crossesNgTemplate?Yp(n,t,e,[]):qv(n,t,o,e)}function Rf(t,e,n){let o,r=Is(()=>{o._dirtyCounter();let i=HT(o,t);if(e&&i===void 0)throw new be(-951,!1);return i});return o=r[rn],o._dirtyCounter=H(0),o._flatValue=void 0,r}function Kv(t){return Rf(!0,!1,t)}function Qv(t){return Rf(!0,!0,t)}function Xv(t){return Rf(!1,!1,t)}function jT(t,e){let n=t[rn];n._lView=je(),n._queryIndex=e,n._queryList=Yv(n._lView,e),n._queryList.onDirty(()=>n._dirtyCounter.update(o=>o+1))}function HT(t,e){let n=t._lView,o=t._queryIndex;if(n===void 0||o===void 0||n[fe]&4)return e?void 0:io;let r=Yv(n,o),i=$T(n,o);return r.reset(i,XC),e?r.first:r._changesDetected||t._flatValue===void 0?t._flatValue=r.toArray():t._flatValue}function Pf(t){return!!t&&typeof t.then=="function"}function Jv(t){return!!t&&typeof t.subscribe=="function"}var ml=class{};var oa=class extends ml{injector;instance=null;constructor(e){super();let n=new jr([...e.providers,{provide:ml,useValue:this}],e.parent||$s(),e.debugName,new Set(["environment"]));this.injector=n,e.runEnvironmentInitializers&&n.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(e){this.injector.onDestroy(e)}};function e_(t,e,n=null){return new oa({providers:t,parent:e,debugName:n,runEnvironmentInitializers:!0}).injector}var BT=(()=>{class t{_injector;cachedInjectors=new Map;constructor(n){this._injector=n}getOrCreateStandaloneInjector(n){if(!n.standalone)return null;if(!this.cachedInjectors.has(n)){let o=zu(!1,n.type),r=o.length>0?e_([o],this._injector,""):null;this.cachedInjectors.set(n,r)}return this.cachedInjectors.get(n)}ngOnDestroy(){try{for(let n of this.cachedInjectors.values())n!==null&&n.destroy()}finally{this.cachedInjectors.clear()}}static \u0275prov=Pe({token:t,providedIn:"environment",factory:()=>new t(it(so))})}return t})();function Le(t){return sf(()=>{let e=t_(t),n=Q(V({},e),{decls:t.decls,vars:t.vars,template:t.template,consts:t.consts||null,ngContentSelectors:t.ngContentSelectors,onPush:t.changeDetection!==cf.Eager,directiveDefs:null,pipeDefs:null,dependencies:e.standalone&&t.dependencies||null,getStandaloneInjector:e.standalone?r=>r.get(BT).getOrCreateStandaloneInjector(n):null,getExternalStyles:null,signals:t.signals??!1,data:t.data||{},encapsulation:t.encapsulation||fo.Emulated,styles:t.styles||io,_:null,schemas:t.schemas||null,tView:null,id:""});e.standalone&&oi("NgStandalone"),n_(n);let o=t.dependencies;return n.directiveDefs=hy(o,UT),n.pipeDefs=hy(o,qh),n.id=WT(n),n})}function UT(t){return Ur(t)||Tc(t)}function zT(t,e){if(t==null)return Nc;let n={};for(let o in t)if(Object.hasOwn(t,o)){let r=t[o],i,s,a,c;Array.isArray(r)?(a=r[0],i=r[1],s=r[2]??i,c=r[3]||null):(i=r,s=r,a=Sl.None,c=null),n[i]=[o,a,c],e[i]=s}return n}function GT(t){if(t==null)return Nc;let e={};for(let n in t)Object.hasOwn(t,n)&&(e[t[n]]=n);return e}function ca(t){return sf(()=>{let e=t_(t);return n_(e),e})}function t_(t){let e={};return{type:t.type,providersResolver:null,viewProvidersResolver:null,factory:null,hostBindings:t.hostBindings||null,hostVars:t.hostVars||0,hostAttrs:t.hostAttrs||null,contentQueries:t.contentQueries||null,declaredInputs:e,inputConfig:t.inputs||Nc,exportAs:t.exportAs||null,standalone:t.standalone??!0,signals:t.signals===!0,selectors:t.selectors||io,viewQuery:t.viewQuery||null,features:t.features||null,setInput:null,resolveHostDirectives:null,hostDirectives:null,controlDef:null,signalFormsInputPresence:null,inputs:zT(t.inputs,e),outputs:GT(t.outputs),debugInfo:null}}function n_(t){t.features?.forEach(e=>e(t))}function hy(t,e){return t?()=>{let n=typeof t=="function"?t():t,o=[];for(let r of n){let i=e(r);i!==null&&o.push(i)}return o}:null}function WT(t){let e=0,n=typeof t.consts=="function"?"":t.consts,o=[t.selectors,t.ngContentSelectors,t.hostVars,t.hostAttrs,n,t.vars,t.decls,t.encapsulation,t.standalone,t.signals,t.exportAs,JSON.stringify(t.inputs),JSON.stringify(t.outputs),Object.getOwnPropertyNames(t.type.prototype),!!t.contentQueries,!!t.viewQuery];for(let i of o.join("|"))e=Math.imul(31,e)+i.charCodeAt(0)<<0;return e+=2147483648,"c"+e}var o_=new $e("");var Lf=(()=>{class t{resolve;reject;initialized=!1;done=!1;donePromise=new Promise((n,o)=>{this.resolve=n,this.reject=o});appInits=O(o_,{optional:!0})??[];injector=O(Un);constructor(){}runInitializers(){if(this.initialized)return;let n=[];for(let r of this.appInits){let i=Ac(this.injector,r);if(Pf(i))n.push(i);else if(Jv(i)){let s=new Promise((a,c)=>{i.subscribe({complete:a,error:c})});n.push(s)}}let o=()=>{this.done=!0,this.resolve()};Promise.all(n).then(()=>{o()}).catch(r=>{this.reject(r)}),n.length===0&&o(),this.initialized=!0}static \u0275fac=function(o){return new(o||t)};static \u0275prov=Zi({token:t,factory:t.\u0275fac})}return t})();function qT(t,e,n,o,r,i,s,a){if(n.firstCreatePass){t.mergedAttrs=_l(t.mergedAttrs,t.attrs);let d=t.tView=Tf(2,t,r,i,s,n.directiveRegistry,n.pipeRegistry,null,n.schemas,n.consts,null);n.queries!==null&&(n.queries.template(n,t),d.queries=n.queries.embeddedTView(t))}a&&(t.flags|=a),Hi(t,!1);let c=YT(n,e,t,o);Wc()&&wf(n,e,c,t),Wi(c,e);let l=kv(c,e,c,t);e[o+sn]=l,If(e,l),DT(l,t,e)}function hl(t,e,n,o,r,i,s,a,c,l,d){let u=n+sn,m;if(e.firstCreatePass){if(m=Il(e,u,4,s||null,a||null),l!=null){let h=wo(e.consts,l);m.localNames=[];for(let y=0;y<h.length;y+=2)m.localNames.push(h[y],-1)}}else m=e.data[u];return qT(m,t,e,n,o,r,i,c),l!=null&&Df(t,m,d),m}var YT=ZT;function ZT(t,e,n,o){return qc(!0),e[wt].createComment("")}var Ff=new $e("");var Vf=new $e("");function r_(){iu(t=>{let e="";throw new be(-600,e)})}var KT=10;var la=(()=>{class t{_runningTick=!1;_destroyed=!1;_destroyListeners=[];_views=[];internalErrorHandler=O(ei);afterRenderManager=O(xf);zonelessEnabled=O(Ys);rootEffectScheduler=O(Kc);dirtyFlags=0;tracingSnapshot=null;allTestViews=new Set;autoDetectTestViews=new Set;includeAllTestViews=!1;afterTick=new Bn;get allViews(){return[...(this.includeAllTestViews?this.allTestViews:this.autoDetectTestViews).keys(),...this._views]}get destroyed(){return this._destroyed}componentTypes=[];components=[];internalPendingTask=O(Bi);get isStable(){return this.internalPendingTask.hasPendingTasksObservable.pipe(vu(n=>!n))}constructor(){O(Yo,{optional:!0})}whenStable(){let n;return new Promise(o=>{n=this.isStable.subscribe({next:r=>{r&&o()}})}).finally(()=>{n.unsubscribe()})}_injector=O(so);_rendererFactory=null;get injector(){return this._injector}bootstrap(n,o){return this.bootstrapImpl(n,o)}bootstrapImpl(n,o,r=Un.NULL){return this._injector.get(En).run(()=>{if(lt(Je.BootstrapComponentStart),!this._injector.get(Lf).done){let W="";throw new be(405,W)}let a=Ur(n),c=this._injector.get(ml),l=new na(a,c);this.componentTypes.push(n);let{hostElement:d,directives:u,bindings:m}=QT(o),h=d||l.selector,y=l.create(r,[],h,c.injector,u,m),E=y.location.nativeElement,M=y.injector.get(Ff,null);return M?.registerApplication(E),y.onDestroy(()=>{this.detachView(y.hostView),Ks(this.components,y),M?.unregisterApplication(E)}),this._loadComponent(y),lt(Je.BootstrapComponentEnd,y),y})}tick(){this.zonelessEnabled||(this.dirtyFlags|=1),this._tick()}_tick(){lt(Je.ChangeDetectionStart),this.tracingSnapshot!==null?this.tracingSnapshot.run(xl.CHANGE_DETECTION,this.tickImpl):this.tickImpl()}tickImpl=()=>{if(this._runningTick)throw lt(Je.ChangeDetectionEnd),new be(101,!1);let n=se(null);try{this._runningTick=!0,this.synchronize()}finally{this._runningTick=!1,this.tracingSnapshot?.dispose(),this.tracingSnapshot=null,se(n),this.afterTick.next(),lt(Je.ChangeDetectionEnd)}};synchronize(){this._rendererFactory===null&&!this._injector.destroyed&&(this._rendererFactory=this._injector.get(Go,null,{optional:!0}));let n=0;for(;this.dirtyFlags!==0&&n++<KT;){lt(Je.ChangeDetectionSyncStart);try{this.synchronizeOnce()}finally{lt(Je.ChangeDetectionSyncEnd)}}}synchronizeOnce(){this.dirtyFlags&16&&(this.dirtyFlags&=-17,this.rootEffectScheduler.flush());let n=!1;if(this.dirtyFlags&7){let o=!!(this.dirtyFlags&1);this.dirtyFlags&=-8,this.dirtyFlags|=8;for(let{_lView:r}of this.allViews){if(!o&&!Us(r))continue;let i=o&&!this.zonelessEnabled?0:1;Tv(r,i),n=!0}if(this.dirtyFlags&=-5,this.syncDirtyFlagsWithViews(),this.dirtyFlags&23)return}n||(this._rendererFactory?.begin?.(),this._rendererFactory?.end?.()),this.dirtyFlags&8&&(this.dirtyFlags&=-9,this.afterRenderManager.execute()),this.syncDirtyFlagsWithViews()}syncDirtyFlagsWithViews(){if(this.allViews.some(({_lView:n})=>Us(n))){this.dirtyFlags|=2;return}else this.dirtyFlags&=-8}attachView(n){let o=n;this._views.push(o),o.attachToAppRef(this)}detachView(n){let o=n;Ks(this._views,o),o.detachFromAppRef()}_loadComponent(n){this.attachView(n.hostView);try{this.tick()}catch(r){this.internalErrorHandler(r)}this.components.push(n),this._injector.get(Vf,[]).forEach(r=>r(n))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(n=>n()),this._views.slice().forEach(n=>n.destroy())}finally{this._destroyed=!0,this._views=[],this._destroyListeners=[]}}onDestroy(n){return this._destroyListeners.push(n),()=>Ks(this._destroyListeners,n)}destroy(){if(this._destroyed)throw new be(406,!1);let n=this._injector;n.destroy&&!n.destroyed&&n.destroy()}get viewCount(){return this._views.length}static \u0275fac=function(o){return new(o||t)};static \u0275prov=Zi({token:t,factory:t.\u0275fac})}return t})();function QT(t){return t===void 0||typeof t=="string"||t instanceof Element?{hostElement:t}:t}function Ks(t,e){let n=t.indexOf(e);n>-1&&t.splice(n,1)}function He(t,e,n,o){let r=je(),i=Jr();if(Mo(r,i,e)){let s=yn(),a=zs();wS(a,r,t,e,n,o)}return He}var Zp=class{destroy(e){}updateValue(e,n){}swap(e,n){let o=Math.min(e,n),r=Math.max(e,n),i=this.detach(r);if(r-o>1){let s=this.detach(o);this.attach(o,i),this.attach(r,s)}else this.attach(o,i)}move(e,n){this.attach(n,this.detach(e))}};function bp(t,e,n,o,r){return t===n&&Object.is(e,o)?1:Object.is(r(t,e),r(n,o))?-1:0}function XT(t,e,n,o){let r,i,s=0,a=t.length-1,c=void 0;if(Array.isArray(e)){se(o);let l=e.length-1;for(se(null);s<=a&&s<=l;){let d=t.at(s),u=e[s],m=bp(s,d,s,u,n);if(m!==0){m<0&&t.updateValue(s,u),s++;continue}let h=t.at(a),y=e[l],E=bp(a,h,l,y,n);if(E!==0){E<0&&t.updateValue(a,y),a--,l--;continue}let M=n(s,d),W=n(a,h),z=n(s,u);if(Object.is(z,W)){let me=n(l,y);Object.is(me,M)?(t.swap(s,a),t.updateValue(a,y),l--,a--):t.move(a,s),t.updateValue(s,u),s++;continue}if(r??=new gl,i??=yy(t,s,a,n),Kp(t,r,s,z))t.updateValue(s,u),s++,a++;else if(i.has(z))r.set(M,t.detach(s)),a--;else{let me=t.create(s,e[s]);t.attach(s,me),s++,a++}}for(;s<=l;)gy(t,r,n,s,e[s]),s++}else if(e!=null){se(o);let l=e[Symbol.iterator]();se(null);let d=l.next();for(;!d.done&&s<=a;){let u=t.at(s),m=d.value,h=bp(s,u,s,m,n);if(h!==0)h<0&&t.updateValue(s,m),s++,d=l.next();else{r??=new gl,i??=yy(t,s,a,n);let y=n(s,m);if(Kp(t,r,s,y))t.updateValue(s,m),s++,a++,d=l.next();else if(!i.has(y))t.attach(s,t.create(s,m)),s++,a++,d=l.next();else{let E=n(s,u);r.set(E,t.detach(s)),a--}}}for(;!d.done;)gy(t,r,n,t.length,d.value),d=l.next()}for(;s<=a;)t.destroy(t.detach(a--));r?.forEach(l=>{t.destroy(l)})}function Kp(t,e,n,o){return e!==void 0&&e.has(o)?(t.attach(n,e.get(o)),e.delete(o),!0):!1}function gy(t,e,n,o,r){if(Kp(t,e,o,n(o,r)))t.updateValue(o,r);else{let i=t.create(o,r);t.attach(o,i)}}function yy(t,e,n,o){let r=new Set;for(let i=e;i<=n;i++)r.add(o(i,t.at(i)));return r}var gl=class{kvMap=new Map;_vMap=void 0;has(e){return this.kvMap.has(e)}delete(e){if(!this.has(e))return!1;let n=this.kvMap.get(e);return this._vMap!==void 0&&this._vMap.has(n)?(this.kvMap.set(e,this._vMap.get(n)),this._vMap.delete(n)):this.kvMap.delete(e),!0}get(e){return this.kvMap.get(e)}set(e,n){if(this.kvMap.has(e)){let o=this.kvMap.get(e);this._vMap===void 0&&(this._vMap=new Map);let r=this._vMap;for(;r.has(o);)o=r.get(o);r.set(o,n)}else this.kvMap.set(e,n)}forEach(e){for(let[n,o]of this.kvMap)if(e(o,n),this._vMap!==void 0){let r=this._vMap;for(;r.has(o);)o=r.get(o),e(o,n)}}};function A(t,e,n,o,r,i,s,a){oi("NgControlFlow");let c=je(),l=yn(),d=wo(l.consts,i);return hl(c,l,t,e,n,o,r,d,256,s,a),$f}function $f(t,e,n,o,r,i,s,a){return oi("NgControlFlow"),JT(t,e,n,o,r,i,s,a),$f}function JT(t,e,n,o,r,i,s,a){let c=je(),l=yn(),d=wo(l.consts,i);hl(c,l,t,e,n,o,r,d,512,s,a)}function R(t,e){oi("NgControlFlow");let n=je(),o=Jr(),r=n[o]!==Cn?n[o]:-1,i=r!==-1?yl(n,sn+r):void 0,s=0;if(Mo(n,o,t)){let a=se(null);try{if(i!==void 0&&Ov(i,s),t!==-1){let c=sn+t,l=yl(n,c),d=ef(n[ce],c),u=Rv(l,d,n),m=Tl(n,d,e,{dehydratedView:u});Ml(l,m,s,Xs(d,u))}}finally{se(a)}}else if(i!==void 0){let a=Nv(i,s);a!==void 0&&(a[kt]=e)}}var Qp=class{lContainer;$implicit;$index;constructor(e,n,o){this.lContainer=e,this.$implicit=n,this.$index=o}get $count(){return this.lContainer.length-Nt}};function Xi(t){return t}function ii(t,e){return e}var Xp=class{hasEmptyBlock;trackByFn;liveCollection;constructor(e,n,o){this.hasEmptyBlock=e,this.trackByFn=n,this.liveCollection=o}};function ze(t,e,n,o,r,i,s,a,c,l,d,u,m){oi("NgControlFlow");let h=je(),y=yn(),E=c!==void 0,M=je(),W=a?s.bind(M[Nn][kt]):s,z=new Xp(E,W);M[sn+t]=z,hl(h,y,t+1,e,n,o,r,wo(y.consts,i),256),E&&hl(h,y,t+2,c,l,d,u,wo(y.consts,m),512)}var Jp=class extends Zp{lContainer;hostLView;templateTNode;operationsCounter=void 0;needsIndexUpdate=!1;constructor(e,n,o){super(),this.lContainer=e,this.hostLView=n,this.templateTNode=o}get length(){return this.lContainer.length-Nt}at(e){return this.getLView(e)[kt].$implicit}attach(e,n){let o=n[Fi];this.needsIndexUpdate||=e!==this.length,Ml(this.lContainer,n,e,Xs(this.templateTNode,o)),eM(this.lContainer,e)}detach(e){return this.needsIndexUpdate||=e!==this.length-1,tM(this.lContainer,e),nM(this.lContainer,e)}create(e,n){let o=jp(this.lContainer,this.templateTNode.tView.ssrId);return Tl(this.hostLView,this.templateTNode,new Qp(this.lContainer,n,e),{dehydratedView:o})}destroy(e){Cl(e[ce],e)}updateValue(e,n){this.getLView(e)[kt].$implicit=n}reset(){this.needsIndexUpdate=!1}updateIndexes(){if(this.needsIndexUpdate)for(let e=0;e<this.length;e++)this.getLView(e)[kt].$index=e}getLView(e){return oM(this.lContainer,e)}};function Ge(t){let e=se(null),n=lo();try{let o=je(),r=o[ce],i=o[n],s=n+1,a=yl(o,s);if(i.liveCollection===void 0){let l=ef(r,s);i.liveCollection=new Jp(a,o,l)}else i.liveCollection.reset();let c=i.liveCollection;if(XT(c,t,i.trackByFn,e),c.updateIndexes(),i.hasEmptyBlock){let l=Jr(),d=c.length===0;if(Mo(o,l,d)){let u=n+2,m=yl(o,u);if(d){let h=ef(r,u),y=Rv(m,h,o),E=Tl(o,h,void 0,{dehydratedView:y});Ml(m,E,0,Xs(h,y))}else r.firstUpdatePass&&YS(m),Ov(m,0)}}}finally{se(e)}}function yl(t,e){return t[e]}function eM(t,e){if(t.length<=Nt)return;let n=Nt+e,o=t[n];o&&Kw(o)}function tM(t,e){if(t.length<=Nt)return;let n=Nt+e,o=t[n];o&&Zw(o)}function nM(t,e){return ea(t,e)}function oM(t,e){return Nv(t,e)}function ef(t,e){return Fc(t,e)}function X(t,e,n){let o=je(),r=Jr();if(Mo(o,r,e)){let i=yn(),s=zs();vS(s,o,t,e,o[wt],n)}return X}function tf(t,e,n,o,r){kf(e,t,n,r?"class":"style",o)}function _(t,e,n,o){let r=je(),i=r[ce],s=t+sn,a=i.firstCreatePass?Bv(s,r,2,e,CS,hg(),n,o):i.data[s];if(ur(a)){let c=r[co].tracingService;if(c&&c.componentCreate){let l=i.data[a.directiveStart+a.componentOffset];return c.componentCreate(Fv(l),()=>(vy(t,e,r,a,o),_))}}return vy(t,e,r,a,o),_}function vy(t,e,n,o,r){if(_v(o,n,t,e,i_),Pc(o)){let i=n[ce];yv(i,n,o),Yy(i,o,n)}r!=null&&Df(n,o)}function b(){let t=yn(),e=Yn(),n=bv(e);return t.firstCreatePass&&Uv(t,n),np(n)&&op(),tp(),n.classesWithoutHost!=null&&FC(n)&&tf(t,n,je(),n.classesWithoutHost,!0),n.stylesWithoutHost!=null&&VC(n)&&tf(t,n,je(),n.stylesWithoutHost,!1),b}function Ke(t,e,n,o){return _(t,e,n,o),b(),Ke}function C(t,e,n,o){let r=je(),i=r[ce],s=t+sn,a=i.firstCreatePass?fT(s,i,2,e,n,o):i.data[s];return _v(a,r,t,e,i_),o!=null&&Df(r,a),C}function w(){let t=Yn(),e=bv(t);return np(e)&&op(),tp(),w}function st(t,e,n,o){return C(t,e,n,o),w(),st}var i_=(t,e,n,o,r)=>(qc(!0),tv(e[wt],o,lp()));function Y(){return je()}function et(t,e,n){let o=je(),r=Jr();if(Mo(o,r,e)){let i=yn(),s=zs();vv(s,o,t,e,o[wt],n)}return et}var da="en-US";var rM=da;function s_(t){typeof t=="string"&&(rM=t.toLowerCase().replace(/_/g,"-"))}function U(t,e,n){let o=je(),r=yn(),i=Yn();return iM(r,o,o[wt],i,t,e,n),U}function ee(t,e,n){let o=je(),r=yn(),i=Yn();return(i.type&3||n)&&Vv(i,r,o,n,o[wt],t,e,il(i,o,e)),ee}function iM(t,e,n,o,r,i,s){let a=!0,c=null;if((o.type&3||s)&&(c??=il(o,e,i),Vv(o,t,e,s,n,r,i,c)&&(a=!1)),a){let l=o.outputs?.[r],d=o.hostDirectiveOutputs?.[r];if(d&&d.length)for(let u=0;u<d.length;u+=2){let m=d[u],h=d[u+1];c??=il(o,e,i),ly(o,e,m,h,r,c)}if(l&&l.length)for(let u of l)c??=il(o,e,i),ly(o,e,u,r,r,c)}}function v(t=1){return kg(t)}function Ft(t,e,n,o){return jT(t,LT(e,n,o)),Ft}function Wt(t=1){Uc(Tg()+t)}function el(t,e){return t<<17|e<<2}function ni(t){return t>>17&32767}function sM(t){return(t&2)==2}function aM(t,e){return t&131071|e<<17}function nf(t){return t|2}function Yi(t){return(t&131068)>>2}function Ep(t,e){return t&-131069|e<<2}function cM(t){return(t&1)===1}function of(t){return t|1}function lM(t,e,n,o,r,i){let s=i?e.classBindings:e.styleBindings,a=ni(s),c=Yi(s);t[o]=n;let l=!1,d;if(Array.isArray(n)){let u=n;d=u[1],(d===null||Pi(u,d)>0)&&(l=!0)}else d=n;if(r)if(c!==0){let m=ni(t[a+1]);t[o+1]=el(m,a),m!==0&&(t[m+1]=Ep(t[m+1],o)),t[a+1]=aM(t[a+1],o)}else t[o+1]=el(a,0),a!==0&&(t[a+1]=Ep(t[a+1],o)),a=o;else t[o+1]=el(c,0),a===0?a=o:t[c+1]=Ep(t[c+1],o),c=o;l&&(t[o+1]=nf(t[o+1])),_y(t,d,o,!0),_y(t,d,o,!1),dM(e,d,t,o,i),s=el(a,c),i?e.classBindings=s:e.styleBindings=s}function dM(t,e,n,o,r){let i=r?t.residualClasses:t.residualStyles;i!=null&&typeof e=="string"&&Pi(i,e)>=0&&(n[o+1]=of(n[o+1]))}function _y(t,e,n,o){let r=t[n+1],i=e===null,s=o?ni(r):Yi(r),a=!1;for(;s!==0&&(a===!1||i);){let c=t[s],l=t[s+1];uM(c,e)&&(a=!0,t[s+1]=o?of(l):nf(l)),s=o?ni(l):Yi(l)}a&&(t[n+1]=o?nf(r):of(r))}function uM(t,e){return t===null||e==null||(Array.isArray(t)?t[1]:t)===e?!0:Array.isArray(t)&&typeof e=="string"?Pi(t,e)>=0:!1}var po={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function pM(t){return t.substring(po.key,po.keyEnd)}function fM(t){return mM(t),a_(t,c_(t,0,po.textEnd))}function a_(t,e){let n=po.textEnd;return n===e?-1:(e=po.keyEnd=hM(t,po.key=e,n),c_(t,e,n))}function mM(t){po.key=0,po.keyEnd=0,po.value=0,po.valueEnd=0,po.textEnd=t.length}function c_(t,e,n){for(;e<n&&t.charCodeAt(e)<=32;)e++;return e}function hM(t,e,n){for(;e<n&&t.charCodeAt(e)>32;)e++;return e}function Io(t,e,n){return l_(t,e,n,!1),Io}function Be(t,e){return l_(t,e,null,!0),Be}function Zo(t){yM(CM,gM,t,!0)}function gM(t,e){for(let n=fM(e);n>=0;n=a_(e,n))Dc(t,pM(e),!0)}function l_(t,e,n,o){let r=je(),i=yn(),s=Hc(2);if(i.firstUpdatePass&&u_(i,t,s,o),e!==Cn&&Mo(r,s,e)){let a=i.data[lo()];p_(i,a,r,r[wt],t,r[s+1]=SM(e,n),o,s)}}function yM(t,e,n,o){let r=yn(),i=Hc(2);r.firstUpdatePass&&u_(r,null,i,o);let s=je();if(n!==Cn&&Mo(s,i,n)){let a=r.data[lo()];if(f_(a,o)&&!d_(r,i)){let c=o?a.classesWithoutHost:a.stylesWithoutHost;c!==null&&(n=xc(c,n||"")),tf(r,a,s,n,o)}else wM(r,a,s,s[wt],s[i+1],s[i+1]=xM(t,e,n),o,i)}}function d_(t,e){return e>=t.expandoStartIndex}function u_(t,e,n,o){let r=t.data;if(r[n+1]===null){let i=r[lo()],s=d_(t,n);f_(i,o)&&e===null&&!s&&(e=!1),e=vM(r,i,e,o),lM(r,i,e,n,s,o)}}function vM(t,e,n,o){let r=Sg(t),i=o?e.residualClasses:e.residualStyles;if(r===null)(o?e.classBindings:e.styleBindings)===0&&(n=xp(null,t,e,n,o),n=ra(n,e.attrs,o),i=null);else{let s=e.directiveStylingLast;if(s===-1||t[s]!==r)if(n=xp(r,t,e,n,o),i===null){let c=_M(t,e,o);c!==void 0&&Array.isArray(c)&&(c=xp(null,t,e,c[1],o),c=ra(c,e.attrs,o),bM(t,e,o,c))}else i=EM(t,e,o)}return i!==void 0&&(o?e.residualClasses=i:e.residualStyles=i),n}function _M(t,e,n){let o=n?e.classBindings:e.styleBindings;if(Yi(o)!==0)return t[ni(o)]}function bM(t,e,n,o){let r=n?e.classBindings:e.styleBindings;t[ni(r)]=o}function EM(t,e,n){let o,r=e.directiveEnd;for(let i=1+e.directiveStylingLast;i<r;i++){let s=t[i].hostAttrs;o=ra(o,s,n)}return ra(o,e.attrs,n)}function xp(t,e,n,o,r){let i=null,s=n.directiveEnd,a=n.directiveStylingLast;for(a===-1?a=n.directiveStart:a++;a<s&&(i=e[a],o=ra(o,i.hostAttrs,r),i!==t);)a++;return t!==null&&(n.directiveStylingLast=a),o}function ra(t,e,n){let o=n?1:2,r=-1;if(e!==null)for(let i=0;i<e.length;i++){let s=e[i];typeof s=="number"?r=s:r===o&&(Array.isArray(t)||(t=t===void 0?[]:["",t]),Dc(t,s,n?!0:e[++i]))}return t===void 0?null:t}function xM(t,e,n){if(n==null||n==="")return io;let o=[],r=Zn(n);if(Array.isArray(r))for(let i=0;i<r.length;i++)t(o,r[i],!0);else if(r instanceof Set)for(let i of r)t(o,i,!0);else if(typeof r=="object")for(let i in r)Object.hasOwn(r,i)&&t(o,i,r[i]);else typeof r=="string"&&e(o,r);return o}function CM(t,e,n){let o=String(e);o!==""&&!o.includes(" ")&&Dc(t,o,n)}function wM(t,e,n,o,r,i,s,a){r===Cn&&(r=io);let c=0,l=0,d=0<r.length?r[0]:null,u=0<i.length?i[0]:null;for(;d!==null||u!==null;){let m=c<r.length?r[c+1]:void 0,h=l<i.length?i[l+1]:void 0,y=null,E;d===u?(c+=2,l+=2,m!==h&&(y=u,E=h)):u===null||d!==null&&d<u?(c+=2,y=d):(l+=2,y=u,E=h),y!==null&&p_(t,e,n,o,y,E,s,a),d=c<r.length?r[c]:null,u=l<i.length?i[l]:null}}function p_(t,e,n,o,r,i,s,a){if(!(e.type&3))return;let c=t.data,l=c[a+1],d=cM(l)?by(c,e,n,r,Yi(l),s):void 0;if(!vl(d)){vl(i)||sM(l)&&(i=by(c,null,n,r,a,s));let u=Ku(lo(),n);dS(o,s,u,r,i)}}function by(t,e,n,o,r,i){let s=e===null,a;for(;r>0;){let c=t[r],l=Array.isArray(c),d=l?c[1]:c,u=d===null,m=n[r+1];m===Cn&&(m=u?io:void 0);let h=u?kc(m,o):d===o?m:void 0;if(l&&!vl(h)&&(h=kc(c,o)),vl(h)&&(a=h,s))return a;let y=t[r+1];r=s?ni(y):Yi(y)}if(e!==null){let c=i?e.residualClasses:e.residualStyles;c!=null&&(a=kc(c,o))}return a}function vl(t){return t!==void 0}function SM(t,e){return t==null||t===""||(typeof e=="string"?t=Zn(t)+e:typeof t=="object"&&(t=Ec(Zn(t)))),t}function f_(t,e){return(t.flags&(e?8:16))!==0}function g(t,e=""){let n=je(),o=yn(),r=t+sn,i=o.firstCreatePass?Il(o,r,1,e,null):o.data[r],s=TM(o,n,i,e);n[r]=s,Wc()&&wf(o,n,s,i),Hi(i,!1)}var TM=(t,e,n,o)=>(qc(!0),Tw(e[wt],o));function MM(t,e,n,o=""){return Mo(t,Jr(),n)?e+zr(n)+o:Cn}function IM(t,e,n,o,r,i=""){let s=bg(),a=eT(t,s,n,r);return Hc(2),a?e+zr(n)+o+zr(r)+i:Cn}function $(t){return pt("",t),$}function pt(t,e,n){let o=je(),r=MM(o,t,e,n);return r!==Cn&&m_(o,lo(),r),pt}function Kn(t,e,n,o,r){let i=je(),s=IM(i,t,e,n,o,r);return s!==Cn&&m_(i,lo(),s),Kn}function m_(t,e,n){let o=Ku(e,t);Mw(t[wt],o,n)}function kl(t,e){let n=_g()+t,o=je();return o[n]===Cn?XS(o,n,e()):JS(o,n)}var h_=(()=>{class t{applicationErrorHandler=O(ei);appRef=O(la);taskService=O(Bi);ngZone=O(En);zonelessEnabled=O(Ys);tracing=O(Yo,{optional:!0});zoneIsDefined=typeof Zone<"u"&&!!Zone.root.run;schedulerTickApplyArgs=[{data:{__scheduler_tick__:!0}}];subscriptions=new gn;angularZoneId=this.zoneIsDefined?this.ngZone._inner?.get(Ps):null;scheduleInRootZone=!this.zonelessEnabled&&this.zoneIsDefined&&(O(hp,{optional:!0})??!1);cancelScheduledCallback=null;useMicrotaskScheduler=!1;runningTick=!1;pendingRenderTaskId=null;constructor(){this.subscriptions.add(this.appRef.afterTick.subscribe(()=>{let n=this.taskService.add();if(!this.runningTick&&(this.cleanup(),!this.zonelessEnabled||this.appRef.includeAllTestViews)){this.taskService.remove(n);return}this.switchToMicrotaskScheduler(),this.taskService.remove(n)})),this.subscriptions.add(this.ngZone.onUnstable.subscribe(()=>{this.runningTick||this.cleanup()}))}switchToMicrotaskScheduler(){this.ngZone.runOutsideAngular(()=>{let n=this.taskService.add();this.useMicrotaskScheduler=!0,queueMicrotask(()=>{this.useMicrotaskScheduler=!1,this.taskService.remove(n)})})}notify(n){if(!this.zonelessEnabled&&n===5)return;switch(n){case 0:case 2:{this.appRef.dirtyFlags|=2;break}case 3:case 4:case 5:case 1:{this.appRef.dirtyFlags|=4;break}case 6:{this.appRef.dirtyFlags|=2;break}case 12:{this.appRef.dirtyFlags|=16;break}case 13:{this.appRef.dirtyFlags|=2;break}case 11:break;default:this.appRef.dirtyFlags|=8}if(this.appRef.tracingSnapshot=this.tracing?.snapshot(this.appRef.tracingSnapshot)??null,!this.shouldScheduleTick())return;let o=this.useMicrotaskScheduler?Pg:dp;this.pendingRenderTaskId=this.taskService.add(),this.scheduleInRootZone?this.cancelScheduledCallback=Zone.root.run(()=>o(()=>this.tick())):this.cancelScheduledCallback=this.ngZone.runOutsideAngular(()=>o(()=>this.tick()))}shouldScheduleTick(){return!(this.appRef.destroyed||this.pendingRenderTaskId!==null||this.runningTick||this.appRef._runningTick||!this.zonelessEnabled&&this.zoneIsDefined&&Zone.current.get(Ps+this.angularZoneId))}tick(){if(this.runningTick||this.appRef.destroyed)return;if(this.appRef.dirtyFlags===0){this.cleanup();return}!this.zonelessEnabled&&this.appRef.dirtyFlags&7&&(this.appRef.dirtyFlags|=1);let n=this.taskService.add();try{this.ngZone.run(()=>{this.runningTick=!0,this.appRef._tick()},void 0,this.schedulerTickApplyArgs)}catch(o){this.applicationErrorHandler(o)}finally{this.taskService.remove(n),this.cleanup()}}ngOnDestroy(){this.subscriptions.unsubscribe(),this.cleanup()}cleanup(){if(this.runningTick=!1,this.cancelScheduledCallback?.(),this.cancelScheduledCallback=null,this.pendingRenderTaskId!==null){let n=this.pendingRenderTaskId;this.pendingRenderTaskId=null,this.taskService.remove(n)}}static \u0275fac=function(o){return new(o||t)};static \u0275prov=Zi({token:t,factory:t.\u0275fac})}return t})();function g_(){return[{provide:sr,useExisting:h_},{provide:En,useClass:Ls},{provide:Ys,useValue:!0}]}function DM(){return typeof $localize<"u"&&$localize.locale||da}var jf=new $e("",{factory:()=>O(jf,{optional:!0,skipSelf:!0})||DM()});var Nl=class{destroyed=!1;listeners=null;errorHandler=O(zn,{optional:!0});isEmitting=!1;hasNullListeners=!1;destroyRef=O(zt);constructor(){this.destroyRef.onDestroy(()=>{this.destroyed=!0,this.listeners=null})}subscribe(e){if(this.destroyed)throw new be(953,!1);return(this.listeners??=[]).push(e),{unsubscribe:()=>{let n=this.listeners?this.listeners.indexOf(e):-1;n>-1&&(this.isEmitting?(this.hasNullListeners=!0,this.listeners[n]=null):this.listeners.splice(n,1))}}}emit(e){if(this.destroyed){console.warn(Ri(953,!1));return}if(this.listeners===null)return;this.isEmitting=!0;let n=se(null);try{for(let o of this.listeners)try{o!==null&&o(e)}catch(r){this.errorHandler?.handleError(r)}}finally{this.hasNullListeners&&(this.hasNullListeners=!1,this.listeners&&kM(this.listeners)),se(n),this.isEmitting=!1}}};function kM(t){let e=t.length-1;for(;e>-1;)t[e]===null&&t.splice(e,1),e--}function T(t,e){return Is(t,e?.equal)}function Hf(t){return Mh(t)}var y_=class t extends Error{_brand;constructor(e){super(e)}static IDLE=new t("IDLE");static LOADING=new t("LOADING")};function b_(t,e){let n=Object.create(Sy);n.value=t,n.transformFn=e?.transform;function o(){if(Or(n),n.value===rf){let r=null;throw new be(-950,r)}return n.value}return o[rn]=n,o}function bt(t){return new Nl}function v_(t,e){return b_(t,e)}function HM(t){return b_(rf,t)}var le=(v_.required=HM,v_);function __(t,e){return Kv(e)}function BM(t,e){return Qv(e)}var St=(__.required=BM,__);function E_(t,e){return Xv(e)}var UM=1e4;var PU=UM-1e3;var Bf=new $e(""),zM=new $e("");function ua(t){return!t.moduleRef}function GM(t){let e=ua(t)?t.r3Injector:t.moduleRef.injector,n=e.get(En);return n.run(()=>{ua(t)?t.r3Injector.resolveInjectorInitializers():t.moduleRef.resolveInjectorInitializers();let o=e.get(ei),r;if(n.runOutsideAngular(()=>{r=n.onError.subscribe({next:o})}),ua(t)){let i=()=>e.destroy(),s=t.platformInjector.get(Bf);s.add(i),e.onDestroy(()=>{r.unsubscribe(),s.delete(i)})}else{let i=()=>t.moduleRef.destroy(),s=t.platformInjector.get(Bf);s.add(i),t.moduleRef.onDestroy(()=>{Ks(t.allPlatformModules,t.moduleRef),r.unsubscribe(),s.delete(i)})}return qM(o,n,()=>{let i=e.get(Bi),s=i.add(),a=e.get(Lf);return a.runInitializers(),a.donePromise.then(()=>{let c=e.get(jf,da);if(s_(c||da),!e.get(zM,!0))return ua(t)?e.get(la):(t.allPlatformModules.push(t.moduleRef),t.moduleRef);if(ua(t)){let d=e.get(la);return t.rootComponent!==void 0&&d.bootstrap(t.rootComponent),d}else return WM?.(t.moduleRef,t.allPlatformModules),t.moduleRef}).finally(()=>{i.remove(s)})})})}var WM;function qM(t,e,n){try{let o=n();return Pf(o)?o.catch(r=>{throw e.runOutsideAngular(()=>t(r)),r}):o}catch(o){throw e.runOutsideAngular(()=>t(o)),o}}var Ol=null;function YM(t=[],e){return Un.create({name:e,providers:[{provide:Vs,useValue:"platform"},{provide:Bf,useValue:new Set([()=>Ol=null])},...t]})}function ZM(t=[]){if(Ol)return Ol;let e=YM(t);return Ol=e,r_(),KM(e),e}function KM(t){let e=t.get(Yc,null);Ac(t,()=>{e?.forEach(n=>n())})}function x_(t){let{rootComponent:e,appProviders:n,platformProviders:o,platformRef:r}=t;lt(Je.BootstrapApplicationStart);try{let i=r?.injector??ZM(o),s=[g_(),$g,...n||[]],a=new oa({providers:s,parent:i,debugName:"",runEnvironmentInitializers:!1});return GM({r3Injector:a.injector,platformInjector:i,rootComponent:e})}catch(i){return Promise.reject(i)}finally{lt(Je.BootstrapApplicationEnd)}}var C_=null;function Ji(){return C_}function zf(t){C_??=t}var pa=class{};function Gf(t,e){e=encodeURIComponent(e);for(let n of t.split(";")){let o=n.indexOf("="),[r,i]=o==-1?[n,""]:[n.slice(0,o),n.slice(o+1)];if(r.trim()!==e)continue;let s=i;try{s=decodeURIComponent(i)}catch{}return s.length>1&&s[0]==='"'&&s[s.length-1]==='"'&&(s=s.slice(1,-1)),s}return null}var w_="browser";var fa=class{_doc;constructor(e){this._doc=e}manager},Al=(()=>{class t extends fa{constructor(n){super(n)}supports(n){return!0}addEventListener(n,o,r,i){return n.addEventListener(o,r,i),()=>this.removeEventListener(n,o,r,i)}removeEventListener(n,o,r,i){return n.removeEventListener(o,r,i)}static \u0275fac=function(o){return new(o||t)(it(_n))};static \u0275prov=Pe({token:t,factory:t.\u0275fac})}return t})(),Ll=new $e(""),Zf=(()=>{class t{_zone;_plugins;_eventNameToPlugin=new Map;constructor(n,o){this._zone=o,n.forEach(s=>{s.manager=this});let r=n.filter(s=>!(s instanceof Al));this._plugins=r.slice().reverse();let i=n.find(s=>s instanceof Al);i&&this._plugins.push(i)}addEventListener(n,o,r,i){return this._findPluginFor(o).addEventListener(n,o,r,i)}getZone(){return this._zone}_findPluginFor(n){let o=this._eventNameToPlugin.get(n);if(o)return o;if(o=this._plugins.find(i=>i.supports(n)),!o)throw new be(-5101,!1);return this._eventNameToPlugin.set(n,o),o}static \u0275fac=function(o){return new(o||t)(it(Ll),it(En))};static \u0275prov=Pe({token:t,factory:t.\u0275fac})}return t})(),Wf="ng-app-id";function S_(t){for(let e of t)e.remove()}function T_(t,e){let n=e.createElement("style");return n.textContent=t,n}function QM(t,e,n,o){let r=t.head?.querySelectorAll(`style[${Wf}="${e}"],link[${Wf}="${e}"]`);if(!r||r.length===0)return!1;for(let i of r)i.removeAttribute(Wf),i instanceof HTMLLinkElement?o.set(i.href.slice(i.href.lastIndexOf("/")+1),{usage:0,elements:[i]}):i.textContent&&n.set(i.textContent,{usage:0,elements:[i]});return!0}function Yf(t,e){let n=e.createElement("link");return n.setAttribute("rel","stylesheet"),n.setAttribute("href",t),n}var Kf=(()=>{class t{doc;appId;nonce;inline=new Map;external=new Map;hosts=new Set;constructor(n,o,r,i={}){this.doc=n,this.appId=o,this.nonce=r,QM(n,o,this.inline,this.external)&&this.hosts.add(n.head)}addStyles(n,o){for(let r of n)this.addUsage(r,this.inline,T_);o?.forEach(r=>this.addUsage(r,this.external,Yf))}removeStyles(n,o){for(let r of n)this.removeUsage(r,this.inline);o?.forEach(r=>this.removeUsage(r,this.external))}addUsage(n,o,r){let i=o.get(n);i?i.usage++:o.set(n,{usage:1,elements:[...this.hosts].map(s=>this.addElement(s,r(n,this.doc)))})}removeUsage(n,o){let r=o.get(n);r&&(r.usage--,r.usage<=0&&(S_(r.elements),o.delete(n)))}ngOnDestroy(){for(let[,{elements:n}]of[...this.inline,...this.external])S_(n);this.hosts.clear()}addHost(n){if(!this.hosts.has(n)){this.hosts.add(n);for(let[o,{elements:r}]of this.inline)r.push(this.addElement(n,T_(o,this.doc)));for(let[o,{elements:r}]of this.external)r.push(this.addElement(n,Yf(o,this.doc)))}}removeHost(n){this.hosts.delete(n);for(let o of[...this.inline.values(),...this.external.values()]){let r=[];for(let i of o.elements)i.parentNode===n?i.remove():r.push(i);o.elements=r}}addElement(n,o){return this.nonce&&o.setAttribute("nonce",this.nonce),n.appendChild(o)}static \u0275fac=function(o){return new(o||t)(it(_n),it(Gs),it(Zc,8),it(Ws))};static \u0275prov=Pe({token:t,factory:t.\u0275fac})}return t})(),qf={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/Math/MathML"},Qf=/%COMP%/g;var I_="%COMP%",XM=`_nghost-${I_}`,JM=`_ngcontent-${I_}`,eI=!0,tI=new $e("",{factory:()=>eI}),nI=new $e("");function oI(t){return JM.replace(Qf,t)}function rI(t){return XM.replace(Qf,t)}function D_(t,e){return e.map(n=>n.replace(Qf,t))}var Xf=(()=>{class t{eventManager;sharedStylesHost;appId;removeStylesOnCompDestroy;doc;ngZone;nonce;tracingService;rendererByCompId=new Map;defaultRenderer;cssVarNamespace;constructor(n,o,r,i,s,a,c=null,l=null,d=null){this.eventManager=n,this.sharedStylesHost=o,this.appId=r,this.removeStylesOnCompDestroy=i,this.doc=s,this.ngZone=a,this.nonce=c,this.tracingService=l,this.cssVarNamespace=d??"",this.defaultRenderer=new ma(n,s,a,this.tracingService,this.cssVarNamespace)}createRenderer(n,o){if(!n||!o)return this.defaultRenderer;let r=this.getOrCreateRenderer(n,o);return r instanceof Pl?r.applyToHost(n):r instanceof ha&&r.applyStyles(),r}getOrCreateRenderer(n,o){let r=this.rendererByCompId,i=r.get(o.id);if(!i){let s=this.doc,a=this.ngZone,c=this.eventManager,l=this.sharedStylesHost,d=this.removeStylesOnCompDestroy,u=this.tracingService;switch(o.encapsulation){case fo.Emulated:i=new Pl(c,l,o,this.appId,d,s,a,u,this.cssVarNamespace);break;case fo.ShadowDom:return new Rl(c,n,o,s,a,this.nonce,u,this.cssVarNamespace,l);case fo.ExperimentalIsolatedShadowDom:return new Rl(c,n,o,s,a,this.nonce,u,this.cssVarNamespace);default:i=new ha(c,l,o,d,s,a,u,this.cssVarNamespace);break}r.set(o.id,i)}return i}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(n){this.rendererByCompId.delete(n)}static \u0275fac=function(o){return new(o||t)(it(Zf),it(ri),it(Gs),it(tI),it(_n),it(En),it(Zc),it(Yo,8),it(nI,8))};static \u0275prov=Pe({token:t,factory:t.\u0275fac})}return t})(),ma=class{eventManager;doc;ngZone;tracingService;cssVarNamespace;data=Object.create(null);throwOnSyntheticProps=!0;constructor(e,n,o,r,i=""){this.eventManager=e,this.doc=n,this.ngZone=o,this.tracingService=r,this.cssVarNamespace=i}destroy(){}destroyNode=null;createElement(e,n){return n?this.doc.createElementNS(qf[n]||n,e):this.doc.createElement(e)}createComment(e){return this.doc.createComment(e)}createText(e){return this.doc.createTextNode(e)}appendChild(e,n){(M_(e)?e.content:e).appendChild(n)}insertBefore(e,n,o){if(e){let r=M_(e)?e.content:e;if(o!=null&&o.parentNode!==r)throw new be(-5106,!1);r.insertBefore(n,o)}}removeChild(e,n){n.remove()}selectRootElement(e,n){let o=typeof e=="string"?this.doc.querySelector(e):e;if(!o)throw new be(-5104,!1);return n||(o.textContent=""),o}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,n,o,r){if(r){n=r+":"+n;let i=qf[r];i?e.setAttributeNS(i,n,o):e.setAttribute(n,o)}else e.setAttribute(n,o)}removeAttribute(e,n,o){if(o){let r=qf[o];r?e.removeAttributeNS(r,n):e.removeAttribute(`${o}:${n}`)}else e.removeAttribute(n)}addClass(e,n){e.classList.add(n)}removeClass(e,n){e.classList.remove(n)}setStyle(e,n,o,r){let i=n.startsWith("--");i&&(n=n.replace("%NS%",this.cssVarNamespace)),i||r&(zo.DashCase|zo.Important)?e.style.setProperty(n,o,r&zo.Important?"important":""):e.style[n]=o}removeStyle(e,n,o){let r=n.startsWith("--");r&&(n=n.replace("%NS%",this.cssVarNamespace)),r||o&zo.DashCase?e.style.removeProperty(n):e.style[n]=""}setProperty(e,n,o){e!=null&&(e[n]=o)}setValue(e,n){e.nodeValue=n}listen(e,n,o,r){if(typeof e=="string"&&(e=Ji().getGlobalEventTarget(this.doc,e),!e))throw new be(-5102,!1);let i=this.decoratePreventDefault(o);return this.tracingService?.wrapEventListener&&(i=this.tracingService.wrapEventListener(e,n,i)),this.eventManager.addEventListener(e,n,i,r)}decoratePreventDefault(e){return n=>{if(n==="__ngUnwrap__")return e;e(n)===!1&&n.preventDefault()}}};function M_(t){return t.tagName==="TEMPLATE"&&t.content!==void 0}var Rl=class extends ma{hostEl;sharedStylesHost;shadowRoot;constructor(e,n,o,r,i,s,a,c,l){super(e,r,i,a,c),this.hostEl=n,this.sharedStylesHost=l,this.shadowRoot=n.attachShadow({mode:"open"}),this.sharedStylesHost&&this.sharedStylesHost.addHost(this.shadowRoot);let d=o.styles;d=D_(o.id,d).map(m=>m.replace(/%NS%/g,c));for(let m of d){let h=document.createElement("style");s&&h.setAttribute("nonce",s),h.textContent=m,this.shadowRoot.appendChild(h)}let u=o.getExternalStyles?.();if(u)for(let m of u){let h=Yf(m,r);s&&h.setAttribute("nonce",s),this.shadowRoot.appendChild(h)}}nodeOrShadowRoot(e){return e===this.hostEl?this.shadowRoot:e}appendChild(e,n){return super.appendChild(this.nodeOrShadowRoot(e),n)}insertBefore(e,n,o){return super.insertBefore(this.nodeOrShadowRoot(e),n,o)}removeChild(e,n){return super.removeChild(null,n)}parentNode(e){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(e)))}destroy(){this.sharedStylesHost&&this.sharedStylesHost.removeHost(this.shadowRoot)}},ha=class extends ma{sharedStylesHost;removeStylesOnCompDestroy;styles;styleUrls;constructor(e,n,o,r,i,s,a,c,l){super(e,i,s,a,c),this.sharedStylesHost=n,this.removeStylesOnCompDestroy=r;let d=o.styles,u=l?D_(l,d):d;this.styles=u.map(m=>m.replace(/%NS%/g,c)),this.styleUrls=o.getExternalStyles?.(l)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){this.removeStylesOnCompDestroy&&Ef.size===0&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}},Pl=class extends ha{contentAttr;hostAttr;constructor(e,n,o,r,i,s,a,c,l){let d=r+"-"+o.id;super(e,n,o,i,s,a,c,l,d),this.contentAttr=oI(d),this.hostAttr=rI(d)}applyToHost(e){this.applyStyles(),this.setAttribute(e,this.hostAttr,"")}createElement(e,n){let o=super.createElement(e,n);return super.setAttribute(o,this.contentAttr,""),o}};var Fl=class t extends pa{supportsDOMEvents=!0;static makeCurrent(){zf(new t)}onAndCancel(e,n,o,r){return e.addEventListener(n,o,r),()=>{e.removeEventListener(n,o,r)}}dispatchEvent(e,n){e.dispatchEvent(n)}remove(e){e.remove()}createElement(e,n){return n=n||this.getDefaultDocument(),n.createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,n){return n==="window"?window:n==="document"?e:n==="body"?e.body:null}getBaseHref(e){let n=iI();return n==null?null:sI(n)}resetBaseElement(){ga=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return Gf(document.cookie,e)}},ga=null;function iI(){return ga=ga||document.head.querySelector("base"),ga?ga.getAttribute("href"):null}function sI(t){return new URL(t,document.baseURI).pathname}var k_=["alt","control","meta","shift"],aI={"\b":"Backspace"," ":"Tab","\x7F":"Delete","\x1B":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},cI={alt:t=>t.altKey,control:t=>t.ctrlKey,meta:t=>t.metaKey,shift:t=>t.shiftKey},N_=(()=>{class t extends fa{constructor(n){super(n)}supports(n){return t.parseEventName(n)!=null}addEventListener(n,o,r,i){let s=t.parseEventName(o),a=t.eventCallback(s.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Ji().onAndCancel(n,s.domEventName,a,i))}static parseEventName(n){let o=n.toLowerCase().split("."),r=o.shift();if(o.length===0||!(r==="keydown"||r==="keyup"))return null;let i=t._normalizeKey(o.pop()),s="",a=o.indexOf("code");if(a>-1&&(o.splice(a,1),s="code."),k_.forEach(l=>{let d=o.indexOf(l);d>-1&&(o.splice(d,1),s+=l+".")}),s+=i,o.length!=0||i.length===0)return null;let c={};return c.domEventName=r,c.fullKey=s,c}static matchEventFullKeyCode(n,o){let r=aI[n.key]||n.key,i="";return o.indexOf("code.")>-1&&(r=n.code,i="code."),r==null||!r?!1:(r=r.toLowerCase(),r===" "?r="space":r==="."&&(r="dot"),k_.forEach(s=>{if(s!==r){let a=cI[s];a(n)&&(i+=s+".")}}),i+=r,i===o)}static eventCallback(n,o,r){return i=>{t.matchEventFullKeyCode(i,n)&&r.runGuarded(()=>o(i))}}static _normalizeKey(n){return n==="esc"?"escape":n}static \u0275fac=function(o){return new(o||t)(it(_n))};static \u0275prov=Pe({token:t,factory:t.\u0275fac})}return t})();async function Jf(t,e,n){let o=V({rootComponent:t},lI(e,n));return x_(o)}function lI(t,e){return{platformRef:e?.platformRef,appProviders:[...mI,...t?.providers??[]],platformProviders:fI}}function dI(){Fl.makeCurrent()}function uI(){return new zn}function pI(){return lf(document),document}var fI=[{provide:Ws,useValue:w_},{provide:Yc,useValue:dI,multi:!0},{provide:_n,useFactory:pI}];var mI=[{provide:Vs,useValue:"root"},{provide:zn,useFactory:uI},{provide:Ll,useClass:Al,multi:!0},{provide:Ll,useClass:N_,multi:!0},Xf,{provide:ri,useClass:Kf},{provide:Kf,useExisting:ri},Zf,{provide:Go,useExisting:Xf},[]];var em=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275prov=Pe({token:t,factory:function(o){let r=null;return o?r=new(o||t):r=it(hI),r},providedIn:"root"})}return t})(),hI=(()=>{class t extends em{_doc=O(_n);sanitize(n,o){if(o==null)return null;switch(n){case Ct.NONE:return o;case Ct.HTML:return Wo(o,"HTML")?Zn(o):El(this._doc,String(o)).toString();case Ct.STYLE:return Wo(o,"Style")?Zn(o):o;case Ct.SCRIPT:if(Wo(o,"Script"))return Zn(o);throw new be(5200,!1);case Ct.URL:return Wo(o,"URL")?Zn(o):ia(String(o));case Ct.RESOURCE_URL:if(Wo(o,"ResourceURL"))return Zn(o);throw new be(-5201,!1);default:throw new be(5202,!1)}}bypassSecurityTrustHtml(n){return pf(n)}bypassSecurityTrustStyle(n){return ff(n)}bypassSecurityTrustScript(n){return mf(n)}bypassSecurityTrustUrl(n){return hf(n)}bypassSecurityTrustResourceUrl(n){return gf(n)}static \u0275fac=function(o){return new(o||t)};static \u0275prov=Zi({token:t,factory:t.\u0275fac})}return t})();var O_={providers:[fp()]};var Qn=typeof window<"u",Vl=Qn?window:null,fr=Qn?document:null,dt={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},Ee={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},qt={NONE:0,AUTO:1,FORCE:2},Et={replace:0,none:1,blend:2},tm=Symbol(),Do=Symbol(),$l=Symbol(),mr=Symbol(),jl=Symbol(),xe=1e-11,ya=1e12,Xn=1e3,va=240,Jn="",A_="var(",_a=[],Hl=(()=>{let t=new Map;return t.set("x","translateX"),t.set("y","translateY"),t.set("z","translateZ"),t})(),es=["perspective","translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY"],R_=es.reduce((t,e)=>Q(V({},t),{[e]:e+"("}),{}),Vt=()=>{},P_=t=>t,L_=/\)\s*[-.\d]/,F_=/(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i,V_=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,$_=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,j_=/hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i,H_=/hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,nm=/[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi,Bl=/^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i,B_=/([a-z])([A-Z])/g,U_=/(\*=|\+=|-=)/,z_=/var\(\s*(--[\w-]+)(?:\s*,\s*([^)]+))?\s*\)/;var ts={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:va,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:Xn,delay:0,loopDelay:0,ease:"out(2)",composition:Et.replace,modifier:P_,onBegin:Vt,onBeforeUpdate:Vt,onUpdate:Vt,onLoop:Vt,onPause:Vt,onComplete:Vt,onRender:Vt},ba={current:null,root:fr},ve={defaults:ts,precision:4,timeScale:1,tickThreshold:200,editor:null},om={version:"4.5.0",engine:null};Qn&&(Vl.AnimeJS||(Vl.AnimeJS=[]),Vl.AnimeJS.push(om));var im=t=>t.replace(B_,"$1-$2").toLowerCase(),Rn=(t,e)=>t.indexOf(e)===0,Ko=Date.now,Pn=Array.isArray,ai=t=>t&&t.constructor===Object,wn=t=>typeof t=="number"&&!isNaN(t),Sn=t=>typeof t=="string",Yt=t=>typeof t=="function",J=t=>typeof t>"u",ko=t=>J(t)||t===null,Ul=t=>Qn&&t instanceof SVGElement,sm=t=>F_.test(t),am=t=>Rn(t,"rgb"),cm=t=>Rn(t,"hsl"),G_=t=>sm(t)||(am(t)||cm(t))&&(t[t.length-1]===")"||!L_.test(t)),Ea=t=>!ve.defaults.hasOwnProperty(t),gI=["opacity","rotate","overflow","color"],W_=(t,e)=>{if(gI.includes(e))return!1;if(t.getAttribute(e)||e in t){if(e==="scale"){let n=t.parentNode;return n&&n.tagName==="filter"}return!0}},zl=t=>Sn(t)?parseFloat(t):t,ci=Math.pow,hr=Math.sqrt,q_=Math.sin,Y_=Math.cos,si=Math.abs;var li=Math.floor,Z_=Math.asin;var xa=Math.PI,rm=Math.round,dn=(t,e,n)=>t<e?e:t>n?n:t,Fe=(t,e)=>{if(e<0)return t;if(!e)return rm(t);let n=10**e;return rm(t*n)/n},K_=(t,e)=>Pn(e)?e.reduce((n,o)=>si(o-t)<si(n-t)?o:n):e?rm(t/e)*e:t,Qo=(t,e,n)=>n===1?e:n===0?t:t+(e-t)*n,di=t=>t===1/0?ya:t===-1/0?-ya:t,Xo=t=>t<=xe?xe:di(Fe(t,11)),$t=t=>Pn(t)?[...t]:t,Gl=(t,e)=>{let n=V({},t);for(let o in e){let r=t[o];n[o]=J(r)?e[o]:r}return n},Qe=(t,e,n,o="_prev",r="_next")=>{let i=t._head,s=r;for(n&&(i=t._tail,s=o);i;){let a=i[s];e(i),i=a}},Ln=(t,e,n="_prev",o="_next")=>{let r=e[n],i=e[o];r?r[o]=i:t._head=i,i?i[n]=r:t._tail=r,e[n]=null,e[o]=null},Tn=(t,e,n,o="_prev",r="_next")=>{let i=t._tail;for(;i&&n&&n(i,e);)i=i[o];let s=i?i[r]:t._head;i?i[r]=e:t._head=e,s?s[o]=e:t._tail=e,e[o]=i,e[r]=s};var Q_=(t,e,n)=>{let o=t.style.transform;if(o){let r=t[mr],i=0,s=o.length,a;for(;i<s;){for(;i<s&&o.charCodeAt(i)===32;)i++;if(i>=s)break;let l=i;for(;i<s&&o.charCodeAt(i)!==40;)i++;if(i>=s)break;let d=o.substring(l,i),u=1,m=i+1,h=-1,y=-1;for(i++;i<s&&u>0;){let M=o.charCodeAt(i);M===40?u++:M===41?u--:M===44&&u===1&&(h===-1?h=i:y===-1&&(y=i)),i++}let E=i-1;d==="translate"||d==="translate3d"?(h===-1?r.translateX=o.substring(m,E).trim():(r.translateX=o.substring(m,h).trim(),y===-1?r.translateY=o.substring(h+1,E).trim():(r.translateY=o.substring(h+1,y).trim(),r.translateZ=o.substring(y+1,E).trim())),a=o.substring(m,E)):d==="scale"||d==="scale3d"?h===-1?r.scale=o.substring(m,E).trim():(r.scaleX=o.substring(m,h).trim(),y===-1?r.scaleY=o.substring(h+1,E).trim():(r.scaleY=o.substring(h+1,y).trim(),r.scaleZ=o.substring(y+1,E).trim())):r[d]=o.substring(m,E)}if(e==="translate3d"&&a)return n&&(n[e]=a),a;let c=r[e];if(!J(c))return n&&(n[e]=c),c}return e==="translate3d"?"0px, 0px, 0px":e==="rotate3d"?"0, 0, 0, 0deg":Rn(e,"scale")?"1":Rn(e,"rotate")||Rn(e,"skew")?"0deg":"0px"},Wl=t=>{let e=Jn;for(let n=0,o=es.length;n<o;n++){let r=es[n],i=t[r];if(i!==void 0){if(r==="translateX"){let s=t.translateY;if(s!==void 0){let a=t.translateZ;a!==void 0?(e+=`translate3d(${i},${s},${a}) `,n+=2):(e+=`translate(${i},${s}) `,n+=1);continue}}if(r==="scaleX"&&t.scale===void 0){let s=t.scaleY;if(s!==void 0){let a=t.scaleZ;a!==void 0?(e+=`scale3d(${i},${s},${a}) `,n+=2):(e+=`scale(${i},${s}) `,n+=1);continue}}e+=`${R_[r]}${i}) `}r==="rotateZ"&&t.rotate3d!==void 0&&(e+=`rotate3d(${t.rotate3d}) `)}return t.matrix!==void 0&&(e+=`matrix(${t.matrix}) `),t.matrix3d!==void 0&&(e+=`matrix3d(${t.matrix3d}) `),e};var lm=[];function ql(t,e){if(!t)return null;let n=lm.length;e:for(let o=0;o<n;o++){let r=lm[o];if(r.detect&&!r.detect(t))continue;let i=r.targetAdapters;for(let s=0,a=i.length;s<a;s++){let c=i[s];if(c.detect(t)){let l=c.props[e];if(l&&(!l.gate||l.gate(t)))return l;break e}}}for(let o=0;o<n;o++){let r=lm[o];if(r.detect&&!r.detect(t))continue;let i=r.propertyResolvers;for(let s=0,a=i.length;s<a;s++){let c=i[s](t,e);if(c)return c}}return null}var yI=t=>{let e=V_.exec(t)||$_.exec(t),n=J(e[4])?1:+e[4];return[+e[1],+e[2],+e[3],n]},vI=t=>{let e=t.length,n=e===4||e===5;return[+("0x"+t[1]+t[n?1:2]),+("0x"+t[n?2:3]+t[n?2:4]),+("0x"+t[n?3:5]+t[n?3:6]),e===5||e===9?+(+("0x"+t[n?4:7]+t[n?4:8])/255).toFixed(3):1]},dm=(t,e,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t),_I=t=>{let e=j_.exec(t)||H_.exec(t),n=+e[1]/360,o=+e[2]/100,r=+e[3]/100,i=J(e[4])?1:+e[4],s,a,c;if(o===0)s=a=c=r;else{let l=r<.5?r*(1+o):r+o-r*o,d=2*r-l;s=Fe(dm(d,l,n+1/3)*255,0),a=Fe(dm(d,l,n)*255,0),c=Fe(dm(d,l,n-1/3)*255,0)}return[s,a,c,i]},X_=t=>am(t)?yI(t):sm(t)?vI(t):cm(t)?_I(t):[0,0,0,1];var xt=(t,e)=>J(t)?e:t,J_=(t,e)=>{let n=t.match(z_),o=e[Do]?e:document.documentElement,r=getComputedStyle(o)?.getPropertyValue(n[1]);return(!r||r.trim()===Jn)&&n[2]&&(r=n[2].trim()),r||0},No=(t,e,n,o,r,i)=>{if(Yt(t)){if(!r){let a=t(e,n,o,i);return isNaN(+a)?a||0:+a}let s=()=>{let a=t(e,n,o,i);return isNaN(+a)?a||0:+a};return r.func=s,s()}if(Sn(t)&&Rn(t,A_)){if(!r)return J_(t,e);let s=()=>J_(t,e);return r.func=s,s()}return t},Ca=(t,e)=>t[Do]?t[$l]&&W_(t,e)?dt.ATTRIBUTE:es.includes(e)||Hl.get(e)?dt.TRANSFORM:Rn(e,"--")?dt.CSS_VAR:e in t.style?dt.CSS:e in t?dt.OBJECT:dt.ATTRIBUTE:dt.OBJECT,eb=(t,e,n)=>{let o=t.style[e];o&&n&&(n[e]=o);let r=o||getComputedStyle(t[jl]||t).getPropertyValue(e);return r==="auto"?"0":r},Oo=(t,e,n,o)=>{let r=J(n)?Ca(t,e):n,i=ql(t,e);if(i){let s=i.get(t);return s&&o&&(o[e]=s),s??0}if(r===dt.OBJECT){let s=t[e];return s&&o&&(o[e]=s),s||0}if(r===dt.ATTRIBUTE){let s=t.getAttribute(e);return s&&o&&(o[e]=s),s}return r===dt.TRANSFORM?Q_(t,e,o):r===dt.CSS_VAR?eb(t,e,o).trimStart():eb(t,e,o)},ns=(t,e,n)=>n==="-"?t-e:n==="+"?t+e:t*e,Yl=()=>({t:Ee.NUMBER,n:0,u:null,o:null,d:null,s:null}),un=(t,e)=>{if(e.t=Ee.NUMBER,e.n=0,e.u=null,e.o=null,e.d=null,e.s=null,!t)return e;let n=+t;if(!isNaN(n))return e.n=n,e;let o=t;o[1]==="="&&(e.o=o[0],o=o.slice(2));let r=o.includes(" ")?!1:Bl.exec(o);if(r)return e.t=Ee.UNIT,e.n=+r[1],e.u=r[2],e;if(e.o)return e.n=+o,e;if(G_(o))return e.t=Ee.COLOR,e.d=X_(o),e;{let i=o.match(nm);return e.t=Ee.COMPLEX,e.d=i?i.map(Number):[],e.s=o.split(nm)||[],e}},um=(t,e)=>(e.t=t._valueType,e.n=t._toNumber,e.u=t._unit,e.o=null,e.d=$t(t._toNumbers),e.s=$t(t._strings),e),Zt=Yl(),Zl=(t,e,n)=>{let o=t._modifier,r=t._fromNumbers,i=t._toNumbers,s=t._strings,a=s[0];for(let c=0,l=i.length;c<l;c++){let d=o(Fe(Qo(r[c],i[c],e),n)),u=s[c+1];a+=`${u?d+u:d}`,t._numbers[c]=d}return a};var wa=(t,e,n,o,r)=>{let i=t.parent,s=t.duration,a=t.completed,c=t.iterationDuration,l=t.iterationCount,d=t._currentIteration,u=t._loopDelay,m=t._reversed,h=t._alternate,y=t._hasChildren,E=t._delay,M=t._currentTime,W=E+c,z=e-E,me=dn(M,-E,s),ae=dn(z,-E,s),ge=z-M,re=ae>0,We=ae>=s,Te=s<=xe,De=r===qt.FORCE,at=0,yt=z,Tt=0;if(l>1){let q=c+(We?0:u),B=~~(ae/q);t._currentIteration=dn(B,0,l),We&&t._currentIteration--,at=t._currentIteration%2,yt=ae-B*q||0}let _t=m^(h&&at),qe=t._ease,pe=We?_t?0:s:_t?c-yt:yt;qe&&(pe=c*qe(pe/c)||0);let S=(i?i.backwards:z<M)?!_t:!!_t;if(t._currentTime=z,t._iterationTime=pe,t.backwards=S,re&&!t.began?(t.began=!0,!n&&!(i&&(S||!i.began))&&t.onBegin(t)):z<=0&&(t.began=!1),!n&&!y&&re&&t._currentIteration!==d&&t.onLoop(t),De||r===qt.AUTO&&(e>=(i&&E>0?0:E)&&e<=W||e<=E&&me>E||e>=W&&me!==s)||pe>=W&&me!==s||pe<=E&&me>0&&!We||e<=me&&me===s&&a||We&&!a&&Te){if(re&&(t.computeDeltaTime(me),n||t.onBeforeUpdate(t)),!y){let q=De||(S?ge*-1:ge)>=ve.tickThreshold,B=Fe(t._offset+(i?i._offset:0)+E+pe,12),I=t._head,K,we,Ye,Ot,de=0;for(;I;){let ft=I._composition,Ne=I._currentTime,Xt=I._changeDuration,At=I._absoluteStartTime+I._changeDuration,Ve=I._nextRep,Lt=I._prevRep,Mt=ft!==Et.none,Ce=Lt?Lt._absoluteStartTime+Lt._changeDuration:0,Ae=Lt&&Lt.parent!==I.parent,ye=!Ve||Ve._isOverridden?At:Ve.parent===I.parent?At+Ve._delay:Ve._absoluteStartTime<Ve._absoluteUpdateStartTime?Ve._absoluteStartTime:Ve._absoluteUpdateStartTime;if((q||(Ne!==Xt||B<=ye||Lt&&!Ae&&(!Ve||Ve.parent!==I.parent))&&(Ne!==0||B>=I._absoluteStartTime||Ae&&!I._hasFromValue&&!Lt._isOverridden&&B>=Ce||Ve&&!Ve._isOverridden&&Ve.parent===I.parent&&Ve._currentTime!==0&&pe<Ve._startTime))&&(!Lt||Ae||pe>=I._startTime)&&(!Mt||!I._isOverridden&&(!I._isOverlapped||B<=At)&&(!Ve||Ve._isOverridden||B<=ye)&&(!Lt||Lt._isOverridden||(Ae?B>=I._absoluteStartTime||!I._hasFromValue&&B>=Ce:B>=Ce+I._delay)))){let Xe=I._currentTime=dn(pe-I._startTime,0,Xt),ne=I._ease(Xe/I._updateDuration),rt=I._modifier,G=I._valueType,ut=I._tweenType,Ue=ut===dt.OBJECT,te=G===Ee.NUMBER,ht=te&&Ue||ne===0||ne===1?-1:ve.precision,ue,nt;if(te)ue=nt=rt(Fe(Qo(I._fromNumber,I._toNumber,ne),ht));else if(G===Ee.UNIT)nt=rt(Fe(Qo(I._fromNumber,I._toNumber,ne),ht)),ue=`${nt}${I._unit}`;else if(G===Ee.COLOR){let Oe=I._numbers,N=I._fromNumbers,L=I._toNumbers,Z=1-ne,oe=N[0],ct=N[1],vt=N[2],jn=L[0],ln=L[1],go=L[2];Oe[0]=rt(Math.sqrt(oe*oe*Z+jn*jn*ne)),Oe[1]=rt(Math.sqrt(ct*ct*Z+ln*ln*ne)),Oe[2]=rt(Math.sqrt(vt*vt*Z+go*go*ne)),Oe[3]=rt(Qo(N[3],L[3],ne)),(!I._setter||o)&&(ue=`rgba(${Fe(Oe[0],0)},${Fe(Oe[1],0)},${Fe(Oe[2],0)},${Oe[3]})`)}else G===Ee.COMPLEX&&(ue=Zl(I,ne,ht));if(Mt&&(I._number=nt),!o&&ft!==Et.blend){let Oe=I.property;K=I.target,I._setter?I._setter(K,nt,I):Ue?K[Oe]=ue:ut===dt.ATTRIBUTE?K.setAttribute(Oe,ue):(we=K.style,ut===dt.TRANSFORM?(K!==Ye&&(Ye=K,Ot=K[mr]),Ot[Oe]=ue,de=1):ut===dt.CSS?we[Oe]=ue:ut===dt.CSS_VAR&&we.setProperty(Oe,ue)),re&&(Tt=1)}else I._value=ue}else Ne&&Lt&&!Ae&&pe<I._startTime&&(I._currentTime=0);de&&I._renderTransforms&&(we.transform=Wl(Ot),de=0),I=I._next}!n&&Tt&&t.onRender(t)}!n&&re&&t.onUpdate(t)}return i&&Te?!n&&(i.began&&!S&&z>0&&!a||S&&z<=xe&&a)&&(t.onComplete(t),t.completed=!S):re&&We?l===1/0?t._startTime+=t.duration:t._currentIteration>=l-1&&(t.paused=!0,!a&&!y&&(t.completed=!0,!n&&!(i&&(S||!i.began))&&(t.onComplete(t),t._resolve(t)))):t.completed=!1,Tt},Ao=(t,e,n,o,r)=>{let i=t._currentIteration;if(wa(t,e,n,o,r),t._hasChildren){let s=t,a=s.backwards,c=o?e:s._iterationTime,l=Ko(),d=0,u=!0;if(!o&&s._currentIteration!==i){let m=s.iterationDuration;Qe(s,h=>{if(!a)!h.completed&&!h.backwards&&h._currentTime<h.iterationDuration&&wa(h,m,n,1,qt.FORCE),h.began=!1,h.completed=!1;else{let y=h.duration,E=h._offset+h._delay,M=E+y;!n&&y<=xe&&(!E||M===m)&&h.onComplete(h)}}),n||s.onLoop(s)}Qe(s,m=>{let h=Fe((c-m._offset)*m._speed,12);if(a&&h>m._delay+m.duration)return;let y=m._fps<s._fps?m.requestTick(l):r;d+=wa(m,h,n,o,y),!m.completed&&u&&(u=!1)},a),!n&&d&&s.onRender(s),(u||a)&&s._currentTime>=s.duration&&(s.paused=!0,s.completed||(s.completed=!0,n||(s.onComplete(s),s._resolve(s))))}};var tb={},os=(t,e,n)=>{if(n===dt.TRANSFORM){let o=Hl.get(t);return o||t}else if(n===dt.CSS||n===dt.ATTRIBUTE&&Ul(e)&&t in e.style){let o=tb[t];if(o)return o;{let r=t&&im(t);return tb[t]=r,r}}else return t},rs=(t,e=!1)=>{if(t._hasChildren)Qe(t,n=>rs(n,e),!0);else{let n=t;n.pause(),Qe(n,o=>{let r=o.property,i=o.target,s=o._tweenType,a=o._inlineValue,c=ko(a)||a===Jn;if(o._setter){if(!e&&!c){if(un(a,Zt),Zt.d){let l=Zt.d,d=o._numbers;for(let u=0,m=l.length;u<m;u++)d[u]=l[u]}else o._number=Zt.n;o._setter(o.target,o._number,o)}}else if(s===dt.OBJECT)!e&&!c&&(i[r]=a);else if(i[Do])if(s===dt.ATTRIBUTE)e||(c?i.removeAttribute(r):i.setAttribute(r,a));else{let l=i.style;if(s===dt.TRANSFORM){let d=i[mr];c?delete d[r]:d[r]=a,o._renderTransforms&&(Object.keys(d).length?l.transform=Wl(d):l.removeProperty("transform"))}else c?l.removeProperty(im(r)):l[r]=a}i[Do]&&n._tail===o&&n.targets.forEach(l=>{l.getAttribute&&l.getAttribute("style")===Jn&&l.removeAttribute("style")})})}return t},nb=t=>rs(t,!0);var is=class{constructor(e=0){this.deltaTime=0,this._currentTime=e,this._lastTickTime=e,this._startTime=e,this._lastTime=e,this._frameDuration=Xn/va,this._fps=va,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(e){let n=+e,o=n<xe?xe:n,r=Xn/o;o>ts.frameRate&&(ts.frameRate=o),this._fps=o,this._frameDuration=r}get speed(){return this._speed}set speed(e){let n=+e;this._speed=n<xe?xe:n}requestTick(e){let n=this._frameDuration,o=e-this._lastTickTime,r=n*.25,i=r<4?r:4;return o+i<n?qt.NONE:(this._lastTickTime=o>=n?e-o%n:e,qt.AUTO)}computeDeltaTime(e){let n=e-this._lastTime;return this.deltaTime=n,this._lastTime=e,n}};var Jo={animation:null,update:Vt},ob=t=>{let e=Jo.animation;return e||(e={duration:xe,computeDeltaTime:Vt,_offset:0,_delay:0,_head:null,_tail:null},Jo.animation=e,Jo.update=()=>{t.forEach(n=>{for(let o in n){let r=n[o],i=r._head;if(i){let s=i._valueType,a=s===Ee.COMPLEX||s===Ee.COLOR?$t(i._fromNumbers):null,c=i._fromNumber,l=r._tail;for(;l&&l!==i;){if(a)for(let d=0,u=l._numbers.length;d<u;d++)a[d]+=l._numbers[d];else c+=l._number;l=l._prevAdd}i._toNumber=c,i._toNumbers=a}}}),wa(e,1,1,0,qt.FORCE)}),e};var rb=Qn?requestAnimationFrame:setImmediate,bI=Qn?cancelAnimationFrame:clearImmediate,pm=class extends is{constructor(e){super(e),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=ts,this.paused=!0,this.reqId=0}update(){let e=this._currentTime=Ko();if(this.requestTick(e)){this.computeDeltaTime(e);let n=this._speed,o=this._fps,r=this._head;for(;r;){let i=r._next;r.paused?(Ln(this,r),this._hasChildren=!!this._tail,r._running=!1,r.completed&&!r._cancelled&&r.cancel()):Ao(r,(e-r._startTime)*r._speed*n,0,0,r._fps<o?r.requestTick(e):qt.AUTO),r=i}Jo.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(Ko()),this.reqId=rb(ib)),this}pause(){if(this.reqId)return this.paused=!0,EI()}resume(){if(this.paused)return this.paused=!1,Qe(this,e=>e.resetTime()),this.wake()}get speed(){return this._speed*(ve.timeScale===1?1:Xn)}set speed(e){let n=e*ve.timeScale;this._speed!==n&&(this._speed=n,Qe(this,o=>o.speed=o._speed))}get timeUnit(){return ve.timeScale===1?"ms":"s"}set timeUnit(e){let o=e==="s",r=o?.001:1;if(ve.timeScale!==r){ve.timeScale=r,ve.tickThreshold=200*r;let i=o?.001:Xn;this.defaults.duration*=i,this._speed*=i}}get precision(){return ve.precision}set precision(e){ve.precision=e}},Kt=(()=>{let t=new pm(Ko());return Qn&&(om.engine=t,fr.addEventListener("visibilitychange",()=>{t.pauseOnDocumentHidden&&(fr.hidden?t.pause():t.resume())})),t})(),ib=()=>{Kt._head?(Kt.reqId=rb(ib),Kt.update()):Kt.reqId=0},EI=()=>(bI(Kt.reqId),Kt.reqId=0,Kt);var Kl={_rep:new WeakMap,_add:new Map},Ta=(t,e,n="_rep")=>{let o=Kl[n],r=o.get(t);return r||(r={},o.set(t,r)),r[e]?r[e]:r[e]={_head:null,_tail:null}},xI=(t,e)=>t._isOverridden||t._absoluteStartTime>e._absoluteStartTime,Sa=t=>{t._isOverlapped=1,t._isOverridden=1,t._changeDuration=xe,t._currentTime=xe},Ql=(t,e)=>{let n=t._composition;if(n===Et.replace){let o=t._absoluteStartTime;Tn(e,t,xI,"_prevRep","_nextRep");let r=t._prevRep;if(r){let i=r.parent,s=r._absoluteEndTime;if(t.parent.id!==i.id&&i.iterationCount>1&&s+(i.duration-i.iterationDuration)>o){Sa(r);let l=r._prevRep;for(;l&&l.parent.id===i.id;)Sa(l),l=l._prevRep}let a=t._absoluteUpdateStartTime;if(s>a){let l=r._startTime,d=s-(l+r._updateDuration),u=Fe(a-d-l,12);r._changeDuration=u,r._currentTime=u,r._isOverlapped=1,u<xe&&Sa(r)}let c=t.parent.parent;if(!c||c!==i.parent){let l=!0;if(Qe(i,d=>{d._isOverlapped||(l=!1)}),l){let d=i.parent;if(d){let u=!0;Qe(d,m=>{m!==i&&Qe(m,h=>{h._isOverlapped||(u=!1)})}),u&&d.cancel()}else i.cancel()}}}}else if(n===Et.blend){let o=Ta(t.target,t.property,"_add"),r=ob(Kl._add),i=o._head;i||(i=V({},t),i._composition=Et.replace,i._updateDuration=xe,i._startTime=0,i._numbers=$t(t._fromNumbers),i._number=0,i._next=null,i._prev=null,Tn(o,i),Tn(r,i));let s=t._toNumber;if(t._fromNumber=i._fromNumber-s,t._toNumber=0,t._numbers=$t(t._fromNumbers),t._number=0,i._fromNumber=s,t._toNumbers.length){let a=$t(t._toNumbers);a.forEach((c,l)=>{t._fromNumbers[l]=i._fromNumbers[l]-c,t._toNumbers[l]=0}),i._fromNumbers=a}Tn(o,t,null,"_prevAdd","_nextAdd")}return t},fm=t=>{let e=t._composition;if(e!==Et.none){let n=t.target,o=t.property,s=Kl._rep.get(n)[o];if(Ln(s,t,"_prevRep","_nextRep"),e===Et.blend){let a=Kl._add,c=a.get(n);if(!c)return;let l=c[o],d=Jo.animation;Ln(l,t,"_prevAdd","_nextAdd");let u=l._head;if(u&&u===l._tail){Ln(l,u,"_prevAdd","_nextAdd"),Ln(d,u);let m=!0;for(let h in c)if(c[h]._head){m=!1;break}m&&a.delete(n)}}}return t},sb=(t,e,n)=>{let o=!1;return Qe(e,r=>{let i=r.target;if(t.includes(i)){let s=r.property,a=r._tweenType,c=os(n,i,a);(!c||c&&c===s)&&(r.parent._tail===r&&r._tweenType===dt.TRANSFORM&&r._prev&&r._prev._tweenType===dt.TRANSFORM&&(r._prev._renderTransforms=1),Ln(e,r),fm(r),o=!0)}},!0),o},Ma=(t,e,n)=>{let o=e||Kt,r;if(o._hasChildren){let i=0;Qe(o,s=>{if(!s._hasChildren)if(r=sb(t,s,n),r&&!s._head)s.cancel(),Ln(o,s);else{let c=s._offset+s._delay+s.duration;c>i&&(i=c)}s._head?Ma(t,s,n):s._hasChildren=!1},!0),J(o.iterationDuration)||(o.iterationDuration=i)}else r=sb(t,o,n);r&&!o._head&&(o._hasChildren=!1,o.cancel&&o.cancel())};var ab=t=>(t.paused=!0,t.began=!1,t.completed=!1,t),mm=t=>(t._cancelled&&(t._hasChildren?Qe(t,mm):Qe(t,e=>{e._composition!==Et.none&&Ql(e,Ta(e.target,e.property))}),t._cancelled=0),t),cb=0,CI=(t,e)=>t._priority>e._priority,er=class extends is{constructor(e={},n=null,o=0){super(0),++cb;let{id:r,delay:i,duration:s,reversed:a,alternate:c,loop:l,loopDelay:d,autoplay:u,frameRate:m,playbackRate:h,priority:y,onComplete:E,onLoop:M,onPause:W,onBegin:z,onBeforeUpdate:me,onUpdate:ae}=e;ba.current&&ba.current.register(this);let ge=n?0:Kt._lastTickTime,re=n?n.defaults:ve.defaults,We=Yt(i)||J(i)?re.delay:+i,Te=Yt(s)||J(s)?1/0:+s,De=xt(l,re.loop),at=xt(d,re.loopDelay),yt=De===!0||De===1/0||De<0?1/0:De+1,Tt=0;n?Tt=o:(Kt.reqId||Kt.requestTick(Ko()),Tt=(Kt._lastTickTime-Kt._startTime)*ve.timeScale),this.id=J(r)?cb:r,this.parent=n,this.duration=di((Te+at)*yt-at)||xe,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=z||re.onBegin,this.onBeforeUpdate=me||re.onBeforeUpdate,this.onUpdate=ae||re.onUpdate,this.onLoop=M||re.onLoop,this.onPause=W||re.onPause,this.onComplete=E||re.onComplete,this.iterationDuration=Te,this.iterationCount=yt,this._autoplay=n?!1:xt(u,re.autoplay),this._offset=Tt,this._delay=We,this._loopDelay=at,this._iterationTime=0,this._currentIteration=0,this._resolve=Vt,this._running=!1,this._reversed=+xt(a,re.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=xt(c,re.alternate),this._prev=null,this._next=null,this._lastTickTime=ge,this._startTime=ge,this._lastTime=ge,this._fps=xt(m,re.frameRate),this._speed=xt(h,re.playbackRate),this._priority=+xt(y,1)}get cancelled(){return!!this._cancelled}set cancelled(e){e?this.cancel():this.reset(!0).play()}get currentTime(){return dn(Fe(this._currentTime,ve.precision),-this._delay,this.duration)}set currentTime(e){let n=this.paused;this.pause().seek(+e),n||this.resume()}get iterationCurrentTime(){return dn(Fe(this._iterationTime,ve.precision),0,this.iterationDuration)}set iterationCurrentTime(e){this.currentTime=this.iterationDuration*this._currentIteration+e}get progress(){return dn(Fe(this._currentTime/this.duration,10),0,1)}set progress(e){this.currentTime=this.duration*e}get iterationProgress(){return dn(Fe(this._iterationTime/this.iterationDuration,10),0,1)}set iterationProgress(e){let n=this.iterationDuration;this.currentTime=n*this._currentIteration+n*e}get currentIteration(){return this._currentIteration}set currentIteration(e){this.currentTime=this.iterationDuration*dn(+e,0,this.iterationCount-1)}get reversed(){return!!this._reversed}set reversed(e){e?this.reverse():this.play()}get speed(){return super.speed}set speed(e){super.speed=e,this.resetTime()}reset(e=!1){return mm(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,Ao(this,0,1,~~e,qt.FORCE),ab(this),this._hasChildren&&Qe(this,ab),this}init(e=!1){this.fps=this._fps,this.speed=this._speed,!e&&this._hasChildren&&Ao(this,this.duration,1,~~e,qt.FORCE),this.reset(e);let n=this._autoplay;return n===!0?this.resume():n&&!J(n.linked)&&n.link(this),this}resetTime(){let e=1/(this._speed*Kt._speed);return this._startTime=Ko()-(this._currentTime+this._delay)*e,this}pause(){return this.paused?this:(this.paused=!0,this.onPause(this),this)}resume(){return this.paused?(this.paused=!1,this.duration<=xe&&!this._hasChildren?Ao(this,xe,0,0,qt.FORCE):(this._running||(Tn(Kt,this,CI),Kt._hasChildren=!0,this._running=!0),this.resetTime(),this._startTime-=12,Kt.wake()),this):this}restart(){return this.reset().resume()}seek(e,n=0,o=0){mm(this),this.completed=!1;let r=this.paused;return this.paused=!0,Ao(this,e+this._delay,~~n,~~o,qt.AUTO),r?this:this.resume()}alternate(){let e=this._reversed,n=this.iterationCount,o=this.iterationDuration,r=n===1/0?li(ya/o):n;return this._reversed=+(this._alternate&&!(r%2)?e:!e),n===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(o*r-this._currentTime),this.resetTime(),this}play(){return this._reversed&&this.alternate(),this.resume()}reverse(){return this._reversed||this.alternate(),this.resume()}cancel(){return this._hasChildren?Qe(this,e=>e.cancel(),!0):Qe(this,fm),this._cancelled=1,this.pause()}stretch(e){let n=this.duration,o=Xo(e);if(n===o)return this;let r=e/n,i=e<=xe;return this.duration=i?xe:o,this.iterationDuration=i?xe:Xo(this.iterationDuration*r),this._offset*=r,this._delay*=r,this._loopDelay*=r,this}revert(){Ao(this,0,1,0,qt.AUTO);let e=this._autoplay;return e&&e.linked&&e.linked===this&&e.revert(),this.cancel()}complete(e=0){return this.seek(this.duration,e).cancel()}then(e=Vt){let n=this.then,o=()=>{this.then=null,e(this),this.then=n,this._resolve=Vt};return new Promise(r=>(this._resolve=()=>r(o()),this.completed&&this._resolve(),this))}};function lb(t){let e=Sn(t)?ba.root.querySelectorAll(t):t;if(e instanceof NodeList||e instanceof HTMLCollection)return e}function gr(t){if(ko(t))return[];if(!Qn)return Pn(t)&&t.flat(1/0)||[t];if(Pn(t)){let n=t.flat(1/0),o=[];for(let r=0,i=n.length;r<i;r++){let s=n[r];if(!ko(s)){let a=lb(s);if(a)for(let c=0,l=a.length;c<l;c++){let d=a[c];if(!ko(d)){let u=!1;for(let m=0,h=o.length;m<h;m++)if(o[m]===d){u=!0;break}u||o.push(d)}}else{let c=!1;for(let l=0,d=o.length;l<d;l++)if(o[l]===s){c=!0;break}c||o.push(s)}}}return o}let e=lb(t);return e?Array.from(e):[t]}function yr(t){let e=gr(t),n=e.length;for(let o=0;o<n;o++){let r=e[o];if(!r[tm]){r[tm]=!0;let i=Ul(r);(r.nodeType||i)&&(r[Do]=!0,r[$l]=i,r[mr]={})}}return e}var hm={deg:1,rad:180/xa,turn:360},db={},Ia=(t,e,n,o=!1)=>{let r=e.u,i=e.n;if(e.t===Ee.UNIT&&r===n)return e;let s=i+r+n,a=db[s];if(!J(a)&&!o)e.n=a;else{let c;if(r in hm)c=i*hm[r]/hm[n];else{let d=t.cloneNode(),u=t.parentNode,m=u&&u!==fr?u:fr.body;m.appendChild(d);let h=d.style;h.width=100+r;let y=d.offsetWidth||100;h.width=100+n;let E=d.offsetWidth||100,M=y/E;m.removeChild(d),c=M*i}e.n=c,db[s]=c}return e.t,Ee.UNIT,e.u=n,e};var tr=t=>t;var Da=(t=1.68)=>e=>ci(e,+t),ym={in:t=>e=>t(e),out:t=>e=>1-t(1-e),inOut:t=>e=>e<.5?t(e*2)/2:1-t(e*-2+2)/2,outIn:t=>e=>e<.5?(1-t(1-e*2))/2:(t(e*2-1)+1)/2},wI=xa/2,ub=xa*2,pb={[Jn]:Da,Quad:Da(2),Cubic:Da(3),Quart:Da(4),Quint:Da(5),Sine:t=>1-Y_(t*wI),Circ:t=>1-hr(1-t*t),Expo:t=>t?ci(2,10*t-10):0,Bounce:t=>{let e,n=4;for(;t<((e=ci(2,--n))-1)/11;);return 1/ci(4,3-n)-7.5625*ci((e*3-2)/22-t,2)},Back:(t=1.7)=>e=>(+t+1)*e*e*e-+t*e*e,Elastic:(t=1,e=.3)=>{let n=dn(+t,1,10),o=dn(+e,xe,2),r=o/ub*Z_(1/n),i=ub/o;return s=>s===0||s===1?s:-n*ci(2,-10*(1-s))*q_((1-s-r)*i)}},gm=(()=>{let t={linear:tr,none:tr};for(let e in ym)for(let n in pb){let o=pb[n],r=ym[e];t[e+n]=n===Jn||n==="Back"||n==="Elastic"?(i,s)=>r(o(i,s)):r(o)}return t})(),Xl={linear:tr,none:tr},SI=t=>{if(Xl[t])return Xl[t];if(t.indexOf("(")<=-1){let n=ym[t]||t.includes("Back")||t.includes("Elastic")?gm[t]():gm[t];return n?Xl[t]=n:tr}else{let e=t.slice(0,-1).split("("),n=gm[e[0]];return n?Xl[t]=n(...e[1].split(",")):tr}},fb=["steps(","irregular(","linear(","cubicBezier("],ui=t=>{if(Sn(t)){for(let n=0,o=fb.length;n<o;n++)if(Rn(t,fb[n]))return console.warn(`String syntax for \`ease: "${t}"\` has been removed from the core and replaced by importing and passing the easing function directly: \`ease: ${t}\``),tr}return Yt(t)?t:Sn(t)?SI(t):tr};var he=Yl(),Ie=Yl(),ss={},Jl={func:null},ed={func:null},td=[null],as=[null,null],nd={to:null},TI=0,mb=0,vr,Ro,MI=(t,e)=>{let n={};if(Pn(t)){let o=[].concat(...t.map(r=>Object.keys(r))).filter(Ea);for(let r=0,i=o.length;r<i;r++){let s=o[r],a=t.map(c=>{let l={};for(let d in c){let u=c[d];Ea(d)?d===s&&(l.to=u):l[d]=u}return l});n[s]=a}}else{let o=xt(e.duration,ve.defaults.duration);Object.keys(t).map(i=>({o:parseFloat(i)/100,p:t[i]})).sort((i,s)=>i.o-s.o).forEach(i=>{let s=i.o,a=i.p;for(let c in a)if(Ea(c)){let l=n[c];l||(l=n[c]=[]);let d=s*o,u=l.length,m=l[u-1],h={to:a[c]},y=0;for(let E=0;E<u;E++)y+=l[E].duration;u===1&&(h.from=m.to),a.ease&&(h.ease=a.ease),h.duration=d-(u?y:0),l.push(h)}return i});for(let i in n){let s=n[i],a;for(let c=0,l=s.length;c<l;c++){let d=s[c],u=d.ease;d.ease=a||void 0,a=u}s[0].duration||s.shift()}}return n},_r=class extends er{constructor(e,n,o,r,i=!1,s=0,a){super(n,o,r),this._head,this._tail,++mb;let c=yr(e),l=c.length,d=n.keyframes,u=d?Gl(MI(d,n),n):n,{id:m,delay:h,duration:y,ease:E,playbackEase:M,modifier:W,composition:z,onRender:me}=u,ae=o?o.defaults:ve.defaults,ge=xt(E,ae.ease),re=xt(M,ae.playbackEase),We=re?ui(re):null,Te=!J(ge.ease),De=Te?ge.ease:xt(E,We?"linear":ae.ease),at=Te?ge.settlingDuration:xt(y,ae.duration),yt=xt(h,ae.delay),Tt=W||ae.modifier,_t=J(z)&&l>=Xn?Et.none:J(z)?ae.composition:z,qe=this._offset+(o?o._offset:0);Te&&(ge.parent=this);let pe=NaN,S=NaN,q=0,B=0;for(let I=0;I<l;I++){let K=c[I],we=s||I,Ye=a||c,Ot=NaN,de=NaN;for(let ft in u)if(Ea(ft)){let Ne=Ca(K,ft),Xt=ql(K,ft),At=os(ft,K,Ne),Ve=u[ft],Lt=Pn(Ve);if(i&&!Lt&&(as[0]=Ve,as[1]=Ve,Ve=as),Lt){let ne=Ve.length,rt=!ai(Ve[0]);ne===2&&rt?(nd.to=Ve,td[0]=nd,vr=td):ne>2&&rt?(vr=[],Ve.forEach((G,ut)=>{ut?ut===1?(as[1]=G,vr.push(as)):vr.push(G):as[0]=G})):vr=Ve}else td[0]=Ve,vr=td;let Mt=null,Ce=null,Ae=NaN,ye=0,Xe=0;for(let ne=vr.length;Xe<ne;Xe++){let rt=vr[Xe];ai(rt)?Ro=rt:(nd.to=rt,Ro=nd),Jl.func=null,ed.func=null;let G=No(xt(Ro.composition,_t),K,we,Ye,null,null),ut=wn(G)?G:Et[G];!Mt&&ut!==Et.none&&(Mt=Ta(K,At));let Ue=Mt?Mt._tail:null,te=o&&Ue&&Ue.parent.parent===o?Ue:Ce,ht=No(Ro.to,K,we,Ye,Jl,te),ue;ai(ht)&&!J(ht.to)?(Ro=ht,ue=ht.to):ue=ht;let nt=No(Ro.from,K,we,Ye,ed,te),Oe=Ro.ease||De,N=No(Oe,K,we,Ye,null,te),L=Yt(N)||Sn(N)?N:Oe,Z=!J(L)&&!J(L.ease),oe=Z?L.ease:L,ct=Z?L.settlingDuration:No(xt(Ro.duration,ne>1?No(at,K,we,Ye,null,te)/ne:at),K,we,Ye,null,te),vt=No(xt(Ro.delay,Xe?0:yt),K,we,Ye,null,te),jn=Ro.modifier||Tt,ln=!J(nt),go=!J(ue),yo=Pn(ue),Ua=yo||ln&&go,za=Ce?ye:0,_i=Ce?ye+vt:vt,Tr=Fe(qe+_i,12),bs=Fe(qe+za,12);!B&&(ln||yo)&&(B=1);let Ut=Ce;if(ut!==Et.none){let _e=Mt._head;for(;_e&&_e._absoluteStartTime<=Tr;)if(_e._isOverridden||(Ut=_e),_e=_e._nextRep,_e&&_e._absoluteStartTime>=Tr)for(;_e;)Sa(_e),_e=_e._nextRep}if(Ua){un(yo?No(ue[0],K,we,Ye,ed,te):nt,he),un(yo?No(ue[1],K,we,Ye,Jl,te):ue,Ie);let _e=Oo(K,At,Ne,ss);he.t===Ee.NUMBER&&(Ut?Ut._valueType===Ee.UNIT&&(he.t=Ee.UNIT,he.u=Ut._unit):(un(_e,Zt),Zt.t===Ee.UNIT&&(he.t=Ee.UNIT,he.u=Zt.u)))}else go?un(ue,Ie):Ce?um(Ce,Ie):un(o&&Ut&&Ut.parent.parent===o?Ut._value:Oo(K,At,Ne,ss),Ie),ln?un(nt,he):Ce?um(Ce,he):un(o&&Ut&&Ut.parent.parent===o?Ut._value:Oo(K,At,Ne,ss),he);if(he.o&&(he.n=ns(Ut?Ut._toNumber:un(Oo(K,At,Ne,ss),Zt).n,he.n,he.o)),Ie.o&&(Ie.n=ns(he.n,Ie.n,Ie.o)),he.t!==Ie.t){if(he.t===Ee.COMPLEX||Ie.t===Ee.COMPLEX){let _e=he.t===Ee.COMPLEX?he:Ie,It=he.t===Ee.COMPLEX?Ie:he;It.t=Ee.COMPLEX,It.s=$t(_e.s),It.d=_e.d.map(()=>It.n)}else if(he.t===Ee.UNIT||Ie.t===Ee.UNIT){let _e=he.t===Ee.UNIT?he:Ie,It=he.t===Ee.UNIT?Ie:he;It.t=Ee.UNIT,It.u=_e.u}else if(he.t===Ee.COLOR||Ie.t===Ee.COLOR){let _e=he.t===Ee.COLOR?he:Ie,It=he.t===Ee.COLOR?Ie:he;It.t=Ee.COLOR,It.d=_e.d.map(()=>0)}}if(he.u!==Ie.u){let _e=Ie.u?he:Ie;_e=Ia(K,_e,Ie.u?Ie.u:he.u,!1)}if(Ie.d&&he.d&&Ie.d.length!==he.d.length){let _e=he.d.length>Ie.d.length?he:Ie,It=_e===he?Ie:he;It.d=_e.d.map((Wa,bi)=>J(It.d[bi])?0:It.d[bi]),It.s=$t(_e.s)}let vo=Fe(+ct||xe,12),Es=ss[At];ko(Es)||(ss[At]=null);let Ga=Xt?Xt.set:null;ye=Fe(_i+vo,12);let Mr=he.d,xs=Ie.d,Cs=Ie.s,Jt={parent:this,id:TI++,property:At,target:K,_value:null,_toFunc:Jl.func,_fromFunc:ed.func,_ease:ui(oe),_fromNumbers:Mr?$t(Mr):_a,_toNumbers:xs?$t(xs):_a,_strings:Cs?$t(Cs):_a,_fromNumber:he.n,_toNumber:Ie.n,_numbers:Mr?$t(Mr):_a,_number:he.n,_unit:Ie.u,_modifier:jn,_currentTime:0,_startTime:_i,_delay:+vt,_updateDuration:vo,_changeDuration:vo,_absoluteStartTime:Tr,_absoluteUpdateStartTime:bs,_absoluteEndTime:Fe(qe+ye,12),_hasFromValue:ln||yo?1:0,_tweenType:Ne,_setter:Ga,_valueType:Ie.t,_composition:ut,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:Es,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};ut!==Et.none&&Ql(Jt,Mt);let or=Jt._valueType;if(or===Ee.COMPLEX)Jt._value=Zl(Jt,1,-1);else if(or===Ee.UNIT)Jt._value=`${jn(Jt._toNumber)}${Jt._unit}`;else if(or===Ee.COLOR){let _e=Ie.d;Jt._value=`rgba(${Fe(_e[0],0)},${Fe(_e[1],0)},${Fe(_e[2],0)},${_e[3]})`}else Jt._value=jn(Jt._toNumber);isNaN(Ae)&&(Ae=Jt._startTime),Ce=Jt,q++,Tn(this,Jt)}(isNaN(S)||Ae<S)&&(S=Ae),(isNaN(pe)||ye>pe)&&(pe=ye),Ne===dt.TRANSFORM&&(Ot=q-Xe,de=q)}if(!isNaN(Ot)){let ft=0;Qe(this,Ne=>{ft>=Ot&&ft<de&&(Ne._renderTransforms=1,Ne._composition===Et.blend&&Qe(Jo.animation,Xt=>{Xt.id===Ne.id&&(Xt._renderTransforms=1)})),ft++})}}l||console.warn("No target found. Make sure the element you're trying to animate is accessible before creating your animation."),S?(Qe(this,I=>{I._startTime-I._delay||(I._delay-=S),I._startTime-=S}),pe-=S):S=0,pe||(pe=xe,this.iterationCount=0),this.targets=c,this.id=J(m)?mb:m,this.duration=pe===xe?xe:di((pe+this._loopDelay)*this.iterationCount-this._loopDelay)||xe,this.onRender=me||ae.onRender,this._ease=We,this._delay=S,this.iterationDuration=pe,!this._autoplay&&B&&this.onRender(this)}stretch(e){let n=this.duration;if(n===Xo(e))return this;let o=e/n;return Qe(this,r=>{r._updateDuration=Xo(r._updateDuration*o),r._changeDuration=Xo(r._changeDuration*o),r._currentTime*=o,r._delay*=o,r._startTime*=o,r._absoluteStartTime*=o,r._absoluteUpdateStartTime*=o,r._absoluteEndTime*=o}),super.stretch(e)}refresh(){return Qe(this,e=>{let n=e._toFunc,o=e._fromFunc;(n||o)&&(o?(un(o(),he),he.u!==e._unit&&e.target[Do]&&Ia(e.target,he,e._unit,!0),e._fromNumbers=$t(he.d),e._fromNumber=he.n):n&&(un(Oo(e.target,e.property,e._tweenType),Zt),e._fromNumbers=$t(Zt.d),e._fromNumber=Zt.n),n&&(un(n(),Ie),e._toNumbers=$t(Ie.d),e._strings=$t(Ie.s),e._toNumber=Ie.o?ns(e._fromNumber,Ie.n,Ie.o):Ie.n))}),this.duration===xe&&this.restart(),this}revert(){return super.revert(),rs(this)}then(e){return super.then(e)}},tn=(t,e)=>ve.editor?ve.editor.addAnimation(t,e):new _r(t,e,null,0,!1).init();var II=(t,e)=>{if(Rn(e,"<")){let n=e[1]==="<",o=t._tail,r=o?o._offset+o._delay:0;return n?r:r+o.duration}},pi=(t,e)=>{let n=t.iterationDuration;if(n===xe&&(n=0),J(e))return n;if(wn(+e))return+e;let o=e,r=t?t.labels:null,i=!ko(r),s=II(t,o),a=!J(s),c=U_.exec(o);if(c){let l=c[0],d=o.split(l),u=i&&d[0]?r[d[0]]:n,m=a?s:i?u:n,h=+d[1];return ns(m,h,l[0])}else return a?s:i?J(r[o])?n:r[o]:n};function DI(t){return di((t.iterationDuration+t._loopDelay)*t.iterationCount-t._loopDelay)||xe}function vm(t,e,n,o,r,i){let a=wn(t.duration)&&t.duration<=xe?n-xe:n;e.composition&&Ao(e,a,1,1,qt.AUTO);let c=o?new _r(o,t,e,a,!1,r,i):new er(t,e,a);return e.composition&&c.init(!0),Tn(e,c),Qe(e,l=>{let u=l._offset+l._delay+l.duration;u>e.iterationDuration&&(e.iterationDuration=u)}),e.duration=DI(e),e}var hb=0,od=class extends er{constructor(e={}){super(e,null,0),++hb,this.id=J(e.id)?hb:e.id,this.duration=0,this.labels={};let n=e.defaults,o=ve.defaults;this.defaults=n?Gl(n,o):o,this.composition=xt(e.composition,!0),this.onRender=e.onRender||o.onRender;let r=xt(e.playbackEase,o.playbackEase);this._ease=r?ui(r):null,this.iterationDuration=0}add(e,n,o){let r=ai(n),i=ai(e);if(r||i){if(this._hasChildren=!0,r){let s=n,a=ve.editor&&ve.editor.addTimelineChild,c=o&&o.type==="Stagger"&&ve.editor,l=Yt(o)?o:null;if(l||c){let d=gr(e),u=this.duration,m=this.iterationDuration,h=s.id,y=0,E=d.length,M=a?a(e,s,this.id,o,E):null,W=l||ve.editor.resolveStagger(o.defaultValue);d.forEach(z=>{let me=V({},M||s);this.duration=u,this.iterationDuration=m,J(h)||(me.id=h+"-"+y);let ae=pi(this,W(z,y,d,null,this));vm(me,this,ae,z,y,d),y++})}else{let d=a?a(e,s,this.id,o):s,u=o&&o.type?o.defaultValue:o;vm(d,this,pi(this,u),e)}}else vm(e,this,pi(this,n));return this.composition&&this.init(!0),this}}sync(e,n){if(J(e)||e&&J(e.pause))return this;e.pause();let o=+(e.effect?e.effect.getTiming().duration:e.duration);!J(e)&&!J(e.persist)&&(e.persist=!0);let r=ve.editor,i=r&&r.addTimelineChild;r&&r.addTimelineSync&&(n=r.addTimelineSync(e,n,this.id),r.addTimelineChild=null);let s=this.add(e,{currentTime:[0,o],duration:o,delay:0,ease:"linear",playbackEase:"linear"},n);return r&&(r.addTimelineChild=i),s}set(e,n,o){return J(n)?this:(n.duration=xe,n.composition=Et.replace,this.add(e,n,o))}call(e,n){return J(e)||e&&!Yt(e)?this:(ve.editor&&ve.editor.addTimelineCall&&(n=ve.editor.addTimelineCall(e,n,this.id)),this.add({duration:0,delay:0,onComplete:()=>e(this)},n))}label(e,n){return J(e)||e&&!Sn(e)?this:(ve.editor&&ve.editor.addTimelineLabel&&(n=ve.editor.addTimelineLabel(e,n,this.id)),this.labels[e]=pi(this,n),this)}remove(e,n){return Ma(gr(e),this,n),this}stretch(e){let n=this.duration;if(n===Xo(e))return this;let o=e/n,r=this.labels;Qe(this,i=>i.stretch(i.duration*o));for(let i in r)r[i]*=o;return super.stretch(e)}refresh(){return Qe(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),Qe(this,e=>e.revert,!0),rs(this)}then(e){return super.then(e)}},rd=t=>ve.editor?ve.editor.addTimeline(t):new od(t).init();var _m={};vh(_m,{clamp:()=>dn,damp:()=>FI,degToRad:()=>PI,lerp:()=>Qo,mapRange:()=>RI,padEnd:()=>OI,padStart:()=>NI,radToDeg:()=>LI,round:()=>Fe,roundPad:()=>kI,snap:()=>K_,wrap:()=>AI});var kI=(t,e)=>(+t).toFixed(e),NI=(t,e,n)=>`${t}`.padStart(e,n),OI=(t,e,n)=>`${t}`.padEnd(e,n),AI=(t,e,n)=>((t-e)%(n-e)+(n-e))%(n-e)+e,RI=(t,e,n,o,r)=>o+(t-e)/(n-e)*(r-o),PI=t=>t*Math.PI/180,LI=t=>t*180/Math.PI,FI=(t,e,n,o)=>o?o===1?e:Qo(t,e,1-Math.exp(-o*n*.1)):t;var gb={_head:null,_tail:null},yb=(t,e,n)=>{let o=gb._head,r;for(;o;){let i=o._next,s=o.$el===t,a=!e||o.property===e,c=!n||o.parent===n;if(s&&a&&c){r=o.animation;try{r.commitStyles()}catch{}r.cancel(),Ln(gb,o);let l=o.parent;l&&(l._completed++,l.animations.length===l._completed&&(l.completed=!0,l.paused=!0,l.muteCallbacks||(l.onComplete(l),l._resolve(l))))}o=i}return r};function vb(t,e,n){let o=yr(t);if(!o.length)return;let[r]=o,i=Ca(r,e),s=os(e,r,i),a=Oo(r,s);if(J(n))return a;if(un(a,Zt),Zt.t===Ee.NUMBER||Zt.t===Ee.UNIT){if(n===!1)return Zt.n;{let c=Ia(r,Zt,n,!1);return`${Fe(c.n,ve.precision)}${c.u}`}}}var _b=(t,e)=>{if(!J(e))return ve.editor&&ve.editor.addSet?ve.editor.addSet(t,e):(e.duration=xe,e.composition=xt(e.composition,Et.none),new _r(t,e,null,0,!0).resume())},bb=(t,e,n)=>{let o=gr(t);for(let r=0,i=o.length;r<i;r++)yb(o[r],n,e&&e.controlAnimation&&e);return Ma(o,e,n),o};var Eb=(t=Vt)=>new er({duration:1*ve.timeScale,onComplete:t},null,0).resume(),xb=t=>{let e;return((...n)=>{let o,r,i,s,a;e&&(o=e.currentIteration,r=e.iterationProgress,i=e.reversed,s=e._alternate,a=e._startTime,e.revert());let c=t(...n);return c&&!Yt(c)&&c.revert&&(e=c),J(r)||(e.currentIteration=o,e.iterationProgress=(s&&o%2?!i:i)?1-r:r,e._startTime=a),c||Vt})};var jt={};vh(jt,{$:()=>yr,addChild:()=>Tn,clamp:()=>Ob,cleanInlineStyles:()=>nb,createSeededRandom:()=>sd,damp:()=>Pb,degToRad:()=>Db,forEachChildren:()=>Qe,get:()=>vb,keepTime:()=>xb,lerp:()=>Rb,mapRange:()=>Ib,padEnd:()=>Tb,padStart:()=>Sb,radToDeg:()=>kb,random:()=>cs,randomPick:()=>Lb,remove:()=>bb,removeChild:()=>Ln,round:()=>Ab,roundPad:()=>wb,set:()=>_b,shuffle:()=>ad,snap:()=>Nb,stagger:()=>Po,sync:()=>Eb,wrap:()=>Mb});var eo=_m,id={},VI=(t,e=0)=>(...n)=>e?o=>t(...n,o):o=>t(o,...n),Cb=t=>(...e)=>{let n=t(...e);return new Proxy(Vt,{apply:(o,r,[i])=>n(i),get:(o,r)=>{if(id[r])return Cb((...i)=>{let s=id[r](...i);return a=>s(n(a))})}})},to=(t,e,n=0)=>{let o=(...r)=>(r.length<e.length?Cb(VI(e,n)):e)(...r);return id[t]||(id[t]=o),o},wb=to("roundPad",eo.roundPad),Sb=to("padStart",eo.padStart),Tb=to("padEnd",eo.padEnd),Mb=to("wrap",eo.wrap),Ib=to("mapRange",eo.mapRange),Db=to("degToRad",eo.degToRad),kb=to("radToDeg",eo.radToDeg),Nb=to("snap",eo.snap),Ob=to("clamp",eo.clamp),Ab=to("round",eo.round),Rb=to("lerp",eo.lerp,1),Pb=to("damp",eo.damp,1);var cs=(t=0,e=1,n=0)=>{let o=10**n;return Math.floor((Math.random()*(e-t+1/o)+t)*o)/o},$I=0,sd=(t,e=0,n=1,o=0)=>{let r=t===void 0?$I++:t;return(i=e,s=n,a=o)=>{r+=1831565813,r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61);let c=10**a;return Math.floor((((r^r>>>14)>>>0)/4294967296*(s-i+1/c)+i)*c)/c}},Lb=t=>t[cs(0,t.length-1)],ad=(t,e=cs)=>{let n=t.length,o,r;for(;n;)r=e(0,--n),o=t[n],t[n]=t[r],t[r]=o;return t};var Po=(t,e={})=>{let n=[],o=0,r,i=null,s=e.from,a=e.reversed,c=e.ease,l=!J(c),u=l&&!J(c.ease)?c.ease:l?ui(c):null,m=e.grid,h=m===!0,y=e.axis,E=e.total,M=J(s)||s===0||s==="first",W=s==="center",z=s==="last",me=s==="random",ae=Pn(s),ge=Pn(t),re=e.use,We=ge?zl(t[0]):zl(t),Te=ge?zl(t[1]):0,De=Bl.exec((ge?t[1]:t)+Jn),at=e.start||0+(ge?We:0),yt=e.seed,_t=!J(yt)&&yt!==!1?sd(yt===!0?0:yt):cs,qe=e.jitter,pe=!J(qe),S=Pn(qe),q=S?qe[0]:qe||0,B=S?qe[1]:qe||0,I=M?0:wn(s)?s:0;return(K,we,Ye,Ot,de)=>{let[ft]=yr(K),Ne=J(E)?Ye.length:E,Xt=J(re)?!1:Yt(re)?re(ft,we,Ne):Oo(ft,re),At=wn(Xt)||Sn(Xt)&&wn(+Xt)?+Xt:we,Ve=At>=0&&At<Ne?At:we;if(W&&(I=(Ne-1)/2),z&&(I=Ne-1),!n.length){if(h){let Ce=!0,Ae=!1,ye=1/0,Xe=1/0,ne=1/0,rt=-1/0,G=-1/0,ut=-1/0,Ue=[],te=[],ht=[];for(let ue=0;ue<Ne;ue++){let nt=Ye[ue],Oe=0,N=0,L=0,Z=!1;if(nt&&Yt(nt.getBoundingClientRect)){let oe=nt.getBoundingClientRect();Oe=oe.left+oe.width/2,N=oe.top+oe.height/2,Z=!0}else{let oe=nt;oe&&wn(oe.x)&&wn(oe.y)&&(Oe=oe.x,N=oe.y,wn(oe.z)&&(L=oe.z,Ae=!0),Z=!0)}if(!Z){Ce=!1;break}Ue.push(Oe),te.push(N),ht.push(L),Oe<ye&&(ye=Oe),N<Xe&&(Xe=N),L<ne&&(ne=L),Oe>rt&&(rt=Oe),N>G&&(G=N),L>ut&&(ut=L)}if(Ce){let ue=Ue[0],nt=te[0],Oe=ht[0];ae?(ue=ye+s[0]*(rt-ye),nt=Xe+s[1]*(G-Xe),Oe=Ae?ne+(s.length>=3?s[2]:.5)*(ut-ne):0):W?(ue=(ye+rt)/2,nt=(Xe+G)/2,Oe=(ne+ut)/2):z?(ue=Ue[Ne-1],nt=te[Ne-1],Oe=ht[Ne-1]):wn(s)&&(ue=Ue[s],nt=te[s],Oe=ht[s]);for(let L=0;L<Ne;L++){let Z=ue-Ue[L],oe=nt-te[L],ct=Oe-ht[L],vt=hr(Z*Z+oe*oe+(Ae?ct*ct:0));y==="x"&&(vt=-Z),y==="y"&&(vt=-oe),y==="z"&&(vt=-ct),n.push(vt)}let N=1/0;for(let L=0;L<Ne;L++){let Z=si(n[L]);Z>0&&Z<N&&(N=Z)}if(N>0&&N<1/0)for(let L=0;L<Ne;L++)n[L]=n[L]/N}else for(let ue=0;ue<Ne;ue++)n.push(si(I-ue))}else for(let Ce=0;Ce<Ne;Ce++)if(!m)n.push(si(I-Ce));else{let Ae=m.length,ye=m[0]*m[1],Xe,ne,rt;ae?(Xe=s[0]*(m[0]-1),ne=s[1]*(m[1]-1),rt=Ae===3?(s.length>=3?s[2]:.5)*(m[2]-1):0):W?(Xe=(m[0]-1)/2,ne=(m[1]-1)/2,rt=Ae===3?(m[2]-1)/2:0):(Xe=I%m[0],ne=li(I/m[0])%m[1],rt=Ae===3?li(I/ye):0);let G=Ce%m[0],ut=li(Ce/m[0])%m[1],Ue=Ae===3?li(Ce/ye):0,te=Xe-G,ht=ne-ut,ue=rt-Ue,nt=hr(te*te+ht*ht+(Ae===3?ue*ue:0));y==="x"&&(nt=-te),y==="y"&&(nt=-ht),y==="z"&&(nt=-ue),n.push(nt)}o=n[0];for(let Ce=1;Ce<Ne;Ce++)n[Ce]>o&&(o=n[Ce]);if(u||a)for(let Ce=0;Ce<Ne;Ce++){let Ae=n[Ce];u&&(Ae=u(Ae/o)*o),a&&(Ae=y?-Ae:si(o-Ae)),n[Ce]=Ae}if(pe){i=new Array(Ne);for(let Ce=0;Ce<Ne;Ce++)i[Ce]=_t(-1,1,4)}me&&(n=ad(n,_t))}let Lt=ge?(Te-We)/o:We;J(r)&&(r=de?pi(de,J(e.start)?de.iterationDuration:at):at);let Mt=r+(Lt*Fe(n[Ve],2)||0);if(pe){let Ce=o?n[Ve]/o:0,Ae=q+(B-q)*Ce;Mt=Mt+i[Ve]*Ae}return e.modifier&&(Mt=e.modifier(Mt)),De&&(Mt=`${Mt}${De[2]}`),Mt}};var jI=t=>{let e=1;if(t&&t.getCTM){let n=t.getCTM();if(n){let o=hr(n.a*n.a+n.b*n.b),r=hr(n.c*n.c+n.d*n.d);e=(o+r)/2}}return e},HI=(t,e,n)=>{let o=Xn,r=getComputedStyle(t),i=r.strokeLinecap,s=r.vectorEffect==="non-scaling-stroke"?t:null,a=i,c=new Proxy(t,{get(l,d){let u=l[d];return d===jl?l:d==="setAttribute"?(...m)=>{if(m[0]==="draw"){let y=m[1].split(" "),E=+y[0],M=+y[1],W=jI(s),z=E*-o*W,me=M*o*W+z,ae=o*W+(E===0&&M===1||E===1&&M===0?0:10*W)-me;if(i!=="butt"){let ge=E===M?"butt":i;a!==ge&&(l.style.strokeLinecap=`${ge}`,a=ge)}l.setAttribute("stroke-dashoffset",`${z}`),l.setAttribute("stroke-dasharray",`${me} ${ae}`)}return Reflect.apply(u,l,m)}:Yt(u)?(...m)=>Reflect.apply(u,l,m):u}});return t.getAttribute("pathLength")!==`${o}`&&(t.setAttribute("pathLength",`${o}`),c.setAttribute("draw",`${e} ${n}`)),c},bm=(t,e=0,n=0)=>gr(t).map(r=>HI(r,e,n));var pn=class t{enabled=typeof window>"u"||typeof window.matchMedia!="function"||!window.matchMedia("(prefers-reduced-motion: reduce)").matches;get isEnabled(){return this.enabled}settle(e,n,o){setTimeout(()=>jt.set(e,n),o)}enter(e,n={}){if(!e)return;let{y:o=8,scale:r,duration:i=260,delay:s=0,ease:a="out(3)"}=n,c={opacity:1,translateY:"0px",scale:1};if(!this.enabled){jt.set(e,c);return}this.settle(e,c,s+i+120),tn(e,Q(V({opacity:[0,1],translateY:[`${o}px`,"0px"]},r===void 0?{}:{scale:[r,1]}),{duration:i,delay:s,ease:a}))}enterList(e,n={}){let o=Array.from(e);if(o.length===0)return;let{y:r=8,duration:i=240,delay:s=0,each:a=30,ease:c="out(3)"}=n;if(!this.enabled){for(let l of o)jt.set(l,{opacity:1,translateY:"0px"});return}o.forEach((l,d)=>{this.settle(l,{opacity:1,translateY:"0px"},s+d*a+i+120)}),tn(o,{opacity:[0,1],translateY:[`${r}px`,"0px"],duration:i,delay:Po(a,{start:s}),ease:c})}reveal(e,n,o={}){let{animate:r=!0,after:i}=o;if(!e){i?.();return}let s={opacity:0,height:"0px"},a={opacity:1,height:"auto"},c=Math.max(e.scrollHeight,e.getBoundingClientRect().height);if(!this.enabled||!r||c===0){jt.set(e,n?a:s),i?.();return}this.settle(e,n?a:s,(n?240:180)+160),tn(e,{opacity:n?[0,1]:[1,0],height:n?["0px",`${c}px`]:[`${c}px`,"0px"],duration:n?240:180,ease:n?"out(3)":"in(2)",onComplete:()=>{jt.set(e,n?a:s),i?.()}})}pulse(e){!this.enabled||!e||(this.settle(e,{opacity:1,scale:1},520),tn(e,{opacity:[.4,1],scale:[.99,1],duration:320,ease:"out(2)"}))}pop(e,n={}){if(!e)return;let{scale:o=1.18,duration:r=220,ease:i="out(2)"}=n;this.enabled&&(this.settle(e,{scale:1},r+120),tn(e,{scale:[o,1],duration:r,ease:i}))}loop(e,n,o={}){if(!e||!this.enabled)return()=>{};let{duration:r=900,delay:i=0,ease:s="inOut(2)",alternate:a=!0}=o,c=tn(e,Q(V({},n),{duration:r,delay:i,ease:s,loop:!0,alternate:a})),l={};for(let[d,u]of Object.entries(n))l[d]=u[0];return()=>{c.pause(),jt.set(e,l)}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Pe({token:t,factory:t.\u0275fac,providedIn:"root"})};var ls=class t{target=null;aim(e){this.target=e}read(){return this.target}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Pe({token:t,factory:t.\u0275fac,providedIn:"root"})};function BI(t,e){if(t&1&&(C(0,"span",22),g(1),w()),t&2){let n=e.$implicit;f(),$(n)}}var Fb=1800,UI=520,zI=Fb,cd=class t{status=le("Connecting to the host\u2026");ready=le(!1);dismissed=bt();letters=["M","o","r","s","e"];leaving=H(!1);host=O(Gt);animation=O(pn);handoff=O(ls);intro;loops=[];introSettle;holdTimer;outroSettle;startedAt=0;left=!1;viewReady=!1;dismissedOnce=!1;constructor(){ke(()=>{this.ready()&&this.leave()})}ngAfterViewInit(){this.viewReady=!0,this.startedAt=Date.now(),this.play(),this.ready()&&this.leave()}ngOnDestroy(){this.clearTimers(),this.stopLoops(),this.intro?.pause()}play(){if(!this.query(".boot"))return;if(!this.animation.isEnabled){this.dismiss();return}let n=this.query(".ring-a"),o=this.query(".ring-b"),r=this.query(".halo"),i=this.query(".aura"),s=this.query(".grid"),a=this.query(".spark"),c=this.query(".dot-a"),l=this.query(".dot-b"),d=this.query(".dash"),u=this.queryAll(".letter"),m=this.query(".tagline"),h=this.query(".foot"),y=this.query(".pulse");try{let E=[n,o].filter(M=>M!==null).map(M=>bm(M)[0]);for(let M of E)M.setAttribute("draw","0 0");this.intro=rd(),this.intro.add(this.one(r),{opacity:[0,.72],scale:[.45,1],duration:900,ease:"out(4)"},0).add(this.one(i),{opacity:[0,.85],scale:[.7,1],duration:1100,ease:"out(4)"},0).add(this.one(s),{opacity:[0,.5],duration:900,ease:"out(3)"},90).add(E,{draw:["0 0","0 1"],duration:720,ease:"inOut(3)",delay:Po(110)},120).add(this.one(a),{opacity:[0,1],duration:420,ease:"out(2)"},260).add(this.one(o),{r:[45,8],opacity:[1,.2],duration:460,ease:"in(2)"},720).add(this.one(c),{opacity:[0,1],scale:[0,1],translateY:[10,0],duration:700,ease:"outElastic(1, .55)"},820).add(this.one(l),{opacity:[0,1],scale:[0,1],translateY:[10,0],duration:700,ease:"outElastic(1, .55)"},890).add(this.one(d),{opacity:[0,1],scaleX:[0,1],duration:700,ease:"outElastic(1, .55)"},960).add(this.one(r),{opacity:[.72,1,.6],scale:[1,1.14,1],duration:620,ease:"inOut(2)"},1060).add(u,{opacity:[0,1],translateY:[16,0],scale:[.85,1],duration:500,ease:"out(3)",delay:Po(40)},1100).add(this.one(m),{opacity:[0,1],translateY:[8,0],duration:420,ease:"out(3)"},1480).add(this.one(h),{opacity:[0,1],translateY:[10,0],duration:420,ease:"out(3)"},1580).add(this.one(y),{opacity:[0,1],scale:[.6,1],duration:420,ease:"out(2)"},1580),this.introSettle=setTimeout(()=>this.snap(),Fb+300)}catch{this.dismiss();return}this.startAmbient()}snap(){for(let e of this.queryAll(".ring"))e.setAttribute("draw","0 1");this.query(".ring-a")?.setAttribute("r","58"),this.query(".ring-b")?.setAttribute("r","8"),jt.set(this.queryAll(".boot"),{opacity:1}),jt.set(this.queryAll(".aura"),{opacity:.85}),jt.set(this.queryAll(".grid"),{opacity:.5}),jt.set(this.queryAll(".halo"),{opacity:.62,scale:1}),jt.set(this.queryAll(".spark"),{opacity:1}),jt.set(this.queryAll(".dot, .dash"),{opacity:1,scale:1,translateY:"0px"}),jt.set(this.queryAll(".letter"),{opacity:1,scale:1,translateY:"0px"}),jt.set(this.queryAll(".tagline, .foot"),{opacity:1,translateY:"0px"}),jt.set(this.queryAll(".pulse"),{opacity:1,scale:1}),jt.set(this.queryAll(".ring-b"),{opacity:.2})}startAmbient(){if(this.animation.isEnabled)try{this.startAmbientLoops()}catch{}}startAmbientLoops(){let e=l=>{this.loops.push(l)},n=[[this.query(".wave-a"),1050],[this.query(".wave-b"),1900]];for(let[l,d]of n)l&&e(tn(l,{scale:[.4,2.05],opacity:[0,.7,0],duration:2600,delay:d,loop:!0,ease:"out(3)"}));let o=this.one(this.query(".spin-a")),r=this.one(this.query(".spin-b")),i=this.one(this.query(".orbit")),s=this.one(this.query(".spark")),a=this.one(this.query(".halo")),c=this.queryAll(".ellipsis i");e(tn(o,{rotate:[0,360],duration:16e3,loop:!0,ease:"linear"})),e(tn(r,{rotate:[0,-360],duration:22e3,loop:!0,ease:"linear"})),e(tn(i,{rotate:[0,360],duration:5400,delay:340,loop:!0,ease:"linear"})),e(tn(s,{scale:[1,1.9,1],opacity:[1,.6,1],duration:1100,delay:340,loop:!0,ease:"inOut(2)"})),e(tn(a,{opacity:[.6,.78],scale:[1,1.045],duration:2400,delay:1400,loop:!0,alternate:!0,ease:"inOut(2)"})),c.length>0&&e(tn(c,{opacity:[.15,1],translateY:[0,-2],duration:620,delay:Po(150,{start:1600}),loop:!0,alternate:!0,ease:"inOut(2)"}))}leave(){if(this.left||!this.viewReady)return;this.left=!0,this.leaving.set(!0);let e=Math.max(0,zI-(Date.now()-this.startedAt));this.holdTimer=setTimeout(()=>this.beginExit(),e)}beginExit(){this.clearTimers(),this.stopLoops(),this.intro?.pause(),this.snap();let e=this.query(".veil"),n=this.query(".aura"),o=this.query(".grid"),r=this.query(".mark"),i=this.query(".halo"),s=this.queryAll(".letter"),a=this.query(".words"),c=this.query(".foot"),l=this.handoff.read(),d=r?.getBoundingClientRect(),u=l&&d&&d.width>0?{translateX:l.x-(d.left+d.width/2),translateY:l.y-(d.top+d.height/2),scale:l.width/d.width}:null;try{let m=rd({defaults:{ease:"inOut(2)"},onComplete:()=>this.dismiss()}).add(this.one(i),{opacity:0,scale:1.3,duration:320},0).add(this.one(n,o),{opacity:0,duration:320},0).add(this.one(this.query(".rings"),this.query(".wave-a"),this.query(".wave-b")),{opacity:0,duration:300},0).add(s,{translateY:-10,opacity:0,duration:260,delay:Po(20)},0).add(this.one(a,c),{opacity:0,duration:220},40);u&&r?m.add(r,Q(V({},u),{duration:560,ease:"inOut(3)"}),0).add(r,{opacity:0,duration:160,ease:"out(2)"},500).add(this.one(e),{opacity:0,duration:380},520):m.add(this.one(r),{scale:1.16,opacity:0,duration:360,ease:"in(2)"},0).add(this.one(e),{opacity:0,duration:420},140)}catch{this.dismiss();return}this.outroSettle=setTimeout(()=>this.dismiss(),UI+460)}dismiss(){this.dismissedOnce||(this.dismissedOnce=!0,this.clearTimers(),this.dismissed.emit())}query(e){return this.host.nativeElement.querySelector(e)}queryAll(e){return Array.from(this.host.nativeElement.querySelectorAll(e))}one(...e){return e.filter(n=>n!==null)}stopLoops(){for(let e of this.loops)e.pause();this.loops=[]}clearTimers(){this.introSettle!==void 0&&(clearTimeout(this.introSettle),this.introSettle=void 0),this.holdTimer!==void 0&&(clearTimeout(this.holdTimer),this.holdTimer=void 0),this.outroSettle!==void 0&&(clearTimeout(this.outroSettle),this.outroSettle=void 0)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Le({type:t,selectors:[["morse-boot-splash"]],inputs:{status:[1,"status"],ready:[1,"ready"]},outputs:{dismissed:"dismissed"},decls:34,vars:3,consts:[[1,"boot"],["aria-hidden","true",1,"veil"],["aria-hidden","true",1,"aura"],["aria-hidden","true",1,"grid"],[1,"center"],[1,"stage"],["aria-hidden","true",1,"halo"],["aria-hidden","true",1,"wave","wave-a"],["aria-hidden","true",1,"wave","wave-b"],["viewBox","0 0 140 140","aria-hidden","true",1,"rings"],[1,"spin","spin-a"],["cx","70","cy","70","r","58",1,"ring","ring-a"],[1,"spin","spin-b"],["cx","70","cy","70","r","45",1,"ring","ring-b"],[1,"orbit"],["cx","70","cy","12","r","3",1,"spark"],["aria-hidden","true",1,"mark"],[1,"dot","dot-a"],[1,"dot","dot-b"],[1,"dash"],[1,"words"],["aria-label","Morse",1,"wordmark"],["aria-hidden","true",1,"letter"],[1,"tagline"],[1,"foot"],["aria-hidden","true",1,"pulse"],["role","status","aria-live","polite",1,"status"],["aria-hidden","true",1,"ellipsis"]],template:function(n,o){n&1&&(C(0,"div",0),st(1,"span",1)(2,"span",2)(3,"span",3),C(4,"div",4)(5,"div",5),st(6,"span",6)(7,"span",7)(8,"span",8),vn(),C(9,"svg",9)(10,"g",10),st(11,"circle",11),w(),C(12,"g",12),st(13,"circle",13),w(),C(14,"g",14),st(15,"circle",15),w()(),So(),C(16,"span",16),st(17,"span",17)(18,"span",18)(19,"span",19),w()(),C(20,"div",20)(21,"div",21),ze(22,BI,2,1,"span",22,Xi),w(),C(24,"div",23),g(25,"the pi coding agent"),w()()(),C(26,"div",24),st(27,"span",25),C(28,"span",26),g(29),w(),C(30,"span",27),st(31,"i")(32,"i")(33,"i"),w()()()),n&2&&(Be("leaving",o.leaving()),f(22),Ge(o.letters),f(7),$(o.status()))},styles:["[_nghost-%COMP%]{display:contents}.boot[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:100;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:26px;overflow:hidden;color:var(--%NS%morse-fg);opacity:1}.boot.leaving[_ngcontent-%COMP%]{pointer-events:none}.veil[_ngcontent-%COMP%]{position:absolute;inset:0;background:var(--%NS%morse-bg)}.aura[_ngcontent-%COMP%]{position:absolute;width:min(560px,90vh);aspect-ratio:1;border-radius:50%;background:radial-gradient(circle,color-mix(in srgb,var(--%NS%morse-accent) 42%,transparent) 0%,transparent 62%);filter:blur(8px);opacity:0;pointer-events:none}.grid[_ngcontent-%COMP%]{position:absolute;inset:0;background-image:radial-gradient(color-mix(in srgb,var(--%NS%morse-fg) 14%,transparent) 1px,transparent 1px);background-size:22px 22px;-webkit-mask-image:radial-gradient(circle at center,#000 0%,transparent 66%);mask-image:radial-gradient(circle at center,#000 0%,transparent 66%);opacity:0;pointer-events:none}.center[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;align-items:center;gap:22px}.stage[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;justify-content:center;width:140px;height:140px}.rings[_ngcontent-%COMP%]{position:absolute;inset:0;width:100%;height:100%;overflow:visible}.ring[_ngcontent-%COMP%]{fill:none;stroke:var(--%NS%morse-fg-muted);stroke-width:1.4;stroke-linecap:round}.ring-b[_ngcontent-%COMP%]{stroke:color-mix(in srgb,var(--%NS%morse-accent) 70%,var(--%NS%morse-fg-muted));stroke-width:1.1}.spin[_ngcontent-%COMP%], .orbit[_ngcontent-%COMP%]{transform-box:fill-box;transform-origin:center;will-change:transform}.spark[_ngcontent-%COMP%]{fill:var(--%NS%morse-fg);opacity:0;filter:drop-shadow(0 0 6px color-mix(in srgb,var(--%NS%morse-accent) 80%,transparent))}.halo[_ngcontent-%COMP%]{position:absolute;width:124px;height:124px;border-radius:50%;background:radial-gradient(circle,color-mix(in srgb,var(--%NS%morse-fg) 30%,transparent) 0%,transparent 68%);opacity:0;pointer-events:none}.wave[_ngcontent-%COMP%]{position:absolute;width:124px;height:124px;border-radius:50%;border:1px solid color-mix(in srgb,var(--%NS%morse-fg) 65%,transparent);opacity:0;pointer-events:none}.wave-b[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--%NS%morse-accent) 70%,transparent)}.mark[_ngcontent-%COMP%]{position:relative;display:inline-flex;align-items:center;gap:9px}.dot[_ngcontent-%COMP%]{width:13px;height:13px;border-radius:50%;background:var(--%NS%morse-fg);opacity:0;box-shadow:0 0 14px color-mix(in srgb,var(--%NS%morse-fg) 55%,transparent)}.dash[_ngcontent-%COMP%]{width:38px;height:13px;border-radius:999px;background:var(--%NS%morse-fg);opacity:0;transform-origin:left center;box-shadow:0 0 14px color-mix(in srgb,var(--%NS%morse-fg) 55%,transparent)}.words[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:7px}.wordmark[_ngcontent-%COMP%]{display:flex;font-size:30px;font-weight:650;line-height:1;letter-spacing:.01em}.letter[_ngcontent-%COMP%]{display:inline-block;opacity:0;will-change:transform,opacity}.tagline[_ngcontent-%COMP%]{font-size:10.5px;letter-spacing:.34em;text-transform:uppercase;color:var(--%NS%morse-fg-muted);opacity:0}.foot[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;gap:8px;font-size:11.5px;color:var(--%NS%morse-fg-muted);opacity:0}.pulse[_ngcontent-%COMP%]{width:6px;height:6px;border-radius:50%;background:var(--%NS%morse-accent);box-shadow:0 0 8px color-mix(in srgb,var(--%NS%morse-accent) 70%,transparent);opacity:0}.ellipsis[_ngcontent-%COMP%]{display:inline-flex;gap:3px}.ellipsis[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{width:4px;height:4px;border-radius:50%;background:currentColor;opacity:.15}"]})};function GI(t,e){t&1&&(C(0,"p",19),g(1),w()),t&2&&(f(),$(e))}function WI(t,e){if(t&1){let n=Y();C(0,"div",23)(1,"p",24),g(2,"Start a local host"),w(),C(3,"code",25),g(4,"npm run dev:server"),w(),C(5,"p",26),g(6,"or point this window at an existing one"),w(),C(7,"form",27),ee("submit",function(r){D(n);let i=v();return k(i.submit(r))}),C(8,"input",28),ee("input",function(r){D(n);let i=v();return k(i.onInput(r))}),w(),C(9,"button",29),g(10,"Connect"),w()()()}if(t&2){let n=v();f(8),et("value",n.server()),f(),et("disabled",n.server().trim().length===0)}}var ld=class t{eyebrow=le("Offline");title=le("Morse is waiting for a host");body=le("This window is only the frontend. The pi coding agent runs behind a Morse host \u2014 start one and this screen will clear itself.");detail=le("");isBrowser=typeof globalThis<"u"&&typeof globalThis.acquireVsCodeApi>"u";server=H("");retry=bt();explore=bt();connect=bt();onInput(e){this.server.set(e.target.value)}submit(e){e.preventDefault();let n=this.server().trim();n.length>0&&this.connect.emit(n)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Le({type:t,selectors:[["morse-connection-screen"]],inputs:{eyebrow:[1,"eyebrow"],title:[1,"title"],body:[1,"body"],detail:[1,"detail"]},outputs:{retry:"retry",explore:"explore",connect:"connect"},decls:30,vars:5,consts:[["role","alertdialog","aria-labelledby","morse-conn-title",1,"screen"],["aria-hidden","true",1,"veil"],["aria-hidden","true",1,"aura"],["aria-hidden","true",1,"grid"],[1,"panel"],["aria-hidden","true",1,"stage"],[1,"halo"],[1,"wave","wave-a"],[1,"wave","wave-b"],["viewBox","0 0 140 140",1,"scanner"],["cx","70","cy","70","r","58",1,"track"],["cx","70","cy","70","r","58",1,"sweep"],[1,"mark"],[1,"glyph","dot"],[1,"glyph","dash"],[1,"eyebrow"],["aria-hidden","true",1,"pip"],["id","morse-conn-title",1,"title"],[1,"body"],[1,"detail"],[1,"actions"],["type","button",1,"primary",3,"click"],["type","button",1,"ghost",3,"click"],[1,"help"],[1,"help-title"],[1,"help-cmd"],[1,"help-or"],[1,"server",3,"submit"],["type","text","name","server","placeholder","ws://host:port","autocomplete","off","spellcheck","false",3,"input","value"],["type","submit",3,"disabled"]],template:function(n,o){if(n&1&&(C(0,"div",0),st(1,"span",1)(2,"span",2)(3,"span",3),C(4,"div",4)(5,"div",5),st(6,"span",6)(7,"span",7)(8,"span",8),vn(),C(9,"svg",9),st(10,"circle",10)(11,"circle",11),w(),So(),C(12,"span",12),st(13,"span",13)(14,"span",13)(15,"span",14),w()(),C(16,"p",15),st(17,"span",16),g(18),w(),C(19,"h1",17),g(20),w(),C(21,"p",18),g(22),w(),A(23,GI,2,1,"p",19),C(24,"div",20)(25,"button",21),ee("click",function(){return o.retry.emit()}),g(26,"Retry now"),w(),C(27,"button",22),ee("click",function(){return o.explore.emit()}),g(28,"Explore the app"),w()(),A(29,WI,11,2,"div",23),w()()),n&2){let r;f(18),$(o.eyebrow()),f(2),$(o.title()),f(2),$(o.body()),f(),R((r=o.detail())?23:-1,r),f(6),R(o.isBrowser?29:-1)}},styles:["[_nghost-%COMP%]{display:contents}.screen[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:90;display:flex;align-items:center;justify-content:center;overflow:hidden;color:var(--%NS%morse-fg);animation:_ngcontent-%COMP%_conn-fade .26s ease-out}.veil[_ngcontent-%COMP%]{position:absolute;inset:0;background:var(--%NS%morse-bg)}.aura[_ngcontent-%COMP%]{position:absolute;width:min(620px,92vh);aspect-ratio:1;border-radius:50%;background:radial-gradient(circle,color-mix(in srgb,var(--%NS%morse-accent) 30%,transparent) 0%,transparent 62%);filter:blur(10px);opacity:.85}.grid[_ngcontent-%COMP%]{position:absolute;inset:0;background-image:radial-gradient(color-mix(in srgb,var(--%NS%morse-fg) 12%,transparent) 1px,transparent 1px);background-size:22px 22px;-webkit-mask-image:radial-gradient(circle at center,#000 0%,transparent 64%);mask-image:radial-gradient(circle at center,#000 0%,transparent 64%);opacity:.55}.panel[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;align-items:center;gap:10px;max-width:520px;padding:28px 20px;text-align:center}.panel[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_conn-rise .46s cubic-bezier(.22,1,.36,1) backwards}.panel[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:nth-child(2){animation-delay:40ms}.panel[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:nth-child(3){animation-delay:90ms}.panel[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:nth-child(4){animation-delay:.14s}.panel[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:nth-child(5){animation-delay:.19s}.panel[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:nth-child(6){animation-delay:.24s}.panel[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:nth-child(7){animation-delay:.29s}.stage[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;justify-content:center;width:140px;height:140px}.scanner[_ngcontent-%COMP%]{position:absolute;inset:0;width:100%;height:100%;overflow:visible}.track[_ngcontent-%COMP%]{fill:none;stroke:var(--%NS%morse-fg-muted);stroke-width:1;opacity:.35}.sweep[_ngcontent-%COMP%]{fill:none;stroke:var(--%NS%morse-accent);stroke-width:1.6;stroke-linecap:round;stroke-dasharray:10 14;transform-box:fill-box;transform-origin:center;animation:_ngcontent-%COMP%_conn-sweep 9s linear infinite}.halo[_ngcontent-%COMP%]{position:absolute;width:96px;height:96px;border-radius:50%;background:radial-gradient(circle,color-mix(in srgb,var(--%NS%morse-accent) 45%,transparent) 0%,transparent 68%);animation:_ngcontent-%COMP%_conn-breathe 3.6s ease-in-out infinite}.wave[_ngcontent-%COMP%]{position:absolute;width:96px;height:96px;border-radius:50%;border:1px solid color-mix(in srgb,var(--%NS%morse-fg) 40%,transparent);animation:_ngcontent-%COMP%_conn-ping 2.8s ease-out infinite}.wave-b[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--%NS%morse-accent) 55%,transparent);animation-delay:1.4s}.mark[_ngcontent-%COMP%]{position:relative;display:inline-flex;align-items:center;gap:8px}.glyph[_ngcontent-%COMP%]{background:var(--%NS%morse-fg);box-shadow:0 0 12px color-mix(in srgb,var(--%NS%morse-fg) 40%,transparent);animation:_ngcontent-%COMP%_conn-search 1.6s ease-in-out infinite}.dot[_ngcontent-%COMP%]{width:12px;height:12px;border-radius:50%}.dash[_ngcontent-%COMP%]{width:34px;height:12px;border-radius:999px;animation-delay:.36s}.glyph[_ngcontent-%COMP%]:nth-child(2){animation-delay:.18s}.eyebrow[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;margin:4px 0 0;font-size:10.5px;letter-spacing:.28em;text-transform:uppercase;color:var(--%NS%morse-fg-muted)}.pip[_ngcontent-%COMP%]{width:6px;height:6px;border-radius:50%;background:var(--%NS%morse-warn);animation:_ngcontent-%COMP%_conn-pip 1.4s ease-in-out infinite}.title[_ngcontent-%COMP%]{margin:0;font-size:19px;font-weight:650;line-height:1.25}.body[_ngcontent-%COMP%]{margin:0;max-width:420px;color:var(--%NS%morse-fg-muted);line-height:1.65}.detail[_ngcontent-%COMP%]{margin:2px 0 0;max-width:460px;font-family:var(--%NS%morse-font-mono);font-size:11px;color:var(--%NS%morse-fg-muted);opacity:.8;word-break:break-word}.actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-top:8px}.actions[_ngcontent-%COMP%] .primary[_ngcontent-%COMP%], .actions[_ngcontent-%COMP%] .ghost[_ngcontent-%COMP%]{padding:6px 16px;border-radius:999px}.actions[_ngcontent-%COMP%] .ghost[_ngcontent-%COMP%]{background:var(--%NS%morse-button-secondary);color:var(--%NS%morse-button-secondary-fg)}.actions[_ngcontent-%COMP%] .ghost[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover);border-color:var(--%NS%morse-border)}.help[_ngcontent-%COMP%]{margin-top:14px;padding:12px 14px;width:100%;max-width:380px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-md);background:var(--%NS%morse-hover);display:flex;flex-direction:column;align-items:center;gap:6px}.help-title[_ngcontent-%COMP%]{margin:0;font-size:11px;letter-spacing:.05em;text-transform:uppercase;color:var(--%NS%morse-fg-muted)}.help-cmd[_ngcontent-%COMP%]{font-family:var(--%NS%morse-font-mono);font-size:12px;padding:3px 10px;border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-code-bg);border:1px solid var(--%NS%morse-border)}.help-or[_ngcontent-%COMP%]{margin:2px 0 0;font-size:11px;color:var(--%NS%morse-fg-muted)}.server[_ngcontent-%COMP%]{display:flex;width:100%;gap:6px}.server[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1;min-width:0}@keyframes _ngcontent-%COMP%_conn-fade{0%{opacity:0}}@keyframes _ngcontent-%COMP%_conn-rise{0%{opacity:0;transform:translateY(10px)}}@keyframes _ngcontent-%COMP%_conn-sweep{to{transform:rotate(360deg)}}@keyframes _ngcontent-%COMP%_conn-breathe{0%,to{opacity:.6;transform:scale(.94)}50%{opacity:1;transform:scale(1.06)}}@keyframes _ngcontent-%COMP%_conn-ping{0%{opacity:.5;transform:scale(.5)}80%,to{opacity:0;transform:scale(2.05)}}@keyframes _ngcontent-%COMP%_conn-search{0%,to{opacity:.4;transform:translateY(0)}45%{opacity:1;transform:translateY(-4px)}}@keyframes _ngcontent-%COMP%_conn-pip{0%,to{opacity:.35}50%{opacity:1}}@media(prefers-reduced-motion:reduce){.screen[_ngcontent-%COMP%], .panel[_ngcontent-%COMP%] > *[_ngcontent-%COMP%], .sweep[_ngcontent-%COMP%], .halo[_ngcontent-%COMP%], .wave[_ngcontent-%COMP%], .glyph[_ngcontent-%COMP%], .pip[_ngcontent-%COMP%]{animation:none}}"]})};var br=class t{attached=H([]);pinned=H([]);live=H(null);pendingMentions=H([]);message=H(null);counter=0;images=this.attached.asReadonly();pins=this.pinned.asReadonly();livePreview=this.live.asReadonly();mentions=this.pendingMentions.asReadonly();notice=this.message.asReadonly();count=T(()=>this.attached().length+this.pinned().length+this.pendingMentions().length);async read(e){let n=[],o=[];for(let r of e){if(!r.type.startsWith("image/")){o.push(r.name);continue}let i=await Em(r);if(!i){o.push(r.name);continue}this.counter+=1,n.push({id:`attachment-${this.counter}`,name:r.name||`image-${this.counter}.png`,mimeType:r.type,data:i,bytes:r.size})}return{images:n,skipped:o}}add(e){e.length!==0&&this.attached.update(n=>[...n,...e])}async accept(e){let{images:n,skipped:o}=await this.read(e);return this.add(n),{attached:n.length,skipped:o}}addMentions(e){let n=e.map(o=>o.trim()).filter(o=>o.length>0);n.length!==0&&this.pendingMentions.update(o=>[...o,...n])}seed(e,n){e.length>0&&this.add(e.map((o,r)=>{this.counter+=1;let s=(o.mimeType.split("/")[1]?.toLowerCase()??"").replace(/[^a-z0-9]/g,"")||"png";return{id:`seed-${this.counter}`,name:r===0?`image.${s}`:`image-${r+1}.${s}`,mimeType:o.mimeType,data:o.data,bytes:Math.floor(o.data.length*3/4)}}));for(let o of n)this.pin({path:o.path,startLine:o.startLine,endLine:o.endLine})}pin(e){if(e.path.length===0||this.pinned().find(r=>r.path===e.path&&r.startLine===e.startLine&&r.endLine===e.endLine))return;this.counter+=1;let o=`pin-${this.counter}`;this.pinned.update(r=>[...r,Q(V({},e),{id:o})])}removePin(e){this.pinned.update(n=>n.filter(o=>o.id!==e))}setLivePreview(e){if(e===null||e.path.length===0||e.startLine===void 0){this.live.set(null);return}let n=this.live();n&&n.path===e.path&&n.startLine===e.startLine&&n.endLine===e.endLine||this.live.set({id:"live-preview",path:e.path,startLine:e.startLine,endLine:e.endLine})}lockLivePreview(){let e=this.live();e&&(this.live.set(null),this.pin({path:e.path,startLine:e.startLine,endLine:e.endLine}))}remove(e){this.attached.update(n=>n.filter(o=>o.id!==e))}takeImages(){let e=this.attached().map(({data:n,mimeType:o})=>({data:n,mimeType:o}));return this.attached.set([]),e}takePins(){let e=this.pinned().map(({path:n,startLine:o,endLine:r})=>{let i={path:n};return o!==void 0&&(i.startLine=o),r!==void 0&&(i.endLine=r),i});return this.pinned.set([]),e}takeMentions(){let e=this.pendingMentions();return this.pendingMentions.set([]),e}clear(){this.attached.set([]),this.pinned.set([]),this.live.set(null),this.pendingMentions.set([])}say(e,n){this.message.set({level:e,text:n,at:Date.now()})}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Pe({token:t,factory:t.\u0275fac,providedIn:"root"})};function Em(t){return new Promise(e=>{if(typeof FileReader>"u"){e(void 0);return}let n=new FileReader;n.onerror=()=>e(void 0),n.onload=()=>{let o=n.result;if(typeof o!="string"){e(void 0);return}let r=o.indexOf(",");e(r===-1?void 0:o.slice(r+1))},n.readAsDataURL(t)})}var qI=["host/ready","session/state","project/list","session/activity","transcript/append","transcript/update","transcript/delta","transcript/replace","transcript/prepend","session/list","interaction/request","interaction/dismiss","notice","context/selection","context/selectionLive","composer/seed","host/command/result","error"];function xm(t){return JSON.stringify(t)}function YI(t){return ZI(t,qI)}function dd(t){let e=ka(t);return YI(e)?e:void 0}function ka(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return}return t instanceof Uint8Array?ka(new TextDecoder().decode(t)):t instanceof ArrayBuffer?ka(new TextDecoder().decode(new Uint8Array(t))):t}function ZI(t,e){if(typeof t!="object"||t===null)return!1;let n=t.type;return typeof n=="string"&&e.includes(n)}function ud(t={cwd:"",name:"workspace"}){return{protocolVersion:15,connection:"connecting",capabilities:null,state:{workspace:t,thinkingLevel:"off",availableModels:[],availableThinkingLevels:[],availableCommands:[],streaming:!1,busy:!1,agentReady:!1,agentStarting:!1},items:[],sessions:[],activity:[],projects:[],pendingInteraction:null}}function Vb(t,e,n){return Q(V({},t),{connection:e,connectionDetail:n})}function $b(t,e){switch(e.type){case"host/ready":return Q(V({},t),{connection:"ready",protocolVersion:e.payload.protocolVersion,capabilities:e.payload.capabilities,state:e.payload.state,frontend:e.payload.frontend??t.frontend});case"session/state":return Q(V({},t),{state:e.payload});case"transcript/append":return Q(V({},t),{items:[...t.items,e.payload]});case"transcript/update":return Q(V({},t),{items:KI(t.items,e.payload)});case"transcript/delta":return Q(V({},t),{items:QI(t.items,e.payload)});case"transcript/replace":return Q(V({},t),{items:[...e.payload.items]});case"transcript/prepend":return Q(V({},t),{items:[...e.payload.items,...t.items]});case"session/list":return Q(V({},t),{sessions:[...e.payload.sessions]});case"session/activity":return Q(V({},t),{activity:[...e.payload.sessions]});case"project/list":return Q(V({},t),{projects:[...e.payload.projects]});case"interaction/request":return Q(V({},t),{pendingInteraction:e.payload});case"interaction/dismiss":return t.pendingInteraction?.requestId===e.payload.requestId?Q(V({},t),{pendingInteraction:null}):t;case"notice":return Q(V({},t),{lastNotice:V({},e.payload)});case"error":return Q(V({},t),{lastError:V({},e.payload)});default:return t}}function KI(t,e){let n=t.findIndex(r=>r.id===e.id);if(n===-1)return[...t,e];let o=[...t];return o[n]=e,o}function QI(t,e){let n=t.findIndex(i=>i.id===e.id);if(n===-1)return t;let o=t[n];if(o.kind!=="assistant")return t;let r=[...t];return r[n]=Q(V({},o),{text:o.text+(e.text??""),thinking:o.thinking+(e.thinking??""),streaming:!0}),r}var XI=5e3;function jb(t){let e=ud(t.workspace??{cwd:"",name:"workspace"}),n=new Set,o=y=>{e=y;for(let E of[...n])E(e)},r=y=>{t.transport.send(y)},i=new Map,s=0,a=new Set,c=new Set,l=new Set,d=(y,E)=>{s+=1;let M=`host-${s}`;return new Promise(W=>{let z=setTimeout(()=>{i.delete(M),W(void 0)},XI);i.set(M,{resolve:W,timer:z}),r({type:"host/command",payload:{command:y,args:E,requestId:M}})})},u=t.transport.onMessage(y=>{if(y.type==="host/command/result"){let E=i.get(y.payload.requestId);E&&(clearTimeout(E.timer),i.delete(y.payload.requestId),E.resolve(y.payload.ok?y.payload.data:void 0));return}if(y.type==="context/selection"){for(let E of[...a])E(y.payload);return}if(y.type==="context/selectionLive"){for(let E of[...c])E(y.payload);return}if(y.type==="composer/seed"){for(let E of[...l])E(y.payload);return}o($b(e,y))}),m=t.transport.onStatus((y,E)=>{o(Vb(e,JI(y),y==="open"?"Waiting for the Morse host to answer\u2026":E))}),h={ready:y=>r({type:"client/ready",payload:{protocolVersion:15,frontend:y??t.frontend}}),prompt:(y,E,M,W)=>r({type:"chat/prompt",payload:{text:y,mode:E,images:M,pins:W}}),editMessage:(y,E)=>r({type:"chat/edit",payload:{itemId:y,text:E}}),forkMessage:y=>r({type:"chat/fork",payload:{itemId:y}}),hostCommand:(y,E)=>d(y,E),abort:()=>r({type:"chat/abort",payload:{}}),newSession:y=>r({type:"session/new",payload:{cwd:y}}),loadSession:(y,E)=>r({type:"session/load",payload:{sessionId:y,cwd:E}}),activateSession:(y,E)=>r({type:"session/activate",payload:{sessionId:y,cwd:E}}),closeSession:y=>r({type:"session/close",payload:{sessionId:y}}),deleteSession:y=>r({type:"session/delete",payload:{sessionId:y}}),compactSession:y=>r({type:"session/compact",payload:{instructions:y}}),loadOlderHistory:()=>r({type:"history/load",payload:{}}),requestSessions:()=>r({type:"session/list",payload:{}}),requestProjects:()=>r({type:"project/list",payload:{}}),openProject:y=>r({type:"project/open",payload:{path:y}}),setModel:(y,E)=>r({type:"model/set",payload:{provider:y,id:E}}),setThinkingLevel:y=>r({type:"thinking/set",payload:{level:y}}),respond:y=>r({type:"interaction/respond",payload:y})};return t.transport.connect(),h.ready(),{getView:()=>e,subscribe:y=>(n.add(y),()=>{n.delete(y)}),onContextSelection:y=>(a.add(y),()=>{a.delete(y)}),onContextSelectionLive:y=>(c.add(y),()=>{c.delete(y)}),onComposerSeed:y=>(l.add(y),()=>{l.delete(y)}),actions:h,dispose:()=>{u(),m(),n.clear(),t.transport.dispose()}}}function JI(t){switch(t){case"open":return"connecting";case"connecting":return"connecting";case"error":return"error";case"closed":return"closed"}}var Er=class{messageListeners=new Set;statusListeners=new Set;onMessage(e){return this.messageListeners.add(e),()=>{this.messageListeners.delete(e)}}onStatus(e){return this.statusListeners.add(e),()=>{this.statusListeners.delete(e)}}emitMessage(e){for(let n of[...this.messageListeners])n(e)}emitStatus(e,n){for(let o of[...this.statusListeners])o(e,n)}};var Hb,Bb=!1;function Ub(){return typeof globalThis.acquireVsCodeApi=="function"}function e1(){let t=globalThis.acquireVsCodeApi;if(typeof t=="function")return Bb||(Bb=!0,Hb=t()),Hb}var pd=class extends Er{kind="vscode";api=e1();listener=e=>{let n=dd(e.data);n&&this.emitMessage(n)};connect(){if(!this.api){this.emitStatus("error","Not running inside a VS Code webview.");return}typeof window<"u"&&window.addEventListener("message",this.listener),this.emitStatus("open")}send(e){this.api?.postMessage(e)}dispose(){typeof window<"u"&&window.removeEventListener("message",this.listener),this.emitStatus("closed")}};var t1=8e3,Na=class extends Er{options;kind="websocket";socket;attempts=0;timer;disposed=!1;queue=[];constructor(e){super(),this.options=e}connect(){this.disposed=!1,this.open()}send(e){if(this.socket&&this.socket.readyState===1){this.socket.send(xm(e));return}this.queue.push(e)}dispose(){this.disposed=!0,this.timer!==void 0&&(clearTimeout(this.timer),this.timer=void 0),this.socket?.close(),this.socket=void 0,this.emitStatus("closed")}open(){let e=this.options.WebSocketImpl??globalThis.WebSocket;if(!e){this.emitStatus("error","WebSocket is not available in this runtime.");return}this.emitStatus("connecting",this.options.url);let n=new e(this.options.url);this.socket=n,n.onopen=()=>{this.attempts=0,this.emitStatus("open");let o=this.queue.splice(0,this.queue.length);for(let r of o)n.send(xm(r))},n.onmessage=o=>{let r=dd(ka(o.data));r&&this.emitMessage(r)},n.onerror=()=>{this.emitStatus("error",`Cannot reach the Morse server at ${this.options.url}.`)},n.onclose=()=>{if(this.socket=void 0,this.disposed){this.emitStatus("closed");return}this.emitStatus("closed","Connection lost \u2014 retrying\u2026"),this.scheduleReconnect()}}scheduleReconnect(){if(this.options.reconnect===!1||this.timer!==void 0)return;let e=this.options.maxBackoffMs??t1,n=Math.min(e,500*2**this.attempts);this.attempts+=1,this.timer=setTimeout(()=>{this.timer=void 0,this.disposed||this.open()},n),this.timer.unref?.()}};var us={cwd:"/mock/workspace",name:"mock-workspace"},n1={hostKind:"server",scope:Wb()?"workspace":"global",editorContext:!1,nativeDialogs:!1,insertIntoEditor:!1,revealFile:!1,filePicker:!0,fileUpload:!0,directoryPicker:!0},fd=class extends Er{kind="memory";timers=new Set;items=s1()?[]:a1();sessions=qb();hot=new Set(this.sessions.slice(0,2).map(e=>e.id));counter=100;disposed=!1;streaming=!1;state={workspace:us,model:{provider:"mock",id:"mock-1",name:"Mock Model",contextWindow:1e6,maxTokens:32768},thinkingLevel:"low",availableModels:[{provider:"mock",id:"mock-1",name:"Mock Model",contextWindow:128e3},{provider:"mock",id:"mock-2",name:"Mock Model (fast)",contextWindow:262144},{provider:"mock-cloud",id:"mock-1",name:"Mock Model",contextWindow:2e5},{provider:"mock-cloud",id:"mock-3",name:"Mock Model (pro)",contextWindow:1e6}],availableThinkingLevels:["off","low","high"],availableCommands:[{name:"skill:codebase-memory",description:"Query the knowledge graph",source:"skill"},{name:"fix-tests",description:"Fix failing tests",source:"prompt"}],streaming:!1,usage:{inputTokens:56400,outputTokens:35200,totalTokens:91600,cacheReadTokens:28e5,cacheWriteTokens:12e3},lastUsage:{inputTokens:12400,outputTokens:668,totalTokens:13068,cacheReadTokens:5e5,cacheWriteTokens:0,reasoningTokens:1066},costUsd:.42,contextUsage:{tokens:79e3,contextWindow:1e6,percent:7.9},counts:{userMessages:10,assistantMessages:165,toolCalls:42,toolResults:42,totalMessages:200},busy:this.items.some(e=>e.kind==="tool"&&e.status==="running"),agentReady:!0,agentStarting:!1};connect(){this.disposed=!1,this.emitStatus("open","in-memory mock host"),this.finishFixtureRun(),typeof location<"u"&&new URL(location.href).searchParams.get("autorun")&&this.schedule(()=>this.simulateRun("Refactor the sidebar and make it responsive."),1500)}finishFixtureRun(){let e=this.items.find(n=>n.kind==="tool"&&n.status==="running");!e||e.kind!=="tool"||this.schedule(()=>{e.status="ok",e.durationMs=3100,this.emit({type:"transcript/update",payload:V({},e)}),this.state=Q(V({},this.state),{busy:!1}),this.emit({type:"session/state",payload:this.state})},6e3)}send(e){switch(e.type){case"client/ready":this.emit({type:"transcript/replace",payload:{items:this.items}}),this.emit({type:"project/list",payload:{projects:Gb()}}),this.emit({type:"session/list",payload:{sessions:this.sessions}}),this.emitActivity(),this.emit({type:"host/ready",payload:{protocolVersion:15,capabilities:n1,state:this.state}});return;case"chat/prompt":this.simulateRun(e.payload.text);return;case"chat/abort":this.abortRun();return;case"session/new":{this.items=[],this.emit({type:"transcript/replace",payload:{items:[]}});let n={id:this.nextId("session"),title:"New session",cwd:us.cwd,updatedAt:Date.now(),messageCount:0};this.sessions=[n,...this.sessions],this.hot.add(n.id),this.state=Q(V({},this.state),{sessionId:n.id,sessionTitle:n.title,streaming:!1}),this.emit({type:"session/list",payload:{sessions:this.sessions}}),this.emit({type:"session/state",payload:this.state}),this.emitActivity();return}case"session/list":this.emit({type:"session/list",payload:{sessions:this.sessions}});return;case"project/list":this.emit({type:"project/list",payload:{projects:Gb()}});return;case"project/open":case"session/activate":case"session/load":this.notify("info","Mock host: switched session.");return;case"session/close":this.notify("warn","Mock host: closing sessions is a no-op.");return;case"session/compact":this.notify("success","Mock host: context compacted.");return;case"model/set":{let n=this.state.availableModels.find(o=>o.provider===e.payload.provider&&o.id===e.payload.id);this.state=Q(V({},this.state),{model:n?V({},n):{provider:e.payload.provider,id:e.payload.id,name:e.payload.id}}),this.emit({type:"session/state",payload:this.state});return}case"thinking/set":this.state=Q(V({},this.state),{thinkingLevel:e.payload.level}),this.emit({type:"session/state",payload:this.state});return;case"interaction/respond":this.emit({type:"interaction/dismiss",payload:{requestId:e.payload.requestId}});return;case"host/command":if(e.payload.command==="listFiles"&&e.payload.requestId){this.emit({type:"host/command/result",payload:{requestId:e.payload.requestId,ok:!0,data:{files:o1}}});return}if(e.payload.command==="uploadFile"&&e.payload.requestId){let n=typeof e.payload.args?.name=="string"?e.payload.args.name:"upload.bin";this.emit({type:"host/command/result",payload:{requestId:e.payload.requestId,ok:!0,data:{path:`.morse/uploads/${n}`,name:n,bytes:0}}});return}if(e.payload.command==="listDirectories"&&e.payload.requestId){this.emit({type:"host/command/result",payload:{requestId:e.payload.requestId,ok:!0,data:i1(e.payload.args?.path)}});return}this.notify("warn",`The mock host does not implement "${e.payload.command}".`);return;default:return}}dispose(){this.disposed=!0,this.abortRun(),this.emitStatus("closed")}simulateRun(e){if(this.streaming){this.notify("warn","A mock run is already streaming.");return}this.streaming=!0,this.appendItem({kind:"user",id:this.nextId("user"),at:Date.now(),text:e}),this.emit({type:"session/state",payload:Q(V({},this.state),{streaming:!0})}),this.emitActivity();let n=0,o=[{thinking:"Let me find where the sidebar is built before I touch anything.",tool:{name:"bash",title:"bash: ls packages/ui-angular/src/app",output:"app.css app.html app.ts chat/ core/ nav/"}},{thinking:"Found it. Now check the navigation component and the styles it relies on.",tool:{name:"read",title:"read: packages/ui-angular/src/app/nav/session-nav.ts",output:`1 import { Component } from "@angular/core";
7
- 2 ... 38 lines`}}];for(let s of o){let a=this.nextId("assistant");this.schedule(()=>{this.appendItem({kind:"assistant",id:a,at:Date.now(),text:"",thinking:"",streaming:!0,model:this.state.model?.name})},n),n+=40;for(let d of zb(s.thinking)){let u=d;this.schedule(()=>{this.emit({type:"transcript/delta",payload:{id:a,thinking:u}})},n),n+=55}let c=this.nextId("tool");this.schedule(()=>{this.updateItem({kind:"assistant",id:a,at:Date.now(),text:"",thinking:s.thinking,streaming:!1,model:this.state.model?.name}),this.appendItem({kind:"tool",id:c,at:Date.now(),name:s.tool.name,title:s.tool.title,status:"running"})},n),n+=900;let l=n;this.schedule(()=>{this.updateItem({kind:"tool",id:c,at:Date.now(),name:s.tool.name,title:s.tool.title,status:"ok",output:s.tool.output,durationMs:l})},n),n+=200}let r=`Mock host received: "${e}".
8
-
9
- This response is produced in the browser, with no pi process and no server, so you can iterate on the frontend (or a new frontend framework) freely.`,i=this.nextId("assistant");this.schedule(()=>{this.appendItem({kind:"assistant",id:i,at:Date.now(),text:"",thinking:"",streaming:!0,model:this.state.model?.name})},n),n+=40;for(let s of zb(r)){let a=s;this.schedule(()=>{this.emit({type:"transcript/delta",payload:{id:i,text:a}})},n),n+=55}this.schedule(()=>{this.streaming=!1,this.updateItem({kind:"assistant",id:i,at:Date.now(),text:r,thinking:"",streaming:!1,model:this.state.model?.name}),this.emit({type:"session/state",payload:Q(V({},this.state),{streaming:!1})}),this.emitActivity()},n+80)}appendItem(e){this.items=[...this.items,e],this.emit({type:"transcript/append",payload:e})}updateItem(e){this.items=this.items.map(n=>n.id===e.id?e:n),this.emit({type:"transcript/update",payload:e})}abortRun(){for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.streaming&&(this.streaming=!1,this.emitActivity())}notify(e,n){this.emit({type:"notice",payload:{level:e,text:n,at:Date.now()}})}schedule(e,n){let o=setTimeout(()=>{this.timers.delete(o),this.disposed||e()},n);this.timers.add(o)}nextId(e){return this.counter+=1,`mock-${e}-${this.counter}`}emitActivity(){let e=this.sessions.filter(n=>this.hot.has(n.id)).slice(0,4).map(n=>({sessionKey:n.id,streaming:this.streaming,busy:!1,agentReady:!0,agentStarting:!1}));this.emit({type:"session/activity",payload:{sessions:e}})}emit(e){this.emitMessage(e)}},o1=["AGENTS.md","README.md","package.json","packages/core/src/chat/service.ts","packages/core/src/domain.ts","packages/core/src/session/service.ts","packages/host-runtime/src/session-controller.ts","packages/protocol/src/wire.ts","packages/ui-angular/src/app/app.ts","packages/ui-angular/src/app/chat/chat-composer/chat-composer.ts","packages/ui-angular/src/app/core/markdown.ts","packages/ui-runtime/src/client.ts"],r1={"/mock":[{name:"home",path:"/mock/home"},{name:"projects",path:"/mock/projects"},{name:"workspace",path:"/mock/workspace"}],"/mock/home":[{name:"projects",path:"/mock/home/projects"}],"/mock/home/projects":[],"/mock/projects":[{name:"morse",path:"/mock/projects/morse"},{name:"other",path:"/mock/projects/other"}],"/mock/projects/morse":[{name:"packages",path:"/mock/projects/morse/packages"}],"/mock/projects/other":[],"/mock/projects/morse/packages":[],"/mock/workspace":[]};function i1(t){let e=typeof t=="string"&&t.trim().length>0?t.trim():us.cwd,n=e==="/mock"?void 0:e.slice(0,e.lastIndexOf("/"))||"/";return{path:e,parent:n,directories:r1[e]??[],isGitRepo:e==="/mock/projects/morse",canOpen:!0,roots:[{name:"mock",path:"/mock"},{name:"workspace",path:us.cwd}]}}function zb(t){return t.match(/.{1,14}/g)??[]}function Wb(){return typeof location>"u"?!1:new URL(location.href).searchParams.get("scope")==="workspace"}function s1(){return typeof location>"u"?!1:new URL(location.href).searchParams.get("empty")==="1"}function qb(){let t=Date.now(),e=[{id:"/mock/morse/2026-01-01_ui-overhaul.jsonl",title:"Sidebar overhaul: projects, sessions, composer",cwd:us.cwd,updatedAt:t-6e4,messageCount:12},{id:"/mock/morse/2026-01-01_scrollbar.jsonl",title:"Improve native scrollbar: compact and themed",cwd:us.cwd,updatedAt:t-7*6e4,messageCount:6}];return Wb()?e:[...e,{id:"/mock/morse/2026-01-01_providers.jsonl",title:"Add provider picker with context sizes",cwd:"/mock/morse",updatedAt:t-20*6e4,messageCount:24},{id:"/mock/morse/2026-01-01_greeting.jsonl",title:"Greeting",cwd:"/mock/morse",updatedAt:t-180*6e4,messageCount:2},{id:"/mock/eigen-morph/2026-01-01_manifest.jsonl",title:"Manifest report-worker untuk production",cwd:"/mock/eigen-morph",updatedAt:t-1560*6e4,messageCount:31}]}function Gb(){let t=new Map;for(let e of qb()){let n=t.get(e.cwd);if(n){n.sessionCount+=1,n.lastUsedAt=Math.max(n.lastUsedAt,e.updatedAt);continue}t.set(e.cwd,{path:e.cwd,name:e.cwd.split("/").filter(Boolean).at(-1)??e.cwd,sessionCount:1,lastUsedAt:e.updatedAt})}return[...t.values()].sort((e,n)=>n.lastUsedAt-e.lastUsedAt)}function a1(){let t=Date.now(),e=["Plan:","","1. **Navigation** \u2014 projects \u2192 sessions, collapsible, with a search box.","2. **Header** \u2014 session title, scope, status badge, `Compact`.","3. **Composer** \u2014 model + thinking + send in one control row.","","Two shapes, because the hosts differ: the browser host is *global* (many projects), VS Code is scoped to the folders it has open.","","```ts","export class SessionNav {"," protected readonly scope = computed(() => this.morse.capabilities()?.scope ?? 'global');",""," protected readonly groups = computed(() => {",' return this.scope() === "global"'," ? this.projects().map((project) => ({ ... }))"," : [{ path: this.workspace().cwd, name: this.workspace().name, sessions }];"," });","}","```","","And a small overview of what each scope renders:","","| Host | Scope | Navigation shape |","|---|---|---|","| NestJS browser | `global` | projects \u2192 sessions |","| VS Code | `workspace` | one group (open folders) |","","See `docs/FRONTENDS.md` for the rule that frontends must read capabilities instead of guessing."].join(`
10
- `);return[{kind:"user",id:"mock-seed-user-1",at:t-15e4,text:"Refactor the sidebar to match the reference, make it responsive, and render markdown properly."},{kind:"tool",id:"mock-seed-tool-1",at:t-14e4,name:"bash",title:"bash: ls packages/ui-angular/src/app",status:"ok",output:"app.css app.html app.ts chat/ core/ nav/",durationMs:12},{kind:"tool",id:"mock-seed-tool-2",at:t-138e3,name:"read",title:"read: packages/ui-angular/src/app/app.css",status:"ok",output:"42 lines, 4 media queries",durationMs:8},{kind:"tool",id:"mock-seed-tool-3",at:t-13e4,name:"edit",title:"edit: packages/ui-angular/src/app/nav/session-nav.ts",status:"ok",output:"+26 -7",durationMs:190},{kind:"tool",id:"mock-seed-tool-4",at:t-128e3,name:"edit",title:"edit: packages/ui-angular/src/app/app.css",status:"ok",output:"+18 -4",durationMs:140},{kind:"tool",id:"mock-seed-tool-5",at:t-1800,name:"bash",title:"bash: npm run build:ui",status:"running",output:"Application bundle generation complete. [1.2 seconds]"},{kind:"assistant",id:"mock-seed-assistant-1",at:t-1e5,text:e,thinking:"The webview is narrow, so the navigation has to become a drawer below ~760px instead of a second column.",streaming:!1,model:"Mock Model"},{kind:"notice",id:"mock-seed-notice-1",at:t-6e4,level:"info",text:"Everything is wired through the same wire protocol \u2014 try ?scope=workspace to see the VS Code shape."}]}function Yb(t={}){if(Ub())return new pd;let e=t.href??(typeof location<"u"?location.href:"http://localhost/"),n=new URL(e,"http://localhost/");if(t.forceMock===!0||n.searchParams.get("mock")==="1")return new fd;let o=n.searchParams.get("server");if(o)return new Na({url:o,WebSocketImpl:t.WebSocketImpl});let r=n.protocol==="https:",i=t.websocketPath??"/ws";return new Na({url:`${r?"wss":"ws"}://${n.host}${i}`,WebSocketImpl:t.WebSocketImpl})}var Zb=new $e("morse.transport",{providedIn:"root",factory:()=>Yb()});var l1={name:"@morse/ui-angular",version:"0.1.0"},d1=6e3,Ht=class t{transport=O(Zb);destroyRef=O(zt);view=H(ud());client;actions;slowConnectionTimer;connection=T(()=>this.view().connection);connectionDetail=T(()=>this.view().connectionDetail);slowConnection=H(!1);capabilities=T(()=>this.view().capabilities);state=T(()=>this.view().state);items=T(()=>this.view().items);projects=T(()=>this.view().projects);sessions=T(()=>this.view().sessions);activity=T(()=>this.view().activity);sessionActivity=T(()=>{let e=new Map;for(let n of this.view().activity)e.set(n.sessionKey,n);return e});pendingInteraction=T(()=>this.view().pendingInteraction);lastNotice=T(()=>this.view().lastNotice);lastError=T(()=>this.view().lastError);agentReady=T(()=>this.view().state.agentReady);agentStarting=T(()=>this.view().state.agentStarting);agentError=T(()=>this.view().state.agentError);running=T(()=>this.view().state.streaming||this.view().state.busy);workspace=T(()=>this.view().state.workspace);model=T(()=>this.view().state.model);thinkingLevel=T(()=>this.view().state.thinkingLevel);availableModels=T(()=>this.view().state.availableModels);availableThinkingLevels=T(()=>this.view().state.availableThinkingLevels);availableCommands=T(()=>this.view().state.availableCommands);usage=T(()=>this.view().state.usage);hasOlderHistory=T(()=>this.view().state.hasOlderHistory===!0);loadingOlderHistory=T(()=>this.view().state.loadingOlderHistory===!0);constructor(){this.client=jb({transport:this.transport,frontend:l1}),this.actions=this.client.actions;let e=this.client.getView();this.view.set(e),this.trackSlowConnection(e.connection),this.client.subscribe(n=>{this.view.set(n),this.trackSlowConnection(n.connection)}),this.destroyRef.onDestroy(()=>{this.clearSlowConnectionTimer(),this.client.dispose()})}trackSlowConnection(e){if(e!=="connecting"){this.clearSlowConnectionTimer(),this.slowConnection.set(!1);return}this.slowConnectionTimer===void 0&&(this.slowConnectionTimer=setTimeout(()=>{this.slowConnection.set(!0)},d1))}clearSlowConnectionTimer(){this.slowConnectionTimer!==void 0&&(clearTimeout(this.slowConnectionTimer),this.slowConnectionTimer=void 0)}prompt(e,n="new",o,r){this.actions.prompt(e,n,o,r)}editMessage(e,n){this.actions.editMessage(e,n)}forkMessage(e){this.actions.forkMessage(e)}onComposerSeed(e){return this.client.onComposerSeed(e)}onContextSelection(e){return this.client.onContextSelection(e)}onContextSelectionLive(e){return this.client.onContextSelectionLive(e)}ready(){this.actions.ready()}abort(){this.actions.abort()}newSession(e){this.actions.newSession(e)}openProject(e){this.actions.openProject(e)}requestProjects(){this.actions.requestProjects()}activateSession(e,n){this.actions.activateSession(e,n)}closeSession(e){this.actions.closeSession(e)}deleteSession(e){this.actions.deleteSession(e)}compactSession(e){this.actions.compactSession(e)}loadOlderHistory(){this.actions.loadOlderHistory()}loadSession(e){this.actions.loadSession(e)}requestSessions(){this.actions.requestSessions()}setModel(e,n){this.actions.setModel(e,n)}setThinkingLevel(e){this.actions.setThinkingLevel(e)}respond(e){this.actions.respond(e)}hostCommand(e,n){this.actions.hostCommand(e,n)}requestHostCommand(e,n){return this.actions.hostCommand(e,n)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Pe({token:t,factory:t.\u0275fac,providedIn:"root"})};var u1=10*1024*1024,ps=class t{morse=O(Ht);available=T(()=>this.morse.capabilities()?.fileUpload===!0);async upload(e){let n=[],o=[];for(let r of e){if(r.size>u1){o.push(r.name);continue}let i=await Em(r);if(!i){o.push(r.name);continue}let s=await this.morse.requestHostCommand("uploadFile",{name:r.name,mimeType:r.type,data:i}),a=typeof s?.path=="string"?s.path:void 0;if(!a){o.push(r.name);continue}n.push({path:a,name:r.name,bytes:typeof s?.bytes=="number"?s.bytes:r.size})}return{added:n,failed:o}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Pe({token:t,factory:t.\u0275fac,providedIn:"root"})};var md=class t{morse=O(Ht);cache=H([]);loading=H(!1);requested=!1;loadedFor;files=this.cache.asReadonly();busy=this.loading.asReadonly();available=T(()=>this.morse.capabilities()?.filePicker===!0);constructor(){ke(()=>{if(!this.available())return;let e=this.morse.workspace().cwd;this.ensureLoaded(this.loadedFor!==void 0&&this.loadedFor!==e)})}ensureLoaded(e=!1){if(this.loading()||this.requested&&!e)return;this.requested=!0;let n=this.morse.workspace().cwd;this.loading.set(!0),this.morse.requestHostCommand("listFiles").then(o=>{if(this.loading.set(!1),this.morse.workspace().cwd!==n){this.ensureLoaded(!0);return}this.loadedFor=n;let r=o?.files;Array.isArray(r)&&this.cache.set(r.filter(i=>typeof i=="string"))})}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Pe({token:t,factory:t.\u0275fac,providedIn:"root"})};function p1(t,e,n=80){let o=Math.floor(t-4-8);return Math.max(n,Math.min(e,o))}var hd=class t{preferred=le(320,{alias:"morsePopoverFit"});host=O(Gt);renderer=O(Go).createRenderer(null,null);observer;constructor(){aa(()=>{this.fit();let e=this.anchor();e&&typeof ResizeObserver<"u"&&(this.observer=new ResizeObserver(()=>this.fit()),this.observer.observe(e))}),O(zt).onDestroy(()=>this.observer?.disconnect())}onWindowResize(){this.fit()}anchor(){let e=this.host.nativeElement;return e.offsetParent??e.parentElement}fit(){let e=this.anchor()?.getBoundingClientRect().top??0,n=p1(e,this.preferred());this.renderer.setStyle(this.host.nativeElement,"--morse-popover-max-height",`${n}px`)}static \u0275fac=function(n){return new(n||t)};static \u0275dir=ca({type:t,selectors:[["","morsePopoverFit",""]],hostBindings:function(n,o){n&1&&U("resize",function(){return o.onWindowResize()},vf)},inputs:{preferred:[1,"morsePopoverFit","preferred"]}})};var nn=class t{morseEnter=le(0);morseEnterY=le(8);morseEnterDuration=le(260);morseEnterScale=le(void 0);element=O(Gt);animation=O(pn);ngAfterViewInit(){let e=Math.max(0,this.morseEnter());this.animation.enter(this.element.nativeElement,{y:this.morseEnterY(),duration:this.morseEnterDuration(),scale:this.morseEnterScale(),delay:Math.min(e,8)*24})}static \u0275fac=function(n){return new(n||t)};static \u0275dir=ca({type:t,selectors:[["","morseEnter",""]],inputs:{morseEnter:[1,"morseEnter"],morseEnterY:[1,"morseEnterY"],morseEnterDuration:[1,"morseEnterDuration"],morseEnterScale:[1,"morseEnterScale"]}})};var f1=["list"];function m1(t,e){t&1&&(_(0,"div",2),g(1,"Reading the workspace\u2026"),b())}function h1(t,e){if(t&1&&(_(0,"div",4),g(1),b()),t&2){let n=v(2);f(),pt("No match for \u201C",n.query(),"\u201D.")}}function g1(t,e){if(t&1){let n=Y();_(0,"div",4),g(1," The host returned no workspace files. "),_(2,"button",5),U("click",function(){D(n);let r=v(2);return k(r.reload.emit())}),g(3,"Load again"),b()()}}function y1(t,e){if(t&1&&A(0,h1,2,1,"div",4)(1,g1,4,0,"div",4),t&2){let n=v();R(n.query().length>0?0:1)}}function v1(t,e){if(t&1){let n=Y();_(0,"li")(1,"button",6),U("mouseenter",function(){let r=D(n).$index,i=v(2);return k(i.activeChange.emit(r))})("click",function(){let r=D(n).$implicit,i=v(2);return k(i.pick.emit(r))}),_(2,"span",7),g(3),b(),_(4,"span",8)(5,"span",9),g(6),b(),g(7),b()()()}if(t&2){let n=e.$implicit,o=e.$index,r=v(2);f(),Be("active",o===r.active()),f(2),$(r.isDirectory(n)?"\u25B8":"\u25A4"),f(3),$(r.split(n).dir),f(),pt("",r.split(n).base," ")}}function _1(t,e){if(t&1&&(_(0,"ul",null,0),ze(2,v1,8,5,"li",null,ii),b()),t&2){let n=v();f(2),Ge(n.files())}}var gd=class t{files=le.required();busy=le(!1);query=le("");active=le(0);pick=bt();close=bt();reload=bt();activeChange=bt();list=St("list");constructor(){ke(()=>{this.active(),this.files(),setTimeout(()=>this.revealActive(),0)})}revealActive(){let e=this.list()?.nativeElement,n=e?.children.item(this.active());if(!e||!n)return;let o=e.getBoundingClientRect(),r=n.getBoundingClientRect();r.top<o.top?e.scrollTop-=o.top-r.top:r.bottom>o.bottom&&(e.scrollTop+=r.bottom-o.bottom)}split(e){let n=e.lastIndexOf("/");return n===-1?{dir:"",base:e}:{dir:e.slice(0,n+1),base:e.slice(n+1)}}isDirectory(e){return Cm(e)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Le({type:t,selectors:[["morse-file-picker"]],viewQuery:function(n,o){n&1&&Ft(o.list,f1,5),n&2&&Wt()},inputs:{files:[1,"files"],busy:[1,"busy"],query:[1,"query"],active:[1,"active"]},outputs:{pick:"pick",close:"close",reload:"reload",activeChange:"activeChange"},decls:16,vars:3,consts:[["list",""],[1,"picker",3,"morseEnter","morseEnterY"],[1,"busy"],[1,"hint"],[1,"empty"],["type","button",1,"reload",3,"click"],["type","button",3,"mouseenter","click"],[1,"icon"],[1,"path"],[1,"dir"]],template:function(n,o){n&1&&(_(0,"div",1),A(1,m1,2,0,"div",2)(2,y1,2,1)(3,_1,4,0,"ul"),_(4,"div",3)(5,"kbd"),g(6,"\u2191"),b(),_(7,"kbd"),g(8,"\u2193"),b(),g(9," move \xB7 "),_(10,"kbd"),g(11,"Enter"),b(),g(12," attach/open \xB7 "),_(13,"kbd"),g(14,"Esc"),b(),g(15," close "),b()()),n&2&&(X("morseEnter",0)("morseEnterY",6),f(),R(o.busy()&&o.files().length===0?1:o.files().length===0?2:3))},dependencies:[nn],styles:["[_nghost-%COMP%]{display:block}.picker[_ngcontent-%COMP%]{display:flex;flex-direction:column;max-height:var(--%NS%morse-popover-max-height, 300px);border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-md);background:var(--%NS%morse-panel, var(--%NS%morse-bg));box-shadow:0 10px 28px #0000004d;overflow:hidden}ul[_ngcontent-%COMP%]{margin:0;padding:4px 0;list-style:none;overflow-y:auto}li[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%;padding:4px 10px;border:0;border-radius:0;background:transparent;color:var(--%NS%morse-fg);font-size:12px;text-align:left;cursor:pointer}li[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{background:var(--%NS%morse-active)}.icon[_ngcontent-%COMP%]{flex:none;color:var(--%NS%morse-fg-muted);font-size:11px}.path[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--%NS%morse-font-mono)}.dir[_ngcontent-%COMP%]{color:var(--%NS%morse-fg-muted)}.empty[_ngcontent-%COMP%], .busy[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:8px 10px;color:var(--%NS%morse-fg-muted);font-size:12px}.reload[_ngcontent-%COMP%]{padding:1px 8px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg);font-size:11px;cursor:pointer}.reload[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover)}.hint[_ngcontent-%COMP%]{padding:5px 10px;border-top:1px solid var(--%NS%morse-border);color:var(--%NS%morse-fg-muted);font-size:11px}kbd[_ngcontent-%COMP%]{font-family:var(--%NS%morse-font-mono);font-size:10px;padding:0 3px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm)}"]})};function Qb(t,e,n=50){let o=e.trim().toLowerCase();return t.map(r=>({file:r,score:o.length===0?0:b1(r,o)})).filter(r=>r.score<Number.POSITIVE_INFINITY).sort((r,i)=>Kb(r.file)-Kb(i.file)||r.score-i.score||r.file.length-i.file.length||r.file.localeCompare(i.file)).slice(0,n).map(r=>r.file)}function Cm(t){return t.endsWith("/")}function Kb(t){return Cm(t)?0:1}function b1(t,e){let n=(Cm(t)?t.slice(0,-1):t).toLowerCase(),o=n.lastIndexOf("/"),r=o===-1?n:n.slice(o+1);return r.startsWith(e)?0:r.includes(e)?1:n.startsWith(e)?2:n.includes(e)?3:Number.POSITIVE_INFINITY}var E1=["list"],x1=(t,e)=>e.id;function C1(t,e){if(t&1&&(_(0,"div",3),g(1),b()),t&2){let n=v(2);f(),pt("No command matches \u201C",n.query(),"\u201D.")}}function w1(t,e){t&1&&(_(0,"div",3),g(1,"No commands available in this session."),b())}function S1(t,e){if(t&1&&A(0,C1,2,1,"div",3)(1,w1,2,0,"div",3),t&2){let n=v();R(n.query().length>0?0:1)}}function T1(t,e){if(t&1&&(_(0,"span",5),g(1),b()),t&2){let n=v().$implicit;f(),$(n.icon)}}function M1(t,e){if(t&1&&(_(0,"span",8),g(1),b()),t&2){let n=v().$implicit;f(),$(n.description)}}function I1(t,e){if(t&1&&(_(0,"span",9),g(1),b()),t&2){let n=v().$implicit;f(),$(n.badge)}}function D1(t,e){if(t&1){let n=Y();_(0,"li")(1,"button",4),U("mouseenter",function(){let r=D(n).$index,i=v(2);return k(i.activeChange.emit(r))})("click",function(){let r=D(n).$implicit,i=v(2);return k(i.pick.emit(r.id))}),A(2,T1,2,1,"span",5),_(3,"span",6)(4,"span",7),g(5),b(),A(6,M1,2,1,"span",8),b(),A(7,I1,2,1,"span",9),b()()}if(t&2){let n=e.$implicit,o=e.$index,r=v(2);f(),Be("active",o===r.active()),f(),R(n.icon?2:-1),f(3),$(n.label),f(),R(n.description?6:-1),f(),R(n.badge?7:-1)}}function k1(t,e){if(t&1&&(_(0,"ul",null,0),ze(2,D1,8,6,"li",null,x1),b()),t&2){let n=v();f(2),Ge(n.items())}}var yd=class t{items=le.required();query=le("");active=le(0);pick=bt();close=bt();activeChange=bt();list=St("list");constructor(){ke(()=>{this.active(),this.items(),setTimeout(()=>this.revealActive(),0)})}revealActive(){let e=this.list()?.nativeElement,n=e?.children.item(this.active());if(!e||!n)return;let o=e.getBoundingClientRect(),r=n.getBoundingClientRect();r.top<o.top?e.scrollTop-=o.top-r.top:r.bottom>o.bottom&&(e.scrollTop+=r.bottom-o.bottom)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Le({type:t,selectors:[["morse-command-picker"]],viewQuery:function(n,o){n&1&&Ft(o.list,E1,5),n&2&&Wt()},inputs:{items:[1,"items"],query:[1,"query"],active:[1,"active"]},outputs:{pick:"pick",close:"close",activeChange:"activeChange"},decls:18,vars:3,consts:[["list",""],[1,"picker",3,"morseEnter","morseEnterY"],[1,"hint"],[1,"empty"],["type","button",3,"mouseenter","click"],[1,"icon"],[1,"text"],[1,"label"],[1,"description"],[1,"badge"]],template:function(n,o){n&1&&(_(0,"div",1),A(1,S1,2,1)(2,k1,4,0,"ul"),_(3,"div",2)(4,"kbd"),g(5,"\u2191"),b(),_(6,"kbd"),g(7,"\u2193"),b(),g(8," move \xB7 "),_(9,"kbd"),g(10,"Enter"),b(),g(11," run \xB7 "),_(12,"kbd"),g(13,"Tab"),b(),g(14," insert \xB7 "),_(15,"kbd"),g(16,"Esc"),b(),g(17," close "),b()()),n&2&&(X("morseEnter",0)("morseEnterY",6),f(),R(o.items().length===0?1:2))},dependencies:[nn],styles:["[_nghost-%COMP%]{display:block}.picker[_ngcontent-%COMP%]{display:flex;flex-direction:column;max-height:var(--%NS%morse-popover-max-height, 320px);border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-md);background:var(--%NS%morse-panel, var(--%NS%morse-bg));box-shadow:0 10px 28px #0000004d;overflow:hidden}ul[_ngcontent-%COMP%]{margin:0;padding:4px 0;list-style:none;overflow-y:auto}li[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%;padding:5px 10px;border:0;border-radius:0;background:transparent;color:var(--%NS%morse-fg);font-size:12px;text-align:left;cursor:pointer}li[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{background:var(--%NS%morse-active)}.icon[_ngcontent-%COMP%]{flex:none;width:14px;color:var(--%NS%morse-fg-muted);text-align:center}.text[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.label[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--%NS%morse-font-mono)}.description[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--%NS%morse-fg-muted);font-size:11px}.badge[_ngcontent-%COMP%]{flex:none;padding:1px 6px;border-radius:999px;background:var(--%NS%morse-badge-bg);color:var(--%NS%morse-badge-fg);font-size:10px}.empty[_ngcontent-%COMP%]{padding:8px 10px;color:var(--%NS%morse-fg-muted);font-size:12px}.hint[_ngcontent-%COMP%]{padding:5px 10px;border-top:1px solid var(--%NS%morse-border);color:var(--%NS%morse-fg-muted);font-size:11px}kbd[_ngcontent-%COMP%]{font-family:var(--%NS%morse-font-mono);font-size:10px;padding:0 3px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm)}"]})};function Xb(t,e,n=50){let o=e.trim().toLowerCase();return o.length===0?t.slice(0,n):t.map(r=>({item:r,score:N1(r,o)})).filter(r=>r.score<Number.POSITIVE_INFINITY).sort((r,i)=>r.score-i.score||r.item.label.length-i.item.label.length).slice(0,n).map(r=>r.item)}function N1(t,e){let n=t.label.toLowerCase();return n.startsWith(e)?0:n.includes(e)?1:t.description?.toLowerCase().includes(e)?2:Number.POSITIVE_INFINITY}function no(t){return t<1e3?t.toString():t<1e4?`${(t/1e3).toFixed(1)}k`:t<1e6?`${Math.round(t/1e3)}k`:t<1e7?`${(t/1e6).toFixed(1)}M`:`${Math.round(t/1e6)}M`}function wm(t){if(!t)return;let e=t.cacheReadTokens??0,n=t.cacheWriteTokens??0,o=t.inputTokens+e+n;if(!(o<=0||e===0&&n===0))return e/o*100}function Sm(t){if(!(t===void 0||t<=0))return`$${t.toFixed(3)}`}function Tm(t){let e=[],n=t.usage;if(n){n.inputTokens>0&&e.push(`\u2191${no(n.inputTokens)}`),n.outputTokens>0&&e.push(`\u2193${no(n.outputTokens)}`),n.cacheReadTokens&&e.push(`R${no(n.cacheReadTokens)}`),n.cacheWriteTokens&&e.push(`W${no(n.cacheWriteTokens)}`);let i=wm(n);i!==void 0&&e.push(`CH${i.toFixed(1)}%`)}let o=Sm(t.costUsd);o&&e.push(o);let r=t.contextUsage;if(r){let i=r.percent!==null?`${r.percent.toFixed(1)}%`:"?";e.push(`${i}/${no(r.contextWindow)}`)}return e.join(" ")}var O1=["search"],A1=["list"],R1=(t,e)=>e.provider,P1=(t,e)=>e.index;function L1(t,e){if(t&1&&(_(0,"div",7),g(1),b()),t&2){let n=v();f(),pt("No model matches \u201C",n.filter(),"\u201D.")}}function F1(t,e){t&1&&(_(0,"span",12),g(1),b()),t&2&&(f(),$(e))}function V1(t,e){t&1&&(_(0,"span",13),g(1,"\u2713"),b())}function $1(t,e){if(t&1){let n=Y();_(0,"button",10),U("mouseenter",function(){let r=D(n).$implicit,i=v(4);return k(i.active.set(r.index))})("click",function(){let r=D(n).$implicit,i=v(4);return k(i.pick.emit(r.model))}),_(1,"span",11),g(2),b(),A(3,F1,2,1,"span",12),A(4,V1,2,0,"span",13),b()}if(t&2){let n,o=e.$implicit,r=v(4);Be("active",o.index===r.active())("selected",r.keyOf(o.model)===r.current()),X("title",r.keyOf(o.model)),He("aria-current",r.keyOf(o.model)===r.current()?"true":null),f(2),$(o.model.name),f(),R((n=r.context(o.model))?3:-1,n),f(),R(r.keyOf(o.model)===r.current()?4:-1)}}function j1(t,e){if(t&1&&(_(0,"div",8),g(1),b(),ze(2,$1,5,9,"button",9,P1)),t&2){let n=v().$implicit;f(),$(n.provider),f(),Ge(n.rows)}}function H1(t,e){if(t&1&&A(0,j1,4,1),t&2){let n=e.$implicit;R(n.rows.length>0?0:-1)}}function B1(t,e){if(t&1&&ze(0,H1,1,1,null,null,R1),t&2){let n=v();Ge(n.groups())}}function U1(t,e){let n=e.trim().toLowerCase(),o=new Map;for(let r of t){if(n.length>0&&!`${r.provider} ${r.id} ${r.name}`.toLowerCase().includes(n))continue;let i=o.get(r.provider);i?i.push(r):o.set(r.provider,[r])}return[...o].map(([r,i])=>({provider:r,models:i}))}var vd=class t{models=le.required();current=le("");pick=bt();close=bt();host=O(Gt);search=St("search");list=St("list");filter=H("");active=H(0);groups=T(()=>{let e=0;return U1(this.models(),this.filter()).map(n=>({provider:n.provider,rows:n.models.map(o=>({model:o,index:e++}))}))});visible=T(()=>this.groups().flatMap(e=>e.rows.map(n=>n.model)));constructor(){aa(()=>this.search()?.nativeElement.focus()),ke(()=>{if(this.groups(),this.filter().trim().length>0)return;let e=this.visible().findIndex(n=>this.keyOf(n)===this.current());e>=0&&this.active.set(e)}),ke(()=>{this.active(),this.groups(),setTimeout(()=>this.revealActive(),0)})}revealActive(){let e=this.list()?.nativeElement,n=e?.querySelectorAll(".row")[this.active()];if(!e||!n)return;let o=e.getBoundingClientRect(),r=n.getBoundingClientRect(),i=e.querySelector(".group")?.offsetHeight??0,s=o.top+i;r.top<s?e.scrollTop-=s-r.top:r.bottom>o.bottom&&(e.scrollTop+=r.bottom-o.bottom)}keyOf(e){return`${e.provider}/${e.id}`}context(e){return e.contextWindow?no(e.contextWindow):""}onFilter(e){this.filter.set(e.target.value),this.active.set(0)}onKeydown(e){let n=this.visible();switch(e.key){case"Escape":e.preventDefault(),this.close.emit();return;case"ArrowDown":e.preventDefault(),this.active.update(o=>Math.min(o+1,Math.max(0,n.length-1)));return;case"ArrowUp":e.preventDefault(),this.active.update(o=>Math.max(0,o-1));return;case"Enter":{let o=n[this.active()];o&&(e.preventDefault(),this.pick.emit(o));return}default:return}}onDocumentPointerdown(e){let n=e.target;n&&!this.host.nativeElement.contains(n)&&this.close.emit()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Le({type:t,selectors:[["morse-model-picker"]],viewQuery:function(n,o){n&1&&Ft(o.search,O1,5)(o.list,A1,5),n&2&&Wt(2)},hostBindings:function(n,o){n&1&&U("pointerdown",function(i){return o.onDocumentPointerdown(i)},An)},inputs:{models:[1,"models"],current:[1,"current"]},outputs:{pick:"pick",close:"close"},decls:10,vars:4,consts:[["search",""],["list",""],[1,"panel",3,"morseEnter","morseEnterY"],[1,"search"],["aria-hidden","true",1,"search-icon"],["type","text","placeholder","Search models","aria-label","Search models",3,"input","keydown","value"],[1,"list"],[1,"empty"],[1,"group"],["type","button",1,"row",3,"active","selected","title"],["type","button",1,"row",3,"mouseenter","click","title"],[1,"name"],[1,"meta"],[1,"check"]],template:function(n,o){n&1&&(_(0,"div",2)(1,"div",3)(2,"span",4),g(3,"\u2315"),b(),_(4,"input",5,0),U("input",function(i){return o.onFilter(i)})("keydown",function(i){return o.onKeydown(i)}),b()(),_(6,"div",6,1),A(8,L1,2,1,"div",7)(9,B1,2,0),b()()),n&2&&(X("morseEnter",0)("morseEnterY",6),f(4),X("value",o.filter()),f(4),R(o.visible().length===0?8:9))},dependencies:[nn],styles:["[_nghost-%COMP%]{display:block}.panel[_ngcontent-%COMP%]{display:flex;flex-direction:column;max-height:var(--%NS%morse-popover-max-height, 340px);border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-md);background:var(--%NS%morse-panel, var(--%NS%morse-bg));box-shadow:0 12px 32px #00000059;overflow:hidden}.search[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;padding:8px 10px;border-bottom:1px solid var(--%NS%morse-border)}.search-icon[_ngcontent-%COMP%]{color:var(--%NS%morse-fg-muted);font-size:13px}.search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1;min-width:0;border:0;background:transparent;font-size:12.5px}.search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus-visible{outline:none}.list[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;padding-bottom:4px}.group[_ngcontent-%COMP%]{position:sticky;top:0;padding:8px 10px 4px;background:var(--%NS%morse-panel, var(--%NS%morse-bg));color:var(--%NS%morse-fg-muted);font-size:10px;font-weight:600;letter-spacing:.06em;text-transform:uppercase}.row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%;padding:5px 10px;border:0;border-radius:0;background:transparent;color:var(--%NS%morse-fg);font:inherit;font-size:12.5px;text-align:left;cursor:pointer}.row.active[_ngcontent-%COMP%], .row[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover)}.row.selected[_ngcontent-%COMP%]{background:var(--%NS%morse-active)}.name[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.meta[_ngcontent-%COMP%]{flex:none;color:var(--%NS%morse-fg-muted);font-size:11px}.check[_ngcontent-%COMP%]{flex:none;color:var(--%NS%morse-accent);font-size:12px}.empty[_ngcontent-%COMP%]{padding:12px 10px;color:var(--%NS%morse-fg-muted);font-size:12px}"]})};var z1=["brain"],G1=["halo"];function W1(t,e){if(t&1&&(vn(),st(0,"path")),t&2){let n=e.$implicit;He("d",n)}}function q1(t,e){t&1&&st(0,"span",3,1)}function Y1(t,e){t&1&&st(0,"span",4,1)}var Z1=["M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z","M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z","M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4","M17.599 6.5a3 3 0 0 0 .399-1.375","M6.003 5.125A3 3 0 0 0 6.401 6.5","M3.477 10.896a4 4 0 0 1 .585-.396","M19.938 10.5a4 4 0 0 1 .585.396","M6 18a4 4 0 0 1-1.967-.516","M19.967 17.484A4 4 0 0 1 18 18"],K1={off:0,minimal:1,low:2,medium:3,high:4,xhigh:5,max:6};function Q1(t){return K1[t]??2}function X1(t){switch(t){case"off":return{params:{opacity:[.35,.6]},duration:5200,ease:"inOut(1)"};case"minimal":return{params:{opacity:[.6,1]},duration:2200};case"low":return{params:{rotate:["-7deg","7deg"]},duration:1500};case"medium":return{params:{scale:[1,1.14]},duration:950,halo:{duration:1300}};case"high":return{params:{scale:[1,1.18]},duration:560,halo:{duration:800}};case"xhigh":return{params:{scale:[1,1.16],rotate:["-8deg","8deg"]},duration:440,halo:{duration:620}};case"max":return{params:{scale:[1,1.22],rotate:["-12deg","12deg"]},duration:320,ease:"linear",halo:{duration:480}}}}var _d=class t{level=le.required();bumped=le(!1);host=O(Gt);animation=O(pn);brain=St("brain");halos=E_("halo");stoppers=[];paths=Z1;intensity=T(()=>Q1(this.level()));constructor(){ke(()=>{let e=this.level(),n=this.brain()?.nativeElement,o=this.halos().map(i=>i.nativeElement);if(this.stopLoops(),!n||!this.animation.isEnabled)return;let r=X1(e);this.stoppers.push(this.animation.loop(n,r.params,{duration:r.duration,delay:r.delay??0,ease:r.ease??"inOut(2)"})),r.halo&&o.forEach((i,s)=>{this.stoppers.push(this.animation.loop(i,{scale:[.72,1.9],opacity:[.55,0]},{duration:r.halo.duration,delay:(r.halo.delay??0)+s*r.halo.duration*.5,ease:"out(2)",alternate:!1}))})}),ke(()=>{this.bumped()&&this.animation.pop(this.host.nativeElement,{scale:1.3,duration:420})}),O(zt).onDestroy(()=>this.stopLoops())}stopLoops(){for(let e of this.stoppers)e();this.stoppers=[]}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Le({type:t,selectors:[["morse-brain"]],viewQuery:function(n,o){n&1&&Ft(o.brain,z1,5)(o.halos,G1,5),n&2&&Wt(2)},hostVars:3,hostBindings:function(n,o){n&2&&(He("data-level",o.level()),Be("bumped",o.bumped()))},inputs:{level:[1,"level"],bumped:[1,"bumped"]},decls:6,vars:2,consts:[["brain",""],["halo",""],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","1.7","stroke-linecap","round","stroke-linejoin","round","aria-hidden","true",1,"brain"],["aria-hidden","true",1,"wave","wave-a"],["aria-hidden","true",1,"wave","wave-b"]],template:function(n,o){n&1&&(vn(),C(0,"svg",2,0),ze(2,W1,1,1,":svg:path",null,ii),w(),A(4,q1,2,0,"span",3),A(5,Y1,2,0,"span",4)),n&2&&(f(2),Ge(o.paths),f(2),R(o.intensity()>=3?4:-1),f(),R(o.intensity()>=4?5:-1))},styles:['[_nghost-%COMP%]{position:relative;display:inline-flex;width:16px;height:16px;color:var(--%NS%morse-accent)}.brain[_ngcontent-%COMP%]{width:100%;height:100%;transform-box:fill-box;transform-origin:center}.wave[_ngcontent-%COMP%]{position:absolute;inset:-1px;border-radius:50%;border:1px solid currentColor;opacity:0;pointer-events:none}[data-level="off"][_nghost-%COMP%]{color:var(--%NS%morse-fg-muted)}[data-level="minimal"][_nghost-%COMP%]{color:var(--%NS%morse-info)}[data-level="low"][_nghost-%COMP%]{color:var(--%NS%morse-success)}[data-level="medium"][_nghost-%COMP%]{color:var(--%NS%morse-warn)}[data-level="high"][_nghost-%COMP%]{color:var(--%NS%morse-error)}[data-level="xhigh"][_nghost-%COMP%]{color:var(--%NS%morse-error);color:color-mix(in srgb,var(--%NS%morse-error) 55%,var(--%NS%morse-typename))}[data-level="max"][_nghost-%COMP%]{color:var(--%NS%morse-typename)}']})};var J1=["panel"];function eD(t,e){t&1&&(_(0,"span",10),g(1,"\u2713"),b())}function tD(t,e){if(t&1){let n=Y();_(0,"button",8),U("mouseenter",function(){let r=D(n).$index,i=v(2);return k(i.active.set(r))})("click",function(){let r=D(n).$implicit,i=v(2);return k(i.choose(r))}),Ke(1,"morse-brain",2),_(2,"span",9),g(3),b(),A(4,eD,2,0,"span",10),b()}if(t&2){let n=e.$implicit,o=e.$index,r=v(2);Be("active",o===r.active())("selected",n===r.current()),He("aria-selected",n===r.current()),f(),X("level",n),f(2),$(n),f(),R(n===r.current()?4:-1)}}function nD(t,e){if(t&1){let n=Y();_(0,"div",6,0),U("keydown",function(r){D(n);let i=v();return k(i.onKeydown(r))}),ze(2,tD,5,8,"button",7,ii),b()}if(t&2){let n=v();X("morseEnter",0)("morseEnterY",6),f(2),Ge(n.levels())}}var bd=class t{levels=le.required();current=le.required();pick=bt();host=O(Gt);panel=St("panel");open=H(!1);active=H(0);bumped=H(!1);constructor(){ke(()=>{this.open()&&setTimeout(()=>this.panel()?.nativeElement.focus(),0)})}toggle(){if(this.open()){this.close();return}this.bump();let e=this.levels().indexOf(this.current());this.active.set(e>=0?e:0),this.open.set(!0)}choose(e){this.pick.emit(e),this.close()}onKeydown(e){let n=this.levels();switch(e.key){case"Escape":e.preventDefault(),this.close();return;case"ArrowDown":e.preventDefault(),this.active.update(o=>Math.min(o+1,Math.max(0,n.length-1)));return;case"ArrowUp":e.preventDefault(),this.active.update(o=>Math.max(0,o-1));return;case"Enter":{let o=n[this.active()];o&&(e.preventDefault(),this.choose(o));return}default:return}}onDocumentPointerdown(e){let n=e.target;this.open()&&n&&!this.host.nativeElement.contains(n)&&this.close()}close(){this.open.set(!1),this.bumped.set(!1)}bump(){this.bumped.set(!1),setTimeout(()=>this.bumped.set(!0),0),setTimeout(()=>this.bumped.set(!1),520)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Le({type:t,selectors:[["morse-thinking-picker"]],viewQuery:function(n,o){n&1&&Ft(o.panel,J1,5),n&2&&Wt()},hostBindings:function(n,o){n&1&&U("pointerdown",function(i){return o.onDocumentPointerdown(i)},An)},inputs:{levels:[1,"levels"],current:[1,"current"]},outputs:{pick:"pick"},decls:7,vars:5,consts:[["panel",""],["type","button","aria-haspopup","listbox",1,"trigger",3,"click","title"],[3,"level"],[1,"level"],["aria-hidden","true",1,"caret"],["role","listbox","aria-label","Thinking level","tabindex","-1",1,"panel",3,"morseEnter","morseEnterY"],["role","listbox","aria-label","Thinking level","tabindex","-1",1,"panel",3,"keydown","morseEnter","morseEnterY"],["type","button","role","option",1,"row",3,"active","selected"],["type","button","role","option",1,"row",3,"mouseenter","click"],[1,"name"],["aria-hidden","true",1,"check"]],template:function(n,o){n&1&&(_(0,"button",1),U("click",function(){return o.toggle()}),Ke(1,"morse-brain",2),_(2,"span",3),g(3),b(),_(4,"span",4),g(5,"\u25BE"),b()(),A(6,nD,4,2,"div",5)),n&2&&(X("title","Thinking level: "+o.current()),He("aria-expanded",o.open()),f(),X("level",o.current()),f(2),$(o.current()),f(3),R(o.open()?6:-1))},dependencies:[nn,_d],styles:["[_nghost-%COMP%]{position:relative;display:inline-block}.trigger[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border:1px solid var(--%NS%morse-input-border);border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-input-bg);color:var(--%NS%morse-input-fg);font-size:12px;cursor:pointer}.trigger[_ngcontent-%COMP%]:hover{border-color:var(--%NS%morse-fg-muted)}.trigger[aria-expanded=true][_ngcontent-%COMP%]{border-color:var(--%NS%morse-focus)}.trigger[_ngcontent-%COMP%] .level[_ngcontent-%COMP%]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-transform:capitalize}.trigger[_ngcontent-%COMP%] .caret[_ngcontent-%COMP%]{flex:none;color:var(--%NS%morse-fg-muted);font-size:10px}.panel[_ngcontent-%COMP%]{position:absolute;left:0;bottom:calc(100% + 6px);z-index:30;display:flex;flex-direction:column;min-width:180px;padding:4px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-md);background:var(--%NS%morse-panel, var(--%NS%morse-bg));box-shadow:0 10px 28px #0000004d}.panel[_ngcontent-%COMP%]:focus-visible{outline:none}.row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%;padding:5px 8px;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg);font:inherit;font-size:12px;text-align:left;cursor:pointer}.row.active[_ngcontent-%COMP%]{background:var(--%NS%morse-hover)}.row[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-transform:capitalize}.row.selected[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{color:var(--%NS%morse-accent)}.row[_ngcontent-%COMP%] .check[_ngcontent-%COMP%]{flex:none;color:var(--%NS%morse-accent);font-size:12px}"]})};function oD(t,e){t&1&&(C(0,"span"),g(1),w()),t&2&&(f(),pt(" \xB7 ",e))}function rD(t,e){if(t&1&&(C(0,"section")(1,"h4"),g(2,"Last assistant message"),w(),C(3,"div",13)(4,"div",14)(5,"span",15),g(6,"Input"),w(),C(7,"span",16),g(8),w()(),C(9,"div",14)(10,"span",15),g(11,"Output"),w(),C(12,"span",16),g(13),w()(),C(14,"div",14)(15,"span",15),g(16,"Reasoning"),w(),C(17,"span",16),g(18),w()(),C(19,"div",14)(20,"span",15),g(21,"Cache read"),w(),C(22,"span",16),g(23),w()(),C(24,"div",14)(25,"span",15),g(26,"Cache write"),w(),C(27,"span",16),g(28),w()(),C(29,"div",14)(30,"span",15),g(31,"Cache hit"),w(),C(32,"span",16),g(33),w()()()()),t&2){let n=v(2);f(8),$(n.lastValue("inputTokens")),f(5),$(n.lastValue("outputTokens")),f(5),$(n.lastValue("reasoningTokens")),f(5),$(n.lastValue("cacheReadTokens")),f(5),$(n.lastValue("cacheWriteTokens")),f(5),$(n.cacheHitLabel())}}function iD(t,e){if(t&1){let n=Y();C(0,"button",5),ee("click",function(){D(n);let r=v();return k(r.close())}),w(),C(1,"div",6)(2,"header")(3,"h3"),g(4,"Context"),w(),C(5,"button",7),ee("click",function(){D(n);let r=v();return k(r.close())}),g(6,"\xD7"),w()(),C(7,"div",8),g(8),A(9,oD,2,1,"span"),w(),C(10,"div",9)(11,"span"),g(12,"Context"),w(),C(13,"span"),g(14),w()(),C(15,"div",10),st(16,"span",11),w(),C(17,"div",12)(18,"span"),g(19),w()(),C(20,"div",13)(21,"div",14)(22,"span",15),g(23,"Messages"),w(),C(24,"span",16),g(25),w()(),C(26,"div",14)(27,"span",15),g(28,"User"),w(),C(29,"span",16),g(30),w()(),C(31,"div",14)(32,"span",15),g(33,"Assistant"),w(),C(34,"span",16),g(35),w()(),C(36,"div",14)(37,"span",15),g(38,"Tool calls"),w(),C(39,"span",16),g(40),w()(),C(41,"div",14)(42,"span",15),g(43,"Cost"),w(),C(44,"span",16),g(45),w()(),C(46,"div",14)(47,"span",15),g(48,"Output limit"),w(),C(49,"span",16),g(50),w()()(),A(51,rD,34,6,"section"),C(52,"section")(53,"h4"),g(54,"Session totals"),w(),C(55,"div",17),g(56),w()()()}if(t&2){let n,o=v();f(8),pt(" ",o.modelLabel()),f(),R((n=o.sessionTitle())?9:-1,n),f(5),Kn("",o.usedLabel()," / ",o.limitLabel()),f(2),Io("width",o.fillPercent(),"%"),Be("warn",o.level()==="warn")("danger",o.level()==="danger"),f(3),pt("",o.percentLabel()," used"),f(6),$(o.counts()?.totalMessages??"\u2014"),f(5),$(o.counts()?.userMessages??"\u2014"),f(5),$(o.counts()?.assistantMessages??"\u2014"),f(5),$(o.counts()?.toolCalls??"\u2014"),f(5),$(o.costLabel()),f(5),$(o.outputLimitLabel()),f(),R(o.lastUsage()?51:-1),f(5),$(o.sessionLine()||"No usage yet.")}}var sD=15.5,Jb=2*Math.PI*sD,Ed=class t{usage=le();lastUsage=le();costUsd=le();contextUsage=le();counts=le();model=le();sessionTitle=le();open=H(!1);circumference=Jb;percent=T(()=>this.contextUsage()?.percent??void 0);percentLabel=T(()=>{let e=this.contextUsage()?.percent;return e==null?"\u2013":`${e.toFixed(1)}%`});level=T(()=>{let e=this.percent()??0;return e>90?"danger":e>70?"warn":"ok"});fillPercent=T(()=>Math.min(100,Math.max(0,this.percent()??0)));dashOffset=T(()=>Jb*(1-this.fillPercent()/100));usedLabel=T(()=>{let e=this.contextUsage()?.tokens;return e==null?"\u2014":no(e)});limitLabel=T(()=>{let e=this.contextUsage()?.contextWindow;return e===void 0?"\u2014":no(e)});costLabel=T(()=>Sm(this.costUsd())??"\u2014");outputLimitLabel=T(()=>{let e=this.model()?.maxTokens;return e===void 0?"\u2014":no(e)});modelLabel=T(()=>this.model()?.name??this.model()?.id??"no model");tooltip=T(()=>{let e=[`Context ${this.percentLabel()} \xB7 ${this.usedLabel()} / ${this.limitLabel()}`],n=Tm({usage:this.usage(),costUsd:this.costUsd(),contextUsage:this.contextUsage()});return n.length>0&&e.push(n),e.join(`
11
- `)});sessionLine=T(()=>Tm({usage:this.usage(),costUsd:this.costUsd(),contextUsage:this.contextUsage()}));cacheHitLabel=T(()=>{let e=wm(this.lastUsage());return e===void 0?"\u2014":`${e.toFixed(1)}%`});lastValue(e){let n=this.lastUsage();return n?no(n[e]??0):"\u2014"}toggle(){this.open.update(e=>!e)}close(){this.open.set(!1)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Le({type:t,selectors:[["morse-usage-indicator"]],hostBindings:function(n,o){n&1&&U("keydown.escape",function(){return o.close()},An)},inputs:{usage:[1,"usage"],lastUsage:[1,"lastUsage"],costUsd:[1,"costUsd"],contextUsage:[1,"contextUsage"],counts:[1,"counts"],model:[1,"model"],sessionTitle:[1,"sessionTitle"]},decls:7,vars:10,consts:[["type","button","aria-label","Context usage",1,"mini",3,"click","title"],["viewBox","0 0 36 36","aria-hidden","true",1,"ring"],["cx","18","cy","18","r","15.5",1,"track"],["cx","18","cy","18","r","15.5",1,"value"],[1,"pct"],["type","button","aria-label","Close usage",1,"scrim",3,"click"],["role","dialog","aria-label","Context usage",1,"panel"],["type","button","aria-label","Close",1,"close",3,"click"],[1,"subtitle"],[1,"bar-head"],[1,"bar"],[1,"fill"],[1,"bar-foot"],[1,"grid"],[1,"cell"],[1,"k"],[1,"v"],[1,"totals"]],template:function(n,o){n&1&&(C(0,"button",0),ee("click",function(){return o.toggle()}),vn(),C(1,"svg",1),st(2,"circle",2)(3,"circle",3),w(),So(),C(4,"span",4),g(5),w()(),A(6,iD,57,19)),n&2&&(et("title",o.tooltip()),He("aria-expanded",o.open()),f(),Be("warn",o.level()==="warn")("danger",o.level()==="danger"),f(2),He("stroke-dasharray",o.circumference)("stroke-dashoffset",o.dashOffset()),f(2),$(o.percentLabel()),f(),R(o.open()?6:-1))},styles:["[_nghost-%COMP%]{position:relative;display:inline-flex;vertical-align:middle}.mini[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;padding:2px 7px 2px 3px;border:1px solid transparent;border-radius:999px;background:transparent;color:var(--%NS%morse-fg-muted);font-size:11px;line-height:1;cursor:pointer}.mini[_ngcontent-%COMP%]:hover, .mini[aria-expanded=true][_ngcontent-%COMP%]{border-color:var(--%NS%morse-border);background:var(--%NS%morse-hover);color:var(--%NS%morse-fg)}.ring[_ngcontent-%COMP%]{width:20px;height:20px;transform:rotate(-90deg)}.track[_ngcontent-%COMP%]{fill:none;stroke:var(--%NS%morse-border);stroke-width:3.4}.value[_ngcontent-%COMP%]{fill:none;stroke:var(--%NS%morse-success);stroke-width:3.4;stroke-linecap:round;transition:stroke-dashoffset .3s ease}.ring.warn[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{stroke:var(--%NS%morse-warn)}.ring.danger[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{stroke:var(--%NS%morse-error)}.pct[_ngcontent-%COMP%]{font-family:var(--%NS%morse-font-mono);font-size:10.5px;font-variant-numeric:tabular-nums}.scrim[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:30;padding:0;border:0;background:transparent;cursor:default}.scrim[_ngcontent-%COMP%]:hover, .scrim[_ngcontent-%COMP%]:active{background:transparent}.panel[_ngcontent-%COMP%]{position:absolute;z-index:31;right:0;bottom:calc(100% + 8px);width:320px;max-height:70vh;overflow-y:auto;padding:12px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-md);background:var(--%NS%morse-panel, var(--%NS%morse-bg));box-shadow:0 16px 40px #00000059;color:var(--%NS%morse-fg);text-align:left}.panel[_ngcontent-%COMP%] header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-bottom:2px}.panel[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:13px;font-weight:600}.close[_ngcontent-%COMP%]{padding:0 6px;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg-muted);font-size:15px;line-height:1.4;cursor:pointer}.close[_ngcontent-%COMP%]:hover{color:var(--%NS%morse-fg);background:var(--%NS%morse-active)}.subtitle[_ngcontent-%COMP%]{margin-bottom:10px;color:var(--%NS%morse-fg-muted);font-size:11px}.bar-head[_ngcontent-%COMP%], .bar-foot[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;color:var(--%NS%morse-fg-muted);font-size:11px}.bar[_ngcontent-%COMP%]{height:7px;margin:5px 0;border-radius:999px;background:var(--%NS%morse-border);overflow:hidden}.bar[_ngcontent-%COMP%] .fill[_ngcontent-%COMP%]{display:block;height:100%;border-radius:999px;background:var(--%NS%morse-success);transition:width .3s ease}.bar[_ngcontent-%COMP%] .fill.warn[_ngcontent-%COMP%]{background:var(--%NS%morse-warn)}.bar[_ngcontent-%COMP%] .fill.danger[_ngcontent-%COMP%]{background:var(--%NS%morse-error)}.grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-top:10px}.cell[_ngcontent-%COMP%]{padding:6px 8px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-input-bg, transparent)}.cell[_ngcontent-%COMP%] .k[_ngcontent-%COMP%]{display:block;color:var(--%NS%morse-fg-muted);font-size:10px;text-transform:uppercase;letter-spacing:.03em}.cell[_ngcontent-%COMP%] .v[_ngcontent-%COMP%]{display:block;margin-top:2px;font-family:var(--%NS%morse-font-mono);font-size:12px;font-variant-numeric:tabular-nums}section[_ngcontent-%COMP%]{margin-top:12px}section[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0 0 4px;color:var(--%NS%morse-fg-muted);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.03em}.totals[_ngcontent-%COMP%]{padding:7px 9px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);color:var(--%NS%morse-fg-muted);font-family:var(--%NS%morse-font-mono);font-size:11.5px;font-variant-numeric:tabular-nums}"]})};var aD=["promptInput"],cD=["fileInput"],e0=(t,e)=>e.id;function lD(t,e){if(t&1){let n=Y();_(0,"button",24),U("click",function(){D(n);let r=v();return k(r.attachSelection())}),g(1," \u29C9 "),b()}}function dD(t,e){t&1&&g(0," add files \xB7 @ to mention \xB7 / for commands ")}function uD(t,e){t&1&&g(0," upload or drop files \xB7 / for commands ")}function pD(t,e){t&1&&g(0," drop files here \xB7 / for commands ")}function fD(t,e){if(t&1){let n=Y();_(0,"morse-file-picker",25),U("activeChange",function(r){D(n);let i=v();return k(i.mentionActive.set(r))})("pick",function(r){D(n);let i=v();return k(i.onPickFile(r))})("reload",function(){D(n);let r=v();return k(r.reloadFiles())})("close",function(){D(n);let r=v();return k(r.onPickerClose())}),b()}if(t&2){let n=v();X("morsePopoverFit",300)("files",n.pickerMatches())("busy",n.loadingFiles())("query",n.pickerFilter())("active",n.mentionActive())}}function mD(t,e){if(t&1){let n=Y();_(0,"morse-command-picker",26),U("activeChange",function(r){D(n);let i=v();return k(i.paletteActive.set(r))})("pick",function(r){D(n);let i=v();return k(i.activatePalette(r,"insert"))})("close",function(){D(n);let r=v();return k(r.onPaletteClose())}),b()}if(t&2){let n=v();X("morsePopoverFit",320)("items",n.paletteItems())("query",n.paletteFilter())("active",n.paletteActive())}}function hD(t,e){if(t&1){let n=Y();_(0,"li",27)(1,"button",29),U("click",function(){D(n);let r=v(2);return k(r.lockLive())}),_(2,"span",30),g(3,"\u29C9"),b(),_(4,"span",31),g(5),b(),_(6,"span",32),g(7),b()(),_(8,"button",33),U("click",function(){D(n);let r=v(2);return k(r.dismissLive())}),g(9," \xD7 "),b()()}if(t&2){let n=e,o=v(2);X("morseEnter",0)("morseEnterY",6)("morseEnterScale",.55)("morseEnterDuration",320),f(),X("title",o.lockLiveLabel()),He("aria-label","Lock the "+n.path+" selection as a pin"),f(3),X("title",n.path),f(),$(n.path),f(2),Kn("L",n.startLine,"-",n.endLine),f(),He("aria-label","Dismiss the "+n.path+" selection preview")}}function gD(t,e){if(t&1){let n=Y();_(0,"li",28),Ke(1,"img",34),_(2,"span",31),g(3),b(),_(4,"button",35),U("click",function(){let r=D(n).$implicit,i=v(2);return k(i.removeImage(r.id))}),g(5," \xD7 "),b()()}if(t&2){let n=e.$implicit,o=e.$index,r=v(2);X("morseEnter",r.chipOffset()+o)("morseEnterY",6)("morseEnterScale",.55)("morseEnterDuration",320),f(),X("src",r.preview(n),Qi)("alt",n.name),f(),X("title",n.name),f(),$(n.name),f(),He("aria-label","Remove "+n.name)}}function yD(t,e){if(t&1&&(_(0,"span",32),g(1),b()),t&2){let n=v().$implicit;f(),Kn("L",n.startLine,"-",n.endLine)}}function vD(t,e){if(t&1){let n=Y();_(0,"li",28)(1,"span",30),g(2,"\u29C9"),b(),_(3,"span",31),g(4),b(),A(5,yD,2,2,"span",32),_(6,"button",35),U("click",function(){let r=D(n).$implicit,i=v(2);return k(i.removePin(r.id))}),g(7," \xD7 "),b()()}if(t&2){let n=e.$implicit,o=e.$index,r=v(2);X("morseEnter",r.chipOffset()+r.images().length+o)("morseEnterY",6)("morseEnterScale",.55)("morseEnterDuration",320),f(3),X("title",n.path),f(),$(n.path),f(),R(n.startLine!==void 0?5:-1),f(),He("aria-label","Unpin "+n.path)}}function _D(t,e){if(t&1&&(_(0,"ul",11),A(1,hD,10,11,"li",27),ze(2,gD,6,9,"li",28,e0),ze(4,vD,8,8,"li",28,e0),b()),t&2){let n,o=v();f(),R((n=o.livePreview())?1:-1,n),f(),Ge(o.images()),f(2),Ge(o.pins())}}function bD(t,e){if(t&1&&(_(0,"span",37),g(1),b()),t&2){let n=v(2);f(),Kn(" \u2193",n.streamedTokens()," \xB7 ",n.tokensPerSecond()??0," t/s ")}}function ED(t,e){if(t&1&&(_(0,"span",39),Ke(1,"span",41),_(2,"span"),g(3),b(),_(4,"span",42),Ke(5,"i")(6,"i")(7,"i"),b()()),t&2){let n=v(2);f(3),pt("Working ",n.elapsed())}}function xD(t,e){if(t&1&&Ke(0,"morse-usage-indicator",40),t&2){let n=v(2);X("usage",n.usageState().usage)("lastUsage",n.usageState().lastUsage)("costUsd",n.usageState().costUsd)("contextUsage",n.usageState().contextUsage)("counts",n.usageState().counts)("model",n.usageState().model)("sessionTitle",n.usageState().sessionTitle)}}function CD(t,e){if(t&1&&(_(0,"div",13)(1,"div",36),A(2,bD,2,2,"span",37),b(),_(3,"div",38),A(4,ED,8,1,"span",39),A(5,xD,1,7,"morse-usage-indicator",40),b()()),t&2){let n=v();f(2),R(n.running()?2:-1),f(2),R(n.running()?4:-1),f(),R(n.showUsage()?5:-1)}}function wD(t,e){if(t&1&&(_(0,"span",17),g(1),b()),t&2){let n=e;X("title",n),f(),$(n)}}function SD(t,e){if(t&1){let n=Y();_(0,"morse-model-picker",43),U("pick",function(r){D(n);let i=v();return k(i.onModelPick(r))})("close",function(){D(n);let r=v();return k(r.closeModelPicker())}),b()}if(t&2){let n=v();X("morsePopoverFit",340)("models",n.models())("current",n.modelKey())}}function TD(t,e){if(t&1){let n=Y();_(0,"button",44),U("click",function(){D(n);let r=v();return k(r.sendWith("steer"))}),g(1,"Steer"),b(),_(2,"button",44),U("click",function(){D(n);let r=v();return k(r.sendWith("followUp"))}),g(3,"Follow up"),b(),_(4,"button",45),U("click",function(){D(n);let r=v();return k(r.abort())}),g(5,"\u25A0"),b()}}function MD(t,e){if(t&1){let n=Y();_(0,"button",46),U("click",function(){D(n);let r=v();return k(r.sendWith("new"))}),g(1," \u2191 "),b()}if(t&2){let n=v();X("disabled",!n.canSend())}}var xd=class t{morse=O(Ht);attachments=O(br);workspace=O(md);uploads=O(ps);promptInput=St("promptInput");fileInput=St("fileInput");text=H("");connected=T(()=>this.morse.connection()==="ready");agentReady=this.morse.agentReady;agentStarting=this.morse.agentStarting;agentError=this.morse.agentError;streaming=T(()=>this.morse.state().streaming);canSend=T(()=>this.connected()&&!this.agentStarting()&&this.agentError()===void 0);canAttachSelection=T(()=>this.morse.capabilities()?.editorContext===!0);thinkingLevel=T(()=>this.morse.state().thinkingLevel);models=this.morse.availableModels;levels=this.morse.availableThinkingLevels;modelKey=T(()=>{let e=this.morse.state().model;return e?`${e.provider}/${e.id}`:""});usageState=this.morse.state;showUsage=T(()=>{let e=this.morse.state();return e.usage!==void 0||e.contextUsage!==void 0});showStatusRow=T(()=>this.running()||this.showUsage());streamedTokens=T(()=>Math.round(Math.max(0,Mm(this.morse.items())-this.baseline())/4));tokensPerSecond=H(void 0);baseline=H(0);throughput=[];images=this.attachments.images;pins=this.attachments.pins;livePreview=this.attachments.livePreview;chipOffset=T(()=>this.livePreview()?1:0);lockLiveLabel=T(()=>this.livePreview()?"Lock this selection \u2014 it stops following the editor; a new selection makes a new chip.":"");pickerOpen=H(!1);workspaceFiles=this.workspace.files;loadingFiles=this.workspace.busy;mentionMode=H(!1);pickerFilter=H("");pickerMatches=T(()=>Qb(this.workspaceFiles(),this.pickerFilter()));mentionActive=H(0);canPickFiles=this.workspace.available;canUpload=this.uploads.available;paletteOpen=H(!1);paletteFilter=H("");paletteActive=H(0);availableCommands=this.morse.availableCommands;paletteItems=T(()=>{let e=[...t0.map(n=>({id:`builtin:${n.name}`,label:`/${n.name}`,description:n.description,badge:"built-in",icon:"\u203A"})),...this.availableCommands().map(n=>({id:`command:${n.name}`,label:`/${n.name}`,description:n.description,badge:n.source,icon:"\u2044"}))];return Xb(e,this.paletteFilter())});modelPickerOpen=H(!1);currentModel=this.morse.model;currentProvider=T(()=>this.morse.model()?.provider??"");modelLabel=T(()=>{let e=this.morse.model();return e?`${e.provider} \xB7 ${e.name}`:"no model"});canAddFiles=T(()=>this.canPickFiles()||this.canUpload()||this.canAttachSelection());addFilesLabel=T(()=>this.canPickFiles()?"Add files to the prompt":this.canUpload()?"Upload files to the prompt":"Attach the active editor selection");running=T(()=>this.morse.state().streaming||this.morse.state().busy);elapsed=T(()=>{this.tick();let e=this.startedAt(),n=e===null?0:Date.now()-e;return n<1e3?"":DD(n)});startedAt=H(null);tick=H(0);constructor(){ke(()=>{if(this.attachments.mentions().length===0)return;let o=this.attachments.takeMentions().map(i=>i.startsWith("@")?i:`@${i}`).join(`
12
- `);this.text.update(i=>i.trim().length===0?o:`${i.trimEnd()}
13
- ${o}`),this.promptInput()?.nativeElement?.focus()}),this.morse.onContextSelection(e=>{this.attachments.pin(e),this.attachments.say("info","Selection pinned to this message.")}),this.morse.onContextSelectionLive(e=>this.attachments.setLivePreview(e)),this.morse.onComposerSeed(e=>{this.text.set(e.text),this.syncInputValue(),this.attachments.seed(e.images??[],e.pins??[])}),ke(e=>{if(!this.running()){this.startedAt.set(null),this.tokensPerSecond.set(void 0),this.throughput.length=0;return}this.startedAt.update(o=>o??Date.now()),this.baseline.set(Hf(()=>Mm(this.morse.items())));let n=setInterval(()=>{this.tick.update(o=>o+1),this.sampleThroughput()},500);e(()=>clearInterval(n))})}onInput(e){let n=e.target;this.text.set(n.value),this.refreshMentionQuery(n.value,n.selectionStart),this.refreshPaletteQuery(n.value,n.selectionStart)}onKeydown(e){if(this.paletteOpen()){let n=this.paletteItems();switch(e.key){case"Escape":e.preventDefault(),this.onPaletteClose();return;case"ArrowDown":e.preventDefault(),this.paletteActive.update(o=>Math.min(o+1,Math.max(0,n.length-1)));return;case"ArrowUp":e.preventDefault(),this.paletteActive.update(o=>Math.max(0,o-1));return;case"Tab":{let o=n[this.paletteActive()];e.preventDefault(),o&&this.activatePalette(o.id,"insert");return}case"Enter":{if(e.isComposing)return;let o=n[this.paletteActive()];if(o){e.preventDefault(),this.activatePalette(o.id,e.shiftKey?"insert":"run");return}break}default:return}}if(this.pickerOpen()){let n=this.pickerMatches();switch(e.key){case"Escape":e.preventDefault(),this.onPickerClose();return;case"ArrowDown":e.preventDefault(),this.mentionActive.update(o=>Math.min(o+1,Math.max(0,n.length-1)));return;case"ArrowUp":e.preventDefault(),this.mentionActive.update(o=>Math.max(0,o-1));return;case"Tab":case"Enter":{let o=n[this.mentionActive()];if(o){e.preventDefault(),this.onPickFile(o);return}e.key==="Tab"&&e.preventDefault();return}default:return}}e.key==="Enter"&&!e.shiftKey&&!e.isComposing&&(e.preventDefault(),this.sendWith(this.streaming()?"steer":"new"))}sendWith(e){let n=this.text().trim(),o=ID(n);if(o){this.text.set(""),this.runBuiltin(o);return}let r=this.attachments.images(),i=this.attachments.pins();if(n.length===0&&r.length===0&&i.length===0){this.promptInput()?.nativeElement.focus();return}this.morse.prompt(n,e,this.attachments.takeImages(),this.attachments.takePins()),this.attachments.setLivePreview(null),this.text.set("")}lockLive(){this.attachments.lockLivePreview(),this.attachments.say("info","Selection locked to this message.")}dismissLive(){this.attachments.setLivePreview(null)}onPaste(e){let n=Array.from(e.clipboardData?.files??[]).filter(o=>o.type.startsWith("image/"));n.length!==0&&(e.preventDefault(),this.attachments.accept(n).then(o=>{o.attached>0&&this.attachments.say("info",`${o.attached} pasted image${o.attached===1?"":"s"} attached`)}))}removeImage(e){this.attachments.remove(e)}removePin(e){this.attachments.removePin(e)}preview(e){return`data:${e.mimeType};base64,${e.data}`}abort(){this.morse.abort()}attachSelection(){if(this.livePreview()){this.lockLive();return}this.requestSelectionSnapshot().then(e=>{if(!e||e.selection===void 0){this.attachments.say("warn","Select some text in the editor first.");return}let n=e.selection;this.attachments.pin({path:e.path??"",startLine:n.startLine,endLine:n.endLine}),this.attachments.say("info","Selection pinned to this message.")})}onAddFiles(){if(this.canPickFiles()){this.openMentionPicker();return}if(this.canUpload()){this.fileInput()?.nativeElement.click();return}this.attachSelection()}openMentionPicker(){if(this.pickerOpen()){this.onPickerClose();return}let e=this.text(),n=e.length>0&&!/\s$/.test(e)?" ":"";this.text.set(`${e}${n}@`);let o=this.promptInput()?.nativeElement;if(o){let r=this.text();o.value=r,o.focus(),o.setSelectionRange(r.length,r.length)}this.mentionMode.set(!0),this.pickerFilter.set(""),this.mentionActive.set(0),this.pickerOpen.set(!0),this.workspace.ensureLoaded()}onFilesChosen(e){let n=e.target,o=Array.from(n?.files??[]);n&&(n.value=""),o.length!==0&&this.importFiles(o.filter(r=>r.type.startsWith("image/")),o.filter(r=>!r.type.startsWith("image/")))}async importFiles(e,n){let o=await this.attachments.accept(e),r=n.length>0?await this.uploads.upload(n):{added:[],failed:[]};this.attachments.addMentions(r.added.map(a=>a.path));let i=[];o.attached>0&&i.push(`${o.attached} image${o.attached===1?"":"s"} attached`),r.added.length>0&&i.push(`${r.added.length} file${r.added.length===1?"":"s"} uploaded`);let s=[...o.skipped,...r.failed];if(s.length>0&&i.push(`could not attach ${s.join(", ")}`),i.length>0){let a=o.attached===0&&r.added.length===0;this.attachments.say(a?"warn":"info",i.join(" \xB7 "))}}refreshMentionQuery(e,n){if(!this.canPickFiles())return;let o=e.slice(0,n??e.length),r=/(?:^|\s)@([\w./-]*)$/.exec(o);if(!r){this.mentionMode()&&(this.pickerOpen.set(!1),this.mentionMode.set(!1));return}r[1]!==this.pickerFilter()&&this.mentionActive.set(0),this.mentionMode.set(!0),this.pickerFilter.set(r[1]??""),this.pickerOpen.set(!0),this.workspace.ensureLoaded()}refreshPaletteQuery(e,n){let o=e.slice(0,n??e.length),r=/(?:^|\n)\s*\/([\w:-]*)$/.exec(o);if(!r){this.paletteOpen()&&this.paletteOpen.set(!1);return}r[1]!==this.paletteFilter()&&this.paletteActive.set(0),this.paletteFilter.set(r[1]??""),this.paletteOpen.set(!0)}activatePalette(e,n){if(e.startsWith("builtin:")){let o=e.slice(8);if(o==="model"){this.stripSlashToken(),this.closePalette(),this.openModelPicker();return}this.stripSlashToken(),this.closePalette(),this.runBuiltin(o);return}if(e.startsWith("command:")){let o=e.slice(8);if(n==="run"){this.stripSlashToken(),this.text.set(""),this.closePalette(),this.morse.prompt(`/${o}`,this.streaming()?"steer":"new");return}this.replaceSlashToken(`/${o} `),this.closePalette()}}onPaletteClose(){this.closePalette()}closePalette(){this.paletteOpen.set(!1),this.paletteFilter.set(""),this.paletteActive.set(0),this.promptInput()?.nativeElement.focus()}openModelPicker(){this.modelPickerOpen.set(!0)}toggleModelPicker(){this.modelPickerOpen.update(e=>!e)}onModelPick(e){this.morse.setModel(e.provider,e.id),this.closeModelPicker()}closeModelPicker(){this.modelPickerOpen.set(!1),this.promptInput()?.nativeElement.focus()}runBuiltin(e){switch(e){case"new":this.morse.newSession(this.morse.workspace().cwd);break;case"compact":this.morse.compactSession();break;case"settings":this.morse.hostCommand("openSettings");break;case"model":this.openModelPicker();break}}stripSlashToken(){this.text.update(e=>e.replace(/(?:^|\n)(\s*)\/[\w:-]*$/,"$1")),this.syncInputValue()}replaceSlashToken(e){this.text.update(n=>n.replace(/(?:^|\n)(\s*)\/[\w:-]*$/,`$1${e}`)),this.syncInputValue()}syncInputValue(){let e=this.promptInput()?.nativeElement;if(!e)return;let n=this.text();e.value=n,e.focus(),e.setSelectionRange(n.length,n.length)}reloadFiles(){this.workspace.ensureLoaded(!0)}async requestSelectionSnapshot(){return this.morse.requestHostCommand("getEditorContext")}onPickerClose(){this.pickerOpen.set(!1),this.mentionMode.set(!1),this.promptInput()?.nativeElement.focus()}onPickFile(e){let n=e.endsWith("/");this.mentionMode()?this.text.update(o=>o.replace(/@[\w./-]*$/,`@${e}${n?"":" "}`)):n||(this.attachments.addMentions([e]),this.attachments.say("info",`Pinned ${e} to this message.`)),n?(this.mentionMode.set(!0),this.pickerFilter.set(e),this.mentionActive.set(0),this.pickerOpen.set(!0),this.workspace.ensureLoaded()):(this.mentionMode.set(!1),this.pickerOpen.set(!1)),this.syncInputValue()}onThinkingPick(e){this.morse.setThinkingLevel(e)}sampleThroughput(){let e=Mm(this.morse.items()),n=Date.now();for(this.throughput.push({at:n,chars:e});this.throughput.length>2&&n-this.throughput[0].at>2e3;)this.throughput.shift();let o=this.throughput[0];if(!o)return;let r=n-o.at;if(r<500)return;let i=(e-o.chars)/4;this.tokensPerSecond.set(Math.max(0,Math.round(i/r*1e4)/10))}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Le({type:t,selectors:[["morse-chat-composer"]],viewQuery:function(n,o){n&1&&Ft(o.promptInput,aD,5)(o.fileInput,cD,5),n&2&&Wt(2)},decls:31,vars:22,consts:[["fileInput",""],["promptInput",""],[1,"host"],[1,"box"],[1,"toolbar"],["type","button",1,"icon",3,"click","disabled","title"],["type","file","multiple","","hidden","",3,"change"],["type","button","title","Pin the editor selection to this message","aria-label","Pin the editor selection to this message",1,"icon","pin-selection"],[1,"hint","muted"],[1,"picker-host",3,"morsePopoverFit","files","busy","query","active"],[1,"palette-host",3,"morsePopoverFit","items","query","active"],[1,"attachments"],["rows","2","aria-label","Prompt",3,"input","keydown","paste","value","disabled","placeholder"],[1,"status-row"],[1,"controls"],[1,"controls-metrics"],["type","button",1,"model-button",3,"pointerdown","click","disabled","title"],[1,"provider",3,"title"],[1,"label"],["aria-hidden","true",1,"caret"],[1,"model-picker-host",3,"morsePopoverFit","models","current"],[1,"thinking-host",3,"pick","levels","current"],[1,"controls-actions"],["type","button","title","Send (Enter)","aria-label","Send",1,"icon","send",3,"disabled"],["type","button","title","Pin the editor selection to this message","aria-label","Pin the editor selection to this message",1,"icon","pin-selection",3,"click"],[1,"picker-host",3,"activeChange","pick","reload","close","morsePopoverFit","files","busy","query","active"],[1,"palette-host",3,"activeChange","pick","close","morsePopoverFit","items","query","active"],[1,"chip","live",3,"morseEnter","morseEnterY","morseEnterScale","morseEnterDuration"],[1,"chip",3,"morseEnter","morseEnterY","morseEnterScale","morseEnterDuration"],["type","button",1,"chip-body",3,"click","title"],["aria-hidden","true",1,"pin-icon"],[1,"chip-name",3,"title"],[1,"chip-lines"],["type","button","title","Dismiss this preview (locked chips stay)",1,"chip-remove",3,"click"],[3,"src","alt"],["type","button",1,"chip-remove",3,"click"],[1,"status-live"],["title","Live output rate: text and thinking, estimated from the character stream",1,"hint","throughput"],[1,"status-end"],["role","status",1,"working"],[1,"usage-host",3,"usage","lastUsage","costUsd","contextUsage","counts","model","sessionTitle"],[1,"spinner"],[1,"dots"],[1,"model-picker-host",3,"pick","close","morsePopoverFit","models","current"],["type","button",1,"secondary",3,"click"],["type","button","title","Stop","aria-label","Stop",1,"icon","stop",3,"click"],["type","button","title","Send (Enter)","aria-label","Send",1,"icon","send",3,"click","disabled"]],template:function(n,o){if(n&1&&(_(0,"footer",2)(1,"div",3)(2,"div",4)(3,"button",5),U("click",function(){return o.onAddFiles()}),g(4," + "),b(),_(5,"input",6,0),U("change",function(i){return o.onFilesChosen(i)}),b(),A(7,lD,2,0,"button",7),_(8,"span",8),A(9,dD,1,0)(10,uD,1,0)(11,pD,1,0),b()(),A(12,fD,1,5,"morse-file-picker",9),A(13,mD,1,4,"morse-command-picker",10),A(14,_D,6,1,"ul",11),_(15,"textarea",12,1),U("input",function(i){return o.onInput(i)})("keydown",function(i){return o.onKeydown(i)})("paste",function(i){return o.onPaste(i)}),b(),A(17,CD,6,3,"div",13),_(18,"div",14)(19,"div",15)(20,"button",16),U("pointerdown",function(i){return i.stopPropagation()})("click",function(){return o.toggleModelPicker()}),A(21,wD,2,2,"span",17),_(22,"span",18),g(23),b(),_(24,"span",19),g(25,"\u25BE"),b()(),A(26,SD,1,3,"morse-model-picker",20),_(27,"morse-thinking-picker",21),U("pick",function(i){return o.onThinkingPick(i)}),b()(),_(28,"div",22),A(29,TD,6,0)(30,MD,2,1,"button",23),b()()()()),n&2){let r;f(3),X("disabled",!o.canAddFiles())("title",o.addFilesLabel()),He("aria-label",o.addFilesLabel())("aria-expanded",o.pickerOpen()),f(4),R(o.canAttachSelection()?7:-1),f(2),R(o.canPickFiles()?9:o.canUpload()?10:11),f(3),R(o.pickerOpen()?12:-1),f(),R(o.paletteOpen()?13:-1),f(),R(o.images().length>0||o.pins().length>0||o.livePreview()!==null?14:-1),f(),X("value",o.text())("disabled",!o.canSend())("placeholder",o.connected()?o.agentStarting()?"Starting the Pi agent\u2026":o.agentError()?"The pi agent is unavailable.":o.agentReady()?"Ask Morse\u2026 (Enter to send, Shift+Enter for a new line)":"Type to start a session\u2026 (Enter to send, Shift+Enter for a new line)":"Waiting for a Morse host\u2026"),f(2),R(o.showStatusRow()?17:-1),f(3),X("disabled",o.models().length===0)("title",o.modelLabel()),He("aria-expanded",o.modelPickerOpen()),f(),R((r=o.currentProvider())?21:-1,r),f(2),$(o.currentModel()?.name||"no model"),f(3),R(o.modelPickerOpen()?26:-1),f(),X("levels",o.levels())("current",o.thinkingLevel()),f(2),R(o.streaming()?29:30)}},dependencies:[nn,gd,Ed,yd,vd,bd,hd],styles:["[_nghost-%COMP%]{display:block;position:relative;padding:10px}.box[_ngcontent-%COMP%]{position:relative;container-type:inline-size;max-width:780px;margin:0 auto;border:1px solid var(--%NS%morse-input-border);border-radius:var(--%NS%morse-radius-lg);background:var(--%NS%morse-input-bg);padding:8px;transition:border-color .12s ease}.toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:0 2px 4px}.toolbar[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{font-size:11.5px;color:var(--%NS%morse-fg-muted)}.icon[_ngcontent-%COMP%]{width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg);font-size:13px;line-height:1;cursor:pointer}.icon[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--%NS%morse-hover)}.icon[_ngcontent-%COMP%]:disabled{opacity:.4;cursor:default}.icon.send[_ngcontent-%COMP%]{background:var(--%NS%morse-accent);border-color:var(--%NS%morse-accent);color:#fff;font-size:15px}.icon.stop[_ngcontent-%COMP%]{color:var(--%NS%morse-error);border-color:var(--%NS%morse-error)}.working[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:0 4px;font-size:11.5px;color:var(--%NS%morse-fg-muted);white-space:nowrap}.working[_ngcontent-%COMP%] .spinner[_ngcontent-%COMP%]{width:11px;height:11px;border-radius:50%;border:1.5px solid var(--%NS%morse-border);border-top-color:var(--%NS%morse-accent);animation:_ngcontent-%COMP%_spin .8s linear infinite}.working[_ngcontent-%COMP%] .dots[_ngcontent-%COMP%]{display:inline-flex;gap:2px}.working[_ngcontent-%COMP%] .dots[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{width:3px;height:3px;border-radius:50%;background:currentColor;animation:_ngcontent-%COMP%_dot 1.2s ease-in-out infinite}.working[_ngcontent-%COMP%] .dots[_ngcontent-%COMP%] i[_ngcontent-%COMP%]:nth-child(2){animation-delay:.15s}.working[_ngcontent-%COMP%] .dots[_ngcontent-%COMP%] i[_ngcontent-%COMP%]:nth-child(3){animation-delay:.3s}.picker-host[_ngcontent-%COMP%], .palette-host[_ngcontent-%COMP%]{position:absolute;left:0;right:0;bottom:calc(100% + 4px);z-index:20}.attachments[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px;margin:0 2px 6px;padding:0;list-style:none}.chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;max-width:220px;padding:3px 4px 3px 3px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-md);background:var(--%NS%morse-hover);font-size:11.5px}.chip[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:22px;height:22px;object-fit:cover;border-radius:var(--%NS%morse-radius-sm)}.chip-name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:rtl;text-align:left}.pin-icon[_ngcontent-%COMP%]{font-size:12px;color:var(--%NS%morse-accent);line-height:1}.chip-lines[_ngcontent-%COMP%]{padding:1px 5px;border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-hover);color:var(--%NS%morse-fg-muted);font-size:10.5px;font-family:var(--%NS%morse-font-mono);white-space:nowrap}.chip-remove[_ngcontent-%COMP%]{padding:0 5px;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg-muted);line-height:1.4;cursor:pointer}.chip-remove[_ngcontent-%COMP%]:hover{color:var(--%NS%morse-fg);background:var(--%NS%morse-active)}.chip.live[_ngcontent-%COMP%]{background:transparent;border:1px dashed color-mix(in srgb,var(--%NS%morse-accent) 55%,transparent)}button.chip-body[_ngcontent-%COMP%]{display:inline-flex;align-items:center;align-self:stretch;gap:6px;flex:1 1 auto;min-width:0;overflow:hidden;border:0;padding:0;background:transparent;color:inherit;font:inherit;line-height:inherit;text-align:left;cursor:pointer}button.chip-body[_ngcontent-%COMP%]:hover, button.chip-body[_ngcontent-%COMP%]:active{background:color-mix(in srgb,var(--%NS%morse-accent) 12%,transparent)}button.chip-body[_ngcontent-%COMP%]:focus-visible{outline:1px solid var(--%NS%morse-focus);outline-offset:-1px}.chip.live[_ngcontent-%COMP%] .chip-lines[_ngcontent-%COMP%]{padding:0;background:transparent;color:color-mix(in srgb,var(--%NS%morse-accent) 70%,var(--%NS%morse-fg))}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}@keyframes _ngcontent-%COMP%_dot{0%,60%,to{opacity:.25}30%{opacity:1}}.box[_ngcontent-%COMP%]:focus-within{border-color:var(--%NS%morse-focus)}textarea[_ngcontent-%COMP%]{width:100%;border:0;background:transparent;resize:none;min-height:44px;max-height:220px;padding:4px 6px;line-height:1.5}textarea[_ngcontent-%COMP%]:focus-visible{outline:none}.controls[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;flex-wrap:nowrap;margin-top:6px}.controls-metrics[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;min-width:0;flex:1 1 auto;flex-wrap:nowrap}.controls-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;flex:0 0 auto;margin-left:auto;white-space:nowrap}.status-row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;margin-top:6px}.status-live[_ngcontent-%COMP%], .status-end[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;min-width:0}.status-live[_ngcontent-%COMP%]{flex:0 1 auto}.status-end[_ngcontent-%COMP%]{flex:0 0 auto}.model-button[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;flex:0 1 auto;min-width:0;max-width:240px;padding:4px 8px;border:1px solid var(--%NS%morse-input-border);border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-input-bg);color:var(--%NS%morse-input-fg);font-size:12px;cursor:pointer}.model-button[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--%NS%morse-fg-muted)}.model-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:default}.model-button[_ngcontent-%COMP%] .provider[_ngcontent-%COMP%]{flex:none;max-width:90px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:1px 5px;border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-hover);color:var(--%NS%morse-fg-muted);font-size:9.5px;font-weight:600;letter-spacing:.04em;text-transform:uppercase}.model-button[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.model-button[_ngcontent-%COMP%] .caret[_ngcontent-%COMP%]{flex:none;color:var(--%NS%morse-fg-muted);font-size:10px}.model-picker-host[_ngcontent-%COMP%]{position:absolute;left:0;bottom:calc(100% + 4px);z-index:20;width:min(360px,100%)}.hint[_ngcontent-%COMP%]{font-size:11px;white-space:nowrap}.throughput[_ngcontent-%COMP%]{color:var(--%NS%morse-accent);font-family:var(--%NS%morse-font-mono);font-variant-numeric:tabular-nums}@container (max-width: 380px){.usage-host[_ngcontent-%COMP%]{display:none}}@container (max-width: 460px){.controls[_ngcontent-%COMP%]{flex-wrap:wrap}.controls-actions[_ngcontent-%COMP%]{flex:1 1 100%;justify-content:flex-end}}@container (max-width: 360px){.thinking-host[_ngcontent-%COMP%]{display:none}}"]})},t0=[{name:"model",description:"Select a model"},{name:"new",description:"Start a new session"},{name:"compact",description:"Compact the current context"},{name:"settings",description:"Open Morse settings"}];function ID(t){let e=/^\/([\w-]+)$/.exec(t);if(e)return t0.some(n=>n.name===e[1])?e[1]:void 0}function DD(t){let e=t/1e3;return e<60?`${e<10?e.toFixed(1):Math.round(e)}s`:`${Math.floor(e/60)}m ${Math.round(e%60)}s`}function Mm(t){let e=0;for(let n of t)n.kind==="assistant"&&(e+=(n.text??"").length+(n.thinking??"").length);return e}var Lo=class t{navigationVisible=H(!1);navigationOpen=this.navigationVisible.asReadonly();projectPicker=H(!1);projectPickerOpen=this.projectPicker.asReadonly();toggleNavigation(){this.navigationVisible.update(e=>!e)}closeNavigation(){this.navigationVisible.set(!1)}openProjectPicker(){this.projectPicker.set(!0)}closeProjectPicker(){this.projectPicker.set(!1)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Pe({token:t,factory:t.\u0275fac,providedIn:"root"})};function kD(t,e){if(t&1&&(C(0,"div",4),g(1),w()),t&2){let n=v();et("title",n.workspace().cwd),f(),$(e)}}function ND(t,e){if(t&1&&(C(0,"span",8),g(1),w()),t&2){let n=v();f(),$(n.statusLabel())}}var Cd=class t{morse=O(Ht);shell=O(Lo);directoryPicker=T(()=>this.morse.capabilities()?.directoryPicker===!0);state=this.morse.state;connection=this.morse.connection;connectionDetail=this.morse.connectionDetail;workspace=this.morse.workspace;navigationOpen=this.shell.navigationOpen;status=T(()=>{let e=this.connection();return e!=="ready"?e:this.state().agentStarting?"starting":!this.state().agentReady&&this.state().agentError===void 0||this.state().agentReady?"ready":"error"});statusLabel=T(()=>{switch(this.status()){case"ready":return"Ready";case"starting":return"Starting\u2026";case"connecting":return"Connecting\u2026";case"closed":return"Disconnected";case"error":return"Error";default:return this.status()}});statusTitle=T(()=>{let e=this.connectionDetail();return e?`${this.statusLabel()} \xB7 ${e}`:this.statusLabel()});title=T(()=>this.state().sessionTitle||this.workspace().name||"Morse");meta=T(()=>{let e=[],n=this.workspace().name;n&&n!==this.title()&&e.push(n);let o=this.state().model;return o&&e.push(o.name),e.join(" \xB7 ")});toggleNavigation(){this.shell.toggleNavigation()}newSession(){if(this.directoryPicker()){this.shell.openProjectPicker();return}this.morse.newSession(this.workspace().cwd)}compact(){this.morse.compactSession()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Le({type:t,selectors:[["morse-chat-header"]],decls:17,vars:13,consts:[[1,"head"],["type","button","title","Sessions and projects","aria-label","Toggle navigation",1,"icon","menu",3,"click"],[1,"titles"],[1,"title",3,"title"],[1,"meta",3,"title"],[1,"actions"],[1,"status",3,"title"],["aria-hidden","true",1,"dot"],[1,"status-text"],["type","button","title","Shrink the conversation context (/compact)","aria-label","Shrink the conversation context",1,"icon",3,"click","disabled"],["viewBox","0 0 16 16","aria-hidden","true",1,"glyph"],["d","M4 3 8 6.6l4-3.6"],["d","M4 13 8 9.4l4 3.6"],["type","button","title","New session","aria-label","New session",1,"icon",3,"click"]],template:function(n,o){if(n&1&&(C(0,"header",0)(1,"button",1),ee("click",function(){return o.toggleNavigation()}),g(2," \u2630 "),w(),C(3,"div",2)(4,"div",3),g(5),w(),A(6,kD,2,2,"div",4),w(),C(7,"div",5)(8,"span",6),st(9,"span",7),A(10,ND,2,1,"span",8),w(),C(11,"button",9),ee("click",function(){return o.compact()}),vn(),C(12,"svg",10),st(13,"path",11)(14,"path",12),w()(),So(),C(15,"button",13),ee("click",function(){return o.newSession()}),g(16," + "),w()()()),n&2){let r;f(),He("aria-expanded",o.navigationOpen()),f(3),et("title",o.state().sessionId??o.workspace().cwd),f(),$(o.title()),f(),R((r=o.meta())?6:-1,r),f(2),Be("online",o.status()==="ready")("busy",o.status()==="starting")("failed",o.status()==="error"||o.status()==="closed"),et("title",o.statusTitle()),f(2),R(o.status()!=="ready"?10:-1),f(),et("disabled",!o.state().agentReady)}},styles:["[_nghost-%COMP%]{display:block;flex:none;background:var(--%NS%morse-bg);border-bottom:1px solid var(--%NS%morse-border)}.head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;min-height:40px;padding:6px 8px}.icon[_ngcontent-%COMP%]{flex:none;width:26px;height:26px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:1px solid transparent;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg);font-size:13px;line-height:1;cursor:pointer}.icon[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--%NS%morse-hover)}.icon[_ngcontent-%COMP%]:disabled{opacity:.4;cursor:default}.icon[_ngcontent-%COMP%] .glyph[_ngcontent-%COMP%]{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round}.menu[_ngcontent-%COMP%]{display:none}@media(max-width:759px){.menu[_ngcontent-%COMP%]{display:inline-flex}}.titles[_ngcontent-%COMP%]{flex:1;min-width:0;line-height:1.3}.title[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;font-weight:600}.meta[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;color:var(--%NS%morse-fg-muted)}.actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:2px;flex:none}.status[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;padding:2px 6px;font-size:11px;color:var(--%NS%morse-fg-muted);white-space:nowrap}.dot[_ngcontent-%COMP%]{flex:none;width:7px;height:7px;border-radius:50%;background:var(--%NS%morse-fg-muted)}.status.online[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{background:var(--%NS%morse-success)}.status.busy[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{background:var(--%NS%morse-warn);animation:_ngcontent-%COMP%_status-pulse 1.1s ease-in-out infinite}.status.failed[_ngcontent-%COMP%]{color:var(--%NS%morse-error)}.status.failed[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{background:var(--%NS%morse-error)}@keyframes _ngcontent-%COMP%_status-pulse{50%{opacity:.35}}"]})};function r0(t){let e=[],n=[],o=()=>{n.length!==0&&(e.push({kind:"process",key:`process-${n[0]?.key??e.length}`,steps:n}),n=[])};for(let r of t){if(r.kind==="tool"){n.push({kind:"tool",key:r.id,item:r});continue}if(r.kind==="assistant"){let i=r.thinking.trim();i.length>0&&n.push({kind:"thinking",key:`${r.id}:thinking`,item:r}),r.text.trim().length>0||r.streaming?(o(),e.push({kind:"assistant",key:r.id,item:r})):i.length===0&&o();continue}o(),r.kind==="user"?e.push({kind:"user",key:r.id,item:r}):r.kind==="notice"?e.push({kind:"notice",key:r.id,item:r}):r.kind==="compaction"&&e.push({kind:"compaction",key:r.id,item:r})}return o(),e}function i0(t){for(let e=t.length-1;e>=0;e-=1){let n=t[e];if(n?.kind==="process")return n.key}return null}var OD=/(^|\s)@([^\s:]+(?::\d+(?:-\d+)?)?)(?=$|\s)/g;function AD(t){if(t.length===0)return;let e=t.indexOf(":");if(e===-1)return{path:t};let n=t.slice(0,e),o=t.slice(e+1),r=/^(\d+)(?:-(\d+))?$/.exec(o);if(n.length===0||!r)return;let i=Number(r[1]),s=r[2]===void 0?i:Number(r[2]);return{path:n,startLine:i,endLine:s}}function s0(t){let e;return t.split(`
14
- `).map(n=>{let o=/^\s*(`{3,}|~{3,})/.exec(n);if(o){let r=o[1]?.charAt(0)??"";return e===void 0?e=r:r===e&&(e=void 0),n}return e===void 0?RD(n):n}).join(`
15
- `)}function RD(t){let e="",n=0;for(;n<t.length;){let o=t.indexOf("`",n);if(o===-1){e+=n0(t.slice(n));break}e+=n0(t.slice(n,o));let r=t.indexOf("`",o+1);if(r===-1){e+=t.slice(o);break}e+=t.slice(o,r+1),n=r+1}return e}function n0(t){return t.replace(OD,(e,n,o)=>{let r=AD(o);if(!r)return e;let i=PD(r.path),s=r.startLine===void 0?`@${i}`:`@${i}:${r.startLine}-${r.endLine}`,a=o0(r.path),c=r.startLine===void 0?"":` data-mention-start="${r.startLine}" data-mention-end="${r.endLine}"`;return`${n}<span class="mention" data-mention-path="${a}" title="${a}"${c}><span class="mention-label">${o0(s)}</span></span>`})}function PD(t){let e=t.replace(/[\\/]+$/,""),n=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return n===-1?e:e.slice(n+1)}function o0(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function LD(t,e){this.v=t,this.k=e}function a0(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function FD(t){if(Array.isArray(t))return t}function VD(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var o,r,i,s,a=[],c=!0,l=!1;try{if(i=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(o=i.call(n)).done)&&(a.push(o.value),a.length!==e);c=!0);}catch(d){l=!0,r=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw r}}return a}}function $D(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
16
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jD(t,e){return FD(t)||VD(t,e)||HD(t,e)||$D()}function HD(t,e){if(t){if(typeof t=="string")return a0(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a0(t,e):void 0}}function wd(t){var e,n;function o(i,s){try{var a=t[i](s),c=a.value,l=c instanceof LD;Promise.resolve(l?c.v:c).then(function(d){if(l){var u=i==="return"&&c.k?i:"next";if(!c.k||d.done)return o(u,d);d=t[u](d).value}r(!!a.done,d)},function(d){o("throw",d)})}catch(d){r(2,d)}}function r(i,s){i===2?e.reject(s):e.resolve({value:s,done:i}),(e=e.next)?o(e.key,e.arg):n=null}this._invoke=function(i,s){return new Promise(function(a,c){var l={key:i,arg:s,resolve:a,reject:c,next:null};n?n=n.next=l:(e=n=l,o(i,s))})},typeof t.return!="function"&&(this.return=void 0)}wd.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},wd.prototype.next=function(t){return this._invoke("next",t)},wd.prototype.throw=function(t){return this._invoke("throw",t)},wd.prototype.return=function(t){return this._invoke("return",t)};var x0=Object.entries,c0=Object.setPrototypeOf,BD=Object.isFrozen,UD=Object.getPrototypeOf,zD=Object.getOwnPropertyDescriptor,Qt=Object.freeze,on=Object.seal,fs=Object.create,C0=typeof Reflect<"u"&&Reflect,Rm=C0.apply,Pm=C0.construct;Qt||(Qt=function(e){return e});on||(on=function(e){return e});Rm||(Rm=function(e,n){for(var o=arguments.length,r=new Array(o>2?o-2:0),i=2;i<o;i++)r[i-2]=arguments[i];return e.apply(n,r)});Pm||(Pm=function(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return new e(...o)});var fi=Bt(Array.prototype.forEach);Array.prototype.indexOf;var GD=Bt(Array.prototype.lastIndexOf),l0=Bt(Array.prototype.pop),Oa=Bt(Array.prototype.push);Array.prototype.slice;var WD=Bt(Array.prototype.splice),ms=Array.isArray,Pa=Bt(String.prototype.toLowerCase),Im=Bt(String.prototype.toString),d0=Bt(String.prototype.match),Aa=Bt(String.prototype.replace),u0=Bt(String.prototype.indexOf),qD=Bt(String.prototype.trim),YD=Bt(Number.prototype.toString),ZD=Bt(Boolean.prototype.toString),p0=typeof BigInt>"u"?null:Bt(BigInt.prototype.toString),f0=typeof Symbol>"u"?null:Bt(Symbol.prototype.toString),Mn=Bt(Object.prototype.hasOwnProperty),Ra=Bt(Object.prototype.toString),fn=Bt(RegExp.prototype.test),xr=KD(TypeError);function Bt(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return Rm(t,e,o)}}function KD(t){return function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return Pm(t,n)}}function tt(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Pa;if(c0&&c0(t,null),!ms(e))return t;let o=e.length;for(;o--;){let r=e[o];if(typeof r=="string"){let i=n(r);i!==r&&(BD(e)||(e[o]=i),r=i)}t[r]=!0}return t}function QD(t){for(let e=0;e<t.length;e++)Mn(t,e)||(t[e]=null);return t}function Vn(t){let e=fs(null);for(let o of x0(t)){var n=jD(o,2);let r=n[0],i=n[1];Mn(t,r)&&(ms(i)?e[r]=QD(i):i&&typeof i=="object"&&i.constructor===Object?e[r]=Vn(i):e[r]=i)}return e}function XD(t){switch(typeof t){case"string":return t;case"number":return YD(t);case"boolean":return ZD(t);case"bigint":return p0?p0(t):"0";case"symbol":return f0?f0(t):"Symbol()";case"undefined":return Ra(t);case"function":case"object":{if(t===null)return Ra(t);let e=t,n=oo(e,"toString");if(typeof n=="function"){let o=n(e);return typeof o=="string"?o:Ra(o)}return Ra(t)}default:return Ra(t)}}function oo(t,e){for(;t!==null;){let o=zD(t,e);if(o){if(o.get)return Bt(o.get);if(typeof o.value=="function")return Bt(o.value)}t=UD(t)}function n(){return null}return n}function JD(t){try{return fn(t,""),!0}catch{return!1}}var m0=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"]),Dm=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"]),km=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"]),ek=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"]),Nm=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"]),tk=Qt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),h0=Qt(["#text"]),g0=Qt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","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"]),Om=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","dominant-baseline","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","pointer-events","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-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","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"]),y0=Qt(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","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"]),Sd=Qt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),nk=on(/{{[\w\W]*|^[\w\W]*}}/g),ok=on(/<%[\w\W]*|^[\w\W]*%>/g),rk=on(/\${[\w\W]*/g),ik=on(/^data-[\-\w.\u00B7-\uFFFF]+$/),sk=on(/^aria-[\-\w]+$/),v0=on(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ak=on(/^(?:\w+script|data):/i),ck=on(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),lk=on(/^html$/i),dk=on(/^[a-z][.\w]*(-[.\w]+)+$/i),_0=on(/<[/\w!]/g),b0=on(/<[/\w]/g),uk=on(/<\/no(script|embed|frames)/i),pk=on(/\/>/i),Fn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},w0=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],fk=Qt(tt({},w0)),mk=(function(){let t={};return fi(w0,e=>{t[e]=on(new RegExp("</"+e+"(?=[\\t\\n\\f\\r />])","i"))}),Qt(t)})(),hk=function(){return typeof window>"u"?null:window},gk=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let o=null,r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(o=n.getAttribute(r));let i="dompurify"+(o?"#"+o:"");try{return e.createPolicy(i,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},E0=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Cr=function(e,n,o,r){return Mn(e,n)&&ms(e[n])?tt(r.base?Vn(r.base):{},e[n],r.transform):o},Am=function(e,n,o){let r=Mn(e,n)?e[n]:void 0;return r&&typeof r=="object"?Vn(r):o()};function S0(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:hk(),e=F=>S0(F);if(e.version="3.4.16",e.removed=[],!t||!t.document||t.document.nodeType!==Fn.document||!t.Element)return e.isSupported=!1,e;let n=t.document,o=n,r=o.currentScript;t.DocumentFragment;let i=t.HTMLTemplateElement,s=t.Node,a=t.Element,c=t.NodeFilter;t.NamedNodeMap===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;let l=t.DOMParser,d=t.trustedTypes,u=a.prototype,m=oo(u,"cloneNode"),h=oo(u,"remove"),y=oo(u,"removeAttributeNode"),E=oo(u,"nextSibling"),M=oo(u,"childNodes"),W=oo(u,"parentNode"),z=oo(u,"shadowRoot"),me=oo(u,"attributes"),ae=s&&s.prototype?oo(s.prototype,"nodeType"):null,ge=s&&s.prototype?oo(s.prototype,"nodeName"):null,re=s&&s.prototype?oo(s.prototype,"ownerDocument"):null,We=function(p){return ae?ae(p):p.nodeType},Te=function(p){return ge?ge(p):p.nodeName};if(typeof i=="function"){let F=n.createElement("template");F.content&&F.content.ownerDocument&&(n=F.content.ownerDocument)}let De,at="",yt,Tt=!1,_t=0,qe=function(){if(_t>0)throw xr('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},pe=function(p){qe(),_t++;try{return De.createHTML(p)}finally{_t--}},S=function(p){qe(),_t++;try{return De.createScriptURL(p)}finally{_t--}},q=function(){return Tt||(yt=gk(d,r),Tt=!0),yt},B=n,I=B.implementation,K=B.createNodeIterator,we=B.createDocumentFragment,Ye=B.getElementsByTagName,Ot=o.importNode,de=E0();e.isSupported=typeof x0=="function"&&typeof W=="function"&&I&&I.createHTMLDocument!==void 0;let ft=nk,Ne=ok,Xt=rk,At=ik,Ve=sk,Lt=ak,Mt=ck,Ce=dk,Ae=v0,ye=null,Xe=tt({},[...m0,...Dm,...km,...Nm,...h0]),ne=null,rt=tt({},[...g0,...Om,...y0,...Sd]),G=Object.seal(fs(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}})),ut=null,Ue=null,te=Object.seal(fs(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ht=!0,ue=!0,nt=!1,Oe=!0,N=!1,L=!0,Z=!1,oe=!1,ct=null,vt=null,jn=!1,ln=!1,go=!1,yo=!1,Ua=!0,za=!1,_i="user-content-",Tr=!0,bs=!1,Ut={},vo=null,Es=tt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),Ga=null,Mr=tt({},["audio","video","img","source","image","track"]),xs=null,Cs=tt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Jt="http://www.w3.org/1998/Math/MathML",or="http://www.w3.org/2000/svg",_e="http://www.w3.org/1999/xhtml",It=_e,Wa=!1,bi=null,QE=tt({},[Jt,or,_e],Im),eh=Qt(["mi","mo","mn","ms","mtext"]),Kd=tt({},eh),th=Qt(["annotation-xml"]),Qd=tt({},th),XE=tt({},["title","style","font","a","script"]),ws=null,JE=["application/xhtml+xml","text/html"],ex="text/html",Rt=null,Ei=null,tx=n.createElement("form"),nh=function(p){return p instanceof RegExp||p instanceof Function},Xd=function(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ei&&Ei===p)return;(!p||typeof p!="object")&&(p={}),p=Vn(p),ws=JE.indexOf(p.PARSER_MEDIA_TYPE)===-1?ex:p.PARSER_MEDIA_TYPE,Rt=ws==="application/xhtml+xml"?Im:Pa,ye=Cr(p,"ALLOWED_TAGS",Xe,{transform:Rt}),ne=Cr(p,"ALLOWED_ATTR",rt,{transform:Rt}),bi=Cr(p,"ALLOWED_NAMESPACES",QE,{transform:Im}),xs=Cr(p,"ADD_URI_SAFE_ATTR",Cs,{transform:Rt,base:Cs}),Ga=Cr(p,"ADD_DATA_URI_TAGS",Mr,{transform:Rt,base:Mr}),vo=Cr(p,"FORBID_CONTENTS",Es,{transform:Rt}),ut=Cr(p,"FORBID_TAGS",Vn({}),{transform:Rt}),Ue=Cr(p,"FORBID_ATTR",Vn({}),{transform:Rt}),Ut=Mn(p,"USE_PROFILES")?p.USE_PROFILES&&typeof p.USE_PROFILES=="object"?Vn(p.USE_PROFILES):p.USE_PROFILES:!1,ht=p.ALLOW_ARIA_ATTR!==!1,ue=p.ALLOW_DATA_ATTR!==!1,nt=p.ALLOW_UNKNOWN_PROTOCOLS||!1,Oe=p.ALLOW_SELF_CLOSE_IN_ATTR!==!1,N=p.SAFE_FOR_TEMPLATES||!1,L=p.SAFE_FOR_XML!==!1,Z=p.WHOLE_DOCUMENT||!1,ln=p.RETURN_DOM||!1,go=p.RETURN_DOM_FRAGMENT||!1,yo=p.RETURN_TRUSTED_TYPE||!1,jn=p.FORCE_BODY||!1,Ua=p.SANITIZE_DOM!==!1,za=p.SANITIZE_NAMED_PROPS||!1,Tr=p.KEEP_CONTENT!==!1,bs=p.IN_PLACE||!1,Ae=JD(p.ALLOWED_URI_REGEXP)?p.ALLOWED_URI_REGEXP:v0,It=typeof p.NAMESPACE=="string"?p.NAMESPACE:_e,Kd=Am(p,"MATHML_TEXT_INTEGRATION_POINTS",()=>tt({},eh)),Qd=Am(p,"HTML_INTEGRATION_POINTS",()=>tt({},th));let x=Am(p,"CUSTOM_ELEMENT_HANDLING",()=>fs(null));if(G=fs(null),Mn(x,"tagNameCheck")&&nh(x.tagNameCheck)&&(G.tagNameCheck=x.tagNameCheck),Mn(x,"attributeNameCheck")&&nh(x.attributeNameCheck)&&(G.attributeNameCheck=x.attributeNameCheck),Mn(x,"allowCustomizedBuiltInElements")&&typeof x.allowCustomizedBuiltInElements=="boolean"&&(G.allowCustomizedBuiltInElements=x.allowCustomizedBuiltInElements),on(G),N&&(ue=!1),go&&(ln=!0),Ut&&(ye=tt({},h0),ne=fs(null),Ut.html===!0&&(tt(ye,m0),tt(ne,g0)),Ut.svg===!0&&(tt(ye,Dm),tt(ne,Om),tt(ne,Sd)),Ut.svgFilters===!0&&(tt(ye,km),tt(ne,Om),tt(ne,Sd)),Ut.mathMl===!0&&(tt(ye,Nm),tt(ne,y0),tt(ne,Sd))),te.tagCheck=null,te.attributeCheck=null,Mn(p,"ADD_TAGS")&&(typeof p.ADD_TAGS=="function"?te.tagCheck=p.ADD_TAGS:ms(p.ADD_TAGS)&&(ye===Xe&&(ye=Vn(ye)),tt(ye,p.ADD_TAGS,Rt))),Mn(p,"ADD_ATTR")&&(typeof p.ADD_ATTR=="function"?te.attributeCheck=p.ADD_ATTR:ms(p.ADD_ATTR)&&(ne===rt&&(ne=Vn(ne)),tt(ne,p.ADD_ATTR,Rt))),Mn(p,"ADD_FORBID_CONTENTS")&&ms(p.ADD_FORBID_CONTENTS)&&(vo===Es&&(vo=Vn(vo)),tt(vo,p.ADD_FORBID_CONTENTS,Rt)),Tr&&(ye["#text"]=!0),Z&&tt(ye,["html","head","body"]),ye.table&&(tt(ye,["tbody"]),delete ut.tbody),p.TRUSTED_TYPES_POLICY){if(typeof p.TRUSTED_TYPES_POLICY.createHTML!="function")throw xr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof p.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw xr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let P=De;De=p.TRUSTED_TYPES_POLICY;try{at=pe("")}catch(j){throw De=P,j}}else p.TRUSTED_TYPES_POLICY===null?(De=void 0,at=""):(De===void 0&&(De=q()),De&&typeof at=="string"&&(at=pe("")));Qt&&Qt(p),Ei=p},oh=tt({},[...Dm,...km,...ek]),rh=tt({},[...Nm,...tk]),nx=function(p,x,P){return x.namespaceURI===_e?p==="svg":x.namespaceURI===Jt?p==="svg"&&(P==="annotation-xml"||Kd[P]):!!oh[p]},ox=function(p,x,P){return x.namespaceURI===_e?p==="math":x.namespaceURI===or?p==="math"&&Qd[P]:!!rh[p]},rx=function(p,x,P){return x.namespaceURI===or&&!Qd[P]||x.namespaceURI===Jt&&!Kd[P]?!1:!rh[p]&&(XE[p]||!oh[p])},ix=function(p){let x=W(p);(!x||!x.tagName)&&(x={namespaceURI:It,tagName:"template"});let P=Pa(p.tagName),j=Pa(x.tagName);return bi[p.namespaceURI]?p.namespaceURI===or?nx(P,x,j):p.namespaceURI===Jt?ox(P,x,j):p.namespaceURI===_e?rx(P,x,j):!!(ws==="application/xhtml+xml"&&bi[p.namespaceURI]):!1},rr=function(p){Oa(e.removed,{element:p});try{W(p).removeChild(p)}catch{if(h(p),!W(p))throw xr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ih=function(p,x,P){try{y(p,x)}catch{try{p.removeAttribute(P)}catch{}}},qa=function(p){Ya(p);let x=M(p);if(x){let j=[];fi(x,ie=>{Oa(j,ie)}),fi(j,ie=>{try{h(ie)}catch{}})}let P=me(p);if(P)for(let j=P.length-1;j>=0;--j){let ie=P[j],Re=ie&&ie.name;typeof Re=="string"&&ih(p,ie,Re)}},Ir=function(p,x,P){if(!P)try{P=x.getAttributeNode(p)}catch{P=null}Oa(e.removed,{attribute:P||null,from:x});try{P?y(x,P):x.removeAttribute(p)}catch{try{x.removeAttribute(p)}catch{}}if(p==="is")if(ln||go)try{rr(x)}catch{}else try{x.setAttribute(p,"")}catch{}},sx=function(p){let x=me(p);if(x)for(let P=x.length-1;P>=0;--P){let j=x[P],ie=j&&j.name;typeof ie!="string"||ne[Rt(ie)]||ih(p,j,ie)}},Ya=function(p){let x=[p];for(;x.length>0;){let P=x.pop();We(P)===Fn.element&&sx(P);let j=M(P);if(j)for(let ie=j.length-1;ie>=0;--ie)x.push(j[ie])}},sh=function(p,x){return L?p==="patchsrc"?!0:p==="for"&&x!=="label"&&x!=="output":!1},ax=function(p){if(!L)return;let x=[p];for(;x.length>0;){let P=x.pop(),j=We(P);if(j===Fn.processingInstruction||j===Fn.comment&&fn(b0,P.data)){try{h(P)}catch{}continue}if(j===Fn.element){let Re=P,Ze=Rt(Te(P));try{Re.hasAttribute&&Re.hasAttribute("patchsrc")&&Re.removeAttribute("patchsrc"),Re.hasAttribute&&Re.hasAttribute("for")&&sh("for",Ze)&&Re.removeAttribute("for")}catch{}}let ie=M(P);if(ie)for(let Re=ie.length-1;Re>=0;--Re)x.push(ie[Re])}},ah=function(p){let x=null,P=null;if(jn)p="<remove></remove>"+p;else{let Re=d0(p,/^[\r\n\t ]+/);P=Re&&Re[0]}ws==="application/xhtml+xml"&&It===_e&&(p='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+p+"</body></html>");let j=De?pe(p):p;if(It===_e)try{x=new l().parseFromString(j,ws)}catch{}if(!x||!x.documentElement){x=I.createDocument(It,"template",null);try{x.documentElement.innerHTML=Wa?at:j}catch{}}let ie=x.body||x.documentElement;return p&&P&&ie.insertBefore(n.createTextNode(P),ie.childNodes[0]||null),It===_e?Ye.call(x,Z?"html":"body")[0]:Z?x.documentElement:ie},ch=function(p){let x=re?re(p):p.ownerDocument;return K.call(x||p,p,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Za=function(p){return p=Aa(p,ft," "),p=Aa(p,Ne," "),p=Aa(p,Xt," "),p},Jd=function(p){var x;p.normalize();let P=re?re(p):p.ownerDocument,j=K.call(P||p,p,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),ie=j.nextNode();for(;ie;)ie.data=Za(ie.data),ie=j.nextNode();let Re=(x=p.querySelectorAll)===null||x===void 0?void 0:x.call(p,"template");Re&&fi(Re,Ze=>{xi(Ze.content)&&Jd(Ze.content)})},Ka=function(p){let x=ge?ge(p):null;return typeof x!="string"||Rt(x)!=="form"?!1:typeof p.nodeName!="string"||typeof p.textContent!="string"||typeof p.removeChild!="function"||p.attributes!==me(p)||typeof p.removeAttribute!="function"||typeof p.removeAttributeNode!="function"||typeof p.getAttributeNode!="function"||typeof p.setAttribute!="function"||typeof p.namespaceURI!="string"||typeof p.insertBefore!="function"||typeof p.hasChildNodes!="function"||p.nodeType!==ae(p)||p.childNodes!==M(p)},xi=function(p){if(!ae||typeof p!="object"||p===null)return!1;try{return ae(p)===Fn.documentFragment}catch{return!1}},Ss=function(p){if(!ae||typeof p!="object"||p===null)return!1;try{return typeof ae(p)=="number"}catch{return!1}};function _o(F,p,x){F.length!==0&&fi(F,P=>{P.call(e,p,x,Ei)})}let cx=function(p,x){return!!(L&&p.hasChildNodes()&&!Ss(p.firstElementChild)&&fn(_0,p.textContent)&&fn(_0,p.innerHTML)||L&&p.namespaceURI===_e&&fk[x]&&(Ss(p.firstElementChild)||typeof p.textContent=="string"&&fn(mk[x],p.textContent))||p.nodeType===Fn.processingInstruction||L&&p.nodeType===Fn.comment&&fn(b0,p.data))},Qa=function(p,x){if(p instanceof RegExp)return fn(p,x);if(p instanceof Function){for(var P=arguments.length,j=new Array(P>2?P-2:0),ie=2;ie<P;ie++)j[ie-2]=arguments[ie];return!!p(x,...j)}return!1},lx=function(p,x,P){if(!ut[x]&&ph(x)&&Qa(G.tagNameCheck,x))return!1;if(Tr&&!vo[x]){let j=W(p),ie=M(p);if(ie&&j){let Re=ie.length;for(let Ze=Re-1;Ze>=0;--Ze){let Dt=p===P?m(ie[Ze],!0):ie[Ze];j.insertBefore(Dt,E(p))}}}return rr(p),!0},lh=function(p,x,P,j){return p.length===0?x:x===P||x===j?Vn(x):x},Ci=function(p,x){return p===x||W(p)!==null?!1:(bs&&Ya(p),!0)},dh=function(p,x){if(_o(de.beforeSanitizeElements,p,null),Ci(p,x))return!0;if(Ka(p))return rr(p),!0;let P=Rt(Te(p));if(ye=lh(de.uponSanitizeElement,ye,Xe,ct),_o(de.uponSanitizeElement,p,{tagName:P,allowedTags:ye}),Ci(p,x))return!0;if(cx(p,P))return rr(p),!0;if(ut[P]||!(te.tagCheck instanceof Function&&te.tagCheck(P))&&!ye[P]){let j=lx(p,P,x);return j===!1&&(_o(de.afterSanitizeElements,p,null),Ci(p,x))?!0:j}if(We(p)===Fn.element&&!ix(p)||(P==="noscript"||P==="noembed"||P==="noframes")&&fn(uk,p.innerHTML))return rr(p),!0;if(N&&p.nodeType===Fn.text){let j=Za(p.textContent);p.textContent!==j&&(Oa(e.removed,{element:p.cloneNode()}),p.textContent=j)}return _o(de.afterSanitizeElements,p,null),Ci(p,x)},uh=function(p,x,P){if(Ue[x]||sh(x,p)||Ua&&(x==="id"||x==="name")&&(P in n||P in tx))return!1;let j=ne[x]||te.attributeCheck instanceof Function&&te.attributeCheck(x,p);return ue&&fn(At,x)||ht&&fn(Ve,x)?!0:j?xs[x]||fn(Ae,Aa(P,Mt,""))||(x==="src"||x==="xlink:href"||x==="href")&&p!=="script"&&u0(P,"data:")===0&&Ga[p]||nt&&!fn(Lt,Aa(P,Mt,""))?!0:!P:ph(p)&&Qa(G.tagNameCheck,p)&&Qa(G.attributeNameCheck,x,p)||x==="is"&&G.allowCustomizedBuiltInElements&&Qa(G.tagNameCheck,P)},dx=tt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ph=function(p){return!dx[Pa(p)]&&fn(Ce,p)},ux=function(p,x,P,j){if(De&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!P)switch(d.getAttributeType(p,x)){case"TrustedHTML":return pe(j);case"TrustedScriptURL":return S(j)}return j},px=function(p,x,P,j){try{return P?p.setAttributeNS(P,x,j):p.setAttribute(x,j),Ka(p)?(rr(p),!1):!0}catch{return Ir(x,p),!1}},fh=function(p,x){if(_o(de.beforeSanitizeAttributes,p,null),Ci(p,x))return;let P=p.attributes;if(!P||Ka(p))return;ne=lh(de.uponSanitizeAttribute,ne,rt,vt);let j={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ne,forceKeepAttr:void 0},ie=P.length,Re=Rt(p.nodeName);for(;ie--;){let Ze=P[ie],Dt=Ze.name,Hn=Ze.namespaceURI,In=Ze.value,wi=Rt(Dt),tu=In,mn=Dt==="value"?tu:qD(tu),mh=!1;if(j.attrName=wi,j.attrValue=mn,j.keepAttr=!0,j.forceKeepAttr=void 0,_o(de.uponSanitizeAttribute,p,j),mn=j.attrValue,za&&(wi==="id"||wi==="name")&&u0(mn,_i)!==0&&(Ir(Dt,p,Ze),mn=_i+mn,mh=!0),L&&fn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,mn)){Ir(Dt,p,Ze);continue}if(wi==="attributename"&&d0(mn,"href")){Ir(Dt,p,Ze);continue}if(!j.forceKeepAttr){if(!j.keepAttr){Ir(Dt,p,Ze);continue}if(!Oe&&fn(pk,mn)){Ir(Dt,p,Ze);continue}if(N&&(mn=Za(mn)),!uh(Re,wi,mn)){Ir(Dt,p,Ze);continue}mn=ux(Re,wi,Hn,mn),mn!==tu&&px(p,Dt,Hn,mn)&&mh&&l0(e.removed)}}_o(de.afterSanitizeAttributes,p,null),Ci(p,x)},Xa=function(p){let x=null,P=ch(p);for(_o(de.beforeSanitizeShadowDOM,p,null);x=P.nextNode();)if(_o(de.uponSanitizeShadowNode,x,null),dh(x,p),fh(x,p),xi(x.content)&&Xa(x.content),We(x)===Fn.element){let j=z(x);xi(j)&&(eu(j),Xa(j))}_o(de.afterSanitizeShadowDOM,p,null)},eu=function(p){let x=[{node:p,shadow:null}];for(;x.length>0;){let P=x.pop();if(P.shadow){Xa(P.shadow);continue}let j=P.node,ie=We(j)===Fn.element,Re=M(j);if(Re)for(let Ze=Re.length-1;Ze>=0;--Ze)x.push({node:Re[Ze],shadow:null});if(ie){let Ze=ge?ge(j):null;if(typeof Ze=="string"&&Rt(Ze)==="template"){let Dt=j.content;xi(Dt)&&x.push({node:Dt,shadow:null})}}if(ie){let Ze=z(j);xi(Ze)&&x.push({node:null,shadow:Ze},{node:Ze,shadow:null})}}};return e.sanitize=function(F){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},x=null,P=null,j=null,ie=null;if(Wa=!F,Wa&&(F="<!-->"),typeof F!="string"&&!Ss(F)&&(F=XD(F),typeof F!="string"))throw xr("dirty is not a string, aborting");if(!e.isSupported)return F;oe?(ye=ct,ne=vt):Xd(p),(de.uponSanitizeElement.length>0||de.uponSanitizeAttribute.length>0)&&(ye=Vn(ye)),de.uponSanitizeAttribute.length>0&&(ne=Vn(ne)),e.removed=[];let Re=bs&&typeof F!="string"&&Ss(F);if(Re){ax(F);let Hn=Te(F);if(typeof Hn=="string"){let In=Rt(Hn);if(!ye[In]||ut[In])throw qa(F),xr("root node is forbidden and cannot be sanitized in-place")}if(Ka(F))throw qa(F),xr("root node is clobbered and cannot be sanitized in-place");try{eu(F)}catch(In){throw qa(F),In}}else if(Ss(F))x=ah("<!---->"),P=x.ownerDocument.importNode(F,!0),P.nodeType===Fn.element&&P.nodeName==="BODY"||P.nodeName==="HTML"?x=P:x.appendChild(P),eu(x);else{if(!ln&&!N&&!Z&&F.indexOf("<")===-1)return De&&yo?pe(F):F;if(x=ah(F),!x)return ln?null:yo?at:""}x&&jn&&rr(x.firstChild);let Ze=Re?F:x;try{let Hn=ch(Ze);for(;j=Hn.nextNode();)dh(j,Ze),fh(j,Ze),xi(j.content)&&Xa(j.content)}catch(Hn){throw Re&&(qa(F),fi(e.removed,In=>{In.element&&Ya(In.element)})),Hn}if(Re){let Hn=!1;if(fi(e.removed,In=>{In.element&&(In.element===F&&(Hn=!0),Ya(In.element))}),Hn)throw xr("a node selected for removal could not be safely returned; refusing to sanitize in place");return N&&Jd(F),F}if(ln){if(N&&Jd(x),go)for(ie=we.call(x.ownerDocument);x.firstChild;)ie.appendChild(x.firstChild);else ie=x;return(ne.shadowroot||ne.shadowrootmode)&&(ie=Ot.call(o,ie,!0)),ie}let Dt=Z?x.outerHTML:x.innerHTML;return Z&&ye["!doctype"]&&x.ownerDocument&&x.ownerDocument.doctype&&x.ownerDocument.doctype.name&&fn(lk,x.ownerDocument.doctype.name)&&(Dt="<!DOCTYPE "+x.ownerDocument.doctype.name+`>
17
- `+Dt),N&&(Dt=Za(Dt)),De&&yo?pe(Dt):Dt},e.setConfig=function(){let F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Xd(F),oe=!0,ct=ye,vt=ne},e.clearConfig=function(){Ei=null,oe=!1,ct=null,vt=null,De=yt,at=""},e.isValidAttribute=function(F,p,x){Ei||Xd({});let P=Rt(F),j=Rt(p);return uh(P,j,x)},e.addHook=function(F,p){typeof p=="function"&&Mn(de,F)&&Oa(de[F],p)},e.removeHook=function(F,p){if(Mn(de,F)){if(p!==void 0){let x=GD(de[F],p);return x===-1?void 0:WD(de[F],x,1)[0]}return l0(de[F])}},e.removeHooks=function(F){Mn(de,F)&&(de[F]=[])},e.removeAllHooks=function(){de=E0()},e}var T0=S0();var q0=xx(W0(),1);var Nd=q0.default;function Y0(t){let e=t.regex,n={},o={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},o]});let r={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},i=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},a={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,r]};r.contains.push(a);let c={match:/\\"/},l={className:"string",begin:/'/,end:/'/},d={match:/\\'/},u={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},m=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=t.SHEBANG({binary:`(${m.join("|")})`,relevance:10}),y={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},E=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],M=["true","false"],W={match:/(\/[a-z._-]+)+/},z=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],me=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],ae=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],ge=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:E,literal:M,built_in:[...z,...me,"set","shopt",...ae,...ge]},contains:[h,t.SHEBANG(),y,u,i,s,W,a,c,l,d,n]}}var sN=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,5}(-[0-9A-Fa-f][0-9A-Fa-f]{0,5})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),aN=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],cN=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],lN=[...aN,...cN],dN=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),uN=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),pN=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),fN=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","corner-bottom-left-shape","corner-bottom-right-shape","corner-shape","corner-top-left-shape","corner-top-right-shape","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Z0(t){let e=t.regex,n=sN(t),o={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",i=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",a=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,o,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+uN.join("|")+")"},{begin:":(:)?("+pN.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+fN.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,n.UNICODE_RANGE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:dN.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+lN.join("|")+")\\b"}]}}function K0(t){let e=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+,\d+ +\+\d+ +@@/,/^@@ +-\d+ +\+\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function Q0(t){let i={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:i,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\b0[bB](_?[01])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:i,illegal:/["']/}]}]}}var X0="[A-Za-z$_][0-9A-Za-z$_]*",mN=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],hN=["true","false","null","undefined","NaN","Infinity"],J0=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],eE=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],tE=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],gN=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],yN=[].concat(tE,J0,eE);function nE(t){let e=t.regex,n=(B,{after:I})=>{let K="</"+B[0].slice(1);return B.input.indexOf(K,I)!==-1},o=X0,r={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(B,I)=>{let K=B[0].length+B.index,we=B.input[K];if(we==="<"||we===","){I.ignoreMatch();return}we===">"&&(n(B,{after:K})||I.ignoreMatch());let Ye,Ot=B.input.substring(K);if(Ye=Ot.match(/^\s*=/)){I.ignoreMatch();return}if((Ye=Ot.match(/^\s+extends\s+/))&&Ye.index===0){I.ignoreMatch();return}}},a={$pattern:X0,keyword:mN,literal:hN,built_in:yN,"variable.language":gN},c="[0-9](_?[0-9])*",l=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",u={className:"number",variants:[{begin:`(\\b(${d})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},y={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},M={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,m]},z={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:o+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},me=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,y,E,M,{match:/\$\d+/},u];m.contains=me.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(me)});let ae=[].concat(z,m.contains),ge=ae.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(ae)}]),re={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:ge},We={variants:[{match:[/class/,/\s+/,o,/\s+/,/extends/,/\s+/,e.concat(o,"(",e.concat(/\./,o),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,o],scope:{1:"keyword",3:"title.class"}}]},Te={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...J0,...eE]}},De={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},at={variants:[{match:[/function/,/\s+/,o,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[re],illegal:/%/},yt={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Tt(B){return e.concat("(?!",B.join("|"),")")}let _t={match:e.concat(/\b/,Tt([...tE,"super","import","await"].map(B=>`${B}\\s*\\(`)),o,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},qe={begin:e.concat(/\./,e.lookahead(e.concat(o,/(?![0-9A-Za-z$_(])/))),end:o,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},pe={match:[/get|set/,/\s+/,o,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},re]},S="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",q={match:[/const|var|let/,/\s+/,o,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(S)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[re]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:ge,CLASS_REFERENCE:Te},illegal:/#(?![$_A-Za-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),De,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,y,E,M,z,{match:/\$\d+/},u,Te,{scope:"attr",match:o+e.lookahead(":"),relevance:0},q,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[z,t.REGEXP_MODE,{className:"function",begin:S,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:ge}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:i},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},at,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[re,t.inherit(t.TITLE_MODE,{begin:o,className:"title.function"})]},{match:/\.\.\./,relevance:0},qe,{match:"\\$"+o,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[re]},_t,yt,We,pe,{match:/\$[(.]/}]}}var vN="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",_N={scope:"number",match:vN,relevance:0};function oE(t){let e={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},o=["true","false","null"],r={scope:"literal",beginKeywords:o.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:o},contains:[e,n,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,r,_N,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function rE(t){let e=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},o={match:/^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/},r={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},i={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},a=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,a,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},l={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=t.inherit(l,{contains:[]}),m=t.inherit(d,{contains:[]});l.contains.push(m),d.contains.push(u);let h=[n,c];return[l,d,u,m].forEach(W=>{W.contains=W.contains.concat(h)}),h=h.concat(l,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:h},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:h}]}]},n,i,o,l,d,{className:"quote",begin:"^>\\s+",contains:h,end:"$"},r,c,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function iE(t){let e=t.regex,n=/(?![A-Za-z0-9])(?![$])/,o=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),r=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),i=e.concat(/[A-Z]+/,n),s={scope:"variable",match:"\\$+"+o},a={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=t.inherit(t.APOS_STRING_MODE,{illegal:null}),d=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(c)}),u={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(qe,pe)=>{pe.data._beginMatch=qe[1]||qe[2]},"on:end":(qe,pe)=>{pe.data._beginMatch!==qe[1]&&pe.ignoreMatch()}},m=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),h=`[
18
- ]`,y={scope:"string",variants:[d,l,u,m]},E={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},M=["false","null","true"],W=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],z=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],ae={keyword:W,literal:(qe=>{let pe=[];return qe.forEach(S=>{pe.push(S),S.toLowerCase()===S?pe.push(S.toUpperCase()):pe.push(S.toLowerCase())}),pe})(M),built_in:z},ge=qe=>qe.map(pe=>pe.replace(/\|\d+$/,"")),re={variants:[{match:[/new/,e.concat(h,"+"),e.concat("(?!",ge(z).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},We=e.concat(o,"\\b(?!\\()"),Te={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),We],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,e.concat(/::/,e.lookahead(/(?!class\b)/)),We],scope:{1:"title.class",3:"variable.constant"}},{match:[r,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},De={scope:"attr",match:e.concat(o,e.lookahead(":"),e.lookahead(/(?!::)/))},at={relevance:0,begin:/\(/,end:/\)/,keywords:ae,contains:[De,s,Te,t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.HASH_COMMENT_MODE,y,E,re]},yt={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",ge(W).join("\\b|"),"|",ge(z).join("\\b|"),"\\b)"),o,e.concat(h,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[at]};at.contains.push(yt);let Tt=[De,Te,t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.HASH_COMMENT_MODE,y,E,re],_t={begin:e.concat(/#\[\s*\\?/,e.either(r,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:M,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:M,keyword:["new","array"]},contains:["self",...Tt]},...Tt,{scope:"meta",variants:[{match:r},{match:i}]}]};return{case_insensitive:!1,keywords:ae,contains:[_t,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},a,{scope:"variable.language",match:/\$this\b/},s,yt,Te,{match:[/const/,/\s/,o],scope:{1:"keyword",3:"variable.constant"}},re,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:ae,contains:["self",_t,s,Te,t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.HASH_COMMENT_MODE,y,E]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},y,E]}}function sE(t){let e=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),o=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","lazy","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:o,built_in:["__import__","abs","aiter","all","anext","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozendict","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","sentinel","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},l={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},d={begin:/\{\{/,relevance:0},u={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,c,d,l]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,c,d,l]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,d,l]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,d,l]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},m="[0-9](_?[0-9])*",h=`(\\b(${m}))?\\.(${m})|\\b(${m})\\.`,y=`\\b|${o.join("|")}`,E={className:"number",relevance:0,variants:[{begin:`(\\b(${m})|(${h}))[eE][+-]?(${m})[jJ]?(?=${y})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${y})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${y})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${y})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${y})`},{begin:`\\b(${m})[jJ](?=${y})`}]},M={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},W={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",c,E,u,t.HASH_COMMENT_MODE]}]};return l.contains=[u,E,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[c,E,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},u,M,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[W]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[E,W,u]}]}}var Od="[A-Za-z$_][0-9A-Za-z$_]*",aE=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],cE=["true","false","null","undefined","NaN","Infinity"],lE=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],dE=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],uE=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],pE=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],fE=[].concat(uE,lE,dE);function bN(t){let e=t.regex,n=(B,{after:I})=>{let K="</"+B[0].slice(1);return B.input.indexOf(K,I)!==-1},o=Od,r={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(B,I)=>{let K=B[0].length+B.index,we=B.input[K];if(we==="<"||we===","){I.ignoreMatch();return}we===">"&&(n(B,{after:K})||I.ignoreMatch());let Ye,Ot=B.input.substring(K);if(Ye=Ot.match(/^\s*=/)){I.ignoreMatch();return}if((Ye=Ot.match(/^\s+extends\s+/))&&Ye.index===0){I.ignoreMatch();return}}},a={$pattern:Od,keyword:aE,literal:cE,built_in:fE,"variable.language":pE},c="[0-9](_?[0-9])*",l=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",u={className:"number",variants:[{begin:`(\\b(${d})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},y={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},M={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,m]},z={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:o+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},me=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,y,E,M,{match:/\$\d+/},u];m.contains=me.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(me)});let ae=[].concat(z,m.contains),ge=ae.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(ae)}]),re={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:ge},We={variants:[{match:[/class/,/\s+/,o,/\s+/,/extends/,/\s+/,e.concat(o,"(",e.concat(/\./,o),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,o],scope:{1:"keyword",3:"title.class"}}]},Te={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...lE,...dE]}},De={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},at={variants:[{match:[/function/,/\s+/,o,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[re],illegal:/%/},yt={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Tt(B){return e.concat("(?!",B.join("|"),")")}let _t={match:e.concat(/\b/,Tt([...uE,"super","import","await"].map(B=>`${B}\\s*\\(`)),o,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},qe={begin:e.concat(/\./,e.lookahead(e.concat(o,/(?![0-9A-Za-z$_(])/))),end:o,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},pe={match:[/get|set/,/\s+/,o,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},re]},S="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",q={match:[/const|var|let/,/\s+/,o,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(S)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[re]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:ge,CLASS_REFERENCE:Te},illegal:/#(?![$_A-Za-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),De,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,y,E,M,z,{match:/\$\d+/},u,Te,{scope:"attr",match:o+e.lookahead(":"),relevance:0},q,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[z,t.REGEXP_MODE,{className:"function",begin:S,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:ge}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:i},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},at,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[re,t.inherit(t.TITLE_MODE,{begin:o,className:"title.function"})]},{match:/\.\.\./,relevance:0},qe,{match:"\\$"+o,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[re]},_t,yt,We,pe,{match:/\$[(.]/}]}}function mE(t){let e=t.regex,n=bN(t),o=Od,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},a={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],l={$pattern:Od,keyword:aE.concat(c),literal:cE,built_in:fE.concat(r),"variable.language":pE},d={className:"meta",begin:"@"+o},u=(E,M,W)=>{let z=E.contains.findIndex(me=>me.label===M);if(z===-1)throw new Error("can not find mode to replace");E.contains.splice(z,1,W)};Object.assign(n.keywords,l),n.exports.PARAMS_CONTAINS.push(d);let m=n.contains.find(E=>E.scope==="attr"),h=Object.assign({},m,{match:e.concat(o,e.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,m,h]),n.contains=n.contains.concat([d,i,s,h]),u(n,"shebang",t.SHEBANG()),u(n,"use_strict",a);let y=n.contains.find(E=>E.label==="func.def");return y.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function hE(t){let e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),o=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(i,{begin:/\(/,end:/\)/}),a=t.inherit(t.APOS_STRING_MODE,{className:"string"}),c=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:o,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,c,a,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,s,c,a]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:"css"}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:"javascript"}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(n,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:l}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function gE(t){let e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",o={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,r]},a=t.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),m={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},y={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},E={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},M=[o,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},m,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},y,E,i,s],W=[...M];return W.pop(),W.push(a),h.contains=W,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:M}}function Wm(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var vi=Wm();function ME(t){vi=t}var gi={exec:()=>null};function ys(t){let e=[];return n=>{let o=Math.max(0,Math.min(3,n-1)),r=e[o];return r||(r=t(o),e[o]=r),r}}function Se(t,e=""){let n=typeof t=="string"?t:t.source,o={replace:(r,i)=>{let s=typeof i=="string"?i:i.source;return s=s.replace(cn.caret,"$1"),n=n.replace(r,s),o},getRegex:()=>new RegExp(n,e)};return o}var EN=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),cn={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ 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,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,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,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:ys(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:ys(t=>new RegExp(`^ {0,${t}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:ys(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:ys(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:ys(t=>new RegExp(`^ {0,${t}}(?:</?(?:${Ha})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:ys(t=>new RegExp(`^ {0,${t}}>`))},xN=/^(?:[ \t]*(?:\n|$))+/,CN=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,wN=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ja=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,SN=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,qm=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,IE=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,DE=Se(IE).replace(/bull/g,qm).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}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),TN=Se(IE).replace(/bull/g,qm).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}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ym=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,MN=/^[^\n]+/,Zm=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,IN=Se(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Zm).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),DN=Se(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,qm).getRegex(),Ha="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",Km=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,kN=Se("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Km).replace("tag",Ha).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),kE=t=>Se(Ym).replace("hr",ja).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",t).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ha).getRegex(),NN=kE(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),ON=kE(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),AN=Se(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ON).getRegex(),Qm={blockquote:AN,code:CN,def:IN,fences:wN,heading:SN,hr:ja,html:kN,lheading:DE,list:DN,newline:xN,paragraph:NN,table:gi,text:MN},yE=Se("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ja).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ha).getRegex(),RN=Q(V({},Qm),{lheading:TN,table:yE,paragraph:Se(Ym).replace("hr",ja).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",yE).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ha).getRegex()}),PN=Q(V({},Qm),{html:Se(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Km).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:gi,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Se(Ym).replace("hr",ja).replace("heading",` *#{1,6} *[^
19
- ]`).replace("lheading",DE).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),LN=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,FN=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,NE=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,VN=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,nr=/[\p{P}\p{S}]/u,vs=/[\s\p{P}\p{S}]/u,Ba=/[^\s\p{P}\p{S}]/u,$N=Se(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,vs).getRegex(),jN=/[\p{Pi}\p{Ps}"']/u,OE=/(?!~)[\p{P}\p{S}]/u,HN=/(?!~)[\s\p{P}\p{S}]/u,BN=/(?:[^\s\p{P}\p{S}]|~)/u,UN=Se(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",EN?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),AE=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,zN=Se(AE,"u").replace(/punct/g,nr).getRegex(),GN=Se(AE,"u").replace(/punct/g,OE).getRegex(),WN=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,qN=Se(WN,"u").replace(/openQuote/g,jN).replace(/punct/g,nr).getRegex(),RE="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",YN=Se(RE,"gu").replace(/notPunctSpace/g,Ba).replace(/punctSpace/g,vs).replace(/punct/g,nr).getRegex(),ZN=Se(RE,"gu").replace(/notPunctSpace/g,BN).replace(/punctSpace/g,HN).replace(/punct/g,OE).getRegex(),KN="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",QN=Se(KN,"gu").replace(/notPunctSpace/g,Ba).replace(/punctSpace/g,vs).replace(/punct/g,nr).getRegex(),XN=Se("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ba).replace(/punctSpace/g,vs).replace(/punct/g,nr).getRegex(),JN="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",eO=Se(JN,"gu").replace(/notPunctSpace/g,Ba).replace(/punctSpace/g,vs).replace(/punct/g,nr).getRegex(),tO=Se(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,nr).getRegex(),nO="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",oO=Se(nO,"gu").replace(/notPunctSpace/g,Ba).replace(/punctSpace/g,vs).replace(/punct/g,nr).getRegex(),rO=Se(/\\(punct)/,"gu").replace(/punct/g,nr).getRegex(),iO=Se(/^<(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(),sO=Se(Km).replace("(?:-->|$)","-->").getRegex(),aO=Se("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",sO).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),PE=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Rd=Se(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",PE).getRegex(),cO=Se(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Rd).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),lO=Se(/^!?\[(label)\]\[(ref)\]/).replace("label",Rd).replace("ref",Zm).getRegex(),dO=Se(/^!?\[(ref)\](?:\[\])?/).replace("ref",Zm).getRegex(),vE=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,uO=Se(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",PE).getRegex(),pO=Se("reflink|nolink(?!\\()","g").replace("reflink",Se(/^!?\[(label)\]\[(ref)\]/).replace("label",uO).replace("ref",vE).getRegex()).replace("nolink",Se(/^!?\[(ref)\](?:\[\])?/).replace("ref",vE).getRegex()).getRegex(),_E=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,fO=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,mO=Se(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,fO).getRegex(),Xm={_backpedal:gi,anyPunctuation:rO,autolink:iO,blockSkip:UN,br:NE,code:FN,del:gi,delLDelim:gi,delRDelim:gi,emStrongLDelim:zN,emStrongRDelimAst:YN,emStrongRDelimUnd:XN,escape:LN,link:cO,nolink:dO,punctuation:$N,reflink:lO,reflinkSearch:pO,tag:aO,text:VN,url:gi},hO=Q(V({},Xm),{emStrongLDelim:qN,emStrongRDelimAst:QN,emStrongRDelimUnd:eO,link:Se(/^!?\[(label)\]\((.*?)\)/).replace("label",Rd).getRegex(),reflink:Se(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Rd).getRegex()}),Um=Q(V({},Xm),{emStrongRDelimAst:ZN,emStrongLDelim:GN,delLDelim:tO,delRDelim:oO,url:Se(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",mO).replace("protocol",_E).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Se(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",_E).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()}),gO=Q(V({},Um),{br:Se(NE).replace("{2,}","*").getRegex(),text:Se(Um.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),Ad={normal:Qm,gfm:RN,pedantic:PN},Va={normal:Xm,gfm:Um,breaks:gO,pedantic:hO},yO={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},bE=t=>yO[t];function $n(t,e){if(e){if(cn.escapeTest.test(t))return t.replace(cn.escapeReplace,bE)}else if(cn.escapeTestNoEncode.test(t))return t.replace(cn.escapeReplaceNoEncode,bE);return t}function vO(t){return t.replace(cn.numericCharacterReference,(e,n,o)=>{let r=n===void 0?Number.parseInt(o,16):Number.parseInt(n,10);return r===0||r>1114111||r>=55296&&r<=57343?"\uFFFD":String.fromCodePoint(r)})}function EE(t){try{t=encodeURI(t).replace(cn.percentDecode,"%")}catch{return null}return t}function xE(t,e){let n=t.replace(cn.findPipe,(i,s,a)=>{let c=!1,l=s;for(;--l>=0&&a[l]==="\\";)c=!c;return c?"|":" |"}),o=n.split(cn.splitPipe),r=0;if(o[0].trim()||o.shift(),o.length>0&&!o.at(-1)?.trim()&&o.pop(),e)if(o.length>e)o.splice(e);else for(;o.length<e;)o.push("");for(;r<o.length;r++)o[r]=o[r].trim().replace(cn.slashPipe,"|");return o}function Sr(t,e,n){let o=t.length;if(o===0)return"";let r=0;for(;r<o;){let i=t.charAt(o-r-1);if(i===e&&!n)r++;else if(i!==e&&n)r++;else break}return t.slice(0,o-r)}function CE(t){let e=t.split(`
20
- `),n=e.length-1;for(;n>=0&&cn.blankLine.test(e[n]);)n--;return e.length-n<=2?t:e.slice(0,n+1).join(`
21
- `)}function Pd(t){return t.trim().toLowerCase().toUpperCase().toLowerCase()}function _O(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let o=0;o<t.length;o++)if(t[o]==="\\")o++;else if(t[o]===e[0])n++;else if(t[o]===e[1]&&(n--,n<0))return o;return n>0?-2:-1}function wE(t,e=0){let n=e,o="";for(let r of t)if(r===" "){let i=4-n%4;o+=" ".repeat(i),n+=i}else o+=r,n++;return o}function SE(t,e,n,o,r){let i=e.href,s=e.title||null,a=t[1].replace(r.other.outputLinkReplace,"$1"),c=t[0].charAt(0)==="!";o.state.inLink=!0;let l=o.state.linkEmitted,d=o.state.inRawBlock;o.state.linkEmitted=!1;let u=o.inlineTokens(a),m=o.state.linkEmitted;if(o.state.linkEmitted=l,o.state.inLink=!1,!c){if(m){o.state.inRawBlock=d;return}o.state.linkEmitted=!0}return{type:c?"image":"link",raw:n,href:i,title:s,text:a,tokens:u}}function bO(t,e,n){let o=t.match(n.other.indentCodeCompensation);if(o===null)return e;let r=o[1];return e.split(`
22
- `).map(i=>{let s=i.match(n.other.beginningSpace);if(s===null)return i;let[a]=s;return i.slice(Math.min(a.length,r.length))}).join(`
23
- `)}function TE(t,e,n,o){if(!e.includes("<"))return!1;for(let r=0;r<e.length;r++){if(e[r]==="\\"){r++;continue}if(e[r]==="`"){let a=o.inline.code.exec(e.slice(r));if(a){r+=a[0].length-1;continue}}if(e[r]!=="<")continue;let i=t.slice(n+r),s=o.inline.tag.exec(i)||o.inline.autolink.exec(i);if(s){if(s[0].length>e.length-r)return!0;r+=s[0].length-1}}return!1}var Ld=class{options;rules;lexer;constructor(t){this.options=t||vi}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=this.options.pedantic?e[0]:CE(e[0]),o=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:o}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],o=bO(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:o}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let o=Sr(n,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceTabChar.test(o))&&(n=o.trim())}return{type:"heading",raw:Sr(e[0],`
24
- `),depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Sr(e[0],`
25
- `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=Sr(e[0],`
26
- `).split(`
27
- `),o="",r="",i=[];for(;n.length>0;){let s=!1,a=[],c;for(c=0;c<n.length;c++)if(this.rules.other.blockquoteStart.test(n[c]))a.push(n[c]),s=!0;else if(!s)a.push(n[c]);else break;n=n.slice(c);let l=a.join(`
28
- `),d=l.replace(this.rules.other.blockquoteSetextReplace,`
29
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
30
- ${l}`:l,r=r?`${r}
31
- ${d}`:d;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,i,!0),this.lexer.state.top=u,n.length===0)break;let m=i.at(-1);if(m?.type==="code")break;if(m?.type==="blockquote"){let h=m,y=n.join(`
32
- `),E=h.raw+`
33
- `+y.replace(this.rules.other.blockquoteSetextReplace2,""),M=this.blockquote(E);i[i.length-1]=M;let W=E.substring(M.raw.length).replace(/^\n/,""),z=W?W.split(`
34
- `).length:0,me=z?n.slice(0,-z):n;me.length>0&&(o=`${o}
35
- ${me.join(`
36
- `)}`),r=r.substring(0,r.length-h.text.length)+M.text;break}else if(m?.type==="list"){let h=m,y=h.raw+`
37
- `+n.join(`
38
- `),E=this.list(y);i[i.length-1]=E,o=o.substring(0,o.length-m.raw.length)+E.raw,r=r.substring(0,r.length-h.raw.length)+E.raw,n=y.substring(i.at(-1).raw.length).split(`
39
- `);continue}}return{type:"blockquote",raw:o,tokens:i,text:r}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),o=n.length>1,r={type:"list",raw:"",ordered:o,start:o?+n.slice(0,-1):"",loose:!1,items:[]};n=o?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=o?n:"[*+-]");let i=this.rules.other.listItemRegex(n),s=!1;for(;t;){let c=!1,l="",d="";if(!(e=i.exec(t))||this.rules.block.hr.test(t))break;l=e[0],t=t.substring(l.length);let u=e[2].split(`
40
- `,1)[0],m=e[1].length,h=this.options.pedantic?wE(u,m):u.replace(this.rules.other.leadingSpaceTab,W=>wE(W,m)),y=t.split(`
41
- `,1)[0],E=!h.trim(),M=0;if(this.options.pedantic?(M=2,d=h.trimStart()):E?M=m+1:(M=h.search(this.rules.other.nonSpaceChar),M=M>4?1:M,d=h.slice(M),M+=m),E&&this.rules.other.blankLine.test(y)&&(l+=y+`
42
- `,t=t.substring(y.length+1),c=!0),!c){let W=this.rules.other.nextBulletRegex(M),z=this.rules.other.hrRegex(M),me=this.rules.other.fencesBeginRegex(M),ae=this.rules.other.headingBeginRegex(M),ge=this.rules.other.htmlBeginRegex(M),re=this.rules.other.blockquoteBeginRegex(M);for(;t;){let We=t.split(`
43
- `,1)[0],Te;if(y=We,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),Te=y):Te=y.replace(this.rules.other.leadingSpaceTab,De=>De.replace(this.rules.other.tabCharGlobal," ")),me.test(y)||ae.test(y)||ge.test(y)||re.test(y)||W.test(y)||z.test(y))break;if(Te.search(this.rules.other.nonSpaceChar)>=M||!y.trim())d+=`
44
- `+Te.slice(M);else{if(E||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||me.test(h)||ae.test(h)||z.test(h))break;d+=`
45
- `+y}E=!y.trim(),l+=We+`
46
- `,t=t.substring(We.length+1),h=Te.slice(M)}}r.loose||(s?r.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(s=!0)),r.items.push({type:"list_item",raw:l,task:!!this.options.gfm&&this.rules.other.listIsTask.test(d),loose:!1,text:d,tokens:[]}),r.raw+=l}let a=r.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let c of r.items)if(this.lexer.state.top=!1,c.tokens=this.lexer.blockTokens(c.text,[]),!r.loose){let l=c.tokens.filter(u=>u.type==="space"),d=l.length>0&&l.some(u=>this.rules.other.anyLine.test(u.raw));r.loose=d}for(let c of r.items){let l=c.tokens[0];if(c.task&&(l?.type==="text"||l?.type==="paragraph")){c.text=c.text.replace(this.rules.other.listReplaceTask,""),l.raw=l.raw.replace(this.rules.other.listReplaceTask,""),l.text=l.text.replace(this.rules.other.listReplaceTask,"");for(let u=this.lexer.inlineQueue.length-1;u>=0;u--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[u].src)){this.lexer.inlineQueue[u].src=this.lexer.inlineQueue[u].src.replace(this.rules.other.listReplaceTask,"");break}let d=this.rules.other.listTaskCheckbox.exec(c.raw);if(d){let u={type:"checkbox",raw:d[0]+" ",checked:d[0]!=="[ ]"};c.checked=u.checked,r.loose?c.tokens[0]&&["paragraph","text"].includes(c.tokens[0].type)&&"tokens"in c.tokens[0]&&c.tokens[0].tokens?(c.tokens[0].raw=u.raw+c.tokens[0].raw,c.tokens[0].text=u.raw+c.tokens[0].text,c.tokens[0].tokens.unshift(u)):c.tokens.unshift({type:"paragraph",raw:u.raw,text:u.raw,tokens:[u]}):c.tokens.unshift(u)}}else c.task&&(c.task=!1)}if(r.loose)for(let c of r.items){c.loose=!0;for(let l of c.tokens)l.type==="text"&&(l.type="paragraph")}return r}}html(t){let e=this.rules.block.html.exec(t);if(e){let n=CE(e[0]);return{type:"html",block:!0,raw:n,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:n}}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=Pd(e[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:Sr(e[0],`
47
- `),href:o,title:r}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=xE(e[1]),o=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
48
- `):[],i={type:"table",raw:Sr(e[0],`
49
- `),header:[],align:[],rows:[]};if(n.length===o.length){for(let s of o)this.rules.other.tableAlignRight.test(s)?i.align.push("right"):this.rules.other.tableAlignCenter.test(s)?i.align.push("center"):this.rules.other.tableAlignLeft.test(s)?i.align.push("left"):i.align.push(null);for(let s=0;s<n.length;s++)i.header.push({text:n[s],tokens:this.lexer.inline(n[s]),header:!0,align:i.align[s]});for(let s of r)i.rows.push(xE(s,i.header.length).map((a,c)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:i.align[c]})));return i}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:Sr(e[0],`
50
- `),depth:e[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
51
- `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&TE(t,e[1],n,this.rules))return;let o=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(o)){if(!this.rules.other.endAngleBracket.test(o))return;let s=Sr(o.slice(0,-1),"\\");if((o.length-s.length)%2===0)return}else{let s=_O(e[2],"()");if(s===-2)return;if(s>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let r=e[2],i="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],i=s[3])}else i=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(o)?r=r.slice(1):r=r.slice(1,-1)),SE(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let o=n[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&TE(t,n[1],o,this.rules))return;let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[Pd(r)];if(!i){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return SE(n,i,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let o=this.rules.inline.emStrongLDelim.exec(t);if(!(!o||!o[1]&&!o[2]&&!o[3]&&!o[4]||o[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(o[1]||o[3])||!n||this.rules.inline.punctuation.exec(n))){let r=[...o[0]].length-1,i,s,a=r,c=0,l=o[0][0],d=n===l,u=l==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,e=e.slice(-1*t.length+r);(o=u.exec(e))!==null;){if(i=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!i)continue;if(s=[...i].length,o[3]||o[4]){a+=s;continue}else if(o[5]||o[6]){if(r%3&&!((r+s)%3)){c+=s;continue}if(d)break}if(a-=s,a>0)continue;s=Math.min(s,s+a+c);let m=[...o[0]][0].length,h=t.slice(0,r+o.index+m+s);if(Math.min(r,s)%2){let E=h.slice(1,-1);return{type:"em",raw:h,text:E,tokens:this.lexer.inlineTokens(E)}}let y=h.slice(2,-2);return{type:"strong",raw:h,text:y,tokens:this.lexer.inlineTokens(y)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),o=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return o&&r&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let o=this.rules.inline.delLDelim.exec(t);if(o&&(!o[1]||!n||this.rules.inline.punctuation.exec(n))){let r=[...o[0]].length-1,i,s,a=r,c=this.rules.inline.delRDelim;for(c.lastIndex=0,e=e.slice(-1*t.length+r);(o=c.exec(e))!==null;){if(i=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!i||(s=[...i].length,s!==r))continue;if(o[3]||o[4]){a+=s;continue}if(a-=s,a>0)continue;s=Math.min(s,s+a);let l=[...o[0]][0].length,d=t.slice(0,r+o.index+l+s),u=d.slice(r,-r);return{type:"del",raw:d,text:u,tokens:this.lexer.inlineTokens(u)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,o;return e[2]==="@"?(n=e[1],o="mailto:"+n):(n=e[1],o=n),{type:"link",raw:e[0],text:n,href:o,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,o;if(e[2]==="@")n=e[0],o="mailto:"+n;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);n=e[0],e[1]==="www."?o="http://"+e[0]:o=e[0]}return{type:"link",raw:e[0],text:n,href:o,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:n?e[0]:vO(e[0]),escaped:n}}}},mo=class zm{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||vi,this.options.tokenizer=this.options.tokenizer||new Ld,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let n={other:cn,block:Ad.normal,inline:Va.normal};this.options.pedantic?(n.block=Ad.pedantic,n.inline=Va.pedantic):this.options.gfm&&(n.block=Ad.gfm,this.options.breaks?n.inline=Va.breaks:n.inline=Va.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ad,inline:Va}}static lex(e,n){return new zm(n).lex(e)}static lexInline(e,n){return new zm(n).inlineTokens(e)}lex(e){e=e.replace(cn.carriageReturn,`
52
- `),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let o=this.inlineQueue[n];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],o=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(cn.tabCharGlobal," ").replace(cn.spaceLine,""));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(a=>(i=a.call({lexer:this},e,n))?(e=e.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let a=n.at(-1);i.raw.length===1&&a!==void 0?a.raw+=`
53
- `:n.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
54
- `)?"":`
55
- `)+i.raw,a.text+=`
56
- `+i.text,this.inlineQueue.at(-1).src=a.text):n.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
57
- `)?"":`
58
- `)+i.raw,a.text+=`
59
- `+i.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},n.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),n.push(i);continue}let s=e;if(this.options.extensions?.startBlock){let a=1/0,c=e.slice(1),l;this.options.extensions.startBlock.forEach(d=>{l=d.call({lexer:this},c),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(s=e.substring(0,a+1))}if(this.state.top&&(i=this.tokenizer.paragraph(s))){let a=n.at(-1);o&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
60
- `)?"":`
61
- `)+i.raw,a.text+=`
62
- `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i),o=s.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let a=n.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
63
- `)?"":`
64
- `)+i.raw,a.text+=`
65
- `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}linkInText(e){if(!e.includes("["))return!1;let n=this.tokenizer.rules.inline.link;for(let o of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(n.test(o[0])&&e.charAt(o.index-1)!=="!")return!0;for(let o of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let r=o[0],i=r.lastIndexOf("[");if(!(r.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,Pd(r.slice(i+1,-1))))&&!(i>1&&this.linkInText(r.slice(1,i-1))))return!0}return!1}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let o=e;if(this.tokens.links&&e.includes("[")){let a=this.tokenizer.rules.inline.reflinkSearch,c=l=>{let d=l.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,Pd(l.slice(d+1,-1))))return l;if(d>1&&l.charAt(0)!=="!"){let u=l.slice(1,d-1);if(this.linkInText(u))return"["+u.replace(a,c)+"]["+"a".repeat(l.length-d-2)+"]"}return"["+"a".repeat(l.length-2)+"]"};o=o.replace(a,c)}o=o.replace(this.tokenizer.rules.inline.anyPunctuation,a=>"+".repeat(a.length)),o=o.replace(this.tokenizer.rules.inline.blockSkip,(a,c,l)=>{let d=l?l.length:0;return a.slice(0,d)+"["+"a".repeat(a.length-d-2)+"]"}),o=this.options.hooks?.emStrongMask?.call({lexer:this},o)??o;let r=!1,i="",s=1/0;for(;e;){if(e.length<s)s=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=""),r=!1;let a;if(this.options.extensions?.inline?.some(l=>(a=l.call({lexer:this},e,n))?(e=e.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let l=n.at(-1);a.type==="text"&&l?.type==="text"?(l.raw+=a.raw,l.text+=a.text):n.push(a);continue}if(a=this.tokenizer.emStrong(e,o,i)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.del(e,o,i)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),n.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),n.push(a);continue}let c=e;if(this.options.extensions?.startInline){let l=1/0,d=e.slice(1),u;this.options.extensions.startInline.forEach(m=>{u=m.call({lexer:this},d),typeof u=="number"&&u>=0&&(l=Math.min(l,u))}),l<1/0&&l>=0&&(c=e.substring(0,l+1))}if(a=this.tokenizer.inlineText(c)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(i=a.raw.slice(-1)),r=!0;let l=n.at(-1);l?.type==="text"?(l.raw+=a.raw,l.text+=a.text):n.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}infiniteLoopError(e){let n="Infinite loop on byte: "+e;if(this.options.silent)console.error(n);else throw new Error(n)}},Fd=class{options;parser;constructor(t){this.options=t||vi}space(t){return""}code({text:t,lang:e,escaped:n}){let o=(e||"").match(cn.notSpaceStart)?.[0],r=t?t.replace(cn.endingNewline,"")+`
66
- `:"";return o?'<pre><code class="language-'+$n(o)+'">'+(n?r:$n(r,!0))+`</code></pre>
67
- `:"<pre><code>"+(n?r:$n(r,!0))+`</code></pre>
68
- `}blockquote({tokens:t}){return`<blockquote>
69
- ${this.parser.parse(t)}</blockquote>
70
- `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
71
- `}hr(t){return`<hr>
72
- `}list(t){let e=t.ordered,n=t.start,o="";for(let s=0;s<t.items.length;s++){let a=t.items[s];o+=this.listitem(a)}let r=e?"ol":"ul",i=e&&n!==1?' start="'+n+'"':"";return"<"+r+i+`>
73
- `+o+"</"+r+`>
74
- `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
75
- `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
76
- `}table(t){let e="",n="";for(let r=0;r<t.header.length;r++)n+=this.tablecell(t.header[r]);e+=this.tablerow({text:n});let o="";for(let r=0;r<t.rows.length;r++){let i=t.rows[r];n="";for(let s=0;s<i.length;s++)n+=this.tablecell(i[s]);o+=this.tablerow({text:n})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
77
- <thead>
78
- `+e+`</thead>
79
- `+o+`</table>
80
- `}tablerow({text:t}){return`<tr>
81
- ${t}</tr>
82
- `}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
83
- `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${$n(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,text:n,tokens:o,autolink:r}){let i=r?$n(n,!0):this.parser.parseInline(o),s=EE(t);if(s===null)return i;t=$n(s,r);let a='<a href="'+t+'"';return e&&(a+=' title="'+$n(e)+'"'),a+=">"+i+"</a>",a}image({href:t,title:e,text:n,tokens:o}){o&&(n=this.parser.parseInline(o,this.parser.textRenderer));let r=EE(t);if(r===null)return $n(n);t=r;let i=`<img src="${$n(t)}" alt="${$n(n)}"`;return e&&(i+=` title="${$n(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:$n(t.text)}},Jm=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},ho=class Gm{options;renderer;textRenderer;constructor(e){this.options=e||vi,this.options.renderer=this.options.renderer||new Fd,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Jm}static parse(e,n){return new Gm(n).parse(e)}static parseInline(e,n){return new Gm(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let o=0;o<e.length;o++){let r=e[o];if(this.options.extensions?.renderers?.[r.type]){let s=r,a=this.options.extensions.renderers[s.type].call({parser:this},s);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(s.type)){n+=a||"";continue}}let i=r;switch(i.type){case"space":{n+=this.renderer.space(i);break}case"hr":{n+=this.renderer.hr(i);break}case"heading":{n+=this.renderer.heading(i);break}case"code":{n+=this.renderer.code(i);break}case"table":{n+=this.renderer.table(i);break}case"blockquote":{n+=this.renderer.blockquote(i);break}case"list":{n+=this.renderer.list(i);break}case"checkbox":{n+=this.renderer.checkbox(i);break}case"html":{n+=this.renderer.html(i);break}case"def":{n+=this.renderer.def(i);break}case"paragraph":{n+=this.renderer.paragraph(i);break}case"text":{n+=this.renderer.text(i);break}default:{let s='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}parseInline(e,n=this.renderer){this.renderer.parser=this;let o="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(i.type)){o+=a||"";continue}}let s=i;switch(s.type){case"escape":{o+=n.text(s);break}case"html":{o+=n.html(s);break}case"link":{o+=n.link(s);break}case"image":{o+=n.image(s);break}case"checkbox":{o+=n.checkbox(s);break}case"strong":{o+=n.strong(s);break}case"em":{o+=n.em(s);break}case"codespan":{o+=n.codespan(s);break}case"br":{o+=n.br(s);break}case"del":{o+=n.del(s);break}case"text":{o+=n.text(s);break}default:{let a='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return o}},$a=class{options;block;constructor(t){this.options=t||vi}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?mo.lex:mo.lexInline}provideParser(t=this.block){return t?ho.parse:ho.parseInline}},Vd=class{defaults=Wm();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ho;Renderer=Fd;TextRenderer=Jm;Lexer=mo;Tokenizer=Ld;Hooks=$a;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let o of t)switch(n=n.concat(e.call(this,o)),o.type){case"table":{let r=o;for(let i of r.header)n=n.concat(this.walkTokens(i.tokens,e));for(let i of r.rows)for(let s of i)n=n.concat(this.walkTokens(s.tokens,e));break}case"list":{let r=o;n=n.concat(this.walkTokens(r.items,e));break}default:{let r=o;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(i=>{let s=r[i].flat(1/0);n=n.concat(this.walkTokens(s,e))}):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let o=V({},n);if(o.async=this.defaults.async||o.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let i=e.renderers[r.name];i?e.renderers[r.name]=function(...s){let a=r.renderer.apply(this,s);return a===!1&&(a=i.apply(this,s)),a}:e.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 i=e[r.level];i?i.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),o.extensions=e),n.renderer){let r=this.defaults.renderer||new Fd(this.defaults);for(let i in n.renderer){if(!(i in r))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let s=i,a=n.renderer[s],c=r[s];r[s]=(...l)=>{let d=a.apply(r,l);return d===!1&&(d=c.apply(r,l)),d||""}}o.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new Ld(this.defaults);for(let i in n.tokenizer){if(!(i in r))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let s=i,a=n.tokenizer[s],c=r[s];r[s]=(...l)=>{let d=a.apply(r,l);return d===!1&&(d=c.apply(r,l)),d}}o.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new $a;for(let i in n.hooks){if(!(i in r))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let s=i,a=n.hooks[s],c=r[s];$a.passThroughHooks.has(i)?r[s]=l=>{if(this.defaults.async&&$a.passThroughHooksRespectAsync.has(i))return(async()=>{let u=await a.call(r,l);return c.call(r,u)})();let d=a.call(r,l);return c.call(r,d)}:r[s]=(...l)=>{if(this.defaults.async)return(async()=>{let u=await a.apply(r,l);return u===!1&&(u=await c.apply(r,l)),u})();let d=a.apply(r,l);return d===!1&&(d=c.apply(r,l)),d}}o.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,i=n.walkTokens;o.walkTokens=function(s){let a=[];return a.push(i.call(this,s)),r&&(a=a.concat(r.call(this,s))),a}}this.defaults=V(V({},this.defaults),o)}),this}setOptions(t){return this.defaults=V(V({},this.defaults),t),this}lexer(t,e){return mo.lex(t,e??this.defaults)}parser(t,e){return ho.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let o=V({},n),r=V(V({},this.defaults),o),i=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&o.async===!1)return i(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 e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=t),r.async)return(async()=>{let s=r.hooks?await r.hooks.preprocess(e):e,a=await(r.hooks?await r.hooks.provideLexer(t):t?mo.lex:mo.lexInline)(s,r),c=r.hooks?await r.hooks.processAllTokens(a):a;r.walkTokens&&await Promise.all(this.walkTokens(c,r.walkTokens));let l=await(r.hooks?await r.hooks.provideParser(t):t?ho.parse:ho.parseInline)(c,r);return r.hooks?await r.hooks.postprocess(l):l})().catch(i);try{r.hooks&&(e=r.hooks.preprocess(e));let s=(r.hooks?r.hooks.provideLexer(t):t?mo.lex:mo.lexInline)(e,r);r.hooks&&(s=r.hooks.processAllTokens(s)),r.walkTokens&&this.walkTokens(s,r.walkTokens);let a=(r.hooks?r.hooks.provideParser(t):t?ho.parse:ho.parseInline)(s,r);return r.hooks&&(a=r.hooks.postprocess(a)),a}catch(s){return i(s)}}}onError(t,e){return n=>{if(n.message+=`
84
- Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error occurred:</p><pre>"+$n(n.message+"",!0)+"</pre>";return e?Promise.resolve(o):o}if(e)return Promise.reject(n);throw n}}},yi=new Vd;function gt(t,e){return yi.parse(t,e)}gt.options=gt.setOptions=function(t){return yi.setOptions(t),gt.defaults=yi.defaults,ME(gt.defaults),gt};gt.getDefaults=Wm;gt.defaults=vi;function EO(...t){return yi.use(...t),gt.defaults=yi.defaults,ME(gt.defaults),gt}gt.use=EO;gt.walkTokens=function(t,e){return yi.walkTokens(t,e)};gt.parseInline=yi.parseInline;gt.Parser=ho;gt.parser=ho.parse;gt.Renderer=Fd;gt.TextRenderer=Jm;gt.Lexer=mo;gt.lexer=mo.lex;gt.Tokenizer=Ld;gt.Hooks=$a;gt.parse=gt;var LG=gt.options,FG=gt.setOptions,VG=gt.walkTokens,$G=gt.parseInline;var jG=ho.parse,HG=mo.lex;for(let[t,e]of Object.entries({bash:Y0,css:Z0,diff:K0,go:Q0,javascript:nE,json:oE,markdown:rE,php:iE,python:sE,typescript:mE,xml:hE,yaml:gE}))Nd.registerLanguage(t,e);var xO={sh:"bash",shell:"bash",zsh:"bash",js:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",html:"xml",svg:"xml",md:"markdown",yml:"yaml"};function LE(){return{code({text:t,lang:e}){let n=(e??"").trim().toLowerCase(),o=xO[n]??n,i=o.length>0&&Nd.getLanguage(o)!==void 0?Nd.highlight(t,{language:o,ignoreIllegals:!0}).value:MO(t);return`<div class="code"><div class="code-head"><span class="code-lang">${o.length>0?o:"text"}</span><button type="button" class="copy" data-copy>Copy</button></div><pre><code class="hljs">${i}</code></pre></div>`},link({href:t,title:e,tokens:n}){let o=this.parser.parseInline(n),r=t.replace(/"/g,"&quot;"),i=e?` title="${e.replace(/"/g,"&quot;")}"`:"";return`<a href="${r}"${i} target="_blank" rel="noreferrer noopener">${o}</a>`}}}var FE=new Vd({gfm:!0,breaks:!1});FE.use({renderer:LE()});var VE=new Vd({gfm:!0,breaks:!0});VE.use({renderer:LE()});var CO=new Map,wO=new Map,SO=200;function TO(t){return T0.sanitize(t,{USE_PROFILES:{html:!0},FORBID_TAGS:["style","form","input","iframe"],ADD_ATTR:["target","rel","data-copy","data-mention-path","data-mention-start","data-mention-end"]})}function $E(t,e,n){let o=t.get(n);if(o!==void 0)return o;let r=TO(e.parse(n,{async:!1}));if(t.size>=SO){let i=t.keys().next().value;i!==void 0&&t.delete(i)}return t.set(n,r),r}function jE(t){return $E(CO,FE,t)}function HE(t){return $E(wO,VE,t)}function MO(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}var $d=class t{text=le.required();variant=le("assistant");mention=bt();sanitizer=O(em);html=T(()=>this.sanitizer.bypassSecurityTrustHtml(this.variant()==="user"?HE(this.text()):jE(this.text())));onClick(e){let n=e.target,o=n?.closest("[data-mention-path]")?.getAttribute("data-mention-path");if(o){this.mention.emit(o);return}let r=n?.closest("button[data-copy]");if(!(r instanceof HTMLButtonElement))return;let s=r.closest(".code")?.querySelector("code")?.textContent??"";navigator.clipboard?.writeText(s);let a=r.textContent;r.textContent="Copied",setTimeout(()=>{r.textContent=a??"Copy"},1200)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Le({type:t,selectors:[["morse-markdown"]],inputs:{text:[1,"text"],variant:[1,"variant"]},outputs:{mention:"mention"},decls:1,vars:1,consts:[[1,"md",3,"click","innerHTML"]],template:function(n,o){n&1&&(C(0,"div",0),ee("click",function(i){return o.onClick(i)}),w()),n&2&&et("innerHTML",o.html(),yf)},styles:["[_nghost-%COMP%]{display:block}"]})};var IO=["list"],DO=(t,e)=>e.key;function kO(t,e){t&1&&Ke(0,"span",4)}function NO(t,e){if(t&1&&g(0),t&2){let n=v();pt(" ",n.state()==="error"?"\u2717":"\u2713"," ")}}function OO(t,e){t&1&&(_(0,"span",5),Ke(1,"i")(2,"i")(3,"i"),b())}function AO(t,e){t&1&&Ke(0,"span",4)}function RO(t,e){t&1&&(_(0,"span",14),g(1,"\u2717"),b())}function PO(t,e){t&1&&(_(0,"span",15),g(1,"\u2713"),b())}function LO(t,e){if(t&1&&(_(0,"span",25),g(1),b()),t&2){let n=v();f(),pt("+",n.added)}}function FO(t,e){if(t&1&&(_(0,"span",26),g(1),b()),t&2){let n=v();f(),pt("\u2212",n.removed)}}function VO(t,e){if(t&1&&(_(0,"span",21),A(1,LO,2,1,"span",25),A(2,FO,2,1,"span",26),b()),t&2){let n=e;f(),R(n.added>0?1:-1),f(),R(n.removed>0?2:-1)}}function $O(t,e){t&1&&(_(0,"span",5),Ke(1,"i")(2,"i")(3,"i"),b())}function jO(t,e){t&1&&(_(0,"span",23),g(1),b()),t&2&&(f(),$(e))}function HO(t,e){if(t&1&&(_(0,"span",27),g(1,"input"),b(),_(2,"pre"),g(3),b()),t&2){let n=v(3).$implicit;f(3),$(n.item.input)}}function BO(t,e){if(t&1&&(_(0,"span",27),g(1,"output"),b(),_(2,"pre"),g(3),b()),t&2){let n=v(3).$implicit;f(3),$(n.item.output)}}function UO(t,e){t&1&&(_(0,"span",27),g(1,"no details reported"),b())}function zO(t,e){if(t&1&&(_(0,"div",24),A(1,HO,4,1),A(2,BO,4,1),A(3,UO,2,0,"span",27),b()),t&2){let n=v(2).$implicit;He("data-body",n.key),f(),R(n.item.input?1:-1),f(),R(n.item.output?2:-1),f(),R(!n.item.input&&!n.item.output?3:-1)}}function GO(t,e){if(t&1){let n=Y();_(0,"div",11)(1,"button",12),U("click",function(){D(n);let r=v().$implicit,i=v();return k(i.toggleStep(r.key))}),_(2,"span",13),A(3,AO,1,0,"span",4)(4,RO,2,0,"span",14)(5,PO,2,0,"span",15),b(),_(6,"span",16),g(7),b(),_(8,"span",17),g(9),b(),_(10,"span",18)(11,"span",19),g(12),b(),_(13,"span",20),g(14),b()(),A(15,VO,3,2,"span",21),Ke(16,"span",22),A(17,$O,4,0,"span",5),A(18,jO,2,1,"span",23),_(19,"span",6),g(20,"\u203A"),b()(),A(21,zO,4,4,"div",24),b()}if(t&2){let n,o,r=v().$implicit,i=v();Be("running",r.item.status==="running")("failed",r.item.status==="error"),f(),He("aria-expanded",i.isStepOpen(r.key)),f(),Zo(r.item.status),f(),R(r.item.status==="running"?3:r.item.status==="error"?4:5),f(3),Zo(i.glyphClass(r.item)),f(),$(i.glyph(r.item)),f(2),$(r.item.name),f(),X("title",r.item.title),f(2),$(i.target(r.item).dir),f(2),$(i.target(r.item).base),f(),R((n=i.diff(r.item))?15:-1,n),f(2),R(r.item.status==="running"?17:-1),f(),R((o=i.elapsed(r.item))?18:-1,o),f(),Be("open",i.isStepOpen(r.key)),f(2),R(i.isStepOpen(r.key)?21:-1)}}function WO(t,e){if(t&1&&(_(0,"div",24)(1,"pre"),g(2),b()()),t&2){let n=v(2).$implicit;He("data-body",n.key),f(2),$(n.item.thinking)}}function qO(t,e){if(t&1){let n=Y();_(0,"div",10)(1,"button",12),U("click",function(){D(n);let r=v().$implicit,i=v();return k(i.toggleStep(r.key))}),_(2,"span",13)(3,"span",28),g(4,"\u273B"),b()(),_(5,"span",29),g(6,"thinking"),b(),_(7,"span",30),g(8),b(),_(9,"span",6),g(10,"\u203A"),b()(),A(11,WO,3,2,"div",24),b()}if(t&2){let n=v().$implicit,o=v();f(),He("aria-expanded",o.isStepOpen(n.key)),f(7),$(o.preview(n.item.thinking)),f(),Be("open",o.isStepOpen(n.key)),f(2),R(o.isStepOpen(n.key)?11:-1)}}function YO(t,e){if(t&1&&(_(0,"li",8),A(1,GO,22,21,"div",9)(2,qO,12,5,"div",10),b()),t&2){let n,o=e.$implicit,r=e.$index;X("morseEnter",r)("morseEnterY",6),f(),R((n=o.kind)==="tool"?1:n==="thinking"?2:-1)}}var Hd=class t{steps=le.required();working=le(!1);animation=O(pn);host=O(Gt);list=St("list");openSteps=H({});override=H(null);tick=H(0);tools=T(()=>this.steps().filter(e=>e.kind==="tool"));thoughts=T(()=>this.steps().filter(e=>e.kind==="thinking").length);running=T(()=>this.tools().some(e=>e.item.status==="running"));failed=T(()=>this.tools().some(e=>e.item.status==="error"));autoOpen=T(()=>this.working()||this.running());isOpen=T(()=>this.override()??this.autoOpen());state=T(()=>this.running()?"running":this.failed()?"error":"ok");summary=T(()=>{let e=this.tools().length,n=this.thoughts(),o=e===1?"action":"actions",r=n>0?` \xB7 ${n} ${n===1?"thought":"thoughts"}`:"",i=this.totalMs();return this.running()?i>0?`Working for ${jd(i)} \xB7 ${e} ${o}${r}`:`Working\u2026 \xB7 ${e} ${o}${r}`:i>0?`Worked for ${jd(i)} \xB7 ${e} ${o}${r}`:`${e} ${o}${r}`});constructor(){ke(n=>{if(!this.running())return;let o=setInterval(()=>this.tick.update(r=>r+1),500);n(()=>clearInterval(o))}),ke(()=>{this.autoOpen(),this.override.set(null)});let e=!1;ke(n=>{let o=this.isOpen(),r=e;e=!0;let i=setTimeout(()=>{this.animation.reveal(this.list()?.nativeElement??null,o,{animate:r})},0);n(()=>clearTimeout(i))})}toggle(){this.override.set(!this.isOpen())}toggleStep(e){let n=!this.isStepOpen(e);this.openSteps.update(o=>Q(V({},o),{[e]:n})),setTimeout(()=>{let o=this.host.nativeElement.querySelector(`[data-body="${CSS.escape(e)}"]`);o&&this.animation.reveal(o,n,{animate:!0})},0)}isStepOpen(e){return this.openSteps()[e]===!0}preview(e){let n=e.replace(/\s+/g," ").trim();return n.length>160?`${n.slice(0,160)}\u2026`:n}elapsed(e){if(e.status==="running"){this.tick();let n=Date.now()-e.at;return n>0?jd(n):""}return e.durationMs===void 0?"":jd(e.durationMs)}target(e){let n=e.title.startsWith(`${e.name}: `)?e.title.slice(e.name.length+2):e.title,o=n.lastIndexOf("/");return o===-1?{dir:"",base:n}:{dir:n.slice(0,o+1),base:n.slice(o+1)}}diff(e){let n=`${e.title}
85
- ${e.output??""}`,o=/\+(\d+)\s*[-−](\d+)/.exec(n);if(o)return{added:Number(o[1]),removed:Number(o[2])};let r=/(\d+)\s+insertions?\(\+\)/.exec(n)?.[1],i=/(\d+)\s+deletions?\([-−]\)/.exec(n)?.[1];return r===void 0&&i===void 0?null:{added:Number(r??0),removed:Number(i??0)}}glyphClass(e){let n=e.name.toLowerCase();return n.includes("edit")||n.includes("write")||n.includes("patch")?"edit":n.includes("bash")||n.includes("shell")||n.includes("exec")?"shell":n.includes("search")||n.includes("grep")||n.includes("find")?"search":"read"}glyph(e){switch(this.glyphClass(e)){case"edit":return"\u270E";case"shell":return"\u276F";case"search":return"\u2315";default:return"\u2630"}}totalMs(){return this.tools().reduce((e,n)=>n.item.status==="running"?(this.tick(),e+Math.max(0,Date.now()-n.item.at)):e+(n.item.durationMs??0),0)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Le({type:t,selectors:[["morse-tool-group"]],viewQuery:function(n,o){n&1&&Ft(o.list,IO,5),n&2&&Wt()},inputs:{steps:[1,"steps"],working:[1,"working"]},decls:14,vars:8,consts:[["list",""],[1,"group"],["type","button",1,"summary",3,"click"],[1,"state"],[1,"spinner"],[1,"dots"],[1,"chev"],[1,"rows"],[3,"morseEnter","morseEnterY"],[1,"card",3,"running","failed"],[1,"card","thought"],[1,"card"],["type","button",1,"head",3,"click"],[1,"status"],[1,"fail"],[1,"ok"],[1,"glyph"],[1,"chip"],[1,"args",3,"title"],[1,"dir"],[1,"base"],[1,"diff"],[1,"grow"],[1,"meta"],[1,"body"],[1,"add"],[1,"del"],[1,"label-small"],[1,"bulb"],[1,"chip","thought-chip"],[1,"preview"]],template:function(n,o){n&1&&(_(0,"div",1)(1,"button",2),U("click",function(){return o.toggle()}),_(2,"span",3),A(3,kO,1,0,"span",4)(4,NO,1,1),b(),_(5,"span"),g(6),b(),A(7,OO,4,0,"span",5),_(8,"span",6),g(9,"\u203A"),b()(),_(10,"ul",7,0),ze(12,YO,3,3,"li",8,DO),b()()),n&2&&(f(),He("aria-expanded",o.isOpen()),f(),Zo(o.state()),f(),R(o.state()==="running"?3:4),f(3),$(o.summary()),f(),R(o.running()?7:-1),f(),Be("open",o.isOpen()),f(4),Ge(o.steps()))},dependencies:[nn],styles:["[_nghost-%COMP%]{display:block}.summary[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;max-width:100%;padding:2px 8px 2px 4px;margin-left:-4px;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg-muted);font-size:12.5px;cursor:pointer}.summary[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover);color:var(--%NS%morse-fg)}.state[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:14px}.state.ok[_ngcontent-%COMP%]{color:var(--%NS%morse-success)}.state.error[_ngcontent-%COMP%]{color:var(--%NS%morse-error)}.spinner[_ngcontent-%COMP%]{width:11px;height:11px;border-radius:50%;border:1.5px solid var(--%NS%morse-border);border-top-color:var(--%NS%morse-accent);animation:_ngcontent-%COMP%_spin .8s linear infinite}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}.chev[_ngcontent-%COMP%]{display:inline-block;transition:transform .17s cubic-bezier(.2,.7,.3,1)}.chev.open[_ngcontent-%COMP%]{transform:rotate(90deg)}.dots[_ngcontent-%COMP%]{display:inline-flex;gap:2px;color:currentColor}.dots[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{width:3px;height:3px;border-radius:50%;background:currentColor;animation:_ngcontent-%COMP%_dot 1.2s ease-in-out infinite}.dots[_ngcontent-%COMP%] i[_ngcontent-%COMP%]:nth-child(2){animation-delay:.15s}.dots[_ngcontent-%COMP%] i[_ngcontent-%COMP%]:nth-child(3){animation-delay:.3s}@keyframes _ngcontent-%COMP%_dot{0%,60%,to{opacity:.25}30%{opacity:1}}.rows[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:4px;margin:6px 0 0;padding:0;list-style:none;overflow:hidden}.card[_ngcontent-%COMP%]{border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-md);background:color-mix(in srgb,var(--%NS%morse-panel) 55%,transparent);overflow:hidden}.card.running[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--%NS%morse-accent) 55%,var(--%NS%morse-border))}.card.failed[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--%NS%morse-error) 55%,var(--%NS%morse-border))}.head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%;padding:5px 8px;border:0;background:transparent;color:var(--%NS%morse-fg);font-size:12.5px;text-align:left;cursor:pointer}.head[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover)}.status[_ngcontent-%COMP%]{flex:none;display:inline-flex;align-items:center;justify-content:center;width:13px;height:13px}.status[_ngcontent-%COMP%] .ok[_ngcontent-%COMP%]{color:var(--%NS%morse-success);font-size:10px}.status[_ngcontent-%COMP%] .fail[_ngcontent-%COMP%]{color:var(--%NS%morse-error);font-size:11px}.status[_ngcontent-%COMP%] .bulb[_ngcontent-%COMP%]{color:var(--%NS%morse-typename);font-size:11px}.glyph[_ngcontent-%COMP%]{flex:none;width:13px;text-align:center;font-size:12px}.glyph.edit[_ngcontent-%COMP%]{color:var(--%NS%morse-keyword)}.glyph.read[_ngcontent-%COMP%]{color:var(--%NS%morse-number)}.glyph.search[_ngcontent-%COMP%]{color:var(--%NS%morse-typename)}.glyph.shell[_ngcontent-%COMP%]{color:var(--%NS%morse-success)}.chip[_ngcontent-%COMP%]{flex:none;padding:0 5px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);color:var(--%NS%morse-fg-muted);font-family:var(--%NS%morse-font-mono);font-size:11px}.args[_ngcontent-%COMP%]{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--%NS%morse-font-mono);font-size:11.5px}.args[_ngcontent-%COMP%] .dir[_ngcontent-%COMP%]{color:var(--%NS%morse-fg-muted)}.preview[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--%NS%morse-fg-muted);font-size:12px}.diff[_ngcontent-%COMP%]{flex:none;display:inline-flex;gap:4px;font-family:var(--%NS%morse-font-mono);font-size:11.5px}.diff[_ngcontent-%COMP%] .add[_ngcontent-%COMP%]{color:var(--%NS%morse-success)}.diff[_ngcontent-%COMP%] .del[_ngcontent-%COMP%]{color:var(--%NS%morse-error)}.meta[_ngcontent-%COMP%]{flex:none;color:var(--%NS%morse-fg-muted);font-variant-numeric:tabular-nums}.grow[_ngcontent-%COMP%]{flex:1}.body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px;padding:0 10px 8px 30px;overflow:hidden}.body[_ngcontent-%COMP%] .label-small[_ngcontent-%COMP%]{font-size:10px;letter-spacing:.06em;text-transform:uppercase;color:var(--%NS%morse-fg-muted)}.body[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{margin:0;max-height:260px;overflow:auto;padding:8px 10px;border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-panel);font-family:var(--%NS%morse-font-mono);font-size:12px;line-height:1.5;white-space:pre-wrap;word-break:break-word}"]})};function jd(t){if(t<1e3)return`${Math.max(1,Math.round(t))}ms`;let e=t/1e3;return e<60?`${e<10?e.toFixed(1):Math.round(e)}s`:`${Math.floor(e/60)}m ${Math.round(e%60)}s`}var ZO=["track"],KO=["previewList"],GE=(t,e)=>e.id;function QO(t,e){if(t&1&&st(0,"span",10),t&2){let n=e.$implicit,o=e.$index,r=v(2);Io("top",o*r.tickPitch,"px")("width",r.tickWidth(o),"px"),Be("active",n.id===r.activeId()),He("aria-selected",o===r.hovered())("aria-label",n.preview||"Prompt")}}function XO(t,e){if(t&1){let n=Y();C(0,"button",14),ee("mouseenter",function(){let r=D(n).$index,i=v(3);return k(i.hovered.set(r))})("click",function(){let r=D(n).$index,i=v(3);return k(i.choose(r))}),C(1,"span",15),g(2),w()()}if(t&2){let n=e.$implicit,o=e.$index,r=v(3);Be("active",n.id===r.activeId())("hovered",o===r.hovered()),f(2),$(n.preview||"No text")}}function JO(t,e){if(t&1){let n=Y();C(0,"div",11),ee("mouseenter",function(){D(n);let r=v(2);return k(r.onEnter())})("mouseleave",function(){D(n);let r=v(2);return k(r.onLeave())}),C(1,"div",12,1),ze(3,XO,3,5,"button",13,GE),w()()}if(t&2){let n=v(2);f(3),Ge(n.prompts())}}function eA(t,e){if(t&1){let n=Y();C(0,"nav",3),ee("mouseenter",function(){D(n);let r=v();return k(r.onEnter())}),C(1,"button",4),ee("click",function(){D(n);let r=v();return k(r.stepWindow(-1))}),g(2," \u2303 "),w(),C(3,"div",5,0),ee("mousemove",function(r){D(n);let i=v();return k(i.onMove(r))})("mouseleave",function(){D(n);let r=v();return k(r.onLeave())})("click",function(r){D(n);let i=v();return k(i.onTrackClick(r))})("keydown",function(r){D(n);let i=v();return k(i.onKeydown(r))}),C(5,"div",6),ze(6,QO,1,8,"span",7,GE),w()(),C(8,"button",8),ee("click",function(){D(n);let r=v();return k(r.stepWindow(1))}),g(9," \u2304 "),w(),A(10,JO,5,0,"div",9),w()}if(t&2){let n=v();f(),et("disabled",!n.hasMoreAbove()),f(2),Io("height",n.visibleCount()*n.tickPitch,"px")("mask-image",n.mask()),f(2),Io("transform","translateY(-"+n.clampedWindowStart()*n.tickPitch+"px)"),f(),Ge(n.prompts()),f(2),et("disabled",!n.hasMoreBelow()),f(2),R(n.hovered()!==null?10:-1)}}var BE=12,UE=30,zE=18,tA=80,nA=10,oA=14,rA=20,iA=[1,.6,.35,.15],sA=160,Bd=class t{prompts=le.required();activeId=le(null);pick=bt();tickPitch=BE;hovered=H(null);windowStart=H(0);track=St("track");previewList=St("previewList");pointerY=null;direction=0;carouselTimer=null;hideTimer=null;visibleCount=T(()=>Math.min(this.prompts().length,UE));maxWindowStart=T(()=>Math.max(0,this.prompts().length-this.visibleCount()));clampedWindowStart=T(()=>Math.min(this.windowStart(),this.maxWindowStart()));hasMoreAbove=T(()=>this.clampedWindowStart()>0);hasMoreBelow=T(()=>this.clampedWindowStart()+this.visibleCount()<this.prompts().length);activeIndex=T(()=>{let e=this.activeId();return e===null?-1:this.prompts().findIndex(n=>n.id===e)});mask=T(()=>{let e=this.hasMoreAbove(),n=this.hasMoreBelow();return!e&&!n?void 0:`linear-gradient(to bottom, ${e?"transparent, black 14%":"black"}, ${n?"black 86%, transparent":"black"})`});constructor(){ke(()=>{if(this.hovered()!==null)return;let e=this.prompts().length,n=Math.min(e,UE),o=Math.max(0,e-n),r=this.activeIndex()>=0?this.activeIndex():e-1;this.windowStart.set(Math.max(0,Math.min(o,r-Math.floor(n/2))))}),ke(()=>{let e=this.hovered();this.previewList(),e!==null&&setTimeout(()=>this.revealRow(e),0)})}ngOnDestroy(){this.stopCarousel(),this.cancelHide()}tickWidth(e){let n=this.prompts()[e]?.id===this.activeId()?oA:nA,o=this.hovered();if(o===null)return n;let r=iA[Math.abs(e-o)]??0;return Math.round(n+(rA-n)*r)}onEnter(){this.cancelHide()}onMove(e){this.cancelHide(),this.pointerY=e.clientY;let n=this.indexFromPointer(e.clientY);n!==null&&this.hovered.set(n),this.updateCarousel(e.clientY)}onLeave(){this.pointerY=null,this.stopCarousel(),this.scheduleHide()}onTrackClick(e){let n=this.indexFromPointer(e.clientY);n!==null&&this.choose(n)}stepWindow(e){let n=Math.max(1,Math.floor(this.visibleCount()/2)),o=Math.max(0,Math.min(this.maxWindowStart(),this.clampedWindowStart()+e*n));this.windowStart.set(o)}choose(e){let n=this.prompts()[e];n&&(this.pick.emit(n.id),this.stopCarousel(),this.hovered.set(null))}onKeydown(e){let n=this.prompts().length;if(n===0)return;let o=this.hovered()??(this.activeIndex()>=0?this.activeIndex():n-1),r=i=>{let s=Math.max(0,Math.min(n-1,i));this.ensureWindowContains(s),this.hovered.set(s)};switch(e.key){case"ArrowUp":e.preventDefault(),r(o-1);return;case"ArrowDown":e.preventDefault(),r(o+1);return;case"Home":e.preventDefault(),r(0);return;case"End":e.preventDefault(),r(n-1);return;case"Enter":case" ":e.preventDefault(),this.choose(o);return;case"Escape":e.preventDefault(),this.hovered.set(null);return;default:return}}indexFromPointer(e){let n=this.track()?.nativeElement,o=this.visibleCount();if(!n||o===0)return null;let r=n.getBoundingClientRect(),i=Math.floor((e-r.top)/BE),s=Math.max(0,Math.min(o-1,i));return Math.min(this.prompts().length-1,this.clampedWindowStart()+s)}updateCarousel(e){let n=this.track()?.nativeElement;if(!n)return;let o=n.getBoundingClientRect(),r=e-o.top,i=0;if(r<=zE&&this.hasMoreAbove()?i=-1:r>=o.height-zE&&this.hasMoreBelow()&&(i=1),this.direction=i,i===0){this.stopCarousel();return}this.carouselTimer===null&&(this.carouselTimer=setInterval(()=>this.carouselStep(),tA))}carouselStep(){if(this.direction===0){this.stopCarousel();return}let e=this.clampedWindowStart(),n=Math.max(0,Math.min(this.maxWindowStart(),e+this.direction));if(n===e){this.stopCarousel();return}if(this.windowStart.set(n),this.pointerY!==null){let o=this.indexFromPointer(this.pointerY);o!==null&&this.hovered.set(o)}}stopCarousel(){this.direction=0,this.carouselTimer!==null&&(clearInterval(this.carouselTimer),this.carouselTimer=null)}ensureWindowContains(e){let n=this.visibleCount(),o=this.maxWindowStart(),r=Math.min(this.clampedWindowStart(),o);e<r?this.windowStart.set(e):e>=r+n&&this.windowStart.set(Math.min(o,e-n+1))}scheduleHide(){this.cancelHide(),this.hideTimer=setTimeout(()=>{this.hideTimer=null,this.hovered.set(null)},sA)}cancelHide(){this.hideTimer!==null&&(clearTimeout(this.hideTimer),this.hideTimer=null)}revealRow(e){let n=this.previewList()?.nativeElement,o=n?.children.item(e);if(!n||!o)return;let r=n.getBoundingClientRect(),i=o.getBoundingClientRect();i.top<r.top?n.scrollTop-=r.top-i.top:i.bottom>r.bottom&&(n.scrollTop+=i.bottom-r.bottom)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Le({type:t,selectors:[["morse-prompt-rail"]],viewQuery:function(n,o){n&1&&Ft(o.track,ZO,5)(o.previewList,KO,5),n&2&&Wt(2)},inputs:{prompts:[1,"prompts"],activeId:[1,"activeId"]},outputs:{pick:"pick"},decls:1,vars:1,consts:[["track",""],["previewList",""],["aria-label","Prompt navigator",1,"rail"],["aria-label","Prompt navigator",1,"rail",3,"mouseenter"],["type","button","title","Earlier prompts","aria-label","Earlier prompts",1,"step",3,"click","disabled"],["role","listbox","tabindex","0","aria-label","Prompts in this conversation",1,"track",3,"mousemove","mouseleave","click","keydown"],[1,"ticks"],["role","option",1,"tick",3,"active","top","width"],["type","button","title","Later prompts","aria-label","Later prompts",1,"step",3,"click","disabled"],[1,"panel"],["role","option",1,"tick"],[1,"panel",3,"mouseenter","mouseleave"],[1,"panel-list"],["type","button",1,"row",3,"active","hovered"],["type","button",1,"row",3,"mouseenter","click"],[1,"row-text"]],template:function(n,o){n&1&&A(0,eA,11,9,"nav",2),n&2&&R(o.prompts().length>=2?0:-1)},styles:["[_nghost-%COMP%]{display:contents}.rail[_ngcontent-%COMP%]{position:absolute;right:12px;top:50%;z-index:6;display:flex;flex-direction:column;align-items:flex-end;transform:translateY(-50%)}.step[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:18px;height:16px;padding:0;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg-muted);font-size:10px;line-height:1;cursor:pointer}.step[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--%NS%morse-hover);color:var(--%NS%morse-fg)}.step[_ngcontent-%COMP%]:disabled{opacity:.25;cursor:default}.track[_ngcontent-%COMP%]{position:relative;width:24px;cursor:pointer;outline:none;overflow:hidden}.track[_ngcontent-%COMP%]:focus-visible{outline:1px solid var(--%NS%morse-focus);outline-offset:1px;border-radius:var(--%NS%morse-radius-sm)}.ticks[_ngcontent-%COMP%]{position:absolute;inset:0;transition:transform .26s ease-out}.tick[_ngcontent-%COMP%]{position:absolute;right:3px;height:2px;border-radius:999px;background:color-mix(in srgb,var(--%NS%morse-fg) 30%,transparent);transition:width .18s ease-out,background .18s ease-out}.track[_ngcontent-%COMP%]:hover .tick[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--%NS%morse-fg) 55%,transparent)}.tick.active[_ngcontent-%COMP%], .track[_ngcontent-%COMP%]:hover .tick.active[_ngcontent-%COMP%]{background:var(--%NS%morse-fg)}.panel[_ngcontent-%COMP%]{position:absolute;right:100%;top:50%;margin-right:10px;transform:translateY(-50%);width:min(20rem,calc(100vw - 4.5rem));border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-md);background:var(--%NS%morse-panel, var(--%NS%morse-bg));box-shadow:0 10px 28px #00000047;overflow:hidden}.panel-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;max-height:368px;padding:4px;overflow-y:auto}.row[_ngcontent-%COMP%]{display:flex;align-items:center;width:100%;min-height:44px;padding:6px 8px;border:1px solid transparent;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg-muted);font:inherit;font-size:11.5px;line-height:1.35;text-align:left;cursor:pointer}.row.hovered[_ngcontent-%COMP%]{border-color:var(--%NS%morse-border);background:var(--%NS%morse-hover)}.row.active[_ngcontent-%COMP%]{background:var(--%NS%morse-active);color:var(--%NS%morse-fg)}.row-text[_ngcontent-%COMP%]{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}"]})};var aA=["scroll"],cA=["inner"],lA=["heroMark"],WE=()=>[],dA=(t,e)=>e.key,uA=(t,e)=>e.path+(e.startLine??"");function pA(t,e){t&1&&(_(0,"span",11),g(1,"Loading older messages\u2026"),b())}function fA(t,e){if(t&1){let n=Y();_(0,"button",13),U("click",function(){D(n);let r=v(2);return k(r.loadOlder())}),g(1," Load older messages "),b()}}function mA(t,e){if(t&1&&(_(0,"div",5),A(1,pA,2,0,"span",11)(2,fA,2,0,"button",12),b()),t&2){let n=v();f(),R(n.loadingOlderHistory()?1:2)}}function hA(t,e){t&1&&(_(0,"div",6)(1,"span"),g(2,"Start of conversation"),b()())}function gA(t,e){if(t&1&&(_(0,"span",31),g(1),b()),t&2){let n=v().$implicit;f(),Kn("L",n.startLine,"-",n.endLine)}}function yA(t,e){if(t&1&&(_(0,"li",27)(1,"span",29),g(2,"\u29C9"),b(),_(3,"span",30),g(4),b(),A(5,gA,2,2,"span",31),b()),t&2){let n=e.$implicit,o=v(4);X("title",n.path),f(4),$(o.basename(n.path)),f(),R(n.startLine!==void 0?5:-1)}}function vA(t,e){if(t&1){let n=Y();_(0,"li",28)(1,"button",32),U("click",function(){let r=D(n),i=r.$implicit,s=r.$index,a=v(4);return k(a.openImage(i,s))}),Ke(2,"img",33),b()()}if(t&2){let n=e.$implicit,o=e.$index,r=v(4);f(),X("title",r.imageName(n,o)),He("aria-label","View "+r.imageName(n,o)),f(),X("src",r.thumb(n),Qi)("alt",r.imageName(n,o))}}function _A(t,e){if(t&1&&(_(0,"ul",19),ze(1,yA,6,3,"li",27,uA),ze(3,vA,3,4,"li",28,Xi),b()),t&2){let n=v(2).$implicit;f(),Ge(n.item.pins??kl(0,WE)),f(2),Ge(n.item.images??kl(1,WE))}}function bA(t,e){if(t&1){let n=Y();_(0,"div",20)(1,"textarea",34),U("input",function(r){D(n);let i=v(3);return k(i.onEditInput(r))})("keydown",function(r){D(n);let i=v(2).$implicit,s=v();return k(s.onEditKeydown(r,i.item))}),b(),_(2,"div",35)(3,"span",36),g(4,"Enter sends \xB7 Shift+Enter for a new line"),b(),_(5,"button",37),U("click",function(){D(n);let r=v(3);return k(r.cancelEdit())}),g(6,"Cancel"),b(),_(7,"button",38),U("click",function(){D(n);let r=v(2).$implicit,i=v();return k(i.submitEdit(r.item))}),g(8," Send "),b()()()}if(t&2){let n=v(3);f(),X("value",n.editingText()),f(6),X("disabled",n.editingText().trim().length===0)}}function EA(t,e){if(t&1){let n=Y();_(0,"div",21)(1,"morse-markdown",39),U("mention",function(r){D(n);let i=v(3);return k(i.openMention(r))}),b()()}if(t&2){let n=v(2).$implicit,o=v();f(),X("text",o.userMarkdown(n.item))}}function xA(t,e){if(t&1){let n=Y();_(0,"button",40),U("click",function(){D(n);let r=v(2).$implicit,i=v();return k(i.startEdit(r.item))}),g(1," \u270E "),b()}}function CA(t,e){if(t&1){let n=Y();_(0,"button",41),U("click",function(){D(n);let r=v(2).$implicit,i=v();return k(i.fork(r.item))}),vn(),_(1,"svg",42),Ke(2,"path",43),b()()}}function wA(t,e){if(t&1){let n=Y();_(0,"div",14),A(1,_A,5,2,"ul",19),A(2,bA,9,2,"div",20)(3,EA,2,1,"div",21),_(4,"div",22)(5,"span",23),g(6),b(),A(7,xA,2,0,"button",24),A(8,CA,3,0,"button",25),_(9,"button",26),U("click",function(){D(n);let r=v().$implicit,i=v();return k(i.copy(r.item))}),g(10),b()()()}if(t&2){let n=v().$implicit,o=v();X("morseEnter",0),He("data-prompt-id",n.item.id),f(),R(o.pinsOf(n.item)!==void 0||n.item.images!==void 0?1:-1),f(),R(o.editingId()===n.item.id?2:3),f(4),$(o.stamp(n.item.at)),f(),R(o.canEdit()?7:-1),f(),R(o.canFork()?8:-1),f(),X("title",o.copiedId()===n.item.id?"Copied":"Copy message"),f(),pt(" ",o.copiedId()===n.item.id?"\u2713":"\u29C9"," ")}}function SA(t,e){if(t&1){let n=Y();Ke(0,"morse-markdown",45),_(1,"div",46)(2,"button",26),U("click",function(){D(n);let r=v(2).$implicit,i=v();return k(i.copyAssistant(r.item))}),g(3),b()()}if(t&2){let n=v(2).$implicit,o=v();X("text",n.item.text),f(2),Be("revealed",o.copiedId()===n.item.id),X("title",o.copiedId()===n.item.id?"Copied":"Copy response"),f(),pt(" ",o.copiedId()===n.item.id?"\u2713 Copied":"\u29C9 Copy"," ")}}function TA(t,e){t&1&&(_(0,"span",44),g(1,"\xA0"),b())}function MA(t,e){if(t&1&&(_(0,"div",15),A(1,SA,4,5)(2,TA,2,0,"span",44),b()),t&2){let n=v().$implicit;X("morseEnter",0),f(),R(n.item.text?1:n.item.streaming?2:-1)}}function IA(t,e){if(t&1&&Ke(0,"morse-tool-group",16),t&2){let n=v().$implicit,o=v();X("morseEnter",0)("steps",n.steps)("working",o.working()&&n.key===o.activeProcess())}}function DA(t,e){if(t&1&&(_(0,"div",47)(1,"pre"),g(2),b()()),t&2){let n=v().$implicit;Zo(n.item.level),X("morseEnter",0),f(2),$(n.item.text)}}function kA(t,e){if(t&1&&(_(0,"span",51),g(1),b()),t&2){let n=v(2).$implicit,o=v();f(),pt("~",o.formatTokens(n.item.tokensBefore)," tokens folded")}}function NA(t,e){if(t&1&&(_(0,"div",52),Ke(1,"morse-markdown",45),b()),t&2){let n=v(2).$implicit;X("morseEnter",0),f(),X("text",n.item.summary)}}function OA(t,e){if(t&1){let n=Y();_(0,"div",18)(1,"button",48),U("click",function(){D(n);let r=v().$implicit,i=v();return k(i.toggleCompaction(r.key))}),Ke(2,"span",49),_(3,"span",50),g(4,"\u26A1 Compacted"),b(),A(5,kA,2,1,"span",51),Ke(6,"span",49),b(),A(7,NA,2,2,"div",52),b()}if(t&2){let n=v().$implicit,o=v();X("morseEnter",0),f(),X("title",n.item.summary?o.expandedCompaction()===n.key?"Hide the summary":"Show the summary":"Everything before this point was summarized into the running context"),f(4),R(n.item.tokensBefore?5:-1),f(2),R(o.expandedCompaction()===n.key&&n.item.summary?7:-1)}}function AA(t,e){if(t&1&&A(0,wA,11,9,"div",14)(1,MA,3,2,"div",15)(2,IA,1,3,"morse-tool-group",16)(3,DA,3,4,"div",17)(4,OA,8,4,"div",18),t&2){let n,o=e.$implicit;R((n=o.kind)==="user"?0:n==="assistant"?1:n==="process"?2:n==="notice"?3:n==="compaction"?4:-1)}}function RA(t,e){if(t&1&&(_(0,"span",59),g(1),b()),t&2){let n=e.$implicit;f(),$(n)}}function PA(t,e){if(t&1&&(_(0,"div",7)(1,"div",53),Ke(2,"span",54),_(3,"span",55,2),Ke(5,"span",56)(6,"span",56)(7,"span",57),b()(),_(8,"div",58),ze(9,RA,2,1,"span",59,Xi),b(),_(11,"div",60),g(12,"the pi coding agent"),b(),_(13,"p",61),g(14," It runs the same pi coding agent you use in the terminal, with your models, tools, skills and sessions. "),b(),_(15,"p",62),g(16," Try "),_(17,"em"),g(18,"\u201Cexplain this repository\u201D"),b(),g(19,", "),_(20,"em"),g(21,"\u201Cwhy is this failing?\u201D"),b(),g(22,", or select code and pin it with the "),_(23,"span",63),g(24,"\u29C9"),b(),g(25," button under the chat. "),b()()),t&2){let n=v();f(9),Ge(n.heroLetters)}}function LA(t,e){if(t&1){let n=Y();_(0,"button",64),U("click",function(){D(n);let r=v();return k(r.jumpToLatest())}),g(1,"\u2193 Latest"),b()}}function FA(t,e){if(t&1){let n=Y();_(0,"div",65),U("click",function(){D(n);let r=v();return k(r.closeImage())}),_(1,"button",66),U("click",function(){D(n);let r=v();return k(r.closeImage())}),g(2," \xD7 "),b(),_(3,"figure",67),U("click",function(r){return r.stopPropagation()}),Ke(4,"img",33),_(5,"figcaption"),g(6),b()()()}if(t&2){let n=e;f(4),X("src",n.src,Qi)("alt",n.label),f(2),$(n.label)}}var VA={png:"png",jpeg:"jpg",jpg:"jpg",webp:"webp",gif:"gif","svg+xml":"svg",bmp:"bmp",avif:"avif"},qE=160;function $A(t){let e=t.replace(/\s+/g," ").trim();return e.length>qE?`${e.slice(0,qE)}\u2026`:e}var Ud=class t{morse=O(Ht);animation=O(pn);handoff=O(ls);scrollHost=St.required("scroll");inner=St("inner");heroMark=St("heroMark");heroLetters=["M","o","r","s","e"];copiedId=H(null);preview=H(null);editingId=H(null);editingText=H("");pinned=H(!0);working=T(()=>this.morse.state().streaming);rows=T(()=>r0(this.morse.items()));activeProcess=T(()=>i0(this.rows()));railPrompts=T(()=>this.rows().filter(e=>e.kind==="user").map(e=>({id:e.item.id,preview:$A(e.item.text)})));activePromptId=H(null);expandedCompaction=H(null);toggleCompaction(e){this.expandedCompaction.update(n=>n===e?null:e)}formatTokens(e){return new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(e)}hasOlderHistory=T(()=>this.morse.hasOlderHistory());loadingOlderHistory=T(()=>this.morse.loadingOlderHistory());activePending=!1;bottomDistance=0;anchorScroll=!1;previousFirstId;previousSessionId;previousLength=0;constructor(){ke(e=>{let n=this.inner()?.nativeElement;if(!n||typeof ResizeObserver>"u")return;let o=new ResizeObserver(()=>{this.pinned()&&this.afterRender(()=>this.scrollToBottom())});o.observe(n),e(()=>o.disconnect())}),ke(()=>{this.rows(),this.pinned()&&this.afterRender(()=>this.scrollToBottom())}),ke(()=>{this.rows().at(-1)?.kind==="user"&&this.animation.pulse(this.inner()?.nativeElement??null)}),ke(()=>{let e=this.rows().length===0;this.afterRender(()=>{let n=this.heroMark()?.nativeElement;if(!e||!n){this.handoff.aim(null);return}let o=n.getBoundingClientRect();this.handoff.aim({x:o.left+o.width/2,y:o.top+o.height/2,width:o.width,height:o.height})})}),ke(()=>{this.railPrompts(),this.afterRender(()=>this.updateActivePrompt())}),ke(()=>{let e=this.morse.state().sessionId,n=this.morse.items(),o=n[0]?.id,r=e===this.previousSessionId&&this.previousFirstId!==void 0&&o!==this.previousFirstId&&n.length>this.previousLength;this.previousSessionId=e,this.previousFirstId=o,this.previousLength=n.length,r&&this.afterRender(()=>this.restoreBottomDistance())})}afterRender(e){setTimeout(e,0)}onScroll(e){let n=e.target,o=n.scrollHeight-n.scrollTop-n.clientHeight;this.pinned.set(o<48),this.bottomDistance=o,this.anchorScroll=o>0,n.scrollTop<80&&this.hasOlderHistory()&&!this.loadingOlderHistory()&&this.morse.loadOlderHistory(),this.updateActivePrompt()}loadOlder(){let e=this.scrollHost().nativeElement;this.bottomDistance=e.scrollHeight-e.scrollTop-e.clientHeight,this.anchorScroll=this.bottomDistance>0,this.morse.loadOlderHistory()}restoreBottomDistance(){if(!this.anchorScroll)return;let e=this.scrollHost().nativeElement,n=Math.max(0,e.scrollHeight-e.clientHeight),o=e.scrollHeight-e.clientHeight-this.bottomDistance;e.scrollTop=Math.max(0,Math.min(n,o))}updateActivePrompt(){this.activePending||(this.activePending=!0,this.afterRender(()=>{this.activePending=!1,this.computeActivePrompt()}))}computeActivePrompt(){let e=this.scrollHost().nativeElement,n=e.querySelectorAll("[data-prompt-id]");if(n.length===0){this.activePromptId.set(null);return}let o=e.getBoundingClientRect().top+100,r=n[0]?.dataset.promptId??null;for(let s of Array.from(n))if(s.getBoundingClientRect().top<=o)r=s.dataset.promptId??r;else break;e.scrollHeight-e.scrollTop-e.clientHeight<=Math.max(48,e.clientHeight*.1)&&(r=n[n.length-1]?.dataset.promptId??r),this.activePromptId.set(r)}scrollToPrompt(e){let n=this.scrollHost().nativeElement,o=n.querySelector(`[data-prompt-id="${e}"]`);if(!o)return;let r=o.getBoundingClientRect().top-n.getBoundingClientRect().top+n.scrollTop-12;this.pinned.set(!1),this.animation.isEnabled&&typeof n.scrollTo=="function"?n.scrollTo({top:r,behavior:"smooth"}):n.scrollTop=r,this.activePromptId.set(e)}jumpToLatest(){this.pinned.set(!0),this.scrollToBottom(!0)}scrollToBottom(e=!1){let n=this.scrollHost().nativeElement;e&&this.animation.isEnabled&&typeof n.scrollTo=="function"&&(typeof document>"u"||document.visibilityState==="visible")?n.scrollTo({top:n.scrollHeight,behavior:"smooth"}):n.scrollTop=n.scrollHeight}stamp(e){return e<=0?"":new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}userMarkdown(e){return s0(e.text)}pinsOf(e){return e.pins}basename(e){let n=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return n===-1?e:e.slice(n+1)}thumb(e){return`data:${e.mimeType};base64,${e.data}`}imageName(e,n){let o=e.mimeType.split("/")[1]?.toLowerCase()??"",r=VA[o]??(o.replace(/[^a-z0-9]/g,"")||"png");return n===0?`image.${r}`:`image-${n+1}.${r}`}openImage(e,n){this.preview.set({src:this.thumb(e),label:this.imageName(e,n)})}closeImage(){this.preview.set(null)}onEscape(){if(this.preview()!==null){this.closeImage();return}this.editingId()!==null&&this.cancelEdit()}canEdit(){return this.morse.capabilities()?.editMessage===!0&&this.morse.state().streaming!==!0}canFork(){return this.morse.capabilities()?.forkMessage===!0&&this.morse.state().streaming!==!0}fork(e){this.morse.forkMessage(e.id)}startEdit(e){this.editingId.set(e.id),this.editingText.set(e.text),this.afterRender(()=>{let n=this.scrollHost().nativeElement.querySelector(".edit-input");n?.focus();let o=n?.value.length??0;n?.setSelectionRange(o,o)})}cancelEdit(){this.editingId.set(null),this.editingText.set("")}onEditInput(e){this.editingText.set(e.target.value)}onEditKeydown(e,n){if(e.key==="Enter"&&!e.shiftKey){e.preventDefault(),this.submitEdit(n);return}e.key==="Escape"&&(e.preventDefault(),this.cancelEdit())}submitEdit(e){let n=this.editingText().trim();n.length!==0&&(this.morse.editMessage(e.id,n),this.cancelEdit())}openMention(e){this.morse.capabilities()?.revealFile===!0&&this.morse.requestHostCommand("revealFile",{path:e}).catch(()=>{})}copyText(e){let n=e.pins??[];if(n.length===0)return e.text;let o=n.map(r=>`${r.path}${r.startLine!==void 0?`:${r.startLine}-${r.endLine??r.startLine}`:""}`).map(r=>`@${r}`).join(`
86
- `);return e.text.trim().length>0?`${e.text}
87
-
88
- ${o}`:o}copy(e){this.copyRaw(e.id,this.copyText(e))}copyAssistant(e){this.copyRaw(e.id,e.text)}copyRaw(e,n){navigator.clipboard?.writeText(n),this.copiedId.set(e),setTimeout(()=>{this.copiedId()===e&&this.copiedId.set(null)},1200)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Le({type:t,selectors:[["morse-chat-transcript"]],viewQuery:function(n,o){n&1&&Ft(o.scrollHost,aA,5)(o.inner,cA,5)(o.heroMark,lA,5),n&2&&Wt(3)},hostBindings:function(n,o){n&1&&U("keydown.escape",function(){return o.onEscape()},An)},decls:12,vars:8,consts:[["scroll",""],["inner",""],["heroMark",""],[1,"transcript",3,"scroll"],[1,"inner"],[1,"older"],[1,"start"],[1,"hero"],[3,"pick","prompts","activeId"],["type","button",1,"latest"],[1,"image-overlay"],[1,"older-label"],["type","button",1,"older-button"],["type","button",1,"older-button",3,"click"],[1,"user",3,"morseEnter"],[1,"assistant",3,"morseEnter"],[3,"morseEnter","steps","working"],[1,"notice",3,"class","morseEnter"],[1,"compaction",3,"morseEnter"],[1,"user-attachments"],[1,"user-edit"],[1,"user-text"],[1,"user-head"],[1,"stamp"],["type","button","title","Edit message",1,"copy-msg"],["type","button","title","Fork from here",1,"copy-msg"],["type","button",1,"copy-msg",3,"click","title"],[1,"mention-pin",3,"title"],[1,"image-chip"],["aria-hidden","true",1,"pin-icon"],[1,"name"],[1,"lines"],["type","button",1,"image-chip-button",3,"click","title"],[3,"src","alt"],["rows","3",1,"edit-input",3,"input","keydown","value"],[1,"edit-actions"],[1,"edit-hint"],["type","button",1,"edit-cancel",3,"click"],["type","button",1,"edit-send",3,"click","disabled"],["variant","user",3,"mention","text"],["type","button","title","Edit message",1,"copy-msg",3,"click"],["type","button","title","Fork from here",1,"copy-msg",3,"click"],["viewBox","0 0 16 16","width","11","height","11","aria-hidden","true"],["fill","currentColor","d","M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z"],[1,"cursor"],[3,"text"],[1,"assistant-actions"],[1,"notice",3,"morseEnter"],["type","button",1,"compaction-sep",3,"click","title"],["aria-hidden","true",1,"sep-line"],[1,"sep-label"],[1,"sep-tokens"],[1,"compaction-summary",3,"morseEnter"],[1,"hero-stage"],["aria-hidden","true",1,"hero-glow"],["aria-hidden","true",1,"hero-mark"],[1,"hero-dot"],[1,"hero-dash"],["aria-label","Morse",1,"hero-wordmark"],["aria-hidden","true",1,"hero-letter"],[1,"hero-tagline"],[1,"hero-hint"],[1,"hero-tips"],[1,"hero-key"],["type","button",1,"latest",3,"click"],[1,"image-overlay",3,"click"],["type","button","aria-label","Close image",1,"image-close",3,"click"],[1,"image-frame",3,"click"]],template:function(n,o){if(n&1&&(_(0,"div",3,0),U("scroll",function(i){return o.onScroll(i)}),_(2,"div",4,1),A(4,mA,3,1,"div",5)(5,hA,3,0,"div",6),ze(6,AA,5,1,null,null,dA,!1,PA,26,0,"div",7),b()(),_(9,"morse-prompt-rail",8),U("pick",function(i){return o.scrollToPrompt(i)}),b(),A(10,LA,2,0,"button",9),A(11,FA,7,3,"div",10)),n&2){let r;f(2),Be("blank",o.rows().length===0),f(2),R(o.hasOlderHistory()||o.loadingOlderHistory()?4:o.rows().length>0?5:-1),f(2),Ge(o.rows()),f(3),X("prompts",o.railPrompts())("activeId",o.activePromptId()),f(),R(!o.pinned()&&o.rows().length>0?10:-1),f(),R((r=o.preview())?11:-1,r)}},dependencies:[$d,Hd,nn,Bd],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0;position:relative}.transcript[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;padding:18px 16px 6px;scrollbar-gutter:stable}.latest[_ngcontent-%COMP%]{position:absolute;right:18px;bottom:10px;padding:3px 12px;border:1px solid var(--%NS%morse-border);border-radius:999px;background:var(--%NS%morse-badge-bg, var(--%NS%morse-hover));color:var(--%NS%morse-badge-fg, var(--%NS%morse-fg));font-size:11.5px;box-shadow:0 4px 12px #00000040;cursor:pointer}.latest[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-active)}.inner[_ngcontent-%COMP%]{width:100%;max-width:780px;margin:0 auto;display:flex;flex-direction:column;gap:14px}.inner.blank[_ngcontent-%COMP%]{min-height:100%;justify-content:center}.user[_ngcontent-%COMP%]{align-self:flex-end;max-width:88%;padding:8px 12px;border-radius:var(--%NS%morse-radius-lg);border-bottom-right-radius:4px;background:var(--%NS%morse-bubble);border:1px solid var(--%NS%morse-border)}.user-head[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:0;min-height:14px;margin-top:4px}.user[_ngcontent-%COMP%] .user-head[_ngcontent-%COMP%] .copy-msg[_ngcontent-%COMP%]{width:0;margin:0;padding:0;overflow:hidden;opacity:0}.user[_ngcontent-%COMP%]:hover .user-head[_ngcontent-%COMP%] .copy-msg[_ngcontent-%COMP%], .user[_ngcontent-%COMP%] .user-head[_ngcontent-%COMP%] .copy-msg[_ngcontent-%COMP%]:focus-visible{width:auto;padding:0 4px;margin-left:6px;overflow:visible;opacity:1}.user[_ngcontent-%COMP%] .stamp[_ngcontent-%COMP%]{font-size:11px;color:var(--%NS%morse-fg-muted)}.assistant-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;min-height:16px;margin-top:-2px}.assistant[_ngcontent-%COMP%] .copy-msg[_ngcontent-%COMP%]{padding:1px 7px;border:1px solid transparent}.assistant[_ngcontent-%COMP%]:hover .copy-msg[_ngcontent-%COMP%], .assistant[_ngcontent-%COMP%] .copy-msg[_ngcontent-%COMP%]:focus-visible, .assistant[_ngcontent-%COMP%] .copy-msg.revealed[_ngcontent-%COMP%]{opacity:1}.copy-msg[_ngcontent-%COMP%]{padding:0 4px;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg-muted);font-size:11px;line-height:1.2;cursor:pointer;opacity:0;transition:opacity .14s ease}.user[_ngcontent-%COMP%]:hover .copy-msg[_ngcontent-%COMP%], .copy-msg[_ngcontent-%COMP%]:focus-visible{opacity:1}.copy-msg[_ngcontent-%COMP%]:hover{color:var(--%NS%morse-fg);background:var(--%NS%morse-hover)}.copy-msg[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{display:block}.older[_ngcontent-%COMP%]{display:flex;justify-content:center;padding:2px 0 8px}.older-label[_ngcontent-%COMP%]{color:var(--%NS%morse-fg-muted);font-size:11px}.older-button[_ngcontent-%COMP%]{padding:3px 12px;border:1px solid var(--%NS%morse-border);border-radius:999px;background:var(--%NS%morse-panel, var(--%NS%morse-bg));color:var(--%NS%morse-fg);font-size:11px;cursor:pointer}.older-button[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover)}.start[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;color:var(--%NS%morse-fg-muted);font-size:11px}.start[_ngcontent-%COMP%]:before, .start[_ngcontent-%COMP%]:after{content:"";flex:1;height:1px;background:var(--%NS%morse-border)}.start[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{white-space:nowrap}.compaction[_ngcontent-%COMP%]{margin:10px 0 14px}.compaction-sep[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%;padding:3px 0;border:none;background:none;color:var(--%NS%morse-fg-muted);font-size:11px;cursor:pointer}.compaction-sep[_ngcontent-%COMP%] .sep-line[_ngcontent-%COMP%]{flex:1;height:1px;background:var(--%NS%morse-border)}.compaction-sep[_ngcontent-%COMP%] .sep-label[_ngcontent-%COMP%]{white-space:nowrap;padding:1px 10px;border:1px solid var(--%NS%morse-border);border-radius:999px;background:var(--%NS%morse-hover);font-family:var(--%NS%morse-font-mono, monospace);font-size:10.5px}.compaction-sep[_ngcontent-%COMP%] .sep-tokens[_ngcontent-%COMP%]{white-space:nowrap;font-size:10.5px;color:var(--%NS%morse-fg-dim, var(--%NS%morse-fg-muted))}.compaction-sep[_ngcontent-%COMP%]:hover .sep-label[_ngcontent-%COMP%]{color:var(--%NS%morse-fg);background:var(--%NS%morse-active)}.compaction-summary[_ngcontent-%COMP%]{margin-top:8px;padding:10px 12px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-panel, var(--%NS%morse-bg));font-size:13px}.user[_ngcontent-%COMP%] .user-text[_ngcontent-%COMP%]{margin:0;word-break:break-word;font-family:var(--%NS%morse-font);line-height:1.55}.user[_ngcontent-%COMP%] .user-text[_ngcontent-%COMP%] .md[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 .5em}.user-edit[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px;min-width:min(420px,60vw)}.user[_ngcontent-%COMP%] .edit-input[_ngcontent-%COMP%]{width:100%;box-sizing:border-box;resize:vertical;min-height:60px;padding:7px 9px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-panel, var(--%NS%morse-bg));color:var(--%NS%morse-fg);font-family:var(--%NS%morse-font);font-size:inherit;line-height:1.55}.user[_ngcontent-%COMP%] .edit-input[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--%NS%morse-accent)}.user-edit[_ngcontent-%COMP%] .edit-actions[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:6px}.user-edit[_ngcontent-%COMP%] .edit-hint[_ngcontent-%COMP%]{margin-right:auto;font-size:10.5px;color:var(--%NS%morse-fg-muted)}.user-edit[_ngcontent-%COMP%] .edit-cancel[_ngcontent-%COMP%], .user-edit[_ngcontent-%COMP%] .edit-send[_ngcontent-%COMP%]{padding:3px 10px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg);font-size:11.5px;cursor:pointer}.user-edit[_ngcontent-%COMP%] .edit-send[_ngcontent-%COMP%]{border-color:var(--%NS%morse-accent);background:var(--%NS%morse-accent);color:#fff}.user-edit[_ngcontent-%COMP%] .edit-send[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:default}.user-edit[_ngcontent-%COMP%] .edit-cancel[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover)}.user-attachments[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:2px 0 6px;padding:0;list-style:none}.user-attachments[_ngcontent-%COMP%] .mention-pin[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;padding:2px 7px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-hover);font-size:11.5px;width:220px;max-width:100%}.user-attachments[_ngcontent-%COMP%] .mention-pin[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.user-attachments[_ngcontent-%COMP%] .mention-pin[_ngcontent-%COMP%] .lines[_ngcontent-%COMP%]{flex:none;padding:0 5px;border-radius:999px;background:var(--%NS%morse-active);color:var(--%NS%morse-fg-muted);font-size:10.5px;font-family:var(--%NS%morse-font-mono);white-space:nowrap}.user-attachments[_ngcontent-%COMP%] .mention-pin[_ngcontent-%COMP%] .pin-icon[_ngcontent-%COMP%]{flex:none;font-size:11px;color:var(--%NS%morse-accent)}.user-attachments[_ngcontent-%COMP%] .image-chip[_ngcontent-%COMP%]{display:inline-flex;min-width:0}.user-attachments[_ngcontent-%COMP%] .image-chip-button[_ngcontent-%COMP%]{display:inline-flex;width:30px;height:30px;padding:0;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-hover);overflow:hidden;cursor:pointer}.user-attachments[_ngcontent-%COMP%] .image-chip-button[_ngcontent-%COMP%]:hover{border-color:color-mix(in srgb,var(--%NS%morse-accent) 45%,var(--%NS%morse-border));background:var(--%NS%morse-active)}.user-attachments[_ngcontent-%COMP%] .image-chip-button[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:100%;display:block;object-fit:cover;border-radius:calc(var(--%NS%morse-radius-sm) - 1px)}.image-overlay[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:60;display:flex;align-items:center;justify-content:center;padding:32px;background:#0000009e}.image-frame[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;margin:0;max-width:min(880px,92vw);max-height:92vh}.image-frame[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:100%;max-height:calc(92vh - 40px);object-fit:contain;border-radius:var(--%NS%morse-radius-md);background:var(--%NS%morse-panel)}.image-frame[_ngcontent-%COMP%] figcaption[_ngcontent-%COMP%]{color:var(--%NS%morse-badge-fg, #fff);font-size:11.5px;text-align:center}.image-close[_ngcontent-%COMP%]{position:absolute;top:14px;right:18px;width:28px;height:28px;border:0;border-radius:50%;background:#00000073;color:#fff;font-size:18px;line-height:1;cursor:pointer}.image-close[_ngcontent-%COMP%]:hover{background:#000000b3}.user[_ngcontent-%COMP%] .user-text[_ngcontent-%COMP%] .mention[_ngcontent-%COMP%]{display:inline-flex;align-items:baseline;max-width:100%;vertical-align:baseline;padding:0;border:1px solid color-mix(in srgb,var(--%NS%morse-accent) 30%,transparent);border-radius:var(--%NS%morse-radius-sm);background:color-mix(in srgb,var(--%NS%morse-accent) 12%,transparent);color:color-mix(in srgb,var(--%NS%morse-accent) 75%,var(--%NS%morse-fg));cursor:pointer}.user[_ngcontent-%COMP%] .user-text[_ngcontent-%COMP%] .mention[_ngcontent-%COMP%] .mention-label[_ngcontent-%COMP%]{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 6px 1px;font-family:var(--%NS%morse-font-mono);font-size:11px}.user[_ngcontent-%COMP%] .user-text[_ngcontent-%COMP%] .mention[_ngcontent-%COMP%]:hover{border-color:color-mix(in srgb,var(--%NS%morse-accent) 60%,transparent);background:color-mix(in srgb,var(--%NS%morse-accent) 20%,transparent)}.assistant[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px}.assistant[_ngcontent-%COMP%] .who[_ngcontent-%COMP%]{font-size:11px;font-weight:600;letter-spacing:.02em;color:var(--%NS%morse-fg-muted)}.assistant[_ngcontent-%COMP%] morse-markdown[_ngcontent-%COMP%] .md{line-height:1.6}.notice[_ngcontent-%COMP%]{padding:8px 10px;border-left:2px solid var(--%NS%morse-info);border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-hover);font-size:12px;color:var(--%NS%morse-fg-muted)}.notice.warn[_ngcontent-%COMP%]{border-color:var(--%NS%morse-warn)}.notice[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{margin:0;font-family:inherit;white-space:pre-wrap;word-break:break-word}.notice.error[_ngcontent-%COMP%]{border-color:var(--%NS%morse-error);color:var(--%NS%morse-fg)}.notice.success[_ngcontent-%COMP%]{border-color:var(--%NS%morse-success)}.hero[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:8px;max-width:460px;margin:0 auto;padding:28px 14px;text-align:center}.hero-stage[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;justify-content:center;width:104px;height:104px;margin-bottom:2px}.hero-glow[_ngcontent-%COMP%]{position:absolute;width:104px;height:104px;border-radius:50%;background:radial-gradient(circle,color-mix(in srgb,var(--%NS%morse-accent) 38%,transparent) 0%,transparent 66%);filter:blur(3px);animation:_ngcontent-%COMP%_hero-breathe 3.6s ease-in-out infinite}.hero-mark[_ngcontent-%COMP%]{position:relative;display:inline-flex;align-items:center;gap:8px}.hero-dot[_ngcontent-%COMP%]{width:12px;height:12px;border-radius:50%;background:var(--%NS%morse-fg);box-shadow:0 0 13px color-mix(in srgb,var(--%NS%morse-fg) 45%,transparent);animation:_ngcontent-%COMP%_hero-hop 3.6s ease-in-out infinite}.hero-dot[_ngcontent-%COMP%]:nth-child(2){animation-delay:.14s}.hero-dash[_ngcontent-%COMP%]{width:34px;height:12px;border-radius:999px;background:var(--%NS%morse-fg);box-shadow:0 0 13px color-mix(in srgb,var(--%NS%morse-fg) 45%,transparent);animation:_ngcontent-%COMP%_hero-hop-dash 3.6s ease-in-out infinite;animation-delay:.3s}.hero-wordmark[_ngcontent-%COMP%]{display:flex;font-size:26px;font-weight:650;line-height:1;background-image:linear-gradient(100deg,transparent 38%,color-mix(in srgb,var(--%NS%morse-fg) 45%,#fff) 50%,transparent 62%),linear-gradient(var(--%NS%morse-fg),var(--%NS%morse-fg));background-size:260% 100%,100% 100%;background-repeat:no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent;animation:_ngcontent-%COMP%_hero-shimmer 3.6s ease-in-out infinite}.hero-letter[_ngcontent-%COMP%]{display:inline-block}.hero-tagline[_ngcontent-%COMP%]{font-size:10px;letter-spacing:.34em;text-transform:uppercase;color:var(--%NS%morse-fg-muted)}.hero-hint[_ngcontent-%COMP%], .hero-tips[_ngcontent-%COMP%]{margin:0;color:var(--%NS%morse-fg-muted);line-height:1.65}.hero-hint[_ngcontent-%COMP%]{margin-top:12px}.hero-tips[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{font-style:normal;color:var(--%NS%morse-fg);background:var(--%NS%morse-hover);border:1px solid var(--%NS%morse-border);border-radius:999px;padding:1px 8px;white-space:nowrap}.hero-key[_ngcontent-%COMP%]{font-family:var(--%NS%morse-font-mono);color:var(--%NS%morse-fg)}@keyframes _ngcontent-%COMP%_hero-breathe{0%,to{opacity:.75;transform:scale(.96)}50%{opacity:1;transform:scale(1.04)}}@keyframes _ngcontent-%COMP%_hero-hop{0%,14%,to{transform:translateY(0)}7%{transform:translateY(-8px)}}@keyframes _ngcontent-%COMP%_hero-hop-dash{0%,16%,to{transform:translateY(0) scale(1)}8%{transform:translateY(-6px) scale(1.08,.88)}}@keyframes _ngcontent-%COMP%_hero-shimmer{0%,38%{background-position:140% 0,0 0}62%,to{background-position:-45% 0,0 0}}@media(prefers-reduced-motion:reduce){.hero-glow[_ngcontent-%COMP%], .hero-dot[_ngcontent-%COMP%], .hero-dash[_ngcontent-%COMP%], .hero-wordmark[_ngcontent-%COMP%]{animation:none}.hero-wordmark[_ngcontent-%COMP%]{background-image:none;color:var(--%NS%morse-fg)}}.cursor[_ngcontent-%COMP%]{display:inline-block;width:7px;height:14px;vertical-align:text-bottom;background:var(--%NS%morse-accent);animation:_ngcontent-%COMP%_blink 1s step-start infinite}@keyframes _ngcontent-%COMP%_blink{50%{opacity:0}}']})};var jA=(t,e)=>e.value;function HA(t,e){t&1&&(C(0,"p",1),g(1),w()),t&2&&(f(),$(e))}function BA(t,e){if(t&1){let n=Y();C(0,"button",4),ee("click",function(){let r=D(n).$implicit,i=v(3);return k(i.choose(r.value))}),g(1),w()}if(t&2){let n=e.$implicit;f(),pt(" ",n.label," ")}}function UA(t,e){if(t&1&&(A(0,HA,2,1,"p",1),C(1,"div",2),ze(2,BA,2,1,"button",3,jA),w()),t&2){let n,o=v(),r=v();R((n=r.messageOf(o))?0:-1,n),f(2),Ge(r.optionsOf(o))}}function zA(t,e){if(t&1){let n=Y();C(0,"p"),g(1),w(),C(2,"div",2)(3,"button",5),ee("click",function(){D(n);let r=v(2);return k(r.decide(!0))}),g(4,"Yes"),w(),C(5,"button",4),ee("click",function(){D(n);let r=v(2);return k(r.decide(!1))}),g(6,"No"),w()()}if(t&2){let n=v(),o=v();f(),$(o.messageOf(n))}}function GA(t,e){if(t&1){let n=Y();C(0,"input",6),ee("input",function(r){D(n);let i=v(2);return k(i.onInput(r))}),w(),C(1,"div",2)(2,"button",5),ee("click",function(){D(n);let r=v(2);return k(r.submit())}),g(3,"Submit"),w(),C(4,"button",4),ee("click",function(){D(n);let r=v(2);return k(r.cancel())}),g(5,"Cancel"),w()()}if(t&2){let n=v(),o=v();et("value",o.value()||o.prefillOf(n))("placeholder",o.placeholderOf(n))}}function WA(t,e){if(t&1){let n=Y();C(0,"textarea",7),ee("input",function(r){D(n);let i=v(2);return k(i.onInput(r))}),w(),C(1,"div",2)(2,"button",5),ee("click",function(){D(n);let r=v(2);return k(r.submit())}),g(3,"Submit"),w(),C(4,"button",4),ee("click",function(){D(n);let r=v(2);return k(r.cancel())}),g(5,"Cancel"),w()()}if(t&2){let n=v(),o=v();et("value",o.value()||o.prefillOf(n))}}function qA(t,e){if(t&1&&(C(0,"section",0)(1,"header"),g(2),w(),A(3,UA,4,1)(4,zA,7,1)(5,GA,6,2)(6,WA,6,1),w()),t&2){let n,o=e;f(2),$(o.title),f(),R((n=o.kind)==="select"?3:n==="confirm"?4:n==="input"?5:n==="editor"?6:-1)}}var zd=class t{morse=O(Ht);request=this.morse.pendingInteraction;value=H("");visible=T(()=>this.request()!==null&&this.morse.capabilities()?.nativeDialogs!==!0);onInput(e){this.value.set(e.target.value)}choose(e){this.respond({value:e})}decide(e){this.respond({confirmed:e})}submit(){this.respond({value:this.value()}),this.value.set("")}cancel(){this.respond({cancelled:!0}),this.value.set("")}messageOf(e){return e.kind==="select"||e.kind==="confirm"?e.message??"":""}optionsOf(e){return e.kind==="select"?e.options:[]}placeholderOf(e){return e.kind==="input"?e.placeholder??"":""}prefillOf(e){return e.kind==="editor"||e.kind==="input"?e.value??"":""}respond(e){let n=this.request();n&&this.morse.respond(V({requestId:n.requestId},e))}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Le({type:t,selectors:[["morse-interaction-panel"]],decls:1,vars:1,consts:[["role","dialog","aria-live","polite",1,"dialog"],[1,"muted"],[1,"options"],["type","button",1,"secondary"],["type","button",1,"secondary",3,"click"],["type","button",3,"click"],["type","text",3,"input","value","placeholder"],["rows","5",3,"input","value"]],template:function(n,o){if(n&1&&A(0,qA,7,2,"section",0),n&2){let r;R((r=o.visible()&&o.request())?0:-1,r)}},styles:[".dialog[_ngcontent-%COMP%]{margin:8px;padding:8px 10px;border:1px solid var(--%NS%morse-focus);border-radius:4px;background:var(--%NS%morse-blockquote);display:flex;flex-direction:column;gap:8px}header[_ngcontent-%COMP%]{font-weight:600}p[_ngcontent-%COMP%]{margin:0;white-space:pre-wrap}.options[_ngcontent-%COMP%]{display:flex;gap:6px;flex-wrap:wrap}"]})};var _s=520,YE=70,Gd=class t{animation=O(pn);async play(e,n){let o=this.resolveTarget();if(!this.animation.isEnabled||!n||!o||e.length===0||typeof document>"u")return;let r=_s+(e.length-1)*YE;e.forEach((i,s)=>{this.launch(i,n,o,s*YE)}),await YA(r)}resolveTarget(){let e=document.querySelector("morse-chat-composer .box");if(!e)return;let n=e.getBoundingClientRect();return{x:n.left+26,y:n.top+18}}launch(e,n,o,r){let i=this.createGhost(e,n);document.body.appendChild(i);let s=Math.min(n.y,o.y)-Math.max(60,Math.abs(n.y-o.y)*.35);tn(i,{translateX:[n.x,o.x],translateY:[{to:n.y,duration:_s*.18},{to:s,duration:_s*.42},{to:o.y,duration:_s*.4}],rotate:[0,-8,6,0],scale:[1,1.04,.86,.42],opacity:[1,1,.9,0],duration:_s,delay:r,ease:"inOut(2)",onComplete:()=>i.remove()}),setTimeout(()=>i.remove(),r+_s+400)}createGhost(e,n){let o=document.createElement("div");if(o.className="drop-ghost",e.thumbnail){let i=document.createElement("img");i.src=e.thumbnail,i.alt="",o.appendChild(i)}else{let i=document.createElement("span");i.className="drop-ghost-glyph",i.textContent="\u25A4",o.appendChild(i)}let r=document.createElement("span");return r.className="drop-ghost-name",r.textContent=e.name,o.appendChild(r),o}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Pe({token:t,factory:t.\u0275fac,providedIn:"root"})};function YA(t){return new Promise(e=>setTimeout(e,t))}var Wd=class t{attachments=O(br);flight=O(Gd);uploads=O(ps);depth=H(0);internalDrag=!1;constructor(){if(typeof document>"u")return;let e=()=>{this.internalDrag=!0},n=()=>{this.internalDrag=!1};document.addEventListener("dragstart",e,!0),document.addEventListener("dragend",n,!0),document.addEventListener("drop",n,!0)}active=T(()=>this.depth()>0);carriesFiles(e){if(this.internalDrag)return!1;let n=e.dataTransfer?.types;return n!==void 0&&n.length>0}onDragEnter(e){this.carriesFiles(e)&&(e.preventDefault(),this.depth.update(n=>n+1))}onDragOver(e){this.carriesFiles(e)&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy"))}onDragLeave(){this.depth.update(e=>Math.max(0,e-1))}async onDrop(e,n){if(this.depth.set(0),!this.carriesFiles(e))return;e.preventDefault();let o=e.dataTransfer;if(!o)return;let r=Array.from(o.files??[]),{images:i}=await this.attachments.read(r.filter(E=>E.type.startsWith("image/"))),s=QA(o),a=r.filter(E=>!E.type.startsWith("image/")),c=this.uploads.available()&&a.length>0?this.uploads.upload(a):Promise.resolve({added:[],failed:a.map(E=>E.name)}),l=[...s.paths.map(E=>ZE(E,n)),...s.names,...a.map(E=>E.name)],d=e.clientX>0||e.clientY>0?{x:e.clientX,y:e.clientY}:ZA();await this.flight.play([...i.map(E=>({name:E.name,thumbnail:`data:${E.mimeType};base64,${E.data}`})),...l.map(E=>({name:E}))],d);let u=await c,m=[...s.paths.map(E=>ZE(E,n)),...s.names,...u.added.map(E=>E.path),...u.failed];this.attachments.add(i),this.attachments.addMentions(m);let h=[];if(i.length>0&&h.push(`${i.length} image${i.length===1?"":"s"} attached`),m.length>0&&h.push(`${m.length} file${m.length===1?"":"s"} added to the prompt`),h.length>0){this.attachments.say("info",h.join(" \xB7 "));return}let y=Array.from(o.types??[]).join(", ")||"none";this.attachments.say("warn",`That drop carried no file (types: ${y}).`)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Pe({token:t,factory:t.\u0275fac,providedIn:"root"})};function ZA(){let t=document.querySelector("main.chat");if(!t)return{x:0,y:0};let e=t.getBoundingClientRect();return{x:e.left+e.width/2,y:e.top+e.height*.35}}var KA=["application/vnd.code.uri-list","ResourceURLs","text/uri-list"];function QA(t){let e=[];for(let r of[...KA,"text/plain"])for(let i of XA(t.getData(r)))e.push(i);let n=[],o=[];for(let r of e){if(r.startsWith("file://")){let s=nR(r);s&&n.push(s);continue}if(/^[a-z]+:\/\//i.test(r))continue;if(tR(r)){n.push(r);continue}let i=eR(r);i&&o.push(i)}return{paths:Array.from(new Set(n)),names:Array.from(new Set(o))}}function XA(t){let e=t.trim();if(e.length===0)return[];if(e.startsWith("["))try{let n=JSON.parse(e);if(Array.isArray(n))return n.map(o=>{if(typeof o=="string")return o;let r=o,i=r.fsPath??r.uri??r.path;return typeof i=="string"?i:""}).filter(o=>o.length>0)}catch{}return JA(e)}function JA(t){return t.split(/\r?\n/).flatMap(e=>e.split(/(?<=\S)\s+(?=[/\\]|[A-Za-z]:[\\/])/)).map(e=>e.trim()).filter(e=>e.length>0&&!e.startsWith("#"))}function eR(t){let e=t.replace(/\s*\([^)]*\)\s*$/,"").trim();if(!(e.length===0||e.length>200)&&!(/\s/.test(e)||e.includes(":")))return/[^/\\]+\.[A-Za-z0-9]{1,8}$/.test(e)?e:void 0}function tR(t){return!!(t.startsWith("/")||/^[A-Za-z]:[\\/]/.test(t))}function nR(t){try{let e=new URL(t);return decodeURIComponent(e.pathname)}catch{return}}function ZE(t,e){if(!e)return t;let n=e.endsWith("/")?e:`${e}/`;return t.startsWith(n)?t.slice(n.length):t}var oR=(t,e)=>e.path,rR=(t,e)=>e.id;function iR(t,e){if(t&1){let n=Y();C(0,"div",8)(1,"button",9),ee("click",function(){D(n);let r=v().$implicit,i=v();return k(i.toggleGroup(r.path))}),C(2,"span",10),g(3),w(),C(4,"span",11),g(5),w(),C(6,"span",12),g(7,"\u203A"),w()(),C(8,"button",13),ee("click",function(r){D(n);let i=v().$implicit,s=v();return k(s.newSession(r,i.path))}),g(9," + "),w()()}if(t&2){let n=v().$implicit,o=v();f(),et("title",n.path),He("aria-expanded",!o.isCollapsed(n.path)),f(2),$(n.name),f(2),$(n.sessions.length),f(),Be("open",!o.isCollapsed(n.path)),f(2),He("aria-label","New session in "+n.name)}}function sR(t,e){t&1&&st(0,"span",15)}function aR(t,e){if(t&1){let n=Y();C(0,"li")(1,"button",14),ee("click",function(){let r=D(n).$implicit,i=v(3);return k(i.activate(r))})("contextmenu",function(r){let i=D(n).$implicit,s=v(3);return k(s.openMenu(r,i))}),A(2,sR,1,0,"span",15),C(3,"span",16),g(4),w(),C(5,"span",17),g(6),w()()()}if(t&2){let n=e.$implicit,o=v(3);f(),Be("active",n.id===o.activeSessionId())("running",o.isRunning(n)),et("title",n.id),f(),R(o.isRunning(n)?2:-1),f(2),$(n.title),f(2),Kn("",n.messageCount," \xB7 ",o.age(n.updatedAt))}}function cR(t,e){t&1&&(C(0,"li",7),g(1,"No sessions yet."),w())}function lR(t,e){if(t&1&&(C(0,"ul"),ze(1,aR,7,9,"li",null,rR,!1,cR,2,0,"li",7),w()),t&2){let n=v().$implicit;f(),Ge(n.sessions)}}function dR(t,e){if(t&1&&(C(0,"section",6),A(1,iR,10,7,"div",8),A(2,lR,4,1,"ul"),w()),t&2){let n=e.$implicit,o=v();f(),R(o.scope()==="global"?1:-1),f(),R(o.scope()==="workspace"||!o.isCollapsed(n.path)?2:-1)}}function uR(t,e){t&1&&(C(0,"p",7),g(1,"Nothing found."),w())}function pR(t,e){if(t&1){let n=Y();C(0,"p",20),g(1,"Delete this session?"),w(),C(2,"p",21),g(3),w(),C(4,"button",22),ee("click",function(){D(n);let r=v(2);return k(r.closeMenu())}),g(5,"Cancel"),w(),C(6,"button",23),ee("click",function(){D(n);let r=v(),i=v();return k(i.deleteNow(r.session))}),g(7," Delete "),w()}if(t&2){let n=v();f(3),$(n.session.title)}}function fR(t,e){if(t&1){let n=Y();C(0,"button",22),ee("click",function(){D(n);let r=v(),i=v();return k(i.closeNow(r.session))}),g(1," Close session "),w(),C(2,"button",23),ee("click",function(){D(n);let r=v(),i=v();return k(i.askDelete(r))}),g(3," Delete session\u2026 "),w()}}function mR(t,e){if(t&1){let n=Y();C(0,"div",18),ee("click",function(){D(n);let r=v();return k(r.closeMenu())})("contextmenu",function(r){D(n);let i=v();return r.preventDefault(),k(i.closeMenu())}),w(),C(1,"div",19),A(2,pR,8,1)(3,fR,4,0),w()}if(t&2){let n=e;f(),Io("left",n.x,"px")("top",n.y,"px"),f(),R(n.confirming?2:3)}}var qd=class t{morse=O(Ht);shell=O(Lo);query=H("");collapsed=H({});menu=H(void 0);nativeDialogs=T(()=>this.morse.capabilities()?.nativeDialogs===!0);activeSessionId=T(()=>this.morse.state().sessionId);sessionActivity=this.morse.sessionActivity;scope=T(()=>this.morse.capabilities()?.scope??"global");directoryPicker=T(()=>this.morse.capabilities()?.directoryPicker===!0);isRunning(e){let n=this.sessionActivity().get(e.id);return n!==void 0?n.streaming||n.busy:e.id===this.activeSessionId()&&this.morse.running()}groups=T(()=>{let e=this.morse.sessions();if(this.scope()==="workspace"){let n=this.morse.workspace(),o=this.morse.projects()[0];return[{path:o?.path??n.cwd,name:n.name||o?.name||"workspace",sessions:e}]}return this.morse.projects().map(n=>({path:n.path,name:n.name,sessions:e.filter(o=>o.cwd===n.path)}))});visibleGroups=T(()=>{let e=this.query().trim().toLowerCase();return e.length===0?this.groups():this.groups().map(n=>Q(V({},n),{sessions:n.sessions.filter(o=>o.title.toLowerCase().includes(e))})).filter(n=>n.name.toLowerCase().includes(e)||n.path.toLowerCase().includes(e)||n.sessions.length>0)});isCollapsed(e){return this.collapsed()[e]===!0}toggleGroup(e){this.collapsed.update(n=>Q(V({},n),{[e]:n[e]!==!0}))}activate(e){this.morse.activateSession(e.id,e.cwd),this.shell.closeNavigation()}openMenu(e,n){e.preventDefault(),e.stopPropagation(),this.menu.set({x:Math.max(0,Math.min(e.clientX,window.innerWidth-200)),y:Math.max(0,Math.min(e.clientY,window.innerHeight-104)),session:n,confirming:!1})}closeMenu(){this.menu.set(void 0)}closeNow(e){this.closeMenu(),this.morse.closeSession(e.id)}askDelete(e){if(this.nativeDialogs()){this.confirmOnHost(e);return}this.menu.set(Q(V({},e),{confirming:!0}))}async confirmOnHost(e){let n=await this.morse.requestHostCommand("confirmDeleteSession",{sessionId:e.session.id,title:e.session.title});if(n===void 0){this.menu.set(Q(V({},e),{confirming:!0}));return}this.closeMenu(),n.confirmed===!0&&this.morse.deleteSession(e.session.id)}deleteNow(e){this.closeMenu(),this.morse.deleteSession(e.id)}onEscape(){this.menu()!==void 0&&this.closeMenu()}newSession(e,n){if(e.stopPropagation(),n===void 0&&this.directoryPicker()){this.shell.openProjectPicker(),this.shell.closeNavigation();return}this.morse.newSession(n??this.morse.workspace().cwd),this.shell.closeNavigation()}refresh(){this.morse.requestProjects(),this.morse.requestSessions()}onQuery(e){this.query.set(e.target.value)}age(e){if(e<=0)return"";let n=Math.max(0,Math.round((Date.now()-e)/1e3));if(n<60)return`${n}s`;let o=Math.round(n/60);if(o<60)return`${o}m`;let r=Math.round(o/60);return r<24?`${r}h`:`${Math.round(r/24)}d`}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Le({type:t,selectors:[["morse-session-nav"]],hostBindings:function(n,o){n&1&&U("keydown.escape",function(){return o.onEscape()},An)},decls:12,vars:4,consts:[[1,"head"],["type","button",1,"primary",3,"click"],["type","button","title","Refresh",1,"secondary","icon",3,"click"],[1,"search"],["type","search","aria-label","Search sessions",3,"input","value","placeholder"],[1,"list"],[1,"group"],[1,"empty"],[1,"group-head"],["type","button",1,"group-title",3,"click","title"],[1,"name"],[1,"count"],[1,"chevron"],["type","button","title","New session in this project",1,"group-new",3,"click"],["type","button",1,"session",3,"click","contextmenu","title"],["aria-hidden","true",1,"pulse"],[1,"title"],[1,"meta"],[1,"context-menu-layer",3,"click","contextmenu"],["role","menu",1,"context-menu"],[1,"context-menu-question"],[1,"context-menu-title"],["type","button",1,"context-menu-item",3,"click"],["type","button",1,"context-menu-item","danger",3,"click"]],template:function(n,o){if(n&1&&(C(0,"div",0)(1,"button",1),ee("click",function(i){return o.newSession(i)}),g(2," New session "),w(),C(3,"button",2),ee("click",function(){return o.refresh()}),g(4,"\u27F3"),w()(),C(5,"div",3)(6,"input",4),ee("input",function(i){return o.onQuery(i)}),w()(),C(7,"div",5),ze(8,dR,3,2,"section",6,oR,!1,uR,2,0,"p",7),w(),A(11,mR,4,5)),n&2){let r;f(6),et("value",o.query())("placeholder",o.scope()==="global"?"Search projects and sessions\u2026":"Search sessions\u2026"),f(2),Ge(o.visibleGroups()),f(3),R((r=o.menu())?11:-1,r)}},styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;min-height:0;height:100%;background:var(--%NS%morse-nav-bg);border-right:1px solid var(--%NS%morse-border)}.head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;padding:10px;border-bottom:1px solid var(--%NS%morse-border)}.head[_ngcontent-%COMP%] button.primary[_ngcontent-%COMP%]{flex:1;padding:5px 10px}.search[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;padding:8px 10px 4px}input[_ngcontent-%COMP%]{width:100%}.list[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;padding:4px 6px 10px}.group[_ngcontent-%COMP%] + .group[_ngcontent-%COMP%]{margin-top:6px}.group-head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:2px}.group-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;flex:1;min-width:0;padding:5px 6px;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg-muted);font-size:11px;font-weight:600;letter-spacing:.03em;text-transform:uppercase;cursor:pointer}.group-title[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover)}.group-title[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}.group-title[_ngcontent-%COMP%] .count[_ngcontent-%COMP%]{flex:none}.group-new[_ngcontent-%COMP%]{flex:none;padding:1px 6px 2px;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg-muted);font-size:15px;line-height:1.2;cursor:pointer}.group-new[_ngcontent-%COMP%]:hover, .group-new[_ngcontent-%COMP%]:focus-visible{background:var(--%NS%morse-hover);color:var(--%NS%morse-fg)}.group-title[_ngcontent-%COMP%] .path[_ngcontent-%COMP%]{max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:rtl;font-weight:400;text-transform:none}.chevron[_ngcontent-%COMP%]{transition:transform .12s ease}.chevron.open[_ngcontent-%COMP%]{transform:rotate(90deg)}ul[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0}.session[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;width:100%;padding:5px 8px;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg);text-align:left;cursor:pointer}.session[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover)}.session.active[_ngcontent-%COMP%]{background:var(--%NS%morse-active);font-weight:500;box-shadow:inset 2px 0 0 var(--%NS%morse-accent)}.session[_ngcontent-%COMP%] .pulse[_ngcontent-%COMP%]{flex:none;position:relative;width:7px;height:7px;border-radius:50%;background:var(--%NS%morse-accent)}.session[_ngcontent-%COMP%] .pulse[_ngcontent-%COMP%]:after{content:"";position:absolute;inset:0;border-radius:50%;background:var(--%NS%morse-accent);animation:_ngcontent-%COMP%_morse-pulse 1.5s ease-out infinite}@keyframes _ngcontent-%COMP%_morse-pulse{0%{transform:scale(1);opacity:.6}to{transform:scale(2.6);opacity:0}}.session[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session[_ngcontent-%COMP%] .meta[_ngcontent-%COMP%]{font-size:11px;white-space:nowrap;opacity:.8}.context-menu-layer[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:40}.context-menu[_ngcontent-%COMP%]{position:fixed;z-index:41;width:220px;max-width:min(280px,90vw);padding:4px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-panel, var(--%NS%morse-bg));box-shadow:0 8px 24px #00000059}.context-menu-question[_ngcontent-%COMP%]{margin:3px 7px 0;font-size:11.5px;color:var(--%NS%morse-fg)}.context-menu-title[_ngcontent-%COMP%]{margin:2px 7px 6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;color:var(--%NS%morse-fg-muted)}.context-menu-item[_ngcontent-%COMP%]{display:block;width:100%;padding:5px 8px;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg);font-size:12px;text-align:left;cursor:pointer}.context-menu-item[_ngcontent-%COMP%]:hover, .context-menu-item[_ngcontent-%COMP%]:focus-visible{background:var(--%NS%morse-hover)}.context-menu-item.danger[_ngcontent-%COMP%]{color:var(--%NS%morse-error)}.empty[_ngcontent-%COMP%]{padding:8px;font-size:12px;color:var(--%NS%morse-fg-muted)}']})};var KE=(t,e)=>e.path;function hR(t,e){if(t&1){let n=Y();C(0,"button",20),ee("click",function(){let r=D(n).$implicit,i=v(2);return k(i.go(r.path))}),g(1),w()}if(t&2){let n=e.$implicit;et("title",n.path),f(),pt(" ",n.name," ")}}function gR(t,e){if(t&1&&(C(0,"div",9),ze(1,hR,2,2,"button",19,KE),w()),t&2){let n=v();f(),Ge(n.roots())}}function yR(t,e){t&1&&(C(0,"p",11),g(1,"Reading folder\u2026"),w())}function vR(t,e){t&1&&(C(0,"p",12),g(1),w()),t&2&&(f(),$(e))}function _R(t,e){if(t&1){let n=Y();C(0,"button",22),ee("click",function(){let r=D(n),i=v(2);return k(i.go(r))}),C(1,"span",23),g(2,"\u21B0"),w(),C(3,"span",24),g(4,".."),w()()}t&2&&et("title",e)}function bR(t,e){if(t&1){let n=Y();C(0,"button",22),ee("click",function(){let r=D(n).$implicit,i=v(2);return k(i.go(r.path))}),C(1,"span",23),g(2,"\u25B8"),w(),C(3,"span",24),g(4),w()()}if(t&2){let n=e.$implicit;et("title",n.path),f(4),$(n.name)}}function ER(t,e){t&1&&(C(0,"p",11),g(1,"No subfolders here."),w())}function xR(t,e){if(t&1&&A(0,ER,2,0,"p",11),t&2){let n=v(2);R(n.parent()===void 0&&n.directories().length===0?0:-1)}}function CR(t,e){if(t&1&&(A(0,_R,5,1,"button",21),ze(1,bR,5,2,"button",21,KE,!1,xR,1,1)),t&2){let n,o=v();R((n=o.parent())?0:-1,n),f(),Ge(o.directories())}}function wR(t,e){t&1&&(C(0,"em"),g(1," \xB7 not in MORSE_PROJECTS"),w())}function SR(t,e){t&1&&(C(0,"em",15),g(1," \xB7 git"),w())}var Yd=class t{morse=O(Ht);shell=O(Lo);loading=H(!1);error=H(void 0);path=H("");draftPath=H("");parent=H(void 0);directories=H([]);roots=H([]);isGitRepo=H(!1);canOpen=H(!1);constructor(){this.load()}go(e){let n=e?.trim();this.load(n&&n.length>0?n:void 0)}onPathInput(e){this.draftPath.set(e.target.value)}close(){this.shell.closeProjectPicker()}confirm(){let e=this.path();e.length===0||!this.canOpen()||(this.morse.newSession(e),this.shell.closeNavigation(),this.close())}onEscape(){this.close()}load(e){this.loading.set(!0),this.error.set(void 0),this.morse.requestHostCommand("listDirectories",e?{path:e}:void 0).then(n=>{this.loading.set(!1);let o=n;if(!o||typeof o.path!="string"){this.error.set("That folder could not be read.");return}this.path.set(o.path),this.draftPath.set(o.path),this.parent.set(o.parent),this.directories.set(o.directories??[]),this.roots.set(o.roots??[]),this.isGitRepo.set(o.isGitRepo===!0),this.canOpen.set(o.canOpen===!0)})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Le({type:t,selectors:[["morse-project-picker"]],hostBindings:function(n,o){n&1&&U("keydown.escape",function(){return o.onEscape()},An)},decls:30,vars:10,consts:[[1,"modal-layer",3,"click"],["role","dialog","aria-modal","true","aria-label","Choose the folder for a new session",1,"modal-card",3,"click"],[1,"modal-head"],["type","button","title","Close","aria-label","Close",1,"close",3,"click"],[1,"modal-sub"],[1,"path-row"],["type","button","title","Parent folder","aria-label","Parent folder",3,"click","disabled"],["type","text","spellcheck","false","autocomplete","off","aria-label","Folder path",3,"input","keydown.enter","value"],["type","button",3,"click","disabled"],[1,"roots"],[1,"listing"],[1,"state"],[1,"state","error"],[1,"modal-foot"],[1,"selected",3,"title"],[1,"ok"],[1,"actions"],["type","button",1,"secondary",3,"click"],["type","button",1,"primary",3,"click","disabled"],["type","button",1,"chip",3,"title"],["type","button",1,"chip",3,"click","title"],["type","button",1,"row",3,"title"],["type","button",1,"row",3,"click","title"],["aria-hidden","true",1,"folder"],[1,"name"]],template:function(n,o){if(n&1&&(C(0,"div",0),ee("click",function(){return o.close()}),C(1,"div",1),ee("click",function(i){return i.stopPropagation()}),C(2,"header",2)(3,"strong"),g(4,"New session"),w(),C(5,"button",3),ee("click",function(){return o.close()}),g(6," \xD7 "),w()(),C(7,"p",4),g(8," Choose the project folder the agent should run in. It starts only after your first prompt. "),w(),C(9,"div",5)(10,"button",6),ee("click",function(){return o.go(o.parent())}),g(11," \u2191 "),w(),C(12,"input",7),ee("input",function(i){return o.onPathInput(i)})("keydown.enter",function(){return o.go(o.draftPath())}),w(),C(13,"button",8),ee("click",function(){return o.go(o.draftPath())}),g(14," Go "),w()(),A(15,gR,3,0,"div",9),C(16,"div",10),A(17,yR,2,0,"p",11)(18,vR,2,1,"p",12)(19,CR,4,2),w(),C(20,"footer",13)(21,"span",14),g(22),A(23,wR,2,0,"em"),A(24,SR,2,0,"em",15),w(),C(25,"div",16)(26,"button",17),ee("click",function(){return o.close()}),g(27,"Cancel"),w(),C(28,"button",18),ee("click",function(){return o.confirm()}),g(29," New session here "),w()()()()()),n&2){let r;f(10),et("disabled",o.parent()===void 0),f(2),et("value",o.draftPath()),f(),et("disabled",o.draftPath().trim().length===0),f(2),R(o.roots().length>0?15:-1),f(2),R(o.loading()?17:(r=o.error())?18:19,r),f(4),et("title",o.path()),f(),pt(" ",o.path()," "),f(),R(o.canOpen()?-1:23),f(),R(o.isGitRepo()?24:-1),f(4),et("disabled",!o.canOpen()||o.loading())}},styles:["[_nghost-%COMP%]{display:contents}.modal-layer[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;padding:24px;background:#00000073}.modal-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:min(560px,100%);max-height:min(640px,90vh);border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-lg);background:var(--%NS%morse-panel, var(--%NS%morse-bg));box-shadow:0 18px 48px #0006;overflow:hidden}.modal-head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:12px 14px;border-bottom:1px solid var(--%NS%morse-border)}.modal-head[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{flex:1;font-size:13px}.modal-head[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{padding:2px 8px;border:0;background:transparent;color:var(--%NS%morse-fg-muted);font-size:16px;line-height:1;cursor:pointer}.modal-head[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]:hover{color:var(--%NS%morse-fg)}.modal-sub[_ngcontent-%COMP%]{margin:0;padding:8px 14px 0;color:var(--%NS%morse-fg-muted);font-size:11.5px}.path-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;padding:10px 14px}.path-row[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1;min-width:0;font-family:var(--%NS%morse-font-mono);font-size:12px}.path-row[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{flex:none;padding:4px 10px}.roots[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px;padding:0 14px 8px}.chip[_ngcontent-%COMP%]{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:2px 9px;border:1px solid var(--%NS%morse-border);border-radius:999px;background:transparent;color:var(--%NS%morse-fg-muted);font-size:11px;cursor:pointer}.chip[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover);color:var(--%NS%morse-fg)}.listing[_ngcontent-%COMP%]{flex:1;min-height:160px;overflow-y:auto;border-top:1px solid var(--%NS%morse-border);padding:4px 6px}.row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%;padding:6px 8px;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg);text-align:left;cursor:pointer}.row[_ngcontent-%COMP%]:hover, .row[_ngcontent-%COMP%]:focus-visible{background:var(--%NS%morse-hover)}.row[_ngcontent-%COMP%] .folder[_ngcontent-%COMP%]{flex:none;width:14px;color:var(--%NS%morse-fg-muted);text-align:center}.row[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row[_ngcontent-%COMP%] .mark[_ngcontent-%COMP%]{flex:none;padding:0 6px;border-radius:999px;background:var(--%NS%morse-badge-bg);color:var(--%NS%morse-badge-fg);font-size:10px}.state[_ngcontent-%COMP%]{margin:8px;color:var(--%NS%morse-fg-muted);font-size:12px}.state.error[_ngcontent-%COMP%]{color:var(--%NS%morse-error)}.modal-foot[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:12px 14px;border-top:1px solid var(--%NS%morse-border)}.selected[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:rtl;text-align:left;color:var(--%NS%morse-fg-muted);font-family:var(--%NS%morse-font-mono);font-size:11px}.selected[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{color:var(--%NS%morse-warn, var(--%NS%morse-error));font-style:normal}.actions[_ngcontent-%COMP%]{display:flex;flex:none;gap:6px}"]})};function TR(t,e){if(t&1){let n=Y();_(0,"morse-boot-splash",10),U("dismissed",function(){D(n);let r=v();return k(r.onBootDismissed())}),b()}if(t&2){let n=v();X("ready",n.bootReady())("status",n.bootStatus())}}function MR(t,e){if(t&1){let n=Y();_(0,"morse-connection-screen",11),U("retry",function(){D(n);let r=v();return k(r.retryConnection())})("explore",function(){D(n);let r=v();return k(r.onConnectionExplore())})("connect",function(r){D(n);let i=v();return k(i.onConnectionConnect(r))}),b()}if(t&2){let n=e;X("eyebrow",n.eyebrow)("title",n.title)("body",n.body)("detail",n.detail)}}function IR(t,e){t&1&&Ke(0,"morse-project-picker")}function DR(t,e){if(t&1){let n=Y();_(0,"button",12),U("click",function(){D(n);let r=v();return k(r.closeNavigation())}),b()}}function kR(t,e){t&1&&(_(0,"div",6),Ke(1,"span",13),_(2,"div",14)(3,"span",15),g(4,"\u2913"),b(),_(5,"strong"),g(6,"Drop to attach"),b(),_(7,"span"),g(8,"Images ride with the prompt \xB7 other files become "),_(9,"code"),g(10,"@mentions"),b()()()()),t&2&&(f(2),X("morseEnter",0)("morseEnterY",-6))}function NR(t,e){if(t&1){let n=Y();_(0,"section",7)(1,"strong"),g(2,"Offline \u2014 the host wouldn't take this frontend"),b(),_(3,"p"),g(4),Ke(5,"br"),g(6),b(),_(7,"div",16)(8,"button",17),U("click",function(){D(n);let r=v();return k(r.reload())}),g(9,"Reload"),b(),_(10,"button",18),U("click",function(){D(n);let r=v();return k(r.retryConnection())}),g(11,"Retry"),b(),_(12,"button",18),U("click",function(){D(n);let r=v();return k(r.showLog())}),g(13,"Show log"),b()()()}if(t&2){let n=e;f(4),$(n.message),f(2),$(n.detail)}}function OR(t,e){if(t&1){let n=Y();_(0,"section",7)(1,"strong"),g(2,"Offline \u2014 reconnecting"),b(),_(3,"p"),g(4," Morse keeps retrying in the background; the rest of the interface stays available while it does. "),b(),_(5,"div",16)(6,"button",17),U("click",function(){D(n);let r=v();return k(r.retryConnection())}),g(7,"Retry now"),b(),_(8,"button",18),U("click",function(){D(n);let r=v();return k(r.showConnectionHelp())}),g(9," Connection help "),b()()()}}function AR(t,e){if(t&1){let n=Y();_(0,"section",8)(1,"strong"),g(2,"Pi agent unavailable"),b(),_(3,"p"),g(4),b(),_(5,"div",16)(6,"button",17),U("click",function(){D(n);let r=v();return k(r.retryAgent())}),g(7,"Retry"),b(),_(8,"button",18),U("click",function(){D(n);let r=v();return k(r.openSettings())}),g(9,"Open settings"),b(),_(10,"button",18),U("click",function(){D(n);let r=v();return k(r.showLog())}),g(11,"Show log"),b()()()}if(t&2){let n=v();f(4),$(n.agentError()||"Morse could not start the pi coding agent.")}}function RR(t,e){if(t&1){let n=Y();_(0,"div",19)(1,"span",20),g(2),b(),_(3,"button",21),U("click",function(){D(n);let r=v();return k(r.dismissToast())}),g(4," \xD7 "),b()()}if(t&2){let n=e;Zo(n.level),f(2),$(n.text)}}function PR(){return typeof location>"u"?!1:new URL(location.href,"http://localhost/").searchParams.get("boot")==="1"}var Zd=class t{morse=O(Ht);shell=O(Lo);dropZone=O(Wd);animation=O(pn);attachments=O(br);destroyRef=O(zt);dismissedNoticeAt=H(null);noticeTimer;bootPreview=PR();bootPending=this.animation.isEnabled&&(this.bootPreview||this.morse.connection()==="connecting");bootForceTimer;bootVisible=H(this.bootPending);bootForced=H(!1);connectionDismissed=H(!1);offline=H(!1);navigationOpen=this.shell.navigationOpen;projectPickerOpen=this.shell.projectPickerOpen;connection=this.morse.connection;agentReady=this.morse.agentReady;agentStarting=this.morse.agentStarting;agentError=this.morse.agentError;lastError=this.morse.lastError;dragging=this.dropZone.active;toast=T(()=>{let e=this.morse.lastNotice(),n=this.attachments.notice(),o=n&&(!e||n.at>=e.at)?n:e;return!o||o.at===this.dismissedNoticeAt()?null:o});autoDismiss=ke(()=>{let e=this.toast();if(this.clearNoticeTimer(),!e)return;let n=e.level==="warn"||e.level==="error"?6e3:3200;this.noticeTimer=setTimeout(()=>this.dismissedNoticeAt.set(e.at),n)});constructor(){this.bootPending&&(this.bootForceTimer=setTimeout(()=>this.bootForced.set(!0),7e3)),ke(()=>{let e=this.morse.connection();if(e==="ready"){this.offline.set(!1),this.connectionDismissed.set(!1);return}(e==="error"||e==="closed"||this.morse.slowConnection())&&this.offline.set(!0)}),this.destroyRef.onDestroy(()=>{this.clearNoticeTimer(),this.clearBootTimer()})}onBootDismissed(){this.bootVisible.set(!1),this.clearBootTimer()}onConnectionExplore(){this.connectionDismissed.set(!0)}showConnectionHelp(){this.connectionDismissed.set(!1)}onConnectionConnect(e){if(typeof location>"u")return;let n=new URL(location.href);n.searchParams.set("server",e),location.href=n.toString()}clearBootTimer(){this.bootForceTimer!==void 0&&(clearTimeout(this.bootForceTimer),this.bootForceTimer=void 0)}clearNoticeTimer(){this.noticeTimer!==void 0&&(clearTimeout(this.noticeTimer),this.noticeTimer=void 0)}bootReady=T(()=>{if(this.bootForced())return!0;let e=this.morse.connection();return e==="error"||e==="closed"||this.morse.slowConnection()?!0:e==="ready"});bootStatus=T(()=>this.morse.connection()!=="ready"?"Connecting to the host\u2026":this.morse.agentStarting()?"Starting the pi agent\u2026":this.morse.agentError()!==void 0?"The agent could not start":"Ready");connectionScreen=T(()=>{if(this.bootVisible()||this.connectionDismissed()||!this.offline())return null;let e=this.lastError();return e?{eyebrow:"Handshake refused",title:"The host turned this frontend away",body:"The socket is up, but the handshake was rejected. That usually means the frontend and the host disagree on the wire protocol \u2014 rebuild both together.",detail:e.detail?`${e.message} \u2014 ${e.detail}`:e.message}:this.morse.slowConnection()&&this.morse.connection()==="connecting"?{eyebrow:"No answer yet",title:"The host is not answering",body:"A socket opened but the handshake never came back. The host may still be starting, or this address is not a Morse host.",detail:this.morse.connectionDetail()??""}:{eyebrow:"Offline \xB7 reconnecting",title:"Morse is waiting for a host",body:"This window is only the frontend. The pi coding agent runs behind a Morse host \u2014 start one and this screen will clear itself.",detail:this.morse.connectionDetail()??""}});closeNavigation(){this.shell.closeNavigation()}retryConnection(){this.morse.ready()}reload(){typeof location<"u"&&location.reload()}retryAgent(){this.morse.newSession()}openSettings(){this.morse.hostCommand("openSettings")}showLog(){this.morse.hostCommand("showOutput")}dismissToast(){this.dismissedNoticeAt.set(this.toast()?.at??this.morse.lastNotice()?.at??null)}liveDropzone=ke(()=>{let e=this.dragging();this.stopDropzoneLoops(),e&&setTimeout(()=>{if(!this.dragging())return;let n=globalThis.document?.querySelector(".dropzone")??void 0;if(!n)return;let o=n.querySelector(".dropzone-card"),r=n.querySelector(".dropzone-icon"),i=n.querySelector(".dropzone-ring");this.dropzoneStops=[this.animation.loop(i,{scale:[1,1.035],opacity:[.9,.25]},{duration:1100}),this.animation.loop(o,{scale:[1,1.03]},{duration:700}),this.animation.loop(r,{translateY:[1.5,-3]},{duration:520})]},0)});dropzoneStops=[];stopDropzoneLoops(){for(let e of this.dropzoneStops)e();this.dropzoneStops=[]}onDragEnter(e){this.dropZone.onDragEnter(e)}onDragOver(e){this.dropZone.onDragOver(e)}onDragLeave(){this.dropZone.onDragLeave()}onDrop(e){this.dropZone.onDrop(e,this.morse.state().workspace.cwd)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Le({type:t,selectors:[["app-root"]],decls:16,vars:11,consts:[[1,"shell"],[3,"ready","status"],[3,"eyebrow","title","body","detail"],[1,"nav"],["type","button","aria-label","Close navigation",1,"scrim"],[1,"chat",3,"dragenter","dragover","dragleave","drop"],["aria-hidden","true",1,"dropzone"],["role","status",1,"alert","offline"],["role","alert",1,"alert"],["role","status",1,"toast",3,"class"],[3,"dismissed","ready","status"],[3,"retry","explore","connect","eyebrow","title","body","detail"],["type","button","aria-label","Close navigation",1,"scrim",3,"click"],[1,"dropzone-ring"],[1,"dropzone-card",3,"morseEnter","morseEnterY"],[1,"dropzone-icon"],[1,"actions"],["type","button",3,"click"],["type","button",1,"secondary",3,"click"],["role","status",1,"toast"],[1,"toast-text"],["type","button","aria-label","Dismiss",1,"toast-close",3,"click"]],template:function(n,o){if(n&1&&(_(0,"div",0),A(1,TR,1,2,"morse-boot-splash",1),A(2,MR,1,4,"morse-connection-screen",2),Ke(3,"morse-session-nav",3),A(4,IR,1,0,"morse-project-picker"),A(5,DR,1,0,"button",4),_(6,"main",5),U("dragenter",function(i){return o.onDragEnter(i)})("dragover",function(i){return o.onDragOver(i)})("dragleave",function(){return o.onDragLeave()})("drop",function(i){return o.onDrop(i)}),A(7,kR,11,2,"div",6),Ke(8,"morse-chat-header"),A(9,NR,14,2,"section",7)(10,OR,10,0,"section",7)(11,AR,12,1,"section",8),Ke(12,"morse-chat-transcript")(13,"morse-interaction-panel")(14,"morse-chat-composer"),A(15,RR,5,3,"div",9),b()()),n&2){let r,i,s;f(),R(o.bootVisible()?1:-1),f(),R((r=o.connectionScreen())?2:-1,r),f(),Be("open",o.navigationOpen()),f(),R(o.projectPickerOpen()?4:-1),f(),R(o.navigationOpen()?5:-1),f(),Be("dropping",o.dragging()),f(),R(o.dragging()?7:-1),f(2),R((i=o.lastError())?9:o.offline()?10:o.connection()==="ready"&&!o.agentReady()&&!o.agentStarting()&&o.agentError()!==void 0?11:-1,i),f(6),R((s=o.toast())?15:-1,s)}},dependencies:[qd,Yd,Cd,Ud,zd,xd,nn,cd,ld],styles:["[_nghost-%COMP%]{display:block;height:100%}.shell[_ngcontent-%COMP%]{position:relative;display:grid;grid-template-columns:272px minmax(0,1fr);height:100%;min-height:0;overflow:hidden;background:var(--%NS%morse-bg)}.nav[_ngcontent-%COMP%]{min-width:0}.chat[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:0;min-height:0;position:relative}.dropzone[_ngcontent-%COMP%]{position:absolute;inset:0;z-index:15;display:flex;align-items:center;justify-content:center;padding:16px;pointer-events:none;background:color-mix(in srgb,var(--%NS%morse-accent) 12%,transparent);border:2px dashed color-mix(in srgb,var(--%NS%morse-accent) 70%,transparent);border-radius:var(--%NS%morse-radius-md);animation:_ngcontent-%COMP%_dropzone-in .14s ease-out}.dropzone-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:4px;max-width:320px;padding:14px 18px;border:1px solid var(--%NS%morse-accent);border-radius:var(--%NS%morse-radius-lg);background:var(--%NS%morse-panel, var(--%NS%morse-bg));color:var(--%NS%morse-fg);box-shadow:0 8px 24px #0000004d;text-align:center;font-size:12px}.dropzone-card[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:13px}.dropzone-card[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:var(--%NS%morse-font-mono);font-size:11px;padding:0 4px;border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-hover)}.dropzone-icon[_ngcontent-%COMP%]{font-size:18px;color:var(--%NS%morse-accent)}.dropzone-ring[_ngcontent-%COMP%]{position:absolute;inset:6px;border:2px dashed color-mix(in srgb,var(--%NS%morse-accent) 45%,transparent);border-radius:var(--%NS%morse-radius-md);pointer-events:none}@keyframes _ngcontent-%COMP%_dropzone-in{0%{opacity:0}}.scrim[_ngcontent-%COMP%]{display:none}.alert[_ngcontent-%COMP%]{margin:10px;padding:10px 12px;border:1px solid var(--%NS%morse-error);border-radius:var(--%NS%morse-radius-md);background:var(--%NS%morse-hover);display:flex;flex-direction:column;gap:8px}.alert[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;white-space:pre-wrap;color:var(--%NS%morse-fg-muted)}.alert.offline[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--%NS%morse-warn) 55%,var(--%NS%morse-border))}.actions[_ngcontent-%COMP%]{display:flex;gap:6px;flex-wrap:wrap}.toast[_ngcontent-%COMP%]{position:absolute;z-index:30;top:10px;right:10px;max-width:min(420px,calc(100% - 20px));display:flex;align-items:flex-start;gap:6px;padding:8px 8px 8px 10px;border-radius:var(--%NS%morse-radius-md);border-left:3px solid var(--%NS%morse-info);background:var(--%NS%morse-panel, var(--%NS%morse-badge-bg));color:var(--%NS%morse-fg);box-shadow:0 8px 24px #0000004d;animation:_ngcontent-%COMP%_toast-in .16s ease-out}.toast-text[_ngcontent-%COMP%]{flex:1;min-width:0;white-space:pre-wrap;font-size:12px;line-height:1.45}.toast-close[_ngcontent-%COMP%]{flex:none;width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg-muted);font-size:14px;line-height:1;cursor:pointer}.toast-close[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover);color:var(--%NS%morse-fg)}.toast.warn[_ngcontent-%COMP%]{border-color:var(--%NS%morse-warn)}.toast.error[_ngcontent-%COMP%]{border-color:var(--%NS%morse-error)}.toast.success[_ngcontent-%COMP%]{border-color:var(--%NS%morse-success)}@keyframes _ngcontent-%COMP%_toast-in{0%{opacity:0;transform:translateY(-6px)}}@media(max-width:759px){.shell[_ngcontent-%COMP%]{grid-template-columns:minmax(0,1fr)}.nav[_ngcontent-%COMP%]{position:absolute;z-index:20;top:0;bottom:0;left:0;width:min(86%,320px);transform:translate(-102%);transition:transform .16s ease;box-shadow:0 0 24px #00000059}.nav.open[_ngcontent-%COMP%]{transform:none}.scrim[_ngcontent-%COMP%]{display:block;position:absolute;z-index:10;inset:0;border:0;padding:0;background:#00000059}.scrim[_ngcontent-%COMP%]:hover, .scrim[_ngcontent-%COMP%]:active{background:#00000059}}"]})};Jf(Zd,O_).catch(t=>console.error(t));