@memberjunction/ng-realtime-widget 6.2.0-edge.8 → 6.2.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,4 +1,4 @@
1
- import{$ as dl,$a as A,$b as jI,A as Ge,Aa as B,Ab as Jt,Ac as QP,B as vp,Ba as z,Bb as $o,Bc as Dc,C as WR,Ca as M,Cb as ui,Cc as Zf,D as Cp,Da as u,Db as mI,E as KR,Ea as m,Eb as kr,Ec as Fo,F as _c,Fa as _,Fb as ti,G as jf,Ga as q,Gb as hI,Gc as $P,H as bp,Ha as te,Hb as fI,Hc as Qf,I as sa,Ia as Be,Ib as gI,Ic as lg,J as Sc,Ja as rI,Jb as vI,Jc as v1,K as jc,Ka as aI,Kb as er,Kc as FT,L as UR,La as ct,Lb as le,Lc as cg,M as qR,Ma as I,Mb as CI,Mc as tn,N as JR,Na as Lt,Nb as bI,Nc as Oc,O as XR,Oa as j,Ob as xI,Oc as dg,P as YR,Pa as $e,Pb as ae,Q as ZR,Qa as p,Qb as yI,Qc as OT,R as QR,Ra as en,Rb as J_,S as wn,Sa as Nt,Sb as la,T as li,Ta as Do,Tb as Mr,U as cl,Ua as Ye,Ub as wI,V as W_,Va as Re,Vb as _I,W as $t,Wa as Ie,Wb as SI,X as d,Xa as sI,Xb as Rt,Y as xp,Ya as lI,Yb as If,Z as $R,Za as qe,Zb as tr,_ as K_,_a as Ee,_b as Pn,a as gi,aa as $i,ab as q_,ac as Ja,b as aa,ba as Ri,bb as ee,bc as Xa,c as qt,ca as Qn,cb as g,cc as kI,d as Me,da as me,db as T,dc as Oe,e as dt,ea as kn,eb as N,ec as MI,f as Vt,fa as eI,fb as Qe,fc as EI,g as Ut,ga as G,gb as qa,gc as RI,h as V,ha as ut,hb as cI,hc as II,i as zR,ia as Le,ib as rt,ic as Ze,j as Ua,ja as kf,jb as at,jc as VP,k as ho,ka as Mf,kb as st,kc as l1,l as y,la as re,lb as ci,lc as c1,m as w,ma as ot,mb as di,mc as LP,n as Qi,na as tI,nb as Yt,nc as BP,o as HR,oa as U_,ob as Ii,oc as zP,p as ln,pa as nI,pb as Ct,pc as HP,q as Qt,qa as iI,qb as ul,qc as Rp,r as wc,ra as Ef,rb as Sr,rc as GP,s as R,sa as oI,sb as Mn,sc as WP,t as wt,ta as Qo,tb as dI,tc as KP,u as G_,ua as W,ub as Rf,uc as UP,v as An,va as $n,vb as uI,vc as qP,w as ll,wa as b,wb as an,wc as JP,x as GR,xa as x,xb as ei,xc as XP,y as bt,ya as Hn,yb as jr,yc as YP,z as je,za as pt,zb as pI,zc as ZP}from"./chunks/chunk-YES54RPF.js";import{a as C1}from"./chunks/chunk-3MGVBZOH.js";import{a as Op}from"./chunks/chunk-BLY4NVPI.js";import{d as eT,e as tT}from"./chunks/chunk-CAGKTBY3.js";import{c as PT}from"./chunks/chunk-FZM6FE42.js";import{j as g1}from"./chunks/chunk-NITLA632.js";import{d as TT}from"./chunks/chunk-U3ZDTOC3.js";import{d as DT}from"./chunks/chunk-4LO57LMD.js";import{e as MT,f as ET,g as RT,h as IT}from"./chunks/chunk-ZRDNSE2K.js";import{A as cT,Ba as wT,C as Fc,Ca as _T,D as on,Da as ST,E as Pp,Ea as Fp,F as dT,Fa as f1,G as u1,Ga as jT,H as uT,I as p1,Ia as bl,J as pT,Ja as kT,K as mT,L as hT,M as fT,O as ng,Q as Tp,R as ig,S as gT,T as vT,U as CT,V as bT,W as og,a as d1,b as da,c as nT,d as iT,e as oT,ea as gn,g as rT,h as aT,i as Ht,j as Qa,k as $a,ka as rg,l as sT,m as Ir,ma as xT,n as Ip,na as fe,o as Ni,oa as ag,p as $f,pa as sg,q as eo,qa as Dp,r as vl,ra as m1,s as Cl,sa as h1,v as eg,w as tg,x as Nn,xa as yT,y as lT,z as fn}from"./chunks/chunk-7FVBGPR4.js";import{$ as Uf,A as CP,B as bP,C as bn,D as ze,E as xP,F as fl,G as yP,I as n1,J as Hf,K as Gf,L as Mp,M as wP,N as _P,Na as Tc,O as i1,P as Ec,Q as SP,Qa as TP,R as o1,S as Rc,T as Wf,U as gl,Ub as s1,V as jP,Vb as AP,W as kP,X as MP,Y as EP,Z as Kf,_ as Ep,_b as NP,a as Xt,aa as RP,ab as Yf,ba as Ic,ca as IP,cb as a1,d as aP,da as PP,e as sP,ea as qf,fa as r1,g as lP,ga as Jf,h as cP,ha as Pc,hb as DP,i as dP,j as uP,k as pP,l as mP,m as hP,n as e1,o as kp,p as Mc,q as fP,r as Rr,s as gP,t as Bf,tb as FP,u as Ti,ub as Jn,v as t1,w as hl,xb as OP,y as vP,z as zf}from"./chunks/chunk-FDR3HREB.js";import{a as $_}from"./chunks/chunk-V4OMOOLJ.js";import{Bd as fo,E as ni,Ee as Vf,F as Pi,Jb as Cn,Nf as jp,Rf as oP,Tb as vi,Tf as rP,Ua as KI,Uf as En,Vf as Lf,Xa as Ne,Ya as _t,_b as eP,ac as Z_,bc as tP,cc as Of,eb as wp,fa as Za,fb as X_,fc as nP,ga as WI,gb as UI,gc as iP,hb as qI,hc as Af,ib as JI,ic as Sp,jb as XI,kb as YI,lb as Y_,lc as Q_,na as ft,nb as ZI,o as he,ob as QI,pb as $I,rd as Nf,s as Er,yb as _p}from"./chunks/chunk-ZQVZ37WB.js";import{$ as ca,A as NR,Aa as Ff,B as z_,Ba as ml,C as VR,D as LR,Da as zI,F as _r,G as Sf,H as oa,I as Ka,J as We,K as BR,L as ra,M as H_,Oa as Bt,P as Pf,Pa as HI,Q as nr,Qa as zt,Ra as GI,S as Ya,T as yp,V as ir,W as PI,Y as Tf,_ as TI,a as Zi,aa as Ui,b as al,ba as DI,c as pe,ca as pl,d as nn,e as MR,f as ER,fa as Df,g as RR,ga as kc,h as sl,ha as Wt,i as IR,ia as xe,j as po,k as PR,l as wf,m as TR,ma as FI,n as DR,o as mo,oa as OI,p as wr,q as si,r as FR,s as _f,ta as AI,u as Bn,ua as NI,v as yc,w as OR,x as AR,xa as VI,y as Zo,ya as LI,za as BI}from"./chunks/chunk-AHHY6OJ6.js";import{a as Xf}from"./chunks/chunk-H3YLLBTJ.js";import{a,d as Ez,g as Rz}from"./chunks/chunk-UVYWEABP.js";var oO=Ez((cet,X0)=>{var JU=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var gt=(function(n){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,i={},o={manual:n.Prism&&n.Prism.manual,disableWorkerMessageHandler:n.Prism&&n.Prism.disableWorkerMessageHandler,util:{encode:a(function E(P){return P instanceof r?new r(P.type,E(P.content),P.alias):Array.isArray(P)?P.map(E):P.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},"encode"),type:a(function(E){return Object.prototype.toString.call(E).slice(8,-1)},"type"),objId:a(function(E){return E.__id||Object.defineProperty(E,"__id",{value:++t}),E.__id},"objId"),clone:a(function E(P,F){F=F||{};var D,O;switch(o.util.type(P)){case"Object":if(O=o.util.objId(P),F[O])return F[O];D={},F[O]=D;for(var H in P)P.hasOwnProperty(H)&&(D[H]=E(P[H],F));return D;case"Array":return O=o.util.objId(P),F[O]?F[O]:(D=[],F[O]=D,P.forEach(function(U,Y){D[Y]=E(U,F)}),D);default:return P}},"deepClone"),getLanguage:a(function(E){for(;E;){var P=e.exec(E.className);if(P)return P[1].toLowerCase();E=E.parentElement}return"none"},"getLanguage"),setLanguage:a(function(E,P){E.className=E.className.replace(RegExp(e,"gi"),""),E.classList.add("language-"+P)},"setLanguage"),currentScript:a(function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(D){var E=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(D.stack)||[])[1];if(E){var P=document.getElementsByTagName("script");for(var F in P)if(P[F].src==E)return P[F]}return null}},"currentScript"),isActive:a(function(E,P,F){for(var D="no-"+P;E;){var O=E.classList;if(O.contains(P))return!0;if(O.contains(D))return!1;E=E.parentElement}return!!F},"isActive")},languages:{plain:i,plaintext:i,text:i,txt:i,extend:a(function(E,P){var F=o.util.clone(o.languages[E]);for(var D in P)F[D]=P[D];return F},"extend"),insertBefore:a(function(E,P,F,D){D=D||o.languages;var O=D[E],H={};for(var U in O)if(O.hasOwnProperty(U)){if(U==P)for(var Y in F)F.hasOwnProperty(Y)&&(H[Y]=F[Y]);F.hasOwnProperty(U)||(H[U]=O[U])}var ce=D[E];return D[E]=H,o.languages.DFS(o.languages,function(ue,K){K===ce&&ue!=E&&(this[ue]=H)}),H},"insertBefore"),DFS:a(function E(P,F,D,O){O=O||{};var H=o.util.objId;for(var U in P)if(P.hasOwnProperty(U)){F.call(P,U,P[U],D||U);var Y=P[U],ce=o.util.type(Y);ce==="Object"&&!O[H(Y)]?(O[H(Y)]=!0,E(Y,F,null,O)):ce==="Array"&&!O[H(Y)]&&(O[H(Y)]=!0,E(Y,F,U,O))}},"DFS")},plugins:{},highlightAll:a(function(E,P){o.highlightAllUnder(document,E,P)},"highlightAll"),highlightAllUnder:a(function(E,P,F){var D={callback:F,container:E,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};o.hooks.run("before-highlightall",D),D.elements=Array.prototype.slice.apply(D.container.querySelectorAll(D.selector)),o.hooks.run("before-all-elements-highlight",D);for(var O=0,H;H=D.elements[O++];)o.highlightElement(H,P===!0,D.callback)},"highlightAllUnder"),highlightElement:a(function(E,P,F){var D=o.util.getLanguage(E),O=o.languages[D];o.util.setLanguage(E,D);var H=E.parentElement;H&&H.nodeName.toLowerCase()==="pre"&&o.util.setLanguage(H,D);var U=E.textContent,Y={element:E,language:D,grammar:O,code:U};function ce(K){Y.highlightedCode=K,o.hooks.run("before-insert",Y),Y.element.innerHTML=Y.highlightedCode,o.hooks.run("after-highlight",Y),o.hooks.run("complete",Y),F&&F.call(Y.element)}if(a(ce,"insertHighlightedCode"),o.hooks.run("before-sanity-check",Y),H=Y.element.parentElement,H&&H.nodeName.toLowerCase()==="pre"&&!H.hasAttribute("tabindex")&&H.setAttribute("tabindex","0"),!Y.code){o.hooks.run("complete",Y),F&&F.call(Y.element);return}if(o.hooks.run("before-highlight",Y),!Y.grammar){ce(o.util.encode(Y.code));return}if(P&&n.Worker){var ue=new Worker(o.filename);ue.onmessage=function(K){ce(K.data)},ue.postMessage(JSON.stringify({language:Y.language,code:Y.code,immediateClose:!0}))}else ce(o.highlight(Y.code,Y.grammar,Y.language))},"highlightElement"),highlight:a(function(E,P,F){var D={code:E,grammar:P,language:F};if(o.hooks.run("before-tokenize",D),!D.grammar)throw new Error('The language "'+D.language+'" has no grammar.');return D.tokens=o.tokenize(D.code,D.grammar),o.hooks.run("after-tokenize",D),r.stringify(o.util.encode(D.tokens),D.language)},"highlight"),tokenize:a(function(E,P){var F=P.rest;if(F){for(var D in F)P[D]=F[D];delete P.rest}var O=new c;return h(O,O.head,E),l(E,O,P,O.head,0),v(O)},"tokenize"),hooks:{all:{},add:a(function(E,P){var F=o.hooks.all;F[E]=F[E]||[],F[E].push(P)},"add"),run:a(function(E,P){var F=o.hooks.all[E];if(!(!F||!F.length))for(var D=0,O;O=F[D++];)O(P)},"run")},Token:r};n.Prism=o;function r(E,P,F,D){this.type=E,this.content=P,this.alias=F,this.length=(D||"").length|0}a(r,"Token"),r.stringify=a(function E(P,F){if(typeof P=="string")return P;if(Array.isArray(P)){var D="";return P.forEach(function(ce){D+=E(ce,F)}),D}var O={type:P.type,content:E(P.content,F),tag:"span",classes:["token",P.type],attributes:{},language:F},H=P.alias;H&&(Array.isArray(H)?Array.prototype.push.apply(O.classes,H):O.classes.push(H)),o.hooks.run("wrap",O);var U="";for(var Y in O.attributes)U+=" "+Y+'="'+(O.attributes[Y]||"").replace(/"/g,"&quot;")+'"';return"<"+O.tag+' class="'+O.classes.join(" ")+'"'+U+">"+O.content+"</"+O.tag+">"},"stringify");function s(E,P,F,D){E.lastIndex=P;var O=E.exec(F);if(O&&D&&O[1]){var H=O[1].length;O.index+=H,O[0]=O[0].slice(H)}return O}a(s,"matchPattern");function l(E,P,F,D,O,H){for(var U in F)if(!(!F.hasOwnProperty(U)||!F[U])){var Y=F[U];Y=Array.isArray(Y)?Y:[Y];for(var ce=0;ce<Y.length;++ce){if(H&&H.cause==U+","+ce)return;var ue=Y[ce],K=ue.inside,Q=!!ue.lookbehind,L=!!ue.greedy,ne=ue.alias;if(L&&!ue.pattern.global){var se=ue.pattern.toString().match(/[imsuy]*$/)[0];ue.pattern=RegExp(ue.pattern.source,se+"g")}for(var Ce=ue.pattern||ue,be=D.next,ke=O;be!==P.tail&&!(H&&ke>=H.reach);ke+=be.value.length,be=be.next){var De=be.value;if(P.length>E.length)return;if(!(De instanceof r)){var ie=1,$;if(L){if($=s(Ce,ke,E,Q),!$||$.index>=E.length)break;var Ae=$.index,Z=$.index+$[0].length,_e=ke;for(_e+=be.value.length;Ae>=_e;)be=be.next,_e+=be.value.length;if(_e-=be.value.length,ke=_e,be.value instanceof r)continue;for(var Ve=be;Ve!==P.tail&&(_e<Z||typeof Ve.value=="string");Ve=Ve.next)ie++,_e+=Ve.value.length;ie--,De=E.slice(ke,_e),$.index-=ke}else if($=s(Ce,0,De,Q),!$)continue;var Ae=$.index,xt=$[0],yt=De.slice(0,Ae),Tt=De.slice(Ae+xt.length),tt=ke+De.length;H&&tt>H.reach&&(H.reach=tt);var ve=be.prev;yt&&(ve=h(P,ve,yt),ke+=yt.length),f(P,ve,ie);var we=new r(U,K?o.tokenize(xt,K):xt,ne,xt);if(be=h(P,ve,we),Tt&&h(P,be,Tt),ie>1){var oe={cause:U+","+ce,reach:tt};l(E,P,F,be.prev,ke,oe),H&&oe.reach>H.reach&&(H.reach=oe.reach)}}}}}}a(l,"matchGrammar");function c(){var E={value:null,prev:null,next:null},P={value:null,prev:E,next:null};E.next=P,this.head=E,this.tail=P,this.length=0}a(c,"LinkedList");function h(E,P,F){var D=P.next,O={value:F,prev:P,next:D};return P.next=O,D.prev=O,E.length++,O}a(h,"addAfter");function f(E,P,F){for(var D=P.next,O=0;O<F&&D!==E.tail;O++)D=D.next;P.next=D,D.prev=P,E.length-=O}a(f,"removeRange");function v(E){for(var P=[],F=E.head.next;F!==E.tail;)P.push(F.value),F=F.next;return P}if(a(v,"toArray"),!n.document)return n.addEventListener&&(o.disableWorkerMessageHandler||n.addEventListener("message",function(E){var P=JSON.parse(E.data),F=P.language,D=P.code,O=P.immediateClose;n.postMessage(o.highlight(D,o.languages[F],F)),O&&n.close()},!1)),o;var C=o.util.currentScript();C&&(o.filename=C.src,C.hasAttribute("data-manual")&&(o.manual=!0));function S(){o.manual||o.highlightAll()}if(a(S,"highlightAutomaticallyCallback"),!o.manual){var k=document.readyState;k==="loading"||k==="interactive"&&C&&C.defer?document.addEventListener("DOMContentLoaded",S):window.requestAnimationFrame?window.requestAnimationFrame(S):window.setTimeout(S,16)}return o})(JU);typeof X0<"u"&&X0.exports&&(X0.exports=gt);typeof global<"u"&&(global.Prism=gt);gt.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};gt.languages.markup.tag.inside["attr-value"].inside.entity=gt.languages.markup.entity;gt.languages.markup.doctype.inside["internal-subset"].inside=gt.languages.markup;gt.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.replace(/&amp;/,"&"))});Object.defineProperty(gt.languages.markup.tag,"addInlined",{value:a(function(e,t){var i={};i["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:gt.languages[t]},i.cdata=/^<!\[CDATA\[|\]\]>$/i;var o={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:i}};o["language-"+t]={pattern:/[\s\S]+/,inside:gt.languages[t]};var r={};r[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:o},gt.languages.insertBefore("markup","cdata",r)},"addInlined")});Object.defineProperty(gt.languages.markup.tag,"addAttribute",{value:a(function(n,e){gt.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:gt.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})},"value")});gt.languages.html=gt.languages.markup;gt.languages.mathml=gt.languages.markup;gt.languages.svg=gt.languages.markup;gt.languages.xml=gt.languages.extend("markup",{});gt.languages.ssml=gt.languages.xml;gt.languages.atom=gt.languages.xml;gt.languages.rss=gt.languages.xml;(function(n){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var t=n.languages.markup;t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))})(gt);gt.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};gt.languages.javascript=gt.languages.extend("clike",{"class-name":[gt.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});gt.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;gt.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:gt.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:gt.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:gt.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:gt.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:gt.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});gt.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:gt.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});gt.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});gt.languages.markup&&(gt.languages.markup.tag.addInlined("script","javascript"),gt.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));gt.languages.js=gt.languages.javascript;(function(){if(typeof gt>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var n="Loading\u2026",e=a(function(C,S){return"\u2716 Error "+C+" while fetching file: "+S},"FAILURE_MESSAGE"),t="\u2716 Error: File does not exist or is empty",i={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},o="data-src-status",r="loading",s="loaded",l="failed",c="pre[data-src]:not(["+o+'="'+s+'"]):not(['+o+'="'+r+'"])';function h(C,S,k){var E=new XMLHttpRequest;E.open("GET",C,!0),E.onreadystatechange=function(){E.readyState==4&&(E.status<400&&E.responseText?S(E.responseText):E.status>=400?k(e(E.status,E.statusText)):k(t))},E.send(null)}a(h,"loadFile");function f(C){var S=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(C||"");if(S){var k=Number(S[1]),E=S[2],P=S[3];return E?P?[k,Number(P)]:[k,void 0]:[k,k]}}a(f,"parseRange"),gt.hooks.add("before-highlightall",function(C){C.selector+=", "+c}),gt.hooks.add("before-sanity-check",function(C){var S=C.element;if(S.matches(c)){C.code="",S.setAttribute(o,r);var k=S.appendChild(document.createElement("CODE"));k.textContent=n;var E=S.getAttribute("data-src"),P=C.language;if(P==="none"){var F=(/\.(\w+)$/.exec(E)||[,"none"])[1];P=i[F]||F}gt.util.setLanguage(k,P),gt.util.setLanguage(S,P);var D=gt.plugins.autoloader;D&&D.loadLanguages(P),h(E,function(O){S.setAttribute(o,s);var H=f(S.getAttribute("data-range"));if(H){var U=O.split(/\r\n?|\n/g),Y=H[0],ce=H[1]==null?U.length:H[1];Y<0&&(Y+=U.length),Y=Math.max(0,Math.min(Y-1,U.length)),ce<0&&(ce+=U.length),ce=Math.max(0,Math.min(ce,U.length)),O=U.slice(Y,ce).join(`
1
+ import{$ as dl,$a as A,$b as jI,A as Ge,Aa as B,Ab as Jt,Ac as QP,B as vp,Ba as z,Bb as $o,Bc as Dc,C as WR,Ca as M,Cb as ui,Cc as Zf,D as Cp,Da as u,Db as mI,E as KR,Ea as m,Eb as kr,Ec as Fo,F as _c,Fa as _,Fb as ti,G as jf,Ga as q,Gb as hI,Gc as $P,H as bp,Ha as te,Hb as fI,Hc as Qf,I as sa,Ia as Be,Ib as gI,Ic as lg,J as Sc,Ja as rI,Jb as vI,Jc as v1,K as jc,Ka as aI,Kb as er,Kc as FT,L as UR,La as ct,Lb as le,Lc as cg,M as qR,Ma as I,Mb as CI,Mc as tn,N as JR,Na as Lt,Nb as bI,Nc as Oc,O as XR,Oa as j,Ob as xI,Oc as dg,P as YR,Pa as $e,Pb as ae,Q as ZR,Qa as p,Qb as yI,Qc as OT,R as QR,Ra as en,Rb as J_,S as wn,Sa as Nt,Sb as la,T as li,Ta as Do,Tb as Mr,U as cl,Ua as Ye,Ub as wI,V as W_,Va as Re,Vb as _I,W as $t,Wa as Ie,Wb as SI,X as d,Xa as sI,Xb as Rt,Y as xp,Ya as lI,Yb as If,Z as $R,Za as qe,Zb as tr,_ as K_,_a as Ee,_b as Pn,a as gi,aa as $i,ab as q_,ac as Ja,b as aa,ba as Ri,bb as ee,bc as Xa,c as qt,ca as Qn,cb as g,cc as kI,d as Me,da as me,db as T,dc as Oe,e as dt,ea as kn,eb as N,ec as MI,f as Vt,fa as eI,fb as Qe,fc as EI,g as Ut,ga as G,gb as qa,gc as RI,h as V,ha as ut,hb as cI,hc as II,i as zR,ia as Le,ib as rt,ic as Ze,j as Ua,ja as kf,jb as at,jc as VP,k as ho,ka as Mf,kb as st,kc as l1,l as y,la as re,lb as ci,lc as c1,m as w,ma as ot,mb as di,mc as LP,n as Qi,na as tI,nb as Yt,nc as BP,o as HR,oa as U_,ob as Ii,oc as zP,p as ln,pa as nI,pb as Ct,pc as HP,q as Qt,qa as iI,qb as ul,qc as Rp,r as wc,ra as Ef,rb as Sr,rc as GP,s as R,sa as oI,sb as Mn,sc as WP,t as wt,ta as Qo,tb as dI,tc as KP,u as G_,ua as W,ub as Rf,uc as UP,v as An,va as $n,vb as uI,vc as qP,w as ll,wa as b,wb as an,wc as JP,x as GR,xa as x,xb as ei,xc as XP,y as bt,ya as Hn,yb as jr,yc as YP,z as je,za as pt,zb as pI,zc as ZP}from"./chunks/chunk-FS5E33YU.js";import{a as C1}from"./chunks/chunk-3MGVBZOH.js";import{a as Op}from"./chunks/chunk-BLY4NVPI.js";import{d as eT,e as tT}from"./chunks/chunk-CAGKTBY3.js";import{c as PT}from"./chunks/chunk-FZM6FE42.js";import{j as g1}from"./chunks/chunk-NITLA632.js";import{d as TT}from"./chunks/chunk-U3ZDTOC3.js";import{d as DT}from"./chunks/chunk-4LO57LMD.js";import{e as MT,f as ET,g as RT,h as IT}from"./chunks/chunk-ZRDNSE2K.js";import{A as cT,Ba as wT,C as Fc,Ca as _T,D as on,Da as ST,E as Pp,Ea as Fp,F as dT,Fa as f1,G as u1,Ga as jT,H as uT,I as p1,Ia as bl,J as pT,Ja as kT,K as mT,L as hT,M as fT,O as ng,Q as Tp,R as ig,S as gT,T as vT,U as CT,V as bT,W as og,a as d1,b as da,c as nT,d as iT,e as oT,ea as gn,g as rT,h as aT,i as Ht,j as Qa,k as $a,ka as rg,l as sT,m as Ir,ma as xT,n as Ip,na as fe,o as Ni,oa as ag,p as $f,pa as sg,q as eo,qa as Dp,r as vl,ra as m1,s as Cl,sa as h1,v as eg,w as tg,x as Nn,xa as yT,y as lT,z as fn}from"./chunks/chunk-7FVBGPR4.js";import{$ as Uf,A as CP,B as bP,C as bn,D as ze,E as xP,F as fl,G as yP,I as n1,J as Hf,K as Gf,L as Mp,M as wP,N as _P,Na as Tc,O as i1,P as Ec,Q as SP,Qa as TP,R as o1,S as Rc,T as Wf,U as gl,Ub as s1,V as jP,Vb as AP,W as kP,X as MP,Y as EP,Z as Kf,_ as Ep,_b as NP,a as Xt,aa as RP,ab as Yf,ba as Ic,ca as IP,cb as a1,d as aP,da as PP,e as sP,ea as qf,fa as r1,g as lP,ga as Jf,h as cP,ha as Pc,hb as DP,i as dP,j as uP,k as pP,l as mP,m as hP,n as e1,o as kp,p as Mc,q as fP,r as Rr,s as gP,t as Bf,tb as FP,u as Ti,ub as Jn,v as t1,w as hl,xb as OP,y as vP,z as zf}from"./chunks/chunk-IYFE6AC7.js";import{a as $_}from"./chunks/chunk-V4OMOOLJ.js";import{Bd as fo,E as ni,Ee as Vf,F as Pi,Jb as Cn,Nf as jp,Rf as oP,Tb as vi,Tf as rP,Ua as KI,Uf as En,Vf as Lf,Xa as Ne,Ya as _t,_b as eP,ac as Z_,bc as tP,cc as Of,eb as wp,fa as Za,fb as X_,fc as nP,ga as WI,gb as UI,gc as iP,hb as qI,hc as Af,ib as JI,ic as Sp,jb as XI,kb as YI,lb as Y_,lc as Q_,na as ft,nb as ZI,o as he,ob as QI,pb as $I,rd as Nf,s as Er,yb as _p}from"./chunks/chunk-ZQVZ37WB.js";import{$ as ca,A as NR,Aa as Ff,B as z_,Ba as ml,C as VR,D as LR,Da as zI,F as _r,G as Sf,H as oa,I as Ka,J as We,K as BR,L as ra,M as H_,Oa as Bt,P as Pf,Pa as HI,Q as nr,Qa as zt,Ra as GI,S as Ya,T as yp,V as ir,W as PI,Y as Tf,_ as TI,a as Zi,aa as Ui,b as al,ba as DI,c as pe,ca as pl,d as nn,e as MR,f as ER,fa as Df,g as RR,ga as kc,h as sl,ha as Wt,i as IR,ia as xe,j as po,k as PR,l as wf,m as TR,ma as FI,n as DR,o as mo,oa as OI,p as wr,q as si,r as FR,s as _f,ta as AI,u as Bn,ua as NI,v as yc,w as OR,x as AR,xa as VI,y as Zo,ya as LI,za as BI}from"./chunks/chunk-AHHY6OJ6.js";import{a as Xf}from"./chunks/chunk-H3YLLBTJ.js";import{a,d as Ez,g as Rz}from"./chunks/chunk-UVYWEABP.js";var oO=Ez((cet,X0)=>{var JU=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var gt=(function(n){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,i={},o={manual:n.Prism&&n.Prism.manual,disableWorkerMessageHandler:n.Prism&&n.Prism.disableWorkerMessageHandler,util:{encode:a(function E(P){return P instanceof r?new r(P.type,E(P.content),P.alias):Array.isArray(P)?P.map(E):P.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},"encode"),type:a(function(E){return Object.prototype.toString.call(E).slice(8,-1)},"type"),objId:a(function(E){return E.__id||Object.defineProperty(E,"__id",{value:++t}),E.__id},"objId"),clone:a(function E(P,F){F=F||{};var D,O;switch(o.util.type(P)){case"Object":if(O=o.util.objId(P),F[O])return F[O];D={},F[O]=D;for(var H in P)P.hasOwnProperty(H)&&(D[H]=E(P[H],F));return D;case"Array":return O=o.util.objId(P),F[O]?F[O]:(D=[],F[O]=D,P.forEach(function(U,Y){D[Y]=E(U,F)}),D);default:return P}},"deepClone"),getLanguage:a(function(E){for(;E;){var P=e.exec(E.className);if(P)return P[1].toLowerCase();E=E.parentElement}return"none"},"getLanguage"),setLanguage:a(function(E,P){E.className=E.className.replace(RegExp(e,"gi"),""),E.classList.add("language-"+P)},"setLanguage"),currentScript:a(function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(D){var E=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(D.stack)||[])[1];if(E){var P=document.getElementsByTagName("script");for(var F in P)if(P[F].src==E)return P[F]}return null}},"currentScript"),isActive:a(function(E,P,F){for(var D="no-"+P;E;){var O=E.classList;if(O.contains(P))return!0;if(O.contains(D))return!1;E=E.parentElement}return!!F},"isActive")},languages:{plain:i,plaintext:i,text:i,txt:i,extend:a(function(E,P){var F=o.util.clone(o.languages[E]);for(var D in P)F[D]=P[D];return F},"extend"),insertBefore:a(function(E,P,F,D){D=D||o.languages;var O=D[E],H={};for(var U in O)if(O.hasOwnProperty(U)){if(U==P)for(var Y in F)F.hasOwnProperty(Y)&&(H[Y]=F[Y]);F.hasOwnProperty(U)||(H[U]=O[U])}var ce=D[E];return D[E]=H,o.languages.DFS(o.languages,function(ue,K){K===ce&&ue!=E&&(this[ue]=H)}),H},"insertBefore"),DFS:a(function E(P,F,D,O){O=O||{};var H=o.util.objId;for(var U in P)if(P.hasOwnProperty(U)){F.call(P,U,P[U],D||U);var Y=P[U],ce=o.util.type(Y);ce==="Object"&&!O[H(Y)]?(O[H(Y)]=!0,E(Y,F,null,O)):ce==="Array"&&!O[H(Y)]&&(O[H(Y)]=!0,E(Y,F,U,O))}},"DFS")},plugins:{},highlightAll:a(function(E,P){o.highlightAllUnder(document,E,P)},"highlightAll"),highlightAllUnder:a(function(E,P,F){var D={callback:F,container:E,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};o.hooks.run("before-highlightall",D),D.elements=Array.prototype.slice.apply(D.container.querySelectorAll(D.selector)),o.hooks.run("before-all-elements-highlight",D);for(var O=0,H;H=D.elements[O++];)o.highlightElement(H,P===!0,D.callback)},"highlightAllUnder"),highlightElement:a(function(E,P,F){var D=o.util.getLanguage(E),O=o.languages[D];o.util.setLanguage(E,D);var H=E.parentElement;H&&H.nodeName.toLowerCase()==="pre"&&o.util.setLanguage(H,D);var U=E.textContent,Y={element:E,language:D,grammar:O,code:U};function ce(K){Y.highlightedCode=K,o.hooks.run("before-insert",Y),Y.element.innerHTML=Y.highlightedCode,o.hooks.run("after-highlight",Y),o.hooks.run("complete",Y),F&&F.call(Y.element)}if(a(ce,"insertHighlightedCode"),o.hooks.run("before-sanity-check",Y),H=Y.element.parentElement,H&&H.nodeName.toLowerCase()==="pre"&&!H.hasAttribute("tabindex")&&H.setAttribute("tabindex","0"),!Y.code){o.hooks.run("complete",Y),F&&F.call(Y.element);return}if(o.hooks.run("before-highlight",Y),!Y.grammar){ce(o.util.encode(Y.code));return}if(P&&n.Worker){var ue=new Worker(o.filename);ue.onmessage=function(K){ce(K.data)},ue.postMessage(JSON.stringify({language:Y.language,code:Y.code,immediateClose:!0}))}else ce(o.highlight(Y.code,Y.grammar,Y.language))},"highlightElement"),highlight:a(function(E,P,F){var D={code:E,grammar:P,language:F};if(o.hooks.run("before-tokenize",D),!D.grammar)throw new Error('The language "'+D.language+'" has no grammar.');return D.tokens=o.tokenize(D.code,D.grammar),o.hooks.run("after-tokenize",D),r.stringify(o.util.encode(D.tokens),D.language)},"highlight"),tokenize:a(function(E,P){var F=P.rest;if(F){for(var D in F)P[D]=F[D];delete P.rest}var O=new c;return h(O,O.head,E),l(E,O,P,O.head,0),v(O)},"tokenize"),hooks:{all:{},add:a(function(E,P){var F=o.hooks.all;F[E]=F[E]||[],F[E].push(P)},"add"),run:a(function(E,P){var F=o.hooks.all[E];if(!(!F||!F.length))for(var D=0,O;O=F[D++];)O(P)},"run")},Token:r};n.Prism=o;function r(E,P,F,D){this.type=E,this.content=P,this.alias=F,this.length=(D||"").length|0}a(r,"Token"),r.stringify=a(function E(P,F){if(typeof P=="string")return P;if(Array.isArray(P)){var D="";return P.forEach(function(ce){D+=E(ce,F)}),D}var O={type:P.type,content:E(P.content,F),tag:"span",classes:["token",P.type],attributes:{},language:F},H=P.alias;H&&(Array.isArray(H)?Array.prototype.push.apply(O.classes,H):O.classes.push(H)),o.hooks.run("wrap",O);var U="";for(var Y in O.attributes)U+=" "+Y+'="'+(O.attributes[Y]||"").replace(/"/g,"&quot;")+'"';return"<"+O.tag+' class="'+O.classes.join(" ")+'"'+U+">"+O.content+"</"+O.tag+">"},"stringify");function s(E,P,F,D){E.lastIndex=P;var O=E.exec(F);if(O&&D&&O[1]){var H=O[1].length;O.index+=H,O[0]=O[0].slice(H)}return O}a(s,"matchPattern");function l(E,P,F,D,O,H){for(var U in F)if(!(!F.hasOwnProperty(U)||!F[U])){var Y=F[U];Y=Array.isArray(Y)?Y:[Y];for(var ce=0;ce<Y.length;++ce){if(H&&H.cause==U+","+ce)return;var ue=Y[ce],K=ue.inside,Q=!!ue.lookbehind,L=!!ue.greedy,ne=ue.alias;if(L&&!ue.pattern.global){var se=ue.pattern.toString().match(/[imsuy]*$/)[0];ue.pattern=RegExp(ue.pattern.source,se+"g")}for(var Ce=ue.pattern||ue,be=D.next,ke=O;be!==P.tail&&!(H&&ke>=H.reach);ke+=be.value.length,be=be.next){var De=be.value;if(P.length>E.length)return;if(!(De instanceof r)){var ie=1,$;if(L){if($=s(Ce,ke,E,Q),!$||$.index>=E.length)break;var Ae=$.index,Z=$.index+$[0].length,_e=ke;for(_e+=be.value.length;Ae>=_e;)be=be.next,_e+=be.value.length;if(_e-=be.value.length,ke=_e,be.value instanceof r)continue;for(var Ve=be;Ve!==P.tail&&(_e<Z||typeof Ve.value=="string");Ve=Ve.next)ie++,_e+=Ve.value.length;ie--,De=E.slice(ke,_e),$.index-=ke}else if($=s(Ce,0,De,Q),!$)continue;var Ae=$.index,xt=$[0],yt=De.slice(0,Ae),Tt=De.slice(Ae+xt.length),tt=ke+De.length;H&&tt>H.reach&&(H.reach=tt);var ve=be.prev;yt&&(ve=h(P,ve,yt),ke+=yt.length),f(P,ve,ie);var we=new r(U,K?o.tokenize(xt,K):xt,ne,xt);if(be=h(P,ve,we),Tt&&h(P,be,Tt),ie>1){var oe={cause:U+","+ce,reach:tt};l(E,P,F,be.prev,ke,oe),H&&oe.reach>H.reach&&(H.reach=oe.reach)}}}}}}a(l,"matchGrammar");function c(){var E={value:null,prev:null,next:null},P={value:null,prev:E,next:null};E.next=P,this.head=E,this.tail=P,this.length=0}a(c,"LinkedList");function h(E,P,F){var D=P.next,O={value:F,prev:P,next:D};return P.next=O,D.prev=O,E.length++,O}a(h,"addAfter");function f(E,P,F){for(var D=P.next,O=0;O<F&&D!==E.tail;O++)D=D.next;P.next=D,D.prev=P,E.length-=O}a(f,"removeRange");function v(E){for(var P=[],F=E.head.next;F!==E.tail;)P.push(F.value),F=F.next;return P}if(a(v,"toArray"),!n.document)return n.addEventListener&&(o.disableWorkerMessageHandler||n.addEventListener("message",function(E){var P=JSON.parse(E.data),F=P.language,D=P.code,O=P.immediateClose;n.postMessage(o.highlight(D,o.languages[F],F)),O&&n.close()},!1)),o;var C=o.util.currentScript();C&&(o.filename=C.src,C.hasAttribute("data-manual")&&(o.manual=!0));function S(){o.manual||o.highlightAll()}if(a(S,"highlightAutomaticallyCallback"),!o.manual){var k=document.readyState;k==="loading"||k==="interactive"&&C&&C.defer?document.addEventListener("DOMContentLoaded",S):window.requestAnimationFrame?window.requestAnimationFrame(S):window.setTimeout(S,16)}return o})(JU);typeof X0<"u"&&X0.exports&&(X0.exports=gt);typeof global<"u"&&(global.Prism=gt);gt.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};gt.languages.markup.tag.inside["attr-value"].inside.entity=gt.languages.markup.entity;gt.languages.markup.doctype.inside["internal-subset"].inside=gt.languages.markup;gt.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.replace(/&amp;/,"&"))});Object.defineProperty(gt.languages.markup.tag,"addInlined",{value:a(function(e,t){var i={};i["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:gt.languages[t]},i.cdata=/^<!\[CDATA\[|\]\]>$/i;var o={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:i}};o["language-"+t]={pattern:/[\s\S]+/,inside:gt.languages[t]};var r={};r[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:o},gt.languages.insertBefore("markup","cdata",r)},"addInlined")});Object.defineProperty(gt.languages.markup.tag,"addAttribute",{value:a(function(n,e){gt.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:gt.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})},"value")});gt.languages.html=gt.languages.markup;gt.languages.mathml=gt.languages.markup;gt.languages.svg=gt.languages.markup;gt.languages.xml=gt.languages.extend("markup",{});gt.languages.ssml=gt.languages.xml;gt.languages.atom=gt.languages.xml;gt.languages.rss=gt.languages.xml;(function(n){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var t=n.languages.markup;t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))})(gt);gt.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};gt.languages.javascript=gt.languages.extend("clike",{"class-name":[gt.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});gt.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;gt.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:gt.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:gt.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:gt.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:gt.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:gt.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});gt.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:gt.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});gt.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});gt.languages.markup&&(gt.languages.markup.tag.addInlined("script","javascript"),gt.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));gt.languages.js=gt.languages.javascript;(function(){if(typeof gt>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var n="Loading\u2026",e=a(function(C,S){return"\u2716 Error "+C+" while fetching file: "+S},"FAILURE_MESSAGE"),t="\u2716 Error: File does not exist or is empty",i={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},o="data-src-status",r="loading",s="loaded",l="failed",c="pre[data-src]:not(["+o+'="'+s+'"]):not(['+o+'="'+r+'"])';function h(C,S,k){var E=new XMLHttpRequest;E.open("GET",C,!0),E.onreadystatechange=function(){E.readyState==4&&(E.status<400&&E.responseText?S(E.responseText):E.status>=400?k(e(E.status,E.statusText)):k(t))},E.send(null)}a(h,"loadFile");function f(C){var S=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(C||"");if(S){var k=Number(S[1]),E=S[2],P=S[3];return E?P?[k,Number(P)]:[k,void 0]:[k,k]}}a(f,"parseRange"),gt.hooks.add("before-highlightall",function(C){C.selector+=", "+c}),gt.hooks.add("before-sanity-check",function(C){var S=C.element;if(S.matches(c)){C.code="",S.setAttribute(o,r);var k=S.appendChild(document.createElement("CODE"));k.textContent=n;var E=S.getAttribute("data-src"),P=C.language;if(P==="none"){var F=(/\.(\w+)$/.exec(E)||[,"none"])[1];P=i[F]||F}gt.util.setLanguage(k,P),gt.util.setLanguage(S,P);var D=gt.plugins.autoloader;D&&D.loadLanguages(P),h(E,function(O){S.setAttribute(o,s);var H=f(S.getAttribute("data-range"));if(H){var U=O.split(/\r\n?|\n/g),Y=H[0],ce=H[1]==null?U.length:H[1];Y<0&&(Y+=U.length),Y=Math.max(0,Math.min(Y-1,U.length)),ce<0&&(ce+=U.length),ce=Math.max(0,Math.min(ce,U.length)),O=U.slice(Y,ce).join(`
2
2
  `),S.hasAttribute("data-start")||S.setAttribute("data-start",String(Y+1))}k.textContent=O,gt.highlightElement(k)},function(O){S.setAttribute(o,l),k.textContent=O})}}),gt.plugins.fileHighlight={highlight:a(function(S){for(var k=(S||document).querySelectorAll(c),E=0,P;P=k[E++];)gt.highlightElement(P)},"highlight")};var v=!1;gt.fileHighlight=function(){v||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),v=!0),gt.plugins.fileHighlight.highlight.apply(this,arguments)}})()});var Iz=Object.defineProperty,Pz=Object.defineProperties,Tz=Object.getOwnPropertyDescriptors,AT=Object.getOwnPropertySymbols,Dz=Object.prototype.hasOwnProperty,Fz=Object.prototype.propertyIsEnumerable,y1=a((n,e,t)=>e in n?Iz(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,"__defNormalProp"),NT=a((n,e)=>{for(var t in e||(e={}))Dz.call(e,t)&&y1(n,t,e[t]);if(AT)for(var t of AT(e))Fz.call(e,t)&&y1(n,t,e[t]);return n},"__spreadValues"),Oz=a((n,e)=>Pz(n,Tz(e)),"__spreadProps"),Dt=a((n,e,t)=>(y1(n,typeof e!="symbol"?e+"":e,t),t),"__publicField"),Pr=globalThis;function Oo(n){return(Pr.__Zone_symbol_prefix||"__zone_symbol__")+n}a(Oo,"__symbol__");function Az(){let n=Pr.performance;function e(De){n&&n.mark&&n.mark(De)}a(e,"mark");function t(De,ie){n&&n.measure&&n.measure(De,ie)}a(t,"performanceMeasure"),e("Zone");let i=class w1{static{a(this,"_ZoneImpl")}constructor(ie,$){Dt(this,"_parent"),Dt(this,"_name"),Dt(this,"_properties"),Dt(this,"_zoneDelegate"),this._parent=ie,this._name=$?$.name||"unnamed":"<root>",this._properties=$&&$.properties||{},this._zoneDelegate=new s(this,this._parent&&this._parent._zoneDelegate,$)}static assertZonePatched(){if(Pr.Promise!==L.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let ie=w1.current;for(;ie.parent;)ie=ie.parent;return ie}static get current(){return se.zone}static get currentTask(){return Ce}static __load_patch(ie,$,Z=!1){if(L.hasOwnProperty(ie)){let _e=Pr[Oo("forceDuplicateZoneCheck")]===!0;if(!Z&&_e)throw Error("Already loaded patch: "+ie)}else if(!Pr["__Zone_disable_"+ie]){let _e="Zone:"+ie;e(_e),L[ie]=$(Pr,w1,ne),t(_e,_e)}}get parent(){return this._parent}get name(){return this._name}get(ie){let $=this.getZoneWith(ie);if($)return $._properties[ie]}getZoneWith(ie){let $=this;for(;$;){if($._properties.hasOwnProperty(ie))return $;$=$._parent}return null}fork(ie){if(!ie)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,ie)}wrap(ie,$){if(typeof ie!="function")throw new Error("Expecting function got: "+ie);let Z=this._zoneDelegate.intercept(this,ie,$),_e=this;return function(){return _e.runGuarded(Z,this,arguments,$)}}run(ie,$,Z,_e){se={parent:se,zone:this};try{return this._zoneDelegate.invoke(this,ie,$,Z,_e)}finally{se=se.parent}}runGuarded(ie,$=null,Z,_e){se={parent:se,zone:this};try{try{return this._zoneDelegate.invoke(this,ie,$,Z,_e)}catch(Ve){if(this._zoneDelegate.handleError(this,Ve))throw Ve}}finally{se=se.parent}}runTask(ie,$,Z){if(ie.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(ie.zone||F).name+"; Execution: "+this.name+")");let _e=ie,{type:Ve,data:{isPeriodic:Ae=!1,isRefreshable:xt=!1}={}}=ie;if(ie.state===D&&(Ve===Q||Ve===K))return;let yt=ie.state!=U;yt&&_e._transitionTo(U,H);let Tt=Ce;Ce=_e,se={parent:se,zone:this};try{Ve==K&&ie.data&&!Ae&&!xt&&(ie.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,_e,$,Z)}catch(tt){if(this._zoneDelegate.handleError(this,tt))throw tt}}finally{let tt=ie.state;if(tt!==D&&tt!==ce)if(Ve==Q||Ae||xt&&tt===O)yt&&_e._transitionTo(H,U,O);else{let ve=_e._zoneDelegates;this._updateTaskCount(_e,-1),yt&&_e._transitionTo(D,U,D),xt&&(_e._zoneDelegates=ve)}se=se.parent,Ce=Tt}}scheduleTask(ie){if(ie.zone&&ie.zone!==this){let Z=this;for(;Z;){if(Z===ie.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${ie.zone.name}`);Z=Z.parent}}ie._transitionTo(O,D);let $=[];ie._zoneDelegates=$,ie._zone=this;try{ie=this._zoneDelegate.scheduleTask(this,ie)}catch(Z){throw ie._transitionTo(ce,O,D),this._zoneDelegate.handleError(this,Z),Z}return ie._zoneDelegates===$&&this._updateTaskCount(ie,1),ie.state==O&&ie._transitionTo(H,O),ie}scheduleMicroTask(ie,$,Z,_e){return this.scheduleTask(new l(ue,ie,$,Z,_e,void 0))}scheduleMacroTask(ie,$,Z,_e,Ve){return this.scheduleTask(new l(K,ie,$,Z,_e,Ve))}scheduleEventTask(ie,$,Z,_e,Ve){return this.scheduleTask(new l(Q,ie,$,Z,_e,Ve))}cancelTask(ie){if(ie.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(ie.zone||F).name+"; Execution: "+this.name+")");if(!(ie.state!==H&&ie.state!==U)){ie._transitionTo(Y,H,U);try{this._zoneDelegate.cancelTask(this,ie)}catch($){throw ie._transitionTo(ce,Y),this._zoneDelegate.handleError(this,$),$}return this._updateTaskCount(ie,-1),ie._transitionTo(D,Y),ie.runCount=-1,ie}}_updateTaskCount(ie,$){let Z=ie._zoneDelegates;$==-1&&(ie._zoneDelegates=null);for(let _e=0;_e<Z.length;_e++)Z[_e]._updateTaskCount(ie.type,$)}};Dt(i,"__symbol__",Oo);let o=i,r={name:"",onHasTask:a((De,ie,$,Z)=>De.hasTask($,Z),"onHasTask"),onScheduleTask:a((De,ie,$,Z)=>De.scheduleTask($,Z),"onScheduleTask"),onInvokeTask:a((De,ie,$,Z,_e,Ve)=>De.invokeTask($,Z,_e,Ve),"onInvokeTask"),onCancelTask:a((De,ie,$,Z)=>De.cancelTask($,Z),"onCancelTask")};class s{static{a(this,"_ZoneDelegate")}constructor(ie,$,Z){Dt(this,"_zone"),Dt(this,"_taskCounts",{microTask:0,macroTask:0,eventTask:0}),Dt(this,"_parentDelegate"),Dt(this,"_forkDlgt"),Dt(this,"_forkZS"),Dt(this,"_forkCurrZone"),Dt(this,"_interceptDlgt"),Dt(this,"_interceptZS"),Dt(this,"_interceptCurrZone"),Dt(this,"_invokeDlgt"),Dt(this,"_invokeZS"),Dt(this,"_invokeCurrZone"),Dt(this,"_handleErrorDlgt"),Dt(this,"_handleErrorZS"),Dt(this,"_handleErrorCurrZone"),Dt(this,"_scheduleTaskDlgt"),Dt(this,"_scheduleTaskZS"),Dt(this,"_scheduleTaskCurrZone"),Dt(this,"_invokeTaskDlgt"),Dt(this,"_invokeTaskZS"),Dt(this,"_invokeTaskCurrZone"),Dt(this,"_cancelTaskDlgt"),Dt(this,"_cancelTaskZS"),Dt(this,"_cancelTaskCurrZone"),Dt(this,"_hasTaskDlgt"),Dt(this,"_hasTaskDlgtOwner"),Dt(this,"_hasTaskZS"),Dt(this,"_hasTaskCurrZone"),this._zone=ie,this._parentDelegate=$,this._forkZS=Z&&(Z&&Z.onFork?Z:$._forkZS),this._forkDlgt=Z&&(Z.onFork?$:$._forkDlgt),this._forkCurrZone=Z&&(Z.onFork?this._zone:$._forkCurrZone),this._interceptZS=Z&&(Z.onIntercept?Z:$._interceptZS),this._interceptDlgt=Z&&(Z.onIntercept?$:$._interceptDlgt),this._interceptCurrZone=Z&&(Z.onIntercept?this._zone:$._interceptCurrZone),this._invokeZS=Z&&(Z.onInvoke?Z:$._invokeZS),this._invokeDlgt=Z&&(Z.onInvoke?$:$._invokeDlgt),this._invokeCurrZone=Z&&(Z.onInvoke?this._zone:$._invokeCurrZone),this._handleErrorZS=Z&&(Z.onHandleError?Z:$._handleErrorZS),this._handleErrorDlgt=Z&&(Z.onHandleError?$:$._handleErrorDlgt),this._handleErrorCurrZone=Z&&(Z.onHandleError?this._zone:$._handleErrorCurrZone),this._scheduleTaskZS=Z&&(Z.onScheduleTask?Z:$._scheduleTaskZS),this._scheduleTaskDlgt=Z&&(Z.onScheduleTask?$:$._scheduleTaskDlgt),this._scheduleTaskCurrZone=Z&&(Z.onScheduleTask?this._zone:$._scheduleTaskCurrZone),this._invokeTaskZS=Z&&(Z.onInvokeTask?Z:$._invokeTaskZS),this._invokeTaskDlgt=Z&&(Z.onInvokeTask?$:$._invokeTaskDlgt),this._invokeTaskCurrZone=Z&&(Z.onInvokeTask?this._zone:$._invokeTaskCurrZone),this._cancelTaskZS=Z&&(Z.onCancelTask?Z:$._cancelTaskZS),this._cancelTaskDlgt=Z&&(Z.onCancelTask?$:$._cancelTaskDlgt),this._cancelTaskCurrZone=Z&&(Z.onCancelTask?this._zone:$._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;let _e=Z&&Z.onHasTask,Ve=$&&$._hasTaskZS;(_e||Ve)&&(this._hasTaskZS=_e?Z:r,this._hasTaskDlgt=$,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=this._zone,Z.onScheduleTask||(this._scheduleTaskZS=r,this._scheduleTaskDlgt=$,this._scheduleTaskCurrZone=this._zone),Z.onInvokeTask||(this._invokeTaskZS=r,this._invokeTaskDlgt=$,this._invokeTaskCurrZone=this._zone),Z.onCancelTask||(this._cancelTaskZS=r,this._cancelTaskDlgt=$,this._cancelTaskCurrZone=this._zone))}get zone(){return this._zone}fork(ie,$){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,ie,$):new o(ie,$)}intercept(ie,$,Z){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,ie,$,Z):$}invoke(ie,$,Z,_e,Ve){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,ie,$,Z,_e,Ve):$.apply(Z,_e)}handleError(ie,$){return this._handleErrorZS?this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,ie,$):!0}scheduleTask(ie,$){let Z=$;if(this._scheduleTaskZS)this._hasTaskZS&&Z._zoneDelegates.push(this._hasTaskDlgtOwner),Z=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,ie,$),Z||(Z=$);else if($.scheduleFn)$.scheduleFn($);else if($.type==ue)E($);else throw new Error("Task is missing scheduleFn.");return Z}invokeTask(ie,$,Z,_e){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,ie,$,Z,_e):$.callback.apply(Z,_e)}cancelTask(ie,$){let Z;if(this._cancelTaskZS)Z=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,ie,$);else{if(!$.cancelFn)throw Error("Task is not cancelable");Z=$.cancelFn($)}return Z}hasTask(ie,$){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,ie,$)}catch(Z){this.handleError(ie,Z)}}_updateTaskCount(ie,$){let Z=this._taskCounts,_e=Z[ie],Ve=Z[ie]=_e+$;if(Ve<0)throw new Error("More tasks executed then were scheduled.");if(_e==0||Ve==0){let Ae={microTask:Z.microTask>0,macroTask:Z.macroTask>0,eventTask:Z.eventTask>0,change:ie};this.hasTask(this._zone,Ae)}}}class l{static{a(this,"ZoneTask")}constructor(ie,$,Z,_e,Ve,Ae){if(Dt(this,"type"),Dt(this,"source"),Dt(this,"invoke"),Dt(this,"callback"),Dt(this,"data"),Dt(this,"scheduleFn"),Dt(this,"cancelFn"),Dt(this,"_zone",null),Dt(this,"runCount",0),Dt(this,"_zoneDelegates",null),Dt(this,"_state","notScheduled"),this.type=ie,this.source=$,this.data=_e,this.scheduleFn=Ve,this.cancelFn=Ae,!Z)throw new Error("callback is not defined");this.callback=Z;let xt=this;ie===Q&&_e&&_e.useG?this.invoke=l.invokeTask:this.invoke=function(){return l.invokeTask.call(Pr,xt,this,arguments)}}static invokeTask(ie,$,Z){ie||(ie=this),be++;try{return ie.runCount++,ie.zone.runTask(ie,$,Z)}finally{be==1&&P(),be--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(D,O)}_transitionTo(ie,$,Z){if(this._state===$||this._state===Z)this._state=ie,ie==D&&(this._zoneDelegates=null);else throw new Error(`${this.type} '${this.source}': can not transition to '${ie}', expecting state '${$}'${Z?" or '"+Z+"'":""}, was '${this._state}'.`)}toString(){return this.data&&typeof this.data.handleId<"u"?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}let c=Oo("setTimeout"),h=Oo("Promise"),f=Oo("then"),v=[],C=!1,S;function k(De){if(S||Pr[h]&&(S=Pr[h].resolve(0)),S){let ie=S[f];ie||(ie=S.then),ie.call(S,De)}else Pr[c](De,0)}a(k,"nativeScheduleMicroTask");function E(De){be===0&&v.length===0&&k(P),De&&v.push(De)}a(E,"scheduleMicroTask");function P(){if(!C){for(C=!0;v.length;){let De=v;v=[];for(let ie=0;ie<De.length;ie++){let $=De[ie];try{$.zone.runTask($,null,null)}catch(Z){ne.onUnhandledError(Z)}}}ne.microtaskDrainDone(),C=!1}}a(P,"drainMicroTaskQueue");let F={name:"NO ZONE"},D="notScheduled",O="scheduling",H="scheduled",U="running",Y="canceling",ce="unknown",ue="microTask",K="macroTask",Q="eventTask",L={},ne={symbol:Oo,currentZoneFrame:a(()=>se,"currentZoneFrame"),onUnhandledError:ke,microtaskDrainDone:ke,scheduleMicroTask:E,showUncaughtError:a(()=>!o[Oo("ignoreConsoleErrorUncaughtError")],"showUncaughtError"),patchEventTarget:a(()=>[],"patchEventTarget"),patchOnProperties:ke,patchMethod:a(()=>ke,"patchMethod"),bindArguments:a(()=>[],"bindArguments"),patchThen:a(()=>ke,"patchThen"),patchMacroTask:a(()=>ke,"patchMacroTask"),patchEventPrototype:a(()=>ke,"patchEventPrototype"),getGlobalObjects:a(()=>{},"getGlobalObjects"),ObjectDefineProperty:a(()=>ke,"ObjectDefineProperty"),ObjectGetOwnPropertyDescriptor:a(()=>{},"ObjectGetOwnPropertyDescriptor"),ObjectCreate:a(()=>{},"ObjectCreate"),ArraySlice:a(()=>[],"ArraySlice"),patchClass:a(()=>ke,"patchClass"),wrapWithCurrentZone:a(()=>ke,"wrapWithCurrentZone"),filterProperties:a(()=>[],"filterProperties"),attachOriginToPatched:a(()=>ke,"attachOriginToPatched"),_redefineProperty:a(()=>ke,"_redefineProperty"),patchCallbacks:a(()=>ke,"patchCallbacks"),nativeScheduleMicroTask:k},se={parent:null,zone:new o(null,null)},Ce=null,be=0;function ke(){}return a(ke,"noop"),t("Zone","Zone"),o}a(Az,"initZone");function Nz(){var n;let e=globalThis,t=e[Oo("forceDuplicateZoneCheck")]===!0;if(e.Zone&&(t||typeof e.Zone.__symbol__!="function"))throw new Error("Zone already loaded.");return(n=e.Zone)!=null||(e.Zone=Az()),e.Zone}a(Nz,"loadZone");var Np=Object.getOwnPropertyDescriptor,S1=Object.defineProperty,j1=Object.getPrototypeOf,Vz=Object.create,Lz=Array.prototype.slice,k1="addEventListener",M1="removeEventListener",b1=Oo(k1),x1=Oo(M1),ua="true",pa="false",Vp=Oo("");function E1(n,e){return Zone.current.wrap(n,e)}a(E1,"wrapWithCurrentZone");function R1(n,e,t,i,o){return Zone.current.scheduleMacroTask(n,e,t,i,o)}a(R1,"scheduleMacroTaskWithCurrentZone");var dn=Oo,mg=typeof window<"u",hg=mg?window:void 0,pi=mg&&hg||globalThis,Bz="removeAttribute";function I1(n,e){for(let t=n.length-1;t>=0;t--)typeof n[t]=="function"&&(n[t]=E1(n[t],e+"_"+t));return n}a(I1,"bindArguments");function zz(n,e){let t=n.constructor.name;for(let i=0;i<e.length;i++){let o=e[i],r=n[o];if(r){let s=Np(n,o);if(!GT(s))continue;n[o]=(l=>{let c=a(function(){return l.apply(this,I1(arguments,t+"."+o))},"patched");return ha(c,l),c})(r)}}}a(zz,"patchPrototype");function GT(n){return n?n.writable===!1?!1:!(typeof n.get=="function"&&typeof n.set>"u"):!0}a(GT,"isPropertyWritable");var WT=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,fg=!("nw"in pi)&&typeof pi.process<"u"&&pi.process.toString()==="[object process]",P1=!fg&&!WT&&!!(mg&&hg.HTMLElement),KT=typeof pi.process<"u"&&pi.process.toString()==="[object process]"&&!WT&&!!(mg&&hg.HTMLElement),pg={},Hz=dn("enable_beforeunload"),VT=a(function(n){if(n=n||pi.event,!n)return;let e=pg[n.type];e||(e=pg[n.type]=dn("ON_PROPERTY"+n.type));let t=this||n.target||pi,i=t[e],o;if(P1&&t===hg&&n.type==="error"){let r=n;o=i&&i.call(this,r.message,r.filename,r.lineno,r.colno,r.error),o===!0&&n.preventDefault()}else o=i&&i.apply(this,arguments),n.type==="beforeunload"&&pi[Hz]&&typeof o=="string"?n.returnValue=o:o!=null&&!o&&n.preventDefault();return o},"wrapFn");function LT(n,e,t){let i=Np(n,e);if(!i&&t&&Np(t,e)&&(i={enumerable:!0,configurable:!0}),!i||!i.configurable)return;let o=dn("on"+e+"patched");if(n.hasOwnProperty(o)&&n[o])return;delete i.writable,delete i.value;let r=i.get,s=i.set,l=e.slice(2),c=pg[l];c||(c=pg[l]=dn("ON_PROPERTY"+l)),i.set=function(h){let f=this;if(!f&&n===pi&&(f=pi),!f)return;typeof f[c]=="function"&&f.removeEventListener(l,VT),s?.call(f,null),f[c]=h,typeof h=="function"&&f.addEventListener(l,VT,!1)},i.get=function(){let h=this;if(!h&&n===pi&&(h=pi),!h)return null;let f=h[c];if(f)return f;if(r){let v=r.call(this);if(v)return i.set.call(this,v),typeof h[Bz]=="function"&&h.removeAttribute(e),v}return null},S1(n,e,i),n[o]=!0}a(LT,"patchProperty");function UT(n,e,t){if(e)for(let i=0;i<e.length;i++)LT(n,"on"+e[i],t);else{let i=[];for(let o in n)o.slice(0,2)=="on"&&i.push(o);for(let o=0;o<i.length;o++)LT(n,i[o],t)}}a(UT,"patchOnProperties");var or=dn("originalInstance");function Ap(n){let e=pi[n];if(!e)return;pi[dn(n)]=e,pi[n]=function(){let o=I1(arguments,n);switch(o.length){case 0:this[or]=new e;break;case 1:this[or]=new e(o[0]);break;case 2:this[or]=new e(o[0],o[1]);break;case 3:this[or]=new e(o[0],o[1],o[2]);break;case 4:this[or]=new e(o[0],o[1],o[2],o[3]);break;default:throw new Error("Arg list too long.")}},ha(pi[n],e);let t=new e(function(){}),i;for(i in t)n==="XMLHttpRequest"&&i==="responseBlob"||(function(o){typeof t[o]=="function"?pi[n].prototype[o]=function(){return this[or][o].apply(this[or],arguments)}:S1(pi[n].prototype,o,{set:a(function(r){typeof r=="function"?(this[or][o]=E1(r,n+"."+o),ha(this[or][o],r)):this[or][o]=r},"set"),get:a(function(){return this[or][o]},"get")})})(i);for(i in e)i!=="prototype"&&e.hasOwnProperty(i)&&(pi[n][i]=e[i])}a(Ap,"patchClass");function Gz(n,e){if(typeof Object.getOwnPropertySymbols!="function")return;Object.getOwnPropertySymbols(n).forEach(i=>{let o=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(e,i,{get:a(function(){return n[i]},"get"),set:a(function(r){o&&(!o.writable||typeof o.set!="function")||(n[i]=r)},"set"),enumerable:o?o.enumerable:!0,configurable:o?o.configurable:!0})})}a(Gz,"copySymbolProperties");var Wz=!1;function ma(n,e,t){let i=n;for(;i&&!i.hasOwnProperty(e);)i=j1(i);!i&&n[e]&&(i=n);let o=dn(e),r=null;if(i&&(!(r=i[o])||!i.hasOwnProperty(o))){r=i[o]=i[e];let s=i&&Np(i,e);if(GT(s)){let l=t(r,o,e);i[e]=function(){return l(this,arguments)},ha(i[e],r),Wz&&Gz(r,i[e])}}return r}a(ma,"patchMethod");function Kz(n,e,t){let i=null;function o(r){let s=r.data;return s.args[s.cbIdx]=function(){r.invoke.apply(this,arguments)},i.apply(s.target,s.args),r}a(o,"scheduleTask"),i=ma(n,e,r=>function(s,l){let c=t(s,l);return c.cbIdx>=0&&typeof l[c.cbIdx]=="function"?R1(c.name,l[c.cbIdx],c,o):r.apply(s,l)})}a(Kz,"patchMacroTask");function ha(n,e){n[dn("OriginalDelegate")]=e}a(ha,"attachOriginToPatched");function BT(n){return typeof n=="function"}a(BT,"isFunction");function zT(n){return typeof n=="number"}a(zT,"isNumber");var Uz={useG:!0},Ao={},qT={},JT=new RegExp("^"+Vp+"(\\w+)(true|false)$"),XT=dn("propagationStopped");function YT(n,e){let t=(e?e(n):n)+pa,i=(e?e(n):n)+ua,o=Vp+t,r=Vp+i;Ao[n]={},Ao[n][pa]=o,Ao[n][ua]=r}a(YT,"prepareEventNames");function qz(n,e,t,i){let o=i&&i.add||k1,r=i&&i.rm||M1,s=i&&i.listeners||"eventListeners",l=i&&i.rmAll||"removeAllListeners",c=dn(o),h="."+o+":",f="prependListener",v="."+f+":",C=a(function(D,O,H){if(D.isRemoved)return;let U=D.callback;typeof U=="object"&&U.handleEvent&&(D.callback=ue=>U.handleEvent(ue),D.originalDelegate=U);let Y;try{D.invoke(D,O,[H])}catch(ue){Y=ue}let ce=D.options;if(ce&&typeof ce=="object"&&ce.once){let ue=D.originalDelegate?D.originalDelegate:D.callback;O[r].call(O,H.type,ue,ce)}return Y},"invokeTask");function S(D,O,H){if(O=O||n.event,!O)return;let U=D||O.target||n,Y=U[Ao[O.type][H?ua:pa]];if(Y){let ce=[];if(Y.length===1){let ue=C(Y[0],U,O);ue&&ce.push(ue)}else{let ue=Y.slice();for(let K=0;K<ue.length&&!(O&&O[XT]===!0);K++){let Q=C(ue[K],U,O);Q&&ce.push(Q)}}if(ce.length===1)throw ce[0];for(let ue=0;ue<ce.length;ue++){let K=ce[ue];e.nativeScheduleMicroTask(()=>{throw K})}}}a(S,"globalCallback");let k=a(function(D){return S(this,D,!1)},"globalZoneAwareCallback"),E=a(function(D){return S(this,D,!0)},"globalZoneAwareCaptureCallback");function P(D,O){if(!D)return!1;let H=!0;O&&O.useG!==void 0&&(H=O.useG);let U=O&&O.vh,Y=!0;O&&O.chkDup!==void 0&&(Y=O.chkDup);let ce=!1;O&&O.rt!==void 0&&(ce=O.rt);let ue=D;for(;ue&&!ue.hasOwnProperty(o);)ue=j1(ue);if(!ue&&D[o]&&(ue=D),!ue||ue[c])return!1;let K=O&&O.eventNameToString,Q={},L=ue[c]=ue[o],ne=ue[dn(r)]=ue[r],se=ue[dn(s)]=ue[s],Ce=ue[dn(l)]=ue[l],be;O&&O.prepend&&(be=ue[dn(O.prepend)]=ue[O.prepend]);function ke(oe,Se){return Se?typeof oe=="boolean"?{capture:oe,passive:!0}:oe?typeof oe=="object"&&oe.passive!==!1?Oz(NT({},oe),{passive:!0}):oe:{passive:!0}:oe}a(ke,"buildEventListenerOptions");let De=a(function(oe){if(!Q.isExisting)return L.call(Q.target,Q.eventName,Q.capture?E:k,Q.options)},"customScheduleGlobal"),ie=a(function(oe){if(!oe.isRemoved){let Se=Ao[oe.eventName],Ke;Se&&(Ke=Se[oe.capture?ua:pa]);let et=Ke&&oe.target[Ke];if(et){for(let Ue=0;Ue<et.length;Ue++)if(et[Ue]===oe){et.splice(Ue,1),oe.isRemoved=!0,oe.removeAbortListener&&(oe.removeAbortListener(),oe.removeAbortListener=null),et.length===0&&(oe.allRemoved=!0,oe.target[Ke]=null);break}}}if(oe.allRemoved)return ne.call(oe.target,oe.eventName,oe.capture?E:k,oe.options)},"customCancelGlobal"),$=a(function(oe){return L.call(Q.target,Q.eventName,oe.invoke,Q.options)},"customScheduleNonGlobal"),Z=a(function(oe){return be.call(Q.target,Q.eventName,oe.invoke,Q.options)},"customSchedulePrepend"),_e=a(function(oe){return ne.call(oe.target,oe.eventName,oe.invoke,oe.options)},"customCancelNonGlobal"),Ve=H?De:$,Ae=H?ie:_e,xt=a(function(oe,Se){let Ke=typeof Se;return Ke==="function"&&oe.callback===Se||Ke==="object"&&oe.originalDelegate===Se},"compareTaskCallbackVsDelegate"),yt=O?.diff||xt,Tt=Zone[dn("UNPATCHED_EVENTS")],tt=n[dn("PASSIVE_EVENTS")];function ve(oe){if(typeof oe=="object"&&oe!==null){let Se=NT({},oe);return oe.signal&&(Se.signal=oe.signal),Se}return oe}a(ve,"copyEventListenerOptions");let we=a(function(oe,Se,Ke,et,Ue=!1,nt=!1){return function(){let ht=this||n,vt=arguments[0];O&&O.transferEventName&&(vt=O.transferEventName(vt));let At=arguments[1];if(!At)return oe.apply(this,arguments);if(fg&&vt==="uncaughtException")return oe.apply(this,arguments);let Kt=!1;if(typeof At!="function"){if(!At.handleEvent)return oe.apply(this,arguments);Kt=!0}if(U&&!U(oe,At,ht,arguments))return;let fi=!!tt&&tt.indexOf(vt)!==-1,ai=ve(ke(arguments[2],fi)),To=ai?.signal;if(To?.aborted)return;if(Tt){for(let yr=0;yr<Tt.length;yr++)if(vt===Tt[yr])return fi?oe.call(ht,vt,At,ai):oe.apply(this,arguments)}let rl=ai?typeof ai=="boolean"?!0:ai.capture:!1,xf=ai&&typeof ai=="object"?ai.once:!1,B_=Zone.current,fp=Ao[vt];fp||(YT(vt,K),fp=Ao[vt]);let _R=fp[rl?ua:pa],xc=ht[_R],SR=!1;if(xc){if(SR=!0,Y){for(let yr=0;yr<xc.length;yr++)if(yt(xc[yr],At))return}}else xc=ht[_R]=[];let yf,jR=ht.constructor.name,kR=qT[jR];kR&&(yf=kR[vt]),yf||(yf=jR+Se+(K?K(vt):vt)),Q.options=ai,xf&&(Q.options.once=!1),Q.target=ht,Q.capture=rl,Q.eventName=vt,Q.isExisting=SR;let gp=H?Uz:void 0;gp&&(gp.taskData=Q),To&&(Q.options.signal=void 0);let Yo=B_.scheduleEventTask(yf,At,gp,Ke,et);if(To){Q.options.signal=To;let yr=a(()=>Yo.zone.cancelTask(Yo),"onAbort");oe.call(To,"abort",yr,{once:!0}),Yo.removeAbortListener=()=>To.removeEventListener("abort",yr)}if(Q.target=null,gp&&(gp.taskData=null),xf&&(Q.options.once=!0),typeof Yo.options!="boolean"&&(Yo.options=ai),Yo.target=ht,Yo.capture=rl,Yo.eventName=vt,Kt&&(Yo.originalDelegate=At),nt?xc.unshift(Yo):xc.push(Yo),Ue)return ht}},"makeAddListener");return ue[o]=we(L,h,Ve,Ae,ce),be&&(ue[f]=we(be,v,Z,Ae,ce,!0)),ue[r]=function(){let oe=this||n,Se=arguments[0];O&&O.transferEventName&&(Se=O.transferEventName(Se));let Ke=arguments[2],et=Ke?typeof Ke=="boolean"?!0:Ke.capture:!1,Ue=arguments[1];if(!Ue)return ne.apply(this,arguments);if(U&&!U(ne,Ue,oe,arguments))return;let nt=Ao[Se],ht;nt&&(ht=nt[et?ua:pa]);let vt=ht&&oe[ht];if(vt)for(let At=0;At<vt.length;At++){let Kt=vt[At];if(yt(Kt,Ue)){if(vt.splice(At,1),Kt.isRemoved=!0,vt.length===0&&(Kt.allRemoved=!0,oe[ht]=null,!et&&typeof Se=="string")){let fi=Vp+"ON_PROPERTY"+Se;oe[fi]=null}return Kt.zone.cancelTask(Kt),ce?oe:void 0}}return ne.apply(this,arguments)},ue[s]=function(){let oe=this||n,Se=arguments[0];O&&O.transferEventName&&(Se=O.transferEventName(Se));let Ke=[],et=ZT(oe,K?K(Se):Se);for(let Ue=0;Ue<et.length;Ue++){let nt=et[Ue],ht=nt.originalDelegate?nt.originalDelegate:nt.callback;Ke.push(ht)}return Ke},ue[l]=function(){let oe=this||n,Se=arguments[0];if(Se){O&&O.transferEventName&&(Se=O.transferEventName(Se));let Ke=Ao[Se];if(Ke){let et=Ke[pa],Ue=Ke[ua],nt=oe[et],ht=oe[Ue];if(nt){let vt=nt.slice();for(let At=0;At<vt.length;At++){let Kt=vt[At],fi=Kt.originalDelegate?Kt.originalDelegate:Kt.callback;this[r].call(this,Se,fi,Kt.options)}}if(ht){let vt=ht.slice();for(let At=0;At<vt.length;At++){let Kt=vt[At],fi=Kt.originalDelegate?Kt.originalDelegate:Kt.callback;this[r].call(this,Se,fi,Kt.options)}}}}else{let Ke=Object.keys(oe);for(let et=0;et<Ke.length;et++){let Ue=Ke[et],nt=JT.exec(Ue),ht=nt&&nt[1];ht&&ht!=="removeListener"&&this[l].call(this,ht)}this[l].call(this,"removeListener")}if(ce)return this},ha(ue[o],L),ha(ue[r],ne),Ce&&ha(ue[l],Ce),se&&ha(ue[s],se),!0}a(P,"patchEventTargetMethods");let F=[];for(let D=0;D<t.length;D++)F[D]=P(t[D],i);return F}a(qz,"patchEventTarget");function ZT(n,e){if(!e){let r=[];for(let s in n){let l=JT.exec(s),c=l&&l[1];if(c&&(!e||c===e)){let h=n[s];if(h)for(let f=0;f<h.length;f++)r.push(h[f])}}return r}let t=Ao[e];t||(YT(e),t=Ao[e]);let i=n[t[pa]],o=n[t[ua]];return i?o?i.concat(o):i.slice():o?o.slice():[]}a(ZT,"findEventTasks");function Jz(n,e){let t=n.Event;t&&t.prototype&&e.patchMethod(t.prototype,"stopImmediatePropagation",i=>function(o,r){o[XT]=!0,i&&i.apply(o,r)})}a(Jz,"patchEventPrototype");function Xz(n,e){e.patchMethod(n,"queueMicrotask",t=>function(i,o){Zone.current.scheduleMicroTask("queueMicrotask",o[0])})}a(Xz,"patchQueueMicrotask");var ug=dn("zoneTask");function Ac(n,e,t,i){let o=null,r=null;e+=i,t+=i;let s={};function l(h){let f=h.data;f.args[0]=function(){return h.invoke.apply(this,arguments)};let v=o.apply(n,f.args);return zT(v)?f.handleId=v:(f.handle=v,f.isRefreshable=BT(v.refresh)),h}a(l,"scheduleTask");function c(h){let{handle:f,handleId:v}=h.data;return r.call(n,f??v)}a(c,"clearTask"),o=ma(n,e,h=>function(f,v){var C;if(BT(v[0])){let S={isRefreshable:!1,isPeriodic:i==="Interval",delay:i==="Timeout"||i==="Interval"?v[1]||0:void 0,args:v},k=v[0];v[0]=a(function(){try{return k.apply(this,arguments)}finally{let{handle:U,handleId:Y,isPeriodic:ce,isRefreshable:ue}=S;!ce&&!ue&&(Y?delete s[Y]:U&&(U[ug]=null))}},"timer");let E=R1(e,v[0],S,l,c);if(!E)return E;let{handleId:P,handle:F,isRefreshable:D,isPeriodic:O}=E.data;if(P)s[P]=E;else if(F&&(F[ug]=E,D&&!O)){let H=F.refresh;F.refresh=function(){let{zone:U,state:Y}=E;return Y==="notScheduled"?(E._state="scheduled",U._updateTaskCount(E,1)):Y==="running"&&(E._state="scheduling"),H.call(this)}}return(C=F??P)!=null?C:E}else return h.apply(n,v)}),r=ma(n,t,h=>function(f,v){let C=v[0],S;zT(C)?(S=s[C],delete s[C]):(S=C?.[ug],S?C[ug]=null:S=C),S?.type?S.cancelFn&&S.zone.cancelTask(S):h.apply(n,v)})}a(Ac,"patchTimer");function Yz(n,e){let{isBrowser:t,isMix:i}=e.getGlobalObjects();if(!t&&!i||!n.customElements||!("customElements"in n))return;let o=["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","formAssociatedCallback","formDisabledCallback","formResetCallback","formStateRestoreCallback"];e.patchCallbacks(e,n.customElements,"customElements","define",o)}a(Yz,"patchCustomElements");function Zz(n,e){if(Zone[e.symbol("patchEventTarget")])return;let{eventNames:t,zoneSymbolEventNames:i,TRUE_STR:o,FALSE_STR:r,ZONE_SYMBOL_PREFIX:s}=e.getGlobalObjects();for(let c=0;c<t.length;c++){let h=t[c],f=h+r,v=h+o,C=s+f,S=s+v;i[h]={},i[h][r]=C,i[h][o]=S}let l=n.EventTarget;if(!(!l||!l.prototype))return e.patchEventTarget(n,e,[l&&l.prototype]),!0}a(Zz,"eventTargetPatch");function Qz(n,e){e.patchEventPrototype(n,e)}a(Qz,"patchEvent");function QT(n,e,t){if(!t||t.length===0)return e;let i=t.filter(r=>r.target===n);if(i.length===0)return e;let o=i[0].ignoreProperties;return e.filter(r=>o.indexOf(r)===-1)}a(QT,"filterProperties");function HT(n,e,t,i){if(!n)return;let o=QT(n,e,t);UT(n,o,i)}a(HT,"patchFilteredProperties");function _1(n){return Object.getOwnPropertyNames(n).filter(e=>e.startsWith("on")&&e.length>2).map(e=>e.substring(2))}a(_1,"getOnEventNames");function $z(n,e){if(fg&&!KT||Zone[n.symbol("patchEvents")])return;let t=e.__Zone_ignore_on_properties,i=[];if(P1){let o=window;i=i.concat(["Document","SVGElement","Element","HTMLElement","HTMLBodyElement","HTMLMediaElement","HTMLFrameSetElement","HTMLFrameElement","HTMLIFrameElement","HTMLMarqueeElement","Worker"]),HT(o,_1(o),t,j1(o))}i=i.concat(["XMLHttpRequest","XMLHttpRequestEventTarget","IDBIndex","IDBRequest","IDBOpenDBRequest","IDBDatabase","IDBTransaction","IDBCursor","WebSocket"]);for(let o=0;o<i.length;o++){let r=e[i[o]];r?.prototype&&HT(r.prototype,_1(r.prototype),t)}}a($z,"propertyDescriptorPatch");function e9(n){n.__load_patch("timers",e=>{let i="clear";Ac(e,"set",i,"Timeout"),Ac(e,"set",i,"Interval"),Ac(e,"set",i,"Immediate")}),n.__load_patch("requestAnimationFrame",e=>{Ac(e,"request","cancel","AnimationFrame"),Ac(e,"mozRequest","mozCancel","AnimationFrame"),Ac(e,"webkitRequest","webkitCancel","AnimationFrame")}),n.__load_patch("blocking",(e,t)=>{let i=["alert","prompt","confirm"];for(let o=0;o<i.length;o++){let r=i[o];ma(e,r,(s,l,c)=>function(h,f){return t.current.run(s,e,f,c)})}}),n.__load_patch("EventTarget",(e,t,i)=>{Qz(e,i),Zz(e,i);let o=e.XMLHttpRequestEventTarget;o&&o.prototype&&i.patchEventTarget(e,i,[o.prototype])}),n.__load_patch("MutationObserver",(e,t,i)=>{Ap("MutationObserver"),Ap("WebKitMutationObserver")}),n.__load_patch("IntersectionObserver",(e,t,i)=>{Ap("IntersectionObserver")}),n.__load_patch("FileReader",(e,t,i)=>{Ap("FileReader")}),n.__load_patch("on_property",(e,t,i)=>{$z(i,e)}),n.__load_patch("customElements",(e,t,i)=>{Yz(e,i)}),n.__load_patch("XHR",(e,t)=>{h(e);let i=dn("xhrTask"),o=dn("xhrSync"),r=dn("xhrListener"),s=dn("xhrScheduled"),l=dn("xhrURL"),c=dn("xhrErrorBeforeScheduled");function h(f){let v=f.XMLHttpRequest;if(!v)return;let C=v.prototype;function S(L){return L[i]}a(S,"findPendingTask");let k=C[b1],E=C[x1];if(!k){let L=f.XMLHttpRequestEventTarget;if(L){let ne=L.prototype;k=ne[b1],E=ne[x1]}}let P="readystatechange",F="scheduled";function D(L){let ne=L.data,se=ne.target;se[s]=!1,se[c]=!1;let Ce=se[r];k||(k=se[b1],E=se[x1]),Ce&&E.call(se,P,Ce);let be=se[r]=()=>{if(se.readyState===se.DONE)if(!ne.aborted&&se[s]&&L.state===F){let De=se[t.__symbol__("loadfalse")];if(se.status!==0&&De&&De.length>0){let ie=L.invoke;L.invoke=function(){let $=se[t.__symbol__("loadfalse")];for(let Z=0;Z<$.length;Z++)$[Z]===L&&$.splice(Z,1);!ne.aborted&&L.state===F&&ie.call(L)},De.push(L)}else L.invoke()}else!ne.aborted&&se[s]===!1&&(se[c]=!0)};return k.call(se,P,be),se[i]||(se[i]=L),K.apply(se,ne.args),se[s]=!0,L}a(D,"scheduleTask");function O(){}a(O,"placeholderCallback");function H(L){let ne=L.data;return ne.aborted=!0,Q.apply(ne.target,ne.args)}a(H,"clearTask");let U=ma(C,"open",()=>function(L,ne){return L[o]=ne[2]==!1,L[l]=ne[1],U.apply(L,ne)}),Y="XMLHttpRequest.send",ce=dn("fetchTaskAborting"),ue=dn("fetchTaskScheduling"),K=ma(C,"send",()=>function(L,ne){if(t.current[ue]===!0||L[o])return K.apply(L,ne);{let se={target:L,url:L[l],isPeriodic:!1,args:ne,aborted:!1},Ce=R1(Y,O,se,D,H);L&&L[c]===!0&&!se.aborted&&Ce.state===F&&Ce.invoke()}}),Q=ma(C,"abort",()=>function(L,ne){let se=S(L);if(se&&typeof se.type=="string"){if(se.cancelFn==null||se.data&&se.data.aborted)return;se.zone.cancelTask(se)}else if(t.current[ce]===!0)return Q.apply(L,ne)})}a(h,"patchXHR")}),n.__load_patch("geolocation",e=>{e.navigator&&e.navigator.geolocation&&zz(e.navigator.geolocation,["getCurrentPosition","watchPosition"])}),n.__load_patch("PromiseRejectionEvent",(e,t)=>{function i(o){return function(r){ZT(e,o).forEach(l=>{let c=e.PromiseRejectionEvent;if(c){let h=new c(o,{promise:r.promise,reason:r.rejection});l.invoke(h)}})}}a(i,"findPromiseRejectionHandler"),e.PromiseRejectionEvent&&(t[dn("unhandledPromiseRejectionHandler")]=i("unhandledrejection"),t[dn("rejectionHandledHandler")]=i("rejectionhandled"))}),n.__load_patch("queueMicrotask",(e,t,i)=>{Xz(e,i)})}a(e9,"patchBrowser");function t9(n){n.__load_patch("ZoneAwarePromise",(e,t,i)=>{let o=Object.getOwnPropertyDescriptor,r=Object.defineProperty;function s(ve){if(ve&&ve.toString===Object.prototype.toString){let we=ve.constructor&&ve.constructor.name;return(we||"")+": "+JSON.stringify(ve)}return ve?ve.toString():Object.prototype.toString.call(ve)}a(s,"readableObjectToString");let l=i.symbol,c=[],h=e[l("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")]!==!1,f=l("Promise"),v=l("then"),C="__creationTrace__";i.onUnhandledError=ve=>{if(i.showUncaughtError()){let we=ve&&ve.rejection;we?console.error("Unhandled Promise rejection:",we instanceof Error?we.message:we,"; Zone:",ve.zone.name,"; Task:",ve.task&&ve.task.source,"; Value:",we,we instanceof Error?we.stack:void 0):console.error(ve)}},i.microtaskDrainDone=()=>{for(;c.length;){let ve=c.shift();try{ve.zone.runGuarded(()=>{throw ve.throwOriginal?ve.rejection:ve})}catch(we){k(we)}}};let S=l("unhandledPromiseRejectionHandler");function k(ve){i.onUnhandledError(ve);try{let we=t[S];typeof we=="function"&&we.call(this,ve)}catch{}}a(k,"handleUnhandledRejection");function E(ve){return ve&&typeof ve.then=="function"}a(E,"isThenable");function P(ve){return ve}a(P,"forwardResolution");function F(ve){return Ae.reject(ve)}a(F,"forwardRejection");let D=l("state"),O=l("value"),H=l("finally"),U=l("parentPromiseValue"),Y=l("parentPromiseState"),ce="Promise.then",ue=null,K=!0,Q=!1,L=0;function ne(ve,we){return oe=>{try{ke(ve,we,oe)}catch(Se){ke(ve,!1,Se)}}}a(ne,"makeResolver");let se=a(function(){let ve=!1;return a(function(oe){return function(){ve||(ve=!0,oe.apply(null,arguments))}},"wrapper")},"once"),Ce="Promise resolved with itself",be=l("currentTaskTrace");function ke(ve,we,oe){let Se=se();if(ve===oe)throw new TypeError(Ce);if(ve[D]===ue){let Ke=null;try{(typeof oe=="object"||typeof oe=="function")&&(Ke=oe&&oe.then)}catch(et){return Se(()=>{ke(ve,!1,et)})(),ve}if(we!==Q&&oe instanceof Ae&&oe.hasOwnProperty(D)&&oe.hasOwnProperty(O)&&oe[D]!==ue)ie(oe),ke(ve,oe[D],oe[O]);else if(we!==Q&&typeof Ke=="function")try{Ke.call(oe,Se(ne(ve,we)),Se(ne(ve,!1)))}catch(et){Se(()=>{ke(ve,!1,et)})()}else{ve[D]=we;let et=ve[O];if(ve[O]=oe,ve[H]===H&&we===K&&(ve[D]=ve[Y],ve[O]=ve[U]),we===Q&&oe instanceof Error){let Ue=t.currentTask&&t.currentTask.data&&t.currentTask.data[C];Ue&&r(oe,be,{configurable:!0,enumerable:!1,writable:!0,value:Ue})}for(let Ue=0;Ue<et.length;)$(ve,et[Ue++],et[Ue++],et[Ue++],et[Ue++]);if(et.length==0&&we==Q){ve[D]=L;let Ue=oe;try{throw new Error("Uncaught (in promise): "+s(oe)+(oe&&oe.stack?`
3
3
  `+oe.stack:""))}catch(nt){Ue=nt}h&&(Ue.throwOriginal=!0),Ue.rejection=oe,Ue.promise=ve,Ue.zone=t.current,Ue.task=t.currentTask,c.push(Ue),i.scheduleMicroTask()}}}return ve}a(ke,"resolvePromise");let De=l("rejectionHandledHandler");function ie(ve){if(ve[D]===L){try{let we=t[De];we&&typeof we=="function"&&we.call(this,{rejection:ve[O],promise:ve})}catch{}ve[D]=Q;for(let we=0;we<c.length;we++)ve===c[we].promise&&c.splice(we,1)}}a(ie,"clearRejectedNoCatch");function $(ve,we,oe,Se,Ke){ie(ve);let et=ve[D],Ue=et?typeof Se=="function"?Se:P:typeof Ke=="function"?Ke:F;we.scheduleMicroTask(ce,()=>{try{let nt=ve[O],ht=!!oe&&H===oe[H];ht&&(oe[U]=nt,oe[Y]=et);let vt=we.run(Ue,void 0,ht&&Ue!==F&&Ue!==P?[]:[nt]);ke(oe,!0,vt)}catch(nt){ke(oe,!1,nt)}},oe)}a($,"scheduleResolveOrReject");let Z="function ZoneAwarePromise() { [native code] }",_e=a(function(){},"noop"),Ve=e.AggregateError;class Ae{static{a(this,"ZoneAwarePromise")}static toString(){return Z}static resolve(we){return we instanceof Ae?we:ke(new this(null),K,we)}static reject(we){return ke(new this(null),Q,we)}static withResolvers(){let we={};return we.promise=new Ae((oe,Se)=>{we.resolve=oe,we.reject=Se}),we}static any(we){if(!we||typeof we[Symbol.iterator]!="function")return Promise.reject(new Ve([],"All promises were rejected"));let oe=[],Se=0;try{for(let Ue of we)Se++,oe.push(Ae.resolve(Ue))}catch{return Promise.reject(new Ve([],"All promises were rejected"))}if(Se===0)return Promise.reject(new Ve([],"All promises were rejected"));let Ke=!1,et=[];return new Ae((Ue,nt)=>{for(let ht=0;ht<oe.length;ht++)oe[ht].then(vt=>{Ke||(Ke=!0,Ue(vt))},vt=>{et.push(vt),Se--,Se===0&&(Ke=!0,nt(new Ve(et,"All promises were rejected")))})})}static race(we){let oe,Se,Ke=new this((nt,ht)=>{oe=nt,Se=ht});function et(nt){oe(nt)}a(et,"onResolve");function Ue(nt){Se(nt)}a(Ue,"onReject");for(let nt of we)E(nt)||(nt=this.resolve(nt)),nt.then(et,Ue);return Ke}static all(we){return Ae.allWithCallback(we)}static allSettled(we){return(this&&this.prototype instanceof Ae?this:Ae).allWithCallback(we,{thenCallback:a(Se=>({status:"fulfilled",value:Se}),"thenCallback"),errorCallback:a(Se=>({status:"rejected",reason:Se}),"errorCallback")})}static allWithCallback(we,oe){let Se,Ke,et=new this((vt,At)=>{Se=vt,Ke=At}),Ue=2,nt=0,ht=[];for(let vt of we){E(vt)||(vt=this.resolve(vt));let At=nt;try{vt.then(Kt=>{ht[At]=oe?oe.thenCallback(Kt):Kt,Ue--,Ue===0&&Se(ht)},Kt=>{oe?(ht[At]=oe.errorCallback(Kt),Ue--,Ue===0&&Se(ht)):Ke(Kt)})}catch(Kt){Ke(Kt)}Ue++,nt++}return Ue-=2,Ue===0&&Se(ht),et}constructor(we){let oe=this;if(!(oe instanceof Ae))throw new Error("Must be an instanceof Promise.");oe[D]=ue,oe[O]=[];try{let Se=se();we&&we(Se(ne(oe,K)),Se(ne(oe,Q)))}catch(Se){ke(oe,!1,Se)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return Ae}then(we,oe){var Se;let Ke=(Se=this.constructor)==null?void 0:Se[Symbol.species];(!Ke||typeof Ke!="function")&&(Ke=this.constructor||Ae);let et=new Ke(_e),Ue=t.current;return this[D]==ue?this[O].push(Ue,et,we,oe):$(this,Ue,et,we,oe),et}catch(we){return this.then(null,we)}finally(we){var oe;let Se=(oe=this.constructor)==null?void 0:oe[Symbol.species];(!Se||typeof Se!="function")&&(Se=Ae);let Ke=new Se(_e);Ke[H]=H;let et=t.current;return this[D]==ue?this[O].push(et,Ke,we,we):$(this,et,Ke,we,we),Ke}}Ae.resolve=Ae.resolve,Ae.reject=Ae.reject,Ae.race=Ae.race,Ae.all=Ae.all;let xt=e[f]=e.Promise;e.Promise=Ae;let yt=l("thenPatched");function Tt(ve){let we=ve.prototype,oe=o(we,"then");if(oe&&(oe.writable===!1||!oe.configurable))return;let Se=we.then;we[v]=Se,ve.prototype.then=function(Ke,et){return new Ae((nt,ht)=>{Se.call(this,nt,ht)}).then(Ke,et)},ve[yt]=!0}a(Tt,"patchThen"),i.patchThen=Tt;function tt(ve){return function(we,oe){let Se=ve.apply(we,oe);if(Se instanceof Ae)return Se;let Ke=Se.constructor;return Ke[yt]||Tt(Ke),Se}}return a(tt,"zoneify"),xt&&(Tt(xt),ma(e,"fetch",ve=>tt(ve))),Promise[t.__symbol__("uncaughtPromiseErrors")]=c,Ae})}a(t9,"patchPromise");function n9(n){n.__load_patch("toString",e=>{let t=Function.prototype.toString,i=dn("OriginalDelegate"),o=dn("Promise"),r=dn("Error"),s=a(function(){if(typeof this=="function"){let f=this[i];if(f)return typeof f=="function"?t.call(f):Object.prototype.toString.call(f);if(this===Promise){let v=e[o];if(v)return t.call(v)}if(this===Error){let v=e[r];if(v)return t.call(v)}}return t.call(this)},"toString");s[i]=t,Function.prototype.toString=s;let l=Object.prototype.toString,c="[object Promise]";Object.prototype.toString=function(){return typeof Promise=="function"&&this instanceof Promise?c:l.call(this)}})}a(n9,"patchToString");function i9(n,e,t,i,o){let r=Zone.__symbol__(i);if(e[r])return;let s=e[r]=e[i];e[i]=function(l,c,h){return c&&c.prototype&&o.forEach(function(f){let v=`${t}.${i}::`+f,C=c.prototype;try{if(C.hasOwnProperty(f)){let S=n.ObjectGetOwnPropertyDescriptor(C,f);S&&S.value?(S.value=n.wrapWithCurrentZone(S.value,v),n._redefineProperty(c.prototype,f,S)):C[f]&&(C[f]=n.wrapWithCurrentZone(C[f],v))}else C[f]&&(C[f]=n.wrapWithCurrentZone(C[f],v))}catch{}}),s.call(e,l,c,h)},n.attachOriginToPatched(e[i],s)}a(i9,"patchCallbacks");function o9(n){n.__load_patch("util",(e,t,i)=>{let o=_1(e);i.patchOnProperties=UT,i.patchMethod=ma,i.bindArguments=I1,i.patchMacroTask=Kz;let r=t.__symbol__("BLACK_LISTED_EVENTS"),s=t.__symbol__("UNPATCHED_EVENTS");e[s]&&(e[r]=e[s]),e[r]&&(t[r]=t[s]=e[r]),i.patchEventPrototype=Jz,i.patchEventTarget=qz,i.ObjectDefineProperty=S1,i.ObjectGetOwnPropertyDescriptor=Np,i.ObjectCreate=Vz,i.ArraySlice=Lz,i.patchClass=Ap,i.wrapWithCurrentZone=E1,i.filterProperties=QT,i.attachOriginToPatched=ha,i._redefineProperty=Object.defineProperty,i.patchCallbacks=i9,i.getGlobalObjects=()=>({globalSources:qT,zoneSymbolEventNames:Ao,eventNames:o,isBrowser:P1,isMix:KT,isNode:fg,TRUE_STR:ua,FALSE_STR:pa,ZONE_SYMBOL_PREFIX:Vp,ADD_EVENT_LISTENER_STR:k1,REMOVE_EVENT_LISTENER_STR:M1})})}a(o9,"patchUtil");function r9(n){t9(n),n9(n),o9(n)}a(r9,"patchCommon");var $T=Nz();r9($T);e9($T);var xl=class{static{a(this,"EventManagerPlugin")}_doc;constructor(e){this._doc=e}manager},Nc=class n extends xl{static{a(this,"DomEventsPlugin")}constructor(e){super(e)}supports(e){return!0}addEventListener(e,t,i,o){return e.addEventListener(t,i,o),()=>this.removeEventListener(e,t,i,o)}removeEventListener(e,t,i,o){return e.removeEventListener(t,i,o)}static \u0275fac=a(function(t){return new(t||n)(Ut(Qt))},"DomEventsPlugin_Factory");static \u0275prov=Me({token:n,factory:n.\u0275fac})},Vc=new Vt(""),Lp=class n{static{a(this,"EventManager")}_zone;_plugins;_eventNameToPlugin=new Map;constructor(e,t){this._zone=t,e.forEach(r=>{r.manager=this});let i=e.filter(r=>!(r instanceof Nc));this._plugins=i.slice().reverse();let o=e.find(r=>r instanceof Nc);o&&this._plugins.push(o)}addEventListener(e,t,i,o){return this._findPluginFor(t).addEventListener(e,t,i,o)}getZone(){return this._zone}_findPluginFor(e){let t=this._eventNameToPlugin.get(e);if(t)return t;if(t=this._plugins.find(o=>o.supports(e)),!t)throw new gi(5101,!1);return this._eventNameToPlugin.set(e,t),t}static \u0275fac=a(function(t){return new(t||n)(Ut(Vc),Ut(wt))},"EventManager_Factory");static \u0275prov=Me({token:n,factory:n.\u0275fac})},gg="ng-app-id";function eD(n){for(let e of n)e.remove()}a(eD,"removeElements");function tD(n,e){let t=e.createElement("style");return t.textContent=n,t}a(tD,"createStyleElement");function a9(n,e,t,i){let o=n.head?.querySelectorAll(`style[${gg}="${e}"],link[${gg}="${e}"]`);if(o)for(let r of o)r.removeAttribute(gg),r instanceof HTMLLinkElement?i.set(r.href.slice(r.href.lastIndexOf("/")+1),{usage:0,elements:[r]}):r.textContent&&t.set(r.textContent,{usage:0,elements:[r]})}a(a9,"addServerStyles");function D1(n,e){let t=e.createElement("link");return t.setAttribute("rel","stylesheet"),t.setAttribute("href",n),t}a(D1,"createLinkElement");var Bp=class n{static{a(this,"SharedStylesHost")}doc;appId;nonce;inline=new Map;external=new Map;hosts=new Set;constructor(e,t,i,o={}){this.doc=e,this.appId=t,this.nonce=i,a9(e,t,this.inline,this.external),this.hosts.add(e.head)}addStyles(e,t){for(let i of e)this.addUsage(i,this.inline,tD);t?.forEach(i=>this.addUsage(i,this.external,D1))}removeStyles(e,t){for(let i of e)this.removeUsage(i,this.inline);t?.forEach(i=>this.removeUsage(i,this.external))}addUsage(e,t,i){let o=t.get(e);o?o.usage++:t.set(e,{usage:1,elements:[...this.hosts].map(r=>this.addElement(r,i(e,this.doc)))})}removeUsage(e,t){let i=t.get(e);i&&(i.usage--,i.usage<=0&&(eD(i.elements),t.delete(e)))}ngOnDestroy(){for(let[,{elements:e}]of[...this.inline,...this.external])eD(e);this.hosts.clear()}addHost(e){this.hosts.add(e);for(let[t,{elements:i}]of this.inline)i.push(this.addElement(e,tD(t,this.doc)));for(let[t,{elements:i}]of this.external)i.push(this.addElement(e,D1(t,this.doc)))}removeHost(e){this.hosts.delete(e)}addElement(e,t){return this.nonce&&t.setAttribute("nonce",this.nonce),typeof ngServerMode<"u"&&ngServerMode&&t.setAttribute(gg,this.appId),e.appendChild(t)}static \u0275fac=a(function(t){return new(t||n)(Ut(Qt),Ut(Cp),Ut(bp,8),Ut(_c))},"SharedStylesHost_Factory");static \u0275prov=Me({token:n,factory:n.\u0275fac})},T1={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"},F1=/%COMP%/g;var iD="%COMP%",s9=`_nghost-${iD}`,l9=`_ngcontent-${iD}`,c9=!0,d9=new Vt("",{factory:a(()=>c9,"factory")});function u9(n){return l9.replace(F1,n)}a(u9,"shimContentAttribute");function p9(n){return s9.replace(F1,n)}a(p9,"shimHostAttribute");function oD(n,e){return e.map(t=>t.replace(F1,n))}a(oD,"shimStylesContent");var zp=class n{static{a(this,"DomRendererFactory2")}eventManager;sharedStylesHost;appId;removeStylesOnCompDestroy;doc;ngZone;nonce;tracingService;rendererByCompId=new Map;defaultRenderer;constructor(e,t,i,o,r,s,l=null,c=null){this.eventManager=e,this.sharedStylesHost=t,this.appId=i,this.removeStylesOnCompDestroy=o,this.doc=r,this.ngZone=s,this.nonce=l,this.tracingService=c,this.defaultRenderer=new Hp(e,r,s,this.tracingService)}createRenderer(e,t){if(!e||!t)return this.defaultRenderer;typeof ngServerMode<"u"&&ngServerMode&&(t.encapsulation===sa.ShadowDom||t.encapsulation===sa.ExperimentalIsolatedShadowDom)&&(t={...t,encapsulation:sa.Emulated});let i=this.getOrCreateRenderer(e,t);return i instanceof Cg?i.applyToHost(e):i instanceof Gp&&i.applyStyles(),i}getOrCreateRenderer(e,t){let i=this.rendererByCompId,o=i.get(t.id);if(!o){let r=this.doc,s=this.ngZone,l=this.eventManager,c=this.sharedStylesHost,h=this.removeStylesOnCompDestroy,f=this.tracingService;switch(t.encapsulation){case sa.Emulated:o=new Cg(l,c,t,this.appId,h,r,s,f);break;case sa.ShadowDom:return new vg(l,e,t,r,s,this.nonce,f,c);case sa.ExperimentalIsolatedShadowDom:return new vg(l,e,t,r,s,this.nonce,f);default:o=new Gp(l,c,t,h,r,s,f);break}i.set(t.id,o)}return o}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(e){this.rendererByCompId.delete(e)}static \u0275fac=a(function(t){return new(t||n)(Ut(Lp),Ut(Bp),Ut(Cp),Ut(d9),Ut(Qt),Ut(wt),Ut(bp),Ut(K_,8))},"DomRendererFactory2_Factory");static \u0275prov=Me({token:n,factory:n.\u0275fac})},Hp=class{static{a(this,"DefaultDomRenderer2")}eventManager;doc;ngZone;tracingService;data=Object.create(null);throwOnSyntheticProps=!0;constructor(e,t,i,o){this.eventManager=e,this.doc=t,this.ngZone=i,this.tracingService=o}destroy(){}destroyNode=null;createElement(e,t){return t?this.doc.createElementNS(T1[t]||t,e):this.doc.createElement(e)}createComment(e){return this.doc.createComment(e)}createText(e){return this.doc.createTextNode(e)}appendChild(e,t){(nD(e)?e.content:e).appendChild(t)}insertBefore(e,t,i){e&&(nD(e)?e.content:e).insertBefore(t,i)}removeChild(e,t){t.remove()}selectRootElement(e,t){let i=typeof e=="string"?this.doc.querySelector(e):e;if(!i)throw new gi(-5104,!1);return t||(i.textContent=""),i}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,i,o){if(o){t=o+":"+t;let r=T1[o];r?e.setAttributeNS(r,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){let o=T1[i];o?e.removeAttributeNS(o,t):e.removeAttribute(`${i}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,i,o){o&(xp.DashCase|xp.Important)?e.style.setProperty(t,i,o&xp.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&xp.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,i){e!=null&&(e[t]=i)}setValue(e,t){e.nodeValue=t}listen(e,t,i,o){if(typeof e=="string"&&(e=Mr().getGlobalEventTarget(this.doc,e),!e))throw new gi(5102,!1);let r=this.decoratePreventDefault(i);return this.tracingService?.wrapEventListener&&(r=this.tracingService.wrapEventListener(e,t,r)),this.eventManager.addEventListener(e,t,r,o)}decoratePreventDefault(e){return t=>{if(t==="__ngUnwrap__")return e;(typeof ngServerMode<"u"&&ngServerMode?this.ngZone.runGuarded(()=>e(t)):e(t))===!1&&t.preventDefault()}}};function nD(n){return n.tagName==="TEMPLATE"&&n.content!==void 0}a(nD,"isTemplateNode");var vg=class extends Hp{static{a(this,"ShadowDomRenderer")}hostEl;sharedStylesHost;shadowRoot;constructor(e,t,i,o,r,s,l,c){super(e,o,r,l),this.hostEl=t,this.sharedStylesHost=c,this.shadowRoot=t.attachShadow({mode:"open"}),this.sharedStylesHost&&this.sharedStylesHost.addHost(this.shadowRoot);let h=i.styles;h=oD(i.id,h);for(let v of h){let C=document.createElement("style");s&&C.setAttribute("nonce",s),C.textContent=v,this.shadowRoot.appendChild(C)}let f=i.getExternalStyles?.();if(f)for(let v of f){let C=D1(v,o);s&&C.setAttribute("nonce",s),this.shadowRoot.appendChild(C)}}nodeOrShadowRoot(e){return e===this.hostEl?this.shadowRoot:e}appendChild(e,t){return super.appendChild(this.nodeOrShadowRoot(e),t)}insertBefore(e,t,i){return super.insertBefore(this.nodeOrShadowRoot(e),t,i)}removeChild(e,t){return super.removeChild(null,t)}parentNode(e){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(e)))}destroy(){this.sharedStylesHost&&this.sharedStylesHost.removeHost(this.shadowRoot)}},Gp=class extends Hp{static{a(this,"NoneEncapsulationDomRenderer")}sharedStylesHost;removeStylesOnCompDestroy;styles;styleUrls;constructor(e,t,i,o,r,s,l,c){super(e,r,s,l),this.sharedStylesHost=t,this.removeStylesOnCompDestroy=o;let h=i.styles;this.styles=c?oD(c,h):h,this.styleUrls=i.getExternalStyles?.(c)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){this.removeStylesOnCompDestroy&&$R.size===0&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}},Cg=class extends Gp{static{a(this,"EmulatedEncapsulationDomRenderer2")}contentAttr;hostAttr;constructor(e,t,i,o,r,s,l,c){let h=o+"-"+i.id;super(e,t,i,r,s,l,c,h),this.contentAttr=u9(h),this.hostAttr=p9(h)}applyToHost(e){this.applyStyles(),this.setAttribute(e,this.hostAttr,"")}createElement(e,t){let i=super.createElement(e,t);return super.setAttribute(i,this.contentAttr,""),i}};var bg=class n extends _I{static{a(this,"BrowserDomAdapter")}supportsDOMEvents=!0;static makeCurrent(){wI(new n)}onAndCancel(e,t,i,o){return e.addEventListener(t,i,o),()=>{e.removeEventListener(t,i,o)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){e.remove()}createElement(e,t){return t=t||this.getDefaultDocument(),t.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,t){return t==="window"?window:t==="document"?e:t==="body"?e.body:null}getBaseHref(e){let t=m9();return t==null?null:h9(t)}resetBaseElement(){Wp=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return MI(document.cookie,e)}},Wp=null;function m9(){return Wp=Wp||document.head.querySelector("base"),Wp?Wp.getAttribute("href"):null}a(m9,"getBaseElementHref");function h9(n){return new URL(n,document.baseURI).pathname}a(h9,"relativePath");var xg=class{static{a(this,"BrowserGetTestability")}addToWindow(e){aa.getAngularTestability=(i,o=!0)=>{let r=e.findTestabilityInTree(i,o);if(r==null)throw new gi(5103,!1);return r},aa.getAllAngularTestabilities=()=>e.getAllTestabilities(),aa.getAllAngularRootElements=()=>e.getAllRootElements();let t=a(i=>{let o=aa.getAllAngularTestabilities(),r=o.length,s=a(function(){r--,r==0&&i()},"decrement");o.forEach(l=>{l.whenStable(s)})},"whenAllStable");aa.frameworkStabilizers||(aa.frameworkStabilizers=[]),aa.frameworkStabilizers.push(t)}findTestabilityInTree(e,t,i){if(t==null)return null;let o=e.getTestability(t);return o??(i?Mr().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null)}},O1=class n{static{a(this,"BrowserXhr")}build(){return new XMLHttpRequest}static \u0275fac=a(function(t){return new(t||n)},"BrowserXhr_Factory");static \u0275prov=Me({token:n,factory:n.\u0275fac})},rD=["alt","control","meta","shift"],f9={"\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"},g9={alt:a(n=>n.altKey,"alt"),control:a(n=>n.ctrlKey,"control"),meta:a(n=>n.metaKey,"meta"),shift:a(n=>n.shiftKey,"shift")},yg=class n extends xl{static{a(this,"KeyEventsPlugin")}constructor(e){super(e)}supports(e){return n.parseEventName(e)!=null}addEventListener(e,t,i,o){let r=n.parseEventName(t),s=n.eventCallback(r.fullKey,i,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Mr().onAndCancel(e,r.domEventName,s,o))}static parseEventName(e){let t=e.toLowerCase().split("."),i=t.shift();if(t.length===0||!(i==="keydown"||i==="keyup"))return null;let o=n._normalizeKey(t.pop()),r="",s=t.indexOf("code");if(s>-1&&(t.splice(s,1),r="code."),rD.forEach(c=>{let h=t.indexOf(c);h>-1&&(t.splice(h,1),r+=c+".")}),r+=o,t.length!=0||o.length===0)return null;let l={};return l.domEventName=i,l.fullKey=r,l}static matchEventFullKeyCode(e,t){let i=f9[e.key]||e.key,o="";return t.indexOf("code.")>-1&&(i=e.code,o="code."),i==null||!i?!1:(i=i.toLowerCase(),i===" "?i="space":i==="."&&(i="dot"),rD.forEach(r=>{if(r!==i){let s=g9[r];s(e)&&(o+=r+".")}}),o+=i,o===t)}static eventCallback(e,t,i){return o=>{n.matchEventFullKeyCode(o,e)&&i.runGuarded(()=>t(o))}}static _normalizeKey(e){return e==="esc"?"escape":e}static \u0275fac=a(function(t){return new(t||n)(Ut(Qt))},"KeyEventsPlugin_Factory");static \u0275prov=Me({token:n,factory:n.\u0275fac})};async function N1(n,e){return xI(v9(n,e))}a(N1,"createApplication");function v9(n,e){return{platformRef:e?.platformRef,appProviders:[...sD,...n?.providers??[]],platformProviders:aD}}a(v9,"createProvidersConfig");function C9(){bg.makeCurrent()}a(C9,"initDomAdapter");function b9(){return new G_}a(b9,"errorHandler");function x9(){return WR(document),document}a(x9,"_document");var aD=[{provide:_c,useValue:RI},{provide:KR,useValue:C9,multi:!0},{provide:Qt,useFactory:x9}],y9=vI(CI,"browser",aD),nKe=new Vt(""),w9=[{provide:iI,useClass:xg},{provide:nI,useClass:Ef},{provide:Ef,useClass:Ef}],sD=[{provide:zR,useValue:"root"},{provide:G_,useFactory:b9},{provide:Vc,useClass:Nc,multi:!0},{provide:Vc,useClass:yg,multi:!0},zp,Bp,Lp,{provide:Ri,useExisting:zp},{provide:EI,useClass:O1},[]],A1=class n{static{a(this,"BrowserModule")}constructor(){}static \u0275fac=a(function(t){return new(t||n)},"BrowserModule_Factory");static \u0275mod=ut({type:n});static \u0275inj=dt({providers:[...sD,...w9],imports:[Oe,bI]})};var lD=class n{static{a(this,"Meta")}_doc;_dom;constructor(e){this._doc=e,this._dom=Mr()}addTag(e,t=!1){return e?this._getOrCreateElement(e,t):null}addTags(e,t=!1){return e?e.reduce((i,o)=>(o&&i.push(this._getOrCreateElement(o,t)),i),[]):[]}getTag(e){if(!e)return null;let t=this._doc.querySelector(`meta[${e}]`);return t?.nodeName.toLowerCase()==="meta"?t:null}getTags(e){if(!e)return[];let t=this._doc.querySelectorAll(`meta[${e}]`);return t?[].slice.call(t).filter(i=>i.nodeName.toLowerCase()==="meta"):[]}updateTag(e,t){if(!e)return null;this._validateMetaDefinition(e),t=t||this._parseSelector(e);let i=this.getTag(t);return i?this._setMetaElementAttributes(e,i):this._getOrCreateElement(e,!0)}removeTag(e){this.removeTagElement(this.getTag(e))}removeTagElement(e){e&&this._dom.remove(e)}_getOrCreateElement(e,t=!1){if(this._validateMetaDefinition(e),!t){let r=this._parseSelector(e),s=this.getTags(r).filter(l=>this._containsAttributes(e,l))[0];if(s!==void 0)return s}let i=this._dom.createElement("meta");return this._setMetaElementAttributes(e,i),this._doc.getElementsByTagName("head")[0].appendChild(i),i}_setMetaElementAttributes(e,t){return Object.keys(e).forEach(i=>t.setAttribute(this._getMetaKeyMap(i),e[i])),t}_parseSelector(e){let t=e.name?"name":"property";return`${t}=${this._escapeSelectorValue(String(e[t]))}`}_escapeSelectorValue(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}_validateMetaDefinition(e){for(let t of Object.keys(e))if(this._getMetaKeyMap(t).toLowerCase().startsWith("on"))throw new gi(5203,!1)}_containsAttributes(e,t){return Object.keys(e).every(i=>t.getAttribute(this._getMetaKeyMap(i))===e[i])}_getMetaKeyMap(e){return Object.hasOwn(cD,e)?cD[e]:e}static \u0275fac=a(function(t){return new(t||n)(Ut(Qt))},"Meta_Factory");static \u0275prov=Me({token:n,factory:n.\u0275fac,providedIn:"root"})},cD={httpEquiv:"http-equiv"},dD=class n{static{a(this,"Title")}_doc;constructor(e){this._doc=e}getTitle(){return this._doc.title}setTitle(e){this._doc.title=e||""}static \u0275fac=a(function(t){return new(t||n)(Ut(Qt))},"Title_Factory");static \u0275prov=Me({token:n,factory:n.\u0275fac,providedIn:"root"})};var S9={pan:!0,panstart:!0,panmove:!0,panend:!0,pancancel:!0,panleft:!0,panright:!0,panup:!0,pandown:!0,pinch:!0,pinchstart:!0,pinchmove:!0,pinchend:!0,pinchcancel:!0,pinchin:!0,pinchout:!0,press:!0,pressup:!0,rotate:!0,rotatestart:!0,rotatemove:!0,rotateend:!0,rotatecancel:!0,swipe:!0,swipeleft:!0,swiperight:!0,swipeup:!0,swipedown:!0,tap:!0,doubletap:!0},V1=new Vt(""),mD=new Vt(""),L1=class n{static{a(this,"HammerGestureConfig")}events=[];overrides={};options;buildHammer(e){let t=new Hammer(e,this.options);t.get("pinch").set({enable:!0}),t.get("rotate").set({enable:!0});for(let i in this.overrides)t.get(i).set(this.overrides[i]);return t}static \u0275fac=a(function(t){return new(t||n)},"HammerGestureConfig_Factory");static \u0275prov=Me({token:n,factory:n.\u0275fac})},B1=class n extends xl{static{a(this,"HammerGesturesPlugin")}_config;_injector;loader;_loaderPromise=null;constructor(e,t,i,o){super(e),this._config=t,this._injector=i,this.loader=o}supports(e){return!(!S9.hasOwnProperty(e.toLowerCase())&&!this.isCustomEvent(e)||!window.Hammer&&!this.loader)}addEventListener(e,t,i){let o=this.manager.getZone();if(t=t.toLowerCase(),!window.Hammer&&this.loader){this._loaderPromise=this._loaderPromise||o.runOutsideAngular(()=>this.loader());let r=!1,s=a(()=>{r=!0},"deregister");return o.runOutsideAngular(()=>this._loaderPromise.then(()=>{if(!window.Hammer){s=a(()=>{},"deregister");return}r||(s=this.addEventListener(e,t,i))}).catch(()=>{s=a(()=>{},"deregister")})),()=>{s()}}return o.runOutsideAngular(()=>{let r=this._config.buildHammer(e),s=a(function(l){o.runGuarded(function(){i(l)})},"callback");return r.on(t,s),()=>{r.off(t,s),typeof r.destroy=="function"&&r.destroy()}})}isCustomEvent(e){return this._config.events.indexOf(e)>-1}static \u0275fac=a(function(t){return new(t||n)(Ut(Qt),Ut(V1),Ut(ln),Ut(mD,8))},"HammerGesturesPlugin_Factory");static \u0275prov=Me({token:n,factory:n.\u0275fac})},uD=class n{static{a(this,"HammerModule")}static \u0275fac=a(function(t){return new(t||n)},"HammerModule_Factory");static \u0275mod=ut({type:n});static \u0275inj=dt({providers:[{provide:Vc,useClass:B1,multi:!0,deps:[Qt,V1,ln,[new GR,mD]]},{provide:V1,useClass:L1}]})},Tn=class n{static{a(this,"DomSanitizer")}static \u0275fac=a(function(t){return new(t||n)},"DomSanitizer_Factory");static \u0275prov=Me({token:n,factory:a(function(t){let i=null;return t?i=new(t||n):i=Ut(z1),i},"DomSanitizer_Factory"),providedIn:"root"})},z1=class n extends Tn{static{a(this,"DomSanitizerImpl")}_doc;constructor(e){super(),this._doc=e}sanitize(e,t){if(t==null)return null;switch(e){case ho.NONE:return t;case ho.HTML:return jc(t,"HTML")?Sc(t):QR(this._doc,String(t)).toString();case ho.STYLE:return jc(t,"Style")?Sc(t):t;case ho.SCRIPT:if(jc(t,"Script"))return Sc(t);throw new gi(5200,!1);case ho.URL:return jc(t,"URL")?Sc(t):ZR(String(t));case ho.RESOURCE_URL:if(jc(t,"ResourceURL"))return Sc(t);throw new gi(5201,!1);default:throw new gi(5202,!1)}}bypassSecurityTrustHtml(e){return UR(e)}bypassSecurityTrustStyle(e){return qR(e)}bypassSecurityTrustScript(e){return JR(e)}bypassSecurityTrustUrl(e){return XR(e)}bypassSecurityTrustResourceUrl(e){return YR(e)}static \u0275fac=a(function(t){return new(t||n)(Ut(Qt))},"DomSanitizerImpl_Factory");static \u0275prov=Me({token:n,factory:n.\u0275fac,providedIn:"root"})},pD;(function(n){n[n.NoHttpTransferCache=0]="NoHttpTransferCache",n[n.HttpTransferCacheOptions=1]="HttpTransferCacheOptions",n[n.I18nSupport=2]="I18nSupport",n[n.EventReplay=3]="EventReplay",n[n.IncrementalHydration=4]="IncrementalHydration"})(pD||(pD={}));var es={BASE_CODE:"BaseFormComponent_Event",EDITING_COMPLETE:"EDITING_COMPLETE",REVERT_PENDING_CHANGES:"REVERT_PENDING_CHANGES",POPULATE_PENDING_RECORDS:"POPULATE_PENDING_RECORDS"},H1=class{static{a(this,"BaseFormComponentEvent")}subEventCode;elementRef;returnValue},wg=class extends H1{static{a(this,"FormEditingCompleteEvent")}subEventCode=es.EDITING_COMPLETE;pendingChanges=[]};var ts=null,_g=class{static{a(this,"RecordNavigationAdapter")}static Register(e){ts=e}static get IsRegistered(){return ts!==null}static OpenEntityRecord(e,t){if(!ts){he(`RecordNavigationAdapter: no host registered, so "${e}" could not be opened. The host application must call RecordNavigationAdapter.Register(...) at bootstrap.`);return}try{ts.OpenEntityRecord(e,t)}catch(i){he(`RecordNavigationAdapter.OpenEntityRecord failed: ${i instanceof Error?i.message:String(i)}`)}}static OpenNewEntityRecord(e,t){if(!ts||!ts.OpenNewEntityRecord){he(`RecordNavigationAdapter: no host registered (or host lacks OpenNewEntityRecord), so new record for "${e}" could not be opened.`);return}try{ts.OpenNewEntityRecord(e,t)}catch(i){he(`RecordNavigationAdapter.OpenNewEntityRecord failed: ${i instanceof Error?i.message:String(i)}`)}}static Reset(){ts=null}};function j9(n,e){if(n&1&&(Qi(),u(0,"defs")(1,"linearGradient"),_(2,"stop",5)(3,"stop",6),m()()),n&2){let t=p();d(),W("id",t.gradientId)("x1",t.gradientCoords.x1)("y1",t.gradientCoords.y1)("x2",t.gradientCoords.x2)("y2",t.gradientCoords.y2),d(),W("stop-color",t.logoGradient.startColor),d(),W("stop-color",t.logoGradient.endColor)}}a(j9,"LoadingComponent_Conditional_3_Template");function k9(n,e){if(n&1&&(u(0,"p",7),g(1),m()),n&2){let t=p();q_(t.textStyle),d(),T(t.text)}}a(k9,"LoadingComponent_Conditional_6_Template");var Ft=class n{static{a(this,"LoadingComponent")}Text="Loading...";set text(e){this.Text=e}get text(){return this.Text}ShowText=!0;set showText(e){this.ShowText=e}get showText(){return this.ShowText}AnimationDuration=1.5;set animationDuration(e){this.AnimationDuration=e}get animationDuration(){return this.AnimationDuration}Size="auto";set size(e){this.Size=e}get size(){return this.Size}TextColor="";set textColor(e){this.TextColor=e}get textColor(){return this.TextColor}LogoColor="";set logoColor(e){this.LogoColor=e}get logoColor(){return this.LogoColor}LogoGradient=null;set logoGradient(e){this.LogoGradient=e}get logoGradient(){return this.LogoGradient}Animation="pulse";set animation(e){this.Animation=e}get animation(){return this.Animation}gradientId=`mj-logo-gradient-${Math.random().toString(36).substring(2,11)}`;get logoClass(){return`mj-loading-logo size-${this.Size} animation-${this.Animation}`}get logoStyle(){return`animation-duration: ${this.AnimationDuration}s`}get textStyle(){return this.TextColor?`color: ${this.TextColor}`:""}get logoFill(){return this.LogoGradient?`url(#${this.gradientId})`:this.LogoColor||null}get gradientCoords(){let t=(this.LogoGradient?.angle??45)*Math.PI/180,i=Math.round(50-Math.cos(t)*50),o=Math.round(50+Math.sin(t)*50),r=Math.round(50+Math.cos(t)*50),s=Math.round(50-Math.sin(t)*50);return{x1:`${i}%`,y1:`${o}%`,x2:`${r}%`,y2:`${s}%`}}static \u0275fac=a(function(t){return new(t||n)},"LoadingComponent_Factory");static \u0275cmp=G({type:n,selectors:[["mj-loading"]],inputs:{Text:"Text",text:"text",ShowText:"ShowText",showText:"showText",AnimationDuration:"AnimationDuration",animationDuration:"animationDuration",Size:"Size",size:"size",TextColor:"TextColor",textColor:"textColor",LogoColor:"LogoColor",logoColor:"logoColor",LogoGradient:"LogoGradient",logoGradient:"logoGradient",Animation:"Animation",animation:"animation"},standalone:!1,decls:7,vars:10,consts:[[1,"mj-loading-container"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 230 128",1,"mj-logo-svg"],["d","M0 0 C1.197 0.668 2.394 1.336 3.592 2.004 C12.234 6.837 20.792 11.805 29.327 16.824 C37.26 21.476 45.269 25.98 53.312 30.438 C53.91 30.769 54.507 31.1 55.122 31.441 C61.234 34.87 61.234 34.87 67.438 38.125 C69.709 37.16 69.709 37.16 72.258 35.652 C73.255 35.09 74.253 34.527 75.281 33.948 C76.364 33.325 77.447 32.703 78.562 32.062 C79.685 31.426 80.808 30.789 81.965 30.133 C90.435 25.322 98.84 20.401 107.239 15.469 C118.242 9.027 129.394 2.857 140.566 -3.286 C142.41 -4.306 144.248 -5.338 146.079 -6.382 C146.869 -6.832 147.659 -7.282 148.473 -7.746 C149.148 -8.136 149.824 -8.526 150.52 -8.927 C156.448 -11.856 163.036 -11.676 169.188 -9.625 C175.638 -6.152 178.915 -2.712 181.438 4.125 C181.951 7.259 181.946 10.308 181.892 13.479 C181.892 14.377 181.893 15.276 181.893 16.201 C181.891 19.145 181.86 22.088 181.828 25.031 C181.821 27.082 181.815 29.134 181.811 31.185 C181.796 36.564 181.757 41.943 181.712 47.322 C181.671 52.819 181.653 58.316 181.633 63.812 C181.59 74.584 181.522 85.354 181.438 96.125 C178.573 94.739 175.729 93.326 172.901 91.867 C170.644 90.732 168.349 89.671 166.018 88.7 C162.628 87.127 160.12 85.736 157.438 83.125 C155.741 78.082 155.893 73.244 156.047 68.004 C156.047 66.534 156.041 65.064 156.031 63.595 C156.018 59.745 156.076 55.899 156.15 52.049 C156.213 48.114 156.207 44.18 156.207 40.244 C156.217 32.536 156.303 24.832 156.438 17.125 C152.485 19.335 148.534 21.546 144.582 23.758 C143.476 24.376 142.37 24.995 141.231 25.632 C131.895 30.857 122.601 36.151 113.321 41.472 C107.737 44.673 102.15 47.868 96.562 51.062 C95.965 51.404 95.367 51.746 94.751 52.098 C86.826 56.629 78.889 61.14 70.938 65.625 C62.527 70.37 54.133 75.144 45.75 79.938 C45.166 80.271 44.581 80.605 43.979 80.95 C37.987 84.375 31.996 87.803 26.011 91.241 C14.366 97.93 2.707 104.594 -9.062 111.062 C-9.97 111.565 -10.878 112.067 -11.814 112.585 C-12.649 113.04 -13.484 113.496 -14.344 113.965 C-15.066 114.36 -15.789 114.756 -16.533 115.164 C-22.269 117.881 -28.602 117.949 -34.625 116.125 C-39.398 114.15 -42.881 110.491 -45.562 106.125 C-45.562 104.805 -45.562 103.485 -45.562 102.125 C-45.022 101.835 -44.481 101.545 -43.924 101.246 C-32.122 94.897 -20.456 88.363 -8.907 81.566 C-0.017 76.35 8.975 71.333 18.003 66.362 C24.427 62.82 30.777 59.186 37.065 55.408 C39.438 54.125 39.438 54.125 41.438 54.125 C41.438 53.465 41.438 52.805 41.438 52.125 C40.704 51.843 39.971 51.561 39.216 51.271 C36.702 50.234 34.368 49.093 31.98 47.797 C30.7 47.102 30.7 47.102 29.395 46.394 C28.481 45.892 27.567 45.391 26.625 44.875 C25.666 44.351 24.707 43.826 23.719 43.286 C14.477 38.202 5.37 32.897 -3.719 27.547 C-8.103 24.968 -12.509 22.431 -16.928 19.911 C-17.89 19.362 -17.89 19.362 -18.871 18.802 C-20.435 17.909 -21.999 17.017 -23.562 16.125 C-23.525 16.942 -23.487 17.759 -23.448 18.601 C-23.106 26.338 -22.848 34.071 -22.682 41.814 C-22.593 45.794 -22.474 49.768 -22.28 53.745 C-21.06 79.461 -21.06 79.461 -25.205 85.53 C-29.148 89.11 -33.517 90.996 -38.581 92.49 C-41.159 93.316 -43.282 94.688 -45.562 96.125 C-46.222 96.125 -46.882 96.125 -47.562 96.125 C-47.655 84.546 -47.726 72.967 -47.77 61.388 C-47.791 56.01 -47.819 50.633 -47.864 45.256 C-47.908 40.062 -47.932 34.869 -47.942 29.675 C-47.949 27.698 -47.964 25.721 -47.985 23.744 C-48.015 20.965 -48.018 18.187 -48.017 15.408 C-48.031 14.599 -48.045 13.79 -48.06 12.956 C-48.013 6.348 -46.391 0.196 -41.823 -4.764 C-27.895 -17.466 -13.817 -7.747 0 0 Z","transform","translate(47.5625,10.875)"],["d","M0 0 C2.051 0.961 2.051 0.961 4.098 2.16 C5.278 2.843 5.278 2.843 6.481 3.541 C7.333 4.043 8.185 4.545 9.062 5.062 C10.954 6.16 12.846 7.258 14.738 8.355 C16.255 9.24 16.255 9.24 17.803 10.142 C22.848 13.074 27.913 15.969 32.979 18.863 C34.753 19.877 36.525 20.892 38.297 21.907 C44.243 25.311 50.205 28.681 56.203 31.992 C57.347 32.625 58.491 33.258 59.669 33.911 C61.837 35.108 64.008 36.299 66.183 37.484 C67.154 38.02 68.125 38.557 69.125 39.109 C69.973 39.573 70.821 40.037 71.695 40.515 C74.149 42.096 76.015 43.87 78 46 C74.984 51.808 72.395 55.457 66.25 58.25 C54.159 61.04 44.857 55.778 34.625 49.75 C32.781 48.681 30.938 47.612 29.094 46.543 C28.114 45.972 27.134 45.402 26.125 44.814 C21.068 41.878 15.989 38.98 10.91 36.082 C9.13 35.065 7.35 34.048 5.57 33.03 C-5.598 26.648 -16.794 20.315 -28 14 C-28 13.34 -28 12.68 -28 12 C-24.284 9.789 -20.551 7.61 -16.812 5.438 C-15.757 4.809 -14.702 4.181 -13.615 3.533 C-12.083 2.649 -12.083 2.649 -10.52 1.746 C-9.582 1.196 -8.645 0.646 -7.679 0.08 C-4.518 -1.194 -3.196 -1.069 0 0 Z","transform","translate(150,69)"],[1,"mj-loading-text",3,"style"],["offset","0%"],["offset","100%"],[1,"mj-loading-text"]],template:a(function(t,i){t&1&&(u(0,"div",0)(1,"div"),Qi(),u(2,"svg",1),b(3,j9,4,7,":svg:defs"),_(4,"path",2)(5,"path",3),m()(),b(6,k9,2,3,"p",4),m()),t&2&&(d(),q_(i.logoStyle),ee(i.logoClass),d(2),x(i.logoGradient?3:-1),d(),Ee("fill",i.logoFill),d(),Ee("fill",i.logoFill),d(),x(i.showText&&i.text?6:-1))},"LoadingComponent_Template"),styles:[`[_nghost-%COMP%] {
4
4
  display: flex;
@@ -25402,7 +25402,7 @@ ${t.metadata.sql}`).join(`
25402
25402
  gap: 8px;
25403
25403
  align-items: flex-start;
25404
25404
  }
25405
- }`]})};function R5e(n,e,t){let i=[],o=[],r=n.dataRequirements;if(!r)return{canRun:!0,missingEntities:[],missingQueries:[]};let s=t??_t.Provider;for(let c of r.entities??[]){let h=s.EntityByName(c.name);if(!h)continue;h.GetUserPermisions(e)?.CanRead||i.push(c.name)}let l=Rr.Instance;for(let c of r.queries??[]){if(!c.name)continue;let h=l.FindQueryByName(c.name);if(!h)continue;h.UserCanRun(e).canRun||o.push(c.name)}return{canRun:i.length===0&&o.length===0,missingEntities:i,missingQueries:o}}a(R5e,"evaluateComponentPermissionsSingle");function TE(n,e,t){let i=R5e(n,e,t);for(let o of n.dependencies??[]){let r=TE(o,e,t);i.missingEntities.push(...r.missingEntities),i.missingQueries.push(...r.missingQueries)}return i.missingEntities=[...new Set(i.missingEntities)],i.missingQueries=[...new Set(i.missingQueries)],i.canRun=i.missingEntities.length===0&&i.missingQueries.length===0,i}a(TE,"EvaluateComponentPermissions");var I5e=a(()=>[1,2,3,4,5],"_c0"),P5e=a((n,e)=>e.spec.name,"_forTrack0");function T5e(n,e){if(n&1){let t=I();u(0,"i",24),j("click",a(function(o){y(t);let r=p().$implicit,s=p(2);return w(s.ToggleNode(r.spec,o))},"ComponentFeedbackPanelComponent_Conditional_15_For_2_Conditional_1_Template_i_click_0_listener")),m()}if(n&2){let t=p().$implicit,i=p(2);A("fa-chevron-right",!i.IsNodeExpanded(t.spec))("fa-chevron-down",i.IsNodeExpanded(t.spec))}}a(T5e,"ComponentFeedbackPanelComponent_Conditional_15_For_2_Conditional_1_Template");function D5e(n,e){n&1&&_(0,"span",19)}a(D5e,"ComponentFeedbackPanelComponent_Conditional_15_For_2_Conditional_2_Template");function F5e(n,e){n&1&&(u(0,"span",23),g(1,"Registry"),m())}a(F5e,"ComponentFeedbackPanelComponent_Conditional_15_For_2_Conditional_7_Template");function O5e(n,e){if(n&1){let t=I();u(0,"div",17),j("click",a(function(){let o=y(t).$implicit,r=p(2);return w(r.SelectComponent(o.spec))},"ComponentFeedbackPanelComponent_Conditional_15_For_2_Template_div_click_0_listener"))("mouseenter",a(function(){let o=y(t).$implicit,r=p(2);return w(r.HoverTreeItem(o.spec))},"ComponentFeedbackPanelComponent_Conditional_15_For_2_Template_div_mouseenter_0_listener"))("mouseleave",a(function(){y(t);let o=p(2);return w(o.ClearTreeItemHover())},"ComponentFeedbackPanelComponent_Conditional_15_For_2_Template_div_mouseleave_0_listener")),b(1,T5e,1,4,"i",18)(2,D5e,1,0,"span",19),_(3,"i",20),u(4,"div",21)(5,"span",22),g(6),m(),b(7,F5e,2,0,"span",23),m()()}if(n&2){let t=e.$implicit,i=p(2);Ee("padding-left",i.GetIndentation(t.depth)),A("selected",i.IsSelected(t.spec)),d(),x(t.hasChildren?1:2),d(5),T(t.spec.title||t.spec.name),d(),x(t.spec.location==="registry"?7:-1)}}a(O5e,"ComponentFeedbackPanelComponent_Conditional_15_For_2_Template");function A5e(n,e){if(n&1&&(u(0,"div",11),B(1,O5e,8,7,"div",16,P5e),m()),n&2){let t=p();d(),z(t.GetTreeItems())}}a(A5e,"ComponentFeedbackPanelComponent_Conditional_15_Template");function N5e(n,e){n&1&&_(0,"mj-empty-state",12)}a(N5e,"ComponentFeedbackPanelComponent_Conditional_16_Template");function V5e(n,e){if(n&1&&_(0,"mj-markdown",26),n&2){let t=p(2);M("data",t.SelectedSpec.description)}}a(V5e,"ComponentFeedbackPanelComponent_Conditional_18_Conditional_5_Template");function L5e(n,e){n&1&&_(0,"i",43)}a(L5e,"ComponentFeedbackPanelComponent_Conditional_18_For_11_Case_3_Template");function B5e(n,e){n&1&&_(0,"i",44)}a(B5e,"ComponentFeedbackPanelComponent_Conditional_18_For_11_Case_4_Template");function z5e(n,e){n&1&&_(0,"i",45)}a(z5e,"ComponentFeedbackPanelComponent_Conditional_18_For_11_Case_5_Template");function H5e(n,e){if(n&1){let t=I();u(0,"span",30)(1,"span",41),j("click",a(function(){let o=y(t).$implicit,r=p(2);return w(r.SetRating(o-.5))},"ComponentFeedbackPanelComponent_Conditional_18_For_11_Template_span_click_1_listener"))("mouseenter",a(function(){let o=y(t).$implicit,r=p(2);return w(r.SetHoverRating(o-.5))},"ComponentFeedbackPanelComponent_Conditional_18_For_11_Template_span_mouseenter_1_listener")),m(),u(2,"span",42),j("click",a(function(){let o=y(t).$implicit,r=p(2);return w(r.SetRating(o))},"ComponentFeedbackPanelComponent_Conditional_18_For_11_Template_span_click_2_listener"))("mouseenter",a(function(){let o=y(t).$implicit,r=p(2);return w(r.SetHoverRating(o))},"ComponentFeedbackPanelComponent_Conditional_18_For_11_Template_span_mouseenter_2_listener")),m(),b(3,L5e,1,0,"i",43)(4,B5e,1,0,"i",44)(5,z5e,1,0,"i",45),m()}if(n&2){let t,i=e.$implicit,o=p(2);d(3),x((t=o.GetStarState(i))==="full"?3:t==="half"?4:5)}}a(H5e,"ComponentFeedbackPanelComponent_Conditional_18_For_11_Template");function G5e(n,e){n&1&&(u(0,"span",31),g(1,"Click to rate"),m())}a(G5e,"ComponentFeedbackPanelComponent_Conditional_18_Conditional_12_Template");function W5e(n,e){if(n&1&&(u(0,"span",36),g(1),m()),n&2){let t=p(2);d(),N("",t.FeedbackComments.length,"/1000")}}a(W5e,"ComponentFeedbackPanelComponent_Conditional_18_Conditional_20_Template");function K5e(n,e){n&1&&(_(0,"i",46),u(1,"span"),g(2,"Submitting..."),m())}a(K5e,"ComponentFeedbackPanelComponent_Conditional_18_Conditional_23_Template");function U5e(n,e){n&1&&(_(0,"i",47),u(1,"span"),g(2,"Submit Feedback"),m())}a(U5e,"ComponentFeedbackPanelComponent_Conditional_18_Conditional_24_Template");function q5e(n,e){n&1&&(u(0,"mj-alert",39),g(1,"Feedback submitted successfully!"),m())}a(q5e,"ComponentFeedbackPanelComponent_Conditional_18_Conditional_25_Template");function J5e(n,e){if(n&1&&(u(0,"mj-alert",40),g(1),m()),n&2){let t=p(2);d(),T(t.SubmitError)}}a(J5e,"ComponentFeedbackPanelComponent_Conditional_18_Conditional_26_Template");function X5e(n,e){if(n&1){let t=I();u(0,"div",14)(1,"div",9),_(2,"i",25),u(3,"span"),g(4),m()(),b(5,V5e,1,1,"mj-markdown",26),u(6,"div",27)(7,"label",28),g(8,"Your Rating"),m(),u(9,"div",29),j("mouseleave",a(function(){y(t);let o=p();return w(o.ClearHoverRating())},"ComponentFeedbackPanelComponent_Conditional_18_Template_div_mouseleave_9_listener")),B(10,H5e,6,1,"span",30,pt),m(),b(12,G5e,2,0,"span",31),m(),u(13,"div",32)(14,"label",33),g(15," Comments "),u(16,"span",34),g(17,"(optional)"),m()(),u(18,"textarea",35),st("ngModelChange",a(function(o){y(t);let r=p();return at(r.FeedbackComments,o)||(r.FeedbackComments=o),w(o)},"ComponentFeedbackPanelComponent_Conditional_18_Template_textarea_ngModelChange_18_listener")),g(19," "),m(),b(20,W5e,2,1,"span",36),m(),u(21,"div",37)(22,"button",38),j("click",a(function(){y(t);let o=p();return w(o.SubmitFeedback())},"ComponentFeedbackPanelComponent_Conditional_18_Template_button_click_22_listener")),b(23,K5e,3,0)(24,U5e,3,0),m()(),b(25,q5e,2,0,"mj-alert",39),b(26,J5e,2,1,"mj-alert",40),m()}if(n&2){let t=p();d(4),N("Rate: ",t.SelectedSpec.title||t.SelectedSpec.name),d(),x(t.SelectedSpec.description?5:-1),d(5),z(Sr(9,I5e)),d(2),x(t.StarRating===0?12:-1),d(6),rt("ngModel",t.FeedbackComments),d(2),x(t.FeedbackComments.length>0?20:-1),d(2),M("disabled",!t.CanSubmit()),d(),x(t.IsSubmitting?23:24),d(2),x(t.SubmitSuccess?25:-1),d(),x(t.SubmitError?26:-1)}}a(X5e,"ComponentFeedbackPanelComponent_Conditional_18_Template");function Y5e(n,e){n&1&&_(0,"mj-empty-state",15)}a(Y5e,"ComponentFeedbackPanelComponent_Conditional_19_Template");var Zu=class n extends Ze{static{a(this,"ComponentFeedbackPanelComponent")}ComponentSpec=null;ReactContainerElement=null;ConversationId=null;ConversationDetailId=null;Closed=new R;SelectedSpec=null;StarRating=0;HoverRating=0;FeedbackComments="";IsSubmitting=!1;SubmitSuccess=!1;SubmitError="";ExpandedNodes=new Set;highlightOverlay=null;hoverOverlay=null;resizeObserver=null;containerClickHandler=null;cdr=V(le);GetTreeItems(){return this.ComponentSpec?(this.ExpandedNodes.has(this.ComponentSpec.name)||this.ExpandedNodes.add(this.ComponentSpec.name),this.buildTree(this.ComponentSpec,0)):[]}buildTree(e,t){let i=[{spec:e,depth:t,hasChildren:!!(e.dependencies&&e.dependencies.length>0)}];if(this.ExpandedNodes.has(e.name)&&e.dependencies)for(let o of e.dependencies)i.push(...this.buildTree(o,t+1));return i}ToggleNode(e,t){t.stopPropagation(),this.ExpandedNodes.has(e.name)?this.ExpandedNodes.delete(e.name):this.ExpandedNodes.add(e.name)}IsNodeExpanded(e){return this.ExpandedNodes.has(e.name)}SelectComponent(e){this.SelectedSpec=e,this.ResetForm(),this.highlightComponent(e.name)}IsSelected(e){return this.SelectedSpec?.name===e.name}GetIndentation(e){return`${e*20}px`}SetRating(e){this.StarRating=e}SetHoverRating(e){this.HoverRating=e}ClearHoverRating(){this.HoverRating=0}GetDisplayRating(){return this.HoverRating||this.StarRating}GetStarState(e){let t=this.GetDisplayRating();return e<=t?"full":e-.5<=t?"half":"empty"}IsStarFilled(e){return e<=this.GetDisplayRating()}ResetForm(){this.StarRating=0,this.HoverRating=0,this.FeedbackComments="",this.SubmitSuccess=!1,this.SubmitError=""}CanSubmit(){return!!this.SelectedSpec&&this.StarRating>0&&!this.IsSubmitting}async SubmitFeedback(){if(!(!this.CanSubmit()||!this.SelectedSpec)){this.IsSubmitting=!0,this.SubmitError="",this.SubmitSuccess=!1,this.cdr.detectChanges();try{let{GraphQLComponentRegistryClient:e}=await import("./chunks/dist-4BLL2YRV.js"),t=this.ProviderToUse,o=await new e(t).SendComponentFeedback({componentName:this.SelectedSpec.name,componentNamespace:this.SelectedSpec.namespace||this.SelectedSpec.registry||"",componentVersion:this.SelectedSpec.version,registryName:this.SelectedSpec.registry,rating:this.StarRating*20,comments:this.FeedbackComments.trim()||void 0,conversationID:this.ConversationId||void 0,conversationDetailID:this.ConversationDetailId||void 0});o.success?(this.SubmitSuccess=!0,setTimeout(()=>{this.ResetForm(),this.cdr.detectChanges()},2e3)):this.SubmitError=o.error||"Failed to submit feedback."}catch(e){this.SubmitError="Failed to submit feedback. Please try again.",console.error("Error submitting component feedback:",e)}finally{this.IsSubmitting=!1,this.cdr.detectChanges()}}}HoverTreeItem(e){!this.ReactContainerElement||this.IsSelected(e)||this.showHoverOverlay(e.name)}ClearTreeItemHover(){this.removeHoverOverlay()}showHoverOverlay(e){if(!this.ReactContainerElement)return;let t=this.ReactContainerElement.querySelector(`[data-mj-component="${e}"]`);if(!t){this.removeHoverOverlay();return}this.ensureContainerPositioned(),this.hoverOverlay||(this.hoverOverlay=document.createElement("div"),this.ReactContainerElement.appendChild(this.hoverOverlay)),this.positionOverlay(this.hoverOverlay,t),this.hoverOverlay.style.border="2px dashed var(--mj-brand-primary, #3B82F6)",this.hoverOverlay.style.background="color-mix(in srgb, var(--mj-brand-primary, #3B82F6) 5%, transparent)"}removeHoverOverlay(){this.hoverOverlay?.parentNode&&this.hoverOverlay.parentNode.removeChild(this.hoverOverlay),this.hoverOverlay=null}highlightComponent(e){if(!this.ReactContainerElement){this.clearHighlight();return}let t=this.ReactContainerElement.querySelector(`[data-mj-component="${e}"]`);if(!t){this.clearHighlight();return}this.ensureContainerPositioned(),this.highlightOverlay||(this.highlightOverlay=document.createElement("div"),this.ReactContainerElement.appendChild(this.highlightOverlay)),this.positionOverlay(this.highlightOverlay,t),this.highlightOverlay.style.border="2px solid var(--mj-brand-primary, #3B82F6)",this.highlightOverlay.style.background="color-mix(in srgb, var(--mj-brand-primary, #3B82F6) 10%, transparent)",this.resizeObserver?.disconnect(),this.resizeObserver=new ResizeObserver(()=>{this.highlightOverlay&&this.positionOverlay(this.highlightOverlay,t)}),this.resizeObserver.observe(t),this.resizeObserver.observe(this.ReactContainerElement),this.installContainerClickListener()}ensureContainerPositioned(){if(!this.ReactContainerElement)return;getComputedStyle(this.ReactContainerElement).position==="static"&&(this.ReactContainerElement.style.position="relative")}getEffectiveRect(e){let t=e.getBoundingClientRect();if(t.width>0&&t.height>0)return t;let i=e.children;if(i.length===0)return t;let o=1/0,r=1/0,s=-1/0,l=-1/0;for(let c=0;c<i.length;c++){let h=i[c].getBoundingClientRect();h.width===0&&h.height===0||(o=Math.min(o,h.top),r=Math.min(r,h.left),s=Math.max(s,h.bottom),l=Math.max(l,h.right))}return o===1/0?t:new DOMRect(r,o,l-r,s-o)}positionOverlay(e,t){if(!this.ReactContainerElement)return;let i=this.getEffectiveRect(t),o=this.ReactContainerElement.getBoundingClientRect();e.style.position="absolute",e.style.top=`${i.top-o.top+this.ReactContainerElement.scrollTop}px`,e.style.left=`${i.left-o.left+this.ReactContainerElement.scrollLeft}px`,e.style.width=`${i.width}px`,e.style.height=`${i.height}px`,e.style.pointerEvents="none",e.style.zIndex="10",e.style.borderRadius="4px",e.style.transition="all 0.2s ease"}installContainerClickListener(){this.containerClickHandler||!this.ReactContainerElement||(this.containerClickHandler=e=>{let t=e.target;if(!t)return;let i=t.closest("[data-mj-component]");if(!i)return;let o=i.getAttribute("data-mj-component");if(!o)return;let r=this.findSpecByName(o);r&&r.name!==this.SelectedSpec?.name&&(this.SelectComponent(r),this.cdr.detectChanges())},this.ReactContainerElement.addEventListener("click",this.containerClickHandler,!0))}removeContainerClickListener(){this.containerClickHandler&&this.ReactContainerElement&&this.ReactContainerElement.removeEventListener("click",this.containerClickHandler,!0),this.containerClickHandler=null}findSpecByName(e){return this.ComponentSpec?this.walkSpecTree(this.ComponentSpec,e):null}walkSpecTree(e,t){if(e.name===t)return e;if(e.dependencies)for(let i of e.dependencies){let o=this.walkSpecTree(i,t);if(o)return o}return null}clearHighlight(){this.resizeObserver?.disconnect(),this.resizeObserver=null,this.highlightOverlay?.parentNode&&this.highlightOverlay.parentNode.removeChild(this.highlightOverlay),this.highlightOverlay=null,this.removeHoverOverlay(),this.removeContainerClickListener()}ClosePanel(){this.clearHighlight(),this.Closed.emit()}ngOnDestroy(){this.clearHighlight()}static \u0275fac=(()=>{let e;return a(function(i){return(e||(e=je(n)))(i||n)},"ComponentFeedbackPanelComponent_Factory")})();static \u0275cmp=G({type:n,selectors:[["mj-component-feedback-panel"]],inputs:{ComponentSpec:"ComponentSpec",ReactContainerElement:"ReactContainerElement",ConversationId:"ConversationId",ConversationDetailId:"ConversationDetailId"},outputs:{Closed:"Closed"},features:[re],decls:20,vars:2,consts:[[1,"feedback-panel-overlay",3,"click"],[1,"feedback-panel",3,"click"],[1,"panel-header"],[1,"panel-title"],[1,"fa-solid","fa-magnifying-glass"],[1,"close-button",3,"click"],[1,"fa-solid","fa-times"],[1,"panel-content"],[1,"tree-section"],[1,"section-header"],[1,"fa-solid","fa-sitemap"],[1,"component-tree"],["Icon","fa-solid fa-circle-info","Title","No component hierarchy available","Size","compact"],[1,"feedback-section"],[1,"selected-component-info"],["Icon","fa-solid fa-hand-pointer","Title","Select a component from the tree to provide feedback","Size","compact"],[1,"tree-item",3,"selected","padding-left"],[1,"tree-item",3,"click","mouseenter","mouseleave"],[1,"tree-toggle","fa-solid",3,"fa-chevron-right","fa-chevron-down"],[1,"tree-spacer"],[1,"fa-solid","fa-cube","component-icon"],[1,"component-info"],[1,"component-name"],[1,"component-badge","registry"],[1,"tree-toggle","fa-solid",3,"click"],[1,"fa-solid","fa-star"],[1,"component-description",3,"data"],[1,"star-rating-container"],[1,"rating-label"],[1,"star-rating",3,"mouseleave"],[1,"star-wrapper"],[1,"rating-text","placeholder"],[1,"comment-container"],[1,"comment-label"],[1,"optional-label"],["placeholder","Share your thoughts about this component...","rows","4","maxlength","1000",1,"comment-input",3,"ngModelChange","ngModel"],[1,"char-count"],[1,"submit-container"],[1,"submit-button",3,"click","disabled"],["Variant","success"],["Variant","error"],[1,"star-zone","star-zone-left",3,"click","mouseenter"],[1,"star-zone","star-zone-right",3,"click","mouseenter"],[1,"star","fa-solid","fa-star"],[1,"star","fa-solid","fa-star-half-stroke"],[1,"star","fa-regular","fa-star"],[1,"fa-solid","fa-spinner","fa-spin"],[1,"fa-solid","fa-paper-plane"]],template:a(function(t,i){t&1&&(u(0,"div",0),j("click",a(function(){return i.ClosePanel()},"ComponentFeedbackPanelComponent_Template_div_click_0_listener")),u(1,"div",1),j("click",a(function(r){return r.stopPropagation()},"ComponentFeedbackPanelComponent_Template_div_click_1_listener")),u(2,"div",2)(3,"div",3),_(4,"i",4),u(5,"span"),g(6,"Inspect & Rate"),m()(),u(7,"button",5),j("click",a(function(){return i.ClosePanel()},"ComponentFeedbackPanelComponent_Template_button_click_7_listener")),_(8,"i",6),m()(),u(9,"div",7)(10,"div",8)(11,"div",9),_(12,"i",10),u(13,"span"),g(14,"Select Component"),m()(),b(15,A5e,3,0,"div",11)(16,N5e,1,0,"mj-empty-state",12),m(),u(17,"div",13),b(18,X5e,27,10,"div",14)(19,Y5e,1,0,"mj-empty-state",15),m()()()()),t&2&&(d(15),x(i.ComponentSpec?15:16),d(3),x(i.SelectedSpec?18:19))},"ComponentFeedbackPanelComponent_Template"),dependencies:[Oe,Gt,un,Ot,im,Pt,oo,oi,mt,vn],styles:[`
25405
+ }`]})};function R5e(n,e,t){let i=[],o=[],r=n.dataRequirements;if(!r)return{canRun:!0,missingEntities:[],missingQueries:[]};let s=t??_t.Provider;for(let c of r.entities??[]){let h=s.EntityByName(c.name);if(!h)continue;h.GetUserPermisions(e)?.CanRead||i.push(c.name)}let l=Rr.Instance;for(let c of r.queries??[]){if(!c.name)continue;let h=l.FindQueryByName(c.name);if(!h)continue;h.UserCanRun(e).canRun||o.push(c.name)}return{canRun:i.length===0&&o.length===0,missingEntities:i,missingQueries:o}}a(R5e,"evaluateComponentPermissionsSingle");function TE(n,e,t){let i=R5e(n,e,t);for(let o of n.dependencies??[]){let r=TE(o,e,t);i.missingEntities.push(...r.missingEntities),i.missingQueries.push(...r.missingQueries)}return i.missingEntities=[...new Set(i.missingEntities)],i.missingQueries=[...new Set(i.missingQueries)],i.canRun=i.missingEntities.length===0&&i.missingQueries.length===0,i}a(TE,"EvaluateComponentPermissions");var I5e=a(()=>[1,2,3,4,5],"_c0"),P5e=a((n,e)=>e.spec.name,"_forTrack0");function T5e(n,e){if(n&1){let t=I();u(0,"i",24),j("click",a(function(o){y(t);let r=p().$implicit,s=p(2);return w(s.ToggleNode(r.spec,o))},"ComponentFeedbackPanelComponent_Conditional_15_For_2_Conditional_1_Template_i_click_0_listener")),m()}if(n&2){let t=p().$implicit,i=p(2);A("fa-chevron-right",!i.IsNodeExpanded(t.spec))("fa-chevron-down",i.IsNodeExpanded(t.spec))}}a(T5e,"ComponentFeedbackPanelComponent_Conditional_15_For_2_Conditional_1_Template");function D5e(n,e){n&1&&_(0,"span",19)}a(D5e,"ComponentFeedbackPanelComponent_Conditional_15_For_2_Conditional_2_Template");function F5e(n,e){n&1&&(u(0,"span",23),g(1,"Registry"),m())}a(F5e,"ComponentFeedbackPanelComponent_Conditional_15_For_2_Conditional_7_Template");function O5e(n,e){if(n&1){let t=I();u(0,"div",17),j("click",a(function(){let o=y(t).$implicit,r=p(2);return w(r.SelectComponent(o.spec))},"ComponentFeedbackPanelComponent_Conditional_15_For_2_Template_div_click_0_listener"))("mouseenter",a(function(){let o=y(t).$implicit,r=p(2);return w(r.HoverTreeItem(o.spec))},"ComponentFeedbackPanelComponent_Conditional_15_For_2_Template_div_mouseenter_0_listener"))("mouseleave",a(function(){y(t);let o=p(2);return w(o.ClearTreeItemHover())},"ComponentFeedbackPanelComponent_Conditional_15_For_2_Template_div_mouseleave_0_listener")),b(1,T5e,1,4,"i",18)(2,D5e,1,0,"span",19),_(3,"i",20),u(4,"div",21)(5,"span",22),g(6),m(),b(7,F5e,2,0,"span",23),m()()}if(n&2){let t=e.$implicit,i=p(2);Ee("padding-left",i.GetIndentation(t.depth)),A("selected",i.IsSelected(t.spec)),d(),x(t.hasChildren?1:2),d(5),T(t.spec.title||t.spec.name),d(),x(t.spec.location==="registry"?7:-1)}}a(O5e,"ComponentFeedbackPanelComponent_Conditional_15_For_2_Template");function A5e(n,e){if(n&1&&(u(0,"div",11),B(1,O5e,8,7,"div",16,P5e),m()),n&2){let t=p();d(),z(t.GetTreeItems())}}a(A5e,"ComponentFeedbackPanelComponent_Conditional_15_Template");function N5e(n,e){n&1&&_(0,"mj-empty-state",12)}a(N5e,"ComponentFeedbackPanelComponent_Conditional_16_Template");function V5e(n,e){if(n&1&&_(0,"mj-markdown",26),n&2){let t=p(2);M("data",t.SelectedSpec.description)}}a(V5e,"ComponentFeedbackPanelComponent_Conditional_18_Conditional_5_Template");function L5e(n,e){n&1&&_(0,"i",43)}a(L5e,"ComponentFeedbackPanelComponent_Conditional_18_For_11_Case_3_Template");function B5e(n,e){n&1&&_(0,"i",44)}a(B5e,"ComponentFeedbackPanelComponent_Conditional_18_For_11_Case_4_Template");function z5e(n,e){n&1&&_(0,"i",45)}a(z5e,"ComponentFeedbackPanelComponent_Conditional_18_For_11_Case_5_Template");function H5e(n,e){if(n&1){let t=I();u(0,"span",30)(1,"span",41),j("click",a(function(){let o=y(t).$implicit,r=p(2);return w(r.SetRating(o-.5))},"ComponentFeedbackPanelComponent_Conditional_18_For_11_Template_span_click_1_listener"))("mouseenter",a(function(){let o=y(t).$implicit,r=p(2);return w(r.SetHoverRating(o-.5))},"ComponentFeedbackPanelComponent_Conditional_18_For_11_Template_span_mouseenter_1_listener")),m(),u(2,"span",42),j("click",a(function(){let o=y(t).$implicit,r=p(2);return w(r.SetRating(o))},"ComponentFeedbackPanelComponent_Conditional_18_For_11_Template_span_click_2_listener"))("mouseenter",a(function(){let o=y(t).$implicit,r=p(2);return w(r.SetHoverRating(o))},"ComponentFeedbackPanelComponent_Conditional_18_For_11_Template_span_mouseenter_2_listener")),m(),b(3,L5e,1,0,"i",43)(4,B5e,1,0,"i",44)(5,z5e,1,0,"i",45),m()}if(n&2){let t,i=e.$implicit,o=p(2);d(3),x((t=o.GetStarState(i))==="full"?3:t==="half"?4:5)}}a(H5e,"ComponentFeedbackPanelComponent_Conditional_18_For_11_Template");function G5e(n,e){n&1&&(u(0,"span",31),g(1,"Click to rate"),m())}a(G5e,"ComponentFeedbackPanelComponent_Conditional_18_Conditional_12_Template");function W5e(n,e){if(n&1&&(u(0,"span",36),g(1),m()),n&2){let t=p(2);d(),N("",t.FeedbackComments.length,"/1000")}}a(W5e,"ComponentFeedbackPanelComponent_Conditional_18_Conditional_20_Template");function K5e(n,e){n&1&&(_(0,"i",46),u(1,"span"),g(2,"Submitting..."),m())}a(K5e,"ComponentFeedbackPanelComponent_Conditional_18_Conditional_23_Template");function U5e(n,e){n&1&&(_(0,"i",47),u(1,"span"),g(2,"Submit Feedback"),m())}a(U5e,"ComponentFeedbackPanelComponent_Conditional_18_Conditional_24_Template");function q5e(n,e){n&1&&(u(0,"mj-alert",39),g(1,"Feedback submitted successfully!"),m())}a(q5e,"ComponentFeedbackPanelComponent_Conditional_18_Conditional_25_Template");function J5e(n,e){if(n&1&&(u(0,"mj-alert",40),g(1),m()),n&2){let t=p(2);d(),T(t.SubmitError)}}a(J5e,"ComponentFeedbackPanelComponent_Conditional_18_Conditional_26_Template");function X5e(n,e){if(n&1){let t=I();u(0,"div",14)(1,"div",9),_(2,"i",25),u(3,"span"),g(4),m()(),b(5,V5e,1,1,"mj-markdown",26),u(6,"div",27)(7,"label",28),g(8,"Your Rating"),m(),u(9,"div",29),j("mouseleave",a(function(){y(t);let o=p();return w(o.ClearHoverRating())},"ComponentFeedbackPanelComponent_Conditional_18_Template_div_mouseleave_9_listener")),B(10,H5e,6,1,"span",30,pt),m(),b(12,G5e,2,0,"span",31),m(),u(13,"div",32)(14,"label",33),g(15," Comments "),u(16,"span",34),g(17,"(optional)"),m()(),u(18,"textarea",35),st("ngModelChange",a(function(o){y(t);let r=p();return at(r.FeedbackComments,o)||(r.FeedbackComments=o),w(o)},"ComponentFeedbackPanelComponent_Conditional_18_Template_textarea_ngModelChange_18_listener")),g(19," "),m(),b(20,W5e,2,1,"span",36),m(),u(21,"div",37)(22,"button",38),j("click",a(function(){y(t);let o=p();return w(o.SubmitFeedback())},"ComponentFeedbackPanelComponent_Conditional_18_Template_button_click_22_listener")),b(23,K5e,3,0)(24,U5e,3,0),m()(),b(25,q5e,2,0,"mj-alert",39),b(26,J5e,2,1,"mj-alert",40),m()}if(n&2){let t=p();d(4),N("Rate: ",t.SelectedSpec.title||t.SelectedSpec.name),d(),x(t.SelectedSpec.description?5:-1),d(5),z(Sr(9,I5e)),d(2),x(t.StarRating===0?12:-1),d(6),rt("ngModel",t.FeedbackComments),d(2),x(t.FeedbackComments.length>0?20:-1),d(2),M("disabled",!t.CanSubmit()),d(),x(t.IsSubmitting?23:24),d(2),x(t.SubmitSuccess?25:-1),d(),x(t.SubmitError?26:-1)}}a(X5e,"ComponentFeedbackPanelComponent_Conditional_18_Template");function Y5e(n,e){n&1&&_(0,"mj-empty-state",15)}a(Y5e,"ComponentFeedbackPanelComponent_Conditional_19_Template");var Zu=class n extends Ze{static{a(this,"ComponentFeedbackPanelComponent")}ComponentSpec=null;ReactContainerElement=null;ConversationId=null;ConversationDetailId=null;Closed=new R;SelectedSpec=null;StarRating=0;HoverRating=0;FeedbackComments="";IsSubmitting=!1;SubmitSuccess=!1;SubmitError="";ExpandedNodes=new Set;highlightOverlay=null;hoverOverlay=null;resizeObserver=null;containerClickHandler=null;cdr=V(le);GetTreeItems(){return this.ComponentSpec?(this.ExpandedNodes.has(this.ComponentSpec.name)||this.ExpandedNodes.add(this.ComponentSpec.name),this.buildTree(this.ComponentSpec,0)):[]}buildTree(e,t){let i=[{spec:e,depth:t,hasChildren:!!(e.dependencies&&e.dependencies.length>0)}];if(this.ExpandedNodes.has(e.name)&&e.dependencies)for(let o of e.dependencies)i.push(...this.buildTree(o,t+1));return i}ToggleNode(e,t){t.stopPropagation(),this.ExpandedNodes.has(e.name)?this.ExpandedNodes.delete(e.name):this.ExpandedNodes.add(e.name)}IsNodeExpanded(e){return this.ExpandedNodes.has(e.name)}SelectComponent(e){this.SelectedSpec=e,this.ResetForm(),this.highlightComponent(e.name)}IsSelected(e){return this.SelectedSpec?.name===e.name}GetIndentation(e){return`${e*20}px`}SetRating(e){this.StarRating=e}SetHoverRating(e){this.HoverRating=e}ClearHoverRating(){this.HoverRating=0}GetDisplayRating(){return this.HoverRating||this.StarRating}GetStarState(e){let t=this.GetDisplayRating();return e<=t?"full":e-.5<=t?"half":"empty"}IsStarFilled(e){return e<=this.GetDisplayRating()}ResetForm(){this.StarRating=0,this.HoverRating=0,this.FeedbackComments="",this.SubmitSuccess=!1,this.SubmitError=""}CanSubmit(){return!!this.SelectedSpec&&this.StarRating>0&&!this.IsSubmitting}async SubmitFeedback(){if(!(!this.CanSubmit()||!this.SelectedSpec)){this.IsSubmitting=!0,this.SubmitError="",this.SubmitSuccess=!1,this.cdr.detectChanges();try{let{GraphQLComponentRegistryClient:e}=await import("./chunks/dist-6QB6LKFP.js"),t=this.ProviderToUse,o=await new e(t).SendComponentFeedback({componentName:this.SelectedSpec.name,componentNamespace:this.SelectedSpec.namespace||this.SelectedSpec.registry||"",componentVersion:this.SelectedSpec.version,registryName:this.SelectedSpec.registry,rating:this.StarRating*20,comments:this.FeedbackComments.trim()||void 0,conversationID:this.ConversationId||void 0,conversationDetailID:this.ConversationDetailId||void 0});o.success?(this.SubmitSuccess=!0,setTimeout(()=>{this.ResetForm(),this.cdr.detectChanges()},2e3)):this.SubmitError=o.error||"Failed to submit feedback."}catch(e){this.SubmitError="Failed to submit feedback. Please try again.",console.error("Error submitting component feedback:",e)}finally{this.IsSubmitting=!1,this.cdr.detectChanges()}}}HoverTreeItem(e){!this.ReactContainerElement||this.IsSelected(e)||this.showHoverOverlay(e.name)}ClearTreeItemHover(){this.removeHoverOverlay()}showHoverOverlay(e){if(!this.ReactContainerElement)return;let t=this.ReactContainerElement.querySelector(`[data-mj-component="${e}"]`);if(!t){this.removeHoverOverlay();return}this.ensureContainerPositioned(),this.hoverOverlay||(this.hoverOverlay=document.createElement("div"),this.ReactContainerElement.appendChild(this.hoverOverlay)),this.positionOverlay(this.hoverOverlay,t),this.hoverOverlay.style.border="2px dashed var(--mj-brand-primary, #3B82F6)",this.hoverOverlay.style.background="color-mix(in srgb, var(--mj-brand-primary, #3B82F6) 5%, transparent)"}removeHoverOverlay(){this.hoverOverlay?.parentNode&&this.hoverOverlay.parentNode.removeChild(this.hoverOverlay),this.hoverOverlay=null}highlightComponent(e){if(!this.ReactContainerElement){this.clearHighlight();return}let t=this.ReactContainerElement.querySelector(`[data-mj-component="${e}"]`);if(!t){this.clearHighlight();return}this.ensureContainerPositioned(),this.highlightOverlay||(this.highlightOverlay=document.createElement("div"),this.ReactContainerElement.appendChild(this.highlightOverlay)),this.positionOverlay(this.highlightOverlay,t),this.highlightOverlay.style.border="2px solid var(--mj-brand-primary, #3B82F6)",this.highlightOverlay.style.background="color-mix(in srgb, var(--mj-brand-primary, #3B82F6) 10%, transparent)",this.resizeObserver?.disconnect(),this.resizeObserver=new ResizeObserver(()=>{this.highlightOverlay&&this.positionOverlay(this.highlightOverlay,t)}),this.resizeObserver.observe(t),this.resizeObserver.observe(this.ReactContainerElement),this.installContainerClickListener()}ensureContainerPositioned(){if(!this.ReactContainerElement)return;getComputedStyle(this.ReactContainerElement).position==="static"&&(this.ReactContainerElement.style.position="relative")}getEffectiveRect(e){let t=e.getBoundingClientRect();if(t.width>0&&t.height>0)return t;let i=e.children;if(i.length===0)return t;let o=1/0,r=1/0,s=-1/0,l=-1/0;for(let c=0;c<i.length;c++){let h=i[c].getBoundingClientRect();h.width===0&&h.height===0||(o=Math.min(o,h.top),r=Math.min(r,h.left),s=Math.max(s,h.bottom),l=Math.max(l,h.right))}return o===1/0?t:new DOMRect(r,o,l-r,s-o)}positionOverlay(e,t){if(!this.ReactContainerElement)return;let i=this.getEffectiveRect(t),o=this.ReactContainerElement.getBoundingClientRect();e.style.position="absolute",e.style.top=`${i.top-o.top+this.ReactContainerElement.scrollTop}px`,e.style.left=`${i.left-o.left+this.ReactContainerElement.scrollLeft}px`,e.style.width=`${i.width}px`,e.style.height=`${i.height}px`,e.style.pointerEvents="none",e.style.zIndex="10",e.style.borderRadius="4px",e.style.transition="all 0.2s ease"}installContainerClickListener(){this.containerClickHandler||!this.ReactContainerElement||(this.containerClickHandler=e=>{let t=e.target;if(!t)return;let i=t.closest("[data-mj-component]");if(!i)return;let o=i.getAttribute("data-mj-component");if(!o)return;let r=this.findSpecByName(o);r&&r.name!==this.SelectedSpec?.name&&(this.SelectComponent(r),this.cdr.detectChanges())},this.ReactContainerElement.addEventListener("click",this.containerClickHandler,!0))}removeContainerClickListener(){this.containerClickHandler&&this.ReactContainerElement&&this.ReactContainerElement.removeEventListener("click",this.containerClickHandler,!0),this.containerClickHandler=null}findSpecByName(e){return this.ComponentSpec?this.walkSpecTree(this.ComponentSpec,e):null}walkSpecTree(e,t){if(e.name===t)return e;if(e.dependencies)for(let i of e.dependencies){let o=this.walkSpecTree(i,t);if(o)return o}return null}clearHighlight(){this.resizeObserver?.disconnect(),this.resizeObserver=null,this.highlightOverlay?.parentNode&&this.highlightOverlay.parentNode.removeChild(this.highlightOverlay),this.highlightOverlay=null,this.removeHoverOverlay(),this.removeContainerClickListener()}ClosePanel(){this.clearHighlight(),this.Closed.emit()}ngOnDestroy(){this.clearHighlight()}static \u0275fac=(()=>{let e;return a(function(i){return(e||(e=je(n)))(i||n)},"ComponentFeedbackPanelComponent_Factory")})();static \u0275cmp=G({type:n,selectors:[["mj-component-feedback-panel"]],inputs:{ComponentSpec:"ComponentSpec",ReactContainerElement:"ReactContainerElement",ConversationId:"ConversationId",ConversationDetailId:"ConversationDetailId"},outputs:{Closed:"Closed"},features:[re],decls:20,vars:2,consts:[[1,"feedback-panel-overlay",3,"click"],[1,"feedback-panel",3,"click"],[1,"panel-header"],[1,"panel-title"],[1,"fa-solid","fa-magnifying-glass"],[1,"close-button",3,"click"],[1,"fa-solid","fa-times"],[1,"panel-content"],[1,"tree-section"],[1,"section-header"],[1,"fa-solid","fa-sitemap"],[1,"component-tree"],["Icon","fa-solid fa-circle-info","Title","No component hierarchy available","Size","compact"],[1,"feedback-section"],[1,"selected-component-info"],["Icon","fa-solid fa-hand-pointer","Title","Select a component from the tree to provide feedback","Size","compact"],[1,"tree-item",3,"selected","padding-left"],[1,"tree-item",3,"click","mouseenter","mouseleave"],[1,"tree-toggle","fa-solid",3,"fa-chevron-right","fa-chevron-down"],[1,"tree-spacer"],[1,"fa-solid","fa-cube","component-icon"],[1,"component-info"],[1,"component-name"],[1,"component-badge","registry"],[1,"tree-toggle","fa-solid",3,"click"],[1,"fa-solid","fa-star"],[1,"component-description",3,"data"],[1,"star-rating-container"],[1,"rating-label"],[1,"star-rating",3,"mouseleave"],[1,"star-wrapper"],[1,"rating-text","placeholder"],[1,"comment-container"],[1,"comment-label"],[1,"optional-label"],["placeholder","Share your thoughts about this component...","rows","4","maxlength","1000",1,"comment-input",3,"ngModelChange","ngModel"],[1,"char-count"],[1,"submit-container"],[1,"submit-button",3,"click","disabled"],["Variant","success"],["Variant","error"],[1,"star-zone","star-zone-left",3,"click","mouseenter"],[1,"star-zone","star-zone-right",3,"click","mouseenter"],[1,"star","fa-solid","fa-star"],[1,"star","fa-solid","fa-star-half-stroke"],[1,"star","fa-regular","fa-star"],[1,"fa-solid","fa-spinner","fa-spin"],[1,"fa-solid","fa-paper-plane"]],template:a(function(t,i){t&1&&(u(0,"div",0),j("click",a(function(){return i.ClosePanel()},"ComponentFeedbackPanelComponent_Template_div_click_0_listener")),u(1,"div",1),j("click",a(function(r){return r.stopPropagation()},"ComponentFeedbackPanelComponent_Template_div_click_1_listener")),u(2,"div",2)(3,"div",3),_(4,"i",4),u(5,"span"),g(6,"Inspect & Rate"),m()(),u(7,"button",5),j("click",a(function(){return i.ClosePanel()},"ComponentFeedbackPanelComponent_Template_button_click_7_listener")),_(8,"i",6),m()(),u(9,"div",7)(10,"div",8)(11,"div",9),_(12,"i",10),u(13,"span"),g(14,"Select Component"),m()(),b(15,A5e,3,0,"div",11)(16,N5e,1,0,"mj-empty-state",12),m(),u(17,"div",13),b(18,X5e,27,10,"div",14)(19,Y5e,1,0,"mj-empty-state",15),m()()()()),t&2&&(d(15),x(i.ComponentSpec?15:16),d(3),x(i.SelectedSpec?18:19))},"ComponentFeedbackPanelComponent_Template"),dependencies:[Oe,Gt,un,Ot,im,Pt,oo,oi,mt,vn],styles:[`
25406
25406
  .feedback-panel-overlay[_ngcontent-%COMP%] {
25407
25407
  position: fixed;
25408
25408
  top: 60px;
@@ -33979,7 +33979,7 @@ if(document.readyState!=='loading'){ready();}else{document.addEventListener('DOM
33979
33979
  .media-highlight[_ngcontent-%COMP%] {
33980
33980
  animation: none;
33981
33981
  }
33982
- }`],changeDetection:0})};var sWe=function(n,e,t,i){var o=arguments.length,r=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r};function Wa(n){return typeof n=="string"&&n.length>0?n:void 0}a(Wa,"asString");function P_(n){return typeof n=="number"&&Number.isFinite(n)?n:void 0}a(P_,"asNumber");var lWe=["image","video","audio","pdf","web"],T_=class extends Fo{static{a(this,"RealtimeMediaChannel")}State=new R_;surface=null;stateChangedSub=null;get ChannelName(){return"Media"}get ToolNamePrefix(){return pz}get TabTitle(){return"Media"}get TabIcon(){return"fa-solid fa-images"}GetToolDefinitions(){return mz}GetDescriptor(){return{Key:this.ChannelName,Version:Tc,DisplayName:this.TabTitle,OwningPackage:"@memberjunction/ng-conversations",Instructions:"A shared surface where you can show the user images, videos, audio clips, PDFs and web pages. Each item opens in its own tab; you can switch between them and highlight a region to point at it.",Nouns:[{Name:"items",Description:"The media items currently shared, each with its type, title and source.",Schema:{type:"array",items:{type:"object"}}}],Verbs:Zf(this.GetToolDefinitions(),this.ToolNamePrefix),DisplayPolicy:"open-on-start",DefaultAvailability:"all-sessions",MaxExposure:"state"}}GetSurfaceComponent(){return I_}GetOnboardingDetails(){return{Heading:"Media",Description:"A shared surface where the agent can show you visuals during the call \u2014 images, videos, audio clips, PDFs and web pages. Each item opens in its own tab; the agent can switch between them and highlight regions to point at exactly what it means.",Tips:["Switch between shared items using the tabs along the top.","The agent can highlight part of an image or page to draw your eye to it.","Open any item in a new browser tab or download it from the toolbar."],IconClass:"fa-solid fa-images"}}OnInitialize(){this.stateChangedSub=this.State.Changed$.subscribe(()=>{this.Context?.RequestSave(this.State.ToJSON())})}BindSurface(e){this.surface=e,e.State=this.State,e.AgentName=this.Context?.AgentName??"The agent",e.Provider=this.Context?.Provider??null}UnbindSurface(){this.surface=null}ApplyAgentTool(e,t){let i={};try{let o=t?JSON.parse(t):{};o&&typeof o=="object"&&!Array.isArray(o)&&(i=o)}catch{return this.fail(`Could not parse arguments for ${e}.`)}switch(e){case xr.ShowMedia:return this.applyShowMedia(i);case xr.CloseMedia:return this.applyCloseMedia(i);case xr.PlayMedia:return this.applyPlayMedia(i);case xr.Highlight:return this.applyHighlight(i);case xr.ClearAll:return this.applyClearAll();default:return this.fail(`Unknown Media tool "${e}".`)}}applyShowMedia(e){let t=Wa(e.mediaType),i=Wa(e.url),o=Wa(e.fileId),r=Wa(e.displayName);if(!t||!lWe.includes(t))return this.fail('Media_ShowMedia requires a "mediaType" of image | video | audio | pdf | web.');if(!i&&!o)return this.fail('Media_ShowMedia requires a source \u2014 provide a "url" (external/public) OR a "fileId" (an MJ: Files id).');if(i&&!gR(i))return this.fail('Media_ShowMedia "url" must be an absolute http:// or https:// URL.');if(!r)return this.fail('Media_ShowMedia requires a "displayName".');let s=this.State.AddItem({Type:t,Url:i?i.trim():void 0,FileID:o,DisplayName:r,Caption:Wa(e.caption)});return this.note(`now showing ${t} "${r}"`),JSON.stringify({success:!0,id:s.Id,active:!0})}applyCloseMedia(e){let t=Wa(e.id);return t?this.State.RemoveItem(t)?(this.note(`closed media item "${t}"`),JSON.stringify({success:!0,id:t})):this.fail(`No media item with id "${t}".`):this.fail('Media_CloseMedia requires an "id".')}applyPlayMedia(e){let t=Wa(e.id);return t?this.State.RequestPlay(t)?(this.note(`playing media item "${t}"`),JSON.stringify({success:!0,id:t})):this.fail(`No media item with id "${t}".`):this.fail('Media_PlayMedia requires an "id".')}applyHighlight(e){let t=Wa(e.id);if(!t)return this.fail('Media_Highlight requires an "id".');let i=P_(e.x),o=P_(e.y),r=P_(e.w),s=P_(e.h);if(i===void 0||o===void 0||r===void 0||s===void 0)return this.fail("Media_Highlight requires numeric fractional x, y, w, h (0..1).");let l={X:i,Y:o,W:r,H:s,Label:Wa(e.label)};return this.State.Highlight(t,l)?(this.note(`highlighted a region of media item "${t}"`),JSON.stringify({success:!0,id:t})):this.fail(`No media item with id "${t}".`)}applyClearAll(){return this.State.Clear(),this.note("cleared all media"),JSON.stringify({success:!0})}SerializeState(){return this.State.ToJSON()}RestoreState(e){return this.State.LoadFromJSON(e)}Dispose(){this.stateChangedSub?.unsubscribe(),this.stateChangedSub=null,this.surface=null,super.Dispose()}fail(e){return JSON.stringify({success:!1,error:e})}note(e){this.Context?.SendContextNote(`[media] ${e} (background context \u2014 do NOT narrate routine changes; mention only if relevant).`)}};T_=sWe([zt(Fo,"RealtimeMediaChannel")],T_);var cWe=[{key:"IdentityVerificationChannel",channelClass:j_},{key:"RealtimeWhiteboardChannel",channelClass:E_},{key:"RealtimeMediaChannel",channelClass:T_}];function vz(){let n=Bt.Instance.ClassFactory;for(let{key:e,channelClass:t}of cWe)n.GetRegistration(Fo,e)===null&&n.Register(Fo,t,e)}a(vz,"EnsureBuiltInChannelsRegistered");var dWe=[{Key:OT,async Load(){(await import("./chunks/interactive-chunk-entry-WGFKDSQQ.js")).EnsureInteractiveComponentChannelRegistered()}}];function Cz(n=dWe){let e=new Map;return async t=>{let i=n.filter(s=>t.includes(s.Key)),r=(await Promise.allSettled(i.map(s=>{let l=e.get(s.Key);return l||(l=s.Load(),e.set(s.Key,l),l.catch(()=>e.delete(s.Key))),l}))).filter(s=>s.status==="rejected");if(r.length>0)throw new Error(`Could not load channel code: ${r.map(s=>s.reason instanceof Error?s.reason.message:String(s.reason)).join("; ")}`)}}a(Cz,"CreateChannelClassLoader");function bz(n){return n.launcher?"launcher":n.widgetKey?"widget-key":n.inviteToken?"invite-token":n.token?"token":"host"}a(bz,"ResolveAuthMode");var uWe=["apiUrl","widgetKey","inviteToken","token","agentId","applicationId","conversationId","channels","channelInputs","chrome","autoStart","requireConsent","theme","themeTokens","locale","agentName","cspNonce","launcher","perception","frameCapture","preload","sessionUrl"];function pWe(n){return n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}a(pWe,"AttributeNameFor");var FBt=[...uWe.filter(n=>n!=="launcher").map(pWe)];var mWe="mj_ml_",hWe="/magic-link/redeem?format=json",CR="This session has expired. Please start again or request a new link.",D_=class{static{a(this,"WidgetAuthAdapter")}apiUrl;provider;post;refresh;now;heldJwt=null;constructor(e){this.apiUrl=e.apiUrl!=null?Tf(e.apiUrl):null,this.provider=e.provider,this.post=e.post,this.refresh=e.refresh??null,this.now=e.now??(()=>Date.now())}async Hold(e){if(this.provider.isConfigured())return{held:!0,jwt:null};let t=e.startsWith(mWe)?await this.redeem(e):{jwt:e};return"failure"in t?{held:!1,failure:t.failure}:await this.provider.configure(t.jwt,()=>this.renew())?(this.heldJwt=t.jwt,{held:!0,jwt:t.jwt}):{held:!1,failure:{code:"provider-rejected",message:"The server did not accept this session. Please try again."}}}HasPrincipal(){return this.heldJwt!==null?!this.isExpired(this.heldJwt):this.provider.isConfigured()}ReadExpiry(e){let t=this.decodePayload(e);if(t===null)return null;let i=t.exp;return typeof i=="number"&&Number.isFinite(i)?i*1e3:null}async renew(){if(this.refresh===null)throw new Error(CR);let e=await this.refresh();return this.heldJwt=e,e}isExpired(e){let t=this.ReadExpiry(e);return t!==null&&t<=this.now()}decodePayload(e){let t=e.split(".")[1];if(t===void 0||t.length===0)return null;try{let i=t.replace(/-/g,"+").replace(/_/g,"/"),o=i.padEnd(i.length+(4-i.length%4)%4,"="),r=JSON.parse(this.utf8FromBase64(o));return typeof r=="object"&&r!==null?r:null}catch{return null}}utf8FromBase64(e){let t=atob(e),i=Uint8Array.from(t,o=>o.charCodeAt(0));return new TextDecoder().decode(i)}async redeem(e){if(this.apiUrl===null)return he("mj-realtime-widget: an invite token arrived but no api-url is configured, so it cannot be redeemed."),{failure:{code:"no-api-url",message:"This widget is missing its server address (api-url)."}};let t=`${this.apiUrl}${hWe}`,i;try{i=await this.post(t,{token:e})}catch(r){return he(`mj-realtime-widget: magic-link redemption could not reach ${t}: ${r instanceof Error?r.message:String(r)}`),{failure:{code:"redeem-failed",message:"We could not reach the server. Please check your connection and try again."}}}let o=this.asRedeemResponse(i.json);return!i.ok||o===null||!o.success||o.token===void 0?(he(`mj-realtime-widget: magic-link redemption failed. reason=${o?.errorCode??"unreadable-response"}, httpOk=${i.ok}, endpoint=${t}`),{failure:{code:"redeem-failed",message:fWe(o?.errorCode)}}):{jwt:o.token}}asRedeemResponse(e){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.success!="boolean"?null:{success:t.success,token:typeof t.token=="string"?t.token:void 0,errorCode:typeof t.errorCode=="string"?t.errorCode:void 0}}};function fWe(n){switch(n){case"expired":return"This invitation link has expired. Please request a new one.";case"consumed":return"This invitation link has already been used. Please request a new one.";case"revoked":return"This invitation link is no longer valid.";case"not_found":case"invalid":return"This invitation link is not valid. Please check it or request a new one.";default:return"We could not start your session from this link. Please try again or request a new one."}}a(fWe,"DescribeRedeemFailure");var ol=class extends Error{static{a(this,"WidgetKeyError")}code;status;constructor(e,t,i){super(e),this.code=t,this.status=i,this.name="WidgetKeyError"}},gWe=15*6e4,F_=class{static{a(this,"WidgetKeyClient")}widgetKey;fetchImpl;baseUrl;proofKey=null;serverOffsetMs=0;constructor(e,t,i=(o,r)=>fetch(o,r)){this.widgetKey=t,this.fetchImpl=i,this.baseUrl=Tf(e)}async Mint(){let e=await VI(),t=await this.call("/widget/session",e);return this.proofKey=e,t}async Refresh(e){if(!this.proofKey)throw new ol("A guest session refresh needs the key registered at mint; call Mint first.","no_proof_key",null);return this.call("/widget/session/refresh",this.proofKey,e)}async call(e,t,i){let o,r=`${this.baseUrl}${e}`,s={"content-type":"application/json"},l={widgetKey:this.widgetKey};i?(s.authorization=`Bearer ${i}`,s.dpop=await LI(t,{Method:"POST",Url:r,AccessToken:i,NowSeconds:Math.floor((Date.now()+this.serverOffsetMs)/1e3)})):l.proofKey=t.PublicJwk;try{o=await this.fetchImpl(r,{method:"POST",headers:s,body:JSON.stringify(l)})}catch(h){throw new ol(`Could not reach the server: ${h instanceof Error?h.message:String(h)}`,"network",null)}let c=null;try{c=await o.json()}catch{}return this.toSession(o.ok,o.status,c)}learnServerOffset(e){let t=vWe(e);t!==null&&(this.serverOffsetMs=t*1e3-Date.now())}toSession(e,t,i){let o=xz(i)?i:{},r=typeof o.errorCode=="string"?o.errorCode:null;if(!e||o.success!==!0||typeof o.token!="string"||o.token.length===0)throw new ol(CWe(r,t),r??"mint_failed",t);let s=bR(o,"widgetId"),l=bR(o,"applicationId"),c=bR(o,"pinnedAgentId");if(!s||!l||!c)throw new ol("The server answered with an incomplete widget session.","incomplete_session",t);this.learnServerOffset(o.token);let h=typeof o.expiresAt=="string"?Date.parse(o.expiresAt)-this.serverOffsetMs:Number.NaN,f=o.voiceMaxSessionMinutes,v=o.modality;return{token:o.token,expiresAtMs:Number.isFinite(h)?h:Date.now()+gWe,widgetId:s,applicationId:l,pinnedAgentId:c,modality:v==="Voice"||v==="Both"?v:"Text",voiceMaxSessionMinutes:typeof f=="number"&&Number.isFinite(f)&&f>0?f:null,enabledChannels:Array.isArray(o.enabledChannels)?o.enabledChannels.filter(C=>typeof C=="string"):[]}}};function xz(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}a(xz,"isRecord");function vWe(n){let e=n.split(".")[1];if(!e)return null;try{let t=e.replace(/-/g,"+").replace(/_/g,"/"),i=JSON.parse(atob(t+"=".repeat((4-t.length%4)%4))),o=xz(i)?i.iat:void 0;return typeof o=="number"&&Number.isFinite(o)?o:null}catch{return null}}a(vWe,"readIssuedAtSeconds");function bR(n,e){let t=n[e];return typeof t=="string"&&t.length>0?t:null}a(bR,"stringField");function CWe(n,e){return n==="rate_limited"||e===429?"Too many attempts. Please wait a moment and try again.":n==="server_error"||e>=500?"The server had a problem starting your session. Please try again.":"This widget is not available here. If you think that is a mistake, please contact the site owner."}a(CWe,"DescribeMintFailure");function bWe(n){switch(n){case"on":return"pixels";case"off":return"state";case"ask":return}}a(bWe,"ExposureForPerception");function yz(n){return{sourceId:n.SourceID,label:n.Label,channel:n.ChannelKey??null,enabled:n.Enabled,active:n.Active}}a(yz,"ToPerceptionSource");function xWe(n,e){let t=new Map(n.map(i=>[i.SourceID,i.Enabled]));return e.filter(i=>t.has(i.SourceID)&&t.get(i.SourceID)!==i.Enabled)}a(xWe,"FindPerceptionToggles");var xR=class{static{a(this,"WidgetExposurePreferences")}inner;mode;explicit=new Map;applying=!1;constructor(e,t){this.inner=e,this.mode=t}Get(e){let t=e.trim().toLowerCase();if(this.explicit.has(t))return this.explicit.get(t);let i=bWe(this.mode());return i!==void 0?i:this.inner.Get(e)}Set(e,t){this.applying||(this.explicit.set(e.trim().toLowerCase(),t),this.inner.Set(e,t))}ForgetChoices(){this.explicit.clear()}WhileApplying(e){this.applying=!0;try{e()}finally{this.applying=!1}}},O_=class{static{a(this,"PerceptionBridge")}runtime;emit;mode="ask";installed=null;original=null;sourcesSub=null;lastSources=[];constructor(e,t){this.runtime=e,this.emit=t}Apply(e){let t=e!==this.mode;if(this.mode=e,this.installed===null&&e==="ask")return;let i=this.ensureInstalled();t&&(i.ForgetChoices(),this.pushIntoLiveChannels(i))}Start(){this.Stop(),this.lastSources=[],this.sourcesSub=this.runtime.VideoSources$.subscribe(e=>{for(let t of xWe(this.lastSources,e))this.emit({name:"mj-perception-changed",detail:{...yz(t),sources:e.map(yz)}});this.lastSources=e})}Stop(){this.sourcesSub?.unsubscribe(),this.sourcesSub=null,this.lastSources=[]}Dispose(){this.Stop(),this.installed!==null&&this.original!==null&&this.runtime.SetExposurePreferences(this.original),this.installed=null,this.original=null}ensureInstalled(){return this.installed===null&&(this.original=this.runtime.ExposurePreferences,this.installed=new xR(this.original,()=>this.mode),this.runtime.SetExposurePreferences(this.installed)),this.installed}pushIntoLiveChannels(e){let t=[...this.runtime.ActiveChannels,...this.runtime.AdvertisedChannels].map(i=>i.ChannelName);e.WhileApplying(()=>{for(let i of t)this.runtime.SetUserChannelExposure(i,e.Get(i))})}};var yWe=a(async()=>(await import("./chunks/frame-capture-chunk-entry-EFFSSPQW.js")).EnableFrameCapture(),"DefaultFrameCaptureEnabler"),wz=!1;function wWe(n){wz||(wz=!0,console.warn(`[mj-realtime-widget] frame-capture is on, but the component rasterizer could not be enabled (${n}), so the agent receives component state only.`))}a(wWe,"warnUnavailable");var A_=class{static{a(this,"FrameCaptureHook")}enabler;enabled=!1;pending=null;dispose=null;constructor(e=yWe){this.enabler=e}Apply(e){e!==this.enabled&&(this.enabled=e,e?this.pending=this.enable():this.disable())}async Ready(){return this.enabled&&this.pending?this.pending:!1}Dispose(){this.enabled=!1,this.disable()}async enable(){if(C1.Instance.Capturer!==null)return!0;try{let e=await this.enabler();return this.enabled?(this.dispose=e,C1.Instance.Capturer!==null):(e(),!1)}catch(e){return wWe(e instanceof Error?e.message:String(e)),!1}}async disable(){let e=this.pending;this.pending=null,await e,!this.enabled&&this.dispose&&(this.dispose(),this.dispose=null)}};var _We={IdentityVerification:"IdentityVerificationChannel",Whiteboard:"RealtimeWhiteboardChannel",Media:"RealtimeMediaChannel",InteractiveComponent:"RealtimeInteractiveComponentChannel",RemoteBrowser:"RealtimeRemoteBrowserChannel",ClientContext:"ClientContextChannel"},SWe=new Set(["booting","connecting"]),jWe=new Set(["ended","error"]),kWe={explicit:"remote",error:"error",deadline:"deadline"},yR="The connection was interrupted. Please try again.",MWe="The call could not be started. Please try again, or reload the page if it keeps happening.";function _z(n){return n===null?yR:n.name==="NotAllowedError"||/permission|denied|not allowed/i.test(n.message)?"Microphone access was blocked. Allow the microphone for this site in your browser, then try again.":n.name==="NotFoundError"||/requested device not found/i.test(n.message)?"No microphone was found. Connect one and try again.":n.message.length>0?n.message:yR}a(_z,"DescribeStartError");var Po=class extends Error{static{a(this,"LaunchFailure")}code;constructor(e,t){super(e),this.code=t}},N_=class{static{a(this,"WidgetController")}deps;config;now;eventsSubject=new pe;phaseSubject=new pe;surfaceOpenSubject=new nn(!1);subs=new Zi;channelSubs=new Map;registeredChannels=new Map;phase="idle";errorMessage="";auth=null;store=null;guest=null;guestSource=null;disposed=!1;launchGeneration=0;endReason=null;readyAnnounced=!1;liveSessionConversationId=null;sawLive=!1;started=!1;ownsRuntimeCall=!1;sawOwnState=!1;connectionSub=null;perception;frameCapture=new A_;constructor(e,t){this.deps=e,this.config=t,this.now=e.now??(()=>Date.now()),this.perception=new O_(e.runtime,i=>this.emit(i)),this.applyPageSettings(),this.wireRuntimeStreams()}get Events$(){return this.eventsSubject.asObservable()}get Phase$(){return this.phaseSubject.asObservable()}get Phase(){return this.phase}get SurfaceChannelOpen$(){return this.surfaceOpenSubject.asObservable()}get ErrorMessage(){return this.errorMessage}get Config(){return this.config}get Mode(){return bz(this.config)}Configure(e){this.config=e,this.applyPageSettings()}applyPageSettings(){this.perception.Apply(this.config.perception),this.frameCapture.Apply(this.config.frameCapture)}Ready(){this.readyAnnounced||this.disposed||(this.readyAnnounced=!0,queueMicrotask(()=>{this.disposed||(this.emit({name:"mj-ready",detail:{mode:this.Mode,autoStart:this.config.autoStart}}),this.config.autoStart&&this.Start())}))}async Start(){if(!(this.disposed||!["idle","ended","error","consent"].includes(this.phase))){if(this.config.requireConsent){this.setPhase("consent");return}await this.launch(!1)}}async AcceptConsent(e){this.phase==="consent"&&await this.launch(e)}DeclineConsent(){this.phase==="consent"&&this.setPhase("idle")}async End(e="user"){this.launchGeneration++,this.endReason??=e;try{await this.endOwnRuntimeCall()}catch(t){console.error("[mj-realtime-widget] Ending the session failed:",t)}(this.phase==="consent"||this.phase==="booting"||this.phase==="connecting")&&(this.setPhase("idle"),this.endReason=null)}NotifyOverlayEnded(){this.endReason??="user"}OnPageHide(e){return!e&&this.deps.pageClose.IsArmed&&(this.endReason??="page-close"),this.deps.pageClose.OnPageHide(e)}Dispose(){if(!this.disposed){this.disposed=!0,this.launchGeneration++,this.deps.pageClose.IsArmed&&this.deps.pageClose.OnHostTeardown(),this.connectionSub?.unsubscribe(),this.subs.unsubscribe(),this.perception.Dispose(),this.frameCapture.Dispose();for(let e of this.channelSubs.values())e.unsubscribe();this.channelSubs.clear(),this.endOwnRuntimeCall().catch(e=>{console.error("[mj-realtime-widget] Ending the session on removal failed:",e)}),this.eventsSubject.complete(),this.phaseSubject.complete(),this.surfaceOpenSubject.complete()}}RegisterChannel(e){let t=new e().ChannelName;if(t.trim().length===0)throw new Error("registerChannel: the channel class has no ChannelName.");this.registeredChannels.set(t.toLowerCase(),e)}async OpenChannel(e,t={}){if(!this.deps.runtime.IsActive)return{success:!1,error:"There is no live call to open a channel in.",errorCode:"no_session"};let i=await this.deps.runtime.OpenChannel(e,t);return i.Success?{success:!0,result:i.Result}:{success:!1,error:i.ErrorMessage??"The channel could not be opened.",errorCode:i.ErrorCode}}SendContextNote(e){this.deps.runtime.SendContextNote(e)}RequestSpokenResponse(e){return this.deps.runtime.RequestSpokenOpening(e)}GetChannelDescriptors(){return[...this.deps.runtime.ActiveChannels,...this.deps.runtime.AdvertisedChannels].map(e=>e.GetDescriptor())}async launch(e){let t=++this.launchGeneration;this.resetLaunchState();try{this.setPhase("booting");let i=await this.prepareSession();if(this.isAbandoned(t))return;this.setPhase("connecting"),await this.startRuntimeSession(i,e,t)}catch(i){if(this.isAbandoned(t)){await this.endAbandonedSession();return}this.fail(i instanceof Po?i.code:"start-failed",i instanceof Error?i.message:"The call could not be started.")}}resetLaunchState(){this.endReason=null,this.errorMessage="",this.sawLive=!1,this.started=!1,this.ownsRuntimeCall=!1,this.sawOwnState=!1,this.guest=null}isAbandoned(e){return this.disposed||e!==this.launchGeneration}async prepareSession(){let e=this.Mode,t=this.config,i=`${t.apiUrl??""}|${t.widgetKey??t.agentId??""}`;return this.store=this.deps.createResumeStore(i),e==="host"||e==="launcher"&&!t.token&&!t.inviteToken?this.prepareWithoutCredential(e):e==="widget-key"?this.prepareGuestSession():this.prepareWithCredential(e)}prepareWithoutCredential(e){let t=this.config.agentId??"";if(e==="host"&&t.length===0)throw new Po("No agent was specified. Set the agent-id attribute.","no-agent");if(e==="host"&&this.config.launcher===null&&(this.auth=this.deps.createAuth(this.config.apiUrl,null),!this.auth.HasPrincipal()))throw new Po("No credential was supplied. Set widget-key, invite-token or token, or run inside an authenticated MemberJunction page.","no-credential");return{agentId:t,applicationId:this.config.applicationId,deadline:null,guestChannels:[]}}async prepareGuestSession(){let{apiUrl:e,widgetKey:t}=this.config;if(!e||!t)throw new Po("A widget-key needs the api-url of the server that issued it.","no-credential");this.guestSource=this.deps.createGuestSessions(e,t);let i=await this.mintGuest(this.guestSource,"Mint");if(i.modality==="Text")throw new Po("This widget is not enabled for voice.","voice-not-enabled");this.guest=i,this.auth=this.deps.createAuth(e,()=>this.renewGuestToken()),await this.holdOrFail(this.auth,i.token),this.config.agentId&&this.config.agentId!==i.pinnedAgentId&&console.warn(`[mj-realtime-widget] agent-id "${this.config.agentId}" ignored: this widget key pins agent "${i.pinnedAgentId}".`);let o=i.voiceMaxSessionMinutes?new Date(this.now()+i.voiceMaxSessionMinutes*6e4):null;return{agentId:i.pinnedAgentId,applicationId:i.applicationId,deadline:o,guestChannels:i.enabledChannels}}async mintGuest(e,t,i){try{return t==="Refresh"?await e.Refresh(i??""):await e.Mint()}catch(o){throw o instanceof ol?new Po(o.message,"auth-failed"):o}}async renewGuestToken(){if(this.guestSource===null||this.guest===null)throw new Error(CR);let e=await this.mintGuest(this.guestSource,"Refresh",this.guest.token);return this.guest=e,e.token}async prepareWithCredential(e){let t=this.config,i=t.agentId??"";if(i.length===0&&e!=="launcher")throw new Po("No agent was specified. Set the agent-id attribute.","no-agent");this.auth=this.deps.createAuth(t.apiUrl,null);let o=this.store?.ReadJwt()??t.token??t.inviteToken;if(o==null)throw new Po("No credential was supplied.","no-credential");let r=await this.holdOrFail(this.auth,o);return r!==null&&this.store?.WriteJwt(r,this.auth.ReadExpiry(r)),{agentId:i,applicationId:t.applicationId,deadline:null,guestChannels:[]}}async holdOrFail(e,t){let i=await e.Hold(t);if(!i.held)throw new Po(i.failure.message,"auth-failed");return i.jwt}async startRuntimeSession(e,t,i){let o=this.deps.runtime;this.config.launcher&&(o.Launcher=this.config.launcher),this.deps.loadChannelClasses&&(o.ChannelClassLoader=this.deps.loadChannelClasses),await this.frameCapture.Ready(),this.perception.Start(),this.wireConnectionState();let r=this.store?.Read()?.lastSessionId??null;this.started=!0,this.ownsRuntimeCall=!0;try{await o.StartRealtimeSession(e.agentId,this.config.conversationId,r,this.config.agentName,null,null,null,null,t,null,e.applicationId,null,{HostChannels:this.buildHostChannels(e.guestChannels),SessionDeadline:e.deadline})}catch(s){throw new Po(_z(s instanceof Error?s:null),this.config.launcher?"launcher-failed":"start-failed")}if(this.isAbandoned(i)){await this.endAbandonedSession();return}if(!this.sawOwnState)throw new Po(MWe,"start-dropped");this.openSeededChannels()}buildHostChannels(e){let t=new Map;for(let i of[...this.config.channels??[],...e]){let o=i.toLowerCase(),r=this.registeredChannels.get(o);t.set(o,r?{Create:a(()=>new r,"Create")}:{ClientPluginClass:_We[i]??i})}for(let[i,o]of this.registeredChannels)t.has(i)||t.set(i,{Create:a(()=>new o,"Create")});return[...t.values()]}openSeededChannels(){for(let[e,t]of Object.entries(this.config.channelInputs))this.OpenChannel(e,t).then(i=>{i.success||this.emitError("channel-failed",`Could not open the ${e} channel: ${i.error??"unknown error"}`)})}async endAbandonedSession(){try{await this.deps.runtime.EndRealtimeSession()}catch(e){console.error("[mj-realtime-widget] An abandoned launch could not close the session it opened:",e)}}wireRuntimeStreams(){let e=this.deps.runtime;this.subs.add(e.SessionStarted$.subscribe(t=>this.onSessionStarted(t.sessionId,t.channelNames))),this.subs.add(e.SessionEnded$.subscribe(t=>this.onSessionEnded(t.sessionId,t.reason))),this.subs.add(e.SessionEvents$.subscribe(t=>this.onSessionEvent(t))),this.subs.add(e.ActiveChannels$.subscribe(t=>this.syncChannelSubscriptions(t)))}onSessionStarted(e,t){this.liveSessionConversationId=this.config.conversationId,this.deps.pageClose.Arm(e),this.store?.WriteSession(e,this.liveSessionConversationId),this.emit({name:"mj-session-started",detail:{sessionId:e,agentId:this.config.agentId,conversationId:this.liveSessionConversationId,channels:t}})}onSessionEnded(e,t){this.deps.pageClose.Disarm(),this.surfaceOpenSubject.next(!1);let i=this.endReason??kWe[t];this.emit({name:"mj-session-ended",detail:{sessionId:e,reason:i}})}onSessionEvent(e){if(this.emit({name:"mj-session-event",detail:{type:e.Type,sessionId:e.AgentSessionID,occurredAt:e.OccurredAt,payload:e.Payload}}),e.Type==="identity.verified"&&Yf(e.Payload)){let t=e.Payload;this.emit({name:"mj-verified",detail:{sessionId:e.AgentSessionID,email:t.VerifiedEmail,name:t.VerifiedName,verifiedAt:t.VerifiedAt,method:t.Method,...t.MaxSessionDeadlineIso?{maxSessionDeadline:t.MaxSessionDeadlineIso}:{},recovered:t.Recovered===!0}})}}syncChannelSubscriptions(e){for(let[t,i]of this.channelSubs)e.includes(t)||(i.unsubscribe(),this.channelSubs.delete(t));for(let t of e)this.channelSubs.has(t)||this.channelSubs.set(t,this.subscribeChannel(t))}subscribeChannel(e){let t=new Zi;return t.add(e.Events$.subscribe(i=>{if(i.Name==="opened"){e.HasSurface()&&this.surfaceOpenSubject.next(!0);let o=i.Payload.inputs??{};this.emit({name:"mj-channel-opened",detail:{channel:i.Channel,instance:i.Instance,inputs:o}})}this.emit({name:"mj-channel-event",detail:{channel:i.Channel,instance:i.Instance,name:i.Name,payload:i.Payload,...i.ChangeId!==void 0?{changeId:i.ChangeId}:{},occurredAt:i.OccurredAt}})})),t.add(e.Output$.subscribe(i=>this.emit({name:"mj-channel-output",detail:{channel:i.Channel,instance:i.Instance,output:i.Output,occurredAt:i.OccurredAt}}))),t}wireConnectionState(){this.connectionSub?.unsubscribe(),this.connectionSub=this.deps.runtime.ConnectionState$.subscribe(e=>this.applyConnectionState(e))}applyConnectionState(e){if(this.started&&(this.sawOwnState=!0,!jWe.has(this.phase)))switch(e){case"connecting":SWe.has(this.phase)&&this.setPhase("connecting");break;case"listening":case"speaking":case"thinking":this.sawLive=!0,this.setPhase("live");break;case"error":{let t=this.sawLive?Qf(this.deps.runtime.LastSessionError):null;if(t){this.fail("time-limit",t.Message);break}this.fail(this.sawLive?"connection-lost":this.config.launcher?"launcher-failed":"start-failed",this.sawLive?yR:_z(this.deps.runtime.LastStartError));break}case"closed":this.sawLive&&this.setPhase("ended");break}}async endOwnRuntimeCall(){this.ownsRuntimeCall&&(this.ownsRuntimeCall=!1,await this.deps.runtime.EndRealtimeSession())}setPhase(e){if(e===this.phase)return;(e==="ended"||e==="error")&&(this.ownsRuntimeCall=!1,this.perception.Stop());let t=this.phase;this.phase=e,this.phaseSubject.next(e),this.emit({name:"mj-phase-changed",detail:{phase:e,previous:t}})}fail(e,t){this.phase!=="error"&&(this.errorMessage=t,this.setPhase("error"),this.emitError(e,t))}emitError(e,t){this.emit({name:"mj-error",detail:{code:e,message:t,phase:this.phase}})}emit(e){this.disposed||this.eventsSubject.next(e)}};function EWe(n){return n.replace(/^http/,"ws")}a(EWe,"toWebSocketUrl");var RWe=a(async(n,e)=>{let t=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),i=await t.json().catch(()=>null);return{ok:t.ok,json:i}},"browserPost");function IWe(n){return{isConfigured(){try{return(Jn.Instance?.ConfigData?.Token??"").length>0}catch{return!1}},async configure(e,t){if(n===null)return he("mj-realtime-widget: cannot authenticate \u2014 no api-url was supplied and no host application has configured the GraphQL provider."),!1;try{let i=new FP(e,n,EWe(n),t);return await OP(i),!0}catch(i){return he(`mj-realtime-widget: failed to configure the GraphQL provider: ${i instanceof Error?i.message:String(i)}`),!1}}}}a(IWe,"graphQLProvider");function Sz(n,e){return new D_({apiUrl:n,provider:IWe(n),post:RWe,refresh:e})}a(Sz,"CreateBrowserWidgetAuth");var V_=class{static{a(this,"WidgetPageClose")}deps;agentSessionId=null;constructor(e){this.deps=e}Arm(e){this.agentSessionId=e}Disarm(){this.agentSessionId=null}get IsArmed(){return this.agentSessionId!==null}OnPageHide(e){return e?!1:this.closeNow()}OnHostTeardown(){return this.closeNow()}closeNow(){let e=this.agentSessionId;if(e===null)return!1;let t=this.deps.config();return t===null?!1:(this.agentSessionId=null,this.deps.send(t.url,t.token,e),!0)}};var PWe=`
33982
+ }`],changeDetection:0})};var sWe=function(n,e,t,i){var o=arguments.length,r=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(r=(o<3?s(r):o>3?s(e,t,r):s(e,t))||r);return o>3&&r&&Object.defineProperty(e,t,r),r};function Wa(n){return typeof n=="string"&&n.length>0?n:void 0}a(Wa,"asString");function P_(n){return typeof n=="number"&&Number.isFinite(n)?n:void 0}a(P_,"asNumber");var lWe=["image","video","audio","pdf","web"],T_=class extends Fo{static{a(this,"RealtimeMediaChannel")}State=new R_;surface=null;stateChangedSub=null;get ChannelName(){return"Media"}get ToolNamePrefix(){return pz}get TabTitle(){return"Media"}get TabIcon(){return"fa-solid fa-images"}GetToolDefinitions(){return mz}GetDescriptor(){return{Key:this.ChannelName,Version:Tc,DisplayName:this.TabTitle,OwningPackage:"@memberjunction/ng-conversations",Instructions:"A shared surface where you can show the user images, videos, audio clips, PDFs and web pages. Each item opens in its own tab; you can switch between them and highlight a region to point at it.",Nouns:[{Name:"items",Description:"The media items currently shared, each with its type, title and source.",Schema:{type:"array",items:{type:"object"}}}],Verbs:Zf(this.GetToolDefinitions(),this.ToolNamePrefix),DisplayPolicy:"open-on-start",DefaultAvailability:"all-sessions",MaxExposure:"state"}}GetSurfaceComponent(){return I_}GetOnboardingDetails(){return{Heading:"Media",Description:"A shared surface where the agent can show you visuals during the call \u2014 images, videos, audio clips, PDFs and web pages. Each item opens in its own tab; the agent can switch between them and highlight regions to point at exactly what it means.",Tips:["Switch between shared items using the tabs along the top.","The agent can highlight part of an image or page to draw your eye to it.","Open any item in a new browser tab or download it from the toolbar."],IconClass:"fa-solid fa-images"}}OnInitialize(){this.stateChangedSub=this.State.Changed$.subscribe(()=>{this.Context?.RequestSave(this.State.ToJSON())})}BindSurface(e){this.surface=e,e.State=this.State,e.AgentName=this.Context?.AgentName??"The agent",e.Provider=this.Context?.Provider??null}UnbindSurface(){this.surface=null}ApplyAgentTool(e,t){let i={};try{let o=t?JSON.parse(t):{};o&&typeof o=="object"&&!Array.isArray(o)&&(i=o)}catch{return this.fail(`Could not parse arguments for ${e}.`)}switch(e){case xr.ShowMedia:return this.applyShowMedia(i);case xr.CloseMedia:return this.applyCloseMedia(i);case xr.PlayMedia:return this.applyPlayMedia(i);case xr.Highlight:return this.applyHighlight(i);case xr.ClearAll:return this.applyClearAll();default:return this.fail(`Unknown Media tool "${e}".`)}}applyShowMedia(e){let t=Wa(e.mediaType),i=Wa(e.url),o=Wa(e.fileId),r=Wa(e.displayName);if(!t||!lWe.includes(t))return this.fail('Media_ShowMedia requires a "mediaType" of image | video | audio | pdf | web.');if(!i&&!o)return this.fail('Media_ShowMedia requires a source \u2014 provide a "url" (external/public) OR a "fileId" (an MJ: Files id).');if(i&&!gR(i))return this.fail('Media_ShowMedia "url" must be an absolute http:// or https:// URL.');if(!r)return this.fail('Media_ShowMedia requires a "displayName".');let s=this.State.AddItem({Type:t,Url:i?i.trim():void 0,FileID:o,DisplayName:r,Caption:Wa(e.caption)});return this.note(`now showing ${t} "${r}"`),JSON.stringify({success:!0,id:s.Id,active:!0})}applyCloseMedia(e){let t=Wa(e.id);return t?this.State.RemoveItem(t)?(this.note(`closed media item "${t}"`),JSON.stringify({success:!0,id:t})):this.fail(`No media item with id "${t}".`):this.fail('Media_CloseMedia requires an "id".')}applyPlayMedia(e){let t=Wa(e.id);return t?this.State.RequestPlay(t)?(this.note(`playing media item "${t}"`),JSON.stringify({success:!0,id:t})):this.fail(`No media item with id "${t}".`):this.fail('Media_PlayMedia requires an "id".')}applyHighlight(e){let t=Wa(e.id);if(!t)return this.fail('Media_Highlight requires an "id".');let i=P_(e.x),o=P_(e.y),r=P_(e.w),s=P_(e.h);if(i===void 0||o===void 0||r===void 0||s===void 0)return this.fail("Media_Highlight requires numeric fractional x, y, w, h (0..1).");let l={X:i,Y:o,W:r,H:s,Label:Wa(e.label)};return this.State.Highlight(t,l)?(this.note(`highlighted a region of media item "${t}"`),JSON.stringify({success:!0,id:t})):this.fail(`No media item with id "${t}".`)}applyClearAll(){return this.State.Clear(),this.note("cleared all media"),JSON.stringify({success:!0})}SerializeState(){return this.State.ToJSON()}RestoreState(e){return this.State.LoadFromJSON(e)}Dispose(){this.stateChangedSub?.unsubscribe(),this.stateChangedSub=null,this.surface=null,super.Dispose()}fail(e){return JSON.stringify({success:!1,error:e})}note(e){this.Context?.SendContextNote(`[media] ${e} (background context \u2014 do NOT narrate routine changes; mention only if relevant).`)}};T_=sWe([zt(Fo,"RealtimeMediaChannel")],T_);var cWe=[{key:"IdentityVerificationChannel",channelClass:j_},{key:"RealtimeWhiteboardChannel",channelClass:E_},{key:"RealtimeMediaChannel",channelClass:T_}];function vz(){let n=Bt.Instance.ClassFactory;for(let{key:e,channelClass:t}of cWe)n.GetRegistration(Fo,e)===null&&n.Register(Fo,t,e)}a(vz,"EnsureBuiltInChannelsRegistered");var dWe=[{Key:OT,async Load(){(await import("./chunks/interactive-chunk-entry-EYXXXLJN.js")).EnsureInteractiveComponentChannelRegistered()}}];function Cz(n=dWe){let e=new Map;return async t=>{let i=n.filter(s=>t.includes(s.Key)),r=(await Promise.allSettled(i.map(s=>{let l=e.get(s.Key);return l||(l=s.Load(),e.set(s.Key,l),l.catch(()=>e.delete(s.Key))),l}))).filter(s=>s.status==="rejected");if(r.length>0)throw new Error(`Could not load channel code: ${r.map(s=>s.reason instanceof Error?s.reason.message:String(s.reason)).join("; ")}`)}}a(Cz,"CreateChannelClassLoader");function bz(n){return n.launcher?"launcher":n.widgetKey?"widget-key":n.inviteToken?"invite-token":n.token?"token":"host"}a(bz,"ResolveAuthMode");var uWe=["apiUrl","widgetKey","inviteToken","token","agentId","applicationId","conversationId","channels","channelInputs","chrome","autoStart","requireConsent","theme","themeTokens","locale","agentName","cspNonce","launcher","perception","frameCapture","preload","sessionUrl"];function pWe(n){return n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}a(pWe,"AttributeNameFor");var FBt=[...uWe.filter(n=>n!=="launcher").map(pWe)];var mWe="mj_ml_",hWe="/magic-link/redeem?format=json",CR="This session has expired. Please start again or request a new link.",D_=class{static{a(this,"WidgetAuthAdapter")}apiUrl;provider;post;refresh;now;heldJwt=null;constructor(e){this.apiUrl=e.apiUrl!=null?Tf(e.apiUrl):null,this.provider=e.provider,this.post=e.post,this.refresh=e.refresh??null,this.now=e.now??(()=>Date.now())}async Hold(e){if(this.provider.isConfigured())return{held:!0,jwt:null};let t=e.startsWith(mWe)?await this.redeem(e):{jwt:e};return"failure"in t?{held:!1,failure:t.failure}:await this.provider.configure(t.jwt,()=>this.renew())?(this.heldJwt=t.jwt,{held:!0,jwt:t.jwt}):{held:!1,failure:{code:"provider-rejected",message:"The server did not accept this session. Please try again."}}}HasPrincipal(){return this.heldJwt!==null?!this.isExpired(this.heldJwt):this.provider.isConfigured()}ReadExpiry(e){let t=this.decodePayload(e);if(t===null)return null;let i=t.exp;return typeof i=="number"&&Number.isFinite(i)?i*1e3:null}async renew(){if(this.refresh===null)throw new Error(CR);let e=await this.refresh();return this.heldJwt=e,e}isExpired(e){let t=this.ReadExpiry(e);return t!==null&&t<=this.now()}decodePayload(e){let t=e.split(".")[1];if(t===void 0||t.length===0)return null;try{let i=t.replace(/-/g,"+").replace(/_/g,"/"),o=i.padEnd(i.length+(4-i.length%4)%4,"="),r=JSON.parse(this.utf8FromBase64(o));return typeof r=="object"&&r!==null?r:null}catch{return null}}utf8FromBase64(e){let t=atob(e),i=Uint8Array.from(t,o=>o.charCodeAt(0));return new TextDecoder().decode(i)}async redeem(e){if(this.apiUrl===null)return he("mj-realtime-widget: an invite token arrived but no api-url is configured, so it cannot be redeemed."),{failure:{code:"no-api-url",message:"This widget is missing its server address (api-url)."}};let t=`${this.apiUrl}${hWe}`,i;try{i=await this.post(t,{token:e})}catch(r){return he(`mj-realtime-widget: magic-link redemption could not reach ${t}: ${r instanceof Error?r.message:String(r)}`),{failure:{code:"redeem-failed",message:"We could not reach the server. Please check your connection and try again."}}}let o=this.asRedeemResponse(i.json);return!i.ok||o===null||!o.success||o.token===void 0?(he(`mj-realtime-widget: magic-link redemption failed. reason=${o?.errorCode??"unreadable-response"}, httpOk=${i.ok}, endpoint=${t}`),{failure:{code:"redeem-failed",message:fWe(o?.errorCode)}}):{jwt:o.token}}asRedeemResponse(e){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.success!="boolean"?null:{success:t.success,token:typeof t.token=="string"?t.token:void 0,errorCode:typeof t.errorCode=="string"?t.errorCode:void 0}}};function fWe(n){switch(n){case"expired":return"This invitation link has expired. Please request a new one.";case"consumed":return"This invitation link has already been used. Please request a new one.";case"revoked":return"This invitation link is no longer valid.";case"not_found":case"invalid":return"This invitation link is not valid. Please check it or request a new one.";default:return"We could not start your session from this link. Please try again or request a new one."}}a(fWe,"DescribeRedeemFailure");var ol=class extends Error{static{a(this,"WidgetKeyError")}code;status;constructor(e,t,i){super(e),this.code=t,this.status=i,this.name="WidgetKeyError"}},gWe=15*6e4,F_=class{static{a(this,"WidgetKeyClient")}widgetKey;fetchImpl;baseUrl;proofKey=null;serverOffsetMs=0;constructor(e,t,i=(o,r)=>fetch(o,r)){this.widgetKey=t,this.fetchImpl=i,this.baseUrl=Tf(e)}async Mint(){let e=await VI(),t=await this.call("/widget/session",e);return this.proofKey=e,t}async Refresh(e){if(!this.proofKey)throw new ol("A guest session refresh needs the key registered at mint; call Mint first.","no_proof_key",null);return this.call("/widget/session/refresh",this.proofKey,e)}async call(e,t,i){let o,r=`${this.baseUrl}${e}`,s={"content-type":"application/json"},l={widgetKey:this.widgetKey};i?(s.authorization=`Bearer ${i}`,s.dpop=await LI(t,{Method:"POST",Url:r,AccessToken:i,NowSeconds:Math.floor((Date.now()+this.serverOffsetMs)/1e3)})):l.proofKey=t.PublicJwk;try{o=await this.fetchImpl(r,{method:"POST",headers:s,body:JSON.stringify(l)})}catch(h){throw new ol(`Could not reach the server: ${h instanceof Error?h.message:String(h)}`,"network",null)}let c=null;try{c=await o.json()}catch{}return this.toSession(o.ok,o.status,c)}learnServerOffset(e){let t=vWe(e);t!==null&&(this.serverOffsetMs=t*1e3-Date.now())}toSession(e,t,i){let o=xz(i)?i:{},r=typeof o.errorCode=="string"?o.errorCode:null;if(!e||o.success!==!0||typeof o.token!="string"||o.token.length===0)throw new ol(CWe(r,t),r??"mint_failed",t);let s=bR(o,"widgetId"),l=bR(o,"applicationId"),c=bR(o,"pinnedAgentId");if(!s||!l||!c)throw new ol("The server answered with an incomplete widget session.","incomplete_session",t);this.learnServerOffset(o.token);let h=typeof o.expiresAt=="string"?Date.parse(o.expiresAt)-this.serverOffsetMs:Number.NaN,f=o.voiceMaxSessionMinutes,v=o.modality;return{token:o.token,expiresAtMs:Number.isFinite(h)?h:Date.now()+gWe,widgetId:s,applicationId:l,pinnedAgentId:c,modality:v==="Voice"||v==="Both"?v:"Text",voiceMaxSessionMinutes:typeof f=="number"&&Number.isFinite(f)&&f>0?f:null,enabledChannels:Array.isArray(o.enabledChannels)?o.enabledChannels.filter(C=>typeof C=="string"):[]}}};function xz(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}a(xz,"isRecord");function vWe(n){let e=n.split(".")[1];if(!e)return null;try{let t=e.replace(/-/g,"+").replace(/_/g,"/"),i=JSON.parse(atob(t+"=".repeat((4-t.length%4)%4))),o=xz(i)?i.iat:void 0;return typeof o=="number"&&Number.isFinite(o)?o:null}catch{return null}}a(vWe,"readIssuedAtSeconds");function bR(n,e){let t=n[e];return typeof t=="string"&&t.length>0?t:null}a(bR,"stringField");function CWe(n,e){return n==="rate_limited"||e===429?"Too many attempts. Please wait a moment and try again.":n==="server_error"||e>=500?"The server had a problem starting your session. Please try again.":"This widget is not available here. If you think that is a mistake, please contact the site owner."}a(CWe,"DescribeMintFailure");function bWe(n){switch(n){case"on":return"pixels";case"off":return"state";case"ask":return}}a(bWe,"ExposureForPerception");function yz(n){return{sourceId:n.SourceID,label:n.Label,channel:n.ChannelKey??null,enabled:n.Enabled,active:n.Active}}a(yz,"ToPerceptionSource");function xWe(n,e){let t=new Map(n.map(i=>[i.SourceID,i.Enabled]));return e.filter(i=>t.has(i.SourceID)&&t.get(i.SourceID)!==i.Enabled)}a(xWe,"FindPerceptionToggles");var xR=class{static{a(this,"WidgetExposurePreferences")}inner;mode;explicit=new Map;applying=!1;constructor(e,t){this.inner=e,this.mode=t}Get(e){let t=e.trim().toLowerCase();if(this.explicit.has(t))return this.explicit.get(t);let i=bWe(this.mode());return i!==void 0?i:this.inner.Get(e)}Set(e,t){this.applying||(this.explicit.set(e.trim().toLowerCase(),t),this.inner.Set(e,t))}ForgetChoices(){this.explicit.clear()}WhileApplying(e){this.applying=!0;try{e()}finally{this.applying=!1}}},O_=class{static{a(this,"PerceptionBridge")}runtime;emit;mode="ask";installed=null;original=null;sourcesSub=null;lastSources=[];constructor(e,t){this.runtime=e,this.emit=t}Apply(e){let t=e!==this.mode;if(this.mode=e,this.installed===null&&e==="ask")return;let i=this.ensureInstalled();t&&(i.ForgetChoices(),this.pushIntoLiveChannels(i))}Start(){this.Stop(),this.lastSources=[],this.sourcesSub=this.runtime.VideoSources$.subscribe(e=>{for(let t of xWe(this.lastSources,e))this.emit({name:"mj-perception-changed",detail:{...yz(t),sources:e.map(yz)}});this.lastSources=e})}Stop(){this.sourcesSub?.unsubscribe(),this.sourcesSub=null,this.lastSources=[]}Dispose(){this.Stop(),this.installed!==null&&this.original!==null&&this.runtime.SetExposurePreferences(this.original),this.installed=null,this.original=null}ensureInstalled(){return this.installed===null&&(this.original=this.runtime.ExposurePreferences,this.installed=new xR(this.original,()=>this.mode),this.runtime.SetExposurePreferences(this.installed)),this.installed}pushIntoLiveChannels(e){let t=[...this.runtime.ActiveChannels,...this.runtime.AdvertisedChannels].map(i=>i.ChannelName);e.WhileApplying(()=>{for(let i of t)this.runtime.SetUserChannelExposure(i,e.Get(i))})}};var yWe=a(async()=>(await import("./chunks/frame-capture-chunk-entry-EFFSSPQW.js")).EnableFrameCapture(),"DefaultFrameCaptureEnabler"),wz=!1;function wWe(n){wz||(wz=!0,console.warn(`[mj-realtime-widget] frame-capture is on, but the component rasterizer could not be enabled (${n}), so the agent receives component state only.`))}a(wWe,"warnUnavailable");var A_=class{static{a(this,"FrameCaptureHook")}enabler;enabled=!1;pending=null;dispose=null;constructor(e=yWe){this.enabler=e}Apply(e){e!==this.enabled&&(this.enabled=e,e?this.pending=this.enable():this.disable())}async Ready(){return this.enabled&&this.pending?this.pending:!1}Dispose(){this.enabled=!1,this.disable()}async enable(){if(C1.Instance.Capturer!==null)return!0;try{let e=await this.enabler();return this.enabled?(this.dispose=e,C1.Instance.Capturer!==null):(e(),!1)}catch(e){return wWe(e instanceof Error?e.message:String(e)),!1}}async disable(){let e=this.pending;this.pending=null,await e,!this.enabled&&this.dispose&&(this.dispose(),this.dispose=null)}};var _We={IdentityVerification:"IdentityVerificationChannel",Whiteboard:"RealtimeWhiteboardChannel",Media:"RealtimeMediaChannel",InteractiveComponent:"RealtimeInteractiveComponentChannel",RemoteBrowser:"RealtimeRemoteBrowserChannel",ClientContext:"ClientContextChannel"},SWe=new Set(["booting","connecting"]),jWe=new Set(["ended","error"]),kWe={explicit:"remote",error:"error",deadline:"deadline"},yR="The connection was interrupted. Please try again.",MWe="The call could not be started. Please try again, or reload the page if it keeps happening.";function _z(n){return n===null?yR:n.name==="NotAllowedError"||/permission|denied|not allowed/i.test(n.message)?"Microphone access was blocked. Allow the microphone for this site in your browser, then try again.":n.name==="NotFoundError"||/requested device not found/i.test(n.message)?"No microphone was found. Connect one and try again.":n.message.length>0?n.message:yR}a(_z,"DescribeStartError");var Po=class extends Error{static{a(this,"LaunchFailure")}code;constructor(e,t){super(e),this.code=t}},N_=class{static{a(this,"WidgetController")}deps;config;now;eventsSubject=new pe;phaseSubject=new pe;surfaceOpenSubject=new nn(!1);subs=new Zi;channelSubs=new Map;registeredChannels=new Map;phase="idle";errorMessage="";auth=null;store=null;guest=null;guestSource=null;disposed=!1;launchGeneration=0;endReason=null;readyAnnounced=!1;liveSessionConversationId=null;sawLive=!1;started=!1;ownsRuntimeCall=!1;sawOwnState=!1;connectionSub=null;perception;frameCapture=new A_;constructor(e,t){this.deps=e,this.config=t,this.now=e.now??(()=>Date.now()),this.perception=new O_(e.runtime,i=>this.emit(i)),this.applyPageSettings(),this.wireRuntimeStreams()}get Events$(){return this.eventsSubject.asObservable()}get Phase$(){return this.phaseSubject.asObservable()}get Phase(){return this.phase}get SurfaceChannelOpen$(){return this.surfaceOpenSubject.asObservable()}get ErrorMessage(){return this.errorMessage}get Config(){return this.config}get Mode(){return bz(this.config)}Configure(e){this.config=e,this.applyPageSettings()}applyPageSettings(){this.perception.Apply(this.config.perception),this.frameCapture.Apply(this.config.frameCapture)}Ready(){this.readyAnnounced||this.disposed||(this.readyAnnounced=!0,queueMicrotask(()=>{this.disposed||(this.emit({name:"mj-ready",detail:{mode:this.Mode,autoStart:this.config.autoStart}}),this.config.autoStart&&this.Start())}))}async Start(){if(!(this.disposed||!["idle","ended","error","consent"].includes(this.phase))){if(this.config.requireConsent){this.setPhase("consent");return}await this.launch(!1)}}async AcceptConsent(e){this.phase==="consent"&&await this.launch(e)}DeclineConsent(){this.phase==="consent"&&this.setPhase("idle")}async End(e="user"){this.launchGeneration++,this.endReason??=e;try{await this.endOwnRuntimeCall()}catch(t){console.error("[mj-realtime-widget] Ending the session failed:",t)}(this.phase==="consent"||this.phase==="booting"||this.phase==="connecting")&&(this.setPhase("idle"),this.endReason=null)}NotifyOverlayEnded(){this.endReason??="user"}OnPageHide(e){return!e&&this.deps.pageClose.IsArmed&&(this.endReason??="page-close"),this.deps.pageClose.OnPageHide(e)}Dispose(){if(!this.disposed){this.disposed=!0,this.launchGeneration++,this.deps.pageClose.IsArmed&&this.deps.pageClose.OnHostTeardown(),this.connectionSub?.unsubscribe(),this.subs.unsubscribe(),this.perception.Dispose(),this.frameCapture.Dispose();for(let e of this.channelSubs.values())e.unsubscribe();this.channelSubs.clear(),this.endOwnRuntimeCall().catch(e=>{console.error("[mj-realtime-widget] Ending the session on removal failed:",e)}),this.eventsSubject.complete(),this.phaseSubject.complete(),this.surfaceOpenSubject.complete()}}RegisterChannel(e){let t=new e().ChannelName;if(t.trim().length===0)throw new Error("registerChannel: the channel class has no ChannelName.");this.registeredChannels.set(t.toLowerCase(),e)}async OpenChannel(e,t={}){if(!this.deps.runtime.IsActive)return{success:!1,error:"There is no live call to open a channel in.",errorCode:"no_session"};let i=await this.deps.runtime.OpenChannel(e,t);return i.Success?{success:!0,result:i.Result}:{success:!1,error:i.ErrorMessage??"The channel could not be opened.",errorCode:i.ErrorCode}}SendContextNote(e){this.deps.runtime.SendContextNote(e)}RequestSpokenResponse(e){return this.deps.runtime.RequestSpokenOpening(e)}GetChannelDescriptors(){return[...this.deps.runtime.ActiveChannels,...this.deps.runtime.AdvertisedChannels].map(e=>e.GetDescriptor())}async launch(e){let t=++this.launchGeneration;this.resetLaunchState();try{this.setPhase("booting");let i=await this.prepareSession();if(this.isAbandoned(t))return;this.setPhase("connecting"),await this.startRuntimeSession(i,e,t)}catch(i){if(this.isAbandoned(t)){await this.endAbandonedSession();return}this.fail(i instanceof Po?i.code:"start-failed",i instanceof Error?i.message:"The call could not be started.")}}resetLaunchState(){this.endReason=null,this.errorMessage="",this.sawLive=!1,this.started=!1,this.ownsRuntimeCall=!1,this.sawOwnState=!1,this.guest=null}isAbandoned(e){return this.disposed||e!==this.launchGeneration}async prepareSession(){let e=this.Mode,t=this.config,i=`${t.apiUrl??""}|${t.widgetKey??t.agentId??""}`;return this.store=this.deps.createResumeStore(i),e==="host"||e==="launcher"&&!t.token&&!t.inviteToken?this.prepareWithoutCredential(e):e==="widget-key"?this.prepareGuestSession():this.prepareWithCredential(e)}prepareWithoutCredential(e){let t=this.config.agentId??"";if(e==="host"&&t.length===0)throw new Po("No agent was specified. Set the agent-id attribute.","no-agent");if(e==="host"&&this.config.launcher===null&&(this.auth=this.deps.createAuth(this.config.apiUrl,null),!this.auth.HasPrincipal()))throw new Po("No credential was supplied. Set widget-key, invite-token or token, or run inside an authenticated MemberJunction page.","no-credential");return{agentId:t,applicationId:this.config.applicationId,deadline:null,guestChannels:[]}}async prepareGuestSession(){let{apiUrl:e,widgetKey:t}=this.config;if(!e||!t)throw new Po("A widget-key needs the api-url of the server that issued it.","no-credential");this.guestSource=this.deps.createGuestSessions(e,t);let i=await this.mintGuest(this.guestSource,"Mint");if(i.modality==="Text")throw new Po("This widget is not enabled for voice.","voice-not-enabled");this.guest=i,this.auth=this.deps.createAuth(e,()=>this.renewGuestToken()),await this.holdOrFail(this.auth,i.token),this.config.agentId&&this.config.agentId!==i.pinnedAgentId&&console.warn(`[mj-realtime-widget] agent-id "${this.config.agentId}" ignored: this widget key pins agent "${i.pinnedAgentId}".`);let o=i.voiceMaxSessionMinutes?new Date(this.now()+i.voiceMaxSessionMinutes*6e4):null;return{agentId:i.pinnedAgentId,applicationId:i.applicationId,deadline:o,guestChannels:i.enabledChannels}}async mintGuest(e,t,i){try{return t==="Refresh"?await e.Refresh(i??""):await e.Mint()}catch(o){throw o instanceof ol?new Po(o.message,"auth-failed"):o}}async renewGuestToken(){if(this.guestSource===null||this.guest===null)throw new Error(CR);let e=await this.mintGuest(this.guestSource,"Refresh",this.guest.token);return this.guest=e,e.token}async prepareWithCredential(e){let t=this.config,i=t.agentId??"";if(i.length===0&&e!=="launcher")throw new Po("No agent was specified. Set the agent-id attribute.","no-agent");this.auth=this.deps.createAuth(t.apiUrl,null);let o=this.store?.ReadJwt()??t.token??t.inviteToken;if(o==null)throw new Po("No credential was supplied.","no-credential");let r=await this.holdOrFail(this.auth,o);return r!==null&&this.store?.WriteJwt(r,this.auth.ReadExpiry(r)),{agentId:i,applicationId:t.applicationId,deadline:null,guestChannels:[]}}async holdOrFail(e,t){let i=await e.Hold(t);if(!i.held)throw new Po(i.failure.message,"auth-failed");return i.jwt}async startRuntimeSession(e,t,i){let o=this.deps.runtime;this.config.launcher&&(o.Launcher=this.config.launcher),this.deps.loadChannelClasses&&(o.ChannelClassLoader=this.deps.loadChannelClasses),await this.frameCapture.Ready(),this.perception.Start(),this.wireConnectionState();let r=this.store?.Read()?.lastSessionId??null;this.started=!0,this.ownsRuntimeCall=!0;try{await o.StartRealtimeSession(e.agentId,this.config.conversationId,r,this.config.agentName,null,null,null,null,t,null,e.applicationId,null,{HostChannels:this.buildHostChannels(e.guestChannels),SessionDeadline:e.deadline})}catch(s){throw new Po(_z(s instanceof Error?s:null),this.config.launcher?"launcher-failed":"start-failed")}if(this.isAbandoned(i)){await this.endAbandonedSession();return}if(!this.sawOwnState)throw new Po(MWe,"start-dropped");this.openSeededChannels()}buildHostChannels(e){let t=new Map;for(let i of[...this.config.channels??[],...e]){let o=i.toLowerCase(),r=this.registeredChannels.get(o);t.set(o,r?{Create:a(()=>new r,"Create")}:{ClientPluginClass:_We[i]??i})}for(let[i,o]of this.registeredChannels)t.has(i)||t.set(i,{Create:a(()=>new o,"Create")});return[...t.values()]}openSeededChannels(){for(let[e,t]of Object.entries(this.config.channelInputs))this.OpenChannel(e,t).then(i=>{i.success||this.emitError("channel-failed",`Could not open the ${e} channel: ${i.error??"unknown error"}`)})}async endAbandonedSession(){try{await this.deps.runtime.EndRealtimeSession()}catch(e){console.error("[mj-realtime-widget] An abandoned launch could not close the session it opened:",e)}}wireRuntimeStreams(){let e=this.deps.runtime;this.subs.add(e.SessionStarted$.subscribe(t=>this.onSessionStarted(t.sessionId,t.channelNames))),this.subs.add(e.SessionEnded$.subscribe(t=>this.onSessionEnded(t.sessionId,t.reason))),this.subs.add(e.SessionEvents$.subscribe(t=>this.onSessionEvent(t))),this.subs.add(e.ActiveChannels$.subscribe(t=>this.syncChannelSubscriptions(t)))}onSessionStarted(e,t){this.liveSessionConversationId=this.config.conversationId,this.deps.pageClose.Arm(e),this.store?.WriteSession(e,this.liveSessionConversationId),this.emit({name:"mj-session-started",detail:{sessionId:e,agentId:this.config.agentId,conversationId:this.liveSessionConversationId,channels:t}})}onSessionEnded(e,t){this.deps.pageClose.Disarm(),this.surfaceOpenSubject.next(!1);let i=this.endReason??kWe[t];this.emit({name:"mj-session-ended",detail:{sessionId:e,reason:i}})}onSessionEvent(e){if(this.emit({name:"mj-session-event",detail:{type:e.Type,sessionId:e.AgentSessionID,occurredAt:e.OccurredAt,payload:e.Payload}}),e.Type==="identity.verified"&&Yf(e.Payload)){let t=e.Payload;this.emit({name:"mj-verified",detail:{sessionId:e.AgentSessionID,email:t.VerifiedEmail,name:t.VerifiedName,verifiedAt:t.VerifiedAt,method:t.Method,...t.MaxSessionDeadlineIso?{maxSessionDeadline:t.MaxSessionDeadlineIso}:{},recovered:t.Recovered===!0}})}}syncChannelSubscriptions(e){for(let[t,i]of this.channelSubs)e.includes(t)||(i.unsubscribe(),this.channelSubs.delete(t));for(let t of e)this.channelSubs.has(t)||this.channelSubs.set(t,this.subscribeChannel(t))}subscribeChannel(e){let t=new Zi;return t.add(e.Events$.subscribe(i=>{if(i.Name==="opened"){e.HasSurface()&&this.surfaceOpenSubject.next(!0);let o=i.Payload.inputs??{};this.emit({name:"mj-channel-opened",detail:{channel:i.Channel,instance:i.Instance,inputs:o}})}this.emit({name:"mj-channel-event",detail:{channel:i.Channel,instance:i.Instance,name:i.Name,payload:i.Payload,...i.ChangeId!==void 0?{changeId:i.ChangeId}:{},occurredAt:i.OccurredAt}})})),t.add(e.Output$.subscribe(i=>this.emit({name:"mj-channel-output",detail:{channel:i.Channel,instance:i.Instance,output:i.Output,occurredAt:i.OccurredAt}}))),t}wireConnectionState(){this.connectionSub?.unsubscribe(),this.connectionSub=this.deps.runtime.ConnectionState$.subscribe(e=>this.applyConnectionState(e))}applyConnectionState(e){if(this.started&&(this.sawOwnState=!0,!jWe.has(this.phase)))switch(e){case"connecting":SWe.has(this.phase)&&this.setPhase("connecting");break;case"listening":case"speaking":case"thinking":this.sawLive=!0,this.setPhase("live");break;case"error":{let t=this.sawLive?Qf(this.deps.runtime.LastSessionError):null;if(t){this.fail("time-limit",t.Message);break}this.fail(this.sawLive?"connection-lost":this.config.launcher?"launcher-failed":"start-failed",this.sawLive?yR:_z(this.deps.runtime.LastStartError));break}case"closed":this.sawLive&&this.setPhase("ended");break}}async endOwnRuntimeCall(){this.ownsRuntimeCall&&(this.ownsRuntimeCall=!1,await this.deps.runtime.EndRealtimeSession())}setPhase(e){if(e===this.phase)return;(e==="ended"||e==="error")&&(this.ownsRuntimeCall=!1,this.perception.Stop());let t=this.phase;this.phase=e,this.phaseSubject.next(e),this.emit({name:"mj-phase-changed",detail:{phase:e,previous:t}})}fail(e,t){this.phase!=="error"&&(this.errorMessage=t,this.setPhase("error"),this.emitError(e,t))}emitError(e,t){this.emit({name:"mj-error",detail:{code:e,message:t,phase:this.phase}})}emit(e){this.disposed||this.eventsSubject.next(e)}};function EWe(n){return n.replace(/^http/,"ws")}a(EWe,"toWebSocketUrl");var RWe=a(async(n,e)=>{let t=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),i=await t.json().catch(()=>null);return{ok:t.ok,json:i}},"browserPost");function IWe(n){return{isConfigured(){try{return(Jn.Instance?.ConfigData?.Token??"").length>0}catch{return!1}},async configure(e,t){if(n===null)return he("mj-realtime-widget: cannot authenticate \u2014 no api-url was supplied and no host application has configured the GraphQL provider."),!1;try{let i=new FP(e,n,EWe(n),t);return await OP(i),!0}catch(i){return he(`mj-realtime-widget: failed to configure the GraphQL provider: ${i instanceof Error?i.message:String(i)}`),!1}}}}a(IWe,"graphQLProvider");function Sz(n,e){return new D_({apiUrl:n,provider:IWe(n),post:RWe,refresh:e})}a(Sz,"CreateBrowserWidgetAuth");var V_=class{static{a(this,"WidgetPageClose")}deps;agentSessionId=null;constructor(e){this.deps=e}Arm(e){this.agentSessionId=e}Disarm(){this.agentSessionId=null}get IsArmed(){return this.agentSessionId!==null}OnPageHide(e){return e?!1:this.closeNow()}OnHostTeardown(){return this.closeNow()}closeNow(){let e=this.agentSessionId;if(e===null)return!1;let t=this.deps.config();return t===null?!1:(this.agentSessionId=null,this.deps.send(t.url,t.token,e),!0)}};var PWe=`
33983
33983
  mutation CloseAgentSession($agentSessionId: String!) {
33984
33984
  CloseAgentSession(agentSessionId: $agentSessionId)
33985
33985
  }`;function TWe(){try{let n=Jn.Instance?.ConfigData,e=n?.URL??"",t=n?.Token??"";return e.length>0&&t.length>0?{url:e,token:t}:null}catch{return null}}a(TWe,"liveConfig");function DWe(n,e,t){fetch(n,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},body:JSON.stringify({query:PWe,variables:{agentSessionId:t}})}).catch(()=>{})}a(DWe,"keepaliveSend");function jz(){return new V_({config:TWe,send:DWe})}a(jz,"CreateBrowserPageClose");var FWe="mj.realtimeWidget.resume.v1:";function OWe(){try{return typeof sessionStorage<"u"?sessionStorage:null}catch{return null}}a(OWe,"BrowserSessionStorage");var L_=class{static{a(this,"WidgetResumeStore")}storage;now;storageKey;constructor(e,t=OWe(),i=()=>Date.now()){this.storage=t,this.now=i,this.storageKey=`${FWe}${e}`}Read(){if(!this.storage)return null;let e;try{e=this.storage.getItem(this.storageKey)}catch{return null}if(e===null)return null;let t=AWe(e);return t===null||this.now()-t.savedAtMs>864e5?(this.Clear(),null):this.dropExpiredJwt(t)}ReadJwt(){return this.Read()?.jwt??null}WriteJwt(e,t){this.write({...this.base(),jwt:e,jwtExpiresAtMs:t})}WriteSession(e,t){this.write({...this.base(),lastSessionId:e,conversationId:t})}Clear(){try{this.storage?.removeItem(this.storageKey)}catch{}}base(){return this.Read()??{jwt:null,jwtExpiresAtMs:null,lastSessionId:null,conversationId:null,savedAtMs:this.now()}}write(e){if(this.storage)try{this.storage.setItem(this.storageKey,JSON.stringify({...e,savedAtMs:this.now()}))}catch(t){console.warn("[mj-realtime-widget] Could not remember this session for a reload:",t)}}dropExpiredJwt(e){return e.jwt!==null&&e.jwtExpiresAtMs!==null&&e.jwtExpiresAtMs<=this.now()?{...e,jwt:null,jwtExpiresAtMs:null}:e}};function AWe(n){let e;try{e=JSON.parse(n)}catch{return null}if(typeof e!="object"||e===null)return null;let t=e,i=t.savedAtMs;if(typeof i!="number"||!Number.isFinite(i))return null;let o=a(s=>typeof t[s]=="string"&&t[s].length>0?t[s]:null,"text"),r=t.jwtExpiresAtMs;return{jwt:o("jwt"),jwtExpiresAtMs:typeof r=="number"&&Number.isFinite(r)?r:null,lastSessionId:o("lastSessionId"),conversationId:o("conversationId"),savedAtMs:i}}a(AWe,"parseBundle");function kz(){return{createAuth:a((n,e)=>Sz(n,e),"createAuth"),createGuestSessions:a((n,e)=>new F_(n,e),"createGuestSessions"),createResumeStore:a(n=>new L_(n),"createResumeStore"),pageClose:jz()}}a(kz,"DefaultRealtimeWidgetPorts");var F7t=1;vz();var bf=null,Mz=null;function NWe(n){return bf===null&&(bf=N1({providers:[gI(),...n?[{provide:bp,useValue:n}]:[]]}),bf.catch(()=>{bf=null})),bf}a(NWe,"GetApplication");function VWe(n){Mz===null&&(Mz=la(y_,{environmentInjector:n.injector}))}a(VWe,"EnsureGlobalStyles");function LWe(n,e){return n==="auto"&&e?"console":n}a(LWe,"EffectiveChrome");var wR=class{static{a(this,"WidgetSession")}app;controller;config;overlay=null;overlayHost=null;overlaySubs=[];surfaceOpen=!1;constructor(e,t,i){this.app=e,this.controller=t,this.config=i}get ErrorMessage(){return this.controller.ErrorMessage}get Phase$(){return this.controller.Phase$}get Events$(){return this.controller.Events$}Configure(e){this.config=e,this.controller.Configure(e),this.applyOverlayInputs()}Start(){return this.controller.Start()}End(){return this.controller.End("user")}OpenChannel(e,t){return this.controller.OpenChannel(e,t)}SendContextNote(e){this.controller.SendContextNote(e)}RequestSpokenResponse(e){return this.controller.RequestSpokenResponse(e)}RegisterChannel(e){this.controller.RegisterChannel(e)}OnPageHide(e){this.controller.OnPageHide(e)}MountOverlay(e){this.overlay!==null&&this.overlayHost===e||(this.UnmountOverlay(),this.app.injector.get(wt).run(()=>{let t=la(x_,{environmentInjector:this.app.injector,hostElement:e});this.overlay=t,this.overlayHost=e,this.applyOverlayInputs(),this.overlaySubs.push(t.instance.Ended.subscribe(()=>this.controller.NotifyOverlayEnded()),this.controller.SurfaceChannelOpen$.subscribe(i=>{this.surfaceOpen=i,this.applyOverlayInputs()})),this.app.attachView(t.hostView),t.changeDetectorRef.detectChanges()}))}UnmountOverlay(){for(let e of this.overlaySubs.splice(0))e.unsubscribe();if(this.overlay!==null){let e=this.overlay;this.overlay=null,this.overlayHost=null,this.app.detachView(e.hostView),e.destroy()}}Dispose(){this.UnmountOverlay(),this.controller.Dispose()}applyOverlayInputs(){this.overlay!==null&&this.app.injector.get(wt).run(()=>{this.overlay?.setInput("AgentName",this.config.agentName),this.overlay?.setInput("Chrome",LWe(this.config.chrome,this.surfaceOpen))})}};async function O7t(n){let e=await NWe(n.Nonce);VWe(e);let t=e.injector.get(ps),i=new N_({runtime:t,...kz(),loadChannelClasses:Cz()},n.Config);return new wR(e,i,n.Config)}a(O7t,"CreateWidgetSession");export{O7t as CreateWidgetSession,LWe as EffectiveChrome,F7t as SESSION_CONTRACT_VERSION};