@webjsdev/core 0.7.38 → 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.
- package/dist/webjs-core-browser.js +3 -3
- package/dist/webjs-core-browser.js.map +3 -3
- package/dist/webjs-core-testing.js +16 -16
- package/dist/webjs-core-testing.js.map +3 -3
- package/dist/webjs-core.js +5 -5
- package/dist/webjs-core.js.map +3 -3
- package/package.json +1 -1
- package/src/component.js +65 -27
- package/src/render-client.js +20 -7
- package/src/render-server.js +60 -31
- package/src/router-client.js +524 -187
- package/src/slot.js +180 -360
- package/src/webjs-frame.js +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Ls=Object.defineProperty;var P=(e,t)=>()=>(e&&(t=e(e=0)),t);var Un=(e,t)=>{for(var n in t)Ls(e,n,{get:t[n],enumerable:!0})};function Os(e,...t){return{_$webjs:"template",strings:e,values:t}}function C(e){return!!e&&typeof e=="object"&&e._$webjs==="template"}var y,Me=P(()=>{y="wjm-"});function Gn(e){if(!e||e.nodeType!==8)return!1;let t=e.nodeValue;return t===lo||t===uo}function fo(e){for(let t of e.addedNodes)if(Gn(t))return!0;for(let t of e.removedNodes)if(Gn(t))return!0;return!1}function Zn(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}function po(){Yn||(we=Zn(),we&&(_e=HTMLSlotElement.prototype.assignedNodes,Wt=HTMLSlotElement.prototype.assignedElements,Ke=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(t){return this.hasAttribute(j)&&!Jn(this)?Kt(this,t):_e?_e.call(this,t):[]},HTMLSlotElement.prototype.assignedElements=function(t){return this.hasAttribute(j)&&!Jn(this)?Kt(this,t).filter(n=>n.nodeType===1):Wt?Wt.call(this,t):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let t=Ke&&Ke.get?Ke.get.call(this):null;return t||mo(this)}}),Yn=!0))}function Jn(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 Kt(e,t){if(e.getAttribute(F)===er)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:Gt(n,new Set,0)}function Gt(e,t,n){if(n>=ho)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(j)){let i=Kt(o,{flatten:!1});if(i.length>0)for(let c of Gt(i,t,n+1))r.push(c);else for(let c of Gt(Array.from(o.childNodes),t,n+1))r.push(c)}else if(_e){let i=_e.call(o,{flatten:!0});for(let c of i)r.push(c)}else r.push(s)}else r.push(s);return r}function mo(e){let t=e.parentElement;for(;t;){if(t.tagName==="SLOT"&&t.hasAttribute(j))return t.getAttribute(F)===K?t:null;t=t.parentElement}return null}function D(e){let t=e,n=t[I];return n||(n={assignedByName:new Map,pendingByName:new Map,lastSnapshot:new WeakMap,nameObservers:new WeakMap,childObserver:null,scheduled:!1,ownedSlots:new Set},t[I]=n),n}function Yt(e){return!!e[I]}function tr(e){let t=D(e);for(;e.firstChild;){let n=e.firstChild,r=Ge(n);Ye(t.assignedByName,r,n),e.removeChild(n)}}function nr(e){let t=D(e),n=e.querySelectorAll(`slot[${j}]`);for(let r of n){let s=r;if(s.getAttribute(F)!==K)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 Ge(e){if(e.nodeType!==1)return null;let n=e.getAttribute("slot");return n||null}function Ye(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}function rr(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 sr(e){if(!we)return;let t=D(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&&(Ye(t.assignedByName,Ge(o),o),r=!0);for(let o of s.removedNodes)e.contains(o)||Xn(t,o)&&(r=!0)}else if(s.type==="attributes"&&s.attributeName==="slot"){let o=s.target;(Xn(t,o)||o.parentElement===e)&&(Ye(t.assignedByName,Ge(o),o),r=!0)}}r&&Xe(e)}),t.childObserver.observe(e,{childList:!0,attributes:!0,attributeFilter:["slot"],subtree:!0}))}function or(e){let t=e[I];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 Xn(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 Xe(e){let t=D(e);t.scheduled||(t.scheduled=!0,queueMicrotask(()=>{t.scheduled=!1,bo(e)}))}function bo(e){if(!we)return;let t=e[I];if(!t)return;let n=Array.from(e.querySelectorAll(`slot[${j}]`)),r=new Set(n);for(let i of t.ownedSlots)r.has(i)||yo(t,i);for(let i of r)t.ownedSlots.has(i)||go(e,i);t.ownedSlots=r;let s=new Map;for(let i of n){let c=i.getAttribute("name")||null,a=s.get(c);a||(a=[],s.set(c,a)),a.push(i)}for(let i of s.keys()){let c=t.pendingByName.get(i);if(c&&c.length){let a=t.assignedByName.get(i)||[],l=[];for(let u of c)l.push(u);for(let u of a)l.indexOf(u)===-1&&l.push(u);t.assignedByName.set(i,l),t.pendingByName.delete(i)}}let o=[];for(let[i,c]of s){let a=t.assignedByName.get(i)||[];for(let l=0;l<c.length;l++){let u=c[l];l===0&&a.length>0?Jt(t,u,a)&&o.push(u):Xt(t,u)&&o.push(u)}}for(let i of o)Se(i)}function yo(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;rr(e.pendingByName,s,r)}e.lastSnapshot.delete(t)}function Jt(e,t,n){let r=t.getAttribute(F)!==K,s=e.lastSnapshot.get(t)||[];if(!r&&_o(s,n))return!1;let i=t[Je];if(r&&i)for(;t.firstChild;)i.appendChild(t.firstChild);else for(;t.firstChild;)t.removeChild(t.firstChild);for(let c of n)t.appendChild(c);return t.setAttribute(F,K),e.lastSnapshot.set(t,n.slice()),!0}function Xt(e,t){let n=t.getAttribute(F)===K;if(t.setAttribute(F,er),!n)return Qn(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return Qn(t),!0}function Qn(e){let t=e[Je];!t||t.childNodes.length===0||e.appendChild(t)}function go(e,t){if(!we)return;let n=D(e);if(n.nameObservers.has(t))return;let r=new MutationObserver(()=>Xe(e));r.observe(t,{attributes:!0,attributeFilter:["name"]}),n.nameObservers.set(t,r)}function ir(e,t){if(!Yt(e))return;let n=D(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);rr(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 Se(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function _o(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 lo,uo,we,I,j,F,K,er,Je,ho,_e,Wt,Ke,Yn,Qe=P(()=>{Me();lo=`${y}s`,uo=`${y}e`;we=Zn(),I=Symbol("webjs.slot.state"),j="data-webjs-light",F="data-projection",K="actual",er="fallback",Je=Symbol("webjs.slot.fallbackFrag"),ho=64,_e=null,Wt=null,Ke=null,Yn=!1;po()});function wr(e,t,n){Wo.has(t)?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}async function sn(e){return JSON.stringify(await Sr(e))}function Y(e){return Ar(JSON.parse(e))}async function Sr(e){let t=Ko();return await Go(e,t),G(e,t)}function Ar(e){return q(e,Qo())}function Ko(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map,fdEntries:new Map}}async function Go(e,t){let n=[e];for(;n.length;){let r=n.pop();if(!ei(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(ti(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 G(e,t){if(e===null)return null;if(e===void 0)return{[_]:"undef"};let n=typeof e;if(n==="string"||n==="boolean")return e;if(n==="number")return Number.isNaN(e)?{[_]:"NaN"}:e===1/0?{[_]:"Inf"}:e===-1/0?{[_]:"-Inf"}:Object.is(e,-0)?{[_]:"-0"}:e;if(n==="bigint")return{[_]:"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{[_]:"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{[_]:"Ref",v:r};r!==void 0&&t.emitted.add(r);let s;if(e instanceof Date)s={[_]:"Date",v:Number.isNaN(e.getTime())?null:e.toISOString()};else if(e instanceof Error)s={[_]:"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={[_]:"File",v:Ee(o),n:e.name,t:e.type||"",m:e.lastModified}:s={[_]:"Blob",v:Ee(o),t:e.type||""}}else if(typeof FormData<"u"&&e instanceof FormData){let o=t.fdEntries.get(e)||[...e.entries()],i=[];for(let[c,a]of o)i.push([c,G(a,t)]);s={[_]:"FD",v:i}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)s=Yo(e);else if(e instanceof Map){let o=[];for(let[i,c]of e)o.push([G(i,t),G(c,t)]);s={[_]:"Map",v:o}}else if(e instanceof Set){let o=[];for(let i of e)o.push(G(i,t));s={[_]:"Set",v:o}}else if(Array.isArray(e))s=e.map(o=>G(o,t));else{s={};for(let o in e){if(!Object.prototype.hasOwnProperty.call(e,o))continue;let i=ni(o)?"_"+o:o;wr(s,i,G(e[o],t))}}if(r!==void 0){if(Array.isArray(s))return{[_]:"Arr",_id:r,v:s};s._id=r}return s}function Yo(e){if(e instanceof ArrayBuffer)return{[_]:"buf",v:Ee(new Uint8Array(e))};if(e instanceof DataView)return{[_]:"dv",v:Ee(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=Jo[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[_]:n,v:Ee(r)}}function Qo(){return{refs:new Map}}function q(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(q(e[i],t));return o}let n=e[_];if(typeof n=="string")return Zo(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=ri(o)?o.slice(1):o;wr(r,i,q(e[o],t))}return r}function Zo(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,c]of e.v)o.set(q(i,n),q(c,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(q(i,n));return o}case"Arr":{let o=[];typeof r=="number"&&n.refs.set(r,o);for(let i of e.v)o.push(q(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=ve(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=ve(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,c]of e.v){let a=q(c,n);o.append(i,a)}return o}default:{if(t==="buf"){let i=ve(e.v);return s(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength))}if(t==="dv"){let i=ve(e.v);return s(new DataView(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)))}let o=Xo[t];if(o){let i=ve(e.v),c=i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength);return s(new o(c))}throw new TypeError(`Unknown serialization tag: ${t}`)}}}function ei(e){return e!==null&&typeof e=="object"}function ti(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function ni(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function ri(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}function Ee(e){if(vr)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 ve(e){if(vr){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 _,Wo,Jo,Xo,vr,Ce=P(()=>{_="_$wj",Wo=new Set(["__proto__","constructor","prototype"]);Jo={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},Xo={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};vr=typeof Buffer<"u"&&typeof Buffer.from=="function"});var Pr={};Un(Pr,{observeLazy:()=>vi,observeViewportOnce:()=>Ti});function Mr(e){let t=cn.get(e);return t||(t=import(e).finally(()=>cn.delete(e)),cn.set(e,t),t)}function vi(e){for(let[t,n]of Object.entries(e))J.set(t.toLowerCase(),n);if(typeof IntersectionObserver>"u"){for(let t of J.values())Mr(t);J.clear();return}ke||(ke=new IntersectionObserver(Ei,{rootMargin:"200px"})),Or(),typeof MutationObserver<"u"&&new MutationObserver(()=>Or()).observe(document.body,{childList:!0,subtree:!0})}function Or(){if(!(!ke||!J.size))for(let e of J.keys())for(let t of document.querySelectorAll(e))ke.observe(t)}function Ei(e){for(let t of e){if(!t.isIntersecting)continue;let n=t.target.tagName.toLowerCase(),r=J.get(n);r&&(Mr(r),J.delete(n),ke?.unobserve(t.target))}}function Ci(e){for(let t of e){if(!t.isIntersecting)continue;let n=ct.get(t.target);ct.delete(t.target),Te?.unobserve(t.target),n&&n()}}function Ti(e,t){return typeof IntersectionObserver>"u"?(t(),()=>{}):(Te||(Te=new IntersectionObserver(Ci,{rootMargin:"200px"})),ct.set(e,t),Te.observe(e),()=>{ct.delete(e),Te?.unobserve(e)})}var J,ke,cn,Te,ct,Ir=P(()=>{J=new Map,ke=null,cn=new Map;Te=null,ct=new WeakMap});var ln,un=P(()=>{ln=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(()=>(Ir(),Pr)).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(()=>(lt(),Fr)).then(({loadFrame:n})=>{this._webjsLoadedSrc!==t||!this.isConnected||n(this,t)})}}:null;typeof customElements<"u"&&ln&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",ln)});function Ni(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 dn(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 ki,fn,ut=P(()=>{ki=new Set(["append","prepend","before","after","replace","update"]);fn=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=ki.has(t)?this.querySelector("template"):null;try{for(let i of r){let c=o?o.content.cloneNode(!0):null;Ni(t,i,c)}}finally{this.remove()}}}:null;typeof customElements<"u"&&fn&&!customElements.get("webjs-stream")&&customElements.define("webjs-stream",fn)});var Br,Ur=P(()=>{Br=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this.style.display||(this.style.display="contents")}}:null;typeof customElements<"u"&&Br&&!customElements.get("webjs-suspense")&&customElements.define("webjs-suspense",Br)});function ft(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]'))$r(n.textContent,n);for(let n of t.querySelectorAll("[data-webjs-seed]"))$r(n.getAttribute("data-webjs-seed"),n,()=>n.removeAttribute("data-webjs-seed"))}}function $r(e,t,n){if(e)try{let r=Y(e);if(r&&typeof r=="object")for(let s in r)Ne.has(s)||Ne.set(s,r[s])}catch{}n?n():t.remove?.()}function xi(e,t,n){Dr||(Dr=!0,ft());let r=`${e}/${t}/${n}`;if(Ne.has(r)){let s=Ne.get(r);return Ne.delete(r),s}return Hr}var Ne,Hr,Dr,hn=P(()=>{Ce();Ne=new Map,Hr=Symbol("webjs.seed.miss"),Dr=!1});var Fr={};Un(Fr,{_FRAME_TOP:()=>rs,_LIVE_ATTRS:()=>wn,_activeFrameId:()=>ns,_addNewHeadElements:()=>Sn,_applyStreamedResolve:()=>ks,_applySwap:()=>Ln,_blurOutgoingFocus:()=>pt,_buildHaveHeader:()=>Nn,_buildSubmitFormData:()=>es,_bumpNavToken:()=>ra,_clearFormBusy:()=>ys,_clearFrameBusy:()=>ms,_collectChildrenSlots:()=>he,_currentPageUrl:()=>sa,_diffElementInPlace:()=>St,_eligibleAnchorHref:()=>bt,_findAnchorInPath:()=>ts,_getSubmitAction:()=>Zr,_getSubmitMethod:()=>Qr,_isNonHtmlPath:()=>aa,_keyOf:()=>de,_longestSharedPath:()=>os,_markFormBusy:()=>bs,_markFrameBusy:()=>ps,_mergeHead:()=>Es,_navToken:()=>na,_onPopState:()=>En,_onSubmit:()=>Cn,_parseHTML:()=>An,_prefetch:()=>pe,_prefetchCache:()=>w,_prefetchHasHoverPointer:()=>ls,_prefetchInflightSize:()=>ea,_prefetchMode:()=>yt,_prefetchPeek:()=>Zi,_prefetchSaysSaveData:()=>xn,_prefetchSuppressed:()=>us,_prefetchTake:()=>fs,_reactivateScripts:()=>At,_readStreamedShell:()=>Cs,_reconcileChildren:()=>Ct,_regraftPermanentElements:()=>_s,_regraftPermanentInSlice:()=>Rn,_resetPrefetch:()=>ta,_resetWarnOnce:()=>ia,_resolveTargetFrameId:()=>Tn,_restoreOptimistic:()=>xe,_runWithTransition:()=>ht,_setCurrentPageUrl:()=>oa,_snapshotCache:()=>v,_streamBoundariesProgressively:()=>Ns,_takeResolveUnit:()=>Ts,_viewTransitionsEnabled:()=>gs,collectChildrenSlots:()=>he,disableClientRouter:()=>Gr,enableClientRouter:()=>vn,loadFrame:()=>Ri,longestSharedPath:()=>os,navigate:()=>Yr,revalidate:()=>Jr});function An(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 ji(){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 s of r.querySelectorAll("*"))s.tagName?.includes("-")&&customElements.upgrade(s)}}),pn.observe(document.body,{childList:!0,subtree:!0}))}function vn(){V||typeof document>"u"||(V=!0,document.addEventListener("click",Xr,!1),document.addEventListener("submit",Cn,!1),window.addEventListener("popstate",En),document.addEventListener("pointerover",fe,!0),document.addEventListener("focusin",fe,!0),document.addEventListener("touchstart",fe,{capture:!0,passive:!0}),document.addEventListener("pointerout",ds,!0),document.addEventListener("webjs:navigate",_n),ji(),_n(),typeof history<"u"&&"scrollRestoration"in history&&(dt=history.scrollRestoration,history.scrollRestoration="manual"),typeof location<"u"&&(O=location.href))}function Gr(){V&&(V=!1,document.removeEventListener("click",Xr,!1),document.removeEventListener("submit",Cn,!1),window.removeEventListener("popstate",En),document.removeEventListener("pointerover",fe,!0),document.removeEventListener("focusin",fe,!0),document.removeEventListener("touchstart",fe,{capture:!0}),document.removeEventListener("pointerout",ds,!0),document.removeEventListener("webjs:navigate",_n),Et(),jn(),z&&(z.disconnect(),z=null),typeof history<"u"&&dt!==null&&(history.scrollRestoration=dt,dt=null),O=null)}async function Yr(e,t){let n=new URL(e,location.href);if(n.origin!==location.origin){location.href=e;return}await kn(n.href,t?.replace??!1,null)}async function Ri(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};N&&N.abort(),N=new AbortController;let s=N.signal,o=++S;return gt(r.href,n,!1,null,"GET",null,s,o)}function Jr(e){if(!e){v.clear(),w.clear();return}let t=new URL(e,location.href),n=t.pathname+t.search;v.delete(n),w.delete(n)}function Xr(e){if(!V||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=ts(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=Tn(t);kn(n,!1,s)}function En(e){kn(location.href,!0,null)}function Cn(e){if(!V||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=Qr(t,n);if(s==="dialog")return;let o=Zr(t,n),i;try{i=new URL(o,location.href)}catch{return}if(i.origin!==location.origin||vt.test(i.pathname))return;let c=es(t,n);e.preventDefault();let a=Tn(n||t);Mi(i.href,s,c,a,t)}function Qr(e,t){return(t&&t.getAttribute("formmethod")||e.getAttribute("method")||"get").toLowerCase()}function Zr(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function es(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 ts(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function ns(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 Tn(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:(ss(`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 ns(e)}function ss(e,t){bn.has(e)||(bn.add(e),typeof console<"u"&&console.warn&&console.warn(t))}function zr(){if(typeof process<"u"&&process.env||yn||typeof document>"u"||typeof getComputedStyle!="function")return;let e=document.documentElement;if(!e)return;yn=!0;let t;try{t=getComputedStyle(e).scrollBehavior}catch{return}t==="smooth"&&ss("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 mt(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 he(e){let t=new Map,n=[];function r(s){if(s.nodeType===8){let o=s,i=o.data,c=/^wj:children:(.+)$/.exec(i);if(c){n.push({path:c[1],start:o});return}if(i.trim()==="/wj:children"){let a=n.pop();a&&!t.has(a.path)&&t.set(a.path,{start:a.start,end:o});return}return}if(s.hasChildNodes&&s.hasChildNodes())for(let o=s.firstChild;o;o=o.nextSibling)r(o)}return r(e),t}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 is(e){let t=Z(e);document.dispatchEvent(new CustomEvent("webjs:before-cache",{detail:{url:e}})),v.has(t)&&v.delete(t);let n={html:document.documentElement.outerHTML,scrollX:typeof window<"u"&&window.scrollX||0,scrollY:typeof window<"u"&&window.scrollY||0};for(v.set(t,n);v.size>Li;){let r=v.keys().next().value;v.delete(r)}}function Oi(e){let t=Z(e),n=v.get(t);return n==null?null:(v.delete(t),v.set(t,n),typeof n=="string"?{html:n,scrollX:0,scrollY:0}:n)}function Z(e){let t=new URL(e,location.href);return t.pathname+t.search}async function kn(e,t,n){N&&N.abort(),N=new AbortController;let r=N.signal,s=++S;O&&is(O);let o=setTimeout(()=>{mt(!0),o=null},150),i=null;t||(i=Ss());try{if(t){let c=Oi(e);if(c){let a=An(c.html);if(a){Ln(a,n,!0,null),typeof window<"u"&&window.scrollTo({left:c.scrollX,top:c.scrollY,behavior:"instant"}),gt(e,n,!1,i,"GET",null,r,s).catch(()=>{});return}}typeof window<"u"&&window.scrollTo({left:0,top:0,behavior:"instant"})}await gt(e,n,!t,i,"GET",null,r,s)}finally{o&&clearTimeout(o),s===S&&(mt(!1),typeof location<"u"&&(O=location.href))}}async function Mi(e,t,n,r,s){N&&N.abort(),N=new AbortController;let o=N.signal,i=++S,c=t==="get"||t==="head",a=new URL(e,location.href);if(c){a.search="";for(let[p,m]of n)a.searchParams.append(p,typeof m=="string"?m:m.name)}O&&is(O);let l=setTimeout(()=>{mt(!0),l=null},150),u=Ss(),d=s?bs(s,i,a.href):null,f=!1;try{let p=await gt(a.href,r,!0,u,c?"GET":t.toUpperCase(),c?null:n,o,i);f=!!(p&&p.ok),!c&&i===S&&(v.clear(),w.clear())}finally{d&&ys(d,i,a.href,f),l&&clearTimeout(l),i===S&&(mt(!1),typeof location<"u"&&(O=location.href))}}function Nn(){return[...he(document.body).keys()].join(",")}function xn(){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 ls(){try{if(typeof matchMedia=="function")return matchMedia("(hover: hover) and (pointer: fine)").matches}catch{}return!0}function Ui(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 us(e){if(e.hasAttribute("data-no-prefetch"))return!0;let t=Ui(e);return t.includes("external")||t.includes("no-prefetch")}function yt(e){if(us(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 ls()?"intent":"viewport"}}function pe(e){if(!V||typeof fetch!="function"||xn())return;let t=Z(e);if(X.has(t)||je.has(t))return;let n=w.get(t);if(n&&gn()-n.at<as)return;if(X.size>=cs){for(je.add(t),le.push(e);le.length>Ii;){let o=le.shift();je.delete(Z(o))}return}let r=Nn();if(!r&&typeof document<"u"&&document.readyState==="loading")return;X.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 c=o.headers.get("x-webjs-build"),a=o.headers.get("x-webjs-src"),l=typeof document<"u"?document.querySelector('script[type="importmap"]'):null,u=l?l.getAttribute("data-webjs-build"):null,d=l?l.getAttribute("data-webjs-src"):null;(c&&u&&c!==u||a&&d&&a!==d)&&(v.clear(),w.clear());let f=o.redirected&&o.url?o.url:e,p=await o.text();$i(t,{html:p,build:c,src:a,finalUrl:f,at:gn()})}).catch(()=>{}).finally(()=>{X.delete(t),Di()})}function Di(){for(;le.length&&X.size<cs;){let e=le.shift();je.delete(Z(e)),pe(e)}}function $i(e,t){for(w.has(e)&&w.delete(e),w.set(e,t);w.size>Pi;){let n=w.keys().next().value;w.delete(n)}typeof document<"u"&&document.dispatchEvent(new CustomEvent("webjs:prefetch",{detail:{url:t.finalUrl,key:e,from:"prefetch"}}))}function fs(e){let t=Z(e),n=w.get(t);return!n||(w.delete(t),gn()-n.at>=as)?null:n}function gn(){try{if(typeof performance<"u"&&typeof performance.now=="function")return performance.now()}catch{}return 0}function fe(e){if(!V)return;let t=hs(e.target);if(!t)return;let n=yt(t);if(n==="none"||n==="render")return;let r=bt(t);if(r){if(e.type==="touchstart"){pe(r);return}n==="intent"&&(Re===t&&ue||(Et(),Re=t,ue=setTimeout(()=>{ue=null,Re=null,pe(r)},Fi)))}}function ds(e){let t=hs(e.target);t&&t===Re&&Et()}function Et(){ue&&(clearTimeout(ue),ue=null),Re=null}function jn(){for(let e of Le)clearTimeout(e);Le.clear(),ae=new WeakMap}function hs(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 _n(){if(typeof document>"u"||xn())return;let e=typeof IntersectionObserver<"u";e&&(z?(z.disconnect(),jn()):z=new IntersectionObserver(t=>{for(let n of t){let r=n.target;if(n.isIntersecting){if(ae.has(r))continue;let s=setTimeout(()=>{Le.delete(s),ae.delete(r),z.unobserve(r);let o=bt(r);o&&yt(r)==="viewport"&&pe(o)},Bi);ae.set(r,s),Le.add(s)}else{let s=ae.get(r);s&&(clearTimeout(s),Le.delete(s),ae.delete(r))}}},{threshold:.5}));for(let t of document.querySelectorAll("a[href]")){let n=yt(t);if(n==="render"){let r=bt(t);r&&pe(r)}else n==="viewport"&&e&&z.observe(t)}}function Hi(e){if(typeof document>"u"||!document.body)return!1;let t=he(document.body),n,r=-1;for(let[a,l]of t)a.length>r&&(r=a.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 c=document.createRange();return c.setStartAfter(n.start),c.setEndBefore(n.end),c.deleteContents(),s.insertBefore(o,n.end),!0}function mn(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||Hi(t)||typeof location<"u"&&(location.href=e)}async function gt(e,t,n,r,s,o,i,c){s=s||"GET";let a=typeof c=="number"?c:S,l,u=null,d=null,f=null,p=null,m=!1,k=e,T=t?ps(t,a):null;try{try{let g=s==="GET"&&!o&&!t?fs(e):null;if(g)l=g.html,d=g.build,f=g.src,k=g.finalUrl,p=200,m=!0;else{let b={"x-webjs-router":"1"},M=Nn();M&&(b["x-webjs-have"]=M),t&&(b["x-webjs-frame"]=t),o!=null&&s!=="GET"&&s!=="HEAD"&&(b.accept=qr+", text/html");let W={method:s,headers:b,credentials:"same-origin"};i&&(W.signal=i),o!=null&&s!=="GET"&&s!=="HEAD"&&(W.body=o);let A=await fetch(e,W);p=A.status,m=A.ok;let ee=A.headers.get("content-type")||"",Oe=/^text\/html\b/i.test(ee);if(ee.toLowerCase().indexOf(qr)===0){let Rs=await A.text();return a===S&&(xe(r),dn(Rs)),{ok:m,status:p,aborted:!1}}if(A.redirected&&A.url&&(k=A.url),A.status===204||A.status===205)return a===S&&n&&history.pushState(null,"",k),{ok:m,status:p,aborted:!1};if(!Oe)return a===S&&(xe(r),mn(e,A.status,null)),{ok:!1,status:p,aborted:!1};d=A.headers.get("x-webjs-build"),f=A.headers.get("x-webjs-src");let Nt=await Cs(A);l=Nt.shell,Nt.streaming&&(u=Nt)}}catch(g){return g&&g.name==="AbortError"?{ok:!1,status:null,aborted:!0}:a!==S?{ok:!1,status:null,aborted:!0}:(xe(r),mn(e,null,g instanceof Error?g:new Error(String(g))),{ok:!1,status:null,aborted:!1})}if(a!==S){if(u&&u.reader)try{u.reader.cancel()}catch{}return{ok:!1,status:p,aborted:!0}}let h=An(l);if(!h)return xe(r),mn(e,null,new Error("navigation response did not parse as HTML")),{ok:!1,status:p,aborted:!1};if(Ln(h,t,!1,k,d,f),n&&history.pushState(null,"",k),n){let g=new URL(k);if(g.hash){let b=document.getElementById(g.hash.slice(1));b?b.scrollIntoView():(zr(),window.scrollTo({left:0,top:0,behavior:"instant"}))}else zr(),window.scrollTo({left:0,top:0,behavior:"instant"})}return u&&(u.reader||u.rest)&&Ns(u.reader,u.dec,u.rest,()=>a===S),document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:k,frameId:t,from:"navigate"}})),{ok:m,status:p,aborted:!1}}finally{T&&ms(T,a)}}function ps(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=_t.has(n);return _t.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 ms(e,t){if(_t.get(e)!==t)return;_t.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 bs(e,t,n){let r=wt.has(e);return wt.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 ys(e,t,n,r){if(wt.get(e)!==t)return;wt.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 Vr(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+=Q(r);return n}function gs(){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 ht(e,t){let n=typeof document<"u"?document.startViewTransition:void 0;if(gs()&&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 _s(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 Rn(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=qi(t,s);if(!o||o===r)continue;let i=o.parentNode;if(i)i.replaceChild(r,o);else{let c=t.indexOf(o);c!==-1&&(t[c]=r)}}}function qi(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 zi(e){if(!(!e||!e.start))for(let t=e.start.nextSibling;t&&t!==e.end;t=t.nextSibling)t.nodeType===1&&ce(t)}function Ln(e,t,n,r,s,o){try{ft(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"]'),f=d?d.getAttribute("data-webjs-build"):null,p=!1;if(s&&f&&(p=s!==f),!p&&e.head&&e.head.children.length>0){let m=Vr(document),k=Vr(e);m!==k&&(p=!0)}if(p&&typeof location<"u"){v.clear(),w.clear();try{let m="webjs:importmap-reload";if(sessionStorage&&sessionStorage.getItem(m))sessionStorage.removeItem(m);else{sessionStorage&&sessionStorage.setItem(m,"1"),location.href=r;return}}catch{location.href=r;return}}else if(!p){let m=d?d.getAttribute("data-webjs-src"):null;o&&m&&o!==m&&(v.clear(),w.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)}`),f=e.querySelector(`webjs-frame#${CSS.escape(t)}`);if(d&&f){Sn(e.head),ht(()=>{Xi(d,f),At(d),ce(d),pt()},()=>ce(d)),Kr(e.body);return}let p=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(p),p.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=he(document.body),c=he(e.body),a=os(i,c);if(a){Sn(e.head),ht(()=>{Vi(i.get(a),c.get(a),e),pt()},()=>zi(i.get(a))),Kr(e.body);return}Es(e.head),_s(document.body,e.body);let l=[...e.body.childNodes];ht(()=>{document.body.replaceChildren(...l),At(document.body),ce(document.body),pt()},()=>ce(document.body))}function pt(){let e=document.activeElement;!e||e===document.body||e===document.documentElement||typeof e.blur=="function"&&e.blur()}function Vi(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));Rn(s,o),Wi(r,e.start,e.end,s,o);for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)i.nodeType===1&&(At(i),ce(i))}function Wi(e,t,n,r,s){let o=new Map;for(let a of r){if(a.nodeType!==1)continue;let l=de(a);l&&o.set(l,a)}let i=n,c=[];for(let a of s){if(a.nodeType===1){let l=de(a);if(l&&o.has(l)){let u=o.get(l);St(u,a),c.push(u),o.delete(l);continue}}c.push(a)}for(let a of r)if(a.parentNode===e){if(a.nodeType===1&&c.includes(a))continue;e.removeChild(a)}for(let a of c)e.insertBefore(a,i)}function St(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),!wn.has(r.name)&&e.getAttribute(r.name)!==r.value&&e.setAttribute(r.name,r.value);for(let r of[...e.attributes])wn.has(r.name)||n.has(r.name)||e.removeAttribute(r.name);if(Ki(e)){Ji(e,t);return}Ct(e,t)}function Ki(e){return e[Symbol.for("webjs.instance")]!=null}function ws(e,t){for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!1;return!0}function Wr(e){let t=new Map,n=`slot[${j}][${F}="${K}"]`;for(let r of e.querySelectorAll(n)){let s=r;if(!ws(s,e))continue;let o=s.getAttribute("name")||null;t.has(o)||t.set(o,s)}return t}function Gi(e,t){for(let n of e.querySelectorAll(`slot[${j}]`)){let r=n;if(ws(r,e)&&(r.getAttribute("name")||null)===t)return r}return null}function Yi(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 Ji(e,t){let n=e[I];if(!n)return;let r=Wr(e),s=Wr(t);if(r.size===0&&s.size===0)return;let o=new Set([...r.keys(),...s.keys()]);for(let i of o){let c=r.get(i),a=s.get(i);if(c&&a){let l=n.lastSnapshot.get(c)||[];Ct(c,a);let u=[...c.childNodes];n.assignedByName.set(i,u),n.lastSnapshot.set(c,u.slice()),Yi(l,u)||Se(c)}else if(c&&!a)n.assignedByName.delete(i),Xt(n,c)&&Se(c);else{let l=Gi(e,i);if(!l)continue;let u=[...a.childNodes].map(d=>document.importNode(d,!0));n.assignedByName.set(i,u),Jt(n,l,u)&&Se(l)}}}function Ct(e,t){let n=[...e.childNodes],r=[...t.childNodes].map(c=>document.importNode(c,!0));Rn(n,r);let s=new Map;for(let c of n){if(c.nodeType!==1)continue;let a=de(c);a&&s.set(a,c)}let o=[];for(let c=0;c<r.length;c++){let a=r[c];if(a.nodeType===1){let l=de(a);if(l&&s.has(l)){let d=s.get(l);St(d,a),o.push(d),s.delete(l);continue}let u=n[c];if(u&&u.nodeType===1&&!de(u)&&u.tagName===a.tagName){St(u,a),o.push(u);continue}}else if(a.nodeType===3){let l=n[c];if(l&&l.nodeType===3){l.nodeValue!==a.nodeValue&&(l.nodeValue=a.nodeValue),o.push(l);continue}}else if(a.nodeType===8){let l=n[c];if(l&&l.nodeType===8){l.nodeValue!==a.nodeValue&&(l.nodeValue=a.nodeValue),o.push(l);continue}}o.push(a)}let i=new Set(o);for(let c of n)!i.has(c)&&c.parentNode===e&&e.removeChild(c);for(let c=0;c<o.length;c++){let a=o[c];(a.parentNode!==e||e.childNodes[c]!==a)&&e.insertBefore(a,e.childNodes[c]||null)}}function de(e){let t=e.getAttribute("data-key");return t?`${e.tagName}:k:${t}`:e.id?`${e.tagName}:i:${e.id}`:null}function Ss(){let e=he(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:S}}function xe(e){if(!e||e.token!==S)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 Xi(e,t){Ct(e,t)}function As(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function On(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=As();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=As();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function Q(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function Sn(e){let t=e.querySelector("title");t&&(document.title=t.textContent||"");let n=new Set;for(let r of document.head.children)n.add(Q(r));for(let r of e.children)r.tagName==="SCRIPT"&&r.getAttribute("type")==="importmap"||r.tagName!=="BASE"&&r.tagName!=="TITLE"&&(n.has(Q(r))||(r.tagName==="SCRIPT"?document.head.appendChild(On(r)):document.head.appendChild(vs(r))))}function Qi(e){return e.tagName==="STYLE"?!0:e.tagName==="LINK"&&(e.getAttribute("rel")||"").toLowerCase().split(/\s+/).includes("stylesheet")}function Es(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(Q(o));let s=new Set;for(let o of e.children)o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&s.add(Q(o));for(let o of[...t.children])o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&o.tagName!=="TITLE"&&(Qi(o)||s.has(Q(o))||o.remove());for(let o of e.children)o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&o.tagName!=="TITLE"&&(r.has(Q(o))||(o.tagName==="SCRIPT"?t.appendChild(On(o)):t.appendChild(vs(o))))}function ce(e){typeof customElements>"u"||Mn(e)}function Mn(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&&Mn(n.shadowRoot))}function Kr(e){for(let t of e.querySelectorAll("template[data-webjs-resolve]"))document.body.appendChild(t.cloneNode(!0))}async function Cs(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:c,done:a}=await t.read();c&&(r+=n.decode(c,{stream:!0})),a&&(r+=n.decode());let l=r.indexOf(o);if(l!==-1)return{shell:r.slice(0,l),streaming:!0,reader:a?null:t,dec:n,rest:r.slice(l+o.length)};let u=r.indexOf(s);if(u!==-1)return{shell:r.slice(0,u),streaming:!0,reader:a?null:t,dec:n,rest:r.slice(u)};if(a)return{shell:r,streaming:!1};let d=i.exec(r);if(d){let f=d.index+d[0].length;return{shell:r.slice(0,f),streaming:!0,reader:t,dec:n,rest:r.slice(f)}}}}function Ts(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 ks(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&&Mn(o)}async function Ns(e,t,n,r){let s=n,o=()=>{let i;for(;i=Ts(s);){if(!r())return!1;ks(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:c}=await e.read();if(i&&(s+=t.decode(i,{stream:!0})),c){s+=t.decode(),o();return}}}catch{}}function At(e){for(let t of e.querySelectorAll("script"))t.replaceWith(On(t))}function Zi(e){return w.get(Z(e))||null}function ea(){return X.size}function ta(){w.clear(),X.clear(),le.length=0,je.clear(),Et(),jn()}function na(){return S}function ra(){return++S}function sa(){return O}function oa(e){O=e}function ia(){bn.clear(),yn=!1}function aa(e){return vt.test(e)}var qr,V,N,S,pn,O,dt,vt,rs,bn,yn,Li,v,Pi,as,cs,Ii,Fi,Bi,w,X,le,je,ue,Re,z,ae,Le,_t,wt,wn,lt=P(()=>{un();ut();ut();Ur();hn();Qe();qr="text/vnd.webjs-stream.html";V=!1,N=null,S=0,pn=null;O=null,dt=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;yn=!1;Li=16,v=new Map;Pi=8,as=3e4,cs=3,Ii=24,Fi=100,Bi=250,w=new Map,X=new Set,le=[],je=new Set,ue=null,Re=null,z=null,ae=new WeakMap,Le=new Set;_t=new WeakMap;wt=new WeakMap;wn=new Set(["value","checked","selected","indeterminate","disabled","open","popover"]);(typeof window>"u"||window.__WEBJS_CLIENT_ROUTER__!==!1)&&vn()});Me();function Ms(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 xt(e){return!!e&&typeof e=="object"&&e._$webjsCss===!0}function jt(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
|
|
3
|
-
`)}</style>`}Me();var Rt=Object.freeze({"@":"event",".":"prop","?":"bool"});function Dn(e){return Object.prototype.hasOwnProperty.call(Rt,e)}function Is(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function Fs(e){return String(e).replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<")}var $n=Symbol.for("webjs.repeat");function Hn(e,t,n){return{[$n]:!0,items:[...e],keyFn:t,templateFn:n}}function Pe(e){return!!e&&typeof e=="object"&&e[$n]===!0}function Bs(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function Lt(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function Us(e){return{_$webjs:"live",value:e}}function Ot(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function Ds(e,t){return{_$webjs:"keyed",key:e,value:t}}function Ie(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function $s(e,t){return{_$webjs:"guard",deps:e,fn:t}}function Fe(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function Hs(e){return{_$webjs:"template-content",template:e}}function Mt(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function qs(e){return{_$webjs:"ref",target:e}}function Be(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function zs(){return{value:void 0}}function Vs(e){return{_$webjs:"cache",value:e}}function Ue(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function Ws(...e){return{_$webjs:"until",args:e}}function De(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function Ks(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function Pt(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function Gs(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function It(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function Ys(e){return{_$webjs:"watch",signal:e}}function $e(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}var x=null,U=!1,ne=0,te=null,Ft=0,qn=(e,t)=>Object.is(e,t),qe=()=>{},zn=()=>!1;function Vn(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)Vn(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function be(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)be(n,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(n){console.error(n)}}}function qt(e){if(U)throw new Error("Signal read during notification phase");if(x===null)return;let t=x,n=t.nextProducerIndex++;n<t.producers.length&&t.producers[n]!==e&&Dt(t)&&be(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,Dt(t)&&Vn(e,t)),t.producerLastReadVersions[n]=e.version}function Dt(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function Wn(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=U;U=!0;try{for(let n of e.liveConsumers)n.dirty||Js(n)}finally{U=t}}function Js(e){e.dirty=!0,Wn(e),e.consumerMarkedDirty.call(e.wrapper||e)}function ze(e){if(!(!e.dirty&&e.lastCleanEpoch===ne)){if(!e.producerMustRecompute()&&!Xs(e)){e.dirty=!1,e.lastCleanEpoch=ne;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=ne}}function Xs(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(ze(n),r!==n.version))return!0}return!1}function $t(e){e&&(e.nextProducerIndex=0);let t=x;return x=e,t}function Ht(e,t){if(x=t,!!e){if(Dt(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)be(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var Ve=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=ne,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=zn,this.producerRecomputeValue=qe,this.consumerMarkedDirty=qe,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||qn,this.watched=n?.[zt],this.unwatched=n?.[Vt]}get(){return qt(this),this.__value}peek(){return this.__value}set(t){if(U)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,ne++,te!==null?Kn(this):Wn(this))}};function Kn(e){let t=U;U=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers)n.dirty||(n.dirty=!0,n.__isWatcher?te.add(n):Kn(n))}finally{U=t}}var Bt=Symbol("unset"),Ut=Symbol("computing"),He=Symbol("errored"),ye=class{constructor(t,n){this.__fn=t,this.__value=Bt,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||qn,this.watched=n?.[zt],this.unwatched=n?.[Vt];let r=this;this.producerMustRecompute=function(){return r.__value===Bt||r.__value===Ut},this.producerRecomputeValue=function(){if(r.__value===Ut)throw new Error("Detected cycle in computations.");let s=r.__value;r.__value=Ut;let o=$t(r),i,c=!1;try{i=r.__fn.call(r.wrapper)}catch(l){i=He,r.__error=l,c=!0}finally{Ht(r,o)}if(!c&&(s!==Bt&&s!==He)&&r.__equal.call(r.wrapper,s,i)){r.__value=s;return}r.__value=i,r.version++},this.consumerMarkedDirty=qe}get(){if(ze(this),qt(this),this.__value===He)throw this.__error;return this.__value}peek(){if(ze(this),this.__value===He)throw this.__error;return this.__value}},We=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=ne,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=zn,this.producerRecomputeValue=qe,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=$t(this);try{for(let r of t)qt(r),r.__isComputed&&ze(r)}finally{Ht(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(be(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=$t(this),r;try{r=t()}finally{Ht(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)be(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},zt=Symbol("watched"),Vt=Symbol("unwatched");function Qs(e){let t=x;x=null;try{return e()}finally{x=t}}function Zs(e){return e.producers.slice()}function eo(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 ro(){return x&&x.__isComputed?x:null}function so(e){Ft++,te===null&&(te=new Set);try{e()}finally{if(Ft--,Ft===0){let t=te;te=null;for(let n of t)n.__fire()}}}var ge={State:Ve,Computed:ye,subtle:{Watcher:We,untrack:Qs,introspectSources:Zs,introspectSinks:eo,hasSinks:to,hasSources:no,currentComputed:ro,watched:zt,unwatched:Vt}};function oo(e,t){return new Ve(e,t)}function io(e,t){return new ye(e,t)}function ao(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function co(e){let t=!1,n=!1,r=new ye(e),s=new We(()=>{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())}}Qe();var ar=new WeakMap,Qt=Symbol.for("webjs.instance");function oe(e,t){let n=t,r=n[Qt];if(C(e)){let s=e;if(r&&r.strings===s.strings){re(r,s.values);return}r&&cr(r,t);let o=t.firstChild;o&&o.nodeType===8&&o.data==="webjs-hydrate"&&o.remove();let i=Ao(s,t);n[Qt]=i;return}if(r&&cr(r,t),n[Qt]=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 et(e){let{strings:t}=e,n=ar.get(t);if(n)return n;let r=[],s="",o="text",i="",c=0,a="",l=0,u=null,d="",f="";for(let m=0;m<t.length;m++){let k=t[m];for(let T=0;T<k.length;T++){let h=k[T];switch(o){case"text":s+=h,h==="<"&&(o="tag-open");break;case"tag-open":s+=h,h==="!"?o="bang-1":h==="/"?(o="tag-name",d=""):/[a-zA-Z]/.test(h)?(o="tag-name",d=h.toLowerCase()):o="text";break;case"bang-1":s+=h,o=h==="-"?"bang-dash":"tag-name";break;case"bang-dash":s+=h,h==="-"?(o="comment",l=0):o="tag-name";break;case"comment":s+=h,h==="-"?l+=1:(h===">"&&l>=2&&(o="text"),l=0);break;case"tag-name":s+=h,h===">"?(o=d==="script"||d==="style"?"rawtext":"text",o==="rawtext"&&(f="")):/\s/.test(h)?o="in-tag":d+=h.toLowerCase();break;case"in-tag":s+=h,h===">"?(o=d==="script"||d==="style"?"rawtext":"text",o==="rawtext"&&(f="")):!/\s/.test(h)&&h!=="/"&&(o="attr-name",i=h,c=s.length-1);break;case"rawtext":s+=h,f=(f+h.toLowerCase()).slice(-9),(f.endsWith("<\/script>")||f.endsWith("</style>"))&&(o="text",f="",d="");break;case"attr-name":h==="="?(o="after-eq",s+=h):/\s/.test(h)?(o="in-tag",i="",s+=h):h===">"?(o="text",i="",s+=h):(i+=h,s+=h);break;case"after-eq":h==='"'||h==="'"?(o="attr-quoted",a=h,s+=h):/\s/.test(h)?(o="in-tag",i="",s+=h):h===">"?(o="text",i="",s+=h):(o="attr-unquoted",s+=h);break;case"attr-unquoted":/\s/.test(h)?(o="in-tag",i="",s+=h):(h===">"&&(o="text",i=""),s+=h);break;case"attr-quoted":s+=h,h===a&&(o="in-tag",i="");break;case"skip-attr":if(h===a){if(u){let g=u.firstPartIdx,b=[];for(let E=g;E<r.length;E++)(r[E].kind==="noop"||r[E].kind==="attr-mixed")&&b.push(E);let M=[],W=t[b[0]],A=W.lastIndexOf(a);M.push(A>=0?W.slice(A+1):W);for(let E=1;E<b.length;E++)M.push(t[b[E]]);let ee=t[b[b.length-1]+1],Oe=ee.indexOf(a);M.push(Oe>=0?ee.slice(0,Oe):ee),r[g]={kind:"attr-mixed",path:[],name:u.name,statics:M,group:b};for(let E=1;E<b.length;E++)r[b[E]]={kind:"noop",path:[],mixedAnchor:g};u=null}o="in-tag",i=""}break}}if(m<t.length-1){let T=r.length;if(o==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(o==="rawtext"){f="",r.push({kind:"noop",path:[]});continue}if(o==="text")s+=`<!--${y}${T}-->`,r.push({kind:"child",path:[]});else if(o==="in-tag"){let h=`data-${y}${T}`;s+=`${h}=""`,r.push({kind:"element",path:[]})}else if(o==="after-eq"){let h=i[0],g=i.slice(1);if(Dn(h)){s=s.slice(0,c);let b=Rt[h],M=`data-${y}${T}`;s+=`${M}=""`,r.push({kind:b,path:[],name:g})}else{s=s.slice(0,c);let b=`data-${y}${T}`;s+=`${b}=""`,r.push({kind:"attr",path:[],name:i})}o="in-tag",i=""}else if(o==="attr-quoted"||o==="attr-unquoted"){s=s.slice(0,c);let h=`data-${y}${T}`;s+=`${h}=""`,u={name:i,firstPartIdx:T},r.push({kind:"noop",path:[]}),o="skip-attr"}else o==="skip-attr"&&r.push({kind:"noop",path:[]})}}let p=document.createElement("template");return p.innerHTML=s,wo(p.content,r),So(p.content,r),n={templateEl:p,parts:r},ar.set(t,n),n}function wo(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(j,"");let s=t.length;r.setAttribute(`data-${y}${s}`,""),t.push({kind:"slot",path:[]})}}function So(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 c=i.data;if(c.startsWith(y)){let a=Number(c.slice(y.length));t[a]&&t[a].kind==="child"&&(t[a].path=n.slice())}}else if(i.nodeType===1){let c=i,a=[];for(let l of c.attributes)if(l.name.startsWith(`data-${y}`)){let u=Number(l.name.slice(`data-${y}`.length));t[u]&&t[u].kind!=="child"&&(t[u].path=n.slice()),a.push(l.name)}for(let l of a)c.removeAttribute(l);r(i)}n.pop()}}r(e)}function Ao(e,t){let{templateEl:n,parts:r}=et(e),s=n.content.cloneNode(!0),o=document.createComment(`${y}s`),i=document.createComment(`${y}e`),c=r.map(l=>tt(l,s)),a=[];for(let l=0;l<e.values.length;l++)H(c[l],e.values[l],void 0,e.values),a.push(e.values[l]);t.replaceChildren(o,...s.childNodes,i);for(let l of c)l.kind==="slot"&&H(l,void 0,void 0,[]);return{strings:e.strings,bound:c,lastValues:a,startNode:o,endNode:i}}function tt(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 re(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?H(e.bound[o],t[o],e.lastValues[o],t):H(s,r,e.lastValues[n],t),e.lastValues[n]=r}}function cr(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=Zt(n.slotEl);r&&ir(r,n.slotEl)}}t.replaceChildren()}function H(e,t,n,r){if(Ot(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":Co(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":Eo(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 c=Zt(s);if(!c||vo(s))return;let a=document.createDocumentFragment();for(;s.firstChild;)a.appendChild(s.firstChild);s[Je]=a,Xe(c)};Zt(s)?o():queueMicrotask(o);break}case"noop":break}}function Zt(e){let t=e.parentElement;for(;t;){if(t[I])return t;t=t.parentElement}return null}function vo(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 Eo(e,t){let n=e,r=Be(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 Co(e,t){return Mo(e,t),R(e,t)}function R(e,t){let n=e.marker;if(Lt(t)){$(e);let s=String(t.value??""),o=document.createElement("template");o.innerHTML=s;let i=[...o.content.childNodes],c=document.createDocumentFragment();for(let a of i)c.appendChild(a);n.parentNode?.insertBefore(c,n),e.child=i;return}if(Ie(t)){let s=t,o=e.__keyedKey;o!==void 0&&!Object.is(o,s.key)&&$(e),e.__keyedKey=s.key,R(e,s.value);return}if(Fe(t)){let s=t,o=e.__guardDeps,i=s.deps;if(o!==void 0&&(Array.isArray(o)&&Array.isArray(i)?Oo(o,i):Object.is(o,i)))return;e.__guardDeps=Array.isArray(i)?i.slice():i,R(e,s.fn());return}if(Mt(t)){$(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(Be(t))return;if(Ue(t))return Po(e,t.value);if(De(t))return Io(e,t.args);if($e(t))return Fo(e,t.signal);if(Pt(t))return Bo(e,t);if(It(t))return Uo(e,t);if(Pe(t)){if(e.child&&e.child.kind==="repeat"){No(e,t);return}$(e);let s={kind:"repeat",map:new Map};e.child=s,ko(n,s,t);return}if(Array.isArray(t)){if(e.child&&e.child.kind==="array"){Ro(e,t);return}$(e);let s={kind:"array",items:[]};e.child=s,jo(n,s,t);return}if(e.child){let s=e.child;if(s.kind==="repeat")lr(s),e.child=void 0;else if(s.kind==="array")fr(s),e.child=void 0;else if(s.kind==="async-stream")mr(s),e.child=void 0;else if("strings"in e.child){let o=e.child;if(C(t)&&o.strings===t.strings){re(o,t.values);return}se(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(C(t)){let s=t,{templateEl:o,parts:i}=et(s),c=o.content.cloneNode(!0),a=document.createComment(`${y}s`),l=document.createComment(`${y}e`),u=i.map(p=>tt(p,c)),d=[];for(let p=0;p<s.values.length;p++)H(u[p],s.values[p],void 0,s.values),d.push(s.values[p]);let f=[a,...c.childNodes,l];n.parentNode?.insertBefore(To(f),n);for(let p of u)p.kind==="slot"&&H(p,void 0,void 0,[]);e.child={strings:s.strings,bound:u,lastValues:d,startNode:a,endNode:l};return}let r=document.createTextNode(String(t));n.parentNode?.insertBefore(r,n),e.child=[r]}function To(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function se(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 tn(e){let{templateEl:t,parts:n}=et(e),r=t.content.cloneNode(!0),s=document.createComment(`${y}s`),o=document.createComment(`${y}e`),i=n.map(l=>tt(l,r)),c=[];for(let l=0;l<e.values.length;l++)H(i[l],e.values[l],void 0,e.values),c.push(e.values[l]);let a=document.createDocumentFragment();for(a.appendChild(s);r.firstChild;)a.appendChild(r.firstChild);return a.appendChild(o),{inst:{strings:e.strings,bound:i,lastValues:c,startNode:s,endNode:o},frag:a}}function Ae(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 ko(e,t,n){let{items:r,keyFn:s,templateFn:o}=n,i=e.parentNode;if(!i)return;let c=document.createDocumentFragment();for(let a=0;a<r.length;a++){let l=s(r[a],a),u=o(r[a],a);if(!C(u))continue;let{inst:d,frag:f}=tn(u);t.map.set(l,d),c.appendChild(f)}i.insertBefore(c,e)}function No(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let s=e.child,{items:o,keyFn:i,templateFn:c}=t,a=new Map;for(let l=0;l<o.length;l++){let u=i(o[l],l),d=c(o[l],l);if(!C(d))continue;let f=s.map.get(u);if(f&&f.strings===d.strings)re(f,d.values),en(f.startNode,f.endNode,r,n),a.set(u,f),s.map.delete(u);else{f&&(Ae(f),se(f.startNode,f.endNode),s.map.delete(u));let{inst:p,frag:m}=tn(d);r.insertBefore(m,n),a.set(u,p)}}for(let l of s.map.values())Ae(l),se(l.startNode,l.endNode);s.map=a}function lr(e){for(let t of e.map.values())Ae(t),se(t.startNode,t.endNode);e.map.clear()}function xo(e){return e.type==="tpl"?e.inst.startNode:e.type==="text"?e.node:null}function Ze(e){e.type==="tpl"?(Ae(e.inst),se(e.inst.startNode,e.inst.endNode)):e.type==="text"&&e.node.parentNode?.removeChild(e.node)}function ur(e){if(C(e)){let{inst:t,frag:n}=tn(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 jo(e,t,n){let r=e.parentNode;if(!r)return;let s=document.createDocumentFragment(),o=[];for(let i of n){let{item:c,frag:a}=ur(i);a&&s.appendChild(a),o.push(c)}r.insertBefore(s,e),t.items=o}function Ro(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let s=e.child,o=s.items,i=[];for(let c=0;c<t.length;c++){let a=t[c],l=o[c];if(C(a)){let f=a;if(l&&l.type==="tpl"&&l.inst.strings===f.strings){re(l.inst,f.values),i.push(l);continue}}else if(a!=null&&a!==!1&&a!==!0){if(l&&l.type==="text"){let f=String(a);l.node.data!==f&&(l.node.data=f),i.push(l);continue}}else{l&&Ze(l),i.push({type:"empty"});continue}let{item:u,frag:d}=ur(a);d&&r.insertBefore(d,Lo(o,c,n)),l&&Ze(l),i.push(u)}for(let c=t.length;c<o.length;c++)Ze(o[c]);s.items=i}function Lo(e,t,n){for(let r=t;r<e.length;r++){let s=xo(e[r]);if(s&&s.parentNode)return s}return n}function fr(e){for(let t of e.items)Ze(t);e.items=[]}function en(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 Oo(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 $(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&dr(t),!e.child)return;let n=e.child;if(n.kind==="repeat")lr(n);else if(n.kind==="array")fr(n);else if(n.kind==="async-stream")mr(n);else if("strings"in n){let r=e.child;Ae(r),se(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function Mo(e,t){let n=e;n.__untilState&&!De(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!Fe(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!Ue(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!Ie(t)&&(n.__keyedKey=void 0),n.__watchSub&&!$e(t)&&dr(n)}function Po(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 c=o;if(C(t)&&c.strings===t.strings){re(c,t.values);return}let a=document.createDocumentFragment();en(c.startNode,c.endNode,a,null),s.set(c.strings,{inst:c,holder:a}),e.child=void 0}if(C(t)){let c=t,a=s.get(c.strings);if(a){s.delete(c.strings),e.child&&$(e),en(a.inst.startNode,a.inst.endNode,n.parentNode,n),re(a.inst,c.values),e.child=a.inst;return}}R(e,t)}function Io(e,t){let n=e,r=n.__untilState,s=n.__untilArgs,o=(f,p)=>!!(Object.is(f,p)||C(f)&&C(p)&&f.strings===p.strings),c=s&&s.length===t.length&&s.every((f,p)=>o(f,t[p]))&&r?r.highestResolved:1/0;r&&(r.aborted=!0),n.__untilArgs=t.slice();let a={aborted:!1,highestResolved:c};n.__untilState=a;let l=-1,u;for(let f=0;f<t.length;f++){let p=t[f];if(!p||typeof p.then!="function"){l=f,u=p;break}}l!==-1&&l<=a.highestResolved?(R(e,u),a.highestResolved=l):l===-1&&!n.__untilEverRendered&&R(e,""),n.__untilEverRendered=!0;let d=Math.min(l===-1?t.length:l,a.highestResolved);for(let f=0;f<d;f++){let p=t[f];!p||typeof p.then!="function"||Promise.resolve(p).then(m=>{a.aborted||f>=a.highestResolved||(a.highestResolved=f,R(e,m))},()=>{})}}function Fo(e,t){let n=e;if(n.__watchSig===t&&n.__watchSub){let o;n.__watchSub.observe(()=>{o=t.get()}),R(e,o);return}n.__watchSub&&(n.__watchSub.dispose(),n.__watchSub=void 0),n.__watchSig=t;let r=new ge.subtle.Watcher(()=>{queueMicrotask(()=>{if(n.__watchSub!==r)return;let o;r.observe(()=>{o=t.get()}),R(e,o)})});n.__watchSub=r;let s;r.observe(()=>{s=t.get()}),R(e,s)}function dr(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function Bo(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="append"&&n.iterable===t.iterable)return;$(e);let r=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=s,hr(s,e,t)}function Uo(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="replace"&&n.iterable===t.iterable)return;$(e);let r=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=s,hr(s,e,t)}async function hr(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,c=pr(i);if(e.mode==="replace"){for(let l of e.nodes)l.parentNode&&l.parentNode.removeChild(l);e.nodes=[]}let a=document.createDocumentFragment();for(let l of c)a.appendChild(l);r.parentNode?.insertBefore(a,r),e.nodes.push(...c),s++}}catch(o){typeof console<"u"&&console.error("[webjs] asyncStream error:",o)}}function pr(e){if(e==null||e===!1||e===!0)return[];if(C(e)){let t=e,{templateEl:n,parts:r}=et(t),s=n.content.cloneNode(!0),o=r.map(i=>tt(i,s));for(let i=0;i<t.values.length;i++)H(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(...pr(n));return t}return[document.createTextNode(String(e))]}function mr(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 br=null;function nt(e){br=e||null}function Do(){return br||void 0}var yr=Symbol.for("webjs:registry"),gr=Symbol.for("webjs:classToTag"),rt=globalThis,L=rt[yr]||(rt[yr]=new Map),_r=rt[gr]||(rt[gr]=new WeakMap),st=typeof window<"u"&&typeof customElements<"u";function nn(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=L.get(e);r?(r.cls=t,r.lazy=n):L.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),_r.set(t,e)}if(st){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),nn(t,n)}}if(!st){let e=globalThis;e.customElements||(e.customElements={define(t,n){nn(t,n)},get(t){return L.get(t)?.cls},upgrade(){},whenDefined(t){let n=L.get(t);return Promise.resolve(n?.cls)}})}function rn(e,t){st?customElements.define(e,t):nn(e,t)}function $o(e,t){if(st)return;let n=L.get(e);if(n){n.moduleUrl=t;return}L.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e})}function Ho(e){return L.get(e)?.cls}function qo(e){return L.get(e)?.moduleUrl||null}function zo(e){return L.get(e)?.lazy===!0}function ot(e){return _r.get(e)}function Vo(){return[...L.keys()]}Ce();Qe();var Tr=typeof window<"u"&&typeof HTMLElement<"u";function si(e,t){return e!==t}function oi(){return{states:new Set,shadowRoot:null,form:null,labels:[],role:"",willValidate:!0,validity:{},validationMessage:"",setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0}}}var it=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=oi(),this.__internals}},ii=["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 ii){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(it.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}var ai=Tr?HTMLElement:it,kr=Symbol("webjs.factoryProps"),Er=new WeakSet,ie=class e extends ai{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){rn(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||on(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(Er.has(t))return;let n=t;for(;n&&n!==e;){if(Object.hasOwn(n,"properties")&&!Object.hasOwn(n,kr)){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)}Er.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:c=>{let a=this.__propValues[r];(o.hasChanged||si)(c,a)&&(this.__propValues[r]=c,o.reflect&&!o.state&&this._connected&&this._reflectAttribute(r,c,o),this.requestUpdate(r,a))}}),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||on(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(!Tr)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=Cr(r.slice(16));try{this[o]=Y(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:xt(r)?[r]:[];if(s.length){if(n){let o=this.shadowRoot.querySelector("style");o&&o.remove()}jt(this._renderRoot,s)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${ot(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().`),Yt(this)||(this.__isHydrating()?(D(this),nr(this)):tr(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&&sr(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&&or(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,c;for(let[u,d]of Object.entries(o))if(((typeof d=="object"?d:{type:d}).attribute||on(u))===t){i=u,c=d;break}if(c===void 0&&(i=Cr(t),c=o[i]||o[t]),c===void 0)return;let a=typeof c=="object"?c:{type:c},l;if(a.converter&&a.converter.fromAttribute)l=a.converter.fromAttribute(r,a.type);else if(a.type===Number)l=r==null?null:Number(r);else if(a.type===Boolean)l=r!=null&&r!=="false";else if(a.type===Object||a.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,nt(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{nt(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 ge.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n;if(this.__signalWatcher.observe(()=>{n=this.render()}),n&&typeof n.then=="function")return this._commitAsync(n);oe(n,this._renderRoot)}_commitAsync(t){let n=this.__renderToken;if(this.__firstRendered&&this._overridesRenderFallback())try{let r=this.renderFallback();r!==void 0&&oe(r,this._renderRoot)}catch(r){console.error("[webjs] renderFallback() threw:",r)}return Promise.resolve(t).then(r=>{n===this.__renderToken&&oe(r,this._renderRoot)},r=>{n===this.__renderToken&&this._handleRenderError(r instanceof Error?r:new Error(String(r)))})}_overridesRenderFallback(){return this.renderFallback!==at.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${ot(this.constructor)||this.tagName?.toLowerCase()}>:`,t);try{let n=this.renderError(t);n!==void 0&&oe(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 on(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Cr(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function at(e){return new.target?Reflect.construct(ie,arguments,new.target):class extends ie{static properties=e;static[kr]=!0}}Object.setPrototypeOf(at,ie);at.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 Nr=Symbol.for("webjs.notFound"),xr=Symbol.for("webjs.redirect"),jr=Symbol.for("webjs.forbidden"),Rr=Symbol.for("webjs.unauthorized");function li(){let e=new Error("webjs: notFound()");throw e.__webjs=Nr,e}function ui(){let e=new Error("webjs: forbidden()");throw e.__webjs=jr,e}function fi(){let e=new Error("webjs: unauthorized()");throw e.__webjs=Rr,e}function di(e,t){let n=typeof t=="object"&&t!==null?t.status:t,r=new Error(`webjs: redirect(${e})`);throw r.__webjs=xr,r.url=e,r.status=typeof n=="number"?n:void 0,r}function hi(e){return!!e&&e.__webjs===Nr}function pi(e){return!!e&&e.__webjs===xr}function mi(e){return!!e&&e.__webjs===jr}function bi(e){return!!e&&e.__webjs===Rr}var Lr=null;function yi(){if(!Lr)return"";try{return Lr()||""}catch{return""}}var cc=Symbol.for("webjs.suspense");function gi(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function _i(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}function wi(e,t={}){let n=t.reconnect!==!1,r=0,s=!1,o=null,i=[];function c(){s||(o=new WebSocket(Si(e),t.protocols),o.onopen=a=>{for(r=0;i.length&&o&&o.readyState===WebSocket.OPEN;)o.send(i.shift());t.onOpen?.(a)},o.onmessage=a=>{let l=a.data;if(typeof l=="string")try{l=JSON.parse(l)}catch{}t.onMessage?.(l,a)},o.onerror=a=>{t.onError?.(a)},o.onclose=a=>{if(t.onClose?.(a),!s&&n){let l=Math.min(1e3*2**r++,3e4);setTimeout(c,l)}})}return c(),{send(a){let l=typeof a=="string"||a instanceof ArrayBuffer||ArrayBuffer.isView(a)?a:JSON.stringify(a);o&&o.readyState===WebSocket.OPEN?o.send(l):i.push(l)},close(a,l){s=!0;try{o?.close(a,l)}catch{}},get socket(){return o},get readyState(){return o?.readyState??3}}}function Si(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}`}Ce();var an="application/vnd.webjs+json";async function Ai(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",an);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 sn(r),n.has("content-type")||n.set("content-type",an));let s=await fetch(e,{...t,headers:n,body:r}),o=s.headers.get("content-type")||"",i=await s.text(),c=o.includes(an)?i?Y(i):null:o.includes("application/json")?i?JSON.parse(i):null:i;if(!s.ok){let a=c&&c.error||`richFetch ${e} -> ${s.status}`,l=new Error(a);throw l.status=s.status,l.body=c,l}return c}Ce();lt();lt();un();ut();var Pn=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 ca(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 la(e,t,n){return e&&typeof e.get=="function"&&typeof e.set=="function"?ca(e,t,n):new Pn(e,t)}hn();var Tt=0,xs=new Map,me=new Map,ua=1e3;function fa(e){if(!(!Array.isArray(e)||!e.length)){Tt+=1;for(let t of e)t&&xs.set(t,Tt)}}function da(){return Tt}function ha(e,t,n){if(!(!Array.isArray(t)||!t.length)&&(me.delete(e),me.set(e,{tags:t.slice(),since:typeof n=="number"?n:Tt}),me.size>ua)){let r=me.keys().next().value;r!==void 0&&me.delete(r)}}function pa(e){let t=me.get(e);if(!t)return!1;for(let n of t.tags)if((xs.get(n)||0)>t.since)return!0;return!1}function ma(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}var ba="application/vnd.webjs+stream",ya=1,ga=2,_a=3,js=new Uint8Array(0);function wa(e,t){let n=t||js,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 Sa(){let e=js;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 Aa=Symbol.for("webjs.context");function va(e){return{__context__:Aa,name:e}}var kt=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},In=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},c=()=>{this._subscriptions.delete(i)};this._subscriptions.add(i),o.callback(this._value,c)}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()}},Fn=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 kt(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 Ea(){return typeof window<"u"}var B={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},Bn=class{constructor(t,{task:n,args:r,autoRun:s=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=s,this._status=B.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=B.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=B.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=B.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 B.INITIAL:return t.initial?.();case B.PENDING:return t.pending?.();case B.COMPLETE:return t.complete?.(this._value);case B.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun||!Ea())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{Fn as ContextConsumer,In as ContextProvider,kt as ContextRequestEvent,ya as FRAME_CHUNK,ga as FRAME_END,_a as FRAME_ERROR,y as MARKER,Hr as SEED_MISS,ba as STREAM_CONTENT_TYPE,ge as Signal,gi as Suspense,Bn as Task,B as TaskStatus,at as WebComponent,ln as WebjsFrame,fn as WebjsStream,Do as activeActionSignal,jt as adoptStyles,Vo as allTags,Ks as asyncAppend,Gs as asyncReplace,so as batch,Vs as cache,io as computed,wi as connectWS,pa as consumeStale,va as createContext,Sa as createFrameDecoder,zs as createRef,yi as cspNonce,Ms as css,Ar as deserialize,Gr as disableClientRouter,co as effect,vn as enableClientRouter,wa as encodeFrame,Fs as escapeAttr,Is as escapeText,da as fetchMark,ui as forbidden,$s as guard,Os as html,Pt as isAsyncAppend,It as isAsyncReplace,xt as isCSS,Ue as isCache,mi as isForbidden,Fe as isGuard,Ie as isKeyed,zo as isLazy,Ot as isLive,hi as isNotFound,pi as isRedirect,Be as isRef,Pe as isRepeat,ao as isSignal,_i as isSuspense,C as isTemplate,Mt as isTemplateContent,bi as isUnauthorized,Lt as isUnsafeHTML,De as isUntil,$e as isWatch,Ds as keyed,Us as live,Ho as lookup,qo as lookupModuleUrl,fa as markStale,Yr as navigate,li as notFound,la as optimistic,Y as parse,ma as parseTagHeader,$o as primeModuleUrl,ci as prop,di as redirect,qs as ref,rn as register,ha as registerKeyTags,oe as render,dn as renderStream,Hn as repeat,Jr as revalidate,Ai as richFetch,ft as scanSeeds,Sr as serialize,nt as setActiveActionSignal,oo as signal,sn as stringify,Ps as stylesToString,ot as tagOf,xi as takeSeed,Hs as templateContent,fi as unauthorized,Bs as unsafeHTML,Ws as until,Ys as watch};
|
|
1
|
+
var jo=Object.defineProperty;var B=(e,t)=>()=>(e&&(t=e(e=0)),t);var Bn=(e,t)=>{for(var n in t)jo(e,n,{get:t[n],enumerable:!0})};function Xn(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}function cs(){Yn||(Wt=Xn(),Wt&&(ve=HTMLSlotElement.prototype.assignedNodes,Vt=HTMLSlotElement.prototype.assignedElements,Ye=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(t){return this.hasAttribute(L)&&!Gn(this)?Kt(this,t):ve?ve.call(this,t):[]},HTMLSlotElement.prototype.assignedElements=function(t){return this.hasAttribute(L)&&!Gn(this)?Kt(this,t).filter(n=>n.nodeType===1):Vt?Vt.call(this,t):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let t=Ye&&Ye.get?Ye.get.call(this):null;return t||ls(this)}}),Yn=!0))}function Gn(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 Kt(e,t){if(e.getAttribute(M)===Qn)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:Yt(n,new Set,0)}function Yt(e,t,n){if(n>=as)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(L)){let i=Kt(o,{flatten:!1});if(i.length>0)for(let a of Yt(i,t,n+1))r.push(a);else for(let a of Yt(Array.from(o.childNodes),t,n+1))r.push(a)}else if(ve){let i=ve.call(o,{flatten:!0});for(let a of i)r.push(a)}else r.push(s)}else r.push(s);return r}function ls(e){let t=e.parentElement;for(;t;){if(t.tagName==="SLOT"&&t.hasAttribute(L))return t.getAttribute(M)===K?t:null;t=t.parentElement}return null}function re(e){let t=e,n=t[R];return n||(n={assignedByName:new Map,lastSnapshot:new WeakMap},t[R]=n),n}function Gt(e){return!!e[R]}function Zn(e){let t=re(e);for(;e.firstChild;){let n=e.firstChild,r=us(n);fs(t.assignedByName,r,n),e.removeChild(n)}}function er(e){let t=re(e),n=e.querySelectorAll(`slot[${L}]`);for(let r of n){let s=r;if(s.getAttribute(M)!==K)continue;let o=oe(s.getAttribute("name"));if(!t.assignedByName.has(o)){let i=Array.from(s.childNodes);t.assignedByName.set(o,i),t.lastSnapshot.set(s,i.slice())}}}function oe(e){return e==null||e===""||e==="default"?null:e}function us(e){return e.nodeType!==1?null:oe(e.getAttribute("slot"))}function fs(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}function tr(e){let t={},n=e[R];if(!n)return t;for(let[r,s]of n.assignedByName)t[r??"default"]=s.slice();return t}function nr(e,t){let n=e[R];if(!n)return!1;let r=n.assignedByName.get(oe(t));return!!(r&&r.length)}function se(e,t,n){let r=re(e),s=oe(t),o=ds(e,n);o.length?r.assignedByName.set(s,o):r.assignedByName.delete(s),Jt(e)}function ds(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 Jt(e){if(!Wt)return;let t=e[R];if(!t)return;let n=[];for(let o of e.querySelectorAll(`slot[${L}]`))hs(e,o)&&n.push(o);let r=new Map;for(let o of n){let i=oe(o.getAttribute("name")),a=r.get(i);a||(a=[],r.set(i,a)),a.push(o)}let s=[];for(let[o,i]of r){let a=t.assignedByName.get(o)||[];for(let c=0;c<i.length;c++){let l=i[c];c===0&&a.length>0?ps(t,l,a)&&s.push(l):ms(t,l)&&s.push(l)}}for(let o of s)bs(o)}function hs(e,t){for(let n=t.parentElement;n&&n!==e;n=n.parentElement)if(n.tagName.includes("-"))return!1;return!0}function ps(e,t,n){let r=t.getAttribute(M)!==K,s=e.lastSnapshot.get(t)||[];if(!r&&zt(s,n))return!1;if(!r&&zt(Array.from(t.childNodes),n))return e.lastSnapshot.set(t,n.slice()),!zt(s,n);let i=t[Ge];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(M,K),e.lastSnapshot.set(t,n.slice()),!0}function ms(e,t){let n=t.getAttribute(M)===K;if(t.setAttribute(M,Qn),!n)return Jn(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return Jn(t),!0}function Jn(e){let t=e[Ge];!t||t.childNodes.length===0||e.appendChild(t)}function rr(e,t){if(!Gt(e))return;let n=re(e),r=oe(t.getAttribute("name")),s=n.assignedByName.get(r);if(s)for(let o of s)o.parentNode===t&&t.removeChild(o);n.lastSnapshot.delete(t)}function bs(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function zt(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 Wt,R,L,M,K,Qn,Ge,as,ve,Vt,Ye,Yn,Je=B(()=>{Wt=Xn(),R=Symbol("webjs.slot.state"),L="data-webjs-light",M="data-projection",K="actual",Qn="fallback",Ge=Symbol("webjs.slot.fallbackFrag"),as=64,ve=null,Vt=null,Ye=null,Yn=!1;cs()});function yr(e,t,n){qs.has(t)?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}async function rn(e){return JSON.stringify(await gr(e))}function G(e){return _r(JSON.parse(e))}async function gr(e){let t=Vs();return await zs(e,t),Y(e,t)}function _r(e){return q(e,Gs())}function Vs(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map,fdEntries:new Map}}async function zs(e,t){let n=[e];for(;n.length;){let r=n.pop();if(!Xs(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(Qs(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 Y(e,t){if(e===null)return null;if(e===void 0)return{[y]:"undef"};let n=typeof e;if(n==="string"||n==="boolean")return e;if(n==="number")return Number.isNaN(e)?{[y]:"NaN"}:e===1/0?{[y]:"Inf"}:e===-1/0?{[y]:"-Inf"}:Object.is(e,-0)?{[y]:"-0"}:e;if(n==="bigint")return{[y]:"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{[y]:"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{[y]:"Ref",v:r};r!==void 0&&t.emitted.add(r);let s;if(e instanceof Date)s={[y]:"Date",v:Number.isNaN(e.getTime())?null:e.toISOString()};else if(e instanceof Error)s={[y]:"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={[y]:"File",v:Te(o),n:e.name,t:e.type||"",m:e.lastModified}:s={[y]:"Blob",v:Te(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,Y(c,t)]);s={[y]:"FD",v:i}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)s=Ws(e);else if(e instanceof Map){let o=[];for(let[i,a]of e)o.push([Y(i,t),Y(a,t)]);s={[y]:"Map",v:o}}else if(e instanceof Set){let o=[];for(let i of e)o.push(Y(i,t));s={[y]:"Set",v:o}}else if(Array.isArray(e))s=e.map(o=>Y(o,t));else{s={};for(let o in e){if(!Object.prototype.hasOwnProperty.call(e,o))continue;let i=Zs(o)?"_"+o:o;yr(s,i,Y(e[o],t))}}if(r!==void 0){if(Array.isArray(s))return{[y]:"Arr",_id:r,v:s};s._id=r}return s}function Ws(e){if(e instanceof ArrayBuffer)return{[y]:"buf",v:Te(new Uint8Array(e))};if(e instanceof DataView)return{[y]:"dv",v:Te(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=Ks[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[y]:n,v:Te(r)}}function Gs(){return{refs:new Map}}function q(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(q(e[i],t));return o}let n=e[y];if(typeof n=="string")return Js(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=ei(o)?o.slice(1):o;yr(r,i,q(e[o],t))}return r}function Js(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(q(i,n),q(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(q(i,n));return o}case"Arr":{let o=[];typeof r=="number"&&n.refs.set(r,o);for(let i of e.v)o.push(q(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=Ee(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=Ee(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=q(a,n);o.append(i,c)}return o}default:{if(t==="buf"){let i=Ee(e.v);return s(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength))}if(t==="dv"){let i=Ee(e.v);return s(new DataView(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)))}let o=Ys[t];if(o){let i=Ee(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 Xs(e){return e!==null&&typeof e=="object"}function Qs(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Zs(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function ei(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}function Te(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 Ee(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 y,qs,Ks,Ys,wr,ke=B(()=>{y="_$wj",qs=new Set(["__proto__","constructor","prototype"]);Ks={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},Ys={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 Lr={};Bn(Lr,{observeLazy:()=>wi,observeViewportOnce:()=>vi});function Rr(e){let t=an.get(e);return t||(t=import(e).finally(()=>an.delete(e)),an.set(e,t),t)}function wi(e){for(let[t,n]of Object.entries(e))J.set(t.toLowerCase(),n);if(typeof IntersectionObserver>"u"){for(let t of J.values())Rr(t);J.clear();return}Ne||(Ne=new IntersectionObserver(Si,{rootMargin:"200px"})),jr(),typeof MutationObserver<"u"&&new MutationObserver(()=>jr()).observe(document.body,{childList:!0,subtree:!0})}function jr(){if(!(!Ne||!J.size))for(let e of J.keys())for(let t of document.querySelectorAll(e))Ne.observe(t)}function Si(e){for(let t of e){if(!t.isIntersecting)continue;let n=t.target.tagName.toLowerCase(),r=J.get(n);r&&(Rr(r),J.delete(n),Ne?.unobserve(t.target))}}function Ai(e){for(let t of e){if(!t.isIntersecting)continue;let n=it.get(t.target);it.delete(t.target),xe?.unobserve(t.target),n&&n()}}function vi(e,t){return typeof IntersectionObserver>"u"?(t(),()=>{}):(xe||(xe=new IntersectionObserver(Ai,{rootMargin:"200px"})),it.set(e,t),xe.observe(e),()=>{it.delete(e),xe?.unobserve(e)})}var J,Ne,an,xe,it,Or=B(()=>{J=new Map,Ne=null,an=new Map;xe=null,it=new WeakMap});var cn,ln=B(()=>{cn=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(()=>(Or(),Lr)).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(()=>(at(),Pr)).then(({loadFrame:n})=>{this._webjsLoadedSrc!==t||!this.isConnected||n(this,t)})}}:null;typeof customElements<"u"&&cn&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",cn)});function Ei(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 fn(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 Ci,un,ct=B(()=>{Ci=new Set(["append","prepend","before","after","replace","update"]);un=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=Ci.has(t)?this.querySelector("template"):null;try{for(let i of r){let a=o?o.content.cloneNode(!0):null;Ei(t,i,a)}}finally{this.remove()}}}:null;typeof customElements<"u"&&un&&!customElements.get("webjs-stream")&&customElements.define("webjs-stream",un)});var Ir,Mr=B(()=>{Ir=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this.style.display||(this.style.display="contents")}}:null;typeof customElements<"u"&&Ir&&!customElements.get("webjs-suspense")&&customElements.define("webjs-suspense",Ir)});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]'))Ur(n.textContent,n);for(let n of t.querySelectorAll("[data-webjs-seed]"))Ur(n.getAttribute("data-webjs-seed"),n,()=>n.removeAttribute("data-webjs-seed"))}}function Ur(e,t,n){if(e)try{let r=G(e);if(r&&typeof r=="object")for(let s in r)je.has(s)||je.set(s,r[s])}catch{}n?n():t.remove?.()}function Ti(e,t,n){Fr||(Fr=!0,lt());let r=`${e}/${t}/${n}`;if(je.has(r)){let s=je.get(r);return je.delete(r),s}return Br}var je,Br,Fr,dn=B(()=>{ke();je=new Map,Br=Symbol("webjs.seed.miss"),Fr=!1});var Pr={};Bn(Pr,{_FRAME_TOP:()=>eo,_LIVE_ATTRS:()=>wn,_activeFrameId:()=>Zr,_addNewHeadElements:()=>Sn,_applyStreamedResolve:()=>Co,_applySwap:()=>Ln,_blurOutgoingFocus:()=>dt,_buildHaveHeader:()=>Nn,_buildSubmitFormData:()=>Xr,_bumpNavToken:()=>ra,_clearFormBusy:()=>mo,_clearFrameBusy:()=>ho,_collectBoundaries:()=>be,_currentPageUrl:()=>oa,_diffElementInPlace:()=>_t,_eligibleAnchorHref:()=>pt,_findAnchorInPath:()=>Qr,_getSubmitAction:()=>Jr,_getSubmitMethod:()=>Gr,_isNonHtmlPath:()=>ca,_keyOf:()=>me,_markFormBusy:()=>po,_markFrameBusy:()=>fo,_mergeHead:()=>So,_navToken:()=>na,_onPopState:()=>Cn,_onSubmit:()=>En,_parseHTML:()=>An,_planBoundarySwap:()=>no,_prefetch:()=>ye,_prefetchCache:()=>w,_prefetchHasHoverPointer:()=>io,_prefetchInflightSize:()=>ea,_prefetchMode:()=>mt,_prefetchPeek:()=>Zi,_prefetchSaysSaveData:()=>jn,_prefetchSuppressed:()=>ao,_prefetchTake:()=>co,_reactivateScripts:()=>Ie,_readStreamedShell:()=>Ao,_reconcileChildren:()=>vt,_regraftPermanentElements:()=>yo,_regraftPermanentInSlice:()=>At,_resetParseProbe:()=>xi,_resetPrefetch:()=>ta,_resetWarnOnce:()=>ia,_resolveTargetFrameId:()=>Tn,_restoreOptimistic:()=>Re,_runWithTransition:()=>ft,_setCurrentPageUrl:()=>sa,_shouldFullLoadDuringParse:()=>aa,_snapshotCache:()=>C,_streamBoundariesProgressively:()=>Eo,_takeResolveUnit:()=>vo,_viewTransitionsEnabled:()=>bo,collectBoundaries:()=>be,disableClientRouter:()=>zr,enableClientRouter:()=>vn,loadFrame:()=>Ri,navigate:()=>Wr,planBoundarySwap:()=>no,revalidate:()=>Kr});function An(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"&&ki()?Document.parseHTMLUnsafe(e):Ni(e)}function ki(){if(ue!==null)return ue;try{ue=Document.parseHTMLUnsafe("<!doctype html><body><!--c--><i></i>")?.body?.firstChild?.nodeType===8}catch{ue=!1}return ue}function xi(){ue=null}function Ni(e){return typeof DOMParser>"u"?null:new DOMParser().parseFromString(e,"text/html")}function ji(){hn||typeof MutationObserver>"u"||typeof customElements>"u"||(hn=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)}}),hn.observe(document.body,{childList:!0,subtree:!0}))}function vn(){z||typeof document>"u"||(z=!0,document.addEventListener("click",Yr,!1),document.addEventListener("submit",En,!1),window.addEventListener("popstate",Cn),document.addEventListener("pointerover",pe,!0),document.addEventListener("focusin",pe,!0),document.addEventListener("touchstart",pe,{capture:!0,passive:!0}),document.addEventListener("pointerout",lo,!0),document.addEventListener("webjs:navigate",_n),ji(),_n(),typeof history<"u"&&"scrollRestoration"in history&&(ut=history.scrollRestoration,history.scrollRestoration="manual"),typeof location<"u"&&(I=location.href))}function zr(){z&&(z=!1,document.removeEventListener("click",Yr,!1),document.removeEventListener("submit",En,!1),window.removeEventListener("popstate",Cn),document.removeEventListener("pointerover",pe,!0),document.removeEventListener("focusin",pe,!0),document.removeEventListener("touchstart",pe,{capture:!0}),document.removeEventListener("pointerout",lo,!0),document.removeEventListener("webjs:navigate",_n),St(),Rn(),V&&(V.disconnect(),V=null),typeof history<"u"&&ut!==null&&(history.scrollRestoration=ut,ut=null),I=null)}async function Wr(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 Ri(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};k&&k.abort(),k=new AbortController;let s=k.signal,o=++S;return bt(r.href,n,!1,null,"GET",null,s,o)}function Kr(e){if(!e){C.clear(),w.clear();return}let t=new URL(e,location.href),n=t.pathname+t.search;C.delete(n),w.delete(n)}function Yr(e){if(!z||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=Qr(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||wt.test(r.pathname))return;e.preventDefault();let s=Tn(t);xn(n,!1,s)}function Cn(e){xn(location.href,!0,null)}function En(e){if(!z||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=Gr(t,n);if(s==="dialog")return;let o=Jr(t,n),i;try{i=new URL(o,location.href)}catch{return}if(i.origin!==location.origin||wt.test(i.pathname))return;let a=Xr(t,n);e.preventDefault();let c=Tn(n||t);Pi(i.href,s,a,c,t)}function Gr(e,t){return(t&&t.getAttribute("formmethod")||e.getAttribute("method")||"get").toLowerCase()}function Jr(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function Xr(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 Qr(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function Zr(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 Tn(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===eo)return null;let r=typeof document<"u"?document.getElementById(n):null;return r&&r.tagName&&r.tagName.toLowerCase()==="webjs-frame"?n:(kn(`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 Zr(e)}function kn(e,t){mn.has(e)||(mn.add(e),typeof console<"u"&&console.warn&&console.warn(t))}function to(e,t){return!e&&!t&&typeof document<"u"&&document.readyState==="loading"}function bn(e,t){typeof process<"u"&&process.env||kn(`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 $r(){if(typeof process<"u"&&process.env||yn||typeof document>"u"||typeof getComputedStyle!="function")return;let e=document.documentElement;if(!e)return;yn=!0;let t;try{t=getComputedStyle(e).scrollBehavior}catch{return}t==="smooth"&&kn("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 ht(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 be(e){let t=new Map,n=[],r=!1;function s(o){if(!r){if(o.nodeType===8){let i=o.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(u=>u.segment===l)){r=!0;return}n.push({segment:l,routeKey:h,start:o});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!==o.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:o});return}return}if(o.hasChildNodes&&o.hasChildNodes())for(let i=o.firstChild;i&&!r;i=i.nextSibling)s(i)}}return s(e),r||n.length>0?null:t}function no(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],s=i=>{let a=null;for(let c of i.keys())(a===null||c.length>a.length)&&(a=c);return a};return{mode:s(e)===r&&s(t)===r?"morph":"replace",segment:r,live:e.get(r),incoming:t.get(r)}}function ro(e){let t=ee(e);document.dispatchEvent(new CustomEvent("webjs:before-cache",{detail:{url:e}})),C.has(t)&&C.delete(t);let n={html:document.documentElement.outerHTML,scrollX:typeof window<"u"&&window.scrollX||0,scrollY:typeof window<"u"&&window.scrollY||0};for(C.set(t,n);C.size>Li;){let r=C.keys().next().value;C.delete(r)}}function Oi(e){let t=ee(e),n=C.get(t);return n==null?null:(C.delete(t),C.set(t,n),typeof n=="string"?{html:n,scrollX:0,scrollY:0}:n)}function ee(e){let t=new URL(e,location.href);return t.pathname+t.search}async function xn(e,t,n){if(to(t,n)&&typeof location<"u"){bn("readyState-loading",e),location.href=e;return}k&&k.abort(),k=new AbortController;let r=k.signal,s=++S;I&&ro(I);let o=setTimeout(()=>{ht(!0),o=null},150),i=null;t||(i=go());try{if(t){let a=Oi(e);if(a){let c=An(a.html);if(c){Ln(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,s,!0).catch(()=>{});return}}typeof window<"u"&&window.scrollTo({left:0,top:0,behavior:"instant"})}await bt(e,n,!t,i,"GET",null,r,s)}finally{o&&clearTimeout(o),s===S&&(ht(!1),typeof location<"u"&&(I=location.href))}}async function Pi(e,t,n,r,s){k&&k.abort(),k=new AbortController;let o=k.signal,i=++S,a=t==="get"||t==="head",c=new URL(e,location.href);if(a){c.search="";for(let[p,m]of n)c.searchParams.append(p,typeof m=="string"?m:m.name)}I&&ro(I);let l=setTimeout(()=>{ht(!0),l=null},150),h=go(),u=s?po(s,i,c.href):null,f=!1;try{let p=await bt(c.href,r,!0,h,a?"GET":t.toUpperCase(),a?null:n,o,i);f=!!(p&&p.ok),!a&&i===S&&(C.clear(),w.clear())}finally{u&&mo(u,i,c.href,f),l&&clearTimeout(l),i===S&&(ht(!1),typeof location<"u"&&(I=location.href))}}function Nn(){let e=be(document.body);return e?[...e.entries()].map(([t,n])=>`${t}:${n.routeKey}`).join(","):""}function jn(){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 io(){try{if(typeof matchMedia=="function")return matchMedia("(hover: hover) and (pointer: fine)").matches}catch{}return!0}function Bi(e){let t=e.getAttribute("rel");return t?t.toLowerCase().split(/\s+/).filter(Boolean):[]}function pt(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||wt.test(n.pathname)?null:t}function ao(e){if(e.hasAttribute("data-no-prefetch"))return!0;let t=Bi(e);return t.includes("external")||t.includes("no-prefetch")}function mt(e){if(ao(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 io()?"intent":"viewport"}}function ye(e){if(!z||typeof fetch!="function"||jn())return;let t=ee(e);if(X.has(t)||Le.has(t))return;let n=w.get(t);if(n&&gn()-n.at<oo)return;if(X.size>=so){for(Le.add(t),de.push(e);de.length>Mi;){let o=de.shift();Le.delete(ee(o))}return}let r=Nn();if(!r&&typeof document<"u"&&document.readyState==="loading")return;X.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,h=l?l.getAttribute("data-webjs-build"):null,u=l?l.getAttribute("data-webjs-src"):null;(a&&h&&a!==h||c&&u&&c!==u)&&(C.clear(),w.clear());let f=o.redirected&&o.url?o.url:e,p=await o.text();$i(t,{html:p,build:a,src:c,finalUrl:f,at:gn()})}).catch(()=>{}).finally(()=>{X.delete(t),Di()})}function Di(){for(;de.length&&X.size<so;){let e=de.shift();Le.delete(ee(e)),ye(e)}}function $i(e,t){for(w.has(e)&&w.delete(e),w.set(e,t);w.size>Ii;){let n=w.keys().next().value;w.delete(n)}typeof document<"u"&&document.dispatchEvent(new CustomEvent("webjs:prefetch",{detail:{url:t.finalUrl,key:e,from:"prefetch"}}))}function co(e){let t=ee(e),n=w.get(t);return!n||(w.delete(t),gn()-n.at>=oo)?null:n}function gn(){try{if(typeof performance<"u"&&typeof performance.now=="function")return performance.now()}catch{}return 0}function pe(e){if(!z)return;let t=uo(e.target);if(!t)return;let n=mt(t);if(n==="none"||n==="render")return;let r=pt(t);if(r){if(e.type==="touchstart"){ye(r);return}n==="intent"&&(Oe===t&&he||(St(),Oe=t,he=setTimeout(()=>{he=null,Oe=null,ye(r)},Fi)))}}function lo(e){let t=uo(e.target);t&&t===Oe&&St()}function St(){he&&(clearTimeout(he),he=null),Oe=null}function Rn(){for(let e of Pe)clearTimeout(e);Pe.clear(),fe=new WeakMap}function uo(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 _n(){if(typeof document>"u"||jn())return;let e=typeof IntersectionObserver<"u";e&&(V?(V.disconnect(),Rn()):V=new IntersectionObserver(t=>{for(let n of t){let r=n.target;if(n.isIntersecting){if(fe.has(r))continue;let s=setTimeout(()=>{Pe.delete(s),fe.delete(r),V.unobserve(r);let o=pt(r);o&&mt(r)==="viewport"&&ye(o)},Ui);fe.set(r,s),Pe.add(s)}else{let s=fe.get(r);s&&(clearTimeout(s),Pe.delete(s),fe.delete(r))}}},{threshold:.5}));for(let t of document.querySelectorAll("a[href]")){let n=mt(t);if(n==="render"){let r=pt(t);r&&ye(r)}else n==="viewport"&&e&&V.observe(t)}}function Hi(e){if(typeof document>"u"||!document.body)return!1;let t=be(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 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 pn(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||Hi(t)||typeof location<"u"&&(location.href=e)}async function bt(e,t,n,r,s,o,i,a,c){s=s||"GET";let l=typeof a=="number"?a:S,h,u=null,f=null,p=null,m=null,x=!1,g=e,d=t?fo(t,l):null;try{try{let b=s==="GET"&&!o&&!t?co(e):null;if(b)h=b.html,f=b.build,p=b.src,g=b.finalUrl,m=200,x=!0;else{let N={"x-webjs-router":"1"},_e=Nn();_e&&(N["x-webjs-have"]=_e),t&&(N["x-webjs-frame"]=t),o!=null&&s!=="GET"&&s!=="HEAD"&&(N.accept=Dr+", text/html");let W={method:s,headers:N,credentials:"same-origin"};i&&(W.signal=i),o!=null&&s!=="GET"&&s!=="HEAD"&&(W.body=o);let A=await fetch(e,W);m=A.status,x=A.ok;let v=A.headers.get("content-type")||"",xo=/^text\/html\b/i.test(v);if(v.toLowerCase().indexOf(Dr)===0){let No=await A.text();return l===S&&(Re(r),fn(No)),{ok:x,status:m,aborted:!1}}if(A.redirected&&A.url&&(g=A.url),A.status===204||A.status===205)return l===S&&n&&history.pushState(null,"",g),{ok:x,status:m,aborted:!1};if(!xo)return l===S&&(Re(r),pn(e,A.status,null)),{ok:!1,status:m,aborted:!1};f=A.headers.get("x-webjs-build"),p=A.headers.get("x-webjs-src");let Tt=await Ao(A);h=Tt.shell,Tt.streaming&&(u=Tt)}}catch(b){return b&&b.name==="AbortError"?{ok:!1,status:null,aborted:!0}:l!==S?{ok:!1,status:null,aborted:!0}:(Re(r),pn(e,null,b instanceof Error?b:new Error(String(b))),{ok:!1,status:null,aborted:!1})}if(l!==S){if(u&&u.reader)try{u.reader.cancel()}catch{}return{ok:!1,status:m,aborted:!0}}let U=An(h);if(!U)return Re(r),pn(e,null,new Error("navigation response did not parse as HTML")),{ok:!1,status:m,aborted:!1};if(Ln(U,t,!!c,g,f,p)==="discard"){if(u&&u.reader)try{u.reader.cancel()}catch{}return{ok:x,status:m,aborted:!1}}if(n&&history.pushState(null,"",g),n){let b=new URL(g);if(b.hash){let N=document.getElementById(b.hash.slice(1));N?N.scrollIntoView():($r(),window.scrollTo({left:0,top:0,behavior:"instant"}))}else $r(),window.scrollTo({left:0,top:0,behavior:"instant"})}return u&&(u.reader||u.rest)&&Eo(u.reader,u.dec,u.rest,()=>l===S),document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:g,frameId:t,from:"navigate"}})),{ok:x,status:m,aborted:!1}}finally{d&&ho(d,l)}}function fo(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=yt.has(n);return yt.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 ho(e,t){if(yt.get(e)!==t)return;yt.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 po(e,t,n){let r=gt.has(e);return gt.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 mo(e,t,n,r){if(gt.get(e)!==t)return;gt.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 Hr(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+=Q(r);return n}function bo(){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 ft(e,t){let n=typeof document<"u"?document.startViewTransition:void 0;if(bo()&&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 yo(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 At(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=qi(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 qi(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 Vi(e){if(!(!e||!e.start))for(let t=e.start.nextSibling;t&&t!==e.end;t=t.nextSibling)t.nodeType===1&&Z(t)}function Ln(e,t,n,r,s,o){try{lt(e)}catch{}try{typeof sessionStorage<"u"&&(!r||t||n)&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}if(r&&!t&&!n){let u=document.querySelector('script[type="importmap"]'),f=u?u.getAttribute("data-webjs-build"):null,p=!1;if(s&&f&&(p=s!==f),!p&&e.head&&e.head.children.length>0){let m=Hr(document),x=Hr(e);m!==x&&(p=!0)}if(p&&typeof location<"u"){C.clear(),w.clear();try{let m="webjs:importmap-reload";if(sessionStorage&&sessionStorage.getItem(m))sessionStorage.removeItem(m);else{sessionStorage&&sessionStorage.setItem(m,"1"),location.href=r;return}}catch{location.href=r;return}}else if(!p){let m=u?u.getAttribute("data-webjs-src"):null;o&&m&&o!==m&&(C.clear(),w.clear(),u&&u.setAttribute("data-webjs-src",o));try{typeof sessionStorage<"u"&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}}}if(t){let u=document.querySelector(`webjs-frame#${CSS.escape(t)}`),f=e.querySelector(`webjs-frame#${CSS.escape(t)}`);if(u&&f){Sn(e.head),ft(()=>{Xi(u,f),Ie(u),Z(u),dt()},()=>Z(u)),Vr(e.body);return}let p=new CustomEvent("webjs:frame-missing",{bubbles:!0,cancelable:!0,detail:{frameId:t,url:r||(typeof location<"u"?location.href:null),document:e}});(u||document).dispatchEvent(p),p.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=be(document.body),a=be(e.body),c=i&&a?no(i,a):null;if(c){let{mode:u,live:f,incoming:p}=c;Sn(e.head),ft(()=>{u==="replace"?zi(f,p):Wi(f,p,e),dt()},()=>Vi(f)),Vr(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";So(e.head),yo(document.body,e.body);let l=[...e.body.childNodes];ft(()=>{document.body.replaceChildren(...l),Ie(document.body),Z(document.body),dt()},()=>Z(document.body))}function dt(){let e=document.activeElement;!e||e===document.body||e===document.documentElement||typeof e.blur=="function"&&e.blur()}function zi(e,t){let n=e.start.parentNode;if(!n)return;let r=[];for(let o=e.start.nextSibling;o&&o!==e.end;o=o.nextSibling)r.push(o);let s=[];for(let o=t.start.nextSibling;o&&o!==t.end;o=o.nextSibling)s.push(document.importNode(o,!0));At(r,s);for(let o of r)o.parentNode===n&&n.removeChild(o);for(let o of s)n.insertBefore(o,e.end);for(let o=e.start.nextSibling;o&&o!==e.end;o=o.nextSibling)o.nodeType===1&&(Ie(o),Z(o))}function Wi(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));At(s,o),Ki(r,e.start,e.end,s,o);for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)i.nodeType===1&&(Ie(i),Z(i))}function Ki(e,t,n,r,s){let o=new Map;for(let c of r){if(c.nodeType!==1)continue;let l=me(c);l&&o.set(l,c)}let i=n,a=[];for(let c of s){if(c.nodeType===1){let l=me(c);if(l&&o.has(l)){let h=o.get(l);_t(h,c),a.push(h),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 _t(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),!wn.has(r.name)&&e.getAttribute(r.name)!==r.value&&e.setAttribute(r.name,r.value);for(let r of[...e.attributes])wn.has(r.name)||n.has(r.name)||e.removeAttribute(r.name);if(Yi(e)){Ji(e,t);return}vt(e,t)}function Yi(e){return e[Symbol.for("webjs.instance")]!=null}function Gi(e,t){for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!1;return!0}function qr(e){let t=new Map,n=`slot[${L}][${M}="${K}"]`;for(let r of e.querySelectorAll(n)){let s=r;if(!Gi(s,e))continue;let o=s.getAttribute("name")||null;t.has(o)||t.set(o,s)}return t}function Ji(e,t){if(!e[R])return;let n=qr(e),r=qr(t);if(n.size===0&&r.size===0)return;let s=new Set([...n.keys(),...r.keys()]);for(let o of s){let i=n.get(o),a=r.get(o);i&&a?(vt(i,a),se(e,o,[...i.childNodes])):a?se(e,o,[...a.childNodes].map(c=>document.importNode(c,!0))):se(e,o,null)}}function vt(e,t){let n=[...e.childNodes],r=[...t.childNodes].map(a=>document.importNode(a,!0));At(n,r);let s=new Map;for(let a of n){if(a.nodeType!==1)continue;let c=me(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=me(c);if(l&&s.has(l)){let u=s.get(l);_t(u,c),o.push(u),s.delete(l);continue}let h=n[a];if(h&&h.nodeType===1&&!me(h)&&h.tagName===c.tagName){_t(h,c),o.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),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 me(e){let t=e.getAttribute("data-key");return t?`${e.tagName}:k:${t}`:e.id?`${e.tagName}:i:${e.id}`:null}function go(){let e=be(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 s=e.get(n),o=[];for(let a=s.start.nextSibling;a&&a!==s.end;a=a.nextSibling)o.push(a);let i=document.createRange();return i.setStartAfter(s.start),i.setEndBefore(s.end),i.deleteContents(),s.start.parentNode.insertBefore(r.content.cloneNode(!0),s.end),{slot:s,oldChildren:o,token:S}}function Re(e){if(!e||e.token!==S)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 Xi(e,t){vt(e,t)}function _o(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function On(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=_o();return n&&t.setAttribute("nonce",n),t.textContent=e.textContent,t}function wo(e){if(!e.hasAttribute("nonce"))return e.cloneNode(!0);let t=e.cloneNode(!0),n=_o();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function Q(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function Sn(e){let t=e.querySelector("title");t&&(document.title=t.textContent||"");let n=new Set;for(let r of document.head.children)n.add(Q(r));for(let r of e.children)r.tagName==="SCRIPT"&&r.getAttribute("type")==="importmap"||r.tagName!=="BASE"&&r.tagName!=="TITLE"&&(n.has(Q(r))||(r.tagName==="SCRIPT"?document.head.appendChild(On(r)):document.head.appendChild(wo(r))))}function Qi(e){return e.tagName==="STYLE"?!0:e.tagName==="LINK"&&(e.getAttribute("rel")||"").toLowerCase().split(/\s+/).includes("stylesheet")}function So(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(Q(o));let s=new Set;for(let o of e.children)o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&s.add(Q(o));for(let o of[...t.children])o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&o.tagName!=="TITLE"&&(Qi(o)||s.has(Q(o))||o.remove());for(let o of e.children)o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&o.tagName!=="TITLE"&&(r.has(Q(o))||(o.tagName==="SCRIPT"?t.appendChild(On(o)):t.appendChild(wo(o))))}function Z(e){typeof customElements>"u"||Pn(e)}function Pn(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&&Pn(n.shadowRoot))}function Vr(e){for(let t of e.querySelectorAll("template[data-webjs-resolve]"))document.body.appendChild(t.cloneNode(!0))}async function Ao(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 h=r.indexOf(s);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 u=i.exec(r);if(u){let f=u.index+u[0].length;return{shell:r.slice(0,f),streaming:!0,reader:t,dec:n,rest:r.slice(f)}}}}function vo(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 Co(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&&Pn(o)}async function Eo(e,t,n,r){let s=n,o=()=>{let i;for(;i=vo(s);){if(!r())return!1;Co(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 Ie(e){for(let t of e.querySelectorAll("script"))t.replaceWith(On(t))}function Zi(e){return w.get(ee(e))||null}function ea(){return X.size}function ta(){w.clear(),X.clear(),de.length=0,Le.clear(),St(),Rn()}function na(){return S}function ra(){return++S}function oa(){return I}function sa(e){I=e}function ia(){mn.clear(),yn=!1}function aa(e,t){return to(e,t)}function ca(e){return wt.test(e)}var Dr,ue,z,k,S,hn,I,ut,wt,eo,mn,yn,Li,C,Ii,oo,so,Mi,Fi,Ui,w,X,de,Le,he,Oe,V,fe,Pe,yt,gt,wn,at=B(()=>{ln();ct();ct();Mr();dn();Je();Dr="text/vnd.webjs-stream.html";ue=null;z=!1,k=null,S=0,hn=null;I=null,ut=null;wt=/\.(?: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;eo="_top";mn=new Set;yn=!1;Li=16,C=new Map;Ii=8,oo=3e4,so=3,Mi=24,Fi=100,Ui=250,w=new Map,X=new Set,de=[],Le=new Set,he=null,Oe=null,V=null,fe=new WeakMap,Pe=new Set;yt=new WeakMap;gt=new WeakMap;wn=new Set(["value","checked","selected","indeterminate","disabled","open","popover"]);(typeof window>"u"||window.__WEBJS_CLIENT_ROUTER__!==!1)&&vn()});function Ro(e,...t){return{_$webjs:"template",strings:e,values:t}}function T(e){return!!e&&typeof e=="object"&&e._$webjs==="template"}var _="wjm-";function Lo(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 kt(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 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 Oo(e){return!e||!e.length?"":`<style>${e.map(t=>t.text).join(`
|
|
3
|
+
`)}</style>`}var Nt=Object.freeze({"@":"event",".":"prop","?":"bool"});function Dn(e){return Object.prototype.hasOwnProperty.call(Nt,e)}function Po(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function Io(e){return String(e).replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<")}var $n=Symbol.for("webjs.repeat");function Hn(e,t,n){return{[$n]:!0,items:[...e],keyFn:t,templateFn:n}}function Me(e){return!!e&&typeof e=="object"&&e[$n]===!0}function Mo(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function jt(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function Fo(e){return{_$webjs:"live",value:e}}function Rt(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function Uo(e,t){return{_$webjs:"keyed",key:e,value:t}}function Fe(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function Bo(e,t){return{_$webjs:"guard",deps:e,fn:t}}function Ue(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function Do(e){return{_$webjs:"template-content",template:e}}function Lt(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function $o(e){return{_$webjs:"ref",target:e}}function Be(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function Ho(){return{value:void 0}}function qo(e){return{_$webjs:"cache",value:e}}function De(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function Vo(...e){return{_$webjs:"until",args:e}}function $e(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function zo(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function Ot(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function Wo(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function Pt(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function Ko(e){return{_$webjs:"watch",signal:e}}function He(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}var j=null,D=!1,ne=0,te=null,It=0,qn=(e,t)=>Object.is(e,t),Ve=()=>{},Vn=()=>!1;function zn(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)zn(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 $t(e){if(D)throw new Error("Signal read during notification phase");if(j===null)return;let t=j,n=t.nextProducerIndex++;n<t.producers.length&&t.producers[n]!==e&&Ut(t)&&we(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,Ut(t)&&zn(e,t)),t.producerLastReadVersions[n]=e.version}function Ut(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function Wn(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=D;D=!0;try{for(let n of e.liveConsumers)n.dirty||Yo(n)}finally{D=t}}function Yo(e){e.dirty=!0,Wn(e),e.consumerMarkedDirty.call(e.wrapper||e)}function ze(e){if(!(!e.dirty&&e.lastCleanEpoch===ne)){if(!e.producerMustRecompute()&&!Go(e)){e.dirty=!1,e.lastCleanEpoch=ne;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=ne}}function Go(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(ze(n),r!==n.version))return!0}return!1}function Bt(e){e&&(e.nextProducerIndex=0);let t=j;return j=e,t}function Dt(e,t){if(j=t,!!e){if(Ut(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 We=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=ne,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=Vn,this.producerRecomputeValue=Ve,this.consumerMarkedDirty=Ve,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||qn,this.watched=n?.[Ht],this.unwatched=n?.[qt]}get(){return $t(this),this.__value}peek(){return this.__value}set(t){if(D)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,ne++,te!==null?Kn(this):Wn(this))}};function Kn(e){let t=D;D=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers)n.dirty||(n.dirty=!0,n.__isWatcher?te.add(n):Kn(n))}finally{D=t}}var Mt=Symbol("unset"),Ft=Symbol("computing"),qe=Symbol("errored"),Se=class{constructor(t,n){this.__fn=t,this.__value=Mt,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||qn,this.watched=n?.[Ht],this.unwatched=n?.[qt];let r=this;this.producerMustRecompute=function(){return r.__value===Mt||r.__value===Ft},this.producerRecomputeValue=function(){if(r.__value===Ft)throw new Error("Detected cycle in computations.");let s=r.__value;r.__value=Ft;let o=Bt(r),i,a=!1;try{i=r.__fn.call(r.wrapper)}catch(l){i=qe,r.__error=l,a=!0}finally{Dt(r,o)}if(!a&&(s!==Mt&&s!==qe)&&r.__equal.call(r.wrapper,s,i)){r.__value=s;return}r.__value=i,r.version++},this.consumerMarkedDirty=Ve}get(){if(ze(this),$t(this),this.__value===qe)throw this.__error;return this.__value}peek(){if(ze(this),this.__value===qe)throw this.__error;return this.__value}},Ke=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=ne,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=Vn,this.producerRecomputeValue=Ve,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=Bt(this);try{for(let r of t)$t(r),r.__isComputed&&ze(r)}finally{Dt(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=Bt(this),r;try{r=t()}finally{Dt(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)we(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},Ht=Symbol("watched"),qt=Symbol("unwatched");function Jo(e){let t=j;j=null;try{return e()}finally{j=t}}function Xo(e){return e.producers.slice()}function Qo(e){return e.liveConsumers?[...e.liveConsumers]:[]}function Zo(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function es(e){return e.producers.length>0}function ts(){return j&&j.__isComputed?j:null}function ns(e){It++,te===null&&(te=new Set);try{e()}finally{if(It--,It===0){let t=te;te=null;for(let n of t)n.__fire()}}}var Ae={State:We,Computed:Se,subtle:{Watcher:Ke,untrack:Jo,introspectSources:Xo,introspectSinks:Qo,hasSinks:Zo,hasSources:es,currentComputed:ts,watched:Ht,unwatched:qt}};function rs(e,t){return new We(e,t)}function os(e,t){return new Se(e,t)}function ss(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function is(e){let t=!1,n=!1,r=new Se(e),s=new Ke(()=>{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())}}Je();var or=new WeakMap,Xt=Symbol.for("webjs.instance");function ce(e,t){let n=t,r=n[Xt];if(T(e)){let s=e;if(r&&r.strings===s.strings){ie(r,s.values);return}r&&sr(r,t);let o=t.firstChild;o&&o.nodeType===8&&o.data==="webjs-hydrate"&&o.remove();let i=_s(s,t);n[Xt]=i;return}if(r&&sr(r,t),n[Xt]=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 Qe(e){let{strings:t}=e,n=or.get(t);if(n)return n;let r=[],s="",o="text",i="",a=0,c="",l=0,h=null,u="",f="";for(let m=0;m<t.length;m++){let x=t[m];for(let g=0;g<x.length;g++){let d=x[g];switch(o){case"text":s+=d,d==="<"&&(o="tag-open");break;case"tag-open":s+=d,d==="!"?o="bang-1":d==="/"?(o="tag-name",u=""):/[a-zA-Z]/.test(d)?(o="tag-name",u=d.toLowerCase()):o="text";break;case"bang-1":s+=d,o=d==="-"?"bang-dash":"tag-name";break;case"bang-dash":s+=d,d==="-"?(o="comment",l=0):o="tag-name";break;case"comment":s+=d,d==="-"?l+=1:(d===">"&&l>=2&&(o="text"),l=0);break;case"tag-name":s+=d,d===">"?(o=u==="script"||u==="style"?"rawtext":"text",o==="rawtext"&&(f="")):/\s/.test(d)?o="in-tag":u+=d.toLowerCase();break;case"in-tag":s+=d,d===">"?(o=u==="script"||u==="style"?"rawtext":"text",o==="rawtext"&&(f="")):!/\s/.test(d)&&d!=="/"&&(o="attr-name",i=d,a=s.length-1);break;case"rawtext":s+=d,f=(f+d.toLowerCase()).slice(-9),(f.endsWith("<\/script>")||f.endsWith("</style>"))&&(o="text",f="",u="");break;case"attr-name":d==="="?(o="after-eq",s+=d):/\s/.test(d)?(o="in-tag",i="",s+=d):d===">"?(o="text",i="",s+=d):(i+=d,s+=d);break;case"after-eq":d==='"'||d==="'"?(o="attr-quoted",c=d,s+=d):/\s/.test(d)?(o="in-tag",i="",s+=d):d===">"?(o="text",i="",s+=d):(o="attr-unquoted",s+=d);break;case"attr-unquoted":/\s/.test(d)?(o="in-tag",i="",s+=d):(d===">"&&(o="text",i=""),s+=d);break;case"attr-quoted":s+=d,d===c&&(o="in-tag",i="");break;case"skip-attr":if(d===c){if(h){let U=h.firstPartIdx,E=[];for(let v=U;v<r.length;v++)(r[v].kind==="noop"||r[v].kind==="attr-mixed")&&E.push(v);let b=[],N=t[E[0]],_e=N.lastIndexOf(c);b.push(_e>=0?N.slice(_e+1):N);for(let v=1;v<E.length;v++)b.push(t[E[v]]);let W=t[E[E.length-1]+1],A=W.indexOf(c);b.push(A>=0?W.slice(0,A):W),r[U]={kind:"attr-mixed",path:[],name:h.name,statics:b,group:E};for(let v=1;v<E.length;v++)r[E[v]]={kind:"noop",path:[],mixedAnchor:U};h=null}o="in-tag",i=""}break}}if(m<t.length-1){let g=r.length;if(o==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(o==="rawtext"){f="",r.push({kind:"noop",path:[]});continue}if(o==="text")s+=`<!--${_}${g}-->`,r.push({kind:"child",path:[]});else if(o==="in-tag"){let d=`data-${_}${g}`;s+=`${d}=""`,r.push({kind:"element",path:[]})}else if(o==="after-eq"){let d=i[0],U=i.slice(1);if(Dn(d)){s=s.slice(0,a);let E=Nt[d],b=`data-${_}${g}`;s+=`${b}=""`,r.push({kind:E,path:[],name:U})}else{s=s.slice(0,a);let E=`data-${_}${g}`;s+=`${E}=""`,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 d=`data-${_}${g}`;s+=`${d}=""`,h={name:i,firstPartIdx:g},r.push({kind:"noop",path:[]}),o="skip-attr"}else o==="skip-attr"&&r.push({kind:"noop",path:[]})}}let p=document.createElement("template");return p.innerHTML=s,ys(p.content,r),gs(p.content,r),n={templateEl:p,parts:r},or.set(t,n),n}function ys(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(L,"");let s=t.length;r.setAttribute(`data-${_}${s}`,""),t.push({kind:"slot",path:[]})}}function gs(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(_)){let c=Number(a.slice(_.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-${_}`)){let h=Number(l.name.slice(`data-${_}`.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 _s(e,t){let{templateEl:n,parts:r}=Qe(e),s=n.content.cloneNode(!0),o=document.createComment(`${_}s`),i=document.createComment(`${_}e`),a=r.map(l=>Ze(l,s)),c=[];for(let l=0;l<e.values.length;l++)H(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"&&H(l,void 0,void 0,[]);return{strings:e.strings,bound:a,lastValues:c,startNode:o,endNode:i}}function Ze(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 ie(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?H(e.bound[o],t[o],e.lastValues[o],t):H(s,r,e.lastValues[n],t),e.lastValues[n]=r}}function sr(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=Qt(n.slotEl);r&&rr(r,n.slotEl)}}t.replaceChildren()}function H(e,t,n,r){if(Rt(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":As(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":Ss(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=Qt(s);if(!a||ws(s))return;let c=document.createDocumentFragment();for(;s.firstChild;)c.appendChild(s.firstChild);s[Ge]=c,queueMicrotask(()=>Jt(a))};Qt(s)?o():queueMicrotask(o);break}case"noop":break}}function Qt(e){let t=e.parentElement;for(;t;){if(t[R])return t;t=t.parentElement}return null}function ws(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 Ss(e,t){let n=e,r=Be(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 As(e,t){return Rs(e,t),O(e,t)}function O(e,t){let n=e.marker;if(jt(t)){$(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(Fe(t)){let s=t,o=e.__keyedKey;o!==void 0&&!Object.is(o,s.key)&&$(e),e.__keyedKey=s.key,O(e,s.value);return}if(Ue(t)){let s=t,o=e.__guardDeps,i=s.deps;if(o!==void 0&&(Array.isArray(o)&&Array.isArray(i)?js(o,i):Object.is(o,i)))return;e.__guardDeps=Array.isArray(i)?i.slice():i,O(e,s.fn());return}if(Lt(t)){$(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(Be(t))return;if(De(t))return Ls(e,t.value);if($e(t))return Os(e,t.args);if(He(t))return Ps(e,t.signal);if(Ot(t))return Is(e,t);if(Pt(t))return Ms(e,t);if(Me(t)){if(e.child&&e.child.kind==="repeat"){Es(e,t);return}$(e);let s={kind:"repeat",map:new Map};e.child=s,Cs(n,s,t);return}if(Array.isArray(t)){if(e.child&&e.child.kind==="array"){xs(e,t);return}$(e);let s={kind:"array",items:[]};e.child=s,ks(n,s,t);return}if(e.child){let s=e.child;if(s.kind==="repeat")ir(s),e.child=void 0;else if(s.kind==="array")cr(s),e.child=void 0;else if(s.kind==="async-stream")dr(s),e.child=void 0;else if("strings"in e.child){let o=e.child;if(T(t)&&o.strings===t.strings){ie(o,t.values);return}ae(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(T(t)){let s=t,{templateEl:o,parts:i}=Qe(s),a=o.content.cloneNode(!0),c=document.createComment(`${_}s`),l=document.createComment(`${_}e`),h=i.map(p=>Ze(p,a)),u=[];for(let p=0;p<s.values.length;p++)H(h[p],s.values[p],void 0,s.values),u.push(s.values[p]);let f=[c,...a.childNodes,l];n.parentNode?.insertBefore(vs(f),n);for(let p of h)p.kind==="slot"&&H(p,void 0,void 0,[]);e.child={strings:s.strings,bound:h,lastValues:u,startNode:c,endNode:l};return}let r=document.createTextNode(String(t));n.parentNode?.insertBefore(r,n),e.child=[r]}function vs(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function ae(e,t){if(!e.parentNode)return;let n=e;for(;n&&n!==t;){let r=n.nextSibling;n.parentNode?.removeChild(n),n=r}t.parentNode===e.parentNode&&t.parentNode?.removeChild(t)}function en(e){let{templateEl:t,parts:n}=Qe(e),r=t.content.cloneNode(!0),s=document.createComment(`${_}s`),o=document.createComment(`${_}e`),i=n.map(l=>Ze(l,r)),a=[];for(let l=0;l<e.values.length;l++)H(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 Ce(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 Cs(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),h=o(r[c],c);if(!T(h))continue;let{inst:u,frag:f}=en(h);t.map.set(l,u),a.appendChild(f)}i.insertBefore(a,e)}function Es(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 h=i(o[l],l),u=a(o[l],l);if(!T(u))continue;let f=s.map.get(h);if(f&&f.strings===u.strings)ie(f,u.values),Zt(f.startNode,f.endNode,r,n),c.set(h,f),s.map.delete(h);else{f&&(Ce(f),ae(f.startNode,f.endNode),s.map.delete(h));let{inst:p,frag:m}=en(u);r.insertBefore(m,n),c.set(h,p)}}for(let l of s.map.values())Ce(l),ae(l.startNode,l.endNode);s.map=c}function ir(e){for(let t of e.map.values())Ce(t),ae(t.startNode,t.endNode);e.map.clear()}function Ts(e){return e.type==="tpl"?e.inst.startNode:e.type==="text"?e.node:null}function Xe(e){e.type==="tpl"?(Ce(e.inst),ae(e.inst.startNode,e.inst.endNode)):e.type==="text"&&e.node.parentNode?.removeChild(e.node)}function ar(e){if(T(e)){let{inst:t,frag:n}=en(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 ks(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}=ar(i);c&&s.appendChild(c),o.push(a)}r.insertBefore(s,e),t.items=o}function xs(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(T(c)){let f=c;if(l&&l.type==="tpl"&&l.inst.strings===f.strings){ie(l.inst,f.values),i.push(l);continue}}else if(c!=null&&c!==!1&&c!==!0){if(l&&l.type==="text"){let f=String(c);l.node.data!==f&&(l.node.data=f),i.push(l);continue}}else{l&&Xe(l),i.push({type:"empty"});continue}let{item:h,frag:u}=ar(c);u&&r.insertBefore(u,Ns(o,a,n)),l&&Xe(l),i.push(h)}for(let a=t.length;a<o.length;a++)Xe(o[a]);s.items=i}function Ns(e,t,n){for(let r=t;r<e.length;r++){let s=Ts(e[r]);if(s&&s.parentNode)return s}return n}function cr(e){for(let t of e.items)Xe(t);e.items=[]}function Zt(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 js(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 $(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&lr(t),!e.child)return;let n=e.child;if(n.kind==="repeat")ir(n);else if(n.kind==="array")cr(n);else if(n.kind==="async-stream")dr(n);else if("strings"in n){let r=e.child;Ce(r),ae(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function Rs(e,t){let n=e;n.__untilState&&!$e(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!Ue(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!De(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!Fe(t)&&(n.__keyedKey=void 0),n.__watchSub&&!He(t)&&lr(n)}function Ls(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(T(t)&&a.strings===t.strings){ie(a,t.values);return}let c=document.createDocumentFragment();Zt(a.startNode,a.endNode,c,null),s.set(a.strings,{inst:a,holder:c}),e.child=void 0}if(T(t)){let a=t,c=s.get(a.strings);if(c){s.delete(a.strings),e.child&&$(e),Zt(c.inst.startNode,c.inst.endNode,n.parentNode,n),ie(c.inst,a.values),e.child=c.inst;return}}O(e,t)}function Os(e,t){let n=e,r=n.__untilState,s=n.__untilArgs,o=(f,p)=>!!(Object.is(f,p)||T(f)&&T(p)&&f.strings===p.strings),a=s&&s.length===t.length&&s.every((f,p)=>o(f,t[p]))&&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 f=0;f<t.length;f++){let p=t[f];if(!p||typeof p.then!="function"){l=f,h=p;break}}l!==-1&&l<=c.highestResolved?(O(e,h),c.highestResolved=l):l===-1&&!n.__untilEverRendered&&O(e,""),n.__untilEverRendered=!0;let u=Math.min(l===-1?t.length:l,c.highestResolved);for(let f=0;f<u;f++){let p=t[f];!p||typeof p.then!="function"||Promise.resolve(p).then(m=>{c.aborted||f>=c.highestResolved||(c.highestResolved=f,O(e,m))},()=>{})}}function Ps(e,t){let n=e;if(n.__watchSig===t&&n.__watchSub){let o;n.__watchSub.observe(()=>{o=t.get()}),O(e,o);return}n.__watchSub&&(n.__watchSub.dispose(),n.__watchSub=void 0),n.__watchSig=t;let r=new Ae.subtle.Watcher(()=>{queueMicrotask(()=>{if(n.__watchSub!==r)return;let o;r.observe(()=>{o=t.get()}),O(e,o)})});n.__watchSub=r;let s;r.observe(()=>{s=t.get()}),O(e,s)}function lr(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function Is(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="append"&&n.iterable===t.iterable)return;$(e);let r=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=s,ur(s,e,t)}function Ms(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="replace"&&n.iterable===t.iterable)return;$(e);let r=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=s,ur(s,e,t)}async function ur(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(T(e)){let t=e,{templateEl:n,parts:r}=Qe(t),s=n.content.cloneNode(!0),o=r.map(i=>Ze(i,s));for(let i=0;i<t.values.length;i++)H(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 dr(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 hr=null;function et(e){hr=e||null}function Fs(){return hr||void 0}var pr=Symbol.for("webjs:registry"),mr=Symbol.for("webjs:classToTag"),tt=globalThis,P=tt[pr]||(tt[pr]=new Map),br=tt[mr]||(tt[mr]=new WeakMap),nt=typeof window<"u"&&typeof customElements<"u";function tn(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=P.get(e);r?(r.cls=t,r.lazy=n):P.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),br.set(t,e)}if(nt){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),tn(t,n)}}if(!nt){let e=globalThis;e.customElements||(e.customElements={define(t,n){tn(t,n)},get(t){return P.get(t)?.cls},upgrade(){},whenDefined(t){let n=P.get(t);return Promise.resolve(n?.cls)}})}function nn(e,t){nt?customElements.define(e,t):tn(e,t)}function Us(e,t){if(nt)return;let n=P.get(e);if(n){n.moduleUrl=t;return}P.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e})}function Bs(e){return P.get(e)?.cls}function Ds(e){return P.get(e)?.moduleUrl||null}function $s(e){return P.get(e)?.lazy===!0}function rt(e){return br.get(e)}function Hs(){return[...P.keys()]}ke();Je();var vr=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 ot=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}},ri=["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 ri){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(ot.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}var oi=vr?HTMLElement:ot,Cr=Symbol("webjs.factoryProps"),Sr=new WeakSet,le=class e extends oi{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){nn(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||on(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(Sr.has(t))return;let n=t;for(;n&&n!==e;){if(Object.hasOwn(n,"properties")&&!Object.hasOwn(n,Cr)){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)}Sr.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||on(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(!vr)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=Ar(r.slice(16));try{this[o]=G(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:kt(r)?[r]:[];if(s.length){if(n){let o=this.shadowRoot.querySelector("style");o&&o.remove()}xt(this._renderRoot,s)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${rt(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().`),Gt(this)||(this.__isHydrating()?(re(this),er(this)):Zn(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 tr(this)}hasSlot(t){return nr(this,t)}setSlotContent(t,n){se(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 o=this.constructor.properties||{},i,a;for(let[h,u]of Object.entries(o))if(((typeof u=="object"?u:{type:u}).attribute||on(h))===t){i=h,a=u;break}if(a===void 0&&(i=Ar(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 Ae.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n;if(this.__signalWatcher.observe(()=>{n=this.render()}),n&&typeof n.then=="function")return this._commitAsync(n);ce(n,this._renderRoot)}_commitAsync(t){let n=this.__renderToken;if(this.__firstRendered&&this._overridesRenderFallback())try{let r=this.renderFallback();r!==void 0&&ce(r,this._renderRoot)}catch(r){console.error("[webjs] renderFallback() threw:",r)}return Promise.resolve(t).then(r=>{n===this.__renderToken&&ce(r,this._renderRoot)},r=>{n===this.__renderToken&&this._handleRenderError(r instanceof Error?r:new Error(String(r)))})}_overridesRenderFallback(){return this.renderFallback!==st.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${rt(this.constructor)||this.tagName?.toLowerCase()}>:`,t);try{let n=this.renderError(t);n!==void 0&&ce(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 on(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Ar(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function st(e){return new.target?Reflect.construct(le,arguments,new.target):class extends le{static properties=e;static[Cr]=!0}}Object.setPrototypeOf(st,le);st.prototype=le.prototype;function si(e,t={}){return e&&typeof e=="object"&&!("call"in e)&&(t=e,e=void 0),{...e?{type:e}:{},...t}}var Er=Symbol.for("webjs.notFound"),Tr=Symbol.for("webjs.redirect"),kr=Symbol.for("webjs.forbidden"),xr=Symbol.for("webjs.unauthorized");function ii(){let e=new Error("webjs: notFound()");throw e.__webjs=Er,e}function ai(){let e=new Error("webjs: forbidden()");throw e.__webjs=kr,e}function ci(){let e=new Error("webjs: unauthorized()");throw e.__webjs=xr,e}function li(e,t){let n=typeof t=="object"&&t!==null?t.status:t,r=new Error(`webjs: redirect(${e})`);throw r.__webjs=Tr,r.url=e,r.status=typeof n=="number"?n:void 0,r}function ui(e){return!!e&&e.__webjs===Er}function fi(e){return!!e&&e.__webjs===Tr}function di(e){return!!e&&e.__webjs===kr}function hi(e){return!!e&&e.__webjs===xr}var Nr=null;function pi(){if(!Nr)return"";try{return Nr()||""}catch{return""}}var lc=Symbol.for("webjs.suspense");function mi(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function bi(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}function yi(e,t={}){let n=t.reconnect!==!1,r=0,s=!1,o=null,i=[];function a(){s||(o=new WebSocket(gi(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 gi(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}`}ke();var sn="application/vnd.webjs+json";async function _i(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",sn);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 rn(r),n.has("content-type")||n.set("content-type",sn));let s=await fetch(e,{...t,headers:n,body:r}),o=s.headers.get("content-type")||"",i=await s.text(),a=o.includes(sn)?i?G(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}ke();at();at();ln();ct();var In=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 la(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 ua(e,t,n){return e&&typeof e.get=="function"&&typeof e.set=="function"?la(e,t,n):new In(e,t)}dn();var Ct=0,To=new Map,ge=new Map,fa=1e3;function da(e){if(!(!Array.isArray(e)||!e.length)){Ct+=1;for(let t of e)t&&To.set(t,Ct)}}function ha(){return Ct}function pa(e,t,n){if(!(!Array.isArray(t)||!t.length)&&(ge.delete(e),ge.set(e,{tags:t.slice(),since:typeof n=="number"?n:Ct}),ge.size>fa)){let r=ge.keys().next().value;r!==void 0&&ge.delete(r)}}function ma(e){let t=ge.get(e);if(!t)return!1;for(let n of t.tags)if((To.get(n)||0)>t.since)return!0;return!1}function ba(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}var ya="application/vnd.webjs+stream",ga=1,_a=2,wa=3,ko=new Uint8Array(0);function Sa(e,t){let n=t||ko,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 Aa(){let e=ko;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 va=Symbol.for("webjs.context");function Ca(e){return{__context__:va,name:e}}var Et=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},Mn=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()}},Fn=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 Et(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 Ea(){return typeof window<"u"}var F={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},Un=class{constructor(t,{task:n,args:r,autoRun:s=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=s,this._status=F.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=F.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=F.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=F.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 F.INITIAL:return t.initial?.();case F.PENDING:return t.pending?.();case F.COMPLETE:return t.complete?.(this._value);case F.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun||!Ea())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{Fn as ContextConsumer,Mn as ContextProvider,Et as ContextRequestEvent,ga as FRAME_CHUNK,_a as FRAME_END,wa as FRAME_ERROR,_ as MARKER,Br as SEED_MISS,ya as STREAM_CONTENT_TYPE,Ae as Signal,mi as Suspense,Un as Task,F as TaskStatus,st as WebComponent,cn as WebjsFrame,un as WebjsStream,Fs as activeActionSignal,xt as adoptStyles,Hs as allTags,zo as asyncAppend,Wo as asyncReplace,ns as batch,qo as cache,os as computed,yi as connectWS,ma as consumeStale,Ca as createContext,Aa as createFrameDecoder,Ho as createRef,pi as cspNonce,Lo as css,_r as deserialize,zr as disableClientRouter,is as effect,vn as enableClientRouter,Sa as encodeFrame,Io as escapeAttr,Po as escapeText,ha as fetchMark,ai as forbidden,Bo as guard,Ro as html,Ot as isAsyncAppend,Pt as isAsyncReplace,kt as isCSS,De as isCache,di as isForbidden,Ue as isGuard,Fe as isKeyed,$s as isLazy,Rt as isLive,ui as isNotFound,fi as isRedirect,Be as isRef,Me as isRepeat,ss as isSignal,bi as isSuspense,T as isTemplate,Lt as isTemplateContent,hi as isUnauthorized,jt as isUnsafeHTML,$e as isUntil,He as isWatch,Uo as keyed,Fo as live,Bs as lookup,Ds as lookupModuleUrl,da as markStale,Wr as navigate,ii as notFound,ua as optimistic,G as parse,ba as parseTagHeader,Us as primeModuleUrl,si as prop,li as redirect,$o as ref,nn as register,pa as registerKeyTags,ce as render,fn as renderStream,Hn as repeat,Kr as revalidate,_i as richFetch,lt as scanSeeds,gr as serialize,et as setActiveActionSignal,rs as signal,rn as stringify,Oo as stylesToString,rt as tagOf,Ti as takeSeed,Do as templateContent,ci as unauthorized,Mo as unsafeHTML,Vo as until,Ko as watch};
|
|
4
4
|
//# sourceMappingURL=webjs-core-browser.js.map
|