@webjsdev/core 0.7.39 → 0.7.40

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,7 +1,7 @@
1
- var lo=Object.defineProperty;var H=(e,t)=>()=>(e&&(t=e(e=0)),t);var lr=(e,t)=>{for(var n in t)lo(e,n,{get:t[n],enumerable:!0})};function Zt(e,...t){return{_$webjs:"template",strings:e,values:t}}function N(e){return!!e&&typeof e=="object"&&e._$webjs==="template"}var v,Be=H(()=>{v="wjm-"});function yr(e){if(!e||e.nodeType!==8)return!1;let t=e.nodeValue;return t===Po||t===$o}function Fo(e){for(let t of e.addedNodes)if(yr(t))return!0;for(let t of e.removedNodes)if(yr(t))return!0;return!1}function Er(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}function Uo(){wr||(We=Er(),We&&(He=HTMLSlotElement.prototype.assignedNodes,fn=HTMLSlotElement.prototype.assignedElements,ht=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(t){return this.hasAttribute(B)&&!_r(this)?dn(this,t):He?He.call(this,t):[]},HTMLSlotElement.prototype.assignedElements=function(t){return this.hasAttribute(B)&&!_r(this)?dn(this,t).filter(n=>n.nodeType===1):fn?fn.call(this,t):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let t=ht&&ht.get?ht.get.call(this):null;return t||qo(this)}}),wr=!0))}function _r(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 dn(e,t){if(e.getAttribute(z)===vr)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:pn(n,new Set,0)}function pn(e,t,n){if(n>=Bo)return e.slice();let r=[];for(let s of e)if(s.nodeType===1&&s.tagName==="SLOT"){let o=s;if(t.has(o))continue;if(t.add(o),o.hasAttribute(B)){let i=dn(o,{flatten:!1});if(i.length>0)for(let a of pn(i,t,n+1))r.push(a);else for(let a of pn(Array.from(o.childNodes),t,n+1))r.push(a)}else if(He){let i=He.call(o,{flatten:!0});for(let a of i)r.push(a)}else r.push(s)}else r.push(s);return r}function qo(e){let t=e.parentElement;for(;t;){if(t.tagName==="SLOT"&&t.hasAttribute(B))return t.getAttribute(z)===le?t:null;t=t.parentElement}return null}function Y(e){let t=e,n=t[W];return n||(n={assignedByName:new Map,pendingByName:new Map,lastSnapshot:new WeakMap,nameObservers:new WeakMap,childObserver:null,scheduled:!1,ownedSlots:new Set},t[W]=n),n}function hn(e){return!!e[W]}function Cr(e){let t=Y(e);for(;e.firstChild;){let n=e.firstChild,r=mt(n);bt(t.assignedByName,r,n),e.removeChild(n)}}function xr(e){let t=Y(e),n=e.querySelectorAll(`slot[${B}]`);for(let r of n){let s=r;if(s.getAttribute(z)!==le)continue;let o=s.getAttribute("name")||null;if(!t.assignedByName.has(o)){let i=Array.from(s.childNodes);t.assignedByName.set(o,i),t.lastSnapshot.set(s,i.slice())}}}function mt(e){if(e.nodeType!==1)return null;let n=e.getAttribute("slot");return n||null}function bt(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}function kr(e,t,n){if(!n.length)return;let r=e.get(t);r||(r=[],e.set(t,r));for(let s of n)r.push(s)}function Tr(e){if(!We)return;let t=Y(e);t.childObserver||(t.childObserver=new MutationObserver(n=>{let r=!1;for(let s of n)if(!Fo(s)){if(s.type==="childList"){for(let o of s.addedNodes)o.parentElement===e&&(bt(t.assignedByName,mt(o),o),r=!0);for(let o of s.removedNodes)e.contains(o)||Sr(t,o)&&(r=!0)}else if(s.type==="attributes"&&s.attributeName==="slot"){let o=s.target;(Sr(t,o)||o.parentElement===e)&&(bt(t.assignedByName,mt(o),o),r=!0)}}r&&yt(e)}),t.childObserver.observe(e,{childList:!0,attributes:!0,attributeFilter:["slot"],subtree:!0}))}function Nr(e){let t=e[W];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 Sr(e,t){for(let[n,r]of e.assignedByName){let s=r.indexOf(t);if(s!==-1)return r.splice(s,1),r.length===0&&e.assignedByName.delete(n),!0}return!1}function yt(e){let t=Y(e);t.scheduled||(t.scheduled=!0,queueMicrotask(()=>{t.scheduled=!1,Do(e)}))}function Do(e){if(!We)return;let t=e[W];if(!t)return;let n=Array.from(e.querySelectorAll(`slot[${B}]`)),r=new Set(n);for(let i of t.ownedSlots)r.has(i)||Ho(t,i);for(let i of r)t.ownedSlots.has(i)||Wo(e,i);t.ownedSlots=r;let s=new Map;for(let i of n){let a=i.getAttribute("name")||null,c=s.get(a);c||(c=[],s.set(a,c)),c.push(i)}for(let i of s.keys()){let a=t.pendingByName.get(i);if(a&&a.length){let c=t.assignedByName.get(i)||[],l=[];for(let f of a)l.push(f);for(let f of c)l.indexOf(f)===-1&&l.push(f);t.assignedByName.set(i,l),t.pendingByName.delete(i)}}let o=[];for(let[i,a]of s){let c=t.assignedByName.get(i)||[];for(let l=0;l<a.length;l++){let f=a[l];l===0&&c.length>0?mn(t,f,c)&&o.push(f):bn(t,f)&&o.push(f)}}for(let i of o)ze(i)}function Ho(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 s=t.getAttribute("name")||null;kr(e.pendingByName,s,r)}e.lastSnapshot.delete(t)}function mn(e,t,n){let r=t.getAttribute(z)!==le,s=e.lastSnapshot.get(t)||[];if(!r&&zo(s,n))return!1;let i=t[gt];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,le),e.lastSnapshot.set(t,n.slice()),!0}function bn(e,t){let n=t.getAttribute(z)===le;if(t.setAttribute(z,vr),!n)return Ar(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return Ar(t),!0}function Ar(e){let t=e[gt];!t||t.childNodes.length===0||e.appendChild(t)}function Wo(e,t){if(!We)return;let n=Y(e);if(n.nameObservers.has(t))return;let r=new MutationObserver(()=>yt(e));r.observe(t,{attributes:!0,attributeFilter:["name"]}),n.nameObservers.set(t,r)}function jr(e,t){if(!hn(e))return;let n=Y(e),r=n.lastSnapshot.get(t);if(!r||r.length===0)return;let s=t.getAttribute("name")||null;for(let i of r)i.parentNode===t&&t.removeChild(i);kr(n.pendingByName,s,r),n.lastSnapshot.delete(t);let o=n.nameObservers.get(t);o&&(o.disconnect(),n.nameObservers.delete(t)),n.ownedSlots.delete(t)}function ze(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function zo(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 Po,$o,We,W,B,z,le,vr,gt,Bo,He,fn,ht,wr,wt=H(()=>{Be();Po=`${v}s`,$o=`${v}e`;We=Er(),W=Symbol("webjs.slot.state"),B="data-webjs-light",z="data-projection",le="actual",vr="fallback",gt=Symbol("webjs.slot.fallbackFrag"),Bo=64,He=null,fn=null,ht=null,wr=!1;Uo()});function Wr(e,t,n){bi.has(t)?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}async function Ye(e){return JSON.stringify(await zr(e))}function V(e){return Vr(JSON.parse(e))}async function zr(e){let t=gi();return await yi(e,t),ue(e,t)}function Vr(e){return Z(e,Ai())}function gi(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map,fdEntries:new Map}}async function yi(e,t){let n=[e];for(;n.length;){let r=n.pop();if(!vi(r))continue;let s=t.refCount.get(r)||0;if(t.refCount.set(r,s+1),!(s>0)){if(typeof Blob<"u"&&r instanceof Blob){let o=new Uint8Array(await r.arrayBuffer());t.blobBytes.set(r,o);continue}if(typeof FormData<"u"&&r instanceof FormData){let o=t.fdEntries.get(r)||[...r.entries()];t.fdEntries.set(r,o);for(let[,i]of o)typeof i!="string"&&n.push(i);continue}if(Array.isArray(r))for(let o=0;o<r.length;o++)n.push(r[o]);else if(r instanceof Map)for(let[o,i]of r)n.push(o),n.push(i);else if(r instanceof Set)for(let o of r)n.push(o);else if(Ci(r))for(let o in r)Object.prototype.hasOwnProperty.call(r,o)&&n.push(r[o])}}for(let[r,s]of t.refCount)s>1&&t.idOf.set(r,t.nextId++)}function ue(e,t){if(e===null)return null;if(e===void 0)return{[C]:"undef"};let n=typeof e;if(n==="string"||n==="boolean")return e;if(n==="number")return Number.isNaN(e)?{[C]:"NaN"}:e===1/0?{[C]:"Inf"}:e===-1/0?{[C]:"-Inf"}:Object.is(e,-0)?{[C]:"-0"}:e;if(n==="bigint")return{[C]:"BigInt",v:e.toString()};if(n==="symbol"){let o=Symbol.keyFor(e);if(o===void 0)throw new TypeError("Cannot serialize a local Symbol; only Symbol.for() registered symbols are supported.");return{[C]:"Sym",v:o}}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{[C]:"Ref",v:r};r!==void 0&&t.emitted.add(r);let s;if(e instanceof Date)s={[C]:"Date",v:Number.isNaN(e.getTime())?null:e.toISOString()};else if(e instanceof Error)s={[C]:"Error",v:{name:e.name,message:e.message,stack:e.stack||null}};else if(typeof Blob<"u"&&e instanceof Blob){let o=t.blobBytes.get(e);typeof File<"u"&&e instanceof File?s={[C]:"File",v:Ge(o),n:e.name,t:e.type||"",m:e.lastModified}:s={[C]:"Blob",v:Ge(o),t:e.type||""}}else if(typeof FormData<"u"&&e instanceof FormData){let o=t.fdEntries.get(e)||[...e.entries()],i=[];for(let[a,c]of o)i.push([a,ue(c,t)]);s={[C]:"FD",v:i}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)s=wi(e);else if(e instanceof Map){let o=[];for(let[i,a]of e)o.push([ue(i,t),ue(a,t)]);s={[C]:"Map",v:o}}else if(e instanceof Set){let o=[];for(let i of e)o.push(ue(i,t));s={[C]:"Set",v:o}}else if(Array.isArray(e))s=e.map(o=>ue(o,t));else{s={};for(let o in e){if(!Object.prototype.hasOwnProperty.call(e,o))continue;let i=xi(o)?"_"+o:o;Wr(s,i,ue(e[o],t))}}if(r!==void 0){if(Array.isArray(s))return{[C]:"Arr",_id:r,v:s};s._id=r}return s}function wi(e){if(e instanceof ArrayBuffer)return{[C]:"buf",v:Ge(new Uint8Array(e))};if(e instanceof DataView)return{[C]:"dv",v:Ge(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=_i[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[C]:n,v:Ge(r)}}function Ai(){return{refs:new Map}}function Z(e,t){if(e===null||typeof e!="object")return e;if(Array.isArray(e)){let o=[];for(let i=0;i<e.length;i++)o.push(Z(e[i],t));return o}let n=e[C];if(typeof n=="string")return Ei(e,n,t);let r={},s=e._id;typeof s=="number"&&t.refs.set(s,r);for(let o in e){if(!Object.prototype.hasOwnProperty.call(e,o)||o==="_id")continue;let i=ki(o)?o.slice(1):o;Wr(r,i,Z(e[o],t))}return r}function Ei(e,t,n){let r=e._id,s=o=>(typeof r=="number"&&n.refs.set(r,o),o);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 s(BigInt(e.v));case"Sym":return s(Symbol.for(e.v));case"Date":return s(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[i,a]of e.v)o.set(Z(i,n),Z(a,n));return o}case"Set":{let o=new Set;typeof r=="number"&&n.refs.set(r,o);for(let i of e.v)o.add(Z(i,n));return o}case"Arr":{let o=[];typeof r=="number"&&n.refs.set(r,o);for(let i of e.v)o.push(Z(i,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=Ke(e.v);return s(new Blob([o],{type:e.t||""}))}case"File":{if(typeof File>"u")throw new TypeError("File is not available in this environment.");let o=Ke(e.v);return s(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;s(o);for(let[i,a]of e.v){let c=Z(a,n);o.append(i,c)}return o}default:{if(t==="buf"){let i=Ke(e.v);return s(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength))}if(t==="dv"){let i=Ke(e.v);return s(new DataView(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)))}let o=Si[t];if(o){let i=Ke(e.v),a=i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength);return s(new o(a))}throw new TypeError(`Unknown serialization tag: ${t}`)}}}function vi(e){return e!==null&&typeof e=="object"}function Ci(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function xi(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function ki(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}function Ge(e){if(Kr)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 Ke(e){if(Kr){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 C,bi,_i,Si,Kr,Te=H(()=>{C="_$wj",bi=new Set(["__proto__","constructor","prototype"]);_i={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},Si={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};Kr=typeof Buffer<"u"&&typeof Buffer.from=="function"});var cs={};lr(cs,{observeLazy:()=>pa,observeViewportOnce:()=>ba});function as(e){let t=jn.get(e);return t||(t=import(e).finally(()=>jn.delete(e)),jn.set(e,t),t)}function pa(e){for(let[t,n]of Object.entries(e))fe.set(t.toLowerCase(),n);if(typeof IntersectionObserver>"u"){for(let t of fe.values())as(t);fe.clear();return}Qe||(Qe=new IntersectionObserver(ha,{rootMargin:"200px"})),is(),typeof MutationObserver<"u"&&new MutationObserver(()=>is()).observe(document.body,{childList:!0,subtree:!0})}function is(){if(!(!Qe||!fe.size))for(let e of fe.keys())for(let t of document.querySelectorAll(e))Qe.observe(t)}function ha(e){for(let t of e){if(!t.isIntersecting)continue;let n=t.target.tagName.toLowerCase(),r=fe.get(n);r&&(as(r),fe.delete(n),Qe?.unobserve(t.target))}}function ma(e){for(let t of e){if(!t.isIntersecting)continue;let n=Lt.get(t.target);Lt.delete(t.target),Ze?.unobserve(t.target),n&&n()}}function ba(e,t){return typeof IntersectionObserver>"u"?(t(),()=>{}):(Ze||(Ze=new IntersectionObserver(ma,{rootMargin:"200px"})),Lt.set(e,t),Ze.observe(e),()=>{Lt.delete(e),Ze?.unobserve(e)})}var fe,Qe,jn,Ze,Lt,ls=H(()=>{fe=new Map,Qe=null,jn=new Map;Ze=null,Lt=new WeakMap});var Rn,Ln=H(()=>{Rn=typeof HTMLElement<"u"?class extends HTMLElement{constructor(){super(),this._webjsLoadedSrc=null,this._webjsLazyTeardown=null}static get observedAttributes(){return["src"]}connectedCallback(){this._webjsScheduleLoad()}disconnectedCallback(){this._webjsLazyTeardown&&(this._webjsLazyTeardown(),this._webjsLazyTeardown=null)}attributeChangedCallback(t,n,r){t==="src"&&this.isConnected&&this._webjsScheduleLoad()}_webjsScheduleLoad(){let t=this.getAttribute("src");if(!t){this._webjsLazyTeardown&&(this._webjsLazyTeardown(),this._webjsLazyTeardown=null),this._webjsLoadedSrc=null;return}let n=t;try{n=new URL(t,location.href).href}catch{}if(n===this._webjsLoadedSrc)return;this._webjsLazyTeardown&&(this._webjsLazyTeardown(),this._webjsLazyTeardown=null),(this.getAttribute("loading")||"eager").toLowerCase()==="lazy"?(this._webjsLoadedSrc=n,Promise.resolve().then(()=>(ls(),cs)).then(({observeViewportOnce:s})=>{this._webjsLoadedSrc!==n||!this.isConnected||(this._webjsLazyTeardown=s(this,()=>{this._webjsLazyTeardown=null,this._webjsLoad(n)}))})):(this._webjsLoadedSrc=n,this._webjsLoad(n))}_webjsLoad(t){Promise.resolve().then(()=>(On(),us)).then(({loadFrame:n})=>{this._webjsLoadedSrc!==t||!this.isConnected||n(this,t)})}}:null;typeof customElements<"u"&&Rn&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",Rn)});function ya(e,t,n){switch(e){case"append":n&&t.append(n);break;case"prepend":n&&t.prepend(n);break;case"before":n&&t.before(n);break;case"after":n&&t.after(n);break;case"replace":n&&t.replaceWith(n);break;case"update":n&&t.replaceChildren(n);break;case"remove":t.remove();break;default:break}}function In(e,t){let n=t||(typeof document<"u"?document:null);if(!n)return;let r=null;if(typeof e=="string"){let o=n.createElement("template");o.innerHTML=e,r=o.content}else if(e&&e.nodeType)r=e;else return;let s=r.querySelectorAll?Array.from(r.querySelectorAll("webjs-stream")):[];if(s.length)for(let o of s)n.body.append(o);else n.body.append(r)}var ga,Mn,Ot=H(()=>{ga=new Set(["append","prepend","before","after","replace","update"]);Mn=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this._webjsApplied||(this._webjsApplied=!0,this._webjsApply())}_webjsApply(){let t=(this.getAttribute("action")||"").toLowerCase(),n=this.ownerDocument||document,r=[],s=this.getAttribute("target");if(s){let i=n.getElementById(s);i&&(r=[i])}else{let i=this.getAttribute("targets");if(i)try{r=Array.from(n.querySelectorAll(i))}catch{r=[]}}let o=ga.has(t)?this.querySelector("template"):null;try{for(let i of r){let a=o?o.content.cloneNode(!0):null;ya(t,i,a)}}finally{this.remove()}}}:null;typeof customElements<"u"&&Mn&&!customElements.get("webjs-stream")&&customElements.define("webjs-stream",Mn)});var fs,ds=H(()=>{fs=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this.style.display||(this.style.display="contents")}}:null;typeof customElements<"u"&&fs&&!customElements.get("webjs-suspense")&&customElements.define("webjs-suspense",fs)});function Mt(e){let t=e||(typeof document<"u"?document:null);if(!(!t||typeof t.querySelectorAll!="function")){for(let n of t.querySelectorAll('script[type="application/json"]#__webjs-seeds, script[type="application/json"][data-webjs-seeds]'))hs(n.textContent,n);for(let n of t.querySelectorAll("[data-webjs-seed]"))hs(n.getAttribute("data-webjs-seed"),n,()=>n.removeAttribute("data-webjs-seed"))}}function hs(e,t,n){if(e)try{let r=V(e);if(r&&typeof r=="object")for(let s in r)et.has(s)||et.set(s,r[s])}catch{}n?n():t.remove?.()}function wa(e,t,n){ps||(ps=!0,Mt());let r=`${e}/${t}/${n}`;if(et.has(r)){let s=et.get(r);return et.delete(r),s}return ms}var et,ms,ps,Pn=H(()=>{Te();et=new Map,ms=Symbol("webjs.seed.miss"),ps=!1});var us={};lr(us,{_FRAME_TOP:()=>Rs,_LIVE_ATTRS:()=>Hn,_activeFrameId:()=>js,_addNewHeadElements:()=>Wn,_applyStreamedResolve:()=>to,_applySwap:()=>tr,_blurOutgoingFocus:()=>$t,_buildHaveHeader:()=>Xn,_buildSubmitFormData:()=>Ts,_bumpNavToken:()=>Ya,_clearFormBusy:()=>zs,_clearFrameBusy:()=>Hs,_collectChildrenSlots:()=>Pe,_currentPageUrl:()=>Ja,_diffElementInPlace:()=>Wt,_eligibleAnchorHref:()=>Bt,_findAnchorInPath:()=>Ns,_getSubmitAction:()=>ks,_getSubmitMethod:()=>xs,_isNonHtmlPath:()=>Qa,_keyOf:()=>Ie,_longestSharedPath:()=>Os,_markFormBusy:()=>Ws,_markFrameBusy:()=>Ds,_mergeHead:()=>Zs,_navToken:()=>Ga,_onPopState:()=>Kn,_onSubmit:()=>Gn,_parseHTML:()=>zn,_prefetch:()=>$e,_prefetchCache:()=>T,_prefetchHasHoverPointer:()=>$s,_prefetchInflightSize:()=>Va,_prefetchMode:()=>Ut,_prefetchPeek:()=>za,_prefetchSaysSaveData:()=>Zn,_prefetchSuppressed:()=>Fs,_prefetchTake:()=>Bs,_reactivateScripts:()=>zt,_readStreamedShell:()=>Qs,_reconcileChildren:()=>Gt,_regraftPermanentElements:()=>Ks,_regraftPermanentInSlice:()=>er,_resetPrefetch:()=>Ka,_resetWarnOnce:()=>Za,_resolveTargetFrameId:()=>Yn,_restoreOptimistic:()=>tt,_runWithTransition:()=>Pt,_setCurrentPageUrl:()=>Xa,_snapshotCache:()=>L,_streamBoundariesProgressively:()=>no,_takeResolveUnit:()=>eo,_viewTransitionsEnabled:()=>Vs,collectChildrenSlots:()=>Pe,disableClientRouter:()=>As,enableClientRouter:()=>Vn,loadFrame:()=>Sa,longestSharedPath:()=>Os,navigate:()=>Es,revalidate:()=>vs});function zn(e){if(!/^\s*(?:<!doctype|<html)/i.test(e)&&typeof document<"u"&&document.implementation)try{let n=document.implementation.createHTMLDocument();if(typeof n.body.setHTMLUnsafe=="function")n.body.setHTMLUnsafe(e);else{let r=n.createElement("template");r.innerHTML=e,n.body.appendChild(r.content)}return n}catch{}return typeof Document<"u"&&typeof Document.parseHTMLUnsafe=="function"?Document.parseHTMLUnsafe(e):typeof DOMParser<"u"?new DOMParser().parseFromString(e,"text/html"):null}function _a(){$n||typeof MutationObserver>"u"||typeof customElements>"u"||($n=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 s of r.querySelectorAll("*"))s.tagName?.includes("-")&&customElements.upgrade(s)}}),$n.observe(document.body,{childList:!0,subtree:!0}))}function Vn(){te||typeof document>"u"||(te=!0,document.addEventListener("click",Cs,!1),document.addEventListener("submit",Gn,!1),window.addEventListener("popstate",Kn),document.addEventListener("pointerover",Me,!0),document.addEventListener("focusin",Me,!0),document.addEventListener("touchstart",Me,{capture:!0,passive:!0}),document.addEventListener("pointerout",Us,!0),document.addEventListener("webjs:navigate",Dn),_a(),Dn(),typeof history<"u"&&"scrollRestoration"in history&&(It=history.scrollRestoration,history.scrollRestoration="manual"),typeof location<"u"&&(D=location.href))}function As(){te&&(te=!1,document.removeEventListener("click",Cs,!1),document.removeEventListener("submit",Gn,!1),window.removeEventListener("popstate",Kn),document.removeEventListener("pointerover",Me,!0),document.removeEventListener("focusin",Me,!0),document.removeEventListener("touchstart",Me,{capture:!0}),document.removeEventListener("pointerout",Us,!0),document.removeEventListener("webjs:navigate",Dn),Kt(),Qn(),ee&&(ee.disconnect(),ee=null),typeof history<"u"&&It!==null&&(history.scrollRestoration=It,It=null),D=null)}async function Es(e,t){let n=new URL(e,location.href);if(n.origin!==location.origin){location.href=e;return}await Jn(n.href,t?.replace??!1,null)}async function Sa(e,t){if(typeof location>"u")return{ok:!1,status:null,aborted:!1};let n=e&&e.id;if(!n)return{ok:!1,status:null,aborted:!1};let r=new URL(t,location.href);if(r.origin!==location.origin)return{ok:!1,status:null,aborted:!1};P&&P.abort(),P=new AbortController;let s=P.signal,o=++j;return qt(r.href,n,!1,null,"GET",null,s,o)}function vs(e){if(!e){L.clear(),T.clear();return}let t=new URL(e,location.href),n=t.pathname+t.search;L.delete(n),T.delete(n)}function Cs(e){if(!te||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=Ns(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||Vt.test(r.pathname))return;e.preventDefault();let s=Yn(t);Jn(n,!1,s)}function Kn(e){Jn(location.href,!0,null)}function Gn(e){if(!te||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 s=xs(t,n);if(s==="dialog")return;let o=ks(t,n),i;try{i=new URL(o,location.href)}catch{return}if(i.origin!==location.origin||Vt.test(i.pathname))return;let a=Ts(t,n);e.preventDefault();let c=Yn(n||t);va(i.href,s,a,c,t)}function xs(e,t){return(t&&t.getAttribute("formmethod")||e.getAttribute("method")||"get").toLowerCase()}function ks(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function Ts(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 Ns(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function js(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 Yn(e){if(!e)return null;let t=e.closest&&e.closest("[data-webjs-frame]"),n=t?t.dataset?t.dataset.webjsFrame:t.getAttribute("data-webjs-frame"):null;if(n!=null&&n!==""){if(n===Rs)return null;let r=typeof document<"u"?document.getElementById(n):null;return r&&r.tagName&&r.tagName.toLowerCase()==="webjs-frame"?n:(Ls(`webjs:frame-unresolved:${n}`,`[webjs] data-webjs-frame="${n}" did not match a live <webjs-frame id="${n}">; performing a normal navigation instead.`),null)}return js(e)}function Ls(e,t){Bn.has(e)||(Bn.add(e),typeof console<"u"&&console.warn&&console.warn(t))}function gs(){if(typeof process<"u"&&process.env||Un||typeof document>"u"||typeof getComputedStyle!="function")return;let e=document.documentElement;if(!e)return;Un=!0;let t;try{t=getComputedStyle(e).scrollBehavior}catch{return}t==="smooth"&&Ls("scroll-behavior-smooth-html","[webjs] Detected `scroll-behavior: smooth` on <html>. The client router scrolls to the top instantly on navigation (like a native page load), so route transitions are not affected by it. It still applies to in-page #anchor links. Pairing it with a sticky `backdrop-filter` header can also flash on iOS during navigation.")}function Ft(e){if(typeof document>"u")return;let t=document.documentElement;if(!(!t||!t.hasAttribute("data-webjs-nav-progress")))try{e?t.setAttribute("data-navigating",""):t.removeAttribute("data-navigating")}catch{}}function Pe(e,t){let n=!!(t&&t.recoverOrphans),r=new Map,s=[];function o(i){if(i.nodeType===8){let a=i,c=a.data,l=/^wj:children:(.+)$/.exec(c);if(l){s.push({path:l[1],start:a});return}if(c.trim()==="/wj:children"){let f=s.pop();f&&!r.has(f.path)&&r.set(f.path,{start:f.start,end:a});return}return}if(i.hasChildNodes&&i.hasChildNodes())for(let a=i.firstChild;a;a=a.nextSibling)o(a)}if(o(e),n)for(let i of s)r.has(i.path)||r.set(i.path,{start:i.start,end:null});return r}function Os(e,t){let n=null;for(let r of e.keys())t.has(r)&&(n===null||r.length>n.length)&&(n=r);return n}function Ms(e){let t=he(e);document.dispatchEvent(new CustomEvent("webjs:before-cache",{detail:{url:e}})),L.has(t)&&L.delete(t);let n={html:document.documentElement.outerHTML,scrollX:typeof window<"u"&&window.scrollX||0,scrollY:typeof window<"u"&&window.scrollY||0};for(L.set(t,n);L.size>Aa;){let r=L.keys().next().value;L.delete(r)}}function Ea(e){let t=he(e),n=L.get(t);return n==null?null:(L.delete(t),L.set(t,n),typeof n=="string"?{html:n,scrollX:0,scrollY:0}:n)}function he(e){let t=new URL(e,location.href);return t.pathname+t.search}async function Jn(e,t,n){P&&P.abort(),P=new AbortController;let r=P.signal,s=++j;D&&Ms(D);let o=setTimeout(()=>{Ft(!0),o=null},150),i=null;t||(i=Ys());try{if(t){let a=Ea(e);if(a){let c=zn(a.html);if(c){tr(c,n,!0,null),typeof window<"u"&&window.scrollTo({left:a.scrollX,top:a.scrollY,behavior:"instant"}),qt(e,n,!1,i,"GET",null,r,s).catch(()=>{});return}}typeof window<"u"&&window.scrollTo({left:0,top:0,behavior:"instant"})}await qt(e,n,!t,i,"GET",null,r,s)}finally{o&&clearTimeout(o),s===j&&(Ft(!1),typeof location<"u"&&(D=location.href))}}async function va(e,t,n,r,s){P&&P.abort(),P=new AbortController;let o=P.signal,i=++j,a=t==="get"||t==="head",c=new URL(e,location.href);if(a){c.search="";for(let[m,g]of n)c.searchParams.append(m,typeof g=="string"?g:g.name)}D&&Ms(D);let l=setTimeout(()=>{Ft(!0),l=null},150),f=Ys(),d=s?Ws(s,i,c.href):null,u=!1;try{let m=await qt(c.href,r,!0,f,a?"GET":t.toUpperCase(),a?null:n,o,i);u=!!(m&&m.ok),!a&&i===j&&(L.clear(),T.clear())}finally{d&&zs(d,i,c.href,u),l&&clearTimeout(l),i===j&&(Ft(!1),typeof location<"u"&&(D=location.href))}}function Xn(){return[...Pe(document.body).keys()].join(",")}function Zn(){try{let e=typeof navigator<"u"?navigator.connection:null;if(e&&(e.saveData===!0||typeof e.effectiveType=="string"&&/2g$/.test(e.effectiveType))||typeof matchMedia=="function"&&matchMedia("(prefers-reduced-data: reduce)").matches)return!0}catch{}return!1}function $s(){try{if(typeof matchMedia=="function")return matchMedia("(hover: hover) and (pointer: fine)").matches}catch{}return!0}function Na(e){let t=e.getAttribute("rel");return t?t.toLowerCase().split(/\s+/).filter(Boolean):[]}function Bt(e){if(!e||!(e instanceof HTMLAnchorElement)||e.hasAttribute("download")||e.hasAttribute("data-no-router")||e.target&&e.target!=="_self")return null;let t=e.href;if(!t)return null;let n;try{n=new URL(t)}catch{return null}return n.origin!==location.origin||n.pathname===location.pathname&&n.search===location.search&&n.hash||Vt.test(n.pathname)?null:t}function Fs(e){if(e.hasAttribute("data-no-prefetch"))return!0;let t=Na(e);return t.includes("external")||t.includes("no-prefetch")}function Ut(e){if(Fs(e))return"none";switch((e.getAttribute("data-prefetch")||"").toLowerCase().trim()){case"false":case"none":return"none";case"true":case"render":return"render";case"auto":case"viewport":return"viewport";case"intent":return"intent";default:return $s()?"intent":"viewport"}}function $e(e){if(!te||typeof fetch!="function"||Zn())return;let t=he(e);if(de.has(t)||nt.has(t))return;let n=T.get(t);if(n&&qn()-n.at<Is)return;if(de.size>=Ps){for(nt.add(t),Le.push(e);Le.length>xa;){let o=Le.shift();nt.delete(he(o))}return}let r=Xn();if(!r&&typeof document<"u"&&document.readyState==="loading")return;de.add(t);let s={"x-webjs-router":"1","x-webjs-prefetch":"1"};r&&(s["x-webjs-have"]=r),fetch(e,{method:"GET",headers:s,credentials:"same-origin"}).then(async o=>{let i=o.headers.get("content-type")||"";if(!/^text\/html\b/i.test(i)||o.status>=400)return;let a=o.headers.get("x-webjs-build"),c=o.headers.get("x-webjs-src"),l=typeof document<"u"?document.querySelector('script[type="importmap"]'):null,f=l?l.getAttribute("data-webjs-build"):null,d=l?l.getAttribute("data-webjs-src"):null;(a&&f&&a!==f||c&&d&&c!==d)&&(L.clear(),T.clear());let u=o.redirected&&o.url?o.url:e,m=await o.text();Ra(t,{html:m,build:a,src:c,finalUrl:u,at:qn()})}).catch(()=>{}).finally(()=>{de.delete(t),ja()})}function ja(){for(;Le.length&&de.size<Ps;){let e=Le.shift();nt.delete(he(e)),$e(e)}}function Ra(e,t){for(T.has(e)&&T.delete(e),T.set(e,t);T.size>Ca;){let n=T.keys().next().value;T.delete(n)}typeof document<"u"&&document.dispatchEvent(new CustomEvent("webjs:prefetch",{detail:{url:t.finalUrl,key:e,from:"prefetch"}}))}function Bs(e){let t=he(e),n=T.get(t);return!n||(T.delete(t),qn()-n.at>=Is)?null:n}function qn(){try{if(typeof performance<"u"&&typeof performance.now=="function")return performance.now()}catch{}return 0}function Me(e){if(!te)return;let t=qs(e.target);if(!t)return;let n=Ut(t);if(n==="none"||n==="render")return;let r=Bt(t);if(r){if(e.type==="touchstart"){$e(r);return}n==="intent"&&(rt===t&&Oe||(Kt(),rt=t,Oe=setTimeout(()=>{Oe=null,rt=null,$e(r)},ka)))}}function Us(e){let t=qs(e.target);t&&t===rt&&Kt()}function Kt(){Oe&&(clearTimeout(Oe),Oe=null),rt=null}function Qn(){for(let e of st)clearTimeout(e);st.clear(),je=new WeakMap}function qs(e){let t=e;for(;t;){if(t instanceof HTMLAnchorElement)return t;let n=t.nodeType===1?t:null;if(n){let s=n.closest&&n.closest("a");if(s instanceof HTMLAnchorElement)return s}let r=t.getRootNode?t.getRootNode():null;t=r&&r.host?r.host:null}return null}function Dn(){if(typeof document>"u"||Zn())return;let e=typeof IntersectionObserver<"u";e&&(ee?(ee.disconnect(),Qn()):ee=new IntersectionObserver(t=>{for(let n of t){let r=n.target;if(n.isIntersecting){if(je.has(r))continue;let s=setTimeout(()=>{st.delete(s),je.delete(r),ee.unobserve(r);let o=Bt(r);o&&Ut(r)==="viewport"&&$e(o)},Ta);je.set(r,s),st.add(s)}else{let s=je.get(r);s&&(clearTimeout(s),st.delete(s),je.delete(r))}}},{threshold:.5}));for(let t of document.querySelectorAll("a[href]")){let n=Ut(t);if(n==="render"){let r=Bt(t);r&&$e(r)}else n==="viewport"&&e&&ee.observe(t)}}function La(e){if(typeof document>"u"||!document.body)return!1;let t=Pe(document.body),n,r=-1;for(let[c,l]of t)c.length>r&&(r=c.length,n=l);if(!n)return!1;let s=n.start.parentNode;if(!s||n.start.parentNode!==n.end.parentNode)return!1;let o=document.createElement("div");o.setAttribute("role","alert"),o.setAttribute("data-webjs-nav-error","");let i=e?`This page could not be loaded. (status ${e})`:"This page could not be loaded.";o.textContent=i;let a=document.createRange();return a.setStartAfter(n.start),a.setEndBefore(n.end),a.deleteContents(),s.insertBefore(o,n.end),!0}function Fn(e,t,n){let r=new CustomEvent("webjs:navigation-error",{bubbles:!0,cancelable:!0,detail:{url:e,status:t??null,error:n||null}});if(typeof document<"u")try{document.dispatchEvent(r)}catch{}r.defaultPrevented||La(t)||typeof location<"u"&&(location.href=e)}async function qt(e,t,n,r,s,o,i,a){s=s||"GET";let c=typeof a=="number"?a:j,l,f=null,d=null,u=null,m=null,g=!1,p=e,h=t?Ds(t,c):null;try{try{let y=s==="GET"&&!o&&!t?Bs(e):null;if(y)l=y.html,d=y.build,u=y.src,p=y.finalUrl,m=200,g=!0;else{let w={"x-webjs-router":"1"},E=Xn();E&&(w["x-webjs-have"]=E),t&&(w["x-webjs-frame"]=t),o!=null&&s!=="GET"&&s!=="HEAD"&&(w.accept=bs+", text/html");let R={method:s,headers:w,credentials:"same-origin"};i&&(R.signal=i),o!=null&&s!=="GET"&&s!=="HEAD"&&(R.body=o);let _=await fetch(e,R);m=_.status,g=_.ok;let x=_.headers.get("content-type")||"",M=/^text\/html\b/i.test(x);if(x.toLowerCase().indexOf(bs)===0){let I=await _.text();return c===j&&(tt(r),In(I)),{ok:g,status:m,aborted:!1}}if(_.redirected&&_.url&&(p=_.url),_.status===204||_.status===205)return c===j&&n&&history.pushState(null,"",p),{ok:g,status:m,aborted:!1};if(!M)return c===j&&(tt(r),Fn(e,_.status,null)),{ok:!1,status:m,aborted:!1};d=_.headers.get("x-webjs-build"),u=_.headers.get("x-webjs-src");let S=await Qs(_);l=S.shell,S.streaming&&(f=S)}}catch(y){return y&&y.name==="AbortError"?{ok:!1,status:null,aborted:!0}:c!==j?{ok:!1,status:null,aborted:!0}:(tt(r),Fn(e,null,y instanceof Error?y:new Error(String(y))),{ok:!1,status:null,aborted:!1})}if(c!==j){if(f&&f.reader)try{f.reader.cancel()}catch{}return{ok:!1,status:m,aborted:!0}}let b=zn(l);if(!b)return tt(r),Fn(e,null,new Error("navigation response did not parse as HTML")),{ok:!1,status:m,aborted:!1};if(tr(b,t,!1,p,d,u),n&&history.pushState(null,"",p),n){let y=new URL(p);if(y.hash){let w=document.getElementById(y.hash.slice(1));w?w.scrollIntoView():(gs(),window.scrollTo({left:0,top:0,behavior:"instant"}))}else gs(),window.scrollTo({left:0,top:0,behavior:"instant"})}return f&&(f.reader||f.rest)&&no(f.reader,f.dec,f.rest,()=>c===j),document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:p,frameId:t,from:"navigate"}})),{ok:g,status:m,aborted:!1}}finally{h&&Hs(h,c)}}function Ds(e,t){if(typeof document>"u")return null;let n=null;try{n=document.querySelector(`webjs-frame#${CSS.escape(e)}`)}catch{n=document.getElementById(e)}if(!n)return null;let r=Dt.has(n);return Dt.set(n,t),n.setAttribute("aria-busy","true"),r||n.dispatchEvent(new CustomEvent("webjs:frame-busy",{bubbles:!0,detail:{frameId:e,busy:!0}})),n}function Hs(e,t){if(Dt.get(e)!==t)return;Dt.delete(e),e.setAttribute("aria-busy","false");let n=e.id||null;e.dispatchEvent(new CustomEvent("webjs:frame-busy",{bubbles:!0,detail:{frameId:n,busy:!1}}))}function Ws(e,t,n){let r=Ht.has(e);return Ht.set(e,t),e.setAttribute("aria-busy","true"),r||e.dispatchEvent(new CustomEvent("webjs:submit-start",{bubbles:!0,detail:{form:e,url:n}})),e}function zs(e,t,n,r){if(Ht.get(e)!==t)return;Ht.delete(e),e.setAttribute("aria-busy","false");let s=new CustomEvent("webjs:submit-end",{bubbles:!0,detail:{form:e,url:n,ok:!!r}});e.isConnected?e.dispatchEvent(s):typeof document<"u"?document.dispatchEvent(s):e.dispatchEvent(s)}function ys(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+=pe(r);return n}function Vs(){if(typeof document>"u")return!1;let e=document.querySelector('meta[name="view-transition"]');return e?(e.getAttribute("content")||"").trim().toLowerCase()==="same-origin":!1}function Pt(e,t){let n=typeof document<"u"?document.startViewTransition:void 0;if(Vs()&&typeof n=="function"){let r=n.call(document,e);r&&r.finished&&typeof r.finished.then=="function"?r.finished.then(()=>{t&&t()}).catch(()=>{}):t&&t();return}e(),t&&t()}function Ks(e,t){if(!e||!t||typeof e.querySelectorAll!="function")return;let n=e.querySelectorAll("[data-webjs-permanent][id]");for(let r of n){let s=r.id;if(!s)continue;let o=null;try{o=t.querySelector(`#${CSS.escape(s)}`)}catch{o=null}if(!o||!r.hasAttribute||!r.hasAttribute("data-webjs-permanent"))continue;let i=o.parentNode;i&&o!==r&&i.replaceChild(r,o)}}function er(e,t){let n=[];for(let r of e){if(r.nodeType!==1)continue;let s=r;if(s.hasAttribute&&s.hasAttribute("data-webjs-permanent")&&s.id&&n.push(s),typeof s.querySelectorAll=="function")for(let o of s.querySelectorAll("[data-webjs-permanent][id]"))n.push(o)}if(n.length)for(let r of n){let s=r.id;if(!s)continue;let o=Oa(t,s);if(!o||o===r)continue;let i=o.parentNode;if(i)i.replaceChild(r,o);else{let a=t.indexOf(o);a!==-1&&(t[a]=r)}}}function Oa(e,t){for(let n of e){if(n.nodeType!==1)continue;let r=n;if(r.id===t)return r;if(typeof r.querySelector=="function"){let s=null;try{s=r.querySelector(`#${CSS.escape(t)}`)}catch{s=null}if(s)return s}}return null}function Ma(e){if(!(!e||!e.start))for(let t=e.start.nextSibling;t&&t!==e.end;t=t.nextSibling)t.nodeType===1&&Re(t)}function tr(e,t,n,r,s,o){try{Mt(e)}catch{}try{typeof sessionStorage<"u"&&(!r||t||n)&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}if(r&&!t&&!n){let d=document.querySelector('script[type="importmap"]'),u=d?d.getAttribute("data-webjs-build"):null,m=!1;if(s&&u&&(m=s!==u),!m&&e.head&&e.head.children.length>0){let g=ys(document),p=ys(e);g!==p&&(m=!0)}if(m&&typeof location<"u"){L.clear(),T.clear();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(!m){let g=d?d.getAttribute("data-webjs-src"):null;o&&g&&o!==g&&(L.clear(),T.clear(),d&&d.setAttribute("data-webjs-src",o));try{typeof sessionStorage<"u"&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}}}if(t){let d=document.querySelector(`webjs-frame#${CSS.escape(t)}`),u=e.querySelector(`webjs-frame#${CSS.escape(t)}`);if(d&&u){Wn(e.head),Pt(()=>{Ha(d,u),zt(d),Re(d),$t()},()=>Re(d)),Ss(e.body);return}let m=new CustomEvent("webjs:frame-missing",{bubbles:!0,cancelable:!0,detail:{frameId:t,url:r||(typeof location<"u"?location.href:null),document:e}});(d||document).dispatchEvent(m),m.defaultPrevented||console.warn(`[webjs] frame "${t}" was not in the navigation response, leaving it unchanged. Handle "webjs:frame-missing" (preventDefault) to override.`);return}let i=Pe(document.body,{recoverOrphans:!0}),a=Pe(e.body,{recoverOrphans:!0}),c=Os(i,a);if(c){let d=i.get(c),u=a.get(c);Pa(d,u),Wn(e.head),Pt(()=>{$a(d,u,e),$t()},()=>Ma(d)),Ss(e.body);return}Zs(e.head),Ks(document.body,e.body);let l=[...e.body.childNodes];Pt(()=>{document.body.replaceChildren(...l),zt(document.body),Re(document.body),$t()},()=>Re(document.body))}function $t(){let e=document.activeElement;!e||e===document.body||e===document.documentElement||typeof e.blur=="function"&&e.blur()}function Ia(e){let t=0;for(let n=e.nextSibling;n;n=n.nextSibling)t++;return t}function Pa(e,t){!e||!t||(e.end===null&&t.end!==null?e.end=ws(e.start,t.end):t.end===null&&e.end!==null&&(t.end=ws(t.start,e.end)))}function ws(e,t){let n=Ia(t);if(n===0)return null;let r=[];for(let o=e.nextSibling;o;o=o.nextSibling)r.push(o);let s=r.length-n;return s<=0?null:r[s]}function $a(e,t,n){if(!e||!t)return;let r=e.start.parentNode;if(!r)return;let s=[];for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)s.push(i);let o=[];for(let i=t.start.nextSibling;i&&i!==t.end;i=i.nextSibling)o.push(document.importNode(i,!0));er(s,o),Fa(r,e.start,e.end,s,o);for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)i.nodeType===1&&(zt(i),Re(i))}function Fa(e,t,n,r,s){let o=new Map;for(let c of r){if(c.nodeType!==1)continue;let l=Ie(c);l&&o.set(l,c)}let i=n,a=[];for(let c of s){if(c.nodeType===1){let l=Ie(c);if(l&&o.has(l)){let f=o.get(l);Wt(f,c),a.push(f),o.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 Wt(e,t){if(e===t)return;if(e.tagName!==t.tagName){e.replaceWith(t);return}let n=new Set;for(let r of t.attributes)n.add(r.name),!Hn.has(r.name)&&e.getAttribute(r.name)!==r.value&&e.setAttribute(r.name,r.value);for(let r of[...e.attributes])Hn.has(r.name)||n.has(r.name)||e.removeAttribute(r.name);if(Ba(e)){Da(e,t);return}Gt(e,t)}function Ba(e){return e[Symbol.for("webjs.instance")]!=null}function Gs(e,t){for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!1;return!0}function _s(e){let t=new Map,n=`slot[${B}][${z}="${le}"]`;for(let r of e.querySelectorAll(n)){let s=r;if(!Gs(s,e))continue;let o=s.getAttribute("name")||null;t.has(o)||t.set(o,s)}return t}function Ua(e,t){for(let n of e.querySelectorAll(`slot[${B}]`)){let r=n;if(Gs(r,e)&&(r.getAttribute("name")||null)===t)return r}return null}function qa(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Da(e,t){let n=e[W];if(!n)return;let r=_s(e),s=_s(t);if(r.size===0&&s.size===0)return;let o=new Set([...r.keys(),...s.keys()]);for(let i of o){let a=r.get(i),c=s.get(i);if(a&&c){let l=n.lastSnapshot.get(a)||[];Gt(a,c);let f=[...a.childNodes];n.assignedByName.set(i,f),n.lastSnapshot.set(a,f.slice()),qa(l,f)||ze(a)}else if(a&&!c)n.assignedByName.delete(i),bn(n,a)&&ze(a);else{let l=Ua(e,i);if(!l)continue;let f=[...c.childNodes].map(d=>document.importNode(d,!0));n.assignedByName.set(i,f),mn(n,l,f)&&ze(l)}}}function Gt(e,t){let n=[...e.childNodes],r=[...t.childNodes].map(a=>document.importNode(a,!0));er(n,r);let s=new Map;for(let a of n){if(a.nodeType!==1)continue;let c=Ie(a);c&&s.set(c,a)}let o=[];for(let a=0;a<r.length;a++){let c=r[a];if(c.nodeType===1){let l=Ie(c);if(l&&s.has(l)){let d=s.get(l);Wt(d,c),o.push(d),s.delete(l);continue}let f=n[a];if(f&&f.nodeType===1&&!Ie(f)&&f.tagName===c.tagName){Wt(f,c),o.push(f);continue}}else if(c.nodeType===3){let l=n[a];if(l&&l.nodeType===3){l.nodeValue!==c.nodeValue&&(l.nodeValue=c.nodeValue),o.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),o.push(l);continue}}o.push(c)}let i=new Set(o);for(let a of n)!i.has(a)&&a.parentNode===e&&e.removeChild(a);for(let a=0;a<o.length;a++){let c=o[a];(c.parentNode!==e||e.childNodes[a]!==c)&&e.insertBefore(c,e.childNodes[a]||null)}}function Ie(e){let t=e.getAttribute("data-key");return t?`${e.tagName}:k:${t}`:e.id?`${e.tagName}:i:${e.id}`:null}function Ys(){let e=Pe(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),s=[];for(let i=r.start.nextSibling;i&&i!==r.end;i=i.nextSibling)s.push(i);let o=document.createRange();return o.setStartAfter(r.start),o.setEndBefore(r.end),o.deleteContents(),r.start.parentNode.insertBefore(n.content.cloneNode(!0),r.end),{slot:r,oldChildren:s,token:j}}function tt(e){if(!e||e.token!==j)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 s of n)t.start.parentNode.insertBefore(s,t.end)}function Ha(e,t){Gt(e,t)}function Js(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function nr(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=Js();return n&&t.setAttribute("nonce",n),t.textContent=e.textContent,t}function Xs(e){if(!e.hasAttribute("nonce"))return e.cloneNode(!0);let t=e.cloneNode(!0),n=Js();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function pe(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function Wn(e){let t=e.querySelector("title");t&&(document.title=t.textContent||"");let n=new Set;for(let r of document.head.children)n.add(pe(r));for(let r of e.children)r.tagName==="SCRIPT"&&r.getAttribute("type")==="importmap"||r.tagName!=="BASE"&&r.tagName!=="TITLE"&&(n.has(pe(r))||(r.tagName==="SCRIPT"?document.head.appendChild(nr(r)):document.head.appendChild(Xs(r))))}function Wa(e){return e.tagName==="STYLE"?!0:e.tagName==="LINK"&&(e.getAttribute("rel")||"").toLowerCase().split(/\s+/).includes("stylesheet")}function Zs(e){let t=document.head,n=e.querySelector("title");n&&(document.title=n.textContent||"");let r=new Set;for(let o of t.children)o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&r.add(pe(o));let s=new Set;for(let o of e.children)o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&s.add(pe(o));for(let o of[...t.children])o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&o.tagName!=="TITLE"&&(Wa(o)||s.has(pe(o))||o.remove());for(let o of e.children)o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&o.tagName!=="TITLE"&&(r.has(pe(o))||(o.tagName==="SCRIPT"?t.appendChild(nr(o)):t.appendChild(Xs(o))))}function Re(e){typeof customElements>"u"||rr(e)}function rr(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&&rr(n.shadowRoot))}function Ss(e){for(let t of e.querySelectorAll("template[data-webjs-resolve]"))document.body.appendChild(t.cloneNode(!0))}async function Qs(e){if(!e.body||typeof e.body.getReader!="function")return{shell:await e.text(),streaming:!1};let t=e.body.getReader(),n=new TextDecoder,r="",s="<template data-webjs-resolve",o="<!--wj-stream-shell-->",i=/<\/html\s*>/i;for(;;){let{value:a,done:c}=await t.read();a&&(r+=n.decode(a,{stream:!0})),c&&(r+=n.decode());let l=r.indexOf(o);if(l!==-1)return{shell:r.slice(0,l),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(l+o.length)};let f=r.indexOf(s);if(f!==-1)return{shell:r.slice(0,f),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(f)};if(c)return{shell:r,streaming:!1};let d=i.exec(r);if(d){let u=d.index+d[0].length;return{shell:r.slice(0,u),streaming:!0,reader:t,dec:n,rest:r.slice(u)}}}}function eo(e){let t=/<template\s+data-webjs-resolve="([^"]+)"\s*>/i.exec(e);if(!t)return null;let n=t[1],r=t.index+t[0].length,s=/<(\/?)template\b[^>]*>/gi;s.lastIndex=r;let o=1,i;for(;i=s.exec(e);)if(i[1]==="/"){if(o--,o===0)return{id:n,content:e.slice(r,i.index),rest:e.slice(i.index+i[0].length)}}else o++;return null}function to(e,t){let n=document.getElementById(e);if(!n)return;let r=document.createElement("template");r.innerHTML=t;let s=[...r.content.childNodes];n.replaceWith(r.content);for(let o of s)o.nodeType===1&&rr(o)}async function no(e,t,n,r){let s=n,o=()=>{let i;for(;i=eo(s);){if(!r())return!1;to(i.id,i.content),s=i.rest}return!0};if(!e){o();return}try{for(;;){if(!o()){try{await e.cancel()}catch{}return}let{value:i,done:a}=await e.read();if(i&&(s+=t.decode(i,{stream:!0})),a){s+=t.decode(),o();return}}}catch{}}function zt(e){for(let t of e.querySelectorAll("script"))t.replaceWith(nr(t))}function za(e){return T.get(he(e))||null}function Va(){return de.size}function Ka(){T.clear(),de.clear(),Le.length=0,nt.clear(),Kt(),Qn()}function Ga(){return j}function Ya(){return++j}function Ja(){return D}function Xa(e){D=e}function Za(){Bn.clear(),Un=!1}function Qa(e){return Vt.test(e)}var bs,te,P,j,$n,D,It,Vt,Rs,Bn,Un,Aa,L,Ca,Is,Ps,xa,ka,Ta,T,de,Le,nt,Oe,rt,ee,je,st,Dt,Ht,Hn,On=H(()=>{Ln();Ot();Ot();ds();Pn();wt();bs="text/vnd.webjs-stream.html";te=!1,P=null,j=0,$n=null;D=null,It=null;Vt=/\.(?: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;Rs="_top";Bn=new Set;Un=!1;Aa=16,L=new Map;Ca=8,Is=3e4,Ps=3,xa=24,ka=100,Ta=250,T=new Map,de=new Set,Le=[],nt=new Set,Oe=null,rt=null,ee=null,je=new WeakMap,st=new Set;Dt=new WeakMap;Ht=new WeakMap;Hn=new Set(["value","checked","selected","indeterminate","disabled","open","popover"]);(typeof window>"u"||window.__WEBJS_CLIENT_ROUTER__!==!1)&&Vn()});Be();function uo(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 be(e){return!!e&&typeof e=="object"&&e._$webjsCss===!0}function Qt(e,t){if(!(!t||!t.length))if("adoptedStyleSheets"in e&&typeof CSSStyleSheet<"u"){let n=t.map(r=>{let s=new CSSStyleSheet;return s.replaceSync(r.text),s});e.adoptedStyleSheets=n}else{let n=e,r=document.createElement("style");r.textContent=t.map(s=>s.text).join(`
2
- `),n.appendChild(r)}}function at(e){return!e||!e.length?"":`<style>${e.map(t=>t.text).join(`
3
- `)}</style>`}Be();var ge=Object.freeze({"@":"event",".":"prop","?":"bool"});function ur(e){return Object.prototype.hasOwnProperty.call(ge,e)}function ct(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function $(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}var fr=Symbol.for("webjs.repeat");function dr(e,t,n){return{[fr]:!0,items:[...e],keyFn:t,templateFn:n}}function ne(e){return!!e&&typeof e=="object"&&e[fr]===!0}function en(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function ye(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function fo(e){return{_$webjs:"live",value:e}}function we(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function po(e,t){return{_$webjs:"keyed",key:e,value:t}}function re(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function ho(e,t){return{_$webjs:"guard",deps:e,fn:t}}function se(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function mo(e){return{_$webjs:"template-content",template:e}}function _e(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function bo(e){return{_$webjs:"ref",target:e}}function oe(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function go(){return{value:void 0}}function yo(e){return{_$webjs:"cache",value:e}}function ie(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function wo(...e){return{_$webjs:"until",args:e}}function ae(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function _o(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function Se(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function So(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function Ae(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function Ao(e){return{_$webjs:"watch",signal:e}}function ce(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}var F=null,G=!1,ve=0,Ee=null,tn=0,pr=(e,t)=>Object.is(e,t),ut=()=>{},hr=()=>!1;function mr(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)mr(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function Ue(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)Ue(n,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(n){console.error(n)}}}function cn(e){if(G)throw new Error("Signal read during notification phase");if(F===null)return;let t=F,n=t.nextProducerIndex++;n<t.producers.length&&t.producers[n]!==e&&sn(t)&&Ue(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,sn(t)&&mr(e,t)),t.producerLastReadVersions[n]=e.version}function sn(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function br(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=G;G=!0;try{for(let n of e.liveConsumers)n.dirty||Eo(n)}finally{G=t}}function Eo(e){e.dirty=!0,br(e),e.consumerMarkedDirty.call(e.wrapper||e)}function ft(e){if(!(!e.dirty&&e.lastCleanEpoch===ve)){if(!e.producerMustRecompute()&&!vo(e)){e.dirty=!1,e.lastCleanEpoch=ve;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=ve}}function vo(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(ft(n),r!==n.version))return!0}return!1}function on(e){e&&(e.nextProducerIndex=0);let t=F;return F=e,t}function an(e,t){if(F=t,!!e){if(sn(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)Ue(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var dt=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=ve,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=hr,this.producerRecomputeValue=ut,this.consumerMarkedDirty=ut,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||pr,this.watched=n?.[ln],this.unwatched=n?.[un]}get(){return cn(this),this.__value}peek(){return this.__value}set(t){if(G)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,ve++,Ee!==null?gr(this):br(this))}};function gr(e){let t=G;G=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers)n.dirty||(n.dirty=!0,n.__isWatcher?Ee.add(n):gr(n))}finally{G=t}}var nn=Symbol("unset"),rn=Symbol("computing"),lt=Symbol("errored"),qe=class{constructor(t,n){this.__fn=t,this.__value=nn,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||pr,this.watched=n?.[ln],this.unwatched=n?.[un];let r=this;this.producerMustRecompute=function(){return r.__value===nn||r.__value===rn},this.producerRecomputeValue=function(){if(r.__value===rn)throw new Error("Detected cycle in computations.");let s=r.__value;r.__value=rn;let o=on(r),i,a=!1;try{i=r.__fn.call(r.wrapper)}catch(l){i=lt,r.__error=l,a=!0}finally{an(r,o)}if(!a&&(s!==nn&&s!==lt)&&r.__equal.call(r.wrapper,s,i)){r.__value=s;return}r.__value=i,r.version++},this.consumerMarkedDirty=ut}get(){if(ft(this),cn(this),this.__value===lt)throw this.__error;return this.__value}peek(){if(ft(this),this.__value===lt)throw this.__error;return this.__value}},pt=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=ve,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=hr,this.producerRecomputeValue=ut,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=on(this);try{for(let r of t)cn(r),r.__isComputed&&ft(r)}finally{an(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(Ue(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=on(this),r;try{r=t()}finally{an(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)Ue(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},ln=Symbol("watched"),un=Symbol("unwatched");function Co(e){let t=F;F=null;try{return e()}finally{F=t}}function xo(e){return e.producers.slice()}function ko(e){return e.liveConsumers?[...e.liveConsumers]:[]}function To(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function No(e){return e.producers.length>0}function jo(){return F&&F.__isComputed?F:null}function Ro(e){tn++,Ee===null&&(Ee=new Set);try{e()}finally{if(tn--,tn===0){let t=Ee;Ee=null;for(let n of t)n.__fire()}}}var De={State:dt,Computed:qe,subtle:{Watcher:pt,untrack:Co,introspectSources:xo,introspectSinks:ko,hasSinks:To,hasSources:No,currentComputed:jo,watched:ln,unwatched:un}};function Lo(e,t){return new dt(e,t)}function Oo(e,t){return new qe(e,t)}function Mo(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function Io(e){let t=!1,n=!1,r=new qe(e),s=new pt(()=>{t||n||(t=!0,queueMicrotask(()=>{if(t=!1,!n){try{r.get()}catch(o){console.error(o)}s.watch()}}))});s.watch(r);try{r.get()}catch(o){console.error(o)}return()=>{n||(n=!0,s.dispose())}}wt();var Rr=new WeakMap,gn=Symbol.for("webjs.instance");function ke(e,t){let n=t,r=n[gn];if(N(e)){let s=e;if(r&&r.strings===s.strings){Ce(r,s.values);return}r&&Lr(r,t);let o=t.firstChild;o&&o.nodeType===8&&o.data==="webjs-hydrate"&&o.remove();let i=Go(s,t);n[gn]=i;return}if(r&&Lr(r,t),n[gn]=null,t.replaceChildren(),!(e==null||e===!1||e===!0)){if(Array.isArray(e)){for(let s of e){let o=document.createTextNode(String(s??""));t.appendChild(o)}return}t.appendChild(document.createTextNode(String(e)))}}function St(e){let{strings:t}=e,n=Rr.get(t);if(n)return n;let r=[],s="",o="text",i="",a=0,c="",l=0,f=null,d="",u="";for(let g=0;g<t.length;g++){let p=t[g];for(let h=0;h<p.length;h++){let b=p[h];switch(o){case"text":s+=b,b==="<"&&(o="tag-open");break;case"tag-open":s+=b,b==="!"?o="bang-1":b==="/"?(o="tag-name",d=""):/[a-zA-Z]/.test(b)?(o="tag-name",d=b.toLowerCase()):o="text";break;case"bang-1":s+=b,o=b==="-"?"bang-dash":"tag-name";break;case"bang-dash":s+=b,b==="-"?(o="comment",l=0):o="tag-name";break;case"comment":s+=b,b==="-"?l+=1:(b===">"&&l>=2&&(o="text"),l=0);break;case"tag-name":s+=b,b===">"?(o=d==="script"||d==="style"?"rawtext":"text",o==="rawtext"&&(u="")):/\s/.test(b)?o="in-tag":d+=b.toLowerCase();break;case"in-tag":s+=b,b===">"?(o=d==="script"||d==="style"?"rawtext":"text",o==="rawtext"&&(u="")):!/\s/.test(b)&&b!=="/"&&(o="attr-name",i=b,a=s.length-1);break;case"rawtext":s+=b,u=(u+b.toLowerCase()).slice(-9),(u.endsWith("<\/script>")||u.endsWith("</style>"))&&(o="text",u="",d="");break;case"attr-name":b==="="?(o="after-eq",s+=b):/\s/.test(b)?(o="in-tag",i="",s+=b):b===">"?(o="text",i="",s+=b):(i+=b,s+=b);break;case"after-eq":b==='"'||b==="'"?(o="attr-quoted",c=b,s+=b):/\s/.test(b)?(o="in-tag",i="",s+=b):b===">"?(o="text",i="",s+=b):(o="attr-unquoted",s+=b);break;case"attr-unquoted":/\s/.test(b)?(o="in-tag",i="",s+=b):(b===">"&&(o="text",i=""),s+=b);break;case"attr-quoted":s+=b,b===c&&(o="in-tag",i="");break;case"skip-attr":if(b===c){if(f){let y=f.firstPartIdx,w=[];for(let A=y;A<r.length;A++)(r[A].kind==="noop"||r[A].kind==="attr-mixed")&&w.push(A);let E=[],R=t[w[0]],_=R.lastIndexOf(c);E.push(_>=0?R.slice(_+1):R);for(let A=1;A<w.length;A++)E.push(t[w[A]]);let x=t[w[w.length-1]+1],M=x.indexOf(c);E.push(M>=0?x.slice(0,M):x),r[y]={kind:"attr-mixed",path:[],name:f.name,statics:E,group:w};for(let A=1;A<w.length;A++)r[w[A]]={kind:"noop",path:[],mixedAnchor:y};f=null}o="in-tag",i=""}break}}if(g<t.length-1){let h=r.length;if(o==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(o==="rawtext"){u="",r.push({kind:"noop",path:[]});continue}if(o==="text")s+=`<!--${v}${h}-->`,r.push({kind:"child",path:[]});else if(o==="in-tag"){let b=`data-${v}${h}`;s+=`${b}=""`,r.push({kind:"element",path:[]})}else if(o==="after-eq"){let b=i[0],y=i.slice(1);if(ur(b)){s=s.slice(0,a);let w=ge[b],E=`data-${v}${h}`;s+=`${E}=""`,r.push({kind:w,path:[],name:y})}else{s=s.slice(0,a);let w=`data-${v}${h}`;s+=`${w}=""`,r.push({kind:"attr",path:[],name:i})}o="in-tag",i=""}else if(o==="attr-quoted"||o==="attr-unquoted"){s=s.slice(0,a);let b=`data-${v}${h}`;s+=`${b}=""`,f={name:i,firstPartIdx:h},r.push({kind:"noop",path:[]}),o="skip-attr"}else o==="skip-attr"&&r.push({kind:"noop",path:[]})}}let m=document.createElement("template");return m.innerHTML=s,Vo(m.content,r),Ko(m.content,r),n={templateEl:m,parts:r},Rr.set(t,n),n}function Vo(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(B,"");let s=t.length;r.setAttribute(`data-${v}${s}`,""),t.push({kind:"slot",path:[]})}}function Ko(e,t){let n=[];function r(s){for(let o=0;o<s.childNodes.length;o++){let i=s.childNodes[o];if(n.push(o),i.nodeType===8){let a=i.data;if(a.startsWith(v)){let c=Number(a.slice(v.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-${v}`)){let f=Number(l.name.slice(`data-${v}`.length));t[f]&&t[f].kind!=="child"&&(t[f].path=n.slice()),c.push(l.name)}for(let l of c)a.removeAttribute(l);r(i)}n.pop()}}r(e)}function Go(e,t){let{templateEl:n,parts:r}=St(e),s=n.content.cloneNode(!0),o=document.createComment(`${v}s`),i=document.createComment(`${v}e`),a=r.map(l=>At(l,s)),c=[];for(let l=0;l<e.values.length;l++)X(a[l],e.values[l],void 0,e.values),c.push(e.values[l]);t.replaceChildren(o,...s.childNodes,i);for(let l of a)l.kind==="slot"&&X(l,void 0,void 0,[]);return{strings:e.strings,bound:a,lastValues:c,startNode:o,endNode:i}}function At(e,t){if(e.kind==="noop")return{kind:"noop",mixedAnchor:e.mixedAnchor};let n=t;for(let s of e.path)n=n.childNodes[s];if(e.kind==="child")return{kind:"child",marker:n};let r=n;if(e.kind==="event"){let s={kind:"event",el:r,name:e.name||"",handler:null,dispatcher(o){s.handler?.(o)}};return r.addEventListener(s.name,s.dispatcher),s}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 Ce(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(Object.is(r,e.lastValues[n]))continue;let s=e.bound[n],o=s.mixedAnchor;s.kind==="noop"&&o!=null?X(e.bound[o],t[o],e.lastValues[o],t):X(s,r,e.lastValues[n],t),e.lastValues[n]=r}}function Lr(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=yn(n.slotEl);r&&jr(r,n.slotEl)}}t.replaceChildren()}function X(e,t,n,r){if(we(t)){let s=t.value;if(e.kind==="prop"&&e.el[e.name]===s||e.kind==="attr"&&e.el.getAttribute(e.name)===String(s)||e.kind==="bool"&&e.el.hasAttribute(e.name)===!!s)return;t=s}switch(e.kind){case"child":Xo(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":Jo(e,t);break;case"attr-mixed":{let s=e,o=s.statics[0];for(let i=0;i<s.group.length;i++)o+=String((r?r[s.group[i]]:t)??""),o+=s.statics[i+1]||"";e.el.setAttribute(e.name,o);break}case"slot":{if(e.applied)break;let s=e.slotEl,o=()=>{e.applied=!0;let a=yn(s);if(!a||Yo(s))return;let c=document.createDocumentFragment();for(;s.firstChild;)c.appendChild(s.firstChild);s[gt]=c,yt(a)};yn(s)?o():queueMicrotask(o);break}case"noop":break}}function yn(e){let t=e.parentElement;for(;t;){if(t[W])return t;t=t.parentElement}return null}function Yo(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 Jo(e,t){let n=e,r=oe(t)?t.target:void 0,s=n.__refTarget,o=r!==s;if(o&&s)if(typeof s=="function")try{s(void 0)}catch{}else typeof s=="object"&&(s.value=void 0);if(o||n.__refElement!==e.el){if(n.__refTarget=r,r)if(typeof r=="function"){if(!o&&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 Xo(e,t){return ii(e,t),U(e,t)}function U(e,t){let n=e.marker;if(ye(t)){J(e);let s=String(t.value??""),o=document.createElement("template");o.innerHTML=s;let i=[...o.content.childNodes],a=document.createDocumentFragment();for(let c of i)a.appendChild(c);n.parentNode?.insertBefore(a,n),e.child=i;return}if(re(t)){let s=t,o=e.__keyedKey;o!==void 0&&!Object.is(o,s.key)&&J(e),e.__keyedKey=s.key,U(e,s.value);return}if(se(t)){let s=t,o=e.__guardDeps,i=s.deps;if(o!==void 0&&(Array.isArray(o)&&Array.isArray(i)?oi(o,i):Object.is(o,i)))return;e.__guardDeps=Array.isArray(i)?i.slice():i,U(e,s.fn());return}if(_e(t)){J(e);let s=t.template;if(s&&s.content){let o=s.content.cloneNode(!0),i=[...o.childNodes];n.parentNode?.insertBefore(o,n),e.child=i}return}if(oe(t))return;if(ie(t))return ai(e,t.value);if(ae(t))return ci(e,t.args);if(ce(t))return li(e,t.signal);if(Se(t))return ui(e,t);if(Ae(t))return fi(e,t);if(ne(t)){if(e.child&&e.child.kind==="repeat"){ei(e,t);return}J(e);let s={kind:"repeat",map:new Map};e.child=s,Qo(n,s,t);return}if(Array.isArray(t)){if(e.child&&e.child.kind==="array"){ri(e,t);return}J(e);let s={kind:"array",items:[]};e.child=s,ni(n,s,t);return}if(e.child){let s=e.child;if(s.kind==="repeat")Or(s),e.child=void 0;else if(s.kind==="array")Ir(s),e.child=void 0;else if(s.kind==="async-stream")Br(s),e.child=void 0;else if("strings"in e.child){let o=e.child;if(N(t)&&o.strings===t.strings){Ce(o,t.values);return}xe(o.startNode,o.endNode),e.child=void 0}else{for(let o of e.child)o.parentNode&&o.parentNode.removeChild(o);e.child=void 0}}if(t==null||t===!1||t===!0)return;if(N(t)){let s=t,{templateEl:o,parts:i}=St(s),a=o.content.cloneNode(!0),c=document.createComment(`${v}s`),l=document.createComment(`${v}e`),f=i.map(m=>At(m,a)),d=[];for(let m=0;m<s.values.length;m++)X(f[m],s.values[m],void 0,s.values),d.push(s.values[m]);let u=[c,...a.childNodes,l];n.parentNode?.insertBefore(Zo(u),n);for(let m of f)m.kind==="slot"&&X(m,void 0,void 0,[]);e.child={strings:s.strings,bound:f,lastValues:d,startNode:c,endNode:l};return}let r=document.createTextNode(String(t));n.parentNode?.insertBefore(r,n),e.child=[r]}function Zo(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function xe(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 _n(e){let{templateEl:t,parts:n}=St(e),r=t.content.cloneNode(!0),s=document.createComment(`${v}s`),o=document.createComment(`${v}e`),i=n.map(l=>At(l,r)),a=[];for(let l=0;l<e.values.length;l++)X(i[l],e.values[l],void 0,e.values),a.push(e.values[l]);let c=document.createDocumentFragment();for(c.appendChild(s);r.firstChild;)c.appendChild(r.firstChild);return c.appendChild(o),{inst:{strings:e.strings,bound:i,lastValues:a,startNode:s,endNode:o},frag:c}}function Ve(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 Qo(e,t,n){let{items:r,keyFn:s,templateFn:o}=n,i=e.parentNode;if(!i)return;let a=document.createDocumentFragment();for(let c=0;c<r.length;c++){let l=s(r[c],c),f=o(r[c],c);if(!N(f))continue;let{inst:d,frag:u}=_n(f);t.map.set(l,d),a.appendChild(u)}i.insertBefore(a,e)}function ei(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let s=e.child,{items:o,keyFn:i,templateFn:a}=t,c=new Map;for(let l=0;l<o.length;l++){let f=i(o[l],l),d=a(o[l],l);if(!N(d))continue;let u=s.map.get(f);if(u&&u.strings===d.strings)Ce(u,d.values),wn(u.startNode,u.endNode,r,n),c.set(f,u),s.map.delete(f);else{u&&(Ve(u),xe(u.startNode,u.endNode),s.map.delete(f));let{inst:m,frag:g}=_n(d);r.insertBefore(g,n),c.set(f,m)}}for(let l of s.map.values())Ve(l),xe(l.startNode,l.endNode);s.map=c}function Or(e){for(let t of e.map.values())Ve(t),xe(t.startNode,t.endNode);e.map.clear()}function ti(e){return e.type==="tpl"?e.inst.startNode:e.type==="text"?e.node:null}function _t(e){e.type==="tpl"?(Ve(e.inst),xe(e.inst.startNode,e.inst.endNode)):e.type==="text"&&e.node.parentNode?.removeChild(e.node)}function Mr(e){if(N(e)){let{inst:t,frag:n}=_n(e);return{item:{type:"tpl",inst:t},frag:n}}if(e!=null&&e!==!1&&e!==!0){let t=document.createTextNode(String(e));return{item:{type:"text",node:t},frag:t}}return{item:{type:"empty"},frag:null}}function ni(e,t,n){let r=e.parentNode;if(!r)return;let s=document.createDocumentFragment(),o=[];for(let i of n){let{item:a,frag:c}=Mr(i);c&&s.appendChild(c),o.push(a)}r.insertBefore(s,e),t.items=o}function ri(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let s=e.child,o=s.items,i=[];for(let a=0;a<t.length;a++){let c=t[a],l=o[a];if(N(c)){let u=c;if(l&&l.type==="tpl"&&l.inst.strings===u.strings){Ce(l.inst,u.values),i.push(l);continue}}else if(c!=null&&c!==!1&&c!==!0){if(l&&l.type==="text"){let u=String(c);l.node.data!==u&&(l.node.data=u),i.push(l);continue}}else{l&&_t(l),i.push({type:"empty"});continue}let{item:f,frag:d}=Mr(c);d&&r.insertBefore(d,si(o,a,n)),l&&_t(l),i.push(f)}for(let a=t.length;a<o.length;a++)_t(o[a]);s.items=i}function si(e,t,n){for(let r=t;r<e.length;r++){let s=ti(e[r]);if(s&&s.parentNode)return s}return n}function Ir(e){for(let t of e.items)_t(t);e.items=[]}function wn(e,t,n,r){if(t.nextSibling===r&&e.parentNode===n)return;let s=document.createDocumentFragment(),o=e;for(;o;){let i=o.nextSibling;if(s.appendChild(o),o===t)break;o=i}n.insertBefore(s,r)}function oi(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 J(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&Pr(t),!e.child)return;let n=e.child;if(n.kind==="repeat")Or(n);else if(n.kind==="array")Ir(n);else if(n.kind==="async-stream")Br(n);else if("strings"in n){let r=e.child;Ve(r),xe(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function ii(e,t){let n=e;n.__untilState&&!ae(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!se(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!ie(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!re(t)&&(n.__keyedKey=void 0),n.__watchSub&&!ce(t)&&Pr(n)}function ai(e,t){let n=e.marker,r=e,s=r.__cacheMap;s||(s=new Map,r.__cacheMap=s);let o=e.child;if(o&&"strings"in o){let a=o;if(N(t)&&a.strings===t.strings){Ce(a,t.values);return}let c=document.createDocumentFragment();wn(a.startNode,a.endNode,c,null),s.set(a.strings,{inst:a,holder:c}),e.child=void 0}if(N(t)){let a=t,c=s.get(a.strings);if(c){s.delete(a.strings),e.child&&J(e),wn(c.inst.startNode,c.inst.endNode,n.parentNode,n),Ce(c.inst,a.values),e.child=c.inst;return}}U(e,t)}function ci(e,t){let n=e,r=n.__untilState,s=n.__untilArgs,o=(u,m)=>!!(Object.is(u,m)||N(u)&&N(m)&&u.strings===m.strings),a=s&&s.length===t.length&&s.every((u,m)=>o(u,t[m]))&&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,f;for(let u=0;u<t.length;u++){let m=t[u];if(!m||typeof m.then!="function"){l=u,f=m;break}}l!==-1&&l<=c.highestResolved?(U(e,f),c.highestResolved=l):l===-1&&!n.__untilEverRendered&&U(e,""),n.__untilEverRendered=!0;let d=Math.min(l===-1?t.length:l,c.highestResolved);for(let u=0;u<d;u++){let m=t[u];!m||typeof m.then!="function"||Promise.resolve(m).then(g=>{c.aborted||u>=c.highestResolved||(c.highestResolved=u,U(e,g))},()=>{})}}function li(e,t){let n=e;if(n.__watchSig===t&&n.__watchSub){let o;n.__watchSub.observe(()=>{o=t.get()}),U(e,o);return}n.__watchSub&&(n.__watchSub.dispose(),n.__watchSub=void 0),n.__watchSig=t;let r=new De.subtle.Watcher(()=>{queueMicrotask(()=>{if(n.__watchSub!==r)return;let o;r.observe(()=>{o=t.get()}),U(e,o)})});n.__watchSub=r;let s;r.observe(()=>{s=t.get()}),U(e,s)}function Pr(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function ui(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="append"&&n.iterable===t.iterable)return;J(e);let r=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=s,$r(s,e,t)}function fi(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="replace"&&n.iterable===t.iterable)return;J(e);let r=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=s,$r(s,e,t)}async function $r(e,t,n){let r=t.marker,s=0;try{for(;!e.aborted;){let o=await e.iterator.next();if(e.aborted||o.done)break;let i=n.mapper?n.mapper(o.value,s):o.value,a=Fr(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),s++}}catch(o){typeof console<"u"&&console.error("[webjs] asyncStream error:",o)}}function Fr(e){if(e==null||e===!1||e===!0)return[];if(N(e)){let t=e,{templateEl:n,parts:r}=St(t),s=n.content.cloneNode(!0),o=r.map(i=>At(i,s));for(let i=0;i<t.values.length;i++)X(o[i],t.values[i],void 0,t.values);return[...s.childNodes]}if(Array.isArray(e)){let t=[];for(let n of e)t.push(...Fr(n));return t}return[document.createTextNode(String(e))]}function Br(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 Ur=null;function Et(e){Ur=e||null}function di(){return Ur||void 0}var qr=Symbol.for("webjs:registry"),Dr=Symbol.for("webjs:classToTag"),vt=globalThis,q=vt[qr]||(vt[qr]=new Map),Hr=vt[Dr]||(vt[Dr]=new WeakMap),Ct=typeof window<"u"&&typeof customElements<"u";function Sn(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=q.get(e);r?(r.cls=t,r.lazy=n):q.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),Hr.set(t,e)}if(Ct){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),Sn(t,n)}}if(!Ct){let e=globalThis;e.customElements||(e.customElements={define(t,n){Sn(t,n)},get(t){return q.get(t)?.cls},upgrade(){},whenDefined(t){let n=q.get(t);return Promise.resolve(n?.cls)}})}function An(e,t){Ct?customElements.define(e,t):Sn(e,t)}function pi(e,t){if(Ct)return;let n=q.get(e);if(n){n.moduleUrl=t;return}q.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e})}function En(e){return q.get(e)?.cls}function hi(e){return q.get(e)?.moduleUrl||null}function mi(e){return q.get(e)?.lazy===!0}function xt(e){return Hr.get(e)}function vn(){return[...q.keys()]}Te();wt();var Jr=typeof window<"u"&&typeof HTMLElement<"u";function Ti(e,t){return e!==t}function Ni(){return{states:new Set,shadowRoot:null,form:null,labels:[],role:"",willValidate:!0,validity:{},validationMessage:"",setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0}}}var kt=class{constructor(){this.__ssrAttrs=new Map,this.__internals=null}get attributes(){return[...this.__ssrAttrs].map(([t,n])=>({name:t,value:n}))}getAttribute(t){let n=this.__ssrAttrs.get(String(t).toLowerCase());return n===void 0?null:n}setAttribute(t,n){this.__ssrAttrs.set(String(t).toLowerCase(),String(n))}removeAttribute(t){this.__ssrAttrs.delete(String(t).toLowerCase())}hasAttribute(t){return this.__ssrAttrs.has(String(t).toLowerCase())}toggleAttribute(t,n){let r=String(t).toLowerCase(),s=this.__ssrAttrs.has(r);return(n===void 0?!s:n)?(this.__ssrAttrs.set(r,""),!0):(this.__ssrAttrs.delete(r),!1)}getAttributeNames(){return[...this.__ssrAttrs.keys()]}closest(t){let n=String(t).trim().toLowerCase();if(!/^[a-z][a-z0-9-]*$/.test(n))return null;if(this.__ssrTag===n)return this;let r=this.__ssrAncestors;if(!Array.isArray(r))return null;for(let s=r.length-1;s>=0;s--)if(r[s]&&r[s].__ssrTag===n)return r[s];return null}get dataset(){if(this.__dataset)return this.__dataset;let t=this,n=r=>"data-"+String(r).replace(/[A-Z]/g,s=>"-"+s.toLowerCase());return this.__dataset=new Proxy({},{get(r,s){if(typeof s!="string")return;let o=t.getAttribute(n(s));return o===null?void 0:o},set(r,s,o){return typeof s=="string"&&t.setAttribute(n(s),o),!0},has(r,s){return typeof s=="string"&&t.hasAttribute(n(s))},deleteProperty(r,s){return typeof s=="string"&&t.removeAttribute(n(s)),!0},ownKeys(){return t.getAttributeNames().filter(r=>r.startsWith("data-")).map(r=>r.slice(5).replace(/-([a-z])/g,(s,o)=>o.toUpperCase()))},getOwnPropertyDescriptor(r,s){if(typeof s=="string"&&t.hasAttribute(n(s)))return{enumerable:!0,configurable:!0,value:t.getAttribute(n(s))}}}),this.__dataset}get className(){return this.getAttribute("class")??""}set className(t){this.setAttribute("class",t)}get hidden(){return this.hasAttribute("hidden")}set hidden(t){this.toggleAttribute("hidden",!!t)}get id(){return this.getAttribute("id")??""}set id(t){this.setAttribute("id",t)}get title(){return this.getAttribute("title")??""}set title(t){this.setAttribute("title",t)}get slot(){return this.getAttribute("slot")??""}set slot(t){this.setAttribute("slot",t)}get role(){return this.getAttribute("role")}set role(t){t==null?this.removeAttribute("role"):this.setAttribute("role",t)}get tabIndex(){let t=this.getAttribute("tabindex");return t===null?-1:Number.parseInt(t,10)||0}set tabIndex(t){this.setAttribute("tabindex",String(t))}addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return this.__internals=Ni(),this.__internals}},ji=["ariaAtomic","ariaAutoComplete","ariaBusy","ariaChecked","ariaColCount","ariaColIndex","ariaColSpan","ariaCurrent","ariaDescription","ariaDisabled","ariaExpanded","ariaHasPopup","ariaHidden","ariaInvalid","ariaKeyShortcuts","ariaLabel","ariaLevel","ariaLive","ariaModal","ariaMultiLine","ariaMultiSelectable","ariaOrientation","ariaPlaceholder","ariaPosInSet","ariaPressed","ariaReadOnly","ariaRequired","ariaRoleDescription","ariaRowCount","ariaRowIndex","ariaRowSpan","ariaSelected","ariaSetSize","ariaSort","ariaValueMax","ariaValueMin","ariaValueNow","ariaValueText"];for(let e of ji){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(kt.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}var Ri=Jr?HTMLElement:kt,Xr=Symbol("webjs.factoryProps"),Gr=new WeakSet,Ne=class e extends Ri{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){An(t,this)}static get observedAttributes(){let t=this.properties||{};return Object.keys(t).filter(n=>!(typeof t[n]=="object"&&t[n].state)).map(n=>typeof t[n]=="object"&&t[n].attribute||Cn(n))}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._assertFactoryProperties(),this._initializeProperties()}_assertFactoryProperties(){let t=this.constructor;if(Gr.has(t))return;let n=t;for(;n&&n!==e;){if(Object.hasOwn(n,"properties")&&!Object.hasOwn(n,Xr)){let r=n.name||"a component";throw new Error(`${r}: \`static properties\` is no longer supported. Declare reactive properties via the factory instead: \`class ${r} extends WebComponent({ count: Number })\`. Use the \`prop()\` helper for options (\`prop(Number, { reflect: true })\`) and set defaults in the constructor after \`super()\`. See https://docs.webjs.dev/docs/components.`)}n=Object.getPrototypeOf(n)}Gr.add(t)}_initializeProperties(){let n=this.constructor.properties;if(!(!n||typeof n!="object")){this.__propValues={};for(let[r,s]of Object.entries(n)){let o=typeof s=="object"?s:{type:s},i=this[r];Object.defineProperty(this,r,{configurable:!0,enumerable:!0,get:()=>this.__propValues[r],set:a=>{let c=this.__propValues[r];(o.hasChanged||Ti)(a,c)&&(this.__propValues[r]=a,o.reflect&&!o.state&&this._connected&&this._reflectAttribute(r,a,o),this.requestUpdate(r,c))}}),i!==void 0?this.__propValues[r]=i:o.default!==void 0&&(this.__propValues[r]=typeof o.default=="function"?o.default():o.default)}}}_reflectAttribute(t,n,r){let s=r.attribute||Cn(t);if(!this.__reflectingAttribute){this.__reflectingAttribute=!0;try{if(r.converter&&r.converter.toAttribute){let o=r.converter.toAttribute(n,r.type);o==null?this.removeAttribute(s):this.setAttribute(s,o)}else r.type===Boolean?n?this.setAttribute(s,""):this.removeAttribute(s):n==null?this.removeAttribute(s):r.type===Object||r.type===Array?this.setAttribute(s,JSON.stringify(n)):this.setAttribute(s,String(n))}finally{this.__reflectingAttribute=!1}}}connectedCallback(){if(!Jr)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 s=n[r].name;s.startsWith("data-webjs-prop-")&&t.push(s)}for(let r of t){let s=this.getAttribute(r);if(this.removeAttribute(r),s==null)continue;let o=Yr(r.slice(16));try{this[o]=V(s)}catch(i){console.warn(`[webjs] failed to decode ${r} on <${this.tagName.toLowerCase()}>: ${i&&i.message}`)}}}_activate(){this._connected=!0,this._reflectDeclaredAttributes();let t=this.constructor;if(t.shadow!==!0&&!this.hasAttribute("data-wj-host")&&this.setAttribute("data-wj-host",""),t.shadow===!0){let n=!!this.shadowRoot;this.shadowRoot||this.attachShadow({mode:"open"}),this._renderRoot=this.shadowRoot;let r=t.styles,s=Array.isArray(r)?r:be(r)?[r]:[];if(s.length){if(n){let o=this.shadowRoot.querySelector("style");o&&o.remove()}Qt(this._renderRoot,s)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${xt(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().`),hn(this)||(this.__isHydrating()?(Y(this),xr(this)):Cr(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&&Tr(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&&Nr(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.properties||{},i,a;for(let[f,d]of Object.entries(o))if(((typeof d=="object"?d:{type:d}).attribute||Cn(f))===t){i=f,a=d;break}if(a===void 0&&(i=Yr(t),a=o[i]||o[t]),a===void 0)return;let c=typeof a=="object"?a:{type:a},l;if(c.converter&&c.converter.fromAttribute)l=c.converter.fromAttribute(r,c.type);else if(c.type===Number)l=r==null?null:Number(r);else if(c.type===Boolean)l=r!=null&&r!=="false";else if(c.type===Object||c.type===Array)try{l=r==null?null:JSON.parse(r)}catch{l=r}else l=r;this[i]!==l&&(this[i]=l,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,r=null;try{if(this.shouldUpdate(t)){this.willUpdate(t);for(let s of this.__controllers)s.hostUpdate&&s.hostUpdate();this.__renderToken=(this.__renderToken||0)+1,this.__renderAbort&&this.__renderAbort.abort(),this.__renderAbort=typeof AbortController<"u"?new AbortController:null,Et(this.__renderAbort?this.__renderAbort.signal:null);try{let s=this.update(t);s&&typeof s.then=="function"&&(r=s)}catch(s){this._handleRenderError(s)}finally{Et(null)}if(!r){for(let s of this.__controllers)s.hostUpdated&&s.hostUpdated();n=!0}}}catch(s){console.error("[webjs] lifecycle hook threw during update phase:",s)}finally{this._isUpdating=!1,(n||r)&&(this._changedProperties=new Map)}if(r){let s=this.__renderToken;this.__pendingAsyncCommits=(this.__pendingAsyncCommits||0)+1,r.then(()=>{if(this.__pendingAsyncCommits--,s===this.__renderToken){for(let o of this.__controllers)o.hostUpdated&&o.hostUpdated();this._postCommit(t)}});return}n?this._postCommit(t):this.__pendingAsyncCommits||this._resolveUpdate()}_resolveUpdate(){if(this._updateResolve){let t=this._changedProperties.size===0;this._updateResolve(t),this._updateResolve=null}}performServerUpdate(){let t=this._changedProperties;this._isUpdating=!0;try{this.willUpdate(t);for(let n of this.__controllers)n.hostUpdate&&n.hostUpdate();this._reflectDeclaredAttributes()}finally{this._isUpdating=!1}}_reflectDeclaredAttributes(){let t=this.constructor.properties||{};for(let n of Object.keys(t)){let r=t[n];!r||!r.reflect||r.state||this._reflectAttribute(n,this[n],r)}}shouldUpdate(t){return!0}willUpdate(t){}update(t){this.__signalWatcher||(this.__signalWatcher=new De.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n;if(this.__signalWatcher.observe(()=>{n=this.render()}),n&&typeof n.then=="function")return this._commitAsync(n);ke(n,this._renderRoot)}_commitAsync(t){let n=this.__renderToken;if(this.__firstRendered&&this._overridesRenderFallback())try{let r=this.renderFallback();r!==void 0&&ke(r,this._renderRoot)}catch(r){console.error("[webjs] renderFallback() threw:",r)}return Promise.resolve(t).then(r=>{n===this.__renderToken&&ke(r,this._renderRoot)},r=>{n===this.__renderToken&&this._handleRenderError(r instanceof Error?r:new Error(String(r)))})}_overridesRenderFallback(){return this.renderFallback!==Tt.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${xt(this.constructor)||this.tagName?.toLowerCase()}>:`,t);try{let n=this.renderError(t);n!==void 0&&ke(n,this._renderRoot)}catch(n){console.error("[webjs] renderError() also threw:",n)}}_postCommit(t){try{this.__firstRendered||(this.__firstRendered=!0,this.firstUpdated(t)),this.updated(t)}catch(n){console.error("[webjs] lifecycle hook threw during post-commit phase:",n)}finally{this._resolveUpdate()}}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){}renderFallback(){}};function Cn(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Yr(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Tt(e){return new.target?Reflect.construct(Ne,arguments,new.target):class extends Ne{static properties=e;static[Xr]=!0}}Object.setPrototypeOf(Tt,Ne);Tt.prototype=Ne.prototype;function Li(e,t={}){return e&&typeof e=="object"&&!("call"in e)&&(t=e,e=void 0),{...e?{type:e}:{},...t}}Be();var Zc=Symbol.for("webjs.suspense");function Oi(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function Nt(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}Te();var xn=null;function Mi(e){xn=e}function kn(){if(!xn)return"";try{return xn()||""}catch{return""}}async function Ii(e,t={ssr:!0}){let n=t&&t.suspenseCtx,r=t&&t.dev!==void 0?t.dev:n&&n.dev;n&&n.dev===void 0&&r!==void 0&&(n.dev=r);let s=await k(e,n);return t&&t.ssr===!1?s:await Q(s,n,[],r)}async function k(e,t){if(e==null||e===!1||e===!0)return"";if(e&&typeof e.then=="function")return e=await e,k(e,t);if(ye(e))return String(e.value??"");if(we(e))return k(e.value,t);if(ce(e))return k(e.signal.get(),t);if(re(e))return k(e.value,t);if(se(e))return k(e.fn(),t);if(_e(e)){let n=e.template;return String(n?.innerHTML??"")}if(oe(e))return"";if(ie(e))return k(e.value,t);if(ae(e)){let n=e.args;for(let r of n)if(!r||typeof r.then!="function")return k(r,t);if(n.length>0)try{let r=await Promise.race(n.map(s=>Promise.resolve(s).catch(()=>{})));return k(r,t)}catch{return""}return""}if(Se(e)||Ae(e))return"";if(Array.isArray(e))return(await Promise.all(e.map(r=>k(r,t)))).join("");if(ne(e)){let n=e;return(await Promise.all(n.items.map((s,o)=>k(n.templateFn(s,o),t)))).join("")}if(Nt(e)){let n=e,r=await k(n.fallback,t);if(t){let s=`s${t.nextId++}`;return t.pending.push({id:s,promise:Promise.resolve(n.children)}),`<webjs-boundary id="${s}">${r}</webjs-boundary>`}return r}return N(e)?Pi(e,t):ct(String(e))}async function Pi(e,t){let{strings:n,values:r}=e,s="",o="text",i="",a=0,c="",l=0,f="",d="";for(let u=0;u<n.length;u++){let m=n[u];for(let g=0;g<m.length;g++){let p=m[g];switch(o){case"text":s+=p,p==="<"&&(o="tag-open");break;case"tag-open":s+=p,p==="!"?o="bang-1":p==="/"?(o="tag-name",f=""):/[a-zA-Z]/.test(p)?(o="tag-name",f=p.toLowerCase()):o="text";break;case"bang-1":s+=p,o=p==="-"?"bang-dash":"tag-name";break;case"bang-dash":s+=p,p==="-"?(o="comment",l=0):o="tag-name";break;case"comment":s+=p,p==="-"?l+=1:(p===">"&&l>=2&&(o="text"),l=0);break;case"tag-name":s+=p,p===">"?(o=jt(f)?"rawtext":"text",o==="rawtext"&&(d="")):/\s/.test(p)?o="in-tag":f+=p.toLowerCase();break;case"in-tag":s+=p,p===">"?(o=jt(f)?"rawtext":"text",o==="rawtext"&&(d="")):!/\s/.test(p)&&p!=="/"&&(o="attr-name",i=p,a=s.length-1);break;case"rawtext":s+=p,d=(d+p.toLowerCase()).slice(-9),(d.endsWith("<\/script>")||d.endsWith("</style>"))&&(o="text",d="",f="");break;case"attr-name":p==="="?(o="after-eq",s+=p):/\s/.test(p)?(o="in-tag",i="",s+=p):p===">"?(o="text",i="",s+=p):(i+=p,s+=p);break;case"after-eq":p==='"'||p==="'"?(o="attr-quoted",c=p,s+=p):/\s/.test(p)?(o="in-tag",i="",s+=p):p===">"?(o="text",i="",s+=p):(o="attr-unquoted",s+=p);break;case"attr-unquoted":/\s/.test(p)?(o="in-tag",i="",s+=p):(p===">"&&(o="text",i=""),s+=p);break;case"attr-quoted":s+=p,p===c&&(o="in-tag",i="");break}}if(u<r.length){let g=r[u];if(g&&typeof g.then=="function"&&(g=await g),o==="comment")s+=String(g??""),l=0;else if(o==="rawtext")s+=String(g??""),d="";else if(o==="text")s+=await k(g,t);else if(o==="after-eq"){let p=i[0],h=i.slice(1),b=ge[p];if(b==="event")s=s.slice(0,a),o="in-tag",i="";else if(b==="prop"){if(s=s.slice(0,a),f==="webjs-suspense"&&h==="fallback"){let y=await k(g,t);s+=`data-webjs-fallback="${$(y)}"`,o="in-tag",i="";continue}if(!f.includes("-")){o="in-tag",i="";continue}if(g===void 0){o="in-tag",i="";continue}try{let y=await Ye(g);s+=`data-webjs-prop-${Xi(h)}="${$(y)}"`}catch(y){console.warn(`[webjs] property binding .${h} has an unserializable value during SSR. Dropping. The browser will see the property as undefined. Detail: ${y&&y.message}`)}o="in-tag",i=""}else b==="bool"?(s=s.slice(0,a),g&&(s+=`${h}=""`),o="in-tag",i=""):(s+=`"${$(String(g??""))}"`,o="in-tag",i="")}else(o==="attr-quoted"||o==="attr-unquoted")&&(s+=$(String(g??"")))}}return s}var $i=new Set(["document","window","localStorage","sessionStorage","navigator","matchMedia","requestAnimationFrame","getComputedStyle","IntersectionObserver","MutationObserver","ResizeObserver"]),Fi=new Set(["attachShadow","querySelector","querySelectorAll","getBoundingClientRect","focus","blur","scrollIntoView"]);function Bi(e){let t=e&&typeof e.message=="string"?e.message:"",n=/^(\w+) is not defined\b/.exec(t);return e instanceof ReferenceError&&n&&$i.has(n[1])?`\`${n[1]}\` is a browser-only global and is undefined during SSR.`:(n=/\.(\w+) is not a function\b/.exec(t),e instanceof TypeError&&n&&Fi.has(n[1])?`\`${n[1]}\` is an HTMLElement method that does not exist on the server-side component instance during SSR.`:null)}function Ui(){return typeof process<"u"&&process.env&&!0}function ts(e,t,n){if(!(n===void 0?!Ui():!!n))return"";let s=t&&t.message?t.message:String(t);return Zt`<div data-webjs-error="${e}" style="border:1px solid #f5c2c7;background:#f8d7da;color:#842029;padding:8px 12px;border-radius:6px;font:13px/1.4 system-ui,sans-serif">
1
+ var to=Object.defineProperty;var J=(e,t)=>()=>(e&&(t=e(e=0)),t);var lr=(e,t)=>{for(var n in t)to(e,n,{get:t[n],enumerable:!0})};function Sr(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}function No(){yr||(fn=Sr(),fn&&(Ke=HTMLSlotElement.prototype.assignedNodes,ln=HTMLSlotElement.prototype.assignedElements,bt=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(t){return this.hasAttribute(q)&&!wr(this)?dn(this,t):Ke?Ke.call(this,t):[]},HTMLSlotElement.prototype.assignedElements=function(t){return this.hasAttribute(q)&&!wr(this)?dn(this,t).filter(n=>n.nodeType===1):ln?ln.call(this,t):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let t=bt&&bt.get?bt.get.call(this):null;return t||jo(this)}}),yr=!0))}function wr(e){let t=e;for(let n=0;n<128;n++){let r=t.parentNode;if(!r||r===t)return!1;if(r.nodeType===11&&r.host)return!0;t=r}return!1}function dn(e,t){if(e.getAttribute(K)===Ar)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:pn(n,new Set,0)}function pn(e,t,n){if(n>=vo)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(q)){let i=dn(s,{flatten:!1});if(i.length>0)for(let a of pn(i,t,n+1))r.push(a);else for(let a of pn(Array.from(s.childNodes),t,n+1))r.push(a)}else if(Ke){let i=Ke.call(s,{flatten:!0});for(let a of i)r.push(a)}else r.push(o)}else r.push(o);return r}function jo(e){let t=e.parentElement;for(;t;){if(t.tagName==="SLOT"&&t.hasAttribute(q))return t.getAttribute(K)===de?t:null;t=t.parentElement}return null}function Z(e){let t=e,n=t[D];return n||(n={assignedByName:new Map,lastSnapshot:new WeakMap},t[D]=n),n}function hn(e){return!!e[D]}function Er(e){let t=Z(e);for(;e.firstChild;){let n=e.firstChild,r=Ro(n);Lo(t.assignedByName,r,n),e.removeChild(n)}}function Cr(e){let t=Z(e),n=e.querySelectorAll(`slot[${q}]`);for(let r of n){let o=r;if(o.getAttribute(K)!==de)continue;let s=ve(o.getAttribute("name"));if(!t.assignedByName.has(s)){let i=Array.from(o.childNodes);t.assignedByName.set(s,i),t.lastSnapshot.set(o,i.slice())}}}function ve(e){return e==null||e===""||e==="default"?null:e}function Ro(e){return e.nodeType!==1?null:ve(e.getAttribute("slot"))}function Lo(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}function xr(e){let t={},n=e[D];if(!n)return t;for(let[r,o]of n.assignedByName)t[r??"default"]=o.slice();return t}function Tr(e,t){let n=e[D];if(!n)return!1;let r=n.assignedByName.get(ve(t));return!!(r&&r.length)}function Ne(e,t,n){let r=Z(e),o=ve(t),s=Oo(e,n);s.length?r.assignedByName.set(o,s):r.assignedByName.delete(o),mn(e)}function Oo(e,t){if(t==null)return[];if(typeof t=="string"){let n=e.ownerDocument||(typeof document<"u"?document:null);return n?[n.createTextNode(t)]:[]}return Array.isArray(t)?t.filter(Boolean):[t]}function mn(e){if(!fn)return;let t=e[D];if(!t)return;let n=[];for(let s of e.querySelectorAll(`slot[${q}]`))Io(e,s)&&n.push(s);let r=new Map;for(let s of n){let i=ve(s.getAttribute("name")),a=r.get(i);a||(a=[],r.set(i,a)),a.push(s)}let o=[];for(let[s,i]of r){let a=t.assignedByName.get(s)||[];for(let c=0;c<i.length;c++){let l=i[c];c===0&&a.length>0?Mo(t,l,a)&&o.push(l):Po(t,l)&&o.push(l)}}for(let s of o)$o(s)}function Io(e,t){for(let n=t.parentElement;n&&n!==e;n=n.parentElement)if(n.tagName.includes("-"))return!1;return!0}function Mo(e,t,n){let r=t.getAttribute(K)!==de,o=e.lastSnapshot.get(t)||[];if(!r&&un(o,n))return!1;if(!r&&un(Array.from(t.childNodes),n))return e.lastSnapshot.set(t,n.slice()),!un(o,n);let i=t[gt];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(K,de),e.lastSnapshot.set(t,n.slice()),!0}function Po(e,t){let n=t.getAttribute(K)===de;if(t.setAttribute(K,Ar),!n)return _r(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return _r(t),!0}function _r(e){let t=e[gt];!t||t.childNodes.length===0||e.appendChild(t)}function kr(e,t){if(!hn(e))return;let n=Z(e),r=ve(t.getAttribute("name")),o=n.assignedByName.get(r);if(o)for(let s of o)s.parentNode===t&&t.removeChild(s);n.lastSnapshot.delete(t)}function $o(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function un(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 fn,D,q,K,de,Ar,gt,vo,Ke,ln,bt,yr,Ge=J(()=>{fn=Sr(),D=Symbol("webjs.slot.state"),q="data-webjs-light",K="data-projection",de="actual",Ar="fallback",gt=Symbol("webjs.slot.fallbackFrag"),vo=64,Ke=null,ln=null,bt=null,yr=!1;No()});function Dr(e,t,n){ci.has(t)?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}async function Ze(e){return JSON.stringify(await qr(e))}function G(e){return Hr(JSON.parse(e))}async function qr(e){let t=li();return await ui(e,t),pe(e,t)}function Hr(e){return te(e,hi())}function li(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map,fdEntries:new Map}}async function ui(e,t){let n=[e];for(;n.length;){let r=n.pop();if(!bi(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){let s=t.fdEntries.get(r)||[...r.entries()];t.fdEntries.set(r,s);for(let[,i]of s)typeof i!="string"&&n.push(i);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(gi(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 pe(e,t){if(e===null)return null;if(e===void 0)return{[k]:"undef"};let n=typeof e;if(n==="string"||n==="boolean")return e;if(n==="number")return Number.isNaN(e)?{[k]:"NaN"}:e===1/0?{[k]:"Inf"}:e===-1/0?{[k]:"-Inf"}:Object.is(e,-0)?{[k]:"-0"}:e;if(n==="bigint")return{[k]:"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{[k]:"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{[k]:"Ref",v:r};r!==void 0&&t.emitted.add(r);let o;if(e instanceof Date)o={[k]:"Date",v:Number.isNaN(e.getTime())?null:e.toISOString()};else if(e instanceof Error)o={[k]:"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={[k]:"File",v:Xe(s),n:e.name,t:e.type||"",m:e.lastModified}:o={[k]:"Blob",v:Xe(s),t:e.type||""}}else if(typeof FormData<"u"&&e instanceof FormData){let s=t.fdEntries.get(e)||[...e.entries()],i=[];for(let[a,c]of s)i.push([a,pe(c,t)]);o={[k]:"FD",v:i}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)o=fi(e);else if(e instanceof Map){let s=[];for(let[i,a]of e)s.push([pe(i,t),pe(a,t)]);o={[k]:"Map",v:s}}else if(e instanceof Set){let s=[];for(let i of e)s.push(pe(i,t));o={[k]:"Set",v:s}}else if(Array.isArray(e))o=e.map(s=>pe(s,t));else{o={};for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;let i=yi(s)?"_"+s:s;Dr(o,i,pe(e[s],t))}}if(r!==void 0){if(Array.isArray(o))return{[k]:"Arr",_id:r,v:o};o._id=r}return o}function fi(e){if(e instanceof ArrayBuffer)return{[k]:"buf",v:Xe(new Uint8Array(e))};if(e instanceof DataView)return{[k]:"dv",v:Xe(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=di[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[k]:n,v:Xe(r)}}function hi(){return{refs:new Map}}function te(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(te(e[i],t));return s}let n=e[k];if(typeof n=="string")return mi(e,n,t);let r={},o=e._id;typeof o=="number"&&t.refs.set(o,r);for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s)||s==="_id")continue;let i=wi(s)?s.slice(1):s;Dr(r,i,te(e[s],t))}return r}function mi(e,t,n){let r=e._id,o=s=>(typeof r=="number"&&n.refs.set(r,s),s);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 o(BigInt(e.v));case"Sym":return o(Symbol.for(e.v));case"Date":return o(e.v==null?new Date(NaN):new Date(e.v));case"Error":{let s=new Error(e.v.message);return s.name=e.v.name,e.v.stack&&(s.stack=e.v.stack),typeof r=="number"&&n.refs.set(r,s),s}case"Map":{let s=new Map;typeof r=="number"&&n.refs.set(r,s);for(let[i,a]of e.v)s.set(te(i,n),te(a,n));return s}case"Set":{let s=new Set;typeof r=="number"&&n.refs.set(r,s);for(let i of e.v)s.add(te(i,n));return s}case"Arr":{let s=[];typeof r=="number"&&n.refs.set(r,s);for(let i of e.v)s.push(te(i,n));return s}case"Ref":{let s=n.refs.get(e.v);if(s===void 0)throw new TypeError(`Dangling reference: id=${e.v}`);return s}case"Blob":{if(typeof Blob>"u")throw new TypeError("Blob is not available in this environment.");let s=Je(e.v);return o(new Blob([s],{type:e.t||""}))}case"File":{if(typeof File>"u")throw new TypeError("File is not available in this environment.");let s=Je(e.v);return o(new File([s],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 s=new FormData;o(s);for(let[i,a]of e.v){let c=te(a,n);s.append(i,c)}return s}default:{if(t==="buf"){let i=Je(e.v);return o(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength))}if(t==="dv"){let i=Je(e.v);return o(new DataView(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)))}let s=pi[t];if(s){let i=Je(e.v),a=i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength);return o(new s(a))}throw new TypeError(`Unknown serialization tag: ${t}`)}}}function bi(e){return e!==null&&typeof e=="object"}function gi(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function yi(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function wi(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}function Xe(e){if(Wr)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 Je(e){if(Wr){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 k,ci,di,pi,Wr,Oe=J(()=>{k="_$wj",ci=new Set(["__proto__","constructor","prototype"]);di={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},pi={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};Wr=typeof Buffer<"u"&&typeof Buffer.from=="function"});var os={};lr(os,{observeLazy:()=>oa,observeViewportOnce:()=>ca});function ss(e){let t=Nn.get(e);return t||(t=import(e).finally(()=>Nn.delete(e)),Nn.set(e,t),t)}function oa(e){for(let[t,n]of Object.entries(e))he.set(t.toLowerCase(),n);if(typeof IntersectionObserver>"u"){for(let t of he.values())ss(t);he.clear();return}nt||(nt=new IntersectionObserver(ia,{rootMargin:"200px"})),rs(),typeof MutationObserver<"u"&&new MutationObserver(()=>rs()).observe(document.body,{childList:!0,subtree:!0})}function rs(){if(!(!nt||!he.size))for(let e of he.keys())for(let t of document.querySelectorAll(e))nt.observe(t)}function ia(e){for(let t of e){if(!t.isIntersecting)continue;let n=t.target.tagName.toLowerCase(),r=he.get(n);r&&(ss(r),he.delete(n),nt?.unobserve(t.target))}}function aa(e){for(let t of e){if(!t.isIntersecting)continue;let n=jt.get(t.target);jt.delete(t.target),tt?.unobserve(t.target),n&&n()}}function ca(e,t){return typeof IntersectionObserver>"u"?(t(),()=>{}):(tt||(tt=new IntersectionObserver(aa,{rootMargin:"200px"})),jt.set(e,t),tt.observe(e),()=>{jt.delete(e),tt?.unobserve(e)})}var he,nt,Nn,tt,jt,is=J(()=>{he=new Map,nt=null,Nn=new Map;tt=null,jt=new WeakMap});var jn,Rn=J(()=>{jn=typeof HTMLElement<"u"?class extends HTMLElement{constructor(){super(),this._webjsLoadedSrc=null,this._webjsLazyTeardown=null}static get observedAttributes(){return["src"]}connectedCallback(){this._webjsScheduleLoad()}disconnectedCallback(){this._webjsLazyTeardown&&(this._webjsLazyTeardown(),this._webjsLazyTeardown=null)}attributeChangedCallback(t,n,r){t==="src"&&this.isConnected&&this._webjsScheduleLoad()}_webjsScheduleLoad(){let t=this.getAttribute("src");if(!t){this._webjsLazyTeardown&&(this._webjsLazyTeardown(),this._webjsLazyTeardown=null),this._webjsLoadedSrc=null;return}let n=t;try{n=new URL(t,location.href).href}catch{}if(n===this._webjsLoadedSrc)return;this._webjsLazyTeardown&&(this._webjsLazyTeardown(),this._webjsLazyTeardown=null),(this.getAttribute("loading")||"eager").toLowerCase()==="lazy"?(this._webjsLoadedSrc=n,Promise.resolve().then(()=>(is(),os)).then(({observeViewportOnce:o})=>{this._webjsLoadedSrc!==n||!this.isConnected||(this._webjsLazyTeardown=o(this,()=>{this._webjsLazyTeardown=null,this._webjsLoad(n)}))})):(this._webjsLoadedSrc=n,this._webjsLoad(n))}_webjsLoad(t){Promise.resolve().then(()=>(Ln(),as)).then(({loadFrame:n})=>{this._webjsLoadedSrc!==t||!this.isConnected||n(this,t)})}}:null;typeof customElements<"u"&&jn&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",jn)});function ua(e,t,n){switch(e){case"append":n&&t.append(n);break;case"prepend":n&&t.prepend(n);break;case"before":n&&t.before(n);break;case"after":n&&t.after(n);break;case"replace":n&&t.replaceWith(n);break;case"update":n&&t.replaceChildren(n);break;case"remove":t.remove();break;default:break}}function In(e,t){let n=t||(typeof document<"u"?document:null);if(!n)return;let r=null;if(typeof e=="string"){let s=n.createElement("template");s.innerHTML=e,r=s.content}else if(e&&e.nodeType)r=e;else return;let o=r.querySelectorAll?Array.from(r.querySelectorAll("webjs-stream")):[];if(o.length)for(let s of o)n.body.append(s);else n.body.append(r)}var la,On,Rt=J(()=>{la=new Set(["append","prepend","before","after","replace","update"]);On=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this._webjsApplied||(this._webjsApplied=!0,this._webjsApply())}_webjsApply(){let t=(this.getAttribute("action")||"").toLowerCase(),n=this.ownerDocument||document,r=[],o=this.getAttribute("target");if(o){let i=n.getElementById(o);i&&(r=[i])}else{let i=this.getAttribute("targets");if(i)try{r=Array.from(n.querySelectorAll(i))}catch{r=[]}}let s=la.has(t)?this.querySelector("template"):null;try{for(let i of r){let a=s?s.content.cloneNode(!0):null;ua(t,i,a)}}finally{this.remove()}}}:null;typeof customElements<"u"&&On&&!customElements.get("webjs-stream")&&customElements.define("webjs-stream",On)});var cs,ls=J(()=>{cs=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this.style.display||(this.style.display="contents")}}:null;typeof customElements<"u"&&cs&&!customElements.get("webjs-suspense")&&customElements.define("webjs-suspense",cs)});function Lt(e){let t=e||(typeof document<"u"?document:null);if(!(!t||typeof t.querySelectorAll!="function")){for(let n of t.querySelectorAll('script[type="application/json"]#__webjs-seeds, script[type="application/json"][data-webjs-seeds]'))fs(n.textContent,n);for(let n of t.querySelectorAll("[data-webjs-seed]"))fs(n.getAttribute("data-webjs-seed"),n,()=>n.removeAttribute("data-webjs-seed"))}}function fs(e,t,n){if(e)try{let r=G(e);if(r&&typeof r=="object")for(let o in r)rt.has(o)||rt.set(o,r[o])}catch{}n?n():t.remove?.()}function fa(e,t,n){us||(us=!0,Lt());let r=`${e}/${t}/${n}`;if(rt.has(r)){let o=rt.get(r);return rt.delete(r),o}return ds}var rt,ds,us,Mn=J(()=>{Oe();rt=new Map,ds=Symbol("webjs.seed.miss"),us=!1});var as={};lr(as,{_FRAME_TOP:()=>ks,_LIVE_ATTRS:()=>Hn,_activeFrameId:()=>Ts,_addNewHeadElements:()=>Wn,_applyStreamedResolve:()=>Js,_applySwap:()=>tr,_blurOutgoingFocus:()=>Mt,_buildHaveHeader:()=>Zn,_buildSubmitFormData:()=>Cs,_bumpNavToken:()=>qa,_clearFormBusy:()=>Ds,_clearFrameBusy:()=>Bs,_collectBoundaries:()=>De,_currentPageUrl:()=>Ha,_diffElementInPlace:()=>qt,_eligibleAnchorHref:()=>$t,_findAnchorInPath:()=>xs,_getSubmitAction:()=>Es,_getSubmitMethod:()=>As,_isNonHtmlPath:()=>Ka,_keyOf:()=>Ue,_markFormBusy:()=>Us,_markFrameBusy:()=>Fs,_mergeHead:()=>Ks,_navToken:()=>Da,_onPopState:()=>Kn,_onSubmit:()=>Gn,_parseHTML:()=>zn,_planBoundarySwap:()=>Ns,_prefetch:()=>qe,_prefetchCache:()=>R,_prefetchHasHoverPointer:()=>Os,_prefetchInflightSize:()=>Ba,_prefetchMode:()=>Ft,_prefetchPeek:()=>Fa,_prefetchSaysSaveData:()=>Qn,_prefetchSuppressed:()=>Is,_prefetchTake:()=>Ms,_reactivateScripts:()=>ct,_readStreamedShell:()=>Gs,_reconcileChildren:()=>Vt,_regraftPermanentElements:()=>Hs,_regraftPermanentInSlice:()=>zt,_resetParseProbe:()=>pa,_resetPrefetch:()=>Ua,_resetWarnOnce:()=>za,_resolveTargetFrameId:()=>Yn,_restoreOptimistic:()=>st,_runWithTransition:()=>It,_setCurrentPageUrl:()=>Wa,_shouldFullLoadDuringParse:()=>Va,_snapshotCache:()=>M,_streamBoundariesProgressively:()=>Xs,_takeResolveUnit:()=>Ys,_viewTransitionsEnabled:()=>qs,collectBoundaries:()=>De,disableClientRouter:()=>ys,enableClientRouter:()=>Vn,loadFrame:()=>ba,navigate:()=>ws,planBoundarySwap:()=>Ns,revalidate:()=>_s});function zn(e){if(!/^\s*(?:<!doctype|<html)/i.test(e)&&typeof document<"u"&&document.implementation)try{let n=document.implementation.createHTMLDocument();if(typeof n.body.setHTMLUnsafe=="function")n.body.setHTMLUnsafe(e);else{let r=n.createElement("template");r.innerHTML=e,n.body.appendChild(r.content)}return n}catch{}return typeof Document<"u"&&typeof Document.parseHTMLUnsafe=="function"&&da()?Document.parseHTMLUnsafe(e):ha(e)}function da(){if(Me!==null)return Me;try{Me=Document.parseHTMLUnsafe("<!doctype html><body><!--c--><i></i>")?.body?.firstChild?.nodeType===8}catch{Me=!1}return Me}function pa(){Me=null}function ha(e){return typeof DOMParser>"u"?null:new DOMParser().parseFromString(e,"text/html")}function ma(){Pn||typeof MutationObserver>"u"||typeof customElements>"u"||(Pn=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)}}),Pn.observe(document.body,{childList:!0,subtree:!0}))}function Vn(){se||typeof document>"u"||(se=!0,document.addEventListener("click",Ss,!1),document.addEventListener("submit",Gn,!1),window.addEventListener("popstate",Kn),document.addEventListener("pointerover",Be,!0),document.addEventListener("focusin",Be,!0),document.addEventListener("touchstart",Be,{capture:!0,passive:!0}),document.addEventListener("pointerout",Ps,!0),document.addEventListener("webjs:navigate",qn),ma(),qn(),typeof history<"u"&&"scrollRestoration"in history&&(Ot=history.scrollRestoration,history.scrollRestoration="manual"),typeof location<"u"&&(z=location.href))}function ys(){se&&(se=!1,document.removeEventListener("click",Ss,!1),document.removeEventListener("submit",Gn,!1),window.removeEventListener("popstate",Kn),document.removeEventListener("pointerover",Be,!0),document.removeEventListener("focusin",Be,!0),document.removeEventListener("touchstart",Be,{capture:!0}),document.removeEventListener("pointerout",Ps,!0),document.removeEventListener("webjs:navigate",qn),Wt(),er(),re&&(re.disconnect(),re=null),typeof history<"u"&&Ot!==null&&(history.scrollRestoration=Ot,Ot=null),z=null)}async function ws(e,t){let n=new URL(e,location.href);if(n.origin!==location.origin){location.href=e;return}await Xn(n.href,t?.replace??!1,null)}async function ba(e,t){if(typeof location>"u")return{ok:!1,status:null,aborted:!1};let n=e&&e.id;if(!n)return{ok:!1,status:null,aborted:!1};let r=new URL(t,location.href);if(r.origin!==location.origin)return{ok:!1,status:null,aborted:!1};$&&$.abort(),$=new AbortController;let o=$.signal,s=++I;return Bt(r.href,n,!1,null,"GET",null,o,s)}function _s(e){if(!e){M.clear(),R.clear();return}let t=new URL(e,location.href),n=t.pathname+t.search;M.delete(n),R.delete(n)}function Ss(e){if(!se||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=xs(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||Ht.test(r.pathname))return;e.preventDefault();let o=Yn(t);Xn(n,!1,o)}function Kn(e){Xn(location.href,!0,null)}function Gn(e){if(!se||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=As(t,n);if(o==="dialog")return;let s=Es(t,n),i;try{i=new URL(s,location.href)}catch{return}if(i.origin!==location.origin||Ht.test(i.pathname))return;let a=Cs(t,n);e.preventDefault();let c=Yn(n||t);wa(i.href,o,a,c,t)}function As(e,t){return(t&&t.getAttribute("formmethod")||e.getAttribute("method")||"get").toLowerCase()}function Es(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function Cs(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 xs(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function Ts(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 Yn(e){if(!e)return null;let t=e.closest&&e.closest("[data-webjs-frame]"),n=t?t.dataset?t.dataset.webjsFrame:t.getAttribute("data-webjs-frame"):null;if(n!=null&&n!==""){if(n===ks)return null;let r=typeof document<"u"?document.getElementById(n):null;return r&&r.tagName&&r.tagName.toLowerCase()==="webjs-frame"?n:(Jn(`webjs:frame-unresolved:${n}`,`[webjs] data-webjs-frame="${n}" did not match a live <webjs-frame id="${n}">; performing a normal navigation instead.`),null)}return Ts(e)}function Jn(e,t){Fn.has(e)||(Fn.add(e),typeof console<"u"&&console.warn&&console.warn(t))}function vs(e,t){return!e&&!t&&typeof document<"u"&&document.readyState==="loading"}function Bn(e,t){typeof process<"u"&&process.env||Jn(`fallback:${e}`,`[webjs] client router fell back to a full page load (${e}) navigating to ${t}. This is correct (no DOM corruption), just not a soft nav.`)}function hs(){if(typeof process<"u"&&process.env||Un||typeof document>"u"||typeof getComputedStyle!="function")return;let e=document.documentElement;if(!e)return;Un=!0;let t;try{t=getComputedStyle(e).scrollBehavior}catch{return}t==="smooth"&&Jn("scroll-behavior-smooth-html","[webjs] Detected `scroll-behavior: smooth` on <html>. The client router scrolls to the top instantly on navigation (like a native page load), so route transitions are not affected by it. It still applies to in-page #anchor links. Pairing it with a sticky `backdrop-filter` header can also flash on iOS during navigation.")}function Pt(e){if(typeof document>"u")return;let t=document.documentElement;if(!(!t||!t.hasAttribute("data-webjs-nav-progress")))try{e?t.setAttribute("data-navigating",""):t.removeAttribute("data-navigating")}catch{}}function De(e){let t=new Map,n=[],r=!1;function o(s){if(!r){if(s.nodeType===8){let i=s.data.trim();if(i.startsWith("wj:children:")){let a=i.slice(12),c=a.lastIndexOf(":");if(c<=0||c===a.length-1){r=!0;return}let l=a.slice(0,c),h=a.slice(c+1);if(t.has(l)||n.some(f=>f.segment===l)){r=!0;return}n.push({segment:l,routeKey:h,start:s});return}if(i.startsWith("/wj:children")){let a=i.slice(12).replace(/^:/,""),c=n.pop();if(!c||c.segment!==a){r=!0;return}if(c.start.parentNode!==s.parentNode){r=!0;return}{let l=c.start.parentNode.tagName;if(l==="TABLE"||l==="TBODY"||l==="THEAD"||l==="TFOOT"||l==="TR"){r=!0;return}}t.set(c.segment,{routeKey:c.routeKey,start:c.start,end:s});return}return}if(s.hasChildNodes&&s.hasChildNodes())for(let i=s.firstChild;i&&!r;i=i.nextSibling)o(i)}}return o(e),r||n.length>0?null:t}function Ns(e,t){let n=[...e.keys()].filter(i=>t.has(i)).sort((i,a)=>i.length-a.length);if(n.length===0)return null;for(let i of n)if(e.get(i).routeKey!==t.get(i).routeKey){let a=null;for(let c of n){if(c===i)break;i.startsWith(c==="/"?c:c+"/")&&(a=c)}return a?{mode:"replace",segment:a,live:e.get(a),incoming:t.get(a)}:null}let r=n[n.length-1],o=i=>{let a=null;for(let c of i.keys())(a===null||c.length>a.length)&&(a=c);return a};return{mode:o(e)===r&&o(t)===r?"morph":"replace",segment:r,live:e.get(r),incoming:t.get(r)}}function js(e){let t=ye(e);document.dispatchEvent(new CustomEvent("webjs:before-cache",{detail:{url:e}})),M.has(t)&&M.delete(t);let n={html:document.documentElement.outerHTML,scrollX:typeof window<"u"&&window.scrollX||0,scrollY:typeof window<"u"&&window.scrollY||0};for(M.set(t,n);M.size>ga;){let r=M.keys().next().value;M.delete(r)}}function ya(e){let t=ye(e),n=M.get(t);return n==null?null:(M.delete(t),M.set(t,n),typeof n=="string"?{html:n,scrollX:0,scrollY:0}:n)}function ye(e){let t=new URL(e,location.href);return t.pathname+t.search}async function Xn(e,t,n){if(vs(t,n)&&typeof location<"u"){Bn("readyState-loading",e),location.href=e;return}$&&$.abort(),$=new AbortController;let r=$.signal,o=++I;z&&js(z);let s=setTimeout(()=>{Pt(!0),s=null},150),i=null;t||(i=Ws());try{if(t){let a=ya(e);if(a){let c=zn(a.html);if(c){tr(c,n,!0,null),typeof window<"u"&&window.scrollTo({left:a.scrollX,top:a.scrollY,behavior:"instant"}),Bt(e,n,!1,i,"GET",null,r,o,!0).catch(()=>{});return}}typeof window<"u"&&window.scrollTo({left:0,top:0,behavior:"instant"})}await Bt(e,n,!t,i,"GET",null,r,o)}finally{s&&clearTimeout(s),o===I&&(Pt(!1),typeof location<"u"&&(z=location.href))}}async function wa(e,t,n,r,o){$&&$.abort(),$=new AbortController;let s=$.signal,i=++I,a=t==="get"||t==="head",c=new URL(e,location.href);if(a){c.search="";for(let[b,g]of n)c.searchParams.append(b,typeof g=="string"?g:g.name)}z&&js(z);let l=setTimeout(()=>{Pt(!0),l=null},150),h=Ws(),f=o?Us(o,i,c.href):null,u=!1;try{let b=await Bt(c.href,r,!0,h,a?"GET":t.toUpperCase(),a?null:n,s,i);u=!!(b&&b.ok),!a&&i===I&&(M.clear(),R.clear())}finally{f&&Ds(f,i,c.href,u),l&&clearTimeout(l),i===I&&(Pt(!1),typeof location<"u"&&(z=location.href))}}function Zn(){let e=De(document.body);return e?[...e.entries()].map(([t,n])=>`${t}:${n.routeKey}`).join(","):""}function Qn(){try{let e=typeof navigator<"u"?navigator.connection:null;if(e&&(e.saveData===!0||typeof e.effectiveType=="string"&&/2g$/.test(e.effectiveType))||typeof matchMedia=="function"&&matchMedia("(prefers-reduced-data: reduce)").matches)return!0}catch{}return!1}function Os(){try{if(typeof matchMedia=="function")return matchMedia("(hover: hover) and (pointer: fine)").matches}catch{}return!0}function Ca(e){let t=e.getAttribute("rel");return t?t.toLowerCase().split(/\s+/).filter(Boolean):[]}function $t(e){if(!e||!(e instanceof HTMLAnchorElement)||e.hasAttribute("download")||e.hasAttribute("data-no-router")||e.target&&e.target!=="_self")return null;let t=e.href;if(!t)return null;let n;try{n=new URL(t)}catch{return null}return n.origin!==location.origin||n.pathname===location.pathname&&n.search===location.search&&n.hash||Ht.test(n.pathname)?null:t}function Is(e){if(e.hasAttribute("data-no-prefetch"))return!0;let t=Ca(e);return t.includes("external")||t.includes("no-prefetch")}function Ft(e){if(Is(e))return"none";switch((e.getAttribute("data-prefetch")||"").toLowerCase().trim()){case"false":case"none":return"none";case"true":case"render":return"render";case"auto":case"viewport":return"viewport";case"intent":return"intent";default:return Os()?"intent":"viewport"}}function qe(e){if(!se||typeof fetch!="function"||Qn())return;let t=ye(e);if(me.has(t)||ot.has(t))return;let n=R.get(t);if(n&&Dn()-n.at<Rs)return;if(me.size>=Ls){for(ot.add(t),$e.push(e);$e.length>Sa;){let s=$e.shift();ot.delete(ye(s))}return}let r=Zn();if(!r&&typeof document<"u"&&document.readyState==="loading")return;me.add(t);let o={"x-webjs-router":"1","x-webjs-prefetch":"1"};r&&(o["x-webjs-have"]=r),fetch(e,{method:"GET",headers:o,credentials:"same-origin"}).then(async s=>{let i=s.headers.get("content-type")||"";if(!/^text\/html\b/i.test(i)||s.status>=400)return;let a=s.headers.get("x-webjs-build"),c=s.headers.get("x-webjs-src"),l=typeof document<"u"?document.querySelector('script[type="importmap"]'):null,h=l?l.getAttribute("data-webjs-build"):null,f=l?l.getAttribute("data-webjs-src"):null;(a&&h&&a!==h||c&&f&&c!==f)&&(M.clear(),R.clear());let u=s.redirected&&s.url?s.url:e,b=await s.text();Ta(t,{html:b,build:a,src:c,finalUrl:u,at:Dn()})}).catch(()=>{}).finally(()=>{me.delete(t),xa()})}function xa(){for(;$e.length&&me.size<Ls;){let e=$e.shift();ot.delete(ye(e)),qe(e)}}function Ta(e,t){for(R.has(e)&&R.delete(e),R.set(e,t);R.size>_a;){let n=R.keys().next().value;R.delete(n)}typeof document<"u"&&document.dispatchEvent(new CustomEvent("webjs:prefetch",{detail:{url:t.finalUrl,key:e,from:"prefetch"}}))}function Ms(e){let t=ye(e),n=R.get(t);return!n||(R.delete(t),Dn()-n.at>=Rs)?null:n}function Dn(){try{if(typeof performance<"u"&&typeof performance.now=="function")return performance.now()}catch{}return 0}function Be(e){if(!se)return;let t=$s(e.target);if(!t)return;let n=Ft(t);if(n==="none"||n==="render")return;let r=$t(t);if(r){if(e.type==="touchstart"){qe(r);return}n==="intent"&&(it===t&&Fe||(Wt(),it=t,Fe=setTimeout(()=>{Fe=null,it=null,qe(r)},Aa)))}}function Ps(e){let t=$s(e.target);t&&t===it&&Wt()}function Wt(){Fe&&(clearTimeout(Fe),Fe=null),it=null}function er(){for(let e of at)clearTimeout(e);at.clear(),Pe=new WeakMap}function $s(e){let t=e;for(;t;){if(t instanceof HTMLAnchorElement)return t;let n=t.nodeType===1?t:null;if(n){let o=n.closest&&n.closest("a");if(o instanceof HTMLAnchorElement)return o}let r=t.getRootNode?t.getRootNode():null;t=r&&r.host?r.host:null}return null}function qn(){if(typeof document>"u"||Qn())return;let e=typeof IntersectionObserver<"u";e&&(re?(re.disconnect(),er()):re=new IntersectionObserver(t=>{for(let n of t){let r=n.target;if(n.isIntersecting){if(Pe.has(r))continue;let o=setTimeout(()=>{at.delete(o),Pe.delete(r),re.unobserve(r);let s=$t(r);s&&Ft(r)==="viewport"&&qe(s)},Ea);Pe.set(r,o),at.add(o)}else{let o=Pe.get(r);o&&(clearTimeout(o),at.delete(o),Pe.delete(r))}}},{threshold:.5}));for(let t of document.querySelectorAll("a[href]")){let n=Ft(t);if(n==="render"){let r=$t(t);r&&qe(r)}else n==="viewport"&&e&&re.observe(t)}}function ka(e){if(typeof document>"u"||!document.body)return!1;let t=De(document.body);if(!t)return!1;let n,r=-1;for(let[c,l]of t)c.length>r&&(r=c.length,n=l);if(!n)return!1;let o=n.start.parentNode;if(!o||n.start.parentNode!==n.end.parentNode)return!1;let s=document.createElement("div");s.setAttribute("role","alert"),s.setAttribute("data-webjs-nav-error","");let i=e?`This page could not be loaded. (status ${e})`:"This page could not be loaded.";s.textContent=i;let a=document.createRange();return a.setStartAfter(n.start),a.setEndBefore(n.end),a.deleteContents(),o.insertBefore(s,n.end),!0}function $n(e,t,n){let r=new CustomEvent("webjs:navigation-error",{bubbles:!0,cancelable:!0,detail:{url:e,status:t??null,error:n||null}});if(typeof document<"u")try{document.dispatchEvent(r)}catch{}r.defaultPrevented||ka(t)||typeof location<"u"&&(location.href=e)}async function Bt(e,t,n,r,o,s,i,a,c){o=o||"GET";let l=typeof a=="number"?a:I,h,f=null,u=null,b=null,g=null,p=!1,d=e,m=t?Fs(t,l):null;try{try{let w=o==="GET"&&!s&&!t?Ms(e):null;if(w)h=w.html,u=w.build,b=w.src,d=w.finalUrl,g=200,p=!0;else{let E={"x-webjs-router":"1"},T=Zn();T&&(E["x-webjs-have"]=T),t&&(E["x-webjs-frame"]=t),s!=null&&o!=="GET"&&o!=="HEAD"&&(E.accept=ps+", text/html");let L={method:o,headers:E,credentials:"same-origin"};i&&(L.signal=i),s!=null&&o!=="GET"&&o!=="HEAD"&&(L.body=s);let S=await fetch(e,L);g=S.status,p=S.ok;let A=S.headers.get("content-type")||"",C=/^text\/html\b/i.test(A);if(A.toLowerCase().indexOf(ps)===0){let x=await S.text();return l===I&&(st(r),In(x)),{ok:p,status:g,aborted:!1}}if(S.redirected&&S.url&&(d=S.url),S.status===204||S.status===205)return l===I&&n&&history.pushState(null,"",d),{ok:p,status:g,aborted:!1};if(!C)return l===I&&(st(r),$n(e,S.status,null)),{ok:!1,status:g,aborted:!1};u=S.headers.get("x-webjs-build"),b=S.headers.get("x-webjs-src");let v=await Gs(S);h=v.shell,v.streaming&&(f=v)}}catch(w){return w&&w.name==="AbortError"?{ok:!1,status:null,aborted:!0}:l!==I?{ok:!1,status:null,aborted:!0}:(st(r),$n(e,null,w instanceof Error?w:new Error(String(w))),{ok:!1,status:null,aborted:!1})}if(l!==I){if(f&&f.reader)try{f.reader.cancel()}catch{}return{ok:!1,status:g,aborted:!0}}let y=zn(h);if(!y)return st(r),$n(e,null,new Error("navigation response did not parse as HTML")),{ok:!1,status:g,aborted:!1};if(tr(y,t,!!c,d,u,b)==="discard"){if(f&&f.reader)try{f.reader.cancel()}catch{}return{ok:p,status:g,aborted:!1}}if(n&&history.pushState(null,"",d),n){let w=new URL(d);if(w.hash){let E=document.getElementById(w.hash.slice(1));E?E.scrollIntoView():(hs(),window.scrollTo({left:0,top:0,behavior:"instant"}))}else hs(),window.scrollTo({left:0,top:0,behavior:"instant"})}return f&&(f.reader||f.rest)&&Xs(f.reader,f.dec,f.rest,()=>l===I),document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:d,frameId:t,from:"navigate"}})),{ok:p,status:g,aborted:!1}}finally{m&&Bs(m,l)}}function Fs(e,t){if(typeof document>"u")return null;let n=null;try{n=document.querySelector(`webjs-frame#${CSS.escape(e)}`)}catch{n=document.getElementById(e)}if(!n)return null;let r=Ut.has(n);return Ut.set(n,t),n.setAttribute("aria-busy","true"),r||n.dispatchEvent(new CustomEvent("webjs:frame-busy",{bubbles:!0,detail:{frameId:e,busy:!0}})),n}function Bs(e,t){if(Ut.get(e)!==t)return;Ut.delete(e),e.setAttribute("aria-busy","false");let n=e.id||null;e.dispatchEvent(new CustomEvent("webjs:frame-busy",{bubbles:!0,detail:{frameId:n,busy:!1}}))}function Us(e,t,n){let r=Dt.has(e);return Dt.set(e,t),e.setAttribute("aria-busy","true"),r||e.dispatchEvent(new CustomEvent("webjs:submit-start",{bubbles:!0,detail:{form:e,url:n}})),e}function Ds(e,t,n,r){if(Dt.get(e)!==t)return;Dt.delete(e),e.setAttribute("aria-busy","false");let o=new CustomEvent("webjs:submit-end",{bubbles:!0,detail:{form:e,url:n,ok:!!r}});e.isConnected?e.dispatchEvent(o):typeof document<"u"?document.dispatchEvent(o):e.dispatchEvent(o)}function ms(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+=be(r);return n}function qs(){if(typeof document>"u")return!1;let e=document.querySelector('meta[name="view-transition"]');return e?(e.getAttribute("content")||"").trim().toLowerCase()==="same-origin":!1}function It(e,t){let n=typeof document<"u"?document.startViewTransition:void 0;if(qs()&&typeof n=="function"){let r=n.call(document,e);r&&r.finished&&typeof r.finished.then=="function"?r.finished.then(()=>{t&&t()}).catch(()=>{}):t&&t();return}e(),t&&t()}function Hs(e,t){if(!e||!t||typeof e.querySelectorAll!="function")return;let n=e.querySelectorAll("[data-webjs-permanent][id]");for(let r of n){let o=r.id;if(!o)continue;let s=null;try{s=t.querySelector(`#${CSS.escape(o)}`)}catch{s=null}if(!s||!r.hasAttribute||!r.hasAttribute("data-webjs-permanent"))continue;let i=s.parentNode;i&&s!==r&&i.replaceChild(r,s)}}function zt(e,t){let n=[];for(let r of e){if(r.nodeType!==1)continue;let o=r;if(o.hasAttribute&&o.hasAttribute("data-webjs-permanent")&&o.id&&n.push(o),typeof o.querySelectorAll=="function")for(let s of o.querySelectorAll("[data-webjs-permanent][id]"))n.push(s)}if(n.length)for(let r of n){let o=r.id;if(!o)continue;let s=va(t,o);if(!s||s===r)continue;let i=s.parentNode;if(i)i.replaceChild(r,s);else{let a=t.indexOf(s);a!==-1&&(t[a]=r)}}}function va(e,t){for(let n of e){if(n.nodeType!==1)continue;let r=n;if(r.id===t)return r;if(typeof r.querySelector=="function"){let o=null;try{o=r.querySelector(`#${CSS.escape(t)}`)}catch{o=null}if(o)return o}}return null}function Na(e){if(!(!e||!e.start))for(let t=e.start.nextSibling;t&&t!==e.end;t=t.nextSibling)t.nodeType===1&&ge(t)}function tr(e,t,n,r,o,s){try{Lt(e)}catch{}try{typeof sessionStorage<"u"&&(!r||t||n)&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}if(r&&!t&&!n){let f=document.querySelector('script[type="importmap"]'),u=f?f.getAttribute("data-webjs-build"):null,b=!1;if(o&&u&&(b=o!==u),!b&&e.head&&e.head.children.length>0){let g=ms(document),p=ms(e);g!==p&&(b=!0)}if(b&&typeof location<"u"){M.clear(),R.clear();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(!b){let g=f?f.getAttribute("data-webjs-src"):null;s&&g&&s!==g&&(M.clear(),R.clear(),f&&f.setAttribute("data-webjs-src",s));try{typeof sessionStorage<"u"&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}}}if(t){let f=document.querySelector(`webjs-frame#${CSS.escape(t)}`),u=e.querySelector(`webjs-frame#${CSS.escape(t)}`);if(f&&u){Wn(e.head),It(()=>{Pa(f,u),ct(f),ge(f),Mt()},()=>ge(f)),gs(e.body);return}let b=new CustomEvent("webjs:frame-missing",{bubbles:!0,cancelable:!0,detail:{frameId:t,url:r||(typeof location<"u"?location.href:null),document:e}});(f||document).dispatchEvent(b),b.defaultPrevented||console.warn(`[webjs] frame "${t}" was not in the navigation response, leaving it unchanged. Handle "webjs:frame-missing" (preventDefault) to override.`);return}let i=De(document.body),a=De(e.body),c=i&&a?Ns(i,a):null;if(c){let{mode:f,live:u,incoming:b}=c;Wn(e.head),It(()=>{f==="replace"?ja(u,b):Ra(u,b,e),Mt()},()=>Na(u)),gs(e.body);return}if(r&&!n&&typeof location<"u"){Bn(i?a?"no-shared-boundary":"incoming-boundaries-malformed":"live-boundaries-malformed",r),location.href=r;return}if(r&&n)return Bn("revalidation-discarded",r),"discard";Ks(e.head),Hs(document.body,e.body);let l=[...e.body.childNodes];It(()=>{document.body.replaceChildren(...l),ct(document.body),ge(document.body),Mt()},()=>ge(document.body))}function Mt(){let e=document.activeElement;!e||e===document.body||e===document.documentElement||typeof e.blur=="function"&&e.blur()}function ja(e,t){let n=e.start.parentNode;if(!n)return;let r=[];for(let s=e.start.nextSibling;s&&s!==e.end;s=s.nextSibling)r.push(s);let o=[];for(let s=t.start.nextSibling;s&&s!==t.end;s=s.nextSibling)o.push(document.importNode(s,!0));zt(r,o);for(let s of r)s.parentNode===n&&n.removeChild(s);for(let s of o)n.insertBefore(s,e.end);for(let s=e.start.nextSibling;s&&s!==e.end;s=s.nextSibling)s.nodeType===1&&(ct(s),ge(s))}function Ra(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));zt(o,s),La(r,e.start,e.end,o,s);for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)i.nodeType===1&&(ct(i),ge(i))}function La(e,t,n,r,o){let s=new Map;for(let c of r){if(c.nodeType!==1)continue;let l=Ue(c);l&&s.set(l,c)}let i=n,a=[];for(let c of o){if(c.nodeType===1){let l=Ue(c);if(l&&s.has(l)){let h=s.get(l);qt(h,c),a.push(h),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 qt(e,t){if(e===t)return;if(e.tagName!==t.tagName){e.replaceWith(t);return}let n=new Set;for(let r of t.attributes)n.add(r.name),!Hn.has(r.name)&&e.getAttribute(r.name)!==r.value&&e.setAttribute(r.name,r.value);for(let r of[...e.attributes])Hn.has(r.name)||n.has(r.name)||e.removeAttribute(r.name);if(Oa(e)){Ma(e,t);return}Vt(e,t)}function Oa(e){return e[Symbol.for("webjs.instance")]!=null}function Ia(e,t){for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!1;return!0}function bs(e){let t=new Map,n=`slot[${q}][${K}="${de}"]`;for(let r of e.querySelectorAll(n)){let o=r;if(!Ia(o,e))continue;let s=o.getAttribute("name")||null;t.has(s)||t.set(s,o)}return t}function Ma(e,t){if(!e[D])return;let n=bs(e),r=bs(t);if(n.size===0&&r.size===0)return;let o=new Set([...n.keys(),...r.keys()]);for(let s of o){let i=n.get(s),a=r.get(s);i&&a?(Vt(i,a),Ne(e,s,[...i.childNodes])):a?Ne(e,s,[...a.childNodes].map(c=>document.importNode(c,!0))):Ne(e,s,null)}}function Vt(e,t){let n=[...e.childNodes],r=[...t.childNodes].map(a=>document.importNode(a,!0));zt(n,r);let o=new Map;for(let a of n){if(a.nodeType!==1)continue;let c=Ue(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=Ue(c);if(l&&o.has(l)){let f=o.get(l);qt(f,c),s.push(f),o.delete(l);continue}let h=n[a];if(h&&h.nodeType===1&&!Ue(h)&&h.tagName===c.tagName){qt(h,c),s.push(h);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 Ue(e){let t=e.getAttribute("data-key");return t?`${e.tagName}:k:${t}`:e.id?`${e.tagName}:i:${e.id}`:null}function Ws(){let e=De(document.body);if(!e||e.size===0)return null;let t=[...e.keys()].sort((a,c)=>c.length-a.length),n=null,r=null;for(let a of t){let c=document.getElementById(`wj-loading:${a}`);if(c instanceof HTMLTemplateElement){n=a,r=c;break}}if(n===null||r===null)return null;let o=e.get(n),s=[];for(let a=o.start.nextSibling;a&&a!==o.end;a=a.nextSibling)s.push(a);let i=document.createRange();return i.setStartAfter(o.start),i.setEndBefore(o.end),i.deleteContents(),o.start.parentNode.insertBefore(r.content.cloneNode(!0),o.end),{slot:o,oldChildren:s,token:I}}function st(e){if(!e||e.token!==I)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 Pa(e,t){Vt(e,t)}function zs(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function nr(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=zs();return n&&t.setAttribute("nonce",n),t.textContent=e.textContent,t}function Vs(e){if(!e.hasAttribute("nonce"))return e.cloneNode(!0);let t=e.cloneNode(!0),n=zs();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function be(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function Wn(e){let t=e.querySelector("title");t&&(document.title=t.textContent||"");let n=new Set;for(let r of document.head.children)n.add(be(r));for(let r of e.children)r.tagName==="SCRIPT"&&r.getAttribute("type")==="importmap"||r.tagName!=="BASE"&&r.tagName!=="TITLE"&&(n.has(be(r))||(r.tagName==="SCRIPT"?document.head.appendChild(nr(r)):document.head.appendChild(Vs(r))))}function $a(e){return e.tagName==="STYLE"?!0:e.tagName==="LINK"&&(e.getAttribute("rel")||"").toLowerCase().split(/\s+/).includes("stylesheet")}function Ks(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(be(s));let o=new Set;for(let s of e.children)s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&o.add(be(s));for(let s of[...t.children])s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&s.tagName!=="TITLE"&&($a(s)||o.has(be(s))||s.remove());for(let s of e.children)s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&s.tagName!=="TITLE"&&(r.has(be(s))||(s.tagName==="SCRIPT"?t.appendChild(nr(s)):t.appendChild(Vs(s))))}function ge(e){typeof customElements>"u"||rr(e)}function rr(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&&rr(n.shadowRoot))}function gs(e){for(let t of e.querySelectorAll("template[data-webjs-resolve]"))document.body.appendChild(t.cloneNode(!0))}async function Gs(e){if(!e.body||typeof e.body.getReader!="function")return{shell:await e.text(),streaming:!1};let t=e.body.getReader(),n=new TextDecoder,r="",o="<template data-webjs-resolve",s="<!--wj-stream-shell-->",i=/<\/html\s*>/i;for(;;){let{value:a,done:c}=await t.read();a&&(r+=n.decode(a,{stream:!0})),c&&(r+=n.decode());let l=r.indexOf(s);if(l!==-1)return{shell:r.slice(0,l),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(l+s.length)};let h=r.indexOf(o);if(h!==-1)return{shell:r.slice(0,h),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(h)};if(c)return{shell:r,streaming:!1};let f=i.exec(r);if(f){let u=f.index+f[0].length;return{shell:r.slice(0,u),streaming:!0,reader:t,dec:n,rest:r.slice(u)}}}}function Ys(e){let t=/<template\s+data-webjs-resolve="([^"]+)"\s*>/i.exec(e);if(!t)return null;let n=t[1],r=t.index+t[0].length,o=/<(\/?)template\b[^>]*>/gi;o.lastIndex=r;let s=1,i;for(;i=o.exec(e);)if(i[1]==="/"){if(s--,s===0)return{id:n,content:e.slice(r,i.index),rest:e.slice(i.index+i[0].length)}}else s++;return null}function Js(e,t){let n=document.getElementById(e);if(!n)return;let r=document.createElement("template");r.innerHTML=t;let o=[...r.content.childNodes];n.replaceWith(r.content);for(let s of o)s.nodeType===1&&rr(s)}async function Xs(e,t,n,r){let o=n,s=()=>{let i;for(;i=Ys(o);){if(!r())return!1;Js(i.id,i.content),o=i.rest}return!0};if(!e){s();return}try{for(;;){if(!s()){try{await e.cancel()}catch{}return}let{value:i,done:a}=await e.read();if(i&&(o+=t.decode(i,{stream:!0})),a){o+=t.decode(),s();return}}}catch{}}function ct(e){for(let t of e.querySelectorAll("script"))t.replaceWith(nr(t))}function Fa(e){return R.get(ye(e))||null}function Ba(){return me.size}function Ua(){R.clear(),me.clear(),$e.length=0,ot.clear(),Wt(),er()}function Da(){return I}function qa(){return++I}function Ha(){return z}function Wa(e){z=e}function za(){Fn.clear(),Un=!1}function Va(e,t){return vs(e,t)}function Ka(e){return Ht.test(e)}var ps,Me,se,$,I,Pn,z,Ot,Ht,ks,Fn,Un,ga,M,_a,Rs,Ls,Sa,Aa,Ea,R,me,$e,ot,Fe,it,re,Pe,at,Ut,Dt,Hn,Ln=J(()=>{Rn();Rt();Rt();ls();Mn();Ge();ps="text/vnd.webjs-stream.html";Me=null;se=!1,$=null,I=0,Pn=null;z=null,Ot=null;Ht=/\.(?: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;ks="_top";Fn=new Set;Un=!1;ga=16,M=new Map;_a=8,Rs=3e4,Ls=3,Sa=24,Aa=100,Ea=250,R=new Map,me=new Set,$e=[],ot=new Set,Fe=null,it=null,re=null,Pe=new WeakMap,at=new Set;Ut=new WeakMap;Dt=new WeakMap;Hn=new Set(["value","checked","selected","indeterminate","disabled","open","popover"]);(typeof window>"u"||window.__WEBJS_CLIENT_ROUTER__!==!1)&&Vn()});function Jt(e,...t){return{_$webjs:"template",strings:e,values:t}}function O(e){return!!e&&typeof e=="object"&&e._$webjs==="template"}var j="wjm-";function no(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 we(e){return!!e&&typeof e=="object"&&e._$webjsCss===!0}function Xt(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
+ `),n.appendChild(r)}}function lt(e){return!e||!e.length?"":`<style>${e.map(t=>t.text).join(`
3
+ `)}</style>`}var _e=Object.freeze({"@":"event",".":"prop","?":"bool"});function ur(e){return Object.prototype.hasOwnProperty.call(_e,e)}function ut(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function F(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}var fr=Symbol.for("webjs.repeat");function dr(e,t,n){return{[fr]:!0,items:[...e],keyFn:t,templateFn:n}}function oe(e){return!!e&&typeof e=="object"&&e[fr]===!0}function Zt(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function Se(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function ro(e){return{_$webjs:"live",value:e}}function Ae(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function so(e,t){return{_$webjs:"keyed",key:e,value:t}}function ie(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function oo(e,t){return{_$webjs:"guard",deps:e,fn:t}}function ae(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function io(e){return{_$webjs:"template-content",template:e}}function Ee(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function ao(e){return{_$webjs:"ref",target:e}}function ce(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function co(){return{value:void 0}}function lo(e){return{_$webjs:"cache",value:e}}function le(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function uo(...e){return{_$webjs:"until",args:e}}function ue(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function fo(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function Ce(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function po(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function xe(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function ho(e){return{_$webjs:"watch",signal:e}}function fe(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}var B=null,X=!1,ke=0,Te=null,Qt=0,pr=(e,t)=>Object.is(e,t),dt=()=>{},hr=()=>!1;function mr(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)mr(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function We(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)We(n,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(n){console.error(n)}}}function on(e){if(X)throw new Error("Signal read during notification phase");if(B===null)return;let t=B,n=t.nextProducerIndex++;n<t.producers.length&&t.producers[n]!==e&&nn(t)&&We(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,nn(t)&&mr(e,t)),t.producerLastReadVersions[n]=e.version}function nn(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function br(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=X;X=!0;try{for(let n of e.liveConsumers)n.dirty||mo(n)}finally{X=t}}function mo(e){e.dirty=!0,br(e),e.consumerMarkedDirty.call(e.wrapper||e)}function pt(e){if(!(!e.dirty&&e.lastCleanEpoch===ke)){if(!e.producerMustRecompute()&&!bo(e)){e.dirty=!1,e.lastCleanEpoch=ke;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=ke}}function bo(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(pt(n),r!==n.version))return!0}return!1}function rn(e){e&&(e.nextProducerIndex=0);let t=B;return B=e,t}function sn(e,t){if(B=t,!!e){if(nn(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)We(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var ht=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=ke,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=hr,this.producerRecomputeValue=dt,this.consumerMarkedDirty=dt,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||pr,this.watched=n?.[an],this.unwatched=n?.[cn]}get(){return on(this),this.__value}peek(){return this.__value}set(t){if(X)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,ke++,Te!==null?gr(this):br(this))}};function gr(e){let t=X;X=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers)n.dirty||(n.dirty=!0,n.__isWatcher?Te.add(n):gr(n))}finally{X=t}}var en=Symbol("unset"),tn=Symbol("computing"),ft=Symbol("errored"),ze=class{constructor(t,n){this.__fn=t,this.__value=en,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||pr,this.watched=n?.[an],this.unwatched=n?.[cn];let r=this;this.producerMustRecompute=function(){return r.__value===en||r.__value===tn},this.producerRecomputeValue=function(){if(r.__value===tn)throw new Error("Detected cycle in computations.");let o=r.__value;r.__value=tn;let s=rn(r),i,a=!1;try{i=r.__fn.call(r.wrapper)}catch(l){i=ft,r.__error=l,a=!0}finally{sn(r,s)}if(!a&&(o!==en&&o!==ft)&&r.__equal.call(r.wrapper,o,i)){r.__value=o;return}r.__value=i,r.version++},this.consumerMarkedDirty=dt}get(){if(pt(this),on(this),this.__value===ft)throw this.__error;return this.__value}peek(){if(pt(this),this.__value===ft)throw this.__error;return this.__value}},mt=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=ke,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=hr,this.producerRecomputeValue=dt,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=rn(this);try{for(let r of t)on(r),r.__isComputed&&pt(r)}finally{sn(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(We(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=rn(this),r;try{r=t()}finally{sn(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)We(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},an=Symbol("watched"),cn=Symbol("unwatched");function go(e){let t=B;B=null;try{return e()}finally{B=t}}function yo(e){return e.producers.slice()}function wo(e){return e.liveConsumers?[...e.liveConsumers]:[]}function _o(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function So(e){return e.producers.length>0}function Ao(){return B&&B.__isComputed?B:null}function Eo(e){Qt++,Te===null&&(Te=new Set);try{e()}finally{if(Qt--,Qt===0){let t=Te;Te=null;for(let n of t)n.__fire()}}}var Ve={State:ht,Computed:ze,subtle:{Watcher:mt,untrack:go,introspectSources:yo,introspectSinks:wo,hasSinks:_o,hasSources:So,currentComputed:Ao,watched:an,unwatched:cn}};function Co(e,t){return new ht(e,t)}function xo(e,t){return new ze(e,t)}function To(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function ko(e){let t=!1,n=!1,r=new ze(e),o=new mt(()=>{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())}}Ge();var vr=new WeakMap,bn=Symbol.for("webjs.instance");function Le(e,t){let n=t,r=n[bn];if(O(e)){let o=e;if(r&&r.strings===o.strings){je(r,o.values);return}r&&Nr(r,t);let s=t.firstChild;s&&s.nodeType===8&&s.data==="webjs-hydrate"&&s.remove();let i=Uo(o,t);n[bn]=i;return}if(r&&Nr(r,t),n[bn]=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 wt(e){let{strings:t}=e,n=vr.get(t);if(n)return n;let r=[],o="",s="text",i="",a=0,c="",l=0,h=null,f="",u="";for(let g=0;g<t.length;g++){let p=t[g];for(let d=0;d<p.length;d++){let m=p[d];switch(s){case"text":o+=m,m==="<"&&(s="tag-open");break;case"tag-open":o+=m,m==="!"?s="bang-1":m==="/"?(s="tag-name",f=""):/[a-zA-Z]/.test(m)?(s="tag-name",f=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=f==="script"||f==="style"?"rawtext":"text",s==="rawtext"&&(u="")):/\s/.test(m)?s="in-tag":f+=m.toLowerCase();break;case"in-tag":o+=m,m===">"?(s=f==="script"||f==="style"?"rawtext":"text",s==="rawtext"&&(u="")):!/\s/.test(m)&&m!=="/"&&(s="attr-name",i=m,a=o.length-1);break;case"rawtext":o+=m,u=(u+m.toLowerCase()).slice(-9),(u.endsWith("<\/script>")||u.endsWith("</style>"))&&(s="text",u="",f="");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(h){let y=h.firstPartIdx,_=[];for(let A=y;A<r.length;A++)(r[A].kind==="noop"||r[A].kind==="attr-mixed")&&_.push(A);let w=[],E=t[_[0]],T=E.lastIndexOf(c);w.push(T>=0?E.slice(T+1):E);for(let A=1;A<_.length;A++)w.push(t[_[A]]);let L=t[_[_.length-1]+1],S=L.indexOf(c);w.push(S>=0?L.slice(0,S):L),r[y]={kind:"attr-mixed",path:[],name:h.name,statics:w,group:_};for(let A=1;A<_.length;A++)r[_[A]]={kind:"noop",path:[],mixedAnchor:y};h=null}s="in-tag",i=""}break}}if(g<t.length-1){let d=r.length;if(s==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(s==="rawtext"){u="",r.push({kind:"noop",path:[]});continue}if(s==="text")o+=`<!--${j}${d}-->`,r.push({kind:"child",path:[]});else if(s==="in-tag"){let m=`data-${j}${d}`;o+=`${m}=""`,r.push({kind:"element",path:[]})}else if(s==="after-eq"){let m=i[0],y=i.slice(1);if(ur(m)){o=o.slice(0,a);let _=_e[m],w=`data-${j}${d}`;o+=`${w}=""`,r.push({kind:_,path:[],name:y})}else{o=o.slice(0,a);let _=`data-${j}${d}`;o+=`${_}=""`,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-${j}${d}`;o+=`${m}=""`,h={name:i,firstPartIdx:d},r.push({kind:"noop",path:[]}),s="skip-attr"}else s==="skip-attr"&&r.push({kind:"noop",path:[]})}}let b=document.createElement("template");return b.innerHTML=o,Fo(b.content,r),Bo(b.content,r),n={templateEl:b,parts:r},vr.set(t,n),n}function Fo(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(q,"");let o=t.length;r.setAttribute(`data-${j}${o}`,""),t.push({kind:"slot",path:[]})}}function Bo(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(j)){let c=Number(a.slice(j.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-${j}`)){let h=Number(l.name.slice(`data-${j}`.length));t[h]&&t[h].kind!=="child"&&(t[h].path=n.slice()),c.push(l.name)}for(let l of c)a.removeAttribute(l);r(i)}n.pop()}}r(e)}function Uo(e,t){let{templateEl:n,parts:r}=wt(e),o=n.content.cloneNode(!0),s=document.createComment(`${j}s`),i=document.createComment(`${j}e`),a=r.map(l=>_t(l,o)),c=[];for(let l=0;l<e.values.length;l++)ee(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"&&ee(l,void 0,void 0,[]);return{strings:e.strings,bound:a,lastValues:c,startNode:s,endNode:i}}function _t(e,t){if(e.kind==="noop")return{kind:"noop",mixedAnchor:e.mixedAnchor};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 je(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(Object.is(r,e.lastValues[n]))continue;let o=e.bound[n],s=o.mixedAnchor;o.kind==="noop"&&s!=null?ee(e.bound[s],t[s],e.lastValues[s],t):ee(o,r,e.lastValues[n],t),e.lastValues[n]=r}}function Nr(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=gn(n.slotEl);r&&kr(r,n.slotEl)}}t.replaceChildren()}function ee(e,t,n,r){if(Ae(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":Ho(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":qo(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=gn(o);if(!a||Do(o))return;let c=document.createDocumentFragment();for(;o.firstChild;)c.appendChild(o.firstChild);o[gt]=c,queueMicrotask(()=>mn(a))};gn(o)?s():queueMicrotask(s);break}case"noop":break}}function gn(e){let t=e.parentElement;for(;t;){if(t[D])return t;t=t.parentElement}return null}function Do(e){let t=e;for(let n=0;n<128;n++){let r=t.parentNode;if(!r||r===t)return!1;if(r.nodeType===11&&r.host)return!0;t=r}return!1}function qo(e,t){let n=e,r=ce(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 Ho(e,t){return Zo(e,t),H(e,t)}function H(e,t){let n=e.marker;if(Se(t)){Q(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(ie(t)){let o=t,s=e.__keyedKey;s!==void 0&&!Object.is(s,o.key)&&Q(e),e.__keyedKey=o.key,H(e,o.value);return}if(ae(t)){let o=t,s=e.__guardDeps,i=o.deps;if(s!==void 0&&(Array.isArray(s)&&Array.isArray(i)?Xo(s,i):Object.is(s,i)))return;e.__guardDeps=Array.isArray(i)?i.slice():i,H(e,o.fn());return}if(Ee(t)){Q(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(ce(t))return;if(le(t))return Qo(e,t.value);if(ue(t))return ei(e,t.args);if(fe(t))return ti(e,t.signal);if(Ce(t))return ni(e,t);if(xe(t))return ri(e,t);if(oe(t)){if(e.child&&e.child.kind==="repeat"){Vo(e,t);return}Q(e);let o={kind:"repeat",map:new Map};e.child=o,zo(n,o,t);return}if(Array.isArray(t)){if(e.child&&e.child.kind==="array"){Yo(e,t);return}Q(e);let o={kind:"array",items:[]};e.child=o,Go(n,o,t);return}if(e.child){let o=e.child;if(o.kind==="repeat")jr(o),e.child=void 0;else if(o.kind==="array")Lr(o),e.child=void 0;else if(o.kind==="async-stream")Pr(o),e.child=void 0;else if("strings"in e.child){let s=e.child;if(O(t)&&s.strings===t.strings){je(s,t.values);return}Re(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(O(t)){let o=t,{templateEl:s,parts:i}=wt(o),a=s.content.cloneNode(!0),c=document.createComment(`${j}s`),l=document.createComment(`${j}e`),h=i.map(b=>_t(b,a)),f=[];for(let b=0;b<o.values.length;b++)ee(h[b],o.values[b],void 0,o.values),f.push(o.values[b]);let u=[c,...a.childNodes,l];n.parentNode?.insertBefore(Wo(u),n);for(let b of h)b.kind==="slot"&&ee(b,void 0,void 0,[]);e.child={strings:o.strings,bound:h,lastValues:f,startNode:c,endNode:l};return}let r=document.createTextNode(String(t));n.parentNode?.insertBefore(r,n),e.child=[r]}function Wo(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function Re(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 wn(e){let{templateEl:t,parts:n}=wt(e),r=t.content.cloneNode(!0),o=document.createComment(`${j}s`),s=document.createComment(`${j}e`),i=n.map(l=>_t(l,r)),a=[];for(let l=0;l<e.values.length;l++)ee(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 Ye(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 zo(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),h=s(r[c],c);if(!O(h))continue;let{inst:f,frag:u}=wn(h);t.map.set(l,f),a.appendChild(u)}i.insertBefore(a,e)}function Vo(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 h=i(s[l],l),f=a(s[l],l);if(!O(f))continue;let u=o.map.get(h);if(u&&u.strings===f.strings)je(u,f.values),yn(u.startNode,u.endNode,r,n),c.set(h,u),o.map.delete(h);else{u&&(Ye(u),Re(u.startNode,u.endNode),o.map.delete(h));let{inst:b,frag:g}=wn(f);r.insertBefore(g,n),c.set(h,b)}}for(let l of o.map.values())Ye(l),Re(l.startNode,l.endNode);o.map=c}function jr(e){for(let t of e.map.values())Ye(t),Re(t.startNode,t.endNode);e.map.clear()}function Ko(e){return e.type==="tpl"?e.inst.startNode:e.type==="text"?e.node:null}function yt(e){e.type==="tpl"?(Ye(e.inst),Re(e.inst.startNode,e.inst.endNode)):e.type==="text"&&e.node.parentNode?.removeChild(e.node)}function Rr(e){if(O(e)){let{inst:t,frag:n}=wn(e);return{item:{type:"tpl",inst:t},frag:n}}if(e!=null&&e!==!1&&e!==!0){let t=document.createTextNode(String(e));return{item:{type:"text",node:t},frag:t}}return{item:{type:"empty"},frag:null}}function Go(e,t,n){let r=e.parentNode;if(!r)return;let o=document.createDocumentFragment(),s=[];for(let i of n){let{item:a,frag:c}=Rr(i);c&&o.appendChild(c),s.push(a)}r.insertBefore(o,e),t.items=s}function Yo(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let o=e.child,s=o.items,i=[];for(let a=0;a<t.length;a++){let c=t[a],l=s[a];if(O(c)){let u=c;if(l&&l.type==="tpl"&&l.inst.strings===u.strings){je(l.inst,u.values),i.push(l);continue}}else if(c!=null&&c!==!1&&c!==!0){if(l&&l.type==="text"){let u=String(c);l.node.data!==u&&(l.node.data=u),i.push(l);continue}}else{l&&yt(l),i.push({type:"empty"});continue}let{item:h,frag:f}=Rr(c);f&&r.insertBefore(f,Jo(s,a,n)),l&&yt(l),i.push(h)}for(let a=t.length;a<s.length;a++)yt(s[a]);o.items=i}function Jo(e,t,n){for(let r=t;r<e.length;r++){let o=Ko(e[r]);if(o&&o.parentNode)return o}return n}function Lr(e){for(let t of e.items)yt(t);e.items=[]}function yn(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 Xo(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 Q(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&Or(t),!e.child)return;let n=e.child;if(n.kind==="repeat")jr(n);else if(n.kind==="array")Lr(n);else if(n.kind==="async-stream")Pr(n);else if("strings"in n){let r=e.child;Ye(r),Re(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function Zo(e,t){let n=e;n.__untilState&&!ue(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!ae(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!le(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!ie(t)&&(n.__keyedKey=void 0),n.__watchSub&&!fe(t)&&Or(n)}function Qo(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(O(t)&&a.strings===t.strings){je(a,t.values);return}let c=document.createDocumentFragment();yn(a.startNode,a.endNode,c,null),o.set(a.strings,{inst:a,holder:c}),e.child=void 0}if(O(t)){let a=t,c=o.get(a.strings);if(c){o.delete(a.strings),e.child&&Q(e),yn(c.inst.startNode,c.inst.endNode,n.parentNode,n),je(c.inst,a.values),e.child=c.inst;return}}H(e,t)}function ei(e,t){let n=e,r=n.__untilState,o=n.__untilArgs,s=(u,b)=>!!(Object.is(u,b)||O(u)&&O(b)&&u.strings===b.strings),a=o&&o.length===t.length&&o.every((u,b)=>s(u,t[b]))&&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,h;for(let u=0;u<t.length;u++){let b=t[u];if(!b||typeof b.then!="function"){l=u,h=b;break}}l!==-1&&l<=c.highestResolved?(H(e,h),c.highestResolved=l):l===-1&&!n.__untilEverRendered&&H(e,""),n.__untilEverRendered=!0;let f=Math.min(l===-1?t.length:l,c.highestResolved);for(let u=0;u<f;u++){let b=t[u];!b||typeof b.then!="function"||Promise.resolve(b).then(g=>{c.aborted||u>=c.highestResolved||(c.highestResolved=u,H(e,g))},()=>{})}}function ti(e,t){let n=e;if(n.__watchSig===t&&n.__watchSub){let s;n.__watchSub.observe(()=>{s=t.get()}),H(e,s);return}n.__watchSub&&(n.__watchSub.dispose(),n.__watchSub=void 0),n.__watchSig=t;let r=new Ve.subtle.Watcher(()=>{queueMicrotask(()=>{if(n.__watchSub!==r)return;let s;r.observe(()=>{s=t.get()}),H(e,s)})});n.__watchSub=r;let o;r.observe(()=>{o=t.get()}),H(e,o)}function Or(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function ni(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="append"&&n.iterable===t.iterable)return;Q(e);let r=t.iterable[Symbol.asyncIterator](),o={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=o,Ir(o,e,t)}function ri(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="replace"&&n.iterable===t.iterable)return;Q(e);let r=t.iterable[Symbol.asyncIterator](),o={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=o,Ir(o,e,t)}async function Ir(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=Mr(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 Mr(e){if(e==null||e===!1||e===!0)return[];if(O(e)){let t=e,{templateEl:n,parts:r}=wt(t),o=n.content.cloneNode(!0),s=r.map(i=>_t(i,o));for(let i=0;i<t.values.length;i++)ee(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(...Mr(n));return t}return[document.createTextNode(String(e))]}function Pr(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 $r=null;function St(e){$r=e||null}function si(){return $r||void 0}var Fr=Symbol.for("webjs:registry"),Br=Symbol.for("webjs:classToTag"),At=globalThis,W=At[Fr]||(At[Fr]=new Map),Ur=At[Br]||(At[Br]=new WeakMap),Et=typeof window<"u"&&typeof customElements<"u";function _n(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=W.get(e);r?(r.cls=t,r.lazy=n):W.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),Ur.set(t,e)}if(Et){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),_n(t,n)}}if(!Et){let e=globalThis;e.customElements||(e.customElements={define(t,n){_n(t,n)},get(t){return W.get(t)?.cls},upgrade(){},whenDefined(t){let n=W.get(t);return Promise.resolve(n?.cls)}})}function Sn(e,t){Et?customElements.define(e,t):_n(e,t)}function oi(e,t){if(Et)return;let n=W.get(e);if(n){n.moduleUrl=t;return}W.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e})}function An(e){return W.get(e)?.cls}function ii(e){return W.get(e)?.moduleUrl||null}function ai(e){return W.get(e)?.lazy===!0}function Ct(e){return Ur.get(e)}function En(){return[...W.keys()]}Oe();Ge();var Kr=typeof window<"u"&&typeof HTMLElement<"u";function _i(e,t){return e!==t}function Si(){return{states:new Set,shadowRoot:null,form:null,labels:[],role:"",willValidate:!0,validity:{},validationMessage:"",setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0}}}var xt=class{constructor(){this.__ssrAttrs=new Map,this.__internals=null}get attributes(){return[...this.__ssrAttrs].map(([t,n])=>({name:t,value:n}))}getAttribute(t){let n=this.__ssrAttrs.get(String(t).toLowerCase());return n===void 0?null:n}setAttribute(t,n){this.__ssrAttrs.set(String(t).toLowerCase(),String(n))}removeAttribute(t){this.__ssrAttrs.delete(String(t).toLowerCase())}hasAttribute(t){return this.__ssrAttrs.has(String(t).toLowerCase())}toggleAttribute(t,n){let r=String(t).toLowerCase(),o=this.__ssrAttrs.has(r);return(n===void 0?!o:n)?(this.__ssrAttrs.set(r,""),!0):(this.__ssrAttrs.delete(r),!1)}getAttributeNames(){return[...this.__ssrAttrs.keys()]}closest(t){let n=String(t).trim().toLowerCase();if(!/^[a-z][a-z0-9-]*$/.test(n))return null;if(this.__ssrTag===n)return this;let r=this.__ssrAncestors;if(!Array.isArray(r))return null;for(let o=r.length-1;o>=0;o--)if(r[o]&&r[o].__ssrTag===n)return r[o];return null}get dataset(){if(this.__dataset)return this.__dataset;let t=this,n=r=>"data-"+String(r).replace(/[A-Z]/g,o=>"-"+o.toLowerCase());return this.__dataset=new Proxy({},{get(r,o){if(typeof o!="string")return;let s=t.getAttribute(n(o));return s===null?void 0:s},set(r,o,s){return typeof o=="string"&&t.setAttribute(n(o),s),!0},has(r,o){return typeof o=="string"&&t.hasAttribute(n(o))},deleteProperty(r,o){return typeof o=="string"&&t.removeAttribute(n(o)),!0},ownKeys(){return t.getAttributeNames().filter(r=>r.startsWith("data-")).map(r=>r.slice(5).replace(/-([a-z])/g,(o,s)=>s.toUpperCase()))},getOwnPropertyDescriptor(r,o){if(typeof o=="string"&&t.hasAttribute(n(o)))return{enumerable:!0,configurable:!0,value:t.getAttribute(n(o))}}}),this.__dataset}get className(){return this.getAttribute("class")??""}set className(t){this.setAttribute("class",t)}get hidden(){return this.hasAttribute("hidden")}set hidden(t){this.toggleAttribute("hidden",!!t)}get id(){return this.getAttribute("id")??""}set id(t){this.setAttribute("id",t)}get title(){return this.getAttribute("title")??""}set title(t){this.setAttribute("title",t)}get slot(){return this.getAttribute("slot")??""}set slot(t){this.setAttribute("slot",t)}get role(){return this.getAttribute("role")}set role(t){t==null?this.removeAttribute("role"):this.setAttribute("role",t)}get tabIndex(){let t=this.getAttribute("tabindex");return t===null?-1:Number.parseInt(t,10)||0}set tabIndex(t){this.setAttribute("tabindex",String(t))}addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return this.__internals=Si(),this.__internals}},Ai=["ariaAtomic","ariaAutoComplete","ariaBusy","ariaChecked","ariaColCount","ariaColIndex","ariaColSpan","ariaCurrent","ariaDescription","ariaDisabled","ariaExpanded","ariaHasPopup","ariaHidden","ariaInvalid","ariaKeyShortcuts","ariaLabel","ariaLevel","ariaLive","ariaModal","ariaMultiLine","ariaMultiSelectable","ariaOrientation","ariaPlaceholder","ariaPosInSet","ariaPressed","ariaReadOnly","ariaRequired","ariaRoleDescription","ariaRowCount","ariaRowIndex","ariaRowSpan","ariaSelected","ariaSetSize","ariaSort","ariaValueMax","ariaValueMin","ariaValueNow","ariaValueText"];for(let e of Ai){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(xt.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}var Ei=Kr?HTMLElement:xt,Gr=Symbol("webjs.factoryProps"),zr=new WeakSet,Ie=class e extends Ei{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){Sn(t,this)}static get observedAttributes(){let t=this.properties||{};return Object.keys(t).filter(n=>!(typeof t[n]=="object"&&t[n].state)).map(n=>typeof t[n]=="object"&&t[n].attribute||Cn(n))}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._assertFactoryProperties(),this._initializeProperties()}_assertFactoryProperties(){let t=this.constructor;if(zr.has(t))return;let n=t;for(;n&&n!==e;){if(Object.hasOwn(n,"properties")&&!Object.hasOwn(n,Gr)){let r=n.name||"a component";throw new Error(`${r}: \`static properties\` is no longer supported. Declare reactive properties via the factory instead: \`class ${r} extends WebComponent({ count: Number })\`. Use the \`prop()\` helper for options (\`prop(Number, { reflect: true })\`) and set defaults in the constructor after \`super()\`. See https://docs.webjs.dev/docs/components.`)}n=Object.getPrototypeOf(n)}zr.add(t)}_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||_i)(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:s.default!==void 0&&(this.__propValues[r]=typeof s.default=="function"?s.default():s.default)}}}_reflectAttribute(t,n,r){let o=r.attribute||Cn(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(!Kr)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=Vr(r.slice(16));try{this[s]=G(o)}catch(i){console.warn(`[webjs] failed to decode ${r} on <${this.tagName.toLowerCase()}>: ${i&&i.message}`)}}}_activate(){this._connected=!0,this._reflectDeclaredAttributes();let t=this.constructor;if(t.shadow!==!0&&!this.hasAttribute("data-wj-host")&&this.setAttribute("data-wj-host",""),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:we(r)?[r]:[];if(o.length){if(n){let s=this.shadowRoot.querySelector("style");s&&s.remove()}Xt(this._renderRoot,o)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${Ct(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().`),hn(this)||(this.__isHydrating()?(Z(this),Cr(this)):Er(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)}})}get slots(){return xr(this)}hasSlot(t){return Tr(this,t)}setSlotContent(t,n){Ne(this,t,n)}__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.__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 s=this.constructor.properties||{},i,a;for(let[h,f]of Object.entries(s))if(((typeof f=="object"?f:{type:f}).attribute||Cn(h))===t){i=h,a=f;break}if(a===void 0&&(i=Vr(t),a=s[i]||s[t]),a===void 0)return;let c=typeof a=="object"?a:{type:a},l;if(c.converter&&c.converter.fromAttribute)l=c.converter.fromAttribute(r,c.type);else if(c.type===Number)l=r==null?null:Number(r);else if(c.type===Boolean)l=r!=null&&r!=="false";else if(c.type===Object||c.type===Array)try{l=r==null?null:JSON.parse(r)}catch{l=r}else l=r;this[i]!==l&&(this[i]=l,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,r=null;try{if(this.shouldUpdate(t)){this.willUpdate(t);for(let o of this.__controllers)o.hostUpdate&&o.hostUpdate();this.__renderToken=(this.__renderToken||0)+1,this.__renderAbort&&this.__renderAbort.abort(),this.__renderAbort=typeof AbortController<"u"?new AbortController:null,St(this.__renderAbort?this.__renderAbort.signal:null);try{let o=this.update(t);o&&typeof o.then=="function"&&(r=o)}catch(o){this._handleRenderError(o)}finally{St(null)}if(!r){for(let o of this.__controllers)o.hostUpdated&&o.hostUpdated();n=!0}}}catch(o){console.error("[webjs] lifecycle hook threw during update phase:",o)}finally{this._isUpdating=!1,(n||r)&&(this._changedProperties=new Map)}if(r){let o=this.__renderToken;this.__pendingAsyncCommits=(this.__pendingAsyncCommits||0)+1,r.then(()=>{if(this.__pendingAsyncCommits--,o===this.__renderToken){for(let s of this.__controllers)s.hostUpdated&&s.hostUpdated();this._postCommit(t)}});return}n?this._postCommit(t):this.__pendingAsyncCommits||this._resolveUpdate()}_resolveUpdate(){if(this._updateResolve){let t=this._changedProperties.size===0;this._updateResolve(t),this._updateResolve=null}}performServerUpdate(){let t=this._changedProperties;this._isUpdating=!0;try{this.willUpdate(t);for(let n of this.__controllers)n.hostUpdate&&n.hostUpdate();this._reflectDeclaredAttributes()}finally{this._isUpdating=!1}}_reflectDeclaredAttributes(){let t=this.constructor.properties||{};for(let n of Object.keys(t)){let r=t[n];!r||!r.reflect||r.state||this._reflectAttribute(n,this[n],r)}}shouldUpdate(t){return!0}willUpdate(t){}update(t){this.__signalWatcher||(this.__signalWatcher=new Ve.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n;if(this.__signalWatcher.observe(()=>{n=this.render()}),n&&typeof n.then=="function")return this._commitAsync(n);Le(n,this._renderRoot)}_commitAsync(t){let n=this.__renderToken;if(this.__firstRendered&&this._overridesRenderFallback())try{let r=this.renderFallback();r!==void 0&&Le(r,this._renderRoot)}catch(r){console.error("[webjs] renderFallback() threw:",r)}return Promise.resolve(t).then(r=>{n===this.__renderToken&&Le(r,this._renderRoot)},r=>{n===this.__renderToken&&this._handleRenderError(r instanceof Error?r:new Error(String(r)))})}_overridesRenderFallback(){return this.renderFallback!==Tt.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${Ct(this.constructor)||this.tagName?.toLowerCase()}>:`,t);try{let n=this.renderError(t);n!==void 0&&Le(n,this._renderRoot)}catch(n){console.error("[webjs] renderError() also threw:",n)}}_postCommit(t){try{this.__firstRendered||(this.__firstRendered=!0,this.firstUpdated(t)),this.updated(t)}catch(n){console.error("[webjs] lifecycle hook threw during post-commit phase:",n)}finally{this._resolveUpdate()}}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){}renderFallback(){}};function Cn(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Vr(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Tt(e){return new.target?Reflect.construct(Ie,arguments,new.target):class extends Ie{static properties=e;static[Gr]=!0}}Object.setPrototypeOf(Tt,Ie);Tt.prototype=Ie.prototype;function Ci(e,t={}){return e&&typeof e=="object"&&!("call"in e)&&(t=e,e=void 0),{...e?{type:e}:{},...t}}var zc=Symbol.for("webjs.suspense");function xi(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function kt(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}Oe();var xn=null;function Ti(e){xn=e}function Tn(){if(!xn)return"";try{return xn()||""}catch{return""}}Ge();async function ki(e,t={ssr:!0}){let n=t&&t.suspenseCtx,r=t&&t.dev!==void 0?t.dev:n&&n.dev;n&&n.dev===void 0&&r!==void 0&&(n.dev=r);let o=await N(e,n);return t&&t.ssr===!1?o:await ne(o,n,[],r)}async function N(e,t){if(e==null||e===!1||e===!0)return"";if(e&&typeof e.then=="function")return e=await e,N(e,t);if(Se(e))return String(e.value??"");if(Ae(e))return N(e.value,t);if(fe(e))return N(e.signal.get(),t);if(ie(e))return N(e.value,t);if(ae(e))return N(e.fn(),t);if(Ee(e)){let n=e.template;return String(n?.innerHTML??"")}if(ce(e))return"";if(le(e))return N(e.value,t);if(ue(e)){let n=e.args;for(let r of n)if(!r||typeof r.then!="function")return N(r,t);if(n.length>0)try{let r=await Promise.race(n.map(o=>Promise.resolve(o).catch(()=>{})));return N(r,t)}catch{return""}return""}if(Ce(e)||xe(e))return"";if(Array.isArray(e))return(await Promise.all(e.map(r=>N(r,t)))).join("");if(oe(e)){let n=e;return(await Promise.all(n.items.map((o,s)=>N(n.templateFn(o,s),t)))).join("")}if(kt(e)){let n=e,r=await N(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 O(e)?vi(e,t):ut(String(e))}async function vi(e,t){let{strings:n,values:r}=e,o="",s="text",i="",a=0,c="",l=0,h="",f="";for(let u=0;u<n.length;u++){let b=n[u];for(let g=0;g<b.length;g++){let p=b[g];switch(s){case"text":o+=p,p==="<"&&(s="tag-open");break;case"tag-open":o+=p,p==="!"?s="bang-1":p==="/"?(s="tag-name",h=""):/[a-zA-Z]/.test(p)?(s="tag-name",h=p.toLowerCase()):s="text";break;case"bang-1":o+=p,s=p==="-"?"bang-dash":"tag-name";break;case"bang-dash":o+=p,p==="-"?(s="comment",l=0):s="tag-name";break;case"comment":o+=p,p==="-"?l+=1:(p===">"&&l>=2&&(s="text"),l=0);break;case"tag-name":o+=p,p===">"?(s=vt(h)?"rawtext":"text",s==="rawtext"&&(f="")):/\s/.test(p)?s="in-tag":h+=p.toLowerCase();break;case"in-tag":o+=p,p===">"?(s=vt(h)?"rawtext":"text",s==="rawtext"&&(f="")):!/\s/.test(p)&&p!=="/"&&(s="attr-name",i=p,a=o.length-1);break;case"rawtext":o+=p,f=(f+p.toLowerCase()).slice(-9),(f.endsWith("<\/script>")||f.endsWith("</style>"))&&(s="text",f="",h="");break;case"attr-name":p==="="?(s="after-eq",o+=p):/\s/.test(p)?(s="in-tag",i="",o+=p):p===">"?(s="text",i="",o+=p):(i+=p,o+=p);break;case"after-eq":p==='"'||p==="'"?(s="attr-quoted",c=p,o+=p):/\s/.test(p)?(s="in-tag",i="",o+=p):p===">"?(s="text",i="",o+=p):(s="attr-unquoted",o+=p);break;case"attr-unquoted":/\s/.test(p)?(s="in-tag",i="",o+=p):(p===">"&&(s="text",i=""),o+=p);break;case"attr-quoted":o+=p,p===c&&(s="in-tag",i="");break}}if(u<r.length){let g=r[u];if(g&&typeof g.then=="function"&&(g=await g),s==="comment")o+=String(g??""),l=0;else if(s==="rawtext")o+=String(g??""),f="";else if(s==="text")o+=await N(g,t);else if(s==="after-eq"){let p=i[0],d=i.slice(1),m=_e[p];if(m==="event")o=o.slice(0,a),s="in-tag",i="";else if(m==="prop"){if(o=o.slice(0,a),h==="webjs-suspense"&&d==="fallback"){let y=await N(g,t);o+=`data-webjs-fallback="${F(y)}"`,s="in-tag",i="";continue}if(!h.includes("-")){s="in-tag",i="";continue}if(g===void 0){s="in-tag",i="";continue}try{let y=await Ze(g);o+=`data-webjs-prop-${Hi(d)}="${F(y)}"`}catch(y){console.warn(`[webjs] property binding .${d} has an unserializable value during SSR. Dropping. The browser will see the property as undefined. Detail: ${y&&y.message}`)}s="in-tag",i=""}else m==="bool"?(o=o.slice(0,a),g&&(o+=`${d}=""`),s="in-tag",i=""):(o+=`"${F(String(g??""))}"`,s="in-tag",i="")}else(s==="attr-quoted"||s==="attr-unquoted")&&(o+=F(String(g??"")))}}return o}var Ni=new Set(["document","window","localStorage","sessionStorage","navigator","matchMedia","requestAnimationFrame","getComputedStyle","IntersectionObserver","MutationObserver","ResizeObserver"]),ji=new Set(["attachShadow","querySelector","querySelectorAll","getBoundingClientRect","focus","blur","scrollIntoView"]);function Ri(e){let t=e&&typeof e.message=="string"?e.message:"",n=/^(\w+) is not defined\b/.exec(t);return e instanceof ReferenceError&&n&&Ni.has(n[1])?`\`${n[1]}\` is a browser-only global and is undefined during SSR.`:(n=/\.(\w+) is not a function\b/.exec(t),e instanceof TypeError&&n&&ji.has(n[1])?`\`${n[1]}\` is an HTMLElement method that does not exist on the server-side component instance during SSR.`:null)}function Li(){return typeof process<"u"&&process.env&&!0}function Zr(e,t,n){if(!(n===void 0?!Li():!!n))return"";let o=t&&t.message?t.message:String(t);return Jt`<div data-webjs-error="${e}" style="border:1px solid #f5c2c7;background:#f8d7da;color:#842029;padding:8px 12px;border-radius:6px;font:13px/1.4 system-ui,sans-serif">
4
4
  <strong>&lt;${e}&gt; failed to render</strong>
5
- <div style="margin-top:4px;white-space:pre-wrap">${s}</div>
6
- </div>`}async function Q(e,t,n=[],r){e=await Hi(e,t,n,r);let s=vn();if(!s.length)return e;let o=[...s].sort((d,u)=>u.length-d.length),i=new RegExp(`<(${o.map(Je).join("|")})(?=[\\s>/])((?:"[^"]*"|'[^']*'|[^>])*?)(/?)>`,"g"),a=[];for(let d of e.matchAll(i)){let[u,m,g,p]=d,h=En(m);if(!h)continue;t&&t.usedComponents&&t.usedComponents.add(m);let b=p?`<${m}${g}>`:u,y=null;try{let w=h.shadow===!0;y=new h,y.__ssrTag=m,y.__ssrAncestors=n;let E=Qr(g),R=Zi(E),_=new Set(Object.keys(Qr(g)).map(A=>A.toLowerCase()));Ki(y,E),Yi(y,E,h);for(let[A,S]of Object.entries(R))y[A]=S;typeof y.performServerUpdate=="function"&&y.performServerUpdate();let x=y.render?y.render():"";x&&typeof x.then=="function"&&(x=await x),b=Gi(b,y,_),w||(b=es(b));let M=await k(x,t);if(w){let A=await Q(M,t,[...n,y],r),S=h.styles,I=Array.isArray(S)?S:S&&be(S)?[S]:[],me=at(I);a.push({start:d.index,end:d.index+u.length,text:`${b}<template shadowrootmode="open">${me}${A}</template>`})}else{if(M.trim()===""){a.push({start:d.index,end:d.index+u.length,text:`${b}<!--webjs-hydrate-->`});continue}let S="",I=d.index+u.length;if(!p){let Xt=d.index+u.length,it=Xe(e,Xt,m);if(it!==-1){S=e.slice(Xt,it);let io=new RegExp(`</${Je(m)}\\s*>`,"i"),ao=e.slice(it),cr=io.exec(ao),co=cr?cr[0].length:`</${m}>`.length;I=it+co}else S=e.slice(Xt),I=e.length}let me=zi(S),ot=Vi(M,me),oo=await Q(ot,t,[...n,y],r);a.push({start:d.index,end:I,text:`${b}<!--webjs-hydrate-->${oo}</${m}>`})}}catch(w){let E=Bi(w);console.error(E?`[webjs] SSR failed for <${m}>: ${E} It was touched in the component's constructor or render(), which run during SSR. Move browser-only work to connectedCallback() or a lifecycle hook (firstUpdated/updated), which SSR never calls; seed first-paint defaults in the constructor only from server-known inputs (attributes / props).`:`[webjs] SSR failed for <${m}>:`,w);let R=w instanceof Error?w:new Error(String(w)),_="";try{let S;y&&typeof y.renderError=="function"&&(S=y.renderError(R)),S===void 0&&(S=ts(m,R,r)),_=await k(S,t),_.trim()&&(_=await Q(_,t,y?[...n,y]:n,r))}catch(S){console.error(`[webjs] renderError() for <${m}> also threw:`,S),_=""}let x=d.index+u.length;if(!p){let S=d.index+u.length,I=Xe(e,S,m);if(I!==-1){let ot=new RegExp(`</${Je(m)}\\s*>`,"i").exec(e.slice(I));x=I+(ot?ot[0].length:`</${m}>`.length)}else x=e.length}let M=h.shadow===!0;M||(b=es(b));let A;if(M){let S=h.styles,I=Array.isArray(S)?S:S&&be(S)?[S]:[],me=at(I);A=`${b}<template shadowrootmode="open">${me}${_}</template>`}else A=`${b}<!--webjs-hydrate-->${_}</${m}>`;a.push({start:d.index,end:x,text:A})}}if(!a.length)return e;a.sort((d,u)=>d.start-u.start);let c=[],l=-1;for(let d of a)d.start>=l&&(c.push(d),l=d.end);let f=e;for(let d=c.length-1;d>=0;d--){let{start:u,end:m,text:g}=c[d];f=f.slice(0,u)+g+f.slice(m)}return f}var qi=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function Di(e){return qi.has(e.toLowerCase())}async function Hi(e,t,n=[],r){if(e.indexOf("<webjs-suspense")===-1)return e;let s=/<webjs-suspense((?:"[^"]*"|'[^']*'|[^>])*?)>/i,o="",i=e;for(let a=0;a<1e4;a++){let c=s.exec(i);if(!c){o+=i;break}let l=c.index,f=c.index+c[0].length;o+=i.slice(0,l);let d=c[1]||"",u=/data-webjs-fallback="([^"]*)"/i.exec(d),m=u?Rt(u[1]):"",g=Xe(i,f,"webjs-suspense"),p,h;if(g===-1)p=i.slice(f),h="";else{p=i.slice(f,g);let b=/<\/webjs-suspense\s*>/i.exec(i.slice(g));h=i.slice(g+(b?b[0].length:17))}if(t){let b=`s${t.nextId++}`;t.pending.push({id:b,promise:Promise.resolve(en(p))}),o+=`<webjs-suspense id="${b}">${m}</webjs-suspense>`}else{let b=await Q(p,t,n,r);o+=`<webjs-suspense>${b}</webjs-suspense>`}i=h}return o}function Xe(e,t,n){let r=Je(n),s=new RegExp(`<${r}(?:[\\s>/])`,"gi"),o=new RegExp(`</${r}\\s*>`,"gi");s.lastIndex=t,o.lastIndex=t;let i=1;for(;i>0;){let a=s.exec(e),c=o.exec(e);if(!c)return-1;if(a&&a.index<c.index)i++,o.lastIndex=a.index+1;else{if(i--,i===0)return c.index;s.lastIndex=c.index+1}}return-1}function Wi(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 zi(e){let t=new Map,n="",r=0;for(;r<e.length;){let s=e.indexOf("<",r);if(s===-1){n+=e.slice(r);break}s>r&&(n+=e.slice(r,s));let o=e.slice(s);if(o.startsWith("<!--")){let h=e.indexOf("-->",s+4);if(h===-1){n+=o,r=e.length;break}n+=e.slice(s,h+3),r=h+3;continue}if(o.startsWith("<!")||o.startsWith("</")){let h=e.indexOf(">",s);if(h===-1){n+=o,r=e.length;break}n+=e.slice(s,h+1),r=h+1;continue}let i=/^<([a-zA-Z][\w-]*)((?:"[^"]*"|'[^']*'|[^>])*?)(\/?)>/.exec(o);if(!i){n+="<",r=s+1;continue}let[a,c,l,f]=i,d=c.toLowerCase(),u=!!f||Di(d),m=Wi(l),g;if(u)g=s+a.length;else{let h=s+a.length,b=Xe(e,h,d);if(b===-1){let _=e.slice(s);m!==null?Zr(t,m,_):n+=_,r=e.length;continue}let y=new RegExp(`</${Je(d)}\\s*>`,"i"),w=e.slice(b),E=y.exec(w),R=E?E[0].length:`</${d}>`.length;g=b+R}let p=e.slice(s,g);m!==null?Zr(t,m,p):n+=p,r=g}return n.length>0&&t.set(null,n),t}function Zr(e,t,n){let r=e.get(t);r!==void 0?e.set(t,r+n):e.set(t,n)}function Vi(e,t){let n=new Set,r="",s=0,o=/<slot((?:"[^"]*"|'[^']*'|[^>])*?)(\/?)>/gi,i;for(;(i=o.exec(e))!==null;){r+=e.slice(s,i.index);let[a,c,l]=i,f=!!l,d=/\bname\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(c),u=d?d[1]??d[2]??d[3]:null,m=c.replace(/\bname\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,"").trim(),g="",p;if(f)p=i.index+a.length;else{let w=i.index+a.length,E=Xe(e,w,"slot");if(E===-1)g=e.slice(w),p=e.length;else{g=e.slice(w,E);let R=/<\/slot\s*>/i,_=e.slice(E),x=R.exec(_),M=x?x[0].length:7;p=E+M}}let h=t.get(u),b=u!==null?` name="${$(u)}"`:"",y=m?` ${m}`:"";h!==void 0&&!n.has(u)?(n.add(u),r+=`<slot data-webjs-light data-projection="actual"${b}${y}>${h}</slot>`):r+=`<slot data-webjs-light data-projection="fallback"${b}${y}>${g}</slot>`,s=p,o.lastIndex=p}return r+=e.slice(s),r}function Je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function jt(e){return e==="script"||e==="style"}function Qr(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 Ki(e,t){if(!(!e||typeof e.setAttribute!="function"))for(let[n,r]of Object.entries(t))e.setAttribute(n,Rt(r))}function es(e){return/\sdata-wj-host(?=[\s>=])/i.test(e)?e:`${e.slice(0,-1)} data-wj-host>`}function Gi(e,t,n){if(!t||typeof t.getAttributeNames!="function")return e;let r="";for(let s of t.getAttributeNames()){let o=String(s).toLowerCase();if(n.has(o))continue;let i=t.getAttribute(s);r+=i===""?` ${o}`:` ${o}="${$(String(i))}"`}return r?`${e.slice(0,-1)}${r}>`:e}function Yi(e,t,n){let r=n.properties||{};for(let[s,o]of Object.entries(t)){let i,a;for(let[l,f]of Object.entries(r))if(((typeof f=="object"?f:{type:f}).attribute||Ji(l))===s){i=l,a=f;break}if(a===void 0&&(a=r[s]||r[Tn(s)],i=r[s]?s:Tn(s)),!a){e[i]=o;continue}let c=typeof a=="object"?a:{type:a};if(c.type===Number)e[i]=Number(o);else if(c.type===Boolean)e[i]=o!=="false";else if(c.type===Object||c.type===Array)try{e[i]=JSON.parse(Rt(o))}catch{e[i]=o}else e[i]=o}}function Tn(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Ji(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Xi(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Rt(e){return e.replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&amp;/g,"&")}function Zi(e){let t={};for(let n of Object.keys(e)){if(!n.startsWith("data-webjs-prop-"))continue;let r=Tn(n.slice(16));try{t[r]=V(Rt(e[n]))}catch{}delete e[n]}return t}function Qi(e,t={ssr:!0}){let n=t&&t.suspenseCtx,r=t&&t.dev!==void 0?t.dev:n&&n.dev;return n&&n.dev===void 0&&r!==void 0&&(n.dev=r),new ReadableStream({async start(s){try{if(t&&t.ssr===!1)await O(e,n,s);else{let o=await k(e,n),i=await Q(o,n,[],r);s.enqueue(i)}n&&n.pending.length&&await ta(n,s,r),s.close()}catch(o){s.error(o)}}})}async function O(e,t,n){if(!(e==null||e===!1||e===!0)){if(e&&typeof e.then=="function")return e=await e,O(e,t,n);if(ye(e)){n.enqueue(String(e.value??""));return}if(we(e))return O(e.value,t,n);if(ce(e))return O(e.signal.get(),t,n);if(re(e))return O(e.value,t,n);if(se(e))return O(e.fn(),t,n);if(_e(e)){let r=e.template;n.enqueue(String(r?.innerHTML??""));return}if(!oe(e)){if(ie(e))return O(e.value,t,n);if(ae(e)){let r=e.args;for(let s of r)if(!s||typeof s.then!="function")return O(s,t,n);if(r.length>0)try{let s=await Promise.race(r.map(o=>Promise.resolve(o).catch(()=>{})));return O(s,t,n)}catch{return}return}if(!(Se(e)||Ae(e))){if(Array.isArray(e)){for(let r of e)await O(r,t,n);return}if(ne(e)){let r=e;for(let s=0;s<r.items.length;s++)await O(r.templateFn(r.items[s],s),t,n);return}if(Nt(e)){let r=e;if(t){let s=`s${t.nextId++}`;n.enqueue(`<webjs-boundary id="${s}">`),await O(r.fallback,t,n),n.enqueue("</webjs-boundary>"),t.pending.push({id:s,promise:Promise.resolve(r.children)})}else await O(r.fallback,t,n);return}if(N(e)){await ea(e,t,n);return}n.enqueue(ct(String(e)))}}}}async function ea(e,t,n){let{strings:r,values:s}=e,o="text",i="",a=0,c="",l=0,f="",d="",u="";for(let m=0;m<r.length;m++){let g=r[m];for(let p=0;p<g.length;p++){let h=g[p];switch(o){case"text":u+=h,h==="<"&&(o="tag-open");break;case"tag-open":u+=h,h==="!"?o="bang-1":h==="/"?(o="tag-name",f=""):/[a-zA-Z]/.test(h)?(o="tag-name",f=h.toLowerCase()):o="text";break;case"bang-1":u+=h,o=h==="-"?"bang-dash":"tag-name";break;case"bang-dash":u+=h,h==="-"?(o="comment",l=0):o="tag-name";break;case"comment":u+=h,h==="-"?l+=1:(h===">"&&l>=2&&(o="text"),l=0);break;case"tag-name":u+=h,h===">"?(o=jt(f)?"rawtext":"text",o==="rawtext"&&(d="")):/\s/.test(h)?o="in-tag":f+=h.toLowerCase();break;case"in-tag":u+=h,h===">"?(o=jt(f)?"rawtext":"text",o==="rawtext"&&(d="")):!/\s/.test(h)&&h!=="/"&&(o="attr-name",i=h,a=u.length-1);break;case"rawtext":u+=h,d=(d+h.toLowerCase()).slice(-9),(d.endsWith("<\/script>")||d.endsWith("</style>"))&&(o="text",d="",f="");break;case"attr-name":h==="="?(o="after-eq",u+=h):/\s/.test(h)?(o="in-tag",i="",u+=h):h===">"?(o="text",i="",u+=h):(i+=h,u+=h);break;case"after-eq":h==='"'||h==="'"?(o="attr-quoted",c=h,u+=h):/\s/.test(h)?(o="in-tag",i="",u+=h):h===">"?(o="text",i="",u+=h):(o="attr-unquoted",u+=h);break;case"attr-unquoted":/\s/.test(h)?(o="in-tag",i="",u+=h):(h===">"&&(o="text",i=""),u+=h);break;case"attr-quoted":u+=h,h===c&&(o="in-tag",i="");break}}if(m<s.length){let p=s[m];if(p&&typeof p.then=="function"&&(p=await p),o==="comment")u+=String(p??""),l=0;else if(o==="rawtext")u+=String(p??""),d="";else if(o==="text")u&&(n.enqueue(u),u=""),await O(p,t,n);else if(o==="after-eq"){let h=i[0],b=i.slice(1),y=ge[h];y==="event"||y==="prop"?(u=u.slice(0,a),o="in-tag",i=""):y==="bool"?(u=u.slice(0,a),p&&(u+=`${b}=""`),o="in-tag",i=""):(u+=`"${$(String(p??""))}"`,o="in-tag",i="")}else(o==="attr-quoted"||o==="attr-unquoted")&&(u+=$(String(p??"")))}}u&&n.enqueue(u)}async function ta(e,t,n){let r=kn(),s=r?` nonce="${$(r)}"`:"";for(;e.pending.length;){let o=e.pending.splice(0);await Promise.all(o.map(async({id:i,promise:a})=>{try{let c=await a,l=await k(c,e),f=await Q(l,e,[],n);t.enqueue(`<template data-webjs-resolve="${i}">${f}</template><script${s}>(function(){var t=document.currentScript.previousElementSibling;var b=document.getElementById("${i}");if(b&&t){b.replaceWith(t.content.cloneNode(true));t.remove()}document.currentScript.remove()})()<\/script>`)}catch(c){console.error(`[webjs] Suspense boundary "${i}" rejected:`,c);try{let l=c instanceof Error?c:new Error(String(c)),f=await Q(await k(ts("webjs-suspense",l,n),e),e,[],n);t.enqueue(`<template data-webjs-resolve="${i}">${f}</template><script${s}>(function(){var t=document.currentScript.previousElementSibling;var b=document.getElementById("${i}");if(b&&t){b.replaceWith(t.content.cloneNode(true));t.remove()}document.currentScript.remove()})()<\/script>`)}catch(l){console.error(`[webjs] Suspense boundary "${i}" error render also threw:`,l)}}}))}}var ns=Symbol.for("webjs.notFound"),rs=Symbol.for("webjs.redirect"),ss=Symbol.for("webjs.forbidden"),os=Symbol.for("webjs.unauthorized");function na(){let e=new Error("webjs: notFound()");throw e.__webjs=ns,e}function ra(){let e=new Error("webjs: forbidden()");throw e.__webjs=ss,e}function sa(){let e=new Error("webjs: unauthorized()");throw e.__webjs=os,e}function oa(e,t){let n=typeof t=="object"&&t!==null?t.status:t,r=new Error(`webjs: redirect(${e})`);throw r.__webjs=rs,r.url=e,r.status=typeof n=="number"?n:void 0,r}function ia(e){return!!e&&e.__webjs===ns}function aa(e){return!!e&&e.__webjs===rs}function ca(e){return!!e&&e.__webjs===ss}function la(e){return!!e&&e.__webjs===os}function ua(e,t={}){let n=t.reconnect!==!1,r=0,s=!1,o=null,i=[];function a(){s||(o=new WebSocket(fa(e),t.protocols),o.onopen=c=>{for(r=0;i.length&&o&&o.readyState===WebSocket.OPEN;)o.send(i.shift());t.onOpen?.(c)},o.onmessage=c=>{let l=c.data;if(typeof l=="string")try{l=JSON.parse(l)}catch{}t.onMessage?.(l,c)},o.onerror=c=>{t.onError?.(c)},o.onclose=c=>{if(t.onClose?.(c),!s&&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);o&&o.readyState===WebSocket.OPEN?o.send(l):i.push(l)},close(c,l){s=!0;try{o?.close(c,l)}catch{}},get socket(){return o},get readyState(){return o?.readyState??3}}}function fa(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}`}Te();var Nn="application/vnd.webjs+json";async function da(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",Nn);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 Ye(r),n.has("content-type")||n.set("content-type",Nn));let s=await fetch(e,{...t,headers:n,body:r}),o=s.headers.get("content-type")||"",i=await s.text(),a=o.includes(Nn)?i?V(i):null:o.includes("application/json")?i?JSON.parse(i):null:i;if(!s.ok){let c=a&&a.error||`richFetch ${e} -> ${s.status}`,l=new Error(c);throw l.status=s.status,l.body=a,l}return a}Te();On();Ln();Ot();var sr=class{constructor(t,n){this.host=t,this.options=n,this.updates=[],this._nextId=0}get value(){let t=this.options.source();if(!this.options.update)return this.updates.length>0?this.updates[this.updates.length-1].payload:t;for(let n of this.updates)t=this.options.update(t,n.payload);return t}add(t,n){let r=`opt-${++this._nextId}`;this.updates.push({id:r,payload:t}),this.host?.requestUpdate?.();let s=()=>{let o=this.updates.findIndex(i=>i.id===r);o!==-1&&(this.updates.splice(o,1),this.host?.requestUpdate?.())};return n&&typeof n.then=="function"&&(typeof n.finally=="function"?n.finally(()=>s()).catch(()=>{}):n.then(()=>s(),()=>s())),s}};async function ec(e,t,n){let r=e.get();e.set(t);let s;try{s=await n()}catch(o){throw e.set(r),o}return s&&s.success===!1&&e.set(r),s}function tc(e,t,n){return e&&typeof e.get=="function"&&typeof e.set=="function"?ec(e,t,n):new sr(e,t)}Pn();var Yt=0,ro=new Map,Fe=new Map,nc=1e3;function rc(e){if(!(!Array.isArray(e)||!e.length)){Yt+=1;for(let t of e)t&&ro.set(t,Yt)}}function sc(){return Yt}function oc(e,t,n){if(!(!Array.isArray(t)||!t.length)&&(Fe.delete(e),Fe.set(e,{tags:t.slice(),since:typeof n=="number"?n:Yt}),Fe.size>nc)){let r=Fe.keys().next().value;r!==void 0&&Fe.delete(r)}}function ic(e){let t=Fe.get(e);if(!t)return!1;for(let n of t.tags)if((ro.get(n)||0)>t.since)return!0;return!1}function ac(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}var cc="application/vnd.webjs+stream",lc=1,uc=2,fc=3,so=new Uint8Array(0);function dc(e,t){let n=t||so,r=n.length,s=new Uint8Array(5+r);return s[0]=e&255,s[1]=r>>>24&255,s[2]=r>>>16&255,s[3]=r>>>8&255,s[4]=r&255,r&&s.set(n,5),s}function pc(){let e=so;return{push(t){if(t&&t.length){let r=new Uint8Array(e.length+t.length);r.set(e,0),r.set(t,e.length),e=r}let n=[];for(;e.length>=5;){let r=e[0],s=(e[1]<<24|e[2]<<16|e[3]<<8|e[4])>>>0;if(e.length<5+s)break;let o=e.slice(5,5+s);n.push({type:r,payload:o}),e=e.slice(5+s)}return n}}}var hc=Symbol.for("webjs.context");function mc(e){return{__context__:hc,name:e}}var Jt=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},or=class{constructor(t,{context:n,initialValue:r}){this._host=t,this._context=n,this._value=r,this._subscriptions=new Set,this._onRequest=s=>{let o=s;if(o.context===this._context)if(s.stopPropagation(),o.subscribe){let i={callback:o.callback},a=()=>{this._subscriptions.delete(i)};this._subscriptions.add(i),o.callback(this._value,a)}else o.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()}},ir=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 Jt(this._context,(n,r)=>{let s=this._value;this._value=n,r&&(this._unsubscribe=r),!Object.is(s,n)&&typeof this._host.requestUpdate=="function"&&this._host.requestUpdate()},this._subscribe);this._host.dispatchEvent(t)}};function bc(){return typeof window<"u"}var K={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},ar=class{constructor(t,{task:n,args:r,autoRun:s=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=s,this._status=K.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=K.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=K.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=K.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 K.INITIAL:return t.initial?.();case K.PENDING:return t.pending?.();case K.COMPLETE:return t.complete?.(this._value);case K.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun||!bc())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{ir as ContextConsumer,or as ContextProvider,Jt as ContextRequestEvent,lc as FRAME_CHUNK,uc as FRAME_END,fc as FRAME_ERROR,v as MARKER,ms as SEED_MISS,cc as STREAM_CONTENT_TYPE,De as Signal,Oi as Suspense,ar as Task,K as TaskStatus,Tt as WebComponent,Rn as WebjsFrame,Mn as WebjsStream,di as activeActionSignal,Qt as adoptStyles,vn as allTags,_o as asyncAppend,So as asyncReplace,Ro as batch,yo as cache,Oo as computed,ua as connectWS,ic as consumeStale,mc as createContext,pc as createFrameDecoder,go as createRef,kn as cspNonce,uo as css,Vr as deserialize,As as disableClientRouter,Io as effect,Vn as enableClientRouter,dc as encodeFrame,$ as escapeAttr,ct as escapeText,sc as fetchMark,ra as forbidden,ho as guard,Zt as html,Se as isAsyncAppend,Ae as isAsyncReplace,be as isCSS,ie as isCache,ca as isForbidden,se as isGuard,re as isKeyed,mi as isLazy,we as isLive,ia as isNotFound,aa as isRedirect,oe as isRef,ne as isRepeat,Mo as isSignal,Nt as isSuspense,N as isTemplate,_e as isTemplateContent,la as isUnauthorized,ye as isUnsafeHTML,ae as isUntil,ce as isWatch,po as keyed,fo as live,En as lookup,hi as lookupModuleUrl,rc as markStale,Es as navigate,na as notFound,tc as optimistic,V as parse,ac as parseTagHeader,pi as primeModuleUrl,Li as prop,oa as redirect,bo as ref,An as register,oc as registerKeyTags,ke as render,In as renderStream,Qi as renderToStream,Ii as renderToString,dr as repeat,vs as revalidate,da as richFetch,Mt as scanSeeds,zr as serialize,Et as setActiveActionSignal,Mi as setCspNonceProvider,Lo as signal,Ye as stringify,at as stylesToString,xt as tagOf,wa as takeSeed,mo as templateContent,sa as unauthorized,en as unsafeHTML,wo as until,Ao as watch};
5
+ <div style="margin-top:4px;white-space:pre-wrap">${o}</div>
6
+ </div>`}async function ne(e,t,n=[],r){e=await Mi(e,t,n,r);let o=En();if(!o.length)return e;let s=[...o].sort((f,u)=>u.length-f.length),i=new RegExp(`<(${s.map(Qe).join("|")})(?=[\\s>/])((?:"[^"]*"|'[^']*'|[^>])*?)(/?)>`,"g"),a=[];for(let f of e.matchAll(i)){let[u,b,g,p]=f,d=An(b);if(!d)continue;t&&t.usedComponents&&t.usedComponents.add(b);let m=p?`<${b}${g}>`:u,y=null;try{let _=d.shadow===!0;y=new d,y.__ssrTag=b,y.__ssrAncestors=n;let w=Jr(g),E=Wi(w),T=new Set(Object.keys(Jr(g)).map(v=>v.toLowerCase()));Bi(y,w),Di(y,w,d);for(let[v,x]of Object.entries(E))y[v]=x;let L="",S=f.index+u.length;if(!p){let v=f.index+u.length,x=et(e,v,b);if(x!==-1){L=e.slice(v,x);let V=new RegExp(`</${Qe(b)}\\s*>`,"i"),Yt=e.slice(x),cr=V.exec(Yt),eo=cr?cr[0].length:`</${b}>`.length;S=x+eo}else L=e.slice(v),S=e.length}let A=$i(L);if(!_){let v=Z(y);for(let[x,V]of A)V&&V.length&&v.assignedByName.set(x,[V])}typeof y.performServerUpdate=="function"&&y.performServerUpdate();let C=y.render?y.render():"";C&&typeof C.then=="function"&&(C=await C),m=Ui(m,y,T),_||(m=Xr(m));let U=await N(C,t);if(_){let v=await ne(U,t,[...n,y],r),x=d.styles,V=Array.isArray(x)?x:x&&we(x)?[x]:[],Yt=lt(V);a.push({start:f.index,end:f.index+u.length,text:`${m}<template shadowrootmode="open">${Yt}${v}</template>`})}else{if(U.trim()===""){a.push({start:f.index,end:f.index+u.length,text:`${m}<!--webjs-hydrate-->`});continue}let x=Fi(U,A),V=await ne(x,t,[...n,y],r);a.push({start:f.index,end:S,text:`${m}<!--webjs-hydrate-->${V}</${b}>`})}}catch(_){let w=Ri(_);console.error(w?`[webjs] SSR failed for <${b}>: ${w} It was touched in the component's constructor or render(), which run during SSR. Move browser-only work to connectedCallback() or a lifecycle hook (firstUpdated/updated), which SSR never calls; seed first-paint defaults in the constructor only from server-known inputs (attributes / props).`:`[webjs] SSR failed for <${b}>:`,_);let E=_ instanceof Error?_:new Error(String(_)),T="";try{let C;y&&typeof y.renderError=="function"&&(C=y.renderError(E)),C===void 0&&(C=Zr(b,E,r)),T=await N(C,t),T.trim()&&(T=await ne(T,t,y?[...n,y]:n,r))}catch(C){console.error(`[webjs] renderError() for <${b}> also threw:`,C),T=""}let L=f.index+u.length;if(!p){let C=f.index+u.length,U=et(e,C,b);if(U!==-1){let x=new RegExp(`</${Qe(b)}\\s*>`,"i").exec(e.slice(U));L=U+(x?x[0].length:`</${b}>`.length)}else L=e.length}let S=d.shadow===!0;S||(m=Xr(m));let A;if(S){let C=d.styles,U=Array.isArray(C)?C:C&&we(C)?[C]:[],v=lt(U);A=`${m}<template shadowrootmode="open">${v}${T}</template>`}else A=`${m}<!--webjs-hydrate-->${T}</${b}>`;a.push({start:f.index,end:L,text:A})}}if(!a.length)return e;a.sort((f,u)=>f.start-u.start);let c=[],l=-1;for(let f of a)f.start>=l&&(c.push(f),l=f.end);let h=e;for(let f=c.length-1;f>=0;f--){let{start:u,end:b,text:g}=c[f];h=h.slice(0,u)+g+h.slice(b)}return h}var Oi=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function Ii(e){return Oi.has(e.toLowerCase())}async function Mi(e,t,n=[],r){if(e.indexOf("<webjs-suspense")===-1)return e;let o=/<webjs-suspense((?:"[^"]*"|'[^']*'|[^>])*?)>/i,s="",i=e;for(let a=0;a<1e4;a++){let c=o.exec(i);if(!c){s+=i;break}let l=c.index,h=c.index+c[0].length;s+=i.slice(0,l);let f=c[1]||"",u=/data-webjs-fallback="([^"]*)"/i.exec(f),b=u?Nt(u[1]):"",g=et(i,h,"webjs-suspense"),p,d;if(g===-1)p=i.slice(h),d="";else{p=i.slice(h,g);let m=/<\/webjs-suspense\s*>/i.exec(i.slice(g));d=i.slice(g+(m?m[0].length:17))}if(t){let m=`s${t.nextId++}`;t.pending.push({id:m,promise:Promise.resolve(Zt(p))}),s+=`<webjs-suspense id="${m}">${b}</webjs-suspense>`}else{let m=await ne(p,t,n,r);s+=`<webjs-suspense>${m}</webjs-suspense>`}i=d}return s}function et(e,t,n){let r=Qe(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 Pi(e){let t=/\bslot\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(e);if(!t)return null;let n=t[1]??t[2]??t[3]??"";return n===""||n==="default"?null:n}function $i(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 d=e.indexOf("-->",o+4);if(d===-1){n+=s,r=e.length;break}n+=e.slice(o,d+3),r=d+3;continue}if(s.startsWith("<!")||s.startsWith("</")){let d=e.indexOf(">",o);if(d===-1){n+=s,r=e.length;break}n+=e.slice(o,d+1),r=d+1;continue}let i=/^<([a-zA-Z][\w-]*)((?:"[^"]*"|'[^']*'|[^>])*?)(\/?)>/.exec(s);if(!i){n+="<",r=o+1;continue}let[a,c,l,h]=i,f=c.toLowerCase(),u=!!h||Ii(f),b=Pi(l),g;if(u)g=o+a.length;else{let d=o+a.length,m=et(e,d,f);if(m===-1){let T=e.slice(o);b!==null?Yr(t,b,T):n+=T,r=e.length;continue}let y=new RegExp(`</${Qe(f)}\\s*>`,"i"),_=e.slice(m),w=y.exec(_),E=w?w[0].length:`</${f}>`.length;g=m+E}let p=e.slice(o,g);b!==null?Yr(t,b,p):n+=p,r=g}return n.length>0&&t.set(null,n),t}function Yr(e,t,n){let r=e.get(t);r!==void 0?e.set(t,r+n):e.set(t,n)}function Fi(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,h=!!l,f=/\bname\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(c),u=f?f[1]??f[2]??f[3]:null,b=c.replace(/\bname\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,"").trim(),g="",p;if(h)p=i.index+a.length;else{let w=i.index+a.length,E=et(e,w,"slot");if(E===-1)g=e.slice(w),p=e.length;else{g=e.slice(w,E);let T=/<\/slot\s*>/i,L=e.slice(E),S=T.exec(L),A=S?S[0].length:7;p=E+A}}let d=u==="default"||u===""?null:u,m=t.get(d),y=u!==null?` name="${F(u)}"`:"",_=b?` ${b}`:"";m!==void 0&&!n.has(d)?(n.add(d),r+=`<slot data-webjs-light data-projection="actual"${y}${_}>${m}</slot>`):r+=`<slot data-webjs-light data-projection="fallback"${y}${_}>${g}</slot>`,o=p,s.lastIndex=p}return r+=e.slice(o),r}function Qe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vt(e){return e==="script"||e==="style"}function Jr(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 Bi(e,t){if(!(!e||typeof e.setAttribute!="function"))for(let[n,r]of Object.entries(t))e.setAttribute(n,Nt(r))}function Xr(e){return/\sdata-wj-host(?=[\s>=])/i.test(e)?e:`${e.slice(0,-1)} data-wj-host>`}function Ui(e,t,n){if(!t||typeof t.getAttributeNames!="function")return e;let r="";for(let o of t.getAttributeNames()){let s=String(o).toLowerCase();if(n.has(s))continue;let i=t.getAttribute(o);r+=i===""?` ${s}`:` ${s}="${F(String(i))}"`}return r?`${e.slice(0,-1)}${r}>`:e}function Di(e,t,n){let r=n.properties||{};for(let[o,s]of Object.entries(t)){let i,a;for(let[l,h]of Object.entries(r))if(((typeof h=="object"?h:{type:h}).attribute||qi(l))===o){i=l,a=h;break}if(a===void 0&&(a=r[o]||r[kn(o)],i=r[o]?o:kn(o)),!a){e[i]=s;continue}let c=typeof a=="object"?a:{type:a};if(c.type===Number)e[i]=Number(s);else if(c.type===Boolean)e[i]=s!=="false";else if(c.type===Object||c.type===Array)try{e[i]=JSON.parse(Nt(s))}catch{e[i]=s}else e[i]=s}}function kn(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function qi(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Hi(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Nt(e){return e.replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&amp;/g,"&")}function Wi(e){let t={};for(let n of Object.keys(e)){if(!n.startsWith("data-webjs-prop-"))continue;let r=kn(n.slice(16));try{t[r]=G(Nt(e[n]))}catch{}delete e[n]}return t}function zi(e,t={ssr:!0}){let n=t&&t.suspenseCtx,r=t&&t.dev!==void 0?t.dev:n&&n.dev;return n&&n.dev===void 0&&r!==void 0&&(n.dev=r),new ReadableStream({async start(o){try{if(t&&t.ssr===!1)await P(e,n,o);else{let s=await N(e,n),i=await ne(s,n,[],r);o.enqueue(i)}n&&n.pending.length&&await Ki(n,o,r),o.close()}catch(s){o.error(s)}}})}async function P(e,t,n){if(!(e==null||e===!1||e===!0)){if(e&&typeof e.then=="function")return e=await e,P(e,t,n);if(Se(e)){n.enqueue(String(e.value??""));return}if(Ae(e))return P(e.value,t,n);if(fe(e))return P(e.signal.get(),t,n);if(ie(e))return P(e.value,t,n);if(ae(e))return P(e.fn(),t,n);if(Ee(e)){let r=e.template;n.enqueue(String(r?.innerHTML??""));return}if(!ce(e)){if(le(e))return P(e.value,t,n);if(ue(e)){let r=e.args;for(let o of r)if(!o||typeof o.then!="function")return P(o,t,n);if(r.length>0)try{let o=await Promise.race(r.map(s=>Promise.resolve(s).catch(()=>{})));return P(o,t,n)}catch{return}return}if(!(Ce(e)||xe(e))){if(Array.isArray(e)){for(let r of e)await P(r,t,n);return}if(oe(e)){let r=e;for(let o=0;o<r.items.length;o++)await P(r.templateFn(r.items[o],o),t,n);return}if(kt(e)){let r=e;if(t){let o=`s${t.nextId++}`;n.enqueue(`<webjs-boundary id="${o}">`),await P(r.fallback,t,n),n.enqueue("</webjs-boundary>"),t.pending.push({id:o,promise:Promise.resolve(r.children)})}else await P(r.fallback,t,n);return}if(O(e)){await Vi(e,t,n);return}n.enqueue(ut(String(e)))}}}}async function Vi(e,t,n){let{strings:r,values:o}=e,s="text",i="",a=0,c="",l=0,h="",f="",u="";for(let b=0;b<r.length;b++){let g=r[b];for(let p=0;p<g.length;p++){let d=g[p];switch(s){case"text":u+=d,d==="<"&&(s="tag-open");break;case"tag-open":u+=d,d==="!"?s="bang-1":d==="/"?(s="tag-name",h=""):/[a-zA-Z]/.test(d)?(s="tag-name",h=d.toLowerCase()):s="text";break;case"bang-1":u+=d,s=d==="-"?"bang-dash":"tag-name";break;case"bang-dash":u+=d,d==="-"?(s="comment",l=0):s="tag-name";break;case"comment":u+=d,d==="-"?l+=1:(d===">"&&l>=2&&(s="text"),l=0);break;case"tag-name":u+=d,d===">"?(s=vt(h)?"rawtext":"text",s==="rawtext"&&(f="")):/\s/.test(d)?s="in-tag":h+=d.toLowerCase();break;case"in-tag":u+=d,d===">"?(s=vt(h)?"rawtext":"text",s==="rawtext"&&(f="")):!/\s/.test(d)&&d!=="/"&&(s="attr-name",i=d,a=u.length-1);break;case"rawtext":u+=d,f=(f+d.toLowerCase()).slice(-9),(f.endsWith("<\/script>")||f.endsWith("</style>"))&&(s="text",f="",h="");break;case"attr-name":d==="="?(s="after-eq",u+=d):/\s/.test(d)?(s="in-tag",i="",u+=d):d===">"?(s="text",i="",u+=d):(i+=d,u+=d);break;case"after-eq":d==='"'||d==="'"?(s="attr-quoted",c=d,u+=d):/\s/.test(d)?(s="in-tag",i="",u+=d):d===">"?(s="text",i="",u+=d):(s="attr-unquoted",u+=d);break;case"attr-unquoted":/\s/.test(d)?(s="in-tag",i="",u+=d):(d===">"&&(s="text",i=""),u+=d);break;case"attr-quoted":u+=d,d===c&&(s="in-tag",i="");break}}if(b<o.length){let p=o[b];if(p&&typeof p.then=="function"&&(p=await p),s==="comment")u+=String(p??""),l=0;else if(s==="rawtext")u+=String(p??""),f="";else if(s==="text")u&&(n.enqueue(u),u=""),await P(p,t,n);else if(s==="after-eq"){let d=i[0],m=i.slice(1),y=_e[d];y==="event"||y==="prop"?(u=u.slice(0,a),s="in-tag",i=""):y==="bool"?(u=u.slice(0,a),p&&(u+=`${m}=""`),s="in-tag",i=""):(u+=`"${F(String(p??""))}"`,s="in-tag",i="")}else(s==="attr-quoted"||s==="attr-unquoted")&&(u+=F(String(p??"")))}}u&&n.enqueue(u)}async function Ki(e,t,n){let r=Tn(),o=r?` nonce="${F(r)}"`:"";for(;e.pending.length;){let s=e.pending.splice(0);await Promise.all(s.map(async({id:i,promise:a})=>{try{let c=await a,l=await N(c,e),h=await ne(l,e,[],n);t.enqueue(`<template data-webjs-resolve="${i}">${h}</template><script${o}>(function(){var t=document.currentScript.previousElementSibling;var b=document.getElementById("${i}");if(b&&t){b.replaceWith(t.content.cloneNode(true));t.remove()}document.currentScript.remove()})()<\/script>`)}catch(c){console.error(`[webjs] Suspense boundary "${i}" rejected:`,c);try{let l=c instanceof Error?c:new Error(String(c)),h=await ne(await N(Zr("webjs-suspense",l,n),e),e,[],n);t.enqueue(`<template data-webjs-resolve="${i}">${h}</template><script${o}>(function(){var t=document.currentScript.previousElementSibling;var b=document.getElementById("${i}");if(b&&t){b.replaceWith(t.content.cloneNode(true));t.remove()}document.currentScript.remove()})()<\/script>`)}catch(l){console.error(`[webjs] Suspense boundary "${i}" error render also threw:`,l)}}}))}}var Qr=Symbol.for("webjs.notFound"),es=Symbol.for("webjs.redirect"),ts=Symbol.for("webjs.forbidden"),ns=Symbol.for("webjs.unauthorized");function Gi(){let e=new Error("webjs: notFound()");throw e.__webjs=Qr,e}function Yi(){let e=new Error("webjs: forbidden()");throw e.__webjs=ts,e}function Ji(){let e=new Error("webjs: unauthorized()");throw e.__webjs=ns,e}function Xi(e,t){let n=typeof t=="object"&&t!==null?t.status:t,r=new Error(`webjs: redirect(${e})`);throw r.__webjs=es,r.url=e,r.status=typeof n=="number"?n:void 0,r}function Zi(e){return!!e&&e.__webjs===Qr}function Qi(e){return!!e&&e.__webjs===es}function ea(e){return!!e&&e.__webjs===ts}function ta(e){return!!e&&e.__webjs===ns}function na(e,t={}){let n=t.reconnect!==!1,r=0,o=!1,s=null,i=[];function a(){o||(s=new WebSocket(ra(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 ra(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}`}Oe();var vn="application/vnd.webjs+json";async function sa(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",vn);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 Ze(r),n.has("content-type")||n.set("content-type",vn));let o=await fetch(e,{...t,headers:n,body:r}),s=o.headers.get("content-type")||"",i=await o.text(),a=s.includes(vn)?i?G(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}Oe();Ln();Rn();Rt();var sr=class{constructor(t,n){this.host=t,this.options=n,this.updates=[],this._nextId=0}get value(){let t=this.options.source();if(!this.options.update)return this.updates.length>0?this.updates[this.updates.length-1].payload:t;for(let n of this.updates)t=this.options.update(t,n.payload);return t}add(t,n){let r=`opt-${++this._nextId}`;this.updates.push({id:r,payload:t}),this.host?.requestUpdate?.();let o=()=>{let s=this.updates.findIndex(i=>i.id===r);s!==-1&&(this.updates.splice(s,1),this.host?.requestUpdate?.())};return n&&typeof n.then=="function"&&(typeof n.finally=="function"?n.finally(()=>o()).catch(()=>{}):n.then(()=>o(),()=>o())),o}};async function Ga(e,t,n){let r=e.get();e.set(t);let o;try{o=await n()}catch(s){throw e.set(r),s}return o&&o.success===!1&&e.set(r),o}function Ya(e,t,n){return e&&typeof e.get=="function"&&typeof e.set=="function"?Ga(e,t,n):new sr(e,t)}Mn();var Kt=0,Zs=new Map,He=new Map,Ja=1e3;function Xa(e){if(!(!Array.isArray(e)||!e.length)){Kt+=1;for(let t of e)t&&Zs.set(t,Kt)}}function Za(){return Kt}function Qa(e,t,n){if(!(!Array.isArray(t)||!t.length)&&(He.delete(e),He.set(e,{tags:t.slice(),since:typeof n=="number"?n:Kt}),He.size>Ja)){let r=He.keys().next().value;r!==void 0&&He.delete(r)}}function ec(e){let t=He.get(e);if(!t)return!1;for(let n of t.tags)if((Zs.get(n)||0)>t.since)return!0;return!1}function tc(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}var nc="application/vnd.webjs+stream",rc=1,sc=2,oc=3,Qs=new Uint8Array(0);function ic(e,t){let n=t||Qs,r=n.length,o=new Uint8Array(5+r);return o[0]=e&255,o[1]=r>>>24&255,o[2]=r>>>16&255,o[3]=r>>>8&255,o[4]=r&255,r&&o.set(n,5),o}function ac(){let e=Qs;return{push(t){if(t&&t.length){let r=new Uint8Array(e.length+t.length);r.set(e,0),r.set(t,e.length),e=r}let n=[];for(;e.length>=5;){let r=e[0],o=(e[1]<<24|e[2]<<16|e[3]<<8|e[4])>>>0;if(e.length<5+o)break;let s=e.slice(5,5+o);n.push({type:r,payload:s}),e=e.slice(5+o)}return n}}}var cc=Symbol.for("webjs.context");function lc(e){return{__context__:cc,name:e}}var Gt=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},or=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()}},ir=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 Gt(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)}};function uc(){return typeof window<"u"}var Y={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},ar=class{constructor(t,{task:n,args:r,autoRun:o=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=o,this._status=Y.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=Y.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=Y.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=Y.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 Y.INITIAL:return t.initial?.();case Y.PENDING:return t.pending?.();case Y.COMPLETE:return t.complete?.(this._value);case Y.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun||!uc())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{ir as ContextConsumer,or as ContextProvider,Gt as ContextRequestEvent,rc as FRAME_CHUNK,sc as FRAME_END,oc as FRAME_ERROR,j as MARKER,ds as SEED_MISS,nc as STREAM_CONTENT_TYPE,Ve as Signal,xi as Suspense,ar as Task,Y as TaskStatus,Tt as WebComponent,jn as WebjsFrame,On as WebjsStream,si as activeActionSignal,Xt as adoptStyles,En as allTags,fo as asyncAppend,po as asyncReplace,Eo as batch,lo as cache,xo as computed,na as connectWS,ec as consumeStale,lc as createContext,ac as createFrameDecoder,co as createRef,Tn as cspNonce,no as css,Hr as deserialize,ys as disableClientRouter,ko as effect,Vn as enableClientRouter,ic as encodeFrame,F as escapeAttr,ut as escapeText,Za as fetchMark,Yi as forbidden,oo as guard,Jt as html,Ce as isAsyncAppend,xe as isAsyncReplace,we as isCSS,le as isCache,ea as isForbidden,ae as isGuard,ie as isKeyed,ai as isLazy,Ae as isLive,Zi as isNotFound,Qi as isRedirect,ce as isRef,oe as isRepeat,To as isSignal,kt as isSuspense,O as isTemplate,Ee as isTemplateContent,ta as isUnauthorized,Se as isUnsafeHTML,ue as isUntil,fe as isWatch,so as keyed,ro as live,An as lookup,ii as lookupModuleUrl,Xa as markStale,ws as navigate,Gi as notFound,Ya as optimistic,G as parse,tc as parseTagHeader,oi as primeModuleUrl,Ci as prop,Xi as redirect,ao as ref,Sn as register,Qa as registerKeyTags,Le as render,In as renderStream,zi as renderToStream,ki as renderToString,dr as repeat,_s as revalidate,sa as richFetch,Lt as scanSeeds,qr as serialize,St as setActiveActionSignal,Ti as setCspNonceProvider,Co as signal,Ze as stringify,lt as stylesToString,Ct as tagOf,fa as takeSeed,io as templateContent,Ji as unauthorized,Zt as unsafeHTML,uo as until,ho as watch};
7
7
  //# sourceMappingURL=webjs-core.js.map