@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.
- package/dist/element/chunks/{chunk-YES54RPF.js → chunk-FS5E33YU.js} +5 -5
- package/dist/element/chunks/{chunk-FDR3HREB.js → chunk-IYFE6AC7.js} +2 -2
- package/dist/element/chunks/{chunk-FDR3HREB.js.map → chunk-IYFE6AC7.js.map} +2 -2
- package/dist/element/chunks/{dist-4BLL2YRV.js → dist-6QB6LKFP.js} +2 -2
- package/dist/element/chunks/{interactive-chunk-entry-WGFKDSQQ.js → interactive-chunk-entry-EYXXXLJN.js} +2 -2
- package/dist/element/meta.json +1 -1
- package/dist/element/mj-realtime-widget-session.js +3 -3
- package/dist/element/sizes.json +10 -10
- package/package.json +13 -13
- /package/dist/element/chunks/{chunk-YES54RPF.js.map → chunk-FS5E33YU.js.map} +0 -0
- /package/dist/element/chunks/{dist-4BLL2YRV.js.map → dist-6QB6LKFP.js.map} +0 -0
- /package/dist/element/chunks/{interactive-chunk-entry-WGFKDSQQ.js.map → interactive-chunk-entry-EYXXXLJN.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$a as h_,Aa as jI,Ba as YI,Ca as XI,D as ht,Da as QI,Ea as ZI,F as OI,Fa as e_,Ga as t_,H as UI,Ha as Kh,Ia as yc,Ja as n_,Ka as r_,La as o_,Ma as vi,Oa as Cc,Pa as i_,Qa as Si,Ra as s_,Sa as a_,Ta as vc,Ua as l_,Va as Sc,Wa as c_,Xa as Ct,Ya as u_,Za as d_,_a as f_,_b as y_,ab as p_,b as kI,bb as m_,c as LI,db as g_,f as FI,ia as Io,ja as pc,ka as VI,la as $I,ma as mc,na as BI,oa as GI,pa as HI,qa as qI,ra as gc,sa as zI,ta as WI,u as zh,ua as KI,ub as Jh,va as Rr,wa as ra,x as Tn,xa as JI,ya as oa,za as Wh}from"./chunk-FDR3HREB.js";import{Bd as Eo,De as AI,Ed as wI,Ee as RI,Mf as MI,Nf as bI,Rf as NI,Tf as PI,Uf as xI,Xa as ft,Ya as Be,na as Kn,o as B,s as yt,t as _n,yb as qh}from"./chunk-ZQVZ37WB.js";import{Aa as Hh,E as Vh,O as II,Oa as dt,Q as vo,Qa as Z,S as So,T as Qe,a as yi,aa as Ci,b as vI,c as fe,d as he,ga as Ar,ha as L,i as SI,ia as N,j as na,ja as $h,ka as Bh,oa as _I,q as EI,qa as TI,wa as DI,za as Gh}from"./chunk-AHHY6OJ6.js";import{a,d as hc,g as OF}from"./chunk-UVYWEABP.js";var aN=hc((sne,sN)=>{function en(n,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(n)),this._timeouts=n,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}a(en,"RetryOperation");sN.exports=en;en.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};en.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};en.prototype.retry=function(n){if(this._timeout&&clearTimeout(this._timeout),!n)return!1;var e=new Date().getTime();if(n&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(n),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(n);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},t),this._options.unref&&this._timer.unref(),!0};en.prototype.attempt=function(n,e){this._fn=n,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};en.prototype.try=function(n){console.log("Using RetryOperation.try() is deprecated"),this.attempt(n)};en.prototype.start=function(n){console.log("Using RetryOperation.start() is deprecated"),this.attempt(n)};en.prototype.start=en.prototype.try;en.prototype.errors=function(){return this._errors};en.prototype.attempts=function(){return this._attempts};en.prototype.mainError=function(){if(this._errors.length===0)return null;for(var n={},e=null,t=0,r=0;r<this._errors.length;r++){var o=this._errors[r],i=o.message,s=(n[i]||0)+1;n[i]=s,s>=t&&(e=o,t=s)}return e}});var lN=hc(fi=>{var Uq=aN();fi.operation=function(n){var e=fi.timeouts(n);return new Uq(e,{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})};fi.timeouts=function(n){if(n instanceof Array)return[].concat(n);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in n)e[t]=n[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],o=0;o<e.retries;o++)r.push(this.createTimeout(o,e));return n&&n.forever&&!r.length&&r.push(this.createTimeout(o,e)),r.sort(function(i,s){return i-s}),r};fi.createTimeout=function(n,e){var t=e.randomize?Math.random()+1:1,r=Math.round(t*Math.max(e.minTimeout,1)*Math.pow(e.factor,n));return r=Math.min(r,e.maxTimeout),r};fi.wrap=function(n,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var r in n)typeof n[r]=="function"&&t.push(r)}for(var o=0;o<t.length;o++){var i=t[o],s=n[i];n[i]=a(function(c){var u=fi.operation(e),f=Array.prototype.slice.call(arguments,1),p=f.pop();f.push(function(m){u.retry(m)||(m&&(arguments[0]=u.mainError()),p.apply(this,arguments))}),u.attempt(function(){c.apply(n,f)})},"retryWrapper").bind(n,s),n[i].options=e}}});var uN=hc((une,cN)=>{cN.exports=lN()});var fN=hc((dne,hf)=>{"use strict";var Vq=uN(),$q=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"],ff=class extends Error{static{a(this,"AbortError")}constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}},Bq=a((n,e,t)=>{let r=t.retries-(e-1);return n.attemptNumber=e,n.retriesLeft=r,n},"decorateErrorWithCounts"),Gq=a(n=>$q.includes(n),"isNetworkError"),dN=a((n,e)=>new Promise((t,r)=>{e={onFailedAttempt:a(()=>{},"onFailedAttempt"),retries:10,...e};let o=Vq.operation(e);o.attempt(async i=>{try{t(await n(i))}catch(s){if(!(s instanceof Error)){r(new TypeError(`Non-error was thrown: "${s}". You should only throw errors.`));return}if(s instanceof ff)o.stop(),r(s.originalError);else if(s instanceof TypeError&&!Gq(s.message))o.stop(),r(s);else{Bq(s,i,e);try{await e.onFailedAttempt(s)}catch(l){r(l);return}o.retry(s)||r(o.mainError())}}})}),"pRetry");hf.exports=dN;hf.exports.default=dN;hf.exports.AbortError=ff});var pt=null,Ec=!1,jh=1,UF=null,He=Symbol("SIGNAL");function V(n){let e=pt;return pt=n,e}a(V,"setActiveConsumer");function Ic(){return pt}a(Ic,"getActiveConsumer");var Mr={version:0,lastCleanEpoch:0,dirty:!1,producers:void 0,producersTail:void 0,consumers:void 0,consumersTail:void 0,recomputing:!1,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,kind:"unknown",producerMustRecompute:a(()=>!1,"producerMustRecompute"),producerRecomputeValue:a(()=>{},"producerRecomputeValue"),consumerMarkedDirty:a(()=>{},"consumerMarkedDirty"),consumerOnSignalRead:a(()=>{},"consumerOnSignalRead")};function Jn(n){if(Ec)throw new Error("");if(pt===null)return;pt.consumerOnSignalRead(n);let e=pt.producersTail;if(e!==void 0&&e.producer===n)return;let t,r=pt.recomputing;if(r&&(t=e!==void 0?e.nextProducer:pt.producers,t!==void 0&&t.producer===n)){pt.producersTail=t,t.lastReadVersion=n.version;return}let o=n.consumersTail;if(o!==void 0&&o.consumer===pt&&(!r||$F(o,pt)))return;let i=_i(pt),s={producer:n,consumer:pt,nextProducer:t,prevConsumer:o,lastReadVersion:n.version,nextConsumer:void 0};pt.producersTail=s,e!==void 0?e.nextProducer=s:pt.producers=s,i&&E_(n,s)}a(Jn,"producerAccessed");function C_(){jh++}a(C_,"producerIncrementEpoch");function Do(n){if(!(_i(n)&&!n.dirty)&&!(!n.dirty&&n.lastCleanEpoch===jh)){if(!n.producerMustRecompute(n)&&!Ii(n)){Ei(n);return}n.producerRecomputeValue(n),Ei(n)}}a(Do,"producerUpdateValueVersion");function Yh(n){if(n.consumers===void 0)return;let e=Ec;Ec=!0;try{for(let t=n.consumers;t!==void 0;t=t.nextConsumer){let r=t.consumer;r.dirty||VF(r)}}finally{Ec=e}}a(Yh,"producerNotifyConsumers");function Xh(){return pt?.consumerAllowSignalWrites!==!1}a(Xh,"producerUpdatesAllowed");function VF(n){n.dirty=!0,Yh(n),n.consumerMarkedDirty?.(n)}a(VF,"consumerMarkDirty");function Ei(n){n.dirty=!1,n.lastCleanEpoch=jh}a(Ei,"producerMarkClean");function jn(n){return n&&v_(n),V(n)}a(jn,"consumerBeforeComputation");function v_(n){n.producersTail=void 0,n.recomputing=!0}a(v_,"resetConsumerBeforeComputation");function br(n,e){V(e),n&&S_(n)}a(br,"consumerAfterComputation");function S_(n){n.recomputing=!1;let e=n.producersTail,t=e!==void 0?e.nextProducer:n.producers;if(t!==void 0){if(_i(n))do t=Qh(t);while(t!==void 0);e!==void 0?e.nextProducer=void 0:n.producers=void 0}}a(S_,"finalizeConsumerAfterComputation");function Ii(n){for(let e=n.producers;e!==void 0;e=e.nextProducer){let t=e.producer,r=e.lastReadVersion;if(r!==t.version||(Do(t),r!==t.version))return!0}return!1}a(Ii,"consumerPollProducersForChange");function Nr(n){if(_i(n)){let e=n.producers;for(;e!==void 0;)e=Qh(e)}n.producers=void 0,n.producersTail=void 0,n.consumers=void 0,n.consumersTail=void 0}a(Nr,"consumerDestroy");function E_(n,e){let t=n.consumersTail,r=_i(n);if(t!==void 0?(e.nextConsumer=t.nextConsumer,t.nextConsumer=e):(e.nextConsumer=void 0,n.consumers=e),e.prevConsumer=t,n.consumersTail=e,!r)for(let o=n.producers;o!==void 0;o=o.nextProducer)E_(o.producer,o)}a(E_,"producerAddLiveConsumer");function Qh(n){let e=n.producer,t=n.nextProducer,r=n.nextConsumer,o=n.prevConsumer;if(n.nextConsumer=void 0,n.prevConsumer=void 0,r!==void 0?r.prevConsumer=o:e.consumersTail=o,o!==void 0)o.nextConsumer=r;else if(e.consumers=r,!_i(e)){let i=e.producers;for(;i!==void 0;)i=Qh(i)}return t}a(Qh,"producerRemoveLiveConsumerLink");function _i(n){return n.consumerIsAlwaysLive||n.consumers!==void 0}a(_i,"consumerIsLive");function ia(n){UF?.(n)}a(ia,"runPostProducerCreatedFn");function $F(n,e){let t=e.producersTail;if(t!==void 0){let r=e.producers;do{if(r===n)return!0;if(r===t)break;r=r.nextProducer}while(r!==void 0)}return!1}a($F,"isValidLink");function sa(n,e){return Object.is(n,e)}a(sa,"defaultEquals");function aa(n,e){let t=Object.create(BF);t.computation=n,e!==void 0&&(t.equal=e);let r=a(()=>{if(Do(t),Jn(t),t.value===Dn)throw t.error;return t.value},"computed");return r[He]=t,ia(t),r}a(aa,"createComputed");var _o=Symbol("UNSET"),To=Symbol("COMPUTING"),Dn=Symbol("ERRORED"),BF={...Mr,value:_o,dirty:!0,error:null,equal:sa,kind:"computed",producerMustRecompute(n){return n.value===_o||n.value===To},producerRecomputeValue(n){if(n.value===To)throw new Error("");let e=n.value;n.value=To;let t=jn(n),r,o=!1;try{r=n.computation(),V(null),o=e!==_o&&e!==Dn&&r!==Dn&&n.equal(e,r)}catch(i){r=Dn,n.error=i}finally{br(n,t)}if(o){n.value=e;return}n.value=r,n.version++}};function GF(){throw new Error}a(GF,"defaultThrowError");var I_=GF;function __(n){I_(n)}a(__,"throwInvalidWriteToSignalError");function Zh(n){I_=n}a(Zh,"setThrowInvalidWriteToSignalError");var HF=null;function ep(n,e){let t=Object.create(la);t.value=n,e!==void 0&&(t.equal=e);let r=a(()=>T_(t),"getter");return r[He]=t,ia(t),[r,a(s=>Pr(t,s),"set"),a(s=>_c(t,s),"update")]}a(ep,"createSignal");function T_(n){return Jn(n),n.value}a(T_,"signalGetFn");function Pr(n,e){Xh()||__(n),n.equal(n.value,e)||(n.value=e,qF(n))}a(Pr,"signalSetFn");function _c(n,e){Xh()||__(n),Pr(n,e(n.value))}a(_c,"signalUpdateFn");var la={...Mr,equal:sa,value:void 0,kind:"signal"};function qF(n){n.version++,C_(),Yh(n),HF?.(n)}a(qF,"signalValueChanged");var tp={...Mr,consumerIsAlwaysLive:!0,consumerAllowSignalWrites:!0,dirty:!0,kind:"effect"};function np(n){if(n.dirty=!1,n.version>0&&!Ii(n))return;n.version++;let e=jn(n);try{n.cleanup(),n.fn()}finally{br(n,e)}}a(np,"runEffect");var rp;function Tc(){return rp}a(Tc,"getCurrentInjector");function wn(n){let e=rp;return rp=n,e}a(wn,"setCurrentInjector");var D_=Symbol("NotFound");function Ti(n){return n===D_||n?.name==="\u0275NotFound"}a(Ti,"isNotFound");function op(n,e,t){let r=Object.create(zF);r.source=n,r.computation=e,t!=null&&(r.equal=t);let i=a(()=>{if(Do(r),Jn(r),r.value===Dn)throw r.error;return r.value},"linkedSignalGetter");return i[He]=r,ia(r),i}a(op,"createLinkedSignal");function w_(n,e){Do(n),Pr(n,e),Ei(n)}a(w_,"linkedSignalSetFn");function A_(n,e){if(Do(n),n.value===Dn)throw n.error;_c(n,e),Ei(n)}a(A_,"linkedSignalUpdateFn");var zF={...Mr,value:_o,dirty:!0,error:null,equal:sa,kind:"linkedSignal",producerMustRecompute(n){return n.value===_o||n.value===To},producerRecomputeValue(n){if(n.value===To)throw new Error("");let e=n.value;n.value=To;let t=jn(n),r,o=!1;try{let i=n.source(),s=e!==_o&&e!==Dn,l=s?{source:n.sourceValue,value:e}:void 0;r=n.computation(i,l),n.sourceValue=i,V(null),o=s&&r!==Dn&&n.equal(e,r)}catch(i){r=Dn,n.error=i}finally{br(n,t)}if(o){n.value=e;return}n.value=r,n.version++}};function R_(n){let e=V(null);try{return n()}finally{V(e)}}a(R_,"untracked");var ua=class{static{a(this,"Version")}full;major;minor;patch;constructor(e){this.full=e;let t=e.split(".");this.major=t[0],this.minor=t[1],this.patch=t.slice(2).join(".")}},sp=new ua("21.2.22"),Sp=(()=>{let n=sp.full;return`https://${n.includes("-next")||n.includes("-rc")||n==="0.0.0-PLACEHOLDER"?"next":`v${sp.major}`}.angular.dev`})(),Ep=`${Sp}/errors`,Nc="https://angular.dev/best-practices/security#preventing-cross-site-scripting-xss",x=class extends Error{static{a(this,"RuntimeError")}code;constructor(e,t){super(zt(e,t)),this.code=e}};function WF(n){return`NG0${Math.abs(n)}`}a(WF,"formatRuntimeErrorCode");function zt(n,e){return`${WF(n)}${e?": "+e:""}`}a(zt,"formatRuntimeError");var Wt=globalThis;function ie(n){for(let e in n)if(n[e]===ie)return e;throw Error("")}a(ie,"getClosureSafeProperty");function x_(n,e){for(let t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}a(x_,"fillProperties");function ga(n){if(typeof n=="string")return n;if(Array.isArray(n))return`[${n.map(ga).join(", ")}]`;if(n==null)return""+n;let e=n.overriddenName||n.name;if(e)return`${e}`;let t=n.toString();if(t==null)return""+t;let r=t.indexOf(`
|
|
1
|
+
import{$a as h_,Aa as jI,Ba as YI,Ca as XI,D as ht,Da as QI,Ea as ZI,F as OI,Fa as e_,Ga as t_,H as UI,Ha as Kh,Ia as yc,Ja as n_,Ka as r_,La as o_,Ma as vi,Oa as Cc,Pa as i_,Qa as Si,Ra as s_,Sa as a_,Ta as vc,Ua as l_,Va as Sc,Wa as c_,Xa as Ct,Ya as u_,Za as d_,_a as f_,_b as y_,ab as p_,b as kI,bb as m_,c as LI,db as g_,f as FI,ia as Io,ja as pc,ka as VI,la as $I,ma as mc,na as BI,oa as GI,pa as HI,qa as qI,ra as gc,sa as zI,ta as WI,u as zh,ua as KI,ub as Jh,va as Rr,wa as ra,x as Tn,xa as JI,ya as oa,za as Wh}from"./chunk-IYFE6AC7.js";import{Bd as Eo,De as AI,Ed as wI,Ee as RI,Mf as MI,Nf as bI,Rf as NI,Tf as PI,Uf as xI,Xa as ft,Ya as Be,na as Kn,o as B,s as yt,t as _n,yb as qh}from"./chunk-ZQVZ37WB.js";import{Aa as Hh,E as Vh,O as II,Oa as dt,Q as vo,Qa as Z,S as So,T as Qe,a as yi,aa as Ci,b as vI,c as fe,d as he,ga as Ar,ha as L,i as SI,ia as N,j as na,ja as $h,ka as Bh,oa as _I,q as EI,qa as TI,wa as DI,za as Gh}from"./chunk-AHHY6OJ6.js";import{a,d as hc,g as OF}from"./chunk-UVYWEABP.js";var aN=hc((sne,sN)=>{function en(n,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(n)),this._timeouts=n,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}a(en,"RetryOperation");sN.exports=en;en.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};en.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};en.prototype.retry=function(n){if(this._timeout&&clearTimeout(this._timeout),!n)return!1;var e=new Date().getTime();if(n&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(n),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(n);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},t),this._options.unref&&this._timer.unref(),!0};en.prototype.attempt=function(n,e){this._fn=n,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};en.prototype.try=function(n){console.log("Using RetryOperation.try() is deprecated"),this.attempt(n)};en.prototype.start=function(n){console.log("Using RetryOperation.start() is deprecated"),this.attempt(n)};en.prototype.start=en.prototype.try;en.prototype.errors=function(){return this._errors};en.prototype.attempts=function(){return this._attempts};en.prototype.mainError=function(){if(this._errors.length===0)return null;for(var n={},e=null,t=0,r=0;r<this._errors.length;r++){var o=this._errors[r],i=o.message,s=(n[i]||0)+1;n[i]=s,s>=t&&(e=o,t=s)}return e}});var lN=hc(fi=>{var Uq=aN();fi.operation=function(n){var e=fi.timeouts(n);return new Uq(e,{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})};fi.timeouts=function(n){if(n instanceof Array)return[].concat(n);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in n)e[t]=n[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],o=0;o<e.retries;o++)r.push(this.createTimeout(o,e));return n&&n.forever&&!r.length&&r.push(this.createTimeout(o,e)),r.sort(function(i,s){return i-s}),r};fi.createTimeout=function(n,e){var t=e.randomize?Math.random()+1:1,r=Math.round(t*Math.max(e.minTimeout,1)*Math.pow(e.factor,n));return r=Math.min(r,e.maxTimeout),r};fi.wrap=function(n,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var r in n)typeof n[r]=="function"&&t.push(r)}for(var o=0;o<t.length;o++){var i=t[o],s=n[i];n[i]=a(function(c){var u=fi.operation(e),f=Array.prototype.slice.call(arguments,1),p=f.pop();f.push(function(m){u.retry(m)||(m&&(arguments[0]=u.mainError()),p.apply(this,arguments))}),u.attempt(function(){c.apply(n,f)})},"retryWrapper").bind(n,s),n[i].options=e}}});var uN=hc((une,cN)=>{cN.exports=lN()});var fN=hc((dne,hf)=>{"use strict";var Vq=uN(),$q=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"],ff=class extends Error{static{a(this,"AbortError")}constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}},Bq=a((n,e,t)=>{let r=t.retries-(e-1);return n.attemptNumber=e,n.retriesLeft=r,n},"decorateErrorWithCounts"),Gq=a(n=>$q.includes(n),"isNetworkError"),dN=a((n,e)=>new Promise((t,r)=>{e={onFailedAttempt:a(()=>{},"onFailedAttempt"),retries:10,...e};let o=Vq.operation(e);o.attempt(async i=>{try{t(await n(i))}catch(s){if(!(s instanceof Error)){r(new TypeError(`Non-error was thrown: "${s}". You should only throw errors.`));return}if(s instanceof ff)o.stop(),r(s.originalError);else if(s instanceof TypeError&&!Gq(s.message))o.stop(),r(s);else{Bq(s,i,e);try{await e.onFailedAttempt(s)}catch(l){r(l);return}o.retry(s)||r(o.mainError())}}})}),"pRetry");hf.exports=dN;hf.exports.default=dN;hf.exports.AbortError=ff});var pt=null,Ec=!1,jh=1,UF=null,He=Symbol("SIGNAL");function V(n){let e=pt;return pt=n,e}a(V,"setActiveConsumer");function Ic(){return pt}a(Ic,"getActiveConsumer");var Mr={version:0,lastCleanEpoch:0,dirty:!1,producers:void 0,producersTail:void 0,consumers:void 0,consumersTail:void 0,recomputing:!1,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,kind:"unknown",producerMustRecompute:a(()=>!1,"producerMustRecompute"),producerRecomputeValue:a(()=>{},"producerRecomputeValue"),consumerMarkedDirty:a(()=>{},"consumerMarkedDirty"),consumerOnSignalRead:a(()=>{},"consumerOnSignalRead")};function Jn(n){if(Ec)throw new Error("");if(pt===null)return;pt.consumerOnSignalRead(n);let e=pt.producersTail;if(e!==void 0&&e.producer===n)return;let t,r=pt.recomputing;if(r&&(t=e!==void 0?e.nextProducer:pt.producers,t!==void 0&&t.producer===n)){pt.producersTail=t,t.lastReadVersion=n.version;return}let o=n.consumersTail;if(o!==void 0&&o.consumer===pt&&(!r||$F(o,pt)))return;let i=_i(pt),s={producer:n,consumer:pt,nextProducer:t,prevConsumer:o,lastReadVersion:n.version,nextConsumer:void 0};pt.producersTail=s,e!==void 0?e.nextProducer=s:pt.producers=s,i&&E_(n,s)}a(Jn,"producerAccessed");function C_(){jh++}a(C_,"producerIncrementEpoch");function Do(n){if(!(_i(n)&&!n.dirty)&&!(!n.dirty&&n.lastCleanEpoch===jh)){if(!n.producerMustRecompute(n)&&!Ii(n)){Ei(n);return}n.producerRecomputeValue(n),Ei(n)}}a(Do,"producerUpdateValueVersion");function Yh(n){if(n.consumers===void 0)return;let e=Ec;Ec=!0;try{for(let t=n.consumers;t!==void 0;t=t.nextConsumer){let r=t.consumer;r.dirty||VF(r)}}finally{Ec=e}}a(Yh,"producerNotifyConsumers");function Xh(){return pt?.consumerAllowSignalWrites!==!1}a(Xh,"producerUpdatesAllowed");function VF(n){n.dirty=!0,Yh(n),n.consumerMarkedDirty?.(n)}a(VF,"consumerMarkDirty");function Ei(n){n.dirty=!1,n.lastCleanEpoch=jh}a(Ei,"producerMarkClean");function jn(n){return n&&v_(n),V(n)}a(jn,"consumerBeforeComputation");function v_(n){n.producersTail=void 0,n.recomputing=!0}a(v_,"resetConsumerBeforeComputation");function br(n,e){V(e),n&&S_(n)}a(br,"consumerAfterComputation");function S_(n){n.recomputing=!1;let e=n.producersTail,t=e!==void 0?e.nextProducer:n.producers;if(t!==void 0){if(_i(n))do t=Qh(t);while(t!==void 0);e!==void 0?e.nextProducer=void 0:n.producers=void 0}}a(S_,"finalizeConsumerAfterComputation");function Ii(n){for(let e=n.producers;e!==void 0;e=e.nextProducer){let t=e.producer,r=e.lastReadVersion;if(r!==t.version||(Do(t),r!==t.version))return!0}return!1}a(Ii,"consumerPollProducersForChange");function Nr(n){if(_i(n)){let e=n.producers;for(;e!==void 0;)e=Qh(e)}n.producers=void 0,n.producersTail=void 0,n.consumers=void 0,n.consumersTail=void 0}a(Nr,"consumerDestroy");function E_(n,e){let t=n.consumersTail,r=_i(n);if(t!==void 0?(e.nextConsumer=t.nextConsumer,t.nextConsumer=e):(e.nextConsumer=void 0,n.consumers=e),e.prevConsumer=t,n.consumersTail=e,!r)for(let o=n.producers;o!==void 0;o=o.nextProducer)E_(o.producer,o)}a(E_,"producerAddLiveConsumer");function Qh(n){let e=n.producer,t=n.nextProducer,r=n.nextConsumer,o=n.prevConsumer;if(n.nextConsumer=void 0,n.prevConsumer=void 0,r!==void 0?r.prevConsumer=o:e.consumersTail=o,o!==void 0)o.nextConsumer=r;else if(e.consumers=r,!_i(e)){let i=e.producers;for(;i!==void 0;)i=Qh(i)}return t}a(Qh,"producerRemoveLiveConsumerLink");function _i(n){return n.consumerIsAlwaysLive||n.consumers!==void 0}a(_i,"consumerIsLive");function ia(n){UF?.(n)}a(ia,"runPostProducerCreatedFn");function $F(n,e){let t=e.producersTail;if(t!==void 0){let r=e.producers;do{if(r===n)return!0;if(r===t)break;r=r.nextProducer}while(r!==void 0)}return!1}a($F,"isValidLink");function sa(n,e){return Object.is(n,e)}a(sa,"defaultEquals");function aa(n,e){let t=Object.create(BF);t.computation=n,e!==void 0&&(t.equal=e);let r=a(()=>{if(Do(t),Jn(t),t.value===Dn)throw t.error;return t.value},"computed");return r[He]=t,ia(t),r}a(aa,"createComputed");var _o=Symbol("UNSET"),To=Symbol("COMPUTING"),Dn=Symbol("ERRORED"),BF={...Mr,value:_o,dirty:!0,error:null,equal:sa,kind:"computed",producerMustRecompute(n){return n.value===_o||n.value===To},producerRecomputeValue(n){if(n.value===To)throw new Error("");let e=n.value;n.value=To;let t=jn(n),r,o=!1;try{r=n.computation(),V(null),o=e!==_o&&e!==Dn&&r!==Dn&&n.equal(e,r)}catch(i){r=Dn,n.error=i}finally{br(n,t)}if(o){n.value=e;return}n.value=r,n.version++}};function GF(){throw new Error}a(GF,"defaultThrowError");var I_=GF;function __(n){I_(n)}a(__,"throwInvalidWriteToSignalError");function Zh(n){I_=n}a(Zh,"setThrowInvalidWriteToSignalError");var HF=null;function ep(n,e){let t=Object.create(la);t.value=n,e!==void 0&&(t.equal=e);let r=a(()=>T_(t),"getter");return r[He]=t,ia(t),[r,a(s=>Pr(t,s),"set"),a(s=>_c(t,s),"update")]}a(ep,"createSignal");function T_(n){return Jn(n),n.value}a(T_,"signalGetFn");function Pr(n,e){Xh()||__(n),n.equal(n.value,e)||(n.value=e,qF(n))}a(Pr,"signalSetFn");function _c(n,e){Xh()||__(n),Pr(n,e(n.value))}a(_c,"signalUpdateFn");var la={...Mr,equal:sa,value:void 0,kind:"signal"};function qF(n){n.version++,C_(),Yh(n),HF?.(n)}a(qF,"signalValueChanged");var tp={...Mr,consumerIsAlwaysLive:!0,consumerAllowSignalWrites:!0,dirty:!0,kind:"effect"};function np(n){if(n.dirty=!1,n.version>0&&!Ii(n))return;n.version++;let e=jn(n);try{n.cleanup(),n.fn()}finally{br(n,e)}}a(np,"runEffect");var rp;function Tc(){return rp}a(Tc,"getCurrentInjector");function wn(n){let e=rp;return rp=n,e}a(wn,"setCurrentInjector");var D_=Symbol("NotFound");function Ti(n){return n===D_||n?.name==="\u0275NotFound"}a(Ti,"isNotFound");function op(n,e,t){let r=Object.create(zF);r.source=n,r.computation=e,t!=null&&(r.equal=t);let i=a(()=>{if(Do(r),Jn(r),r.value===Dn)throw r.error;return r.value},"linkedSignalGetter");return i[He]=r,ia(r),i}a(op,"createLinkedSignal");function w_(n,e){Do(n),Pr(n,e),Ei(n)}a(w_,"linkedSignalSetFn");function A_(n,e){if(Do(n),n.value===Dn)throw n.error;_c(n,e),Ei(n)}a(A_,"linkedSignalUpdateFn");var zF={...Mr,value:_o,dirty:!0,error:null,equal:sa,kind:"linkedSignal",producerMustRecompute(n){return n.value===_o||n.value===To},producerRecomputeValue(n){if(n.value===To)throw new Error("");let e=n.value;n.value=To;let t=jn(n),r,o=!1;try{let i=n.source(),s=e!==_o&&e!==Dn,l=s?{source:n.sourceValue,value:e}:void 0;r=n.computation(i,l),n.sourceValue=i,V(null),o=s&&r!==Dn&&n.equal(e,r)}catch(i){r=Dn,n.error=i}finally{br(n,t)}if(o){n.value=e;return}n.value=r,n.version++}};function R_(n){let e=V(null);try{return n()}finally{V(e)}}a(R_,"untracked");var ua=class{static{a(this,"Version")}full;major;minor;patch;constructor(e){this.full=e;let t=e.split(".");this.major=t[0],this.minor=t[1],this.patch=t.slice(2).join(".")}},sp=new ua("21.2.22"),Sp=(()=>{let n=sp.full;return`https://${n.includes("-next")||n.includes("-rc")||n==="0.0.0-PLACEHOLDER"?"next":`v${sp.major}`}.angular.dev`})(),Ep=`${Sp}/errors`,Nc="https://angular.dev/best-practices/security#preventing-cross-site-scripting-xss",x=class extends Error{static{a(this,"RuntimeError")}code;constructor(e,t){super(zt(e,t)),this.code=e}};function WF(n){return`NG0${Math.abs(n)}`}a(WF,"formatRuntimeErrorCode");function zt(n,e){return`${WF(n)}${e?": "+e:""}`}a(zt,"formatRuntimeError");var Wt=globalThis;function ie(n){for(let e in n)if(n[e]===ie)return e;throw Error("")}a(ie,"getClosureSafeProperty");function x_(n,e){for(let t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}a(x_,"fillProperties");function ga(n){if(typeof n=="string")return n;if(Array.isArray(n))return`[${n.map(ga).join(", ")}]`;if(n==null)return""+n;let e=n.overriddenName||n.name;if(e)return`${e}`;let t=n.toString();if(t==null)return""+t;let r=t.indexOf(`
|
|
2
2
|
`);return r>=0?t.slice(0,r):t}a(ga,"stringify");function Pc(n,e){return n?e?`${n} ${e}`:n:e||""}a(Pc,"concatStringsWithSpace");var KF=ie({__forward_ref__:ie});function ya(n){return n.__forward_ref__=ya,n}a(ya,"forwardRef");function ne(n){return Ca(n)?n():n}a(ne,"resolveForwardRef");function Ca(n){return typeof n=="function"&&n.hasOwnProperty(KF)&&n.__forward_ref__===ya}a(Ca,"isForwardRef");function k_(n,e,t){n!=e&&L_(t,n,e,"==")}a(k_,"assertEqual");function L_(n,e,t,r){throw new Error(`ASSERTION ERROR: ${n}`+(r==null?"":` [Expected=> ${t} ${r} ${e} <=Actual]`))}a(L_,"throwError");function $(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}a($,"\u0275\u0275defineInjectable");function Qn(n){return{providers:n.providers||[],imports:n.imports||[]}}a(Qn,"\u0275\u0275defineInjector");function xc(n){return JF(n,Mi)}a(xc,"getInjectableDef");function JF(n,e){return n.hasOwnProperty(e)&&n[e]||null}a(JF,"getOwnDefinition");function jF(n){let e=n?.[Mi]??null;return e||null}a(jF,"getInheritedInjectableDef");function ap(n){return n&&n.hasOwnProperty(da)?n[da]:null}a(ap,"getInjectorDef");var Mi=ie({\u0275prov:ie}),da=ie({\u0275inj:ie}),F=class{static{a(this,"InjectionToken")}_desc;ngMetadataName="InjectionToken";\u0275prov;constructor(e,t){this._desc=e,this.\u0275prov=void 0,typeof t=="number"?this.__NG_ELEMENT_ID__=t:t!==void 0&&(this.\u0275prov=$({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}};function Ip(n){return n&&!!n.\u0275providers}a(Ip,"isEnvironmentProviders");var Zn=ie({\u0275cmp:ie}),bo=ie({\u0275dir:ie}),va=ie({\u0275pipe:ie}),kc=ie({\u0275mod:ie}),An=ie({\u0275fac:ie}),No=ie({__NG_ELEMENT_ID__:ie}),M_=ie({__NG_ENV_ID__:ie});function Po(n){return Fc(n,"@NgModule"),n[kc]||null}a(Po,"getNgModuleDef");function Lc(n){let e=Po(n);if(!e)throw new x(915,!1);return e}a(Lc,"getNgModuleDefOrThrow");function Oe(n){return Fc(n,"@Component"),n[Zn]||null}a(Oe,"getComponentDef");function Ut(n){return Fc(n,"@Directive"),n[bo]||null}a(Ut,"getDirectiveDef");function dn(n){return Fc(n,"@Pipe"),n[va]||null}a(dn,"getPipeDef");function Fc(n,e){if(n==null)throw new x(-919,!1)}a(Fc,"assertTypeDefined");function Sa(n){let e=Oe(n)||Ut(n)||dn(n);return e!==null&&e.standalone}a(Sa,"isStandalone");function j(n){return typeof n=="string"?n:n==null?"":String(n)}a(j,"renderStringify");function Rn(n){return typeof n=="function"?n.name||n.toString():typeof n=="object"&&n!=null&&typeof n.type=="function"?n.type.name||n.type.toString():j(n)}a(Rn,"stringifyForError");var F_=ie({ngErrorCode:ie}),YF=ie({ngErrorMessage:ie}),XF=ie({ngTokenPath:ie});function _p(n,e){return O_("",-200,e)}a(_p,"cyclicDependencyError");function Oc(n,e){throw new x(-201,!1)}a(Oc,"throwProviderNotFoundError");function O_(n,e,t){let r=new x(e,n);return r[F_]=e,r[YF]=n,t&&(r[XF]=t),r}a(O_,"createRuntimeError");function QF(n){return n[F_]}a(QF,"getRuntimeErrorCode");var lp;function U_(){return lp}a(U_,"getInjectImplementation");function vt(n){let e=lp;return lp=n,e}a(vt,"setInjectImplementation");function Tp(n,e,t){let r=xc(n);if(r&&r.providedIn=="root")return r.value===void 0?r.value=r.factory():r.value;if(t&8)return null;if(e!==void 0)return e;Oc(n,"")}a(Tp,"injectRootLimpMode");var ZF={},wo=ZF,cp="__NG_DI_FLAG__",up=class{static{a(this,"RetrievingInjector")}injector;constructor(e){this.injector=e}retrieve(e,t){let r=Ao(t)||0;try{return this.injector.get(e,r&8?null:wo,r)}catch(o){if(Ti(o))return o;throw o}}};function eO(n,e=0){let t=Tc();if(t===void 0)throw new x(-203,!1);if(t===null)return Tp(n,void 0,e);{let r=tO(e),o=t.retrieve(n,r);if(Ti(o)){if(r.optional)return null;throw o}return o}}a(eO,"injectInjectorOnly");function le(n,e=0){return(U_()||eO)(ne(n),e)}a(le,"\u0275\u0275inject");function Uc(n){throw new x(202,!1)}a(Uc,"\u0275\u0275invalidFactoryDep");function b(n,e){return le(n,Ao(e))}a(b,"inject");function Ao(n){return typeof n>"u"||typeof n=="number"?n:0|(n.optional&&8)|(n.host&&1)|(n.self&&2)|(n.skipSelf&&4)}a(Ao,"convertToBitFlags");function tO(n){return{optional:!!(n&8),host:!!(n&1),self:!!(n&2),skipSelf:!!(n&4)}}a(tO,"convertToInjectOptions");function dp(n){let e=[];for(let t=0;t<n.length;t++){let r=ne(n[t]);if(Array.isArray(r)){if(r.length===0)throw new x(900,!1);let o,i=0;for(let s=0;s<r.length;s++){let l=r[s],c=nO(l);typeof c=="number"?c===-1?o=l.token:i|=c:o=l}e.push(le(o,i))}else e.push(le(r))}return e}a(dp,"injectArgs");function bi(n,e){return n[cp]=e,n.prototype[cp]=e,n}a(bi,"attachInjectFlag");function nO(n){return n[cp]}a(nO,"getInjectFlag");function kr(n,e){let t=n.hasOwnProperty(An);return t?n[An]:null}a(kr,"getFactoryDef");function V_(n,e,t){if(n.length!==e.length)return!1;for(let r=0;r<n.length;r++){let o=n[r],i=e[r];if(t&&(o=t(o),i=t(i)),i!==o)return!1}return!0}a(V_,"arrayEquals");function fn(n){return n.flat(Number.POSITIVE_INFINITY)}a(fn,"flatten");function Vc(n,e){n.forEach(t=>Array.isArray(t)?Vc(t,e):e(t))}a(Vc,"deepForEach");function Dp(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}a(Dp,"addToArray");function Ea(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}a(Ea,"removeFromArray");function Ia(n,e){let t=[];for(let r=0;r<n;r++)t.push(e);return t}a(Ia,"newArray");function wp(n,e,t){let r=n.length-t;for(;e<r;)n[e]=n[e+t],e++;for(;t--;)n.pop()}a(wp,"arraySplice");function Ap(n,e,t,r){let o=n.length;if(o==e)n.push(t,r);else if(o===1)n.push(r,n[0]),n[0]=t;else{for(o--,n.push(n[o-1],n[o]);o>e;){let i=o-2;n[o]=n[i],o--}n[e]=t,n[e+1]=r}}a(Ap,"arrayInsert2");function _a(n,e,t){let r=Ni(n,e);return r>=0?n[r|1]=t:(r=~r,Ap(n,r,e,t)),r}a(_a,"keyValueArraySet");function $c(n,e){let t=Ni(n,e);if(t>=0)return n[t|1]}a($c,"keyValueArrayGet");function Ni(n,e){return rO(n,e,1)}a(Ni,"keyValueArrayIndexOf");function rO(n,e,t){let r=0,o=n.length>>t;for(;o!==r;){let i=r+(o-r>>1),s=n[i<<t];if(e===s)return i<<t;s>e?o=i:r=i+1}return~(o<<t)}a(rO,"_arrayIndexOfSorted");var Kt={},se=[],xo=new F(""),Rp=new F("",-1),Mp=new F(""),fa=class{static{a(this,"NullInjector")}get(e,t=wo){if(t===wo){let o=O_("",-201);throw o.name="\u0275NotFound",o}return t}};function bp(n){return{\u0275providers:n}}a(bp,"makeEnvironmentProviders");function $_(...n){return{\u0275providers:Bc(!0,n),\u0275fromNgModule:!0}}a($_,"importProvidersFrom");function Bc(n,...e){let t=[],r=new Set,o,i=a(s=>{t.push(s)},"collectProviders");return Vc(e,s=>{let l=s;Ac(l,i,[],r)&&(o||=[],o.push(l))}),o!==void 0&&B_(o,i),t}a(Bc,"internalImportProvidersFrom");function B_(n,e){for(let t=0;t<n.length;t++){let{ngModule:r,providers:o}=n[t];Np(o,i=>{e(i,r)})}}a(B_,"processInjectorTypesWithProviders");function Ac(n,e,t,r){if(n=ne(n),!n)return!1;let o=null,i=ap(n),s=!i&&Oe(n);if(!i&&!s){let c=n.ngModule;if(i=ap(c),i)o=c;else return!1}else{if(s&&!s.standalone)return!1;o=n}let l=r.has(o);if(s){if(l)return!1;if(r.add(o),s.dependencies){let c=typeof s.dependencies=="function"?s.dependencies():s.dependencies;for(let u of c)Ac(u,e,t,r)}}else if(i){if(i.imports!=null&&!l){r.add(o);let u;Vc(i.imports,f=>{Ac(f,e,t,r)&&(u||=[],u.push(f))}),u!==void 0&&B_(u,e)}if(!l){let u=kr(o)||(()=>new o);e({provide:o,useFactory:u,deps:se},o),e({provide:Mp,useValue:o,multi:!0},o),e({provide:xo,useValue:a(()=>le(o),"useValue"),multi:!0},o)}let c=i.providers;if(c!=null&&!l){let u=n;Np(c,f=>{e(f,u)})}}else return!1;return o!==n&&n.providers!==void 0}a(Ac,"walkProviderTree");function Np(n,e){for(let t of n)Ip(t)&&(t=t.\u0275providers),Array.isArray(t)?Np(t,e):e(t)}a(Np,"deepForEachProvider");var oO=ie({provide:String,useValue:ie});function G_(n){return n!==null&&typeof n=="object"&&oO in n}a(G_,"isValueProvider");function iO(n){return!!(n&&n.useExisting)}a(iO,"isExistingProvider");function sO(n){return!!(n&&n.useFactory)}a(sO,"isFactoryProvider");function Ro(n){return typeof n=="function"}a(Ro,"isTypeProvider");function H_(n){return!!n.useClass}a(H_,"isClassProvider");var Pp=new F(""),Dc={},b_={},ip;function Pi(){return ip===void 0&&(ip=new fa),ip}a(Pi,"getNullInjector");var Ot=class{static{a(this,"EnvironmentInjector")}},Mo=class extends Ot{static{a(this,"R3Injector")}parent;source;scopes;records=new Map;_ngOnDestroyHooks=new Set;_onDestroyHooks=[];get destroyed(){return this._destroyed}_destroyed=!1;injectorDefTypes;constructor(e,t,r,o){super(),this.parent=t,this.source=r,this.scopes=o,hp(e,s=>this.processProvider(s)),this.records.set(Rp,Di(void 0,this)),o.has("environment")&&this.records.set(Ot,Di(void 0,this));let i=this.records.get(Pp);i!=null&&typeof i.value=="string"&&this.scopes.add(i.value),this.injectorDefTypes=new Set(this.get(Mp,se,{self:!0}))}retrieve(e,t){let r=Ao(t)||0;try{return this.get(e,wo,r)}catch(o){if(Ti(o))return o;throw o}}destroy(){ca(this),this._destroyed=!0;let e=V(null);try{for(let r of this._ngOnDestroyHooks)r.ngOnDestroy();let t=this._onDestroyHooks;this._onDestroyHooks=[];for(let r of t)r()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),V(e)}}onDestroy(e){return ca(this),this._onDestroyHooks.push(e),()=>this.removeOnDestroy(e)}runInContext(e){ca(this);let t=wn(this),r=vt(void 0),o;try{return e()}finally{wn(t),vt(r)}}get(e,t=wo,r){if(ca(this),e.hasOwnProperty(M_))return e[M_](this);let o=Ao(r),i,s=wn(this),l=vt(void 0);try{if(!(o&4)){let u=this.records.get(e);if(u===void 0){let f=dO(e)&&xc(e);f&&this.injectableDefInScope(f)?u=Di(fp(e),Dc):u=null,this.records.set(e,u)}if(u!=null)return this.hydrate(e,u,o)}let c=o&2?Pi():this.parent;return t=o&8&&t===wo?null:t,c.get(e,t)}catch(c){let u=QF(c);throw u===-200||u===-201?new x(u,null):c}finally{vt(l),wn(s)}}resolveInjectorInitializers(){let e=V(null),t=wn(this),r=vt(void 0),o;try{let i=this.get(xo,se,{self:!0});for(let s of i)s()}finally{wn(t),vt(r),V(e)}}toString(){return"R3Injector[...]"}processProvider(e){e=ne(e);let t=Ro(e)?e:ne(e&&e.provide),r=lO(e);if(!Ro(e)&&e.multi===!0){let o=this.records.get(t);o||(o=Di(void 0,Dc,!0),o.factory=()=>dp(o.multi),this.records.set(t,o)),t=e,o.multi.push(e)}this.records.set(t,r)}hydrate(e,t,r){let o=V(null);try{if(t.value===b_)throw _p("");return t.value===Dc&&(t.value=b_,t.value=t.factory(void 0,r)),typeof t.value=="object"&&t.value&&uO(t.value)&&this._ngOnDestroyHooks.add(t.value),t.value}finally{V(o)}}injectableDefInScope(e){if(!e.providedIn)return!1;let t=ne(e.providedIn);return typeof t=="string"?t==="any"||this.scopes.has(t):this.injectorDefTypes.has(t)}removeOnDestroy(e){let t=this._onDestroyHooks.indexOf(e);t!==-1&&this._onDestroyHooks.splice(t,1)}};function fp(n){let e=xc(n),t=e!==null?e.factory:kr(n);if(t!==null)return t;if(n instanceof F)throw new x(-204,!1);if(n instanceof Function)return aO(n);throw new x(-204,!1)}a(fp,"injectableDefOrInjectorDefFactory");function aO(n){if(n.length>0)throw new x(-204,!1);let t=jF(n);return t!==null?()=>t.factory(n):()=>new n}a(aO,"getUndecoratedInjectableFactory");function lO(n){if(G_(n))return Di(void 0,n.useValue);{let e=xp(n);return Di(e,Dc)}}a(lO,"providerToRecord");function xp(n,e,t){let r;if(Ro(n)){let o=ne(n);return kr(o)||fp(o)}else if(G_(n))r=a(()=>ne(n.useValue),"factory");else if(sO(n))r=a(()=>n.useFactory(...dp(n.deps||[])),"factory");else if(iO(n))r=a((o,i)=>le(ne(n.useExisting),i!==void 0&&i&8?8:void 0),"factory");else{let o=ne(n&&(n.useClass||n.provide));if(cO(n))r=a(()=>new o(...dp(n.deps)),"factory");else return kr(o)||fp(o)}return r}a(xp,"providerToFactory");function ca(n){if(n.destroyed)throw new x(-205,!1)}a(ca,"assertNotDestroyed");function Di(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}a(Di,"makeRecord");function cO(n){return!!n.deps}a(cO,"hasDeps");function uO(n){return n!==null&&typeof n=="object"&&typeof n.ngOnDestroy=="function"}a(uO,"hasOnDestroy");function dO(n){return typeof n=="function"||typeof n=="object"&&n.ngMetadataName==="InjectionToken"}a(dO,"couldBeInjectableType");function hp(n,e){for(let t of n)Array.isArray(t)?hp(t,e):t&&Ip(t)?hp(t.\u0275providers,e):e(t)}a(hp,"forEachSingleProvider");function Gc(n,e){let t;n instanceof Mo?(ca(n),t=n):t=new up(n);let r,o=wn(t),i=vt(void 0);try{return e()}finally{wn(o),vt(i)}}a(Gc,"runInInjectionContext");function kp(){return U_()!==void 0||Tc()!=null}a(kp,"isInInjectionContext");var nt=0,P=1,G=2,Ge=3,rt=4,ot=5,Ur=6,xi=7,be=8,re=9,Jt=10,W=11,Vr=12,Ta=13,ko=14,it=15,$r=16,Lo=17,Mn=18,hn=19,Lp=20,Yn=21,Hc=22,Lr=23,Vt=24,Fo=25,bn=26,K=27,Fp=1,er=6,Br=7,Da=8,Oo=9,Ne=10;function Et(n){return Array.isArray(n)&&typeof n[Fp]=="object"}a(Et,"isLView");function Rt(n){return Array.isArray(n)&&n[Fp]===!0}a(Rt,"isLContainer");function Op(n){return(n.flags&4)!==0}a(Op,"isContentQueryHost");function Nn(n){return n.componentOffset>-1}a(Nn,"isComponentHost");function ki(n){return(n.flags&1)===1}a(ki,"isDirectiveHost");function jt(n){return!!n.template}a(jt,"isComponentDef");function Gr(n){return(n[G]&512)!==0}a(Gr,"isRootView");function Pn(n){return(n[G]&256)===256}a(Pn,"isDestroyed");var pe;(function(n){n[n.NONE=0]="NONE",n[n.HTML=1]="HTML",n[n.STYLE=2]="STYLE",n[n.SCRIPT=3]="SCRIPT",n[n.URL=4]="URL",n[n.RESOURCE_URL=5]="RESOURCE_URL",n[n.ATTRIBUTE_NO_BINDING=6]="ATTRIBUTE_NO_BINDING"})(pe||(pe={}));var wc,wi="svg",qc="math";function Up(){return wc||(wc={},xr(pe.HTML,void 0,[["iframe",["srcdoc"]],["*",["innerHTML","outerHTML"]]]),xr(pe.STYLE,void 0,[["*",["style"]]]),xr(pe.URL,void 0,[["*",["formAction"]],["area",["href"]],["a",["href","xlink:href"]],["form",["action"]],["img",["src"]],["video",["src"]]]),xr(pe.URL,qc,[["*",["href","xlink:href"]],["annotation",["href","xlink:href"]],["annotation-xml",["href","xlink:href"]],["maction",["href","xlink:href"]],["malignmark",["href","xlink:href"]],["math",["href","xlink:href"]],["mroot",["href","xlink:href"]],["msqrt",["href","xlink:href"]],["merror",["href","xlink:href"]],["mfrac",["href","xlink:href"]],["mglyph",["href","xlink:href"]],["msub",["href","xlink:href"]],["msup",["href","xlink:href"]],["msubsup",["href","xlink:href"]],["mmultiscripts",["href","xlink:href"]],["mprescripts",["href","xlink:href"]],["mi",["href","xlink:href"]],["mn",["href","xlink:href"]],["mo",["href","xlink:href"]],["mpadded",["href","xlink:href"]],["mphantom",["href","xlink:href"]],["mrow",["href","xlink:href"]],["ms",["href","xlink:href"]],["mspace",["href","xlink:href"]],["mstyle",["href","xlink:href"]],["mtable",["href","xlink:href"]],["mtd",["href","xlink:href"]],["mtr",["href","xlink:href"]],["mtext",["href","xlink:href"]],["mover",["href","xlink:href"]],["munder",["href","xlink:href"]],["munderover",["href","xlink:href"]],["semantics",["href","xlink:href"]],["none",["href","xlink:href"]]]),xr(pe.RESOURCE_URL,void 0,[["base",["href"]],["embed",["src"]],["frame",["src"]],["iframe",["src"]],["link",["href"]],["object",["codebase","data"]]]),xr(pe.URL,wi,[["a",["href","xlink:href"]]]),xr(pe.ATTRIBUTE_NO_BINDING,wi,[["animate",["attributeName","values","to","from"]],["set",["to","attributeName"]],["animateMotion",["attributeName"]],["animateTransform",["attributeName"]]]),xr(pe.ATTRIBUTE_NO_BINDING,void 0,[["unknown",["attributeName","values","to","from","sandbox","allow","allowFullscreen","referrerPolicy","csp","fetchPriority"]],["iframe",["sandbox","allow","allowFullscreen","referrerPolicy","csp","fetchPriority"]]])),wc}a(Up,"SECURITY_SCHEMA");function xr(n,e,t){for(let[r,o]of t){let i=e&&r!=="unknown"?`:${e}:${r}`:r;i=i.toLowerCase();for(let s of o)wc[`${i}|${s.toLowerCase()}`]=n}}a(xr,"registerContext");function Vp(n,e,t){let r=Up(),o=n.toLowerCase(),i=e.toLowerCase(),s=t&&o!=="*"&&o!=="unknown"?r[`:${t}:${o}|${i}`]:void 0,l=t?r[`:${t}:*|${i}`]:void 0;return s??l??r[`${o}|${i}`]??r[`*|${i}`]??pe.NONE}a(Vp,"checkSecurityContext");function Mt(n){for(;Array.isArray(n);)n=n[nt];return n}a(Mt,"unwrapRNode");function $p(n){for(;Array.isArray(n);){if(typeof n[Fp]=="object")return n;n=n[nt]}return null}a($p,"unwrapLView");function Uo(n,e){return Mt(e[n])}a(Uo,"getNativeByIndex");function Je(n,e){return Mt(e[n.index])}a(Je,"getNativeByTNode");function Vo(n,e){return n.data[e]}a(Vo,"getTNode");function Hr(n,e){return n[e]}a(Hr,"load");function wa(n,e,t,r){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=r}a(wa,"store");function Yt(n,e){let t=e[n];return Et(t)?t:t[nt]}a(Yt,"getComponentLViewByIndex");function q_(n){return(n[G]&4)===4}a(q_,"isCreationMode");function zc(n){return(n[G]&128)===128}a(zc,"viewAttachedToChangeDetector");function z_(n){return Rt(n[Ge])}a(z_,"viewAttachedToContainer");function st(n,e){return e==null?null:n[e]}a(st,"getConstant");function Bp(n){n[Lo]=0}a(Bp,"resetPreOrderHookFlags");function Gp(n){n[G]&1024||(n[G]|=1024,zc(n)&&$o(n))}a(Gp,"markViewForRefresh");function Hp(n,e){for(;n>0;)e=e[ko],n--;return e}a(Hp,"walkUpViews");function Aa(n){return!!(n[G]&9216||n[Vt]?.dirty)}a(Aa,"requiresRefreshOrTraversal");function Wc(n){n[Jt].changeDetectionScheduler?.notify(8),n[G]&64&&(n[G]|=1024),Aa(n)&&$o(n)}a(Wc,"updateAncestorTraversalFlagsOnAttach");function $o(n){n[Jt].changeDetectionScheduler?.notify(0);let e=Fr(n);for(;e!==null&&!(e[G]&8192||(e[G]|=8192,!zc(e)));)e=Fr(e)}a($o,"markAncestorsForTraversal");function Ra(n,e){if(Pn(n))throw new x(911,!1);n[Yn]===null&&(n[Yn]=[]),n[Yn].push(e)}a(Ra,"storeLViewOnDestroy");function Kc(n,e){if(n[Yn]===null)return;let t=n[Yn].indexOf(e);t!==-1&&n[Yn].splice(t,1)}a(Kc,"removeLViewOnDestroy");function Fr(n){let e=n[Ge];return Rt(e)?e[Ge]:e}a(Fr,"getLViewParent");function qp(n){return n[xi]??=[]}a(qp,"getOrCreateLViewCleanup");function zp(n){return n.cleanup??=[]}a(zp,"getOrCreateTViewCleanup");function W_(n,e,t,r){let o=qp(e);o.push(t),n.firstCreatePass&&zp(n).push(r,o.length-1)}a(W_,"storeCleanupWithContext");var z={lFrame:Z_(null),bindingsEnabled:!0,skipHydrationRootTNode:null},pp;(function(n){n[n.Off=0]="Off",n[n.Exhaustive=1]="Exhaustive",n[n.OnlyDirtyViews=2]="OnlyDirtyViews"})(pp||(pp={}));var mp=!1;function K_(){return z.lFrame.elementDepthCount}a(K_,"getElementDepthCount");function J_(){z.lFrame.elementDepthCount++}a(J_,"increaseElementDepthCount");function Wp(){z.lFrame.elementDepthCount--}a(Wp,"decreaseElementDepthCount");function Jc(){return z.bindingsEnabled}a(Jc,"getBindingsEnabled");function Kp(){return z.skipHydrationRootTNode!==null}a(Kp,"isInSkipHydrationBlock");function Jp(n){return z.skipHydrationRootTNode===n}a(Jp,"isSkipHydrationRootTNode");function jp(){z.bindingsEnabled=!0}a(jp,"\u0275\u0275enableBindings");function Yp(){z.bindingsEnabled=!1}a(Yp,"\u0275\u0275disableBindings");function Xp(){z.skipHydrationRootTNode=null}a(Xp,"leaveSkipHydrationBlock");function A(){return z.lFrame.lView}a(A,"getLView");function J(){return z.lFrame.tView}a(J,"getTView");function Qp(n){return z.lFrame.contextLView=n,n[be]}a(Qp,"\u0275\u0275restoreView");function Zp(n){return z.lFrame.contextLView=null,n}a(Zp,"\u0275\u0275resetView");function q(){let n=em();for(;n!==null&&n.type===64;)n=n.parent;return n}a(q,"getCurrentTNode");function em(){return z.lFrame.currentTNode}a(em,"getCurrentTNodePlaceholderOk");function Li(){let n=z.lFrame,e=n.currentTNode;return n.isParent?e:e.parent}a(Li,"getCurrentParentTNode");function xn(n,e){let t=z.lFrame;t.currentTNode=n,t.isParent=e}a(xn,"setCurrentTNode");function tm(){return z.lFrame.isParent}a(tm,"isCurrentTNodeParent");function nm(){z.lFrame.isParent=!1}a(nm,"setCurrentTNodeAsNotParent");function rm(){return z.lFrame.contextLView}a(rm,"getContextLView");function om(){return mp}a(om,"isRefreshingViews");function ha(n){let e=mp;return mp=n,e}a(ha,"setIsRefreshingViews");function at(){let n=z.lFrame,e=n.bindingRootIndex;return e===-1&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}a(at,"getBindingRoot");function kn(){return z.lFrame.bindingIndex}a(kn,"getBindingIndex");function im(n){return z.lFrame.bindingIndex=n}a(im,"setBindingIndex");function It(){return z.lFrame.bindingIndex++}a(It,"nextBindingIndex");function Ln(n){let e=z.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}a(Ln,"incrementBindingIndex");function j_(){return z.lFrame.inI18n}a(j_,"isInI18nBlock");function sm(n){z.lFrame.inI18n=n}a(sm,"setInI18nBlock");function Y_(n,e){let t=z.lFrame;t.bindingIndex=t.bindingRootIndex=n,jc(e)}a(Y_,"setBindingRootForHostBindings");function X_(){return z.lFrame.currentDirectiveIndex}a(X_,"getCurrentDirectiveIndex");function jc(n){z.lFrame.currentDirectiveIndex=n}a(jc,"setCurrentDirectiveIndex");function Yc(n){let e=z.lFrame.currentDirectiveIndex;return e===-1?null:n[e]}a(Yc,"getCurrentDirectiveDef");function Xc(){return z.lFrame.currentQueryIndex}a(Xc,"getCurrentQueryIndex");function Ma(n){z.lFrame.currentQueryIndex=n}a(Ma,"setCurrentQueryIndex");function fO(n){let e=n[P];return e.type===2?e.declTNode:e.type===1?n[ot]:null}a(fO,"getDeclarationTNode");function am(n,e,t){if(t&4){let o=e,i=n;for(;o=o.parent,o===null&&!(t&1);)if(o=fO(i),o===null||(i=i[ko],o.type&10))break;if(o===null)return!1;e=o,n=i}let r=z.lFrame=Q_();return r.currentTNode=e,r.lView=n,!0}a(am,"enterDI");function Qc(n){let e=Q_(),t=n[P];z.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}a(Qc,"enterView");function Q_(){let n=z.lFrame,e=n===null?null:n.child;return e===null?Z_(n):e}a(Q_,"allocLFrame");function Z_(n){let e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:n,child:null,inI18n:!1};return n!==null&&(n.child=e),e}a(Z_,"createLFrame");function eT(){let n=z.lFrame;return z.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}a(eT,"leaveViewLight");var lm=eT;function Zc(){let n=eT();n.isParent=!0,n.tView=null,n.selectedIndex=-1,n.contextLView=null,n.elementDepthCount=0,n.currentDirectiveIndex=-1,n.currentNamespace=null,n.bindingRootIndex=-1,n.bindingIndex=-1,n.currentQueryIndex=0}a(Zc,"leaveView");function tT(n){return(z.lFrame.contextLView=Hp(n,z.lFrame.contextLView))[be]}a(tT,"nextContextImpl");function ze(){return z.lFrame.selectedIndex}a(ze,"getSelectedIndex");function Fn(n){z.lFrame.selectedIndex=n}a(Fn,"setSelectedIndex");function $t(){let n=z.lFrame;return Vo(n.tView,n.selectedIndex)}a($t,"getSelectedTNode");function cm(){z.lFrame.currentNamespace=wi}a(cm,"\u0275\u0275namespaceSVG");function um(){z.lFrame.currentNamespace=qc}a(um,"\u0275\u0275namespaceMathML");function dm(){hO()}a(dm,"\u0275\u0275namespaceHTML");function hO(){z.lFrame.currentNamespace=null}a(hO,"namespaceHTMLInternal");function fm(){return z.lFrame.currentNamespace}a(fm,"getNamespace");var nT=!0;function ba(){return nT}a(ba,"wasLastNodeCreated");function Fi(n){nT=n}a(Fi,"lastNodeWasCreated");function gp(n,e=null,t=null,r){let o=hm(n,e,t,r);return o.resolveInjectorInitializers(),o}a(gp,"createInjector");function hm(n,e=null,t=null,r,o=new Set){let i=[t||se,$_(n)],s;return new Mo(i,e||Pi(),s||null,o)}a(hm,"createInjectorWithoutInjectorInstances");var tt=class n{static{a(this,"Injector")}static THROW_IF_NOT_FOUND=wo;static NULL=new fa;static create(e,t){if(Array.isArray(e))return gp({name:""},t,e,"");{let r=e.name??"";return gp({name:r},e.parent,e.providers,r)}}static \u0275prov=$({token:n,providedIn:"any",factory:a(()=>le(Rp),"factory")});static __NG_ELEMENT_ID__=-1},bt=new F(""),St=class{static{a(this,"DestroyRef")}static __NG_ELEMENT_ID__=pO;static __NG_ENV_ID__=a(e=>e,"__NG_ENV_ID__")},Rc=class extends St{static{a(this,"NodeInjectorDestroyRef")}_lView;constructor(e){super(),this._lView=e}get destroyed(){return Pn(this._lView)}onDestroy(e){let t=this._lView;return Ra(t,e),()=>Kc(t,e)}};function pO(){return new Rc(A())}a(pO,"injectDestroyRef");var pm=!1,rT=new F(""),cn=class n{static{a(this,"PendingTasksInternal")}taskId=0;pendingTasks=new Set;destroyed=!1;pendingTask=new he(!1);debugTaskTracker=b(rT,{optional:!0});get hasPendingTasks(){return this.destroyed?!1:this.pendingTask.value}get hasPendingTasksObservable(){return this.destroyed?new vI(e=>{e.next(!1),e.complete()}):this.pendingTask}add(){!this.hasPendingTasks&&!this.destroyed&&this.pendingTask.next(!0);let e=this.taskId++;return this.pendingTasks.add(e),this.debugTaskTracker?.add(e),e}has(e){return this.pendingTasks.has(e)}remove(e){this.pendingTasks.delete(e),this.debugTaskTracker?.remove(e),this.pendingTasks.size===0&&this.hasPendingTasks&&this.pendingTask.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this.hasPendingTasks&&this.pendingTask.next(!1),this.destroyed=!0,this.pendingTask.unsubscribe()}static \u0275prov=$({token:n,providedIn:"root",factory:a(()=>new n,"factory")})},yp=class extends fe{static{a(this,"EventEmitter_")}__isAsync;destroyRef=void 0;pendingTasks=void 0;constructor(e=!1){super(),this.__isAsync=e,kp()&&(this.destroyRef=b(St,{optional:!0})??void 0,this.pendingTasks=b(cn,{optional:!0})??void 0)}emit(e){let t=V(null);try{super.next(e)}finally{V(t)}}subscribe(e,t,r){let o=e,i=t||(()=>null),s=r;if(e&&typeof e=="object"){let c=e;o=c.next?.bind(c),i=c.error?.bind(c),s=c.complete?.bind(c)}this.__isAsync&&(i=this.wrapInTimeout(i),o&&(o=this.wrapInTimeout(o)),s&&(s=this.wrapInTimeout(s)));let l=super.subscribe({next:o,error:i,complete:s});return e instanceof yi&&e.add(l),l}wrapInTimeout(e){return t=>{let r=this.pendingTasks?.add();setTimeout(()=>{try{e(t)}finally{r!==void 0&&this.pendingTasks?.remove(r)}})}}},mt=yp;function Mc(...n){}a(Mc,"noop");function mm(n){let e,t;function r(){n=Mc;try{t!==void 0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(t),e!==void 0&&clearTimeout(e)}catch{}}return a(r,"cleanup"),e=setTimeout(()=>{n(),r()}),typeof requestAnimationFrame=="function"&&(t=requestAnimationFrame(()=>{n(),r()})),()=>r()}a(mm,"scheduleCallbackWithRafRace");function oT(n){return queueMicrotask(()=>n()),()=>{n=Mc}}a(oT,"scheduleCallbackWithMicrotask");var gm="isAngularZone",pa=gm+"_ID",mO=0,Se=class n{static{a(this,"NgZone")}hasPendingMacrotasks=!1;hasPendingMicrotasks=!1;isStable=!0;onUnstable=new mt(!1);onMicrotaskEmpty=new mt(!1);onStable=new mt(!1);onError=new mt(!1);constructor(e){let{enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:r=!1,shouldCoalesceRunChangeDetection:o=!1,scheduleInRootZone:i=pm}=e;if(typeof Zone>"u")throw new x(908,!1);Zone.assertZonePatched();let s=this;s._nesting=0,s._outer=s._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(s._inner=s._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(s._inner=s._inner.fork(Zone.longStackTraceZoneSpec)),s.shouldCoalesceEventChangeDetection=!o&&r,s.shouldCoalesceRunChangeDetection=o,s.callbackScheduled=!1,s.scheduleInRootZone=i,CO(s)}static isInAngularZone(){return typeof Zone<"u"&&Zone.current.get(gm)===!0}static assertInAngularZone(){if(!n.isInAngularZone())throw new x(909,!1)}static assertNotInAngularZone(){if(n.isInAngularZone())throw new x(909,!1)}run(e,t,r){return this._inner.run(e,t,r)}runTask(e,t,r,o){let i=this._inner,s=i.scheduleEventTask("NgZoneEvent: "+o,e,gO,Mc,Mc);try{return i.runTask(s,t,r)}finally{i.cancelTask(s)}}runGuarded(e,t,r){return this._inner.runGuarded(e,t,r)}runOutsideAngular(e){return this._outer.run(e)}},gO={};function ym(n){if(n._nesting==0&&!n.hasPendingMicrotasks&&!n.isStable)try{n._nesting++,n.onMicrotaskEmpty.emit(null)}finally{if(n._nesting--,!n.hasPendingMicrotasks)try{n.runOutsideAngular(()=>n.onStable.emit(null))}finally{n.isStable=!0}}}a(ym,"checkStable");function yO(n){if(n.isCheckStableRunning||n.callbackScheduled)return;n.callbackScheduled=!0;function e(){mm(()=>{n.callbackScheduled=!1,Cp(n),n.isCheckStableRunning=!0,ym(n),n.isCheckStableRunning=!1})}a(e,"scheduleCheckStable"),n.scheduleInRootZone?Zone.root.run(()=>{e()}):n._outer.run(()=>{e()}),Cp(n)}a(yO,"delayChangeDetectionForEvents");function CO(n){let e=a(()=>{yO(n)},"delayChangeDetectionForEventsDelegate"),t=mO++;n._inner=n._inner.fork({name:"angular",properties:{[gm]:!0,[pa]:t,[pa+t]:!0},onInvokeTask:a((r,o,i,s,l,c)=>{if(vO(c))return r.invokeTask(i,s,l,c);try{return N_(n),r.invokeTask(i,s,l,c)}finally{(n.shouldCoalesceEventChangeDetection&&s.type==="eventTask"||n.shouldCoalesceRunChangeDetection)&&e(),P_(n)}},"onInvokeTask"),onInvoke:a((r,o,i,s,l,c,u)=>{try{return N_(n),r.invoke(i,s,l,c,u)}finally{n.shouldCoalesceRunChangeDetection&&!n.callbackScheduled&&!SO(c)&&e(),P_(n)}},"onInvoke"),onHasTask:a((r,o,i,s)=>{r.hasTask(i,s),o===i&&(s.change=="microTask"?(n._hasPendingMicrotasks=s.microTask,Cp(n),ym(n)):s.change=="macroTask"&&(n.hasPendingMacrotasks=s.macroTask))},"onHasTask"),onHandleError:a((r,o,i,s)=>(r.handleError(i,s),n.runOutsideAngular(()=>n.onError.emit(s)),!1),"onHandleError")})}a(CO,"forkInnerZoneWithAngularBehavior");function Cp(n){n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&n.callbackScheduled===!0?n.hasPendingMicrotasks=!0:n.hasPendingMicrotasks=!1}a(Cp,"updateMicroTaskStatus");function N_(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}a(N_,"onEnter");function P_(n){n._nesting--,ym(n)}a(P_,"onLeave");var ma=class{static{a(this,"NoopNgZone")}hasPendingMicrotasks=!1;hasPendingMacrotasks=!1;isStable=!0;onUnstable=new mt;onMicrotaskEmpty=new mt;onStable=new mt;onError=new mt;run(e,t,r){return e.apply(t,r)}runGuarded(e,t,r){return e.apply(t,r)}runOutsideAngular(e){return e()}runTask(e,t,r,o){return e.apply(t,r)}};function vO(n){return iT(n,"__ignore_ng_zone__")}a(vO,"shouldBeIgnoredByZone");function SO(n){return iT(n,"__scheduler_tick__")}a(SO,"isSchedulerTick");function iT(n,e){return!Array.isArray(n)||n.length!==1?!1:n[0]?.data?.[e]===!0}a(iT,"hasApplyArgsData");var Xn=class{static{a(this,"ErrorHandler")}_console=console;handleError(e){this._console.error("ERROR",e)}},pn=new F("",{factory:a(()=>{let n=b(Se),e=b(Ot),t;return r=>{n.runOutsideAngular(()=>{e.destroyed&&!t?setTimeout(()=>{throw r}):(t??=e.get(Xn),t.handleError(r))})}},"factory")}),Cm={provide:xo,useValue:a(()=>{let n=b(Xn,{optional:!0})},"useValue"),multi:!0},w6=new F("",{factory:a(()=>{if(typeof ngServerMode<"u"&&ngServerMode)return;let n=b(bt).defaultView;if(!n)return;let e=b(pn),t=a(i=>{e(i.reason),i.preventDefault()},"rejectionListener"),r=a(i=>{i.error?e(i.error):e(new Error(i.message,{cause:i})),i.preventDefault()},"errorListener"),o=a(()=>{n.addEventListener("unhandledrejection",t),n.addEventListener("error",r)},"setupEventListeners");typeof Zone<"u"?Zone.root.run(o):o(),b(St).onDestroy(()=>{n.removeEventListener("error",r),n.removeEventListener("unhandledrejection",t)})},"factory")});function eu(n,e){let[t,r,o]=ep(n,e?.equal),i=t,s=i[He];return i.set=r,i.update=o,i.asReadonly=Na.bind(i),i}a(eu,"signal");function Na(){let n=this[He];if(n.readonlyFn===void 0){let e=a(()=>this(),"readonlyFn");e[He]=n,n.readonlyFn=e}return n.readonlyFn}a(Na,"signalAsReadonlyFn");var Or=class{static{a(this,"ViewContext")}view;node;constructor(e,t){this.view=e,this.node=t}static __NG_ELEMENT_ID__=EO};function EO(){return new Or(A(),q())}a(EO,"injectViewContext");var un=class{static{a(this,"ChangeDetectionScheduler")}},Oi=new F("",{factory:a(()=>!0,"factory")}),IO=new F("",{factory:a(()=>!1,"factory")}),tu=new F(""),Ai=class n{static{a(this,"PendingTasks")}internalPendingTasks=b(cn);scheduler=b(un);errorHandler=b(pn);add(){let e=this.internalPendingTasks.add();return()=>{this.internalPendingTasks.has(e)&&(this.scheduler.notify(11),this.internalPendingTasks.remove(e))}}run(e){let t=this.add();e().catch(this.errorHandler).finally(t)}static \u0275prov=$({token:n,providedIn:"root",factory:a(()=>new n,"factory")})},Ri=class n{static{a(this,"EffectScheduler")}static \u0275prov=$({token:n,providedIn:"root",factory:a(()=>new vp,"factory")})},vp=class{static{a(this,"ZoneAwareEffectScheduler")}dirtyEffectCount=0;queues=new Map;add(e){this.enqueue(e),this.schedule(e)}schedule(e){e.dirty&&this.dirtyEffectCount++}remove(e){let t=e.zone,r=this.queues.get(t);r.has(e)&&(r.delete(e),e.dirty&&this.dirtyEffectCount--)}enqueue(e){let t=e.zone;this.queues.has(t)||this.queues.set(t,new Set);let r=this.queues.get(t);r.has(e)||r.add(e)}flush(){for(;this.dirtyEffectCount>0;){let e=!1;for(let[t,r]of this.queues)t===null?e||=this.flushQueue(r):e||=t.run(()=>this.flushQueue(r));e||(this.dirtyEffectCount=0)}}flushQueue(e){let t=!1;for(let r of e)r.dirty&&(this.dirtyEffectCount--,t=!0,r.run());return t}},bc=class{static{a(this,"EffectRefImpl")}[He];constructor(e){this[He]=e}destroy(){this[He].destroy()}};function sT(n,e){let t=e?.injector??b(tt),r=e?.manualCleanup!==!0?t.get(St):null,o,i=t.get(Or,null,{optional:!0}),s=t.get(un);return i!==null?(o=DO(i.view,s,n),r instanceof Rc&&r._lView===i.view&&(r=null)):o=wO(n,t.get(Ri),s),o.injector=t,r!==null&&(o.onDestroyFns=[r.onDestroy(()=>o.destroy())]),new bc(o)}a(sT,"effect");var aT={...tp,cleanupFns:void 0,zone:null,onDestroyFns:null,run(){let n=ha(!1);try{np(this)}finally{ha(n)}},cleanup(){if(!this.cleanupFns?.length)return;let n=V(null);try{for(;this.cleanupFns.length;)this.cleanupFns.pop()()}finally{this.cleanupFns=[],V(n)}}},_O={...aT,consumerMarkedDirty(){this.scheduler.schedule(this),this.notifier.notify(12)},destroy(){if(Nr(this),this.onDestroyFns!==null)for(let n of this.onDestroyFns)n();this.cleanup(),this.scheduler.remove(this)}},TO={...aT,consumerMarkedDirty(){this.view[G]|=8192,$o(this.view),this.notifier.notify(13)},destroy(){if(Nr(this),this.onDestroyFns!==null)for(let n of this.onDestroyFns)n();this.cleanup(),this.view[Lr]?.delete(this)}};function DO(n,e,t){let r=Object.create(TO);return r.view=n,r.zone=typeof Zone<"u"?Zone.current:null,r.notifier=e,r.fn=lT(r,t),n[Lr]??=new Set,n[Lr].add(r),r.consumerMarkedDirty(r),r}a(DO,"createViewEffect");function wO(n,e,t){let r=Object.create(_O);return r.fn=lT(r,n),r.scheduler=e,r.notifier=t,r.zone=typeof Zone<"u"?Zone.current:null,r.scheduler.add(r),r.notifier.notify(12),r}a(wO,"createRootEffect");function lT(n,e){return()=>{e(t=>(n.cleanupFns??=[]).push(t))}}a(lT,"createEffectFn");function sr(n){return{toString:n}.toString()}a(sr,"noSideEffects");var Ui="__annotations__",Vi="__parameters__",$i="__prop__metadata__";function ul(n,e,t,r,o){return sr(()=>{let i=Hg(e);function s(...l){if(this instanceof s)return i.call(this,...l),this;let c=new s(...l);return a(function(f){return o&&o(f,...l),(f.hasOwnProperty(Ui)?f[Ui]:Object.defineProperty(f,Ui,{value:[]})[Ui]).push(c),f},"TypeDecorator")}return a(s,"DecoratorFactory"),t&&(s.prototype=Object.create(t.prototype)),s.prototype.ngMetadataName=n,s.annotationCls=s,s})}a(ul,"makeDecorator");function Hg(n){return a(function(...t){if(n){let r=n(...t);for(let o in r)this[o]=r[o]}},"ctor")}a(Hg,"makeMetadataCtor");function ns(n,e,t){return sr(()=>{let r=Hg(e);function o(...i){if(this instanceof o)return r.apply(this,i),this;let s=new o(...i);return l.annotation=s,l;function l(c,u,f){let p=c.hasOwnProperty(Vi)?c[Vi]:Object.defineProperty(c,Vi,{value:[]})[Vi];for(;p.length<=f;)p.push(null);return(p[f]=p[f]||[]).push(s),c}a(l,"ParamDecorator")}return a(o,"ParamDecoratorFactory"),o.prototype.ngMetadataName=n,o.annotationCls=o,o})}a(ns,"makeParamDecorator");function ar(n,e,t,r){return sr(()=>{let o=Hg(e);function i(...s){if(this instanceof i)return o.apply(this,s),this;let l=new i(...s);function c(u,f){if(u===void 0)throw new Error("Standard Angular field decorators are not supported in JIT mode.");let p=u.constructor,m=p.hasOwnProperty($i)?p[$i]:Object.defineProperty(p,$i,{value:{}})[$i];m[f]=m.hasOwnProperty(f)&&m[f]||[],m[f].unshift(l)}return a(c,"PropDecorator"),c}return a(i,"PropDecoratorFactory"),t&&(i.prototype=Object.create(t.prototype)),i.prototype.ngMetadataName=n,i.annotationCls=i,i})}a(ar,"makePropDecorator");var gD=bi(ns("Inject",n=>({token:n})),-1),yD=bi(ns("Optional"),8),CD=bi(ns("Self"),2),vD=bi(ns("SkipSelf"),4),SD=bi(ns("Host"),1);function Bt(n){let e=Wt.ng;if(e&&e.\u0275compilerFacade)return e.\u0275compilerFacade;throw new Error("JIT compiler unavailable")}a(Bt,"getCompilerFacade");var cT={\u0275\u0275defineInjectable:$,\u0275\u0275defineInjector:Qn,\u0275\u0275inject:le,\u0275\u0275invalidFactoryDep:Uc,resolveForwardRef:ne},ED=Function;function xa(n){return typeof n=="function"}a(xa,"isType");var AO=/^function\s+\S+\(\)\s*{[\s\S]+\.apply\(this,\s*(arguments|(?:[^()]+\(\[\],)?[^()]+\(arguments\).*)\)/,RO=/^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{/,MO=/^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{[\s\S]*constructor\s*\(/,bO=/^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{[\s\S]*constructor\s*\(\)\s*{[^}]*super\(\.\.\.arguments\)/;function NO(n){return AO.test(n)||bO.test(n)||RO.test(n)&&!MO.test(n)}a(NO,"isDelegateCtor");var Eu=class{static{a(this,"ReflectionCapabilities")}_reflect;constructor(e){this._reflect=e||Wt.Reflect}factory(e){return(...t)=>new e(...t)}_zipTypesAndAnnotations(e,t){let r;typeof e>"u"?r=Ia(t.length):r=Ia(e.length);for(let o=0;o<r.length;o++)typeof e>"u"?r[o]=[]:e[o]&&e[o]!=Object?r[o]=[e[o]]:r[o]=[],t&&t[o]!=null&&(r[o]=r[o].concat(t[o]));return r}_ownParameters(e,t){let r=e.toString();if(NO(r))return null;if(e.parameters&&e.parameters!==t.parameters)return e.parameters;let o=e.ctorParameters;if(o&&o!==t.ctorParameters){let l=typeof o=="function"?o():o,c=l.map(f=>f&&f.type),u=l.map(f=>f&&vm(f.decorators));return this._zipTypesAndAnnotations(c,u)}let i=e.hasOwnProperty(Vi)&&e[Vi],s=this._reflect&&this._reflect.getOwnMetadata&&this._reflect.getOwnMetadata("design:paramtypes",e);return s||i?this._zipTypesAndAnnotations(s,i):Ia(e.length)}parameters(e){if(!xa(e))return[];let t=nu(e),r=this._ownParameters(e,t);return!r&&t!==Object&&(r=this.parameters(t)),r||[]}_ownAnnotations(e,t){if(e.annotations&&e.annotations!==t.annotations){let r=e.annotations;return typeof r=="function"&&r.annotations&&(r=r.annotations),r}return e.decorators&&e.decorators!==t.decorators?vm(e.decorators):e.hasOwnProperty(Ui)?e[Ui]:null}annotations(e){if(!xa(e))return[];let t=nu(e),r=this._ownAnnotations(e,t)||[];return(t!==Object?this.annotations(t):[]).concat(r)}_ownPropMetadata(e,t){if(e.propMetadata&&e.propMetadata!==t.propMetadata){let r=e.propMetadata;return typeof r=="function"&&r.propMetadata&&(r=r.propMetadata),r}if(e.propDecorators&&e.propDecorators!==t.propDecorators){let r=e.propDecorators,o={};return Object.keys(r).forEach(i=>{o[i]=vm(r[i])}),o}return e.hasOwnProperty($i)?e[$i]:null}propMetadata(e){if(!xa(e))return{};let t=nu(e),r={};if(t!==Object){let i=this.propMetadata(t);Object.keys(i).forEach(s=>{r[s]=i[s]})}let o=this._ownPropMetadata(e,t);return o&&Object.keys(o).forEach(i=>{let s=[];r.hasOwnProperty(i)&&s.push(...r[i]),s.push(...o[i]),r[i]=s}),r}ownPropMetadata(e){return xa(e)?this._ownPropMetadata(e,nu(e))||{}:{}}hasLifecycleHook(e,t){return e instanceof ED&&t in e.prototype}};function vm(n){return n?n.map(e=>{let r=e.type.annotationCls,o=e.args?e.args:[];return new r(...o)}):[]}a(vm,"convertTsickleDecoratorIntoMetadata");function nu(n){let e=n.prototype?Object.getPrototypeOf(n.prototype):null;return(e?e.constructor:null)||Object}a(nu,"getParentCtor");function ID(n,e,t,r){e!==null?e.applyValueToInputSignal(e,r):n[t]=r}a(ID,"applyValueToInputField");var Iu=class{static{a(this,"SimpleChange")}previousValue;currentValue;firstChange;constructor(e,t,r){this.previousValue=e,this.currentValue=t,this.firstChange=r}isFirstChange(){return this.firstChange}},rs=(()=>{let n=a(()=>_D,"\u0275\u0275NgOnChangesFeatureImpl");return n.ngInherit=!0,n})();function _D(n){return n.type.prototype.ngOnChanges&&(n.setInput=xO),PO}a(_D,"NgOnChangesFeatureImpl");function PO(){let n=DD(this),e=n?.current;if(e){let t=n.previous;if(t===Kt)n.previous=e;else for(let r in e)t[r]=e[r];n.current=null,this.ngOnChanges(e)}}a(PO,"rememberChangeHistoryAndInvokeOnChangesHook");function xO(n,e,t,r,o){let i=this.declaredInputs[r],s=DD(n)||kO(n,{previous:Kt,current:null}),l=s.current||(s.current={}),c=s.previous,u=c[i];l[i]=new Iu(u&&u.currentValue,t,c===Kt),ID(n,e,o,t)}a(xO,"ngOnChangesSetInput");var TD="__ngSimpleChanges__";function DD(n){return n[TD]||null}a(DD,"getSimpleChangesStore");function kO(n,e){return n[TD]=e}a(kO,"setSimpleChangesStore");var uT=[];var ae=a(function(n,e=null,t){for(let r=0;r<uT.length;r++){let o=uT[r];o(n,e,t)}},"profiler"),ee;(function(n){n[n.TemplateCreateStart=0]="TemplateCreateStart",n[n.TemplateCreateEnd=1]="TemplateCreateEnd",n[n.TemplateUpdateStart=2]="TemplateUpdateStart",n[n.TemplateUpdateEnd=3]="TemplateUpdateEnd",n[n.LifecycleHookStart=4]="LifecycleHookStart",n[n.LifecycleHookEnd=5]="LifecycleHookEnd",n[n.OutputStart=6]="OutputStart",n[n.OutputEnd=7]="OutputEnd",n[n.BootstrapApplicationStart=8]="BootstrapApplicationStart",n[n.BootstrapApplicationEnd=9]="BootstrapApplicationEnd",n[n.BootstrapComponentStart=10]="BootstrapComponentStart",n[n.BootstrapComponentEnd=11]="BootstrapComponentEnd",n[n.ChangeDetectionStart=12]="ChangeDetectionStart",n[n.ChangeDetectionEnd=13]="ChangeDetectionEnd",n[n.ChangeDetectionSyncStart=14]="ChangeDetectionSyncStart",n[n.ChangeDetectionSyncEnd=15]="ChangeDetectionSyncEnd",n[n.AfterRenderHooksStart=16]="AfterRenderHooksStart",n[n.AfterRenderHooksEnd=17]="AfterRenderHooksEnd",n[n.ComponentStart=18]="ComponentStart",n[n.ComponentEnd=19]="ComponentEnd",n[n.DeferBlockStateStart=20]="DeferBlockStateStart",n[n.DeferBlockStateEnd=21]="DeferBlockStateEnd",n[n.DynamicComponentStart=22]="DynamicComponentStart",n[n.DynamicComponentEnd=23]="DynamicComponentEnd",n[n.HostBindingsUpdateStart=24]="HostBindingsUpdateStart",n[n.HostBindingsUpdateEnd=25]="HostBindingsUpdateEnd"})(ee||(ee={}));function LO(n,e,t){let{ngOnChanges:r,ngOnInit:o,ngDoCheck:i}=e.type.prototype;if(r){let s=_D(e);(t.preOrderHooks??=[]).push(n,s),(t.preOrderCheckHooks??=[]).push(n,s)}o&&(t.preOrderHooks??=[]).push(0-n,o),i&&((t.preOrderHooks??=[]).push(n,i),(t.preOrderCheckHooks??=[]).push(n,i))}a(LO,"registerPreOrderHooks");function wD(n,e){for(let t=e.directiveStart,r=e.directiveEnd;t<r;t++){let i=n.data[t].type.prototype,{ngAfterContentInit:s,ngAfterContentChecked:l,ngAfterViewInit:c,ngAfterViewChecked:u,ngOnDestroy:f}=i;s&&(n.contentHooks??=[]).push(-t,s),l&&((n.contentHooks??=[]).push(t,l),(n.contentCheckHooks??=[]).push(t,l)),c&&(n.viewHooks??=[]).push(-t,c),u&&((n.viewHooks??=[]).push(t,u),(n.viewCheckHooks??=[]).push(t,u)),f!=null&&(n.destroyHooks??=[]).push(t,f)}}a(wD,"registerPostOrderHooks");function hu(n,e,t){AD(n,e,3,t)}a(hu,"executeCheckHooks");function pu(n,e,t,r){(n[G]&3)===t&&AD(n,e,t,r)}a(pu,"executeInitAndCheckHooks");function Sm(n,e){let t=n[G];(t&3)===e&&(t&=16383,t+=1,n[G]=t)}a(Sm,"incrementInitPhaseFlags");function AD(n,e,t,r){let o=r!==void 0?n[Lo]&65535:0,i=r??-1,s=e.length-1,l=0;for(let c=o;c<s;c++)if(typeof e[c+1]=="number"){if(l=e[c],r!=null&&l>=r)break}else e[c]<0&&(n[Lo]+=65536),(l<i||i==-1)&&(FO(n,t,e,c),n[Lo]=(n[Lo]&4294901760)+c+2),c++}a(AD,"callHooks");function dT(n,e){ae(ee.LifecycleHookStart,n,e);let t=V(null);try{e.call(n)}finally{V(t),ae(ee.LifecycleHookEnd,n,e)}}a(dT,"callHookInternal");function FO(n,e,t,r){let o=t[r]<0,i=t[r+1],s=o?-t[r]:t[r],l=n[s];o?n[G]>>14<n[Lo]>>16&&(n[G]&3)===e&&(n[G]+=16384,dT(l,i)):dT(l,i)}a(FO,"callHook");var Hi=-1,Wo=class{static{a(this,"NodeInjectorFactory")}factory;name;injectImpl;resolving=!1;canSeeViewProviders;multi;componentProviders;index;providerFactory;constructor(e,t,r,o){this.factory=e,this.name=o,this.canSeeViewProviders=t,this.injectImpl=r}};function RD(n){return n!=null&&typeof n=="object"&&(n.insertBeforeIndex===null||typeof n.insertBeforeIndex=="number"||Array.isArray(n.insertBeforeIndex))}a(RD,"isTNodeShape");function OO(n){return(n.flags&8)!==0}a(OO,"hasClassInput");function UO(n){return(n.flags&16)!==0}a(UO,"hasStyleInput");function VO(n,e,t){let r=0;for(;r<t.length;){let o=t[r];if(typeof o=="number"){if(o!==0)break;r++;let i=t[r++],s=t[r++],l=t[r++];n.setAttribute(e,s,l,i)}else{let i=o,s=t[++r];$O(i)?n.setProperty(e,i,s):n.setAttribute(e,i,s),r++}}return r}a(VO,"setUpAttributes");function MD(n){return n===3||n===4||n===6}a(MD,"isNameOnlyAttributeMarker");function $O(n){return n.charCodeAt(0)===64}a($O,"isAnimationProp");function Ji(n,e){if(!(e===null||e.length===0))if(n===null||n.length===0)n=e.slice();else{let t=-1;for(let r=0;r<e.length;r++){let o=e[r];typeof o=="number"?t=o:t===0||(t===-1||t===2?fT(n,t,o,null,e[++r]):fT(n,t,o,null,null))}}return n}a(Ji,"mergeHostAttrs");function fT(n,e,t,r,o){let i=0,s=n.length;if(e===-1)s=-1;else for(;i<n.length;){let l=n[i++];if(typeof l=="number"){if(l===e){s=-1;break}else if(l>e){s=i-1;break}}}for(;i<n.length;){let l=n[i];if(typeof l=="number")break;if(l===t){o!==null&&(n[i+1]=o);return}i++,o!==null&&i++}s!==-1&&(n.splice(s,0,e),i=s+1),n.splice(i++,0,t),o!==null&&n.splice(i++,0,o)}a(fT,"mergeHostAttribute");function bD(n){return n!==Hi}a(bD,"hasParentInjector");function _u(n){return n&32767}a(_u,"getParentInjectorIndex");function BO(n){return n>>16}a(BO,"getParentInjectorViewOffset");function Tu(n,e){let t=BO(n),r=e;for(;t>0;)r=r[ko],t--;return r}a(Tu,"getParentInjectorView");var Om=!0;function Du(n){let e=Om;return Om=n,e}a(Du,"setIncludeViewProviders");var GO=256,ND=GO-1,PD=5,HO=0,Un={};function qO(n,e,t){let r;typeof t=="string"?r=t.charCodeAt(0)||0:t.hasOwnProperty(No)&&(r=t[No]),r==null&&(r=t[No]=HO++);let o=r&ND,i=1<<o;e.data[n+(o>>PD)]|=i}a(qO,"bloomAdd");function wu(n,e){let t=xD(n,e);if(t!==-1)return t;let r=e[P];r.firstCreatePass&&(n.injectorIndex=e.length,Em(r.data,n),Em(e,null),Em(r.blueprint,null));let o=qg(n,e),i=n.injectorIndex;if(bD(o)){let s=_u(o),l=Tu(o,e),c=l[P].data;for(let u=0;u<8;u++)e[i+u]=l[s+u]|c[s+u]}return e[i+8]=o,i}a(wu,"getOrCreateNodeInjectorForNode");function Em(n,e){n.push(0,0,0,0,0,0,0,0,e)}a(Em,"insertBloom");function xD(n,e){return n.injectorIndex===-1||n.parent&&n.parent.injectorIndex===n.injectorIndex||e[n.injectorIndex+8]===null?-1:n.injectorIndex}a(xD,"getInjectorIndex");function qg(n,e){if(n.parent&&n.parent.injectorIndex!==-1)return n.parent.injectorIndex;let t=0,r=null,o=e;for(;o!==null;){if(r=UD(o),r===null)return Hi;if(t++,o=o[ko],r.injectorIndex!==-1)return r.injectorIndex|t<<16}return Hi}a(qg,"getParentInjectorLocation");function Um(n,e,t){qO(n,e,t)}a(Um,"diPublicInInjector");function zO(n,e){if(e==="class")return n.classes;if(e==="style")return n.styles;let t=n.attrs;if(t){let r=t.length,o=0;for(;o<r;){let i=t[o];if(MD(i))break;if(i===0)o=o+2;else if(typeof i=="number")for(o++;o<r&&typeof t[o]=="string";)o++;else{if(i===e)return t[o+1];o=o+2}}}return null}a(zO,"injectAttributeImpl");function kD(n,e,t){if(t&8||n!==void 0)return n;Oc(e,"NodeInjector")}a(kD,"notFoundValueOrThrow");function LD(n,e,t,r){if(t&8&&r===void 0&&(r=null),(t&3)===0){let o=n[re],i=vt(void 0);try{return o?o.get(e,r,t&8):Tp(e,r,t&8)}finally{vt(i)}}return kD(r,e,t)}a(LD,"lookupTokenUsingModuleInjector");function FD(n,e,t,r=0,o){if(n!==null){if(e[G]&2048&&!(r&2)){let s=jO(n,e,t,r,Un);if(s!==Un)return s}let i=OD(n,e,t,r,Un);if(i!==Un)return i}return LD(e,t,r,o)}a(FD,"getOrCreateInjectable");function OD(n,e,t,r,o){let i=KO(t);if(typeof i=="function"){if(!am(e,n,r))return r&1?kD(o,t,r):LD(e,t,r,o);try{let s;if(s=i(r),s==null&&!(r&8))Oc(t);else return s}finally{lm()}}else if(typeof i=="number"){let s=null,l=xD(n,e),c=Hi,u=r&1?e[it][ot]:null;for((l===-1||r&4)&&(c=l===-1?qg(n,e):e[l+8],c===Hi||!pT(r,!1)?l=-1:(s=e[P],l=_u(c),e=Tu(c,e)));l!==-1;){let f=e[P];if(hT(i,l,f.data)){let p=WO(l,e,t,s,r,u);if(p!==Un)return p}c=e[l+8],c!==Hi&&pT(r,e[P].data[l+8]===u)&&hT(i,l,e)?(s=f,l=_u(c),e=Tu(c,e)):l=-1}}return o}a(OD,"lookupTokenUsingNodeInjector");function WO(n,e,t,r,o,i){let s=e[P],l=s.data[n+8],c=r==null?Nn(l)&&Om:r!=s&&(l.type&3)!==0,u=o&1&&i===l,f=mu(l,s,t,c,u);return f!==null?Wa(e,s,f,l,o):Un}a(WO,"searchTokensOnInjector");function mu(n,e,t,r,o){let i=n.providerIndexes,s=e.data,l=i&1048575,c=n.directiveStart,u=n.directiveEnd,f=i>>20,p=r?l:l+f,m=o?l+f:u;for(let g=p;g<m;g++){let y=s[g];if(g<c&&t===y||g>=c&&y.type===t)return g}if(o){let g=s[c];if(g&&jt(g)&&g.type===t)return c}return null}a(mu,"locateDirectiveOrProvider");function Wa(n,e,t,r,o){let i=n[t],s=e.data;if(i instanceof Wo){let l=i;if(l.resolving)throw _p("");let c=Du(l.canSeeViewProviders);l.resolving=!0;let u=s[t].type||s[t],f,p=l.injectImpl?vt(l.injectImpl):null,m=am(n,r,0);try{i=n[t]=l.factory(void 0,o,s,n,r),e.firstCreatePass&&t>=r.directiveStart&&LO(t,s[t],e)}finally{p!==null&&vt(p),Du(c),l.resolving=!1,lm()}}return i}a(Wa,"getNodeInjectable");function KO(n){if(typeof n=="string")return n.charCodeAt(0)||0;let e=n.hasOwnProperty(No)?n[No]:void 0;return typeof e=="number"?e>=0?e&ND:JO:e}a(KO,"bloomHashBitOrFactory");function hT(n,e,t){let r=1<<n;return!!(t[e+(n>>PD)]&r)}a(hT,"bloomHasToken");function pT(n,e){return!(n&2)&&!(n&1&&e)}a(pT,"shouldSearchParent");var Ho=class{static{a(this,"NodeInjector")}_tNode;_lView;constructor(e,t){this._tNode=e,this._lView=t}get(e,t,r){return FD(this._tNode,this._lView,e,Ao(r),t)}};function JO(){return new Ho(q(),A())}a(JO,"createNodeInjector");function dl(n){return sr(()=>{let e=n.prototype.constructor,t=e[An]||Vm(e),r=Object.prototype,o=Object.getPrototypeOf(n.prototype).constructor;for(;o&&o!==r;){let i=o[An]||Vm(o);if(i&&i!==t)return i;o=Object.getPrototypeOf(o)}return i=>new i})}a(dl,"\u0275\u0275getInheritedFactory");function Vm(n){return Ca(n)?()=>{let e=Vm(ne(n));return e&&e()}:kr(n)}a(Vm,"getFactoryOf");function jO(n,e,t,r,o){let i=n,s=e;for(;i!==null&&s!==null&&s[G]&2048&&!Gr(s);){let l=OD(i,s,t,r|2,Un);if(l!==Un)return l;let c=i.parent;if(!c){let u=s[Lp];if(u){let f=u.get(t,Un,r&-5);if(f!==Un)return f}c=UD(s),s=s[ko]}i=c}return o}a(jO,"lookupTokenUsingEmbeddedInjector");function UD(n){let e=n[P],t=e.type;return t===2?e.declTNode:t===1?n[ot]:null}a(UD,"getTNodeFromLView");function Zu(n){return zO(q(),n)}a(Zu,"\u0275\u0275injectAttribute");var VD=ns("Attribute",n=>({attributeName:n,__NG_ELEMENT_ID__:a(()=>Zu(n),"__NG_ELEMENT_ID__")})),mT=null;function zg(){return mT=mT||new Eu}a(zg,"getReflect");function ed(n){return $D(zg().parameters(n))}a(ed,"reflectDependencies");function $D(n){return n.map(e=>YO(e))}a($D,"convertDependencies");function YO(n){let e={token:null,attribute:null,host:!1,optional:!1,self:!1,skipSelf:!1};if(Array.isArray(n)&&n.length>0)for(let t=0;t<n.length;t++){let r=n[t];if(r===void 0)continue;let o=Object.getPrototypeOf(r);if(r instanceof yD||o.ngMetadataName==="Optional")e.optional=!0;else if(r instanceof vD||o.ngMetadataName==="SkipSelf")e.skipSelf=!0;else if(r instanceof CD||o.ngMetadataName==="Self")e.self=!0;else if(r instanceof SD||o.ngMetadataName==="Host")e.host=!0;else if(r instanceof gD)e.token=r.token;else if(r instanceof VD){if(r.attributeName===void 0)throw new x(-204,!1);e.attribute=r.attributeName}else e.token=r}else n===void 0||Array.isArray(n)&&n.length===0?e.token=null:e.token=n;return e}a(YO,"reflectDependency");function XO(n,e){let t=null,r=null;n.hasOwnProperty(Mi)||Object.defineProperty(n,Mi,{get:a(()=>(t===null&&(t=Bt({usage:0,kind:"injectable",type:n}).compileInjectable(cT,`ng:///${n.name}/\u0275prov.js`,tU(n,e))),t),"get")}),n.hasOwnProperty(An)||Object.defineProperty(n,An,{get:a(()=>{if(r===null){let o=Bt({usage:0,kind:"injectable",type:n});r=o.compileFactory(cT,`ng:///${n.name}/\u0275fac.js`,{name:n.name,type:n,typeArgumentCount:0,deps:ed(n),target:o.FactoryTarget.Injectable})}return r},"get"),configurable:!0})}a(XO,"compileInjectable");var QO=ie({provide:String,useValue:ie});function gT(n){return n.useClass!==void 0}a(gT,"isUseClassProvider");function ZO(n){return QO in n}a(ZO,"isUseValueProvider");function yT(n){return n.useFactory!==void 0}a(yT,"isUseFactoryProvider");function eU(n){return n.useExisting!==void 0}a(eU,"isUseExistingProvider");function tU(n,e){let t=e||{providedIn:null},r={name:n.name,type:n,typeArgumentCount:0,providedIn:t.providedIn};return(gT(t)||yT(t))&&t.deps!==void 0&&(r.deps=$D(t.deps)),gT(t)?r.useClass=t.useClass:ZO(t)?r.useValue=t.useValue:yT(t)?r.useFactory=t.useFactory:eU(t)&&(r.useExisting=t.useExisting),r}a(tU,"getInjectableMetadata");var nU=ul("Injectable",void 0,void 0,void 0,(n,e)=>XO(n,e));function rU(){return os(q(),A())}a(rU,"injectElementRef");function os(n,e){return new Gt(Je(n,e))}a(os,"createElementRef");var Gt=class{static{a(this,"ElementRef")}nativeElement;constructor(e){this.nativeElement=e}static __NG_ELEMENT_ID__=rU};function BD(n){return n instanceof Gt?n.nativeElement:n}a(BD,"unwrapElementRef");function oU(){return this._results[Symbol.iterator]()}a(oU,"symbolIterator");var Au=class{static{a(this,"QueryList")}_emitDistinctChangesOnly;dirty=!0;_onDirty=void 0;_results=[];_changesDetected=!1;_changes=void 0;length=0;first=void 0;last=void 0;get changes(){return this._changes??=new fe}constructor(e=!1){this._emitDistinctChangesOnly=e}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,t){this.dirty=!1;let r=fn(e);(this._changesDetected=!V_(this._results,r,t))&&(this._results=r,this.length=r.length,this.last=r[this.length-1],this.first=r[0])}notifyOnChanges(){this._changes!==void 0&&(this._changesDetected||!this._emitDistinctChangesOnly)&&this._changes.next(this)}onDirty(e){this._onDirty=e}setDirty(){this.dirty=!0,this._onDirty?.()}destroy(){this._changes!==void 0&&(this._changes.complete(),this._changes.unsubscribe())}[Symbol.iterator]=oU};function GD(n){return(n.flags&128)===128}a(GD,"hasInSkipHydrationBlockFlag");var Ka;(function(n){n[n.OnPush=0]="OnPush",n[n.Eager=1]="Eager",n[n.Default=1]="Default"})(Ka||(Ka={}));var Wg=new Map,iU=0;function sU(){return iU++}a(sU,"getUniqueLViewId");function aU(n){Wg.set(n[hn],n)}a(aU,"registerLView");function $m(n){Wg.delete(n[hn])}a($m,"unregisterLView");function lU(){return Wg}a(lU,"getTrackedLViews");var CT="__ngContext__";function Wr(n,e){Et(e)?(n[CT]=e[hn],aU(e)):n[CT]=e}a(Wr,"attachPatchData");function HD(n){return zD(n[Vr])}a(HD,"getFirstLContainer");function qD(n){return zD(n[rt])}a(qD,"getNextLContainer");function zD(n){for(;n!==null&&!Rt(n);)n=n[rt];return n}a(zD,"getNearestLContainer");var Bm;(function(n){n[n.Default=0]="Default",n[n.OnPush=1]="OnPush"})(Bm||(Bm={}));var Gm;(function(n){n[n.Emulated=0]="Emulated",n[n.None=1]="None"})(Gm||(Gm={}));var Hm;function cU(n){Hm=n}a(cU,"setDocument");function fl(){if(Hm!==void 0)return Hm;if(typeof document<"u")return document;throw new x(210,!1)}a(fl,"getDocument");var WD=new F("",{factory:a(()=>uU,"factory")}),uU="ng";var KD=new F(""),dU=new F("",{providedIn:"platform",factory:a(()=>"unknown","factory")}),fU=new F(""),hU=new F("",{factory:a(()=>b(bt).body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null,"factory")}),Kg={breakpoints:[16,32,48,64,96,128,256,384,640,750,828,1080,1200,1920,2048,3840],placeholderResolution:30,disableImageSizeWarning:!1,disableImageLazyLoadWarning:!1},td=new F("",{factory:a(()=>Kg,"factory")});var Ru=class n{static{a(this,"TransferState")}static \u0275prov=$({token:n,providedIn:"root",factory:a(()=>{let e=new n;return(typeof ngServerMode>"u"||!ngServerMode)&&(e.store=pU(b(bt),b(WD))),e},"factory")});store={};onSerializeCallbacks={};get(e,t){return this.store[e]!==void 0?this.store[e]:t}set(e,t){this.store[e]=t}remove(e){delete this.store[e]}hasKey(e){return this.store.hasOwnProperty(e)}get isEmpty(){return Object.keys(this.store).length===0}onSerialize(e,t){this.onSerializeCallbacks[e]=t}toJson(){for(let e in this.onSerializeCallbacks)if(this.onSerializeCallbacks.hasOwnProperty(e))try{this.store[e]=this.onSerializeCallbacks[e]()}catch(t){console.warn("Exception in onSerialize callback: ",t)}return JSON.stringify(this.store).replace(/</g,"\\u003C").replace(/\//g,"\\u002F")}};function pU(n,e){let t=n.getElementById(e+"-state");if(t?.tagName==="SCRIPT"&&t.textContent)try{return JSON.parse(t.textContent)}catch(r){console.warn("Exception while restoring TransferState for app "+e,r)}return{}}a(pU,"retrieveTransferredState");var JD="r";var Jg="di",jg="s",jD="p";var mU=new F(""),YD=!1,XD=new F("",{factory:a(()=>YD,"factory")}),gU=new F(""),yU=new F("");var CU=new F("",{factory:a(()=>[],"factory")}),QD=new F(""),vU=new F("",{factory:a(()=>new Map,"factory")}),SU=new F(""),Mu={passive:!0,capture:!0},Im=new WeakMap,_m=new WeakMap,zr=new WeakMap,vT=["click","keydown"],ST=["mouseenter","mouseover","focusin"],ru=new Map,Ja=class{static{a(this,"DeferEventEntry")}callbacks=new Set;listener=a(()=>{for(let e of this.callbacks)e()},"listener")};function ZD(n,e){let t=_m.get(n);if(!t){t=new Ja,_m.set(n,t);for(let r of vT)n.addEventListener(r,t.listener,Mu)}return t.callbacks.add(e),()=>{let{callbacks:r,listener:o}=t;if(r.delete(e),r.size===0){_m.delete(n);for(let i of vT)n.removeEventListener(i,o,Mu)}}}a(ZD,"onInteraction");function ew(n,e){let t=Im.get(n);if(!t){t=new Ja,Im.set(n,t);for(let r of ST)n.addEventListener(r,t.listener,Mu)}return t.callbacks.add(e),()=>{let{callbacks:r,listener:o}=t;if(r.delete(e),r.size===0){for(let i of ST)n.removeEventListener(i,o,Mu);Im.delete(n)}}}a(ew,"onHover");function EU(n){let e=tw(n);return new IntersectionObserver(t=>{for(let r of t)r.isIntersecting&&zr.has(r.target)&&zr.get(r.target)?.get(e)?.listener()},n)}a(EU,"createIntersectionObserver");function IU(n,e,t,r){let o=tw(r),i=zr.get(n)?.get(o);ru.has(o)||ru.set(o,{observer:t(r),count:0});let s=ru.get(o);if(!i){i=new Ja,s.observer.observe(n);let l=zr.get(n);l?l.set(o,i):(l=new Map,zr.set(n,l)),l.set(o,i),s.count++}return i.callbacks.add(e),()=>{if(zr.get(n)?.has(o)){if(i.callbacks.delete(e),i.callbacks.size===0){s.observer.unobserve(n),s.count--;let l=zr.get(n);l&&(l.delete(o),l.size===0&&zr.delete(n))}s.count===0&&(s.observer.disconnect(),ru.delete(o))}}}a(IU,"onViewport");function tw(n){return n?`${n.rootMargin}/${typeof n.threshold=="number"?n.threshold:n.threshold?.join(`
|
|
3
3
|
`)}`:""}a(tw,"getIntersectionObserverKey");var _U=new F("",{factory:a(()=>({}),"factory")}),ET=new WeakMap;function TU(n,e){if(n==null||typeof n!="object")return;let t=ET.get(n);t||(t=new WeakSet,ET.set(n,t)),t.add(e)}a(TU,"markEventHandledForElement");var DU=a((n,e,t,r)=>{},"_stashEventListenerImpl");function wU(n,e,t,r){DU(n,e,t,r)}a(wU,"stashEventListenerImpl");var hl=new F("");function nd(n){return(n.flags&32)===32}a(nd,"isDetachedByI18n");var AU="__nghData__",RU=AU,MU="__nghDeferData__",nw=MU;var bU=a(()=>null,"_retrieveHydrationInfoImpl");function rw(n,e,t=!1){return bU(n,e,t)}a(rw,"retrieveHydrationInfo");function ow(n){let e=n._lView;return e[P].type===2?null:(Gr(e)&&(e=e[K]),e)}a(ow,"getLNodeForHydration");var qm;(function(n){n.Hydrated="hydrated",n.Skipped="skipped",n.Mismatched="mismatched"})(qm||(qm={}));function Yg(n){return n.get(QD,!1,{optional:!0})}a(Yg,"isIncrementalHydrationEnabled");function NU(n,e){let t=e.get(hl),o=e.get(Ru).get(nw,{}),i=!1,s=n,l=null,c=[];for(;!i&&s;){i=t.has(s);let u=t.hydrating.get(s);if(l===null&&u!=null){l=u.promise;break}c.unshift(s),s=o[s][jD]}return{parentBlockPromise:l,hydrationQueue:c}}a(NU,"getParentBlockHydrationQueue");function iw(n,e){let t=n.contentQueries;if(t!==null){let r=V(null);try{for(let o=0;o<t.length;o+=2){let i=t[o],s=t[o+1];if(s!==-1){let l=n.data[s];Ma(i),l.contentQueries(2,e[s],s)}}}finally{V(r)}}}a(iw,"refreshContentQueries");function zm(n,e,t){Ma(0);let r=V(null);try{e(n,t)}finally{V(r)}}a(zm,"executeViewQueryFn");function Xg(n,e,t){if(Op(e)){let r=V(null);try{let o=e.directiveStart,i=e.directiveEnd;for(let s=o;s<i;s++){let l=n.data[s];if(l.contentQueries){let c=t[s];l.contentQueries(1,c,s)}}}finally{V(r)}}}a(Xg,"executeContentQueries");var gn;(function(n){n[n.Emulated=0]="Emulated",n[n.None=2]="None",n[n.ShadowDom=3]="ShadowDom",n[n.ExperimentalIsolatedShadowDom=4]="ExperimentalIsolatedShadowDom"})(gn||(gn={}));var sw="svg",aw="math",lw={"http://www.w3.org/2000/svg":sw,"http://www.w3.org/1998/Math/MathML":aw},ou;function cw(){if(ou===void 0&&(ou=null,Wt.trustedTypes))try{ou=Wt.trustedTypes.createPolicy("angular",{createHTML:a(n=>n,"createHTML"),createScript:a(n=>n,"createScript"),createScriptURL:a(n=>n,"createScriptURL")})}catch{}return ou}a(cw,"getPolicy$1");function is(n){return cw()?.createHTML(n)||n}a(is,"trustedHTMLFromString");function PU(n){return cw()?.createScriptURL(n)||n}a(PU,"trustedScriptURLFromString");var iu;function Qg(){if(iu===void 0&&(iu=null,Wt.trustedTypes))try{iu=Wt.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:a(n=>n,"createHTML"),createScript:a(n=>n,"createScript"),createScriptURL:a(n=>n,"createScriptURL")})}catch{}return iu}a(Qg,"getPolicy");function IT(n){return Qg()?.createHTML(n)||n}a(IT,"trustedHTMLFromStringBypass");function _T(n){return Qg()?.createScript(n)||n}a(_T,"trustedScriptFromStringBypass");function TT(n){return Qg()?.createScriptURL(n)||n}a(TT,"trustedScriptURLFromStringBypass");var rr=class{static{a(this,"SafeValueImpl")}changingThisBreaksApplicationSecurity;constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${Nc})`}},Wm=class extends rr{static{a(this,"SafeHtmlImpl")}getTypeName(){return"HTML"}},Km=class extends rr{static{a(this,"SafeStyleImpl")}getTypeName(){return"Style"}},Jm=class extends rr{static{a(this,"SafeScriptImpl")}getTypeName(){return"Script"}},jm=class extends rr{static{a(this,"SafeUrlImpl")}getTypeName(){return"URL"}},Ym=class extends rr{static{a(this,"SafeResourceUrlImpl")}getTypeName(){return"ResourceURL"}};function $n(n){return n instanceof rr?n.changingThisBreaksApplicationSecurity:n}a($n,"unwrapSafeValue");function ss(n,e){let t=uw(n);if(t!=null&&t!==e){if(t==="ResourceURL"&&e==="URL")return!0;throw new Error(`Required a safe ${e}, got a ${t} (see ${Nc})`)}return t===e}a(ss,"allowSanitizationBypassAndThrow");function uw(n){return n instanceof rr&&n.getTypeName()||null}a(uw,"getSanitizationBypassType");function xU(n){return new Wm(n)}a(xU,"bypassSanitizationTrustHtml");function kU(n){return new Km(n)}a(kU,"bypassSanitizationTrustStyle");function LU(n){return new Jm(n)}a(LU,"bypassSanitizationTrustScript");function FU(n){return new jm(n)}a(FU,"bypassSanitizationTrustUrl");function OU(n){return new Ym(n)}a(OU,"bypassSanitizationTrustResourceUrl");function dw(n){let e=new Qm(n);return UU()?new Xm(e):e}a(dw,"getInertBodyHelper");var Xm=class{static{a(this,"DOMParserHelper")}inertDocumentHelper;constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e="<body><remove></remove>"+e;try{let t=new window.DOMParser().parseFromString(is(e),"text/html").body;return t===null?this.inertDocumentHelper.getInertBodyElement(e):(t.firstChild?.remove(),t)}catch{return null}}},Qm=class{static{a(this,"InertDocumentHelper")}defaultDoc;inertDocument;constructor(e){this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert")}getInertBodyElement(e){let t=this.inertDocument.createElement("template");return t.innerHTML=is(e),t}};function UU(){try{return!!new window.DOMParser().parseFromString(is(""),"text/html")}catch{return!1}}a(UU,"isDOMParserAvailable");var VU=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function rd(n){return n=String(n),n.match(VU)?n:"unsafe:"+n}a(rd,"_sanitizeUrl");function lr(n){let e={};for(let t of n.split(","))e[t]=!0;return e}a(lr,"tagSet");function pl(...n){let e={};for(let t of n)for(let r in t)t.hasOwnProperty(r)&&(e[r]=!0);return e}a(pl,"merge");var fw=lr("area,br,col,hr,img,wbr"),hw=lr("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),pw=lr("rp,rt"),$U=pl(pw,hw),BU=pl(hw,lr("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),GU=pl(pw,lr("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),Zm=pl(fw,BU,GU,$U),mw=lr("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),HU=lr("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,srcset,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),qU=lr("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext"),eg=pl(mw,HU,qU),zU=lr("script,style,template"),tg=class{static{a(this,"SanitizingHtmlSerializer")}sanitizedSomething=!1;buf=[];sanitizeChildren(e){let t=e.firstChild,r=!0,o=[];for(;t;){if(t.nodeType===Node.ELEMENT_NODE?r=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,r&&t.firstChild){o.push(t),t=JU(t);continue}for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let i=KU(t);if(i){t=i;break}t=o.pop()}}return this.buf.join("")}startElement(e){let t=DT(e).toLowerCase();if(!Zm.hasOwnProperty(t))return this.sanitizedSomething=!0,!zU.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);let r=e.attributes;for(let o=0;o<r.length;o++){let i=r.item(o),s=i.name,l=s.toLowerCase();if(!eg.hasOwnProperty(l)){this.sanitizedSomething=!0;continue}let c=i.value;mw[l]&&(c=rd(c)),this.buf.push(" ",s,'="',wT(c),'"')}return this.buf.push(">"),!0}endElement(e){let t=DT(e).toLowerCase();Zm.hasOwnProperty(t)&&!fw.hasOwnProperty(t)&&(this.buf.push("</"),this.buf.push(t),this.buf.push(">"))}chars(e){this.buf.push(wT(e))}};function WU(n,e){return(n.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)!==Node.DOCUMENT_POSITION_CONTAINED_BY}a(WU,"isClobberedElement");function KU(n){let e=n.nextSibling;if(e&&n!==e.previousSibling)throw gw(e);return e}a(KU,"getNextSibling");function JU(n){let e=n.firstChild;if(e&&WU(n,e))throw gw(e);return e}a(JU,"getFirstChild");function DT(n){let e=n.nodeName;return typeof e=="string"?e:"FORM"}a(DT,"getNodeName");function gw(n){return new Error(`Failed to sanitize html because the element is clobbered: ${n.outerHTML}`)}a(gw,"clobberedElementError");var jU=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,YU=/([^\#-~ |!])/g;function wT(n){return n.replace(/&/g,"&").replace(jU,function(e){let t=e.charCodeAt(0),r=e.charCodeAt(1);return"&#"+((t-55296)*1024+(r-56320)+65536)+";"}).replace(YU,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"<").replace(/>/g,">")}a(wT,"encodeEntities");var su;function yw(n,e){let t=null;try{su=su||dw(n);let r=e?String(e):"";t=su.getInertBodyElement(r);let o=5,i=r;do{if(o===0)throw new Error("Failed to sanitize html because the input is unstable");o--,r=i,i=t.innerHTML,t=su.getInertBodyElement(r)}while(r!==i);let l=new tg().sanitizeChildren(ng(t)||t);return is(l)}finally{if(t){let r=ng(t)||t;for(;r.firstChild;)r.firstChild.remove()}}}a(yw,"_sanitizeHtml");function ng(n){return"content"in n&&XU(n)?n.content:null}a(ng,"getTemplateContent");function XU(n){return n.nodeType===Node.ELEMENT_NODE&&n.nodeName==="TEMPLATE"}a(XU,"isTemplateElement");var QU=/^>|^->|<!--|-->|--!>|<!-$/g,ZU=/(<|>)/g,eV="\u200B$1\u200B";function tV(n){return n.replace(QU,e=>e.replace(ZU,eV))}a(tV,"escapeCommentText");function Cw(n,e){return n.createText(e)}a(Cw,"createTextNode");function vw(n,e,t){n.setValue(e,t)}a(vw,"updateTextNode");function Sw(n,e){return n.createComment(tV(e))}a(Sw,"createCommentNode");function Zg(n,e,t){return n.createElement(e,t)}a(Zg,"createElementNode");function Ko(n,e,t,r,o){n.insertBefore(e,t,r,o)}a(Ko,"nativeInsertBefore");function Ew(n,e,t){n.appendChild(e,t)}a(Ew,"nativeAppendChild");function AT(n,e,t,r,o){r!==null?Ko(n,e,t,r,o):Ew(n,e,t)}a(AT,"nativeAppendOrInsertBefore");function ml(n,e,t,r){n.removeChild(null,e,t,r)}a(ml,"nativeRemoveNode");function nV(n,e,t){n.setAttribute(e,"style",t)}a(nV,"writeDirectStyle");function rV(n,e,t){t===""?n.removeAttribute(e,"class"):n.setAttribute(e,"class",t)}a(rV,"writeDirectClass");function Iw(n,e,t){let{mergedAttrs:r,classes:o,styles:i}=t;r!==null&&VO(n,e,r),o!==null&&rV(n,e,o),i!==null&&nV(n,e,i)}a(Iw,"setupStaticAttributes");function oV(n){let e=A();n.src="",n.srcdoc=is(""),ml(e[W],n)}a(oV,"enforceIframeSecurity");function ey(n,e=!0){if(n[0]!=":")return[null,n];let t=n.indexOf(":",1);if(t===-1){if(e)throw new Error(`Unsupported format "${n}" expecting ":namespace:name"`);return[null,n]}return[n.slice(1,t),n.slice(t+1)]}a(ey,"splitNsName");function ty(n,e,t){if(e!==void 0&&t!==void 0&&ww(e,t)!==pe.HTML)return n;let r=gl();return r?IT(r.sanitize(pe.HTML,n)||""):ss(n,"HTML")?IT($n(n)):yw(fl(),j(n))}a(ty,"\u0275\u0275sanitizeHtml");function ny(n){let e=gl();return e?e.sanitize(pe.STYLE,n)||"":ss(n,"Style")?$n(n):j(n)}a(ny,"\u0275\u0275sanitizeStyle");function ry(n){let e=gl();return e?e.sanitize(pe.URL,n)||"":ss(n,"URL")?$n(n):rd(j(n))}a(ry,"\u0275\u0275sanitizeUrl");function od(n){let e=gl();if(e)return TT(e.sanitize(pe.RESOURCE_URL,n)||"");if(ss(n,"ResourceURL"))return TT($n(n));throw new x(904,!1)}a(od,"\u0275\u0275sanitizeResourceUrl");function oy(n){let e=gl();if(e)return _T(e.sanitize(pe.SCRIPT,n)||"");if(ss(n,"Script"))return _T($n(n));throw new x(905,!1)}a(oy,"\u0275\u0275sanitizeScript");function _w(n){return is(n[0])}a(_w,"\u0275\u0275trustConstantHtml");function Tw(n){return PU(n[0])}a(Tw,"\u0275\u0275trustConstantResourceUrl");function iV(n,e){switch(ww(n,e)){case pe.RESOURCE_URL:return od;case pe.URL:return ry;default:return null}}a(iV,"getUrlSanitizer");function Dw(n,e,t){return iV(e,t)?.(n)??n}a(Dw,"\u0275\u0275sanitizeUrlOrResourceUrl");function gl(){let n=A();return n&&n[Jt].sanitizer}a(gl,"getSanitizer");function ww(n,e){let[t,r]=Aw(n);return Vp(r,e,t)}a(ww,"getSecurityContext");function Aw(n){n=n.toLowerCase();let e=ey(n,!1);if(e[0])return e;let r=ze()===-1?null:$t(),o=r?.namespace;if(n==="#host"&&r?.type===2){let i=Je(r,A());if(i.tagName&&(n=i.tagName.toLowerCase()),o==null){let s=i.namespaceURI;o=s&&lw[s]}}return[o,n]}a(Aw,"resolveElement");var au=new Set(["href","xlink:href"]),sV={animate:{to:au,values:au,from:au},set:{to:au}};function iy(n,e,t){let o=ze()===-1?null:$t();if(o&&o.type!==2)return n;let[i,s]=Aw(e);if(Vp(s,t,i)!==pe.ATTRIBUTE_NO_BINDING)return n;let c=A();if(o){if(s==="iframe"){let f=Je(o,c);oV(f)}else if(i===wi){let f=sV[s]?.[t.toLowerCase()];if(f){let p=Je(o,c);if(aV(p,f))throw new x(-910,!1);return n}}}let u=!1;throw new x(-910,u)}a(iy,"\u0275\u0275validateAttribute");function aV(n,e){for(let t of n.getAttributeNames()){if(t.toLowerCase()!=="attributename")continue;let r=n.getAttribute(t);if(r!==null&&e.has(r.toLowerCase()))return r}return null}a(aV,"getSecuritySensitiveSVGAnimationAttributeName");var lV=!1,k9=new F("",{factory:a(()=>lV,"factory")});function Rw(n){return n.ownerDocument.defaultView}a(Rw,"\u0275\u0275resolveWindow");function Mw(n){return n.ownerDocument}a(Mw,"\u0275\u0275resolveDocument");function bw(n){return n.ownerDocument.body}a(bw,"\u0275\u0275resolveBody");function Bi(n){return n instanceof Function?n():n}a(Bi,"maybeUnwrapFn");function cV(n,e,t){let r=n.length;for(;;){let o=n.indexOf(e,t);if(o===-1)return o;if(o===0||n.charCodeAt(o-1)<=32){let i=e.length;if(o+i===r||n.charCodeAt(o+i)<=32)return o}t=o+1}}a(cV,"classIndexOf");var Nw="ng-template";function uV(n,e,t,r){let o=0;if(r){for(;o<e.length&&typeof e[o]=="string";o+=2)if(e[o]==="class"&&cV(e[o+1].toLowerCase(),t,0)!==-1)return!0}else if(sy(n))return!1;if(o=e.indexOf(1,o),o>-1){let i;for(;++o<e.length&&typeof(i=e[o])=="string";)if(i.toLowerCase()===t)return!0}return!1}a(uV,"isCssClassMatching");function sy(n){return n.type===4&&n.value!==Nw}a(sy,"isInlineTemplate");function dV(n,e,t){let r=n.type===4&&!t?Nw:n.value;return e===r}a(dV,"hasTagAndTypeMatch");function fV(n,e,t){let r=4,o=n.attrs,i=o!==null?mV(o):0,s=!1;for(let l=0;l<e.length;l++){let c=e[l];if(typeof c=="number"){if(!s&&!mn(r)&&!mn(c))return!1;if(s&&mn(c))continue;s=!1,r=c|r&1;continue}if(!s)if(r&4){if(r=2|r&1,c!==""&&!dV(n,c,t)||c===""&&e.length===1){if(mn(r))return!1;s=!0}}else if(r&8){if(o===null||!uV(n,o,c,t)){if(mn(r))return!1;s=!0}}else{let u=e[++l],f=hV(c,o,sy(n),t);if(f===-1){if(mn(r))return!1;s=!0;continue}if(u!==""){let p;if(f>i?p="":p=o[f+1].toLowerCase(),r&2&&u!==p){if(mn(r))return!1;s=!0}}}}return mn(r)||s}a(fV,"isNodeMatchingSelector");function mn(n){return(n&1)===0}a(mn,"isPositive");function hV(n,e,t,r){if(e===null)return-1;let o=0;if(r||!t){let i=!1;for(;o<e.length;){let s=e[o];if(s===n)return o;if(s===3||s===6)i=!0;else if(s===1||s===2){let l=e[++o];for(;typeof l=="string";)l=e[++o];continue}else{if(s===4)break;if(s===0){o+=4;continue}}o+=i?1:2}return-1}else return gV(e,n)}a(hV,"findAttrIndexInNode");function Pw(n,e,t=!1){for(let r=0;r<e.length;r++)if(fV(n,e[r],t))return!0;return!1}a(Pw,"isNodeMatchingSelectorList");function pV(n){let e=n.attrs;if(e!=null){let t=e.indexOf(5);if((t&1)===0)return e[t+1]}return null}a(pV,"getProjectAsAttrValue");function mV(n){for(let e=0;e<n.length;e++){let t=n[e];if(MD(t))return e}return n.length}a(mV,"getNameOnlyMarkerIndex");function gV(n,e){let t=n.indexOf(4);if(t>-1)for(t++;t<n.length;){let r=n[t];if(typeof r=="number")return-1;if(r===e)return t;t++}return-1}a(gV,"matchTemplateAttribute");function yV(n,e){e:for(let t=0;t<e.length;t++){let r=e[t];if(n.length===r.length){for(let o=0;o<n.length;o++)if(n[o]!==r[o])continue e;return!0}}return!1}a(yV,"isSelectorInSelectorList");function RT(n,e){return n?":not("+e.trim()+")":e}a(RT,"maybeWrapInNotSelector");function CV(n){let e=n[0],t=1,r=2,o="",i=!1;for(;t<n.length;){let s=n[t];if(typeof s=="string")if(r&2){let l=n[++t];o+="["+s+(l.length>0?'="'+l+'"':"")+"]"}else r&8?o+="."+s:r&4&&(o+=" "+s);else o!==""&&!mn(s)&&(e+=RT(i,o),o=""),r=s,i=i||!mn(r);t++}return o!==""&&(e+=RT(i,o)),e}a(CV,"stringifyCSSSelector");function vV(n){return n.map(CV).join(",")}a(vV,"stringifyCSSSelectorList");function SV(n){let e=[],t=[],r=1,o=2;for(;r<n.length;){let i=n[r];if(typeof i=="string")o===2?i!==""&&e.push(i,n[++r]):o===8&&t.push(i);else{if(!mn(o))break;o=i}r++}return t.length&&e.push(1,...t),e}a(SV,"extractAttrsAndClassesFromSelector");var ce={};function ay(n,e,t,r,o,i,s,l,c,u,f){let p=K+r,m=p+o,g=EV(p,m),y=typeof u=="function"?u():u;return g[P]={type:n,blueprint:g,template:t,queries:null,viewQuery:l,declTNode:e,data:g.slice().fill(null,p),bindingStartIndex:p,expandoStartIndex:m,hostBindingOpCodes:null,firstCreatePass:!0,firstUpdatePass:!0,staticViewQueries:!1,staticContentQueries:!1,preOrderHooks:null,preOrderCheckHooks:null,contentHooks:null,contentCheckHooks:null,viewHooks:null,viewCheckHooks:null,destroyHooks:null,cleanup:null,contentQueries:null,components:null,directiveRegistry:typeof i=="function"?i():i,pipeRegistry:typeof s=="function"?s():s,firstChild:null,schemas:c,consts:y,incompleteFirstPass:!1,ssrId:f}}a(ay,"createTView");function EV(n,e){let t=[];for(let r=0;r<e;r++)t.push(r<n?null:ce);return t}a(EV,"createViewBlueprint");function xw(n){let e=n.tView;return e===null||e.incompleteFirstPass?n.tView=ay(1,null,n.template,n.decls,n.vars,n.directiveDefs,n.pipeDefs,n.viewQuery,n.schemas,n.consts,n.id):e}a(xw,"getOrCreateComponentTView");function id(n,e,t,r,o,i,s,l,c,u,f){let p=e.blueprint.slice();return p[nt]=o,p[G]=r|4|128|8|64|1024,(u!==null||n&&n[G]&2048)&&(p[G]|=2048),Bp(p),p[Ge]=p[ko]=n,p[be]=t,p[Jt]=s||n&&n[Jt],p[W]=l||n&&n[W],p[re]=c||n&&n[re]||null,p[ot]=i,p[hn]=sU(),p[Ur]=f,p[Lp]=u,p[it]=e.type==2?n[it]:p,p}a(id,"createLView");function IV(n,e,t){let r=Je(e,n),o=xw(t),i=n[Jt].rendererFactory,s=cy(n,id(n,o,null,ly(t),r,e,null,i.createRenderer(r,t),null,null,null));return n[e.index]=s}a(IV,"createComponentLView");function ly(n){let e=16;return n.signals?e=4096:n.onPush&&(e=64),e}a(ly,"getInitialLViewFlagsFromDef");function yl(n,e,t,r){if(t===0)return-1;let o=e.length;for(let i=0;i<t;i++)e.push(r),n.blueprint.push(r),n.data.push(null);return o}a(yl,"allocExpando");function cy(n,e){return n[Vr]?n[Ta][rt]=e:n[Vr]=e,n[Ta]=e,e}a(cy,"addToEndOfViewTree");function Cl(n=1){kw(J(),A(),ze()+n,!1)}a(Cl,"\u0275\u0275advance");function kw(n,e,t,r){if(!r)if((e[G]&3)===3){let i=n.preOrderCheckHooks;i!==null&&hu(e,i,t)}else{let i=n.preOrderHooks;i!==null&&pu(e,i,0,t)}Fn(t)}a(kw,"selectIndexInternal");var ja;(function(n){n[n.None=0]="None",n[n.SignalBased=1]="SignalBased",n[n.HasDecoratorInputTransform=2]="HasDecoratorInputTransform"})(ja||(ja={}));function qi(n,e,t,r){let o=V(null);try{let[i,s,l]=n.inputs[t],c=null;(s&ja.SignalBased)!==0&&(c=e[i][He]),c!==null&&c.transformFn!==void 0?r=c.transformFn(r):l!==null&&(r=l.call(e,r)),n.setInput!==null?n.setInput(e,c,r,t,i):ID(e,c,i,r)}finally{V(o)}}a(qi,"writeToDirectiveInput");var Jo;(function(n){n[n.Important=1]="Important",n[n.DashCase=2]="DashCase"})(Jo||(Jo={}));var rg;function uy(n,e){return rg(n,e)}a(uy,"icuContainerIterate");function _V(n){rg===void 0&&(rg=n())}a(_V,"ensureIcuContainerVisitorLoaded");var Lw=new F("",{factory:a(()=>!1,"factory")}),Fw=new F("",{factory:a(()=>TV,"factory")}),TV=4e3,DV=!1,ri=(typeof ngServerMode>"u"||!ngServerMode)&&typeof document<"u"&&typeof document?.documentElement?.getAnimations=="function";function sd(n){return n[re].get(Lw,DV)}a(sd,"areAnimationsDisabled");function wV(n,e,t){let r=ji.get(n);if(r){for(let o of e)r.classList.push(o);for(let o of t)r.cleanupFns.push(o)}else ji.set(n,{classList:e,cleanupFns:t})}a(wV,"trackEnterClasses");function dy(n){let e=ji.get(n);if(e){for(let t of e.cleanupFns)t();ji.delete(n)}qo.delete(n)}a(dy,"cleanupEnterClassData");var AV=a(()=>{},"noOpAnimationComplete"),ji=new WeakMap,qo=new WeakMap,Ya=new WeakMap,ka=new WeakSet;function og(n,e){let t=Ya.get(n);if(t&&t.length>0){let r=t.findIndex(o=>o===e);r>-1&&t.splice(r,1)}t?.length===0&&Ya.delete(n)}a(og,"clearLeavingNodes");function RV(n,e){let t=Ya.get(n);if(!t||t.length===0)return;let r=e.parentNode,o=e.previousSibling;for(let i=t.length-1;i>=0;i--){let s=t[i],l=s.parentNode;s===e?(t.splice(i,1),ka.add(s),s.dispatchEvent(new CustomEvent("animationend",{detail:{cancel:!0}}))):(o&&s===o||l&&r&&l!==r)&&(t.splice(i,1),s.dispatchEvent(new CustomEvent("animationend",{detail:{cancel:!0}})),s.parentNode?.removeChild(s))}}a(RV,"cancelLeavingNodes");function fy(n,e){let t=Ya.get(n);t?t.includes(e)||t.push(e):Ya.set(n,[e])}a(fy,"trackLeavingNodes");function bu(n){let e=n[bn]??={};return e.enter??=new Map}a(bu,"getLViewEnterAnimations");function jo(n){let e=n[bn]??={};return e.leave??=new Map}a(jo,"getLViewLeaveAnimations");function Ow(n){let e=typeof n=="function"?n():n,t=Array.isArray(e)?e:null;return typeof e=="string"&&(t=e.trim().split(/\s+/).filter(r=>r)),t}a(Ow,"getClassListFromValue");function MV(n,e){if(!ri)return;let t=ji.get(n);if(t&&t.classList.length>0&&bV(n,t.classList))for(let r of t.classList)e.removeClass(n,r);dy(n)}a(MV,"cancelAnimationsIfRunning");function bV(n,e){for(let t of e)if(n.classList.contains(t))return!0;return!1}a(bV,"elementHasClassList");function Xa(n){return n.composedPath?n.composedPath()[0]:n.target}a(Xa,"getEventTarget");function hy(n,e){let t=qo.get(e);return t===void 0?!0:e===Xa(n)&&(t.animationName!==void 0&&n.animationName===t.animationName||t.propertyName!==void 0&&(t.propertyName==="all"||n.propertyName===t.propertyName))}a(hy,"isLongestAnimation");function ad(n,e,t){let r=n.get(e.index)??{animateFns:[]};r.animateFns.push(t),n.set(e.index,r)}a(ad,"addAnimationToLView");function ig(n,e){if(n)for(let t of n)t();for(let t of e)t()}a(ig,"cleanupAfterLeaveAnimations");function sg(n,e){let t=jo(n).get(e.index);t&&(t.resolvers=void 0)}a(sg,"clearLViewNodeAnimationResolvers");function lu(n,e,t,r,o){og(e,t),ig(r,o),sg(n,e)}a(lu,"leaveAnimationFunctionCleanup");function Nu(n){if(!n)return 0;let e=n.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(n)*e}a(Nu,"parseCssTimeUnitsToMs");function Go(n,e){return n.getPropertyValue(e).split(",").map(r=>r.trim())}a(Go,"parseCssPropertyValue");function NV(n){let e=Go(n,"transition-property"),t=Go(n,"transition-duration"),r=Go(n,"transition-delay"),o={propertyName:"",duration:0,animationName:void 0};for(let i=0;i<e.length;i++){let s=Nu(r[i])+Nu(t[i]);s>o.duration&&(o.propertyName=e[i],o.duration=s)}return o}a(NV,"getLongestComputedTransition");function PV(n){let e=Go(n,"animation-name"),t=Go(n,"animation-delay"),r=Go(n,"animation-duration"),o=Go(n,"animation-iteration-count"),i={animationName:"",propertyName:void 0,duration:0};for(let s=0;s<e.length;s++){let l=Nu(t[s])+Nu(r[s]),c=o[s];l>i.duration&&c!=="infinite"&&(i.animationName=e[s],i.duration=l)}return i}a(PV,"getLongestComputedAnimation");function Uw(n,e){return n!==void 0&&n.duration>e.duration}a(Uw,"isShorterThanExistingAnimation");function Vw(n){return(n.animationName!=null||n.propertyName!=null)&&n.duration>0}a(Vw,"longestExists");function xV(n,e){let t=getComputedStyle(n),r=PV(t),o=NV(t),i=r.duration>o.duration?r:o;Uw(e.get(n),i)||Vw(i)&&e.set(n,i)}a(xV,"determineLongestAnimationFromComputedStyles");function $w(n,e,t){if(!t)return;let r=n.getAnimations();return r.length===0?xV(n,e):kV(n,e,r)}a($w,"determineLongestAnimation");function kV(n,e,t){let r={animationName:void 0,propertyName:void 0,duration:0};for(let o of t){let i=o.effect?.getTiming();if(i?.iterations===1/0)continue;let s=typeof i?.duration=="number"?i.duration:0,l=(i?.delay??0)+s,c=o.playbackRate;c!==void 0&&c!==0&&c!==1&&(l/=Math.abs(c));let u,f;o.animationName?f=o.animationName:u=o.transitionProperty,l>=r.duration&&(r={animationName:f,propertyName:u,duration:l})}Uw(e.get(n),r)||Vw(r)&&e.set(n,r)}a(kV,"determineLongestAnimationFromElementAnimations");var Yo=new Set,Qa;(function(n){n[n.CHANGE_DETECTION=0]="CHANGE_DETECTION",n[n.AFTER_NEXT_RENDER=1]="AFTER_NEXT_RENDER"})(Qa||(Qa={}));var oi=new F(""),MT=new Set;function lt(n){MT.has(n)||(MT.add(n),performance?.mark?.("mark_feature_usage",{detail:{feature:n}}))}a(lt,"performanceMarkFeature");var Yi=class n{static{a(this,"AfterRenderManager")}impl=null;execute(){this.impl?.execute()}static \u0275prov=$({token:n,providedIn:"root",factory:a(()=>new n,"factory")})},py=[0,1,2,3],Za=class n{static{a(this,"AfterRenderImpl")}ngZone=b(Se);scheduler=b(un);errorHandler=b(Xn,{optional:!0});sequences=new Set;deferredRegistrations=new Set;executing=!1;constructor(){b(oi,{optional:!0})}execute(){let e=this.sequences.size>0;e&&ae(ee.AfterRenderHooksStart),this.executing=!0;for(let t of py)for(let r of this.sequences)if(!(r.erroredOrDestroyed||!r.hooks[t]))try{r.pipelinedValue=this.ngZone.runOutsideAngular(()=>this.maybeTrace(()=>{let o=r.hooks[t];return o(r.pipelinedValue)},r.snapshot))}catch(o){r.erroredOrDestroyed=!0,this.errorHandler?.handleError(o)}this.executing=!1;for(let t of this.sequences)t.afterRun(),t.once&&(this.sequences.delete(t),t.destroy());for(let t of this.deferredRegistrations)this.sequences.add(t);this.deferredRegistrations.size>0&&this.scheduler.notify(7),this.deferredRegistrations.clear(),e&&ae(ee.AfterRenderHooksEnd)}register(e){let{view:t}=e;t!==void 0?((t[Fo]??=[]).push(e),$o(t),t[G]|=8192):this.executing?this.deferredRegistrations.add(e):this.addSequence(e)}addSequence(e){this.sequences.add(e),this.scheduler.notify(7)}unregister(e){this.executing&&this.sequences.has(e)?(e.erroredOrDestroyed=!0,e.pipelinedValue=void 0,e.once=!0):(this.sequences.delete(e),this.deferredRegistrations.delete(e))}maybeTrace(e,t){return t?t.run(Qa.AFTER_NEXT_RENDER,e):e()}static \u0275prov=$({token:n,providedIn:"root",factory:a(()=>new n,"factory")})},el=class{static{a(this,"AfterRenderSequence")}impl;hooks;view;once;snapshot;erroredOrDestroyed=!1;pipelinedValue=void 0;unregisterOnDestroy;constructor(e,t,r,o,i,s=null){this.impl=e,this.hooks=t,this.view=r,this.once=o,this.snapshot=s,this.unregisterOnDestroy=i?.onDestroy(()=>this.destroy())}afterRun(){this.erroredOrDestroyed=!1,this.pipelinedValue=void 0,this.snapshot?.dispose(),this.snapshot=null}destroy(){this.impl.unregister(this),this.unregisterOnDestroy?.();let e=this.view?.[Fo];e&&(this.view[Fo]=e.filter(t=>t!==this))}};function Bw(n,e){let t=e?.injector??b(tt);return typeof ngServerMode<"u"&&ngServerMode?ld:(lt("NgAfterRender"),Gw(n,t,e,!1))}a(Bw,"afterEveryRender");function my(n,e){let t=e?.injector??b(tt);return typeof ngServerMode<"u"&&ngServerMode?ld:(lt("NgAfterNextRender"),Gw(n,t,e,!0))}a(my,"afterNextRender");function LV(n){return n instanceof Function?[void 0,void 0,n,void 0]:[n.earlyRead,n.write,n.mixedReadWrite,n.read]}a(LV,"getHooks");function Gw(n,e,t,r){let o=e.get(Yi);o.impl??=e.get(Za);let i=e.get(oi,null,{optional:!0}),s=t?.manualCleanup!==!0?e.get(St):null,l=e.get(Or,null,{optional:!0}),c=new el(o.impl,LV(n),l?.view,r,s,i?.snapshot(null));return o.impl.register(c),c}a(Gw,"afterEveryRenderImpl");var ld={destroy(){}},cd=new F("",{factory:a(()=>({queue:new Set,isScheduled:!1,scheduler:null,injector:b(Ot)}),"factory")});function Hw(n,e,t){let r=n.get(cd);if(Array.isArray(e))for(let o of e)r.queue.add(o),t?.detachedLeaveAnimationFns?.push(o);else r.queue.add(e),t?.detachedLeaveAnimationFns?.push(e);r.scheduler&&r.scheduler(n)}a(Hw,"addToAnimationQueue");function FV(n,e){let t=n.get(cd);if(e.detachedLeaveAnimationFns){for(let r of e.detachedLeaveAnimationFns)t.queue.delete(r);e.detachedLeaveAnimationFns=void 0}}a(FV,"removeFromAnimationQueue");function OV(n){let e=n.get(cd);e.isScheduled||(my(()=>{e.isScheduled=!1;for(let t of e.queue)t();e.queue.clear()},{injector:e.injector}),e.isScheduled=!0)}a(OV,"scheduleAnimationQueue");function ud(n){let e=n.get(cd);e.scheduler=OV,e.scheduler(n)}a(ud,"initializeAnimationQueueScheduler");function gy(n,e){for(let[t,r]of e)Hw(n,r.animateFns)}a(gy,"queueEnterAnimations");function bT(n,e,t,r){let o=n?.[bn]?.enter;e!==null&&o&&o.has(t.index)&&gy(r,o)}a(bT,"maybeQueueEnterAnimation");function Gi(n,e,t,r,o,i,s,l){if(o!=null){let c,u=!1;Rt(o)?c=o:Et(o)&&(u=!0,o=o[nt]);let f=Mt(o);n===0&&r!==null?(bT(l,r,i,t),s==null?Ew(e,r,f):Ko(e,r,f,s||null,!0)):n===1&&r!==null?(bT(l,r,i,t),Ko(e,r,f,s||null,!0),RV(i,f)):n===2?(l?.[bn]?.leave?.has(i.index)&&fy(i,f),ka.delete(f),NT(l,i,t,p=>{if(ka.has(f)){ka.delete(f);return}ml(e,f,u,p)})):n===3&&(ka.delete(f),NT(l,i,t,()=>{e.destroyNode(f)})),c!=null&&qV(e,n,t,c,i,r,s)}}a(Gi,"applyToElementOrContainer");function qw(n,e){zw(n,e),e[nt]=null,e[ot]=null}a(qw,"removeViewFromDOM");function UV(n,e,t,r,o,i){r[nt]=o,r[ot]=e,dd(n,r,t,1,o,i)}a(UV,"addViewToDOM");function zw(n,e){e[Jt].changeDetectionScheduler?.notify(9),dd(n,e,e[W],2,null,null)}a(zw,"detachViewFromDOM");function VV(n){let e=n[Vr];if(!e)return Tm(n[P],n);for(;e;){let t=null;if(Et(e))t=e[Vr];else{let r=e[Ne];r&&(t=r)}if(!t){for(;e&&!e[rt]&&e!==n;)Et(e)&&Tm(e[P],e),e=e[Ge];e===null&&(e=n),Et(e)&&Tm(e[P],e),t=e&&e[rt]}e=t}}a(VV,"destroyViewTree");function yy(n,e){let t=n[Oo],r=t.indexOf(e);t.splice(r,1)}a(yy,"detachMovedView");function vl(n,e){if(Pn(e))return;let t=e[W];t.destroyNode&&dd(n,e,t,3,null,null),VV(e)}a(vl,"destroyLView");function Tm(n,e){if(Pn(e))return;let t=V(null);try{e[G]&=-129,e[G]|=256,e[Vt]&&Nr(e[Vt]),GV(n,e),BV(n,e),e[P].type===1&&e[W].destroy();let r=e[$r];if(r!==null&&Rt(e[Ge])){r!==e[Ge]&&yy(r,e);let o=e[Mn];o!==null&&o.detachView(n)}$m(e)}finally{V(t)}}a(Tm,"cleanUpView");function NT(n,e,t,r){let o=n?.[bn];if(o==null||o.leave==null||!o.leave.has(e.index))return r(!1);n&&Yo.add(n[hn]),Hw(t,()=>{if(o.leave&&o.leave.has(e.index)){let s=o.leave.get(e.index),l=[];if(s){for(let c=0;c<s.animateFns.length;c++){let u=s.animateFns[c],{promise:f}=u();l.push(f)}o.detachedLeaveAnimationFns=void 0}o.running=Promise.allSettled(l),$V(n,r)}else n&&Yo.delete(n[hn]),r(!1)},o)}a(NT,"runLeaveAnimationsWithCallback");function $V(n,e){let t=n[bn]?.running;if(t){t.then(()=>{n[bn].running=void 0,Yo.delete(n[hn]),e(!0)});return}e(!1)}a($V,"runAfterLeaveAnimations");function BV(n,e){let t=n.cleanup,r=e[xi];if(t!==null)for(let s=0;s<t.length-1;s+=2)if(typeof t[s]=="string"){let l=t[s+3];l>=0?r[l]():r[-l].unsubscribe(),s+=2}else{let l=r[t[s+1]];t[s].call(l)}r!==null&&(e[xi]=null);let o=e[Yn];if(o!==null){e[Yn]=null;for(let s=0;s<o.length;s++){let l=o[s];l()}}let i=e[Lr];if(i!==null){e[Lr]=null;for(let s of i)s.destroy()}}a(BV,"processCleanups");function GV(n,e){let t;if(n!=null&&(t=n.destroyHooks)!=null)for(let r=0;r<t.length;r+=2){let o=e[t[r]];if(!(o instanceof Wo)){let i=t[r+1];if(Array.isArray(i))for(let s=0;s<i.length;s+=2){let l=o[i[s]],c=i[s+1];ae(ee.LifecycleHookStart,l,c);try{c.call(l)}finally{ae(ee.LifecycleHookEnd,l,c)}}else{ae(ee.LifecycleHookStart,o,i);try{i.call(o)}finally{ae(ee.LifecycleHookEnd,o,i)}}}}}a(GV,"executeOnDestroys");function Ww(n,e,t){return Kw(n,e.parent,t)}a(Ww,"getParentRElement");function Kw(n,e,t){let r=e;for(;r!==null&&r.type&168;)e=r,r=e.parent;if(r===null)return t[nt];if(Nn(r)){let{encapsulation:o}=n.data[r.directiveStart+r.componentOffset];if(o===gn.None||o===gn.Emulated)return null}return Je(r,t)}a(Kw,"getClosestRElement");function Jw(n,e,t){return Yw(n,e,t)}a(Jw,"getInsertInFrontOfRNode");function jw(n,e,t){return n.type&40?Je(n,t):null}a(jw,"getInsertInFrontOfRNodeWithNoI18n");var Yw=jw,ag;function Xw(n,e){Yw=n,ag=e}a(Xw,"setI18nHandling");function Cy(n,e,t,r){let o=Ww(n,r,e),i=e[W],s=r.parent||e[ot],l=Jw(s,r,e);if(o!=null)if(Array.isArray(t))for(let c=0;c<t.length;c++)AT(i,o,t[c],l,!1);else AT(i,o,t,l,!1);ag!==void 0&&ag(i,r,e,t,o)}a(Cy,"appendChild");function La(n,e){if(e!==null){let t=e.type;if(t&3)return Je(e,n);if(t&4)return lg(-1,n[e.index]);if(t&8){let r=e.child;if(r!==null)return La(n,r);{let o=n[e.index];return Rt(o)?lg(-1,o):Mt(o)}}else{if(t&128)return La(n,e.next);if(t&32)return uy(e,n)()||Mt(n[e.index]);{let r=Qw(n,e);if(r!==null){if(Array.isArray(r))return r[0];let o=Fr(n[it]);return La(o,r)}else return La(n,e.next)}}}return null}a(La,"getFirstNativeNode");function Qw(n,e){if(e!==null){let r=n[it][ot],o=e.projection;return r.projection[o]}return null}a(Qw,"getProjectionNodes");function lg(n,e){let t=Ne+n+1;if(t<e.length){let r=e[t],o=r[P].firstChild;if(o!==null)return La(r,o)}return e[Br]}a(lg,"getBeforeNodeForView");function vy(n,e,t,r,o,i,s){for(;t!=null;){let l=r[re];if(t.type===128){t=t.next;continue}let c=r[t.index],u=t.type;if(s&&e===0&&(c&&Wr(Mt(c),r),t.flags|=2),!nd(t))if(u&8)vy(n,e,t.child,r,o,i,!1),Gi(e,n,l,o,c,t,i,r);else if(u&32){let f=uy(t,r),p;for(;p=f();)Gi(e,n,l,o,p,t,i,r);Gi(e,n,l,o,c,t,i,r)}else u&16?Zw(n,e,r,t,o,i):Gi(e,n,l,o,c,t,i,r);t=s?t.projectionNext:t.next}}a(vy,"applyNodes");function dd(n,e,t,r,o,i){vy(t,r,n.firstChild,e,o,i,!1)}a(dd,"applyView");function HV(n,e,t){let r=e[W],o=Ww(n,t,e),i=t.parent||e[ot],s=Jw(i,t,e);Zw(r,0,e,t,o,s)}a(HV,"applyProjection");function Zw(n,e,t,r,o,i){let s=t[it],c=s[ot].projection[r.projection];if(Array.isArray(c))for(let u=0;u<c.length;u++){let f=c[u];Gi(e,n,t[re],o,f,r,i,t)}else{let u=c,f=s[Ge];GD(r)&&(u.flags|=128),vy(n,e,u,f,o,i,!0)}}a(Zw,"applyProjectionRecursive");function qV(n,e,t,r,o,i,s){let l=r[Br],c=Mt(r);l!==c&&Gi(e,n,t,i,l,o,s);for(let u=Ne;u<r.length;u++){let f=r[u];dd(f[P],f,n,e,i,l)}}a(qV,"applyContainer");function zV(n,e,t,r,o){if(e)o?n.addClass(t,r):n.removeClass(t,r);else{let i=r.indexOf("-")===-1?void 0:Jo.DashCase;o==null?n.removeStyle(t,r,i):(typeof o=="string"&&o.endsWith("!important")&&(o=o.slice(0,-10),i|=Jo.Important),n.setStyle(t,r,o,i))}}a(zV,"applyStyling");function eA(n,e,t,r,o){let i=ze(),s=r&2;try{Fn(-1),s&&e.length>K&&kw(n,e,K,!1);let l=s?ee.TemplateUpdateStart:ee.TemplateCreateStart;ae(l,o,t),t(r,o)}finally{Fn(i);let l=s?ee.TemplateUpdateEnd:ee.TemplateCreateEnd;ae(l,o,t)}}a(eA,"executeTemplate");function fd(n,e,t){YV(n,e,t),(t.flags&64)===64&&XV(n,e,t)}a(fd,"createDirectivesInstances");function as(n,e,t=Je){let r=e.localNames;if(r!==null){let o=e.index+1;for(let i=0;i<r.length;i+=2){let s=r[i+1],l=s===-1?t(e,n):n[s];n[o++]=l}}}a(as,"saveResolvedLocalsInData");function WV(n,e,t,r){let i=r.get(XD,YD)||t===gn.ShadowDom||t===gn.ExperimentalIsolatedShadowDom,s=n.selectRootElement(e,i);return KV(s),s}a(WV,"locateHostElement");function KV(n){JV(n)}a(KV,"applyRootElementTransform");var JV=a(()=>null,"_applyRootElementTransformImpl");function jV(n){return n==="class"?"className":n==="for"?"htmlFor":n==="formaction"?"formAction":n==="innerHtml"?"innerHTML":n==="readonly"?"readOnly":n==="tabindex"?"tabIndex":n}a(jV,"mapPropName");function Sy(n,e,t,r,o,i){let s=e[P];if(gd(n,s,e,t,r)){Nn(n)&&tA(e,n.index);return}n.type&3&&(t=jV(t)),Ey(n,e,t,r,o,i)}a(Sy,"setPropertyAndInputs");function Ey(n,e,t,r,o,i){if(n.type&3){let s=Je(n,e);r=i!=null?i(r,n.value||"",t):r,o.setProperty(s,t,r)}else n.type&12}a(Ey,"setDomProperty");function tA(n,e){let t=Yt(e,n);t[G]&16||(t[G]|=64)}a(tA,"markDirtyIfOnPush");function YV(n,e,t){let r=t.directiveStart,o=t.directiveEnd;Nn(t)&&IV(e,t,n.data[r+t.componentOffset]),n.firstCreatePass||wu(t,e);let i=t.initialInputs;for(let s=r;s<o;s++){let l=n.data[s],c=Wa(e,n,s,t);if(Wr(c,e),i!==null&&e$(e,s-r,c,l,t,i),jt(l)){let u=Yt(t.index,e);u[be]=Wa(e,n,s,t)}}}a(YV,"instantiateAllDirectives");function XV(n,e,t){let r=t.directiveStart,o=t.directiveEnd,i=t.index,s=X_();try{Fn(i);for(let l=r;l<o;l++){let c=n.data[l],u=e[l];jc(l),(c.hostBindings!==null||c.hostVars!==0||c.hostAttrs!==null)&&QV(c,u)}}finally{Fn(-1),jc(s)}}a(XV,"invokeDirectivesHostBindings");function QV(n,e){n.hostBindings!==null&&n.hostBindings(1,e)}a(QV,"invokeHostBindingsInCreationMode");function Iy(n,e){let t=n.directiveRegistry,r=null;if(t)for(let o=0;o<t.length;o++){let i=t[o];Pw(e,i.selectors,!1)&&(r??=[],jt(i)?r.unshift(i):r.push(i))}return r}a(Iy,"findDirectiveDefMatches");function ZV(n,e,t,r,o,i){let s=Je(n,e);hd(e[W],s,i,n.value,t,r,o)}a(ZV,"elementAttributeInternal");function hd(n,e,t,r,o,i,s){if(i==null)n.removeAttribute(e,o,t);else{let l=s==null?j(i):s(i,r||"",o);n.setAttribute(e,o,l,t)}}a(hd,"setElementAttribute");function e$(n,e,t,r,o,i){let s=i[e];if(s!==null)for(let l=0;l<s.length;l+=2){let c=s[l],u=s[l+1];qi(r,t,c,u)}}a(e$,"setInputsFromAttrs");function pd(n,e,t,r,o){let i=K+t,s=e[P],l=o(s,e,n,r,t);e[i]=l,xn(n,!0);let c=n.type===2;return c?(Iw(e[W],l,n),(K_()===0||ki(n))&&Wr(l,e),J_()):Wr(l,e),ba()&&(!c||!nd(n))&&Cy(s,e,l,n),n}a(pd,"elementLikeStartShared");function md(n){let e=n;return tm()?nm():(e=e.parent,xn(e,!1)),e}a(md,"elementLikeEndShared");function nA(n,e,t){return(n===null||jt(n))&&(t=$p(t[e.index])),t[W]}a(nA,"loadComponentRenderer");function _y(n,e){let t=n[re];if(!t)return;let r;try{r=t.get(pn,null)}catch{r=null}r?.(e)}a(_y,"handleUncaughtError");function gd(n,e,t,r,o){let i=n.inputs?.[r],s=n.hostDirectiveInputs?.[r],l=!1;if(s)for(let c=0;c<s.length;c+=2){let u=s[c],f=s[c+1],p=e.data[u];qi(p,t[u],f,o),l=!0}if(i)for(let c of i){let u=t[c],f=e.data[c];qi(f,u,r,o),l=!0}return l}a(gd,"setAllInputsForProperty");function t$(n,e){let t=Yt(e,n),r=t[P];n$(r,t);let o=t[nt];o!==null&&t[Ur]===null&&(t[Ur]=rw(o,t[re])),ae(ee.ComponentStart);try{yd(r,t,t[be])}finally{ae(ee.ComponentEnd,t[be])}}a(t$,"renderComponent");function n$(n,e){for(let t=e.length;t<n.blueprint.length;t++)e.push(n.blueprint[t])}a(n$,"syncViewWithBlueprint");function yd(n,e,t){Qc(e);try{let r=n.viewQuery;r!==null&&zm(1,r,t);let o=n.template;o!==null&&eA(n,e,o,1,t),n.firstCreatePass&&(n.firstCreatePass=!1),e[Mn]?.finishViewCreation(n),n.staticContentQueries&&iw(n,e),n.staticViewQueries&&zm(2,n.viewQuery,t);let i=n.components;i!==null&&r$(e,i)}catch(r){throw n.firstCreatePass&&(n.incompleteFirstPass=!0,n.firstCreatePass=!1),r}finally{e[G]&=-5,Zc()}}a(yd,"renderView");function r$(n,e){for(let t=0;t<e.length;t++)t$(n,e[t])}a(r$,"renderChildComponents");function ls(n,e,t,r){let o=V(null);try{let i=e.tView,l=n[G]&4096?4096:16,c=id(n,i,t,l,null,e,null,null,r?.injector??null,r?.embeddedViewInjector??null,r?.dehydratedView??null),u=n[e.index];c[$r]=u;let f=n[Mn];return f!==null&&(c[Mn]=f.createEmbeddedView(i)),yd(i,c,t),c}finally{V(o)}}a(ls,"createAndRenderEmbeddedLView");function Xo(n,e){return!e||e.firstChild===null||GD(n)}a(Xo,"shouldAddViewToDom");var L9=new F("");function tl(n,e,t,r,o=!1){for(;t!==null;){if(t.type===128){t=o?t.projectionNext:t.next;continue}let i=e[t.index];i!==null&&r.push(Mt(i)),Rt(i)&&rA(i,r);let s=t.type;if(s&8)tl(n,e,t.child,r);else if(s&32){let l=uy(t,e),c;for(;c=l();)r.push(c)}else if(s&16){let l=Qw(e,t);if(Array.isArray(l))r.push(...l);else{let c=Fr(e[it]);tl(c[P],c,l,r,!0)}}t=o?t.projectionNext:t.next}return r}a(tl,"collectNativeNodes");function rA(n,e){for(let t=Ne;t<n.length;t++){let r=n[t],o=r[P].firstChild;o!==null&&tl(r[P],r,o,e)}n[Br]!==n[nt]&&e.push(n[Br])}a(rA,"collectNativeNodesInLContainer");function oA(n){if(n[Fo]!==null){for(let e of n[Fo])e.impl.addSequence(e);n[Fo].length=0}}a(oA,"addAfterRenderSequencesForView");var iA=[];function o$(n){return n[Vt]??i$(n)}a(o$,"getOrBorrowReactiveLViewConsumer");function i$(n){let e=iA.pop()??Object.create(a$);return e.lView=n,e}a(i$,"borrowReactiveLViewConsumer");function s$(n){n.lView[Vt]!==n&&(n.lView=null,iA.push(n))}a(s$,"maybeReturnReactiveLViewConsumer");var a$={...Mr,consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:a(n=>{$o(n.lView)},"consumerMarkedDirty"),consumerOnSignalRead(){this.lView[Vt]=this}};function l$(n){let e=n[Vt]??Object.create(c$);return e.lView=n,e}a(l$,"getOrCreateTemporaryConsumer");var c$={...Mr,consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:a(n=>{let e=Fr(n.lView);for(;e&&!sA(e[P]);)e=Fr(e);e&&Gp(e)},"consumerMarkedDirty"),consumerOnSignalRead(){this.lView[Vt]=this}};function sA(n){return n.type!==2}a(sA,"viewShouldHaveReactiveConsumer");function aA(n){if(n[Lr]===null)return;let e=!0;for(;e;){let t=!1;for(let r of n[Lr])r.dirty&&(t=!0,r.zone===null||Zone.current===r.zone?r.run():r.zone.run(()=>r.run()));e=t&&!!(n[G]&8192)}}a(aA,"runEffectsInView");var u$=100;function lA(n,e=0){let r=n[Jt].rendererFactory,o=!1;o||r.begin?.();try{d$(n,e)}finally{o||r.end?.()}}a(lA,"detectChangesInternal");function d$(n,e){let t=om();try{ha(!0),cg(n,e);let r=0;for(;Aa(n);){if(r===u$)throw new x(103,!1);r++,cg(n,1)}}finally{ha(t)}}a(d$,"detectChangesInViewWhileDirty");function cA(n,e,t,r){if(Pn(e))return;let o=e[G],i=!1,s=!1;Qc(e);let l=!0,c=null,u=null;i||(sA(n)?(u=o$(e),c=jn(u)):Ic()===null?(l=!1,u=l$(e),c=jn(u)):e[Vt]&&(Nr(e[Vt]),e[Vt]=null));try{Bp(e),im(n.bindingStartIndex),t!==null&&eA(n,e,t,2,r);let f=(o&3)===3;if(!i)if(f){let g=n.preOrderCheckHooks;g!==null&&hu(e,g,null)}else{let g=n.preOrderHooks;g!==null&&pu(e,g,0,null),Sm(e,0)}if(s||f$(e),aA(e),uA(e,0),n.contentQueries!==null&&iw(n,e),!i)if(f){let g=n.contentCheckHooks;g!==null&&hu(e,g)}else{let g=n.contentHooks;g!==null&&pu(e,g,1),Sm(e,1)}p$(n,e);let p=n.components;p!==null&&fA(e,p,0);let m=n.viewQuery;if(m!==null&&zm(2,m,r),!i)if(f){let g=n.viewCheckHooks;g!==null&&hu(e,g)}else{let g=n.viewHooks;g!==null&&pu(e,g,2),Sm(e,2)}if(n.firstUpdatePass===!0&&(n.firstUpdatePass=!1),e[Hc]){for(let g of e[Hc])g();e[Hc]=null}i||(oA(e),e[G]&=-73)}catch(f){throw i||$o(e),f}finally{u!==null&&(br(u,c),l&&s$(u)),Zc()}}a(cA,"refreshView");function uA(n,e){for(let t=HD(n);t!==null;t=qD(t))for(let r=Ne;r<t.length;r++){let o=t[r];dA(o,e)}}a(uA,"detectChangesInEmbeddedViews");function f$(n){for(let e=HD(n);e!==null;e=qD(e)){if(!(e[G]&2))continue;let t=e[Oo];for(let r=0;r<t.length;r++){let o=t[r];Gp(o)}}}a(f$,"markTransplantedViewsForRefresh");function h$(n,e,t){ae(ee.ComponentStart);let r=Yt(e,n);try{dA(r,t)}finally{ae(ee.ComponentEnd,r[be])}}a(h$,"detectChangesInComponent");function dA(n,e){zc(n)&&cg(n,e)}a(dA,"detectChangesInViewIfAttached");function cg(n,e){let r=n[P],o=n[G],i=n[Vt],s=!!(e===0&&o&16);if(s||=!!(o&64&&e===0),s||=!!(o&1024),s||=!!(i?.dirty&&Ii(i)),s||=!1,i&&(i.dirty=!1),n[G]&=-9217,s)cA(r,n,r.template,n[be]);else if(o&8192){let l=V(null);try{aA(n),uA(n,1);let c=r.components;c!==null&&fA(n,c,1),oA(n)}finally{V(l)}}}a(cg,"detectChangesInView");function fA(n,e,t){for(let r=0;r<e.length;r++)h$(n,e[r],t)}a(fA,"detectChangesInChildComponents");function p$(n,e){let t=n.hostBindingOpCodes;if(t!==null)try{for(let r=0;r<t.length;r++){let o=t[r];if(o<0)Fn(~o);else{let i=o,s=t[++r],l=t[++r];Y_(s,i);let c=e[i];ae(ee.HostBindingsUpdateStart,c);try{l(2,c)}finally{ae(ee.HostBindingsUpdateEnd,c)}}}}finally{Fn(-1)}}a(p$,"processHostBindingOpCodes");function Cd(n,e){let t=om()?64:1088;for(n[Jt].changeDetectionScheduler?.notify(e);n;){n[G]|=t;let r=Fr(n);if(Gr(n)&&!r)return n;n=r}return null}a(Cd,"markViewDirty");function hA(n,e,t,r){return[n,!0,0,e,null,r,null,t,null,null]}a(hA,"createLContainer");function pA(n,e){let t=Ne+e;if(t<n.length)return n[t]}a(pA,"getLViewFromLContainer");function cs(n,e,t,r=!0){let o=e[P];if(m$(o,e,n,t),r){let s=lg(t,n),l=e[W],c=l.parentNode(n[Br]);c!==null&&UV(o,n[ot],l,e,c,s)}let i=e[Ur];i!==null&&i.firstChild!==null&&(i.firstChild=null)}a(cs,"addLViewToLContainer");function Ty(n,e){let t=nl(n,e);return t!==void 0&&vl(t[P],t),t}a(Ty,"removeLViewFromLContainer");function nl(n,e){if(n.length<=Ne)return;let t=Ne+e,r=n[t];if(r){let o=r[$r];o!==null&&o!==n&&yy(o,r),e>0&&(n[t-1][rt]=r[rt]);let i=Ea(n,Ne+e);qw(r[P],r);let s=i[Mn];s!==null&&s.detachView(i[P]),r[Ge]=null,r[rt]=null,r[G]&=-129}return r}a(nl,"detachView");function m$(n,e,t,r){let o=Ne+r,i=t.length;r>0&&(t[o-1][rt]=e),r<i-Ne?(e[rt]=t[o],Dp(t,Ne+r,e)):(t.push(e),e[rt]=null),e[Ge]=t;let s=e[$r];s!==null&&t!==s&&mA(s,e);let l=e[Mn];l!==null&&l.insertView(n),Wc(e),e[G]|=128}a(m$,"insertView");function mA(n,e){let t=n[Oo],r=e[Ge];if(Et(r))n[G]|=2;else{let o=r[Ge][it];e[it]!==o&&(n[G]|=2)}t===null?n[Oo]=[e]:t.push(e)}a(mA,"trackMovedView");var Kr=class{static{a(this,"ViewRef")}_lView;_cdRefInjectingView;_appRef=null;_attachedToViewContainer=!1;exhaustive;get rootNodes(){let e=this._lView,t=e[P];return tl(t,e,t.firstChild,[])}constructor(e,t){this._lView=e,this._cdRefInjectingView=t}get context(){return this._lView[be]}set context(e){this._lView[be]=e}get destroyed(){return Pn(this._lView)}destroy(){if(this._appRef)this._appRef.detachView(this);else if(this._attachedToViewContainer){let e=this._lView[Ge];if(Rt(e)){let t=e[Da],r=t?t.indexOf(this):-1;r>-1&&(nl(e,r),Ea(t,r))}this._attachedToViewContainer=!1}vl(this._lView[P],this._lView)}onDestroy(e){Ra(this._lView,e)}markForCheck(){Cd(this._cdRefInjectingView||this._lView,4)}detach(){this._lView[G]&=-129}reattach(){Wc(this._lView),this._lView[G]|=128}detectChanges(){this._lView[G]|=1024,lA(this._lView)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new x(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null;let e=Gr(this._lView),t=this._lView[$r];t!==null&&!e&&yy(t,this._lView),zw(this._lView[P],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new x(902,!1);this._appRef=e;let t=Gr(this._lView),r=this._lView[$r];r!==null&&!t&&mA(r,this._lView),Wc(this._lView)}};var Jr=class{static{a(this,"TemplateRef")}_declarationLView;_declarationTContainer;elementRef;static __NG_ELEMENT_ID__=g$;constructor(e,t,r){this._declarationLView=e,this._declarationTContainer=t,this.elementRef=r}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(e,t){return this.createEmbeddedViewImpl(e,t)}createEmbeddedViewImpl(e,t,r){let o=ls(this._declarationLView,this._declarationTContainer,e,{embeddedViewInjector:t,dehydratedView:r});return new Kr(o)}};function g$(){return vd(q(),A())}a(g$,"injectTemplateRef");function vd(n,e){return n.type&4?new Jr(e,n,os(n,e)):null}a(vd,"createTemplateRef");function gA(n,e,t){let r=e.insertBeforeIndex,o=Array.isArray(r)?r[0]:r;return o===null?jw(n,e,t):Mt(t[o])}a(gA,"getInsertInFrontOfRNodeWithI18n");function yA(n,e,t,r,o){let i=e.insertBeforeIndex;if(Array.isArray(i)){let s=r,l=null;if(e.type&3||(l=s,s=o),s!==null&&e.componentOffset===-1)for(let c=1;c<i.length;c++){let u=t[i[c]];Ko(n,s,u,l,!1)}}}a(yA,"processI18nInsertBefore");function ii(n,e,t,r,o){let i=n.data[e];if(i===null)i=Dy(n,e,t,r,o),j_()&&(i.flags|=32);else if(i.type&64){i.type=t,i.value=r,i.attrs=o;let s=Li();i.injectorIndex=s===null?-1:s.injectorIndex}return xn(i,!0),i}a(ii,"getOrCreateTNode");function Dy(n,e,t,r,o){let i=em(),s=tm(),l=s?i:i&&i.parent,c=n.data[e]=C$(n,l,t,e,r,o);return y$(n,c,i,s),c}a(Dy,"createTNodeAtIndex");function y$(n,e,t,r){n.firstChild===null&&(n.firstChild=e),t!==null&&(r?t.child==null&&e.parent!==null&&(t.child=e):t.next===null&&(t.next=e,e.prev=t))}a(y$,"linkTNodeInTView");function C$(n,e,t,r,o,i){let s=e?e.injectorIndex:-1,l=0;return Kp()&&(l|=128),{type:t,index:r,insertBeforeIndex:null,injectorIndex:s,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,controlDirectiveIndex:-1,customControlIndex:-1,propertyBindings:null,flags:l,providerIndexes:0,value:o,namespace:fm(),attrs:i,mergedAttrs:null,localNames:null,initialInputs:null,inputs:null,hostDirectiveInputs:null,outputs:null,hostDirectiveOutputs:null,directiveToIndex:null,tView:null,next:null,prev:null,projectionNext:null,child:null,parent:e,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}a(C$,"createTNode");function CA(n,e){if(n.push(e),n.length>1)for(let t=n.length-2;t>=0;t--){let r=n[t];vA(r)||v$(r,e)&&S$(r)===null&&E$(r,e.index)}}a(CA,"addTNodeAndUpdateInsertBeforeIndex");function vA(n){return!(n.type&64)}a(vA,"isI18nText");function v$(n,e){return vA(e)||n.index>e.index}a(v$,"isNewTNodeCreatedBefore");function S$(n){let e=n.insertBeforeIndex;return Array.isArray(e)?e[0]:e}a(S$,"getInsertBeforeIndex");function E$(n,e){let t=n.insertBeforeIndex;Array.isArray(t)?t[0]=e:(Xw(gA,yA),n.insertBeforeIndex=e)}a(E$,"setInsertBeforeIndex");function Ua(n,e){let t=n.data[e];return t===null||typeof t=="string"?null:t.hasOwnProperty("currentCaseLViewIndex")?t:t.value}a(Ua,"getTIcu");function I$(n,e,t){let r=n.data[e];r===null?n.data[e]=t:r.value=t}a(I$,"setTIcu");function _$(n,e){let t=n.insertBeforeIndex;t===null?(Xw(gA,yA),t=n.insertBeforeIndex=[null,e]):(k_(Array.isArray(t),!0,"Expecting array here"),t.push(e))}a(_$,"setTNodeInsertBeforeIndex");function T$(n,e,t){let r=Dy(n,t,64,null,null);return CA(e,r),r}a(T$,"createTNodePlaceholder");function Sd(n,e){let t=e[n.currentCaseLViewIndex];return t===null?t:t<0?~t:t}a(Sd,"getCurrentICUCaseIndex");function D$(n){return n>>>17}a(D$,"getParentFromIcuCreateOpCode");function w$(n){return(n&131070)>>>1}a(w$,"getRefFromIcuCreateOpCode");function A$(n,e,t){return n|e<<17|t<<1}a(A$,"icuCreateOpCode");function R$(n){return n===-1}a(R$,"isRootTemplateMessage");function SA(n,e,t){n.index=0;let r=Sd(e,t);r!==null?n.removes=e.remove[r]:n.removes=se}a(SA,"enterIcu");function ug(n){if(n.index<n.removes.length){let e=n.removes[n.index++];if(e>0)return n.lView[e];{n.stack.push(n.index,n.removes);let t=~e,r=n.lView[P].data[t];return SA(n,r,n.lView),ug(n)}}else return n.stack.length===0?(n.lView=void 0,null):(n.removes=n.stack.pop(),n.index=n.stack.pop(),ug(n))}a(ug,"icuContainerIteratorNext");function M$(){let n={stack:[],index:-1};function e(t,r){for(n.lView=r;n.stack.length;)n.stack.pop();return SA(n,t.value,r),ug.bind(null,n)}return a(e,"icuContainerIteratorStart"),e}a(M$,"loadIcuContainerVisitor");var b$=a(()=>{},"_prepareI18nBlockForHydrationImpl");function N$(n,e,t,r){b$(n,e,t,r)}a(N$,"prepareI18nBlockForHydration");var P$=a(()=>{},"_claimDehydratedIcuCaseImpl");function x$(n,e,t){P$(n,e,t)}a(x$,"claimDehydratedIcuCase");function k$(n){let e=n[Ur];if(e){let{i18nNodes:t,dehydratedIcuData:r}=e;if(t&&r){let o=n[W];for(let i of r.values())L$(o,t,i)}e.i18nNodes=void 0,e.dehydratedIcuData=void 0}}a(k$,"cleanupI18nHydrationData");function L$(n,e,t){for(let r of t.node.cases[t.case]){let o=e.get(r.index-K);o&&ml(n,o,!1)}}a(L$,"cleanupDehydratedIcuData");function EA(n){let e=n[er]??[],r=n[Ge][W],o=[];for(let i of e)i.data[Jg]!==void 0?o.push(i):IA(i,r);n[er]=o}a(EA,"removeDehydratedViews");function F$(n){let{lContainer:e}=n,t=e[er];if(t===null)return;let o=e[Ge][W];for(let i of t)IA(i,o)}a(F$,"removeDehydratedViewList");function IA(n,e){let t=0,r=n.firstChild;if(r){let o=n.data[JD];for(;t<o;){let i=r.nextSibling;ml(e,r,!1),r=i,t++}}}a(IA,"removeDehydratedView");function Ed(n){EA(n);let e=n[nt];Et(e)&&rl(e);for(let t=Ne;t<n.length;t++)rl(n[t])}a(Ed,"cleanupLContainer");function rl(n){k$(n);let e=n[P];for(let t=K;t<e.bindingStartIndex;t++)if(Rt(n[t])){let r=n[t];Ed(r)}else Et(n[t])&&rl(n[t])}a(rl,"cleanupLView");function _A(n){let e=n._views;for(let t of e){let r=ow(t);r!==null&&r[nt]!==null&&(Et(r)?rl(r):Ed(r))}}a(_A,"cleanupDehydratedViews");function O$(n,e,t,r){n!==null&&(t.cleanup(e),Ed(n.lContainer),_A(r))}a(O$,"cleanupHydratedDeferBlocks");var U$=a(()=>null,"_findMatchingDehydratedViewImpl"),V$=a(()=>null,"_findAndReconcileMatchingDehydratedViewsImpl");function Pu(n,e){return U$(n,e)}a(Pu,"findMatchingDehydratedView");function TA(n,e,t){return V$(n,e,t)}a(TA,"findAndReconcileMatchingDehydratedViews");var DA=class{static{a(this,"ComponentRef")}},Id=class{static{a(this,"ComponentFactory")}},dg=class{static{a(this,"_NullComponentFactoryResolver")}resolveComponentFactory(e){throw new x(917,!1)}},Sl=class{static{a(this,"ComponentFactoryResolver")}static NULL=new dg},ol=class{static{a(this,"RendererFactory2")}},Qo=class{static{a(this,"Renderer2")}destroyNode=null;static __NG_ELEMENT_ID__=a(()=>$$(),"__NG_ELEMENT_ID__")};function $$(){let n=A(),e=q(),t=Yt(e.index,n);return(Et(t)?t:n)[W]}a($$,"injectRenderer2");var xu=class n{static{a(this,"Sanitizer")}static \u0275prov=$({token:n,providedIn:"root",factory:a(()=>null,"factory")})};function wy(n){return n.ngModule!==void 0}a(wy,"isModuleWithProviders");function Bo(n){return!!Po(n)}a(Bo,"isNgModule");function cu(n){return!!dn(n)}a(cu,"isPipe");function PT(n){return!!Ut(n)}a(PT,"isDirective");function Va(n){return!!Oe(n)}a(Va,"isComponent");function B$(n){return Oe(n)?"component":Ut(n)?"directive":dn(n)?"pipe":"type"}a(B$,"getDependencyTypeForError");function G$(n,e){if(Ca(n)&&(n=ne(n),!n))throw new Error(`Expected forwardRef function, imported from "${Rn(e)}", to return a standalone entity or NgModule but got "${Rn(n)||n}".`);if(Po(n)==null){let t=Oe(n)||Ut(n)||dn(n);if(t!=null){if(!t.standalone){let r=B$(n);throw new Error(`The "${Rn(n)}" ${r}, imported from "${Rn(e)}", is not standalone. Does the ${r} have the standalone: false flag?`)}}else throw wy(n)?new Error(`A module with providers was imported from "${Rn(e)}". Modules with providers are not supported in standalone components imports.`):new Error(`The "${Rn(n)}" type, imported from "${Rn(e)}", must be a standalone component / directive / pipe or an NgModule. Did you forget to add the required @Component / @Directive / @Pipe or @NgModule annotation?`)}}a(G$,"verifyStandaloneImport");var fg=class{static{a(this,"DepsTracker")}ownerNgModule=new WeakMap;ngModulesWithSomeUnresolvedDecls=new Set;ngModulesScopeCache=new WeakMap;standaloneComponentsScopeCache=new WeakMap;resolveNgModulesDecls(){if(this.ngModulesWithSomeUnresolvedDecls.size!==0){for(let e of this.ngModulesWithSomeUnresolvedDecls){let t=Po(e);if(t?.declarations)for(let r of Bi(t.declarations))Va(r)&&this.ownerNgModule.set(r,e)}this.ngModulesWithSomeUnresolvedDecls.clear()}}getComponentDependencies(e,t){this.resolveNgModulesDecls();let r=Oe(e);if(r===null)throw new Error(`Attempting to get component dependencies for a type that is not a component: ${e}`);if(r.standalone){let o=this.getStandaloneComponentScope(e,t);return o.compilation.isPoisoned?{dependencies:[]}:{dependencies:[...o.compilation.directives,...o.compilation.pipes,...o.compilation.ngModules]}}else{if(!this.ownerNgModule.has(e))return{dependencies:[]};let o=this.getNgModuleScope(this.ownerNgModule.get(e));return o.compilation.isPoisoned?{dependencies:[]}:{dependencies:[...o.compilation.directives,...o.compilation.pipes]}}}registerNgModule(e,t){if(!Bo(e))throw new Error(`Attempting to register a Type which is not NgModule as NgModule: ${e}`);this.ngModulesWithSomeUnresolvedDecls.add(e)}clearScopeCacheFor(e){this.ngModulesScopeCache.delete(e),this.standaloneComponentsScopeCache.delete(e)}getNgModuleScope(e){if(this.ngModulesScopeCache.has(e))return this.ngModulesScopeCache.get(e);let t=this.computeNgModuleScope(e);return this.ngModulesScopeCache.set(e,t),t}computeNgModuleScope(e){let t=Lc(e),r={exported:{directives:new Set,pipes:new Set},compilation:{directives:new Set,pipes:new Set}};for(let o of Bi(t.imports))if(Bo(o)){let i=this.getNgModuleScope(o);qr(i.exported.directives,r.compilation.directives),qr(i.exported.pipes,r.compilation.pipes)}else if(Sa(o))if(PT(o)||Va(o))r.compilation.directives.add(o);else if(cu(o))r.compilation.pipes.add(o);else throw new x(980,"The standalone imported type is neither a component nor a directive nor a pipe");else{r.compilation.isPoisoned=!0;break}if(!r.compilation.isPoisoned)for(let o of Bi(t.declarations)){if(Bo(o)||Sa(o)){r.compilation.isPoisoned=!0;break}cu(o)?r.compilation.pipes.add(o):r.compilation.directives.add(o)}for(let o of Bi(t.exports))if(Bo(o)){let i=this.getNgModuleScope(o);qr(i.exported.directives,r.exported.directives),qr(i.exported.pipes,r.exported.pipes),qr(i.exported.directives,r.compilation.directives),qr(i.exported.pipes,r.compilation.pipes)}else cu(o)?r.exported.pipes.add(o):r.exported.directives.add(o);return r}getStandaloneComponentScope(e,t){if(this.standaloneComponentsScopeCache.has(e))return this.standaloneComponentsScopeCache.get(e);let r=this.computeStandaloneComponentScope(e,t);return this.standaloneComponentsScopeCache.set(e,r),r}computeStandaloneComponentScope(e,t){let r={compilation:{directives:new Set([e]),pipes:new Set,ngModules:new Set}};for(let o of fn(t??[])){let i=ne(o);try{G$(i,e)}catch{return r.compilation.isPoisoned=!0,r}if(Bo(i)){r.compilation.ngModules.add(i);let s=this.getNgModuleScope(i);if(s.exported.isPoisoned)return r.compilation.isPoisoned=!0,r;qr(s.exported.directives,r.compilation.directives),qr(s.exported.pipes,r.compilation.pipes)}else if(cu(i))r.compilation.pipes.add(i);else if(PT(i)||Va(i))r.compilation.directives.add(i);else return r.compilation.isPoisoned=!0,r}return r}isOrphanComponent(e){let t=Oe(e);return!t||t.standalone?!1:(this.resolveNgModulesDecls(),!this.ownerNgModule.has(e))}};function qr(n,e){for(let t of n)e.add(t)}a(qr,"addSet");var Xi=new fg,gu={},zi=class{static{a(this,"ChainedInjector")}injector;parentInjector;constructor(e,t){this.injector=e,this.parentInjector=t}get(e,t,r){let o=this.injector.get(e,gu,r);return o!==gu||t===gu?o:this.parentInjector.get(e,t,r)}};function ku(n,e,t){let r=t?n.styles:null,o=t?n.classes:null,i=0;if(e!==null)for(let s=0;s<e.length;s++){let l=e[s];if(typeof l=="number")i=l;else if(i==1)o=Pc(o,l);else if(i==2){let c=l,u=e[++s];r=Pc(r,c+": "+u+";")}}t?n.styles=r:n.stylesWithoutHost=r,t?n.classes=o:n.classesWithoutHost=o}a(ku,"computeStaticStyling");function $e(n,e=0){let t=A();if(t===null)return le(n,e);let r=q();return FD(r,t,ne(n),e)}a($e,"\u0275\u0275directiveInject");function wA(){let n="invalid";throw new Error(n)}a(wA,"\u0275\u0275invalidFactory");function AA(n,e,t,r,o){let i=r===null?null:{"":-1},s=o(n,t);if(s!==null){let l=s,c=null,u=null;for(let f of s)if(f.resolveHostDirectives!==null){[l,c,u]=f.resolveHostDirectives(s);break}z$(n,e,t,l,i,c,u)}i!==null&&r!==null&&H$(t,r,i)}a(AA,"resolveDirectives");function H$(n,e,t){let r=n.localNames=[];for(let o=0;o<e.length;o+=2){let i=t[e[o+1]];if(i==null)throw new x(-301,!1);r.push(e[o],i)}}a(H$,"cacheMatchingLocalNames");function q$(n,e,t){e.componentOffset=t,(n.components??=[]).push(e.index)}a(q$,"markAsComponentHost");function z$(n,e,t,r,o,i,s){let l=r.length,c=null;for(let m=0;m<l;m++){let g=r[m];c===null&&jt(g)&&(c=g,q$(n,t,m)),Um(wu(t,e),n,g.type)}X$(t,n.data.length,l),c?.viewProvidersResolver&&c.viewProvidersResolver(c);for(let m=0;m<l;m++){let g=r[m];g.providersResolver&&g.providersResolver(g)}let u=!1,f=!1,p=yl(n,e,l,null);l>0&&(t.directiveToIndex=new Map);for(let m=0;m<l;m++){let g=r[m];if(t.mergedAttrs=Ji(t.mergedAttrs,g.hostAttrs),K$(n,t,e,p,g),Y$(p,g,o),s!==null&&s.has(g)){let[C,v]=s.get(g);t.directiveToIndex.set(g.type,[p,C+t.directiveStart,v+t.directiveStart])}else(i===null||!i.has(g))&&t.directiveToIndex.set(g.type,p);g.contentQueries!==null&&(t.flags|=4),(g.hostBindings!==null||g.hostAttrs!==null||g.hostVars!==0)&&(t.flags|=64);let y=g.type.prototype;!u&&(y.ngOnChanges||y.ngOnInit||y.ngDoCheck)&&((n.preOrderHooks??=[]).push(t.index),u=!0),!f&&(y.ngOnChanges||y.ngDoCheck)&&((n.preOrderCheckHooks??=[]).push(t.index),f=!0),p++}W$(n,t,i)}a(z$,"initializeDirectives");function W$(n,e,t){for(let r=e.directiveStart;r<e.directiveEnd;r++){let o=n.data[r];if(t===null||!t.has(o))xT(0,e,o,r),xT(1,e,o,r),LT(e,r,!1);else{let i=t.get(o);kT(0,e,i,r),kT(1,e,i,r),LT(e,r,!0)}}}a(W$,"initializeInputAndOutputAliases");function xT(n,e,t,r){let o=n===0?t.inputs:t.outputs;for(let i in o)if(o.hasOwnProperty(i)){let s;n===0?s=e.inputs??={}:s=e.outputs??={},s[i]??=[],s[i].push(r),RA(e,i)}}a(xT,"setupSelectorMatchedInputsOrOutputs");function kT(n,e,t,r){let o=n===0?t.inputs:t.outputs;for(let i in o)if(o.hasOwnProperty(i)){let s=o[i],l;n===0?l=e.hostDirectiveInputs??={}:l=e.hostDirectiveOutputs??={},l[s]??=[],l[s].push(r,i),RA(e,s)}}a(kT,"setupHostDirectiveInputsOrOutputs");function RA(n,e){e==="class"?n.flags|=8:e==="style"&&(n.flags|=16)}a(RA,"setShadowStylingInputFlags");function LT(n,e,t){let{attrs:r,inputs:o,hostDirectiveInputs:i}=n;if(r===null||!t&&o===null||t&&i===null||sy(n)){n.initialInputs??=[],n.initialInputs.push(null);return}let s=null,l=0;for(;l<r.length;){let c=r[l];if(c===0){l+=4;continue}else if(c===5){l+=2;continue}else if(typeof c=="number")break;if(!t&&o.hasOwnProperty(c)){let u=o[c];for(let f of u)if(f===e){s??=[],s.push(c,r[l+1]);break}}else if(t&&i.hasOwnProperty(c)){let u=i[c];for(let f=0;f<u.length;f+=2)if(u[f]===e){s??=[],s.push(u[f+1],r[l+1]);break}}l+=2}n.initialInputs??=[],n.initialInputs.push(s)}a(LT,"setupInitialInputs");function K$(n,e,t,r,o){n.data[r]=o;let i=o.factory||(o.factory=kr(o.type,!0)),s=new Wo(i,jt(o),$e,null);n.blueprint[r]=s,t[r]=s,J$(n,e,r,yl(n,t,o.hostVars,ce),o)}a(K$,"configureViewWithDirective");function J$(n,e,t,r,o){let i=o.hostBindings;if(i){let s=n.hostBindingOpCodes;s===null&&(s=n.hostBindingOpCodes=[]);let l=~e.index;j$(s)!=l&&s.push(l),s.push(t,r,i)}}a(J$,"registerHostBindingOpCodes");function j$(n){let e=n.length;for(;e>0;){let t=n[--e];if(typeof t=="number"&&t<0)return t}return 0}a(j$,"lastSelectedElementIdx");function Y$(n,e,t){if(t){if(e.exportAs)for(let r=0;r<e.exportAs.length;r++)t[e.exportAs[r]]=n;jt(e)&&(t[""]=n)}}a(Y$,"saveNameToExportMap");function X$(n,e,t){n.flags|=1,n.directiveStart=e,n.directiveEnd=e+t,n.providerIndexes=e}a(X$,"initTNodeFlags");function Ay(n,e,t,r,o,i,s,l){let c=e[P],u=c.consts,f=st(u,s),p=ii(c,n,t,r,f);return i&&AA(c,e,p,st(u,l),o),p.mergedAttrs=Ji(p.mergedAttrs,p.attrs),p.attrs!==null&&ku(p,p.attrs,!1),p.mergedAttrs!==null&&ku(p,p.mergedAttrs,!0),c.queries!==null&&c.queries.elementStart(c,p),p}a(Ay,"directiveHostFirstCreatePass");function Ry(n,e){wD(n,e),Op(e)&&n.queries.elementEnd(e)}a(Ry,"directiveHostEndFirstCreatePass");function MA(n,e,t,r,o,i){let s=e.consts,l=st(s,o),c=ii(e,n,t,r,l);if(c.mergedAttrs=Ji(c.mergedAttrs,c.attrs),i!=null){let u=st(s,i);c.localNames=[];for(let f=0;f<u.length;f+=2)c.localNames.push(u[f],-1)}return c.attrs!==null&&ku(c,c.attrs,!1),c.mergedAttrs!==null&&ku(c,c.mergedAttrs,!0),e.queries!==null&&e.queries.elementStart(e,c),c}a(MA,"domOnlyFirstCreatePass");function My(n){return _d(n)?Array.isArray(n)||!(n instanceof Map)&&Symbol.iterator in n:!1}a(My,"isListLikeIterable");function bA(n,e){if(Array.isArray(n))for(let t=0;t<n.length;t++)e(n[t]);else{let t=n[Symbol.iterator](),r;for(;!(r=t.next()).done;)e(r.value)}}a(bA,"iterateListLike");function _d(n){return n!==null&&(typeof n=="function"||typeof n=="object")}a(_d,"isJsObject");function yn(n,e,t){return n[e]=t}a(yn,"updateBinding");function us(n,e){return n[e]}a(us,"getBinding");function Ue(n,e,t){if(t===ce)return!1;let r=n[e];return Object.is(r,t)?!1:(n[e]=t,!0)}a(Ue,"bindingUpdated");function Zo(n,e,t,r){let o=Ue(n,e,t);return Ue(n,e+1,r)||o}a(Zo,"bindingUpdated2");function Td(n,e,t,r,o){let i=Zo(n,e,t,r);return Ue(n,e+2,o)||i}a(Td,"bindingUpdated3");function Xt(n,e,t,r,o,i){let s=Zo(n,e,t,r);return Zo(n,e+2,o,i)||s}a(Xt,"bindingUpdated4");function zo(n,e,t){return a(function r(o){let i=r.__ngNativeEl__;i!==void 0&&TU(o,i);let s=Nn(n)?Yt(n.index,e):e;Cd(s,5);let l=e[be],c=FT(e,l,t,o),u=r.__ngNextListenerFn__;for(;u;)c=FT(e,l,u,o)&&c,u=u.__ngNextListenerFn__;return c},"wrapListenerIn_markDirtyAndPreventDefault")}a(zo,"wrapListener");function FT(n,e,t,r){let o=V(null);try{return ae(ee.OutputStart,e,t),t(r)!==!1}catch(i){return _y(n,i),!1}finally{ae(ee.OutputEnd,e,t),V(o)}}a(FT,"executeListenerWithErrorHandling");function by(n,e,t,r,o,i,s,l){let c=ki(n),u=!1,f=null;if(!r&&c&&(f=Z$(e,t,i,n.index)),f!==null){let p=f.__ngLastListenerFn__||f;p.__ngNextListenerFn__=s,f.__ngLastListenerFn__=s,u=!0}else{let p=Je(n,t),m=r?r(p):p;wU(t,m,i,l),r||(l.__ngNativeEl__=p);let g=o.listen(m,i,l);if(!Q$(i)){let y=r?C=>r(Mt(C[n.index])):n.index;NA(y,e,t,i,l,g,!1)}}return u}a(by,"listenToDomEvent");function Q$(n){return n.startsWith("animation")||n.startsWith("transition")}a(Q$,"isAnimationEventType");function Z$(n,e,t,r){let o=n.cleanup;if(o!=null)for(let i=0;i<o.length-1;i+=2){let s=o[i];if(s===t&&o[i+1]===r){let l=e[xi],c=o[i+2];return l&&l.length>c?l[c]:null}typeof s=="string"&&(i+=2)}return null}a(Z$,"findExistingListener");function NA(n,e,t,r,o,i,s){let l=e.firstCreatePass?zp(e):null,c=qp(t),u=c.length;c.push(o,i),l&&l.push(r,n,u,(u+1)*(s?-1:1))}a(NA,"storeListenerCleanup");function Lu(n,e,t,r,o,i){let s=e[t],l=e[P],u=l.data[t].outputs[r],p=s[u].subscribe(i);NA(n.index,l,e,o,i,p,!0)}a(Lu,"listenToOutput");function PA(){eB()}a(PA,"\u0275\u0275controlCreate");function eB(){let n=A(),e=J(),t=q();if(e.firstCreatePass&&nB(e,t),t.controlDirectiveIndex===-1)return;lt("NgSignalForms");let r=n[t.controlDirectiveIndex];e.data[t.controlDirectiveIndex].controlDef.create(r,new Fu(n,e,t))}a(eB,"controlCreateInternal");function xA(){tB()}a(xA,"\u0275\u0275control");function tB(){let n=A(),e=J(),t=$t();if(t.controlDirectiveIndex===-1)return;let r=e.data[t.controlDirectiveIndex].controlDef,o=n[t.controlDirectiveIndex];r.update(o,new Fu(n,e,t))}a(tB,"controlUpdateInternal");var Fu=class{static{a(this,"ControlDirectiveHostImpl")}lView;tView;tNode;hasPassThrough;constructor(e,t,r){this.lView=e,this.tView=t,this.tNode=r,this.hasPassThrough=!!(r.flags&4096)}get customControl(){return this.tNode.customControlIndex!==-1?this.lView[this.tNode.customControlIndex]:void 0}get descriptor(){return`<${this.tNode.value}>`}listenToCustomControlOutput(e,t){kA(this.tView.data[this.tNode.customControlIndex],e)&&Lu(this.tNode,this.lView,this.tNode.customControlIndex,e,e,zo(this.tNode,this.lView,t))}listenToCustomControlModel(e){let t=this.tNode.flags&1024?"valueChange":"checkedChange";Lu(this.tNode,this.lView,this.tNode.customControlIndex,t,t,zo(this.tNode,this.lView,e))}listenToDom(e,t){by(this.tNode,this.tView,this.lView,void 0,this.lView[W],e,t,zo(this.tNode,this.lView,t))}setInputOnDirectives(e,t){let r=this.tNode.inputs?.[e],o=this.tNode.hostDirectiveInputs?.[e];if(!r&&!o)return!1;if(r)for(let i of r){let s=this.tView.data[i],l=this.lView[i];qi(s,l,e,t)}if(o)for(let i=0;i<o.length;i+=2){let s=o[i],l=o[i+1],c=this.tView.data[s],u=this.lView[s];qi(c,u,l,t)}return!0}setCustomControlModelInput(e){let t=this.lView[this.tNode.customControlIndex],r=this.tView.data[this.tNode.customControlIndex],o=this.tNode.flags&1024?"value":"checked";qi(r,t,o,e)}customControlHasInput(e){return this.tNode.customControlIndex===-1?!1:this.tView.data[this.tNode.customControlIndex].inputs[e]!=null}};function nB(n,e,t){for(let o=e.directiveStart;o<e.directiveEnd;o++)if(n.data[o].controlDef){e.controlDirectiveIndex=o;break}if(e.controlDirectiveIndex===-1)return;let r=n.data[e.controlDirectiveIndex].controlDef;if(r.passThroughInput&&(e.inputs?.[r.passThroughInput]?.length??0)>1){e.flags|=4096;return}rB(n,e)}a(nB,"initializeControlFirstCreatePass");function rB(n,e){for(let t=e.directiveStart;t<e.directiveEnd;t++){let r=n.data[t];if(OT(r,"value")){e.flags|=1024,e.customControlIndex=t;return}if(OT(r,"checked")){e.flags|=2048,e.customControlIndex=t;return}}}a(rB,"initializeCustomControlStatus");function OT(n,e){return oB(n,e)&&kA(n,e+"Change")}a(OT,"hasModelInput");function oB(n,e){return e in n.inputs}a(oB,"hasInput");function kA(n,e){return e in n.outputs}a(kA,"hasOutput");var hg=Symbol("BINDING");function LA(n){return n.debugInfo?.className||n.type.name||null}a(LA,"getComponentName");var Ou=class extends Sl{static{a(this,"ComponentFactoryResolver")}ngModule;constructor(e){super(),this.ngModule=e}resolveComponentFactory(e){let t=Oe(e);return new ei(t,this.ngModule)}};function iB(n){return Object.keys(n).map(e=>{let[t,r,o]=n[e],i={propName:t,templateName:e,isSignal:(r&ja.SignalBased)!==0};return o&&(i.transform=o),i})}a(iB,"toInputRefArray");function sB(n){return Object.keys(n).map(e=>({propName:n[e],templateName:e}))}a(sB,"toOutputRefArray");function aB(n,e,t){let r=e instanceof Ot?e:e?.injector;return r&&n.getStandaloneInjector!==null&&(r=n.getStandaloneInjector(r)||r),r?new zi(t,r):t}a(aB,"createRootViewInjector");function lB(n){let e=n.get(ol,null);if(e===null)throw new x(407,!1);let t=n.get(xu,null),r=n.get(un,null),o=n.get(oi,null,{optional:!0});return{rendererFactory:e,sanitizer:t,changeDetectionScheduler:r,ngReflect:!1,tracingService:o}}a(lB,"createRootLViewEnvironment");function cB(n,e){let t=FA(n);return Zg(e,t,t==="svg"?wi:t==="math"?qc:null)}a(cB,"createHostElement");function uB(n){if(n?.toLowerCase()==="script")throw new x(905,!1)}a(uB,"assertNotScriptHostElement");function FA(n){return(n.selectors[0][0]||"div").toLowerCase()}a(FA,"inferTagNameFromDefinition");var ei=class extends Id{static{a(this,"ComponentFactory")}componentDef;ngModule;selector;componentType;ngContentSelectors;isBoundToModule;cachedInputs=null;cachedOutputs=null;get inputs(){return this.cachedInputs??=iB(this.componentDef.inputs),this.cachedInputs}get outputs(){return this.cachedOutputs??=sB(this.componentDef.outputs),this.cachedOutputs}constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=vV(e.selectors),this.ngContentSelectors=e.ngContentSelectors??[],this.isBoundToModule=!!t}create(e,t,r,o,i,s){ae(ee.DynamicComponentStart);let l=V(null);try{let c=this.componentDef,u=aB(c,o||this.ngModule,e),f=lB(u),p=f.tracingService;return p&&p.componentCreate?p.componentCreate(LA(c),()=>this.createComponentRef(f,u,t,r,i,s)):this.createComponentRef(f,u,t,r,i,s)}finally{V(l)}}createComponentRef(e,t,r,o,i,s){let l=this.componentDef,c=dB(o,l,s,i),u=e.rendererFactory.createRenderer(null,l),f=o?WV(u,o,l.encapsulation,t):cB(l,u);uB(f?.tagName);let p=s?.some(UT)||i?.some(y=>typeof y!="function"&&y.bindings.some(UT)),m=id(null,c,null,512|ly(l),null,null,e,u,t,null,rw(f,t,!0));m[K]=f,Qc(m);let g=null;try{let y=Ay(K,m,2,"#host",()=>c.directiveRegistry,!0,0);Iw(u,f,y),Wr(f,m),fd(c,m,y),Xg(c,y,m),Ry(c,y),r!==void 0&&hB(y,this.ngContentSelectors,r),g=Yt(y.index,m),m[be]=g[be],yd(c,m,null)}catch(y){throw g!==null&&$m(g),$m(m),y}finally{ae(ee.DynamicComponentEnd),Zc()}return new Uu(this.componentType,m,!!p)}};function dB(n,e,t,r){let o=n?["ng-version","21.2.22"]:SV(e.selectors[0]),i=null,s=null,l=0;if(t)for(let f of t)l+=f[hg].requiredVars,f.create&&(f.targetIdx=0,(i??=[]).push(f)),f.update&&(f.targetIdx=0,(s??=[]).push(f));if(r)for(let f=0;f<r.length;f++){let p=r[f];if(typeof p!="function")for(let m of p.bindings){l+=m[hg].requiredVars;let g=f+1;m.create&&(m.targetIdx=g,(i??=[]).push(m)),m.update&&(m.targetIdx=g,(s??=[]).push(m))}}let c=[e];if(r)for(let f of r){let p=typeof f=="function"?f:f.type,m=Ut(p);c.push(m)}return ay(0,null,fB(i,s),1,l,c,null,null,null,[o],null)}a(dB,"createRootTView");function fB(n,e){return!n&&!e?null:t=>{if(t&1&&n)for(let r of n)r.create();if(t&2&&e)for(let r of e)r.update()}}a(fB,"getRootTViewTemplate");function UT(n){let e=n[hg].kind;return e==="input"||e==="twoWay"}a(UT,"isInputBinding");var Uu=class extends DA{static{a(this,"ComponentRef")}_rootLView;_hasInputBindings;instance;hostView;changeDetectorRef;componentType;location;previousInputValues=null;_tNode;constructor(e,t,r){super(),this._rootLView=t,this._hasInputBindings=r,this._tNode=Vo(t[P],K),this.location=os(this._tNode,t),this.instance=Yt(this._tNode.index,t)[be],this.hostView=this.changeDetectorRef=new Kr(t,void 0),this.componentType=e}setInput(e,t){this._hasInputBindings;let r=this._tNode;if(this.previousInputValues??=new Map,this.previousInputValues.has(e)&&Object.is(this.previousInputValues.get(e),t))return;let o=this._rootLView,i=gd(r,o[P],o,e,t);this.previousInputValues.set(e,t);let s=Yt(r.index,o);Cd(s,1)}get injector(){return new Ho(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}};function hB(n,e,t){let r=n.projection=[];for(let o=0;o<e.length;o++){let i=t[o];r.push(i!=null&&i.length?Array.from(i):null)}}a(hB,"projectNodes");var or=class{static{a(this,"ViewContainerRef")}static __NG_ELEMENT_ID__=pB};function pB(){let n=q();return OA(n,A())}a(pB,"injectViewContainerRef");var pg=class n extends or{static{a(this,"R3ViewContainerRef")}_lContainer;_hostTNode;_hostLView;constructor(e,t,r){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=r}get element(){return os(this._hostTNode,this._hostLView)}get injector(){return new Ho(this._hostTNode,this._hostLView)}get parentInjector(){let e=qg(this._hostTNode,this._hostLView);if(bD(e)){let t=Tu(e,this._hostLView),r=_u(e),o=t[P].data[r+8];return new Ho(o,t)}else return new Ho(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){let t=VT(this._lContainer);return t!==null&&t[e]||null}get length(){return this._lContainer.length-Ne}createEmbeddedView(e,t,r){let o,i;typeof r=="number"?o=r:r!=null&&(o=r.index,i=r.injector);let s=Pu(this._lContainer,e.ssrId),l=e.createEmbeddedViewImpl(t||{},i,s);return this.insertImpl(l,o,Xo(this._hostTNode,s)),l}createComponent(e,t,r,o,i,s,l){let c=e&&!xa(e),u;if(c)u=t;else{let v=t||{};u=v.index,r=v.injector,o=v.projectableNodes,i=v.environmentInjector||v.ngModuleRef,s=v.directives,l=v.bindings}let f=c?e:new ei(Oe(e)),p=r||this.parentInjector;if(!i&&f.ngModule==null){let S=(c?p:this.parentInjector).get(Ot,null);S&&(i=S)}let m=Oe(f.componentType??{}),g=Pu(this._lContainer,m?.id??null),y=g?.firstChild??null,C=f.create(p,o,y,i,s,l);return this.insertImpl(C.hostView,u,Xo(this._hostTNode,g)),C}insert(e,t){return this.insertImpl(e,t,!0)}insertImpl(e,t,r){let o=e._lView;if(z_(o)){let l=this.indexOf(e);if(l!==-1)this.detach(l);else{let c=o[Ge],u=new n(c,c[ot],c[Ge]);u.detach(u.indexOf(e))}}let i=this._adjustIndex(t),s=this._lContainer;return cs(s,o,i,r),e.attachToViewContainerRef(),Dp(Dm(s),i,e),e}move(e,t){return this.insert(e,t)}indexOf(e){let t=VT(this._lContainer);return t!==null?t.indexOf(e):-1}remove(e){let t=this._adjustIndex(e,-1),r=nl(this._lContainer,t);r&&(Ea(Dm(this._lContainer),t),vl(r[P],r))}detach(e){let t=this._adjustIndex(e,-1),r=nl(this._lContainer,t);return r&&Ea(Dm(this._lContainer),t)!=null?new Kr(r):null}_adjustIndex(e,t=0){return e??this.length+t}};function VT(n){return n[Da]}a(VT,"getViewRefs");function Dm(n){return n[Da]||(n[Da]=[])}a(Dm,"getOrCreateViewRefs");function OA(n,e){let t,r=e[n.index];return Rt(r)?t=r:(t=hA(r,e,null,n),e[n.index]=t,cy(e,t)),gB(t,e,n,r),new pg(t,n,e)}a(OA,"createContainerRef");function mB(n,e){let t=n[W],r=t.createComment(""),o=Je(e,n),i=t.parentNode(o);return Ko(t,i,r,t.nextSibling(o),!1),r}a(mB,"insertAnchorNode");var gB=CB,yB=a(()=>!1,"_populateDehydratedViewsInLContainer");function UA(n,e,t){return yB(n,e,t)}a(UA,"populateDehydratedViewsInLContainer");function CB(n,e,t,r){if(n[Br])return;let o;t.type&8?o=Mt(r):o=mB(e,t),n[Br]=o}a(CB,"createAnchorNode");var mg=class n{static{a(this,"LQuery_")}queryList;matches=null;constructor(e){this.queryList=e}clone(){return new n(this.queryList)}setDirty(){this.queryList.setDirty()}},gg=class n{static{a(this,"LQueries_")}queries;constructor(e=[]){this.queries=e}createEmbeddedView(e){let t=e.queries;if(t!==null){let r=e.contentQueries!==null?e.contentQueries[0]:t.length,o=[];for(let i=0;i<r;i++){let s=t.getByIndex(i),l=this.queries[s.indexInDeclarationView];o.push(l.clone())}return new n(o)}return null}insertView(e){this.dirtyQueriesWithMatches(e)}detachView(e){this.dirtyQueriesWithMatches(e)}finishViewCreation(e){this.dirtyQueriesWithMatches(e)}dirtyQueriesWithMatches(e){for(let t=0;t<this.queries.length;t++)Py(e,t).matches!==null&&this.queries[t].setDirty()}},Vu=class{static{a(this,"TQueryMetadata_")}flags;read;predicate;constructor(e,t,r=null){this.flags=t,this.read=r,typeof e=="string"?this.predicate=_B(e):this.predicate=e}},yg=class n{static{a(this,"TQueries_")}queries;constructor(e=[]){this.queries=e}elementStart(e,t){for(let r=0;r<this.queries.length;r++)this.queries[r].elementStart(e,t)}elementEnd(e){for(let t=0;t<this.queries.length;t++)this.queries[t].elementEnd(e)}embeddedTView(e){let t=null;for(let r=0;r<this.length;r++){let o=t!==null?t.length:0,i=this.getByIndex(r).embeddedTView(e,o);i&&(i.indexInDeclarationView=r,t!==null?t.push(i):t=[i])}return t!==null?new n(t):null}template(e,t){for(let r=0;r<this.queries.length;r++)this.queries[r].template(e,t)}getByIndex(e){return this.queries[e]}get length(){return this.queries.length}track(e){this.queries.push(e)}},Cg=class n{static{a(this,"TQuery_")}metadata;matches=null;indexInDeclarationView=-1;crossesNgTemplate=!1;_declarationNodeIndex;_appliesToNextNode=!0;constructor(e,t=-1){this.metadata=e,this._declarationNodeIndex=t}elementStart(e,t){this.isApplyingToNode(t)&&this.matchTNode(e,t)}elementEnd(e){this._declarationNodeIndex===e.index&&(this._appliesToNextNode=!1)}template(e,t){this.elementStart(e,t)}embeddedTView(e,t){return this.isApplyingToNode(e)?(this.crossesNgTemplate=!0,this.addMatch(-e.index,t),new n(this.metadata)):null}isApplyingToNode(e){if(this._appliesToNextNode&&(this.metadata.flags&1)!==1){let t=this._declarationNodeIndex,r=e.parent;for(;r!==null&&r.type&8&&r.index!==t;)r=r.parent;return t===(r!==null?r.index:-1)}return this._appliesToNextNode}matchTNode(e,t){let r=this.metadata.predicate;if(Array.isArray(r))for(let o=0;o<r.length;o++){let i=r[o];this.matchTNodeWithReadOption(e,t,vB(t,i)),this.matchTNodeWithReadOption(e,t,mu(t,e,i,!1,!1))}else r===Jr?t.type&4&&this.matchTNodeWithReadOption(e,t,-1):this.matchTNodeWithReadOption(e,t,mu(t,e,r,!1,!1))}matchTNodeWithReadOption(e,t,r){if(r!==null){let o=this.metadata.read;if(o!==null)if(o===Gt||o===or||o===Jr&&t.type&4)this.addMatch(t.index,-2);else{let i=mu(t,e,o,!1,!1);i!==null&&this.addMatch(t.index,i)}else this.addMatch(t.index,r)}}addMatch(e,t){this.matches===null?this.matches=[e,t]:this.matches.push(e,t)}};function vB(n,e){let t=n.localNames;if(t!==null){for(let r=0;r<t.length;r+=2)if(t[r]===e)return t[r+1]}return null}a(vB,"getIdxOfMatchingSelector");function SB(n,e){return n.type&11?os(n,e):n.type&4?vd(n,e):null}a(SB,"createResultByTNodeType");function EB(n,e,t,r){return t===-1?SB(e,n):t===-2?IB(n,e,r):Wa(n,n[P],t,e)}a(EB,"createResultForNode");function IB(n,e,t){if(t===Gt)return os(e,n);if(t===Jr)return vd(e,n);if(t===or)return OA(e,n)}a(IB,"createSpecialToken");function VA(n,e,t,r){let o=e[Mn].queries[r];if(o.matches===null){let i=n.data,s=t.matches,l=[];for(let c=0;s!==null&&c<s.length;c+=2){let u=s[c];if(u<0)l.push(null);else{let f=i[u];l.push(EB(e,f,s[c+1],t.metadata.read))}}o.matches=l}return o.matches}a(VA,"materializeViewResults");function vg(n,e,t,r){let o=n.queries.getByIndex(t),i=o.matches;if(i!==null){let s=VA(n,e,o,t);for(let l=0;l<i.length;l+=2){let c=i[l];if(c>0)r.push(s[l/2]);else{let u=i[l+1],f=e[-c];for(let p=Ne;p<f.length;p++){let m=f[p];m[$r]===m[Ge]&&vg(m[P],m,u,r)}if(f[Oo]!==null){let p=f[Oo];for(let m=0;m<p.length;m++){let g=p[m];vg(g[P],g,u,r)}}}}}return r}a(vg,"collectQueryResults");function Ny(n,e){return n[Mn].queries[e].queryList}a(Ny,"loadQueryInternal");function $A(n,e,t){let r=new Au((t&4)===4);return W_(n,e,r,r.destroy),(e[Mn]??=new gg).queries.push(new mg(r))-1}a($A,"createLQuery");function BA(n,e,t){let r=J();return r.firstCreatePass&&(HA(r,new Vu(n,e,t),-1),(e&2)===2&&(r.staticViewQueries=!0)),$A(r,A(),e)}a(BA,"createViewQuery");function GA(n,e,t,r){let o=J();if(o.firstCreatePass){let i=q();HA(o,new Vu(e,t,r),i.index),TB(o,n),(t&2)===2&&(o.staticContentQueries=!0)}return $A(o,A(),t)}a(GA,"createContentQuery");function _B(n){return n.split(",").map(e=>e.trim())}a(_B,"splitQueryMultiSelectors");function HA(n,e,t){n.queries===null&&(n.queries=new yg),n.queries.track(new Cg(e,t))}a(HA,"createTQuery");function TB(n,e){let t=n.contentQueries||(n.contentQueries=[]),r=t.length?t[t.length-1]:-1;e!==r&&t.push(n.queries.length-1,e)}a(TB,"saveContentQueryAndDirectiveIndex");function Py(n,e){return n.queries.getByIndex(e)}a(Py,"getTQuery");function qA(n,e){let t=n[P],r=Py(t,e);return r.crossesNgTemplate?vg(t,n,e,[]):VA(t,n,r,e)}a(qA,"getQueryResults");function xy(n,e,t){let r,o=aa(()=>{r._dirtyCounter();let i=DB(r,n);if(e&&i===void 0)throw new x(-951,!1);return i});return r=o[He],r._dirtyCounter=eu(0),r._flatValue=void 0,o}a(xy,"createQuerySignalFn");function ky(n){return xy(!0,!1,n)}a(ky,"createSingleResultOptionalQuerySignalFn");function Ly(n){return xy(!0,!0,n)}a(Ly,"createSingleResultRequiredQuerySignalFn");function zA(n){return xy(!1,!1,n)}a(zA,"createMultiResultQuerySignalFn");function WA(n,e){let t=n[He];t._lView=A(),t._queryIndex=e,t._queryList=Ny(t._lView,e),t._queryList.onDirty(()=>t._dirtyCounter.update(r=>r+1))}a(WA,"bindQueryToSignal");function DB(n,e){let t=n._lView,r=n._queryIndex;if(t===void 0||r===void 0||t[G]&4)return e?void 0:se;let o=Ny(t,r),i=qA(t,r);return o.reset(i,BD),e?o.first:o._changesDetected||n._flatValue===void 0?n._flatValue=o.toArray():n._flatValue}a(DB,"refreshSignalQuery");var $u=new Map,KA=new Set;async function JA(n){let e=$u;$u=new Map;let t=new Map;function r(i){let s=t.get(i);if(s)return s;let l=n(i).then(c=>AB(i,c));return t.set(i,l),l}a(r,"cachedResourceResolve");let o=Array.from(e).map(async([i,s])=>{if(s.styleUrl&&s.styleUrls?.length)throw new Error("@Component cannot define both `styleUrl` and `styleUrls`. Use `styleUrl` if the component has one stylesheet, or `styleUrls` if it has multiple");let l=[];s.templateUrl&&l.push(r(s.templateUrl).then(p=>{s.template=p}));let c=typeof s.styles=="string"?[s.styles]:s.styles??[];s.styles=c;let{styleUrl:u,styleUrls:f}=s;if(u&&(f=[u],s.styleUrl=void 0),f?.length){let p=Promise.all(f.map(m=>r(m))).then(m=>{c.push(...m),s.styleUrls=void 0});l.push(p)}await Promise.all(l),KA.delete(i)});await Promise.all(o)}a(JA,"resolveComponentResources");function wB(n,e){jA(e)&&($u.set(n,e),KA.add(n))}a(wB,"maybeQueueResolutionOfComponentResources");function jA(n){return!!(n.templateUrl&&!n.hasOwnProperty("template")||n.styleUrls?.length||n.styleUrl)}a(jA,"componentNeedsResolution");function YA(){return $u.size===0}a(YA,"isComponentResourceResolutionQueueEmpty");async function AB(n,e){if(typeof e=="string")return e;if(e.status!==void 0&&e.status!==200)throw new x(918,!1);return e.text()}a(AB,"unwrapResponse");var $T=new Map,RB=!0;function MB(n,e,t){if(e&&e!==t&&RB)throw new x(921,!1)}a(MB,"assertSameOrNotExisting");function Fy(n,e){let t=$T.get(e)||null;MB(e,t,n),$T.set(e,n)}a(Fy,"registerNgModuleType");var jr=class{static{a(this,"NgModuleRef")}},XA=class{static{a(this,"NgModuleFactory")}};function Oy(n,e){return new Qi(n,e??null,[])}a(Oy,"createNgModule");var Qi=class extends jr{static{a(this,"NgModuleRef")}ngModuleType;_parent;_bootstrapComponents=[];_r3Injector;instance;destroyCbs=[];componentFactoryResolver=new Ou(this);constructor(e,t,r,o=!0){super(),this.ngModuleType=e,this._parent=t;let i=Po(e);this._bootstrapComponents=Bi(i.bootstrap),this._r3Injector=hm(e,t,[{provide:jr,useValue:this},{provide:Sl,useValue:this.componentFactoryResolver},...r],ga(e),new Set(["environment"])),o&&this.resolveInjectorInitializers()}resolveInjectorInitializers(){this._r3Injector.resolveInjectorInitializers(),this.instance=this._r3Injector.get(this.ngModuleType)}get injector(){return this._r3Injector}destroy(){let e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}},il=class extends XA{static{a(this,"NgModuleFactory")}moduleType;constructor(e){super(),this.moduleType=e}create(e){return new Qi(this.moduleType,e,[])}};function QA(n,e,t){return new Qi(n,e,t,!1)}a(QA,"createNgModuleRefWithProviders");var sl=class extends jr{static{a(this,"EnvironmentNgModuleRefAdapter")}injector;componentFactoryResolver=new Ou(this);instance=null;constructor(e){super();let t=new Mo([...e.providers,{provide:jr,useValue:this},{provide:Sl,useValue:this.componentFactoryResolver}],e.parent||Pi(),e.debugName,new Set(["environment"]));this.injector=t,e.runEnvironmentInitializers&&t.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(e){this.injector.onDestroy(e)}};function Uy(n,e,t=null){return new sl({providers:n,parent:e,debugName:t,runEnvironmentInitializers:!0}).injector}a(Uy,"createEnvironmentInjector");var Sg=class n{static{a(this,"StandaloneService")}_injector;cachedInjectors=new Map;constructor(e){this._injector=e}getOrCreateStandaloneInjector(e){if(!e.standalone)return null;if(!this.cachedInjectors.has(e)){let t=Bc(!1,e.type),r=t.length>0?Uy([t],this._injector,""):null;this.cachedInjectors.set(e,r)}return this.cachedInjectors.get(e)}ngOnDestroy(){try{for(let e of this.cachedInjectors.values())e!==null&&e.destroy()}finally{this.cachedInjectors.clear()}}static \u0275prov=$({token:n,providedIn:"environment",factory:a(()=>new n(le(Ot)),"factory")})};function Dd(n){return sr(()=>{let e=eR(n),t={...e,decls:n.decls,vars:n.vars,template:n.template,consts:n.consts||null,ngContentSelectors:n.ngContentSelectors,onPush:n.changeDetection===Ka.OnPush,directiveDefs:null,pipeDefs:null,dependencies:e.standalone&&n.dependencies||null,getStandaloneInjector:e.standalone?o=>o.get(Sg).getOrCreateStandaloneInjector(t):null,getExternalStyles:null,signals:n.signals??!1,data:n.data||{},encapsulation:n.encapsulation||gn.Emulated,styles:n.styles||se,_:null,schemas:n.schemas||null,tView:null,id:""};e.standalone&<("NgStandalone"),tR(t);let r=n.dependencies;return t.directiveDefs=Bu(r,ZA),t.pipeDefs=Bu(r,dn),t.id=PB(t),t})}a(Dd,"\u0275\u0275defineComponent");function ZA(n){return Oe(n)||Ut(n)}a(ZA,"extractDirectiveDef");function si(n){return sr(()=>({type:n.type,bootstrap:n.bootstrap||se,declarations:n.declarations||se,imports:n.imports||se,exports:n.exports||se,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null}))}a(si,"\u0275\u0275defineNgModule");function bB(n,e){if(n==null)return Kt;let t={};for(let r in n)if(n.hasOwnProperty(r)){let o=n[r],i,s,l,c;Array.isArray(o)?(l=o[0],i=o[1],s=o[2]??i,c=o[3]||null):(i=o,s=o,l=ja.None,c=null),t[i]=[r,l,c],e[i]=s}return t}a(bB,"parseAndConvertInputsForDefinition");function NB(n){if(n==null)return Kt;let e={};for(let t in n)n.hasOwnProperty(t)&&(e[n[t]]=t);return e}a(NB,"parseAndConvertOutputsForDefinition");function Bn(n){return sr(()=>{let e=eR(n);return tR(e),e})}a(Bn,"\u0275\u0275defineDirective");function ai(n){return{type:n.type,name:n.name,factory:null,pure:n.pure!==!1,standalone:n.standalone??!0,onDestroy:n.type.prototype.ngOnDestroy||null}}a(ai,"\u0275\u0275definePipe");function eR(n){let e={};return{type:n.type,providersResolver:null,viewProvidersResolver:null,factory:null,hostBindings:n.hostBindings||null,hostVars:n.hostVars||0,hostAttrs:n.hostAttrs||null,contentQueries:n.contentQueries||null,declaredInputs:e,inputConfig:n.inputs||Kt,exportAs:n.exportAs||null,standalone:n.standalone??!0,signals:n.signals===!0,selectors:n.selectors||se,viewQuery:n.viewQuery||null,features:n.features||null,setInput:null,resolveHostDirectives:null,hostDirectives:null,controlDef:null,inputs:bB(n.inputs,e),outputs:NB(n.outputs),debugInfo:null}}a(eR,"getNgDirectiveDef");function tR(n){n.features?.forEach(e=>e(n))}a(tR,"initFeatures");function Bu(n,e){return n?()=>{let t=typeof n=="function"?n():n,r=[];for(let o of t){let i=e(o);i!==null&&r.push(i)}return r}:null}a(Bu,"extractDefListOrFactory");function PB(n){let e=0,t=typeof n.consts=="function"?"":n.consts,r=[n.selectors,n.ngContentSelectors,n.hostVars,n.hostAttrs,t,n.vars,n.decls,n.encapsulation,n.standalone,n.signals,n.exportAs,JSON.stringify(n.inputs),JSON.stringify(n.outputs),Object.getOwnPropertyNames(n.type.prototype),!!n.contentQueries,!!n.viewQuery];for(let i of r.join("|"))e=Math.imul(31,e)+i.charCodeAt(0)<<0;return e+=2147483648,"c"+e}a(PB,"getComponentId");function nR(n){return e=>{e.controlDef={create:a((t,r)=>{t?.\u0275ngControlCreate(r)},"create"),update:a((t,r)=>{t?.\u0275ngControlUpdate?.(r)},"update"),passThroughInput:n}}}a(nR,"\u0275\u0275ControlFeature");function rR(n){let e=a(t=>{let r=Array.isArray(n);t.hostDirectives===null?(t.resolveHostDirectives=xB,t.hostDirectives=r?n.map(Eg):[n]):r?t.hostDirectives.unshift(...n.map(Eg)):t.hostDirectives.unshift(n)},"feature");return e.ngInherit=!0,e}a(rR,"\u0275\u0275HostDirectivesFeature");function xB(n){let e=[],t=!1,r=null,o=null;for(let i=0;i<n.length;i++){let s=n[i];if(s.hostDirectives!==null){let l=e.length;r??=new Map,o??=new Map,oR(s,e,r),o.set(s,[l,e.length-1])}i===0&&jt(s)&&(t=!0,e.push(s))}for(let i=t?1:0;i<n.length;i++)e.push(n[i]);return[e,r,o]}a(xB,"resolveHostDirectives");function oR(n,e,t){if(n.hostDirectives!==null)for(let r of n.hostDirectives)if(typeof r=="function"){let o=r();for(let i of o)BT(Eg(i),e,t)}else BT(r,e,t)}a(oR,"findHostDirectiveDefs");function BT(n,e,t){let r=Ut(n.directive);kB(r.declaredInputs,n.inputs),oR(r,e,t),t.set(r,n),e.push(r)}a(BT,"trackHostDirectiveDef");function Eg(n){return typeof n=="function"?{directive:ne(n),inputs:Kt,outputs:Kt}:{directive:ne(n.directive),inputs:GT(n.inputs),outputs:GT(n.outputs)}}a(Eg,"createHostDirectiveDef");function GT(n){if(n===void 0||n.length===0)return Kt;let e={};for(let t=0;t<n.length;t+=2)e[n[t]]=n[t+1];return e}a(GT,"bindingArrayToMap");function kB(n,e){for(let t in e)if(e.hasOwnProperty(t)){let r=e[t],o=n[t];n[r]=o}}a(kB,"patchDeclaredInputs");function LB(n){return Object.getPrototypeOf(n.prototype).constructor}a(LB,"getSuperType");function El(n){let e=LB(n.type),t=!0,r=[n];for(;e&&e!==Function.prototype&&e!==Object.prototype;){let o,i=Object.hasOwn(e,Zn)?e[Zn]:void 0,s=Object.hasOwn(e,bo)?e[bo]:void 0;if(jt(n))o=i??s;else{if(i)throw new x(903,!1);o=s}if(o){if(t){r.push(o);let c=n;c.inputs=wm(n.inputs),c.declaredInputs=wm(n.declaredInputs),c.outputs=wm(n.outputs);let u=o.hostBindings;u&&$B(n,u);let f=o.viewQuery,p=o.contentQueries;if(f&&UB(n,f),p&&VB(n,p),FB(n,o),x_(n.outputs,o.outputs),jt(o)&&o.data.animation){let m=n.data;m.animation=(m.animation||[]).concat(o.data.animation)}}let l=o.features;if(l)for(let c=0;c<l.length;c++){let u=l[c];u&&u.ngInherit&&u(n),u===El&&(t=!1)}}e=Object.getPrototypeOf(e)}OB(r)}a(El,"\u0275\u0275InheritDefinitionFeature");function FB(n,e){for(let t in e.inputs){if(!e.inputs.hasOwnProperty(t)||n.inputs.hasOwnProperty(t))continue;let r=e.inputs[t];r!==void 0&&(n.inputs[t]=r,n.declaredInputs[t]=e.declaredInputs[t])}}a(FB,"mergeInputsWithTransforms");function OB(n){let e=0,t=null;for(let r=n.length-1;r>=0;r--){let o=n[r];o.hostVars=e+=o.hostVars,o.hostAttrs=Ji(o.hostAttrs,t=Ji(t,o.hostAttrs))}}a(OB,"mergeHostAttrsAcrossInheritance");function wm(n){return n===Kt?{}:n===se?[]:n}a(wm,"maybeUnwrapEmpty");function UB(n,e){let t=n.viewQuery;t?n.viewQuery=(r,o)=>{e(r,o),t(r,o)}:n.viewQuery=e}a(UB,"inheritViewQuery");function VB(n,e){let t=n.contentQueries;t?n.contentQueries=(r,o,i)=>{e(r,o,i),t(r,o,i)}:n.contentQueries=e}a(VB,"inheritContentQueries");function $B(n,e){let t=n.hostBindings;t?n.hostBindings=(r,o)=>{e(r,o),t(r,o)}:n.hostBindings=e}a($B,"inheritHostBindings");function iR(n,e,t,r,o,i,s,l){if(t.firstCreatePass){n.mergedAttrs=Ji(n.mergedAttrs,n.attrs);let f=n.tView=ay(2,n,o,i,s,t.directiveRegistry,t.pipeRegistry,null,t.schemas,t.consts,null);t.queries!==null&&(t.queries.template(t,n),f.queries=t.queries.embeddedTView(n))}l&&(n.flags|=l),xn(n,!1);let c=GB(t,e,n,r);ba()&&Cy(t,e,c,n),Wr(c,e);let u=hA(c,e,c,n);e[r+K]=u,cy(e,u),UA(u,n,e)}a(iR,"templateCreate");function BB(n,e,t,r,o,i,s,l,c,u,f){let p=t+K,m;return e.firstCreatePass?(m=ii(e,p,4,s||null,l||null),Jc()&&AA(e,n,m,st(e.consts,u),Iy),wD(e,m)):m=e.data[p],iR(m,n,e,t,r,o,i,c),ki(m)&&fd(e,n,m),u!=null&&as(n,m,f),m}a(BB,"declareDirectiveHostTemplate");function ti(n,e,t,r,o,i,s,l,c,u,f){let p=t+K,m;if(e.firstCreatePass){if(m=ii(e,p,4,s||null,l||null),u!=null){let g=st(e.consts,u);m.localNames=[];for(let y=0;y<g.length;y+=2)m.localNames.push(g[y],-1)}}else m=e.data[p];return iR(m,n,e,t,r,o,i,c),u!=null&&as(n,m,f),m}a(ti,"declareNoDirectiveHostTemplate");function Vy(n,e,t,r,o,i,s,l){let c=A(),u=J(),f=st(u.consts,i);return BB(c,u,n,e,t,r,o,f,void 0,s,l),Vy}a(Vy,"\u0275\u0275template");function $y(n,e,t,r,o,i,s,l){let c=A(),u=J(),f=st(u.consts,i);return ti(c,u,n,e,t,r,o,f,void 0,s,l),$y}a($y,"\u0275\u0275domTemplate");var GB=HB;function HB(n,e,t,r){return Fi(!0),e[W].createComment("")}a(HB,"createContainerAnchorImpl");var We;(function(n){n[n.NOT_STARTED=0]="NOT_STARTED",n[n.IN_PROGRESS=1]="IN_PROGRESS",n[n.COMPLETE=2]="COMPLETE",n[n.FAILED=3]="FAILED"})(We||(We={}));var HT=0,qB=1,_e;(function(n){n[n.Placeholder=0]="Placeholder",n[n.Loading=1]="Loading",n[n.Complete=2]="Complete",n[n.Error=3]="Error"})(_e||(_e={}));var Zi;(function(n){n[n.Initial=-1]="Initial"})(Zi||(Zi={}));var Wi=0,li=1,Fa=2,uu=3,zB=4,WB=5,wd=6,KB=7,Ki=8,JB=9,Gu;(function(n){n[n.Manual=0]="Manual",n[n.Playthrough=1]="Playthrough"})(Gu||(Gu={}));function Il(n,e,t){let r=aR(n);e[r]===null&&(e[r]=[]),e[r].push(t)}a(Il,"storeTriggerCleanupFn");function yu(n,e){let t=aR(n),r=e[t];if(r!==null){for(let o of r)o();e[t]=null}}a(yu,"invokeTriggerCleanupFns");function sR(n){yu(1,n),yu(0,n),yu(2,n)}a(sR,"invokeAllTriggerCleanupFns");function aR(n){let e=zB;return n===1?e=WB:n===2&&(e=JB),e}a(aR,"getCleanupFnKeyByType");function Ad(n){return n+1}a(Ad,"getDeferBlockDataIndex");function Nt(n,e){let t=n[P],r=Ad(e.index);return n[r]}a(Nt,"getLDeferBlockDetails");function jB(n,e,t){let r=n[P],o=Ad(e);n[o]=t}a(jB,"setLDeferBlockDetails");function _t(n,e){let t=Ad(e.index);return n.data[t]}a(_t,"getTDeferBlockDetails");function YB(n,e,t){let r=Ad(e);n.data[r]=t}a(YB,"setTDeferBlockDetails");function XB(n,e,t){let r=e[P],o=_t(r,t);switch(n){case _e.Complete:return o.primaryTmplIndex;case _e.Loading:return o.loadingTmplIndex;case _e.Error:return o.errorTmplIndex;case _e.Placeholder:return o.placeholderTmplIndex;default:return null}}a(XB,"getTemplateIndexForState");function Ig(n,e){return e===_e.Placeholder?n.placeholderBlockConfig?.[HT]??null:e===_e.Loading?n.loadingBlockConfig?.[HT]??null:null}a(Ig,"getMinimumDurationForState");function lR(n){return n.loadingBlockConfig?.[qB]??null}a(lR,"getLoadingBlockAfter");function qT(n,e){if(!n||n.length===0)return e;let t=new Set(n);for(let r of e)t.add(r);return n.length===t.size?n:Array.from(t)}a(qT,"addDepsToRegistry");function QB(n,e){let t=e.primaryTmplIndex+K;return Vo(n,t)}a(QB,"getPrimaryBlockTNode");function cR(n,e,t,r){let o=t.get(Se);return IU(n,()=>o.run(e),i=>o.runOutsideAngular(()=>EU(i)),r)}a(cR,"onViewportWrapper");function ZB(n,e,t){return t==null?n:t>=0?Hp(t,n):n[e.index][Ne]??null}a(ZB,"getTriggerLView");function e1(n,e){return Uo(K+e,n)}a(e1,"getTriggerElement");function ds(n,e,t,r,o,i,s,l){let c=n[re],u=c.get(Se),f;function p(){if(Pn(n)){f.destroy();return}let m=Nt(n,e),g=m[li];if(g!==Zi.Initial&&g!==_e.Placeholder){f.destroy();return}let y=ZB(n,e,r);if(!y||(f.destroy(),Pn(y)))return;let C=e1(y,t),v=o(C,()=>{u.run(()=>{n!==y&&Kc(y,v),i()})},c,l);n!==y&&Ra(y,v),Il(s,m,v)}a(p,"pollDomTrigger"),f=Bw({read:p},{injector:c})}a(ds,"registerDomTrigger");function By(n,e){let t=e.get(_g),r=a(()=>t.remove(n),"cleanupFn");return t.add(n),r}a(By,"onIdle");var t1=a(()=>typeof requestIdleCallback<"u"?requestIdleCallback:setTimeout,"_requestIdleCallback"),n1=a(()=>typeof requestIdleCallback<"u"?cancelIdleCallback:clearTimeout,"_cancelIdleCallback"),_g=class n{static{a(this,"IdleScheduler")}executingCallbacks=!1;idleId=null;current=new Set;deferred=new Set;ngZone=b(Se);requestIdleCallbackFn=t1().bind(globalThis);cancelIdleCallbackFn=n1().bind(globalThis);add(e){(this.executingCallbacks?this.deferred:this.current).add(e),this.idleId===null&&this.scheduleIdleCallback()}remove(e){let{current:t,deferred:r}=this;t.delete(e),r.delete(e),t.size===0&&r.size===0&&this.cancelIdleCallback()}scheduleIdleCallback(){let e=a(()=>{this.cancelIdleCallback(),this.executingCallbacks=!0;for(let t of this.current)t();if(this.current.clear(),this.executingCallbacks=!1,this.deferred.size>0){for(let t of this.deferred)this.current.add(t);this.deferred.clear(),this.scheduleIdleCallback()}},"callback");this.idleId=this.requestIdleCallbackFn(()=>this.ngZone.run(e))}cancelIdleCallback(){this.idleId!==null&&(this.cancelIdleCallbackFn(this.idleId),this.idleId=null)}ngOnDestroy(){this.cancelIdleCallback(),this.current.clear(),this.deferred.clear()}static \u0275prov=$({token:n,providedIn:"root",factory:a(()=>new n,"factory")})};function Gy(n){return(e,t)=>uR(n,e,t)}a(Gy,"onTimer");function uR(n,e,t){let r=t.get(Hu),o=t.get(Se),i=a(()=>r.remove(e),"cleanupFn");return r.add(n,e,o),i}a(uR,"scheduleTimerTrigger");var Hu=class n{static{a(this,"TimerScheduler")}executingCallbacks=!1;timeoutId=null;invokeTimerAt=null;current=[];deferred=[];add(e,t,r){let o=this.executingCallbacks?this.deferred:this.current;this.addToQueue(o,Date.now()+e,t),this.scheduleTimer(r)}remove(e){let{current:t,deferred:r}=this;this.removeFromQueue(t,e)===-1&&this.removeFromQueue(r,e),t.length===0&&r.length===0&&this.clearTimeout()}addToQueue(e,t,r){let o=e.length;for(let i=0;i<e.length;i+=2)if(e[i]>t){o=i;break}Ap(e,o,t,r)}removeFromQueue(e,t){let r=-1;for(let o=0;o<e.length;o+=2)if(e[o+1]===t){r=o;break}return r>-1&&wp(e,r,2),r}scheduleTimer(e){let t=a(()=>{this.clearTimeout(),this.executingCallbacks=!0;let o=[...this.current],i=Date.now();for(let l=0;l<o.length;l+=2){let c=o[l],u=o[l+1];if(c<=i)u();else break}let s=-1;for(let l=0;l<this.current.length&&this.current[l]<=i;l+=2)s=l+1;if(s>=0&&wp(this.current,0,s+1),this.executingCallbacks=!1,this.deferred.length>0){for(let l=0;l<this.deferred.length;l+=2){let c=this.deferred[l],u=this.deferred[l+1];this.addToQueue(this.current,c,u)}this.deferred.length=0}this.scheduleTimer(e)},"callback"),r=16;if(this.current.length>0){let o=Date.now(),i=this.current[0];if(this.timeoutId===null||this.invokeTimerAt&&this.invokeTimerAt-i>r){this.clearTimeout();let s=Math.max(i-o,r);this.invokeTimerAt=i,this.timeoutId=e.runOutsideAngular(()=>setTimeout(()=>e.run(t),s))}}}clearTimeout(){this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}ngOnDestroy(){this.clearTimeout(),this.current.length=0,this.deferred.length=0}static \u0275prov=$({token:n,providedIn:"root",factory:a(()=>new n,"factory")})},Tg=class n{static{a(this,"CachedInjectorService")}cachedInjectors=new Map;getOrCreateInjector(e,t,r,o){if(!this.cachedInjectors.has(e)){let i=r.length>0?Uy(r,t,o):null;this.cachedInjectors.set(e,i)}return this.cachedInjectors.get(e)}ngOnDestroy(){try{for(let e of this.cachedInjectors.values())e!==null&&e.destroy()}finally{this.cachedInjectors.clear()}}static \u0275prov=$({token:n,providedIn:"environment",factory:a(()=>new n,"factory")})};var dR=new F("");function Am(n,e,t){return n.get(Tg).getOrCreateInjector(e,n,t,"")}a(Am,"getOrCreateEnvironmentInjector");function r1(n,e,t){if(n instanceof zi){let o=n.injector,i=n.parentInjector,s=Am(i,e,t);return new zi(o,s)}let r=n.get(Ot);if(r!==n){let o=Am(r,e,t);return new zi(n,o)}return Am(n,e,t)}a(r1,"createDeferBlockInjector");function tr(n,e,t,r=!1){let o=t[Ge],i=o[P];if(Pn(o))return;let s=Nt(o,e),l=s[li],c=s[KB];if(!(c!==null&&n<c)&&WT(l,n)&&WT(s[Wi]??-1,n)){let u=_t(i,e),p=!r&&(typeof ngServerMode>"u"||!ngServerMode)&&(lR(u)!==null||Ig(u,_e.Loading)!==null||Ig(u,_e.Placeholder))?Dg:fR;try{p(n,s,t,e,o)}catch(m){_y(o,m)}}}a(tr,"renderDeferBlockState");function o1(n,e){let t=n[er]?.findIndex(o=>o.data[jg]===e[li])??-1;return{dehydratedView:t>-1?n[er][t]:null,dehydratedViewIx:t}}a(o1,"findMatchingDehydratedViewForDeferBlock");function fR(n,e,t,r,o){ae(ee.DeferBlockStateStart);let i=XB(n,o,r);if(i!==null){e[li]=n;let s=o[P],l=i+K,c=Vo(s,l),u=0;Ty(t,u);let f;if(n===_e.Complete){let y=_t(s,r),C=y.providers;C&&C.length>0&&(f=r1(o[re],y,C))}let{dehydratedView:p,dehydratedViewIx:m}=o1(t,e),g=ls(o,c,null,{injector:f,dehydratedView:p});if(cs(t,g,u,Xo(c,p)),Cd(g,2),m>-1&&t[er]?.splice(m,1),(n===_e.Complete||n===_e.Error)&&Array.isArray(e[Ki])){for(let y of e[Ki])y();e[Ki]=null}}ae(ee.DeferBlockStateEnd)}a(fR,"applyDeferBlockState");function i1(n,e,t,r,o){let i=Date.now(),s=o[P],l=_t(s,r);if(e[Fa]===null||e[Fa]<=i){e[Fa]=null;let c=lR(l),u=e[uu]!==null;if(n===_e.Loading&&c!==null&&!u){e[Wi]=n;let f=zT(c,e,r,t,o);e[uu]=f}else{n>_e.Loading&&u&&(e[uu](),e[uu]=null,e[Wi]=null),fR(n,e,t,r,o);let f=Ig(l,n);f!==null&&(e[Fa]=i+f,zT(f,e,r,t,o))}}else e[Wi]=n}a(i1,"applyDeferBlockStateWithScheduling");function zT(n,e,t,r,o){return uR(n,a(()=>{let s=e[Wi];e[Fa]=null,e[Wi]=null,s!==null&&tr(s,t,r)},"callback"),o[re])}a(zT,"scheduleDeferBlockUpdate");function WT(n,e){return n<e}a(WT,"isValidStateChange");function fs(n,e){let t=n[e.index];tr(_e.Placeholder,e,t)}a(fs,"renderPlaceholder");function KT(n,e,t){n.loadingPromise.then(()=>{n.loadingState===We.COMPLETE?tr(_e.Complete,e,t):n.loadingState===We.FAILED&&tr(_e.Error,e,t)})}a(KT,"renderDeferStateAfterResourceLoading");var Dg=null;function hR(n,e,t,r){let o=n.consts;t!=null&&(e.placeholderBlockConfig=st(o,t)),r!=null&&(e.loadingBlockConfig=st(o,r)),Dg===null&&(Dg=i1)}a(hR,"\u0275\u0275deferEnableTimerScheduling");var wg=class n{static{a(this,"Console")}log(e){console.log(e)}warn(e){console.warn(e)}static \u0275fac=a(function(t){return new(t||n)},"Console_Factory");static \u0275prov=$({token:n,factory:n.\u0275fac,providedIn:"platform"})},Ag=class{static{a(this,"DIDebugData")}resolverToTokenToDependencies=new WeakMap;resolverToProviders=new WeakMap;resolverToEffects=new WeakMap;standaloneInjectorToComponent=new WeakMap;reset(){this.resolverToTokenToDependencies=new WeakMap,this.resolverToProviders=new WeakMap,this.standaloneInjectorToComponent=new WeakMap}},B9=new Ag;function Hy(n){return typeof n=="function"&&n[He]!==void 0}a(Hy,"isSignal");function qy(n){return Hy(n)&&typeof n.set=="function"}a(qy,"isWritableSignal");var pR=new F(""),mR=new F(""),Rg=class n{static{a(this,"Testability")}_ngZone;registry;_isZoneStable=!0;_callbacks=[];_taskTrackingZone=null;_destroyRef;constructor(e,t,r){this._ngZone=e,this.registry=t,kp()&&(this._destroyRef=b(St,{optional:!0})??void 0),zy||(gR(r),r.addToWindow(t)),this._watchAngularEvents(),e.run(()=>{this._taskTrackingZone=typeof Zone>"u"?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){let e=this._ngZone.onUnstable.subscribe({next:a(()=>{this._isZoneStable=!1},"next")}),t=this._ngZone.runOutsideAngular(()=>this._ngZone.onStable.subscribe({next:a(()=>{Se.assertNotInAngularZone(),queueMicrotask(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})},"next")}));this._destroyRef?.onDestroy(()=>{e.unsubscribe(),t.unsubscribe()})}isStable(){return this._isZoneStable&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())queueMicrotask(()=>{for(;this._callbacks.length!==0;){let e=this._callbacks.pop();clearTimeout(e.timeoutId),e.doneCb()}});else{let e=this.getPendingTasks();this._callbacks=this._callbacks.filter(t=>t.updateCb&&t.updateCb(e)?(clearTimeout(t.timeoutId),!1):!0)}}getPendingTasks(){return this._taskTrackingZone?this._taskTrackingZone.macroTasks.map(e=>({source:e.source,creationLocation:e.creationLocation,data:e.data})):[]}addCallback(e,t,r){let o=-1;t&&t>0&&(o=setTimeout(()=>{this._callbacks=this._callbacks.filter(i=>i.timeoutId!==o),e()},t)),this._callbacks.push({doneCb:e,timeoutId:o,updateCb:r})}whenStable(e,t,r){if(r&&!this._taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(e,t,r),this._runCallbacksIfReady()}registerApplication(e){this.registry.registerApplication(e,this)}unregisterApplication(e){this.registry.unregisterApplication(e)}findProviders(e,t,r){return[]}static \u0275fac=a(function(t){return new(t||n)(le(Se),le(qu),le(mR))},"Testability_Factory");static \u0275prov=$({token:n,factory:n.\u0275fac})},qu=class n{static{a(this,"TestabilityRegistry")}_applications=new Map;registerApplication(e,t){this._applications.set(e,t)}unregisterApplication(e){this._applications.delete(e)}unregisterAllApplications(){this._applications.clear()}getTestability(e){return this._applications.get(e)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(e,t=!0){return zy?.findTestabilityInTree(this,e,t)??null}static \u0275fac=a(function(t){return new(t||n)},"TestabilityRegistry_Factory");static \u0275prov=$({token:n,factory:n.\u0275fac,providedIn:"platform"})};function gR(n){zy=n}a(gR,"setTestabilityGetter");var zy;function _l(n){return!!n&&typeof n.then=="function"}a(_l,"isPromise");function Rd(n){return!!n&&typeof n.subscribe=="function"}a(Rd,"isSubscribable");var yR=new F("");var al=class n{static{a(this,"ApplicationInitStatus")}resolve;reject;initialized=!1;done=!1;donePromise=new Promise((e,t)=>{this.resolve=e,this.reject=t});appInits=b(yR,{optional:!0})??[];injector=b(tt);constructor(){}runInitializers(){if(this.initialized)return;let e=[];for(let r of this.appInits){let o=Gc(this.injector,r);if(_l(o))e.push(o);else if(Rd(o)){let i=new Promise((s,l)=>{o.subscribe({complete:s,error:l})});e.push(i)}}let t=a(()=>{this.done=!0,this.resolve()},"complete");Promise.all(e).then(()=>{t()}).catch(r=>{this.reject(r)}),e.length===0&&t(),this.initialized=!0}static \u0275fac=a(function(t){return new(t||n)},"ApplicationInitStatus_Factory");static \u0275prov=$({token:n,factory:n.\u0275fac,providedIn:"root"})},CR=new F("");function Wy(){Zh(()=>{let n="";throw new x(600,n)})}a(Wy,"publishSignalConfiguration");function vR(n){return n.isBoundToModule}a(vR,"isBoundToModule");var s1=10;function Ky(n,e){return Array.isArray(e)?e.reduce(Ky,n):{...n,...e}}a(Ky,"optionsReducer");var Vn=class n{static{a(this,"ApplicationRef")}_runningTick=!1;_destroyed=!1;_destroyListeners=[];_views=[];internalErrorHandler=b(pn);afterRenderManager=b(Yi);zonelessEnabled=b(Oi);rootEffectScheduler=b(Ri);dirtyFlags=0;tracingSnapshot=null;allTestViews=new Set;autoDetectTestViews=new Set;includeAllTestViews=!1;afterTick=new fe;get allViews(){return[...(this.includeAllTestViews?this.allTestViews:this.autoDetectTestViews).keys(),...this._views]}get destroyed(){return this._destroyed}componentTypes=[];components=[];internalPendingTask=b(cn);get isStable(){return this.internalPendingTask.hasPendingTasksObservable.pipe(na(e=>!e))}constructor(){b(oi,{optional:!0})}whenStable(){let e;return new Promise(t=>{e=this.isStable.subscribe({next:a(r=>{r&&t()},"next")})}).finally(()=>{e.unsubscribe()})}_injector=b(Ot);_rendererFactory=null;get injector(){return this._injector}bootstrap(e,t){return this.bootstrapImpl(e,t)}bootstrapImpl(e,t,r=tt.NULL){return this._injector.get(Se).run(()=>{ae(ee.BootstrapComponentStart);let i=e instanceof Id;if(!this._injector.get(al).done){let g="";throw new x(405,g)}let l;i?l=e:l=this._injector.get(Sl).resolveComponentFactory(e),this.componentTypes.push(l.componentType);let c=vR(l)?void 0:this._injector.get(jr),u=t||l.selector,f=l.create(r,[],u,c),p=f.location.nativeElement,m=f.injector.get(pR,null);return m?.registerApplication(p),f.onDestroy(()=>{this.detachView(f.hostView),$a(this.components,f),m?.unregisterApplication(p)}),this._loadComponent(f),ae(ee.BootstrapComponentEnd,f),f})}tick(){this.zonelessEnabled||(this.dirtyFlags|=1),this._tick()}_tick(){ae(ee.ChangeDetectionStart),this.tracingSnapshot!==null?this.tracingSnapshot.run(Qa.CHANGE_DETECTION,this.tickImpl):this.tickImpl()}tickImpl=a(()=>{if(this._runningTick)throw ae(ee.ChangeDetectionEnd),new x(101,!1);let e=V(null);try{this._runningTick=!0,this.synchronize()}finally{this._runningTick=!1,this.tracingSnapshot?.dispose(),this.tracingSnapshot=null,V(e),this.afterTick.next(),ae(ee.ChangeDetectionEnd)}},"tickImpl");synchronize(){this._rendererFactory===null&&!this._injector.destroyed&&(this._rendererFactory=this._injector.get(ol,null,{optional:!0}));let e=0;for(;this.dirtyFlags!==0&&e++<s1;){ae(ee.ChangeDetectionSyncStart);try{this.synchronizeOnce()}finally{ae(ee.ChangeDetectionSyncEnd)}}}synchronizeOnce(){this.dirtyFlags&16&&(this.dirtyFlags&=-17,this.rootEffectScheduler.flush());let e=!1;if(this.dirtyFlags&7){let t=!!(this.dirtyFlags&1);this.dirtyFlags&=-8,this.dirtyFlags|=8;for(let{_lView:r}of this.allViews){if(!t&&!Aa(r))continue;let o=t&&!this.zonelessEnabled?0:1;lA(r,o),e=!0}if(this.dirtyFlags&=-5,this.syncDirtyFlagsWithViews(),this.dirtyFlags&23)return}e||(this._rendererFactory?.begin?.(),this._rendererFactory?.end?.()),this.dirtyFlags&8&&(this.dirtyFlags&=-9,this.afterRenderManager.execute()),this.syncDirtyFlagsWithViews()}syncDirtyFlagsWithViews(){if(this.allViews.some(({_lView:e})=>Aa(e))){this.dirtyFlags|=2;return}else this.dirtyFlags&=-8}attachView(e){let t=e;this._views.push(t),t.attachToAppRef(this)}detachView(e){let t=e;$a(this._views,t),t.detachFromAppRef()}_loadComponent(e){this.attachView(e.hostView);try{this.tick()}catch(r){this.internalErrorHandler(r)}this.components.push(e),this._injector.get(CR,[]).forEach(r=>r(e))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(e=>e()),this._views.slice().forEach(e=>e.destroy())}finally{this._destroyed=!0,this._views=[],this._destroyListeners=[]}}onDestroy(e){return this._destroyListeners.push(e),()=>$a(this._destroyListeners,e)}destroy(){if(this._destroyed)throw new x(406,!1);let e=this._injector;e.destroy&&!e.destroyed&&e.destroy()}get viewCount(){return this._views.length}static \u0275fac=a(function(t){return new(t||n)},"ApplicationRef_Factory");static \u0275prov=$({token:n,factory:n.\u0275fac,providedIn:"root"})};function $a(n,e){let t=n.indexOf(e);t>-1&&n.splice(t,1)}a($a,"remove");function Md(){let n,e;return{promise:new Promise((r,o)=>{n=r,e=o}),resolve:n,reject:e}}a(Md,"promiseWithResolvers");function SR(n){let e=A(),t=q();if(fs(e,t),!_R(0,e))return;let r=e[re],o=Nt(e,t),i=n(()=>Tt(0,e,t),r);Il(0,o,i)}a(SR,"scheduleDelayedTrigger");function ER(n){if(typeof ngServerMode<"u"&&ngServerMode)return;let e=A(),t=e[re],r=q(),o=e[P],i=_t(o,r);if(i.loadingState===We.NOT_STARTED){let s=Nt(e,r),c=n(a(()=>Tl(i,e,r),"prefetch"),t);Il(1,s,c)}}a(ER,"scheduleDelayedPrefetching");function IR(n,e,t){if(typeof ngServerMode<"u"&&ngServerMode)return;let r=e[re],o=Nt(e,t),i=o[wd],s=n(()=>Nd(r,i),r);Il(2,o,s)}a(IR,"scheduleDelayedHydrating");function Tl(n,e,t){bd(n,e,t)}a(Tl,"triggerPrefetching");function bd(n,e,t){let r=e[re],o=e[P];if(n.loadingState!==We.NOT_STARTED)return n.loadingPromise??Promise.resolve();let i=Nt(e,t),s=QB(o,n);n.loadingState=We.IN_PROGRESS,yu(1,i);let l=n.dependencyResolverFn,c=r.get(Ai).add();return l?(n.loadingPromise=Promise.allSettled(l()).then(u=>{let f=!1,p=null,m=[],g=[];for(let y=0;y<u.length;y++){let C=u[y];if(C.status==="fulfilled"){let v=C.value,S=Oe(v)||Ut(v);if(S)m.push(S);else{let E=dn(v);E&&g.push(E)}}else{f=!0,p=C.reason instanceof Error?C.reason:new Error(String(C.reason));break}}if(f){if(n.loadingState=We.FAILED,n.errorTmplIndex===null){let C="",v=new x(-750,C);_y(e,v)}}else{n.loadingState=We.COMPLETE;let y=s.tView;if(m.length>0){y.directiveRegistry=qT(y.directiveRegistry,m);let C=m.map(S=>S.type),v=Bc(!1,...C);n.providers=v}g.length>0&&(y.pipeRegistry=qT(y.pipeRegistry,g))}}),n.loadingPromise.finally(()=>{n.loadingPromise=null,c()})):(n.loadingPromise=Promise.resolve().then(()=>{n.loadingPromise=null,n.loadingState=We.COMPLETE,c()}),n.loadingPromise)}a(bd,"triggerResourceLoading");function _R(n,e){return!(n===0&&typeof ngServerMode<"u"&&ngServerMode||e[re].get(dR,null,{optional:!0})?.behavior===Gu.Manual)}a(_R,"shouldTriggerDeferBlock");function Tt(n,e,t){let r=e[P],o=e[t.index];if(!_R(n,e))return;let i=Nt(e,t),s=_t(r,t);switch(sR(i),s.loadingState){case We.NOT_STARTED:tr(_e.Loading,t,o),bd(s,e,t),s.loadingState===We.IN_PROGRESS&&KT(s,t,o);break;case We.IN_PROGRESS:tr(_e.Loading,t,o),KT(s,t,o);break;case We.COMPLETE:tr(_e.Complete,t,o);break;case We.FAILED:tr(_e.Error,t,o);break;default:}}a(Tt,"triggerDeferBlock");async function Nd(n,e,t){let r=n.get(hl);if(r.hydrating.has(e))return;let{parentBlockPromise:i,hydrationQueue:s}=NU(e,n);if(s.length===0)return;i!==null&&s.shift(),c1(r,s),i!==null&&await i;let l=s[0];r.has(l)?await JT(n,s,t):r.awaitParentBlock(l,async()=>await JT(n,s,t))}a(Nd,"triggerHydrationFromBlockName");async function JT(n,e,t){let r=n.get(hl),o=r.hydrating,i=n.get(cn),s=i.add();for(let c=0;c<e.length;c++){let u=e[c],f=r.get(u);if(f!=null){if(await d1(f),await u1(n),a1(f)){F$(f),jT(e.slice(c),r);break}o.get(u).resolve()}else{l1(c,e,r),jT(e.slice(c),r);break}}let l=e[e.length-1];await o.get(l)?.promise,i.remove(s),t&&t(e),O$(r.get(l),e,r,n.get(Vn))}a(JT,"triggerHydrationForBlockQueue");function a1(n){return Nt(n.lView,n.tNode)[li]===_e.Error}a(a1,"deferBlockHasErrored");function l1(n,e,t){let r=n-1,o=r>-1?t.get(e[r]):null;o&&Ed(o.lContainer)}a(l1,"cleanupParentContainer");function jT(n,e){let t=e.hydrating;for(let r in n)t.get(r)?.reject();e.cleanup(n)}a(jT,"cleanupRemainingHydrationQueue");function c1(n,e){for(let t of e)n.hydrating.set(t,Md())}a(c1,"populateHydratingStateForQueue");function u1(n){return new Promise(e=>my(e,{injector:n}))}a(u1,"nextRender");async function d1(n){let{tNode:e,lView:t}=n,r=Nt(t,e);return new Promise(o=>{f1(r,o),Tt(2,t,e)})}a(d1,"triggerResourceLoadingForHydration");function f1(n,e){Array.isArray(n[Ki])||(n[Ki]=[]),n[Ki].push(e)}a(f1,"onDeferBlockCompletion");function qe(n,e,t){return n===0?YT(e,t):n===2?!YT(e,t):!(typeof ngServerMode<"u"&&ngServerMode)}a(qe,"shouldAttachTrigger");function h1(n){return n!=null&&(n&1)===1}a(h1,"hasHydrateTriggers");function YT(n,e){let t=n[re],r=_t(n[P],e),o=Yg(t),i=h1(r.flags);if(typeof ngServerMode<"u"&&ngServerMode)return!o||!i;let l=Nt(n,e)[wd]!==null;return!(i&&l&&o)}a(YT,"shouldAttachRegularTrigger");function Yr(n,e){let t=_t(n,e);return t.hydrateTriggers??=new Map}a(Yr,"getHydrateTriggers");function TR(n,e,t,r,o,i,s,l,c,u){let f=A(),p=J(),m=n+K,g=ti(f,p,n,null,0,0),y=f[re],C=Yg(y);if(p.firstCreatePass){lt("NgDefer");let w={primaryTmplIndex:e,loadingTmplIndex:r??null,placeholderTmplIndex:o??null,errorTmplIndex:i??null,placeholderBlockConfig:null,loadingBlockConfig:null,dependencyResolverFn:t??null,loadingState:We.NOT_STARTED,loadingPromise:null,providers:null,hydrateTriggers:null,debug:null,flags:u??0};c?.(p,w,l,s),YB(p,m,w)}let v=f[m];UA(v,g,f);let S=null,E=null;if(v[er]?.length>0){let w=v[er][0].data;E=w[Jg]??null,S=w[jg]}let I=[null,Zi.Initial,null,null,null,null,E,S,null,null];jB(f,m,I);let _=null;E!==null&&C&&(_=y.get(hl),_.add(E,{lView:f,tNode:g,lContainer:v}));let T=a(()=>{sR(I),E!==null&&_?.cleanup([E])},"onLViewDestroy");Il(0,I,()=>Kc(f,T)),Ra(f,T)}a(TR,"\u0275\u0275defer");function DR(n){let e=A(),t=$t();if(!qe(0,e,t))return;let r=It();if(Ue(e,r,n)){let o=V(null);try{let i=!!n,l=Nt(e,t)[li];i===!1&&l===Zi.Initial?fs(e,t):i===!0&&(l===Zi.Initial||l===_e.Placeholder)&&Tt(0,e,t)}finally{V(o)}}}a(DR,"\u0275\u0275deferWhen");function wR(n){let e=A(),t=$t();if(!qe(1,e,t))return;let r=It();if(Ue(e,r,n)){let o=V(null);try{let i=!!n,s=e[P],l=_t(s,t);i===!0&&l.loadingState===We.NOT_STARTED&&Tl(l,e,t)}finally{V(o)}}}a(wR,"\u0275\u0275deferPrefetchWhen");function AR(n){let e=A(),t=$t();if(!qe(2,e,t))return;let r=It(),o=J();if(Yr(o,t).set(6,null),Ue(e,r,n))if(typeof ngServerMode<"u"&&ngServerMode)Tt(2,e,t);else{let s=e[re],l=V(null);try{if(!!n===!0){let f=Nt(e,t)[wd];Nd(s,f)}}finally{V(l)}}}a(AR,"\u0275\u0275deferHydrateWhen");function RR(){let n=A(),e=q();if(!qe(2,n,e))return;Yr(J(),e).set(7,null),typeof ngServerMode<"u"&&ngServerMode&&Tt(2,n,e)}a(RR,"\u0275\u0275deferHydrateNever");function MR(){let n=A(),e=q();qe(0,n,e)&&SR(By)}a(MR,"\u0275\u0275deferOnIdle");function bR(){let n=A(),e=q();qe(1,n,e)&&ER(By)}a(bR,"\u0275\u0275deferPrefetchOnIdle");function NR(){let n=A(),e=q();if(!qe(2,n,e))return;Yr(J(),e).set(0,null),typeof ngServerMode<"u"&&ngServerMode?Tt(2,n,e):IR(By,n,e)}a(NR,"\u0275\u0275deferHydrateOnIdle");function PR(){let n=A(),e=q();if(!qe(0,n,e))return;_t(n[P],e).loadingTmplIndex===null&&fs(n,e),Tt(0,n,e)}a(PR,"\u0275\u0275deferOnImmediate");function xR(){let n=A(),e=q();if(!qe(1,n,e))return;let t=n[P],r=_t(t,e);r.loadingState===We.NOT_STARTED&&bd(r,n,e)}a(xR,"\u0275\u0275deferPrefetchOnImmediate");function kR(){let n=A(),e=q();if(!qe(2,n,e))return;if(Yr(J(),e).set(1,null),typeof ngServerMode<"u"&&ngServerMode)Tt(2,n,e);else{let r=n[re],i=Nt(n,e)[wd];Nd(r,i)}}a(kR,"\u0275\u0275deferHydrateOnImmediate");function LR(n){let e=A(),t=q();qe(0,e,t)&&SR(Gy(n))}a(LR,"\u0275\u0275deferOnTimer");function FR(n){let e=A(),t=q();qe(1,e,t)&&ER(Gy(n))}a(FR,"\u0275\u0275deferPrefetchOnTimer");function OR(n){let e=A(),t=q();if(!qe(2,e,t))return;Yr(J(),t).set(5,{type:5,delay:n}),typeof ngServerMode<"u"&&ngServerMode?Tt(2,e,t):IR(Gy(n),e,t)}a(OR,"\u0275\u0275deferHydrateOnTimer");function UR(n,e){let t=A(),r=q();qe(0,t,r)&&(fs(t,r),typeof ngServerMode<"u"&&ngServerMode||ds(t,r,n,e,ew,()=>Tt(0,t,r),0))}a(UR,"\u0275\u0275deferOnHover");function VR(n,e){let t=A(),r=q();if(!qe(1,t,r))return;let o=t[P],i=_t(o,r);i.loadingState===We.NOT_STARTED&&ds(t,r,n,e,ew,()=>Tl(i,t,r),1)}a(VR,"\u0275\u0275deferPrefetchOnHover");function $R(){let n=A(),e=q();if(!qe(2,n,e))return;Yr(J(),e).set(4,null),typeof ngServerMode<"u"&&ngServerMode&&Tt(2,n,e)}a($R,"\u0275\u0275deferHydrateOnHover");function BR(n,e){let t=A(),r=q();qe(0,t,r)&&(fs(t,r),typeof ngServerMode<"u"&&ngServerMode||ds(t,r,n,e,ZD,()=>Tt(0,t,r),0))}a(BR,"\u0275\u0275deferOnInteraction");function GR(n,e){let t=A(),r=q();if(!qe(1,t,r))return;let o=t[P],i=_t(o,r);i.loadingState===We.NOT_STARTED&&ds(t,r,n,e,ZD,()=>Tl(i,t,r),1)}a(GR,"\u0275\u0275deferPrefetchOnInteraction");function HR(){let n=A(),e=q();if(!qe(2,n,e))return;Yr(J(),e).set(3,null),typeof ngServerMode<"u"&&ngServerMode&&Tt(2,n,e)}a(HR,"\u0275\u0275deferHydrateOnInteraction");function qR(n,e,t){let r=A(),o=q();qe(0,r,o)&&(fs(r,o),typeof ngServerMode<"u"&&ngServerMode||ds(r,o,n,e,cR,()=>Tt(0,r,o),0,t))}a(qR,"\u0275\u0275deferOnViewport");function zR(n,e,t){let r=A(),o=q();if(!qe(1,r,o))return;let i=r[P],s=_t(i,o);s.loadingState===We.NOT_STARTED&&ds(r,o,n,e,cR,()=>Tl(s,r,o),1,t)}a(zR,"\u0275\u0275deferPrefetchOnViewport");function WR(n){let e=A(),t=q();if(!qe(2,e,t))return;Yr(J(),t).set(2,n?{type:2,intersectionObserverOptions:n}:null),typeof ngServerMode<"u"&&ngServerMode&&Tt(2,e,t)}a(WR,"\u0275\u0275deferHydrateOnViewport");function Jy(n,e){let t=A(),r=It();if(Ue(t,r,e)){let o=J(),i=$t();if(gd(i,o,t,n,e))Nn(i)&&tA(t,i.index);else{let l=Je(i,t);hd(t[W],l,null,i.value,n,e,null)}}return Jy}a(Jy,"\u0275\u0275ariaProperty");function jy(n,e,t,r){let o=A(),i=It();if(Ue(o,i,e)){let s=J(),l=$t();ZV(l,o,n,e,t,r)}return jy}a(jy,"\u0275\u0275attribute");function Ba(n){if(lt("NgAnimateEnter"),typeof ngServerMode<"u"&&ngServerMode||!ri)return Ba;let e=A();if(sd(e))return Ba;let t=q(),r=e[re].get(Se);return ad(bu(e),t,()=>p1(e,t,n,r)),ud(e[re]),gy(e[re],bu(e)),Ba}a(Ba,"\u0275\u0275animateEnter");function p1(n,e,t,r){let o=Je(e,n),i=n[W],s=Ow(t),l=[],c=!1,u=a(p=>{if(Xa(p)!==o)return;let m=p instanceof AnimationEvent?"animationend":"transitionend";r.runOutsideAngular(()=>{i.listen(o,m,f)})},"handleEnterAnimationStart"),f=a(p=>{Xa(p)===o&&(hy(p,o)&&(c=!0),m1(p,o,i))},"handleEnterAnimationEnd");if(s&&s.length>0){r.runOutsideAngular(()=>{l.push(i.listen(o,"animationstart",u)),l.push(i.listen(o,"transitionstart",u))}),wV(o,s,l);for(let p of s)i.addClass(o,p);r.runOutsideAngular(()=>{requestAnimationFrame(()=>{if(!c&&($w(o,qo,ri),!qo.has(o))){for(let p of s)i.removeClass(o,p);dy(o)}})})}}a(p1,"runEnterAnimation");function m1(n,e,t){let r=ji.get(e);if(!(Xa(n)!==e||!r)&&hy(n,e)){n.stopPropagation();for(let o of r.classList)t.removeClass(e,o);dy(e)}}a(m1,"enterAnimationEnd");function Ga(n){if(lt("NgAnimateEnter"),typeof ngServerMode<"u"&&ngServerMode||!ri)return Ga;let e=A();if(sd(e))return Ga;let t=q();return ad(bu(e),t,()=>g1(e,t,n)),ud(e[re]),gy(e[re],bu(e)),Ga}a(Ga,"\u0275\u0275animateEnterListener");function g1(n,e,t){let r=Je(e,n);t.call(n[be],{target:r,animationComplete:AV})}a(g1,"runEnterAnimationFunction");function Ha(n){if(lt("NgAnimateLeave"),typeof ngServerMode<"u"&&ngServerMode||!ri)return Ha;let e=A();if(sd(e))return Ha;let r=q(),o=e[re].get(Se);return ad(jo(e),r,()=>y1(e,r,n,o)),ud(e[re]),Ha}a(Ha,"\u0275\u0275animateLeave");function y1(n,e,t,r){let{promise:o,resolve:i}=Md(),s=Je(e,n),l=n[W];Yo.add(n[hn]),(jo(n).get(e.index).resolvers??=[]).push(i);let c=Ow(t);return c&&c.length>0?C1(s,e,n,c,l,r):i(),{promise:o,resolve:i}}a(y1,"runLeaveAnimations");function C1(n,e,t,r,o,i){MV(n,o);let s=[],l=jo(t).get(e.index)?.resolvers,c,u=!1,f=a(p=>{if(!(Xa(p)!==n&&p.type!=="animation-fallback")&&(p.type==="animation-fallback"||hy(p,n))){if(u=!0,c&&clearTimeout(c),p.type!=="animation-fallback"&&p.stopPropagation(),qo.delete(n),og(e,n),Array.isArray(e.projection))for(let g of r)o.removeClass(n,g);ig(l,s),sg(t,e)}},"handleOutAnimationEnd");i.runOutsideAngular(()=>{s.push(o.listen(n,"animationend",f)),s.push(o.listen(n,"transitionend",f))}),fy(e,n);for(let p of r)o.addClass(n,p);i.runOutsideAngular(()=>{requestAnimationFrame(()=>{if(u)return;$w(n,qo,ri);let p=qo.get(n);p?(c=setTimeout(()=>{f(new CustomEvent("animation-fallback"))},p.duration+50),s.push(()=>clearTimeout(c))):(og(e,n),ig(l,s),sg(t,e))})})}a(C1,"animateLeaveClassRunner");function zu(n){if(lt("NgAnimateLeave"),typeof ngServerMode<"u"&&ngServerMode||!ri)return zu;let e=A(),t=q();Yo.add(e[hn]);let r=e[re].get(Se),o=e[re].get(Fw);return ad(jo(e),t,()=>v1(e,t,n,r,o)),ud(e[re]),zu}a(zu,"\u0275\u0275animateLeaveListener");function v1(n,e,t,r,o){let{promise:i,resolve:s}=Md(),l=Je(e,n),c=[],u=n[W],f=sd(n);(jo(n).get(e.index).resolvers??=[]).push(s);let p=jo(n).get(e.index)?.resolvers;if(f)lu(n,e,l,p,c);else{let m=setTimeout(()=>lu(n,e,l,p,c),o),g={target:l,animationComplete:a(()=>{lu(n,e,l,p,c),clearTimeout(m)},"animationComplete")};fy(e,l),r.runOutsideAngular(()=>{c.push(u.listen(l,"animationend",()=>{lu(n,e,l,p,c),clearTimeout(m)},{once:!0}))}),t.call(n[be],g)}return{promise:i,resolve:s}}a(v1,"runLeaveAnimationFunction");function KR(){return A()[it][be]}a(KR,"\u0275\u0275componentInstance");var Mg=class{static{a(this,"LiveCollection")}destroy(e){}updateValue(e,t){}swap(e,t){let r=Math.min(e,t),o=Math.max(e,t),i=this.detach(o);if(o-r>1){let s=this.detach(r);this.attach(r,i),this.attach(o,s)}else this.attach(r,i)}move(e,t){this.attach(t,this.detach(e))}};function Rm(n,e,t,r,o){return n===t&&Object.is(e,r)?1:Object.is(o(n,e),o(t,r))?-1:0}a(Rm,"valuesMatching");function S1(n,e,t,r){let o,i,s=0,l=n.length-1,c=void 0;if(Array.isArray(e)){V(r);let u=e.length-1;for(V(null);s<=l&&s<=u;){let f=n.at(s),p=e[s],m=Rm(s,f,s,p,t);if(m!==0){m<0&&n.updateValue(s,p),s++;continue}let g=n.at(l),y=e[u],C=Rm(l,g,u,y,t);if(C!==0){C<0&&n.updateValue(l,y),l--,u--;continue}let v=t(s,f),S=t(l,g),E=t(s,p);if(Object.is(E,S)){let I=t(u,y);Object.is(I,v)?(n.swap(s,l),n.updateValue(l,y),u--,l--):n.move(l,s),n.updateValue(s,p),s++;continue}if(o??=new Wu,i??=QT(n,s,l,t),bg(n,o,s,E))n.updateValue(s,p),s++,l++;else if(i.has(E))o.set(v,n.detach(s)),l--;else{let I=n.create(s,e[s]);n.attach(s,I),s++,l++}}for(;s<=u;)XT(n,o,t,s,e[s]),s++}else if(e!=null){V(r);let u=e[Symbol.iterator]();V(null);let f=u.next();for(;!f.done&&s<=l;){let p=n.at(s),m=f.value,g=Rm(s,p,s,m,t);if(g!==0)g<0&&n.updateValue(s,m),s++,f=u.next();else{o??=new Wu,i??=QT(n,s,l,t);let y=t(s,m);if(bg(n,o,s,y))n.updateValue(s,m),s++,l++,f=u.next();else if(!i.has(y))n.attach(s,n.create(s,m)),s++,l++,f=u.next();else{let C=t(s,p);o.set(C,n.detach(s)),l--}}}for(;!f.done;)XT(n,o,t,n.length,f.value),f=u.next()}for(;s<=l;)n.destroy(n.detach(l--));o?.forEach(u=>{n.destroy(u)})}a(S1,"reconcile");function bg(n,e,t,r){return e!==void 0&&e.has(r)?(n.attach(t,e.get(r)),e.delete(r),!0):!1}a(bg,"attachPreviouslyDetached");function XT(n,e,t,r,o){if(bg(n,e,r,t(r,o)))n.updateValue(r,o);else{let i=n.create(r,o);n.attach(r,i)}}a(XT,"createOrAttach");function QT(n,e,t,r){let o=new Set;for(let i=e;i<=t;i++)o.add(r(i,n.at(i)));return o}a(QT,"initLiveItemsInTheFuture");var Wu=class{static{a(this,"UniqueValueMultiKeyMap")}kvMap=new Map;_vMap=void 0;has(e){return this.kvMap.has(e)}delete(e){if(!this.has(e))return!1;let t=this.kvMap.get(e);return this._vMap!==void 0&&this._vMap.has(t)?(this.kvMap.set(e,this._vMap.get(t)),this._vMap.delete(t)):this.kvMap.delete(e),!0}get(e){return this.kvMap.get(e)}set(e,t){if(this.kvMap.has(e)){let r=this.kvMap.get(e);this._vMap===void 0&&(this._vMap=new Map);let o=this._vMap;for(;o.has(r);)r=o.get(r);o.set(r,t)}else this.kvMap.set(e,t)}forEach(e){for(let[t,r]of this.kvMap)if(e(r,t),this._vMap!==void 0){let o=this._vMap;for(;o.has(r);)r=o.get(r),e(r,t)}}};function Pd(n,e,t,r,o,i,s,l){lt("NgControlFlow");let c=A(),u=J(),f=st(u.consts,i);return ti(c,u,n,e,t,r,o,f,256,s,l),xd}a(Pd,"\u0275\u0275conditionalCreate");function xd(n,e,t,r,o,i,s,l){lt("NgControlFlow");let c=A(),u=J(),f=st(u.consts,i);return ti(c,u,n,e,t,r,o,f,512,s,l),xd}a(xd,"\u0275\u0275conditionalBranchCreate");function kd(n,e){lt("NgControlFlow");let t=A(),r=It(),o=t[r]!==ce?t[r]:-1,i=o!==-1?Ku(t,K+o):void 0,s=0;if(Ue(t,r,n)){let l=V(null);try{if(i!==void 0&&Ty(i,s),n!==-1){let c=K+n,u=Ku(t,c),f=kg(t[P],c),p=TA(u,f,t),m=ls(t,f,e,{dehydratedView:p});cs(u,m,s,Xo(f,p))}}finally{V(l)}}else if(i!==void 0){let l=pA(i,s);l!==void 0&&(l[be]=e)}}a(kd,"\u0275\u0275conditional");var Ng=class{static{a(this,"RepeaterContext")}lContainer;$implicit;$index;constructor(e,t,r){this.lContainer=e,this.$implicit=t,this.$index=r}get $count(){return this.lContainer.length-Ne}};function JR(n){return n}a(JR,"\u0275\u0275repeaterTrackByIndex");function jR(n,e){return e}a(jR,"\u0275\u0275repeaterTrackByIdentity");var Pg=class{static{a(this,"RepeaterMetadata")}hasEmptyBlock;trackByFn;liveCollection;constructor(e,t,r){this.hasEmptyBlock=e,this.trackByFn=t,this.liveCollection=r}};function YR(n,e,t,r,o,i,s,l,c,u,f,p,m){lt("NgControlFlow");let g=A(),y=J(),C=c!==void 0,v=A(),S=l?s.bind(v[it][be]):s,E=new Pg(C,S);v[K+n]=E,ti(g,y,n+1,e,t,r,o,st(y.consts,i),256),C&&ti(g,y,n+2,c,u,f,p,st(y.consts,m),512)}a(YR,"\u0275\u0275repeaterCreate");var xg=class extends Mg{static{a(this,"LiveCollectionLContainerImpl")}lContainer;hostLView;templateTNode;operationsCounter=void 0;needsIndexUpdate=!1;constructor(e,t,r){super(),this.lContainer=e,this.hostLView=t,this.templateTNode=r}get length(){return this.lContainer.length-Ne}at(e){return this.getLView(e)[be].$implicit}attach(e,t){let r=t[Ur];this.needsIndexUpdate||=e!==this.length,cs(this.lContainer,t,e,Xo(this.templateTNode,r)),E1(this.lContainer,e)}detach(e){return this.needsIndexUpdate||=e!==this.length-1,I1(this.lContainer,e),_1(this.lContainer,e)}create(e,t){let r=Pu(this.lContainer,this.templateTNode.tView.ssrId);return ls(this.hostLView,this.templateTNode,new Ng(this.lContainer,t,e),{dehydratedView:r})}destroy(e){vl(e[P],e)}updateValue(e,t){this.getLView(e)[be].$implicit=t}reset(){this.needsIndexUpdate=!1}updateIndexes(){if(this.needsIndexUpdate)for(let e=0;e<this.length;e++)this.getLView(e)[be].$index=e}getLView(e){return T1(this.lContainer,e)}};function XR(n){let e=V(null),t=ze();try{let r=A(),o=r[P],i=r[t],s=t+1,l=Ku(r,s);if(i.liveCollection===void 0){let u=kg(o,s);i.liveCollection=new xg(l,r,u)}else i.liveCollection.reset();let c=i.liveCollection;if(S1(c,n,i.trackByFn,e),c.updateIndexes(),i.hasEmptyBlock){let u=It(),f=c.length===0;if(Ue(r,u,f)){let p=t+2,m=Ku(r,p);if(f){let g=kg(o,p),y=TA(m,g,r),C=ls(r,g,void 0,{dehydratedView:y});cs(m,C,0,Xo(g,y))}else o.firstUpdatePass&&EA(m),Ty(m,0)}}}finally{V(e)}}a(XR,"\u0275\u0275repeater");function Ku(n,e){return n[e]}a(Ku,"getLContainer");function E1(n,e){if(n.length<=Ne)return;let t=Ne+e,r=n[t],o=r?r[bn]:void 0;if(r&&o&&o.detachedLeaveAnimationFns&&o.detachedLeaveAnimationFns.length>0){let i=r[re];FV(i,o),Yo.delete(r[hn]),o.detachedLeaveAnimationFns=void 0}}a(E1,"clearDetachAnimationList");function I1(n,e){if(n.length<=Ne)return;let t=Ne+e,r=n[t],o=r?r[bn]:void 0;o&&o.leave&&o.leave.size>0&&(o.detachedLeaveAnimationFns=[])}a(I1,"maybeInitDetachAnimationList");function _1(n,e){return nl(n,e)}a(_1,"detachExistingView");function T1(n,e){return pA(n,e)}a(T1,"getExistingLViewFromLContainer");function kg(n,e){return Vo(n,e)}a(kg,"getExistingTNode");function Yy(n,e,t){let r=A(),o=It();if(Ue(r,o,e)){let i=J(),s=$t();Sy(s,r,n,e,r[W],t)}return Yy}a(Yy,"\u0275\u0275property");function Lg(n,e,t,r,o){gd(e,n,t,o?"class":"style",r)}a(Lg,"setDirectiveInputsWhichShadowsStyling");function ir(n,e,t,r){let o=A(),i=o[P],s=n+K,l=i.firstCreatePass?Ay(s,o,2,e,Iy,Jc(),t,r):i.data[s];if(Nn(l)){let c=o[Jt].tracingService;if(c&&c.componentCreate){let u=i.data[l.directiveStart+l.componentOffset];return c.componentCreate(LA(u),()=>(ZT(n,e,o,l,r),ir))}}return ZT(n,e,o,l,r),ir}a(ir,"\u0275\u0275elementStart");function ZT(n,e,t,r,o){if(pd(r,t,n,e,QR),ki(r)){let i=t[P];fd(i,t,r),Xg(i,r,t)}o!=null&&as(t,r)}a(ZT,"initializeElement");function Xr(){let n=J(),e=q(),t=md(e);return n.firstCreatePass&&Ry(n,t),Jp(t)&&Xp(),Wp(),t.classesWithoutHost!=null&&OO(t)&&Lg(n,t,A(),t.classesWithoutHost,!0),t.stylesWithoutHost!=null&&UO(t)&&Lg(n,t,A(),t.stylesWithoutHost,!1),Xr}a(Xr,"\u0275\u0275elementEnd");function hs(n,e,t,r){return ir(n,e,t,r),Xr(),hs}a(hs,"\u0275\u0275element");function Ld(n,e,t,r){let o=A(),i=o[P],s=n+K,l=i.firstCreatePass?MA(s,i,2,e,t,r):i.data[s];return pd(l,o,n,e,QR),r!=null&&as(o,l),Ld}a(Ld,"\u0275\u0275domElementStart");function Fd(){let n=q(),e=md(n);return Jp(e)&&Xp(),Wp(),Fd}a(Fd,"\u0275\u0275domElementEnd");function Xy(n,e,t,r){return Ld(n,e,t,r),Fd(),Xy}a(Xy,"\u0275\u0275domElement");var QR=a((n,e,t,r,o)=>(Fi(!0),Zg(e[W],r,fm())),"_locateOrCreateElementNode");function Od(n,e,t){let r=A(),o=r[P],i=n+K,s=o.firstCreatePass?Ay(i,r,8,"ng-container",Iy,Jc(),e,t):o.data[i];if(pd(s,r,n,"ng-container",ZR),ki(s)){let l=r[P];fd(l,r,s),Xg(l,s,r)}return t!=null&&as(r,s),Od}a(Od,"\u0275\u0275elementContainerStart");function Dl(){let n=J(),e=q(),t=md(e);return n.firstCreatePass&&Ry(n,t),Dl}a(Dl,"\u0275\u0275elementContainerEnd");function Qy(n,e,t){return Od(n,e,t),Dl(),Qy}a(Qy,"\u0275\u0275elementContainer");function Ud(n,e,t){let r=A(),o=r[P],i=n+K,s=o.firstCreatePass?MA(i,o,8,"ng-container",e,t):o.data[i];return pd(s,r,n,"ng-container",ZR),t!=null&&as(r,s),Ud}a(Ud,"\u0275\u0275domElementContainerStart");function Zy(){let n=q(),e=md(n);return Dl}a(Zy,"\u0275\u0275domElementContainerEnd");function eC(n,e,t){return Ud(n,e,t),Zy(),eC}a(eC,"\u0275\u0275domElementContainer");var ZR=a((n,e,t,r,o)=>(Fi(!0),Sw(e[W],"")),"_locateOrCreateElementContainerNode");function eM(){return A()}a(eM,"\u0275\u0275getCurrentView");function tC(n,e,t){let r=A(),o=It();if(Ue(r,o,e)){let i=J(),s=$t();Ey(s,r,n,e,r[W],t)}return tC}a(tC,"\u0275\u0275domProperty");function nC(n,e,t){let r=A(),o=It();if(Ue(r,o,e)){let i=J(),s=$t(),l=Yc(i.data),c=nA(l,s,r);Ey(s,r,n,e,c,t)}return nC}a(nC,"\u0275\u0275syntheticHostProperty");var Pa=void 0;function D1(n){let e=Math.floor(Math.abs(n)),t=n.toString().replace(/^[^.]*\.?/,"").length;return e===1&&t===0?1:5}a(D1,"plural");var w1=["en",[["a","p"],["AM","PM"]],[["AM","PM"]],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],Pa,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],Pa,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm\u202Fa","h:mm:ss\u202Fa","h:mm:ss\u202Fa z","h:mm:ss\u202Fa zzzz"],["{1}, {0}",Pa,Pa,Pa],[".",",",";","%","+","-","E","\xD7","\u2030","\u221E","NaN",":"],["#,##0.###","#,##0%","\xA4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",D1],Mm=Object.create(null);function Dt(n){let e=A1(n),t=eD(e);if(t)return t;let r=e.split("-")[0];if(t=eD(r),t)return t;if(r==="en")return w1;throw new x(701,!1)}a(Dt,"findLocaleData");function Vd(n){return Dt(n)[Ve.PluralCase]}a(Vd,"getLocalePluralCase");function eD(n){if(!(n in Mm)){let e=Wt.ng&&Wt.ng.common&&Wt.ng.common.locales&&Wt.ng.common.locales[n];return e!==void 0&&(Mm[n]=e),e}return Mm[n]}a(eD,"getLocaleData");var Ve;(function(n){n[n.LocaleId=0]="LocaleId",n[n.DayPeriodsFormat=1]="DayPeriodsFormat",n[n.DayPeriodsStandalone=2]="DayPeriodsStandalone",n[n.DaysFormat=3]="DaysFormat",n[n.DaysStandalone=4]="DaysStandalone",n[n.MonthsFormat=5]="MonthsFormat",n[n.MonthsStandalone=6]="MonthsStandalone",n[n.Eras=7]="Eras",n[n.FirstDayOfWeek=8]="FirstDayOfWeek",n[n.WeekendRange=9]="WeekendRange",n[n.DateFormat=10]="DateFormat",n[n.TimeFormat=11]="TimeFormat",n[n.DateTimeFormat=12]="DateTimeFormat",n[n.NumberSymbols=13]="NumberSymbols",n[n.NumberFormats=14]="NumberFormats",n[n.CurrencyCode=15]="CurrencyCode",n[n.CurrencySymbol=16]="CurrencySymbol",n[n.CurrencyName=17]="CurrencyName",n[n.Currencies=18]="Currencies",n[n.Directionality=19]="Directionality",n[n.PluralCase=20]="PluralCase",n[n.ExtraData=21]="ExtraData"})(Ve||(Ve={}));function A1(n){return n.toLowerCase().replace(/_/g,"-")}a(A1,"normalizeLocale");var R1=["zero","one","two","few","many"];function M1(n,e){let t=Vd(e)(parseInt(n,10)),r=R1[t];return r!==void 0?r:"other"}a(M1,"getPluralCase");var wl="en-US",b1="USD",tM={marker:"element"},nM={marker:"ICU"},On;(function(n){n[n.SHIFT=2]="SHIFT",n[n.APPEND_EAGERLY=1]="APPEND_EAGERLY",n[n.COMMENT=2]="COMMENT"})(On||(On={}));var rM=wl;function oM(n){typeof n=="string"&&(rM=n.toLowerCase().replace(/_/g,"-"))}a(oM,"setLocaleId");function N1(){return rM}a(N1,"getLocaleId");var ll=0,qa=0;function P1(n){n&&(ll=ll|1<<Math.min(qa,31)),qa++}a(P1,"setMaskBit");function x1(n,e,t){try{if(qa>0){let r=n.data[t],o=Array.isArray(r)?r:r.update,i=kn()-qa-1;sM(n,e,o,i,ll)}}finally{ll=0,qa=0}}a(x1,"applyI18n");function k1(n,e,t){let r=n[W];switch(t){case Node.COMMENT_NODE:return Sw(r,e);case Node.TEXT_NODE:return Cw(r,e);case Node.ELEMENT_NODE:return Zg(r,e,null)}}a(k1,"createNodeWithoutHydration");var Cu=a((n,e,t,r)=>(Fi(!0),k1(n,t,r)),"_locateOrCreateNode");function L1(n,e,t,r){let o=n[W];for(let i=0;i<e.length;i++){let s=e[i++],l=e[i],c=(s&On.COMMENT)===On.COMMENT,u=(s&On.APPEND_EAGERLY)===On.APPEND_EAGERLY,f=s>>>On.SHIFT,p=n[f],m=!1;p===null&&(p=n[f]=Cu(n,f,l,c?Node.COMMENT_NODE:Node.TEXT_NODE),m=ba()),u&&t!==null&&m&&Ko(o,t,p,r,!1)}}a(L1,"applyCreateOpCodes");function iM(n,e,t,r){let o=t[W],i=null,s;for(let l=0;l<e.length;l++){let c=e[l];if(typeof c=="string"){let u=e[++l];t[u]===null&&(t[u]=Cu(t,u,c,Node.TEXT_NODE))}else if(typeof c=="number")switch(c&1){case 0:let u=D$(c);i===null&&(i=u,s=o.parentNode(r));let f,p;if(u===i?(f=r,p=s):(f=null,p=Mt(t[u])),p!==null){let C=w$(c),v=t[C];Ko(o,p,v,f,!1);let S=Ua(n,C);if(S!==null&&typeof S=="object"){let E=Sd(S,t);E!==null&&iM(n,S.create[E],t,t[S.anchorIdx])}}break;case 1:let m=c>>>1,g=e[++l],y=e[++l];hd(o,Uo(m,t),null,null,g,y,null);break;default:}else switch(c){case nM:let u=e[++l],f=e[++l];if(t[f]===null){let g=t[f]=Cu(t,f,u,Node.COMMENT_NODE);Wr(g,t)}break;case tM:let p=e[++l],m=e[++l];if(t[m]===null){let g=t[m]=Cu(t,m,p,Node.ELEMENT_NODE);Wr(g,t)}break;default:}}}a(iM,"applyMutableOpCodes");function sM(n,e,t,r,o){for(let i=0;i<t.length;i++){let s=t[i],l=t[++i];if(s&o){let c="";for(let u=i+1;u<=i+l;u++){let f=t[u];if(typeof f=="string")c+=f;else if(typeof f=="number")if(f<0)c+=j(e[r-f]);else{let p=f>>>2;switch(f&3){case 1:let m=t[++u],g=t[++u],y=n.data[p];if(typeof y=="string")hd(e[W],e[p],null,y,m,c,g);else{let v=ze();Fn(p);try{Sy(y,e,m,c,e[W],g)}finally{Fn(v)}}break;case 0:let C=e[p];C!==null&&vw(e[W],C,c);break;case 2:F1(n,Ua(n,p),e,c);break;case 3:tD(n,Ua(n,p),r,e);break}}}}else{let c=t[i+1];if(c>0&&(c&3)===3){let u=c>>>2,f=Ua(n,u);e[f.currentCaseLViewIndex]<0&&tD(n,f,r,e)}}i+=l}}a(sM,"applyUpdateOpCodes");function tD(n,e,t,r){let o=r[e.currentCaseLViewIndex];if(o!==null){let i=ll;o<0&&(o=r[e.currentCaseLViewIndex]=~o,i=-1),sM(n,r,e.update[o],t,i)}}a(tD,"applyIcuUpdateCase");function F1(n,e,t,r){let o=O1(e,r);if(Sd(e,t)!==o&&(aM(n,e,t),t[e.currentCaseLViewIndex]=o===null?null:~o,o!==null)){let s=t[e.anchorIdx];s&&iM(n,e.create[o],t,s),x$(t,e.anchorIdx,o)}}a(F1,"applyIcuSwitchCase");function aM(n,e,t){let r=Sd(e,t);if(r!==null){let o=e.remove[r];for(let i=0;i<o.length;i++){let s=o[i];if(s>0){let l=Uo(s,t);l!==null&&ml(t[W],l)}else aM(n,Ua(n,~s),t)}}}a(aM,"applyIcuSwitchCaseRemove");function O1(n,e){let t=n.cases.indexOf(e);if(t===-1)switch(n.type){case 1:{let r=M1(e,N1());t=n.cases.indexOf(r),t===-1&&r!=="other"&&(t=n.cases.indexOf("other"));break}case 0:{t=n.cases.indexOf("other");break}}return t===-1?null:t}a(O1,"getCaseIndex");var Ju=/�(\d+):?\d*�/gi,U1=/({\s*�\d+:?\d*�\s*,\s*\S{6}\s*,[\s\S]*})/gi,V1=/�(\d+)�/,lM=/^\s*(�\d+:?\d*�)\s*,\s*(select|plural)\s*,/,za="\uFFFD",$1=/�\/?\*(\d+:\d+)�/gi,B1=/�(\/?[#*]\d+):?\d*�/gi,G1=/\uE500/g;function H1(n){return n.replace(G1," ")}a(H1,"replaceNgsp");function q1(n,e,t,r,o,i){let s=Li(),l=[],c=[],u=[[]],f=[[]];o=J1(o,i);let p=H1(o).split(B1);for(let m=0;m<p.length;m++){let g=p[m];if((m&1)===0){let y=Fg(g);for(let C=0;C<y.length;C++){let v=y[C];if((C&1)===0){let S=v;S!==""&&z1(f[0],n,s,u[0],l,c,t,S)}else{let S=v;if(typeof S!="object")throw new Error(`Unable to parse ICU expression in "${o}" message.`);let I=cM(n,s,u[0],t,l,"",!0).index;dM(f[0],n,t,c,e,S,I)}}}else{let y=g.charCodeAt(0)===47,C=g.charCodeAt(y?1:0),v=K+Number.parseInt(g.substring(y?2:1));if(y)u.shift(),f.shift(),xn(Li(),!1);else{let S=T$(n,u[0],v);u.unshift([]),xn(S,!0);let E={kind:2,index:v,children:[],type:C===35?0:1};f[0].push(E),f.unshift(E.children)}}}n.data[r]={create:l,update:c,ast:f[0],parentTNodeIndex:e}}a(q1,"i18nStartFirstCreatePass");function cM(n,e,t,r,o,i,s){let l=yl(n,r,1,null),c=l<<On.SHIFT,u=Li();e===u&&(u=null),u===null&&(c|=On.APPEND_EAGERLY),s&&(c|=On.COMMENT,_V(M$)),o.push(c,i===null?"":i);let f=Dy(n,l,s?32:1,i===null?"":i,null);CA(t,f);let p=f.index;return xn(f,!1),u!==null&&e!==u&&_$(u,p),f}a(cM,"createTNodeAndAddOpCode");function z1(n,e,t,r,o,i,s,l){let c=l.match(Ju),f=cM(e,t,r,s,o,c?null:l,!1).index;c&&ju(i,l,f,null,0,null),n.push({kind:0,index:f})}a(z1,"i18nStartFirstCreatePassProcessTextNode");function W1(n,e,t){let r=q(),o=r.index,i=[];if(n.firstCreatePass&&n.data[e]===null){for(let s=0;s<t.length;s+=2){let l=t[s],c=t[s+1];if(c!==""){if(U1.test(c))throw new Error(`ICU expressions are not supported in attributes. Message: "${c}".`);let u=r.namespace?`:${r.namespace}:${r.value}`:r.value;ju(i,c,o,l,K1(i),Og(l,u))}}n.data[e]=i}}a(W1,"i18nAttributesFirstPass");function ju(n,e,t,r,o,i){let s=n.length,l=s+1;n.push(null,null);let c=s+2,u=e.split(Ju),f=0;for(let p=0;p<u.length;p++){let m=u[p];if(p&1){let g=o+parseInt(m,10);n.push(-1-g),f=f|uM(g)}else m!==""&&n.push(m)}return n.push(t<<2|(r?1:0)),r&&n.push(r,i),n[s]=f,n[l]=n.length-c,f}a(ju,"generateBindingUpdateOpCodes");function K1(n){let e=0;for(let t=0;t<n.length;t++){let r=n[t];typeof r=="number"&&r<0&&e++}return e}a(K1,"countBindings");function uM(n){return 1<<Math.min(n,31)}a(uM,"toMaskBit");function nD(n){let e,t="",r=0,o=!1,i;for(;(e=$1.exec(n))!==null;)o?e[0]===`${za}/*${i}${za}`&&(r=e.index,o=!1):(t+=n.substring(r,e.index+e[0].length),i=e[1],o=!0);return t+=n.slice(r),t}a(nD,"removeInnerTemplateTranslation");function J1(n,e){if(R$(e))return nD(n);{let t=n.indexOf(`:${e}${za}`)+2+e.toString().length,r=n.search(new RegExp(`${za}\\/\\*\\d+:${e}${za}`));return nD(n.substring(t,r))}}a(J1,"getTranslationForTemplate");function dM(n,e,t,r,o,i,s){let l=0,c={type:i.type,currentCaseLViewIndex:yl(e,t,1,null),anchorIdx:s,cases:[],create:[],remove:[],update:[]};Q1(r,i,s),I$(e,s,c);let u=i.values,f=[];for(let p=0;p<u.length;p++){let m=u[p],g=[];for(let C=0;C<m.length;C++){let v=m[C];if(typeof v!="string"){let S=g.push(v)-1;m[C]=`<!--\uFFFD${S}\uFFFD-->`}}let y=[];f.push(y),l=Y1(y,e,c,t,r,o,i.cases[p],m.join(""),g)|l}l&&Z1(r,l,s),n.push({kind:3,index:s,cases:f,currentCaseLViewIndex:c.currentCaseLViewIndex})}a(dM,"icuStart");function j1(n){let e=[],t=[],r=1,o=0;n=n.replace(lM,function(s,l,c){return c==="select"?r=0:r=1,o=parseInt(l.slice(1),10),""});let i=Fg(n);for(let s=0;s<i.length;){let l=i[s++].trim();r===1&&(l=l.replace(/\s*(?:=)?(\w+)\s*/,"$1")),l.length&&e.push(l);let c=Fg(i[s++]);e.length>t.length&&t.push(c)}return{type:r,mainBinding:o,cases:e,values:t}}a(j1,"parseICUBlock");function Fg(n){if(!n)return[];let e=0,t=[],r=[],o=/[{}]/g;o.lastIndex=0;let i;for(;i=o.exec(n);){let l=i.index;if(i[0]=="}"){if(t.pop(),t.length==0){let c=n.substring(e,l);lM.test(c)?r.push(j1(c)):r.push(c),e=l+1}}else{if(t.length==0){let c=n.substring(e,l);r.push(c),e=l+1}t.push("{")}}let s=n.substring(e);return r.push(s),r}a(Fg,"i18nParseTextIntoPartsAndICU");function Y1(n,e,t,r,o,i,s,l,c){let u=[],f=[],p=[];t.cases.push(s),t.create.push(u),t.remove.push(f),t.update.push(p);let g=dw(fl()).getInertBodyElement(l),y=ng(g)||g;return y?fM(n,e,t,r,o,u,f,p,y,i,c,0):0}a(Y1,"parseIcuCase");function fM(n,e,t,r,o,i,s,l,c,u,f,p){let m=0,g=c.firstChild;for(;g;){let y=yl(e,r,1,null);switch(g.nodeType){case Node.ELEMENT_NODE:let C=g,v=C.tagName.toLowerCase();if(Zm.hasOwnProperty(v)){bm(i,tM,v,u,y),e.data[y]=v;let _=C.attributes;for(let w=0;w<_.length;w++){let R=_.item(w),O=R.name.toLowerCase(),M=!!R.value.match(Ju),U=C.namespaceURI,Q=U&&lw[U],ue=Q?`:${Q}:${v}`:v;if(M)eg.hasOwnProperty(O)&&ju(l,R.value,y,R.name,0,Og(O,ue));else if(eg[O]){let Fe=R.value;Og(O,ue)?oD(i,y,R.name,"unsafe:blocked"):oD(i,y,R.name,Fe)}}let T={kind:1,index:y,children:[]};n.push(T),m=fM(T.children,e,t,r,o,i,s,l,g,y,f,p+1)|m,rD(s,y,p)}break;case Node.TEXT_NODE:let S=g.textContent||"",E=S.match(Ju);bm(i,null,E?"":S,u,y),rD(s,y,p),E&&(m=ju(l,S,y,null,0,null)|m),n.push({kind:0,index:y});break;case Node.COMMENT_NODE:let I=V1.exec(g.textContent||"");if(I){let _=parseInt(I[1],10),T=f[_];bm(i,nM,"",u,y),dM(n,e,r,o,u,T,y),X1(s,y,p)}break}g=g.nextSibling}return m}a(fM,"walkIcuTree");function rD(n,e,t){t===0&&n.push(e)}a(rD,"addRemoveNode");function X1(n,e,t){t===0&&(n.push(~e),n.push(e))}a(X1,"addRemoveNestedIcu");function Q1(n,e,t){n.push(uM(e.mainBinding),2,-1-e.mainBinding,t<<2|2)}a(Q1,"addUpdateIcuSwitch");function Z1(n,e,t){n.push(e,1,t<<2|3)}a(Z1,"addUpdateIcuUpdate");function bm(n,e,t,r,o){e!==null&&n.push(e),n.push(t,o,A$(0,r,o))}a(bm,"addCreateNodeAndAppend");function oD(n,e,t,r){n.push(e<<1|1,t,r)}a(oD,"addCreateAttribute");function eG(n){let e=n.toLowerCase(),[t,r]=ey(e,!1);return t===sw||t===aw?`:${t}:${r}`:r}a(eG,"normalizeTagName");function Og(n,e){let t=n.toLowerCase(),r=e?eG(e):"*",[o]=ey(r,!1),i=Up();switch(i[`${r}|${t}`]||(o?i[`:${o}:*|${t}`]:void 0)||i[`*|${t}`]||pe.NONE){case pe.HTML:return ty;case pe.STYLE:return ny;case pe.SCRIPT:return oy;case pe.URL:return rd;case pe.RESOURCE_URL:return od;case pe.ATTRIBUTE_NO_BINDING:return iy;default:return null}}a(Og,"i18nResolveSanitizer");var iD=0,tG=/\[(�.+?�?)\]/,nG=/\[(�.+?�?)\]|(�\/?\*\d+:\d+�)/g,rG=/({\s*)(VAR_(PLURAL|SELECT)(_\d+)?)(\s*,)/g,oG=/{([A-Z0-9_]+)}/g,iG=/�I18N_EXP_(ICU(_\d+)?)�/g,sG=/\/\*/,aG=/\d+\:(\d+)/;function lG(n,e={}){let t=n;if(tG.test(n)){let r={},o=[iD];t=t.replace(nG,(i,s,l)=>{let c=s||l,u=r[c]||[];if(u.length||(c.split("|").forEach(C=>{let v=C.match(aG),S=v?parseInt(v[1],10):iD,E=sG.test(C);u.push([S,E,C])}),r[c]=u),!u.length)throw new Error(`i18n postprocess: unmatched placeholder - ${c}`);let f=o[o.length-1],p=0;for(let C=0;C<u.length;C++)if(u[C][0]===f){p=C;break}let[m,g,y]=u[p];return g?o.pop():f!==m&&o.push(m),u.splice(p,1),y})}return Object.keys(e).length&&(t=t.replace(rG,(r,o,i,s,l,c)=>e.hasOwnProperty(i)?`${o}${e[i]}${c}`:r),t=t.replace(oG,(r,o)=>e.hasOwnProperty(o)?e[o]:r),t=t.replace(iG,(r,o)=>{if(e.hasOwnProperty(o)){let i=e[o];if(!i.length)throw new Error(`i18n postprocess: unmatched ICU - ${r} with key: ${o}`);return i.shift()}return r})),t}a(lG,"i18nPostprocess");function rC(n,e,t=-1){let r=J(),o=A(),i=K+n,s=st(r.consts,e),l=Li();if(r.firstCreatePass&&q1(r,l===null?0:l.index,o,i,s,t),r.type===2){let m=o[it];m[G]|=32}else o[G]|=32;let c=r.data[i],u=l===o[ot]?null:l,f=Kw(r,u,o),p=l&&l.type&8?o[l.index]:null;N$(o,i,l,t),L1(o,c.create,f,p),sm(!0)}a(rC,"\u0275\u0275i18nStart");function oC(){sm(!1)}a(oC,"\u0275\u0275i18nEnd");function hM(n,e,t){rC(n,e,t),oC()}a(hM,"\u0275\u0275i18n");function pM(n,e){let t=J(),r=st(t.consts,e);W1(t,n+K,r)}a(pM,"\u0275\u0275i18nAttributes");function iC(n){let e=A();return P1(Ue(e,It(),n)),iC}a(iC,"\u0275\u0275i18nExp");function mM(n){x1(J(),A(),n+K)}a(mM,"\u0275\u0275i18nApply");function gM(n,e={}){return lG(n,e)}a(gM,"\u0275\u0275i18nPostprocess");function sC(n,e,t){let r=A(),o=J(),i=q();return cC(o,r,r[W],i,n,e,t),sC}a(sC,"\u0275\u0275listener");function aC(n,e){let t=q(),r=A(),o=J(),i=Yc(o.data),s=nA(i,t,r);return cC(o,r,s,t,n,e),aC}a(aC,"\u0275\u0275syntheticHostListener");function lC(n,e,t){let r=A(),o=J(),i=q();return(i.type&3||t)&&by(i,o,r,t,r[W],n,e,zo(i,r,e)),lC}a(lC,"\u0275\u0275domListener");function cC(n,e,t,r,o,i,s){let l=!0,c=null;if((r.type&3||s)&&(c??=zo(r,e,i),by(r,n,e,s,t,o,i,c)&&(l=!1)),l){let u=r.outputs?.[o],f=r.hostDirectiveOutputs?.[o];if(f&&f.length)for(let p=0;p<f.length;p+=2){let m=f[p],g=f[p+1];c??=zo(r,e,i),Lu(r,e,m,g,o,c)}if(u&&u.length)for(let p of u)c??=zo(r,e,i),Lu(r,e,p,o,o,c)}}a(cC,"listenerInternal");function yM(n=1){return tT(n)}a(yM,"\u0275\u0275nextContext");function cG(n,e){let t=null,r=pV(n);for(let o=0;o<e.length;o++){let i=e[o];if(i==="*"){t=o;continue}if(r===null?Pw(n,i,!0):yV(r,i))return o}return t}a(cG,"matchingProjectionSlotIndex");function CM(n){let e=A()[it][ot];if(!e.projection){let t=n?n.length:1,r=e.projection=Ia(t,null),o=r.slice(),i=e.child;for(;i!==null;){if(i.type!==128){let s=n?cG(i,n):0;s!==null&&(o[s]?o[s].projectionNext=i:r[s]=i,o[s]=i)}i=i.next}}}a(CM,"\u0275\u0275projectionDef");function vM(n,e=0,t,r,o,i){let s=A(),l=J(),c=r?n+1:null;c!==null&&ti(s,l,c,r,o,i,null,t);let u=ii(l,K+n,16,null,t||null);u.projection===null&&(u.projection=e),nm();let p=!s[Ur]||Kp();s[it][ot].projection[u.projection]===null&&c!==null?uG(s,l,c):p&&!nd(u)&&HV(l,s,u)}a(vM,"\u0275\u0275projection");function uG(n,e,t){let r=K+t,o=e.data[r],i=n[r],s=Pu(i,o.tView.ssrId),l=ls(n,o,void 0,{dehydratedView:s});cs(i,l,0,Xo(o,s))}a(uG,"insertFallbackContent");function uC(n,e,t,r){return GA(n,e,t,r),uC}a(uC,"\u0275\u0275contentQuery");function Al(n,e,t){return BA(n,e,t),Al}a(Al,"\u0275\u0275viewQuery");function $d(n){let e=A(),t=J(),r=Xc();Ma(r+1);let o=Py(t,r);if(n.dirty&&q_(e)===((o.metadata.flags&2)===2)){if(o.matches===null)n.reset([]);else{let i=qA(e,r);n.reset(i,BD),n.notifyOnChanges()}return!0}return!1}a($d,"\u0275\u0275queryRefresh");function Bd(){return Ny(A(),Xc())}a(Bd,"\u0275\u0275loadQuery");function dC(n,e,t,r,o){return WA(e,GA(n,t,r,o)),dC}a(dC,"\u0275\u0275contentQuerySignal");function fC(n,e,t,r){return WA(n,BA(e,t,r)),fC}a(fC,"\u0275\u0275viewQuerySignal");function SM(n=1){Ma(Xc()+n)}a(SM,"\u0275\u0275queryAdvance");function EM(n){let e=rm();return Hr(e,K+n)}a(EM,"\u0275\u0275reference");function du(n,e){return n<<17|e<<2}a(du,"toTStylingRange");function ni(n){return n>>17&32767}a(ni,"getTStylingRangePrev");function dG(n){return(n&2)==2}a(dG,"getTStylingRangePrevDuplicate");function fG(n,e){return n&131071|e<<17}a(fG,"setTStylingRangePrev");function Ug(n){return n|2}a(Ug,"setTStylingRangePrevDuplicate");function es(n){return(n&131068)>>2}a(es,"getTStylingRangeNext");function Nm(n,e){return n&-131069|e<<2}a(Nm,"setTStylingRangeNext");function hG(n){return(n&1)===1}a(hG,"getTStylingRangeNextDuplicate");function Vg(n){return n|1}a(Vg,"setTStylingRangeNextDuplicate");function pG(n,e,t,r,o,i){let s=i?e.classBindings:e.styleBindings,l=ni(s),c=es(s);n[r]=t;let u=!1,f;if(Array.isArray(t)){let p=t;f=p[1],(f===null||Ni(p,f)>0)&&(u=!0)}else f=t;if(o)if(c!==0){let m=ni(n[l+1]);n[r+1]=du(m,l),m!==0&&(n[m+1]=Nm(n[m+1],r)),n[l+1]=fG(n[l+1],r)}else n[r+1]=du(l,0),l!==0&&(n[l+1]=Nm(n[l+1],r)),l=r;else n[r+1]=du(c,0),l===0?l=r:n[c+1]=Nm(n[c+1],r),c=r;u&&(n[r+1]=Ug(n[r+1])),sD(n,f,r,!0),sD(n,f,r,!1),mG(e,f,n,r,i),s=du(l,c),i?e.classBindings=s:e.styleBindings=s}a(pG,"insertTStylingBinding");function mG(n,e,t,r,o){let i=o?n.residualClasses:n.residualStyles;i!=null&&typeof e=="string"&&Ni(i,e)>=0&&(t[r+1]=Vg(t[r+1]))}a(mG,"markDuplicateOfResidualStyling");function sD(n,e,t,r){let o=n[t+1],i=e===null,s=r?ni(o):es(o),l=!1;for(;s!==0&&(l===!1||i);){let c=n[s],u=n[s+1];gG(c,e)&&(l=!0,n[s+1]=r?Vg(u):Ug(u)),s=r?ni(u):es(u)}l&&(n[t+1]=r?Ug(o):Vg(o))}a(sD,"markDuplicates");function gG(n,e){return n===null||e==null||(Array.isArray(n)?n[1]:n)===e?!0:Array.isArray(n)&&typeof e=="string"?Ni(n,e)>=0:!1}a(gG,"isStylingMatch");var je={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function IM(n){return n.substring(je.key,je.keyEnd)}a(IM,"getLastParsedKey");function yG(n){return n.substring(je.value,je.valueEnd)}a(yG,"getLastParsedValue");function CG(n){return DM(n),_M(n,ts(n,0,je.textEnd))}a(CG,"parseClassName");function _M(n,e){let t=je.textEnd;return t===e?-1:(e=je.keyEnd=SG(n,je.key=e,t),ts(n,e,t))}a(_M,"parseClassNameNext");function vG(n){return DM(n),TM(n,ts(n,0,je.textEnd))}a(vG,"parseStyle");function TM(n,e){let t=je.textEnd,r=je.key=ts(n,e,t);return t===r?-1:(r=je.keyEnd=EG(n,r,t),r=aD(n,r,t,58),r=je.value=ts(n,r,t),r=je.valueEnd=IG(n,r,t),aD(n,r,t,59))}a(TM,"parseStyleNext");function DM(n){je.key=0,je.keyEnd=0,je.value=0,je.valueEnd=0,je.textEnd=n.length}a(DM,"resetParserState");function ts(n,e,t){for(;e<t&&n.charCodeAt(e)<=32;)e++;return e}a(ts,"consumeWhitespace");function SG(n,e,t){for(;e<t&&n.charCodeAt(e)>32;)e++;return e}a(SG,"consumeClassToken");function EG(n,e,t){let r;for(;e<t&&((r=n.charCodeAt(e))===45||r===95||(r&-33)>=65&&(r&-33)<=90||r>=48&&r<=57);)e++;return e}a(EG,"consumeStyleKey");function aD(n,e,t,r){return e=ts(n,e,t),e<t&&e++,e}a(aD,"consumeSeparator");function IG(n,e,t){let r=-1,o=-1,i=-1,s=e,l=s;for(;s<t;){let c=n.charCodeAt(s++);if(c===59)return l;c===34||c===39?l=s=lD(n,c,s,t):e===s-4&&i===85&&o===82&&r===76&&c===40?l=s=lD(n,41,s,t):c>32&&(l=s),i=o,o=r,r=c&-33}return l}a(IG,"consumeStyleValue");function lD(n,e,t,r){let o=-1,i=t;for(;i<r;){let s=n.charCodeAt(i++);if(s==e&&o!==92)return i;s==92&&o===92?o=0:o=s}throw new Error}a(lD,"consumeQuotedText");function Gd(n,e,t){return RM(n,e,t,!1),Gd}a(Gd,"\u0275\u0275styleProp");function Rl(n,e){return RM(n,e,null,!0),Rl}a(Rl,"\u0275\u0275classProp");function wM(n){MM(PM,_G,n,!1)}a(wM,"\u0275\u0275styleMap");function _G(n,e){for(let t=vG(e);t>=0;t=TM(e,t))PM(n,IM(e),yG(e))}a(_G,"styleStringParser");function AM(n){MM(bG,TG,n,!0)}a(AM,"\u0275\u0275classMap");function TG(n,e){for(let t=CG(e);t>=0;t=_M(e,t))_a(n,IM(e),!0)}a(TG,"classStringParser");function RM(n,e,t,r){let o=A(),i=J(),s=Ln(2);if(i.firstUpdatePass&&NM(i,n,s,r),e!==ce&&Ue(o,s,e)){let l=i.data[ze()];xM(i,l,o,o[W],n,o[s+1]=PG(e,t),r,s)}}a(RM,"checkStylingProperty");function MM(n,e,t,r){let o=J(),i=Ln(2);o.firstUpdatePass&&NM(o,null,i,r);let s=A();if(t!==ce&&Ue(s,i,t)){let l=o.data[ze()];if(kM(l,r)&&!bM(o,i)){let c=r?l.classesWithoutHost:l.stylesWithoutHost;c!==null&&(t=Pc(c,t||"")),Lg(o,l,s,t,r)}else NG(o,l,s,s[W],s[i+1],s[i+1]=MG(n,e,t),r,i)}}a(MM,"checkStylingMap");function bM(n,e){return e>=n.expandoStartIndex}a(bM,"isInHostBindings");function NM(n,e,t,r){let o=n.data;if(o[t+1]===null){let i=o[ze()],s=bM(n,t);kM(i,r)&&e===null&&!s&&(e=!1),e=DG(o,i,e,r),pG(o,i,e,t,s,r)}}a(NM,"stylingFirstUpdatePass");function DG(n,e,t,r){let o=Yc(n),i=r?e.residualClasses:e.residualStyles;if(o===null)(r?e.classBindings:e.styleBindings)===0&&(t=Pm(null,n,e,t,r),t=cl(t,e.attrs,r),i=null);else{let s=e.directiveStylingLast;if(s===-1||n[s]!==o)if(t=Pm(o,n,e,t,r),i===null){let c=wG(n,e,r);c!==void 0&&Array.isArray(c)&&(c=Pm(null,n,e,c[1],r),c=cl(c,e.attrs,r),AG(n,e,r,c))}else i=RG(n,e,r)}return i!==void 0&&(r?e.residualClasses=i:e.residualStyles=i),t}a(DG,"wrapInStaticStylingKey");function wG(n,e,t){let r=t?e.classBindings:e.styleBindings;if(es(r)!==0)return n[ni(r)]}a(wG,"getTemplateHeadTStylingKey");function AG(n,e,t,r){let o=t?e.classBindings:e.styleBindings;n[ni(o)]=r}a(AG,"setTemplateHeadTStylingKey");function RG(n,e,t){let r,o=e.directiveEnd;for(let i=1+e.directiveStylingLast;i<o;i++){let s=n[i].hostAttrs;r=cl(r,s,t)}return cl(r,e.attrs,t)}a(RG,"collectResidual");function Pm(n,e,t,r,o){let i=null,s=t.directiveEnd,l=t.directiveStylingLast;for(l===-1?l=t.directiveStart:l++;l<s&&(i=e[l],r=cl(r,i.hostAttrs,o),i!==n);)l++;return n!==null&&(t.directiveStylingLast=l),r}a(Pm,"collectStylingFromDirectives");function cl(n,e,t){let r=t?1:2,o=-1;if(e!==null)for(let i=0;i<e.length;i++){let s=e[i];typeof s=="number"?o=s:o===r&&(Array.isArray(n)||(n=n===void 0?[]:["",n]),_a(n,s,t?!0:e[++i]))}return n===void 0?null:n}a(cl,"collectStylingFromTAttrs");function MG(n,e,t){if(t==null||t==="")return se;let r=[],o=$n(t);if(Array.isArray(o))for(let i=0;i<o.length;i++)n(r,o[i],!0);else if(o instanceof Set)for(let i of o)n(r,i,!0);else if(typeof o=="object")for(let i in o)o.hasOwnProperty(i)&&n(r,i,o[i]);else typeof o=="string"&&e(r,o);return r}a(MG,"toStylingKeyValueArray");function PM(n,e,t){_a(n,e,$n(t))}a(PM,"styleKeyValueArraySet");function bG(n,e,t){let r=String(e);r!==""&&!r.includes(" ")&&_a(n,r,t)}a(bG,"classKeyValueArraySet");function NG(n,e,t,r,o,i,s,l){o===ce&&(o=se);let c=0,u=0,f=0<o.length?o[0]:null,p=0<i.length?i[0]:null;for(;f!==null||p!==null;){let m=c<o.length?o[c+1]:void 0,g=u<i.length?i[u+1]:void 0,y=null,C;f===p?(c+=2,u+=2,m!==g&&(y=p,C=g)):p===null||f!==null&&f<p?(c+=2,y=f):(u+=2,y=p,C=g),y!==null&&xM(n,e,t,r,y,C,s,l),f=c<o.length?o[c]:null,p=u<i.length?i[u]:null}}a(NG,"updateStylingMap");function xM(n,e,t,r,o,i,s,l){if(!(e.type&3))return;let c=n.data,u=c[l+1],f=hG(u)?cD(c,e,t,o,es(u),s):void 0;if(!Yu(f)){Yu(i)||dG(u)&&(i=cD(c,null,t,o,l,s));let p=Uo(ze(),t);zV(r,s,p,o,i)}}a(xM,"updateStyling");function cD(n,e,t,r,o,i){let s=e===null,l;for(;o>0;){let c=n[o],u=Array.isArray(c),f=u?c[1]:c,p=f===null,m=t[o+1];m===ce&&(m=p?se:void 0);let g=p?$c(m,r):f===r?m:void 0;if(u&&!Yu(g)&&(g=$c(c,r)),Yu(g)&&(l=g,s))return l;let y=n[o+1];o=s?ni(y):es(y)}if(e!==null){let c=i?e.residualClasses:e.residualStyles;c!=null&&(l=$c(c,r))}return l}a(cD,"findStylingValue");function Yu(n){return n!==void 0}a(Yu,"isStylingValuePresent");function PG(n,e){return n==null||n===""||(typeof e=="string"?n=n+e:typeof n=="object"&&(n=ga($n(n)))),n}a(PG,"normalizeSuffix");function kM(n,e){return(n.flags&(e?8:16))!==0}a(kM,"hasStylingInputShadow");function Hd(n,e=""){let t=A(),r=J(),o=n+K,i=r.firstCreatePass?ii(r,o,1,e,null):r.data[o],s=xG(r,t,i,e);t[o]=s,ba()&&Cy(r,t,s,i),xn(i,!1)}a(Hd,"\u0275\u0275text");var xG=a((n,e,t,r)=>(Fi(!0),Cw(e[W],r)),"_locateOrCreateTextNode");function LM(n,e){let t=!1,r=kn();for(let i=1;i<e.length;i+=2)t=Ue(n,r++,e[i])||t;if(im(r),!t)return ce;let o=e[0];for(let i=1;i<e.length;i+=2)o+=j(e[i])+(i+1!==e.length?e[i+1]:"");return o}a(LM,"interpolationV");function FM(n,e,t,r=""){return Ue(n,It(),t)?e+j(t)+r:ce}a(FM,"interpolation1");function OM(n,e,t,r,o,i=""){let s=kn(),l=Zo(n,s,t,o);return Ln(2),l?e+j(t)+r+j(o)+i:ce}a(OM,"interpolation2");function UM(n,e,t,r,o,i,s,l=""){let c=kn(),u=Td(n,c,t,o,s);return Ln(3),u?e+j(t)+r+j(o)+i+j(s)+l:ce}a(UM,"interpolation3");function VM(n,e,t,r,o,i,s,l,c,u=""){let f=kn(),p=Xt(n,f,t,o,s,c);return Ln(4),p?e+j(t)+r+j(o)+i+j(s)+l+j(c)+u:ce}a(VM,"interpolation4");function $M(n,e,t,r,o,i,s,l,c,u,f,p=""){let m=kn(),g=Xt(n,m,t,o,s,c);return g=Ue(n,m+4,f)||g,Ln(5),g?e+j(t)+r+j(o)+i+j(s)+l+j(c)+u+j(f)+p:ce}a($M,"interpolation5");function BM(n,e,t,r,o,i,s,l,c,u,f,p,m,g=""){let y=kn(),C=Xt(n,y,t,o,s,c);return C=Zo(n,y+4,f,m)||C,Ln(6),C?e+j(t)+r+j(o)+i+j(s)+l+j(c)+u+j(f)+p+j(m)+g:ce}a(BM,"interpolation6");function GM(n,e,t,r,o,i,s,l,c,u,f,p,m,g,y,C=""){let v=kn(),S=Xt(n,v,t,o,s,c);return S=Td(n,v+4,f,m,y)||S,Ln(7),S?e+j(t)+r+j(o)+i+j(s)+l+j(c)+u+j(f)+p+j(m)+g+j(y)+C:ce}a(GM,"interpolation7");function HM(n,e,t,r,o,i,s,l,c,u,f,p,m,g,y,C,v,S=""){let E=kn(),I=Xt(n,E,t,o,s,c);return I=Xt(n,E+4,f,m,y,v)||I,Ln(8),I?e+j(t)+r+j(o)+i+j(s)+l+j(c)+u+j(f)+p+j(m)+g+j(y)+C+j(v)+S:ce}a(HM,"interpolation8");function hC(n){return qd("",n),hC}a(hC,"\u0275\u0275textInterpolate");function qd(n,e,t){let r=A(),o=FM(r,n,e,t);return o!==ce&&cr(r,ze(),o),qd}a(qd,"\u0275\u0275textInterpolate1");function pC(n,e,t,r,o){let i=A(),s=OM(i,n,e,t,r,o);return s!==ce&&cr(i,ze(),s),pC}a(pC,"\u0275\u0275textInterpolate2");function mC(n,e,t,r,o,i,s){let l=A(),c=UM(l,n,e,t,r,o,i,s);return c!==ce&&cr(l,ze(),c),mC}a(mC,"\u0275\u0275textInterpolate3");function gC(n,e,t,r,o,i,s,l,c){let u=A(),f=VM(u,n,e,t,r,o,i,s,l,c);return f!==ce&&cr(u,ze(),f),gC}a(gC,"\u0275\u0275textInterpolate4");function yC(n,e,t,r,o,i,s,l,c,u,f){let p=A(),m=$M(p,n,e,t,r,o,i,s,l,c,u,f);return m!==ce&&cr(p,ze(),m),yC}a(yC,"\u0275\u0275textInterpolate5");function CC(n,e,t,r,o,i,s,l,c,u,f,p,m){let g=A(),y=BM(g,n,e,t,r,o,i,s,l,c,u,f,p,m);return y!==ce&&cr(g,ze(),y),CC}a(CC,"\u0275\u0275textInterpolate6");function vC(n,e,t,r,o,i,s,l,c,u,f,p,m,g,y){let C=A(),v=GM(C,n,e,t,r,o,i,s,l,c,u,f,p,m,g,y);return v!==ce&&cr(C,ze(),v),vC}a(vC,"\u0275\u0275textInterpolate7");function SC(n,e,t,r,o,i,s,l,c,u,f,p,m,g,y,C,v){let S=A(),E=HM(S,n,e,t,r,o,i,s,l,c,u,f,p,m,g,y,C,v);return E!==ce&&cr(S,ze(),E),SC}a(SC,"\u0275\u0275textInterpolate8");function EC(n){let e=A(),t=LM(e,n);return t!==ce&&cr(e,ze(),t),EC}a(EC,"\u0275\u0275textInterpolateV");function cr(n,e,t){let r=Uo(e,n);vw(n[W],r,t)}a(cr,"textBindingInternal");function IC(n,e,t){qy(e)&&(e=e());let r=A(),o=It();if(Ue(r,o,e)){let i=J(),s=$t();Sy(s,r,n,e,r[W],t)}return IC}a(IC,"\u0275\u0275twoWayProperty");function qM(n,e){let t=qy(n);return t&&n.set(e),t}a(qM,"\u0275\u0275twoWayBindingSet");function _C(n,e){let t=A(),r=J(),o=q();return cC(r,t,t[W],o,n,e),_C}a(_C,"\u0275\u0275twoWayListener");var zM={};function TC(n){lt("NgLet");let e=J(),t=A(),r=n+K,o=ii(e,r,128,null,null);return xn(o,!1),wa(e,t,r,zM),TC}a(TC,"\u0275\u0275declareLet");function WM(n){let e=J(),t=A(),r=ze();return wa(e,t,r,n),n}a(WM,"\u0275\u0275storeLet");function KM(n){let e=rm(),t=Hr(e,K+n);if(t===zM)throw new x(314,!1);return t}a(KM,"\u0275\u0275readContextLet");function JM(n,e){let t=J(),r=A(),o=r[W],i="data-ng-source-location";for(let[s,l,c,u]of e){let f=Vo(t,s+K),p=Uo(s+K,r);if(!p.hasAttribute(i)){let m=`${n}@o:${l},l:${c},c:${u}`;o.setAttribute(p,i,m)}}}a(JM,"\u0275\u0275attachSourceLocations");function jM(n){return Ue(A(),It(),n)?j(n):ce}a(jM,"\u0275\u0275interpolate");function YM(n,e,t=""){return FM(A(),n,e,t)}a(YM,"\u0275\u0275interpolate1");function XM(n,e,t,r,o=""){return OM(A(),n,e,t,r,o)}a(XM,"\u0275\u0275interpolate2");function QM(n,e,t,r,o,i,s=""){return UM(A(),n,e,t,r,o,i,s)}a(QM,"\u0275\u0275interpolate3");function ZM(n,e,t,r,o,i,s,l,c=""){return VM(A(),n,e,t,r,o,i,s,l,c)}a(ZM,"\u0275\u0275interpolate4");function e0(n,e,t,r,o,i,s,l,c,u,f=""){return $M(A(),n,e,t,r,o,i,s,l,c,u,f)}a(e0,"\u0275\u0275interpolate5");function t0(n,e,t,r,o,i,s,l,c,u,f,p,m=""){return BM(A(),n,e,t,r,o,i,s,l,c,u,f,p,m)}a(t0,"\u0275\u0275interpolate6");function n0(n,e,t,r,o,i,s,l,c,u,f,p,m,g,y=""){return GM(A(),n,e,t,r,o,i,s,l,c,u,f,p,m,g,y)}a(n0,"\u0275\u0275interpolate7");function r0(n,e,t,r,o,i,s,l,c,u,f,p,m,g,y,C,v=""){return HM(A(),n,e,t,r,o,i,s,l,c,u,f,p,m,g,y,C,v)}a(r0,"\u0275\u0275interpolate8");function o0(n){return LM(A(),n)}a(o0,"\u0275\u0275interpolateV");function i0(n,e,t){let r=at()+n,o=A();return o[r]===ce?yn(o,r,e(t,o)):us(o,r)}a(i0,"\u0275\u0275arrowFunction");function uD(n,e,t){let r=J();r.firstCreatePass&&s0(e,r.data,r.blueprint,jt(n),t)}a(uD,"providersResolver");function s0(n,e,t,r,o){if(n=ne(n),Array.isArray(n))for(let i=0;i<n.length;i++)s0(n[i],e,t,r,o);else{let i=J(),s=A(),l=q(),c=Ro(n)?n:ne(n.provide),u=xp(n),f=l.providerIndexes&1048575,p=l.directiveStart,m=l.providerIndexes>>20;if(Ro(n)||!n.multi){let g=new Wo(u,o,$e,null),y=km(c,e,o?f:f+m,p);y===-1?(Um(wu(l,s),i,c),xm(i,n,e.length),e.push(c),l.directiveStart++,l.directiveEnd++,o&&(l.providerIndexes+=1048576),t.push(g),s.push(g)):(t[y]=g,s[y]=g)}else{let g=km(c,e,f+m,p),y=km(c,e,f,f+m),C=g>=0&&t[g],v=y>=0&&t[y];if(o&&!v||!o&&!C){Um(wu(l,s),i,c);let S=FG(o?LG:kG,t.length,o,r,u,n);!o&&v&&(t[y].providerFactory=S),xm(i,n,e.length,0),e.push(c),l.directiveStart++,l.directiveEnd++,o&&(l.providerIndexes+=1048576),t.push(S),s.push(S)}else{let S=a0(t[o?y:g],u,!o&&r);xm(i,n,g>-1?g:y,S)}!o&&r&&v&&t[y].componentProviders++}}}a(s0,"resolveProvider");function xm(n,e,t,r){let o=Ro(e),i=H_(e);if(o||i){let c=(i?ne(e.useClass):e).prototype.ngOnDestroy;if(c){let u=n.destroyHooks||(n.destroyHooks=[]);if(!o&&e.multi){let f=u.indexOf(t);f===-1?u.push(t,[r,c]):u[f+1].push(r,c)}else u.push(t,c)}}}a(xm,"registerDestroyHooksIfSupported");function a0(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}a(a0,"multiFactoryAdd");function km(n,e,t,r){for(let o=t;o<r;o++)if(e[o]===n)return o;return-1}a(km,"indexOf");function kG(n,e,t,r,o){return $g(this.multi,[])}a(kG,"multiProvidersFactoryResolver");function LG(n,e,t,r,o){let i=this.multi,s;if(this.providerFactory){let l=this.providerFactory.componentProviders,c=Wa(r,r[P],this.providerFactory.index,o);s=c.slice(0,l),$g(i,s);for(let u=l;u<c.length;u++)s.push(c[u])}else s=[],$g(i,s);return s}a(LG,"multiViewProvidersFactoryResolver");function $g(n,e){for(let t=0;t<n.length;t++){let r=n[t];e.push(r())}return e}a($g,"multiResolve");function FG(n,e,t,r,o,i){let s=new Wo(n,t,$e,null);return s.multi=[],s.index=e,s.componentProviders=0,a0(s,o,r&&!t),s}a(FG,"multiFactory");function l0(n,e){return t=>{t.providersResolver=(r,o)=>uD(r,o?o(n):n,!1),e&&(t.viewProvidersResolver=(r,o)=>uD(r,o?o(e):e,!0))}}a(l0,"\u0275\u0275ProvidersFeature");function c0(n){return e=>{n.length<1||(e.getExternalStyles=t=>n.map(o=>o+"?ngcomp"+(t?"="+encodeURIComponent(t):"")+"&e="+e.encapsulation))}}a(c0,"\u0275\u0275ExternalStylesFeature");function u0(n,e,t){let r=n.\u0275cmp;r.directiveDefs=Bu(e,ZA),r.pipeDefs=Bu(t,dn)}a(u0,"\u0275\u0275setComponentScope");function DC(n,e){return sr(()=>{let t=Lc(n);t.declarations=fu(e.declarations||se),t.imports=fu(e.imports||se),t.exports=fu(e.exports||se),e.bootstrap&&(t.bootstrap=fu(e.bootstrap)),Xi.registerNgModule(n,e)})}a(DC,"\u0275\u0275setNgModuleScope");function fu(n){if(typeof n=="function")return n;let e=fn(n);return e.some(Ca)?()=>e.map(ne).map(dD):e.map(dD)}a(fu,"convertToTypeArray");function dD(n){return wy(n)?n.ngModule:n}a(dD,"maybeUnwrapModuleWithProviders");function d0(n,e){let t=at()+n,r=A();return r[t]===ce?yn(r,t,e()):us(r,t)}a(d0,"\u0275\u0275pureFunction0");function f0(n,e,t){return E0(A(),at(),n,e,t)}a(f0,"\u0275\u0275pureFunction1");function h0(n,e,t,r){return I0(A(),at(),n,e,t,r)}a(h0,"\u0275\u0275pureFunction2");function p0(n,e,t,r,o){return _0(A(),at(),n,e,t,r,o)}a(p0,"\u0275\u0275pureFunction3");function m0(n,e,t,r,o,i,s){return T0(A(),at(),n,e,t,r,o,i)}a(m0,"\u0275\u0275pureFunction4");function g0(n,e,t,r,o,i,s){let l=at()+n,c=A(),u=Xt(c,l,t,r,o,i);return Ue(c,l+4,s)||u?yn(c,l+5,e(t,r,o,i,s)):us(c,l+5)}a(g0,"\u0275\u0275pureFunction5");function y0(n,e,t,r,o,i,s,l){let c=at()+n,u=A(),f=Xt(u,c,t,r,o,i);return Zo(u,c+4,s,l)||f?yn(u,c+6,e(t,r,o,i,s,l)):us(u,c+6)}a(y0,"\u0275\u0275pureFunction6");function C0(n,e,t,r,o,i,s,l,c){let u=at()+n,f=A(),p=Xt(f,u,t,r,o,i);return Td(f,u+4,s,l,c)||p?yn(f,u+7,e(t,r,o,i,s,l,c)):us(f,u+7)}a(C0,"\u0275\u0275pureFunction7");function v0(n,e,t,r,o,i,s,l,c,u){let f=at()+n,p=A(),m=Xt(p,f,t,r,o,i);return Xt(p,f+4,s,l,c,u)||m?yn(p,f+8,e(t,r,o,i,s,l,c,u)):us(p,f+8)}a(v0,"\u0275\u0275pureFunction8");function S0(n,e,t){return D0(A(),at(),n,e,t)}a(S0,"\u0275\u0275pureFunctionV");function Ml(n,e){let t=n[e];return t===ce?void 0:t}a(Ml,"getPureFunctionReturnValue");function E0(n,e,t,r,o,i){let s=e+t;return Ue(n,s,o)?yn(n,s+1,i?r.call(i,o):r(o)):Ml(n,s+1)}a(E0,"pureFunction1Internal");function I0(n,e,t,r,o,i,s){let l=e+t;return Zo(n,l,o,i)?yn(n,l+2,s?r.call(s,o,i):r(o,i)):Ml(n,l+2)}a(I0,"pureFunction2Internal");function _0(n,e,t,r,o,i,s,l){let c=e+t;return Td(n,c,o,i,s)?yn(n,c+3,l?r.call(l,o,i,s):r(o,i,s)):Ml(n,c+3)}a(_0,"pureFunction3Internal");function T0(n,e,t,r,o,i,s,l,c){let u=e+t;return Xt(n,u,o,i,s,l)?yn(n,u+4,c?r.call(c,o,i,s,l):r(o,i,s,l)):Ml(n,u+4)}a(T0,"pureFunction4Internal");function D0(n,e,t,r,o,i){let s=e+t,l=!1;for(let c=0;c<o.length;c++)Ue(n,s++,o[c])&&(l=!0);return l?yn(n,s,r.apply(i,o)):Ml(n,s)}a(D0,"pureFunctionVInternal");function w0(n,e){let t=J(),r,o=n+K;t.firstCreatePass?(r=OG(e,t.pipeRegistry),t.data[o]=r,r.onDestroy&&(t.destroyHooks??=[]).push(o,r.onDestroy)):r=t.data[o];let i=r.factory||(r.factory=kr(r.type,!0)),s,l=vt($e);try{let c=Du(!1),u=i();return Du(c),wa(t,A(),o,u),u}finally{vt(l)}}a(w0,"\u0275\u0275pipe");function OG(n,e){if(e)for(let t=e.length-1;t>=0;t--){let r=e[t];if(n===r.name)return r}}a(OG,"getPipeDef");function A0(n,e,t){let r=n+K,o=A(),i=Hr(o,r);return bl(o,r)?E0(o,at(),e,i.transform,t,i):i.transform(t)}a(A0,"\u0275\u0275pipeBind1");function R0(n,e,t,r){let o=n+K,i=A(),s=Hr(i,o);return bl(i,o)?I0(i,at(),e,s.transform,t,r,s):s.transform(t,r)}a(R0,"\u0275\u0275pipeBind2");function M0(n,e,t,r,o){let i=n+K,s=A(),l=Hr(s,i);return bl(s,i)?_0(s,at(),e,l.transform,t,r,o,l):l.transform(t,r,o)}a(M0,"\u0275\u0275pipeBind3");function b0(n,e,t,r,o,i){let s=n+K,l=A(),c=Hr(l,s);return bl(l,s)?T0(l,at(),e,c.transform,t,r,o,i,c):c.transform(t,r,o,i)}a(b0,"\u0275\u0275pipeBind4");function N0(n,e,t){let r=n+K,o=A(),i=Hr(o,r);return bl(o,r)?D0(o,at(),e,i.transform,t,i):i.transform.apply(i,t)}a(N0,"\u0275\u0275pipeBindV");function bl(n,e){return n[P].data[e].pure}a(bl,"isPure");function P0(n,e){return vd(n,e)}a(P0,"\u0275\u0275templateRefExtractor");function x0(n,e){return()=>{try{return Xi.getComponentDependencies(n,e).dependencies}catch(t){throw console.error(`Computing dependencies in local compilation mode for the component "${n.name}" failed with the exception:`,t),t}}}a(x0,"\u0275\u0275getComponentDepsFactory");function wC(n,e){let t=Oe(n);t!==null&&(t.debugInfo=e)}a(wC,"\u0275setClassDebugInfo");function k0(n,e,t){let r=`./@ng/component?c=${n}&t=${encodeURIComponent(e)}`;return new URL(r,t).href}a(k0,"\u0275\u0275getReplaceMetadataURL");function L0(n,e,t,r,o=null,i=null){let s=Oe(n);e.apply(null,[n,t,...r]);let{newDef:l,oldDef:c}=UG(s,Oe(n));if(n[Zn]=l,c.tView){let u=lU().values();for(let f of u)Gr(f)&&f[Ge]===null&&vu(o,i,l,c,f)}}a(L0,"\u0275\u0275replaceMetadata");function UG(n,e){let t={...n};return{newDef:Object.assign(n,e,{directiveDefs:t.directiveDefs,pipeDefs:t.pipeDefs,setInput:t.setInput,type:t.type}),oldDef:t}}a(UG,"mergeWithExistingDefinition");function vu(n,e,t,r,o){let i=o[P];if(i===r.tView){$G(n,e,t,r,o);return}for(let s=K;s<i.bindingStartIndex;s++){let l=o[s];if(Rt(l)){Et(l[nt])&&vu(n,e,t,r,l[nt]);for(let c=Ne;c<l.length;c++)vu(n,e,t,r,l[c])}else Et(l)&&vu(n,e,t,r,l)}}a(vu,"recreateMatchingLViews");function VG(n,e){n.componentReplaced?.(e.id)}a(VG,"clearRendererCache");function $G(n,e,t,r,o){let i=o[be],s=o[nt],l=o[Ge],c=o[ot],u=o[re].get(Se,null),f=a(()=>{if(r.encapsulation===gn.ShadowDom||r.encapsulation===gn.ExperimentalIsolatedShadowDom){let y=s.cloneNode(!1);s.replaceWith(y),s=y}let p=xw(t),m=id(l,p,i,ly(t),s,c,null,null,null,null,null);BG(l,o,m,c.index),vl(o[P],o),rl(o);let g=o[Jt].rendererFactory;VG(g,r),m[W]=g.createRenderer(s,t),qw(o[P],o),GG(c),yd(p,m,i),cA(p,m,p.template,i)},"recreate");u===null?fD(n,e,f):u.run(()=>fD(n,e,f))}a($G,"recreateLView");function fD(n,e,t){try{t()}catch(r){let o=r;if(e!==null&&o.message){let i=o.message+(o.stack?`
|
|
4
4
|
`+o.stack:"");n?.hot?.send?.("angular:invalidate",{id:e,message:i,error:!0})}throw r}}a(fD,"executeWithInvalidateFallback");function BG(n,e,t,r){for(let o=K;o<n[P].bindingStartIndex;o++){let i=n[o];if((Et(i)||Rt(i))&&i[rt]===e){i[rt]=t;break}}n[Vr]===e&&(n[Vr]=t),n[Ta]===e&&(n[Ta]=t),t[rt]=e[rt],e[rt]=null,n[r]=t}a(BG,"replaceLViewInTree");function GG(n){if(n.projection!==null){for(let e of n.projection)RD(e)&&(e.projectionNext=null,e.flags&=-3);n.projection=null}}a(GG,"resetProjectionState");var nr={\u0275\u0275animateEnter:Ba,\u0275\u0275animateEnterListener:Ga,\u0275\u0275animateLeave:Ha,\u0275\u0275animateLeaveListener:zu,\u0275\u0275attribute:jy,\u0275\u0275defineComponent:Dd,\u0275\u0275defineDirective:Bn,\u0275\u0275defineInjectable:$,\u0275\u0275defineInjector:Qn,\u0275\u0275defineNgModule:si,\u0275\u0275definePipe:ai,\u0275\u0275directiveInject:$e,\u0275\u0275getInheritedFactory:dl,\u0275\u0275inject:le,\u0275\u0275injectAttribute:Zu,\u0275\u0275invalidFactory:wA,\u0275\u0275invalidFactoryDep:Uc,\u0275\u0275templateRefExtractor:P0,\u0275\u0275resetView:Zp,\u0275\u0275HostDirectivesFeature:rR,\u0275\u0275NgOnChangesFeature:rs,\u0275\u0275ControlFeature:nR,\u0275\u0275ProvidersFeature:l0,\u0275\u0275InheritDefinitionFeature:El,\u0275\u0275ExternalStylesFeature:c0,\u0275\u0275nextContext:yM,\u0275\u0275namespaceHTML:dm,\u0275\u0275namespaceMathML:um,\u0275\u0275namespaceSVG:cm,\u0275\u0275enableBindings:jp,\u0275\u0275disableBindings:Yp,\u0275\u0275elementStart:ir,\u0275\u0275elementEnd:Xr,\u0275\u0275element:hs,\u0275\u0275elementContainerStart:Od,\u0275\u0275elementContainerEnd:Dl,\u0275\u0275domElement:Xy,\u0275\u0275domElementStart:Ld,\u0275\u0275domElementEnd:Fd,\u0275\u0275domElementContainer:eC,\u0275\u0275domElementContainerStart:Ud,\u0275\u0275domElementContainerEnd:Zy,\u0275\u0275domTemplate:$y,\u0275\u0275domListener:lC,\u0275\u0275elementContainer:Qy,\u0275\u0275pureFunction0:d0,\u0275\u0275pureFunction1:f0,\u0275\u0275pureFunction2:h0,\u0275\u0275pureFunction3:p0,\u0275\u0275pureFunction4:m0,\u0275\u0275pureFunction5:g0,\u0275\u0275pureFunction6:y0,\u0275\u0275pureFunction7:C0,\u0275\u0275pureFunction8:v0,\u0275\u0275pureFunctionV:S0,\u0275\u0275getCurrentView:eM,\u0275\u0275restoreView:Qp,\u0275\u0275listener:sC,\u0275\u0275projection:vM,\u0275\u0275syntheticHostProperty:nC,\u0275\u0275syntheticHostListener:aC,\u0275\u0275pipeBind1:A0,\u0275\u0275pipeBind2:R0,\u0275\u0275pipeBind3:M0,\u0275\u0275pipeBind4:b0,\u0275\u0275pipeBindV:N0,\u0275\u0275projectionDef:CM,\u0275\u0275domProperty:tC,\u0275\u0275ariaProperty:Jy,\u0275\u0275property:Yy,\u0275\u0275control:xA,\u0275\u0275controlCreate:PA,\u0275\u0275pipe:w0,\u0275\u0275queryRefresh:$d,\u0275\u0275queryAdvance:SM,\u0275\u0275viewQuery:Al,\u0275\u0275viewQuerySignal:fC,\u0275\u0275loadQuery:Bd,\u0275\u0275contentQuery:uC,\u0275\u0275contentQuerySignal:dC,\u0275\u0275reference:EM,\u0275\u0275classMap:AM,\u0275\u0275styleMap:wM,\u0275\u0275styleProp:Gd,\u0275\u0275classProp:Rl,\u0275\u0275advance:Cl,\u0275\u0275template:Vy,\u0275\u0275conditional:kd,\u0275\u0275conditionalCreate:Pd,\u0275\u0275conditionalBranchCreate:xd,\u0275\u0275defer:TR,\u0275\u0275deferWhen:DR,\u0275\u0275deferOnIdle:MR,\u0275\u0275deferOnImmediate:PR,\u0275\u0275deferOnTimer:LR,\u0275\u0275deferOnHover:UR,\u0275\u0275deferOnInteraction:BR,\u0275\u0275deferOnViewport:qR,\u0275\u0275deferPrefetchWhen:wR,\u0275\u0275deferPrefetchOnIdle:bR,\u0275\u0275deferPrefetchOnImmediate:xR,\u0275\u0275deferPrefetchOnTimer:FR,\u0275\u0275deferPrefetchOnHover:VR,\u0275\u0275deferPrefetchOnInteraction:GR,\u0275\u0275deferPrefetchOnViewport:zR,\u0275\u0275deferHydrateWhen:AR,\u0275\u0275deferHydrateNever:RR,\u0275\u0275deferHydrateOnIdle:NR,\u0275\u0275deferHydrateOnImmediate:kR,\u0275\u0275deferHydrateOnTimer:OR,\u0275\u0275deferHydrateOnHover:$R,\u0275\u0275deferHydrateOnInteraction:HR,\u0275\u0275deferHydrateOnViewport:WR,\u0275\u0275deferEnableTimerScheduling:hR,\u0275\u0275repeater:XR,\u0275\u0275repeaterCreate:YR,\u0275\u0275repeaterTrackByIndex:JR,\u0275\u0275repeaterTrackByIdentity:jR,\u0275\u0275componentInstance:KR,\u0275\u0275text:Hd,\u0275\u0275textInterpolate:hC,\u0275\u0275textInterpolate1:qd,\u0275\u0275textInterpolate2:pC,\u0275\u0275textInterpolate3:mC,\u0275\u0275textInterpolate4:gC,\u0275\u0275textInterpolate5:yC,\u0275\u0275textInterpolate6:CC,\u0275\u0275textInterpolate7:vC,\u0275\u0275textInterpolate8:SC,\u0275\u0275textInterpolateV:EC,\u0275\u0275i18n:hM,\u0275\u0275i18nAttributes:pM,\u0275\u0275i18nExp:iC,\u0275\u0275i18nStart:rC,\u0275\u0275i18nEnd:oC,\u0275\u0275i18nApply:mM,\u0275\u0275i18nPostprocess:gM,\u0275\u0275resolveWindow:Rw,\u0275\u0275resolveDocument:Mw,\u0275\u0275resolveBody:bw,\u0275\u0275setComponentScope:u0,\u0275\u0275setNgModuleScope:DC,\u0275\u0275registerNgModuleType:Fy,\u0275\u0275getComponentDepsFactory:x0,\u0275setClassDebugInfo:wC,\u0275\u0275declareLet:TC,\u0275\u0275storeLet:WM,\u0275\u0275arrowFunction:i0,\u0275\u0275readContextLet:KM,\u0275\u0275attachSourceLocations:JM,\u0275\u0275interpolate:jM,\u0275\u0275interpolate1:YM,\u0275\u0275interpolate2:XM,\u0275\u0275interpolate3:QM,\u0275\u0275interpolate4:ZM,\u0275\u0275interpolate5:e0,\u0275\u0275interpolate6:t0,\u0275\u0275interpolate7:n0,\u0275\u0275interpolate8:r0,\u0275\u0275interpolateV:o0,\u0275\u0275sanitizeHtml:ty,\u0275\u0275sanitizeStyle:ny,\u0275\u0275sanitizeResourceUrl:od,\u0275\u0275sanitizeScript:oy,\u0275\u0275validateAttribute:iy,\u0275\u0275sanitizeUrl:ry,\u0275\u0275sanitizeUrlOrResourceUrl:Dw,\u0275\u0275trustConstantHtml:_w,\u0275\u0275trustConstantResourceUrl:Tw,forwardRef:ya,resolveForwardRef:ne,\u0275\u0275twoWayProperty:IC,\u0275\u0275twoWayBindingSet:qM,\u0275\u0275twoWayListener:_C,\u0275\u0275replaceMetadata:L0,\u0275\u0275getReplaceMetadataURL:k0},Oa=null;function F0(n){Oa!==null&&(n.defaultEncapsulation!==Oa.defaultEncapsulation||n.preserveWhitespaces!==Oa.preserveWhitespaces)||(Oa=n)}a(F0,"setJitOptions");function HG(){return Oa}a(HG,"getJitOptions");var Su=[];function qG(n,e){Su.push({moduleType:n,ngModule:e})}a(qG,"enqueueModuleForDelayedScoping");var Lm=!1;function O0(){if(!Lm){Lm=!0;try{for(let n=Su.length-1;n>=0;n--){let{moduleType:e,ngModule:t}=Su[n];t.declarations&&t.declarations.every(U0)&&(Su.splice(n,1),zG(e,t))}}finally{Lm=!1}}}a(O0,"flushModuleScopingQueueAsMuchAsPossible");function U0(n){return Array.isArray(n)?n.every(U0):!!ne(n)}a(U0,"isResolvedDeclaration");function V0(n,e={}){$0(n,e),e.id!==void 0&&Fy(n,e.id),qG(n,e)}a(V0,"compileNgModule");function $0(n,e,t=!1){let r=fn(e.declarations||se),o=null;Object.defineProperty(n,kc,{configurable:!0,get:a(()=>(o===null&&(o=Bt({usage:0,kind:"NgModule",type:n}).compileNgModule(nr,`ng:///${n.name}/\u0275mod.js`,{type:n,bootstrap:fn(e.bootstrap||se).map(ne),declarations:r.map(ne),imports:fn(e.imports||se).map(ne).map(hD),exports:fn(e.exports||se).map(ne).map(hD),schemas:e.schemas?fn(e.schemas):null,id:e.id||null}),o.schemas||(o.schemas=[])),o),"get")});let i=null;Object.defineProperty(n,An,{get:a(()=>{if(i===null){let l=Bt({usage:0,kind:"NgModule",type:n});i=l.compileFactory(nr,`ng:///${n.name}/\u0275fac.js`,{name:n.name,type:n,deps:ed(n),target:l.FactoryTarget.NgModule,typeArgumentCount:0})}return i},"get"),configurable:!1});let s=null;Object.defineProperty(n,da,{get:a(()=>{if(s===null){let l={name:n.name,type:n,providers:e.providers||se,imports:[(e.imports||se).map(ne),(e.exports||se).map(ne)]};s=Bt({usage:0,kind:"NgModule",type:n}).compileInjector(nr,`ng:///${n.name}/\u0275inj.js`,l)}return s},"get"),configurable:!1})}a($0,"compileNgModuleDefs");function zG(n,e){let t=fn(e.declarations||se),r=RC(n);t.forEach(o=>{if(o=ne(o),o.hasOwnProperty(Zn)){let s=Oe(o);AC(s,r)}else!o.hasOwnProperty(bo)&&!o.hasOwnProperty(va)&&(o.ngSelectorScope=n)})}a(zG,"setScopeOnDeclaredComponents");function AC(n,e){n.directiveDefs=()=>Array.from(e.compilation.directives).map(t=>t.hasOwnProperty(Zn)?Oe(t):Ut(t)).filter(t=>!!t),n.pipeDefs=()=>Array.from(e.compilation.pipes).map(t=>dn(t)),n.schemas=e.schemas,n.tView=null}a(AC,"patchComponentDefWithScope");function RC(n){if(Bo(n)){let e=Xi.getNgModuleScope(n);return{schemas:Lc(n).schemas||null,...e}}else if(Sa(n)){if((Oe(n)||Ut(n))!==null)return{schemas:null,compilation:{directives:new Set,pipes:new Set},exported:{directives:new Set([n]),pipes:new Set}};if(dn(n)!==null)return{schemas:null,compilation:{directives:new Set,pipes:new Set},exported:{directives:new Set,pipes:new Set([n])}}}throw new Error(`${n.name} does not have a module def (\u0275mod property)`)}a(RC,"transitiveScopesFor");function hD(n){return wy(n)?n.ngModule:n}a(hD,"expandModuleWithProviders");var Fm=0;function B0(n,e){let t=null;wB(n,e),H0(n,e),Object.defineProperty(n,Zn,{get:a(()=>{if(t===null){let r=Bt({usage:0,kind:"component",type:n});if(jA(e)){let f=[`Component '${n.name}' is not resolved:`];throw e.templateUrl&&f.push(` - templateUrl: ${e.templateUrl}`),e.styleUrls&&e.styleUrls.length&&f.push(` - styleUrls: ${JSON.stringify(e.styleUrls)}`),e.styleUrl&&f.push(` - styleUrl: ${e.styleUrl}`),f.push("Did you run and wait for 'resolveComponentResources()'?"),new Error(f.join(`
|
|
@@ -346,10 +346,10 @@ Please ensure the code property contains a string of JavaScript/JSX code.`)}if(e
|
|
|
346
346
|
The code property must contain valid JavaScript/JSX code defining a React component.`);if(!e.componentCode.includes(e.componentName))throw new Error(`Component compilation failed: Component code must define a component named "${e.componentName}".
|
|
347
347
|
The function/component name in the code must match the componentName property.
|
|
348
348
|
Expected to find: function ${e.componentName}(...) or const ${e.componentName} = ...
|
|
349
|
-
Code preview: `+e.componentCode.substring(0,200)+"...")}generateComponentId(e){return`${e}_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}getCachedComponent(e,t){let r=this.createCacheKey(e,t);return this.compilationCache.get(r)}createCacheKey(e,t){let r=0;for(let o=0;o<t.length;o++){let i=t.charCodeAt(o);r=(r<<5)-r+i,r=r&r}return`${e}_${r.toString(36)}`}cacheComponent(e,t){if(this.compilationCache.size>=this.config.maxCacheSize){let o=this.compilationCache.keys().next().value;o&&this.compilationCache.delete(o)}let r=this.createCacheKey(e.name,t);this.compilationCache.set(r,e)}createCompilationError(e,t){return{message:e.message||"Unknown compilation error",stack:e.stack,componentName:t,phase:"compilation",details:e}}ClearCache(){this.compilationCache.clear()}clearCache(){return this.ClearCache()}GetCacheSize(){return this.compilationCache.size}getCacheSize(){return this.GetCacheSize()}UpdateConfig(e){this.config={...this.config,...e}}updateConfig(e){return this.UpdateConfig(e)}};var Ah=["react"],Rh=[],sF={presets:Ah,plugins:[...Rh],minified:!0,comments:!1},aF={presets:Ah,plugins:[...Rh],sourceMaps:"inline",minified:!1,comments:!0};var XY={maxComponents:1e3,cleanupInterval:6e4,useLRU:!0,enableNamespaces:!0},Ks=class{static{a(this,"ComponentRegistry")}get registryId(){return this.RegistryId}constructor(e){this.config={...XY,...e},this.registry=new Map,this.RegistryId=`component-registry-${Date.now()}`,this.config.cleanupInterval>0&&this.startCleanupTimer()}Register(e,t,r="Global",o="v1",i,s){let l=this.generateRegistryKey(e,r,o,i),c={id:l,name:e,version:o,namespace:r,registeredAt:new Date,tags:s},u={component:t,metadata:c,lastAccessed:new Date,refCount:0};return this.registry.size>=this.config.maxComponents&&this.config.useLRU&&this.evictLRU(),this.registry.set(l,u),c}register(e,t,r="Global",o="v1",i,s){return this.Register(e,t,r,o,i,s)}Get(e,t="Global",r,o){let i=this.resolveLookupKey(e,t,r,o);if(!i)return;let s=this.registry.get(i);if(s)return s.lastAccessed=new Date,s.refCount++,s.component}get(e,t="Global",r,o){return this.Get(e,t,r,o)}Has(e,t="Global",r,o){let i=this.resolveLookupKey(e,t,r,o);return i?this.registry.has(i):!1}has(e,t="Global",r,o){return this.Has(e,t,r,o)}Unregister(e,t="Global",r,o){let i=this.resolveLookupKey(e,t,r,o);return i?this.registry.delete(i):!1}unregister(e,t="Global",r,o){return this.Unregister(e,t,r,o)}GetNamespace(e){let t=[];for(let r of this.registry.values())r.metadata.namespace===e&&t.push(r.metadata);return t}getNamespace(e){return this.GetNamespace(e)}GetAll(e="Global",t="v1"){let r={};for(let o of this.registry.values())o.metadata.namespace===e&&o.metadata.version===t&&(r[o.metadata.name]=o.component);return r}getAll(e="Global",t="v1"){return this.GetAll(e,t)}GetNamespaces(){let e=new Set;for(let t of this.registry.values())e.add(t.metadata.namespace);return Array.from(e)}getNamespaces(){return this.GetNamespaces()}GetByTags(e){let t=[];for(let r of this.registry.values())r.metadata.tags?.some(o=>e.includes(o))&&t.push(r.metadata);return t}getByTags(e){return this.GetByTags(e)}Release(e,t="Global",r,o){let i=this.resolveLookupKey(e,t,r,o);if(!i)return;let s=this.registry.get(i);s&&s.refCount>0&&s.refCount--}release(e,t="Global",r,o){return this.Release(e,t,r,o)}Clear(){this.registry.clear()}clear(){return this.Clear()}ClearNamespace(e="Global"){let t=[];for(let[r,o]of this.registry)o.metadata.namespace===e&&t.push(r);for(let r of t)this.registry.delete(r);return t.length}clearNamespace(e="Global"){return this.ClearNamespace(e)}ForceClear(){this.stopCleanupTimer(),this.registry.clear(),console.log("\u{1F9F9} Registry force cleared - all components removed")}forceClear(){return this.ForceClear()}Size(){return this.registry.size}size(){return this.Size()}Cleanup(e=!1){let t=[],r=Date.now();for(let[o,i]of this.registry){let s=r-i.lastAccessed.getTime(),l=i.refCount===0&&s>this.config.cleanupInterval;(e||l)&&t.push(o)}for(let o of t)this.registry.delete(o);return t.length}cleanup(e=!1){return this.Cleanup(e)}GetStats(){let e=0,t,r;for(let o of this.registry.values())e+=o.refCount,(!t||o.metadata.registeredAt<t)&&(t=o.metadata.registeredAt),(!r||o.metadata.registeredAt>r)&&(r=o.metadata.registeredAt);return{totalComponents:this.registry.size,namespaces:this.GetNamespaces().length,totalRefCount:e,oldestComponent:t,newestComponent:r}}getStats(){return this.GetStats()}Destroy(){this.stopCleanupTimer(),this.Clear(),Xe.cleanupComponent(this.RegistryId)}destroy(){return this.Destroy()}generateRegistryKey(e,t,r,o){let i=this.config.enableNamespaces?`${t}::${e}@${r}`:`${e}@${r}`;return o?`${i}#${o}`:i}resolveLookupKey(e,t,r,o){return r&&o?this.generateRegistryKey(e,t,r,o):r?this.findLatestForVersion(e,t,r):this.findLatestVersion(e,t)}findLatestForVersion(e,t,r){let o,i;for(let[s,l]of this.registry)l.metadata.name===e&&l.metadata.namespace===t&&l.metadata.version===r&&(!i||l.metadata.registeredAt>i)&&(i=l.metadata.registeredAt,o=s);return o}findLatestVersion(e,t){let r,o;for(let[i,s]of this.registry)s.metadata.name===e&&s.metadata.namespace===t&&(!o||s.metadata.registeredAt>o)&&(o=s.metadata.registeredAt,r=i);return r}evictLRU(){let e,t;for(let[r,o]of this.registry)o.refCount>0||(!t||o.lastAccessed<t)&&(t=o.lastAccessed,e=r);e&&this.registry.delete(e)}startCleanupTimer(){this.cleanupTimer=Xe.setInterval(this.RegistryId,()=>{this.Cleanup()},this.config.cleanupInterval,{purpose:"component-registry-cleanup"})}stopCleanupTimer(){this.cleanupTimer&&(Xe.clearInterval(this.RegistryId,this.cleanupTimer),this.cleanupTimer=void 0)}};var Mh,mo=class n{static{a(this,"ComponentRegistryService")}static{this._globalStoreKey="___SINGLETON__ComponentRegistryService"}get Provider(){return this._provider??new Be}set Provider(e){this._provider=e}constructor(e,t,r=!1,o){this.compiledComponentCache=new Map,this.componentReferences=new Map,this.componentEngine=Tn.Instance,this.registryProviders=new Map,this.debug=!1,this._provider=null,this.cachedProviderClient=null,this.compiler=e,this.runtimeContext=t,this.debug=r,this.graphQLClient=o}static get Instance(){let e=So();return e?e[n._globalStoreKey]:void 0}static GetInstance(e,t,r=!1,o){let i=So();return i?(i[n._globalStoreKey]||(i[n._globalStoreKey]=new n(e,t,r,o)),i[n._globalStoreKey]):new n(e,t,r,o)}static getInstance(e,t,r=!1,o){return this.GetInstance(e,t,r,o)}SetGraphQLClient(e){this.graphQLClient=e,this.debug&&console.log("\u2705 GraphQL client configured for component registry")}setGraphQLClient(e){return this.SetGraphQLClient(e)}async getGraphQLClient(){if(this.graphQLClient)return this.graphQLClient;if(this.cachedProviderClient)return this.cachedProviderClient;try{let e=Be?.Provider;if(e&&e.ExecuteGQL!==void 0){if(!Mh)try{Mh=(await import("./dist-4BLL2YRV.js")).GraphQLComponentRegistryClient}catch{return this.debug&&console.log("\u26A0\uFE0F [ComponentRegistryService] @memberjunction/graphql-dataprovider not available"),null}if(Mh)try{let t=new Mh(e);return this.cachedProviderClient=t,this.debug&&console.log("\u{1F4E1} [ComponentRegistryService] Created GraphQL client from active metadata provider"),t}catch(t){this.debug&&console.log("\u26A0\uFE0F [ComponentRegistryService] Failed to create GraphQL client:",t)}}}catch(e){this.debug&&console.log("\u26A0\uFE0F [ComponentRegistryService] Could not access metadata provider:",e)}return null}async Initialize(e){await this.componentEngine.Config(!1,e)}async initialize(e){return this.Initialize(e)}async calculateSpecHash(e){if(typeof crypto>"u"||!crypto.subtle)throw new Error("Web Crypto API not available. This typically happens when running in an insecure context. Please use HTTPS or localhost for development. Note: crypto.subtle is available in Node.js 15+ and all modern browsers on secure contexts.");let t=JSON.stringify(e),o=new TextEncoder().encode(t),i=await crypto.subtle.digest("SHA-256",o);return Array.from(new Uint8Array(i)).map(c=>c.toString(16).padStart(2,"0")).join("")}async GetCompiledComponent(e,t,r){await this.Initialize(r);let o=await this.componentEngine.FindComponentByID(e,r);if(!o)throw new Error(`Component not found: ${e}`);let i=this.getComponentKey(o.Name,o.Namespace,o.Version,o.SourceRegistryID);if(this.compiledComponentCache.has(i)){let p=this.compiledComponentCache.get(i);return p.lastUsed=new Date,p.useCount++,t&&this.addComponentReference(i,t),this.debug&&console.log(`\u2705 Reusing compiled component from cache: ${i} (use count: ${p.useCount})`),p.component(this.runtimeContext)}this.debug&&console.log(`\u{1F504} Loading and compiling component: ${i}`);let s=await this.GetComponentSpec(e,r),l=this.componentEngine.ComponentLibraries||[],c;try{c=await this.compiler.compile({componentName:o.Name,componentCode:s.code,libraries:s.libraries,allLibraries:l})}catch(p){throw console.error(`\u{1F534} Error compiling component ${o.Name}`,p),p}if(!c.success)throw console.error(`\u{1F534} Error compiling component ${o.Name}`,c,"Code",s.code),new Error(`Failed to compile component ${o.Name}: ${c.error}`);let u={name:o.Name,namespace:o.Namespace||"",version:o.Version,description:o.Description||"",title:o.Title||void 0,type:o.Type||void 0,status:o.Status||void 0,properties:s.properties,events:s.events,libraries:s.libraries,dependencies:s.dependencies,sourceRegistryID:o.SourceRegistryID,isLocal:!o.SourceRegistryID};if(!c.component)throw new Error("Component compilation succeeded but no component returned");let f=c.component.factory;return this.compiledComponentCache.set(i,{component:f,metadata:u,compiledAt:new Date,lastUsed:new Date,useCount:1}),t&&this.addComponentReference(i,t),f(this.runtimeContext)}async getCompiledComponent(e,t,r){return this.GetCompiledComponent(e,t,r)}async GetCompiledComponentFromRegistry(e,t,r,o,i,s){await this.Initialize(s),this.debug&&console.log(`\u{1F310} [ComponentRegistryService] Fetching from external registry: ${e}/${t}/${r}@${o}`);let l=this.componentEngine.ComponentRegistries?.find(p=>p.Name===e&&p.Status==="Active");if(!l)throw new Error(`Registry not found or inactive: ${e}`);this.debug&&console.log(`\u2705 [ComponentRegistryService] Found registry: ${l.Name} (ID: ${l.ID})`);let c=await this.getGraphQLClient();if(!c)throw new Error("GraphQL client not available for external registry fetching. No client provided and the active metadata provider is not a GraphQLDataProvider.");let u=`external:${e}:${t}:${r}:${o}`,f=this.compiledComponentCache.get(u);try{let p=await c.GetRegistryComponent({registryName:l.Name,namespace:t,name:r,version:o,hash:f?.specHash});if(!p&&f?.specHash)return this.debug&&console.log(`\u267B\uFE0F [ComponentRegistryService] Component not modified, using cached: ${u}`),f.lastUsed=new Date,f.useCount++,i&&this.addComponentReference(u,i),f.component(this.runtimeContext);if(!p)throw new Error(`Component not found in registry ${e}: ${t}/${r}@${o}`);this.debug&&console.log(`\u2705 [ComponentRegistryService] Fetched spec from external registry: ${p.name}`);let m=await this.calculateSpecHash(p);if(f&&f.specHash===m)return this.debug&&console.log(`\u267B\uFE0F [ComponentRegistryService] Using cached compilation for: ${u} (hash match)`),f.lastUsed=new Date,f.useCount++,i&&this.addComponentReference(u,i),f.component(this.runtimeContext);f&&this.debug&&console.log(`\u{1F504} [ComponentRegistryService] Spec changed for: ${u}, recompiling (old hash: ${f.specHash?.substring(0,8)}..., new hash: ${m.substring(0,8)}...)`);let g=this.componentEngine.ComponentLibraries||[],y=await this.compiler.compile({componentName:p.name,componentCode:p.code||"",allLibraries:g});if(!y.success||!y.component)throw new Error(`Failed to compile component: ${y.error?.message||"Unknown error"}`);return this.compiledComponentCache.set(u,{component:y.component.factory,metadata:{name:p.name,namespace:p.namespace||"",version:p.version||"1.0.0",description:p.description||"",type:p.type,isLocal:!1},compiledAt:new Date,lastUsed:new Date,useCount:1,specHash:m}),i&&this.addComponentReference(u,i),this.debug&&console.log(`\u{1F3AF} [ComponentRegistryService] Successfully compiled external component: ${p.name}`),y.component.factory(this.runtimeContext)}catch(p){throw console.error("\u274C [ComponentRegistryService] Failed to fetch from external registry:",p),p}}async getCompiledComponentFromRegistry(e,t,r,o,i,s){return this.GetCompiledComponentFromRegistry(e,t,r,o,i,s)}async GetComponentSpec(e,t){await this.Initialize(t);let r=await this.componentEngine.FindComponentByID(e,t);if(!r)throw new Error(`Component not found: ${e}`);if(!r.SourceRegistryID){if(!r.Specification)throw new Error(`Local component ${r.Name} has no specification`);return JSON.parse(r.Specification)}if(r.Specification&&r.LastSyncedAt)return this.debug&&console.log(`Using cached external component: ${r.Name} (synced: ${r.LastSyncedAt})`),JSON.parse(r.Specification);let o=this.componentEngine.ComponentRegistries?.find(s=>N(s.ID,r.SourceRegistryID));if(!o)throw new Error(`Registry not found: ${r.SourceRegistryID}`);let i;if(this.graphQLClient){this.debug&&console.log(`Fetching from registry via GraphQL: ${r.Name}`);let s=await this.graphQLClient.GetRegistryComponent({registryName:o.Name,namespace:r.Namespace||"",name:r.Name,version:r.Version});if(!s)throw new Error(`Component not found in registry: ${r.Name}`);i=s}else i=await this.fetchFromExternalRegistry(o.URI||"",r.Name,r.Namespace||"",r.Version,this.getRegistryApiKey(o.ID));return await this.cacheExternalComponent(e,i,t),i}async getComponentSpec(e,t){return this.GetComponentSpec(e,t)}async fetchFromExternalRegistry(e,t,r,o,i){let s=`${e}/components/${encodeURIComponent(r)}/${encodeURIComponent(t)}/${o}`,l={Accept:"application/json"};i&&(l.Authorization=`Bearer ${i}`),this.debug&&console.log(`Fetching from external registry: ${s}`);let c=await fetch(s,{headers:l});if(!c.ok)throw await c.body?.cancel().catch(()=>{}),new Error(`Registry fetch failed: ${c.status} ${c.statusText}`);return await c.json()}async cacheExternalComponent(e,t,r){let i=await this.Provider.GetEntityObject("MJ: Components",r);if(!await i.Load(e))throw new Error(`Failed to load component entity: ${e}`);if(i.Specification=JSON.stringify(t),i.LastSyncedAt=new Date,i.ReplicatedAt||(i.ReplicatedAt=new Date),t.name&&(i.Name=t.name),t.namespace&&(i.Namespace=t.namespace),t.version&&(i.Version=t.version),t.title&&(i.Title=t.title),t.description&&(i.Description=t.description),t.type){let c={report:"Report",dashboard:"Dashboard",form:"Form",table:"Table",chart:"Chart",navigation:"Navigation",search:"Search",widget:"Widget",utility:"Utility",other:"Other"}[t.type.toLowerCase()];c&&(i.Type=c)}if(t.functionalRequirements&&(i.FunctionalRequirements=t.functionalRequirements),t.technicalDesign&&(i.TechnicalDesign=t.technicalDesign),!await i.Save())throw new Error(`Failed to save cached component: ${i.Name}
|
|
350
|
-
${i.LatestResult?.CompleteMessage||"Unknown error"}`);this.debug&&console.log(`Cached external component: ${i.Name} at ${i.LastSyncedAt}`),await this.componentEngine.Config(!0,r)}async LoadDependencies(e,t){await this.Initialize(t);let r=this.componentEngine.ComponentDependencies?.filter(i=>N(i.ComponentID,e))||[],o=[];for(let i of r){let s=await this.componentEngine.FindComponentByID(i.DependencyComponentID,t);s&&o.push({name:s.Name,namespace:s.Namespace||"",version:s.Version,isRequired:!0,location:s.SourceRegistryID?"registry":"embedded",sourceRegistryID:s.SourceRegistryID})}return o}async loadDependencies(e,t){return this.LoadDependencies(e,t)}async ResolveDependencyTree(e,t,r=new Set){if(r.has(e))return{componentId:e,circular:!0};r.add(e),await this.Initialize(t);let o=await this.componentEngine.FindComponentByID(e,t);if(!o)return{componentId:e,dependencies:[]};let i=await this.LoadDependencies(e,t),s=[];for(let l of i){let c=await this.componentEngine.FindComponent(l.name,l.namespace,void 0,t);if(c){let u=await this.ResolveDependencyTree(c.ID,t,r);s.push(u)}}return{componentId:e,name:o.Name,namespace:o.Namespace||void 0,version:o.Version,dependencies:s,totalCount:s.reduce((l,c)=>l+(c.totalCount||1),1)}}async resolveDependencyTree(e,t,r=new Set){return this.ResolveDependencyTree(e,t,r)}async GetComponentsToLoad(e,t){let r=await this.ResolveDependencyTree(e,t),o=[],i=a(s=>{s.dependencies&&s.dependencies.forEach(i),o.includes(s.componentId)||o.push(s.componentId)},"processNode");return i(r),o}async getComponentsToLoad(e,t){return this.GetComponentsToLoad(e,t)}addComponentReference(e,t){this.componentReferences.has(e)||this.componentReferences.set(e,new Set),this.componentReferences.get(e).add(t)}RemoveComponentReference(e,t){let r=this.componentReferences.get(e);r&&(r.delete(t),r.size===0&&this.considerCacheEviction(e))}removeComponentReference(e,t){return this.RemoveComponentReference(e,t)}considerCacheEviction(e){let t=this.compiledComponentCache.get(e);if(t){let r=Date.now()-t.lastUsed.getTime(),o=300*1e3;r>o&&(this.debug&&console.log(`\u{1F5D1}\uFE0F Evicting unused component from cache: ${e}`),this.compiledComponentCache.delete(e))}}getRegistryApiKey(e){let t=`REGISTRY_API_KEY_${e.replace(/-/g,"_").toUpperCase()}`;return process.env[t]}GetCacheStats(){let e=0;return this.compiledComponentCache.forEach(t=>{e+=t.useCount}),{compiledComponents:this.compiledComponentCache.size,totalUseCount:e,memoryEstimate:`~${this.compiledComponentCache.size*50}KB`}}getCacheStats(){return this.GetCacheStats()}ClearCache(){this.debug&&console.log("\u{1F9F9} Clearing all component caches"),this.compiledComponentCache.clear(),this.componentReferences.clear()}clearCache(){return this.ClearCache()}ForceClearAll(){this.compiledComponentCache.clear(),this.componentReferences.clear(),console.log("\u{1F9F9} Component cache force cleared")}forceClearAll(){return this.ForceClearAll()}static Reset(){let e=So(),t=e?e[n._globalStoreKey]:void 0;t&&(t.forceClearAll(),e&&delete e[n._globalStoreKey])}static reset(){return this.Reset()}getComponentKey(e,t,r,o){return`${o||"local"}/${t||"global"}/${e}@${r}`}};var Js=class{static{a(this,"ComponentResolver")}constructor(e,t,r,o=!1){this.registryService=null,this.compiler=null,this.runtimeContext=null,this.componentEngine=Tn.Instance,this.debug=!1,this.registry=e,this.resolverInstanceId=`resolver-${Date.now()}-${Math.random()}`,this.debug=o,t&&r&&(this.compiler=t,this.runtimeContext=r,this.registryService=mo.getInstance(t,r,o))}async ResolveComponents(e,t="Global",r){console.log(`\u{1F680} [ComponentResolver] Starting component resolution for: ${e.name}`),console.log("\u{1F4CB} [ComponentResolver] Root component spec:",{name:e.name,location:e.location,registry:e.registry,namespace:e.namespace,hasCode:!!e.code,hasDependencies:!!(e.dependencies&&e.dependencies.length>0)}),this.debug&&console.log("\u{1F4CB} [ComponentResolver] Dependencies to resolve:",(e.dependencies||[]).map(s=>({name:s.name,location:s.location,namespace:s.namespace})));let o={};this.registryService&&(this.debug&&console.log("\u{1F504} [ComponentResolver] Initializing component engine..."),await this.componentEngine.Config(!1,r),this.debug&&console.log("\u2705 [ComponentResolver] Component engine initialized")),await this.resolveComponentHierarchy(e,o,t,new Set,r),o[e.name]||(console.error(`\u274C [ComponentResolver] Root component '${e.name}' was NOT added to resolved map!`),console.log("\u{1F4E6} [ComponentResolver] What IS in resolved map:",Object.keys(o))),this.debug&&console.log("\u{1F4CA} [ComponentResolver] Resolved components before unwrapping:",Object.keys(o));let i={};for(let[s,l]of Object.entries(o))l&&typeof l=="object"&&"component"in l?typeof l.component=="function"?(i[s]=l.component,this.debug&&console.log(`\u2705 [ComponentResolver] Unwrapped component: ${s} (was object with .component)`)):(console.error(`\u274C [ComponentResolver] Component ${s} has invalid component property:`,typeof l.component,l),i[s]=l):typeof l=="function"?(i[s]=l,this.debug&&console.log(`\u2705 [ComponentResolver] Component already a function: ${s}`)):(console.warn(`\u26A0\uFE0F [ComponentResolver] Component ${s} is not a function or wrapped component:`,typeof l,l),i[s]=l);return this.debug&&console.log("\u{1F3AF} [ComponentResolver] Final resolved components:",Object.keys(i).map(s=>({name:s,type:typeof i[s],isUndefined:i[s]===void 0}))),i}async resolveComponents(e,t="Global",r){return this.ResolveComponents(e,t,r)}async resolveComponentHierarchy(e,t,r,o=new Set,i){let s=`${e.namespace||r}/${e.name}@${e.version||"latest"}`;if(t[e.name]){this.debug&&console.log(`\u23ED\uFE0F [ComponentResolver] Component already resolved: ${e.name}`);return}if(o.has(s)){this.debug&&console.warn(`Circular dependency detected for component: ${s}`);return}o.add(s),this.debug&&console.log(`\u{1F504} [ComponentResolver] Resolving dependencies for ${e.name} BEFORE resolving itself`);let l=e.dependencies||[];for(let c of l)this.debug&&console.log(` \u21B3 [ComponentResolver] Resolving dependency: ${c.name} for parent ${e.name}`),await this.resolveComponentHierarchy(c,t,r,o,i);if(l.length>0&&this.debug&&console.log(`\u2705 [ComponentResolver] All ${l.length} dependencies resolved for ${e.name}, now resolving itself`),e.location==="registry"&&this.registryService){this.debug&&(console.log(`\u{1F50D} [ComponentResolver] Looking for registry component: ${e.name} in namespace: ${e.namespace||r}`),e.registry?console.log(` \u{1F4CD} [ComponentResolver] External registry specified: ${e.registry}`):console.log(" \u{1F4CD} [ComponentResolver] Local registry (no registry field specified)"));try{if(e.registry){this.debug&&console.log(`\u{1F310} [ComponentResolver] Fetching from external registry: ${e.registry}`);let c=await this.registryService.getCompiledComponentFromRegistry(e.registry,e.namespace||r,e.name,e.version||"latest",this.resolverInstanceId,i);c?(t[e.name]=c,this.debug&&console.log(`\u2705 [ComponentResolver] Successfully fetched and compiled from external registry: ${e.name}`)):console.error(`\u274C [ComponentResolver] Failed to fetch from external registry: ${e.name} from ${e.registry}`)}else{this.debug&&console.log(`\u{1F4BE} [ComponentResolver] Looking for locally registered component: ${e.name}`);let c=await this.componentEngine.FindComponent(e.name,e.namespace||r,void 0,i);if(c){this.debug&&console.log("\u2705 [ComponentResolver] Found component in local DB:",{ID:c.ID,Name:c.Name,Namespace:c.Namespace,Version:c.Version});let u=await this.registryService.getCompiledComponent(c.ID,this.resolverInstanceId,i);t[e.name]=u,this.debug&&console.log(`\u{1F4E6} [ComponentResolver] Successfully compiled and resolved local component: ${e.name}, type: ${typeof u}`)}else console.error(`\u274C [ComponentResolver] Local registry component NOT found in database: ${e.name} with namespace: ${e.namespace||r}`)}}catch(c){this.debug&&console.error(`Failed to load registry component ${e.name}:`,c)}}else{let c=e.namespace||r;if(e.code&&this.compiler){this.debug&&console.log(`\u{1F528} [ComponentResolver] Component ${e.name} has inline code, compiling...`);try{let u=await this.compiler.compile({componentName:e.name,componentCode:e.code,libraries:e.libraries,dependencies:e.dependencies,allLibraries:[]});if(u.success&&u.component){if(!this.runtimeContext){console.error("\u274C [ComponentResolver] Cannot compile without runtime context");return}let f=u.component.factory(this.runtimeContext);this.registry.register(e.name,f,c,e.version||"latest"),t[e.name]=f,this.debug&&console.log(`\u2705 [ComponentResolver] Successfully compiled and registered inline component: ${e.name}`)}else console.error(`\u274C [ComponentResolver] Failed to compile inline component ${e.name}:`,u.error)}catch(u){console.error(`\u274C [ComponentResolver] Error compiling inline component ${e.name}:`,u)}}else{this.debug&&console.log(`\u{1F50D} [ComponentResolver] Looking for embedded component: ${e.name} in namespace: ${c}`);let u=this.registry.get(e.name,c);if(u)t[e.name]=u,this.debug&&console.log(`\u2705 [ComponentResolver] Found embedded component: ${e.name}, type: ${typeof u}`),this.debug&&console.log(`\u{1F4C4} Resolved embedded component: ${e.name} from namespace ${c}, type:`,typeof u);else{this.debug&&console.log(`\u26A0\uFE0F [ComponentResolver] Not found in namespace ${c}, trying fallback namespace: ${r}`);let f=this.registry.get(e.name,r);f?(t[e.name]=f,this.debug&&console.log(`\u2705 [ComponentResolver] Found embedded component in fallback namespace: ${e.name}, type: ${typeof f}`),this.debug&&console.log(`\u{1F4C4} Resolved embedded component: ${e.name} from fallback namespace ${r}, type:`,typeof f)):(console.error(`\u274C [ComponentResolver] Could not resolve embedded component: ${e.name} in namespace ${c} or ${r}`),this.debug&&console.warn(`\u26A0\uFE0F Could not resolve embedded component: ${e.name} in namespace ${c} or ${r}`),t[e.name]=void 0)}}}}Cleanup(){this.registryService&&this.debug&&console.log(`Cleaning up resolver: ${this.resolverInstanceId}`)}cleanup(){return this.Cleanup()}ValidateDependencies(e,t="Global"){let r=[],o=new Set;return this.checkDependencies(e,t,r,o),r}validateDependencies(e,t="Global"){return this.ValidateDependencies(e,t)}checkDependencies(e,t,r,o){if(o.has(e.name))return;o.add(e.name),this.registry.has(e.name,t)||r.push(e.name);let i=e.dependencies||[];for(let s of i)this.checkDependencies(s,t,r,o)}GetDependencyGraph(e){let t=new Map,r=new Set;return this.buildDependencyGraph(e,t,r),t}getDependencyGraph(e){return this.GetDependencyGraph(e)}buildDependencyGraph(e,t,r){if(r.has(e.name))return;r.add(e.name);let o=e.dependencies||[],i=o.map(s=>s.name);t.set(e.name,i);for(let s of o)this.buildDependencyGraph(s,t,r)}GetLoadOrder(e){let t=this.GetDependencyGraph(e),r=new Set,o=[];for(let i of t.keys())r.has(i)||this.topologicalSortDFS(i,t,r,o);return o.reverse()}getLoadOrder(e){return this.GetLoadOrder(e)}topologicalSortDFS(e,t,r,o){r.add(e);let i=t.get(e)||[];for(let s of i)r.has(s)||this.topologicalSortDFS(s,t,r,o);o.push(e)}ResolveInOrder(e,t="Global"){let r=this.GetLoadOrder(e),o=[];for(let i of r){let s=this.registry.get(i,t);s&&o.push({name:i,component:s})}return o}resolveInOrder(e,t="Global"){return this.ResolveInOrder(e,t)}FlattenComponentSpecs(e){let t=[],r=new Set;return this.collectComponentSpecs(e,t,r),t}flattenComponentSpecs(e){return this.FlattenComponentSpecs(e)}collectComponentSpecs(e,t,r){if(r.has(e.name))return;r.add(e.name),t.push(e);let o=e.dependencies||[];for(let i of o)this.collectComponentSpecs(i,t,r)}};var js=class{static{a(this,"ComponentManager")}constructor(e,t,r,o={}){this.fetchCache=new Map,this.registryNotifications=new Set,this.loadingPromises=new Map,this.componentEngine=Tn.Instance,this.graphQLClient=null,this.compiler=e,this.registry=t,this.runtimeContext=r,this.config={debug:!1,maxCacheSize:100,cacheTTL:36e5,enableUsageTracking:!0,dependencyBatchSize:5,fetchTimeout:3e4,...o},this.log("ComponentManager initialized",{debug:this.config.debug,cacheTTL:this.config.cacheTTL,usageTracking:this.config.enableUsageTracking})}async LoadComponent(e,t={}){let r=Date.now(),o=this.getComponentKey(e,t);this.log(`Loading component: ${e.name}`,{key:o,location:e.location,registry:e.registry,forceRefresh:t.forceRefresh});let i=this.loadingPromises.get(o);if(i&&!t.forceRefresh){let l=e.namespace||t.defaultNamespace||"Global",c=e.version||t.defaultVersion||"latest",u=this.calculateHash(e),f=this.registry.get(e.name,l,c,u);return f?(this.log(`Component already registered (circular dep resolution): ${e.name}`),{success:!0,component:f,spec:e,fromCache:!0}):(this.log(`Component already loading: ${e.name}, waiting...`),i)}let s=this.doLoadComponent(e,t,o,r);this.loadingPromises.set(o,s);try{return await s}finally{this.loadingPromises.delete(o)}}async loadComponent(e,t={}){return this.LoadComponent(e,t)}async doLoadComponent(e,t,r,o){let i=[];try{let s=e.namespace||t.defaultNamespace||"Global",l=e.version||t.defaultVersion||"latest",c=this.calculateHash(e),u=this.registry.get(e.name,s,l,c);if(u&&!t.forceRefresh&&!t.forceRecompile){this.log(`Component found in registry: ${e.name}`),t.trackUsage!==!1&&await this.notifyRegistryUsageIfNeeded(e,r);let y=this.fetchCache.get(r);return{success:!0,component:u,spec:y?.spec||e,fromCache:!0}}let f=e;if(this.needsFetch(e)){this.log(`Fetching component spec: ${e.name}`);try{f=await this.fetchComponentSpec(e,t.contextUser,{resolutionMode:t.resolutionMode}),this.fetchCache.set(r,{spec:f,fetchedAt:new Date,hash:this.calculateHash(f),usageNotified:!1})}catch(y){throw i.push({message:`Failed to fetch component: ${y instanceof Error?y.message:String(y)}`,phase:"fetch",componentName:e.name}),y}}else e.location==="registry"&&e.code&&this.log(`Skipping fetch for registry component: ${e.name} (code already provided)`,{location:e.location,registry:e.registry}),e.code&&!this.fetchCache.has(r)&&this.fetchCache.set(r,{spec:f,fetchedAt:new Date,hash:this.calculateHash(f),usageNotified:!1});t.trackUsage!==!1&&await this.notifyRegistryUsageIfNeeded(f,r);let p=u;if(!p||t.forceRecompile){this.log(`Compiling component: ${e.name}`);try{p=await this.compileComponent(f,t)}catch(y){throw i.push({message:`Failed to compile component: ${y instanceof Error?y.message:String(y)}`,phase:"compile",componentName:e.name}),y}}(!u||t.forceRefresh||t.forceRecompile)&&(this.log(`Registering component: ${e.name}`),this.registry.register(f.name,p,s,l,c));let m={};if(f.dependencies&&f.dependencies.length>0){this.log(`Loading ${f.dependencies.length} dependencies for ${e.name}`);let y=await this.loadDependenciesBatched(f.dependencies,{...t,isDependent:!0});for(let C of y)if(C.success&&C.component){let v=f.dependencies.find(S=>S.name===(C.spec?.name||""));v&&(m[v.name]=C.component)}else C.errors&&i.push(...C.errors)}let g=Date.now()-o;return this.log(`Component loaded successfully: ${e.name} (${g}ms)`,{fromCache:!1,dependencyCount:Object.keys(m).length}),{success:i.length===0,component:p,spec:f,fromCache:!1,dependencies:m,errors:i.length>0?i:void 0}}catch(s){let l=Date.now()-o;return this.log(`Failed to load component: ${e.name} (${l}ms)`,s),{success:!1,fromCache:!1,errors:i.length>0?i:[{message:s instanceof Error?s.message:String(s),phase:"fetch",componentName:e.name}]}}}async LoadHierarchy(e,t={}){let r=Date.now(),o=[],i=[],s={},l={fromCache:0,fetched:0,compiled:0,totalTime:0};this.log(`Loading component hierarchy: ${e.name}`,{location:e.location,registry:e.registry});try{this.componentEngine&&typeof this.componentEngine.Config=="function"&&await this.componentEngine.Config(!1,t.contextUser);let c=await this.loadComponentRecursive(e,t,o,i,s,l,new Set);l.totalTime=Date.now()-r,this.log(`Hierarchy loaded: ${e.name}`,{success:i.length===0,loadedCount:o.length,errors:i.length,...l});let u={};for(let[f,p]of Object.entries(s))p&&typeof p=="object"&&"component"in p?u[f]=p.component:u[f]=p;return{success:i.length===0,rootComponent:c.component,resolvedSpec:c.spec,loadedComponents:o,errors:i,components:u,stats:l}}catch(c){return l.totalTime=Date.now()-r,this.log(`Failed to load hierarchy: ${e.name}`,c),{success:!1,loadedComponents:o,errors:[...i,{message:c instanceof Error?c.message:String(c),phase:"fetch",componentName:e.name}],stats:l}}}async loadHierarchy(e,t={}){return this.LoadHierarchy(e,t)}async loadComponentRecursive(e,t,r,o,i,s,l){let c=this.getComponentKey(e,t);if(l.has(c))return this.log(`Circular dependency detected: ${e.name}`),{success:!0,component:i[e.name],spec:e,fromCache:!0};l.add(c);let u=await this.LoadComponent(e,t);if(u.success&&u.component){r.push(e.name),i[e.name]=u.component,s&&(u.fromCache?s.fromCache++:(s.fetched++,s.compiled++));let f=this.resolveDependencies(e.dependencies,u.spec?.dependencies);if(f)for(let p of f){let m={...p};m.code&&this.log(`Dependency ${m.name} already has code (from registry population), optimizing load`),m.location==="registry"&&!m.registry&&(m.registry=void 0,this.log(`Dependency ${m.name} is a local registry component (registry=undefined)`)),await this.loadComponentRecursive(m,{...t,isDependent:!0},r,o,i,s,l)}}else u.errors&&o.push(...u.errors);return u}async loadDependenciesBatched(e,t){let r=this.config.dependencyBatchSize||5,o=[];for(let i=0;i<e.length;i+=r){let l=e.slice(i,i+r).map(u=>this.LoadComponent(u,t)),c=await Promise.all(l);o.push(...c)}return o}resolveDependencies(e,t){let r=e&&e.length>0;return r&&e.some(i=>!!i.code)?e:r?t?.some(i=>!!i.code)?t:e:t||e}needsFetch(e){return e.location==="registry"&&!e.code}async fetchComponentSpec(e,t,r){let o=this.getComponentKey(e,{}),i=this.fetchCache.get(o);if(i&&this.isCacheValid(i))return this.log(`Using cached spec for: ${e.name}`),i.spec;if(!e.registry){let f=await this.componentEngine.FindComponent(e.name,e.namespace);if(!f)throw new Error(`Local component not found: ${e.name}`);if(!f.Specification)throw new Error(`Local component ${e.name} has no specification`);let p=JSON.parse(f.Specification);return this.fetchCache.set(o,{spec:p,fetchedAt:new Date,usageNotified:!1}),p}if(this.graphQLClient||await this.initializeGraphQLClient(),!this.graphQLClient)throw new Error("GraphQL client not available for registry fetching");this.log(`Fetching from external registry: ${e.registry}/${e.name}`);let s=i?.hash,l=await this.graphQLClient.GetRegistryComponentWithHash({registryName:e.registry,namespace:e.namespace||"Global",name:e.name,version:e.version||"latest",hash:s});if(l.notModified&&i)return this.log(`Registry returned 304 for ${e.name}, reusing cached spec`),this.fetchCache.set(o,{...i,fetchedAt:new Date}),i.spec;if(!l.specification)throw new Error(`Component not found in registry: ${e.registry}/${e.name}`);let c=l.specification,u=this.applyResolutionMode(c,e,r?.resolutionMode);return this.fetchCache.set(o,{spec:u,fetchedAt:new Date,hash:l.hash,usageNotified:!1}),u}applyResolutionMode(e,t,r){let o;return r==="embed"?o={...e,location:"embedded",registry:void 0}:o={...e,location:t.location,registry:t.registry,namespace:t.namespace||e.namespace,name:t.name||e.name},o.dependencies&&o.dependencies.length>0&&(o.dependencies=o.dependencies.map(i=>this.applyResolutionMode(i,i,r))),o}async compileComponent(e,t){let r=t.allLibraries||this.componentEngine.ComponentLibraries||[],o=e.libraries?.filter(l=>l&&l.name&&l.globalVariable&&l.name!=="unknown"&&l.globalVariable!=="undefined"),i=await this.compiler.compile({componentName:e.name,componentCode:e.code||"",libraries:o,dependencies:e.dependencies,allLibraries:r});if(!i.success||!i.component)throw new Error(i.error?.message||"Compilation failed");return i.loadedLibraries&&i.loadedLibraries.size>0&&(this.runtimeContext.libraries||(this.runtimeContext.libraries={}),i.loadedLibraries.forEach((l,c)=>{this.runtimeContext.libraries[c]=l})),i.component.factory(this.runtimeContext,void 0,{})}async notifyRegistryUsageIfNeeded(e,t){if(!e.registry||!this.config.enableUsageTracking)return;let r=`${e.registry}:${t}`;if(this.registryNotifications.has(r)){this.log(`Usage already notified for: ${e.name}`);return}try{this.log(`Notifying registry usage for: ${e.name}`),this.registryNotifications.add(r);let o=this.fetchCache.get(t);o&&(o.usageNotified=!0)}catch(o){console.warn(`Failed to notify registry usage for ${t}:`,o)}}async initializeGraphQLClient(){try{let e=Be?.Provider;if(e&&e.ExecuteGQL){let{GraphQLComponentRegistryClient:t}=await import("./dist-4BLL2YRV.js");this.graphQLClient=new t(e),this.log("GraphQL client initialized")}}catch(e){B(`Failed to initialize GraphQL client: ${e instanceof Error?e.message:String(e)}`)}}isCacheValid(e){return Date.now()-e.fetchedAt.getTime()<(this.config.cacheTTL||36e5)}calculateHash(e){let t=JSON.stringify({name:e.name,version:e.version,code:e.code,libraries:e.libraries}),r=0;for(let o=0;o<t.length;o++){let i=t.charCodeAt(o);r=(r<<5)-r+i,r=r&r}return r.toString(16)}getComponentKey(e,t){let r=e.registry||"local",o=e.namespace||t.defaultNamespace||"Global",i=e.version||t.defaultVersion||"latest",s=this.calculateHash(e);return`${r}:${o}:${e.name}:${i}#${s}`}ClearCache(){this.fetchCache.clear(),this.registryNotifications.clear(),this.loadingPromises.clear(),this.log("All caches cleared")}clearCache(){return this.ClearCache()}GetCacheStats(){return{fetchCacheSize:this.fetchCache.size,notificationsCount:this.registryNotifications.size,loadingCount:this.loadingPromises.size}}getCacheStats(){return this.GetCacheStats()}log(e,t){this.config.debug&&console.log(`\u{1F3AF} [ComponentManager] ${e}`,t||"")}};function lF(n,e={}){let{onError:t,fallback:r,logErrors:o=!0,recovery:i="none"}=e;return class extends n.Component{static{a(this,"ErrorBoundary")}get state(){return this.State}set state(l){this.State=l}constructor(l){super(l),this.HandleRetry=()=>{this.setState(c=>({hasError:!1,error:null,errorInfo:null,retryCount:c.retryCount+1}))},this.HandleReset=()=>{this.setState({hasError:!1,error:null,errorInfo:null,retryCount:0})},this.State={hasError:!1,error:null,errorInfo:null,retryCount:0}}static getDerivedStateFromError(l){return{hasError:!0,error:l}}componentDidCatch(l,c){if(o&&(console.error("React Error Boundary caught error:",l),console.error("Error Info:",c)),t)try{t(l,c)}catch(u){console.error("Error in custom error handler:",u)}this.setState({errorInfo:c})}get handleRetry(){return this.HandleRetry}set handleRetry(l){this.HandleRetry=l}get handleReset(){return this.HandleReset}set handleReset(l){this.HandleReset=l}render(){if(this.State.hasError){if(r)return typeof r=="function"?r({error:this.State.error,errorInfo:this.State.errorInfo,retry:this.HandleRetry,reset:this.HandleReset,retryCount:this.State.retryCount}):r;let l=i==="retry"&&this.State.retryCount<3,c=i==="reset";return n.createElement("div",{style:{padding:"20px",backgroundColor:"#f8f8f8",border:"1px solid #ddd",borderRadius:"4px",margin:"10px"}},n.createElement("h2",{style:{color:"#d32f2f"}},"Component Error"),n.createElement("p",{style:{color:"#666"}},"An error occurred while rendering this component."),this.State.error&&n.createElement("details",{style:{marginTop:"10px"}},n.createElement("summary",{style:{cursor:"pointer",color:"#333"}},"Error Details"),n.createElement("pre",{style:{backgroundColor:"#f0f0f0",padding:"10px",marginTop:"10px",overflow:"auto",fontSize:"12px"}},this.State.error.toString(),`
|
|
349
|
+
Code preview: `+e.componentCode.substring(0,200)+"...")}generateComponentId(e){return`${e}_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}getCachedComponent(e,t){let r=this.createCacheKey(e,t);return this.compilationCache.get(r)}createCacheKey(e,t){let r=0;for(let o=0;o<t.length;o++){let i=t.charCodeAt(o);r=(r<<5)-r+i,r=r&r}return`${e}_${r.toString(36)}`}cacheComponent(e,t){if(this.compilationCache.size>=this.config.maxCacheSize){let o=this.compilationCache.keys().next().value;o&&this.compilationCache.delete(o)}let r=this.createCacheKey(e.name,t);this.compilationCache.set(r,e)}createCompilationError(e,t){return{message:e.message||"Unknown compilation error",stack:e.stack,componentName:t,phase:"compilation",details:e}}ClearCache(){this.compilationCache.clear()}clearCache(){return this.ClearCache()}GetCacheSize(){return this.compilationCache.size}getCacheSize(){return this.GetCacheSize()}UpdateConfig(e){this.config={...this.config,...e}}updateConfig(e){return this.UpdateConfig(e)}};var Ah=["react"],Rh=[],sF={presets:Ah,plugins:[...Rh],minified:!0,comments:!1},aF={presets:Ah,plugins:[...Rh],sourceMaps:"inline",minified:!1,comments:!0};var XY={maxComponents:1e3,cleanupInterval:6e4,useLRU:!0,enableNamespaces:!0},Ks=class{static{a(this,"ComponentRegistry")}get registryId(){return this.RegistryId}constructor(e){this.config={...XY,...e},this.registry=new Map,this.RegistryId=`component-registry-${Date.now()}`,this.config.cleanupInterval>0&&this.startCleanupTimer()}Register(e,t,r="Global",o="v1",i,s){let l=this.generateRegistryKey(e,r,o,i),c={id:l,name:e,version:o,namespace:r,registeredAt:new Date,tags:s},u={component:t,metadata:c,lastAccessed:new Date,refCount:0};return this.registry.size>=this.config.maxComponents&&this.config.useLRU&&this.evictLRU(),this.registry.set(l,u),c}register(e,t,r="Global",o="v1",i,s){return this.Register(e,t,r,o,i,s)}Get(e,t="Global",r,o){let i=this.resolveLookupKey(e,t,r,o);if(!i)return;let s=this.registry.get(i);if(s)return s.lastAccessed=new Date,s.refCount++,s.component}get(e,t="Global",r,o){return this.Get(e,t,r,o)}Has(e,t="Global",r,o){let i=this.resolveLookupKey(e,t,r,o);return i?this.registry.has(i):!1}has(e,t="Global",r,o){return this.Has(e,t,r,o)}Unregister(e,t="Global",r,o){let i=this.resolveLookupKey(e,t,r,o);return i?this.registry.delete(i):!1}unregister(e,t="Global",r,o){return this.Unregister(e,t,r,o)}GetNamespace(e){let t=[];for(let r of this.registry.values())r.metadata.namespace===e&&t.push(r.metadata);return t}getNamespace(e){return this.GetNamespace(e)}GetAll(e="Global",t="v1"){let r={};for(let o of this.registry.values())o.metadata.namespace===e&&o.metadata.version===t&&(r[o.metadata.name]=o.component);return r}getAll(e="Global",t="v1"){return this.GetAll(e,t)}GetNamespaces(){let e=new Set;for(let t of this.registry.values())e.add(t.metadata.namespace);return Array.from(e)}getNamespaces(){return this.GetNamespaces()}GetByTags(e){let t=[];for(let r of this.registry.values())r.metadata.tags?.some(o=>e.includes(o))&&t.push(r.metadata);return t}getByTags(e){return this.GetByTags(e)}Release(e,t="Global",r,o){let i=this.resolveLookupKey(e,t,r,o);if(!i)return;let s=this.registry.get(i);s&&s.refCount>0&&s.refCount--}release(e,t="Global",r,o){return this.Release(e,t,r,o)}Clear(){this.registry.clear()}clear(){return this.Clear()}ClearNamespace(e="Global"){let t=[];for(let[r,o]of this.registry)o.metadata.namespace===e&&t.push(r);for(let r of t)this.registry.delete(r);return t.length}clearNamespace(e="Global"){return this.ClearNamespace(e)}ForceClear(){this.stopCleanupTimer(),this.registry.clear(),console.log("\u{1F9F9} Registry force cleared - all components removed")}forceClear(){return this.ForceClear()}Size(){return this.registry.size}size(){return this.Size()}Cleanup(e=!1){let t=[],r=Date.now();for(let[o,i]of this.registry){let s=r-i.lastAccessed.getTime(),l=i.refCount===0&&s>this.config.cleanupInterval;(e||l)&&t.push(o)}for(let o of t)this.registry.delete(o);return t.length}cleanup(e=!1){return this.Cleanup(e)}GetStats(){let e=0,t,r;for(let o of this.registry.values())e+=o.refCount,(!t||o.metadata.registeredAt<t)&&(t=o.metadata.registeredAt),(!r||o.metadata.registeredAt>r)&&(r=o.metadata.registeredAt);return{totalComponents:this.registry.size,namespaces:this.GetNamespaces().length,totalRefCount:e,oldestComponent:t,newestComponent:r}}getStats(){return this.GetStats()}Destroy(){this.stopCleanupTimer(),this.Clear(),Xe.cleanupComponent(this.RegistryId)}destroy(){return this.Destroy()}generateRegistryKey(e,t,r,o){let i=this.config.enableNamespaces?`${t}::${e}@${r}`:`${e}@${r}`;return o?`${i}#${o}`:i}resolveLookupKey(e,t,r,o){return r&&o?this.generateRegistryKey(e,t,r,o):r?this.findLatestForVersion(e,t,r):this.findLatestVersion(e,t)}findLatestForVersion(e,t,r){let o,i;for(let[s,l]of this.registry)l.metadata.name===e&&l.metadata.namespace===t&&l.metadata.version===r&&(!i||l.metadata.registeredAt>i)&&(i=l.metadata.registeredAt,o=s);return o}findLatestVersion(e,t){let r,o;for(let[i,s]of this.registry)s.metadata.name===e&&s.metadata.namespace===t&&(!o||s.metadata.registeredAt>o)&&(o=s.metadata.registeredAt,r=i);return r}evictLRU(){let e,t;for(let[r,o]of this.registry)o.refCount>0||(!t||o.lastAccessed<t)&&(t=o.lastAccessed,e=r);e&&this.registry.delete(e)}startCleanupTimer(){this.cleanupTimer=Xe.setInterval(this.RegistryId,()=>{this.Cleanup()},this.config.cleanupInterval,{purpose:"component-registry-cleanup"})}stopCleanupTimer(){this.cleanupTimer&&(Xe.clearInterval(this.RegistryId,this.cleanupTimer),this.cleanupTimer=void 0)}};var Mh,mo=class n{static{a(this,"ComponentRegistryService")}static{this._globalStoreKey="___SINGLETON__ComponentRegistryService"}get Provider(){return this._provider??new Be}set Provider(e){this._provider=e}constructor(e,t,r=!1,o){this.compiledComponentCache=new Map,this.componentReferences=new Map,this.componentEngine=Tn.Instance,this.registryProviders=new Map,this.debug=!1,this._provider=null,this.cachedProviderClient=null,this.compiler=e,this.runtimeContext=t,this.debug=r,this.graphQLClient=o}static get Instance(){let e=So();return e?e[n._globalStoreKey]:void 0}static GetInstance(e,t,r=!1,o){let i=So();return i?(i[n._globalStoreKey]||(i[n._globalStoreKey]=new n(e,t,r,o)),i[n._globalStoreKey]):new n(e,t,r,o)}static getInstance(e,t,r=!1,o){return this.GetInstance(e,t,r,o)}SetGraphQLClient(e){this.graphQLClient=e,this.debug&&console.log("\u2705 GraphQL client configured for component registry")}setGraphQLClient(e){return this.SetGraphQLClient(e)}async getGraphQLClient(){if(this.graphQLClient)return this.graphQLClient;if(this.cachedProviderClient)return this.cachedProviderClient;try{let e=Be?.Provider;if(e&&e.ExecuteGQL!==void 0){if(!Mh)try{Mh=(await import("./dist-6QB6LKFP.js")).GraphQLComponentRegistryClient}catch{return this.debug&&console.log("\u26A0\uFE0F [ComponentRegistryService] @memberjunction/graphql-dataprovider not available"),null}if(Mh)try{let t=new Mh(e);return this.cachedProviderClient=t,this.debug&&console.log("\u{1F4E1} [ComponentRegistryService] Created GraphQL client from active metadata provider"),t}catch(t){this.debug&&console.log("\u26A0\uFE0F [ComponentRegistryService] Failed to create GraphQL client:",t)}}}catch(e){this.debug&&console.log("\u26A0\uFE0F [ComponentRegistryService] Could not access metadata provider:",e)}return null}async Initialize(e){await this.componentEngine.Config(!1,e)}async initialize(e){return this.Initialize(e)}async calculateSpecHash(e){if(typeof crypto>"u"||!crypto.subtle)throw new Error("Web Crypto API not available. This typically happens when running in an insecure context. Please use HTTPS or localhost for development. Note: crypto.subtle is available in Node.js 15+ and all modern browsers on secure contexts.");let t=JSON.stringify(e),o=new TextEncoder().encode(t),i=await crypto.subtle.digest("SHA-256",o);return Array.from(new Uint8Array(i)).map(c=>c.toString(16).padStart(2,"0")).join("")}async GetCompiledComponent(e,t,r){await this.Initialize(r);let o=await this.componentEngine.FindComponentByID(e,r);if(!o)throw new Error(`Component not found: ${e}`);let i=this.getComponentKey(o.Name,o.Namespace,o.Version,o.SourceRegistryID);if(this.compiledComponentCache.has(i)){let p=this.compiledComponentCache.get(i);return p.lastUsed=new Date,p.useCount++,t&&this.addComponentReference(i,t),this.debug&&console.log(`\u2705 Reusing compiled component from cache: ${i} (use count: ${p.useCount})`),p.component(this.runtimeContext)}this.debug&&console.log(`\u{1F504} Loading and compiling component: ${i}`);let s=await this.GetComponentSpec(e,r),l=this.componentEngine.ComponentLibraries||[],c;try{c=await this.compiler.compile({componentName:o.Name,componentCode:s.code,libraries:s.libraries,allLibraries:l})}catch(p){throw console.error(`\u{1F534} Error compiling component ${o.Name}`,p),p}if(!c.success)throw console.error(`\u{1F534} Error compiling component ${o.Name}`,c,"Code",s.code),new Error(`Failed to compile component ${o.Name}: ${c.error}`);let u={name:o.Name,namespace:o.Namespace||"",version:o.Version,description:o.Description||"",title:o.Title||void 0,type:o.Type||void 0,status:o.Status||void 0,properties:s.properties,events:s.events,libraries:s.libraries,dependencies:s.dependencies,sourceRegistryID:o.SourceRegistryID,isLocal:!o.SourceRegistryID};if(!c.component)throw new Error("Component compilation succeeded but no component returned");let f=c.component.factory;return this.compiledComponentCache.set(i,{component:f,metadata:u,compiledAt:new Date,lastUsed:new Date,useCount:1}),t&&this.addComponentReference(i,t),f(this.runtimeContext)}async getCompiledComponent(e,t,r){return this.GetCompiledComponent(e,t,r)}async GetCompiledComponentFromRegistry(e,t,r,o,i,s){await this.Initialize(s),this.debug&&console.log(`\u{1F310} [ComponentRegistryService] Fetching from external registry: ${e}/${t}/${r}@${o}`);let l=this.componentEngine.ComponentRegistries?.find(p=>p.Name===e&&p.Status==="Active");if(!l)throw new Error(`Registry not found or inactive: ${e}`);this.debug&&console.log(`\u2705 [ComponentRegistryService] Found registry: ${l.Name} (ID: ${l.ID})`);let c=await this.getGraphQLClient();if(!c)throw new Error("GraphQL client not available for external registry fetching. No client provided and the active metadata provider is not a GraphQLDataProvider.");let u=`external:${e}:${t}:${r}:${o}`,f=this.compiledComponentCache.get(u);try{let p=await c.GetRegistryComponent({registryName:l.Name,namespace:t,name:r,version:o,hash:f?.specHash});if(!p&&f?.specHash)return this.debug&&console.log(`\u267B\uFE0F [ComponentRegistryService] Component not modified, using cached: ${u}`),f.lastUsed=new Date,f.useCount++,i&&this.addComponentReference(u,i),f.component(this.runtimeContext);if(!p)throw new Error(`Component not found in registry ${e}: ${t}/${r}@${o}`);this.debug&&console.log(`\u2705 [ComponentRegistryService] Fetched spec from external registry: ${p.name}`);let m=await this.calculateSpecHash(p);if(f&&f.specHash===m)return this.debug&&console.log(`\u267B\uFE0F [ComponentRegistryService] Using cached compilation for: ${u} (hash match)`),f.lastUsed=new Date,f.useCount++,i&&this.addComponentReference(u,i),f.component(this.runtimeContext);f&&this.debug&&console.log(`\u{1F504} [ComponentRegistryService] Spec changed for: ${u}, recompiling (old hash: ${f.specHash?.substring(0,8)}..., new hash: ${m.substring(0,8)}...)`);let g=this.componentEngine.ComponentLibraries||[],y=await this.compiler.compile({componentName:p.name,componentCode:p.code||"",allLibraries:g});if(!y.success||!y.component)throw new Error(`Failed to compile component: ${y.error?.message||"Unknown error"}`);return this.compiledComponentCache.set(u,{component:y.component.factory,metadata:{name:p.name,namespace:p.namespace||"",version:p.version||"1.0.0",description:p.description||"",type:p.type,isLocal:!1},compiledAt:new Date,lastUsed:new Date,useCount:1,specHash:m}),i&&this.addComponentReference(u,i),this.debug&&console.log(`\u{1F3AF} [ComponentRegistryService] Successfully compiled external component: ${p.name}`),y.component.factory(this.runtimeContext)}catch(p){throw console.error("\u274C [ComponentRegistryService] Failed to fetch from external registry:",p),p}}async getCompiledComponentFromRegistry(e,t,r,o,i,s){return this.GetCompiledComponentFromRegistry(e,t,r,o,i,s)}async GetComponentSpec(e,t){await this.Initialize(t);let r=await this.componentEngine.FindComponentByID(e,t);if(!r)throw new Error(`Component not found: ${e}`);if(!r.SourceRegistryID){if(!r.Specification)throw new Error(`Local component ${r.Name} has no specification`);return JSON.parse(r.Specification)}if(r.Specification&&r.LastSyncedAt)return this.debug&&console.log(`Using cached external component: ${r.Name} (synced: ${r.LastSyncedAt})`),JSON.parse(r.Specification);let o=this.componentEngine.ComponentRegistries?.find(s=>N(s.ID,r.SourceRegistryID));if(!o)throw new Error(`Registry not found: ${r.SourceRegistryID}`);let i;if(this.graphQLClient){this.debug&&console.log(`Fetching from registry via GraphQL: ${r.Name}`);let s=await this.graphQLClient.GetRegistryComponent({registryName:o.Name,namespace:r.Namespace||"",name:r.Name,version:r.Version});if(!s)throw new Error(`Component not found in registry: ${r.Name}`);i=s}else i=await this.fetchFromExternalRegistry(o.URI||"",r.Name,r.Namespace||"",r.Version,this.getRegistryApiKey(o.ID));return await this.cacheExternalComponent(e,i,t),i}async getComponentSpec(e,t){return this.GetComponentSpec(e,t)}async fetchFromExternalRegistry(e,t,r,o,i){let s=`${e}/components/${encodeURIComponent(r)}/${encodeURIComponent(t)}/${o}`,l={Accept:"application/json"};i&&(l.Authorization=`Bearer ${i}`),this.debug&&console.log(`Fetching from external registry: ${s}`);let c=await fetch(s,{headers:l});if(!c.ok)throw await c.body?.cancel().catch(()=>{}),new Error(`Registry fetch failed: ${c.status} ${c.statusText}`);return await c.json()}async cacheExternalComponent(e,t,r){let i=await this.Provider.GetEntityObject("MJ: Components",r);if(!await i.Load(e))throw new Error(`Failed to load component entity: ${e}`);if(i.Specification=JSON.stringify(t),i.LastSyncedAt=new Date,i.ReplicatedAt||(i.ReplicatedAt=new Date),t.name&&(i.Name=t.name),t.namespace&&(i.Namespace=t.namespace),t.version&&(i.Version=t.version),t.title&&(i.Title=t.title),t.description&&(i.Description=t.description),t.type){let c={report:"Report",dashboard:"Dashboard",form:"Form",table:"Table",chart:"Chart",navigation:"Navigation",search:"Search",widget:"Widget",utility:"Utility",other:"Other"}[t.type.toLowerCase()];c&&(i.Type=c)}if(t.functionalRequirements&&(i.FunctionalRequirements=t.functionalRequirements),t.technicalDesign&&(i.TechnicalDesign=t.technicalDesign),!await i.Save())throw new Error(`Failed to save cached component: ${i.Name}
|
|
350
|
+
${i.LatestResult?.CompleteMessage||"Unknown error"}`);this.debug&&console.log(`Cached external component: ${i.Name} at ${i.LastSyncedAt}`),await this.componentEngine.Config(!0,r)}async LoadDependencies(e,t){await this.Initialize(t);let r=this.componentEngine.ComponentDependencies?.filter(i=>N(i.ComponentID,e))||[],o=[];for(let i of r){let s=await this.componentEngine.FindComponentByID(i.DependencyComponentID,t);s&&o.push({name:s.Name,namespace:s.Namespace||"",version:s.Version,isRequired:!0,location:s.SourceRegistryID?"registry":"embedded",sourceRegistryID:s.SourceRegistryID})}return o}async loadDependencies(e,t){return this.LoadDependencies(e,t)}async ResolveDependencyTree(e,t,r=new Set){if(r.has(e))return{componentId:e,circular:!0};r.add(e),await this.Initialize(t);let o=await this.componentEngine.FindComponentByID(e,t);if(!o)return{componentId:e,dependencies:[]};let i=await this.LoadDependencies(e,t),s=[];for(let l of i){let c=await this.componentEngine.FindComponent(l.name,l.namespace,void 0,t);if(c){let u=await this.ResolveDependencyTree(c.ID,t,r);s.push(u)}}return{componentId:e,name:o.Name,namespace:o.Namespace||void 0,version:o.Version,dependencies:s,totalCount:s.reduce((l,c)=>l+(c.totalCount||1),1)}}async resolveDependencyTree(e,t,r=new Set){return this.ResolveDependencyTree(e,t,r)}async GetComponentsToLoad(e,t){let r=await this.ResolveDependencyTree(e,t),o=[],i=a(s=>{s.dependencies&&s.dependencies.forEach(i),o.includes(s.componentId)||o.push(s.componentId)},"processNode");return i(r),o}async getComponentsToLoad(e,t){return this.GetComponentsToLoad(e,t)}addComponentReference(e,t){this.componentReferences.has(e)||this.componentReferences.set(e,new Set),this.componentReferences.get(e).add(t)}RemoveComponentReference(e,t){let r=this.componentReferences.get(e);r&&(r.delete(t),r.size===0&&this.considerCacheEviction(e))}removeComponentReference(e,t){return this.RemoveComponentReference(e,t)}considerCacheEviction(e){let t=this.compiledComponentCache.get(e);if(t){let r=Date.now()-t.lastUsed.getTime(),o=300*1e3;r>o&&(this.debug&&console.log(`\u{1F5D1}\uFE0F Evicting unused component from cache: ${e}`),this.compiledComponentCache.delete(e))}}getRegistryApiKey(e){let t=`REGISTRY_API_KEY_${e.replace(/-/g,"_").toUpperCase()}`;return process.env[t]}GetCacheStats(){let e=0;return this.compiledComponentCache.forEach(t=>{e+=t.useCount}),{compiledComponents:this.compiledComponentCache.size,totalUseCount:e,memoryEstimate:`~${this.compiledComponentCache.size*50}KB`}}getCacheStats(){return this.GetCacheStats()}ClearCache(){this.debug&&console.log("\u{1F9F9} Clearing all component caches"),this.compiledComponentCache.clear(),this.componentReferences.clear()}clearCache(){return this.ClearCache()}ForceClearAll(){this.compiledComponentCache.clear(),this.componentReferences.clear(),console.log("\u{1F9F9} Component cache force cleared")}forceClearAll(){return this.ForceClearAll()}static Reset(){let e=So(),t=e?e[n._globalStoreKey]:void 0;t&&(t.forceClearAll(),e&&delete e[n._globalStoreKey])}static reset(){return this.Reset()}getComponentKey(e,t,r,o){return`${o||"local"}/${t||"global"}/${e}@${r}`}};var Js=class{static{a(this,"ComponentResolver")}constructor(e,t,r,o=!1){this.registryService=null,this.compiler=null,this.runtimeContext=null,this.componentEngine=Tn.Instance,this.debug=!1,this.registry=e,this.resolverInstanceId=`resolver-${Date.now()}-${Math.random()}`,this.debug=o,t&&r&&(this.compiler=t,this.runtimeContext=r,this.registryService=mo.getInstance(t,r,o))}async ResolveComponents(e,t="Global",r){console.log(`\u{1F680} [ComponentResolver] Starting component resolution for: ${e.name}`),console.log("\u{1F4CB} [ComponentResolver] Root component spec:",{name:e.name,location:e.location,registry:e.registry,namespace:e.namespace,hasCode:!!e.code,hasDependencies:!!(e.dependencies&&e.dependencies.length>0)}),this.debug&&console.log("\u{1F4CB} [ComponentResolver] Dependencies to resolve:",(e.dependencies||[]).map(s=>({name:s.name,location:s.location,namespace:s.namespace})));let o={};this.registryService&&(this.debug&&console.log("\u{1F504} [ComponentResolver] Initializing component engine..."),await this.componentEngine.Config(!1,r),this.debug&&console.log("\u2705 [ComponentResolver] Component engine initialized")),await this.resolveComponentHierarchy(e,o,t,new Set,r),o[e.name]||(console.error(`\u274C [ComponentResolver] Root component '${e.name}' was NOT added to resolved map!`),console.log("\u{1F4E6} [ComponentResolver] What IS in resolved map:",Object.keys(o))),this.debug&&console.log("\u{1F4CA} [ComponentResolver] Resolved components before unwrapping:",Object.keys(o));let i={};for(let[s,l]of Object.entries(o))l&&typeof l=="object"&&"component"in l?typeof l.component=="function"?(i[s]=l.component,this.debug&&console.log(`\u2705 [ComponentResolver] Unwrapped component: ${s} (was object with .component)`)):(console.error(`\u274C [ComponentResolver] Component ${s} has invalid component property:`,typeof l.component,l),i[s]=l):typeof l=="function"?(i[s]=l,this.debug&&console.log(`\u2705 [ComponentResolver] Component already a function: ${s}`)):(console.warn(`\u26A0\uFE0F [ComponentResolver] Component ${s} is not a function or wrapped component:`,typeof l,l),i[s]=l);return this.debug&&console.log("\u{1F3AF} [ComponentResolver] Final resolved components:",Object.keys(i).map(s=>({name:s,type:typeof i[s],isUndefined:i[s]===void 0}))),i}async resolveComponents(e,t="Global",r){return this.ResolveComponents(e,t,r)}async resolveComponentHierarchy(e,t,r,o=new Set,i){let s=`${e.namespace||r}/${e.name}@${e.version||"latest"}`;if(t[e.name]){this.debug&&console.log(`\u23ED\uFE0F [ComponentResolver] Component already resolved: ${e.name}`);return}if(o.has(s)){this.debug&&console.warn(`Circular dependency detected for component: ${s}`);return}o.add(s),this.debug&&console.log(`\u{1F504} [ComponentResolver] Resolving dependencies for ${e.name} BEFORE resolving itself`);let l=e.dependencies||[];for(let c of l)this.debug&&console.log(` \u21B3 [ComponentResolver] Resolving dependency: ${c.name} for parent ${e.name}`),await this.resolveComponentHierarchy(c,t,r,o,i);if(l.length>0&&this.debug&&console.log(`\u2705 [ComponentResolver] All ${l.length} dependencies resolved for ${e.name}, now resolving itself`),e.location==="registry"&&this.registryService){this.debug&&(console.log(`\u{1F50D} [ComponentResolver] Looking for registry component: ${e.name} in namespace: ${e.namespace||r}`),e.registry?console.log(` \u{1F4CD} [ComponentResolver] External registry specified: ${e.registry}`):console.log(" \u{1F4CD} [ComponentResolver] Local registry (no registry field specified)"));try{if(e.registry){this.debug&&console.log(`\u{1F310} [ComponentResolver] Fetching from external registry: ${e.registry}`);let c=await this.registryService.getCompiledComponentFromRegistry(e.registry,e.namespace||r,e.name,e.version||"latest",this.resolverInstanceId,i);c?(t[e.name]=c,this.debug&&console.log(`\u2705 [ComponentResolver] Successfully fetched and compiled from external registry: ${e.name}`)):console.error(`\u274C [ComponentResolver] Failed to fetch from external registry: ${e.name} from ${e.registry}`)}else{this.debug&&console.log(`\u{1F4BE} [ComponentResolver] Looking for locally registered component: ${e.name}`);let c=await this.componentEngine.FindComponent(e.name,e.namespace||r,void 0,i);if(c){this.debug&&console.log("\u2705 [ComponentResolver] Found component in local DB:",{ID:c.ID,Name:c.Name,Namespace:c.Namespace,Version:c.Version});let u=await this.registryService.getCompiledComponent(c.ID,this.resolverInstanceId,i);t[e.name]=u,this.debug&&console.log(`\u{1F4E6} [ComponentResolver] Successfully compiled and resolved local component: ${e.name}, type: ${typeof u}`)}else console.error(`\u274C [ComponentResolver] Local registry component NOT found in database: ${e.name} with namespace: ${e.namespace||r}`)}}catch(c){this.debug&&console.error(`Failed to load registry component ${e.name}:`,c)}}else{let c=e.namespace||r;if(e.code&&this.compiler){this.debug&&console.log(`\u{1F528} [ComponentResolver] Component ${e.name} has inline code, compiling...`);try{let u=await this.compiler.compile({componentName:e.name,componentCode:e.code,libraries:e.libraries,dependencies:e.dependencies,allLibraries:[]});if(u.success&&u.component){if(!this.runtimeContext){console.error("\u274C [ComponentResolver] Cannot compile without runtime context");return}let f=u.component.factory(this.runtimeContext);this.registry.register(e.name,f,c,e.version||"latest"),t[e.name]=f,this.debug&&console.log(`\u2705 [ComponentResolver] Successfully compiled and registered inline component: ${e.name}`)}else console.error(`\u274C [ComponentResolver] Failed to compile inline component ${e.name}:`,u.error)}catch(u){console.error(`\u274C [ComponentResolver] Error compiling inline component ${e.name}:`,u)}}else{this.debug&&console.log(`\u{1F50D} [ComponentResolver] Looking for embedded component: ${e.name} in namespace: ${c}`);let u=this.registry.get(e.name,c);if(u)t[e.name]=u,this.debug&&console.log(`\u2705 [ComponentResolver] Found embedded component: ${e.name}, type: ${typeof u}`),this.debug&&console.log(`\u{1F4C4} Resolved embedded component: ${e.name} from namespace ${c}, type:`,typeof u);else{this.debug&&console.log(`\u26A0\uFE0F [ComponentResolver] Not found in namespace ${c}, trying fallback namespace: ${r}`);let f=this.registry.get(e.name,r);f?(t[e.name]=f,this.debug&&console.log(`\u2705 [ComponentResolver] Found embedded component in fallback namespace: ${e.name}, type: ${typeof f}`),this.debug&&console.log(`\u{1F4C4} Resolved embedded component: ${e.name} from fallback namespace ${r}, type:`,typeof f)):(console.error(`\u274C [ComponentResolver] Could not resolve embedded component: ${e.name} in namespace ${c} or ${r}`),this.debug&&console.warn(`\u26A0\uFE0F Could not resolve embedded component: ${e.name} in namespace ${c} or ${r}`),t[e.name]=void 0)}}}}Cleanup(){this.registryService&&this.debug&&console.log(`Cleaning up resolver: ${this.resolverInstanceId}`)}cleanup(){return this.Cleanup()}ValidateDependencies(e,t="Global"){let r=[],o=new Set;return this.checkDependencies(e,t,r,o),r}validateDependencies(e,t="Global"){return this.ValidateDependencies(e,t)}checkDependencies(e,t,r,o){if(o.has(e.name))return;o.add(e.name),this.registry.has(e.name,t)||r.push(e.name);let i=e.dependencies||[];for(let s of i)this.checkDependencies(s,t,r,o)}GetDependencyGraph(e){let t=new Map,r=new Set;return this.buildDependencyGraph(e,t,r),t}getDependencyGraph(e){return this.GetDependencyGraph(e)}buildDependencyGraph(e,t,r){if(r.has(e.name))return;r.add(e.name);let o=e.dependencies||[],i=o.map(s=>s.name);t.set(e.name,i);for(let s of o)this.buildDependencyGraph(s,t,r)}GetLoadOrder(e){let t=this.GetDependencyGraph(e),r=new Set,o=[];for(let i of t.keys())r.has(i)||this.topologicalSortDFS(i,t,r,o);return o.reverse()}getLoadOrder(e){return this.GetLoadOrder(e)}topologicalSortDFS(e,t,r,o){r.add(e);let i=t.get(e)||[];for(let s of i)r.has(s)||this.topologicalSortDFS(s,t,r,o);o.push(e)}ResolveInOrder(e,t="Global"){let r=this.GetLoadOrder(e),o=[];for(let i of r){let s=this.registry.get(i,t);s&&o.push({name:i,component:s})}return o}resolveInOrder(e,t="Global"){return this.ResolveInOrder(e,t)}FlattenComponentSpecs(e){let t=[],r=new Set;return this.collectComponentSpecs(e,t,r),t}flattenComponentSpecs(e){return this.FlattenComponentSpecs(e)}collectComponentSpecs(e,t,r){if(r.has(e.name))return;r.add(e.name),t.push(e);let o=e.dependencies||[];for(let i of o)this.collectComponentSpecs(i,t,r)}};var js=class{static{a(this,"ComponentManager")}constructor(e,t,r,o={}){this.fetchCache=new Map,this.registryNotifications=new Set,this.loadingPromises=new Map,this.componentEngine=Tn.Instance,this.graphQLClient=null,this.compiler=e,this.registry=t,this.runtimeContext=r,this.config={debug:!1,maxCacheSize:100,cacheTTL:36e5,enableUsageTracking:!0,dependencyBatchSize:5,fetchTimeout:3e4,...o},this.log("ComponentManager initialized",{debug:this.config.debug,cacheTTL:this.config.cacheTTL,usageTracking:this.config.enableUsageTracking})}async LoadComponent(e,t={}){let r=Date.now(),o=this.getComponentKey(e,t);this.log(`Loading component: ${e.name}`,{key:o,location:e.location,registry:e.registry,forceRefresh:t.forceRefresh});let i=this.loadingPromises.get(o);if(i&&!t.forceRefresh){let l=e.namespace||t.defaultNamespace||"Global",c=e.version||t.defaultVersion||"latest",u=this.calculateHash(e),f=this.registry.get(e.name,l,c,u);return f?(this.log(`Component already registered (circular dep resolution): ${e.name}`),{success:!0,component:f,spec:e,fromCache:!0}):(this.log(`Component already loading: ${e.name}, waiting...`),i)}let s=this.doLoadComponent(e,t,o,r);this.loadingPromises.set(o,s);try{return await s}finally{this.loadingPromises.delete(o)}}async loadComponent(e,t={}){return this.LoadComponent(e,t)}async doLoadComponent(e,t,r,o){let i=[];try{let s=e.namespace||t.defaultNamespace||"Global",l=e.version||t.defaultVersion||"latest",c=this.calculateHash(e),u=this.registry.get(e.name,s,l,c);if(u&&!t.forceRefresh&&!t.forceRecompile){this.log(`Component found in registry: ${e.name}`),t.trackUsage!==!1&&await this.notifyRegistryUsageIfNeeded(e,r);let y=this.fetchCache.get(r);return{success:!0,component:u,spec:y?.spec||e,fromCache:!0}}let f=e;if(this.needsFetch(e)){this.log(`Fetching component spec: ${e.name}`);try{f=await this.fetchComponentSpec(e,t.contextUser,{resolutionMode:t.resolutionMode}),this.fetchCache.set(r,{spec:f,fetchedAt:new Date,hash:this.calculateHash(f),usageNotified:!1})}catch(y){throw i.push({message:`Failed to fetch component: ${y instanceof Error?y.message:String(y)}`,phase:"fetch",componentName:e.name}),y}}else e.location==="registry"&&e.code&&this.log(`Skipping fetch for registry component: ${e.name} (code already provided)`,{location:e.location,registry:e.registry}),e.code&&!this.fetchCache.has(r)&&this.fetchCache.set(r,{spec:f,fetchedAt:new Date,hash:this.calculateHash(f),usageNotified:!1});t.trackUsage!==!1&&await this.notifyRegistryUsageIfNeeded(f,r);let p=u;if(!p||t.forceRecompile){this.log(`Compiling component: ${e.name}`);try{p=await this.compileComponent(f,t)}catch(y){throw i.push({message:`Failed to compile component: ${y instanceof Error?y.message:String(y)}`,phase:"compile",componentName:e.name}),y}}(!u||t.forceRefresh||t.forceRecompile)&&(this.log(`Registering component: ${e.name}`),this.registry.register(f.name,p,s,l,c));let m={};if(f.dependencies&&f.dependencies.length>0){this.log(`Loading ${f.dependencies.length} dependencies for ${e.name}`);let y=await this.loadDependenciesBatched(f.dependencies,{...t,isDependent:!0});for(let C of y)if(C.success&&C.component){let v=f.dependencies.find(S=>S.name===(C.spec?.name||""));v&&(m[v.name]=C.component)}else C.errors&&i.push(...C.errors)}let g=Date.now()-o;return this.log(`Component loaded successfully: ${e.name} (${g}ms)`,{fromCache:!1,dependencyCount:Object.keys(m).length}),{success:i.length===0,component:p,spec:f,fromCache:!1,dependencies:m,errors:i.length>0?i:void 0}}catch(s){let l=Date.now()-o;return this.log(`Failed to load component: ${e.name} (${l}ms)`,s),{success:!1,fromCache:!1,errors:i.length>0?i:[{message:s instanceof Error?s.message:String(s),phase:"fetch",componentName:e.name}]}}}async LoadHierarchy(e,t={}){let r=Date.now(),o=[],i=[],s={},l={fromCache:0,fetched:0,compiled:0,totalTime:0};this.log(`Loading component hierarchy: ${e.name}`,{location:e.location,registry:e.registry});try{this.componentEngine&&typeof this.componentEngine.Config=="function"&&await this.componentEngine.Config(!1,t.contextUser);let c=await this.loadComponentRecursive(e,t,o,i,s,l,new Set);l.totalTime=Date.now()-r,this.log(`Hierarchy loaded: ${e.name}`,{success:i.length===0,loadedCount:o.length,errors:i.length,...l});let u={};for(let[f,p]of Object.entries(s))p&&typeof p=="object"&&"component"in p?u[f]=p.component:u[f]=p;return{success:i.length===0,rootComponent:c.component,resolvedSpec:c.spec,loadedComponents:o,errors:i,components:u,stats:l}}catch(c){return l.totalTime=Date.now()-r,this.log(`Failed to load hierarchy: ${e.name}`,c),{success:!1,loadedComponents:o,errors:[...i,{message:c instanceof Error?c.message:String(c),phase:"fetch",componentName:e.name}],stats:l}}}async loadHierarchy(e,t={}){return this.LoadHierarchy(e,t)}async loadComponentRecursive(e,t,r,o,i,s,l){let c=this.getComponentKey(e,t);if(l.has(c))return this.log(`Circular dependency detected: ${e.name}`),{success:!0,component:i[e.name],spec:e,fromCache:!0};l.add(c);let u=await this.LoadComponent(e,t);if(u.success&&u.component){r.push(e.name),i[e.name]=u.component,s&&(u.fromCache?s.fromCache++:(s.fetched++,s.compiled++));let f=this.resolveDependencies(e.dependencies,u.spec?.dependencies);if(f)for(let p of f){let m={...p};m.code&&this.log(`Dependency ${m.name} already has code (from registry population), optimizing load`),m.location==="registry"&&!m.registry&&(m.registry=void 0,this.log(`Dependency ${m.name} is a local registry component (registry=undefined)`)),await this.loadComponentRecursive(m,{...t,isDependent:!0},r,o,i,s,l)}}else u.errors&&o.push(...u.errors);return u}async loadDependenciesBatched(e,t){let r=this.config.dependencyBatchSize||5,o=[];for(let i=0;i<e.length;i+=r){let l=e.slice(i,i+r).map(u=>this.LoadComponent(u,t)),c=await Promise.all(l);o.push(...c)}return o}resolveDependencies(e,t){let r=e&&e.length>0;return r&&e.some(i=>!!i.code)?e:r?t?.some(i=>!!i.code)?t:e:t||e}needsFetch(e){return e.location==="registry"&&!e.code}async fetchComponentSpec(e,t,r){let o=this.getComponentKey(e,{}),i=this.fetchCache.get(o);if(i&&this.isCacheValid(i))return this.log(`Using cached spec for: ${e.name}`),i.spec;if(!e.registry){let f=await this.componentEngine.FindComponent(e.name,e.namespace);if(!f)throw new Error(`Local component not found: ${e.name}`);if(!f.Specification)throw new Error(`Local component ${e.name} has no specification`);let p=JSON.parse(f.Specification);return this.fetchCache.set(o,{spec:p,fetchedAt:new Date,usageNotified:!1}),p}if(this.graphQLClient||await this.initializeGraphQLClient(),!this.graphQLClient)throw new Error("GraphQL client not available for registry fetching");this.log(`Fetching from external registry: ${e.registry}/${e.name}`);let s=i?.hash,l=await this.graphQLClient.GetRegistryComponentWithHash({registryName:e.registry,namespace:e.namespace||"Global",name:e.name,version:e.version||"latest",hash:s});if(l.notModified&&i)return this.log(`Registry returned 304 for ${e.name}, reusing cached spec`),this.fetchCache.set(o,{...i,fetchedAt:new Date}),i.spec;if(!l.specification)throw new Error(`Component not found in registry: ${e.registry}/${e.name}`);let c=l.specification,u=this.applyResolutionMode(c,e,r?.resolutionMode);return this.fetchCache.set(o,{spec:u,fetchedAt:new Date,hash:l.hash,usageNotified:!1}),u}applyResolutionMode(e,t,r){let o;return r==="embed"?o={...e,location:"embedded",registry:void 0}:o={...e,location:t.location,registry:t.registry,namespace:t.namespace||e.namespace,name:t.name||e.name},o.dependencies&&o.dependencies.length>0&&(o.dependencies=o.dependencies.map(i=>this.applyResolutionMode(i,i,r))),o}async compileComponent(e,t){let r=t.allLibraries||this.componentEngine.ComponentLibraries||[],o=e.libraries?.filter(l=>l&&l.name&&l.globalVariable&&l.name!=="unknown"&&l.globalVariable!=="undefined"),i=await this.compiler.compile({componentName:e.name,componentCode:e.code||"",libraries:o,dependencies:e.dependencies,allLibraries:r});if(!i.success||!i.component)throw new Error(i.error?.message||"Compilation failed");return i.loadedLibraries&&i.loadedLibraries.size>0&&(this.runtimeContext.libraries||(this.runtimeContext.libraries={}),i.loadedLibraries.forEach((l,c)=>{this.runtimeContext.libraries[c]=l})),i.component.factory(this.runtimeContext,void 0,{})}async notifyRegistryUsageIfNeeded(e,t){if(!e.registry||!this.config.enableUsageTracking)return;let r=`${e.registry}:${t}`;if(this.registryNotifications.has(r)){this.log(`Usage already notified for: ${e.name}`);return}try{this.log(`Notifying registry usage for: ${e.name}`),this.registryNotifications.add(r);let o=this.fetchCache.get(t);o&&(o.usageNotified=!0)}catch(o){console.warn(`Failed to notify registry usage for ${t}:`,o)}}async initializeGraphQLClient(){try{let e=Be?.Provider;if(e&&e.ExecuteGQL){let{GraphQLComponentRegistryClient:t}=await import("./dist-6QB6LKFP.js");this.graphQLClient=new t(e),this.log("GraphQL client initialized")}}catch(e){B(`Failed to initialize GraphQL client: ${e instanceof Error?e.message:String(e)}`)}}isCacheValid(e){return Date.now()-e.fetchedAt.getTime()<(this.config.cacheTTL||36e5)}calculateHash(e){let t=JSON.stringify({name:e.name,version:e.version,code:e.code,libraries:e.libraries}),r=0;for(let o=0;o<t.length;o++){let i=t.charCodeAt(o);r=(r<<5)-r+i,r=r&r}return r.toString(16)}getComponentKey(e,t){let r=e.registry||"local",o=e.namespace||t.defaultNamespace||"Global",i=e.version||t.defaultVersion||"latest",s=this.calculateHash(e);return`${r}:${o}:${e.name}:${i}#${s}`}ClearCache(){this.fetchCache.clear(),this.registryNotifications.clear(),this.loadingPromises.clear(),this.log("All caches cleared")}clearCache(){return this.ClearCache()}GetCacheStats(){return{fetchCacheSize:this.fetchCache.size,notificationsCount:this.registryNotifications.size,loadingCount:this.loadingPromises.size}}getCacheStats(){return this.GetCacheStats()}log(e,t){this.config.debug&&console.log(`\u{1F3AF} [ComponentManager] ${e}`,t||"")}};function lF(n,e={}){let{onError:t,fallback:r,logErrors:o=!0,recovery:i="none"}=e;return class extends n.Component{static{a(this,"ErrorBoundary")}get state(){return this.State}set state(l){this.State=l}constructor(l){super(l),this.HandleRetry=()=>{this.setState(c=>({hasError:!1,error:null,errorInfo:null,retryCount:c.retryCount+1}))},this.HandleReset=()=>{this.setState({hasError:!1,error:null,errorInfo:null,retryCount:0})},this.State={hasError:!1,error:null,errorInfo:null,retryCount:0}}static getDerivedStateFromError(l){return{hasError:!0,error:l}}componentDidCatch(l,c){if(o&&(console.error("React Error Boundary caught error:",l),console.error("Error Info:",c)),t)try{t(l,c)}catch(u){console.error("Error in custom error handler:",u)}this.setState({errorInfo:c})}get handleRetry(){return this.HandleRetry}set handleRetry(l){this.HandleRetry=l}get handleReset(){return this.HandleReset}set handleReset(l){this.HandleReset=l}render(){if(this.State.hasError){if(r)return typeof r=="function"?r({error:this.State.error,errorInfo:this.State.errorInfo,retry:this.HandleRetry,reset:this.HandleReset,retryCount:this.State.retryCount}):r;let l=i==="retry"&&this.State.retryCount<3,c=i==="reset";return n.createElement("div",{style:{padding:"20px",backgroundColor:"#f8f8f8",border:"1px solid #ddd",borderRadius:"4px",margin:"10px"}},n.createElement("h2",{style:{color:"#d32f2f"}},"Component Error"),n.createElement("p",{style:{color:"#666"}},"An error occurred while rendering this component."),this.State.error&&n.createElement("details",{style:{marginTop:"10px"}},n.createElement("summary",{style:{cursor:"pointer",color:"#333"}},"Error Details"),n.createElement("pre",{style:{backgroundColor:"#f0f0f0",padding:"10px",marginTop:"10px",overflow:"auto",fontSize:"12px"}},this.State.error.toString(),`
|
|
351
351
|
|
|
352
|
-
`,this.State.error.stack)),(l||c)&&n.createElement("div",{style:{marginTop:"10px"}},l&&n.createElement("button",{onClick:this.HandleRetry,style:{padding:"8px 16px",marginRight:"10px",backgroundColor:"#1976d2",color:"white",border:"none",borderRadius:"4px",cursor:"pointer"}},`Retry (${3-this.State.retryCount} attempts left)`),c&&n.createElement("button",{onClick:this.HandleReset,style:{padding:"8px 16px",backgroundColor:"#757575",color:"white",border:"none",borderRadius:"4px",cursor:"pointer"}},"Reset Component")))}return this.props.children}}}a(lF,"CreateErrorBoundary");function bh(n,e={}){return lF(n,e)}a(bh,"createErrorBoundary");var Ys=class{static{a(this,"ComponentHierarchyRegistrar")}constructor(e,t,r){this.compiler=e,this.registry=t,this.runtimeContext=r}async fetchExternalComponent(e,t){try{let r=Be?.Provider;if(!r||!r.ExecuteGQL)return console.warn("\u26A0\uFE0F [ComponentHierarchyRegistrar] No GraphQL provider available for external registry fetch"),null;let{GraphQLComponentRegistryClient:o}=await import("./dist-4BLL2YRV.js"),s=await new o(r).GetRegistryComponent({registryName:e.registry,namespace:e.namespace||"Global",name:e.name,version:e.version||"latest"});return s&&s.code?(_n()||yt(`\u2705 [ComponentHierarchyRegistrar] Fetched external component ${e.name} with code (${s.code.length} chars)`),s):(console.warn(`\u26A0\uFE0F [ComponentHierarchyRegistrar] Failed to fetch external component ${e.name} or no code`),null)}catch(r){return console.error(`\u274C [ComponentHierarchyRegistrar] Error fetching external component ${e.name}:`,r),null}}async RegisterHierarchy(e,t){let r=e;e.location==="registry"&&e.registry&&!e.code&&(_n()||yt(`\u{1F310} [ComponentHierarchyRegistrar] Fetching external registry component: ${e.registry}/${e.name}`),r=await this.fetchExternalComponent(e,t.contextUser)||e);let{styles:o,namespace:i="Global",version:s="v1",continueOnError:l=!0,allowOverride:c=!0}=t,u=[],f=[],p=[];_n()||yt("\u{1F333} ComponentHierarchyRegistrar.registerHierarchy:",void 0,{rootComponent:r.name,hasLibraries:!!(r.libraries&&r.libraries.length>0),libraryCount:r.libraries?.length||0});let m=new Map,g=new Map,y=new Map,C=a(async E=>{if(!E.code)return{success:!0};try{let I=E.libraries?.filter(w=>!(!w||typeof w!="object"||!w.name||w.name==="unknown"||w.name==="null"||w.name==="undefined"||!w.globalVariable||w.globalVariable==="undefined"||w.globalVariable==="null")),_={componentName:E.name,componentCode:E.code,styles:o,libraries:I,dependencies:E.dependencies,allLibraries:t.allLibraries},T=await this.compiler.compile(_);return T.success&&T.component?(m.set(E.name,T.component),g.set(E.name,E),T.loadedLibraries&&T.loadedLibraries.forEach((w,R)=>{y.has(R)||(y.set(R,w),_n()||yt(`\u{1F4DA} [registerHierarchy] Added library ${R} to accumulated libraries`))}),{success:!0}):{success:!1,error:{componentName:E.name,error:T.error?.message||"Unknown compilation error",phase:"compilation"}}}catch(I){return{success:!1,error:{componentName:E.name,error:I instanceof Error?I.message:String(I),phase:"compilation"}}}},"compileOnly"),v=[r],S=new Set;for(;v.length>0;){let E=v.shift();if(S.has(E.name))continue;if(S.add(E.name),E.location==="registry"&&E.registry&&!E.code){let _=await this.fetchExternalComponent(E,t.contextUser);if(_)E=_;else{console.warn(`\u26A0\uFE0F [ComponentHierarchyRegistrar] Could not fetch external component ${E.name}, skipping`);continue}}let I=await C(E);if(!I.success&&(f.push(I.error),!l))return{success:!1,registeredComponents:u,errors:f,warnings:p,resolvedSpec:r};E.dependencies&&v.push(...E.dependencies)}y.size>0&&(this.runtimeContext.libraries||(this.runtimeContext.libraries={}),y.forEach((E,I)=>{this.runtimeContext.libraries[I]=E,_n()||yt(`\u2705 [registerHierarchy] Added ${I} to runtime context libraries`)}));for(let[E,I]of m){let _=g.get(E),T={};for(let[R,O]of m){let M=O.factory(this.runtimeContext,o);T[R]=M.component}let w=I.factory(this.runtimeContext,o,T);this.registry.register(_.name,w,_.namespace||i,s),u.push(_.name)}return{success:f.length===0,registeredComponents:u,errors:f,warnings:p,resolvedSpec:r}}async registerHierarchy(e,t){return this.RegisterHierarchy(e,t)}async RegisterSingleComponent(e,t){let{styles:r,namespace:o="Global",version:i="v1",allowOverride:s=!0}=t;try{if(!e.code)return{success:!0,error:void 0};if(this.registry.get(e.name,o,i)&&!s)return{success:!1,error:{componentName:e.name,error:`Component already registered in ${o}/${i}`,phase:"registration"}};let c=e.libraries?.filter(m=>!(!m||typeof m!="object"||!m.name||m.name==="unknown"||m.name==="null"||m.name==="undefined"||!m.globalVariable||m.globalVariable==="undefined"||m.globalVariable==="null"));_n()||yt(`\u{1F527} Compiling component ${e.name} with libraries:`,void 0,{originalCount:e.libraries?.length||0,filteredCount:c?.length||0,libraries:c?.map(m=>m.name)||[]});let u={componentName:e.name,componentCode:e.code,styles:r,libraries:c,dependencies:e.dependencies,allLibraries:t.allLibraries},f=await this.compiler.compile(u);if(!f.success)return{success:!1,error:{componentName:e.name,error:f.error?.message||"Unknown compilation error",phase:"compilation"}};f.loadedLibraries&&f.loadedLibraries.size>0&&(this.runtimeContext.libraries||(this.runtimeContext.libraries={}),f.loadedLibraries.forEach((m,g)=>{this.runtimeContext.libraries[g]=m,_n()||yt(`\u2705 [registerSingleComponent] Added ${g} to runtime context libraries`)})),_n()||yt(`\u{1F3ED} Calling factory for ${e.name} with runtime context:`,void 0,{hasReact:!!this.runtimeContext.React,hasReactDOM:!!this.runtimeContext.ReactDOM,libraryCount:Object.keys(this.runtimeContext.libraries||{}).length});let p=f.component.factory(this.runtimeContext,r);return this.registry.register(e.name,p,e.namespace||o,i),{success:!0}}catch(l){return{success:!1,error:{componentName:e.name,error:l instanceof Error?l.message:String(l),phase:"registration"}}}}async registerSingleComponent(e,t){return this.RegisterSingleComponent(e,t)}async registerChildComponents(e,t,r,o,i){for(let s of e){let l=await this.RegisterSingleComponent(s,{styles:t.styles,namespace:t.namespace,version:t.version,allowOverride:t.allowOverride,allLibraries:t.allLibraries});if(l.success)s.code&&r.push(s.name);else if(o.push(l.error),!t.continueOnError)return;let c=s.dependencies||[];c.length>0&&await this.registerChildComponents(c,t,r,o,i)}}};var ac=class{static{a(this,"ReactRootManager")}constructor(){this.roots=new Map,this.renderingRoots=new Set,this.unmountQueue=new Map,this.hooks=[],this.firstRootCreated=!1}RegisterHook(e){this.hooks.push(e)}RemoveHook(e){let t=this.hooks.findIndex(r=>r.name===e);return t>=0?(this.hooks.splice(t,1),!0):!1}CreateRoot(e,t,r){let o=`react-root-${Date.now()}-${Math.random()}`,i=t(e),s={id:o,root:i,container:e,isRendering:!1,componentId:r};this.roots.set(o,s),r&&Xe.registerReactRoot(r,i,()=>this.UnmountRoot(o));let l={rootId:o,container:e,componentId:r};return this.firstRootCreated||(this.firstRootCreated=!0,this.invokeHooks("OnFirstRootCreated",l)),this.invokeHooks("OnRootCreated",l),o}createRoot(e,t,r){return this.CreateRoot(e,t,r)}render(e,t,r){let o=this.roots.get(e);if(!o){console.warn(`React root ${e} not found`);return}if(this.unmountQueue.has(e)){console.warn(`React root ${e} is being unmounted, skipping render`);return}o.isRendering=!0,this.renderingRoots.add(e);try{o.root.render(t),o.lastRenderTime=new Date,Promise.resolve().then(()=>{o.isRendering=!1,this.renderingRoots.delete(e);let i=this.unmountQueue.get(e);i&&(this.unmountQueue.delete(e),i()),r&&r()})}catch(i){throw o.isRendering=!1,this.renderingRoots.delete(e),i}}UnmountRoot(e,t=!1){return new Promise(r=>{let o=this.roots.get(e);if(!o){r();return}let i=a(()=>{try{o.root.unmount(),this.roots.delete(e),this.renderingRoots.delete(e),o.container&&(delete o.container._reactRootContainer,o.container.innerHTML=""),this.invokeHooks("OnRootUnmounted",e),r()}catch(s){console.error(`Error unmounting React root ${e}:`,s),this.roots.delete(e),this.renderingRoots.delete(e),r()}},"performUnmount");!o.isRendering||t?i():this.unmountQueue.set(e,()=>{i()})})}unmountRoot(e,t=!1){return this.UnmountRoot(e,t)}async UnmountComponentRoots(e){let t=[];for(let[r,o]of this.roots)o.componentId===e&&t.push(r);await Promise.all(t.map(r=>this.UnmountRoot(r)))}async unmountComponentRoots(e){return this.UnmountComponentRoots(e)}IsRendering(e){return this.renderingRoots.has(e)}isRendering(e){return this.IsRendering(e)}GetStats(){return{totalRoots:this.roots.size,renderingRoots:this.renderingRoots.size,pendingUnmounts:this.unmountQueue.size}}getStats(){return this.GetStats()}async Cleanup(){this.invokeHooks("OnCleanup");let e=Array.from(this.roots.keys());await Promise.all(e.map(t=>this.UnmountRoot(t,!0))),this.firstRootCreated=!1}async cleanup(){return this.Cleanup()}invokeHooks(e,t){for(let r of this.hooks){let o=r[e];if(typeof o=="function")try{o.call(r,t)}catch(i){console.error(`Error in runtime hook "${r.name}" during ${e}:`,i)}}}},Wn=new ac;function cF(){return{colors:{primary:"#5B4FE9",primaryHover:"#4940D4",primaryActive:"#3E37B8",primaryLight:"#E8E6FF",secondary:"#64748B",secondaryHover:"#475569",success:"#10B981",successLight:"#D1FAE5",successText:"#047857",successBorder:"#b7eb8f",warning:"#F59E0B",warningLight:"#FEF3C7",warningText:"#8c6c00",warningBorder:"#ffe58f",error:"#EF4444",errorLight:"#FEE2E2",errorText:"#B91C1C",errorBorder:"#FECACA",info:"#3B82F6",infoLight:"#DBEAFE",infoText:"#1D4ED8",infoBorder:"#91d5ff",background:"#FFFFFF",surface:"#F8FAFC",surfaceHover:"#F1F5F9",overlay:"rgba(0, 0, 0, 0.5)",text:"#1E293B",textSecondary:"#64748B",textTertiary:"#94A3B8",textInverse:"#FFFFFF",link:"#5B4FE9",linkHover:"#4940D4",border:"#E2E8F0",borderLight:"#F1F5F9",borderFocus:"#5B4FE9",shadow:"rgba(0, 0, 0, 0.05)",shadowMedium:"rgba(0, 0, 0, 0.1)",shadowLarge:"rgba(0, 0, 0, 0.15)"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px",xxl:"48px",xxxl:"64px"},typography:{fontFamily:'-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif',fontSize:{xs:"11px",sm:"12px",md:"14px",lg:"16px",xl:"20px",xxl:"24px",xxxl:"32px"},fontWeight:{light:"300",regular:"400",medium:"500",semibold:"600",bold:"700"},lineHeight:{tight:"1.25",normal:"1.5",relaxed:"1.75"}},borders:{radius:{sm:"6px",md:"8px",lg:"12px",xl:"16px",full:"9999px"},width:{thin:"1px",medium:"2px",thick:"3px"}},shadows:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",inner:"inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)"},transitions:{fast:"150ms ease-in-out",normal:"250ms ease-in-out",slow:"350ms ease-in-out"},overflow:"auto",chartPalette:["#2196F3","#4CAF50","#FF9800","#E91E63","#9C27B0","#00BCD4","#F44336","#8BC34A","#FF5722","#3F51B5"],sequentialScale:["#E3F2FD","#BBDEFB","#90CAF9","#42A5F5","#2196F3","#1976D2","#0D47A1"],divergingScale:{low:"#F44336",mid:"#EEEEEE",high:"#4CAF50"}}}a(cF,"SetupStyles");var hX={primary:"--mj-brand-primary",primaryHover:"--mj-brand-primary-hover",primaryActive:"--mj-brand-primary-active",primaryLight:"--mj-brand-primary-light",secondary:"--mj-brand-secondary",secondaryHover:"--mj-brand-secondary-hover",success:"--mj-status-success",successLight:"--mj-status-success-bg",successText:"--mj-status-success-text",successBorder:"--mj-status-success-border",warning:"--mj-status-warning",warningLight:"--mj-status-warning-bg",warningText:"--mj-status-warning-text",warningBorder:"--mj-status-warning-border",error:"--mj-status-error",errorLight:"--mj-status-error-bg",errorText:"--mj-status-error-text",errorBorder:"--mj-status-error-border",info:"--mj-status-info",infoLight:"--mj-status-info-bg",infoText:"--mj-status-info-text",infoBorder:"--mj-status-info-border",background:"--mj-bg-page",surface:"--mj-bg-surface",surfaceHover:"--mj-bg-surface-hover",overlay:"--mj-bg-overlay",text:"--mj-text-primary",textSecondary:"--mj-text-secondary",textTertiary:"--mj-text-muted",textInverse:"--mj-text-inverse",link:"--mj-text-link",linkHover:"--mj-text-link-hover",border:"--mj-border-default",borderLight:"--mj-border-subtle",borderFocus:"--mj-border-focus"},pX=10,mX=7;function gX(n){if(typeof n=="function")return r=>(n(r)??"").trim();let e=n??(typeof document<"u"?document.documentElement:void 0);if(!e||typeof getComputedStyle>"u")return null;let t=getComputedStyle(e);return r=>t.getPropertyValue(r).trim()}a(gX,"resolveTokenReader");function lc(n){let e=cF(),t=gX(n);if(!t)return e;for(let[l,c]of Object.entries(hX)){let u=t(c);u&&(e.colors[l]=u)}let r=[];for(let l=1;l<=pX;l++){let c=t(`--mj-viz-${l}`);c&&r.push(c)}r.length>0&&(e.chartPalette=r);let o=[];for(let l=1;l<=mX;l++){let c=t(`--mj-viz-seq-${l}`);c&&o.push(c)}o.length>1&&(e.sequentialScale=o);let i=t("--mj-viz-div-low"),s=t("--mj-viz-div-high");if(i&&s){let l=t("--mj-viz-div-mid");e.divergingScale=l?{low:i,mid:l,high:s}:{low:i,high:s}}return e}a(lc,"BuildStylesFromTheme");var yX={small:.875,large:1.25},CX=10;function vX(n,e){let t={};for(let[r,o]of Object.entries(n)){let i=typeof o=="string"?/^\s*(\d+(?:\.\d+)?)px\s*$/.exec(o):null;t[r]=i?`${Math.max(CX,Math.round(parseFloat(i[1])*e))}px`:o}return t}a(vX,"scaleFontSizes");function HE(n,e){if(!e)return n;let t=Array.isArray(e.chartPalette)&&e.chartPalette.length>0,r=Array.isArray(e.sequentialScale)&&e.sequentialScale.length>1,o=!!e.divergingScale?.low&&!!e.divergingScale?.high,i=e.fontScale?yX[e.fontScale]:void 0,s=!!i&&!!n.typography?.fontSize;return!t&&!r&&!o&&!s?n:{...n,...t?{chartPalette:e.chartPalette}:{},...r?{sequentialScale:e.sequentialScale}:{},...o?{divergingScale:e.divergingScale}:{},...s?{typography:{...n.typography,fontSize:vX(n.typography.fontSize,i)}}:{}}}a(HE,"ApplyStyleOverrides");function SX(n){if(!n)return 1;let e=String(n).trim(),t,r,o,i=/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.exec(e);if(i){let s=i[1];s.length===3&&(s=s.split("").map(c=>c+c).join(""));let l=parseInt(s,16);t=l>>16&255,r=l>>8&255,o=l&255}else{let s=/rgba?\(([^)]+)\)/i.exec(e);if(!s)return 1;let l=s[1].split(",").map(c=>parseFloat(c));if(t=l[0],r=l[1],o=l[2],[t,r,o].some(c=>Number.isNaN(c)))return 1}return(.2126*t+.7152*r+.0722*o)/255}a(SX,"colorLuminance");function EX(n){let e=typeof n=="string"?n:n&&(n.md||n.sm||n.lg);if(!e)return;let t=parseInt(String(e),10);return Number.isNaN(t)?void 0:t}a(EX,"radiusToNumber");function uF(n,e){let t=n?.colors||{},r=e?zs(e,"theme"):void 0,o=SX(t.background)<.5,i={colorPrimary:t.primary,colorInfo:t.info||t.primary,colorSuccess:t.success,colorWarning:t.warning,colorError:t.error,colorBgContainer:t.surface,colorBgElevated:t.surface,colorBgLayout:t.background,colorText:t.text,colorTextSecondary:t.textSecondary,colorBorder:t.border,colorBorderSecondary:t.borderLight||t.border,fontFamily:n?.typography?.fontFamily},s=EX(n?.borders?.radius);s!==void 0&&(i.borderRadius=s);for(let u of Object.keys(i))i[u]==null&&delete i[u];let l={token:i},c=r&&(o?r.darkAlgorithm:r.defaultAlgorithm);return c&&(l.algorithm=c),l}a(uF,"BuildAntdThemeConfig");function dF(n,e,t,r){let o=t?.antd;if(!o)return e;let i=zs(o,"ConfigProvider");if(!i)return e;try{return n.createElement(i,{theme:uF(r,o)},e)}catch{return e}}a(dF,"WrapWithLibraryThemeProviders");function qE(n,e,t,r){return dF(n,e,t,r)}a(qE,"wrapWithLibraryThemeProviders");function fF(n){let e=[],t=a(s=>{if(s.code&&e.push(s.code),s.dependencies)for(let l of s.dependencies)t(l)},"collectCode");t(n);let r=e.join("|"),o=0;for(let s=0;s<r.length;s++){let l=r.charCodeAt(s);o=(o<<5)-o+l,o=o&o}return`v${Math.abs(o).toString(16).padStart(8,"0").substring(0,8)}`}a(fF,"GenerateComponentHierarchyHash");function zE(n){return fF(n)}a(zE,"generateComponentHierarchyHash");function go(n,e,t){let r=0;for(let o=0;o<t;o++){let i=n[e+o];r+=i*i}return r}a(go,"SumOfSquares");function cc(n,e,t,r,o,i,s){let l=0;for(let c=0;c<s;c++)l+=n[e+c]*r[o+c];return t===0||i===0?0:l/(Math.sqrt(t)*Math.sqrt(i))}a(cc,"CosineFromNorms");function Nh(n,e,t,r,o){let i=0;for(let s=0;s<o;s++){let l=n[e+s]-t[r+s];i+=l*l}return 1/(1+Math.sqrt(i))}a(Nh,"EuclideanScore");function JE(n,e,t,r,o){let i=0;for(let s=0;s<o;s++)i+=Math.abs(n[e+s]-t[r+s]);return 1/(1+i)}a(JE,"ManhattanScore");function jE(n,e,t,r,o){let i=0;for(let l=0;l<o;l++)i+=n[e+l]*t[r+l];return(Math.tanh(i/Math.sqrt(o))+1)/2}a(jE,"DotProductScore");function YE(n,e,t,r,o){let i=0,s=0;for(let l=0;l<o;l++){let c=n[e+l]!==0,u=t[r+l]!==0;c&&u&&i++,(c||u)&&s++}return s===0?1:i/s}a(YE,"JaccardScore");function XE(n,e,t,r,o){let i=0;for(let s=0;s<o;s++)n[e+s]!==t[r+s]&&i++;return 1-i/o}a(XE,"HammingScore");function Xs(n,e,t,r,o,i,s,l){switch(n){case"cosine":return(cc(e,t,r,o,i,s,l)+1)/2;case"cosine-similarity":return cc(e,t,r,o,i,s,l);case"euclidean":return Nh(e,t,o,i,l);case"manhattan":return JE(e,t,o,i,l);case"dotproduct":return jE(e,t,o,i,l);case"jaccard":return YE(e,t,o,i,l);case"hamming":return XE(e,t,o,i,l);default:throw new Error(`Unknown distance metric: ${n}`)}}a(Xs,"MetricScore");function QE(n){return n==="cosine"||n==="cosine-similarity"||n==="euclidean"||n==="manhattan"||n==="dotproduct"||n==="jaccard"||n==="hamming"}a(QE,"IsKnownMetric");function uc(n,e){if(!QE(e.Metric))throw new Error(`Unknown distance metric: ${e.Metric}`);let t=e.TopK===null?new KE:new WE(e.TopK);return n.Data instanceof Float32Array?IX(n.Data,n,e,t):_X(n.Data,n,e,t),t.Result()}a(uc,"SearchRows");function IX(n,e,t,r){let o=e.Dims,i=e.Norms,s=e.Live,l=t.Query,c=t.QueryNormSq,u=t.Candidates,f=t.Threshold,p=t.Metric,m=u?0:t.RowStart??0,g=u?u.length:Math.min(t.RowEnd??e.RowCount,e.RowCount);for(let y=m;y<g;y++){let C=u?u[y]:y;if(s[C]!==1)continue;let v=C*o,S;if(p==="cosine"||p==="cosine-similarity"){let E=0;for(let T=0;T<o;T++)E+=l[T]*n[v+T];let I=i[C],_=c===0||I===0?0:E/(Math.sqrt(c)*Math.sqrt(I));S=p==="cosine"?(_+1)/2:_}else if(p==="euclidean"){let E=0;for(let I=0;I<o;I++){let _=l[I]-n[v+I];E+=_*_}S=1/(1+Math.sqrt(E))}else if(p==="dotproduct"){let E=0;for(let I=0;I<o;I++)E+=l[I]*n[v+I];S=(Math.tanh(E/Math.sqrt(o))+1)/2}else S=Xs(p,l,0,c,n,v,i[C],o);S===S&&(f!==null&&!(S>=f)||r.Offer(C,S))}}a(IX,"scanFloat32Rows");function _X(n,e,t,r){let o=e.Dims,i=e.Norms,s=e.Live,l=t.Query,c=t.QueryNormSq,u=t.Candidates,f=t.Threshold,p=t.Metric,m=u?0:t.RowStart??0,g=u?u.length:Math.min(t.RowEnd??e.RowCount,e.RowCount);for(let y=m;y<g;y++){let C=u?u[y]:y;if(s[C]!==1)continue;let v=C*o,S;if(p==="cosine"||p==="cosine-similarity"){let E=0;for(let T=0;T<o;T++)E+=l[T]*n[v+T];let I=i[C],_=c===0||I===0?0:E/(Math.sqrt(c)*Math.sqrt(I));S=p==="cosine"?(_+1)/2:_}else if(p==="euclidean"){let E=0;for(let I=0;I<o;I++){let _=l[I]-n[v+I];E+=_*_}S=1/(1+Math.sqrt(E))}else if(p==="dotproduct"){let E=0;for(let I=0;I<o;I++)E+=l[I]*n[v+I];S=(Math.tanh(E/Math.sqrt(o))+1)/2}else S=Xs(p,l,0,c,n,v,i[C],o);S===S&&(f!==null&&!(S>=f)||r.Offer(C,S))}}a(_X,"scanFloat64Rows");var WE=class{static{a(this,"TopRowsCollector")}constructor(e){this.k=e,this.count=0;let t=Math.max(0,Math.trunc(e));this.rows=new Int32Array(t),this.scores=new Float64Array(t)}Offer(e,t){let r=this.rows.length;if(r===0)return;let o;if(this.count<r)o=this.count++;else if(t>this.scores[r-1])o=r-1;else return;for(;o>0&&this.scores[o-1]<t;)this.scores[o]=this.scores[o-1],this.rows[o]=this.rows[o-1],o--;this.scores[o]=t,this.rows[o]=e}Result(){return{Rows:this.rows.slice(0,this.count),Scores:this.scores.slice(0,this.count)}}},KE=class{static{a(this,"AllRowsCollector")}constructor(){this.rows=[],this.scores=[]}Offer(e,t){this.rows.push(e),this.scores.push(t)}Result(){let e=this.rows.map((o,i)=>i);e.sort((o,i)=>this.scores[i]-this.scores[o]||this.rows[o]-this.rows[i]);let t=new Int32Array(e.length),r=new Float64Array(e.length);for(let o=0;o<e.length;o++)t[o]=this.rows[e[o]],r[o]=this.scores[e[o]];return{Rows:t,Scores:r}}};var hF=16,pF=1.5,TX=64,DX=.25,mF=8192,wX=a(n=>new ArrayBuffer(n),"DEFAULT_ALLOCATOR"),AX=1,dc=class n{static{a(this,"VectorStore")}constructor(e="float64",t){this.readOnly=!1,this.storeID=AX++,this.dims=0,this.capacity=0,this.rowCount=0,this.liveCount=0,this.zeroNormRows=0,this.generation=0,this.version=0,this.norms=new Float64Array(0),this.live=new Uint8Array(0),this.keys=[],this.metadata=[],this.rowByKey=new Map,this.changedRows=[],this.changedVersions=[],this.changeLogFloor=0,this.precision=e,this.allocate=t??wX,this.data=e==="float32"?new Float32Array(0):new Float64Array(0)}static Adopt(e,t,r){let o=new n(t);return o.adoptView(e,r),o}get Precision(){return this.precision}get Dims(){return this.dims}get Size(){return this.liveCount}get RowCount(){return this.rowCount}get ZeroNormRows(){return this.zeroNormRows}get StoreID(){return this.storeID}get Generation(){return this.generation}get Version(){return this.version}get IsShared(){return typeof SharedArrayBuffer<"u"&&this.data.buffer instanceof SharedArrayBuffer}get Keys(){return this.keys}Has(e){return this.rowByKey.has(e)}RowOf(e){return this.rowByKey.get(e)}KeyAt(e){return this.keys[e]??null}MetadataAt(e){return this.metadata[e]}NormAt(e){return this.norms[e]}IsLive(e){return this.live[e]===1}View(){return{Data:this.data,Norms:this.norms,Live:this.live,RowCount:this.rowCount,Dims:this.dims}}Snapshot(){return{...this.View(),StoreID:this.storeID,LiveCount:this.liveCount,Precision:this.precision,Generation:this.generation,Version:this.version}}ChangedRowsSince(e,t){if(t!==this.generation||e<this.changeLogFloor)return null;let r=this.changedVersions.length;for(;r>0&&this.changedVersions[r-1]>e;)r--;return Int32Array.from(this.changedRows.slice(r))}LiveRows(){let e=new Int32Array(this.liveCount),t=0;for(let r=0;r<this.rowCount;r++)this.live[r]===1&&(e[t++]=r);return e}ReadRow(e){let t=e*this.dims;return Array.from(this.data.subarray(t,t+this.dims))}CopyRow(e){let t=e*this.dims;return this.data.slice(t,t+this.dims)}ToStorePrecision(e){return this.precision==="float32"?Float64Array.from(e,Math.fround):Float64Array.from(e)}Reserve(e,t){this.assertWritable(),this.dims===0&&(this.dims=t),this.ensureCapacity(this.rowCount+e)}Write(e,t){this.assertWritable(),this.dims===0&&(this.dims=t.length);let r=this.rowByKey.get(e);return r===void 0?(this.ensureCapacity(this.rowCount+1),r=this.rowCount++,this.keys[r]=e,this.metadata[r]=void 0,this.rowByKey.set(e,r),this.live[r]=1,this.liveCount++):this.norms[r]===0&&this.zeroNormRows--,this.writeValues(r,t),this.version++,this.recordChange(r),r}SetMetadata(e,t){this.assertWritable(),this.metadata[e]=t}Remove(e){this.assertWritable();let t=this.rowByKey.get(e);return t===void 0?!1:(this.rowByKey.delete(e),this.keys[t]=null,this.metadata[t]=void 0,this.live[t]=0,this.norms[t]===0&&this.zeroNormRows--,this.liveCount--,this.version++,this.recordChange(t),this.compactIfWorthwhile(),!0)}Clear(){this.assertWritable(),this.rowCount=0,this.liveCount=0,this.zeroNormRows=0,this.capacity=0,this.data=this.precision==="float32"?new Float32Array(0):new Float64Array(0),this.norms=new Float64Array(0),this.live=new Uint8Array(0),this.keys=[],this.metadata=[],this.rowByKey=new Map,this.generation++,this.version++,this.resetChangeLog()}recordChange(e){if(this.changedRows.push(e),this.changedVersions.push(this.version),this.changedRows.length>mF){let t=this.changedRows.length-mF/2;this.changeLogFloor=this.changedVersions[t-1],this.changedRows.splice(0,t),this.changedVersions.splice(0,t)}}resetChangeLog(){this.changedRows=[],this.changedVersions=[],this.changeLogFloor=this.version}writeValues(e,t){let r=e*this.dims;for(let i=0;i<this.dims;i++)this.data[r+i]=t[i];let o=go(this.data,r,this.dims);this.norms[e]=o,o===0&&this.zeroNormRows++}ensureCapacity(e){if(e<=this.capacity)return;let t=Math.max(e,Math.ceil(this.capacity*pF),hF);this.reallocate(t,this.rowCount)}reallocate(e,t){let r=this.allocateData(e*this.dims),o=new Float64Array(this.allocate(e*Float64Array.BYTES_PER_ELEMENT)),i=new Uint8Array(this.allocate(e));r.set(this.data.subarray(0,t*this.dims)),o.set(this.norms.subarray(0,t)),i.set(this.live.subarray(0,t)),this.data=r,this.norms=o,this.live=i,this.capacity=e,this.version++}allocateData(e){let t=this.precision==="float32"?Float32Array.BYTES_PER_ELEMENT:Float64Array.BYTES_PER_ELEMENT,r=this.allocate(e*t);return this.precision==="float32"?new Float32Array(r):new Float64Array(r)}compactIfWorthwhile(){let e=this.rowCount-this.liveCount;e<TX||e<this.rowCount*DX||this.compact()}compact(){let e=this.LiveRows(),t=Math.max(hF,Math.ceil(e.length*pF)),r=this.allocateData(t*this.dims),o=new Float64Array(this.allocate(t*Float64Array.BYTES_PER_ELEMENT)),i=new Uint8Array(this.allocate(t)),s=new Array(e.length),l=new Array(e.length),c=new Map;for(let u=0;u<e.length;u++){let f=e[u];r.set(this.data.subarray(f*this.dims,(f+1)*this.dims),u*this.dims),o[u]=this.norms[f],i[u]=1;let p=this.keys[f];s[u]=p,l[u]=this.metadata[f],c.set(p,u)}this.data=r,this.norms=o,this.live=i,this.keys=s,this.metadata=l,this.rowByKey=c,this.capacity=t,this.rowCount=e.length,this.generation++,this.version++,this.resetChangeLog()}adoptView(e,t){this.data=e.Data,this.norms=e.Norms,this.live=e.Live,this.dims=e.Dims,this.rowCount=e.RowCount,this.capacity=e.RowCount,this.keys=new Array(e.RowCount).fill(null),this.metadata=new Array(e.RowCount).fill(void 0);let r=t??this.liveRowsOfView(e);for(let o=0;o<r.length;o++){let i=r[o];if(e.Live[i]!==1)continue;let s=String(i);this.keys[i]=s,this.rowByKey.set(s,i),this.liveCount++,e.Norms[i]===0&&this.zeroNormRows++}t&&(this.live=this.maskLive(e,r)),this.readOnly=!0}liveRowsOfView(e){let t=[];for(let r=0;r<e.RowCount;r++)e.Live[r]===1&&t.push(r);return Int32Array.from(t)}maskLive(e,t){let r=new Uint8Array(e.RowCount);for(let o=0;o<t.length;o++)e.Live[t[o]]===1&&(r[t[o]]=1);return r}assertWritable(){if(this.readOnly)throw new Error("This vector store is a read-only view and cannot be modified")}};var RX=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},ZE="Default",Tr=class{static{a(this,"BaseVectorAccelerator")}AllocateBuffer(e){return new ArrayBuffer(e)}TrySearchSync(e){return null}SearchAsync(e){return Promise.resolve(uc(e.Snapshot,e))}ClusterAsync(e){return Promise.resolve(null)}};Tr=RX([Z(Tr,ZE)],Tr);var Ph=class extends Ar{static{a(this,"VectorAcceleratorResolver")}constructor(){super(),this.current=null,this.currentClass=null}static get Instance(){return super.getInstance()}get Current(){let e=dt.Instance.ClassFactory,r=e.GetRegistration(Tr,ZE)?.SubClass??Tr;return(!this.current||this.currentClass!==r)&&(this.current=e.CreateInstance(Tr,ZE)??new Tr,this.currentClass=r),this.current}};var Dr=class n{static{a(this,"SimpleVectorService")}constructor(e){this.expectedDimensions=null,this.explicitAccelerator=e?.Accelerator,this.store=new dc(e?.Precision??"float64",t=>this.accelerator.AllocateBuffer(t))}static FromRowsView(e,t,r){let o=new n({Precision:t,Accelerator:new Tr});return o.store=dc.Adopt(e,t,r),o.expectedDimensions=e.Dims>0?e.Dims:null,o}static RunClusterJob(e){let t=n.FromRowsView(e.Snapshot,e.Snapshot.Precision,e.Candidates),r=e.Algorithm==="kmeans"?t.KMeansCluster(e.K??1,e.MaxIterations??100,e.Metric,e.Tolerance??1e-4):t.DBSCANCluster(e.Epsilon??.1,e.MinPoints??1,e.Metric);return n.clusterResultToRows(r)}get StoreID(){return this.store.StoreID}get Precision(){return this.store.Precision}ReserveCapacity(e,t){e<=0||t<=0||(this.validateAndSetDimensionCount(t),this.store.Reserve(e,t))}LoadVectors(e){if(!e)throw new Error("Entries cannot be null or undefined");let t=e instanceof Map?e.size:e.length,r=e instanceof Map?e.values().next().value:e[0]?.vector;t>0&&r&&(this.validateAndSetDimensions(r),this.store.Reserve(t,r.length)),e instanceof Map?e.forEach((o,i)=>{this.validateAndSetDimensions(o),this.store.SetMetadata(this.store.Write(i,o),void 0)}):e.forEach(o=>{this.validateAndSetDimensions(o.vector),this.store.SetMetadata(this.store.Write(o.key,o.vector),o.metadata)})}AddVector(e,t,r){if(!e)throw new Error("Key cannot be null or undefined");if(!t||t.length===0)throw new Error("Vector cannot be null, undefined, or empty");this.validateAndSetDimensions(t),this.store.SetMetadata(this.store.Write(e,t),r)}FindNearest(e,t=10,r,o="cosine",i){let s=this.planSearch(e,t,r,o,i);if(!s)return[];if(s.Mode==="custom")return this.searchWithCustomMetric(s);let l=this.accelerator.TrySearchSync(s.Job);return l?this.finalizeSearch(s,l,!0):this.finalizeSearch(s,uc(s.Job.Snapshot,s.Job),!1)}async FindNearestAsync(e,t=10,r,o="cosine",i){let s=this.planSearch(e,t,r,o,i);if(!s)return[];if(s.Mode==="custom")return this.searchWithCustomMetric(s);let l=await this.accelerator.SearchAsync(s.Job);return this.finalizeSearch(s,l,!0)}planSearch(e,t,r,o,i){if(!e||e.length===0)throw new Error("Query vector cannot be null, undefined, or empty");let s=i?this.filterRows(i):null,l=s?s.length:this.store.Size;if(l===0)return null;let c=this.usesCustomMetric;if(!c&&!QE(o))return B(`Error calculating ${o} similarity: Unknown distance metric: ${o}`),null;if(!c&&this.store.Dims!==e.length)return B(`Error calculating ${o} similarity: Vectors must have same dimensions. Got ${e.length} and ${this.store.Dims}`),null;let u=Math.trunc(t),f=u>=1&&u<l;return{Mode:c?"custom":"kernel",QueryVector:e,TopK:t,Metric:o,Threshold:r??null,Filter:i,KeysAtDispatch:this.store.Keys,VersionAtDispatch:this.store.Version,Job:this.buildSearchJob(e,f?u:null,r,o,s)}}buildSearchJob(e,t,r,o,i){let s=this.store.ToStorePrecision(e);return{...{Query:s,QueryNormSq:go(s,0,s.length),Candidates:i,Metric:o,TopK:t,Threshold:r??null},Snapshot:this.store.Snapshot(),Source:this.store}}filterRows(e){let t=[],r=this.store.RowCount;for(let o=0;o<r;o++){if(!this.store.IsLive(o))continue;let i=this.store.MetadataAt(o);i&&e(i)&&t.push(o)}return Int32Array.from(t)}finalizeSearch(e,t,r){return(!r&&e.VersionAtDispatch===this.store.Version?this.hitsFromRows(t):this.rescoreRows(e,t)).slice(0,e.TopK).map(s=>({key:this.store.KeyAt(s.Row),score:s.Score,metadata:this.store.MetadataAt(s.Row)}))}hitsFromRows(e){let t=new Array(e.Rows.length);for(let r=0;r<e.Rows.length;r++)t[r]={Row:e.Rows[r],Score:e.Scores[r]};return t}rescoreRows(e,t){let r=e.Job,o=this.store.View(),i=new Set,s=[];for(let l=0;l<t.Rows.length;l++){let c=e.KeysAtDispatch[t.Rows[l]],u=c==null?void 0:this.store.RowOf(c);if(u===void 0||i.has(u))continue;if(i.add(u),e.Filter){let p=this.store.MetadataAt(u);if(!p||!e.Filter(p))continue}let f=Xs(r.Metric,r.Query,0,r.QueryNormSq,o.Data,u*o.Dims,o.Norms[u],o.Dims);f===f&&(r.Threshold!==null&&!(f>=r.Threshold)||s.push({Row:u,Score:f}))}return s.sort((l,c)=>c.Score-l.Score||l.Row-c.Row),r.TopK===null?s:s.slice(0,r.TopK)}searchWithCustomMetric(e){let t=e.Job.Candidates??this.store.LiveRows(),r=[];for(let o=0;o<t.length;o++){let i=t[o],s=this.store.KeyAt(i);try{let l=this.CalculateDistance(e.QueryVector,this.store.ReadRow(i),e.Metric);(e.Threshold===null||l>=e.Threshold)&&r.push({key:s,score:l,metadata:this.store.MetadataAt(i)})}catch(l){B(`Error calculating ${e.Metric} similarity for key ${s}: ${l}`)}}return r.sort((o,i)=>i.score-o.score).slice(0,e.TopK)}get accelerator(){return this.explicitAccelerator??Ph.Instance.Current}get usesCustomMetric(){let e=n.prototype;return this.CalculateDistance!==e.CalculateDistance||this.CosineSimilarity!==e.CosineSimilarity||this.EuclideanDistance!==e.EuclideanDistance||this.ManhattanDistance!==e.ManhattanDistance||this.DotProduct!==e.DotProduct||this.JaccardSimilarity!==e.JaccardSimilarity||this.HammingDistance!==e.HammingDistance}FindSimilar(e,t=10,r,o="cosine",i){let s=this.store.RowOf(e);if(s===void 0)throw new Error(`Vector with key "${e}" not found`);return this.FindNearest(this.store.ReadRow(s),t+1,r,o,i).filter(l=>l.key!==e).slice(0,t)}Similarity(e,t){let r=this.store.RowOf(e),o=this.store.RowOf(t);if(r===void 0)throw new Error(`Vector with key "${e}" not found`);if(o===void 0)throw new Error(`Vector with key "${t}" not found`);if(this.usesCustomMetric)return this.CosineSimilarity(this.store.ReadRow(r),this.store.ReadRow(o));let i=this.store.View();return cc(i.Data,r*i.Dims,i.Norms[r],i.Data,o*i.Dims,i.Norms[o],i.Dims)}CosineSimilarity(e,t){if(e.length!==t.length)throw new Error(`Vectors must have same dimensions. Got ${e.length} and ${t.length}`);return cc(e,0,go(e,0,e.length),t,0,go(t,0,t.length),e.length)}EuclideanDistance(e,t){if(e.length!==t.length)throw new Error(`Vectors must have same dimensions. Got ${e.length} and ${t.length}`);return Nh(e,0,t,0,e.length)}ManhattanDistance(e,t){if(e.length!==t.length)throw new Error(`Vectors must have same dimensions. Got ${e.length} and ${t.length}`);return JE(e,0,t,0,e.length)}DotProduct(e,t){if(e.length!==t.length)throw new Error(`Vectors must have same dimensions. Got ${e.length} and ${t.length}`);return jE(e,0,t,0,e.length)}JaccardSimilarity(e,t){if(e.length!==t.length)throw new Error(`Vectors must have same dimensions. Got ${e.length} and ${t.length}`);return YE(e,0,t,0,e.length)}HammingDistance(e,t){if(e.length!==t.length)throw new Error(`Vectors must have same dimensions. Got ${e.length} and ${t.length}`);return XE(e,0,t,0,e.length)}CalculateDistance(e,t,r="cosine"){switch(r){case"cosine":return(this.CosineSimilarity(e,t)+1)/2;case"cosine-similarity":return this.CosineSimilarity(e,t);case"euclidean":return this.EuclideanDistance(e,t);case"manhattan":return this.ManhattanDistance(e,t);case"dotproduct":return this.DotProduct(e,t);case"jaccard":return this.JaccardSimilarity(e,t);case"hamming":return this.HammingDistance(e,t);default:throw new Error(`Unknown distance metric: ${r}`)}}get Size(){return this.store.Size}Clear(){this.store.Clear()}Has(e){return this.store.Has(e)}GetVector(e){let t=this.store.RowOf(e);return t===void 0?void 0:this.store.ReadRow(t)}GetMetadata(e){let t=this.store.RowOf(e);return t===void 0?void 0:this.store.MetadataAt(t)}UpdateVector(e,t){let r=this.store.RowOf(e);if(r===void 0)throw new Error(`Vector with key "${e}" not found. Use AddVector to create new entries.`);if(t.vector==null&&t.metadata==null)throw new Error("At least one of vector or metadata must be provided for an update");if(t.vector!=null){if(t.vector.length===0)throw new Error("Vector cannot be empty");this.validateAndSetDimensions(t.vector),this.store.Write(e,t.vector)}return t.metadata!=null&&this.store.SetMetadata(r,t.metadata),!0}AddOrUpdateVector(e,t,r){if(!e)throw new Error("Key cannot be null or undefined");if(!t||t.length===0)throw new Error("Vector cannot be null, undefined, or empty");let o=this.store.Has(e);return o?this.UpdateVector(e,{vector:t,metadata:r}):this.AddVector(e,t,r),o}RemoveVector(e){return this.store.Remove(e)}GetAllKeys(){return Array.from(this.store.LiveRows(),e=>this.store.KeyAt(e))}ExportVectors(){return Array.from(this.store.LiveRows(),e=>({key:this.store.KeyAt(e),vector:this.store.ReadRow(e),metadata:this.store.MetadataAt(e)}))}validateAndSetDimensions(e){this.validateAndSetDimensionCount(e.length)}validateAndSetDimensionCount(e){if(this.expectedDimensions===null)this.expectedDimensions=e;else if(e!==this.expectedDimensions)throw new Error(`Vector dimension mismatch. Expected ${this.expectedDimensions} dimensions, got ${e}. All vectors must have the same number of dimensions for similarity calculations to work.`)}get ExpectedDimensions(){return this.expectedDimensions}FindAboveThreshold(e,t,r="cosine",o){return this.FindNearest(e,this.store.Size,t,r,o)}KMeansCluster(e,t=100,r="euclidean",o=1e-4){if(e<=0||e>this.store.Size)throw new Error(`Invalid k: ${e}. Must be between 1 and ${this.store.Size}`);let i=this.store.LiveRows(),s=this.createScorer(r),l=this.initializeKMeansPlusPlus(i,e,s),c=null,u=0,f=!1;for(;u<t&&!f;){let p=this.assignToNearestCentroid(i,l,s);if(f=c!==null&&this.sameAssignments(c,p),c=p,!f){let m=this.recomputeCentroids(i,c,e,l);this.maxCentroidMovement(l,m,s)<o&&(f=!0),l.clear(),m.forEach((g,y)=>l.set(y,g))}u++}return this.buildKMeansResult(i,c??this.assignToNearestCentroid(i,l,s),l,e,r,u,s)}buildKMeansResult(e,t,r,o,i,s,l){let c=new Map;for(let p=0;p<o;p++)c.set(p,[]);for(let p=0;p<e.length;p++)c.get(t[p]).push(this.store.KeyAt(e[p]));let u=0;for(let p=0;p<e.length;p++){let m=1-l.RowVsCentroid(e[p],r.get(t[p]));u+=m*m}let f=new Map;return r.forEach((p,m)=>f.set(m,Array.from(p.Values))),{clusters:c,centroids:f,metadata:{metric:i,iterations:s,inertia:u,silhouetteScore:this.SilhouetteScore({clusters:c,centroids:f},i)}}}initializeKMeansPlusPlus(e,t,r){let o=new Map,i=Math.floor(Math.random()*e.length);o.set(0,this.centroidFromRow(e[i]));for(let s=1;s<t;s++){let l=new Float64Array(e.length);for(let p=0;p<e.length;p++){let m=1/0;o.forEach(g=>{m=Math.min(m,1-r.RowVsCentroid(e[p],g))}),l[p]=m}let c=0;for(let p=0;p<l.length;p++)c+=l[p]*l[p];let u=Math.random()*c,f=0;for(let p=0;p<e.length;p++)if(f+=l[p]*l[p],f>=u){o.set(s,this.centroidFromRow(e[p]));break}}return o}assignToNearestCentroid(e,t,r){let o=new Int32Array(e.length);for(let i=0;i<e.length;i++){let s=1/0,l=0;t.forEach((c,u)=>{let f=1-r.RowVsCentroid(e[i],c);f<s&&(s=f,l=u)}),o[i]=l}return o}recomputeCentroids(e,t,r,o){let i=this.store.Dims,s=this.store.View(),l=[],c=new Int32Array(r);for(let f=0;f<r;f++)l.push(new Float64Array(i));for(let f=0;f<e.length;f++){let p=l[t[f]],m=e[f]*i;for(let g=0;g<i;g++)p[g]+=s.Data[m+g];c[t[f]]++}let u=new Map;for(let f=0;f<r;f++){if(c[f]===0){u.set(f,o.get(f));continue}let p=l[f];for(let m=0;m<i;m++)p[m]/=c[f];u.set(f,{Values:p,NormSq:go(p,0,i)})}return u}maxCentroidMovement(e,t,r){let o=0;return t.forEach((i,s)=>{let l=1-r.EuclideanBetween(e.get(s),i);o=Math.max(o,l)}),o}centroidFromRow(e){let t=Float64Array.from(this.store.CopyRow(e));return{Values:t,NormSq:go(t,0,t.length)}}sameAssignments(e,t){for(let r=0;r<t.length;r++)if(e[r]!==t[r])return!1;return!0}createScorer(e){let t=this.store.View(),r=t.Dims;return this.usesCustomMetric?{RowVsCentroid:a((o,i)=>this.CalculateDistance(this.store.ReadRow(o),Array.from(i.Values),e),"RowVsCentroid"),RowVsRow:a((o,i)=>this.CalculateDistance(this.store.ReadRow(o),this.store.ReadRow(i),e),"RowVsRow"),EuclideanBetween:a((o,i)=>this.CalculateDistance(Array.from(o.Values),Array.from(i.Values),"euclidean"),"EuclideanBetween")}:{RowVsCentroid:a((o,i)=>Xs(e,t.Data,o*r,t.Norms[o],i.Values,0,i.NormSq,r),"RowVsCentroid"),RowVsRow:a((o,i)=>Xs(e,t.Data,o*r,t.Norms[o],t.Data,i*r,t.Norms[i],r),"RowVsRow"),EuclideanBetween:a((o,i)=>Nh(o.Values,0,i.Values,0,r),"EuclideanBetween")}}DBSCANCluster(e,t,r="euclidean",o){if(e<=0||e>=1)throw new Error("Epsilon must be between 0 and 1 (exclusive)");if(t<=0)throw new Error("MinPoints must be positive");let i=o?this.filterRows(o):this.store.LiveRows(),s=this.buildNeighborhoods(i,1-e,r,o),l=new Uint8Array(this.store.RowCount),c=new Uint8Array(this.store.RowCount),u=new Map,f=[],p=0;for(let g=0;g<i.length;g++){let y=i[g];if(l[y])continue;l[y]=1;let C=s[y];if(C.length<t)f.push(y);else{let v=[];u.set(p,v),this.expandCluster(y,C,v,l,c,s,t),p++}}let m=f.filter(g=>!c[g]).map(g=>this.store.KeyAt(g));return{clusters:u,outliers:m,metadata:{metric:r,silhouetteScore:u.size>0?this.SilhouetteScore({clusters:u,outliers:m},r):void 0}}}buildNeighborhoods(e,t,r,o){let i=new Array(this.store.RowCount);if(this.usesCustomMetric){for(let l=0;l<e.length;l++){let c=this.FindNearest(this.store.ReadRow(e[l]),e.length,t,r,o);i[e[l]]=Int32Array.from(c,u=>this.store.RowOf(u.key))}return i}let s=this.store.View();for(let l=0;l<e.length;l++){let c=e[l],u=uc(s,{Query:Float64Array.from(s.Data.subarray(c*s.Dims,(c+1)*s.Dims)),QueryNormSq:s.Norms[c],Candidates:e,Metric:r,TopK:null,Threshold:t});i[c]=u.Rows}return i}expandCluster(e,t,r,o,i,s,l){r.push(this.store.KeyAt(e)),i[e]=1;let c=Array.from(t);for(let u=0;u<c.length;u++){let f=c[u];if(!o[f]){o[f]=1;let p=s[f];if(p.length>=l)for(let m=0;m<p.length;m++)o[p[m]]||c.push(p[m])}i[f]||(r.push(this.store.KeyAt(f)),i[f]=1)}}FindCentroid(e){if(e.length===0)throw new Error("Cannot find centroid of empty vector set");let t=e[0].length,r=new Array(t).fill(0);e.forEach(o=>{if(o.length!==t)throw new Error("All vectors must have the same dimensions");for(let i=0;i<t;i++)r[i]+=o[i]});for(let o=0;o<t;o++)r[o]/=e.length;return r}WithinClusterDistance(e,t="euclidean"){let r=0,o=0,i=this.createScorer(t);return e.clusters.forEach(s=>{let l=this.rowsForKeys(s);for(let c=0;c<l.length;c++)for(let u=c+1;u<l.length;u++)l[c]>=0&&l[u]>=0&&(r+=1-i.RowVsRow(l[c],l[u]),o++)}),o>0?r/o:0}BetweenClusterDistance(e,t="euclidean"){let r=Array.from(e.clusters.keys());if(r.length<2)return 0;let o=0,i=0,s=this.createScorer(t);for(let l=0;l<r.length;l++)for(let c=l+1;c<r.length;c++){let u=this.rowsForKeys(e.clusters.get(r[l])),f=this.rowsForKeys(e.clusters.get(r[c]));for(let p=0;p<u.length;p++)for(let m=0;m<f.length;m++)u[p]>=0&&f[m]>=0&&(o+=1-s.RowVsRow(u[p],f[m]),i++)}return i>0?o/i:0}SilhouetteScore(e,t="euclidean"){let r=[],o=this.createScorer(t),i=new Map;return e.clusters.forEach((s,l)=>i.set(l,this.rowsForKeys(s))),e.clusters.forEach((s,l)=>{let c=i.get(l);for(let u=0;u<s.length;u++){let f=c[u];if(f<0)continue;let p=0;if(s.length>1){let g=0,y=0;for(let C=0;C<s.length;C++)s[C]!==s[u]&&(g+=c[C]>=0?1-o.RowVsRow(f,c[C]):0,y++);p=g/y}let m=1/0;if(i.forEach((g,y)=>{if(y===l||g.length===0)return;let C=0;for(let v=0;v<g.length;v++)C+=g[v]>=0?1-o.RowVsRow(f,g[v]):0;m=Math.min(m,C/g.length)}),m!==1/0){let g=(m-p)/Math.max(p,m);r.push(g)}}}),r.length>0?r.reduce((s,l)=>s+l,0)/r.length:0}ElbowMethod(e,t,r="euclidean"){if(e<1||t>this.store.Size||e>t)throw new Error("Invalid k range");let o=new Map;for(let i=e;i<=t;i++){let s=this.KMeansCluster(i,100,r);o.set(i,s.metadata?.inertia||0)}return o}async KMeansClusterAsync(e,t=100,r="euclidean",o=1e-4){if(e<=0||e>this.store.Size)throw new Error(`Invalid k: ${e}. Must be between 1 and ${this.store.Size}`);if(this.usesCustomMetric)return this.KMeansCluster(e,t,r,o);let i=this.store.Keys,s=await this.accelerator.ClusterAsync({Snapshot:this.store.Snapshot(),Candidates:null,Algorithm:"kmeans",Metric:r,K:e,MaxIterations:t,Tolerance:o});return s?this.clusterResultFromRows(s,i,r):this.KMeansCluster(e,t,r,o)}async DBSCANClusterAsync(e,t,r="euclidean",o){if(e<=0||e>=1)throw new Error("Epsilon must be between 0 and 1 (exclusive)");if(t<=0)throw new Error("MinPoints must be positive");if(this.usesCustomMetric)return this.DBSCANCluster(e,t,r,o);let i=this.store.Keys,s=await this.accelerator.ClusterAsync({Snapshot:this.store.Snapshot(),Candidates:o?this.filterRows(o):null,Algorithm:"dbscan",Metric:r,Epsilon:e,MinPoints:t});return s?this.clusterResultFromRows(s,i,r):this.DBSCANCluster(e,t,r,o)}static clusterResultToRows(e){let t=a(o=>Int32Array.from(o,i=>Number(i)),"toRows"),r=new Map;return e.clusters.forEach((o,i)=>r.set(i,t(o))),{Clusters:r,Centroids:e.centroids??null,Outliers:e.outliers?t(e.outliers):null,Iterations:e.metadata?.iterations,Inertia:e.metadata?.inertia,SilhouetteScore:e.metadata?.silhouetteScore}}clusterResultFromRows(e,t,r){let o=a(l=>{let c=[];for(let u=0;u<l.length;u++){let f=t[l[u]];f!=null&&c.push(f)}return c},"toKeys"),i=new Map;e.Clusters.forEach((l,c)=>i.set(c,o(l)));let s={clusters:i,metadata:{metric:r,silhouetteScore:e.SilhouetteScore}};return e.Centroids&&(s.centroids=e.Centroids),e.Outliers&&(s.outliers=o(e.Outliers)),e.Iterations!==void 0&&(s.metadata.iterations=e.Iterations),e.Inertia!==void 0&&(s.metadata.inertia=e.Inertia),s}rowsForKeys(e){let t=new Int32Array(e.length);for(let r=0;r<e.length;r++)t[r]=this.store.RowOf(e[r])??-1;return t}};function eI(n){if(!n)return null;let e;try{e=JSON.parse(n)}catch{return null}if(!Array.isArray(e)||e.length===0)return null;for(let t of e)if(typeof t!="number"||!Number.isFinite(t))return null;return e}a(eI,"ParseVectorJSON");function tI(n){let e=DI(n);if(!e)return null;for(let t=0;t<e.length;t++)if(!Number.isFinite(e[t]))return null;return e}a(tI,"DecodeVectorBinary");function nI(n,e){return tI(n)??eI(e)}a(nI,"ReadStoredVector");var MX=new Set(["$eq","$ne","$gt","$gte","$lt","$lte","$in","$nin","$exists"]),ln=class extends Error{static{a(this,"UnsupportedFilterError")}};function yF(n){if(n==null)return{Status:"none"};if(!iI(n))return{Status:"unsupported",Reason:`a metadata filter must be an object, got ${kh(n)}`};if(Object.keys(n).length===0)return{Status:"none"};try{return{Status:"ok",Predicate:CF(n)}}catch(e){if(e instanceof ln)return{Status:"unsupported",Reason:e.message};throw e}}a(yF,"CompileMetadataFilter");function CF(n){let e=[];for(let[t,r]of Object.entries(n))e.push(t.startsWith("$")?bX(t,r):NX(t,r));return t=>e.every(r=>r(t))}a(CF,"compileObject");function bX(n,e){if(n!=="$and"&&n!=="$or")throw new ln(`unsupported logical operator "${n}"`);if(!Array.isArray(e)||e.length===0)throw new ln(`"${n}" needs a non-empty array of filters`);let t=e.map((r,o)=>{if(!iI(r))throw new ln(`"${n}[${o}]" must be an object, got ${kh(r)}`);return CF(r)});return n==="$and"?r=>t.every(o=>o(r)):r=>t.some(o=>o(r))}a(bX,"compileLogical");function NX(n,e){if(!iI(e)){let o=rI(fc(e,n));return i=>o(i(n))}let t=Object.entries(e);if(t.length===0)throw new ln(`"${n}" has an empty condition object`);let r=t.map(([o,i])=>PX(n,o,i));return o=>{let i=o(n);return r.every(s=>s(i))}}a(NX,"compileField");function PX(n,e,t){if(!MX.has(e))throw new ln(`unsupported operator "${e}" on "${n}"`);let r=`${n}.${e}`;switch(e){case"$eq":return rI(fc(t,r));case"$ne":{let o=rI(fc(t,r));return i=>!o(i)}case"$in":{let o=gF(t,r);return i=>xh(i,s=>o.some(l=>oI(s,l)))}case"$nin":{let o=gF(t,r);return i=>!xh(i,s=>o.some(l=>oI(s,l)))}case"$exists":{if(typeof t!="boolean")throw new ln(`"${r}" needs true or false`);return o=>o!=null===t}default:{let o=fc(t,r);if(o===null||typeof o=="boolean")throw new ln(`"${r}" needs a number, date or string`);return i=>xh(i,s=>kX(e,xX(s,o)))}}}a(PX,"compileOperator");function rI(n){return n===null?e=>e==null:e=>xh(e,t=>oI(t,n))}a(rI,"equalsPredicate");function xh(n,e){return n==null?!1:Array.isArray(n)?n.some(e):e(n)}a(xh,"matchesAny");function oI(n,e){if(e===null)return n==null;if(n instanceof Date){let t=vF(e);return t!==null&&n.getTime()===t}return typeof n=="string"&&typeof e=="string"?n===e||$h(n)&&$h(e)&&N(n,e):n===e}a(oI,"valuesEqual");function xX(n,e){if(n instanceof Date){let t=vF(e);return t===null?null:n.getTime()-t}return typeof n=="number"&&typeof e=="number"?n-e:typeof n=="string"&&typeof e=="string"?n<e?-1:n>e?1:0:null}a(xX,"compare");function kX(n,e){if(e===null||Number.isNaN(e))return!1;switch(n){case"$gt":return e>0;case"$gte":return e>=0;case"$lt":return e<0;default:return e<=0}}a(kX,"orderingHolds");function vF(n){if(typeof n=="number")return n;if(typeof n=="string"){let e=Date.parse(n);return Number.isNaN(e)?null:e}return null}a(vF,"toInstant");function fc(n,e){if(n===null)return null;if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")return n;if(n instanceof Date)return n.toISOString();throw new ln(`"${e}" must be a string, number, boolean or null, got ${kh(n)}`)}a(fc,"toScalar");function gF(n,e){if(!Array.isArray(n))throw new ln(`"${e}" needs an array, got ${kh(n)}`);return n.map((t,r)=>fc(t,`${e}[${r}]`))}a(gF,"toScalarArray");function iI(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&!(n instanceof Date)}a(iI,"isPlainObject");function kh(n){return n===null?"null":Array.isArray(n)?"an array":typeof n=="object"?"an object":typeof n}a(kh,"describe");var Lh=class n{static{a(this,"VectorMetadataFilter")}static BuildConditions(e){let t=[];if(e.EntityNames&&e.EntityNames.length>0&&t.push({Field:"EntityName",Operator:"in",Value:e.EntityNames}),e.SourceTypes&&e.SourceTypes.length>0&&t.push({Field:"SourceType",Operator:"in",Value:e.SourceTypes}),e.ContentTypes&&e.ContentTypes.length>0&&t.push({Field:"ContentType",Operator:"in",Value:e.ContentTypes}),e.Tags&&e.Tags.length>0)for(let r of e.Tags)t.push({Field:"Tags",Operator:"contains",Value:r});return e.EntityDocumentIDs&&e.EntityDocumentIDs.length>0&&t.push({Field:"EntityDocumentID",Operator:"in",Value:e.EntityDocumentIDs}),t}static ToNativeFilter(e){let t={};for(let r of e)switch(r.Operator){case"eq":t[r.Field]={$eq:r.Value};break;case"in":t[r.Field]={$in:r.Value};break;case"contains":t[r.Field]={$eq:r.Value};break}return t}static FromOptions(e){let t=n.BuildConditions(e);if(t.length!==0)return n.ToNativeFilter(t)}};function SF(n){if(!n||typeof n!="object")return!1;let e=n;return typeof e.ColocatedDialect=="string"&&typeof e.ColocatedSchema=="string"&&typeof e.RunColocatedSQL=="function"}a(SF,"IsColocatedVectorHost");var yo=class{static{a(this,"VectorDBBase")}get ApiKey(){return this._apiKey}constructor(e){if(!e||e.trim().length===0)throw new Error("API key cannot be empty");this._apiKey=e}get IsReadOnly(){return!1}get ManagesIndexes(){return!0}get SupportsHybridSearch(){return!1}HybridQuery(e,t){return this.QueryIndex({vector:e.vector,topK:e.topK,includeMetadata:e.includeMetadata,includeValues:e.includeValues,filter:e.filter},t)}MetadataFilteredQuery(e,t){let r=this.BuildMetadataFilter(e.metadataFilter),o={...e,filter:r??e.filter};return delete o.metadataFilter,this.QueryIndex(o,t)}BuildMetadataFilter(e){return Lh.FromOptions(e)}get SupportsColocatedQuery(){return!1}get QueryKeyIsEntityDocumentID(){return!1}get RequiresAPIKey(){return!0}SetColocatedHost(e){this.ColocatedHost=e}TryWireColocatedHost(e){return this.SupportsColocatedQuery&&SF(e)?(this.SetColocatedHost(e),!0):!1}ColocatedQuery(e,t){return Promise.reject(new Error("ColocatedQuery is not supported by this provider (SupportsColocatedQuery is false)"))}GetSourceRecordFieldPaths(e){return[]}BuildProviderDirectives(e,t){return{}}wrapSuccessResponse(e){return{success:!0,message:"",data:e}}wrapFailureResponse(e){return{success:!1,message:e||"An error occurred",data:null}}};var LX=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},FX=function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},sI=new Map,aI=class extends yo{static{a(this,"SimpleVectorDatabase")}constructor(e){super(e&&e.trim().length>0?e:"in-memory-no-auth")}get ManagesIndexes(){return!1}async loadIndexConfig(e,t){let o=await new ft().RunView({EntityName:"MJ: Vector Indexes",ExtraFilter:`Name='${Ci(e)}'`,Fields:["ID","ProviderConfig"],ResultType:"simple",MaxRows:1,SkipTotalRowCount:!0},t);if(!o.Success)return B(`SimpleVectorDatabase.loadIndexConfig: RunView failed for "${e}": ${o.ErrorMessage}`),null;if((o.Results?.length??0)===0)return B(`SimpleVectorDatabase.loadIndexConfig: no MJVectorIndex row with Name="${e}"`),null;let i=o.Results[0].ProviderConfig;if(!i)return B(`SimpleVectorDatabase.loadIndexConfig: index "${e}" exists but ProviderConfig is empty`),null;try{let s=JSON.parse(i);return!s.entityName||!s.vectorField?(B(`SimpleVectorDatabase.loadIndexConfig: index "${e}" ProviderConfig missing entityName/vectorField`),null):{entityName:s.entityName,vectorField:s.vectorField,binaryVectorField:s.binaryVectorField||void 0,filter:s.filter,titleField:s.titleField,snippetField:s.snippetField}}catch(s){return B(`SimpleVectorDatabase.loadIndexConfig: index "${e}" ProviderConfig JSON parse failed: ${s instanceof Error?s.message:String(s)}`),null}}async loadIndex(e,t){let r=await this.loadIndexConfig(e,t);if(!r)return null;let o=await this.fetchEntityRows(r,t);if(o==null)return null;let{entity:i,rows:s}=o,l=JSON.stringify(r),c=this.rowsFingerprint(s,r,i),u=sI.get(e);if(u&&u.configJSON===l&&u.rowsFingerprint===c)return{config:r,entity:u.entity,service:u.service,rowsByID:u.rowsByID};let{service:f,rowsByID:p}=this.buildServiceFromRows(s,r,i);return sI.set(e,{configJSON:l,entity:i,service:f,rowsFingerprint:c,rowsByID:p}),{config:r,entity:i,service:f,rowsByID:p}}rowsFingerprint(e,t,r){let o=new Array(e.length);for(let s=0;s<e.length;s++){let l=e[s],c=Kn.FromEntityRecord(r,l),u=l.__mj_UpdatedAt,f=u instanceof Date?u.toISOString():String(u??""),p=t.binaryVectorField&&l[t.binaryVectorField]?1:0;o[s]=`${c.ToURLSegment()}${f}${l[t.vectorField]?1:0}${p}`}return(e.length>0?Object.keys(e[0]).sort().join(","):"")+""+o.join("")}async fetchEntityRows(e,t){let o=new Be().EntityByName(e.entityName);if(!o)return null;let s=await new ft().RunView({EntityName:e.entityName,ExtraFilter:e.filter,ResultType:"simple",BypassCache:!0,...e.binaryVectorField?{IncludeBinaryFields:!0}:{}},t);return s.Success?{entity:o,rows:s.Results??[]}:(B(`SimpleVectorDatabase.loadIndex: RunView on "${e.entityName}" failed: ${s.ErrorMessage}`),null)}buildServiceFromRows(e,t,r){let o=new Dr,i=[],s=new Map,l=null,c=0;for(let u of e){let f=Kn.FromEntityRecord(r,u);if(!f.HasValue)continue;let p=this.readRowVector(u,t);if(!p)continue;if(l??=p.length,p.length!==l){c++;continue}let m=f.ToURLSegment();i.push({key:m,vector:p,metadata:u}),s.set(m,u)}return c>0&&B(`SimpleVectorDatabase: skipped ${c} "${t.entityName}" row(s) whose ${t.vectorField} has a different dimension count than the rest (${l}) \u2014 re-embed them with one model`),o.LoadVectors(i),{service:o,rowsByID:s}}readRowVector(e,t){if(t.binaryVectorField){let o=e[t.binaryVectorField],i=typeof o=="string"?tI(o):null;if(i)return i}let r=e[t.vectorField];return typeof r=="string"?eI(r):Array.isArray(r)&&r.length>0&&r.every(o=>typeof o=="number"&&Number.isFinite(o))?r:null}buildMatchMetadata(e,t,r){let o=Kn.FromEntityRecord(r,e),i={Entity:t.entityName,RecordID:o.HasValue?o.ToURLSegment():""};return t.titleField&&e[t.titleField]!=null&&(i.Title=String(e[t.titleField])),t.snippetField&&e[t.snippetField]!=null&&(i.Snippet=String(e[t.snippetField])),e.__mj_UpdatedAt!=null&&(i.__mj_UpdatedAt=e.__mj_UpdatedAt),i}async QueryIndex(e,t){let r=e,o=String(r.id??""),i=r.vector,s=Number(r.topK??10);if(!o||!Array.isArray(i)||i.length===0)return B(`SimpleVectorDatabase.QueryIndex: missing indexName="${o}" or vector (length ${Array.isArray(i)?i.length:"n/a"})`),{success:!1,message:"Missing indexName or vector",data:null};let l=yF(r.filter);if(l.Status==="unsupported")return B(`SimpleVectorDatabase.QueryIndex: index="${o}" cannot apply its metadata filter \u2014 ${l.Reason}. The query is refused rather than run unfiltered.`),{success:!1,message:`Unsupported metadata filter: ${l.Reason}`,data:null};let c=await this.loadIndex(o,t);if(!c)return{success:!1,message:`Index "${o}" not configured`,data:null};yt(`SimpleVectorDatabase.QueryIndex: index="${o}" loaded ${c.service.Size} vectors, querying topK=${s}${l.Status==="ok"?" with a metadata filter":""}`);let u=l.Status==="ok"?this.rowFilter(l.Predicate,c.config,c.entity):void 0,f=c.service.FindNearest(i,s,0,"cosine",u);return{success:!0,message:`Returned ${f.length} match(es)`,data:{matches:f.map(p=>({id:p.key,score:p.score,metadata:this.buildMatchMetadata(c.rowsByID.get(p.key)??{},c.config,c.entity)}))}}}rowFilter(e,t,r){return o=>e(a(s=>{switch(s){case"Entity":case"EntityName":return t.entityName;case"SourceType":return"entity";case"RecordID":return Kn.FromEntityRecord(r,o).ToURLSegment();default:return o[s]}},"read"))}get IsReadOnly(){return!0}get RequiresAPIKey(){return!1}ListIndexes(){return{indexes:[]}}GetIndex(e){return this.unsupported("GetIndex")}CreateIndex(e){return this.unsupported("CreateIndex")}DeleteIndex(e){return this.unsupported("DeleteIndex")}EditIndex(e){return this.unsupported("EditIndex")}CreateRecord(e){return this.unsupported("CreateRecord")}CreateRecords(e){return this.unsupported("CreateRecords")}GetRecord(e){return this.unsupported("GetRecord")}GetRecords(e){return this.unsupported("GetRecords")}UpdateRecord(e){return this.unsupported("UpdateRecord")}UpdateRecords(e){return this.unsupported("UpdateRecords")}DeleteRecord(e){return this.unsupported("DeleteRecord")}DeleteRecords(e){return this.unsupported("DeleteRecords")}DeleteAllRecords(e){return sI.clear(),{success:!0,message:"cache cleared",data:null}}ListVectorIDs(e){let t={IDs:[],NextPaginationToken:void 0};return Promise.resolve(t)}unsupported(e){return{success:!1,message:`SimpleVectorDatabase does not support ${e} \u2014 embeddings are read directly from the entity row's vector column. Use Pinecone/pgvector/Qdrant for ingestion.`,data:null}}};aI=LX([Z(yo,"SimpleVectorDatabase"),FX("design:paramtypes",[String])],aI);var OX=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},UX=function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},lI,Fh="MJ: Entity Record Documents",VX=["id","entitydocumentid","recordid","vectorjson","vectorbinary"];function $X(n){let e=TI(n?.ID);if(!n||e===null)return null;let t=new Be().EntityByName(Fh),r=t?.GetUserPermisions(n)?.CanRead===!0;if(!t||!r)return{Key:e,RowFiltered:!0};let o=t.GetEffectiveRowFilterWhereClause(n,qh.Read,"")??"",i=Array.from(t.GetDeniedReadFields(n)??[]).map(s=>s.trim().toLowerCase()).filter(s=>VX.includes(s)).sort();return{Key:`pc:rls=${o}|deny=${i.join(",")}`,RowFiltered:o.length>0||i.length>0}}a($X,"permissionClassOf");var cI=class{static{a(this,"LoadInProgress")}constructor(e,t,r,o){this.EntityDocumentID=e,this.Epoch=t,this.ContextUser=r,this.Class=o,this.Pending=[],this.StaleOnArrival=!1,this.Promise=Promise.resolve(null)}},BX=900*1e3,GX=64,HX=250,EF=500,wr=class extends Ar{static{a(this,"SimpleVectorIndexCache")}constructor(){super(),this.indexCache=new Map,this.inFlightLoads=new Map,this.loadEpochs=new Map,this.remoteRefreshIDs=new Map,this.remoteRefreshTimer=null,this.ttlMs=BX,this.maxIndexes=GX,this.subscribedToBaseEntityEvents=!1,this.subscribeToBaseEntityEvents()}static get Instance(){return super.getInstance()}get TtlMs(){return this.ttlMs}set TtlMs(e){this.ttlMs=e}get MaxIndexes(){return this.maxIndexes}set MaxIndexes(e){this.maxIndexes=Math.max(1,Math.floor(e)),this.evictOverCapacity()}get Size(){return this.indexCache.size}cacheKey(e,t){return`${e}|${t.Key}`}touch(e,t){this.indexCache.delete(e),this.indexCache.set(e,t)}evictOverCapacity(){for(let e of this.indexCache.keys()){if(this.indexCache.size<=this.maxIndexes)return;this.indexCache.delete(e)}}async GetOrLoad(e,t,r){let o=$X(t);if(o===null)return Promise.resolve().then(r);let i=this.cacheKey(e,o),s=this.indexCache.get(i);return s?(this.touch(i,s),(s.stale||Date.now()-s.loadedAt>=this.ttlMs)&&this.startLoad(i,e,t,o,r),s):this.startLoad(i,e,t,o,r)}startLoad(e,t,r,o,i){let s=this.epochOf(t),l=this.inFlightLoads.get(e);if(l&&l.Epoch===s)return l.Promise;let c=new cI(t,s,r,o);return c.Promise=this.runLoad(e,c,i),this.inFlightLoads.set(e,c),c.Promise.catch(u=>{B(`SimpleVectorIndexCache: load failed for EntityDocumentID="${t}": ${u instanceof Error?u.message:String(u)}`)}),c.Promise}async runLoad(e,t,r){try{let o=await Promise.resolve().then(r);if(o&&t.Epoch===this.epochOf(t.EntityDocumentID)){let i={...o,permissionClass:t.Class.Key,rowFiltered:t.Class.RowFiltered};return this.replayPendingChanges(t,i),t.StaleOnArrival&&(i.stale=!0),this.indexCache.delete(e),this.indexCache.set(e,i),this.evictOverCapacity(),i}return o}finally{this.inFlightLoads.get(e)===t&&this.inFlightLoads.delete(e)}}epochOf(e){return this.loadEpochs.get(e)??0}bumpEpoch(e){this.loadEpochs.set(e,this.epochOf(e)+1)}Invalidate(e){this.indexCache.forEach((t,r)=>{t.entityDocumentId===e&&this.indexCache.delete(r)}),this.bumpEpoch(e)}InvalidateAll(){this.indexCache.clear(),this.inFlightLoads.forEach(e=>this.bumpEpoch(e.EntityDocumentID))}MarkAllStale(){this.indexCache.forEach(e=>{e.stale=!0}),this.inFlightLoads.forEach(e=>{e.StaleOnArrival=!0})}ApplyRowChange(e){this.applyRowChangeWhere(e,t=>!t.Class.RowFiltered),e.ID&&this.hasRowFilteredIndexes()&&this.queueRowReRead(e.ID,!1)}ApplyRowRemoval(e){this.applyRowRemovalWhere(e,()=>!0)}hasRowFilteredIndexes(){for(let e of this.indexCache.values())if(e.rowFiltered)return!0;for(let e of this.inFlightLoads.values())if(e.Class.RowFiltered)return!0;return!1}applyRowChangeWhere(e,t){if(!e.ID)return;let r=e.EntityDocumentID||null,o=!1;this.indexCache.forEach(i=>{t(IF(i))&&(i.entityDocumentId!==r?i.service.RemoveVector(e.ID):this.applyRowToIndex(i,e)||(o=!0))}),this.inFlightLoads.forEach(i=>{t(i)&&i.Pending.push(i.EntityDocumentID===r?{Kind:"upsert",Row:e}:{Kind:"remove",ID:e.ID})}),o&&r&&this.Invalidate(r)}applyRowRemovalWhere(e,t){this.indexCache.forEach(r=>{t(IF(r))&&r.service.RemoveVector(e)}),this.inFlightLoads.forEach(r=>{t(r)&&r.Pending.push({Kind:"remove",ID:e})})}applyRowToIndex(e,t){let r=nI(t.VectorBinary,t.VectorJSON);if(!r||!t.RecordID)return e.service.RemoveVector(t.ID),!0;let o=e.service.ExpectedDimensions;return o!==null&&o!==r.length?!1:(e.service.AddOrUpdateVector(t.ID,r,{RecordID:t.RecordID}),!0)}replayPendingChanges(e,t){for(let r of e.Pending)r.Kind==="remove"?t.service.RemoveVector(r.ID):this.applyRowToIndex(t,r.Row)||(t.stale=!0)}subscribeToBaseEntityEvents(){if(!this.subscribedToBaseEntityEvents){this.subscribedToBaseEntityEvents=!0;try{dt.Instance.GetEventListener(!1).subscribe(e=>{if(e.event!==vo.ComponentEvent||e.eventCode!==Eo.BaseEventCode)return;let t=e.args;t&&this.HandleEntityEvent(t)})}catch(e){B(`SimpleVectorIndexCache: failed to subscribe to BaseEntity events: ${e instanceof Error?e.message:String(e)}`)}}}HandleEntityEvent(e){if(e.type!=="save"&&e.type!=="delete"&&e.type!=="remote-invalidate"||(e.baseEntity?.EntityInfo?.Name??e.entityName)!==Fh)return;if(e.type==="remote-invalidate"){this.handleRemoteInvalidate(e.payload);return}if(!e.baseEntity){this.MarkAllStale();return}let r=e.baseEntity;e.type==="delete"?this.ApplyRowRemoval(r.ID):this.ApplyRowChange({ID:r.ID,EntityDocumentID:r.EntityDocumentID,RecordID:r.RecordID,VectorJSON:r.VectorJSON,VectorBinary:r.VectorBinary})}handleRemoteInvalidate(e){let t=e?.primaryKeyValues?qX(e.primaryKeyValues):null;if(e?.action==="delete"&&t){this.ApplyRowRemoval(t);return}if(e?.action==="save"){let r=e.recordData?zX(e.recordData):null;if(r){this.ApplyRowChange(r);return}if(t){this.queueRowReRead(t,!0);return}}this.MarkAllStale()}queueRowReRead(e,t){this.indexCache.size===0&&this.inFlightLoads.size===0||(this.remoteRefreshIDs.set(e,t||this.remoteRefreshIDs.get(e)===!0),!this.remoteRefreshTimer&&(this.remoteRefreshTimer=setTimeout(()=>{this.remoteRefreshTimer=null,this.refreshQueuedRows().catch(r=>{B(`SimpleVectorIndexCache: re-reading changed EntityRecordDocument rows failed: ${r instanceof Error?r.message:String(r)}`),this.MarkAllStale()})},HX)))}async refreshQueuedRows(){let e=Array.from(this.remoteRefreshIDs);this.remoteRefreshIDs.clear();for(let[t,{ContextUser:r,RowFiltered:o}]of this.loadedClasses()){let i=a(l=>l.Class.Key===t,"includeUser"),s=e.filter(([,l])=>l||o).map(([l])=>l);for(let l=0;l<s.length;l+=EF){let c=s.slice(l,l+EF);if(!await this.refreshRows(c,r,i)){this.MarkAllStale();return}}}}async refreshRows(e,t,r){let o=e.map(l=>`'${Ci(l)}'`).join(","),i;try{i=await new ft().RunView({EntityName:Fh,ExtraFilter:`ID IN (${o})`,Fields:["ID","EntityDocumentID","RecordID","VectorJSON","VectorBinary"],ResultType:"simple",BypassCache:!0},t)}catch(l){return B(`SimpleVectorIndexCache: re-reading ${e.length} changed EntityRecordDocument row(s) threw: ${l instanceof Error?l.message:String(l)}`),!1}if(!i.Success)return B(`SimpleVectorIndexCache: re-reading ${e.length} changed EntityRecordDocument row(s) failed: ${i.ErrorMessage}`),!1;let s=new Set;for(let l of i.Results??[])s.add(l.ID),this.applyRowChangeWhere(l,r);for(let l of e)s.has(l)||this.applyRowRemovalWhere(l,r);return!0}loadedClasses(){let e=new Map;return this.indexCache.forEach(t=>e.set(t.permissionClass,{ContextUser:t.contextUser,RowFiltered:t.rowFiltered})),this.inFlightLoads.forEach(t=>e.set(t.Class.Key,{ContextUser:t.ContextUser,RowFiltered:t.Class.RowFiltered})),e}};function IF(n){return{Class:{Key:n.permissionClass,RowFiltered:n.rowFiltered}}}a(IF,"targetOfIndex");function qX(n){try{let e=JSON.parse(n),t=Array.isArray(e)?e.find(r=>r?.FieldName==="ID"):void 0;return t?.Value?String(t.Value):null}catch{return null}}a(qX,"parsePrimaryKeyID");function zX(n){try{let e=JSON.parse(n);return!e||typeof e.ID!="string"||typeof e.EntityDocumentID!="string"||!("VectorJSON"in e)&&!("VectorBinary"in e)?null:{ID:e.ID,EntityDocumentID:e.EntityDocumentID,RecordID:typeof e.RecordID=="string"?e.RecordID:"",VectorJSON:typeof e.VectorJSON=="string"?e.VectorJSON:null,VectorBinary:typeof e.VectorBinary=="string"?e.VectorBinary:null}}catch{return null}}a(zX,"parseRecordData");var uI=lI=class extends yo{static{a(this,"SimpleVectorServiceProvider")}static get TtlMs(){return wr.Instance.TtlMs}static set TtlMs(e){wr.Instance.TtlMs=e}constructor(e){super(e&&e.trim().length>0?e:"in-memory-no-auth")}get IsReadOnly(){return!0}get RequiresAPIKey(){return!1}get ManagesIndexes(){return!1}get QueryKeyIsEntityDocumentID(){return!0}static InvalidateIndex(e){wr.Instance.Invalidate(e)}static InvalidateAll(){wr.Instance.InvalidateAll()}static get CacheSize(){return wr.Instance.Size}loadIndex(e,t){return wr.Instance.GetOrLoad(e,t,async()=>{let o=await new ft().RunView({EntityName:Fh,ExtraFilter:`EntityDocumentID='${Ci(e)}' AND (VectorBinary IS NOT NULL OR VectorJSON IS NOT NULL)`,Fields:["ID","RecordID","VectorJSON","VectorBinary"],ResultType:"simple",IgnoreMaxRows:!0},t);if(!o.Success)return B(`SimpleVectorServiceProvider.loadIndex: RunView failed for EntityDocumentID="${e}": ${o.ErrorMessage}`),null;let i=this.buildService(e,o.Results??[]);return{entityDocumentId:e,service:i,loadedAt:Date.now(),contextUser:t,stale:!1}})}buildService(e,t){let r=new Dr({Precision:"float32"}),o=0;for(let i of t){if(!i.ID||!i.RecordID)continue;let s=nI(i.VectorBinary,i.VectorJSON);if(s){if(r.ExpectedDimensions===null&&r.ReserveCapacity(t.length,s.length),s.length!==r.ExpectedDimensions){o++;continue}r.AddVector(i.ID,s,{RecordID:i.RecordID})}}return o>0&&B(`SimpleVectorServiceProvider: skipped ${o} EntityRecordDocument row(s) for EntityDocumentID="${e}" whose vector dimensions differ from the rest \u2014 re-run vector sync for that document`),r}async QueryIndex(e,t){let r=e,o=String(r.id??""),i=r.vector,s=Number(r.topK??10);if(!o||!Array.isArray(i))return{success:!1,message:"Missing EntityDocumentID or query vector",data:null};let l=await this.loadIndex(o,t);if(!l)return{success:!1,message:`Failed to load index for EntityDocumentID="${o}"`,data:null};if(l.service.Size===0)return{success:!0,message:"No embedded records yet",data:{matches:[]}};let c=await l.service.FindNearestAsync(i,s,void 0,"cosine-similarity");return{success:!0,message:`Returned ${c.length} match(es)`,data:{matches:c.map(u=>({id:u.key,score:u.score,metadata:{RecordID:u.metadata?.RecordID??null}}))}}}ListIndexes(){return{indexes:[]}}GetIndex(e){return this.unsupported("GetIndex")}CreateIndex(e){return this.unsupported("CreateIndex")}DeleteIndex(e){return this.unsupported("DeleteIndex")}EditIndex(e){return this.unsupported("EditIndex")}CreateRecord(e){return this.unsupported("CreateRecord")}CreateRecords(e){return this.unsupported("CreateRecords")}GetRecord(e){return this.unsupported("GetRecord")}GetRecords(e){return this.unsupported("GetRecords")}UpdateRecord(e){return this.unsupported("UpdateRecord")}UpdateRecords(e){return this.unsupported("UpdateRecords")}DeleteRecord(e){return this.unsupported("DeleteRecord")}DeleteRecords(e){return this.unsupported("DeleteRecords")}DeleteAllRecords(e){return lI.InvalidateAll(),{success:!0,message:"cache cleared",data:null}}ListVectorIDs(e){let t={IDs:[],NextPaginationToken:void 0};return Promise.resolve(t)}unsupported(e){return{success:!1,message:`SimpleVectorServiceProvider does not support ${e} \u2014 embeddings are read directly from MJ: Entity Record Documents.VectorJSON. Use the vector-sync pipeline (or a remote VectorDB provider) for ingestion.`,data:null}}};uI=lI=OX([Z(yo,"SimpleVectorServiceProvider"),UX("design:paramtypes",[String])],uI);var WX=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},Qs=class{static{a(this,"RuntimeUtilities")}constructor(){this.debug=!1}BuildUtilities(e=!1,t){return this.debug=e,this.provider=t??Be.Provider,this.setupUtilities(this.provider)}buildUtilities(e=!1,t){return this.BuildUtilities(e,t)}setupUtilities(e){let t=ft.FromMetadataProvider(e),r=new wI(e);return{md:this.createSimpleMetadata(e),rv:this.createSimpleRunView(t),rq:this.createSimpleRunQuery(r),ai:this.createSimpleAITools(),geoDataEngine:this.createSimpleGeoDataEngine(),ml:this.createSimpleMLTools()}}createSimpleAITools(){let e=Eo.Provider;if(!(e instanceof Jh))throw new Error("Current data provider is not a GraphQLDataProvider. AI tools require GraphQL provider.");let t=e;return{ExecutePrompt:a(async r=>{try{let o=await t.AI.ExecuteSimplePrompt({systemPrompt:r.systemPrompt,messages:r.messages,preferredModels:r.preferredModels,modelPower:r.modelPower});return console.log("\u{1F916} ExecutePrompt succeeded!"),this.debug&&(console.log(" > params",r),console.log(" > result:",o)),{success:o.success,result:o.result||"",resultObject:o.resultObject,modelName:o.modelName||""}}catch(o){return B(o),{success:!1,result:"Failed to execute prompt: "+(o instanceof Error?o.message:String(o)),modelName:""}}},"ExecutePrompt"),EmbedText:a(async r=>{try{let o=await t.AI.EmbedText({textToEmbed:r.textToEmbed,modelSize:r.modelSize,inputType:r.inputType});if(o.error)throw new Error(o.error||"Failed to generate embeddings");let i=Array.isArray(r.textToEmbed)?o.embeddings?.length:1;return console.log(`\u{1F916} EmbedText succeeded! ${i} embeddings returned`),this.debug&&(console.log(" > params",r),console.log(" > result:",o)),{result:o.embeddings,modelName:o.modelName,vectorDimensions:o.vectorDimensions}}catch(o){throw B(o),o}},"EmbedText"),VectorService:new Dr}}createSimpleMLTools(){let e=Eo.Provider;if(!(e instanceof Jh))return;let t=e;return{listModels:a((r,o)=>this.listMLModels(r,o),"listModels"),score:a((r,o,i)=>this.scoreMLRecords(t,r,o,i),"score")}}async listMLModels(e,t){try{let o=await ft.FromMetadataProvider(this.provider).RunView({EntityName:"MJ: ML Models",ExtraFilter:this.buildMLModelsFilter(e),OrderBy:"Version DESC",MaxRows:e?.maxResults,ResultType:"entity_object"},t);return o.Success?o.Results.map(i=>this.mapMLModel(i)):(console.error(`\u274C listModels failed for MJ: ML Models: ${o.ErrorMessage}`),[])}catch(r){return B(r),[]}}buildMLModelsFilter(e){let t=[],r=e?.status??"Published";return t.push(`Status='${this.escapeSqlLiteral(r)}'`),e?.targetVariable&&t.push(`TargetVariable='${this.escapeSqlLiteral(e.targetVariable)}'`),t.join(" AND ")}mapMLModel(e){return{id:e.ID,pipeline:e.Pipeline,version:e.Version,targetVariable:e.TargetVariable,problemType:e.ProblemType,status:e.Status,metrics:this.parseMLMetrics(e.Metrics),holdoutMetrics:this.parseMLMetrics(e.HoldoutMetrics)}}parseMLMetrics(e){if(e)try{let t=JSON.parse(e);return t&&typeof t=="object"?t:void 0}catch{return}}async scoreMLRecords(e,t,r,o){let i=this.normalizeRecordKeys(r,o?.primaryKeyField??"ID");try{let s={modelId:t,scope:{records:i}},c=await new FI().Execute(s,{provider:e,user:o?.contextUser});if(!c.Success||!c.Output)return console.error(`\u274C score failed for model ${t}: ${c.ErrorMessage}`),{scoredCount:0,failedCount:i.length,skippedCount:0,predictions:[]};let u=c.Output;return{scoredCount:u.scored,failedCount:u.failed,skippedCount:u.skipped,predictions:(u.predictions??[]).map(f=>({recordId:f.recordId,score:f.score,class:f.class}))}}catch(s){return B(s),{scoredCount:0,failedCount:i.length,skippedCount:0,predictions:[]}}}normalizeRecordKeys(e,t){let r=[];for(let o of e)if(typeof o=="string")r.push(o);else if(o!=null){let i=o[t];i!=null&&r.push(String(i))}return r}escapeSqlLiteral(e){return e.replace(/'/g,"''")}createSimpleMetadata(e){return{Entities:e.Entities,GetEntityObject:a(t=>e.GetEntityObject(t),"GetEntityObject")}}createSimpleGeoDataEngine(){try{let e=UI.Instance;return e?{ResolvePointToLocation:a((t,r)=>e.ResolvePointToLocation(t,r),"ResolvePointToLocation"),EnsureLoaded:a(()=>e.EnsureLoaded(),"EnsureLoaded"),get Loaded(){return e.Loaded}}:void 0}catch{return}}createSimpleRunQuery(e){return{RunQuery:a(async t=>{try{let r=await e.RunQuery(t);return r.Success?(console.log(`\u2705 RunQuery "${t.QueryName}" succeeded: ${r.RowCount} rows returned`),this.debug&&(console.log(" > params",t),console.log(" > result:",r))):console.error(`\u274C RunQuery failed: ${r.ErrorMessage}`),r}catch(r){throw console.error("\u274C RunQuery threw exception:",r),B(r),r}},"RunQuery")}}createSimpleRunView(e){return{RunView:a(async t=>{try{let r=await e.RunView(t);return r.Success?(console.log(`\u2705 RunView succeeded for ${t.EntityName}: ${r.TotalRowCount} rows returned`),this.debug&&(console.log(" > params",t),console.log(" > result:",r))):console.error(`\u274C RunView failed for ${t.EntityName}: ${r.ErrorMessage}`),r}catch(r){throw console.error("\u274C RunView threw exception:",r),B(r),r}},"RunView"),RunViews:a(async t=>{try{let r=await e.RunViews(t),o=t.map(s=>s.EntityName).join(", "),i=r.reduce((s,l)=>s+(l.TotalRowCount||0),0);return console.log(`\u2705 RunViews succeeded for [${o}]: ${i} total rows returned`),this.debug&&(console.log(" > params",t),console.log(" > results:",r)),r}catch(r){throw console.error("\u274C RunViews threw exception:",r),B(r),r}},"RunViews")}}};Qs=WX([Z(Qs,"RuntimeUtilities")],Qs);function _F(){try{let n=dt.Instance.ClassFactory.CreateInstance(Qs);if(n)return n}catch{}return new Qs}a(_F,"CreateRuntimeUtilities");function dI(){return _F()}a(dI,"createRuntimeUtilities");function KX(n){if(!n)return null;if(Array.isArray(n))return n.length>0?Kn.FromKeyValuePairs(n):null;if(typeof n.GetValueByFieldName=="function")return n;let e=n;return e.FieldName!==void 0&&e.Value!==void 0?Kn.FromKeyValuePairs([e]):null}a(KX,"coerceToCompositeKey");async function TF(n,e,t,r){let o=KX(e);if(!o)return null;let i=t.EntityByName(n);if(!i)return console.warn(`OpenEntityRecord: entity not found: ${n}`),null;let s=!1;for(let f of o.KeyValuePairs){let p=i.Fields.find(m=>m.Name.trim().toLowerCase()===f.FieldName.trim().toLowerCase());if(!p)return console.warn(`OpenEntityRecord: non-matching field for key ${JSON.stringify(o)}`),null;if(!p.IsPrimaryKey){s=!0;break}}if(!s)return o;let c=await ft.FromMetadataProvider(t).RunView({EntityName:n,ExtraFilter:o.ToWhereClause()},r);if(!c?.Success||c.Results.length===0)return null;let u=c.Results[0];return Kn.FromKeyValuePairs(i.PrimaryKeys.map(f=>({FieldName:f.Name,Value:u[f.Name]})))}a(TF,"ResolveEntityRecordKey");async function fI(n,e,t,r){return TF(n,e,t,r)}a(fI,"resolveEntityRecordKey");var hI=class{static{a(this,"ComponentErrorAnalyzer")}static{this.ERROR_PATTERNS=[{pattern:/ReferenceError: (\w+) is not defined/,errorType:"not_defined",extractComponent:a(e=>e[1],"extractComponent")},{pattern:/Cannot read propert(?:y|ies) '(\w+)' of undefined/,errorType:"property_error",extractComponent:a(e=>e[1],"extractComponent")},{pattern:/(\w+)\(\.\.\.\): Nothing was returned from render/,errorType:"render_error",extractComponent:a(e=>e[1],"extractComponent")},{pattern:/at (\w+Component\w*)/,errorType:"stack_trace",extractComponent:a(e=>e[1],"extractComponent")},{pattern:/Error: Unable to find node on an unmounted component/,errorType:"unmounted_component",extractComponent:a(()=>null,"extractComponent")},{pattern:/Invalid hook call.*component (\w+)/,errorType:"invalid_hook",extractComponent:a(e=>e[1],"extractComponent")},{pattern:/TypeError:.*in (\w+) \(at/,errorType:"type_error",extractComponent:a(e=>e[1],"extractComponent")},{pattern:/Module not found: Error: Can't resolve '\.\/(\w+)'/,errorType:"missing_import",extractComponent:a(e=>e[1],"extractComponent")},{pattern:/(\w+) is not a function/,errorType:"not_a_function",extractComponent:a(e=>e[1],"extractComponent")},{pattern:/Minified React error.*Visit.*for the full message.*component[: ](\w+)/s,errorType:"react_error",extractComponent:a(e=>e[1],"extractComponent")}]}static IdentifyFailedComponents(e){let t=new Set;for(let r of e)this.extractComponentsFromError(r).forEach(i=>t.add(i));return Array.from(t)}static identifyFailedComponents(e){return this.IdentifyFailedComponents(e)}static AnalyzeComponentErrors(e){let t=[];for(let o of e){let i=this.analyzeError(o);t.push(...i)}let r=new Map;return t.forEach(o=>{let i=`${o.componentName}-${o.errorType}`;r.has(i)||r.set(i,o)}),Array.from(r.values())}static analyzeComponentErrors(e){return this.AnalyzeComponentErrors(e)}static extractComponentsFromError(e){let t=[];for(let o of this.ERROR_PATTERNS){let i=e.match(o.pattern);if(i){let s=o.extractComponent(i);s&&this.isLikelyComponentName(s)&&t.push(s)}}let r=this.extractComponentsFromStackTrace(e);return t.push(...r),t}static analyzeError(e){let t=[];for(let r of this.ERROR_PATTERNS){let o=e.match(r.pattern);if(o){let i=r.extractComponent(o);i&&this.isLikelyComponentName(i)&&t.push({componentName:i,errorType:r.errorType,errorMessage:e,lineNumber:this.extractLineNumber(e),context:this.extractContext(e)})}}return t.length===0&&this.extractComponentsFromStackTrace(e).forEach(o=>{t.push({componentName:o,errorType:"unknown",errorMessage:e,lineNumber:this.extractLineNumber(e)})}),t}static extractComponentsFromStackTrace(e){let t=[],r=[/at (\w+Component\w*)/g,/at (\w+)\s*\(/g,/in (\w+)\s*\(at/g,/in (\w+)\s*\(created by/g];for(let o of r){let i;for(;(i=o.exec(e))!==null;){let s=i[1];this.isLikelyComponentName(s)&&t.push(s)}}return[...new Set(t)]}static isLikelyComponentName(e){let t=new Set(["Object","Array","String","Number","Boolean","Function","Promise","Error","TypeError","ReferenceError","SyntaxError","undefined","null","console","window","document"]),r=new Set(["render","setState","forceUpdate","props","state","context","componentDidMount","componentWillUnmount","useEffect","useState"]);return e.length>0&&/^[A-Z]/.test(e)&&!t.has(e)&&!r.has(e)&&!/^use[A-Z]/.test(e)}static extractLineNumber(e){let t=[/:(\d+):\d+/,/line (\d+)/i,/Line (\d+)/];for(let r of t){let o=e.match(r);if(o)return parseInt(o[1],10)}}static extractContext(e){let t=e.match(/\(at ([^)]+)\)/);if(t)return t[1];let r=e.match(/created by (\w+)/);if(r)return`Created by ${r[1]}`}static FormatAnalysisResults(e){if(e.length===0)return"No component failures detected";let t=`Detected ${e.length} component failure(s):
|
|
352
|
+
`,this.State.error.stack)),(l||c)&&n.createElement("div",{style:{marginTop:"10px"}},l&&n.createElement("button",{onClick:this.HandleRetry,style:{padding:"8px 16px",marginRight:"10px",backgroundColor:"#1976d2",color:"white",border:"none",borderRadius:"4px",cursor:"pointer"}},`Retry (${3-this.State.retryCount} attempts left)`),c&&n.createElement("button",{onClick:this.HandleReset,style:{padding:"8px 16px",backgroundColor:"#757575",color:"white",border:"none",borderRadius:"4px",cursor:"pointer"}},"Reset Component")))}return this.props.children}}}a(lF,"CreateErrorBoundary");function bh(n,e={}){return lF(n,e)}a(bh,"createErrorBoundary");var Ys=class{static{a(this,"ComponentHierarchyRegistrar")}constructor(e,t,r){this.compiler=e,this.registry=t,this.runtimeContext=r}async fetchExternalComponent(e,t){try{let r=Be?.Provider;if(!r||!r.ExecuteGQL)return console.warn("\u26A0\uFE0F [ComponentHierarchyRegistrar] No GraphQL provider available for external registry fetch"),null;let{GraphQLComponentRegistryClient:o}=await import("./dist-6QB6LKFP.js"),s=await new o(r).GetRegistryComponent({registryName:e.registry,namespace:e.namespace||"Global",name:e.name,version:e.version||"latest"});return s&&s.code?(_n()||yt(`\u2705 [ComponentHierarchyRegistrar] Fetched external component ${e.name} with code (${s.code.length} chars)`),s):(console.warn(`\u26A0\uFE0F [ComponentHierarchyRegistrar] Failed to fetch external component ${e.name} or no code`),null)}catch(r){return console.error(`\u274C [ComponentHierarchyRegistrar] Error fetching external component ${e.name}:`,r),null}}async RegisterHierarchy(e,t){let r=e;e.location==="registry"&&e.registry&&!e.code&&(_n()||yt(`\u{1F310} [ComponentHierarchyRegistrar] Fetching external registry component: ${e.registry}/${e.name}`),r=await this.fetchExternalComponent(e,t.contextUser)||e);let{styles:o,namespace:i="Global",version:s="v1",continueOnError:l=!0,allowOverride:c=!0}=t,u=[],f=[],p=[];_n()||yt("\u{1F333} ComponentHierarchyRegistrar.registerHierarchy:",void 0,{rootComponent:r.name,hasLibraries:!!(r.libraries&&r.libraries.length>0),libraryCount:r.libraries?.length||0});let m=new Map,g=new Map,y=new Map,C=a(async E=>{if(!E.code)return{success:!0};try{let I=E.libraries?.filter(w=>!(!w||typeof w!="object"||!w.name||w.name==="unknown"||w.name==="null"||w.name==="undefined"||!w.globalVariable||w.globalVariable==="undefined"||w.globalVariable==="null")),_={componentName:E.name,componentCode:E.code,styles:o,libraries:I,dependencies:E.dependencies,allLibraries:t.allLibraries},T=await this.compiler.compile(_);return T.success&&T.component?(m.set(E.name,T.component),g.set(E.name,E),T.loadedLibraries&&T.loadedLibraries.forEach((w,R)=>{y.has(R)||(y.set(R,w),_n()||yt(`\u{1F4DA} [registerHierarchy] Added library ${R} to accumulated libraries`))}),{success:!0}):{success:!1,error:{componentName:E.name,error:T.error?.message||"Unknown compilation error",phase:"compilation"}}}catch(I){return{success:!1,error:{componentName:E.name,error:I instanceof Error?I.message:String(I),phase:"compilation"}}}},"compileOnly"),v=[r],S=new Set;for(;v.length>0;){let E=v.shift();if(S.has(E.name))continue;if(S.add(E.name),E.location==="registry"&&E.registry&&!E.code){let _=await this.fetchExternalComponent(E,t.contextUser);if(_)E=_;else{console.warn(`\u26A0\uFE0F [ComponentHierarchyRegistrar] Could not fetch external component ${E.name}, skipping`);continue}}let I=await C(E);if(!I.success&&(f.push(I.error),!l))return{success:!1,registeredComponents:u,errors:f,warnings:p,resolvedSpec:r};E.dependencies&&v.push(...E.dependencies)}y.size>0&&(this.runtimeContext.libraries||(this.runtimeContext.libraries={}),y.forEach((E,I)=>{this.runtimeContext.libraries[I]=E,_n()||yt(`\u2705 [registerHierarchy] Added ${I} to runtime context libraries`)}));for(let[E,I]of m){let _=g.get(E),T={};for(let[R,O]of m){let M=O.factory(this.runtimeContext,o);T[R]=M.component}let w=I.factory(this.runtimeContext,o,T);this.registry.register(_.name,w,_.namespace||i,s),u.push(_.name)}return{success:f.length===0,registeredComponents:u,errors:f,warnings:p,resolvedSpec:r}}async registerHierarchy(e,t){return this.RegisterHierarchy(e,t)}async RegisterSingleComponent(e,t){let{styles:r,namespace:o="Global",version:i="v1",allowOverride:s=!0}=t;try{if(!e.code)return{success:!0,error:void 0};if(this.registry.get(e.name,o,i)&&!s)return{success:!1,error:{componentName:e.name,error:`Component already registered in ${o}/${i}`,phase:"registration"}};let c=e.libraries?.filter(m=>!(!m||typeof m!="object"||!m.name||m.name==="unknown"||m.name==="null"||m.name==="undefined"||!m.globalVariable||m.globalVariable==="undefined"||m.globalVariable==="null"));_n()||yt(`\u{1F527} Compiling component ${e.name} with libraries:`,void 0,{originalCount:e.libraries?.length||0,filteredCount:c?.length||0,libraries:c?.map(m=>m.name)||[]});let u={componentName:e.name,componentCode:e.code,styles:r,libraries:c,dependencies:e.dependencies,allLibraries:t.allLibraries},f=await this.compiler.compile(u);if(!f.success)return{success:!1,error:{componentName:e.name,error:f.error?.message||"Unknown compilation error",phase:"compilation"}};f.loadedLibraries&&f.loadedLibraries.size>0&&(this.runtimeContext.libraries||(this.runtimeContext.libraries={}),f.loadedLibraries.forEach((m,g)=>{this.runtimeContext.libraries[g]=m,_n()||yt(`\u2705 [registerSingleComponent] Added ${g} to runtime context libraries`)})),_n()||yt(`\u{1F3ED} Calling factory for ${e.name} with runtime context:`,void 0,{hasReact:!!this.runtimeContext.React,hasReactDOM:!!this.runtimeContext.ReactDOM,libraryCount:Object.keys(this.runtimeContext.libraries||{}).length});let p=f.component.factory(this.runtimeContext,r);return this.registry.register(e.name,p,e.namespace||o,i),{success:!0}}catch(l){return{success:!1,error:{componentName:e.name,error:l instanceof Error?l.message:String(l),phase:"registration"}}}}async registerSingleComponent(e,t){return this.RegisterSingleComponent(e,t)}async registerChildComponents(e,t,r,o,i){for(let s of e){let l=await this.RegisterSingleComponent(s,{styles:t.styles,namespace:t.namespace,version:t.version,allowOverride:t.allowOverride,allLibraries:t.allLibraries});if(l.success)s.code&&r.push(s.name);else if(o.push(l.error),!t.continueOnError)return;let c=s.dependencies||[];c.length>0&&await this.registerChildComponents(c,t,r,o,i)}}};var ac=class{static{a(this,"ReactRootManager")}constructor(){this.roots=new Map,this.renderingRoots=new Set,this.unmountQueue=new Map,this.hooks=[],this.firstRootCreated=!1}RegisterHook(e){this.hooks.push(e)}RemoveHook(e){let t=this.hooks.findIndex(r=>r.name===e);return t>=0?(this.hooks.splice(t,1),!0):!1}CreateRoot(e,t,r){let o=`react-root-${Date.now()}-${Math.random()}`,i=t(e),s={id:o,root:i,container:e,isRendering:!1,componentId:r};this.roots.set(o,s),r&&Xe.registerReactRoot(r,i,()=>this.UnmountRoot(o));let l={rootId:o,container:e,componentId:r};return this.firstRootCreated||(this.firstRootCreated=!0,this.invokeHooks("OnFirstRootCreated",l)),this.invokeHooks("OnRootCreated",l),o}createRoot(e,t,r){return this.CreateRoot(e,t,r)}render(e,t,r){let o=this.roots.get(e);if(!o){console.warn(`React root ${e} not found`);return}if(this.unmountQueue.has(e)){console.warn(`React root ${e} is being unmounted, skipping render`);return}o.isRendering=!0,this.renderingRoots.add(e);try{o.root.render(t),o.lastRenderTime=new Date,Promise.resolve().then(()=>{o.isRendering=!1,this.renderingRoots.delete(e);let i=this.unmountQueue.get(e);i&&(this.unmountQueue.delete(e),i()),r&&r()})}catch(i){throw o.isRendering=!1,this.renderingRoots.delete(e),i}}UnmountRoot(e,t=!1){return new Promise(r=>{let o=this.roots.get(e);if(!o){r();return}let i=a(()=>{try{o.root.unmount(),this.roots.delete(e),this.renderingRoots.delete(e),o.container&&(delete o.container._reactRootContainer,o.container.innerHTML=""),this.invokeHooks("OnRootUnmounted",e),r()}catch(s){console.error(`Error unmounting React root ${e}:`,s),this.roots.delete(e),this.renderingRoots.delete(e),r()}},"performUnmount");!o.isRendering||t?i():this.unmountQueue.set(e,()=>{i()})})}unmountRoot(e,t=!1){return this.UnmountRoot(e,t)}async UnmountComponentRoots(e){let t=[];for(let[r,o]of this.roots)o.componentId===e&&t.push(r);await Promise.all(t.map(r=>this.UnmountRoot(r)))}async unmountComponentRoots(e){return this.UnmountComponentRoots(e)}IsRendering(e){return this.renderingRoots.has(e)}isRendering(e){return this.IsRendering(e)}GetStats(){return{totalRoots:this.roots.size,renderingRoots:this.renderingRoots.size,pendingUnmounts:this.unmountQueue.size}}getStats(){return this.GetStats()}async Cleanup(){this.invokeHooks("OnCleanup");let e=Array.from(this.roots.keys());await Promise.all(e.map(t=>this.UnmountRoot(t,!0))),this.firstRootCreated=!1}async cleanup(){return this.Cleanup()}invokeHooks(e,t){for(let r of this.hooks){let o=r[e];if(typeof o=="function")try{o.call(r,t)}catch(i){console.error(`Error in runtime hook "${r.name}" during ${e}:`,i)}}}},Wn=new ac;function cF(){return{colors:{primary:"#5B4FE9",primaryHover:"#4940D4",primaryActive:"#3E37B8",primaryLight:"#E8E6FF",secondary:"#64748B",secondaryHover:"#475569",success:"#10B981",successLight:"#D1FAE5",successText:"#047857",successBorder:"#b7eb8f",warning:"#F59E0B",warningLight:"#FEF3C7",warningText:"#8c6c00",warningBorder:"#ffe58f",error:"#EF4444",errorLight:"#FEE2E2",errorText:"#B91C1C",errorBorder:"#FECACA",info:"#3B82F6",infoLight:"#DBEAFE",infoText:"#1D4ED8",infoBorder:"#91d5ff",background:"#FFFFFF",surface:"#F8FAFC",surfaceHover:"#F1F5F9",overlay:"rgba(0, 0, 0, 0.5)",text:"#1E293B",textSecondary:"#64748B",textTertiary:"#94A3B8",textInverse:"#FFFFFF",link:"#5B4FE9",linkHover:"#4940D4",border:"#E2E8F0",borderLight:"#F1F5F9",borderFocus:"#5B4FE9",shadow:"rgba(0, 0, 0, 0.05)",shadowMedium:"rgba(0, 0, 0, 0.1)",shadowLarge:"rgba(0, 0, 0, 0.15)"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px",xxl:"48px",xxxl:"64px"},typography:{fontFamily:'-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif',fontSize:{xs:"11px",sm:"12px",md:"14px",lg:"16px",xl:"20px",xxl:"24px",xxxl:"32px"},fontWeight:{light:"300",regular:"400",medium:"500",semibold:"600",bold:"700"},lineHeight:{tight:"1.25",normal:"1.5",relaxed:"1.75"}},borders:{radius:{sm:"6px",md:"8px",lg:"12px",xl:"16px",full:"9999px"},width:{thin:"1px",medium:"2px",thick:"3px"}},shadows:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",inner:"inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)"},transitions:{fast:"150ms ease-in-out",normal:"250ms ease-in-out",slow:"350ms ease-in-out"},overflow:"auto",chartPalette:["#2196F3","#4CAF50","#FF9800","#E91E63","#9C27B0","#00BCD4","#F44336","#8BC34A","#FF5722","#3F51B5"],sequentialScale:["#E3F2FD","#BBDEFB","#90CAF9","#42A5F5","#2196F3","#1976D2","#0D47A1"],divergingScale:{low:"#F44336",mid:"#EEEEEE",high:"#4CAF50"}}}a(cF,"SetupStyles");var hX={primary:"--mj-brand-primary",primaryHover:"--mj-brand-primary-hover",primaryActive:"--mj-brand-primary-active",primaryLight:"--mj-brand-primary-light",secondary:"--mj-brand-secondary",secondaryHover:"--mj-brand-secondary-hover",success:"--mj-status-success",successLight:"--mj-status-success-bg",successText:"--mj-status-success-text",successBorder:"--mj-status-success-border",warning:"--mj-status-warning",warningLight:"--mj-status-warning-bg",warningText:"--mj-status-warning-text",warningBorder:"--mj-status-warning-border",error:"--mj-status-error",errorLight:"--mj-status-error-bg",errorText:"--mj-status-error-text",errorBorder:"--mj-status-error-border",info:"--mj-status-info",infoLight:"--mj-status-info-bg",infoText:"--mj-status-info-text",infoBorder:"--mj-status-info-border",background:"--mj-bg-page",surface:"--mj-bg-surface",surfaceHover:"--mj-bg-surface-hover",overlay:"--mj-bg-overlay",text:"--mj-text-primary",textSecondary:"--mj-text-secondary",textTertiary:"--mj-text-muted",textInverse:"--mj-text-inverse",link:"--mj-text-link",linkHover:"--mj-text-link-hover",border:"--mj-border-default",borderLight:"--mj-border-subtle",borderFocus:"--mj-border-focus"},pX=10,mX=7;function gX(n){if(typeof n=="function")return r=>(n(r)??"").trim();let e=n??(typeof document<"u"?document.documentElement:void 0);if(!e||typeof getComputedStyle>"u")return null;let t=getComputedStyle(e);return r=>t.getPropertyValue(r).trim()}a(gX,"resolveTokenReader");function lc(n){let e=cF(),t=gX(n);if(!t)return e;for(let[l,c]of Object.entries(hX)){let u=t(c);u&&(e.colors[l]=u)}let r=[];for(let l=1;l<=pX;l++){let c=t(`--mj-viz-${l}`);c&&r.push(c)}r.length>0&&(e.chartPalette=r);let o=[];for(let l=1;l<=mX;l++){let c=t(`--mj-viz-seq-${l}`);c&&o.push(c)}o.length>1&&(e.sequentialScale=o);let i=t("--mj-viz-div-low"),s=t("--mj-viz-div-high");if(i&&s){let l=t("--mj-viz-div-mid");e.divergingScale=l?{low:i,mid:l,high:s}:{low:i,high:s}}return e}a(lc,"BuildStylesFromTheme");var yX={small:.875,large:1.25},CX=10;function vX(n,e){let t={};for(let[r,o]of Object.entries(n)){let i=typeof o=="string"?/^\s*(\d+(?:\.\d+)?)px\s*$/.exec(o):null;t[r]=i?`${Math.max(CX,Math.round(parseFloat(i[1])*e))}px`:o}return t}a(vX,"scaleFontSizes");function HE(n,e){if(!e)return n;let t=Array.isArray(e.chartPalette)&&e.chartPalette.length>0,r=Array.isArray(e.sequentialScale)&&e.sequentialScale.length>1,o=!!e.divergingScale?.low&&!!e.divergingScale?.high,i=e.fontScale?yX[e.fontScale]:void 0,s=!!i&&!!n.typography?.fontSize;return!t&&!r&&!o&&!s?n:{...n,...t?{chartPalette:e.chartPalette}:{},...r?{sequentialScale:e.sequentialScale}:{},...o?{divergingScale:e.divergingScale}:{},...s?{typography:{...n.typography,fontSize:vX(n.typography.fontSize,i)}}:{}}}a(HE,"ApplyStyleOverrides");function SX(n){if(!n)return 1;let e=String(n).trim(),t,r,o,i=/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.exec(e);if(i){let s=i[1];s.length===3&&(s=s.split("").map(c=>c+c).join(""));let l=parseInt(s,16);t=l>>16&255,r=l>>8&255,o=l&255}else{let s=/rgba?\(([^)]+)\)/i.exec(e);if(!s)return 1;let l=s[1].split(",").map(c=>parseFloat(c));if(t=l[0],r=l[1],o=l[2],[t,r,o].some(c=>Number.isNaN(c)))return 1}return(.2126*t+.7152*r+.0722*o)/255}a(SX,"colorLuminance");function EX(n){let e=typeof n=="string"?n:n&&(n.md||n.sm||n.lg);if(!e)return;let t=parseInt(String(e),10);return Number.isNaN(t)?void 0:t}a(EX,"radiusToNumber");function uF(n,e){let t=n?.colors||{},r=e?zs(e,"theme"):void 0,o=SX(t.background)<.5,i={colorPrimary:t.primary,colorInfo:t.info||t.primary,colorSuccess:t.success,colorWarning:t.warning,colorError:t.error,colorBgContainer:t.surface,colorBgElevated:t.surface,colorBgLayout:t.background,colorText:t.text,colorTextSecondary:t.textSecondary,colorBorder:t.border,colorBorderSecondary:t.borderLight||t.border,fontFamily:n?.typography?.fontFamily},s=EX(n?.borders?.radius);s!==void 0&&(i.borderRadius=s);for(let u of Object.keys(i))i[u]==null&&delete i[u];let l={token:i},c=r&&(o?r.darkAlgorithm:r.defaultAlgorithm);return c&&(l.algorithm=c),l}a(uF,"BuildAntdThemeConfig");function dF(n,e,t,r){let o=t?.antd;if(!o)return e;let i=zs(o,"ConfigProvider");if(!i)return e;try{return n.createElement(i,{theme:uF(r,o)},e)}catch{return e}}a(dF,"WrapWithLibraryThemeProviders");function qE(n,e,t,r){return dF(n,e,t,r)}a(qE,"wrapWithLibraryThemeProviders");function fF(n){let e=[],t=a(s=>{if(s.code&&e.push(s.code),s.dependencies)for(let l of s.dependencies)t(l)},"collectCode");t(n);let r=e.join("|"),o=0;for(let s=0;s<r.length;s++){let l=r.charCodeAt(s);o=(o<<5)-o+l,o=o&o}return`v${Math.abs(o).toString(16).padStart(8,"0").substring(0,8)}`}a(fF,"GenerateComponentHierarchyHash");function zE(n){return fF(n)}a(zE,"generateComponentHierarchyHash");function go(n,e,t){let r=0;for(let o=0;o<t;o++){let i=n[e+o];r+=i*i}return r}a(go,"SumOfSquares");function cc(n,e,t,r,o,i,s){let l=0;for(let c=0;c<s;c++)l+=n[e+c]*r[o+c];return t===0||i===0?0:l/(Math.sqrt(t)*Math.sqrt(i))}a(cc,"CosineFromNorms");function Nh(n,e,t,r,o){let i=0;for(let s=0;s<o;s++){let l=n[e+s]-t[r+s];i+=l*l}return 1/(1+Math.sqrt(i))}a(Nh,"EuclideanScore");function JE(n,e,t,r,o){let i=0;for(let s=0;s<o;s++)i+=Math.abs(n[e+s]-t[r+s]);return 1/(1+i)}a(JE,"ManhattanScore");function jE(n,e,t,r,o){let i=0;for(let l=0;l<o;l++)i+=n[e+l]*t[r+l];return(Math.tanh(i/Math.sqrt(o))+1)/2}a(jE,"DotProductScore");function YE(n,e,t,r,o){let i=0,s=0;for(let l=0;l<o;l++){let c=n[e+l]!==0,u=t[r+l]!==0;c&&u&&i++,(c||u)&&s++}return s===0?1:i/s}a(YE,"JaccardScore");function XE(n,e,t,r,o){let i=0;for(let s=0;s<o;s++)n[e+s]!==t[r+s]&&i++;return 1-i/o}a(XE,"HammingScore");function Xs(n,e,t,r,o,i,s,l){switch(n){case"cosine":return(cc(e,t,r,o,i,s,l)+1)/2;case"cosine-similarity":return cc(e,t,r,o,i,s,l);case"euclidean":return Nh(e,t,o,i,l);case"manhattan":return JE(e,t,o,i,l);case"dotproduct":return jE(e,t,o,i,l);case"jaccard":return YE(e,t,o,i,l);case"hamming":return XE(e,t,o,i,l);default:throw new Error(`Unknown distance metric: ${n}`)}}a(Xs,"MetricScore");function QE(n){return n==="cosine"||n==="cosine-similarity"||n==="euclidean"||n==="manhattan"||n==="dotproduct"||n==="jaccard"||n==="hamming"}a(QE,"IsKnownMetric");function uc(n,e){if(!QE(e.Metric))throw new Error(`Unknown distance metric: ${e.Metric}`);let t=e.TopK===null?new KE:new WE(e.TopK);return n.Data instanceof Float32Array?IX(n.Data,n,e,t):_X(n.Data,n,e,t),t.Result()}a(uc,"SearchRows");function IX(n,e,t,r){let o=e.Dims,i=e.Norms,s=e.Live,l=t.Query,c=t.QueryNormSq,u=t.Candidates,f=t.Threshold,p=t.Metric,m=u?0:t.RowStart??0,g=u?u.length:Math.min(t.RowEnd??e.RowCount,e.RowCount);for(let y=m;y<g;y++){let C=u?u[y]:y;if(s[C]!==1)continue;let v=C*o,S;if(p==="cosine"||p==="cosine-similarity"){let E=0;for(let T=0;T<o;T++)E+=l[T]*n[v+T];let I=i[C],_=c===0||I===0?0:E/(Math.sqrt(c)*Math.sqrt(I));S=p==="cosine"?(_+1)/2:_}else if(p==="euclidean"){let E=0;for(let I=0;I<o;I++){let _=l[I]-n[v+I];E+=_*_}S=1/(1+Math.sqrt(E))}else if(p==="dotproduct"){let E=0;for(let I=0;I<o;I++)E+=l[I]*n[v+I];S=(Math.tanh(E/Math.sqrt(o))+1)/2}else S=Xs(p,l,0,c,n,v,i[C],o);S===S&&(f!==null&&!(S>=f)||r.Offer(C,S))}}a(IX,"scanFloat32Rows");function _X(n,e,t,r){let o=e.Dims,i=e.Norms,s=e.Live,l=t.Query,c=t.QueryNormSq,u=t.Candidates,f=t.Threshold,p=t.Metric,m=u?0:t.RowStart??0,g=u?u.length:Math.min(t.RowEnd??e.RowCount,e.RowCount);for(let y=m;y<g;y++){let C=u?u[y]:y;if(s[C]!==1)continue;let v=C*o,S;if(p==="cosine"||p==="cosine-similarity"){let E=0;for(let T=0;T<o;T++)E+=l[T]*n[v+T];let I=i[C],_=c===0||I===0?0:E/(Math.sqrt(c)*Math.sqrt(I));S=p==="cosine"?(_+1)/2:_}else if(p==="euclidean"){let E=0;for(let I=0;I<o;I++){let _=l[I]-n[v+I];E+=_*_}S=1/(1+Math.sqrt(E))}else if(p==="dotproduct"){let E=0;for(let I=0;I<o;I++)E+=l[I]*n[v+I];S=(Math.tanh(E/Math.sqrt(o))+1)/2}else S=Xs(p,l,0,c,n,v,i[C],o);S===S&&(f!==null&&!(S>=f)||r.Offer(C,S))}}a(_X,"scanFloat64Rows");var WE=class{static{a(this,"TopRowsCollector")}constructor(e){this.k=e,this.count=0;let t=Math.max(0,Math.trunc(e));this.rows=new Int32Array(t),this.scores=new Float64Array(t)}Offer(e,t){let r=this.rows.length;if(r===0)return;let o;if(this.count<r)o=this.count++;else if(t>this.scores[r-1])o=r-1;else return;for(;o>0&&this.scores[o-1]<t;)this.scores[o]=this.scores[o-1],this.rows[o]=this.rows[o-1],o--;this.scores[o]=t,this.rows[o]=e}Result(){return{Rows:this.rows.slice(0,this.count),Scores:this.scores.slice(0,this.count)}}},KE=class{static{a(this,"AllRowsCollector")}constructor(){this.rows=[],this.scores=[]}Offer(e,t){this.rows.push(e),this.scores.push(t)}Result(){let e=this.rows.map((o,i)=>i);e.sort((o,i)=>this.scores[i]-this.scores[o]||this.rows[o]-this.rows[i]);let t=new Int32Array(e.length),r=new Float64Array(e.length);for(let o=0;o<e.length;o++)t[o]=this.rows[e[o]],r[o]=this.scores[e[o]];return{Rows:t,Scores:r}}};var hF=16,pF=1.5,TX=64,DX=.25,mF=8192,wX=a(n=>new ArrayBuffer(n),"DEFAULT_ALLOCATOR"),AX=1,dc=class n{static{a(this,"VectorStore")}constructor(e="float64",t){this.readOnly=!1,this.storeID=AX++,this.dims=0,this.capacity=0,this.rowCount=0,this.liveCount=0,this.zeroNormRows=0,this.generation=0,this.version=0,this.norms=new Float64Array(0),this.live=new Uint8Array(0),this.keys=[],this.metadata=[],this.rowByKey=new Map,this.changedRows=[],this.changedVersions=[],this.changeLogFloor=0,this.precision=e,this.allocate=t??wX,this.data=e==="float32"?new Float32Array(0):new Float64Array(0)}static Adopt(e,t,r){let o=new n(t);return o.adoptView(e,r),o}get Precision(){return this.precision}get Dims(){return this.dims}get Size(){return this.liveCount}get RowCount(){return this.rowCount}get ZeroNormRows(){return this.zeroNormRows}get StoreID(){return this.storeID}get Generation(){return this.generation}get Version(){return this.version}get IsShared(){return typeof SharedArrayBuffer<"u"&&this.data.buffer instanceof SharedArrayBuffer}get Keys(){return this.keys}Has(e){return this.rowByKey.has(e)}RowOf(e){return this.rowByKey.get(e)}KeyAt(e){return this.keys[e]??null}MetadataAt(e){return this.metadata[e]}NormAt(e){return this.norms[e]}IsLive(e){return this.live[e]===1}View(){return{Data:this.data,Norms:this.norms,Live:this.live,RowCount:this.rowCount,Dims:this.dims}}Snapshot(){return{...this.View(),StoreID:this.storeID,LiveCount:this.liveCount,Precision:this.precision,Generation:this.generation,Version:this.version}}ChangedRowsSince(e,t){if(t!==this.generation||e<this.changeLogFloor)return null;let r=this.changedVersions.length;for(;r>0&&this.changedVersions[r-1]>e;)r--;return Int32Array.from(this.changedRows.slice(r))}LiveRows(){let e=new Int32Array(this.liveCount),t=0;for(let r=0;r<this.rowCount;r++)this.live[r]===1&&(e[t++]=r);return e}ReadRow(e){let t=e*this.dims;return Array.from(this.data.subarray(t,t+this.dims))}CopyRow(e){let t=e*this.dims;return this.data.slice(t,t+this.dims)}ToStorePrecision(e){return this.precision==="float32"?Float64Array.from(e,Math.fround):Float64Array.from(e)}Reserve(e,t){this.assertWritable(),this.dims===0&&(this.dims=t),this.ensureCapacity(this.rowCount+e)}Write(e,t){this.assertWritable(),this.dims===0&&(this.dims=t.length);let r=this.rowByKey.get(e);return r===void 0?(this.ensureCapacity(this.rowCount+1),r=this.rowCount++,this.keys[r]=e,this.metadata[r]=void 0,this.rowByKey.set(e,r),this.live[r]=1,this.liveCount++):this.norms[r]===0&&this.zeroNormRows--,this.writeValues(r,t),this.version++,this.recordChange(r),r}SetMetadata(e,t){this.assertWritable(),this.metadata[e]=t}Remove(e){this.assertWritable();let t=this.rowByKey.get(e);return t===void 0?!1:(this.rowByKey.delete(e),this.keys[t]=null,this.metadata[t]=void 0,this.live[t]=0,this.norms[t]===0&&this.zeroNormRows--,this.liveCount--,this.version++,this.recordChange(t),this.compactIfWorthwhile(),!0)}Clear(){this.assertWritable(),this.rowCount=0,this.liveCount=0,this.zeroNormRows=0,this.capacity=0,this.data=this.precision==="float32"?new Float32Array(0):new Float64Array(0),this.norms=new Float64Array(0),this.live=new Uint8Array(0),this.keys=[],this.metadata=[],this.rowByKey=new Map,this.generation++,this.version++,this.resetChangeLog()}recordChange(e){if(this.changedRows.push(e),this.changedVersions.push(this.version),this.changedRows.length>mF){let t=this.changedRows.length-mF/2;this.changeLogFloor=this.changedVersions[t-1],this.changedRows.splice(0,t),this.changedVersions.splice(0,t)}}resetChangeLog(){this.changedRows=[],this.changedVersions=[],this.changeLogFloor=this.version}writeValues(e,t){let r=e*this.dims;for(let i=0;i<this.dims;i++)this.data[r+i]=t[i];let o=go(this.data,r,this.dims);this.norms[e]=o,o===0&&this.zeroNormRows++}ensureCapacity(e){if(e<=this.capacity)return;let t=Math.max(e,Math.ceil(this.capacity*pF),hF);this.reallocate(t,this.rowCount)}reallocate(e,t){let r=this.allocateData(e*this.dims),o=new Float64Array(this.allocate(e*Float64Array.BYTES_PER_ELEMENT)),i=new Uint8Array(this.allocate(e));r.set(this.data.subarray(0,t*this.dims)),o.set(this.norms.subarray(0,t)),i.set(this.live.subarray(0,t)),this.data=r,this.norms=o,this.live=i,this.capacity=e,this.version++}allocateData(e){let t=this.precision==="float32"?Float32Array.BYTES_PER_ELEMENT:Float64Array.BYTES_PER_ELEMENT,r=this.allocate(e*t);return this.precision==="float32"?new Float32Array(r):new Float64Array(r)}compactIfWorthwhile(){let e=this.rowCount-this.liveCount;e<TX||e<this.rowCount*DX||this.compact()}compact(){let e=this.LiveRows(),t=Math.max(hF,Math.ceil(e.length*pF)),r=this.allocateData(t*this.dims),o=new Float64Array(this.allocate(t*Float64Array.BYTES_PER_ELEMENT)),i=new Uint8Array(this.allocate(t)),s=new Array(e.length),l=new Array(e.length),c=new Map;for(let u=0;u<e.length;u++){let f=e[u];r.set(this.data.subarray(f*this.dims,(f+1)*this.dims),u*this.dims),o[u]=this.norms[f],i[u]=1;let p=this.keys[f];s[u]=p,l[u]=this.metadata[f],c.set(p,u)}this.data=r,this.norms=o,this.live=i,this.keys=s,this.metadata=l,this.rowByKey=c,this.capacity=t,this.rowCount=e.length,this.generation++,this.version++,this.resetChangeLog()}adoptView(e,t){this.data=e.Data,this.norms=e.Norms,this.live=e.Live,this.dims=e.Dims,this.rowCount=e.RowCount,this.capacity=e.RowCount,this.keys=new Array(e.RowCount).fill(null),this.metadata=new Array(e.RowCount).fill(void 0);let r=t??this.liveRowsOfView(e);for(let o=0;o<r.length;o++){let i=r[o];if(e.Live[i]!==1)continue;let s=String(i);this.keys[i]=s,this.rowByKey.set(s,i),this.liveCount++,e.Norms[i]===0&&this.zeroNormRows++}t&&(this.live=this.maskLive(e,r)),this.readOnly=!0}liveRowsOfView(e){let t=[];for(let r=0;r<e.RowCount;r++)e.Live[r]===1&&t.push(r);return Int32Array.from(t)}maskLive(e,t){let r=new Uint8Array(e.RowCount);for(let o=0;o<t.length;o++)e.Live[t[o]]===1&&(r[t[o]]=1);return r}assertWritable(){if(this.readOnly)throw new Error("This vector store is a read-only view and cannot be modified")}};var RX=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},ZE="Default",Tr=class{static{a(this,"BaseVectorAccelerator")}AllocateBuffer(e){return new ArrayBuffer(e)}TrySearchSync(e){return null}SearchAsync(e){return Promise.resolve(uc(e.Snapshot,e))}ClusterAsync(e){return Promise.resolve(null)}};Tr=RX([Z(Tr,ZE)],Tr);var Ph=class extends Ar{static{a(this,"VectorAcceleratorResolver")}constructor(){super(),this.current=null,this.currentClass=null}static get Instance(){return super.getInstance()}get Current(){let e=dt.Instance.ClassFactory,r=e.GetRegistration(Tr,ZE)?.SubClass??Tr;return(!this.current||this.currentClass!==r)&&(this.current=e.CreateInstance(Tr,ZE)??new Tr,this.currentClass=r),this.current}};var Dr=class n{static{a(this,"SimpleVectorService")}constructor(e){this.expectedDimensions=null,this.explicitAccelerator=e?.Accelerator,this.store=new dc(e?.Precision??"float64",t=>this.accelerator.AllocateBuffer(t))}static FromRowsView(e,t,r){let o=new n({Precision:t,Accelerator:new Tr});return o.store=dc.Adopt(e,t,r),o.expectedDimensions=e.Dims>0?e.Dims:null,o}static RunClusterJob(e){let t=n.FromRowsView(e.Snapshot,e.Snapshot.Precision,e.Candidates),r=e.Algorithm==="kmeans"?t.KMeansCluster(e.K??1,e.MaxIterations??100,e.Metric,e.Tolerance??1e-4):t.DBSCANCluster(e.Epsilon??.1,e.MinPoints??1,e.Metric);return n.clusterResultToRows(r)}get StoreID(){return this.store.StoreID}get Precision(){return this.store.Precision}ReserveCapacity(e,t){e<=0||t<=0||(this.validateAndSetDimensionCount(t),this.store.Reserve(e,t))}LoadVectors(e){if(!e)throw new Error("Entries cannot be null or undefined");let t=e instanceof Map?e.size:e.length,r=e instanceof Map?e.values().next().value:e[0]?.vector;t>0&&r&&(this.validateAndSetDimensions(r),this.store.Reserve(t,r.length)),e instanceof Map?e.forEach((o,i)=>{this.validateAndSetDimensions(o),this.store.SetMetadata(this.store.Write(i,o),void 0)}):e.forEach(o=>{this.validateAndSetDimensions(o.vector),this.store.SetMetadata(this.store.Write(o.key,o.vector),o.metadata)})}AddVector(e,t,r){if(!e)throw new Error("Key cannot be null or undefined");if(!t||t.length===0)throw new Error("Vector cannot be null, undefined, or empty");this.validateAndSetDimensions(t),this.store.SetMetadata(this.store.Write(e,t),r)}FindNearest(e,t=10,r,o="cosine",i){let s=this.planSearch(e,t,r,o,i);if(!s)return[];if(s.Mode==="custom")return this.searchWithCustomMetric(s);let l=this.accelerator.TrySearchSync(s.Job);return l?this.finalizeSearch(s,l,!0):this.finalizeSearch(s,uc(s.Job.Snapshot,s.Job),!1)}async FindNearestAsync(e,t=10,r,o="cosine",i){let s=this.planSearch(e,t,r,o,i);if(!s)return[];if(s.Mode==="custom")return this.searchWithCustomMetric(s);let l=await this.accelerator.SearchAsync(s.Job);return this.finalizeSearch(s,l,!0)}planSearch(e,t,r,o,i){if(!e||e.length===0)throw new Error("Query vector cannot be null, undefined, or empty");let s=i?this.filterRows(i):null,l=s?s.length:this.store.Size;if(l===0)return null;let c=this.usesCustomMetric;if(!c&&!QE(o))return B(`Error calculating ${o} similarity: Unknown distance metric: ${o}`),null;if(!c&&this.store.Dims!==e.length)return B(`Error calculating ${o} similarity: Vectors must have same dimensions. Got ${e.length} and ${this.store.Dims}`),null;let u=Math.trunc(t),f=u>=1&&u<l;return{Mode:c?"custom":"kernel",QueryVector:e,TopK:t,Metric:o,Threshold:r??null,Filter:i,KeysAtDispatch:this.store.Keys,VersionAtDispatch:this.store.Version,Job:this.buildSearchJob(e,f?u:null,r,o,s)}}buildSearchJob(e,t,r,o,i){let s=this.store.ToStorePrecision(e);return{...{Query:s,QueryNormSq:go(s,0,s.length),Candidates:i,Metric:o,TopK:t,Threshold:r??null},Snapshot:this.store.Snapshot(),Source:this.store}}filterRows(e){let t=[],r=this.store.RowCount;for(let o=0;o<r;o++){if(!this.store.IsLive(o))continue;let i=this.store.MetadataAt(o);i&&e(i)&&t.push(o)}return Int32Array.from(t)}finalizeSearch(e,t,r){return(!r&&e.VersionAtDispatch===this.store.Version?this.hitsFromRows(t):this.rescoreRows(e,t)).slice(0,e.TopK).map(s=>({key:this.store.KeyAt(s.Row),score:s.Score,metadata:this.store.MetadataAt(s.Row)}))}hitsFromRows(e){let t=new Array(e.Rows.length);for(let r=0;r<e.Rows.length;r++)t[r]={Row:e.Rows[r],Score:e.Scores[r]};return t}rescoreRows(e,t){let r=e.Job,o=this.store.View(),i=new Set,s=[];for(let l=0;l<t.Rows.length;l++){let c=e.KeysAtDispatch[t.Rows[l]],u=c==null?void 0:this.store.RowOf(c);if(u===void 0||i.has(u))continue;if(i.add(u),e.Filter){let p=this.store.MetadataAt(u);if(!p||!e.Filter(p))continue}let f=Xs(r.Metric,r.Query,0,r.QueryNormSq,o.Data,u*o.Dims,o.Norms[u],o.Dims);f===f&&(r.Threshold!==null&&!(f>=r.Threshold)||s.push({Row:u,Score:f}))}return s.sort((l,c)=>c.Score-l.Score||l.Row-c.Row),r.TopK===null?s:s.slice(0,r.TopK)}searchWithCustomMetric(e){let t=e.Job.Candidates??this.store.LiveRows(),r=[];for(let o=0;o<t.length;o++){let i=t[o],s=this.store.KeyAt(i);try{let l=this.CalculateDistance(e.QueryVector,this.store.ReadRow(i),e.Metric);(e.Threshold===null||l>=e.Threshold)&&r.push({key:s,score:l,metadata:this.store.MetadataAt(i)})}catch(l){B(`Error calculating ${e.Metric} similarity for key ${s}: ${l}`)}}return r.sort((o,i)=>i.score-o.score).slice(0,e.TopK)}get accelerator(){return this.explicitAccelerator??Ph.Instance.Current}get usesCustomMetric(){let e=n.prototype;return this.CalculateDistance!==e.CalculateDistance||this.CosineSimilarity!==e.CosineSimilarity||this.EuclideanDistance!==e.EuclideanDistance||this.ManhattanDistance!==e.ManhattanDistance||this.DotProduct!==e.DotProduct||this.JaccardSimilarity!==e.JaccardSimilarity||this.HammingDistance!==e.HammingDistance}FindSimilar(e,t=10,r,o="cosine",i){let s=this.store.RowOf(e);if(s===void 0)throw new Error(`Vector with key "${e}" not found`);return this.FindNearest(this.store.ReadRow(s),t+1,r,o,i).filter(l=>l.key!==e).slice(0,t)}Similarity(e,t){let r=this.store.RowOf(e),o=this.store.RowOf(t);if(r===void 0)throw new Error(`Vector with key "${e}" not found`);if(o===void 0)throw new Error(`Vector with key "${t}" not found`);if(this.usesCustomMetric)return this.CosineSimilarity(this.store.ReadRow(r),this.store.ReadRow(o));let i=this.store.View();return cc(i.Data,r*i.Dims,i.Norms[r],i.Data,o*i.Dims,i.Norms[o],i.Dims)}CosineSimilarity(e,t){if(e.length!==t.length)throw new Error(`Vectors must have same dimensions. Got ${e.length} and ${t.length}`);return cc(e,0,go(e,0,e.length),t,0,go(t,0,t.length),e.length)}EuclideanDistance(e,t){if(e.length!==t.length)throw new Error(`Vectors must have same dimensions. Got ${e.length} and ${t.length}`);return Nh(e,0,t,0,e.length)}ManhattanDistance(e,t){if(e.length!==t.length)throw new Error(`Vectors must have same dimensions. Got ${e.length} and ${t.length}`);return JE(e,0,t,0,e.length)}DotProduct(e,t){if(e.length!==t.length)throw new Error(`Vectors must have same dimensions. Got ${e.length} and ${t.length}`);return jE(e,0,t,0,e.length)}JaccardSimilarity(e,t){if(e.length!==t.length)throw new Error(`Vectors must have same dimensions. Got ${e.length} and ${t.length}`);return YE(e,0,t,0,e.length)}HammingDistance(e,t){if(e.length!==t.length)throw new Error(`Vectors must have same dimensions. Got ${e.length} and ${t.length}`);return XE(e,0,t,0,e.length)}CalculateDistance(e,t,r="cosine"){switch(r){case"cosine":return(this.CosineSimilarity(e,t)+1)/2;case"cosine-similarity":return this.CosineSimilarity(e,t);case"euclidean":return this.EuclideanDistance(e,t);case"manhattan":return this.ManhattanDistance(e,t);case"dotproduct":return this.DotProduct(e,t);case"jaccard":return this.JaccardSimilarity(e,t);case"hamming":return this.HammingDistance(e,t);default:throw new Error(`Unknown distance metric: ${r}`)}}get Size(){return this.store.Size}Clear(){this.store.Clear()}Has(e){return this.store.Has(e)}GetVector(e){let t=this.store.RowOf(e);return t===void 0?void 0:this.store.ReadRow(t)}GetMetadata(e){let t=this.store.RowOf(e);return t===void 0?void 0:this.store.MetadataAt(t)}UpdateVector(e,t){let r=this.store.RowOf(e);if(r===void 0)throw new Error(`Vector with key "${e}" not found. Use AddVector to create new entries.`);if(t.vector==null&&t.metadata==null)throw new Error("At least one of vector or metadata must be provided for an update");if(t.vector!=null){if(t.vector.length===0)throw new Error("Vector cannot be empty");this.validateAndSetDimensions(t.vector),this.store.Write(e,t.vector)}return t.metadata!=null&&this.store.SetMetadata(r,t.metadata),!0}AddOrUpdateVector(e,t,r){if(!e)throw new Error("Key cannot be null or undefined");if(!t||t.length===0)throw new Error("Vector cannot be null, undefined, or empty");let o=this.store.Has(e);return o?this.UpdateVector(e,{vector:t,metadata:r}):this.AddVector(e,t,r),o}RemoveVector(e){return this.store.Remove(e)}GetAllKeys(){return Array.from(this.store.LiveRows(),e=>this.store.KeyAt(e))}ExportVectors(){return Array.from(this.store.LiveRows(),e=>({key:this.store.KeyAt(e),vector:this.store.ReadRow(e),metadata:this.store.MetadataAt(e)}))}validateAndSetDimensions(e){this.validateAndSetDimensionCount(e.length)}validateAndSetDimensionCount(e){if(this.expectedDimensions===null)this.expectedDimensions=e;else if(e!==this.expectedDimensions)throw new Error(`Vector dimension mismatch. Expected ${this.expectedDimensions} dimensions, got ${e}. All vectors must have the same number of dimensions for similarity calculations to work.`)}get ExpectedDimensions(){return this.expectedDimensions}FindAboveThreshold(e,t,r="cosine",o){return this.FindNearest(e,this.store.Size,t,r,o)}KMeansCluster(e,t=100,r="euclidean",o=1e-4){if(e<=0||e>this.store.Size)throw new Error(`Invalid k: ${e}. Must be between 1 and ${this.store.Size}`);let i=this.store.LiveRows(),s=this.createScorer(r),l=this.initializeKMeansPlusPlus(i,e,s),c=null,u=0,f=!1;for(;u<t&&!f;){let p=this.assignToNearestCentroid(i,l,s);if(f=c!==null&&this.sameAssignments(c,p),c=p,!f){let m=this.recomputeCentroids(i,c,e,l);this.maxCentroidMovement(l,m,s)<o&&(f=!0),l.clear(),m.forEach((g,y)=>l.set(y,g))}u++}return this.buildKMeansResult(i,c??this.assignToNearestCentroid(i,l,s),l,e,r,u,s)}buildKMeansResult(e,t,r,o,i,s,l){let c=new Map;for(let p=0;p<o;p++)c.set(p,[]);for(let p=0;p<e.length;p++)c.get(t[p]).push(this.store.KeyAt(e[p]));let u=0;for(let p=0;p<e.length;p++){let m=1-l.RowVsCentroid(e[p],r.get(t[p]));u+=m*m}let f=new Map;return r.forEach((p,m)=>f.set(m,Array.from(p.Values))),{clusters:c,centroids:f,metadata:{metric:i,iterations:s,inertia:u,silhouetteScore:this.SilhouetteScore({clusters:c,centroids:f},i)}}}initializeKMeansPlusPlus(e,t,r){let o=new Map,i=Math.floor(Math.random()*e.length);o.set(0,this.centroidFromRow(e[i]));for(let s=1;s<t;s++){let l=new Float64Array(e.length);for(let p=0;p<e.length;p++){let m=1/0;o.forEach(g=>{m=Math.min(m,1-r.RowVsCentroid(e[p],g))}),l[p]=m}let c=0;for(let p=0;p<l.length;p++)c+=l[p]*l[p];let u=Math.random()*c,f=0;for(let p=0;p<e.length;p++)if(f+=l[p]*l[p],f>=u){o.set(s,this.centroidFromRow(e[p]));break}}return o}assignToNearestCentroid(e,t,r){let o=new Int32Array(e.length);for(let i=0;i<e.length;i++){let s=1/0,l=0;t.forEach((c,u)=>{let f=1-r.RowVsCentroid(e[i],c);f<s&&(s=f,l=u)}),o[i]=l}return o}recomputeCentroids(e,t,r,o){let i=this.store.Dims,s=this.store.View(),l=[],c=new Int32Array(r);for(let f=0;f<r;f++)l.push(new Float64Array(i));for(let f=0;f<e.length;f++){let p=l[t[f]],m=e[f]*i;for(let g=0;g<i;g++)p[g]+=s.Data[m+g];c[t[f]]++}let u=new Map;for(let f=0;f<r;f++){if(c[f]===0){u.set(f,o.get(f));continue}let p=l[f];for(let m=0;m<i;m++)p[m]/=c[f];u.set(f,{Values:p,NormSq:go(p,0,i)})}return u}maxCentroidMovement(e,t,r){let o=0;return t.forEach((i,s)=>{let l=1-r.EuclideanBetween(e.get(s),i);o=Math.max(o,l)}),o}centroidFromRow(e){let t=Float64Array.from(this.store.CopyRow(e));return{Values:t,NormSq:go(t,0,t.length)}}sameAssignments(e,t){for(let r=0;r<t.length;r++)if(e[r]!==t[r])return!1;return!0}createScorer(e){let t=this.store.View(),r=t.Dims;return this.usesCustomMetric?{RowVsCentroid:a((o,i)=>this.CalculateDistance(this.store.ReadRow(o),Array.from(i.Values),e),"RowVsCentroid"),RowVsRow:a((o,i)=>this.CalculateDistance(this.store.ReadRow(o),this.store.ReadRow(i),e),"RowVsRow"),EuclideanBetween:a((o,i)=>this.CalculateDistance(Array.from(o.Values),Array.from(i.Values),"euclidean"),"EuclideanBetween")}:{RowVsCentroid:a((o,i)=>Xs(e,t.Data,o*r,t.Norms[o],i.Values,0,i.NormSq,r),"RowVsCentroid"),RowVsRow:a((o,i)=>Xs(e,t.Data,o*r,t.Norms[o],t.Data,i*r,t.Norms[i],r),"RowVsRow"),EuclideanBetween:a((o,i)=>Nh(o.Values,0,i.Values,0,r),"EuclideanBetween")}}DBSCANCluster(e,t,r="euclidean",o){if(e<=0||e>=1)throw new Error("Epsilon must be between 0 and 1 (exclusive)");if(t<=0)throw new Error("MinPoints must be positive");let i=o?this.filterRows(o):this.store.LiveRows(),s=this.buildNeighborhoods(i,1-e,r,o),l=new Uint8Array(this.store.RowCount),c=new Uint8Array(this.store.RowCount),u=new Map,f=[],p=0;for(let g=0;g<i.length;g++){let y=i[g];if(l[y])continue;l[y]=1;let C=s[y];if(C.length<t)f.push(y);else{let v=[];u.set(p,v),this.expandCluster(y,C,v,l,c,s,t),p++}}let m=f.filter(g=>!c[g]).map(g=>this.store.KeyAt(g));return{clusters:u,outliers:m,metadata:{metric:r,silhouetteScore:u.size>0?this.SilhouetteScore({clusters:u,outliers:m},r):void 0}}}buildNeighborhoods(e,t,r,o){let i=new Array(this.store.RowCount);if(this.usesCustomMetric){for(let l=0;l<e.length;l++){let c=this.FindNearest(this.store.ReadRow(e[l]),e.length,t,r,o);i[e[l]]=Int32Array.from(c,u=>this.store.RowOf(u.key))}return i}let s=this.store.View();for(let l=0;l<e.length;l++){let c=e[l],u=uc(s,{Query:Float64Array.from(s.Data.subarray(c*s.Dims,(c+1)*s.Dims)),QueryNormSq:s.Norms[c],Candidates:e,Metric:r,TopK:null,Threshold:t});i[c]=u.Rows}return i}expandCluster(e,t,r,o,i,s,l){r.push(this.store.KeyAt(e)),i[e]=1;let c=Array.from(t);for(let u=0;u<c.length;u++){let f=c[u];if(!o[f]){o[f]=1;let p=s[f];if(p.length>=l)for(let m=0;m<p.length;m++)o[p[m]]||c.push(p[m])}i[f]||(r.push(this.store.KeyAt(f)),i[f]=1)}}FindCentroid(e){if(e.length===0)throw new Error("Cannot find centroid of empty vector set");let t=e[0].length,r=new Array(t).fill(0);e.forEach(o=>{if(o.length!==t)throw new Error("All vectors must have the same dimensions");for(let i=0;i<t;i++)r[i]+=o[i]});for(let o=0;o<t;o++)r[o]/=e.length;return r}WithinClusterDistance(e,t="euclidean"){let r=0,o=0,i=this.createScorer(t);return e.clusters.forEach(s=>{let l=this.rowsForKeys(s);for(let c=0;c<l.length;c++)for(let u=c+1;u<l.length;u++)l[c]>=0&&l[u]>=0&&(r+=1-i.RowVsRow(l[c],l[u]),o++)}),o>0?r/o:0}BetweenClusterDistance(e,t="euclidean"){let r=Array.from(e.clusters.keys());if(r.length<2)return 0;let o=0,i=0,s=this.createScorer(t);for(let l=0;l<r.length;l++)for(let c=l+1;c<r.length;c++){let u=this.rowsForKeys(e.clusters.get(r[l])),f=this.rowsForKeys(e.clusters.get(r[c]));for(let p=0;p<u.length;p++)for(let m=0;m<f.length;m++)u[p]>=0&&f[m]>=0&&(o+=1-s.RowVsRow(u[p],f[m]),i++)}return i>0?o/i:0}SilhouetteScore(e,t="euclidean"){let r=[],o=this.createScorer(t),i=new Map;return e.clusters.forEach((s,l)=>i.set(l,this.rowsForKeys(s))),e.clusters.forEach((s,l)=>{let c=i.get(l);for(let u=0;u<s.length;u++){let f=c[u];if(f<0)continue;let p=0;if(s.length>1){let g=0,y=0;for(let C=0;C<s.length;C++)s[C]!==s[u]&&(g+=c[C]>=0?1-o.RowVsRow(f,c[C]):0,y++);p=g/y}let m=1/0;if(i.forEach((g,y)=>{if(y===l||g.length===0)return;let C=0;for(let v=0;v<g.length;v++)C+=g[v]>=0?1-o.RowVsRow(f,g[v]):0;m=Math.min(m,C/g.length)}),m!==1/0){let g=(m-p)/Math.max(p,m);r.push(g)}}}),r.length>0?r.reduce((s,l)=>s+l,0)/r.length:0}ElbowMethod(e,t,r="euclidean"){if(e<1||t>this.store.Size||e>t)throw new Error("Invalid k range");let o=new Map;for(let i=e;i<=t;i++){let s=this.KMeansCluster(i,100,r);o.set(i,s.metadata?.inertia||0)}return o}async KMeansClusterAsync(e,t=100,r="euclidean",o=1e-4){if(e<=0||e>this.store.Size)throw new Error(`Invalid k: ${e}. Must be between 1 and ${this.store.Size}`);if(this.usesCustomMetric)return this.KMeansCluster(e,t,r,o);let i=this.store.Keys,s=await this.accelerator.ClusterAsync({Snapshot:this.store.Snapshot(),Candidates:null,Algorithm:"kmeans",Metric:r,K:e,MaxIterations:t,Tolerance:o});return s?this.clusterResultFromRows(s,i,r):this.KMeansCluster(e,t,r,o)}async DBSCANClusterAsync(e,t,r="euclidean",o){if(e<=0||e>=1)throw new Error("Epsilon must be between 0 and 1 (exclusive)");if(t<=0)throw new Error("MinPoints must be positive");if(this.usesCustomMetric)return this.DBSCANCluster(e,t,r,o);let i=this.store.Keys,s=await this.accelerator.ClusterAsync({Snapshot:this.store.Snapshot(),Candidates:o?this.filterRows(o):null,Algorithm:"dbscan",Metric:r,Epsilon:e,MinPoints:t});return s?this.clusterResultFromRows(s,i,r):this.DBSCANCluster(e,t,r,o)}static clusterResultToRows(e){let t=a(o=>Int32Array.from(o,i=>Number(i)),"toRows"),r=new Map;return e.clusters.forEach((o,i)=>r.set(i,t(o))),{Clusters:r,Centroids:e.centroids??null,Outliers:e.outliers?t(e.outliers):null,Iterations:e.metadata?.iterations,Inertia:e.metadata?.inertia,SilhouetteScore:e.metadata?.silhouetteScore}}clusterResultFromRows(e,t,r){let o=a(l=>{let c=[];for(let u=0;u<l.length;u++){let f=t[l[u]];f!=null&&c.push(f)}return c},"toKeys"),i=new Map;e.Clusters.forEach((l,c)=>i.set(c,o(l)));let s={clusters:i,metadata:{metric:r,silhouetteScore:e.SilhouetteScore}};return e.Centroids&&(s.centroids=e.Centroids),e.Outliers&&(s.outliers=o(e.Outliers)),e.Iterations!==void 0&&(s.metadata.iterations=e.Iterations),e.Inertia!==void 0&&(s.metadata.inertia=e.Inertia),s}rowsForKeys(e){let t=new Int32Array(e.length);for(let r=0;r<e.length;r++)t[r]=this.store.RowOf(e[r])??-1;return t}};function eI(n){if(!n)return null;let e;try{e=JSON.parse(n)}catch{return null}if(!Array.isArray(e)||e.length===0)return null;for(let t of e)if(typeof t!="number"||!Number.isFinite(t))return null;return e}a(eI,"ParseVectorJSON");function tI(n){let e=DI(n);if(!e)return null;for(let t=0;t<e.length;t++)if(!Number.isFinite(e[t]))return null;return e}a(tI,"DecodeVectorBinary");function nI(n,e){return tI(n)??eI(e)}a(nI,"ReadStoredVector");var MX=new Set(["$eq","$ne","$gt","$gte","$lt","$lte","$in","$nin","$exists"]),ln=class extends Error{static{a(this,"UnsupportedFilterError")}};function yF(n){if(n==null)return{Status:"none"};if(!iI(n))return{Status:"unsupported",Reason:`a metadata filter must be an object, got ${kh(n)}`};if(Object.keys(n).length===0)return{Status:"none"};try{return{Status:"ok",Predicate:CF(n)}}catch(e){if(e instanceof ln)return{Status:"unsupported",Reason:e.message};throw e}}a(yF,"CompileMetadataFilter");function CF(n){let e=[];for(let[t,r]of Object.entries(n))e.push(t.startsWith("$")?bX(t,r):NX(t,r));return t=>e.every(r=>r(t))}a(CF,"compileObject");function bX(n,e){if(n!=="$and"&&n!=="$or")throw new ln(`unsupported logical operator "${n}"`);if(!Array.isArray(e)||e.length===0)throw new ln(`"${n}" needs a non-empty array of filters`);let t=e.map((r,o)=>{if(!iI(r))throw new ln(`"${n}[${o}]" must be an object, got ${kh(r)}`);return CF(r)});return n==="$and"?r=>t.every(o=>o(r)):r=>t.some(o=>o(r))}a(bX,"compileLogical");function NX(n,e){if(!iI(e)){let o=rI(fc(e,n));return i=>o(i(n))}let t=Object.entries(e);if(t.length===0)throw new ln(`"${n}" has an empty condition object`);let r=t.map(([o,i])=>PX(n,o,i));return o=>{let i=o(n);return r.every(s=>s(i))}}a(NX,"compileField");function PX(n,e,t){if(!MX.has(e))throw new ln(`unsupported operator "${e}" on "${n}"`);let r=`${n}.${e}`;switch(e){case"$eq":return rI(fc(t,r));case"$ne":{let o=rI(fc(t,r));return i=>!o(i)}case"$in":{let o=gF(t,r);return i=>xh(i,s=>o.some(l=>oI(s,l)))}case"$nin":{let o=gF(t,r);return i=>!xh(i,s=>o.some(l=>oI(s,l)))}case"$exists":{if(typeof t!="boolean")throw new ln(`"${r}" needs true or false`);return o=>o!=null===t}default:{let o=fc(t,r);if(o===null||typeof o=="boolean")throw new ln(`"${r}" needs a number, date or string`);return i=>xh(i,s=>kX(e,xX(s,o)))}}}a(PX,"compileOperator");function rI(n){return n===null?e=>e==null:e=>xh(e,t=>oI(t,n))}a(rI,"equalsPredicate");function xh(n,e){return n==null?!1:Array.isArray(n)?n.some(e):e(n)}a(xh,"matchesAny");function oI(n,e){if(e===null)return n==null;if(n instanceof Date){let t=vF(e);return t!==null&&n.getTime()===t}return typeof n=="string"&&typeof e=="string"?n===e||$h(n)&&$h(e)&&N(n,e):n===e}a(oI,"valuesEqual");function xX(n,e){if(n instanceof Date){let t=vF(e);return t===null?null:n.getTime()-t}return typeof n=="number"&&typeof e=="number"?n-e:typeof n=="string"&&typeof e=="string"?n<e?-1:n>e?1:0:null}a(xX,"compare");function kX(n,e){if(e===null||Number.isNaN(e))return!1;switch(n){case"$gt":return e>0;case"$gte":return e>=0;case"$lt":return e<0;default:return e<=0}}a(kX,"orderingHolds");function vF(n){if(typeof n=="number")return n;if(typeof n=="string"){let e=Date.parse(n);return Number.isNaN(e)?null:e}return null}a(vF,"toInstant");function fc(n,e){if(n===null)return null;if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")return n;if(n instanceof Date)return n.toISOString();throw new ln(`"${e}" must be a string, number, boolean or null, got ${kh(n)}`)}a(fc,"toScalar");function gF(n,e){if(!Array.isArray(n))throw new ln(`"${e}" needs an array, got ${kh(n)}`);return n.map((t,r)=>fc(t,`${e}[${r}]`))}a(gF,"toScalarArray");function iI(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&!(n instanceof Date)}a(iI,"isPlainObject");function kh(n){return n===null?"null":Array.isArray(n)?"an array":typeof n=="object"?"an object":typeof n}a(kh,"describe");var Lh=class n{static{a(this,"VectorMetadataFilter")}static BuildConditions(e){let t=[];if(e.EntityNames&&e.EntityNames.length>0&&t.push({Field:"EntityName",Operator:"in",Value:e.EntityNames}),e.SourceTypes&&e.SourceTypes.length>0&&t.push({Field:"SourceType",Operator:"in",Value:e.SourceTypes}),e.ContentTypes&&e.ContentTypes.length>0&&t.push({Field:"ContentType",Operator:"in",Value:e.ContentTypes}),e.Tags&&e.Tags.length>0)for(let r of e.Tags)t.push({Field:"Tags",Operator:"contains",Value:r});return e.EntityDocumentIDs&&e.EntityDocumentIDs.length>0&&t.push({Field:"EntityDocumentID",Operator:"in",Value:e.EntityDocumentIDs}),t}static ToNativeFilter(e){let t={};for(let r of e)switch(r.Operator){case"eq":t[r.Field]={$eq:r.Value};break;case"in":t[r.Field]={$in:r.Value};break;case"contains":t[r.Field]={$eq:r.Value};break}return t}static FromOptions(e){let t=n.BuildConditions(e);if(t.length!==0)return n.ToNativeFilter(t)}};function SF(n){if(!n||typeof n!="object")return!1;let e=n;return typeof e.ColocatedDialect=="string"&&typeof e.ColocatedSchema=="string"&&typeof e.RunColocatedSQL=="function"}a(SF,"IsColocatedVectorHost");var yo=class{static{a(this,"VectorDBBase")}get ApiKey(){return this._apiKey}constructor(e){if(!e||e.trim().length===0)throw new Error("API key cannot be empty");this._apiKey=e}get IsReadOnly(){return!1}get ManagesIndexes(){return!0}get SupportsHybridSearch(){return!1}HybridQuery(e,t){return this.QueryIndex({vector:e.vector,topK:e.topK,includeMetadata:e.includeMetadata,includeValues:e.includeValues,filter:e.filter},t)}MetadataFilteredQuery(e,t){let r=this.BuildMetadataFilter(e.metadataFilter),o={...e,filter:r??e.filter};return delete o.metadataFilter,this.QueryIndex(o,t)}BuildMetadataFilter(e){return Lh.FromOptions(e)}get SupportsColocatedQuery(){return!1}get QueryKeyIsEntityDocumentID(){return!1}get RequiresAPIKey(){return!0}SetColocatedHost(e){this.ColocatedHost=e}TryWireColocatedHost(e){return this.SupportsColocatedQuery&&SF(e)?(this.SetColocatedHost(e),!0):!1}ColocatedQuery(e,t){return Promise.reject(new Error("ColocatedQuery is not supported by this provider (SupportsColocatedQuery is false)"))}GetSourceRecordFieldPaths(e){return[]}BuildProviderDirectives(e,t){return{}}wrapSuccessResponse(e){return{success:!0,message:"",data:e}}wrapFailureResponse(e){return{success:!1,message:e||"An error occurred",data:null}}};var LX=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},FX=function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},sI=new Map,aI=class extends yo{static{a(this,"SimpleVectorDatabase")}constructor(e){super(e&&e.trim().length>0?e:"in-memory-no-auth")}get ManagesIndexes(){return!1}async loadIndexConfig(e,t){let o=await new ft().RunView({EntityName:"MJ: Vector Indexes",ExtraFilter:`Name='${Ci(e)}'`,Fields:["ID","ProviderConfig"],ResultType:"simple",MaxRows:1,SkipTotalRowCount:!0},t);if(!o.Success)return B(`SimpleVectorDatabase.loadIndexConfig: RunView failed for "${e}": ${o.ErrorMessage}`),null;if((o.Results?.length??0)===0)return B(`SimpleVectorDatabase.loadIndexConfig: no MJVectorIndex row with Name="${e}"`),null;let i=o.Results[0].ProviderConfig;if(!i)return B(`SimpleVectorDatabase.loadIndexConfig: index "${e}" exists but ProviderConfig is empty`),null;try{let s=JSON.parse(i);return!s.entityName||!s.vectorField?(B(`SimpleVectorDatabase.loadIndexConfig: index "${e}" ProviderConfig missing entityName/vectorField`),null):{entityName:s.entityName,vectorField:s.vectorField,binaryVectorField:s.binaryVectorField||void 0,filter:s.filter,titleField:s.titleField,snippetField:s.snippetField}}catch(s){return B(`SimpleVectorDatabase.loadIndexConfig: index "${e}" ProviderConfig JSON parse failed: ${s instanceof Error?s.message:String(s)}`),null}}async loadIndex(e,t){let r=await this.loadIndexConfig(e,t);if(!r)return null;let o=await this.fetchEntityRows(r,t);if(o==null)return null;let{entity:i,rows:s}=o,l=JSON.stringify(r),c=this.rowsFingerprint(s,r,i),u=sI.get(e);if(u&&u.configJSON===l&&u.rowsFingerprint===c)return{config:r,entity:u.entity,service:u.service,rowsByID:u.rowsByID};let{service:f,rowsByID:p}=this.buildServiceFromRows(s,r,i);return sI.set(e,{configJSON:l,entity:i,service:f,rowsFingerprint:c,rowsByID:p}),{config:r,entity:i,service:f,rowsByID:p}}rowsFingerprint(e,t,r){let o=new Array(e.length);for(let s=0;s<e.length;s++){let l=e[s],c=Kn.FromEntityRecord(r,l),u=l.__mj_UpdatedAt,f=u instanceof Date?u.toISOString():String(u??""),p=t.binaryVectorField&&l[t.binaryVectorField]?1:0;o[s]=`${c.ToURLSegment()}${f}${l[t.vectorField]?1:0}${p}`}return(e.length>0?Object.keys(e[0]).sort().join(","):"")+""+o.join("")}async fetchEntityRows(e,t){let o=new Be().EntityByName(e.entityName);if(!o)return null;let s=await new ft().RunView({EntityName:e.entityName,ExtraFilter:e.filter,ResultType:"simple",BypassCache:!0,...e.binaryVectorField?{IncludeBinaryFields:!0}:{}},t);return s.Success?{entity:o,rows:s.Results??[]}:(B(`SimpleVectorDatabase.loadIndex: RunView on "${e.entityName}" failed: ${s.ErrorMessage}`),null)}buildServiceFromRows(e,t,r){let o=new Dr,i=[],s=new Map,l=null,c=0;for(let u of e){let f=Kn.FromEntityRecord(r,u);if(!f.HasValue)continue;let p=this.readRowVector(u,t);if(!p)continue;if(l??=p.length,p.length!==l){c++;continue}let m=f.ToURLSegment();i.push({key:m,vector:p,metadata:u}),s.set(m,u)}return c>0&&B(`SimpleVectorDatabase: skipped ${c} "${t.entityName}" row(s) whose ${t.vectorField} has a different dimension count than the rest (${l}) \u2014 re-embed them with one model`),o.LoadVectors(i),{service:o,rowsByID:s}}readRowVector(e,t){if(t.binaryVectorField){let o=e[t.binaryVectorField],i=typeof o=="string"?tI(o):null;if(i)return i}let r=e[t.vectorField];return typeof r=="string"?eI(r):Array.isArray(r)&&r.length>0&&r.every(o=>typeof o=="number"&&Number.isFinite(o))?r:null}buildMatchMetadata(e,t,r){let o=Kn.FromEntityRecord(r,e),i={Entity:t.entityName,RecordID:o.HasValue?o.ToURLSegment():""};return t.titleField&&e[t.titleField]!=null&&(i.Title=String(e[t.titleField])),t.snippetField&&e[t.snippetField]!=null&&(i.Snippet=String(e[t.snippetField])),e.__mj_UpdatedAt!=null&&(i.__mj_UpdatedAt=e.__mj_UpdatedAt),i}async QueryIndex(e,t){let r=e,o=String(r.id??""),i=r.vector,s=Number(r.topK??10);if(!o||!Array.isArray(i)||i.length===0)return B(`SimpleVectorDatabase.QueryIndex: missing indexName="${o}" or vector (length ${Array.isArray(i)?i.length:"n/a"})`),{success:!1,message:"Missing indexName or vector",data:null};let l=yF(r.filter);if(l.Status==="unsupported")return B(`SimpleVectorDatabase.QueryIndex: index="${o}" cannot apply its metadata filter \u2014 ${l.Reason}. The query is refused rather than run unfiltered.`),{success:!1,message:`Unsupported metadata filter: ${l.Reason}`,data:null};let c=await this.loadIndex(o,t);if(!c)return{success:!1,message:`Index "${o}" not configured`,data:null};yt(`SimpleVectorDatabase.QueryIndex: index="${o}" loaded ${c.service.Size} vectors, querying topK=${s}${l.Status==="ok"?" with a metadata filter":""}`);let u=l.Status==="ok"?this.rowFilter(l.Predicate,c.config,c.entity):void 0,f=c.service.FindNearest(i,s,0,"cosine",u);return{success:!0,message:`Returned ${f.length} match(es)`,data:{matches:f.map(p=>({id:p.key,score:p.score,metadata:this.buildMatchMetadata(c.rowsByID.get(p.key)??{},c.config,c.entity)}))}}}rowFilter(e,t,r){return o=>e(a(s=>{switch(s){case"Entity":case"EntityName":return t.entityName;case"SourceType":return"entity";case"RecordID":return Kn.FromEntityRecord(r,o).ToURLSegment();default:return o[s]}},"read"))}get IsReadOnly(){return!0}get RequiresAPIKey(){return!1}ListIndexes(){return{indexes:[]}}GetIndex(e){return this.unsupported("GetIndex")}CreateIndex(e){return this.unsupported("CreateIndex")}DeleteIndex(e){return this.unsupported("DeleteIndex")}EditIndex(e){return this.unsupported("EditIndex")}CreateRecord(e){return this.unsupported("CreateRecord")}CreateRecords(e){return this.unsupported("CreateRecords")}GetRecord(e){return this.unsupported("GetRecord")}GetRecords(e){return this.unsupported("GetRecords")}UpdateRecord(e){return this.unsupported("UpdateRecord")}UpdateRecords(e){return this.unsupported("UpdateRecords")}DeleteRecord(e){return this.unsupported("DeleteRecord")}DeleteRecords(e){return this.unsupported("DeleteRecords")}DeleteAllRecords(e){return sI.clear(),{success:!0,message:"cache cleared",data:null}}ListVectorIDs(e){let t={IDs:[],NextPaginationToken:void 0};return Promise.resolve(t)}unsupported(e){return{success:!1,message:`SimpleVectorDatabase does not support ${e} \u2014 embeddings are read directly from the entity row's vector column. Use Pinecone/pgvector/Qdrant for ingestion.`,data:null}}};aI=LX([Z(yo,"SimpleVectorDatabase"),FX("design:paramtypes",[String])],aI);var OX=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},UX=function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},lI,Fh="MJ: Entity Record Documents",VX=["id","entitydocumentid","recordid","vectorjson","vectorbinary"];function $X(n){let e=TI(n?.ID);if(!n||e===null)return null;let t=new Be().EntityByName(Fh),r=t?.GetUserPermisions(n)?.CanRead===!0;if(!t||!r)return{Key:e,RowFiltered:!0};let o=t.GetEffectiveRowFilterWhereClause(n,qh.Read,"")??"",i=Array.from(t.GetDeniedReadFields(n)??[]).map(s=>s.trim().toLowerCase()).filter(s=>VX.includes(s)).sort();return{Key:`pc:rls=${o}|deny=${i.join(",")}`,RowFiltered:o.length>0||i.length>0}}a($X,"permissionClassOf");var cI=class{static{a(this,"LoadInProgress")}constructor(e,t,r,o){this.EntityDocumentID=e,this.Epoch=t,this.ContextUser=r,this.Class=o,this.Pending=[],this.StaleOnArrival=!1,this.Promise=Promise.resolve(null)}},BX=900*1e3,GX=64,HX=250,EF=500,wr=class extends Ar{static{a(this,"SimpleVectorIndexCache")}constructor(){super(),this.indexCache=new Map,this.inFlightLoads=new Map,this.loadEpochs=new Map,this.remoteRefreshIDs=new Map,this.remoteRefreshTimer=null,this.ttlMs=BX,this.maxIndexes=GX,this.subscribedToBaseEntityEvents=!1,this.subscribeToBaseEntityEvents()}static get Instance(){return super.getInstance()}get TtlMs(){return this.ttlMs}set TtlMs(e){this.ttlMs=e}get MaxIndexes(){return this.maxIndexes}set MaxIndexes(e){this.maxIndexes=Math.max(1,Math.floor(e)),this.evictOverCapacity()}get Size(){return this.indexCache.size}cacheKey(e,t){return`${e}|${t.Key}`}touch(e,t){this.indexCache.delete(e),this.indexCache.set(e,t)}evictOverCapacity(){for(let e of this.indexCache.keys()){if(this.indexCache.size<=this.maxIndexes)return;this.indexCache.delete(e)}}async GetOrLoad(e,t,r){let o=$X(t);if(o===null)return Promise.resolve().then(r);let i=this.cacheKey(e,o),s=this.indexCache.get(i);return s?(this.touch(i,s),(s.stale||Date.now()-s.loadedAt>=this.ttlMs)&&this.startLoad(i,e,t,o,r),s):this.startLoad(i,e,t,o,r)}startLoad(e,t,r,o,i){let s=this.epochOf(t),l=this.inFlightLoads.get(e);if(l&&l.Epoch===s)return l.Promise;let c=new cI(t,s,r,o);return c.Promise=this.runLoad(e,c,i),this.inFlightLoads.set(e,c),c.Promise.catch(u=>{B(`SimpleVectorIndexCache: load failed for EntityDocumentID="${t}": ${u instanceof Error?u.message:String(u)}`)}),c.Promise}async runLoad(e,t,r){try{let o=await Promise.resolve().then(r);if(o&&t.Epoch===this.epochOf(t.EntityDocumentID)){let i={...o,permissionClass:t.Class.Key,rowFiltered:t.Class.RowFiltered};return this.replayPendingChanges(t,i),t.StaleOnArrival&&(i.stale=!0),this.indexCache.delete(e),this.indexCache.set(e,i),this.evictOverCapacity(),i}return o}finally{this.inFlightLoads.get(e)===t&&this.inFlightLoads.delete(e)}}epochOf(e){return this.loadEpochs.get(e)??0}bumpEpoch(e){this.loadEpochs.set(e,this.epochOf(e)+1)}Invalidate(e){this.indexCache.forEach((t,r)=>{t.entityDocumentId===e&&this.indexCache.delete(r)}),this.bumpEpoch(e)}InvalidateAll(){this.indexCache.clear(),this.inFlightLoads.forEach(e=>this.bumpEpoch(e.EntityDocumentID))}MarkAllStale(){this.indexCache.forEach(e=>{e.stale=!0}),this.inFlightLoads.forEach(e=>{e.StaleOnArrival=!0})}ApplyRowChange(e){this.applyRowChangeWhere(e,t=>!t.Class.RowFiltered),e.ID&&this.hasRowFilteredIndexes()&&this.queueRowReRead(e.ID,!1)}ApplyRowRemoval(e){this.applyRowRemovalWhere(e,()=>!0)}hasRowFilteredIndexes(){for(let e of this.indexCache.values())if(e.rowFiltered)return!0;for(let e of this.inFlightLoads.values())if(e.Class.RowFiltered)return!0;return!1}applyRowChangeWhere(e,t){if(!e.ID)return;let r=e.EntityDocumentID||null,o=!1;this.indexCache.forEach(i=>{t(IF(i))&&(i.entityDocumentId!==r?i.service.RemoveVector(e.ID):this.applyRowToIndex(i,e)||(o=!0))}),this.inFlightLoads.forEach(i=>{t(i)&&i.Pending.push(i.EntityDocumentID===r?{Kind:"upsert",Row:e}:{Kind:"remove",ID:e.ID})}),o&&r&&this.Invalidate(r)}applyRowRemovalWhere(e,t){this.indexCache.forEach(r=>{t(IF(r))&&r.service.RemoveVector(e)}),this.inFlightLoads.forEach(r=>{t(r)&&r.Pending.push({Kind:"remove",ID:e})})}applyRowToIndex(e,t){let r=nI(t.VectorBinary,t.VectorJSON);if(!r||!t.RecordID)return e.service.RemoveVector(t.ID),!0;let o=e.service.ExpectedDimensions;return o!==null&&o!==r.length?!1:(e.service.AddOrUpdateVector(t.ID,r,{RecordID:t.RecordID}),!0)}replayPendingChanges(e,t){for(let r of e.Pending)r.Kind==="remove"?t.service.RemoveVector(r.ID):this.applyRowToIndex(t,r.Row)||(t.stale=!0)}subscribeToBaseEntityEvents(){if(!this.subscribedToBaseEntityEvents){this.subscribedToBaseEntityEvents=!0;try{dt.Instance.GetEventListener(!1).subscribe(e=>{if(e.event!==vo.ComponentEvent||e.eventCode!==Eo.BaseEventCode)return;let t=e.args;t&&this.HandleEntityEvent(t)})}catch(e){B(`SimpleVectorIndexCache: failed to subscribe to BaseEntity events: ${e instanceof Error?e.message:String(e)}`)}}}HandleEntityEvent(e){if(e.type!=="save"&&e.type!=="delete"&&e.type!=="remote-invalidate"||(e.baseEntity?.EntityInfo?.Name??e.entityName)!==Fh)return;if(e.type==="remote-invalidate"){this.handleRemoteInvalidate(e.payload);return}if(!e.baseEntity){this.MarkAllStale();return}let r=e.baseEntity;e.type==="delete"?this.ApplyRowRemoval(r.ID):this.ApplyRowChange({ID:r.ID,EntityDocumentID:r.EntityDocumentID,RecordID:r.RecordID,VectorJSON:r.VectorJSON,VectorBinary:r.VectorBinary})}handleRemoteInvalidate(e){let t=e?.primaryKeyValues?qX(e.primaryKeyValues):null;if(e?.action==="delete"&&t){this.ApplyRowRemoval(t);return}if(e?.action==="save"){let r=e.recordData?zX(e.recordData):null;if(r){this.ApplyRowChange(r);return}if(t){this.queueRowReRead(t,!0);return}}this.MarkAllStale()}queueRowReRead(e,t){this.indexCache.size===0&&this.inFlightLoads.size===0||(this.remoteRefreshIDs.set(e,t||this.remoteRefreshIDs.get(e)===!0),!this.remoteRefreshTimer&&(this.remoteRefreshTimer=setTimeout(()=>{this.remoteRefreshTimer=null,this.refreshQueuedRows().catch(r=>{B(`SimpleVectorIndexCache: re-reading changed EntityRecordDocument rows failed: ${r instanceof Error?r.message:String(r)}`),this.MarkAllStale()})},HX)))}async refreshQueuedRows(){let e=Array.from(this.remoteRefreshIDs);this.remoteRefreshIDs.clear();for(let[t,{ContextUser:r,RowFiltered:o}]of this.loadedClasses()){let i=a(l=>l.Class.Key===t,"includeUser"),s=e.filter(([,l])=>l||o).map(([l])=>l);for(let l=0;l<s.length;l+=EF){let c=s.slice(l,l+EF);if(!await this.refreshRows(c,r,i)){this.MarkAllStale();return}}}}async refreshRows(e,t,r){let o=e.map(l=>`'${Ci(l)}'`).join(","),i;try{i=await new ft().RunView({EntityName:Fh,ExtraFilter:`ID IN (${o})`,Fields:["ID","EntityDocumentID","RecordID","VectorJSON","VectorBinary"],ResultType:"simple",BypassCache:!0},t)}catch(l){return B(`SimpleVectorIndexCache: re-reading ${e.length} changed EntityRecordDocument row(s) threw: ${l instanceof Error?l.message:String(l)}`),!1}if(!i.Success)return B(`SimpleVectorIndexCache: re-reading ${e.length} changed EntityRecordDocument row(s) failed: ${i.ErrorMessage}`),!1;let s=new Set;for(let l of i.Results??[])s.add(l.ID),this.applyRowChangeWhere(l,r);for(let l of e)s.has(l)||this.applyRowRemovalWhere(l,r);return!0}loadedClasses(){let e=new Map;return this.indexCache.forEach(t=>e.set(t.permissionClass,{ContextUser:t.contextUser,RowFiltered:t.rowFiltered})),this.inFlightLoads.forEach(t=>e.set(t.Class.Key,{ContextUser:t.ContextUser,RowFiltered:t.Class.RowFiltered})),e}};function IF(n){return{Class:{Key:n.permissionClass,RowFiltered:n.rowFiltered}}}a(IF,"targetOfIndex");function qX(n){try{let e=JSON.parse(n),t=Array.isArray(e)?e.find(r=>r?.FieldName==="ID"):void 0;return t?.Value?String(t.Value):null}catch{return null}}a(qX,"parsePrimaryKeyID");function zX(n){try{let e=JSON.parse(n);return!e||typeof e.ID!="string"||typeof e.EntityDocumentID!="string"||!("VectorJSON"in e)&&!("VectorBinary"in e)?null:{ID:e.ID,EntityDocumentID:e.EntityDocumentID,RecordID:typeof e.RecordID=="string"?e.RecordID:"",VectorJSON:typeof e.VectorJSON=="string"?e.VectorJSON:null,VectorBinary:typeof e.VectorBinary=="string"?e.VectorBinary:null}}catch{return null}}a(zX,"parseRecordData");var uI=lI=class extends yo{static{a(this,"SimpleVectorServiceProvider")}static get TtlMs(){return wr.Instance.TtlMs}static set TtlMs(e){wr.Instance.TtlMs=e}constructor(e){super(e&&e.trim().length>0?e:"in-memory-no-auth")}get IsReadOnly(){return!0}get RequiresAPIKey(){return!1}get ManagesIndexes(){return!1}get QueryKeyIsEntityDocumentID(){return!0}static InvalidateIndex(e){wr.Instance.Invalidate(e)}static InvalidateAll(){wr.Instance.InvalidateAll()}static get CacheSize(){return wr.Instance.Size}loadIndex(e,t){return wr.Instance.GetOrLoad(e,t,async()=>{let o=await new ft().RunView({EntityName:Fh,ExtraFilter:`EntityDocumentID='${Ci(e)}' AND (VectorBinary IS NOT NULL OR VectorJSON IS NOT NULL)`,Fields:["ID","RecordID","VectorJSON","VectorBinary"],ResultType:"simple",IgnoreMaxRows:!0},t);if(!o.Success)return B(`SimpleVectorServiceProvider.loadIndex: RunView failed for EntityDocumentID="${e}": ${o.ErrorMessage}`),null;let i=this.buildService(e,o.Results??[]);return{entityDocumentId:e,service:i,loadedAt:Date.now(),contextUser:t,stale:!1}})}buildService(e,t){let r=new Dr({Precision:"float32"}),o=0;for(let i of t){if(!i.ID||!i.RecordID)continue;let s=nI(i.VectorBinary,i.VectorJSON);if(s){if(r.ExpectedDimensions===null&&r.ReserveCapacity(t.length,s.length),s.length!==r.ExpectedDimensions){o++;continue}r.AddVector(i.ID,s,{RecordID:i.RecordID})}}return o>0&&B(`SimpleVectorServiceProvider: skipped ${o} EntityRecordDocument row(s) for EntityDocumentID="${e}" whose vector dimensions differ from the rest \u2014 re-run vector sync for that document`),r}async QueryIndex(e,t){let r=e,o=String(r.id??""),i=r.vector,s=Number(r.topK??10);if(!o||!Array.isArray(i))return{success:!1,message:"Missing EntityDocumentID or query vector",data:null};let l=await this.loadIndex(o,t);if(!l)return{success:!1,message:`Failed to load index for EntityDocumentID="${o}"`,data:null};if(l.service.Size===0)return{success:!0,message:"No embedded records yet",data:{matches:[]}};let c=await l.service.FindNearestAsync(i,s,void 0,"cosine-similarity");return{success:!0,message:`Returned ${c.length} match(es)`,data:{matches:c.map(u=>({id:u.key,score:u.score,metadata:{RecordID:u.metadata?.RecordID??null}}))}}}ListIndexes(){return{indexes:[]}}GetIndex(e){return this.unsupported("GetIndex")}CreateIndex(e){return this.unsupported("CreateIndex")}DeleteIndex(e){return this.unsupported("DeleteIndex")}EditIndex(e){return this.unsupported("EditIndex")}CreateRecord(e){return this.unsupported("CreateRecord")}CreateRecords(e){return this.unsupported("CreateRecords")}GetRecord(e){return this.unsupported("GetRecord")}GetRecords(e){return this.unsupported("GetRecords")}UpdateRecord(e){return this.unsupported("UpdateRecord")}UpdateRecords(e){return this.unsupported("UpdateRecords")}DeleteRecord(e){return this.unsupported("DeleteRecord")}DeleteRecords(e){return this.unsupported("DeleteRecords")}DeleteAllRecords(e){return lI.InvalidateAll(),{success:!0,message:"cache cleared",data:null}}ListVectorIDs(e){let t={IDs:[],NextPaginationToken:void 0};return Promise.resolve(t)}unsupported(e){return{success:!1,message:`SimpleVectorServiceProvider does not support ${e} \u2014 embeddings are read directly from MJ: Entity Record Documents.VectorJSON. Use the vector-sync pipeline (or a remote VectorDB provider) for ingestion.`,data:null}}};uI=lI=OX([Z(yo,"SimpleVectorServiceProvider"),UX("design:paramtypes",[String])],uI);var WX=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},Qs=class{static{a(this,"RuntimeUtilities")}constructor(){this.debug=!1}BuildUtilities(e=!1,t){return this.debug=e,this.provider=t??Be.Provider,this.setupUtilities(this.provider)}buildUtilities(e=!1,t){return this.BuildUtilities(e,t)}setupUtilities(e){let t=ft.FromMetadataProvider(e),r=new wI(e);return{md:this.createSimpleMetadata(e),rv:this.createSimpleRunView(t),rq:this.createSimpleRunQuery(r),ai:this.createSimpleAITools(),geoDataEngine:this.createSimpleGeoDataEngine(),ml:this.createSimpleMLTools()}}createSimpleAITools(){let e=Eo.Provider;if(!(e instanceof Jh))throw new Error("Current data provider is not a GraphQLDataProvider. AI tools require GraphQL provider.");let t=e;return{ExecutePrompt:a(async r=>{try{let o=await t.AI.ExecuteSimplePrompt({systemPrompt:r.systemPrompt,messages:r.messages,preferredModels:r.preferredModels,modelPower:r.modelPower});return console.log("\u{1F916} ExecutePrompt succeeded!"),this.debug&&(console.log(" > params",r),console.log(" > result:",o)),{success:o.success,result:o.result||"",resultObject:o.resultObject,modelName:o.modelName||""}}catch(o){return B(o),{success:!1,result:"Failed to execute prompt: "+(o instanceof Error?o.message:String(o)),modelName:""}}},"ExecutePrompt"),EmbedText:a(async r=>{try{let o=await t.AI.EmbedText({textToEmbed:r.textToEmbed,modelSize:r.modelSize,inputType:r.inputType});if(o.error)throw new Error(o.error||"Failed to generate embeddings");let i=Array.isArray(r.textToEmbed)?o.embeddings?.length:1;return console.log(`\u{1F916} EmbedText succeeded! ${i} embeddings returned`),this.debug&&(console.log(" > params",r),console.log(" > result:",o)),{result:o.embeddings,modelName:o.modelName,vectorDimensions:o.vectorDimensions}}catch(o){throw B(o),o}},"EmbedText"),VectorService:new Dr}}createSimpleMLTools(){let e=Eo.Provider;if(!(e instanceof Jh))return;let t=e;return{listModels:a((r,o)=>this.listMLModels(r,o),"listModels"),score:a((r,o,i)=>this.scoreMLRecords(t,r,o,i),"score")}}async listMLModels(e,t){try{let o=await ft.FromMetadataProvider(this.provider).RunView({EntityName:"MJ: ML Models",ExtraFilter:this.buildMLModelsFilter(e),OrderBy:"Version DESC",MaxRows:e?.maxResults,ResultType:"entity_object"},t);return o.Success?o.Results.map(i=>this.mapMLModel(i)):(console.error(`\u274C listModels failed for MJ: ML Models: ${o.ErrorMessage}`),[])}catch(r){return B(r),[]}}buildMLModelsFilter(e){let t=[],r=e?.status??"Published";return t.push(`Status='${this.escapeSqlLiteral(r)}'`),e?.targetVariable&&t.push(`TargetVariable='${this.escapeSqlLiteral(e.targetVariable)}'`),t.join(" AND ")}mapMLModel(e){return{id:e.ID,pipeline:e.Pipeline,version:e.Version,targetVariable:e.TargetVariable,problemType:e.ProblemType,status:e.Status,metrics:this.parseMLMetrics(e.Metrics),holdoutMetrics:this.parseMLMetrics(e.HoldoutMetrics)}}parseMLMetrics(e){if(e)try{let t=JSON.parse(e);return t&&typeof t=="object"?t:void 0}catch{return}}async scoreMLRecords(e,t,r,o){let i=this.normalizeRecordKeys(r,o?.primaryKeyField??"ID");try{let s={modelId:t,scope:{records:i}},c=await new FI().Execute(s,{provider:e,user:o?.contextUser});if(!c.Success||!c.Output)return console.error(`\u274C score failed for model ${t}: ${c.ErrorMessage}`),{scoredCount:0,failedCount:i.length,skippedCount:0,predictions:[]};let u=c.Output;return{scoredCount:u.scored,failedCount:u.failed,skippedCount:u.skipped,predictions:(u.predictions??[]).map(f=>({recordId:f.recordId,score:f.score,class:f.class}))}}catch(s){return B(s),{scoredCount:0,failedCount:i.length,skippedCount:0,predictions:[]}}}normalizeRecordKeys(e,t){let r=[];for(let o of e)if(typeof o=="string")r.push(o);else if(o!=null){let i=o[t];i!=null&&r.push(String(i))}return r}escapeSqlLiteral(e){return e.replace(/'/g,"''")}createSimpleMetadata(e){return{Entities:e.Entities,GetEntityObject:a(t=>e.GetEntityObject(t),"GetEntityObject")}}createSimpleGeoDataEngine(){try{let e=UI.Instance;return e?{ResolvePointToLocation:a((t,r)=>e.ResolvePointToLocation(t,r),"ResolvePointToLocation"),EnsureLoaded:a(()=>e.EnsureLoaded(),"EnsureLoaded"),get Loaded(){return e.Loaded}}:void 0}catch{return}}createSimpleRunQuery(e){return{RunQuery:a(async t=>{try{let r=await e.RunQuery(t);return r.Success?(console.log(`\u2705 RunQuery "${t.QueryName}" succeeded: ${r.RowCount} rows returned`),this.debug&&(console.log(" > params",t),console.log(" > result:",r))):console.error(`\u274C RunQuery failed: ${r.ErrorMessage}`),r}catch(r){throw console.error("\u274C RunQuery threw exception:",r),B(r),r}},"RunQuery")}}createSimpleRunView(e){return{RunView:a(async t=>{try{let r=await e.RunView(t);return r.Success?(console.log(`\u2705 RunView succeeded for ${t.EntityName}: ${r.TotalRowCount} rows returned`),this.debug&&(console.log(" > params",t),console.log(" > result:",r))):console.error(`\u274C RunView failed for ${t.EntityName}: ${r.ErrorMessage}`),r}catch(r){throw console.error("\u274C RunView threw exception:",r),B(r),r}},"RunView"),RunViews:a(async t=>{try{let r=await e.RunViews(t),o=t.map(s=>s.EntityName).join(", "),i=r.reduce((s,l)=>s+(l.TotalRowCount||0),0);return console.log(`\u2705 RunViews succeeded for [${o}]: ${i} total rows returned`),this.debug&&(console.log(" > params",t),console.log(" > results:",r)),r}catch(r){throw console.error("\u274C RunViews threw exception:",r),B(r),r}},"RunViews")}}};Qs=WX([Z(Qs,"RuntimeUtilities")],Qs);function _F(){try{let n=dt.Instance.ClassFactory.CreateInstance(Qs);if(n)return n}catch{}return new Qs}a(_F,"CreateRuntimeUtilities");function dI(){return _F()}a(dI,"createRuntimeUtilities");function KX(n){if(!n)return null;if(Array.isArray(n))return n.length>0?Kn.FromKeyValuePairs(n):null;if(typeof n.GetValueByFieldName=="function")return n;let e=n;return e.FieldName!==void 0&&e.Value!==void 0?Kn.FromKeyValuePairs([e]):null}a(KX,"coerceToCompositeKey");async function TF(n,e,t,r){let o=KX(e);if(!o)return null;let i=t.EntityByName(n);if(!i)return console.warn(`OpenEntityRecord: entity not found: ${n}`),null;let s=!1;for(let f of o.KeyValuePairs){let p=i.Fields.find(m=>m.Name.trim().toLowerCase()===f.FieldName.trim().toLowerCase());if(!p)return console.warn(`OpenEntityRecord: non-matching field for key ${JSON.stringify(o)}`),null;if(!p.IsPrimaryKey){s=!0;break}}if(!s)return o;let c=await ft.FromMetadataProvider(t).RunView({EntityName:n,ExtraFilter:o.ToWhereClause()},r);if(!c?.Success||c.Results.length===0)return null;let u=c.Results[0];return Kn.FromKeyValuePairs(i.PrimaryKeys.map(f=>({FieldName:f.Name,Value:u[f.Name]})))}a(TF,"ResolveEntityRecordKey");async function fI(n,e,t,r){return TF(n,e,t,r)}a(fI,"resolveEntityRecordKey");var hI=class{static{a(this,"ComponentErrorAnalyzer")}static{this.ERROR_PATTERNS=[{pattern:/ReferenceError: (\w+) is not defined/,errorType:"not_defined",extractComponent:a(e=>e[1],"extractComponent")},{pattern:/Cannot read propert(?:y|ies) '(\w+)' of undefined/,errorType:"property_error",extractComponent:a(e=>e[1],"extractComponent")},{pattern:/(\w+)\(\.\.\.\): Nothing was returned from render/,errorType:"render_error",extractComponent:a(e=>e[1],"extractComponent")},{pattern:/at (\w+Component\w*)/,errorType:"stack_trace",extractComponent:a(e=>e[1],"extractComponent")},{pattern:/Error: Unable to find node on an unmounted component/,errorType:"unmounted_component",extractComponent:a(()=>null,"extractComponent")},{pattern:/Invalid hook call.*component (\w+)/,errorType:"invalid_hook",extractComponent:a(e=>e[1],"extractComponent")},{pattern:/TypeError:.*in (\w+) \(at/,errorType:"type_error",extractComponent:a(e=>e[1],"extractComponent")},{pattern:/Module not found: Error: Can't resolve '\.\/(\w+)'/,errorType:"missing_import",extractComponent:a(e=>e[1],"extractComponent")},{pattern:/(\w+) is not a function/,errorType:"not_a_function",extractComponent:a(e=>e[1],"extractComponent")},{pattern:/Minified React error.*Visit.*for the full message.*component[: ](\w+)/s,errorType:"react_error",extractComponent:a(e=>e[1],"extractComponent")}]}static IdentifyFailedComponents(e){let t=new Set;for(let r of e)this.extractComponentsFromError(r).forEach(i=>t.add(i));return Array.from(t)}static identifyFailedComponents(e){return this.IdentifyFailedComponents(e)}static AnalyzeComponentErrors(e){let t=[];for(let o of e){let i=this.analyzeError(o);t.push(...i)}let r=new Map;return t.forEach(o=>{let i=`${o.componentName}-${o.errorType}`;r.has(i)||r.set(i,o)}),Array.from(r.values())}static analyzeComponentErrors(e){return this.AnalyzeComponentErrors(e)}static extractComponentsFromError(e){let t=[];for(let o of this.ERROR_PATTERNS){let i=e.match(o.pattern);if(i){let s=o.extractComponent(i);s&&this.isLikelyComponentName(s)&&t.push(s)}}let r=this.extractComponentsFromStackTrace(e);return t.push(...r),t}static analyzeError(e){let t=[];for(let r of this.ERROR_PATTERNS){let o=e.match(r.pattern);if(o){let i=r.extractComponent(o);i&&this.isLikelyComponentName(i)&&t.push({componentName:i,errorType:r.errorType,errorMessage:e,lineNumber:this.extractLineNumber(e),context:this.extractContext(e)})}}return t.length===0&&this.extractComponentsFromStackTrace(e).forEach(o=>{t.push({componentName:o,errorType:"unknown",errorMessage:e,lineNumber:this.extractLineNumber(e)})}),t}static extractComponentsFromStackTrace(e){let t=[],r=[/at (\w+Component\w*)/g,/at (\w+)\s*\(/g,/in (\w+)\s*\(at/g,/in (\w+)\s*\(created by/g];for(let o of r){let i;for(;(i=o.exec(e))!==null;){let s=i[1];this.isLikelyComponentName(s)&&t.push(s)}}return[...new Set(t)]}static isLikelyComponentName(e){let t=new Set(["Object","Array","String","Number","Boolean","Function","Promise","Error","TypeError","ReferenceError","SyntaxError","undefined","null","console","window","document"]),r=new Set(["render","setState","forceUpdate","props","state","context","componentDidMount","componentWillUnmount","useEffect","useState"]);return e.length>0&&/^[A-Z]/.test(e)&&!t.has(e)&&!r.has(e)&&!/^use[A-Z]/.test(e)}static extractLineNumber(e){let t=[/:(\d+):\d+/,/line (\d+)/i,/Line (\d+)/];for(let r of t){let o=e.match(r);if(o)return parseInt(o[1],10)}}static extractContext(e){let t=e.match(/\(at ([^)]+)\)/);if(t)return t[1];let r=e.match(/created by (\w+)/);if(r)return`Created by ${r[1]}`}static FormatAnalysisResults(e){if(e.length===0)return"No component failures detected";let t=`Detected ${e.length} component failure(s):
|
|
353
353
|
`;return e.forEach((r,o)=>{t+=`
|
|
354
354
|
${o+1}. Component: ${r.componentName}
|
|
355
355
|
`,t+=` Error Type: ${r.errorType}
|
|
@@ -468,4 +468,4 @@ Make sure your component spec includes a "code" property with the React componen
|
|
|
468
468
|
color: #64748B;
|
|
469
469
|
margin-top: 8px;
|
|
470
470
|
}`],changeDetection:0})}};var FF=class n{static{a(this,"MJReactModule")}static{this.\u0275fac=a(function(t){return new(t||n)},"MJReactModule_Factory")}static{this.\u0275mod=si({type:n})}static{this.\u0275inj=Qn({providers:[Zs,ea,Co],imports:[ic]})}};export{x as a,Wt as b,ya as c,$ as d,Qn as e,F as f,le as g,b as h,Pp as i,Ot as j,pe as k,Qp as l,Zp as m,cm as n,dm as o,tt as p,bt as q,St as r,mt as s,Se as t,Xn as u,eu as v,sT as w,yD as x,rs as y,dl as z,Gt as A,Au as B,cU as C,WD as D,KD as E,dU as F,fU as G,hU as H,gn as I,$n as J,ss as K,xU as L,kU as M,LU as N,FU as O,OU as P,rd as Q,yw as R,ty as S,ry as T,od as U,Rw as V,Mw as W,Cl as X,Jo as Y,Yo as Z,oi as _,my as $,Jr as aa,ol as ba,Qo as ca,$e as da,or as ea,jr as fa,Dd as ga,si as ha,Bn as ia,ai as ja,rR as ka,El as la,Vy as ma,$y as na,Hy as oa,pR as pa,mR as qa,Rg as ra,_l as sa,Vn as ta,jy as ua,KR as va,Pd as wa,kd as xa,JR as ya,jR as za,YR as Aa,XR as Ba,Yy as Ca,ir as Da,Xr as Ea,hs as Fa,Ld as Ga,Fd as Ha,Xy as Ia,Od as Ja,Dl as Ka,Qy as La,eM as Ma,tC as Na,sC as Oa,lC as Pa,yM as Qa,CM as Ra,vM as Sa,uC as Ta,Al as Ua,$d as Va,Bd as Wa,dC as Xa,SM as Ya,EM as Za,Gd as _a,Rl as $a,wM as ab,AM as bb,Hd as cb,hC as db,qd as eb,pC as fb,mC as gb,gC as hb,IC as ib,qM as jb,_C as kb,TC as lb,WM as mb,KM as nb,YM as ob,l0 as pb,u0 as qb,d0 as rb,f0 as sb,h0 as tb,p0 as ub,y0 as vb,w0 as wb,A0 as xb,R0 as yb,M0 as zb,P0 as Ab,zd as Bb,uH as Cb,fH as Db,CZ as Eb,vZ as Fb,EZ as Gb,IZ as Hb,RZ as Ib,MH as Jb,MZ as Kb,ci as Lb,xZ as Mb,yb as Nb,kZ as Ob,UH as Pb,VH as Qb,LZ as Rb,FZ as Sb,ah as Tb,q5 as Ub,gE as Vb,ec as Wb,wE as Xb,AE as Yb,RE as Zb,ME as _b,PE as $b,xE as ac,kE as bc,LE as cc,ic as dc,_Y as ec,FE as fc,DY as gc,wce as hc,Th as ic,Ie as jc,qZ as kc,Mb as lc,HH as mc,Rb as nc,Cee as oc,Ob as pc,fr as qc,Oee as rc,iq as sc,Bee as tc,Gee as uc,Bb as vc,Cq as wc,nte as xc,Xf as yc,Vs as zc,$s as Ac,QS as Bc,Lk as Cc,vr as Dc,Ls as Ec,Bs as Fc,mE as Gc,H5 as Hc,nF as Ic,Gce as Jc,Co as Kc,ea as Lc,Uh as Mc,LF as Nc,FF as Oc,rle as Pc,ole as Qc,ile as Rc,sle as Sc,ale as Tc,lle as Uc,_L as Vc};
|
|
471
|
-
//# sourceMappingURL=chunk-
|
|
471
|
+
//# sourceMappingURL=chunk-FS5E33YU.js.map
|