@webjsdev/core 0.7.2 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
1
  function Zn(e,...t){return{_$webjs:"template",strings:e,values:t}}function C(e){return!!e&&typeof e=="object"&&e._$webjs==="template"}var y="w$";function Xn(e,...t){let n=e[0];for(let r=1;r<e.length;r++)n+=String(t[r-1]??"")+e[r];return{_$webjsCss:!0,text:n}}function le(e){return!!e&&typeof e=="object"&&e._$webjsCss===!0}function et(e,t){if(!(!t||!t.length))if("adoptedStyleSheets"in e&&typeof CSSStyleSheet<"u"){let n=t.map(r=>{let o=new CSSStyleSheet;return o.replaceSync(r.text),o});e.adoptedStyleSheets=n}else{let n=e,r=document.createElement("style");r.textContent=t.map(o=>o.text).join(`
2
2
  `),n.appendChild(r)}}function tt(e){return!e||!e.length?"":`<style>${e.map(t=>t.text).join(`
3
- `)}</style>`}function Re(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function I(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}var Ut=Symbol.for("webjs.repeat");function Qn(e,t,n){return{[Ut]:!0,items:[...e],keyFn:t,templateFn:n}}function Z(e){return!!e&&typeof e=="object"&&e[Ut]===!0}function er(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function X(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function tr(e){return{_$webjs:"live",value:e}}function Q(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function ee(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function te(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function fe(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function ne(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function re(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function se(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function ue(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function de(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function oe(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}var O=null,q=!1,ae=0,ie=null,nt=0,Ft=(e,t)=>Object.is(e,t),Oe=()=>{},Dt=()=>!1;function Ht(e,t){e.liveConsumers||(e.liveConsumers=new Set);let n=e.liveConsumers.size===0;if(e.liveConsumers.add(t),n){if(e.producers&&e.producers.length>0)for(let r of e.producers)Ht(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function he(e,t){if(e.liveConsumers&&(e.liveConsumers.delete(t),e.liveConsumers.size===0)){if(e.producers&&e.producers.length>0)for(let n of e.producers)he(n,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(n){console.error(n)}}}function ct(e){if(q)throw new Error("Signal read during notification phase");if(O===null)return;let t=O,n=t.nextProducerIndex++;n<t.producers.length&&t.producers[n]!==e&&ot(t)&&he(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,ot(t)&&Ht(e,t)),t.producerLastReadVersions[n]=e.version}function ot(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function Wt(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=q;q=!0;try{for(let n of e.liveConsumers)n.dirty||nr(n)}finally{q=t}}function nr(e){e.dirty=!0,Wt(e),e.consumerMarkedDirty.call(e.wrapper||e)}function Le(e){if(!(!e.dirty&&e.lastCleanEpoch===ae)){if(!e.producerMustRecompute()&&!rr(e)){e.dirty=!1,e.lastCleanEpoch=ae;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=ae}}function rr(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(Le(n),r!==n.version))return!0}return!1}function it(e){e&&(e.nextProducerIndex=0);let t=O;return O=e,t}function at(e,t){if(O=t,!!e){if(ot(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)he(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var $e=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=ae,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=Dt,this.producerRecomputeValue=Oe,this.consumerMarkedDirty=Oe,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||Ft,this.watched=n?.[lt],this.unwatched=n?.[ft]}get(){return ct(this),this.__value}peek(){return this.__value}set(t){if(q)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,ae++,ie!==null?Vt(this):Wt(this))}};function Vt(e){let t=q;q=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers)n.dirty||(n.dirty=!0,n.__isWatcher?ie.add(n):Vt(n))}finally{q=t}}var rt=Symbol("unset"),st=Symbol("computing"),je=Symbol("errored"),pe=class{constructor(t,n){this.__fn=t,this.__value=rt,this.__error=null,this.version=0,this.lastCleanEpoch=-1,this.dirty=!0,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!1,this.wrapper=this,this.__isSignal=!0,this.__isComputed=!0,this.__equal=n?.equals||Ft,this.watched=n?.[lt],this.unwatched=n?.[ft];let r=this;this.producerMustRecompute=function(){return r.__value===rt||r.__value===st},this.producerRecomputeValue=function(){if(r.__value===st)throw new Error("Detected cycle in computations.");let o=r.__value;r.__value=st;let s=it(r),i,a=!1;try{i=r.__fn.call(r.wrapper)}catch(l){i=je,r.__error=l,a=!0}finally{at(r,s)}if(!a&&(o!==rt&&o!==je)&&r.__equal.call(r.wrapper,o,i)){r.__value=o;return}r.__value=i,r.version++},this.consumerMarkedDirty=Oe}get(){if(Le(this),ct(this),this.__value===je)throw this.__error;return this.__value}peek(){if(Le(this),this.__value===je)throw this.__error;return this.__value}},Me=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=ae,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=Dt,this.producerRecomputeValue=Oe,this.wrapper=this,this.__isWatcher=!0;let n=this;this.consumerMarkedDirty=function(){n.__fire()}}__fire(){this.__notify&&this.__notify.call(this)}watch(...t){if(t.length===0){this.dirty=!1;return}let n=it(this);try{for(let r of t)ct(r),r.__isComputed&&Le(r)}finally{at(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(he(this.producers[n],this),this.producers.splice(n,1),this.producerLastReadVersions.splice(n,1),this.nextProducerIndex=Math.min(this.nextProducerIndex,this.producers.length))}getPending(){return this.producers.filter(t=>t.__isComputed&&t.dirty)}observe(t){let n=it(this),r;try{r=t()}finally{at(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)he(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},lt=Symbol("watched"),ft=Symbol("unwatched");function sr(e){let t=O;O=null;try{return e()}finally{O=t}}function or(e){return e.producers.slice()}function ir(e){return e.liveConsumers?[...e.liveConsumers]:[]}function ar(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function cr(e){return e.producers.length>0}function lr(){return O&&O.__isComputed?O:null}function fr(e){nt++,ie===null&&(ie=new Set);try{e()}finally{if(nt--,nt===0){let t=ie;ie=null;for(let n of t)n.__fire()}}}var me={State:$e,Computed:pe,subtle:{Watcher:Me,untrack:sr,introspectSources:or,introspectSinks:ir,hasSinks:ar,hasSources:cr,currentComputed:lr,watched:lt,unwatched:ft}};function ur(e,t){return new $e(e,t)}function dr(e,t){return new pe(e,t)}function hr(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function pr(e){let t=!1,n=!1,r=new pe(e),o=new Me(()=>{t||n||(t=!0,queueMicrotask(()=>{if(t=!1,!n){try{r.get()}catch(s){console.error(s)}o.watch()}}))});o.watch(r);try{r.get()}catch(s){console.error(s)}return()=>{n||(n=!0,o.dispose())}}var mr=`${y}s`,gr=`${y}e`;function zt(e){if(!e||e.nodeType!==8)return!1;let t=e.nodeValue;return t===mr||t===gr}function br(e){for(let t of e.addedNodes)if(zt(t))return!0;for(let t of e.removedNodes)if(zt(t))return!0;return!1}function Zt(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}var be=Zt(),V=Symbol("webjs.slot.state"),B="data-webjs-light",z="data-projection",ye="actual",Xt="fallback",Be=Symbol("webjs.slot.fallbackFrag"),yr=64,ge=null,ut=null,Ie=null,Kt=!1;function _r(){Kt||(be=Zt(),be&&(ge=HTMLSlotElement.prototype.assignedNodes,ut=HTMLSlotElement.prototype.assignedElements,Ie=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(t){return this.hasAttribute(B)&&!Gt(this)?dt(this,t):ge?ge.call(this,t):[]},HTMLSlotElement.prototype.assignedElements=function(t){return this.hasAttribute(B)&&!Gt(this)?dt(this,t).filter(n=>n.nodeType===1):ut?ut.call(this,t):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let t=Ie&&Ie.get?Ie.get.call(this):null;return t||wr(this)}}),Kt=!0))}_r();function Gt(e){let t=e;for(let n=0;n<128;n++){let r=t.parentNode;if(!r||r===t)return!1;if(r.host)return!0;t=r}return!1}function dt(e,t){if(e.getAttribute(z)===Xt)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:ht(n,new Set,0)}function ht(e,t,n){if(n>=yr)return e.slice();let r=[];for(let o of e)if(o.nodeType===1&&o.tagName==="SLOT"){let s=o;if(t.has(s))continue;if(t.add(s),s.hasAttribute(B)){let i=dt(s,{flatten:!1});if(i.length>0)for(let a of ht(i,t,n+1))r.push(a);else for(let a of ht(Array.from(s.childNodes),t,n+1))r.push(a)}else if(ge){let i=ge.call(s,{flatten:!0});for(let a of i)r.push(a)}else r.push(o)}else r.push(o);return r}function wr(e){let t=e.parentElement;for(;t;){if(t.tagName==="SLOT"&&t.hasAttribute(B))return t.getAttribute(z)===ye?t:null;t=t.parentElement}return null}function U(e){let t=e,n=t[V];return n||(n={assignedByName:new Map,pendingByName:new Map,lastSnapshot:new WeakMap,nameObservers:new WeakMap,childObserver:null,scheduled:!1,ownedSlots:new Set},t[V]=n),n}function pt(e){return!!e[V]}function Qt(e){let t=U(e);for(;e.firstChild;){let n=e.firstChild,r=Pe(n);qe(t.assignedByName,r,n),e.removeChild(n)}}function en(e){let t=U(e),n=e.querySelectorAll(`slot[${B}]`);for(let r of n){let o=r;if(o.getAttribute(z)!==ye)continue;let s=o.getAttribute("name")||null;if(!t.assignedByName.has(s)){let i=Array.from(o.childNodes);t.assignedByName.set(s,i),t.lastSnapshot.set(o,i.slice())}}}function Pe(e){if(e.nodeType!==1)return null;let n=e.getAttribute("slot");return n||null}function qe(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}function tn(e,t,n){if(!n.length)return;let r=e.get(t);r||(r=[],e.set(t,r));for(let o of n)r.push(o)}function nn(e){if(!be)return;let t=U(e);t.childObserver||(t.childObserver=new MutationObserver(n=>{let r=!1;for(let o of n)if(!br(o)){if(o.type==="childList"){for(let s of o.addedNodes)s.parentElement===e&&(qe(t.assignedByName,Pe(s),s),r=!0);for(let s of o.removedNodes)e.contains(s)||Jt(t,s)&&(r=!0)}else if(o.type==="attributes"&&o.attributeName==="slot"){let s=o.target;(Jt(t,s)||s.parentElement===e)&&(qe(t.assignedByName,Pe(s),s),r=!0)}}r&&Ue(e)}),t.childObserver.observe(e,{childList:!0,attributes:!0,attributeFilter:["slot"],subtree:!0}))}function rn(e){let t=e[V];if(t){t.childObserver&&(t.childObserver.disconnect(),t.childObserver=null);for(let n of t.ownedSlots){let r=t.nameObservers.get(n);r&&(r.disconnect(),t.nameObservers.delete(n))}}}function Jt(e,t){for(let[n,r]of e.assignedByName){let o=r.indexOf(t);if(o!==-1)return r.splice(o,1),r.length===0&&e.assignedByName.delete(n),!0}return!1}function Ue(e){let t=U(e);t.scheduled||(t.scheduled=!0,queueMicrotask(()=>{t.scheduled=!1,Sr(e)}))}function Sr(e){if(!be)return;let t=e[V];if(!t)return;let n=Array.from(e.querySelectorAll(`slot[${B}]`)),r=new Set(n);for(let i of t.ownedSlots)r.has(i)||Ar(t,i);for(let i of r)t.ownedSlots.has(i)||kr(e,i);t.ownedSlots=r;let o=new Map;for(let i of n){let a=i.getAttribute("name")||null,c=o.get(a);c||(c=[],o.set(a,c)),c.push(i)}for(let i of o.keys()){let a=t.pendingByName.get(i);if(a&&a.length){let c=t.assignedByName.get(i)||[],l=[];for(let d of a)l.push(d);for(let d of c)l.indexOf(d)===-1&&l.push(d);t.assignedByName.set(i,l),t.pendingByName.delete(i)}}let s=[];for(let[i,a]of o){let c=t.assignedByName.get(i)||[];for(let l=0;l<a.length;l++){let d=a[l];l===0&&c.length>0?Cr(t,d,c)&&s.push(d):xr(t,d)&&s.push(d)}}for(let i of s)Nr(i)}function Ar(e,t){let n=e.nameObservers.get(t);n&&(n.disconnect(),e.nameObservers.delete(t));let r=e.lastSnapshot.get(t);if(r&&r.length>0){let o=t.getAttribute("name")||null;tn(e.pendingByName,o,r)}e.lastSnapshot.delete(t)}function Cr(e,t,n){let r=t.getAttribute(z)!==ye,o=e.lastSnapshot.get(t)||[];if(!r&&Tr(o,n))return!1;let i=t[Be];if(r&&i)for(;t.firstChild;)i.appendChild(t.firstChild);else for(;t.firstChild;)t.removeChild(t.firstChild);for(let a of n)t.appendChild(a);return t.setAttribute(z,ye),e.lastSnapshot.set(t,n.slice()),!0}function xr(e,t){let n=t.getAttribute(z)===ye;if(t.setAttribute(z,Xt),!n)return Yt(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return Yt(t),!0}function Yt(e){let t=e[Be];!t||t.childNodes.length===0||e.appendChild(t)}function kr(e,t){if(!be)return;let n=U(e);if(n.nameObservers.has(t))return;let r=new MutationObserver(()=>Ue(e));r.observe(t,{attributes:!0,attributeFilter:["name"]}),n.nameObservers.set(t,r)}function sn(e,t){if(!pt(e))return;let n=U(e),r=n.lastSnapshot.get(t);if(!r||r.length===0)return;let o=t.getAttribute("name")||null;for(let i of r)i.parentNode===t&&t.removeChild(i);tn(n.pendingByName,o,r),n.lastSnapshot.delete(t);let s=n.nameObservers.get(t);s&&(s.disconnect(),n.nameObservers.delete(t)),n.ownedSlots.delete(t)}function Nr(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function Tr(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var on=new WeakMap,mt=Symbol.for("webjs.instance");function De(e,t){let n=t,r=n[mt];if(C(e)){let o=e;if(r&&r.strings===o.strings){Se(r,o.values);return}r&&an(r,t);let s=t.firstChild;s&&s.nodeType===8&&s.data==="webjs-hydrate"&&s.remove();let i=Rr(o,t);n[mt]=i;return}if(r&&an(r,t),n[mt]=null,t.replaceChildren(),!(e==null||e===!1||e===!0)){if(Array.isArray(e)){for(let o of e){let s=document.createTextNode(String(o??""));t.appendChild(s)}return}t.appendChild(document.createTextNode(String(e)))}}function _e(e){let{strings:t}=e,n=on.get(t);if(n)return n;let r=[],o="",s="text",i="",a=0,c="",l=0,d=null,p="",f="";for(let b=0;b<t.length;b++){let h=t[b];for(let u=0;u<h.length;u++){let m=h[u];switch(s){case"text":o+=m,m==="<"&&(s="tag-open");break;case"tag-open":o+=m,m==="!"?s="bang-1":m==="/"?(s="tag-name",p=""):/[a-zA-Z]/.test(m)?(s="tag-name",p=m.toLowerCase()):s="text";break;case"bang-1":o+=m,s=m==="-"?"bang-dash":"tag-name";break;case"bang-dash":o+=m,m==="-"?(s="comment",l=0):s="tag-name";break;case"comment":o+=m,m==="-"?l+=1:(m===">"&&l>=2&&(s="text"),l=0);break;case"tag-name":o+=m,m===">"?(s=p==="script"||p==="style"?"rawtext":"text",s==="rawtext"&&(f="")):/\s/.test(m)?s="in-tag":p+=m.toLowerCase();break;case"in-tag":o+=m,m===">"?(s=p==="script"||p==="style"?"rawtext":"text",s==="rawtext"&&(f="")):!/\s/.test(m)&&m!=="/"&&(s="attr-name",i=m,a=o.length-1);break;case"rawtext":o+=m,f=(f+m.toLowerCase()).slice(-9),(f.endsWith("<\/script>")||f.endsWith("</style>"))&&(s="text",f="",p="");break;case"attr-name":m==="="?(s="after-eq",o+=m):/\s/.test(m)?(s="in-tag",i="",o+=m):m===">"?(s="text",i="",o+=m):(i+=m,o+=m);break;case"after-eq":m==='"'||m==="'"?(s="attr-quoted",c=m,o+=m):/\s/.test(m)?(s="in-tag",i="",o+=m):m===">"?(s="text",i="",o+=m):(s="attr-unquoted",o+=m);break;case"attr-unquoted":/\s/.test(m)?(s="in-tag",i="",o+=m):(m===">"&&(s="text",i=""),o+=m);break;case"attr-quoted":o+=m,m===c&&(s="in-tag",i="");break;case"skip-attr":if(m===c){if(d){let k=d.firstPartIdx,S=[];for(let T=k;T<r.length;T++)(r[T].kind==="noop"||r[T].kind==="attr-mixed")&&S.push(T);let _=[],j=t[S[0]],E=j.lastIndexOf(c);_.push(E>=0?j.slice(E+1):j);for(let T=1;T<S.length;T++)_.push(t[S[T]]);let A=t[S[S.length-1]+1],L=A.indexOf(c);_.push(L>=0?A.slice(0,L):A),r[k]={kind:"attr-mixed",path:[],name:d.name,statics:_,group:S},d=null}s="in-tag",i=""}break}}if(b<t.length-1){let u=r.length;if(s==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(s==="rawtext"){f="",r.push({kind:"noop",path:[]});continue}if(s==="text")o+=`<!--${y}${u}-->`,r.push({kind:"child",path:[]});else if(s==="in-tag"){let m=`data-${y}${u}`;o+=`${m}=""`,r.push({kind:"element",path:[]})}else if(s==="after-eq"){let m=i[0],k=i.slice(1);if(m==="@"||m==="."||m==="?"){o=o.slice(0,a);let S=m==="@"?"event":m==="."?"prop":"bool",_=`data-${y}${u}`;o+=`${_}=""`,r.push({kind:S,path:[],name:k})}else{o=o.slice(0,a);let S=`data-${y}${u}`;o+=`${S}=""`,r.push({kind:"attr",path:[],name:i})}s="in-tag",i=""}else if(s==="attr-quoted"||s==="attr-unquoted"){o=o.slice(0,a);let m=`data-${y}${u}`;o+=`${m}=""`,d={name:i,firstPartIdx:u},r.push({kind:"noop",path:[]}),s="skip-attr"}else s==="skip-attr"&&r.push({kind:"noop",path:[]})}}let g=document.createElement("template");return g.innerHTML=o,Er(g.content,r),vr(g.content,r),n={templateEl:g,parts:r},on.set(t,n),n}function Er(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(B,"");let o=t.length;r.setAttribute(`data-${y}${o}`,""),t.push({kind:"slot",path:[]})}}function vr(e,t){let n=[];function r(o){for(let s=0;s<o.childNodes.length;s++){let i=o.childNodes[s];if(n.push(s),i.nodeType===8){let a=i.data;if(a.startsWith(y)){let c=Number(a.slice(y.length));t[c]&&t[c].kind==="child"&&(t[c].path=n.slice())}}else if(i.nodeType===1){let a=i,c=[];for(let l of a.attributes)if(l.name.startsWith(`data-${y}`)){let d=Number(l.name.slice(`data-${y}`.length));t[d]&&t[d].kind!=="child"&&(t[d].path=n.slice()),c.push(l.name)}for(let l of c)a.removeAttribute(l);r(i)}n.pop()}}r(e)}function Rr(e,t){let{templateEl:n,parts:r}=_e(e),o=n.content.cloneNode(!0),s=document.createComment(`${y}s`),i=document.createComment(`${y}e`),a=r.map(l=>we(l,o)),c=[];for(let l=0;l<e.values.length;l++)F(a[l],e.values[l],void 0,e.values),c.push(e.values[l]);t.replaceChildren(s,...o.childNodes,i);for(let l of a)l.kind==="slot"&&F(l,void 0,void 0,[]);return{strings:e.strings,bound:a,lastValues:c,startNode:s,endNode:i}}function we(e,t){if(e.kind==="noop")return{kind:"noop"};let n=t;for(let o of e.path)n=n.childNodes[o];if(e.kind==="child")return{kind:"child",marker:n};let r=n;if(e.kind==="event"){let o={kind:"event",el:r,name:e.name||"",handler:null,dispatcher(s){o.handler?.(s)}};return r.addEventListener(o.name,o.dispatcher),o}if(e.kind==="attr")return{kind:"attr",el:r,name:e.name||""};if(e.kind==="attr-mixed")return{kind:"attr-mixed",el:r,name:e.name||"",statics:e.statics||[],group:e.group||[]};if(e.kind==="prop")return{kind:"prop",el:r,name:e.name||""};if(e.kind==="bool")return{kind:"bool",el:r,name:e.name||""};if(e.kind==="element")return{kind:"element",el:r};if(e.kind==="slot")return{kind:"slot",slotEl:r,applied:!1};throw new Error(`unknown part kind ${e.kind}`)}function Se(e,t){for(let n=0;n<t.length;n++){let r=t[n];Object.is(r,e.lastValues[n])||(F(e.bound[n],r,e.lastValues[n],t),e.lastValues[n]=r)}}function an(e,t){for(let n of e.bound){if(n.kind==="event"&&n.el.removeEventListener(n.name,n.dispatcher),n.kind==="element"){let r=n.lastTarget;if(r){if(typeof r=="function")try{r(void 0)}catch{}else typeof r=="object"&&(r.value=void 0);n.lastTarget=void 0,n.__lastEl=void 0}}if(n.kind==="slot"){let r=gt(n.slotEl);r&&sn(r,n.slotEl)}}t.replaceChildren()}function F(e,t,n,r){if(Q(t)){let o=t.value;if(e.kind==="prop"&&e.el[e.name]===o||e.kind==="attr"&&e.el.getAttribute(e.name)===String(o)||e.kind==="bool"&&e.el.hasAttribute(e.name)===!!o)return;t=o}switch(e.kind){case"child":Lr(e,t);break;case"attr":{t==null||t===!1?e.el.removeAttribute(e.name):e.el.setAttribute(e.name,String(t));break}case"prop":e.el[e.name]=t;break;case"bool":t?e.el.setAttribute(e.name,""):e.el.removeAttribute(e.name);break;case"event":e.handler=typeof t=="function"?t:null;break;case"element":Or(e,t);break;case"attr-mixed":{let o=e,s=o.statics[0];for(let i=0;i<o.group.length;i++)s+=String((r?r[o.group[i]]:t)??""),s+=o.statics[i+1]||"";e.el.setAttribute(e.name,s);break}case"slot":{if(e.applied)break;let o=e.slotEl,s=()=>{e.applied=!0;let a=gt(o);if(!a||jr(o))return;let c=document.createDocumentFragment();for(;o.firstChild;)c.appendChild(o.firstChild);o[Be]=c,Ue(a)};gt(o)?s():queueMicrotask(s);break}case"noop":break}}function gt(e){let t=e.parentElement;for(;t;){if(t[V])return t;t=t.parentElement}return null}function jr(e){let t=e;for(let n=0;n<128;n++){let r=t.parentNode;if(!r||r===t)return!1;if(r.host)return!0;t=r}return!1}function Or(e,t){let n=e,r=ne(t)?t.target:void 0,o=n.__refTarget,s=r!==o;if(s&&o)if(typeof o=="function")try{o(void 0)}catch{}else typeof o=="object"&&(o.value=void 0);if(s||n.__refElement!==e.el){if(n.__refTarget=r,r)if(typeof r=="function"){if(!s&&n.__refElement!==void 0)try{r(void 0)}catch{}try{r(e.el)}catch{}}else typeof r=="object"&&(r.value=e.el);n.__refElement=e.el,e.lastTarget=r}}function Lr(e,t){return Pr(e,t),$(e,t)}function $(e,t){let n=e.marker;if(X(t)){K(e);let o=String(t.value??""),s=document.createElement("template");s.innerHTML=o;let i=[...s.content.childNodes],a=document.createDocumentFragment();for(let c of i)a.appendChild(c);n.parentNode?.insertBefore(a,n),e.child=i;return}if(ee(t)){let o=t,s=e.__keyedKey;s!==void 0&&!Object.is(s,o.key)&&K(e),e.__keyedKey=o.key,$(e,o.value);return}if(te(t)){let o=t,s=e.__guardDeps,i=o.deps;if(s!==void 0&&(Array.isArray(s)&&Array.isArray(i)?Ir(s,i):Object.is(s,i)))return;e.__guardDeps=Array.isArray(i)?i.slice():i,$(e,o.fn());return}if(fe(t)){K(e);let o=t.template;if(o&&o.content){let s=o.content.cloneNode(!0),i=[...s.childNodes];n.parentNode?.insertBefore(s,n),e.child=i}return}if(ne(t))return;if(re(t))return qr(e,t.value);if(se(t))return Br(e,t.args);if(oe(t))return Ur(e,t.signal);if(ue(t))return Fr(e,t);if(de(t))return Dr(e,t);if(Z(t)){if(e.child&&e.child.kind==="repeat"){Mr(e,t);return}K(e);let o={kind:"repeat",map:new Map};e.child=o,$r(n,o,t);return}if(e.child){let o=e.child;if(o.kind==="repeat")fn(o),e.child=void 0;else if(o.kind==="async-stream")pn(o),e.child=void 0;else if("strings"in e.child){let s=e.child;if(C(t)&&s.strings===t.strings){Se(s,t.values);return}Ae(s.startNode,s.endNode),e.child=void 0}else{for(let s of e.child)s.parentNode&&s.parentNode.removeChild(s);e.child=void 0}}if(t==null||t===!1||t===!0)return;if(C(t)){let o=t,{templateEl:s,parts:i}=_e(o),a=s.content.cloneNode(!0),c=document.createComment(`${y}s`),l=document.createComment(`${y}e`),d=i.map(g=>we(g,a)),p=[];for(let g=0;g<o.values.length;g++)F(d[g],o.values[g],void 0,o.values),p.push(o.values[g]);let f=[c,...a.childNodes,l];n.parentNode?.insertBefore(cn(f),n);for(let g of d)g.kind==="slot"&&F(g,void 0,void 0,[]);e.child={strings:o.strings,bound:d,lastValues:p,startNode:c,endNode:l};return}if(Array.isArray(t)){let o=[];for(let i of t)if(C(i)){let a=i,{templateEl:c,parts:l}=_e(a),d=c.content.cloneNode(!0),p=l.map(f=>we(f,d));for(let f=0;f<a.values.length;f++)F(p[f],a.values[f],void 0,a.values);o.push(...d.childNodes)}else i!=null&&i!==!1&&i!==!0&&o.push(document.createTextNode(String(i)));let s=cn(o);n.parentNode?.insertBefore(s,n),e.child=o;return}let r=document.createTextNode(String(t));n.parentNode?.insertBefore(r,n),e.child=[r]}function cn(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function Ae(e,t){if(!e.parentNode)return;let n=e;for(;n&&n!==t;){let r=n.nextSibling;n.parentNode?.removeChild(n),n=r}t.parentNode===e.parentNode&&t.parentNode?.removeChild(t)}function ln(e){let{templateEl:t,parts:n}=_e(e),r=t.content.cloneNode(!0),o=document.createComment(`${y}s`),s=document.createComment(`${y}e`),i=n.map(l=>we(l,r)),a=[];for(let l=0;l<e.values.length;l++)F(i[l],e.values[l],void 0,e.values),a.push(e.values[l]);let c=document.createDocumentFragment();for(c.appendChild(o);r.firstChild;)c.appendChild(r.firstChild);return c.appendChild(s),{inst:{strings:e.strings,bound:i,lastValues:a,startNode:o,endNode:s},frag:c}}function Fe(e){for(let t of e.bound)if(t.kind==="event"&&t.el.removeEventListener(t.name,t.dispatcher),t.kind==="element"){let n=t.lastTarget;if(n){if(typeof n=="function")try{n(void 0)}catch{}else typeof n=="object"&&(n.value=void 0);t.lastTarget=void 0,t.__lastEl=void 0}}}function $r(e,t,n){let{items:r,keyFn:o,templateFn:s}=n,i=e.parentNode;if(!i)return;let a=document.createDocumentFragment();for(let c=0;c<r.length;c++){let l=o(r[c],c),d=s(r[c],c);if(!C(d))continue;let{inst:p,frag:f}=ln(d);t.map.set(l,p),a.appendChild(f)}i.insertBefore(a,e)}function Mr(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let o=e.child,{items:s,keyFn:i,templateFn:a}=t,c=new Map;for(let l=0;l<s.length;l++){let d=i(s[l],l),p=a(s[l],l);if(!C(p))continue;let f=o.map.get(d);if(f&&f.strings===p.strings)Se(f,p.values),bt(f.startNode,f.endNode,r,n),c.set(d,f),o.map.delete(d);else{f&&(Fe(f),Ae(f.startNode,f.endNode),o.map.delete(d));let{inst:g,frag:b}=ln(p);r.insertBefore(b,n),c.set(d,g)}}for(let l of o.map.values())Fe(l),Ae(l.startNode,l.endNode);o.map=c}function fn(e){for(let t of e.map.values())Fe(t),Ae(t.startNode,t.endNode);e.map.clear()}function bt(e,t,n,r){if(t.nextSibling===r&&e.parentNode===n)return;let o=document.createDocumentFragment(),s=e;for(;s;){let i=s.nextSibling;if(o.appendChild(s),s===t)break;s=i}n.insertBefore(o,r)}function Ir(e,t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}function K(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&un(t),!e.child)return;let n=e.child;if(n.kind==="repeat")fn(n);else if(n.kind==="async-stream")pn(n);else if("strings"in n){let r=e.child;Fe(r),Ae(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function Pr(e,t){let n=e;n.__untilState&&!se(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!te(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!re(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!ee(t)&&(n.__keyedKey=void 0),n.__watchSub&&!oe(t)&&un(n)}function qr(e,t){let n=e.marker,r=e,o=r.__cacheMap;o||(o=new Map,r.__cacheMap=o);let s=e.child;if(s&&"strings"in s){let a=s;if(C(t)&&a.strings===t.strings){Se(a,t.values);return}let c=document.createDocumentFragment();bt(a.startNode,a.endNode,c,null),o.set(a.strings,{inst:a,holder:c}),e.child=void 0}if(C(t)){let a=t,c=o.get(a.strings);if(c){o.delete(a.strings),e.child&&K(e),bt(c.inst.startNode,c.inst.endNode,n.parentNode,n),Se(c.inst,a.values),e.child=c.inst;return}}$(e,t)}function Br(e,t){let n=e,r=n.__untilState,o=n.__untilArgs,s=(f,g)=>!!(Object.is(f,g)||C(f)&&C(g)&&f.strings===g.strings),a=o&&o.length===t.length&&o.every((f,g)=>s(f,t[g]))&&r?r.highestResolved:1/0;r&&(r.aborted=!0),n.__untilArgs=t.slice();let c={aborted:!1,highestResolved:a};n.__untilState=c;let l=-1,d;for(let f=0;f<t.length;f++){let g=t[f];if(!g||typeof g.then!="function"){l=f,d=g;break}}l!==-1&&l<=c.highestResolved?($(e,d),c.highestResolved=l):l===-1&&!n.__untilEverRendered&&$(e,""),n.__untilEverRendered=!0;let p=Math.min(l===-1?t.length:l,c.highestResolved);for(let f=0;f<p;f++){let g=t[f];!g||typeof g.then!="function"||Promise.resolve(g).then(b=>{c.aborted||f>=c.highestResolved||(c.highestResolved=f,$(e,b))},()=>{})}}function Ur(e,t){let n=e;if(n.__watchSig===t&&n.__watchSub){let s;n.__watchSub.observe(()=>{s=t.get()}),$(e,s);return}n.__watchSub&&(n.__watchSub.dispose(),n.__watchSub=void 0),n.__watchSig=t;let r=new me.subtle.Watcher(()=>{queueMicrotask(()=>{if(n.__watchSub!==r)return;let s;r.observe(()=>{s=t.get()}),$(e,s)})});n.__watchSub=r;let o;r.observe(()=>{o=t.get()}),$(e,o)}function un(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function Fr(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="append"&&n.iterable===t.iterable)return;K(e);let r=t.iterable[Symbol.asyncIterator](),o={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=o,dn(o,e,t)}function Dr(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="replace"&&n.iterable===t.iterable)return;K(e);let r=t.iterable[Symbol.asyncIterator](),o={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=o,dn(o,e,t)}async function dn(e,t,n){let r=t.marker,o=0;try{for(;!e.aborted;){let s=await e.iterator.next();if(e.aborted||s.done)break;let i=n.mapper?n.mapper(s.value,o):s.value,a=hn(i);if(e.mode==="replace"){for(let l of e.nodes)l.parentNode&&l.parentNode.removeChild(l);e.nodes=[]}let c=document.createDocumentFragment();for(let l of a)c.appendChild(l);r.parentNode?.insertBefore(c,r),e.nodes.push(...a),o++}}catch(s){typeof console<"u"&&console.error("[webjs] asyncStream error:",s)}}function hn(e){if(e==null||e===!1||e===!0)return[];if(C(e)){let t=e,{templateEl:n,parts:r}=_e(t),o=n.content.cloneNode(!0),s=r.map(i=>we(i,o));for(let i=0;i<t.values.length;i++)F(s[i],t.values[i],void 0,t.values);return[...o.childNodes]}if(Array.isArray(e)){let t=[];for(let n of e)t.push(...hn(n));return t}return[document.createTextNode(String(e))]}function pn(e){e.aborted=!0;for(let t of e.nodes)t.parentNode&&t.parentNode.removeChild(t);e.nodes=[];try{e.iterator.return?.()?.catch?.(()=>{})}catch{}}var mn=Symbol.for("webjs:registry"),gn=Symbol.for("webjs:classToTag"),He=globalThis,M=He[mn]||(He[mn]=new Map),bn=He[gn]||(He[gn]=new WeakMap),We=typeof window<"u"&&typeof customElements<"u";function yt(e,t){if(!e||typeof e!="string"||!e.includes("-"))throw new Error(`customElements.define: tag "${e}" must contain a hyphen (HTML spec)`);let n=t.lazy===!0,r=M.get(e);r?(r.cls=t,r.lazy=n):M.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),bn.set(t,e)}if(We){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),yt(t,n)}}if(!We){let e=globalThis;e.customElements||(e.customElements={define(t,n){yt(t,n)},get(t){return M.get(t)?.cls},upgrade(){},whenDefined(t){let n=M.get(t);return Promise.resolve(n?.cls)}})}function _t(e,t){We?customElements.define(e,t):yt(e,t)}function Hr(e,t){if(We)return;let n=M.get(e);if(n){n.moduleUrl=t;return}M.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e})}function wt(e){return M.get(e)?.cls}function Wr(e){return M.get(e)?.moduleUrl||null}function Vr(e){return M.get(e)?.lazy===!0}function Ve(e){return bn.get(e)}function St(){return[...M.keys()]}var w="_$wj",ke="_id";async function Ne(e){return JSON.stringify(await yn(e))}function J(e){return _n(JSON.parse(e))}async function yn(e){let t=zr();return await Kr(e,t),G(e,t)}function _n(e){return D(e,Zr())}function zr(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map}}async function Kr(e,t){let n=[e];for(;n.length;){let r=n.pop();if(!Qr(r))continue;let o=t.refCount.get(r)||0;if(t.refCount.set(r,o+1),!(o>0)){if(typeof Blob<"u"&&r instanceof Blob){let s=new Uint8Array(await r.arrayBuffer());t.blobBytes.set(r,s);continue}if(typeof FormData<"u"&&r instanceof FormData){for(let[,s]of r.entries())typeof s!="string"&&n.push(s);continue}if(Array.isArray(r))for(let s=0;s<r.length;s++)n.push(r[s]);else if(r instanceof Map)for(let[s,i]of r)n.push(s),n.push(i);else if(r instanceof Set)for(let s of r)n.push(s);else if(es(r))for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&n.push(r[s])}}for(let[r,o]of t.refCount)o>1&&t.idOf.set(r,t.nextId++)}function G(e,t){if(e===null)return null;if(e===void 0)return{[w]:"undef"};let n=typeof e;if(n==="string"||n==="boolean")return e;if(n==="number")return Number.isNaN(e)?{[w]:"NaN"}:e===1/0?{[w]:"Inf"}:e===-1/0?{[w]:"-Inf"}:Object.is(e,-0)?{[w]:"-0"}:e;if(n==="bigint")return{[w]:"BigInt",v:e.toString()};if(n==="symbol"){let s=Symbol.keyFor(e);if(s===void 0)throw new TypeError("Cannot serialize a local Symbol; only Symbol.for() registered symbols are supported.");return{[w]:"Sym",v:s}}if(n==="function")throw new TypeError("Cannot serialize a function.");let r=t.idOf.get(e);if(r!==void 0&&t.emitted.has(r))return{[w]:"Ref",v:r};r!==void 0&&t.emitted.add(r);let o;if(e instanceof Date)o={[w]:"Date",v:Number.isNaN(e.getTime())?null:e.toISOString()};else if(e instanceof Error)o={[w]:"Error",v:{name:e.name,message:e.message,stack:e.stack||null}};else if(typeof Blob<"u"&&e instanceof Blob){let s=t.blobBytes.get(e);typeof File<"u"&&e instanceof File?o={[w]:"File",v:xe(s),n:e.name,t:e.type||"",m:e.lastModified}:o={[w]:"Blob",v:xe(s),t:e.type||""}}else if(typeof FormData<"u"&&e instanceof FormData){let s=[];for(let[i,a]of e.entries())s.push([i,G(a,t)]);o={[w]:"FD",v:s}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)o=Gr(e);else if(e instanceof Map){let s=[];for(let[i,a]of e)s.push([G(i,t),G(a,t)]);o={[w]:"Map",v:s}}else if(e instanceof Set){let s=[];for(let i of e)s.push(G(i,t));o={[w]:"Set",v:s}}else if(Array.isArray(e))o=e.map(s=>G(s,t));else{o={};for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;let i=ts(s)?"_"+s:s;o[i]=G(e[s],t)}}if(r!==void 0){if(Array.isArray(o))return{[w]:"Arr",[ke]:r,v:o};o[ke]=r}return o}function Gr(e){if(e instanceof ArrayBuffer)return{[w]:"buf",v:xe(new Uint8Array(e))};if(e instanceof DataView)return{[w]:"dv",v:xe(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=Jr[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[w]:n,v:xe(r)}}var Jr={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},Yr={i8:Int8Array,u8:Uint8Array,u8c:Uint8ClampedArray,i16:Int16Array,u16:Uint16Array,i32:Int32Array,u32:Uint32Array,f32:Float32Array,f64:Float64Array,bi64:typeof BigInt64Array<"u"?BigInt64Array:null,bu64:typeof BigUint64Array<"u"?BigUint64Array:null};function Zr(){return{refs:new Map}}function D(e,t){if(e===null||typeof e!="object")return e;if(Array.isArray(e)){let s=[];for(let i=0;i<e.length;i++)s.push(D(e[i],t));return s}let n=e[w];if(typeof n=="string")return Xr(e,n,t);let r={},o=e[ke];typeof o=="number"&&t.refs.set(o,r);for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s)||s===ke)continue;let i=ns(s)?s.slice(1):s;r[i]=D(e[s],t)}return r}function Xr(e,t,n){let r=e[ke];switch(t){case"undef":return;case"NaN":return NaN;case"Inf":return 1/0;case"-Inf":return-1/0;case"-0":return-0;case"BigInt":return BigInt(e.v);case"Sym":return Symbol.for(e.v);case"Date":return e.v==null?new Date(NaN):new Date(e.v);case"Error":{let o=new Error(e.v.message);return o.name=e.v.name,e.v.stack&&(o.stack=e.v.stack),typeof r=="number"&&n.refs.set(r,o),o}case"Map":{let o=new Map;typeof r=="number"&&n.refs.set(r,o);for(let[s,i]of e.v)o.set(D(s,n),D(i,n));return o}case"Set":{let o=new Set;typeof r=="number"&&n.refs.set(r,o);for(let s of e.v)o.add(D(s,n));return o}case"Arr":{let o=[];typeof r=="number"&&n.refs.set(r,o);for(let s of e.v)o.push(D(s,n));return o}case"Ref":{let o=n.refs.get(e.v);if(o===void 0)throw new TypeError(`Dangling reference: id=${e.v}`);return o}case"Blob":{if(typeof Blob>"u")throw new TypeError("Blob is not available in this environment.");let o=Ce(e.v);return new Blob([o],{type:e.t||""})}case"File":{if(typeof File>"u")throw new TypeError("File is not available in this environment.");let o=Ce(e.v);return new File([o],e.n,{type:e.t||"",lastModified:e.m})}case"FD":{if(typeof FormData>"u")throw new TypeError("FormData is not available in this environment.");let o=new FormData;for(let[s,i]of e.v){let a=D(i,n);o.append(s,a)}return o}default:{if(t==="buf"){let s=Ce(e.v);return s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)}if(t==="dv"){let s=Ce(e.v);return new DataView(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength))}let o=Yr[t];if(o){let s=Ce(e.v),i=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength);return new o(i)}throw new TypeError(`Unknown serialization tag: ${t}`)}}}function Qr(e){return e!==null&&typeof e=="object"}function es(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function ts(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function ns(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}var wn=typeof Buffer<"u"&&typeof Buffer.from=="function";function xe(e){if(wn)return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("base64");let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function Ce(e){if(wn){let r=Buffer.from(e,"base64");return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}let t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}var Cn=typeof window<"u"&&typeof HTMLElement<"u";function rs(e,t){return e!==t}var ss=Cn?HTMLElement:class{},At=class extends ss{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){_t(t,this)}static get observedAttributes(){let t=this.properties||{};return Object.keys(t).filter(n=>!t[n].state).map(Sn)}constructor(){super(),this._renderRoot=null,this._scheduled=!1,this._connected=!1,this.__controllers=new Set,this.__firstRendered=!1,this._changedProperties=new Map,this._updateResolve=null,this._updatePromise=Promise.resolve(!0),this._isUpdating=!1,this._initializeProperties()}_initializeProperties(){let n=this.constructor.properties;if(!(!n||typeof n!="object")){this.__propValues={};for(let[r,o]of Object.entries(n)){let s=typeof o=="object"?o:{type:o},i=this[r];Object.defineProperty(this,r,{configurable:!0,enumerable:!0,get:()=>this.__propValues[r],set:a=>{let c=this.__propValues[r];(s.hasChanged||rs)(a,c)&&(this.__propValues[r]=a,s.reflect&&!s.state&&this._connected&&this._reflectAttribute(r,a,s),this.requestUpdate(r,c))}}),i!==void 0&&(this.__propValues[r]=i)}}}_reflectAttribute(t,n,r){let o=Sn(t);if(!this.__reflectingAttribute){this.__reflectingAttribute=!0;try{if(r.converter&&r.converter.toAttribute){let s=r.converter.toAttribute(n,r.type);s==null?this.removeAttribute(o):this.setAttribute(o,s)}else r.type===Boolean?n?this.setAttribute(o,""):this.removeAttribute(o):n==null?this.removeAttribute(o):r.type===Object||r.type===Array?this.setAttribute(o,JSON.stringify(n)):this.setAttribute(o,String(n))}finally{this.__reflectingAttribute=!1}}}connectedCallback(){if(!Cn)return;if(this.__webjsPropsHydrated||(this.__webjsPropsHydrated=!0,this._hydratePropAttrs()),this.constructor.hydrate==="visible"&&typeof IntersectionObserver<"u"&&!this.__hydrationActivated){this.__hydrationActivated=!1,this.__hydrationObserver=new IntersectionObserver(n=>{for(let r of n)if(r.isIntersecting){this.__hydrationObserver.unobserve(this),this.__hydrationObserver.disconnect(),this.__hydrationObserver=null,this.__hydrationActivated=!0,this._activate();return}},{rootMargin:"200px"}),this.__hydrationObserver.observe(this);return}this._activate()}_hydratePropAttrs(){let t=[],n=this.attributes;for(let r=0;r<n.length;r++){let o=n[r].name;o.startsWith("data-webjs-prop-")&&t.push(o)}for(let r of t){let o=this.getAttribute(r);if(this.removeAttribute(r),o==null)continue;let s=An(r.slice(16));try{this[s]=J(o)}catch(i){console.warn(`[webjs] failed to decode ${r} on <${this.tagName.toLowerCase()}>: ${i&&i.message}`)}}}_activate(){this._connected=!0;let t=this.constructor;if(t.shadow===!0){let n=!!this.shadowRoot;this.shadowRoot||this.attachShadow({mode:"open"}),this._renderRoot=this.shadowRoot;let r=t.styles,o=Array.isArray(r)?r:le(r)?[r]:[];if(o.length){if(n){let s=this.shadowRoot.querySelector("style");s&&s.remove()}et(this._renderRoot,o)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${Ve(t)||this.tagName?.toLowerCase()}> has static shadow = false AND static styles. static styles only works with shadow DOM (adoptedStyleSheets). For light DOM, use global CSS or <style> in render().`),pt(this)||(this.__isHydrating()?(U(this),en(this)):Qt(this));for(let n of this.__controllers)n.hostConnected&&n.hostConnected();this._updateResolve===null&&(this._updatePromise=new Promise(n=>{this._updateResolve=n})),this._scheduled=!0,queueMicrotask(()=>{this._scheduled=!1;try{this._performRender()}catch(n){console.error("[webjs] lifecycle hook threw during initial render:",n)}this._renderRoot===this&&nn(this)})}__isHydrating(){let t=this.firstChild,n=t!=null&&t.nodeType===8&&t.data==="webjs-hydrate";return n&&(this.__hydratedAtActivate=!0),n}disconnectedCallback(){this._connected=!1,this.__hydrationObserver&&(this.__hydrationObserver.disconnect(),this.__hydrationObserver=null),this._renderRoot===this&&rn(this),this.__signalWatcher&&(this.__signalWatcher.dispose(),this.__signalWatcher=void 0);for(let t of this.__controllers)t.hostDisconnected&&t.hostDisconnected()}attributeChangedCallback(t,n,r){if(this.__reflectingAttribute)return;let o=this.constructor,s=An(t),i=o.properties&&(o.properties[s]||o.properties[t]);if(!i)return;let a;if(i.converter&&i.converter.fromAttribute)a=i.converter.fromAttribute(r,i.type);else if(i.type===Number)a=r==null?null:Number(r);else if(i.type===Boolean)a=r!=null&&r!=="false";else if(i.type===Object||i.type===Array)try{a=r==null?null:JSON.parse(r)}catch{a=r}else a=r;this[s]!==a&&(this[s]=a,this._connected&&this.requestUpdate())}requestUpdate(t,n){t!==void 0&&!this._changedProperties.has(t)&&this._changedProperties.set(t,n),this._scheduleUpdate()}_scheduleUpdate(){this._updateResolve===null&&(this._updatePromise=new Promise(t=>{this._updateResolve=t})),!this._isUpdating&&(this._scheduled||!this._connected||(this._scheduled=!0,queueMicrotask(()=>{this._scheduled=!1;try{this._performRender()}catch(t){console.error("[webjs] lifecycle hook threw during update cycle:",t)}})))}_performRender(){if(!this._renderRoot)return;let t=this._changedProperties;this._isUpdating=!0;let n=!1;try{if(this.shouldUpdate(t)){this.willUpdate(t);for(let r of this.__controllers)r.hostUpdate&&r.hostUpdate();try{this.update(t)}catch(r){console.error(`[webjs] render error in <${Ve(this.constructor)||this.tagName?.toLowerCase()}>:`,r);try{let o=this.renderError(r);o!==void 0&&De(o,this._renderRoot)}catch(o){console.error("[webjs] renderError() also threw:",o)}}for(let r of this.__controllers)r.hostUpdated&&r.hostUpdated();n=!0}}catch(r){console.error("[webjs] lifecycle hook threw during update phase:",r)}finally{this._isUpdating=!1,n&&(this._changedProperties=new Map)}if(n)try{this.__firstRendered||(this.__firstRendered=!0,this.firstUpdated(t)),this.updated(t)}catch(r){console.error("[webjs] lifecycle hook threw during post-commit phase:",r)}finally{this._resolveUpdate()}else this._resolveUpdate()}_resolveUpdate(){if(this._updateResolve){let t=this._changedProperties.size===0;this._updateResolve(t),this._updateResolve=null}}shouldUpdate(t){return!0}willUpdate(t){}update(t){this.__signalWatcher||(this.__signalWatcher=new me.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n;this.__signalWatcher.observe(()=>{n=this.render()}),De(n,this._renderRoot)}updated(t){}firstUpdated(t){}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._updatePromise}addController(t){this.__controllers.add(t),this._connected&&t.hostConnected&&t.hostConnected()}removeController(t){this.__controllers.delete(t)}render(){return""}renderError(t){}};function Sn(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function An(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}var Eo=Symbol.for("webjs.suspense");function os(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function ze(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}var Ct=null;function is(e){Ct=e}function xt(){if(!Ct)return"";try{return Ct()||""}catch{return""}}async function as(e,t={ssr:!0}){let n=t&&t.suspenseCtx,r=await x(e,n);return t&&t.ssr===!1?r:await Te(r,n)}async function x(e,t){if(e==null||e===!1||e===!0)return"";if(e&&typeof e.then=="function")return e=await e,x(e,t);if(X(e))return String(e.value??"");if(Q(e))return x(e.value,t);if(oe(e))return x(e.signal.get(),t);if(ee(e))return x(e.value,t);if(te(e))return x(e.fn(),t);if(fe(e)){let n=e.template;return String(n?.innerHTML??"")}if(ne(e))return"";if(re(e))return x(e.value,t);if(se(e)){let n=e.args;for(let r of n)if(!r||typeof r.then!="function")return x(r,t);if(n.length>0)try{let r=await Promise.race(n.map(o=>Promise.resolve(o).catch(()=>{})));return x(r,t)}catch{return""}return""}if(ue(e)||de(e))return"";if(Array.isArray(e))return(await Promise.all(e.map(r=>x(r,t)))).join("");if(Z(e)){let n=e;return(await Promise.all(n.items.map((o,s)=>x(n.templateFn(o,s),t)))).join("")}if(ze(e)){let n=e,r=await x(n.fallback,t);if(t){let o=`s${t.nextId++}`;return t.pending.push({id:o,promise:Promise.resolve(n.children)}),`<webjs-boundary id="${o}">${r}</webjs-boundary>`}return r}return C(e)?cs(e,t):Re(String(e))}async function cs(e,t){let{strings:n,values:r}=e,o="",s="text",i="",a=0,c="",l=0,d="",p="";for(let f=0;f<n.length;f++){let g=n[f];for(let b=0;b<g.length;b++){let h=g[b];switch(s){case"text":o+=h,h==="<"&&(s="tag-open");break;case"tag-open":o+=h,h==="!"?s="bang-1":h==="/"?(s="tag-name",d=""):/[a-zA-Z]/.test(h)?(s="tag-name",d=h.toLowerCase()):s="text";break;case"bang-1":o+=h,s=h==="-"?"bang-dash":"tag-name";break;case"bang-dash":o+=h,h==="-"?(s="comment",l=0):s="tag-name";break;case"comment":o+=h,h==="-"?l+=1:(h===">"&&l>=2&&(s="text"),l=0);break;case"tag-name":o+=h,h===">"?(s=Ge(d)?"rawtext":"text",s==="rawtext"&&(p="")):/\s/.test(h)?s="in-tag":d+=h.toLowerCase();break;case"in-tag":o+=h,h===">"?(s=Ge(d)?"rawtext":"text",s==="rawtext"&&(p="")):!/\s/.test(h)&&h!=="/"&&(s="attr-name",i=h,a=o.length-1);break;case"rawtext":o+=h,p=(p+h.toLowerCase()).slice(-9),(p.endsWith("<\/script>")||p.endsWith("</style>"))&&(s="text",p="",d="");break;case"attr-name":h==="="?(s="after-eq",o+=h):/\s/.test(h)?(s="in-tag",i="",o+=h):h===">"?(s="text",i="",o+=h):(i+=h,o+=h);break;case"after-eq":h==='"'||h==="'"?(s="attr-quoted",c=h,o+=h):/\s/.test(h)?(s="in-tag",i="",o+=h):h===">"?(s="text",i="",o+=h):(s="attr-unquoted",o+=h);break;case"attr-unquoted":/\s/.test(h)?(s="in-tag",i="",o+=h):(h===">"&&(s="text",i=""),o+=h);break;case"attr-quoted":o+=h,h===c&&(s="in-tag",i="");break}}if(f<r.length){let b=r[f];if(b&&typeof b.then=="function"&&(b=await b),s==="comment")o+=String(b??""),l=0;else if(s==="rawtext")o+=String(b??""),p="";else if(s==="text")o+=await x(b,t);else if(s==="after-eq"){let h=i[0],u=i.slice(1);if(h==="@")o=o.slice(0,a),s="in-tag",i="";else if(h==="."){if(o=o.slice(0,a),!d.includes("-")){s="in-tag",i="";continue}if(b===void 0){s="in-tag",i="";continue}try{let m=await Ne(b);o+=`data-webjs-prop-${gs(u)}="${I(m)}"`}catch(m){console.warn(`[webjs] property binding .${u} has an unserializable value during SSR. Dropping. The browser will see the property as undefined. Detail: ${m&&m.message}`)}s="in-tag",i=""}else h==="?"?(o=o.slice(0,a),b&&(o+=`${u}=""`),s="in-tag",i=""):(o+=`"${I(String(b??""))}"`,s="in-tag",i="")}else(s==="attr-quoted"||s==="attr-unquoted")&&(o+=I(String(b??"")))}}return o}async function Te(e,t){let n=St();if(!n.length)return e;let r=[...n].sort((l,d)=>d.length-l.length),o=new RegExp(`<(${r.map(Ke).join("|")})(?=[\\s>/])((?:"[^"]*"|'[^']*'|[^>])*?)(/?)>`,"g"),s=[];for(let l of e.matchAll(o)){let[d,p,f,g]=l,b=wt(p);if(!b)continue;t&&t.usedComponents&&t.usedComponents.add(p);let h=g?`<${p}${f}>`:d;try{let u=b.shadow===!0,m=new b,k=ps(f),S=ys(k);ms(m,k,b);for(let[E,A]of Object.entries(S))m[E]=A;let _=m.render?m.render():"";_&&typeof _.then=="function"&&(_=await _);let j=await x(_,t);if(u){let E=await Te(j,t),A=b.styles,L=Array.isArray(A)?A:A&&le(A)?[A]:[],T=tt(L);s.push({start:l.index,end:l.index+d.length,text:`${h}<template shadowrootmode="open">${T}${E}</template>`})}else{if(j.trim()===""){s.push({start:l.index,end:l.index+d.length,text:`${h}<!--webjs-hydrate-->`});continue}let A="",L=l.index+d.length;if(!g){let Qe=l.index+d.length,ve=Nt(e,Qe,p);if(ve!==-1){A=e.slice(Qe,ve);let Gn=new RegExp(`</${Ke(p)}\\s*>`,"i"),Jn=e.slice(ve),Bt=Gn.exec(Jn),Yn=Bt?Bt[0].length:`</${p}>`.length;L=ve+Yn}else A=e.slice(Qe),L=e.length}let T=ds(A),zn=hs(j,T),Kn=await Te(zn,t);s.push({start:l.index,end:L,text:`${h}<!--webjs-hydrate-->${Kn}</${p}>`})}}catch(u){console.error(`[webjs] SSR failed for <${p}>:`,u)}}if(!s.length)return e;s.sort((l,d)=>l.start-d.start);let i=[],a=-1;for(let l of s)l.start>=a&&(i.push(l),a=l.end);let c=e;for(let l=i.length-1;l>=0;l--){let{start:d,end:p,text:f}=i[l];c=c.slice(0,d)+f+c.slice(p)}return c}var ls=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function fs(e){return ls.has(e.toLowerCase())}function Nt(e,t,n){let r=Ke(n),o=new RegExp(`<${r}(?:[\\s>/])`,"gi"),s=new RegExp(`</${r}\\s*>`,"gi");o.lastIndex=t,s.lastIndex=t;let i=1;for(;i>0;){let a=o.exec(e),c=s.exec(e);if(!c)return-1;if(a&&a.index<c.index)i++,s.lastIndex=a.index+1;else{if(i--,i===0)return c.index;o.lastIndex=c.index+1}}return-1}function us(e){let t=/\bslot\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(e);if(!t)return null;let n=t[1]??t[2]??t[3]??"";return n===""?null:n}function ds(e){let t=new Map,n="",r=0;for(;r<e.length;){let o=e.indexOf("<",r);if(o===-1){n+=e.slice(r);break}o>r&&(n+=e.slice(r,o));let s=e.slice(o);if(s.startsWith("<!--")){let u=e.indexOf("-->",o+4);if(u===-1){n+=s,r=e.length;break}n+=e.slice(o,u+3),r=u+3;continue}if(s.startsWith("<!")||s.startsWith("</")){let u=e.indexOf(">",o);if(u===-1){n+=s,r=e.length;break}n+=e.slice(o,u+1),r=u+1;continue}let i=/^<([a-zA-Z][\w-]*)((?:"[^"]*"|'[^']*'|[^>])*?)(\/?)>/.exec(s);if(!i){n+="<",r=o+1;continue}let[a,c,l,d]=i,p=c.toLowerCase(),f=!!d||fs(p),g=us(l),b;if(f)b=o+a.length;else{let u=o+a.length,m=Nt(e,u,p);if(m===-1){let E=e.slice(o);g!==null?xn(t,g,E):n+=E,r=e.length;continue}let k=new RegExp(`</${Ke(p)}\\s*>`,"i"),S=e.slice(m),_=k.exec(S),j=_?_[0].length:`</${p}>`.length;b=m+j}let h=e.slice(o,b);g!==null?xn(t,g,h):n+=h,r=b}return n.length>0&&t.set(null,n),t}function xn(e,t,n){let r=e.get(t);r!==void 0?e.set(t,r+n):e.set(t,n)}function hs(e,t){let n=new Set,r="",o=0,s=/<slot((?:"[^"]*"|'[^']*'|[^>])*?)(\/?)>/gi,i;for(;(i=s.exec(e))!==null;){r+=e.slice(o,i.index);let[a,c,l]=i,d=!!l,p=/\bname\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(c),f=p?p[1]??p[2]??p[3]:null,g=c.replace(/\bname\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,"").trim(),b="",h;if(d)h=i.index+a.length;else{let S=i.index+a.length,_=Nt(e,S,"slot");if(_===-1)b=e.slice(S),h=e.length;else{b=e.slice(S,_);let j=/<\/slot\s*>/i,E=e.slice(_),A=j.exec(E),L=A?A[0].length:7;h=_+L}}let u=t.get(f),m=f!==null?` name="${I(f)}"`:"",k=g?` ${g}`:"";u!==void 0&&!n.has(f)?(n.add(f),r+=`<slot data-webjs-light data-projection="actual"${m}${k}>${u}</slot>`):r+=`<slot data-webjs-light data-projection="fallback"${m}${k}>${b}</slot>`,o=h,s.lastIndex=h}return r+=e.slice(o),r}function Ke(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ge(e){return e==="script"||e==="style"}function ps(e){let t={},n=/([a-zA-Z_:][\w:.-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g,r;for(;(r=n.exec(e))!==null;)t[r[1]]=r[2]??r[3]??r[4]??"";return t}function ms(e,t,n){let r=n.properties||{};for(let[o,s]of Object.entries(t)){let i=r[o]||r[kt(o)],a=r[o]?o:kt(o);if(!i){e[a]=s;continue}if(i.type===Number)e[a]=Number(s);else if(i.type===Boolean)e[a]=s!=="false";else if(i.type===Object||i.type===Array)try{e[a]=JSON.parse(s)}catch{e[a]=s}else e[a]=s}}function kt(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function gs(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function bs(e){return e.replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&amp;/g,"&")}function ys(e){let t={};for(let n of Object.keys(e)){if(!n.startsWith("data-webjs-prop-"))continue;let r=kt(n.slice(16));try{t[r]=J(bs(e[n]))}catch{}delete e[n]}return t}function _s(e,t={ssr:!0}){let n=t&&t.suspenseCtx;return new ReadableStream({async start(r){try{if(t&&t.ssr===!1)await N(e,n,r);else{let o=await x(e,n),s=await Te(o,n);r.enqueue(s)}n&&n.pending.length&&await Ss(n,r),r.close()}catch(o){r.error(o)}}})}async function N(e,t,n){if(!(e==null||e===!1||e===!0)){if(e&&typeof e.then=="function")return e=await e,N(e,t,n);if(X(e)){n.enqueue(String(e.value??""));return}if(Q(e))return N(e.value,t,n);if(oe(e))return N(e.signal.get(),t,n);if(ee(e))return N(e.value,t,n);if(te(e))return N(e.fn(),t,n);if(fe(e)){let r=e.template;n.enqueue(String(r?.innerHTML??""));return}if(!ne(e)){if(re(e))return N(e.value,t,n);if(se(e)){let r=e.args;for(let o of r)if(!o||typeof o.then!="function")return N(o,t,n);if(r.length>0)try{let o=await Promise.race(r.map(s=>Promise.resolve(s).catch(()=>{})));return N(o,t,n)}catch{return}return}if(!(ue(e)||de(e))){if(Array.isArray(e)){for(let r of e)await N(r,t,n);return}if(Z(e)){let r=e;for(let o=0;o<r.items.length;o++)await N(r.templateFn(r.items[o],o),t,n);return}if(ze(e)){let r=e;if(t){let o=`s${t.nextId++}`;n.enqueue(`<webjs-boundary id="${o}">`),await N(r.fallback,t,n),n.enqueue("</webjs-boundary>"),t.pending.push({id:o,promise:Promise.resolve(r.children)})}else await N(r.fallback,t,n);return}if(C(e)){await ws(e,t,n);return}n.enqueue(Re(String(e)))}}}}async function ws(e,t,n){let{strings:r,values:o}=e,s="text",i="",a=0,c="",l=0,d="",p="",f="";for(let g=0;g<r.length;g++){let b=r[g];for(let h=0;h<b.length;h++){let u=b[h];switch(s){case"text":f+=u,u==="<"&&(s="tag-open");break;case"tag-open":f+=u,u==="!"?s="bang-1":u==="/"?(s="tag-name",d=""):/[a-zA-Z]/.test(u)?(s="tag-name",d=u.toLowerCase()):s="text";break;case"bang-1":f+=u,s=u==="-"?"bang-dash":"tag-name";break;case"bang-dash":f+=u,u==="-"?(s="comment",l=0):s="tag-name";break;case"comment":f+=u,u==="-"?l+=1:(u===">"&&l>=2&&(s="text"),l=0);break;case"tag-name":f+=u,u===">"?(s=Ge(d)?"rawtext":"text",s==="rawtext"&&(p="")):/\s/.test(u)?s="in-tag":d+=u.toLowerCase();break;case"in-tag":f+=u,u===">"?(s=Ge(d)?"rawtext":"text",s==="rawtext"&&(p="")):!/\s/.test(u)&&u!=="/"&&(s="attr-name",i=u,a=f.length-1);break;case"rawtext":f+=u,p=(p+u.toLowerCase()).slice(-9),(p.endsWith("<\/script>")||p.endsWith("</style>"))&&(s="text",p="",d="");break;case"attr-name":u==="="?(s="after-eq",f+=u):/\s/.test(u)?(s="in-tag",i="",f+=u):u===">"?(s="text",i="",f+=u):(i+=u,f+=u);break;case"after-eq":u==='"'||u==="'"?(s="attr-quoted",c=u,f+=u):/\s/.test(u)?(s="in-tag",i="",f+=u):u===">"?(s="text",i="",f+=u):(s="attr-unquoted",f+=u);break;case"attr-unquoted":/\s/.test(u)?(s="in-tag",i="",f+=u):(u===">"&&(s="text",i=""),f+=u);break;case"attr-quoted":f+=u,u===c&&(s="in-tag",i="");break}}if(g<o.length){let h=o[g];if(h&&typeof h.then=="function"&&(h=await h),s==="comment")f+=String(h??""),l=0;else if(s==="rawtext")f+=String(h??""),p="";else if(s==="text")f&&(n.enqueue(f),f=""),await N(h,t,n);else if(s==="after-eq"){let u=i[0],m=i.slice(1);u==="@"||u==="."?(f=f.slice(0,a),s="in-tag",i=""):u==="?"?(f=f.slice(0,a),h&&(f+=`${m}=""`),s="in-tag",i=""):(f+=`"${I(String(h??""))}"`,s="in-tag",i="")}else(s==="attr-quoted"||s==="attr-unquoted")&&(f+=I(String(h??"")))}}f&&n.enqueue(f)}async function Ss(e,t){let n=xt(),r=n?` nonce="${I(n)}"`:"";for(;e.pending.length;){let o=e.pending.splice(0);await Promise.all(o.map(async({id:s,promise:i})=>{try{let a=await i,c=await x(a,e),l=await Te(c,e);t.enqueue(`<template data-webjs-resolve="${s}">${l}</template><script${r}>(function(){var t=document.currentScript.previousElementSibling;var b=document.getElementById("${s}");if(b&&t){b.innerHTML=t.innerHTML;t.remove()}document.currentScript.remove()})()<\/script>`)}catch(a){console.error(`[webjs] Suspense boundary "${s}" rejected:`,a)}}))}}var kn=Symbol.for("webjs.notFound"),Nn=Symbol.for("webjs.redirect");function As(){let e=new Error("webjs: notFound()");throw e.__webjs=kn,e}function Cs(e,t=307){let n=new Error(`webjs: redirect(${e})`);throw n.__webjs=Nn,n.url=e,n.status=t,n}function xs(e){return!!e&&e.__webjs===kn}function ks(e){return!!e&&e.__webjs===Nn}function Ns(e,t,n){let r=/^\s*([A-Z]+)\s+(\/\S*)\s*$/.exec(e);if(!r)throw new Error(`expose(): bad pattern ${JSON.stringify(e)}: expected "METHOD /path"`);let[,o,s]=r;return t.__webjsHttp={method:o,path:s,validate:n&&typeof n.validate=="function"?n.validate:null,cors:n&&"cors"in n?Ts(n.cors):null},t}function Ts(e){return e?e===!0?{origin:"*",credentials:!1,maxAge:86400,headers:null}:typeof e=="string"?{origin:e,credentials:!0,maxAge:86400,headers:null}:Array.isArray(e)?{origin:e,credentials:!0,maxAge:86400,headers:null}:{origin:e.origin,credentials:!!e.credentials,maxAge:typeof e.maxAge=="number"?e.maxAge:86400,headers:Array.isArray(e.headers)?e.headers:null}:null}function Es(e){return e&&typeof e=="function"&&e.__webjsHttp||null}function vs(e,t={}){let n=t.reconnect!==!1,r=0,o=!1,s=null,i=[];function a(){o||(s=new WebSocket(Rs(e),t.protocols),s.onopen=c=>{for(r=0;i.length&&s&&s.readyState===WebSocket.OPEN;)s.send(i.shift());t.onOpen?.(c)},s.onmessage=c=>{let l=c.data;if(typeof l=="string")try{l=JSON.parse(l)}catch{}t.onMessage?.(l,c)},s.onerror=c=>{t.onError?.(c)},s.onclose=c=>{if(t.onClose?.(c),!o&&n){let l=Math.min(1e3*2**r++,3e4);setTimeout(a,l)}})}return a(),{send(c){let l=typeof c=="string"||c instanceof ArrayBuffer||ArrayBuffer.isView(c)?c:JSON.stringify(c);s&&s.readyState===WebSocket.OPEN?s.send(l):i.push(l)},close(c,l){o=!0;try{s?.close(c,l)}catch{}},get socket(){return s},get readyState(){return s?.readyState??3}}}function Rs(e){if(/^wss?:\/\//i.test(e))return e;let t=typeof location<"u"&&location.protocol==="https:"?"wss:":"ws:",n=typeof location<"u"?location.host:"";return`${t}//${n}${e.startsWith("/")?e:"/"+e}`}var Tt="application/vnd.webjs+json";async function js(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",Tt);let r=t.body;r!=null&&typeof r=="object"&&!(r instanceof FormData)&&!(r instanceof Blob)&&!(r instanceof ArrayBuffer)&&!(r instanceof URLSearchParams)&&!(typeof ReadableStream<"u"&&r instanceof ReadableStream)&&!ArrayBuffer.isView(r)&&(r=await Ne(r),n.has("content-type")||n.set("content-type",Tt));let o=await fetch(e,{...t,headers:n,body:r}),s=o.headers.get("content-type")||"",i=await o.text(),a=s.includes(Tt)?i?J(i):null:s.includes("application/json")?i?JSON.parse(i):null:i;if(!o.ok){let c=a&&a.error||`richFetch ${e} -> ${o.status}`,l=new Error(c);throw l.status=o.status,l.body=a,l}return a}var Et=typeof HTMLElement<"u"?class extends HTMLElement{}:null;typeof customElements<"u"&&Et&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",Et);function jn(e){return typeof Document<"u"&&typeof Document.parseHTMLUnsafe=="function"?Document.parseHTMLUnsafe(e):typeof DOMParser<"u"?new DOMParser().parseFromString(e,"text/html"):null}var ce=!1,H=null,R=0,vt=null;function Os(){vt||typeof MutationObserver>"u"||typeof customElements>"u"||(vt=new MutationObserver(e=>{for(let t of e)for(let n of t.addedNodes){if(n.nodeType!==1)continue;let r=n;r.tagName?.includes("-")&&customElements.upgrade(r);for(let o of r.querySelectorAll("*"))o.tagName?.includes("-")&&customElements.upgrade(o)}}),vt.observe(document.body,{childList:!0,subtree:!0}))}var W=null,Je=null;function On(){ce||typeof document>"u"||(ce=!0,document.addEventListener("click",$n,!0),document.addEventListener("submit",In,!0),window.addEventListener("popstate",Mn),Os(),typeof history<"u"&&"scrollRestoration"in history&&(Je=history.scrollRestoration,history.scrollRestoration="manual"),typeof location<"u"&&(W=location.href))}function Ls(){ce&&(ce=!1,document.removeEventListener("click",$n,!0),document.removeEventListener("submit",In,!0),window.removeEventListener("popstate",Mn),typeof history<"u"&&Je!==null&&(history.scrollRestoration=Je,Je=null),W=null)}async function $s(e,t){let n=new URL(e,location.href);if(n.origin!==location.origin){location.href=e;return}await $t(n.href,t?.replace??!1,null)}function Ms(e){if(!e){v.clear();return}let t=new URL(e,location.href);v.delete(t.pathname+t.search)}On();var Ln=/\.(?:pdf|zip|tar|gz|7z|rar|dmg|exe|msi|deb|rpm|apk|ipa|xlsx?|docx?|pptx?|csv|odt|ods|odp|rtf|epub|mobi|xml|json|rss|atom|txt|md|wasm|mp3|mp4|mov|avi|webm|ogg|flac|wav|m4a|m4v|mkv|png|jpe?g|gif|webp|avif|bmp|ico|svg|tiff?|heic)$/i;function $n(e){if(!ce||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=Bs(e);if(!t||t.hasAttribute("download")||t.hasAttribute("data-no-router")||t.target&&t.target!=="_self")return;let n=t.href;if(!n)return;let r=new URL(n);if(r.origin!==location.origin||r.pathname===location.pathname&&r.search===location.search&&r.hash||Ln.test(r.pathname))return;e.preventDefault();let o=Pn(t);$t(n,!1,o)}function Mn(e){$t(location.href,!0,null)}function In(e){if(!ce||e.defaultPrevented)return;let t=e.target;if(!t||t.nodeType!==1||t.tagName!=="FORM"||t.hasAttribute("data-no-router"))return;let n=e.submitter??null;if(n&&n.hasAttribute("data-no-router"))return;let r=n&&n.getAttribute("formtarget")||t.getAttribute("target")||"";if(r&&r!=="_self")return;let o=Is(t,n);if(o==="dialog")return;let s=Ps(t,n),i;try{i=new URL(s,location.href)}catch{return}if(i.origin!==location.origin||Ln.test(i.pathname))return;let a=qs(t,n);e.preventDefault();let c=Pn(t);Hs(i.href,o,a,c)}function Is(e,t){return(t&&t.getAttribute("formmethod")||e.getAttribute("method")||"get").toLowerCase()}function Ps(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function qs(e,t){try{return new FormData(e,t||void 0)}catch{let n=new FormData(e);return t&&t.getAttribute("name")&&n.append(t.getAttribute("name"),t.getAttribute("value")||""),n}}function Bs(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function Pn(e){let t=e;for(;t;){let n=t.closest("webjs-frame");if(n&&n.id)return n.id;let r=t.getRootNode();if(r&&r.host)t=r.host;else break}return null}function Ze(e){let t=new Map,n=[];function r(o){if(o.nodeType===8){let s=o,i=s.data,a=/^wj:children:(.+)$/.exec(i);if(a){n.push({path:a[1],start:s});return}if(i.trim()==="/wj:children"){let c=n.pop();c&&!t.has(c.path)&&t.set(c.path,{start:c.start,end:s});return}return}if(o.hasChildNodes&&o.hasChildNodes())for(let s=o.firstChild;s;s=s.nextSibling)r(s)}return r(e),t}function Us(e,t){let n=null;for(let r of e.keys())t.has(r)&&(n===null||r.length>n.length)&&(n=r);return n}var Fs=16,v=new Map;function qn(e){let t=Bn(e);v.has(t)&&v.delete(t);let n={html:document.documentElement.outerHTML,scrollX:typeof window<"u"&&window.scrollX||0,scrollY:typeof window<"u"&&window.scrollY||0};for(v.set(t,n);v.size>Fs;){let r=v.keys().next().value;v.delete(r)}}function Ds(e){let t=Bn(e),n=v.get(t);return n==null?null:(v.delete(t),v.set(t,n),typeof n=="string"?{html:n,scrollX:0,scrollY:0}:n)}function Bn(e){let t=new URL(e,location.href);return t.pathname+t.search}async function $t(e,t,n){H&&H.abort(),H=new AbortController;let r=H.signal,o=++R;W&&qn(W);let s=setTimeout(()=>{document.documentElement.setAttribute("data-navigating",""),s=null},150),i=null;t||(i=Dn());try{if(t){let a=Ds(e);if(a){let c=jn(a.html);if(c){Un(c,n,!0,null),typeof window<"u"&&window.scrollTo(a.scrollX,a.scrollY),jt(e,n,!1,i,"GET",null,r,o).catch(()=>{});return}}typeof window<"u"&&window.scrollTo(0,0)}await jt(e,n,!t,i,"GET",null,r,o)}finally{s&&clearTimeout(s),o===R&&(document.documentElement.removeAttribute("data-navigating"),typeof location<"u"&&(W=location.href))}}async function Hs(e,t,n,r){H&&H.abort(),H=new AbortController;let o=H.signal,s=++R,i=t==="get"||t==="head",a=new URL(e,location.href);if(i){a.search="";for(let[d,p]of n)a.searchParams.append(d,typeof p=="string"?p:p.name)}W&&qn(W);let c=setTimeout(()=>{document.documentElement.setAttribute("data-navigating",""),c=null},150),l=Dn();try{await jt(a.href,r,!0,l,i?"GET":t.toUpperCase(),i?null:n,o,s),!i&&s===R&&v.clear()}finally{c&&clearTimeout(c),s===R&&(document.documentElement.removeAttribute("data-navigating"),typeof location<"u"&&(W=location.href))}}function Ws(){return[...Ze(document.body).keys()].join(",")}async function jt(e,t,n,r,o,s,i,a){o=o||"GET";let c=typeof a=="number"?a:R,l,d=null,p=e;try{let g={"x-webjs-router":"1"},b=Ws();b&&(g["x-webjs-have"]=b),t&&(g["x-webjs-frame"]=t);let h={method:o,headers:g,credentials:"same-origin"};i&&(h.signal=i),s!=null&&o!=="GET"&&o!=="HEAD"&&(h.body=s);let u=await fetch(e,h),m=u.headers.get("content-type")||"",k=/^text\/html\b/i.test(m);if(u.redirected&&u.url&&(p=u.url),u.status===204||u.status===205){c===R&&n&&history.pushState(null,"",p);return}if(!k){c===R&&(location.href=e);return}d=u.headers.get("x-webjs-build"),l=await u.text()}catch(g){if(g&&g.name==="AbortError"||c!==R)return;Ks(r),location.href=e;return}if(c!==R)return;let f=jn(l);if(!f){location.href=e;return}if(Un(f,t,!1,p,d),n&&history.pushState(null,"",p),n){let g=new URL(p);if(g.hash){let b=document.getElementById(g.hash.slice(1));b?b.scrollIntoView():window.scrollTo(0,0)}else window.scrollTo(0,0)}document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:p,frameId:t}}))}function Tn(e){if(!e||!e.head)return"";let t=e.head.querySelectorAll('[data-webjs-track="reload"]');if(!t.length)return"";let n="";for(let r of t)n+=Y(r);return n}function Un(e,t,n,r,o){try{typeof sessionStorage<"u"&&(!r||t||n)&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}if(r&&!t&&!n){let d=document.querySelector('script[type="importmap"]'),p=d?d.getAttribute("data-webjs-build"):null,f=!1;if(o&&p&&(f=o!==p),!f&&e.head&&e.head.children.length>0){let g=Tn(document),b=Tn(e);g!==b&&(f=!0)}if(f&&typeof location<"u")try{let g="webjs:importmap-reload";if(sessionStorage&&sessionStorage.getItem(g))sessionStorage.removeItem(g);else{sessionStorage&&sessionStorage.setItem(g,"1"),location.href=r;return}}catch{location.href=r;return}else if(!f)try{typeof sessionStorage<"u"&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}}if(t){let d=document.querySelector(`webjs-frame#${CSS.escape(t)}`),p=e.querySelector(`webjs-frame#${CSS.escape(t)}`);if(d&&p){vn(e.head),Gs(d,p),Lt(d),Ye(d),Rn(e.body),Rt();return}}let s=Ze(document.body),i=Ze(e.body),a=Us(s,i);if(a){vn(e.head),Vs(s.get(a),i.get(a),e),Rn(e.body),Rt();return}Js(e.head);let c=[...e.body.childNodes],l=()=>{document.body.replaceChildren(...c),Lt(document.body),Ye(document.body),Rt()};document.startViewTransition?document.startViewTransition(l).finished.then(()=>Ye(document.body)).catch(()=>{}):l()}function Rt(){let e=document.activeElement;!e||e===document.body||e===document.documentElement||typeof e.blur=="function"&&e.blur()}function Vs(e,t,n){if(!e||!t)return;let r=e.start.parentNode;if(!r)return;let o=[];for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)o.push(i);let s=[];for(let i=t.start.nextSibling;i&&i!==t.end;i=i.nextSibling)s.push(document.importNode(i,!0));zs(r,e.start,e.end,o,s);for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)i.nodeType===1&&(Lt(i),Ye(i))}function zs(e,t,n,r,o){let s=new Map;for(let c of r){if(c.nodeType!==1)continue;let l=Ee(c);l&&s.set(l,c)}let i=n,a=[];for(let c of o){if(c.nodeType===1){let l=Ee(c);if(l&&s.has(l)){let d=s.get(l);Ot(d,c),a.push(d),s.delete(l);continue}}a.push(c)}for(let c of r)if(c.parentNode===e){if(c.nodeType===1&&a.includes(c))continue;e.removeChild(c)}for(let c of a)e.insertBefore(c,i)}function Ot(e,t){if(e.tagName!==t.tagName){e.replaceWith(t);return}let n=new Set;for(let r of t.attributes)n.add(r.name),!En.has(r.name)&&e.getAttribute(r.name)!==r.value&&e.setAttribute(r.name,r.value);for(let r of[...e.attributes])En.has(r.name)||n.has(r.name)||e.removeAttribute(r.name);Fn(e,t)}function Fn(e,t){let n=[...e.childNodes],r=[...t.childNodes].map(a=>document.importNode(a,!0)),o=new Map;for(let a of n){if(a.nodeType!==1)continue;let c=Ee(a);c&&o.set(c,a)}let s=[];for(let a=0;a<r.length;a++){let c=r[a];if(c.nodeType===1){let l=Ee(c);if(l&&o.has(l)){let p=o.get(l);Ot(p,c),s.push(p),o.delete(l);continue}let d=n[a];if(d&&d.nodeType===1&&!Ee(d)&&d.tagName===c.tagName){Ot(d,c),s.push(d);continue}}else if(c.nodeType===3){let l=n[a];if(l&&l.nodeType===3){l.nodeValue!==c.nodeValue&&(l.nodeValue=c.nodeValue),s.push(l);continue}}else if(c.nodeType===8){let l=n[a];if(l&&l.nodeType===8){l.nodeValue!==c.nodeValue&&(l.nodeValue=c.nodeValue),s.push(l);continue}}s.push(c)}let i=new Set(s);for(let a of n)!i.has(a)&&a.parentNode===e&&e.removeChild(a);for(let a=0;a<s.length;a++){let c=s[a];(c.parentNode!==e||e.childNodes[a]!==c)&&e.insertBefore(c,e.childNodes[a]||null)}}function Ee(e){let t=e.getAttribute("data-key");return t?`${e.tagName}:k:${t}`:e.id?`${e.tagName}:i:${e.id}`:null}var En=new Set(["value","checked","selected","indeterminate","disabled","open","popover"]);function Dn(){let e=Ze(document.body);if(e.size===0)return null;let t=null;for(let i of e.keys())(t===null||i.length>t.length)&&(t=i);if(t===null)return null;let n=document.getElementById(`wj-loading:${t}`);if(!(n instanceof HTMLTemplateElement))return null;let r=e.get(t),o=[];for(let i=r.start.nextSibling;i&&i!==r.end;i=i.nextSibling)o.push(i);let s=document.createRange();return s.setStartAfter(r.start),s.setEndBefore(r.end),s.deleteContents(),r.start.parentNode.insertBefore(n.content.cloneNode(!0),r.end),{slot:r,oldChildren:o,token:R}}function Ks(e){if(!e||e.token!==R)return;let{slot:t,oldChildren:n}=e;if(t.start.parentNode!==t.end.parentNode)return;let r=document.createRange();r.setStartAfter(t.start),r.setEndBefore(t.end),r.deleteContents();for(let o of n)t.start.parentNode.insertBefore(o,t.end)}function Gs(e,t){Fn(e,t)}function Hn(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function Mt(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=Hn();return n&&t.setAttribute("nonce",n),t.textContent=e.textContent,t}function Wn(e){if(!e.hasAttribute("nonce"))return e.cloneNode(!0);let t=e.cloneNode(!0),n=Hn();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function Y(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function vn(e){let t=e.querySelector("title");t&&(document.title=t.textContent||"");let n=new Set;for(let r of document.head.children)n.add(Y(r));for(let r of e.children)r.tagName==="SCRIPT"&&r.getAttribute("type")==="importmap"||r.tagName!=="BASE"&&r.tagName!=="TITLE"&&(n.has(Y(r))||(r.tagName==="SCRIPT"?document.head.appendChild(Mt(r)):document.head.appendChild(Wn(r))))}function Js(e){let t=document.head,n=e.querySelector("title");n&&(document.title=n.textContent||"");let r=new Set;for(let s of t.children)s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&r.add(Y(s));let o=new Set;for(let s of e.children)s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&o.add(Y(s));for(let s of[...t.children])s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&s.tagName!=="TITLE"&&(o.has(Y(s))||s.remove());for(let s of e.children)s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&s.tagName!=="TITLE"&&(r.has(Y(s))||(s.tagName==="SCRIPT"?t.appendChild(Mt(s)):t.appendChild(Wn(s))))}function Ye(e){typeof customElements>"u"||Vn(e)}function Vn(e){let t=e instanceof Element?[e,...e.querySelectorAll("*")]:[...e.querySelectorAll("*")];for(let n of t)n.tagName&&n.tagName.includes("-")&&(customElements.upgrade(n),n.shadowRoot&&Vn(n.shadowRoot))}function Rn(e){for(let t of e.querySelectorAll("template[data-webjs-resolve]"))document.body.appendChild(t.cloneNode(!0))}function Lt(e){for(let t of e.querySelectorAll("script"))t.replaceWith(Mt(t))}var Ys=Symbol.for("webjs.context");function Zs(e){return{__context__:Ys,name:e}}var Xe=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},It=class{constructor(t,{context:n,initialValue:r}){this._host=t,this._context=n,this._value=r,this._subscriptions=new Set,this._onRequest=o=>{let s=o;if(s.context===this._context)if(o.stopPropagation(),s.subscribe){let i={callback:s.callback},a=()=>{this._subscriptions.delete(i)};this._subscriptions.add(i),s.callback(this._value,a)}else s.callback(this._value)},typeof t.addController=="function"&&t.addController(this)}get value(){return this._value}setValue(t){if(!Object.is(this._value,t)){this._value=t;for(let n of this._subscriptions){let r=()=>{this._subscriptions.delete(n)};n.callback(t,r)}}}hostConnected(){this._host.addEventListener("context-request",this._onRequest)}hostDisconnected(){this._host.removeEventListener("context-request",this._onRequest),this._subscriptions.clear()}},Pt=class{constructor(t,{context:n,subscribe:r=!0}){this._host=t,this._context=n,this._subscribe=r,this._value=void 0,this._unsubscribe=void 0,typeof t.addController=="function"&&t.addController(this)}get value(){return this._value}hostConnected(){this._dispatchRequest()}hostDisconnected(){this._unsubscribe&&(this._unsubscribe(),this._unsubscribe=void 0)}_dispatchRequest(){let t=new Xe(this._context,(n,r)=>{let o=this._value;this._value=n,r&&(this._unsubscribe=r),!Object.is(o,n)&&typeof this._host.requestUpdate=="function"&&this._host.requestUpdate()},this._subscribe);this._host.dispatchEvent(t)}};var P={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},qt=class{constructor(t,{task:n,args:r,autoRun:o=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=o,this._status=P.INITIAL,this._value=void 0,this._error=void 0,this._abortController=null,this._prevArgs=null,typeof t.addController=="function"&&t.addController(this)}get status(){return this._status}get value(){return this._value}get error(){return this._error}async run(){this.abort();let t=new AbortController;this._abortController=t;let n=this._argsFn();this._prevArgs=n,this._status=P.PENDING,this._error=void 0,this._requestHostUpdate();try{let r=await this._taskFn(...n,{signal:t.signal});if(t.signal.aborted)return;this._value=r,this._status=P.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=P.ERROR,this._value=void 0}finally{this._abortController===t&&(this._abortController=null)}this._requestHostUpdate()}abort(){this._abortController&&(this._abortController.abort(),this._abortController=null)}render(t={}){switch(this._status){case P.INITIAL:return t.initial?.();case P.PENDING:return t.pending?.();case P.COMPLETE:return t.complete?.(this._value);case P.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun)return;let t=this._argsFn();this._argsEqual(this._prevArgs,t)||this.run()}hostUpdated(){}hostConnected(){}hostDisconnected(){this.abort()}_requestHostUpdate(){typeof this._host.requestUpdate=="function"&&this._host.requestUpdate()}_argsEqual(t,n){if(t===null||t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==n[r])return!1;return!0}};export{Pt as ContextConsumer,It as ContextProvider,Xe as ContextRequestEvent,y as MARKER,me as Signal,os as Suspense,qt as Task,P as TaskStatus,At as WebComponent,Et as WebjsFrame,et as adoptStyles,St as allTags,fr as batch,dr as computed,vs as connectWS,Zs as createContext,xt as cspNonce,Xn as css,_n as deserialize,Ls as disableClientRouter,pr as effect,On as enableClientRouter,I as escapeAttr,Re as escapeText,Ns as expose,Es as getExposed,Zn as html,le as isCSS,Vr as isLazy,Q as isLive,xs as isNotFound,ks as isRedirect,Z as isRepeat,hr as isSignal,ze as isSuspense,C as isTemplate,X as isUnsafeHTML,tr as live,wt as lookup,Wr as lookupModuleUrl,$s as navigate,As as notFound,J as parse,Hr as primeModuleUrl,Cs as redirect,_t as register,De as render,_s as renderToStream,as as renderToString,Qn as repeat,Ms as revalidate,js as richFetch,yn as serialize,is as setCspNonceProvider,ur as signal,Ne as stringify,tt as stylesToString,Ve as tagOf,er as unsafeHTML};
3
+ `)}</style>`}function Re(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function I(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}var Ut=Symbol.for("webjs.repeat");function Qn(e,t,n){return{[Ut]:!0,items:[...e],keyFn:t,templateFn:n}}function Z(e){return!!e&&typeof e=="object"&&e[Ut]===!0}function er(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function X(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function tr(e){return{_$webjs:"live",value:e}}function Q(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function ee(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function te(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function fe(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function ne(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function re(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function se(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function ue(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function de(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function oe(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}var O=null,q=!1,ae=0,ie=null,nt=0,Ft=(e,t)=>Object.is(e,t),Oe=()=>{},Dt=()=>!1;function Ht(e,t){e.liveConsumers||(e.liveConsumers=new Set);let n=e.liveConsumers.size===0;if(e.liveConsumers.add(t),n){if(e.producers&&e.producers.length>0)for(let r of e.producers)Ht(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function he(e,t){if(e.liveConsumers&&(e.liveConsumers.delete(t),e.liveConsumers.size===0)){if(e.producers&&e.producers.length>0)for(let n of e.producers)he(n,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(n){console.error(n)}}}function ct(e){if(q)throw new Error("Signal read during notification phase");if(O===null)return;let t=O,n=t.nextProducerIndex++;n<t.producers.length&&t.producers[n]!==e&&ot(t)&&he(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,ot(t)&&Ht(e,t)),t.producerLastReadVersions[n]=e.version}function ot(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function Wt(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=q;q=!0;try{for(let n of e.liveConsumers)n.dirty||nr(n)}finally{q=t}}function nr(e){e.dirty=!0,Wt(e),e.consumerMarkedDirty.call(e.wrapper||e)}function Le(e){if(!(!e.dirty&&e.lastCleanEpoch===ae)){if(!e.producerMustRecompute()&&!rr(e)){e.dirty=!1,e.lastCleanEpoch=ae;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=ae}}function rr(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(Le(n),r!==n.version))return!0}return!1}function it(e){e&&(e.nextProducerIndex=0);let t=O;return O=e,t}function at(e,t){if(O=t,!!e){if(ot(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)he(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var $e=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=ae,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=Dt,this.producerRecomputeValue=Oe,this.consumerMarkedDirty=Oe,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||Ft,this.watched=n?.[lt],this.unwatched=n?.[ft]}get(){return ct(this),this.__value}peek(){return this.__value}set(t){if(q)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,ae++,ie!==null?Vt(this):Wt(this))}};function Vt(e){let t=q;q=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers)n.dirty||(n.dirty=!0,n.__isWatcher?ie.add(n):Vt(n))}finally{q=t}}var rt=Symbol("unset"),st=Symbol("computing"),je=Symbol("errored"),pe=class{constructor(t,n){this.__fn=t,this.__value=rt,this.__error=null,this.version=0,this.lastCleanEpoch=-1,this.dirty=!0,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!1,this.wrapper=this,this.__isSignal=!0,this.__isComputed=!0,this.__equal=n?.equals||Ft,this.watched=n?.[lt],this.unwatched=n?.[ft];let r=this;this.producerMustRecompute=function(){return r.__value===rt||r.__value===st},this.producerRecomputeValue=function(){if(r.__value===st)throw new Error("Detected cycle in computations.");let o=r.__value;r.__value=st;let s=it(r),i,a=!1;try{i=r.__fn.call(r.wrapper)}catch(l){i=je,r.__error=l,a=!0}finally{at(r,s)}if(!a&&(o!==rt&&o!==je)&&r.__equal.call(r.wrapper,o,i)){r.__value=o;return}r.__value=i,r.version++},this.consumerMarkedDirty=Oe}get(){if(Le(this),ct(this),this.__value===je)throw this.__error;return this.__value}peek(){if(Le(this),this.__value===je)throw this.__error;return this.__value}},Me=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=ae,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=Dt,this.producerRecomputeValue=Oe,this.wrapper=this,this.__isWatcher=!0;let n=this;this.consumerMarkedDirty=function(){n.__fire()}}__fire(){this.__notify&&this.__notify.call(this)}watch(...t){if(t.length===0){this.dirty=!1;return}let n=it(this);try{for(let r of t)ct(r),r.__isComputed&&Le(r)}finally{at(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(he(this.producers[n],this),this.producers.splice(n,1),this.producerLastReadVersions.splice(n,1),this.nextProducerIndex=Math.min(this.nextProducerIndex,this.producers.length))}getPending(){return this.producers.filter(t=>t.__isComputed&&t.dirty)}observe(t){let n=it(this),r;try{r=t()}finally{at(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)he(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},lt=Symbol("watched"),ft=Symbol("unwatched");function sr(e){let t=O;O=null;try{return e()}finally{O=t}}function or(e){return e.producers.slice()}function ir(e){return e.liveConsumers?[...e.liveConsumers]:[]}function ar(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function cr(e){return e.producers.length>0}function lr(){return O&&O.__isComputed?O:null}function fr(e){nt++,ie===null&&(ie=new Set);try{e()}finally{if(nt--,nt===0){let t=ie;ie=null;for(let n of t)n.__fire()}}}var me={State:$e,Computed:pe,subtle:{Watcher:Me,untrack:sr,introspectSources:or,introspectSinks:ir,hasSinks:ar,hasSources:cr,currentComputed:lr,watched:lt,unwatched:ft}};function ur(e,t){return new $e(e,t)}function dr(e,t){return new pe(e,t)}function hr(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function pr(e){let t=!1,n=!1,r=new pe(e),o=new Me(()=>{t||n||(t=!0,queueMicrotask(()=>{if(t=!1,!n){try{r.get()}catch(s){console.error(s)}o.watch()}}))});o.watch(r);try{r.get()}catch(s){console.error(s)}return()=>{n||(n=!0,o.dispose())}}var mr=`${y}s`,gr=`${y}e`;function zt(e){if(!e||e.nodeType!==8)return!1;let t=e.nodeValue;return t===mr||t===gr}function br(e){for(let t of e.addedNodes)if(zt(t))return!0;for(let t of e.removedNodes)if(zt(t))return!0;return!1}function Zt(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}var be=Zt(),V=Symbol("webjs.slot.state"),B="data-webjs-light",z="data-projection",ye="actual",Xt="fallback",Be=Symbol("webjs.slot.fallbackFrag"),yr=64,ge=null,ut=null,Ie=null,Kt=!1;function _r(){Kt||(be=Zt(),be&&(ge=HTMLSlotElement.prototype.assignedNodes,ut=HTMLSlotElement.prototype.assignedElements,Ie=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(t){return this.hasAttribute(B)&&!Gt(this)?dt(this,t):ge?ge.call(this,t):[]},HTMLSlotElement.prototype.assignedElements=function(t){return this.hasAttribute(B)&&!Gt(this)?dt(this,t).filter(n=>n.nodeType===1):ut?ut.call(this,t):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let t=Ie&&Ie.get?Ie.get.call(this):null;return t||wr(this)}}),Kt=!0))}_r();function Gt(e){let t=e;for(let n=0;n<128;n++){let r=t.parentNode;if(!r||r===t)return!1;if(r.host)return!0;t=r}return!1}function dt(e,t){if(e.getAttribute(z)===Xt)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:ht(n,new Set,0)}function ht(e,t,n){if(n>=yr)return e.slice();let r=[];for(let o of e)if(o.nodeType===1&&o.tagName==="SLOT"){let s=o;if(t.has(s))continue;if(t.add(s),s.hasAttribute(B)){let i=dt(s,{flatten:!1});if(i.length>0)for(let a of ht(i,t,n+1))r.push(a);else for(let a of ht(Array.from(s.childNodes),t,n+1))r.push(a)}else if(ge){let i=ge.call(s,{flatten:!0});for(let a of i)r.push(a)}else r.push(o)}else r.push(o);return r}function wr(e){let t=e.parentElement;for(;t;){if(t.tagName==="SLOT"&&t.hasAttribute(B))return t.getAttribute(z)===ye?t:null;t=t.parentElement}return null}function U(e){let t=e,n=t[V];return n||(n={assignedByName:new Map,pendingByName:new Map,lastSnapshot:new WeakMap,nameObservers:new WeakMap,childObserver:null,scheduled:!1,ownedSlots:new Set},t[V]=n),n}function pt(e){return!!e[V]}function Qt(e){let t=U(e);for(;e.firstChild;){let n=e.firstChild,r=Pe(n);qe(t.assignedByName,r,n),e.removeChild(n)}}function en(e){let t=U(e),n=e.querySelectorAll(`slot[${B}]`);for(let r of n){let o=r;if(o.getAttribute(z)!==ye)continue;let s=o.getAttribute("name")||null;if(!t.assignedByName.has(s)){let i=Array.from(o.childNodes);t.assignedByName.set(s,i),t.lastSnapshot.set(o,i.slice())}}}function Pe(e){if(e.nodeType!==1)return null;let n=e.getAttribute("slot");return n||null}function qe(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}function tn(e,t,n){if(!n.length)return;let r=e.get(t);r||(r=[],e.set(t,r));for(let o of n)r.push(o)}function nn(e){if(!be)return;let t=U(e);t.childObserver||(t.childObserver=new MutationObserver(n=>{let r=!1;for(let o of n)if(!br(o)){if(o.type==="childList"){for(let s of o.addedNodes)s.parentElement===e&&(qe(t.assignedByName,Pe(s),s),r=!0);for(let s of o.removedNodes)e.contains(s)||Jt(t,s)&&(r=!0)}else if(o.type==="attributes"&&o.attributeName==="slot"){let s=o.target;(Jt(t,s)||s.parentElement===e)&&(qe(t.assignedByName,Pe(s),s),r=!0)}}r&&Ue(e)}),t.childObserver.observe(e,{childList:!0,attributes:!0,attributeFilter:["slot"],subtree:!0}))}function rn(e){let t=e[V];if(t){t.childObserver&&(t.childObserver.disconnect(),t.childObserver=null);for(let n of t.ownedSlots){let r=t.nameObservers.get(n);r&&(r.disconnect(),t.nameObservers.delete(n))}}}function Jt(e,t){for(let[n,r]of e.assignedByName){let o=r.indexOf(t);if(o!==-1)return r.splice(o,1),r.length===0&&e.assignedByName.delete(n),!0}return!1}function Ue(e){let t=U(e);t.scheduled||(t.scheduled=!0,queueMicrotask(()=>{t.scheduled=!1,Sr(e)}))}function Sr(e){if(!be)return;let t=e[V];if(!t)return;let n=Array.from(e.querySelectorAll(`slot[${B}]`)),r=new Set(n);for(let i of t.ownedSlots)r.has(i)||Ar(t,i);for(let i of r)t.ownedSlots.has(i)||kr(e,i);t.ownedSlots=r;let o=new Map;for(let i of n){let a=i.getAttribute("name")||null,c=o.get(a);c||(c=[],o.set(a,c)),c.push(i)}for(let i of o.keys()){let a=t.pendingByName.get(i);if(a&&a.length){let c=t.assignedByName.get(i)||[],l=[];for(let d of a)l.push(d);for(let d of c)l.indexOf(d)===-1&&l.push(d);t.assignedByName.set(i,l),t.pendingByName.delete(i)}}let s=[];for(let[i,a]of o){let c=t.assignedByName.get(i)||[];for(let l=0;l<a.length;l++){let d=a[l];l===0&&c.length>0?Cr(t,d,c)&&s.push(d):xr(t,d)&&s.push(d)}}for(let i of s)Nr(i)}function Ar(e,t){let n=e.nameObservers.get(t);n&&(n.disconnect(),e.nameObservers.delete(t));let r=e.lastSnapshot.get(t);if(r&&r.length>0){let o=t.getAttribute("name")||null;tn(e.pendingByName,o,r)}e.lastSnapshot.delete(t)}function Cr(e,t,n){let r=t.getAttribute(z)!==ye,o=e.lastSnapshot.get(t)||[];if(!r&&Tr(o,n))return!1;let i=t[Be];if(r&&i)for(;t.firstChild;)i.appendChild(t.firstChild);else for(;t.firstChild;)t.removeChild(t.firstChild);for(let a of n)t.appendChild(a);return t.setAttribute(z,ye),e.lastSnapshot.set(t,n.slice()),!0}function xr(e,t){let n=t.getAttribute(z)===ye;if(t.setAttribute(z,Xt),!n)return Yt(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return Yt(t),!0}function Yt(e){let t=e[Be];!t||t.childNodes.length===0||e.appendChild(t)}function kr(e,t){if(!be)return;let n=U(e);if(n.nameObservers.has(t))return;let r=new MutationObserver(()=>Ue(e));r.observe(t,{attributes:!0,attributeFilter:["name"]}),n.nameObservers.set(t,r)}function sn(e,t){if(!pt(e))return;let n=U(e),r=n.lastSnapshot.get(t);if(!r||r.length===0)return;let o=t.getAttribute("name")||null;for(let i of r)i.parentNode===t&&t.removeChild(i);tn(n.pendingByName,o,r),n.lastSnapshot.delete(t);let s=n.nameObservers.get(t);s&&(s.disconnect(),n.nameObservers.delete(t)),n.ownedSlots.delete(t)}function Nr(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function Tr(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var on=new WeakMap,mt=Symbol.for("webjs.instance");function De(e,t){let n=t,r=n[mt];if(C(e)){let o=e;if(r&&r.strings===o.strings){Se(r,o.values);return}r&&an(r,t);let s=t.firstChild;s&&s.nodeType===8&&s.data==="webjs-hydrate"&&s.remove();let i=Rr(o,t);n[mt]=i;return}if(r&&an(r,t),n[mt]=null,t.replaceChildren(),!(e==null||e===!1||e===!0)){if(Array.isArray(e)){for(let o of e){let s=document.createTextNode(String(o??""));t.appendChild(s)}return}t.appendChild(document.createTextNode(String(e)))}}function _e(e){let{strings:t}=e,n=on.get(t);if(n)return n;let r=[],o="",s="text",i="",a=0,c="",l=0,d=null,p="",f="";for(let b=0;b<t.length;b++){let h=t[b];for(let u=0;u<h.length;u++){let m=h[u];switch(s){case"text":o+=m,m==="<"&&(s="tag-open");break;case"tag-open":o+=m,m==="!"?s="bang-1":m==="/"?(s="tag-name",p=""):/[a-zA-Z]/.test(m)?(s="tag-name",p=m.toLowerCase()):s="text";break;case"bang-1":o+=m,s=m==="-"?"bang-dash":"tag-name";break;case"bang-dash":o+=m,m==="-"?(s="comment",l=0):s="tag-name";break;case"comment":o+=m,m==="-"?l+=1:(m===">"&&l>=2&&(s="text"),l=0);break;case"tag-name":o+=m,m===">"?(s=p==="script"||p==="style"?"rawtext":"text",s==="rawtext"&&(f="")):/\s/.test(m)?s="in-tag":p+=m.toLowerCase();break;case"in-tag":o+=m,m===">"?(s=p==="script"||p==="style"?"rawtext":"text",s==="rawtext"&&(f="")):!/\s/.test(m)&&m!=="/"&&(s="attr-name",i=m,a=o.length-1);break;case"rawtext":o+=m,f=(f+m.toLowerCase()).slice(-9),(f.endsWith("<\/script>")||f.endsWith("</style>"))&&(s="text",f="",p="");break;case"attr-name":m==="="?(s="after-eq",o+=m):/\s/.test(m)?(s="in-tag",i="",o+=m):m===">"?(s="text",i="",o+=m):(i+=m,o+=m);break;case"after-eq":m==='"'||m==="'"?(s="attr-quoted",c=m,o+=m):/\s/.test(m)?(s="in-tag",i="",o+=m):m===">"?(s="text",i="",o+=m):(s="attr-unquoted",o+=m);break;case"attr-unquoted":/\s/.test(m)?(s="in-tag",i="",o+=m):(m===">"&&(s="text",i=""),o+=m);break;case"attr-quoted":o+=m,m===c&&(s="in-tag",i="");break;case"skip-attr":if(m===c){if(d){let k=d.firstPartIdx,S=[];for(let T=k;T<r.length;T++)(r[T].kind==="noop"||r[T].kind==="attr-mixed")&&S.push(T);let _=[],j=t[S[0]],E=j.lastIndexOf(c);_.push(E>=0?j.slice(E+1):j);for(let T=1;T<S.length;T++)_.push(t[S[T]]);let A=t[S[S.length-1]+1],L=A.indexOf(c);_.push(L>=0?A.slice(0,L):A),r[k]={kind:"attr-mixed",path:[],name:d.name,statics:_,group:S},d=null}s="in-tag",i=""}break}}if(b<t.length-1){let u=r.length;if(s==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(s==="rawtext"){f="",r.push({kind:"noop",path:[]});continue}if(s==="text")o+=`<!--${y}${u}-->`,r.push({kind:"child",path:[]});else if(s==="in-tag"){let m=`data-${y}${u}`;o+=`${m}=""`,r.push({kind:"element",path:[]})}else if(s==="after-eq"){let m=i[0],k=i.slice(1);if(m==="@"||m==="."||m==="?"){o=o.slice(0,a);let S=m==="@"?"event":m==="."?"prop":"bool",_=`data-${y}${u}`;o+=`${_}=""`,r.push({kind:S,path:[],name:k})}else{o=o.slice(0,a);let S=`data-${y}${u}`;o+=`${S}=""`,r.push({kind:"attr",path:[],name:i})}s="in-tag",i=""}else if(s==="attr-quoted"||s==="attr-unquoted"){o=o.slice(0,a);let m=`data-${y}${u}`;o+=`${m}=""`,d={name:i,firstPartIdx:u},r.push({kind:"noop",path:[]}),s="skip-attr"}else s==="skip-attr"&&r.push({kind:"noop",path:[]})}}let g=document.createElement("template");return g.innerHTML=o,Er(g.content,r),vr(g.content,r),n={templateEl:g,parts:r},on.set(t,n),n}function Er(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(B,"");let o=t.length;r.setAttribute(`data-${y}${o}`,""),t.push({kind:"slot",path:[]})}}function vr(e,t){let n=[];function r(o){for(let s=0;s<o.childNodes.length;s++){let i=o.childNodes[s];if(n.push(s),i.nodeType===8){let a=i.data;if(a.startsWith(y)){let c=Number(a.slice(y.length));t[c]&&t[c].kind==="child"&&(t[c].path=n.slice())}}else if(i.nodeType===1){let a=i,c=[];for(let l of a.attributes)if(l.name.startsWith(`data-${y}`)){let d=Number(l.name.slice(`data-${y}`.length));t[d]&&t[d].kind!=="child"&&(t[d].path=n.slice()),c.push(l.name)}for(let l of c)a.removeAttribute(l);r(i)}n.pop()}}r(e)}function Rr(e,t){let{templateEl:n,parts:r}=_e(e),o=n.content.cloneNode(!0),s=document.createComment(`${y}s`),i=document.createComment(`${y}e`),a=r.map(l=>we(l,o)),c=[];for(let l=0;l<e.values.length;l++)F(a[l],e.values[l],void 0,e.values),c.push(e.values[l]);t.replaceChildren(s,...o.childNodes,i);for(let l of a)l.kind==="slot"&&F(l,void 0,void 0,[]);return{strings:e.strings,bound:a,lastValues:c,startNode:s,endNode:i}}function we(e,t){if(e.kind==="noop")return{kind:"noop"};let n=t;for(let o of e.path)n=n.childNodes[o];if(e.kind==="child")return{kind:"child",marker:n};let r=n;if(e.kind==="event"){let o={kind:"event",el:r,name:e.name||"",handler:null,dispatcher(s){o.handler?.(s)}};return r.addEventListener(o.name,o.dispatcher),o}if(e.kind==="attr")return{kind:"attr",el:r,name:e.name||""};if(e.kind==="attr-mixed")return{kind:"attr-mixed",el:r,name:e.name||"",statics:e.statics||[],group:e.group||[]};if(e.kind==="prop")return{kind:"prop",el:r,name:e.name||""};if(e.kind==="bool")return{kind:"bool",el:r,name:e.name||""};if(e.kind==="element")return{kind:"element",el:r};if(e.kind==="slot")return{kind:"slot",slotEl:r,applied:!1};throw new Error(`unknown part kind ${e.kind}`)}function Se(e,t){for(let n=0;n<t.length;n++){let r=t[n];Object.is(r,e.lastValues[n])||(F(e.bound[n],r,e.lastValues[n],t),e.lastValues[n]=r)}}function an(e,t){for(let n of e.bound){if(n.kind==="event"&&n.el.removeEventListener(n.name,n.dispatcher),n.kind==="element"){let r=n.lastTarget;if(r){if(typeof r=="function")try{r(void 0)}catch{}else typeof r=="object"&&(r.value=void 0);n.lastTarget=void 0,n.__lastEl=void 0}}if(n.kind==="slot"){let r=gt(n.slotEl);r&&sn(r,n.slotEl)}}t.replaceChildren()}function F(e,t,n,r){if(Q(t)){let o=t.value;if(e.kind==="prop"&&e.el[e.name]===o||e.kind==="attr"&&e.el.getAttribute(e.name)===String(o)||e.kind==="bool"&&e.el.hasAttribute(e.name)===!!o)return;t=o}switch(e.kind){case"child":Lr(e,t);break;case"attr":{t==null||t===!1?e.el.removeAttribute(e.name):e.el.setAttribute(e.name,String(t));break}case"prop":e.el[e.name]=t;break;case"bool":t?e.el.setAttribute(e.name,""):e.el.removeAttribute(e.name);break;case"event":e.handler=typeof t=="function"?t:null;break;case"element":Or(e,t);break;case"attr-mixed":{let o=e,s=o.statics[0];for(let i=0;i<o.group.length;i++)s+=String((r?r[o.group[i]]:t)??""),s+=o.statics[i+1]||"";e.el.setAttribute(e.name,s);break}case"slot":{if(e.applied)break;let o=e.slotEl,s=()=>{e.applied=!0;let a=gt(o);if(!a||jr(o))return;let c=document.createDocumentFragment();for(;o.firstChild;)c.appendChild(o.firstChild);o[Be]=c,Ue(a)};gt(o)?s():queueMicrotask(s);break}case"noop":break}}function gt(e){let t=e.parentElement;for(;t;){if(t[V])return t;t=t.parentElement}return null}function jr(e){let t=e;for(let n=0;n<128;n++){let r=t.parentNode;if(!r||r===t)return!1;if(r.host)return!0;t=r}return!1}function Or(e,t){let n=e,r=ne(t)?t.target:void 0,o=n.__refTarget,s=r!==o;if(s&&o)if(typeof o=="function")try{o(void 0)}catch{}else typeof o=="object"&&(o.value=void 0);if(s||n.__refElement!==e.el){if(n.__refTarget=r,r)if(typeof r=="function"){if(!s&&n.__refElement!==void 0)try{r(void 0)}catch{}try{r(e.el)}catch{}}else typeof r=="object"&&(r.value=e.el);n.__refElement=e.el,e.lastTarget=r}}function Lr(e,t){return Pr(e,t),$(e,t)}function $(e,t){let n=e.marker;if(X(t)){K(e);let o=String(t.value??""),s=document.createElement("template");s.innerHTML=o;let i=[...s.content.childNodes],a=document.createDocumentFragment();for(let c of i)a.appendChild(c);n.parentNode?.insertBefore(a,n),e.child=i;return}if(ee(t)){let o=t,s=e.__keyedKey;s!==void 0&&!Object.is(s,o.key)&&K(e),e.__keyedKey=o.key,$(e,o.value);return}if(te(t)){let o=t,s=e.__guardDeps,i=o.deps;if(s!==void 0&&(Array.isArray(s)&&Array.isArray(i)?Ir(s,i):Object.is(s,i)))return;e.__guardDeps=Array.isArray(i)?i.slice():i,$(e,o.fn());return}if(fe(t)){K(e);let o=t.template;if(o&&o.content){let s=o.content.cloneNode(!0),i=[...s.childNodes];n.parentNode?.insertBefore(s,n),e.child=i}return}if(ne(t))return;if(re(t))return qr(e,t.value);if(se(t))return Br(e,t.args);if(oe(t))return Ur(e,t.signal);if(ue(t))return Fr(e,t);if(de(t))return Dr(e,t);if(Z(t)){if(e.child&&e.child.kind==="repeat"){Mr(e,t);return}K(e);let o={kind:"repeat",map:new Map};e.child=o,$r(n,o,t);return}if(e.child){let o=e.child;if(o.kind==="repeat")fn(o),e.child=void 0;else if(o.kind==="async-stream")pn(o),e.child=void 0;else if("strings"in e.child){let s=e.child;if(C(t)&&s.strings===t.strings){Se(s,t.values);return}Ae(s.startNode,s.endNode),e.child=void 0}else{for(let s of e.child)s.parentNode&&s.parentNode.removeChild(s);e.child=void 0}}if(t==null||t===!1||t===!0)return;if(C(t)){let o=t,{templateEl:s,parts:i}=_e(o),a=s.content.cloneNode(!0),c=document.createComment(`${y}s`),l=document.createComment(`${y}e`),d=i.map(g=>we(g,a)),p=[];for(let g=0;g<o.values.length;g++)F(d[g],o.values[g],void 0,o.values),p.push(o.values[g]);let f=[c,...a.childNodes,l];n.parentNode?.insertBefore(cn(f),n);for(let g of d)g.kind==="slot"&&F(g,void 0,void 0,[]);e.child={strings:o.strings,bound:d,lastValues:p,startNode:c,endNode:l};return}if(Array.isArray(t)){let o=[];for(let i of t)if(C(i)){let a=i,{templateEl:c,parts:l}=_e(a),d=c.content.cloneNode(!0),p=l.map(f=>we(f,d));for(let f=0;f<a.values.length;f++)F(p[f],a.values[f],void 0,a.values);o.push(...d.childNodes)}else i!=null&&i!==!1&&i!==!0&&o.push(document.createTextNode(String(i)));let s=cn(o);n.parentNode?.insertBefore(s,n),e.child=o;return}let r=document.createTextNode(String(t));n.parentNode?.insertBefore(r,n),e.child=[r]}function cn(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function Ae(e,t){if(!e.parentNode)return;let n=e;for(;n&&n!==t;){let r=n.nextSibling;n.parentNode?.removeChild(n),n=r}t.parentNode===e.parentNode&&t.parentNode?.removeChild(t)}function ln(e){let{templateEl:t,parts:n}=_e(e),r=t.content.cloneNode(!0),o=document.createComment(`${y}s`),s=document.createComment(`${y}e`),i=n.map(l=>we(l,r)),a=[];for(let l=0;l<e.values.length;l++)F(i[l],e.values[l],void 0,e.values),a.push(e.values[l]);let c=document.createDocumentFragment();for(c.appendChild(o);r.firstChild;)c.appendChild(r.firstChild);return c.appendChild(s),{inst:{strings:e.strings,bound:i,lastValues:a,startNode:o,endNode:s},frag:c}}function Fe(e){for(let t of e.bound)if(t.kind==="event"&&t.el.removeEventListener(t.name,t.dispatcher),t.kind==="element"){let n=t.lastTarget;if(n){if(typeof n=="function")try{n(void 0)}catch{}else typeof n=="object"&&(n.value=void 0);t.lastTarget=void 0,t.__lastEl=void 0}}}function $r(e,t,n){let{items:r,keyFn:o,templateFn:s}=n,i=e.parentNode;if(!i)return;let a=document.createDocumentFragment();for(let c=0;c<r.length;c++){let l=o(r[c],c),d=s(r[c],c);if(!C(d))continue;let{inst:p,frag:f}=ln(d);t.map.set(l,p),a.appendChild(f)}i.insertBefore(a,e)}function Mr(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let o=e.child,{items:s,keyFn:i,templateFn:a}=t,c=new Map;for(let l=0;l<s.length;l++){let d=i(s[l],l),p=a(s[l],l);if(!C(p))continue;let f=o.map.get(d);if(f&&f.strings===p.strings)Se(f,p.values),bt(f.startNode,f.endNode,r,n),c.set(d,f),o.map.delete(d);else{f&&(Fe(f),Ae(f.startNode,f.endNode),o.map.delete(d));let{inst:g,frag:b}=ln(p);r.insertBefore(b,n),c.set(d,g)}}for(let l of o.map.values())Fe(l),Ae(l.startNode,l.endNode);o.map=c}function fn(e){for(let t of e.map.values())Fe(t),Ae(t.startNode,t.endNode);e.map.clear()}function bt(e,t,n,r){if(t.nextSibling===r&&e.parentNode===n)return;let o=document.createDocumentFragment(),s=e;for(;s;){let i=s.nextSibling;if(o.appendChild(s),s===t)break;s=i}n.insertBefore(o,r)}function Ir(e,t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}function K(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&un(t),!e.child)return;let n=e.child;if(n.kind==="repeat")fn(n);else if(n.kind==="async-stream")pn(n);else if("strings"in n){let r=e.child;Fe(r),Ae(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function Pr(e,t){let n=e;n.__untilState&&!se(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!te(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!re(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!ee(t)&&(n.__keyedKey=void 0),n.__watchSub&&!oe(t)&&un(n)}function qr(e,t){let n=e.marker,r=e,o=r.__cacheMap;o||(o=new Map,r.__cacheMap=o);let s=e.child;if(s&&"strings"in s){let a=s;if(C(t)&&a.strings===t.strings){Se(a,t.values);return}let c=document.createDocumentFragment();bt(a.startNode,a.endNode,c,null),o.set(a.strings,{inst:a,holder:c}),e.child=void 0}if(C(t)){let a=t,c=o.get(a.strings);if(c){o.delete(a.strings),e.child&&K(e),bt(c.inst.startNode,c.inst.endNode,n.parentNode,n),Se(c.inst,a.values),e.child=c.inst;return}}$(e,t)}function Br(e,t){let n=e,r=n.__untilState,o=n.__untilArgs,s=(f,g)=>!!(Object.is(f,g)||C(f)&&C(g)&&f.strings===g.strings),a=o&&o.length===t.length&&o.every((f,g)=>s(f,t[g]))&&r?r.highestResolved:1/0;r&&(r.aborted=!0),n.__untilArgs=t.slice();let c={aborted:!1,highestResolved:a};n.__untilState=c;let l=-1,d;for(let f=0;f<t.length;f++){let g=t[f];if(!g||typeof g.then!="function"){l=f,d=g;break}}l!==-1&&l<=c.highestResolved?($(e,d),c.highestResolved=l):l===-1&&!n.__untilEverRendered&&$(e,""),n.__untilEverRendered=!0;let p=Math.min(l===-1?t.length:l,c.highestResolved);for(let f=0;f<p;f++){let g=t[f];!g||typeof g.then!="function"||Promise.resolve(g).then(b=>{c.aborted||f>=c.highestResolved||(c.highestResolved=f,$(e,b))},()=>{})}}function Ur(e,t){let n=e;if(n.__watchSig===t&&n.__watchSub){let s;n.__watchSub.observe(()=>{s=t.get()}),$(e,s);return}n.__watchSub&&(n.__watchSub.dispose(),n.__watchSub=void 0),n.__watchSig=t;let r=new me.subtle.Watcher(()=>{queueMicrotask(()=>{if(n.__watchSub!==r)return;let s;r.observe(()=>{s=t.get()}),$(e,s)})});n.__watchSub=r;let o;r.observe(()=>{o=t.get()}),$(e,o)}function un(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function Fr(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="append"&&n.iterable===t.iterable)return;K(e);let r=t.iterable[Symbol.asyncIterator](),o={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=o,dn(o,e,t)}function Dr(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="replace"&&n.iterable===t.iterable)return;K(e);let r=t.iterable[Symbol.asyncIterator](),o={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=o,dn(o,e,t)}async function dn(e,t,n){let r=t.marker,o=0;try{for(;!e.aborted;){let s=await e.iterator.next();if(e.aborted||s.done)break;let i=n.mapper?n.mapper(s.value,o):s.value,a=hn(i);if(e.mode==="replace"){for(let l of e.nodes)l.parentNode&&l.parentNode.removeChild(l);e.nodes=[]}let c=document.createDocumentFragment();for(let l of a)c.appendChild(l);r.parentNode?.insertBefore(c,r),e.nodes.push(...a),o++}}catch(s){typeof console<"u"&&console.error("[webjs] asyncStream error:",s)}}function hn(e){if(e==null||e===!1||e===!0)return[];if(C(e)){let t=e,{templateEl:n,parts:r}=_e(t),o=n.content.cloneNode(!0),s=r.map(i=>we(i,o));for(let i=0;i<t.values.length;i++)F(s[i],t.values[i],void 0,t.values);return[...o.childNodes]}if(Array.isArray(e)){let t=[];for(let n of e)t.push(...hn(n));return t}return[document.createTextNode(String(e))]}function pn(e){e.aborted=!0;for(let t of e.nodes)t.parentNode&&t.parentNode.removeChild(t);e.nodes=[];try{e.iterator.return?.()?.catch?.(()=>{})}catch{}}var mn=Symbol.for("webjs:registry"),gn=Symbol.for("webjs:classToTag"),He=globalThis,M=He[mn]||(He[mn]=new Map),bn=He[gn]||(He[gn]=new WeakMap),We=typeof window<"u"&&typeof customElements<"u";function yt(e,t){if(!e||typeof e!="string"||!e.includes("-"))throw new Error(`customElements.define: tag "${e}" must contain a hyphen (HTML spec)`);let n=t.lazy===!0,r=M.get(e);r?(r.cls=t,r.lazy=n):M.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),bn.set(t,e)}if(We){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),yt(t,n)}}if(!We){let e=globalThis;e.customElements||(e.customElements={define(t,n){yt(t,n)},get(t){return M.get(t)?.cls},upgrade(){},whenDefined(t){let n=M.get(t);return Promise.resolve(n?.cls)}})}function _t(e,t){We?customElements.define(e,t):yt(e,t)}function Hr(e,t){if(We)return;let n=M.get(e);if(n){n.moduleUrl=t;return}M.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e})}function wt(e){return M.get(e)?.cls}function Wr(e){return M.get(e)?.moduleUrl||null}function Vr(e){return M.get(e)?.lazy===!0}function Ve(e){return bn.get(e)}function St(){return[...M.keys()]}var w="_$wj",ke="_id";async function Ne(e){return JSON.stringify(await yn(e))}function J(e){return _n(JSON.parse(e))}async function yn(e){let t=zr();return await Kr(e,t),G(e,t)}function _n(e){return D(e,Zr())}function zr(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map}}async function Kr(e,t){let n=[e];for(;n.length;){let r=n.pop();if(!Qr(r))continue;let o=t.refCount.get(r)||0;if(t.refCount.set(r,o+1),!(o>0)){if(typeof Blob<"u"&&r instanceof Blob){let s=new Uint8Array(await r.arrayBuffer());t.blobBytes.set(r,s);continue}if(typeof FormData<"u"&&r instanceof FormData){for(let[,s]of r.entries())typeof s!="string"&&n.push(s);continue}if(Array.isArray(r))for(let s=0;s<r.length;s++)n.push(r[s]);else if(r instanceof Map)for(let[s,i]of r)n.push(s),n.push(i);else if(r instanceof Set)for(let s of r)n.push(s);else if(es(r))for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&n.push(r[s])}}for(let[r,o]of t.refCount)o>1&&t.idOf.set(r,t.nextId++)}function G(e,t){if(e===null)return null;if(e===void 0)return{[w]:"undef"};let n=typeof e;if(n==="string"||n==="boolean")return e;if(n==="number")return Number.isNaN(e)?{[w]:"NaN"}:e===1/0?{[w]:"Inf"}:e===-1/0?{[w]:"-Inf"}:Object.is(e,-0)?{[w]:"-0"}:e;if(n==="bigint")return{[w]:"BigInt",v:e.toString()};if(n==="symbol"){let s=Symbol.keyFor(e);if(s===void 0)throw new TypeError("Cannot serialize a local Symbol; only Symbol.for() registered symbols are supported.");return{[w]:"Sym",v:s}}if(n==="function")throw new TypeError("Cannot serialize a function.");let r=t.idOf.get(e);if(r!==void 0&&t.emitted.has(r))return{[w]:"Ref",v:r};r!==void 0&&t.emitted.add(r);let o;if(e instanceof Date)o={[w]:"Date",v:Number.isNaN(e.getTime())?null:e.toISOString()};else if(e instanceof Error)o={[w]:"Error",v:{name:e.name,message:e.message,stack:e.stack||null}};else if(typeof Blob<"u"&&e instanceof Blob){let s=t.blobBytes.get(e);typeof File<"u"&&e instanceof File?o={[w]:"File",v:xe(s),n:e.name,t:e.type||"",m:e.lastModified}:o={[w]:"Blob",v:xe(s),t:e.type||""}}else if(typeof FormData<"u"&&e instanceof FormData){let s=[];for(let[i,a]of e.entries())s.push([i,G(a,t)]);o={[w]:"FD",v:s}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)o=Gr(e);else if(e instanceof Map){let s=[];for(let[i,a]of e)s.push([G(i,t),G(a,t)]);o={[w]:"Map",v:s}}else if(e instanceof Set){let s=[];for(let i of e)s.push(G(i,t));o={[w]:"Set",v:s}}else if(Array.isArray(e))o=e.map(s=>G(s,t));else{o={};for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;let i=ts(s)?"_"+s:s;o[i]=G(e[s],t)}}if(r!==void 0){if(Array.isArray(o))return{[w]:"Arr",[ke]:r,v:o};o[ke]=r}return o}function Gr(e){if(e instanceof ArrayBuffer)return{[w]:"buf",v:xe(new Uint8Array(e))};if(e instanceof DataView)return{[w]:"dv",v:xe(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=Jr[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[w]:n,v:xe(r)}}var Jr={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},Yr={i8:Int8Array,u8:Uint8Array,u8c:Uint8ClampedArray,i16:Int16Array,u16:Uint16Array,i32:Int32Array,u32:Uint32Array,f32:Float32Array,f64:Float64Array,bi64:typeof BigInt64Array<"u"?BigInt64Array:null,bu64:typeof BigUint64Array<"u"?BigUint64Array:null};function Zr(){return{refs:new Map}}function D(e,t){if(e===null||typeof e!="object")return e;if(Array.isArray(e)){let s=[];for(let i=0;i<e.length;i++)s.push(D(e[i],t));return s}let n=e[w];if(typeof n=="string")return Xr(e,n,t);let r={},o=e[ke];typeof o=="number"&&t.refs.set(o,r);for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s)||s===ke)continue;let i=ns(s)?s.slice(1):s;r[i]=D(e[s],t)}return r}function Xr(e,t,n){let r=e[ke];switch(t){case"undef":return;case"NaN":return NaN;case"Inf":return 1/0;case"-Inf":return-1/0;case"-0":return-0;case"BigInt":return BigInt(e.v);case"Sym":return Symbol.for(e.v);case"Date":return e.v==null?new Date(NaN):new Date(e.v);case"Error":{let o=new Error(e.v.message);return o.name=e.v.name,e.v.stack&&(o.stack=e.v.stack),typeof r=="number"&&n.refs.set(r,o),o}case"Map":{let o=new Map;typeof r=="number"&&n.refs.set(r,o);for(let[s,i]of e.v)o.set(D(s,n),D(i,n));return o}case"Set":{let o=new Set;typeof r=="number"&&n.refs.set(r,o);for(let s of e.v)o.add(D(s,n));return o}case"Arr":{let o=[];typeof r=="number"&&n.refs.set(r,o);for(let s of e.v)o.push(D(s,n));return o}case"Ref":{let o=n.refs.get(e.v);if(o===void 0)throw new TypeError(`Dangling reference: id=${e.v}`);return o}case"Blob":{if(typeof Blob>"u")throw new TypeError("Blob is not available in this environment.");let o=Ce(e.v);return new Blob([o],{type:e.t||""})}case"File":{if(typeof File>"u")throw new TypeError("File is not available in this environment.");let o=Ce(e.v);return new File([o],e.n,{type:e.t||"",lastModified:e.m})}case"FD":{if(typeof FormData>"u")throw new TypeError("FormData is not available in this environment.");let o=new FormData;for(let[s,i]of e.v){let a=D(i,n);o.append(s,a)}return o}default:{if(t==="buf"){let s=Ce(e.v);return s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)}if(t==="dv"){let s=Ce(e.v);return new DataView(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength))}let o=Yr[t];if(o){let s=Ce(e.v),i=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength);return new o(i)}throw new TypeError(`Unknown serialization tag: ${t}`)}}}function Qr(e){return e!==null&&typeof e=="object"}function es(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function ts(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function ns(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}var wn=typeof Buffer<"u"&&typeof Buffer.from=="function";function xe(e){if(wn)return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("base64");let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function Ce(e){if(wn){let r=Buffer.from(e,"base64");return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}let t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}var Cn=typeof window<"u"&&typeof HTMLElement<"u";function rs(e,t){return e!==t}var ss=Cn?HTMLElement:class{},At=class extends ss{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){_t(t,this)}static get observedAttributes(){let t=this.properties||{};return Object.keys(t).filter(n=>!t[n].state).map(Sn)}constructor(){super(),this._renderRoot=null,this._scheduled=!1,this._connected=!1,this.__controllers=new Set,this.__firstRendered=!1,this._changedProperties=new Map,this._updateResolve=null,this._updatePromise=Promise.resolve(!0),this._isUpdating=!1,this._initializeProperties()}_initializeProperties(){let n=this.constructor.properties;if(!(!n||typeof n!="object")){this.__propValues={};for(let[r,o]of Object.entries(n)){let s=typeof o=="object"?o:{type:o},i=this[r];Object.defineProperty(this,r,{configurable:!0,enumerable:!0,get:()=>this.__propValues[r],set:a=>{let c=this.__propValues[r];(s.hasChanged||rs)(a,c)&&(this.__propValues[r]=a,s.reflect&&!s.state&&this._connected&&this._reflectAttribute(r,a,s),this.requestUpdate(r,c))}}),i!==void 0&&(this.__propValues[r]=i)}}}_reflectAttribute(t,n,r){let o=Sn(t);if(!this.__reflectingAttribute){this.__reflectingAttribute=!0;try{if(r.converter&&r.converter.toAttribute){let s=r.converter.toAttribute(n,r.type);s==null?this.removeAttribute(o):this.setAttribute(o,s)}else r.type===Boolean?n?this.setAttribute(o,""):this.removeAttribute(o):n==null?this.removeAttribute(o):r.type===Object||r.type===Array?this.setAttribute(o,JSON.stringify(n)):this.setAttribute(o,String(n))}finally{this.__reflectingAttribute=!1}}}connectedCallback(){if(!Cn)return;if(this.__webjsPropsHydrated||(this.__webjsPropsHydrated=!0,this._hydratePropAttrs()),this.constructor.hydrate==="visible"&&typeof IntersectionObserver<"u"&&!this.__hydrationActivated){this.__hydrationActivated=!1,this.__hydrationObserver=new IntersectionObserver(n=>{for(let r of n)if(r.isIntersecting){this.__hydrationObserver.unobserve(this),this.__hydrationObserver.disconnect(),this.__hydrationObserver=null,this.__hydrationActivated=!0,this._activate();return}},{rootMargin:"200px"}),this.__hydrationObserver.observe(this);return}this._activate()}_hydratePropAttrs(){let t=[],n=this.attributes;for(let r=0;r<n.length;r++){let o=n[r].name;o.startsWith("data-webjs-prop-")&&t.push(o)}for(let r of t){let o=this.getAttribute(r);if(this.removeAttribute(r),o==null)continue;let s=An(r.slice(16));try{this[s]=J(o)}catch(i){console.warn(`[webjs] failed to decode ${r} on <${this.tagName.toLowerCase()}>: ${i&&i.message}`)}}}_activate(){this._connected=!0;let t=this.constructor;if(t.shadow===!0){let n=!!this.shadowRoot;this.shadowRoot||this.attachShadow({mode:"open"}),this._renderRoot=this.shadowRoot;let r=t.styles,o=Array.isArray(r)?r:le(r)?[r]:[];if(o.length){if(n){let s=this.shadowRoot.querySelector("style");s&&s.remove()}et(this._renderRoot,o)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${Ve(t)||this.tagName?.toLowerCase()}> has static shadow = false AND static styles. static styles only works with shadow DOM (adoptedStyleSheets). For light DOM, use global CSS or <style> in render().`),pt(this)||(this.__isHydrating()?(U(this),en(this)):Qt(this));for(let n of this.__controllers)n.hostConnected&&n.hostConnected();this._updateResolve===null&&(this._updatePromise=new Promise(n=>{this._updateResolve=n})),this._scheduled=!0,queueMicrotask(()=>{this._scheduled=!1;try{this._performRender()}catch(n){console.error("[webjs] lifecycle hook threw during initial render:",n)}this._renderRoot===this&&nn(this)})}__isHydrating(){let t=this.firstChild,n=t!=null&&t.nodeType===8&&t.data==="webjs-hydrate";return n&&(this.__hydratedAtActivate=!0),n}disconnectedCallback(){this._connected=!1,this.__hydrationObserver&&(this.__hydrationObserver.disconnect(),this.__hydrationObserver=null),this._renderRoot===this&&rn(this),this.__signalWatcher&&(this.__signalWatcher.dispose(),this.__signalWatcher=void 0);for(let t of this.__controllers)t.hostDisconnected&&t.hostDisconnected()}attributeChangedCallback(t,n,r){if(this.__reflectingAttribute)return;let o=this.constructor,s=An(t),i=o.properties&&(o.properties[s]||o.properties[t]);if(!i)return;let a;if(i.converter&&i.converter.fromAttribute)a=i.converter.fromAttribute(r,i.type);else if(i.type===Number)a=r==null?null:Number(r);else if(i.type===Boolean)a=r!=null&&r!=="false";else if(i.type===Object||i.type===Array)try{a=r==null?null:JSON.parse(r)}catch{a=r}else a=r;this[s]!==a&&(this[s]=a,this._connected&&this.requestUpdate())}requestUpdate(t,n){t!==void 0&&!this._changedProperties.has(t)&&this._changedProperties.set(t,n),this._scheduleUpdate()}_scheduleUpdate(){this._updateResolve===null&&(this._updatePromise=new Promise(t=>{this._updateResolve=t})),!this._isUpdating&&(this._scheduled||!this._connected||(this._scheduled=!0,queueMicrotask(()=>{this._scheduled=!1;try{this._performRender()}catch(t){console.error("[webjs] lifecycle hook threw during update cycle:",t)}})))}_performRender(){if(!this._renderRoot)return;let t=this._changedProperties;this._isUpdating=!0;let n=!1;try{if(this.shouldUpdate(t)){this.willUpdate(t);for(let r of this.__controllers)r.hostUpdate&&r.hostUpdate();try{this.update(t)}catch(r){console.error(`[webjs] render error in <${Ve(this.constructor)||this.tagName?.toLowerCase()}>:`,r);try{let o=this.renderError(r);o!==void 0&&De(o,this._renderRoot)}catch(o){console.error("[webjs] renderError() also threw:",o)}}for(let r of this.__controllers)r.hostUpdated&&r.hostUpdated();n=!0}}catch(r){console.error("[webjs] lifecycle hook threw during update phase:",r)}finally{this._isUpdating=!1,n&&(this._changedProperties=new Map)}if(n)try{this.__firstRendered||(this.__firstRendered=!0,this.firstUpdated(t)),this.updated(t)}catch(r){console.error("[webjs] lifecycle hook threw during post-commit phase:",r)}finally{this._resolveUpdate()}else this._resolveUpdate()}_resolveUpdate(){if(this._updateResolve){let t=this._changedProperties.size===0;this._updateResolve(t),this._updateResolve=null}}shouldUpdate(t){return!0}willUpdate(t){}update(t){this.__signalWatcher||(this.__signalWatcher=new me.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n;this.__signalWatcher.observe(()=>{n=this.render()}),De(n,this._renderRoot)}updated(t){}firstUpdated(t){}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._updatePromise}addController(t){this.__controllers.add(t),this._connected&&t.hostConnected&&t.hostConnected()}removeController(t){this.__controllers.delete(t)}render(){return""}renderError(t){}};function Sn(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function An(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}var Eo=Symbol.for("webjs.suspense");function os(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function ze(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}var Ct=null;function is(e){Ct=e}function xt(){if(!Ct)return"";try{return Ct()||""}catch{return""}}async function as(e,t={ssr:!0}){let n=t&&t.suspenseCtx,r=await x(e,n);return t&&t.ssr===!1?r:await Te(r,n)}async function x(e,t){if(e==null||e===!1||e===!0)return"";if(e&&typeof e.then=="function")return e=await e,x(e,t);if(X(e))return String(e.value??"");if(Q(e))return x(e.value,t);if(oe(e))return x(e.signal.get(),t);if(ee(e))return x(e.value,t);if(te(e))return x(e.fn(),t);if(fe(e)){let n=e.template;return String(n?.innerHTML??"")}if(ne(e))return"";if(re(e))return x(e.value,t);if(se(e)){let n=e.args;for(let r of n)if(!r||typeof r.then!="function")return x(r,t);if(n.length>0)try{let r=await Promise.race(n.map(o=>Promise.resolve(o).catch(()=>{})));return x(r,t)}catch{return""}return""}if(ue(e)||de(e))return"";if(Array.isArray(e))return(await Promise.all(e.map(r=>x(r,t)))).join("");if(Z(e)){let n=e;return(await Promise.all(n.items.map((o,s)=>x(n.templateFn(o,s),t)))).join("")}if(ze(e)){let n=e,r=await x(n.fallback,t);if(t){let o=`s${t.nextId++}`;return t.pending.push({id:o,promise:Promise.resolve(n.children)}),`<webjs-boundary id="${o}">${r}</webjs-boundary>`}return r}return C(e)?cs(e,t):Re(String(e))}async function cs(e,t){let{strings:n,values:r}=e,o="",s="text",i="",a=0,c="",l=0,d="",p="";for(let f=0;f<n.length;f++){let g=n[f];for(let b=0;b<g.length;b++){let h=g[b];switch(s){case"text":o+=h,h==="<"&&(s="tag-open");break;case"tag-open":o+=h,h==="!"?s="bang-1":h==="/"?(s="tag-name",d=""):/[a-zA-Z]/.test(h)?(s="tag-name",d=h.toLowerCase()):s="text";break;case"bang-1":o+=h,s=h==="-"?"bang-dash":"tag-name";break;case"bang-dash":o+=h,h==="-"?(s="comment",l=0):s="tag-name";break;case"comment":o+=h,h==="-"?l+=1:(h===">"&&l>=2&&(s="text"),l=0);break;case"tag-name":o+=h,h===">"?(s=Ge(d)?"rawtext":"text",s==="rawtext"&&(p="")):/\s/.test(h)?s="in-tag":d+=h.toLowerCase();break;case"in-tag":o+=h,h===">"?(s=Ge(d)?"rawtext":"text",s==="rawtext"&&(p="")):!/\s/.test(h)&&h!=="/"&&(s="attr-name",i=h,a=o.length-1);break;case"rawtext":o+=h,p=(p+h.toLowerCase()).slice(-9),(p.endsWith("<\/script>")||p.endsWith("</style>"))&&(s="text",p="",d="");break;case"attr-name":h==="="?(s="after-eq",o+=h):/\s/.test(h)?(s="in-tag",i="",o+=h):h===">"?(s="text",i="",o+=h):(i+=h,o+=h);break;case"after-eq":h==='"'||h==="'"?(s="attr-quoted",c=h,o+=h):/\s/.test(h)?(s="in-tag",i="",o+=h):h===">"?(s="text",i="",o+=h):(s="attr-unquoted",o+=h);break;case"attr-unquoted":/\s/.test(h)?(s="in-tag",i="",o+=h):(h===">"&&(s="text",i=""),o+=h);break;case"attr-quoted":o+=h,h===c&&(s="in-tag",i="");break}}if(f<r.length){let b=r[f];if(b&&typeof b.then=="function"&&(b=await b),s==="comment")o+=String(b??""),l=0;else if(s==="rawtext")o+=String(b??""),p="";else if(s==="text")o+=await x(b,t);else if(s==="after-eq"){let h=i[0],u=i.slice(1);if(h==="@")o=o.slice(0,a),s="in-tag",i="";else if(h==="."){if(o=o.slice(0,a),!d.includes("-")){s="in-tag",i="";continue}if(b===void 0){s="in-tag",i="";continue}try{let m=await Ne(b);o+=`data-webjs-prop-${gs(u)}="${I(m)}"`}catch(m){console.warn(`[webjs] property binding .${u} has an unserializable value during SSR. Dropping. The browser will see the property as undefined. Detail: ${m&&m.message}`)}s="in-tag",i=""}else h==="?"?(o=o.slice(0,a),b&&(o+=`${u}=""`),s="in-tag",i=""):(o+=`"${I(String(b??""))}"`,s="in-tag",i="")}else(s==="attr-quoted"||s==="attr-unquoted")&&(o+=I(String(b??"")))}}return o}async function Te(e,t){let n=St();if(!n.length)return e;let r=[...n].sort((l,d)=>d.length-l.length),o=new RegExp(`<(${r.map(Ke).join("|")})(?=[\\s>/])((?:"[^"]*"|'[^']*'|[^>])*?)(/?)>`,"g"),s=[];for(let l of e.matchAll(o)){let[d,p,f,g]=l,b=wt(p);if(!b)continue;t&&t.usedComponents&&t.usedComponents.add(p);let h=g?`<${p}${f}>`:d;try{let u=b.shadow===!0,m=new b,k=ps(f),S=ys(k);ms(m,k,b);for(let[E,A]of Object.entries(S))m[E]=A;let _=m.render?m.render():"";_&&typeof _.then=="function"&&(_=await _);let j=await x(_,t);if(u){let E=await Te(j,t),A=b.styles,L=Array.isArray(A)?A:A&&le(A)?[A]:[],T=tt(L);s.push({start:l.index,end:l.index+d.length,text:`${h}<template shadowrootmode="open">${T}${E}</template>`})}else{if(j.trim()===""){s.push({start:l.index,end:l.index+d.length,text:`${h}<!--webjs-hydrate-->`});continue}let A="",L=l.index+d.length;if(!g){let Qe=l.index+d.length,ve=Nt(e,Qe,p);if(ve!==-1){A=e.slice(Qe,ve);let Gn=new RegExp(`</${Ke(p)}\\s*>`,"i"),Jn=e.slice(ve),Bt=Gn.exec(Jn),Yn=Bt?Bt[0].length:`</${p}>`.length;L=ve+Yn}else A=e.slice(Qe),L=e.length}let T=ds(A),zn=hs(j,T),Kn=await Te(zn,t);s.push({start:l.index,end:L,text:`${h}<!--webjs-hydrate-->${Kn}</${p}>`})}}catch(u){console.error(`[webjs] SSR failed for <${p}>:`,u)}}if(!s.length)return e;s.sort((l,d)=>l.start-d.start);let i=[],a=-1;for(let l of s)l.start>=a&&(i.push(l),a=l.end);let c=e;for(let l=i.length-1;l>=0;l--){let{start:d,end:p,text:f}=i[l];c=c.slice(0,d)+f+c.slice(p)}return c}var ls=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function fs(e){return ls.has(e.toLowerCase())}function Nt(e,t,n){let r=Ke(n),o=new RegExp(`<${r}(?:[\\s>/])`,"gi"),s=new RegExp(`</${r}\\s*>`,"gi");o.lastIndex=t,s.lastIndex=t;let i=1;for(;i>0;){let a=o.exec(e),c=s.exec(e);if(!c)return-1;if(a&&a.index<c.index)i++,s.lastIndex=a.index+1;else{if(i--,i===0)return c.index;o.lastIndex=c.index+1}}return-1}function us(e){let t=/\bslot\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(e);if(!t)return null;let n=t[1]??t[2]??t[3]??"";return n===""?null:n}function ds(e){let t=new Map,n="",r=0;for(;r<e.length;){let o=e.indexOf("<",r);if(o===-1){n+=e.slice(r);break}o>r&&(n+=e.slice(r,o));let s=e.slice(o);if(s.startsWith("<!--")){let u=e.indexOf("-->",o+4);if(u===-1){n+=s,r=e.length;break}n+=e.slice(o,u+3),r=u+3;continue}if(s.startsWith("<!")||s.startsWith("</")){let u=e.indexOf(">",o);if(u===-1){n+=s,r=e.length;break}n+=e.slice(o,u+1),r=u+1;continue}let i=/^<([a-zA-Z][\w-]*)((?:"[^"]*"|'[^']*'|[^>])*?)(\/?)>/.exec(s);if(!i){n+="<",r=o+1;continue}let[a,c,l,d]=i,p=c.toLowerCase(),f=!!d||fs(p),g=us(l),b;if(f)b=o+a.length;else{let u=o+a.length,m=Nt(e,u,p);if(m===-1){let E=e.slice(o);g!==null?xn(t,g,E):n+=E,r=e.length;continue}let k=new RegExp(`</${Ke(p)}\\s*>`,"i"),S=e.slice(m),_=k.exec(S),j=_?_[0].length:`</${p}>`.length;b=m+j}let h=e.slice(o,b);g!==null?xn(t,g,h):n+=h,r=b}return n.length>0&&t.set(null,n),t}function xn(e,t,n){let r=e.get(t);r!==void 0?e.set(t,r+n):e.set(t,n)}function hs(e,t){let n=new Set,r="",o=0,s=/<slot((?:"[^"]*"|'[^']*'|[^>])*?)(\/?)>/gi,i;for(;(i=s.exec(e))!==null;){r+=e.slice(o,i.index);let[a,c,l]=i,d=!!l,p=/\bname\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(c),f=p?p[1]??p[2]??p[3]:null,g=c.replace(/\bname\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,"").trim(),b="",h;if(d)h=i.index+a.length;else{let S=i.index+a.length,_=Nt(e,S,"slot");if(_===-1)b=e.slice(S),h=e.length;else{b=e.slice(S,_);let j=/<\/slot\s*>/i,E=e.slice(_),A=j.exec(E),L=A?A[0].length:7;h=_+L}}let u=t.get(f),m=f!==null?` name="${I(f)}"`:"",k=g?` ${g}`:"";u!==void 0&&!n.has(f)?(n.add(f),r+=`<slot data-webjs-light data-projection="actual"${m}${k}>${u}</slot>`):r+=`<slot data-webjs-light data-projection="fallback"${m}${k}>${b}</slot>`,o=h,s.lastIndex=h}return r+=e.slice(o),r}function Ke(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ge(e){return e==="script"||e==="style"}function ps(e){let t={},n=/([a-zA-Z_:][\w:.-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g,r;for(;(r=n.exec(e))!==null;)t[r[1]]=r[2]??r[3]??r[4]??"";return t}function ms(e,t,n){let r=n.properties||{};for(let[o,s]of Object.entries(t)){let i=r[o]||r[kt(o)],a=r[o]?o:kt(o);if(!i){e[a]=s;continue}if(i.type===Number)e[a]=Number(s);else if(i.type===Boolean)e[a]=s!=="false";else if(i.type===Object||i.type===Array)try{e[a]=JSON.parse(s)}catch{e[a]=s}else e[a]=s}}function kt(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function gs(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function bs(e){return e.replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&amp;/g,"&")}function ys(e){let t={};for(let n of Object.keys(e)){if(!n.startsWith("data-webjs-prop-"))continue;let r=kt(n.slice(16));try{t[r]=J(bs(e[n]))}catch{}delete e[n]}return t}function _s(e,t={ssr:!0}){let n=t&&t.suspenseCtx;return new ReadableStream({async start(r){try{if(t&&t.ssr===!1)await N(e,n,r);else{let o=await x(e,n),s=await Te(o,n);r.enqueue(s)}n&&n.pending.length&&await Ss(n,r),r.close()}catch(o){r.error(o)}}})}async function N(e,t,n){if(!(e==null||e===!1||e===!0)){if(e&&typeof e.then=="function")return e=await e,N(e,t,n);if(X(e)){n.enqueue(String(e.value??""));return}if(Q(e))return N(e.value,t,n);if(oe(e))return N(e.signal.get(),t,n);if(ee(e))return N(e.value,t,n);if(te(e))return N(e.fn(),t,n);if(fe(e)){let r=e.template;n.enqueue(String(r?.innerHTML??""));return}if(!ne(e)){if(re(e))return N(e.value,t,n);if(se(e)){let r=e.args;for(let o of r)if(!o||typeof o.then!="function")return N(o,t,n);if(r.length>0)try{let o=await Promise.race(r.map(s=>Promise.resolve(s).catch(()=>{})));return N(o,t,n)}catch{return}return}if(!(ue(e)||de(e))){if(Array.isArray(e)){for(let r of e)await N(r,t,n);return}if(Z(e)){let r=e;for(let o=0;o<r.items.length;o++)await N(r.templateFn(r.items[o],o),t,n);return}if(ze(e)){let r=e;if(t){let o=`s${t.nextId++}`;n.enqueue(`<webjs-boundary id="${o}">`),await N(r.fallback,t,n),n.enqueue("</webjs-boundary>"),t.pending.push({id:o,promise:Promise.resolve(r.children)})}else await N(r.fallback,t,n);return}if(C(e)){await ws(e,t,n);return}n.enqueue(Re(String(e)))}}}}async function ws(e,t,n){let{strings:r,values:o}=e,s="text",i="",a=0,c="",l=0,d="",p="",f="";for(let g=0;g<r.length;g++){let b=r[g];for(let h=0;h<b.length;h++){let u=b[h];switch(s){case"text":f+=u,u==="<"&&(s="tag-open");break;case"tag-open":f+=u,u==="!"?s="bang-1":u==="/"?(s="tag-name",d=""):/[a-zA-Z]/.test(u)?(s="tag-name",d=u.toLowerCase()):s="text";break;case"bang-1":f+=u,s=u==="-"?"bang-dash":"tag-name";break;case"bang-dash":f+=u,u==="-"?(s="comment",l=0):s="tag-name";break;case"comment":f+=u,u==="-"?l+=1:(u===">"&&l>=2&&(s="text"),l=0);break;case"tag-name":f+=u,u===">"?(s=Ge(d)?"rawtext":"text",s==="rawtext"&&(p="")):/\s/.test(u)?s="in-tag":d+=u.toLowerCase();break;case"in-tag":f+=u,u===">"?(s=Ge(d)?"rawtext":"text",s==="rawtext"&&(p="")):!/\s/.test(u)&&u!=="/"&&(s="attr-name",i=u,a=f.length-1);break;case"rawtext":f+=u,p=(p+u.toLowerCase()).slice(-9),(p.endsWith("<\/script>")||p.endsWith("</style>"))&&(s="text",p="",d="");break;case"attr-name":u==="="?(s="after-eq",f+=u):/\s/.test(u)?(s="in-tag",i="",f+=u):u===">"?(s="text",i="",f+=u):(i+=u,f+=u);break;case"after-eq":u==='"'||u==="'"?(s="attr-quoted",c=u,f+=u):/\s/.test(u)?(s="in-tag",i="",f+=u):u===">"?(s="text",i="",f+=u):(s="attr-unquoted",f+=u);break;case"attr-unquoted":/\s/.test(u)?(s="in-tag",i="",f+=u):(u===">"&&(s="text",i=""),f+=u);break;case"attr-quoted":f+=u,u===c&&(s="in-tag",i="");break}}if(g<o.length){let h=o[g];if(h&&typeof h.then=="function"&&(h=await h),s==="comment")f+=String(h??""),l=0;else if(s==="rawtext")f+=String(h??""),p="";else if(s==="text")f&&(n.enqueue(f),f=""),await N(h,t,n);else if(s==="after-eq"){let u=i[0],m=i.slice(1);u==="@"||u==="."?(f=f.slice(0,a),s="in-tag",i=""):u==="?"?(f=f.slice(0,a),h&&(f+=`${m}=""`),s="in-tag",i=""):(f+=`"${I(String(h??""))}"`,s="in-tag",i="")}else(s==="attr-quoted"||s==="attr-unquoted")&&(f+=I(String(h??"")))}}f&&n.enqueue(f)}async function Ss(e,t){let n=xt(),r=n?` nonce="${I(n)}"`:"";for(;e.pending.length;){let o=e.pending.splice(0);await Promise.all(o.map(async({id:s,promise:i})=>{try{let a=await i,c=await x(a,e),l=await Te(c,e);t.enqueue(`<template data-webjs-resolve="${s}">${l}</template><script${r}>(function(){var t=document.currentScript.previousElementSibling;var b=document.getElementById("${s}");if(b&&t){b.innerHTML=t.innerHTML;t.remove()}document.currentScript.remove()})()<\/script>`)}catch(a){console.error(`[webjs] Suspense boundary "${s}" rejected:`,a)}}))}}var kn=Symbol.for("webjs.notFound"),Nn=Symbol.for("webjs.redirect");function As(){let e=new Error("webjs: notFound()");throw e.__webjs=kn,e}function Cs(e,t=307){let n=new Error(`webjs: redirect(${e})`);throw n.__webjs=Nn,n.url=e,n.status=t,n}function xs(e){return!!e&&e.__webjs===kn}function ks(e){return!!e&&e.__webjs===Nn}function Ns(e,t,n){let r=/^\s*([A-Z]+)\s+(\/\S*)\s*$/.exec(e);if(!r)throw new Error(`expose(): bad pattern ${JSON.stringify(e)}: expected "METHOD /path"`);let[,o,s]=r;return t.__webjsHttp={method:o,path:s,validate:n&&typeof n.validate=="function"?n.validate:null,cors:n&&"cors"in n?Ts(n.cors):null},t}function Ts(e){return e?e===!0?{origin:"*",credentials:!1,maxAge:86400,headers:null}:typeof e=="string"?{origin:e,credentials:!0,maxAge:86400,headers:null}:Array.isArray(e)?{origin:e,credentials:!0,maxAge:86400,headers:null}:{origin:e.origin,credentials:!!e.credentials,maxAge:typeof e.maxAge=="number"?e.maxAge:86400,headers:Array.isArray(e.headers)?e.headers:null}:null}function Es(e){return e&&typeof e=="function"&&e.__webjsHttp||null}function vs(e,t={}){let n=t.reconnect!==!1,r=0,o=!1,s=null,i=[];function a(){o||(s=new WebSocket(Rs(e),t.protocols),s.onopen=c=>{for(r=0;i.length&&s&&s.readyState===WebSocket.OPEN;)s.send(i.shift());t.onOpen?.(c)},s.onmessage=c=>{let l=c.data;if(typeof l=="string")try{l=JSON.parse(l)}catch{}t.onMessage?.(l,c)},s.onerror=c=>{t.onError?.(c)},s.onclose=c=>{if(t.onClose?.(c),!o&&n){let l=Math.min(1e3*2**r++,3e4);setTimeout(a,l)}})}return a(),{send(c){let l=typeof c=="string"||c instanceof ArrayBuffer||ArrayBuffer.isView(c)?c:JSON.stringify(c);s&&s.readyState===WebSocket.OPEN?s.send(l):i.push(l)},close(c,l){o=!0;try{s?.close(c,l)}catch{}},get socket(){return s},get readyState(){return s?.readyState??3}}}function Rs(e){if(/^wss?:\/\//i.test(e))return e;let t=typeof location<"u"&&location.protocol==="https:"?"wss:":"ws:",n=typeof location<"u"?location.host:"";return`${t}//${n}${e.startsWith("/")?e:"/"+e}`}var Tt="application/vnd.webjs+json";async function js(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",Tt);let r=t.body;r!=null&&typeof r=="object"&&!(r instanceof FormData)&&!(r instanceof Blob)&&!(r instanceof ArrayBuffer)&&!(r instanceof URLSearchParams)&&!(typeof ReadableStream<"u"&&r instanceof ReadableStream)&&!ArrayBuffer.isView(r)&&(r=await Ne(r),n.has("content-type")||n.set("content-type",Tt));let o=await fetch(e,{...t,headers:n,body:r}),s=o.headers.get("content-type")||"",i=await o.text(),a=s.includes(Tt)?i?J(i):null:s.includes("application/json")?i?JSON.parse(i):null:i;if(!o.ok){let c=a&&a.error||`richFetch ${e} -> ${o.status}`,l=new Error(c);throw l.status=o.status,l.body=a,l}return a}var Et=typeof HTMLElement<"u"?class extends HTMLElement{}:null;typeof customElements<"u"&&Et&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",Et);function jn(e){return typeof Document<"u"&&typeof Document.parseHTMLUnsafe=="function"?Document.parseHTMLUnsafe(e):typeof DOMParser<"u"?new DOMParser().parseFromString(e,"text/html"):null}var ce=!1,H=null,R=0,vt=null;function Os(){vt||typeof MutationObserver>"u"||typeof customElements>"u"||(vt=new MutationObserver(e=>{for(let t of e)for(let n of t.addedNodes){if(n.nodeType!==1)continue;let r=n;r.tagName?.includes("-")&&customElements.upgrade(r);for(let o of r.querySelectorAll("*"))o.tagName?.includes("-")&&customElements.upgrade(o)}}),vt.observe(document.body,{childList:!0,subtree:!0}))}var W=null,Je=null;function On(){ce||typeof document>"u"||(ce=!0,document.addEventListener("click",$n,!1),document.addEventListener("submit",In,!1),window.addEventListener("popstate",Mn),Os(),typeof history<"u"&&"scrollRestoration"in history&&(Je=history.scrollRestoration,history.scrollRestoration="manual"),typeof location<"u"&&(W=location.href))}function Ls(){ce&&(ce=!1,document.removeEventListener("click",$n,!1),document.removeEventListener("submit",In,!1),window.removeEventListener("popstate",Mn),typeof history<"u"&&Je!==null&&(history.scrollRestoration=Je,Je=null),W=null)}async function $s(e,t){let n=new URL(e,location.href);if(n.origin!==location.origin){location.href=e;return}await $t(n.href,t?.replace??!1,null)}function Ms(e){if(!e){v.clear();return}let t=new URL(e,location.href);v.delete(t.pathname+t.search)}On();var Ln=/\.(?:pdf|zip|tar|gz|7z|rar|dmg|exe|msi|deb|rpm|apk|ipa|xlsx?|docx?|pptx?|csv|odt|ods|odp|rtf|epub|mobi|xml|json|rss|atom|txt|md|wasm|mp3|mp4|mov|avi|webm|ogg|flac|wav|m4a|m4v|mkv|png|jpe?g|gif|webp|avif|bmp|ico|svg|tiff?|heic)$/i;function $n(e){if(!ce||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=Bs(e);if(!t||t.hasAttribute("download")||t.hasAttribute("data-no-router")||t.target&&t.target!=="_self")return;let n=t.href;if(!n)return;let r=new URL(n);if(r.origin!==location.origin||r.pathname===location.pathname&&r.search===location.search&&r.hash||Ln.test(r.pathname))return;e.preventDefault();let o=Pn(t);$t(n,!1,o)}function Mn(e){$t(location.href,!0,null)}function In(e){if(!ce||e.defaultPrevented)return;let t=e.target;if(!t||t.nodeType!==1||t.tagName!=="FORM"||t.hasAttribute("data-no-router"))return;let n=e.submitter??null;if(n&&n.hasAttribute("data-no-router"))return;let r=n&&n.getAttribute("formtarget")||t.getAttribute("target")||"";if(r&&r!=="_self")return;let o=Is(t,n);if(o==="dialog")return;let s=Ps(t,n),i;try{i=new URL(s,location.href)}catch{return}if(i.origin!==location.origin||Ln.test(i.pathname))return;let a=qs(t,n);e.preventDefault();let c=Pn(t);Hs(i.href,o,a,c)}function Is(e,t){return(t&&t.getAttribute("formmethod")||e.getAttribute("method")||"get").toLowerCase()}function Ps(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function qs(e,t){try{return new FormData(e,t||void 0)}catch{let n=new FormData(e);return t&&t.getAttribute("name")&&n.append(t.getAttribute("name"),t.getAttribute("value")||""),n}}function Bs(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function Pn(e){let t=e;for(;t;){let n=t.closest("webjs-frame");if(n&&n.id)return n.id;let r=t.getRootNode();if(r&&r.host)t=r.host;else break}return null}function Ze(e){let t=new Map,n=[];function r(o){if(o.nodeType===8){let s=o,i=s.data,a=/^wj:children:(.+)$/.exec(i);if(a){n.push({path:a[1],start:s});return}if(i.trim()==="/wj:children"){let c=n.pop();c&&!t.has(c.path)&&t.set(c.path,{start:c.start,end:s});return}return}if(o.hasChildNodes&&o.hasChildNodes())for(let s=o.firstChild;s;s=s.nextSibling)r(s)}return r(e),t}function Us(e,t){let n=null;for(let r of e.keys())t.has(r)&&(n===null||r.length>n.length)&&(n=r);return n}var Fs=16,v=new Map;function qn(e){let t=Bn(e);v.has(t)&&v.delete(t);let n={html:document.documentElement.outerHTML,scrollX:typeof window<"u"&&window.scrollX||0,scrollY:typeof window<"u"&&window.scrollY||0};for(v.set(t,n);v.size>Fs;){let r=v.keys().next().value;v.delete(r)}}function Ds(e){let t=Bn(e),n=v.get(t);return n==null?null:(v.delete(t),v.set(t,n),typeof n=="string"?{html:n,scrollX:0,scrollY:0}:n)}function Bn(e){let t=new URL(e,location.href);return t.pathname+t.search}async function $t(e,t,n){H&&H.abort(),H=new AbortController;let r=H.signal,o=++R;W&&qn(W);let s=setTimeout(()=>{document.documentElement.setAttribute("data-navigating",""),s=null},150),i=null;t||(i=Dn());try{if(t){let a=Ds(e);if(a){let c=jn(a.html);if(c){Un(c,n,!0,null),typeof window<"u"&&window.scrollTo(a.scrollX,a.scrollY),jt(e,n,!1,i,"GET",null,r,o).catch(()=>{});return}}typeof window<"u"&&window.scrollTo(0,0)}await jt(e,n,!t,i,"GET",null,r,o)}finally{s&&clearTimeout(s),o===R&&(document.documentElement.removeAttribute("data-navigating"),typeof location<"u"&&(W=location.href))}}async function Hs(e,t,n,r){H&&H.abort(),H=new AbortController;let o=H.signal,s=++R,i=t==="get"||t==="head",a=new URL(e,location.href);if(i){a.search="";for(let[d,p]of n)a.searchParams.append(d,typeof p=="string"?p:p.name)}W&&qn(W);let c=setTimeout(()=>{document.documentElement.setAttribute("data-navigating",""),c=null},150),l=Dn();try{await jt(a.href,r,!0,l,i?"GET":t.toUpperCase(),i?null:n,o,s),!i&&s===R&&v.clear()}finally{c&&clearTimeout(c),s===R&&(document.documentElement.removeAttribute("data-navigating"),typeof location<"u"&&(W=location.href))}}function Ws(){return[...Ze(document.body).keys()].join(",")}async function jt(e,t,n,r,o,s,i,a){o=o||"GET";let c=typeof a=="number"?a:R,l,d=null,p=e;try{let g={"x-webjs-router":"1"},b=Ws();b&&(g["x-webjs-have"]=b),t&&(g["x-webjs-frame"]=t);let h={method:o,headers:g,credentials:"same-origin"};i&&(h.signal=i),s!=null&&o!=="GET"&&o!=="HEAD"&&(h.body=s);let u=await fetch(e,h),m=u.headers.get("content-type")||"",k=/^text\/html\b/i.test(m);if(u.redirected&&u.url&&(p=u.url),u.status===204||u.status===205){c===R&&n&&history.pushState(null,"",p);return}if(!k){c===R&&(location.href=e);return}d=u.headers.get("x-webjs-build"),l=await u.text()}catch(g){if(g&&g.name==="AbortError"||c!==R)return;Ks(r),location.href=e;return}if(c!==R)return;let f=jn(l);if(!f){location.href=e;return}if(Un(f,t,!1,p,d),n&&history.pushState(null,"",p),n){let g=new URL(p);if(g.hash){let b=document.getElementById(g.hash.slice(1));b?b.scrollIntoView():window.scrollTo(0,0)}else window.scrollTo(0,0)}document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:p,frameId:t}}))}function Tn(e){if(!e||!e.head)return"";let t=e.head.querySelectorAll('[data-webjs-track="reload"]');if(!t.length)return"";let n="";for(let r of t)n+=Y(r);return n}function Un(e,t,n,r,o){try{typeof sessionStorage<"u"&&(!r||t||n)&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}if(r&&!t&&!n){let d=document.querySelector('script[type="importmap"]'),p=d?d.getAttribute("data-webjs-build"):null,f=!1;if(o&&p&&(f=o!==p),!f&&e.head&&e.head.children.length>0){let g=Tn(document),b=Tn(e);g!==b&&(f=!0)}if(f&&typeof location<"u")try{let g="webjs:importmap-reload";if(sessionStorage&&sessionStorage.getItem(g))sessionStorage.removeItem(g);else{sessionStorage&&sessionStorage.setItem(g,"1"),location.href=r;return}}catch{location.href=r;return}else if(!f)try{typeof sessionStorage<"u"&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}}if(t){let d=document.querySelector(`webjs-frame#${CSS.escape(t)}`),p=e.querySelector(`webjs-frame#${CSS.escape(t)}`);if(d&&p){vn(e.head),Gs(d,p),Lt(d),Ye(d),Rn(e.body),Rt();return}}let s=Ze(document.body),i=Ze(e.body),a=Us(s,i);if(a){vn(e.head),Vs(s.get(a),i.get(a),e),Rn(e.body),Rt();return}Js(e.head);let c=[...e.body.childNodes],l=()=>{document.body.replaceChildren(...c),Lt(document.body),Ye(document.body),Rt()};document.startViewTransition?document.startViewTransition(l).finished.then(()=>Ye(document.body)).catch(()=>{}):l()}function Rt(){let e=document.activeElement;!e||e===document.body||e===document.documentElement||typeof e.blur=="function"&&e.blur()}function Vs(e,t,n){if(!e||!t)return;let r=e.start.parentNode;if(!r)return;let o=[];for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)o.push(i);let s=[];for(let i=t.start.nextSibling;i&&i!==t.end;i=i.nextSibling)s.push(document.importNode(i,!0));zs(r,e.start,e.end,o,s);for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)i.nodeType===1&&(Lt(i),Ye(i))}function zs(e,t,n,r,o){let s=new Map;for(let c of r){if(c.nodeType!==1)continue;let l=Ee(c);l&&s.set(l,c)}let i=n,a=[];for(let c of o){if(c.nodeType===1){let l=Ee(c);if(l&&s.has(l)){let d=s.get(l);Ot(d,c),a.push(d),s.delete(l);continue}}a.push(c)}for(let c of r)if(c.parentNode===e){if(c.nodeType===1&&a.includes(c))continue;e.removeChild(c)}for(let c of a)e.insertBefore(c,i)}function Ot(e,t){if(e.tagName!==t.tagName){e.replaceWith(t);return}let n=new Set;for(let r of t.attributes)n.add(r.name),!En.has(r.name)&&e.getAttribute(r.name)!==r.value&&e.setAttribute(r.name,r.value);for(let r of[...e.attributes])En.has(r.name)||n.has(r.name)||e.removeAttribute(r.name);Fn(e,t)}function Fn(e,t){let n=[...e.childNodes],r=[...t.childNodes].map(a=>document.importNode(a,!0)),o=new Map;for(let a of n){if(a.nodeType!==1)continue;let c=Ee(a);c&&o.set(c,a)}let s=[];for(let a=0;a<r.length;a++){let c=r[a];if(c.nodeType===1){let l=Ee(c);if(l&&o.has(l)){let p=o.get(l);Ot(p,c),s.push(p),o.delete(l);continue}let d=n[a];if(d&&d.nodeType===1&&!Ee(d)&&d.tagName===c.tagName){Ot(d,c),s.push(d);continue}}else if(c.nodeType===3){let l=n[a];if(l&&l.nodeType===3){l.nodeValue!==c.nodeValue&&(l.nodeValue=c.nodeValue),s.push(l);continue}}else if(c.nodeType===8){let l=n[a];if(l&&l.nodeType===8){l.nodeValue!==c.nodeValue&&(l.nodeValue=c.nodeValue),s.push(l);continue}}s.push(c)}let i=new Set(s);for(let a of n)!i.has(a)&&a.parentNode===e&&e.removeChild(a);for(let a=0;a<s.length;a++){let c=s[a];(c.parentNode!==e||e.childNodes[a]!==c)&&e.insertBefore(c,e.childNodes[a]||null)}}function Ee(e){let t=e.getAttribute("data-key");return t?`${e.tagName}:k:${t}`:e.id?`${e.tagName}:i:${e.id}`:null}var En=new Set(["value","checked","selected","indeterminate","disabled","open","popover"]);function Dn(){let e=Ze(document.body);if(e.size===0)return null;let t=null;for(let i of e.keys())(t===null||i.length>t.length)&&(t=i);if(t===null)return null;let n=document.getElementById(`wj-loading:${t}`);if(!(n instanceof HTMLTemplateElement))return null;let r=e.get(t),o=[];for(let i=r.start.nextSibling;i&&i!==r.end;i=i.nextSibling)o.push(i);let s=document.createRange();return s.setStartAfter(r.start),s.setEndBefore(r.end),s.deleteContents(),r.start.parentNode.insertBefore(n.content.cloneNode(!0),r.end),{slot:r,oldChildren:o,token:R}}function Ks(e){if(!e||e.token!==R)return;let{slot:t,oldChildren:n}=e;if(t.start.parentNode!==t.end.parentNode)return;let r=document.createRange();r.setStartAfter(t.start),r.setEndBefore(t.end),r.deleteContents();for(let o of n)t.start.parentNode.insertBefore(o,t.end)}function Gs(e,t){Fn(e,t)}function Hn(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function Mt(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=Hn();return n&&t.setAttribute("nonce",n),t.textContent=e.textContent,t}function Wn(e){if(!e.hasAttribute("nonce"))return e.cloneNode(!0);let t=e.cloneNode(!0),n=Hn();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function Y(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function vn(e){let t=e.querySelector("title");t&&(document.title=t.textContent||"");let n=new Set;for(let r of document.head.children)n.add(Y(r));for(let r of e.children)r.tagName==="SCRIPT"&&r.getAttribute("type")==="importmap"||r.tagName!=="BASE"&&r.tagName!=="TITLE"&&(n.has(Y(r))||(r.tagName==="SCRIPT"?document.head.appendChild(Mt(r)):document.head.appendChild(Wn(r))))}function Js(e){let t=document.head,n=e.querySelector("title");n&&(document.title=n.textContent||"");let r=new Set;for(let s of t.children)s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&r.add(Y(s));let o=new Set;for(let s of e.children)s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&o.add(Y(s));for(let s of[...t.children])s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&s.tagName!=="TITLE"&&(o.has(Y(s))||s.remove());for(let s of e.children)s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&s.tagName!=="TITLE"&&(r.has(Y(s))||(s.tagName==="SCRIPT"?t.appendChild(Mt(s)):t.appendChild(Wn(s))))}function Ye(e){typeof customElements>"u"||Vn(e)}function Vn(e){let t=e instanceof Element?[e,...e.querySelectorAll("*")]:[...e.querySelectorAll("*")];for(let n of t)n.tagName&&n.tagName.includes("-")&&(customElements.upgrade(n),n.shadowRoot&&Vn(n.shadowRoot))}function Rn(e){for(let t of e.querySelectorAll("template[data-webjs-resolve]"))document.body.appendChild(t.cloneNode(!0))}function Lt(e){for(let t of e.querySelectorAll("script"))t.replaceWith(Mt(t))}var Ys=Symbol.for("webjs.context");function Zs(e){return{__context__:Ys,name:e}}var Xe=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},It=class{constructor(t,{context:n,initialValue:r}){this._host=t,this._context=n,this._value=r,this._subscriptions=new Set,this._onRequest=o=>{let s=o;if(s.context===this._context)if(o.stopPropagation(),s.subscribe){let i={callback:s.callback},a=()=>{this._subscriptions.delete(i)};this._subscriptions.add(i),s.callback(this._value,a)}else s.callback(this._value)},typeof t.addController=="function"&&t.addController(this)}get value(){return this._value}setValue(t){if(!Object.is(this._value,t)){this._value=t;for(let n of this._subscriptions){let r=()=>{this._subscriptions.delete(n)};n.callback(t,r)}}}hostConnected(){this._host.addEventListener("context-request",this._onRequest)}hostDisconnected(){this._host.removeEventListener("context-request",this._onRequest),this._subscriptions.clear()}},Pt=class{constructor(t,{context:n,subscribe:r=!0}){this._host=t,this._context=n,this._subscribe=r,this._value=void 0,this._unsubscribe=void 0,typeof t.addController=="function"&&t.addController(this)}get value(){return this._value}hostConnected(){this._dispatchRequest()}hostDisconnected(){this._unsubscribe&&(this._unsubscribe(),this._unsubscribe=void 0)}_dispatchRequest(){let t=new Xe(this._context,(n,r)=>{let o=this._value;this._value=n,r&&(this._unsubscribe=r),!Object.is(o,n)&&typeof this._host.requestUpdate=="function"&&this._host.requestUpdate()},this._subscribe);this._host.dispatchEvent(t)}};var P={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},qt=class{constructor(t,{task:n,args:r,autoRun:o=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=o,this._status=P.INITIAL,this._value=void 0,this._error=void 0,this._abortController=null,this._prevArgs=null,typeof t.addController=="function"&&t.addController(this)}get status(){return this._status}get value(){return this._value}get error(){return this._error}async run(){this.abort();let t=new AbortController;this._abortController=t;let n=this._argsFn();this._prevArgs=n,this._status=P.PENDING,this._error=void 0,this._requestHostUpdate();try{let r=await this._taskFn(...n,{signal:t.signal});if(t.signal.aborted)return;this._value=r,this._status=P.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=P.ERROR,this._value=void 0}finally{this._abortController===t&&(this._abortController=null)}this._requestHostUpdate()}abort(){this._abortController&&(this._abortController.abort(),this._abortController=null)}render(t={}){switch(this._status){case P.INITIAL:return t.initial?.();case P.PENDING:return t.pending?.();case P.COMPLETE:return t.complete?.(this._value);case P.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun)return;let t=this._argsFn();this._argsEqual(this._prevArgs,t)||this.run()}hostUpdated(){}hostConnected(){}hostDisconnected(){this.abort()}_requestHostUpdate(){typeof this._host.requestUpdate=="function"&&this._host.requestUpdate()}_argsEqual(t,n){if(t===null||t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==n[r])return!1;return!0}};export{Pt as ContextConsumer,It as ContextProvider,Xe as ContextRequestEvent,y as MARKER,me as Signal,os as Suspense,qt as Task,P as TaskStatus,At as WebComponent,Et as WebjsFrame,et as adoptStyles,St as allTags,fr as batch,dr as computed,vs as connectWS,Zs as createContext,xt as cspNonce,Xn as css,_n as deserialize,Ls as disableClientRouter,pr as effect,On as enableClientRouter,I as escapeAttr,Re as escapeText,Ns as expose,Es as getExposed,Zn as html,le as isCSS,Vr as isLazy,Q as isLive,xs as isNotFound,ks as isRedirect,Z as isRepeat,hr as isSignal,ze as isSuspense,C as isTemplate,X as isUnsafeHTML,tr as live,wt as lookup,Wr as lookupModuleUrl,$s as navigate,As as notFound,J as parse,Hr as primeModuleUrl,Cs as redirect,_t as register,De as render,_s as renderToStream,as as renderToString,Qn as repeat,Ms as revalidate,js as richFetch,yn as serialize,is as setCspNonceProvider,ur as signal,Ne as stringify,tt as stylesToString,Ve as tagOf,er as unsafeHTML};
4
4
  //# sourceMappingURL=webjs-core.js.map