@webjsdev/core 0.7.42 → 0.7.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,9 @@
1
- var Us=Object.defineProperty;var oe=(e,t)=>()=>(e&&(t=e(e=0)),t);var $r=(e,t)=>{for(var n in t)Us(e,n,{get:t[n],enumerable:!0})};function Jr(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}function bi(){if(Vr||(ae=Jr(),!ae))return;it=HTMLSlotElement.prototype.assignedNodes,Rn=HTMLSlotElement.prototype.assignedElements,jt=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(n){return this.hasAttribute(L)&&!Ln(this)?Dn(this,n):it?it.call(this,n):[]},HTMLSlotElement.prototype.assignedElements=function(n){return this.hasAttribute(L)&&!Ln(this)?Dn(this,n).filter(r=>r.nodeType===1):Rn?Rn.call(this,n):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let n=jt&&jt.get?jt.get.call(this):null;return n||Kr(this)}});let e=Object.getOwnPropertyDescriptor(Text.prototype,"assignedSlot");Object.defineProperty(Text.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let n=e&&e.get?e.get.call(this):null;return n||Kr(this)}}),On=HTMLSlotElement.prototype.assign,HTMLSlotElement.prototype.assign=function(...n){if(this.hasAttribute(L)&&!Ln(this)){let r=gi(this);if(r){let o=ee(r);o.manualAssign||(o.manualAssign=new Map);let s=n.filter(Boolean);for(let[i,c]of o.manualAssign){if(i===this)continue;let a=c.filter(l=>{let f=l.deref();return f!==void 0&&s.indexOf(f)===-1});a.length!==c.length&&(a.length?o.manualAssign.set(i,a):o.manualAssign.delete(i))}if(s.length?o.manualAssign.set(this,s.map(i=>new WeakRef(i))):o.manualAssign.delete(this),o.applying&&o.pendingRecordNodes)for(let i of s)o.pendingRecordNodes.add(i);else o.pendingRecordNodes=new Set(s);Ue(o),te(r)}return}return On?On.apply(this,n):void 0},Vr=!0}function Hn(e,t){let n=e.manualAssign;if(!n||!n.size)return null;for(let[r,o]of n){let s=!1,i=o.filter(c=>{let a=c.deref();return a===void 0?!1:(a===t&&(s=!0),!0)});if(i.length!==o.length&&(i.length?n.set(r,i):n.delete(r)),s){let c=e.host;return c&&(r===c||c.contains(r))?r:null}}return null}function gi(e){for(let t=e.parentElement;t;t=t.parentElement)if(t[j])return Q(t,e)?t:null;return null}function Ln(e){let t=e;for(let n=0;n<128;n++){let r=t.parentNode;if(!r||r===t)return!1;if(r.nodeType===11&&r.host)return!0;t=r}return!1}function Dn(e,t){if(e.getAttribute(U)!==K)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:Fn(n,new Set,0)}function Fn(e,t,n){if(n>=mi)return e.slice();let r=[];for(let o of e)if(o.nodeType===1&&o.tagName==="SLOT"){let s=o;if(t.has(s))continue;if(t.add(s),s.hasAttribute(L)){let i=Dn(s,{flatten:!1});if(i.length>0)for(let c of Fn(i,t,n+1))r.push(c);else for(let c of Fn(Array.from(s.childNodes),t,n+1))r.push(c)}else if(it){let i=it.call(s,{flatten:!0});for(let c of i)r.push(c)}else r.push(o)}else r.push(o);return r}function Kr(e){let t=e.parentElement;return t&&t.tagName==="SLOT"&&t.hasAttribute(L)&&t.getAttribute(U)===K?t:null}function ee(e){let t=e,n=t[j];return n||(n={host:e,authored:[],assignedByName:new Map,lastSnapshot:new WeakMap},t[j]=n),n}function Wn(e){return!!e[j]}function Xr(e){let t=ee(e);for(;e.firstChild;){let n=e.firstChild;t.authored.push(n),k.add(n),e.removeChild(n)}Ue(t)}function Ue(e){let t=e.assignedByName;t.clear();for(let n of e.authored)yi(t,_e(e,n),n)}function _e(e,t){let n=Hn(e,t);if(n)return V(n.getAttribute("name"));if(e.adoptedKey){let r=e.adoptedKey.get(t);if(r!==void 0)return r}return Qr(t)}function Zr(e){let t=ee(e);t.adopted=!0;let n=new Set,r=e.querySelectorAll(`slot[${L}]`);for(let o of r){let s=o;if(!Q(e,s)||s.getAttribute(U)!==K||Pt(t,e,s))continue;let i=V(s.getAttribute("name"));if(!n.has(i)){n.add(i);let c=Array.from(s.childNodes);for(let a of c)t.authored.push(a),Qr(a)!==i&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(a,i));t.lastSnapshot.set(s,c.slice())}}for(let o of e.querySelectorAll("wj-slot-park"))if(Q(e,o)){for(let s of Array.from(o.childNodes))k.add(s),t.authored.push(s);o.remove()}Ue(t)}function V(e){return e==null||e===""||e==="default"?null:e}function Qr(e){return e.nodeType!==1?null:V(e.getAttribute("slot"))}function yi(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}function Ee(e,t,n){let r=ee(e),o=V(t),s=Array.isArray(n)?n.filter(Boolean):n?[n]:[],i=r.authored.findIndex(a=>_e(r,a)===o),c=r.authored.filter(a=>_e(r,a)===o);r.authored=r.authored.filter(a=>_e(r,a)!==o),(i===-1||i>r.authored.length)&&(i=r.authored.length);for(let a of s)a.nodeType===1&&!Hn(r,a)&&(o==null?a.removeAttribute("slot"):a.setAttribute("slot",o)),k.add(a);if(r.authored.splice(i,0,...s),r.applying&&r.pendingRecordNodes){for(let a of c)r.pendingRecordNodes.add(a);for(let a of s)r.pendingRecordNodes.add(a)}else r.pendingRecordNodes=new Set([...c,...s]);if(r.adoptedKey){for(let a of c)r.adoptedKey.delete(a);for(let a of s)r.adoptedKey.delete(a)}Ue(r),te(e)}function wi(){ie||!ae||(ie=Node.prototype.appendChild,eo=Node.prototype.insertBefore,Be=Node.prototype.removeChild,Bn=Node.prototype.replaceChild,to=Element.prototype.append,no=Element.prototype.prepend,ro=Element.prototype.replaceChildren,Rt=Object.getOwnPropertyDescriptor(Element.prototype,"innerHTML"),Un=Object.getOwnPropertyDescriptor(Node.prototype,"textContent"))}function It(e,t){let n=e[D];e[D]=!0;try{return t()}finally{e[D]=n,n||zn(e)}}function oo(e){if(!ae)return;let t=e,n=ee(e);n.backstop||(n.backstop=new MutationObserver(r=>Mt(e,n,r)),n.backstop.observe(e,{childList:!0,subtree:!1}),n.flipSensor=new MutationObserver(r=>so(e,r)),n.flipSensor.observe(e,{attributes:!0,attributeFilter:["slot","name"],subtree:!0}))}function Mt(e,t,n){let r=e,o=r[Ae],s=r[Symbol.for("webjs.instance")],i=!1,c=new Set;for(let a of n){for(let l of a.addedNodes)if(c.add(l),l!==o&&!(s&&co(s,l))){if(t.authored.indexOf(l)!==-1){i=!0;continue}k.add(l),t.authored.push(l),i=!0}for(let l of a.removedNodes){let f=t.authored.indexOf(l);if(f===-1||e.contains(l))continue;k.has(l)&&l.parentNode==null&&!c.has(l)||(t.authored.splice(f,1),i=!0)}}i&&te(e)}function zn(e){let t=e,n=t[j];if(!(n&&n.backstop))return;let r=n.backstop.takeRecords();(!(Symbol.for("webjs.instance")in t)||t[Symbol.for("webjs.instance")])&&Mt(e,n,r)}function so(e,t){let n=e[j];if(!n)return;let r=!1;for(let o of t){if(o.type!=="attributes")continue;let s=o.target;o.attributeName==="name"?s.tagName==="SLOT"&&s.hasAttribute(L)&&Q(e,s)&&(r=!0):o.attributeName==="slot"&&(n.adoptedKey&&n.adoptedKey.delete(s),n.authored.indexOf(s)!==-1&&(r=!0))}r&&te(e)}function io(e){let t=e[j];t&&(t.backstop&&(Mt(e,t,t.backstop.takeRecords()),t.backstop.disconnect(),t.backstop=void 0),t.flipSensor&&(so(e,t.flipSensor.takeRecords()),t.flipSensor.disconnect(),t.flipSensor=void 0))}function ao(e){if(!ae)return;let t=e,n=t[j];if(!n)return;let r=t[Symbol.for("webjs.instance")],o=Symbol.for("webjs.instance")in t,s=!o&&n.adopted===!0,i=!1;for(let c of Array.from(e.childNodes))if(c!==t[Ae]){if(n.authored.indexOf(c)!==-1){i=!0;continue}o&&(!r||co(r,c))||!o&&s||(k.add(c),n.authored.push(c),i=!0)}i&&te(e)}function co(e,t){if(!e||!e.startNode||!e.endNode)return!1;if(t===e.startNode||t===e.endNode)return!0;for(let n=e.startNode.nextSibling;n&&n!==e.endNode;n=n.nextSibling)if(n===t)return!0;return!1}function _i(e){let t=e,n=t[Ae];return(!n||!n.isConnected)&&(n||(n=e.ownerDocument.createElement("wj-slot-park"),n.setAttribute("hidden",""),n.style.display="none",t[Ae]=n),It(e,()=>ie.call(e,n))),n}function Se(e){return e instanceof Node||!!(e&&typeof e=="object"&&e.ownerDocument&&e.ownerDocument.defaultView&&e instanceof e.ownerDocument.defaultView.Node)}function In(e,t,n){if(n&&!Se(t))return[e.ownerDocument.createTextNode(`${t}`)];if(!Se(t))throw new TypeError("Failed to execute insertion on the host: parameter is not of type Node.");if(t&&t.nodeType===11){let r=Array.from(t.childNodes);Ot(e,r);for(let o of r)Be.call(t,o);return r}return Ot(e,[t]),[t]}function Ot(e,t){Fe(e,t);for(let n of t){if(!Se(n))throw new TypeError("Failed to execute insertion on the host: parameter is not of type Node.");let r=n.nodeType;if(r!==1&&r!==3&&r!==4&&r!==7&&r!==8&&r!==11)throw new DOMException("Failed to execute insertion on the host: the node type may not be inserted here.","HierarchyRequestError")}}function Fe(e,t){for(let n of t)if(n===e||n.nodeType===1&&n.contains(e))throw new DOMException("Failed to execute insertion on the host: the new child contains the parent.","HierarchyRequestError")}function Mn(e,t,n){let r=e.authored;for(let s of t){let i=r.indexOf(s);i!==-1&&r.splice(i,1)}let o=n==null?r.length:r.indexOf(n);o===-1&&(o=r.length),r.splice(o,0,...t)}function lo(e,t){let n=e[j];return n?Pt(n,e,t):!1}function Pt(e,t,n){for(let r=n;r&&r!==t;r=r.parentNode)if(e.authored.indexOf(r)!==-1)return!0;return!1}function Pn(e,t){if(k.has(t))return!0;let n=t.parentNode;if(n==null)return!1;if(n===e||n===e[Ae])return!0;let r=e[j];return n.nodeType===1&&n.tagName==="SLOT"&&n.hasAttribute(L)&&(r&&r.lastSnapshot.has(n)||e.contains(n)&&Q(e,n))}function $n(e,t){let n=[];for(let s of t)Se(s)?s.nodeType===11?n.push({frag:s}):n.push({node:s}):n.push({text:`${s}`});for(let s of n)s.frag?Fe(e,Array.from(s.frag.childNodes)):s.node&&Ot(e,[s.node]);let r=e.ownerDocument.createDocumentFragment();for(let s of n)if(s.text!==void 0)ie.call(r,e.ownerDocument.createTextNode(s.text));else if(s.frag){let i=Array.from(s.frag.childNodes);Ot(e,i);for(let c of i)ie.call(r,c)}else s.node&&(Fe(e,[s.node]),ie.call(r,s.node));let o=Array.from(r.childNodes);Fe(e,o);for(let s of o)Be.call(r,s);return o}function Z(e,t,n){if(t.applying&&t.pendingRecordNodes)for(let r of n||[])t.pendingRecordNodes.add(r);else t.pendingRecordNodes=new Set(n||[]);if(t.adoptedKey&&n)for(let r of n)t.adoptedKey.delete(r);Ue(t),te(e)}function uo(e){if(!ae)return;let t=e;if(t[Gr])return;wi(),t[Gr]=!0;let n=ee(e);t.appendChild=function(r){if(t[D])return ie.call(this,r);let o=In(e,r,!1);for(let s of o)k.add(s);return Mn(n,o,null),Z(e,n,o),r},t.insertBefore=function(r,o){if(t[D])return eo.call(this,r,o);if(!Se(r))throw new TypeError("Failed to execute insertBefore on the host: parameter 1 is not of type Node.");if(o!=null&&!Se(o))throw new TypeError("Failed to execute insertBefore on the host: parameter 2 is not of type Node.");if(Fe(e,r.nodeType===11?Array.from(r.childNodes):[r]),o!=null&&(n.authored.indexOf(o)===-1||!Pn(e,o)))throw new DOMException("insertBefore: reference node is not an assigned child of this host","NotFoundError");if(r===o)return r;let s=In(e,r,!1);for(let i of s)k.add(i);return Mn(n,s,o||null),Z(e,n,s),r},t.removeChild=function(r){if(t[D])return Be.call(this,r);let o=n.authored.indexOf(r);if(o===-1)return Be.call(this,r);if(!Pn(e,r))throw new DOMException("removeChild: the node is not an assigned child of this host","NotFoundError");return n.authored.splice(o,1),Z(e,n,[r]),r},t.replaceChild=function(r,o){if(t[D])return Bn.call(this,r,o);if(n.authored.indexOf(o)===-1)return Bn.call(this,r,o);if(!Se(r))throw new TypeError("Failed to execute replaceChild on the host: parameter 1 is not of type Node.");if(Fe(e,r.nodeType===11?Array.from(r.childNodes):[r]),!Pn(e,o))throw new DOMException("replaceChild: the node to be replaced is not an assigned child of this host","NotFoundError");if(r===o)return o;let i=In(e,r,!1);for(let a of i)k.add(a);for(let a of i){if(a===o)continue;let l=n.authored.indexOf(a);l!==-1&&n.authored.splice(l,1)}let c=n.authored.indexOf(o);return n.authored.splice(c,1,...i),Z(e,n,[...i,o]),o},t.append=function(...r){if(t[D])return to.apply(this,r);let o=$n(e,r);for(let s of o)k.add(s);Mn(n,o,null),Z(e,n,o)},t.prepend=function(...r){if(t[D])return no.apply(this,r);let o=$n(e,r);for(let s of o)k.add(s);for(let s of o){let i=n.authored.indexOf(s);i!==-1&&n.authored.splice(i,1)}n.authored.unshift(...o),Z(e,n,o)},t.replaceChildren=function(...r){if(t[D])return ro.apply(this,r);let o=$n(e,r);for(let i of o)k.add(i);let s=n.authored;n.authored=o.slice(),Z(e,n,[...s,...o])},Object.defineProperty(t,"innerHTML",{configurable:!0,get(){return Rt.get.call(this)},set(r){if(t[D]){Rt.set.call(this,r);return}let o=e.ownerDocument.createElement("div");Rt.set.call(o,r===null?"":`${r}`);let s=Array.from(o.childNodes);for(let c of s)k.add(c);let i=n.authored;n.authored=s,Z(e,n,[...i,...s])}}),Object.defineProperty(t,"textContent",{configurable:!0,get(){return Un.get.call(this)},set(r){if(t[D]){Un.set.call(this,r);return}let o=r==null||r===""?[]:[e.ownerDocument.createTextNode(`${r}`)];for(let i of o)k.add(i);let s=n.authored;n.authored=o,Z(e,n,[...s,...o])}})}function te(e){if(!ae)return;let t=e[j];if(t){if(t.applying){t.reapply=!0;return}t.applying=!0;try{do{t.reapply=!1;let n=t.pendingRecordNodes||Si;t.pendingRecordNodes=void 0,Ai(e,t,n),Ei(e,t),Ue(t);let r=[],o=new Set;for(let f of e.querySelectorAll(`slot[${L}]`))if(Q(e,f)&&!Pt(t,e,f)){if(!f.hasAttribute(U)&&!(at in f)){o.add(V(f.getAttribute("name")));continue}r.push(f)}let s=new Map;for(let f of r){let u=V(f.getAttribute("name")),d=s.get(u);d||(d=[],s.set(u,d)),d.push(f)}let i=[];for(let[f,u]of s){let d=t.assignedByName.get(f)||[];for(let p=0;p<u.length;p++){let g=u[p],b=d.filter(h=>{let y=Hn(t,h);return y?y===g:p===0}),m=b.filter(h=>h===e||h.nodeType===1&&h.contains(e));if(m.length){for(let h of m)k.delete(h);b=b.filter(h=>m.indexOf(h)===-1)}b.length>0?Ci(t,g,b)&&i.push(g):Ti(t,g)&&i.push(g)}}for(let f of i)Ni(t,f);let c=new Set(s.keys());for(let f of o)c.add(f);let a=new Set;for(let f of t.authored)c.has(_e(t,f))||a.add(f);let l=e[Ae];if(l)for(let f of Array.from(l.childNodes))a.has(f)||Be.call(l,f);if(a.size){let f=_i(e);for(let u of a)u.parentNode!==f&&(k.delete(u),It(e,()=>ie.call(f,u)))}if(t.backstop){let f=t.backstop.takeRecords();f.length&&Mt(e,t,f)}}while(t.reapply)}finally{t.applying=!1}}}function Ai(e,t,n){for(let r of e.querySelectorAll(`slot[${L}][${U}="${K}"]`)){if(!Q(e,r)||Pt(t,e,r))continue;let o=r,s=t.lastSnapshot.get(o);if(!s)continue;let i=Array.from(o.childNodes);if(qn(i,s))continue;let c=t.authored,a=V(o.getAttribute("name")),l=i.filter(g=>!n.has(g));for(let g of l)c.indexOf(g)===-1&&_e(t,g)!==a&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(g,a));for(let g of c){if(l.indexOf(g)!==-1||_e(t,g)!==a)continue;let b=c.indexOf(g),m=0;for(let h=0;h<l.length;h++){let y=c.indexOf(l[h]);y!==-1&&y<b&&(m=h+1)}l.splice(m,0,g)}let f=new Set(l);for(let g of s)f.add(g);let u=-1,d=0;for(let g of c){if(f.has(g)){u===-1&&(u=d);continue}d+=1}let p=c.filter(g=>!f.has(g));(u===-1||u>p.length)&&(u=p.length),p.splice(u,0,...l),t.authored=p}}function Ei(e,t){let n=e[Ae];t.authored=t.authored.filter(r=>{if(k.has(r))return!0;let o=r.parentNode;return o==null?!1:!!(o===e||o===n||o.nodeType===1&&o.tagName==="SLOT"&&o.hasAttribute(L)&&(t.lastSnapshot.has(o)||e.contains(o)&&Q(e,o)))})}function fo(e){if(!ae)return!1;for(let t of e.querySelectorAll(`slot[${L}][${U}]`))if(Q(e,t))return!0;return!1}function Q(e,t){let n=t[Lt];if(n)return n===e;let r=typeof t.getAttribute=="function"?t.getAttribute(hi):null;if(r){let o=xi(t,r);if(o)return o===e}for(let o=t.parentElement;o&&o!==e;o=o.parentElement)if(o.tagName.includes("-"))return!1;return!0}function xi(e,t){let n=t.toLowerCase();for(let r=e.parentElement;r;r=r.parentElement)if(r.tagName.toLowerCase()===n)return r;return null}function Ci(e,t,n){for(let l of n)k.delete(l);let r=t.getAttribute(U)!==K,o=e.lastSnapshot.get(t)||[],s=r||!qn(o,n);if(!r&&qn(Array.from(t.childNodes),n))return e.lastSnapshot.set(t,n.slice()),s;let i=t[at];if(r&&i)for(;t.firstChild;)i.appendChild(t.firstChild);let c=new Set(n);for(let l of Array.from(t.childNodes))c.has(l)||t.removeChild(l);let a=t.firstChild;for(let l of n){if(l===a){a=a.nextSibling;continue}t.insertBefore(l,a)}return t.setAttribute(U,K),e.lastSnapshot.set(t,n.slice()),s}function Ti(e,t){let n=t.getAttribute(U)===K;if(t.setAttribute(U,pi),!n)return Yr(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return Yr(t),!0}function Yr(e){let t=e[at];!t||t.childNodes.length===0||e.appendChild(t)}function po(e,t){if(!Wn(e))return;let n=ee(e),r=V(t.getAttribute("name")),o=n.assignedByName.get(r);if(o)for(let s of o)s.parentNode===t&&(k.add(s),t.removeChild(s));n.lastSnapshot.delete(t)}function ki(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function Ni(e,t){e.pendingSlotChanges||(e.pendingSlotChanges=new Set),e.pendingSlotChanges.add(t),!e.slotChangeScheduled&&(e.slotChangeScheduled=!0,queueMicrotask(()=>{e.slotChangeScheduled=!1;let n=e.pendingSlotChanges||new Set;e.pendingSlotChanges=new Set;for(let r of n)ki(r)}))}function qn(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 ae,j,L,U,K,pi,at,Lt,hi,mi,it,Rn,jt,On,Vr,D,Gr,Ae,k,ie,eo,Be,Bn,to,no,ro,Rt,Un,Si,$t=oe(()=>{ae=Jr(),j=Symbol("webjs.slot.state"),L="data-webjs-light",U="data-projection",K="actual",pi="fallback",at=Symbol("webjs.slot.fallbackFrag"),Lt=Symbol("webjs.slot.templateOwner"),hi="data-wj-slot-owner",mi=64,it=null,Rn=null,jt=null,On=null,Vr=!1;bi();D=Symbol("webjs.slot.rendering"),Gr=Symbol("webjs.slot.intercepted"),Ae=Symbol("webjs.slot.park"),k=new WeakSet,ie=null,eo=null,Be=null,Bn=null,to=null,no=null,ro=null,Rt=null,Un=null;Si=new Set});function No(e,t,n){ea.has(t)?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}async function dt(e){return JSON.stringify(await vo(e))}function ne(e){return jo(JSON.parse(e))}async function vo(e){let t=ta();return await na(e,t),xe(e,t)}function jo(e){return le(e,ia())}function ta(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map,fdEntries:new Map}}async function na(e,t){let n=[e];for(;n.length;){let r=n.pop();if(!ca(r))continue;let o=t.refCount.get(r)||0;if(t.refCount.set(r,o+1),!(o>0)){if(typeof Blob<"u"&&r instanceof Blob){let s=new Uint8Array(await r.arrayBuffer());t.blobBytes.set(r,s);continue}if(typeof FormData<"u"&&r instanceof FormData){let s=t.fdEntries.get(r)||[...r.entries()];t.fdEntries.set(r,s);for(let[,i]of s)typeof i!="string"&&n.push(i);continue}if(Array.isArray(r))for(let s=0;s<r.length;s++)n.push(r[s]);else if(r instanceof Map)for(let[s,i]of r)n.push(s),n.push(i);else if(r instanceof Set)for(let s of r)n.push(s);else if(la(r))for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&n.push(r[s])}}for(let[r,o]of t.refCount)o>1&&t.idOf.set(r,t.nextId++)}function xe(e,t){if(e===null)return null;if(e===void 0)return{[N]:"undef"};let n=typeof e;if(n==="string"||n==="boolean")return e;if(n==="number")return Number.isNaN(e)?{[N]:"NaN"}:e===1/0?{[N]:"Inf"}:e===-1/0?{[N]:"-Inf"}:Object.is(e,-0)?{[N]:"-0"}:e;if(n==="bigint")return{[N]:"BigInt",v:e.toString()};if(n==="symbol"){let s=Symbol.keyFor(e);if(s===void 0)throw new TypeError("Cannot serialize a local Symbol; only Symbol.for() registered symbols are supported.");return{[N]:"Sym",v:s}}if(n==="function")throw new TypeError("Cannot serialize a function.");let r=t.idOf.get(e);if(r!==void 0&&t.emitted.has(r))return{[N]:"Ref",v:r};r!==void 0&&t.emitted.add(r);let o;if(e instanceof Date)o={[N]:"Date",v:Number.isNaN(e.getTime())?null:e.toISOString()};else if(e instanceof Error)o={[N]:"Error",v:{name:e.name,message:e.message,stack:e.stack||null}};else if(typeof Blob<"u"&&e instanceof Blob){let s=t.blobBytes.get(e);typeof File<"u"&&e instanceof File?o={[N]:"File",v:ft(s),n:e.name,t:e.type||"",m:e.lastModified}:o={[N]:"Blob",v:ft(s),t:e.type||""}}else if(typeof FormData<"u"&&e instanceof FormData){let s=t.fdEntries.get(e)||[...e.entries()],i=[];for(let[c,a]of s)i.push([c,xe(a,t)]);o={[N]:"FD",v:i}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)o=ra(e);else if(e instanceof Map){let s=[];for(let[i,c]of e)s.push([xe(i,t),xe(c,t)]);o={[N]:"Map",v:s}}else if(e instanceof Set){let s=[];for(let i of e)s.push(xe(i,t));o={[N]:"Set",v:s}}else if(Array.isArray(e))o=e.map(s=>xe(s,t));else{o={};for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;let i=ua(s)?"_"+s:s;No(o,i,xe(e[s],t))}}if(r!==void 0){if(Array.isArray(o))return{[N]:"Arr",_id:r,v:o};o._id=r}return o}function ra(e){if(e instanceof ArrayBuffer)return{[N]:"buf",v:ft(new Uint8Array(e))};if(e instanceof DataView)return{[N]:"dv",v:ft(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=oa[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[N]:n,v:ft(r)}}function ia(){return{refs:new Map}}function le(e,t){if(e===null||typeof e!="object")return e;if(Array.isArray(e)){let s=[];for(let i=0;i<e.length;i++)s.push(le(e[i],t));return s}let n=e[N];if(typeof n=="string")return aa(e,n,t);let r={},o=e._id;typeof o=="number"&&t.refs.set(o,r);for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s)||s==="_id")continue;let i=fa(s)?s.slice(1):s;No(r,i,le(e[s],t))}return r}function aa(e,t,n){let r=e._id,o=s=>(typeof r=="number"&&n.refs.set(r,s),s);switch(t){case"undef":return;case"NaN":return NaN;case"Inf":return 1/0;case"-Inf":return-1/0;case"-0":return-0;case"BigInt":return o(BigInt(e.v));case"Sym":return o(Symbol.for(e.v));case"Date":return o(e.v==null?new Date(NaN):new Date(e.v));case"Error":{let s=new Error(e.v.message);return s.name=e.v.name,e.v.stack&&(s.stack=e.v.stack),typeof r=="number"&&n.refs.set(r,s),s}case"Map":{let s=new Map;typeof r=="number"&&n.refs.set(r,s);for(let[i,c]of e.v)s.set(le(i,n),le(c,n));return s}case"Set":{let s=new Set;typeof r=="number"&&n.refs.set(r,s);for(let i of e.v)s.add(le(i,n));return s}case"Arr":{let s=[];typeof r=="number"&&n.refs.set(r,s);for(let i of e.v)s.push(le(i,n));return s}case"Ref":{let s=n.refs.get(e.v);if(s===void 0)throw new TypeError(`Dangling reference: id=${e.v}`);return s}case"Blob":{if(typeof Blob>"u")throw new TypeError("Blob is not available in this environment.");let s=ut(e.v);return o(new Blob([s],{type:e.t||""}))}case"File":{if(typeof File>"u")throw new TypeError("File is not available in this environment.");let s=ut(e.v);return o(new File([s],e.n,{type:e.t||"",lastModified:e.m}))}case"FD":{if(typeof FormData>"u")throw new TypeError("FormData is not available in this environment.");let s=new FormData;o(s);for(let[i,c]of e.v){let a=le(c,n);s.append(i,a)}return s}default:{if(t==="buf"){let i=ut(e.v);return o(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength))}if(t==="dv"){let i=ut(e.v);return o(new DataView(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)))}let s=sa[t];if(s){let i=ut(e.v),c=i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength);return o(new s(c))}throw new TypeError(`Unknown serialization tag: ${t}`)}}}function ca(e){return e!==null&&typeof e=="object"}function la(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function ua(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function fa(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}function ft(e){if(Ro)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 ut(e){if(Ro){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 N,ea,oa,sa,Ro,ze=oe(()=>{N="_$wj",ea=new Set(["__proto__","constructor","prototype"]);oa={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},sa={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};Ro=typeof Buffer<"u"&&typeof Buffer.from=="function"});var Vo={};$r(Vo,{observeLazy:()=>Xa,observeViewportOnce:()=>ec});function zo(e){let t=rr.get(e);return t||(t=import(e).finally(()=>rr.delete(e)),rr.set(e,t),t)}function Xa(e){for(let[t,n]of Object.entries(e))Ce.set(t.toLowerCase(),n);if(typeof IntersectionObserver>"u"){for(let t of Ce.values())zo(t);Ce.clear();return}bt||(bt=new IntersectionObserver(Za,{rootMargin:"200px"})),Wo(),typeof MutationObserver<"u"&&new MutationObserver(()=>Wo()).observe(document.body,{childList:!0,subtree:!0})}function Wo(){if(!(!bt||!Ce.size))for(let e of Ce.keys())for(let t of document.querySelectorAll(e))bt.observe(t)}function Za(e){for(let t of e){if(!t.isIntersecting)continue;let n=t.target.tagName.toLowerCase(),r=Ce.get(n);r&&(zo(r),Ce.delete(n),bt?.unobserve(t.target))}}function Qa(e){for(let t of e){if(!t.isIntersecting)continue;let n=Xt.get(t.target);Xt.delete(t.target),mt?.unobserve(t.target),n&&n()}}function ec(e,t){return typeof IntersectionObserver>"u"?(t(),()=>{}):(mt||(mt=new IntersectionObserver(Qa,{rootMargin:"200px"})),Xt.set(e,t),mt.observe(e),()=>{Xt.delete(e),mt?.unobserve(e)})}var Ce,bt,rr,mt,Xt,Ko=oe(()=>{Ce=new Map,bt=null,rr=new Map;mt=null,Xt=new WeakMap});var or,sr=oe(()=>{or=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(()=>(Ko(),Vo)).then(({observeViewportOnce:o})=>{this._webjsLoadedSrc!==n||!this.isConnected||(this._webjsLazyTeardown=o(this,()=>{this._webjsLazyTeardown=null,this._webjsLoad(n)}))})):(this._webjsLoadedSrc=n,this._webjsLoad(n))}_webjsLoad(t){Promise.resolve().then(()=>(ir(),Go)).then(({loadFrame:n})=>{this._webjsLoadedSrc!==t||!this.isConnected||n(this,t)})}}:null;typeof customElements<"u"&&or&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",or)});function nc(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 cr(e,t){let n=t||(typeof document<"u"?document:null);if(!n)return;let r=null;if(typeof e=="string"){let s=n.createElement("template");s.innerHTML=e,r=s.content}else if(e&&e.nodeType)r=e;else return;let o=r.querySelectorAll?Array.from(r.querySelectorAll("webjs-stream")):[];if(o.length)for(let s of o)n.body.append(s);else n.body.append(r)}var tc,ar,Zt=oe(()=>{tc=new Set(["append","prepend","before","after","replace","update"]);ar=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this._webjsApplied||(this._webjsApplied=!0,this._webjsApply())}_webjsApply(){let t=(this.getAttribute("action")||"").toLowerCase(),n=this.ownerDocument||document,r=[],o=this.getAttribute("target");if(o){let i=n.getElementById(o);i&&(r=[i])}else{let i=this.getAttribute("targets");if(i)try{r=Array.from(n.querySelectorAll(i))}catch{r=[]}}let s=tc.has(t)?this.querySelector("template"):null;try{for(let i of r){let c=s?s.content.cloneNode(!0):null;nc(t,i,c)}}finally{this.remove()}}}:null;typeof customElements<"u"&&ar&&!customElements.get("webjs-stream")&&customElements.define("webjs-stream",ar)});var Yo,Jo=oe(()=>{Yo=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this.style.display||(this.style.display="contents")}}:null;typeof customElements<"u"&&Yo&&!customElements.get("webjs-suspense")&&customElements.define("webjs-suspense",Yo)});function Qt(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]'))Zo(n.textContent,n);for(let n of t.querySelectorAll("[data-webjs-seed]"))Zo(n.getAttribute("data-webjs-seed"),n,()=>n.removeAttribute("data-webjs-seed"))}}function Zo(e,t,n){if(e)try{let r=ne(e);if(r&&typeof r=="object")for(let o in r)gt.has(o)||gt.set(o,r[o])}catch{}n?n():t.remove?.()}function rc(e,t,n){Xo||(Xo=!0,Qt());let r=`${e}/${t}/${n}`;if(gt.has(r)){let o=gt.get(r);return gt.delete(r),o}return Qo}var gt,Qo,Xo,lr=oe(()=>{ze();gt=new Map,Qo=Symbol("webjs.seed.miss"),Xo=!1});var Go={};$r(Go,{_FRAME_TOP:()=>ps,_LIVE_ATTRS:()=>gr,_activeFrameId:()=>ds,_addNewHeadElements:()=>yr,_applyStreamedResolve:()=>Ps,_applySwap:()=>vr,_blurOutgoingFocus:()=>nn,_buildHaveHeader:()=>Tr,_buildSubmitFormData:()=>us,_bumpNavToken:()=>Mc,_clearFormBusy:()=>ks,_clearFrameBusy:()=>Cs,_collectBoundaries:()=>Qe,_currentPageUrl:()=>Pc,_diffElementInPlace:()=>un,_eligibleAnchorHref:()=>on,_findAnchorInPath:()=>fs,_getSubmitAction:()=>ls,_getSubmitMethod:()=>cs,_isNonHtmlPath:()=>Bc,_keyOf:()=>Ze,_markFormBusy:()=>Ts,_markFrameBusy:()=>xs,_mergeHead:()=>Ls,_navToken:()=>Ic,_onPopState:()=>Sr,_onSubmit:()=>Ar,_parseHTML:()=>wr,_planBoundarySwap:()=>ms,_prefetch:()=>et,_prefetchCache:()=>I,_prefetchHasHoverPointer:()=>ws,_prefetchInflightSize:()=>Oc,_prefetchMode:()=>sn,_prefetchPeek:()=>Rc,_prefetchSaysSaveData:()=>kr,_prefetchSuppressed:()=>_s,_prefetchTake:()=>Ss,_reactivateScripts:()=>At,_readStreamedShell:()=>Is,_reconcileChildren:()=>mn,_regraftPermanentElements:()=>vs,_regraftPermanentInSlice:()=>hn,_resetParseProbe:()=>sc,_resetPrefetch:()=>Lc,_resetWarnOnce:()=>Dc,_resolveTargetFrameId:()=>Er,_restoreOptimistic:()=>yt,_runWithTransition:()=>tn,_setCurrentPageUrl:()=>$c,_shouldFullLoadDuringParse:()=>Fc,_snapshotCache:()=>F,_streamBoundariesProgressively:()=>$s,_takeResolveUnit:()=>Ms,_viewTransitionsEnabled:()=>Ns,collectBoundaries:()=>Qe,disableClientRouter:()=>os,enableClientRouter:()=>_r,loadFrame:()=>cc,navigate:()=>ss,planBoundarySwap:()=>ms,revalidate:()=>is});function wr(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"&&oc()?Document.parseHTMLUnsafe(e):ic(e)}function oc(){if(Ke!==null)return Ke;try{Ke=Document.parseHTMLUnsafe("<!doctype html><body><!--c--><i></i>")?.body?.firstChild?.nodeType===8}catch{Ke=!1}return Ke}function sc(){Ke=null}function ic(e){return typeof DOMParser>"u"?null:new DOMParser().parseFromString(e,"text/html")}function ac(){ur||typeof MutationObserver>"u"||typeof customElements>"u"||(ur=new MutationObserver(e=>{for(let t of e)for(let n of t.addedNodes){if(n.nodeType!==1)continue;let r=n;r.tagName?.includes("-")&&customElements.upgrade(r);for(let o of r.querySelectorAll("*"))o.tagName?.includes("-")&&customElements.upgrade(o)}}),ur.observe(document.body,{childList:!0,subtree:!0}))}function _r(){de||typeof document>"u"||(de=!0,document.addEventListener("click",as,!1),document.addEventListener("submit",Ar,!1),window.addEventListener("popstate",Sr),document.addEventListener("pointerover",Xe,!0),document.addEventListener("focusin",Xe,!0),document.addEventListener("touchstart",Xe,{capture:!0,passive:!0}),document.addEventListener("pointerout",As,!0),document.addEventListener("webjs:navigate",br),ac(),br(),typeof history<"u"&&"scrollRestoration"in history&&(en=history.scrollRestoration,history.scrollRestoration="manual"),typeof location<"u"&&(X=location.href))}function os(){de&&(de=!1,document.removeEventListener("click",as,!1),document.removeEventListener("submit",Ar,!1),window.removeEventListener("popstate",Sr),document.removeEventListener("pointerover",Xe,!0),document.removeEventListener("focusin",Xe,!0),document.removeEventListener("touchstart",Xe,{capture:!0}),document.removeEventListener("pointerout",As,!0),document.removeEventListener("webjs:navigate",br),pn(),Nr(),fe&&(fe.disconnect(),fe=null),typeof history<"u"&&en!==null&&(history.scrollRestoration=en,en=null),X=null)}async function ss(e,t){let n=new URL(e,location.href);if(n.origin!==location.origin){location.href=e;return}await Cr(n.href,t?.replace??!1,null)}async function cc(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};W&&W.abort(),W=new AbortController;let o=W.signal,s=++$;return an(r.href,n,!1,null,"GET",null,o,s)}function is(e){if(!e){F.clear(),I.clear();return}let t=new URL(e,location.href),n=t.pathname+t.search;F.delete(n),I.delete(n)}function as(e){if(!de||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=fs(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||dn.test(r.pathname))return;e.preventDefault();let o=Er(t);Cr(n,!1,o)}function Sr(e){Cr(location.href,!0,null)}function Ar(e){if(!de||e.defaultPrevented)return;let t=e.target;if(!t||t.nodeType!==1||t.tagName!=="FORM"||t.hasAttribute("data-no-router"))return;let n=e.submitter??null;if(n&&n.hasAttribute("data-no-router"))return;let r=n&&n.getAttribute("formtarget")||t.getAttribute("target")||"";if(r&&r!=="_self")return;let o=cs(t,n);if(o==="dialog")return;let s=ls(t,n),i;try{i=new URL(s,location.href)}catch{return}if(i.origin!==location.origin||dn.test(i.pathname))return;let c=us(t,n);e.preventDefault();let a=Er(n||t);fc(i.href,o,c,a,t)}function cs(e,t){return(t&&t.getAttribute("formmethod")||e.getAttribute("method")||"get").toLowerCase()}function ls(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function us(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 fs(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function ds(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 Er(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===ps)return null;let r=typeof document<"u"?document.getElementById(n):null;return r&&r.tagName&&r.tagName.toLowerCase()==="webjs-frame"?n:(xr(`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 ds(e)}function xr(e,t){dr.has(e)||(dr.add(e),typeof console<"u"&&console.warn&&console.warn(t))}function hs(e,t){return!e&&!t&&typeof document<"u"&&document.readyState==="loading"}function pr(e,t){typeof process<"u"&&process.env||xr(`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 ts(){if(typeof process<"u"&&process.env||hr||typeof document>"u"||typeof getComputedStyle!="function")return;let e=document.documentElement;if(!e)return;hr=!0;let t;try{t=getComputedStyle(e).scrollBehavior}catch{return}t==="smooth"&&xr("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 rn(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 Qe(e){let t=new Map,n=[],r=!1;function o(s){if(!r){if(s.nodeType===8){let i=s.data.trim();if(i.startsWith("wj:children:")){let c=i.slice(12),a=c.lastIndexOf(":");if(a<=0||a===c.length-1){r=!0;return}let l=c.slice(0,a),f=c.slice(a+1);if(t.has(l)||n.some(u=>u.segment===l)){r=!0;return}n.push({segment:l,routeKey:f,start:s});return}if(i.startsWith("/wj:children")){let c=i.slice(12).replace(/^:/,""),a=n.pop();if(!a||a.segment!==c){r=!0;return}if(a.start.parentNode!==s.parentNode){r=!0;return}{let l=a.start.parentNode.tagName;if(l==="TABLE"||l==="TBODY"||l==="THEAD"||l==="TFOOT"||l==="TR"){r=!0;return}}t.set(a.segment,{routeKey:a.routeKey,start:a.start,end:s});return}return}if(s.hasChildNodes&&s.hasChildNodes())for(let i=s.firstChild;i&&!r;i=i.nextSibling)o(i)}}return o(e),r||n.length>0?null:t}function ms(e,t){let n=[...e.keys()].filter(i=>t.has(i)).sort((i,c)=>i.length-c.length);if(n.length===0)return null;for(let i of n)if(e.get(i).routeKey!==t.get(i).routeKey){let c=null;for(let a of n){if(a===i)break;i.startsWith(a==="/"?a:a+"/")&&(c=a)}return c?{mode:"replace",segment:c,live:e.get(c),incoming:t.get(c)}:null}let r=n[n.length-1],o=i=>{let c=null;for(let a of i.keys())(c===null||a.length>c.length)&&(c=a);return c};return{mode:o(e)===r&&o(t)===r?"morph":"replace",segment:r,live:e.get(r),incoming:t.get(r)}}function bs(e){let t=ve(e);document.dispatchEvent(new CustomEvent("webjs:before-cache",{detail:{url:e}})),F.has(t)&&F.delete(t);let n={html:document.documentElement.outerHTML,scrollX:typeof window<"u"&&window.scrollX||0,scrollY:typeof window<"u"&&window.scrollY||0};for(F.set(t,n);F.size>lc;){let r=F.keys().next().value;F.delete(r)}}function uc(e){let t=ve(e),n=F.get(t);return n==null?null:(F.delete(t),F.set(t,n),typeof n=="string"?{html:n,scrollX:0,scrollY:0}:n)}function ve(e){let t=new URL(e,location.href);return t.pathname+t.search}async function Cr(e,t,n){if(hs(t,n)&&typeof location<"u"){pr("readyState-loading",e),location.href=e;return}W&&W.abort(),W=new AbortController;let r=W.signal,o=++$;X&&bs(X);let s=setTimeout(()=>{rn(!0),s=null},150),i=null;t||(i=js());try{if(t){let c=uc(e);if(c){let a=wr(c.html);if(a){vr(a,n,!0,null),typeof window<"u"&&window.scrollTo({left:c.scrollX,top:c.scrollY,behavior:"instant"}),an(e,n,!1,i,"GET",null,r,o,!0).catch(()=>{});return}}typeof window<"u"&&window.scrollTo({left:0,top:0,behavior:"instant"})}await an(e,n,!t,i,"GET",null,r,o)}finally{s&&clearTimeout(s),o===$&&(rn(!1),typeof location<"u"&&(X=location.href))}}async function fc(e,t,n,r,o){W&&W.abort(),W=new AbortController;let s=W.signal,i=++$,c=t==="get"||t==="head",a=new URL(e,location.href);if(c){a.search="";for(let[p,g]of n)a.searchParams.append(p,typeof g=="string"?g:g.name)}X&&bs(X);let l=setTimeout(()=>{rn(!0),l=null},150),f=js(),u=o?Ts(o,i,a.href):null,d=!1;try{let p=await an(a.href,r,!0,f,c?"GET":t.toUpperCase(),c?null:n,s,i);d=!!(p&&p.ok),!c&&i===$&&(F.clear(),I.clear())}finally{u&&ks(u,i,a.href,d),l&&clearTimeout(l),i===$&&(rn(!1),typeof location<"u"&&(X=location.href))}}function Tr(){let e=Qe(document.body);return e?[...e.entries()].map(([t,n])=>`${t}:${n.routeKey}`).join(","):""}function kr(){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 ws(){try{if(typeof matchMedia=="function")return matchMedia("(hover: hover) and (pointer: fine)").matches}catch{}return!0}function bc(e){let t=e.getAttribute("rel");return t?t.toLowerCase().split(/\s+/).filter(Boolean):[]}function on(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||dn.test(n.pathname)?null:t}function _s(e){if(e.hasAttribute("data-no-prefetch"))return!0;let t=bc(e);return t.includes("external")||t.includes("no-prefetch")}function sn(e){if(_s(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 ws()?"intent":"viewport"}}function et(e){if(!de||typeof fetch!="function"||kr())return;let t=ve(e);if(Te.has(t)||wt.has(t))return;let n=I.get(t);if(n&&mr()-n.at<gs)return;if(Te.size>=ys){for(wt.add(t),Ye.push(e);Ye.length>pc;){let s=Ye.shift();wt.delete(ve(s))}return}let r=Tr();if(!r&&typeof document<"u"&&document.readyState==="loading")return;Te.add(t);let o={"x-webjs-router":"1","x-webjs-prefetch":"1"};r&&(o["x-webjs-have"]=r),fetch(e,{method:"GET",headers:o,credentials:"same-origin"}).then(async s=>{let i=s.headers.get("content-type")||"";if(!/^text\/html\b/i.test(i)||s.status>=400)return;let c=s.headers.get("x-webjs-build"),a=s.headers.get("x-webjs-src"),l=typeof document<"u"?document.querySelector('script[type="importmap"]'):null,f=l?l.getAttribute("data-webjs-build"):null,u=l?l.getAttribute("data-webjs-src"):null;(c&&f&&c!==f||a&&u&&a!==u)&&(F.clear(),I.clear());let d=s.redirected&&s.url?s.url:e,p=await s.text();yc(t,{html:p,build:c,src:a,finalUrl:d,at:mr()})}).catch(()=>{}).finally(()=>{Te.delete(t),gc()})}function gc(){for(;Ye.length&&Te.size<ys;){let e=Ye.shift();wt.delete(ve(e)),et(e)}}function yc(e,t){for(I.has(e)&&I.delete(e),I.set(e,t);I.size>dc;){let n=I.keys().next().value;I.delete(n)}typeof document<"u"&&document.dispatchEvent(new CustomEvent("webjs:prefetch",{detail:{url:t.finalUrl,key:e,from:"prefetch"}}))}function Ss(e){let t=ve(e),n=I.get(t);return!n||(I.delete(t),mr()-n.at>=gs)?null:n}function mr(){try{if(typeof performance<"u"&&typeof performance.now=="function")return performance.now()}catch{}return 0}function Xe(e){if(!de)return;let t=Es(e.target);if(!t)return;let n=sn(t);if(n==="none"||n==="render")return;let r=on(t);if(r){if(e.type==="touchstart"){et(r);return}n==="intent"&&(_t===t&&Je||(pn(),_t=t,Je=setTimeout(()=>{Je=null,_t=null,et(r)},hc)))}}function As(e){let t=Es(e.target);t&&t===_t&&pn()}function pn(){Je&&(clearTimeout(Je),Je=null),_t=null}function Nr(){for(let e of St)clearTimeout(e);St.clear(),Ge=new WeakMap}function Es(e){let t=e;for(;t;){if(t instanceof HTMLAnchorElement)return t;let n=t.nodeType===1?t:null;if(n){let o=n.closest&&n.closest("a");if(o instanceof HTMLAnchorElement)return o}let r=t.getRootNode?t.getRootNode():null;t=r&&r.host?r.host:null}return null}function br(){if(typeof document>"u"||kr())return;let e=typeof IntersectionObserver<"u";e&&(fe?(fe.disconnect(),Nr()):fe=new IntersectionObserver(t=>{for(let n of t){let r=n.target;if(n.isIntersecting){if(Ge.has(r))continue;let o=setTimeout(()=>{St.delete(o),Ge.delete(r),fe.unobserve(r);let s=on(r);s&&sn(r)==="viewport"&&et(s)},mc);Ge.set(r,o),St.add(o)}else{let o=Ge.get(r);o&&(clearTimeout(o),St.delete(o),Ge.delete(r))}}},{threshold:.5}));for(let t of document.querySelectorAll("a[href]")){let n=sn(t);if(n==="render"){let r=on(t);r&&et(r)}else n==="viewport"&&e&&fe.observe(t)}}function wc(e){if(typeof document>"u"||!document.body)return!1;let t=Qe(document.body);if(!t)return!1;let n,r=-1;for(let[a,l]of t)a.length>r&&(r=a.length,n=l);if(!n)return!1;let o=n.start.parentNode;if(!o||n.start.parentNode!==n.end.parentNode)return!1;let s=document.createElement("div");s.setAttribute("role","alert"),s.setAttribute("data-webjs-nav-error","");let i=e?`This page could not be loaded. (status ${e})`:"This page could not be loaded.";s.textContent=i;let c=document.createRange();return c.setStartAfter(n.start),c.setEndBefore(n.end),c.deleteContents(),o.insertBefore(s,n.end),!0}function fr(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||wc(t)||typeof location<"u"&&(location.href=e)}async function an(e,t,n,r,o,s,i,c,a){o=o||"GET";let l=typeof c=="number"?c:$,f,u=null,d=null,p=null,g=null,b=!1,m=e,h=t?xs(t,l):null;try{try{let w=o==="GET"&&!s&&!t?Ss(e):null;if(w)f=w.html,d=w.build,p=w.src,m=w.finalUrl,g=200,b=!0;else{let C={"x-webjs-router":"1"},x=Tr();x&&(C["x-webjs-have"]=x),t&&(C["x-webjs-frame"]=t),s!=null&&o!=="GET"&&o!=="HEAD"&&(C.accept=es+", text/html");let T={method:o,headers:C,credentials:"same-origin"};i&&(T.signal=i),s!=null&&o!=="GET"&&o!=="HEAD"&&(T.body=s);let S=await fetch(e,T);g=S.status,b=S.ok;let E=S.headers.get("content-type")||"",A=/^text\/html\b/i.test(E);if(E.toLowerCase().indexOf(es)===0){let v=await S.text();return l===$&&(yt(r),cr(v)),{ok:b,status:g,aborted:!1}}if(S.redirected&&S.url&&(m=S.url),S.status===204||S.status===205)return l===$&&n&&history.pushState(null,"",m),{ok:b,status:g,aborted:!1};if(!A)return l===$&&(yt(r),fr(e,S.status,null)),{ok:!1,status:g,aborted:!1};d=S.headers.get("x-webjs-build"),p=S.headers.get("x-webjs-src");let M=await Is(S);f=M.shell,M.streaming&&(u=M)}}catch(w){return w&&w.name==="AbortError"?{ok:!1,status:null,aborted:!0}:l!==$?{ok:!1,status:null,aborted:!0}:(yt(r),fr(e,null,w instanceof Error?w:new Error(String(w))),{ok:!1,status:null,aborted:!1})}if(l!==$){if(u&&u.reader)try{u.reader.cancel()}catch{}return{ok:!1,status:g,aborted:!0}}let y=wr(f);if(!y)return yt(r),fr(e,null,new Error("navigation response did not parse as HTML")),{ok:!1,status:g,aborted:!1};if(vr(y,t,!!a,m,d,p)==="discard"){if(u&&u.reader)try{u.reader.cancel()}catch{}return{ok:b,status:g,aborted:!1}}if(n&&history.pushState(null,"",m),n){let w=new URL(m);if(w.hash){let C=document.getElementById(w.hash.slice(1));C?C.scrollIntoView():(ts(),window.scrollTo({left:0,top:0,behavior:"instant"}))}else ts(),window.scrollTo({left:0,top:0,behavior:"instant"})}return u&&(u.reader||u.rest)&&$s(u.reader,u.dec,u.rest,()=>l===$),document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:m,frameId:t,from:"navigate"}})),{ok:b,status:g,aborted:!1}}finally{h&&Cs(h,l)}}function xs(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=cn.has(n);return cn.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 Cs(e,t){if(cn.get(e)!==t)return;cn.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 Ts(e,t,n){let r=ln.has(e);return ln.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 ks(e,t,n,r){if(ln.get(e)!==t)return;ln.delete(e),e.setAttribute("aria-busy","false");let o=new CustomEvent("webjs:submit-end",{bubbles:!0,detail:{form:e,url:n,ok:!!r}});e.isConnected?e.dispatchEvent(o):typeof document<"u"?document.dispatchEvent(o):e.dispatchEvent(o)}function ns(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+=ke(r);return n}function Ns(){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 tn(e,t){let n=typeof document<"u"?document.startViewTransition:void 0;if(Ns()&&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 vs(e,t){if(!e||!t||typeof e.querySelectorAll!="function")return;let n=e.querySelectorAll("[data-webjs-permanent][id]");for(let r of n){let o=r.id;if(!o)continue;let s=null;try{s=t.querySelector(`#${CSS.escape(o)}`)}catch{s=null}if(!s||!r.hasAttribute||!r.hasAttribute("data-webjs-permanent"))continue;let i=s.parentNode;i&&s!==r&&i.replaceChild(r,s)}}function hn(e,t){let n=[];for(let r of e){if(r.nodeType!==1)continue;let o=r;if(o.hasAttribute&&o.hasAttribute("data-webjs-permanent")&&o.id&&n.push(o),typeof o.querySelectorAll=="function")for(let s of o.querySelectorAll("[data-webjs-permanent][id]"))n.push(s)}if(n.length)for(let r of n){let o=r.id;if(!o)continue;let s=_c(t,o);if(!s||s===r)continue;let i=s.parentNode;if(i)i.replaceChild(r,s);else{let c=t.indexOf(s);c!==-1&&(t[c]=r)}}}function _c(e,t){for(let n of e){if(n.nodeType!==1)continue;let r=n;if(r.id===t)return r;if(typeof r.querySelector=="function"){let o=null;try{o=r.querySelector(`#${CSS.escape(t)}`)}catch{o=null}if(o)return o}}return null}function Sc(e){if(!(!e||!e.start))for(let t=e.start.nextSibling;t&&t!==e.end;t=t.nextSibling)t.nodeType===1&&Ne(t)}function vr(e,t,n,r,o,s){try{Qt(e)}catch{}try{for(let u of e.querySelectorAll("[data-wj-host]"))u.setAttribute("data-wj-serialized","")}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"]'),d=u?u.getAttribute("data-webjs-build"):null,p=!1;if(o&&d&&(p=o!==d),!p&&e.head&&e.head.children.length>0){let g=ns(document),b=ns(e);g!==b&&(p=!0)}if(p&&typeof location<"u"){F.clear(),I.clear();try{let g="webjs:importmap-reload";if(sessionStorage&&sessionStorage.getItem(g))sessionStorage.removeItem(g);else{sessionStorage&&sessionStorage.setItem(g,"1"),location.href=r;return}}catch{location.href=r;return}}else if(!p){let g=u?u.getAttribute("data-webjs-src"):null;s&&g&&s!==g&&(F.clear(),I.clear(),u&&u.setAttribute("data-webjs-src",s));try{typeof sessionStorage<"u"&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}}}if(t){let u=document.querySelector(`webjs-frame#${CSS.escape(t)}`),d=e.querySelector(`webjs-frame#${CSS.escape(t)}`);if(u&&d){yr(e.head),tn(()=>{vc(u,d),At(u),Ne(u),nn()},()=>Ne(u)),rs(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=Qe(document.body),c=Qe(e.body),a=i&&c?ms(i,c):null;if(a){let{mode:u,live:d,incoming:p}=a;yr(e.head),tn(()=>{u==="replace"?Ac(d,p):Ec(d,p,e),kc(d.start,p.start),nn()},()=>Sc(d)),rs(e.body);return}if(r&&!n&&typeof location<"u"){pr(i?c?"no-shared-boundary":"incoming-boundaries-malformed":"live-boundaries-malformed",r),location.href=r;return}if(r&&n)return pr("revalidation-discarded",r),"discard";Ls(e.head),vs(document.body,e.body);let l=[...e.body.childNodes];tn(()=>{document.body.replaceChildren(...l),At(document.body),Ne(document.body),nn()},()=>Ne(document.body))}function nn(){let e=document.activeElement;!e||e===document.body||e===document.documentElement||typeof e.blur=="function"&&e.blur()}function Ac(e,t){let n=e.start.parentNode;if(!n)return;let r=[];for(let s=e.start.nextSibling;s&&s!==e.end;s=s.nextSibling)r.push(s);let o=[];for(let s=t.start.nextSibling;s&&s!==t.end;s=s.nextSibling)o.push(document.importNode(s,!0));hn(r,o);for(let s of r)s.parentNode===n&&n.removeChild(s);for(let s of o)n.insertBefore(s,e.end);for(let s=e.start.nextSibling;s&&s!==e.end;s=s.nextSibling)s.nodeType===1&&(At(s),Ne(s))}function Ec(e,t,n){if(!e||!t)return;let r=e.start.parentNode;if(!r)return;let o=[];for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)o.push(i);let s=[];for(let i=t.start.nextSibling;i&&i!==t.end;i=i.nextSibling)s.push(document.importNode(i,!0));hn(o,s),xc(r,e.start,e.end,o,s);for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)i.nodeType===1&&(At(i),Ne(i))}function xc(e,t,n,r,o){let s=new Map;for(let a of r){if(a.nodeType!==1)continue;let l=Ze(a);l&&s.set(l,a)}let i=n,c=[];for(let a of o){if(a.nodeType===1){let l=Ze(a);if(l&&s.has(l)){let f=s.get(l);un(f,a),c.push(f),s.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 un(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),!gr.has(r.name)&&r.name!=="data-wj-serialized"&&e.getAttribute(r.name)!==r.value&&e.setAttribute(r.name,r.value);for(let r of[...e.attributes])gr.has(r.name)||n.has(r.name)||e.removeAttribute(r.name);if(Cc(e)){Nc(e,t);return}mn(e,t)}function Cc(e){let t=e;return t[Symbol.for("webjs.instance")]!=null||t[j]!=null}function Tc(e,t){for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!1;return!0}function fn(e){let t=new Map,n=`slot[${L}][${U}="${K}"]`;for(let r of e.querySelectorAll(n)){let o=r;if(!Tc(o,e)||lo(e,o))continue;let s=!1;for(let c=o.parentElement;c&&c!==e;c=c.parentElement)if(c.tagName==="SLOT"&&c.hasAttribute(L)&&c.getAttribute(U)===K){s=!0;break}if(s)continue;let i=V(o.getAttribute("name"));t.has(i)||t.set(i,o)}return t}function kc(e,t){let n=e.parentNode;if(!n||n.nodeType!==1)return;let r=n;if(r.tagName!=="SLOT"||!r.hasAttribute(L))return;let o=null;for(let u=r.parentElement;u;u=u.parentElement){if(u[j]){o=u;break}if(u.tagName.includes("-"))return}if(!o)return;let s=V(r.getAttribute("name"));Ee(o,s,[...r.childNodes]);let i=t.parentNode;if(!i||i.nodeType!==1)return;let c=i;if(c.tagName!=="SLOT")return;let a=null;for(let u=c.parentElement;u;u=u.parentElement)if(u.tagName.includes("-")){a=u;break}if(!a||a.tagName!==o.tagName)return;let l=fn(o),f=fn(a);for(let u of new Set([...l.keys(),...f.keys()])){if(u===s)continue;let d=f.get(u);d?Ee(o,u,[...d.childNodes].map(p=>document.importNode(p,!0))):l.get(u)&&Ee(o,u,null)}}function Nc(e,t){if(!e[j])return;let n=fn(e),r=fn(t);if(n.size===0&&r.size===0)return;let o=new Set([...n.keys(),...r.keys()]);for(let s of o){let i=n.get(s),c=r.get(s);i&&c?(mn(i,c),Ee(e,s,[...i.childNodes])):c?Ee(e,s,[...c.childNodes].map(a=>document.importNode(a,!0))):Ee(e,s,null)}}function mn(e,t){let n=[...e.childNodes],r=[...t.childNodes].map(c=>document.importNode(c,!0));hn(n,r);let o=new Map;for(let c of n){if(c.nodeType!==1)continue;let a=Ze(c);a&&o.set(a,c)}let s=[];for(let c=0;c<r.length;c++){let a=r[c];if(a.nodeType===1){let l=Ze(a);if(l&&o.has(l)){let u=o.get(l);un(u,a),s.push(u),o.delete(l);continue}let f=n[c];if(f&&f.nodeType===1&&!Ze(f)&&f.tagName===a.tagName){un(f,a),s.push(f);continue}}else if(a.nodeType===3){let l=n[c];if(l&&l.nodeType===3){l.nodeValue!==a.nodeValue&&(l.nodeValue=a.nodeValue),s.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),s.push(l);continue}}s.push(a)}let i=new Set(s);for(let c of n)!i.has(c)&&c.parentNode===e&&e.removeChild(c);for(let c=0;c<s.length;c++){let a=s[c];(a.parentNode!==e||e.childNodes[c]!==a)&&e.insertBefore(a,e.childNodes[c]||null)}}function Ze(e){let t=e.getAttribute("data-key");return t?`${e.tagName}:k:${t}`:e.id?`${e.tagName}:i:${e.id}`:null}function js(){let e=Qe(document.body);if(!e||e.size===0)return null;let t=[...e.keys()].sort((c,a)=>a.length-c.length),n=null,r=null;for(let c of t){let a=document.getElementById(`wj-loading:${c}`);if(a instanceof HTMLTemplateElement){n=c,r=a;break}}if(n===null||r===null)return null;let o=e.get(n),s=[];for(let c=o.start.nextSibling;c&&c!==o.end;c=c.nextSibling)s.push(c);let i=document.createRange();return i.setStartAfter(o.start),i.setEndBefore(o.end),i.deleteContents(),o.start.parentNode.insertBefore(r.content.cloneNode(!0),o.end),{slot:o,oldChildren:s,token:$}}function yt(e){if(!e||e.token!==$)return;let{slot:t,oldChildren:n}=e;if(t.start.parentNode!==t.end.parentNode)return;let r=document.createRange();r.setStartAfter(t.start),r.setEndBefore(t.end),r.deleteContents();for(let o of n)t.start.parentNode.insertBefore(o,t.end)}function vc(e,t){mn(e,t)}function Rs(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function jr(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=Rs();return n&&t.setAttribute("nonce",n),t.textContent=e.textContent,t}function Os(e){if(!e.hasAttribute("nonce"))return e.cloneNode(!0);let t=e.cloneNode(!0),n=Rs();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function ke(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function yr(e){let t=e.querySelector("title");t&&(document.title=t.textContent||"");let n=new Set;for(let r of document.head.children)n.add(ke(r));for(let r of e.children)r.tagName==="SCRIPT"&&r.getAttribute("type")==="importmap"||r.tagName!=="BASE"&&r.tagName!=="TITLE"&&(n.has(ke(r))||(r.tagName==="SCRIPT"?document.head.appendChild(jr(r)):document.head.appendChild(Os(r))))}function jc(e){return e.tagName==="STYLE"?!0:e.tagName==="LINK"&&(e.getAttribute("rel")||"").toLowerCase().split(/\s+/).includes("stylesheet")}function Ls(e){let t=document.head,n=e.querySelector("title");n&&(document.title=n.textContent||"");let r=new Set;for(let s of t.children)s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&r.add(ke(s));let o=new Set;for(let s of e.children)s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&o.add(ke(s));for(let s of[...t.children])s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&s.tagName!=="TITLE"&&(jc(s)||o.has(ke(s))||s.remove());for(let s of e.children)s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&s.tagName!=="TITLE"&&(r.has(ke(s))||(s.tagName==="SCRIPT"?t.appendChild(jr(s)):t.appendChild(Os(s))))}function Ne(e){typeof customElements>"u"||Rr(e)}function Rr(e){let t=e instanceof Element?[e,...e.querySelectorAll("*")]:[...e.querySelectorAll("*")];for(let n of t)n.tagName&&n.tagName.includes("-")&&(customElements.upgrade(n),n.shadowRoot&&Rr(n.shadowRoot))}function rs(e){for(let t of e.querySelectorAll("template[data-webjs-resolve]"))document.body.appendChild(t.cloneNode(!0))}async function Is(e){if(!e.body||typeof e.body.getReader!="function")return{shell:await e.text(),streaming:!1};let t=e.body.getReader(),n=new TextDecoder,r="",o="<template data-webjs-resolve",s="<!--wj-stream-shell-->",i=/<\/html\s*>/i;for(;;){let{value:c,done:a}=await t.read();c&&(r+=n.decode(c,{stream:!0})),a&&(r+=n.decode());let l=r.indexOf(s);if(l!==-1)return{shell:r.slice(0,l),streaming:!0,reader:a?null:t,dec:n,rest:r.slice(l+s.length)};let f=r.indexOf(o);if(f!==-1)return{shell:r.slice(0,f),streaming:!0,reader:a?null:t,dec:n,rest:r.slice(f)};if(a)return{shell:r,streaming:!1};let u=i.exec(r);if(u){let d=u.index+u[0].length;return{shell:r.slice(0,d),streaming:!0,reader:t,dec:n,rest:r.slice(d)}}}}function Ms(e){let t=/<template\s+data-webjs-resolve="([^"]+)"\s*>/i.exec(e);if(!t)return null;let n=t[1],r=t.index+t[0].length,o=/<(\/?)template\b[^>]*>/gi;o.lastIndex=r;let s=1,i;for(;i=o.exec(e);)if(i[1]==="/"){if(s--,s===0)return{id:n,content:e.slice(r,i.index),rest:e.slice(i.index+i[0].length)}}else s++;return null}function Ps(e,t){let n=document.getElementById(e);if(!n)return;let r=document.createElement("template");r.innerHTML=t;let o=[...r.content.childNodes];n.replaceWith(r.content);for(let s of o)s.nodeType===1&&Rr(s)}async function $s(e,t,n,r){let o=n,s=()=>{let i;for(;i=Ms(o);){if(!r())return!1;Ps(i.id,i.content),o=i.rest}return!0};if(!e){s();return}try{for(;;){if(!s()){try{await e.cancel()}catch{}return}let{value:i,done:c}=await e.read();if(i&&(o+=t.decode(i,{stream:!0})),c){o+=t.decode(),s();return}}}catch{}}function At(e){for(let t of e.querySelectorAll("script"))t.replaceWith(jr(t))}function Rc(e){return I.get(ve(e))||null}function Oc(){return Te.size}function Lc(){I.clear(),Te.clear(),Ye.length=0,wt.clear(),pn(),Nr()}function Ic(){return $}function Mc(){return++$}function Pc(){return X}function $c(e){X=e}function Dc(){dr.clear(),hr=!1}function Fc(e,t){return hs(e,t)}function Bc(e){return dn.test(e)}var es,Ke,de,W,$,ur,X,en,dn,ps,dr,hr,lc,F,dc,gs,ys,pc,hc,mc,I,Te,Ye,wt,Je,_t,fe,Ge,St,cn,ln,gr,ir=oe(()=>{sr();Zt();Zt();Jo();lr();$t();es="text/vnd.webjs-stream.html";Ke=null;de=!1,W=null,$=0,ur=null;X=null,en=null;dn=/\.(?: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;ps="_top";dr=new Set;hr=!1;lc=16,F=new Map;dc=8,gs=3e4,ys=3,pc=24,hc=100,mc=250,I=new Map,Te=new Set,Ye=[],wt=new Set,Je=null,_t=null,fe=null,Ge=new WeakMap,St=new Set;cn=new WeakMap;ln=new WeakMap;gr=new Set(["value","checked","selected","indeterminate","disabled","open","popover"]);(typeof window>"u"||window.__WEBJS_CLIENT_ROUTER__!==!1)&&_r()});function wn(e,...t){return{_$webjs:"template",strings:e,values:t}}function P(e){return!!e&&typeof e=="object"&&e._$webjs==="template"}var O="wjm-";function qs(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 je(e){return!!e&&typeof e=="object"&&e._$webjsCss===!0}function _n(e,t){if(!(!t||!t.length))if("adoptedStyleSheets"in e&&typeof CSSStyleSheet<"u"){let n=t.map(r=>{let o=new CSSStyleSheet;return o.replaceSync(r.text),o});e.adoptedStyleSheets=n}else{let n=e,r=document.createElement("style");r.textContent=t.map(o=>o.text).join(`
1
+ var Ws=Object.defineProperty;var se=(e,t)=>()=>(e&&(t=e(e=0)),t);var qr=(e,t)=>{for(var n in t)Ws(e,n,{get:t[n],enumerable:!0})};function eo(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}function wi(){if(Jr||(ce=eo(),!ce))return;it=HTMLSlotElement.prototype.assignedNodes,Mn=HTMLSlotElement.prototype.assignedElements,jt=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(n){return this.hasAttribute(L)&&!Pn(this)?qn(this,n):it?it.call(this,n):[]},HTMLSlotElement.prototype.assignedElements=function(n){return this.hasAttribute(L)&&!Pn(this)?qn(this,n).filter(r=>r.nodeType===1):Mn?Mn.call(this,n):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let n=jt&&jt.get?jt.get.call(this):null;return n||Xr(this)}});let e=Object.getOwnPropertyDescriptor(Text.prototype,"assignedSlot");Object.defineProperty(Text.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let n=e&&e.get?e.get.call(this):null;return n||Xr(this)}}),In=HTMLSlotElement.prototype.assign,HTMLSlotElement.prototype.assign=function(...n){if(this.hasAttribute(L)&&!Pn(this)){let r=_i(this);if(r){let o=ee(r);o.manualAssign||(o.manualAssign=new Map);let s=n.filter(Boolean);for(let[i,a]of o.manualAssign){if(i===this)continue;let c=a.filter(l=>{let f=l.deref();return f!==void 0&&s.indexOf(f)===-1});c.length!==a.length&&(c.length?o.manualAssign.set(i,c):o.manualAssign.delete(i))}if(s.length?o.manualAssign.set(this,s.map(i=>new WeakRef(i))):o.manualAssign.delete(this),o.applying&&o.pendingRecordNodes)for(let i of s)o.pendingRecordNodes.add(i);else o.pendingRecordNodes=new Set(s);qe(o),te(r)}return}return In?In.apply(this,n):void 0},Jr=!0}function Vn(e,t){let n=e.manualAssign;if(!n||!n.size)return null;for(let[r,o]of n){let s=!1,i=o.filter(a=>{let c=a.deref();return c===void 0?!1:(c===t&&(s=!0),!0)});if(i.length!==o.length&&(i.length?n.set(r,i):n.delete(r)),s){let a=e.host;return a&&(r===a||a.contains(r))?r:null}}return null}function _i(e){for(let t=e.parentElement;t;t=t.parentElement)if(t[j])return Q(t,e)?t:null;return null}function Pn(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 qn(e,t){if(e.getAttribute(q)!==K)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:Un(n,new Set,0)}function Un(e,t,n){if(n>=yi)return e.slice();let r=[];for(let o of e)if(o.nodeType===1&&o.tagName==="SLOT"){let s=o;if(t.has(s))continue;if(t.add(s),s.hasAttribute(L)){let i=qn(s,{flatten:!1});if(i.length>0)for(let a of Un(i,t,n+1))r.push(a);else for(let a of Un(Array.from(s.childNodes),t,n+1))r.push(a)}else if(it){let i=it.call(s,{flatten:!0});for(let a of i)r.push(a)}else r.push(o)}else r.push(o);return r}function Xr(e){let t=e.parentElement;return t&&t.tagName==="SLOT"&&t.hasAttribute(L)&&t.getAttribute(q)===K?t:null}function ee(e){let t=e,n=t[j];return n||(n={host:e,authored:[],assignedByName:new Map,lastSnapshot:new WeakMap},t[j]=n),n}function Kn(e){return!!e[j]}function to(e){let t=ee(e);for(;e.firstChild;){let n=e.firstChild;t.authored.push(n),T.add(n),e.removeChild(n)}qe(t)}function qe(e){let t=e.assignedByName;t.clear();for(let n of e.authored)Si(t,Se(e,n),n)}function Se(e,t){let n=Vn(e,t);if(n)return V(n.getAttribute("name"));if(e.adoptedKey){let r=e.adoptedKey.get(t);if(r!==void 0)return r}return ro(t)}function no(e){let t=ee(e);t.adopted=!0;let n=new Set,r=e.querySelectorAll(`slot[${L}]`);for(let o of r){let s=o;if(!Q(e,s)||s.getAttribute(q)!==K||Pt(t,e,s))continue;let i=V(s.getAttribute("name"));if(!n.has(i)){n.add(i);let a=Array.from(s.childNodes);for(let c of a)t.authored.push(c),ro(c)!==i&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(c,i));t.lastSnapshot.set(s,a.slice())}}for(let o of e.querySelectorAll("wj-slot-park"))if(Q(e,o)){for(let s of Array.from(o.childNodes))T.add(s),t.authored.push(s);o.remove()}qe(t)}function V(e){return e==null||e===""||e==="default"?null:e}function ro(e){return e.nodeType!==1?null:V(e.getAttribute("slot"))}function Si(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}function xe(e,t,n){let r=ee(e),o=V(t),s=Array.isArray(n)?n.filter(Boolean):n?[n]:[],i=r.authored.findIndex(c=>Se(r,c)===o),a=r.authored.filter(c=>Se(r,c)===o);r.authored=r.authored.filter(c=>Se(r,c)!==o),(i===-1||i>r.authored.length)&&(i=r.authored.length);for(let c of s)c.nodeType===1&&!Vn(r,c)&&(o==null?c.removeAttribute("slot"):c.setAttribute("slot",o)),T.add(c);if(r.authored.splice(i,0,...s),r.applying&&r.pendingRecordNodes){for(let c of a)r.pendingRecordNodes.add(c);for(let c of s)r.pendingRecordNodes.add(c)}else r.pendingRecordNodes=new Set([...a,...s]);if(r.adoptedKey){for(let c of a)r.adoptedKey.delete(c);for(let c of s)r.adoptedKey.delete(c)}qe(r),te(e)}function Ai(){ae||!ce||(ae=Node.prototype.appendChild,oo=Node.prototype.insertBefore,Be=Node.prototype.removeChild,Hn=Node.prototype.replaceChild,so=Element.prototype.append,io=Element.prototype.prepend,ao=Element.prototype.replaceChildren,Rt=Object.getOwnPropertyDescriptor(Element.prototype,"innerHTML"),Wn=Object.getOwnPropertyDescriptor(Node.prototype,"textContent"))}function Mt(e,t){let n=e[D];e[D]=!0;try{return t()}finally{e[D]=n,n||Gn(e)}}function co(e){if(!ce)return;let t=e,n=ee(e);n.backstop||(n.backstop=new MutationObserver(r=>It(e,n,r)),n.backstop.observe(e,{childList:!0,subtree:!1}),n.flipSensor=new MutationObserver(r=>lo(e,r)),n.flipSensor.observe(e,{attributes:!0,attributeFilter:["slot","name"],subtree:!0}))}function It(e,t,n){let r=e,o=r[Ee],s=r[Symbol.for("webjs.instance")],i=!1,a=new Set;for(let c of n){for(let l of c.addedNodes)if(a.add(l),l!==o&&!(s&&po(s,l))){if(t.authored.indexOf(l)!==-1){i=!0;continue}T.add(l),t.authored.push(l),i=!0}for(let l of c.removedNodes){let f=t.authored.indexOf(l);if(f===-1||e.contains(l))continue;T.has(l)&&l.parentNode==null&&!a.has(l)||(t.authored.splice(f,1),i=!0)}}i&&te(e)}function Gn(e){let t=e,n=t[j];if(!(n&&n.backstop))return;let r=n.backstop.takeRecords();(!(Symbol.for("webjs.instance")in t)||t[Symbol.for("webjs.instance")])&&It(e,n,r)}function lo(e,t){let n=e[j];if(!n)return;let r=!1;for(let o of t){if(o.type!=="attributes")continue;let s=o.target;o.attributeName==="name"?s.tagName==="SLOT"&&s.hasAttribute(L)&&Q(e,s)&&(r=!0):o.attributeName==="slot"&&(n.adoptedKey&&n.adoptedKey.delete(s),n.authored.indexOf(s)!==-1&&(r=!0))}r&&te(e)}function uo(e){let t=e[j];t&&(t.backstop&&(It(e,t,t.backstop.takeRecords()),t.backstop.disconnect(),t.backstop=void 0),t.flipSensor&&(lo(e,t.flipSensor.takeRecords()),t.flipSensor.disconnect(),t.flipSensor=void 0))}function fo(e){if(!ce)return;let t=e,n=t[j];if(!n)return;let r=t[Symbol.for("webjs.instance")],o=Symbol.for("webjs.instance")in t,s=!o&&n.adopted===!0,i=!1;for(let a of Array.from(e.childNodes))if(a!==t[Ee]){if(n.authored.indexOf(a)!==-1){i=!0;continue}o&&(!r||po(r,a))||!o&&s||(T.add(a),n.authored.push(a),i=!0)}i&&te(e)}function po(e,t){if(!e||!e.startNode||!e.endNode)return!1;if(t===e.startNode||t===e.endNode)return!0;for(let n=e.startNode.nextSibling;n&&n!==e.endNode;n=n.nextSibling)if(n===t)return!0;return!1}function Ei(e){let t=e,n=t[Ee];return(!n||!n.isConnected)&&(n||(n=e.ownerDocument.createElement("wj-slot-park"),n.setAttribute("hidden",""),n.style.display="none",t[Ee]=n),Mt(e,()=>ae.call(e,n))),n}function Ae(e){return e instanceof Node||!!(e&&typeof e=="object"&&e.ownerDocument&&e.ownerDocument.defaultView&&e instanceof e.ownerDocument.defaultView.Node)}function $n(e,t,n){if(n&&!Ae(t))return[e.ownerDocument.createTextNode(`${t}`)];if(!Ae(t))throw new TypeError("Failed to execute insertion on the host: parameter is not of type Node.");if(t&&t.nodeType===11){let r=Array.from(t.childNodes);Ot(e,r);for(let o of r)Be.call(t,o);return r}return Ot(e,[t]),[t]}function Ot(e,t){Fe(e,t);for(let n of t){if(!Ae(n))throw new TypeError("Failed to execute insertion on the host: parameter is not of type Node.");let r=n.nodeType;if(r!==1&&r!==3&&r!==4&&r!==7&&r!==8&&r!==11)throw new DOMException("Failed to execute insertion on the host: the node type may not be inserted here.","HierarchyRequestError")}}function Fe(e,t){for(let n of t)if(n===e||n.nodeType===1&&n.contains(e))throw new DOMException("Failed to execute insertion on the host: the new child contains the parent.","HierarchyRequestError")}function Dn(e,t,n){let r=e.authored;for(let s of t){let i=r.indexOf(s);i!==-1&&r.splice(i,1)}let o=n==null?r.length:r.indexOf(n);o===-1&&(o=r.length),r.splice(o,0,...t)}function ho(e,t){let n=e[j];return n?Pt(n,e,t):!1}function Pt(e,t,n){for(let r=n;r&&r!==t;r=r.parentNode)if(e.authored.indexOf(r)!==-1)return!0;return!1}function Fn(e,t){if(T.has(t))return!0;let n=t.parentNode;if(n==null)return!1;if(n===e||n===e[Ee])return!0;let r=e[j];return n.nodeType===1&&n.tagName==="SLOT"&&n.hasAttribute(L)&&(r&&r.lastSnapshot.has(n)||e.contains(n)&&Q(e,n))}function Bn(e,t){let n=[];for(let s of t)Ae(s)?s.nodeType===11?n.push({frag:s}):n.push({node:s}):n.push({text:`${s}`});for(let s of n)s.frag?Fe(e,Array.from(s.frag.childNodes)):s.node&&Ot(e,[s.node]);let r=e.ownerDocument.createDocumentFragment();for(let s of n)if(s.text!==void 0)ae.call(r,e.ownerDocument.createTextNode(s.text));else if(s.frag){let i=Array.from(s.frag.childNodes);Ot(e,i);for(let a of i)ae.call(r,a)}else s.node&&(Fe(e,[s.node]),ae.call(r,s.node));let o=Array.from(r.childNodes);Fe(e,o);for(let s of o)Be.call(r,s);return o}function Z(e,t,n){if(t.applying&&t.pendingRecordNodes)for(let r of n||[])t.pendingRecordNodes.add(r);else t.pendingRecordNodes=new Set(n||[]);if(t.adoptedKey&&n)for(let r of n)t.adoptedKey.delete(r);qe(t),te(e)}function mo(e){if(!ce)return;let t=e;if(t[Zr])return;Ai(),t[Zr]=!0;let n=ee(e);t.appendChild=function(r){if(t[D])return ae.call(this,r);let o=$n(e,r,!1);for(let s of o)T.add(s);return Dn(n,o,null),Z(e,n,o),r},t.insertBefore=function(r,o){if(t[D])return oo.call(this,r,o);if(!Ae(r))throw new TypeError("Failed to execute insertBefore on the host: parameter 1 is not of type Node.");if(o!=null&&!Ae(o))throw new TypeError("Failed to execute insertBefore on the host: parameter 2 is not of type Node.");if(Fe(e,r.nodeType===11?Array.from(r.childNodes):[r]),o!=null&&(n.authored.indexOf(o)===-1||!Fn(e,o)))throw new DOMException("insertBefore: reference node is not an assigned child of this host","NotFoundError");if(r===o)return r;let s=$n(e,r,!1);for(let i of s)T.add(i);return Dn(n,s,o||null),Z(e,n,s),r},t.removeChild=function(r){if(t[D])return Be.call(this,r);let o=n.authored.indexOf(r);if(o===-1)return Be.call(this,r);if(!Fn(e,r))throw new DOMException("removeChild: the node is not an assigned child of this host","NotFoundError");return n.authored.splice(o,1),Z(e,n,[r]),r},t.replaceChild=function(r,o){if(t[D])return Hn.call(this,r,o);if(n.authored.indexOf(o)===-1)return Hn.call(this,r,o);if(!Ae(r))throw new TypeError("Failed to execute replaceChild on the host: parameter 1 is not of type Node.");if(Fe(e,r.nodeType===11?Array.from(r.childNodes):[r]),!Fn(e,o))throw new DOMException("replaceChild: the node to be replaced is not an assigned child of this host","NotFoundError");if(r===o)return o;let i=$n(e,r,!1);for(let c of i)T.add(c);for(let c of i){if(c===o)continue;let l=n.authored.indexOf(c);l!==-1&&n.authored.splice(l,1)}let a=n.authored.indexOf(o);return n.authored.splice(a,1,...i),Z(e,n,[...i,o]),o},t.append=function(...r){if(t[D])return so.apply(this,r);let o=Bn(e,r);for(let s of o)T.add(s);Dn(n,o,null),Z(e,n,o)},t.prepend=function(...r){if(t[D])return io.apply(this,r);let o=Bn(e,r);for(let s of o)T.add(s);for(let s of o){let i=n.authored.indexOf(s);i!==-1&&n.authored.splice(i,1)}n.authored.unshift(...o),Z(e,n,o)},t.replaceChildren=function(...r){if(t[D])return ao.apply(this,r);let o=Bn(e,r);for(let i of o)T.add(i);let s=n.authored;n.authored=o.slice(),Z(e,n,[...s,...o])},Object.defineProperty(t,"innerHTML",{configurable:!0,get(){return Rt.get.call(this)},set(r){if(t[D]){Rt.set.call(this,r);return}let o=e.ownerDocument.createElement("div");Rt.set.call(o,r===null?"":`${r}`);let s=Array.from(o.childNodes);for(let a of s)T.add(a);let i=n.authored;n.authored=s,Z(e,n,[...i,...s])}}),Object.defineProperty(t,"textContent",{configurable:!0,get(){return Wn.get.call(this)},set(r){if(t[D]){Wn.set.call(this,r);return}let o=r==null||r===""?[]:[e.ownerDocument.createTextNode(`${r}`)];for(let i of o)T.add(i);let s=n.authored;n.authored=o,Z(e,n,[...s,...o])}})}function te(e){if(!ce)return;let t=e[j];if(t){if(t.applying){t.reapply=!0;return}t.applying=!0;try{do{t.reapply=!1;let n=t.pendingRecordNodes||xi;t.pendingRecordNodes=void 0,Ci(e,t,n),ki(e,t),qe(t);let r=[],o=new Set;for(let f of e.querySelectorAll(`slot[${L}]`))if(Q(e,f)&&!Pt(t,e,f)){if(!f.hasAttribute(q)&&!(at in f)){o.add(V(f.getAttribute("name")));continue}r.push(f)}let s=new Map;for(let f of r){let u=V(f.getAttribute("name")),d=s.get(u);d||(d=[],s.set(u,d)),d.push(f)}let i=[];for(let[f,u]of s){let d=t.assignedByName.get(f)||[];for(let p=0;p<u.length;p++){let g=u[p],b=d.filter(h=>{let y=Vn(t,h);return y?y===g:p===0}),m=b.filter(h=>h===e||h.nodeType===1&&h.contains(e));if(m.length){for(let h of m)T.delete(h);b=b.filter(h=>m.indexOf(h)===-1)}b.length>0?vi(t,g,b)&&i.push(g):Ni(t,g)&&i.push(g)}}for(let f of i)Ri(t,f);let a=new Set(s.keys());for(let f of o)a.add(f);let c=new Set;for(let f of t.authored)a.has(Se(t,f))||c.add(f);let l=e[Ee];if(l)for(let f of Array.from(l.childNodes))c.has(f)||Be.call(l,f);if(c.size){let f=Ei(e);for(let u of c)u.parentNode!==f&&(T.delete(u),Mt(e,()=>ae.call(f,u)))}if(t.backstop){let f=t.backstop.takeRecords();f.length&&It(e,t,f)}}while(t.reapply)}finally{t.applying=!1}}}function Ci(e,t,n){for(let r of e.querySelectorAll(`slot[${L}][${q}="${K}"]`)){if(!Q(e,r)||Pt(t,e,r))continue;let o=r,s=t.lastSnapshot.get(o);if(!s)continue;let i=Array.from(o.childNodes);if(zn(i,s))continue;let a=t.authored,c=V(o.getAttribute("name")),l=i.filter(g=>!n.has(g));for(let g of l)a.indexOf(g)===-1&&Se(t,g)!==c&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(g,c));for(let g of a){if(l.indexOf(g)!==-1||Se(t,g)!==c)continue;let b=a.indexOf(g),m=0;for(let h=0;h<l.length;h++){let y=a.indexOf(l[h]);y!==-1&&y<b&&(m=h+1)}l.splice(m,0,g)}let f=new Set(l);for(let g of s)f.add(g);let u=-1,d=0;for(let g of a){if(f.has(g)){u===-1&&(u=d);continue}d+=1}let p=a.filter(g=>!f.has(g));(u===-1||u>p.length)&&(u=p.length),p.splice(u,0,...l),t.authored=p}}function ki(e,t){let n=e[Ee];t.authored=t.authored.filter(r=>{if(T.has(r))return!0;let o=r.parentNode;return o==null?!1:!!(o===e||o===n||o.nodeType===1&&o.tagName==="SLOT"&&o.hasAttribute(L)&&(t.lastSnapshot.has(o)||e.contains(o)&&Q(e,o)))})}function bo(e){if(!ce)return!1;for(let t of e.querySelectorAll(`slot[${L}][${q}]`))if(Q(e,t))return!0;return!1}function Q(e,t){let n=t[Lt];if(n)return n===e;let r=typeof t.getAttribute=="function"?t.getAttribute(gi):null;if(r){let o=Ti(t,r);if(o)return o===e}for(let o=t.parentElement;o&&o!==e;o=o.parentElement)if(o.tagName.includes("-"))return!1;return!0}function Ti(e,t){let n=t.toLowerCase();for(let r=e.parentElement;r;r=r.parentElement)if(r.tagName.toLowerCase()===n)return r;return null}function vi(e,t,n){for(let l of n)T.delete(l);let r=t.getAttribute(q)!==K,o=e.lastSnapshot.get(t)||[],s=r||!zn(o,n);if(!r&&zn(Array.from(t.childNodes),n))return e.lastSnapshot.set(t,n.slice()),s;let i=t[at];if(r&&i)for(;t.firstChild;)i.appendChild(t.firstChild);let a=new Set(n);for(let l of Array.from(t.childNodes))a.has(l)||t.removeChild(l);let c=t.firstChild;for(let l of n){if(l===c){c=c.nextSibling;continue}t.insertBefore(l,c)}return t.setAttribute(q,K),e.lastSnapshot.set(t,n.slice()),s}function Ni(e,t){let n=t.getAttribute(q)===K;if(t.setAttribute(q,bi),!n)return Qr(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return Qr(t),!0}function Qr(e){let t=e[at];!t||t.childNodes.length===0||e.appendChild(t)}function go(e,t){if(!Kn(e))return;let n=ee(e),r=V(t.getAttribute("name")),o=n.assignedByName.get(r);if(o)for(let s of o)s.parentNode===t&&(T.add(s),t.removeChild(s));n.lastSnapshot.delete(t)}function ji(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function Ri(e,t){e.pendingSlotChanges||(e.pendingSlotChanges=new Set),e.pendingSlotChanges.add(t),!e.slotChangeScheduled&&(e.slotChangeScheduled=!0,queueMicrotask(()=>{e.slotChangeScheduled=!1;let n=e.pendingSlotChanges||new Set;e.pendingSlotChanges=new Set;for(let r of n)ji(r)}))}function zn(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 ce,j,L,q,K,bi,at,Lt,gi,yi,it,Mn,jt,In,Jr,D,Zr,Ee,T,ae,oo,Be,Hn,so,io,ao,Rt,Wn,xi,$t=se(()=>{ce=eo(),j=Symbol("webjs.slot.state"),L="data-webjs-light",q="data-projection",K="actual",bi="fallback",at=Symbol("webjs.slot.fallbackFrag"),Lt=Symbol("webjs.slot.templateOwner"),gi="data-wj-slot-owner",yi=64,it=null,Mn=null,jt=null,In=null,Jr=!1;wi();D=Symbol("webjs.slot.rendering"),Zr=Symbol("webjs.slot.intercepted"),Ee=Symbol("webjs.slot.park"),T=new WeakSet,ae=null,oo=null,Be=null,Hn=null,so=null,io=null,ao=null,Rt=null,Wn=null;xi=new Set});function Oo(e,t,n){ra.has(t)?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}async function dt(e){return JSON.stringify(await Lo(e))}function ne(e){return Mo(JSON.parse(e))}async function Lo(e){let t=oa();return await sa(e,t),Ce(e,t)}function Mo(e){return ue(e,la())}function oa(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map,fdEntries:new Map}}async function sa(e,t){let n=[e];for(;n.length;){let r=n.pop();if(!fa(r))continue;let o=t.refCount.get(r)||0;if(t.refCount.set(r,o+1),!(o>0)){if(typeof Blob<"u"&&r instanceof Blob){let s=new Uint8Array(await r.arrayBuffer());t.blobBytes.set(r,s);continue}if(typeof FormData<"u"&&r instanceof FormData){let s=t.fdEntries.get(r)||[...r.entries()];t.fdEntries.set(r,s);for(let[,i]of s)typeof i!="string"&&n.push(i);continue}if(Array.isArray(r))for(let s=0;s<r.length;s++)n.push(r[s]);else if(r instanceof Map)for(let[s,i]of r)n.push(s),n.push(i);else if(r instanceof Set)for(let s of r)n.push(s);else if(da(r))for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&n.push(r[s])}}for(let[r,o]of t.refCount)o>1&&t.idOf.set(r,t.nextId++)}function Ce(e,t){if(e===null)return null;if(e===void 0)return{[v]:"undef"};let n=typeof e;if(n==="string"||n==="boolean")return e;if(n==="number")return Number.isNaN(e)?{[v]:"NaN"}:e===1/0?{[v]:"Inf"}:e===-1/0?{[v]:"-Inf"}:Object.is(e,-0)?{[v]:"-0"}:e;if(n==="bigint")return{[v]:"BigInt",v:e.toString()};if(n==="symbol"){let s=Symbol.keyFor(e);if(s===void 0)throw new TypeError("Cannot serialize a local Symbol; only Symbol.for() registered symbols are supported.");return{[v]:"Sym",v:s}}if(n==="function")throw new TypeError("Cannot serialize a function.");let r=t.idOf.get(e);if(r!==void 0&&t.emitted.has(r))return{[v]:"Ref",v:r};r!==void 0&&t.emitted.add(r);let o;if(e instanceof Date)o={[v]:"Date",v:Number.isNaN(e.getTime())?null:e.toISOString()};else if(e instanceof Error)o={[v]:"Error",v:{name:e.name,message:e.message,stack:e.stack||null}};else if(typeof Blob<"u"&&e instanceof Blob){let s=t.blobBytes.get(e);typeof File<"u"&&e instanceof File?o={[v]:"File",v:ft(s),n:e.name,t:e.type||"",m:e.lastModified}:o={[v]:"Blob",v:ft(s),t:e.type||""}}else if(typeof FormData<"u"&&e instanceof FormData){let s=t.fdEntries.get(e)||[...e.entries()],i=[];for(let[a,c]of s)i.push([a,Ce(c,t)]);o={[v]:"FD",v:i}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)o=ia(e);else if(e instanceof Map){let s=[];for(let[i,a]of e)s.push([Ce(i,t),Ce(a,t)]);o={[v]:"Map",v:s}}else if(e instanceof Set){let s=[];for(let i of e)s.push(Ce(i,t));o={[v]:"Set",v:s}}else if(Array.isArray(e))o=e.map(s=>Ce(s,t));else{o={};for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;let i=pa(s)?"_"+s:s;Oo(o,i,Ce(e[s],t))}}if(r!==void 0){if(Array.isArray(o))return{[v]:"Arr",_id:r,v:o};o._id=r}return o}function ia(e){if(e instanceof ArrayBuffer)return{[v]:"buf",v:ft(new Uint8Array(e))};if(e instanceof DataView)return{[v]:"dv",v:ft(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=aa[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[v]:n,v:ft(r)}}function la(){return{refs:new Map}}function ue(e,t){if(e===null||typeof e!="object")return e;if(Array.isArray(e)){let s=[];for(let i=0;i<e.length;i++)s.push(ue(e[i],t));return s}let n=e[v];if(typeof n=="string")return ua(e,n,t);let r={},o=e._id;typeof o=="number"&&t.refs.set(o,r);for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s)||s==="_id")continue;let i=ha(s)?s.slice(1):s;Oo(r,i,ue(e[s],t))}return r}function ua(e,t,n){let r=e._id,o=s=>(typeof r=="number"&&n.refs.set(r,s),s);switch(t){case"undef":return;case"NaN":return NaN;case"Inf":return 1/0;case"-Inf":return-1/0;case"-0":return-0;case"BigInt":return o(BigInt(e.v));case"Sym":return o(Symbol.for(e.v));case"Date":return o(e.v==null?new Date(NaN):new Date(e.v));case"Error":{let s=new Error(e.v.message);return s.name=e.v.name,e.v.stack&&(s.stack=e.v.stack),typeof r=="number"&&n.refs.set(r,s),s}case"Map":{let s=new Map;typeof r=="number"&&n.refs.set(r,s);for(let[i,a]of e.v)s.set(ue(i,n),ue(a,n));return s}case"Set":{let s=new Set;typeof r=="number"&&n.refs.set(r,s);for(let i of e.v)s.add(ue(i,n));return s}case"Arr":{let s=[];typeof r=="number"&&n.refs.set(r,s);for(let i of e.v)s.push(ue(i,n));return s}case"Ref":{let s=n.refs.get(e.v);if(s===void 0)throw new TypeError(`Dangling reference: id=${e.v}`);return s}case"Blob":{if(typeof Blob>"u")throw new TypeError("Blob is not available in this environment.");let s=ut(e.v);return o(new Blob([s],{type:e.t||""}))}case"File":{if(typeof File>"u")throw new TypeError("File is not available in this environment.");let s=ut(e.v);return o(new File([s],e.n,{type:e.t||"",lastModified:e.m}))}case"FD":{if(typeof FormData>"u")throw new TypeError("FormData is not available in this environment.");let s=new FormData;o(s);for(let[i,a]of e.v){let c=ue(a,n);s.append(i,c)}return s}default:{if(t==="buf"){let i=ut(e.v);return o(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength))}if(t==="dv"){let i=ut(e.v);return o(new DataView(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)))}let s=ca[t];if(s){let i=ut(e.v),a=i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength);return o(new s(a))}throw new TypeError(`Unknown serialization tag: ${t}`)}}}function fa(e){return e!==null&&typeof e=="object"}function da(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function pa(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function ha(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}function ft(e){if(Io)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 ut(e){if(Io){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 v,ra,aa,ca,Io,ze=se(()=>{v="_$wj",ra=new Set(["__proto__","constructor","prototype"]);aa={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},ca={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};Io=typeof Buffer<"u"&&typeof Buffer.from=="function"});var Jo={};qr(Jo,{observeLazy:()=>ec,observeViewportOnce:()=>rc});function Yo(e){let t=ir.get(e);return t||(t=import(e).finally(()=>ir.delete(e)),ir.set(e,t),t)}function ec(e){for(let[t,n]of Object.entries(e))ke.set(t.toLowerCase(),n);if(typeof IntersectionObserver>"u"){for(let t of ke.values())Yo(t);ke.clear();return}bt||(bt=new IntersectionObserver(tc,{rootMargin:"200px"})),Go(),typeof MutationObserver<"u"&&new MutationObserver(()=>Go()).observe(document.body,{childList:!0,subtree:!0})}function Go(){if(!(!bt||!ke.size))for(let e of ke.keys())for(let t of document.querySelectorAll(e))bt.observe(t)}function tc(e){for(let t of e){if(!t.isIntersecting)continue;let n=t.target.tagName.toLowerCase(),r=ke.get(n);r&&(Yo(r),ke.delete(n),bt?.unobserve(t.target))}}function nc(e){for(let t of e){if(!t.isIntersecting)continue;let n=Xt.get(t.target);Xt.delete(t.target),mt?.unobserve(t.target),n&&n()}}function rc(e,t){return typeof IntersectionObserver>"u"?(t(),()=>{}):(mt||(mt=new IntersectionObserver(nc,{rootMargin:"200px"})),Xt.set(e,t),mt.observe(e),()=>{Xt.delete(e),mt?.unobserve(e)})}var ke,bt,ir,mt,Xt,Xo=se(()=>{ke=new Map,bt=null,ir=new Map;mt=null,Xt=new WeakMap});var ar,cr=se(()=>{ar=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(()=>(Xo(),Jo)).then(({observeViewportOnce:o})=>{this._webjsLoadedSrc!==n||!this.isConnected||(this._webjsLazyTeardown=o(this,()=>{this._webjsLazyTeardown=null,this._webjsLoad(n)}))})):(this._webjsLoadedSrc=n,this._webjsLoad(n))}_webjsLoad(t){Promise.resolve().then(()=>(lr(),Zo)).then(({loadFrame:n})=>{this._webjsLoadedSrc!==t||!this.isConnected||n(this,t)})}}:null;typeof customElements<"u"&&ar&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",ar)});function sc(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 fr(e,t){let n=t||(typeof document<"u"?document:null);if(!n)return;let r=null;if(typeof e=="string"){let s=n.createElement("template");s.innerHTML=e,r=s.content}else if(e&&e.nodeType)r=e;else return;let o=r.querySelectorAll?Array.from(r.querySelectorAll("webjs-stream")):[];if(o.length)for(let s of o)n.body.append(s);else n.body.append(r)}var oc,ur,Zt=se(()=>{oc=new Set(["append","prepend","before","after","replace","update"]);ur=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this._webjsApplied||(this._webjsApplied=!0,this._webjsApply())}_webjsApply(){let t=(this.getAttribute("action")||"").toLowerCase(),n=this.ownerDocument||document,r=[],o=this.getAttribute("target");if(o){let i=n.getElementById(o);i&&(r=[i])}else{let i=this.getAttribute("targets");if(i)try{r=Array.from(n.querySelectorAll(i))}catch{r=[]}}let s=oc.has(t)?this.querySelector("template"):null;try{for(let i of r){let a=s?s.content.cloneNode(!0):null;sc(t,i,a)}}finally{this.remove()}}}:null;typeof customElements<"u"&&ur&&!customElements.get("webjs-stream")&&customElements.define("webjs-stream",ur)});var Qo,es=se(()=>{Qo=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this.style.display||(this.style.display="contents")}}:null;typeof customElements<"u"&&Qo&&!customElements.get("webjs-suspense")&&customElements.define("webjs-suspense",Qo)});function Qt(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]'))ns(n.textContent,n);for(let n of t.querySelectorAll("[data-webjs-seed]"))ns(n.getAttribute("data-webjs-seed"),n,()=>n.removeAttribute("data-webjs-seed"))}}function ns(e,t,n){if(e)try{let r=ne(e);if(r&&typeof r=="object")for(let o in r)gt.has(o)||gt.set(o,r[o])}catch{}n?n():t.remove?.()}function ic(e,t,n){ts||(ts=!0,Qt());let r=`${e}/${t}/${n}`;if(gt.has(r)){let o=gt.get(r);return gt.delete(r),o}return rs}var gt,rs,ts,dr=se(()=>{ze();gt=new Map,rs=Symbol("webjs.seed.miss"),ts=!1});var Zo={};qr(Zo,{_FRAME_TOP:()=>gs,_LIVE_ATTRS:()=>_r,_activeFrameId:()=>bs,_addNewHeadElements:()=>Ar,_applyStreamedResolve:()=>Fs,_applySwap:()=>Or,_blurOutgoingFocus:()=>rn,_buildHaveHeader:()=>Nr,_buildSubmitFormData:()=>hs,_bumpNavToken:()=>Bc,_clearFormBusy:()=>Rs,_clearFrameBusy:()=>Ns,_collectBoundaries:()=>Qe,_currentPageUrl:()=>qc,_diffElementInPlace:()=>fn,_eligibleAnchorHref:()=>sn,_findAnchorInPath:()=>ms,_getSubmitAction:()=>ps,_getSubmitMethod:()=>ds,_isNonHtmlPath:()=>zc,_keyOf:()=>Ze,_markFormBusy:()=>js,_markFrameBusy:()=>vs,_mergeHead:()=>Ps,_navToken:()=>Fc,_onPopState:()=>Cr,_onSubmit:()=>kr,_parseHTML:()=>Er,_planBoundarySwap:()=>ws,_prefetch:()=>et,_prefetchCache:()=>M,_prefetchHasHoverPointer:()=>Es,_prefetchInflightSize:()=>$c,_prefetchMode:()=>an,_prefetchPeek:()=>Pc,_prefetchSaysSaveData:()=>jr,_prefetchSuppressed:()=>xs,_prefetchTake:()=>Cs,_reactivateScripts:()=>At,_readStreamedShell:()=>$s,_reconcileChildren:()=>yn,_regraftPermanentElements:()=>Ls,_regraftPermanentInSlice:()=>gn,_resetParseProbe:()=>cc,_resetPrefetch:()=>Dc,_resetWarnOnce:()=>Hc,_resolveTargetFrameId:()=>Tr,_restoreOptimistic:()=>yt,_runWithTransition:()=>tn,_setCurrentPageUrl:()=>Uc,_shouldFullLoadDuringParse:()=>Wc,_snapshotCache:()=>F,_streamBoundariesProgressively:()=>Bs,_takeResolveUnit:()=>Ds,_viewTransitionsEnabled:()=>Os,collectBoundaries:()=>Qe,disableClientRouter:()=>cs,enableClientRouter:()=>xr,loadFrame:()=>fc,navigate:()=>ls,planBoundarySwap:()=>ws,revalidate:()=>us});function Er(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"&&ac()?Document.parseHTMLUnsafe(e):lc(e)}function ac(){if(Ke!==null)return Ke;try{Ke=Document.parseHTMLUnsafe("<!doctype html><body><!--c--><i></i>")?.body?.firstChild?.nodeType===8}catch{Ke=!1}return Ke}function cc(){Ke=null}function lc(e){return typeof DOMParser>"u"?null:new DOMParser().parseFromString(e,"text/html")}function uc(){pr||typeof MutationObserver>"u"||typeof customElements>"u"||(pr=new MutationObserver(e=>{for(let t of e)for(let n of t.addedNodes){if(n.nodeType!==1)continue;let r=n;r.tagName?.includes("-")&&customElements.upgrade(r);for(let o of r.querySelectorAll("*"))o.tagName?.includes("-")&&customElements.upgrade(o)}}),pr.observe(document.body,{childList:!0,subtree:!0}))}function xr(){pe||typeof document>"u"||(pe=!0,document.addEventListener("click",fs,!1),document.addEventListener("submit",kr,!1),window.addEventListener("popstate",Cr),document.addEventListener("pointerover",Xe,!0),document.addEventListener("focusin",Xe,!0),document.addEventListener("touchstart",Xe,{capture:!0,passive:!0}),document.addEventListener("pointerout",ks,!0),document.addEventListener("webjs:navigate",wr),uc(),wr(),typeof history<"u"&&"scrollRestoration"in history&&(en=history.scrollRestoration,history.scrollRestoration="manual"),typeof location<"u"&&(X=location.href))}function cs(){pe&&(pe=!1,document.removeEventListener("click",fs,!1),document.removeEventListener("submit",kr,!1),window.removeEventListener("popstate",Cr),document.removeEventListener("pointerover",Xe,!0),document.removeEventListener("focusin",Xe,!0),document.removeEventListener("touchstart",Xe,{capture:!0}),document.removeEventListener("pointerout",ks,!0),document.removeEventListener("webjs:navigate",wr),bn(),Rr(),de&&(de.disconnect(),de=null),typeof history<"u"&&en!==null&&(history.scrollRestoration=en,en=null),X=null)}async function ls(e,t){let n=new URL(e,location.href);if(n.origin!==location.origin){location.href=e;return}await vr(n.href,t?.replace??!1,null)}async function fc(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};W&&W.abort(),W=new AbortController;let o=W.signal,s=++$;return cn(r.href,n,!1,null,"GET",null,o,s)}function us(e){if(!e){F.clear(),M.clear();return}let t=new URL(e,location.href),n=t.pathname+t.search;F.delete(n),M.delete(n)}function fs(e){if(!pe||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=ms(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||hn.test(r.pathname))return;e.preventDefault();let o=Tr(t);vr(n,!1,o)}function Cr(e){vr(location.href,!0,null)}function kr(e){if(!pe||e.defaultPrevented)return;let t=e.target;if(!t||t.nodeType!==1||t.tagName!=="FORM"||t.hasAttribute("data-no-router"))return;let n=e.submitter??null;if(n&&n.hasAttribute("data-no-router"))return;let r=n&&n.getAttribute("formtarget")||t.getAttribute("target")||"";if(r&&r!=="_self")return;let o=ds(t,n);if(o==="dialog")return;let s=ps(t,n),i;try{i=new URL(s,location.href)}catch{return}if(i.origin!==location.origin||hn.test(i.pathname))return;let a=hs(t,n);e.preventDefault();let c=Tr(n||t);mc(i.href,o,a,c,t)}function ds(e,t){return(t&&t.getAttribute("formmethod")||e.getAttribute("method")||"get").toLowerCase()}function ps(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function hs(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 ms(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function bs(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 Tr(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===gs)return null;let r=typeof document<"u"?document.getElementById(n):null;return r&&r.tagName&&r.tagName.toLowerCase()==="webjs-frame"?n:(mn(`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 bs(e)}function mn(e,t){mr.has(e)||(mr.add(e),typeof console<"u"&&console.warn&&console.warn(t))}function ys(e,t){return!e&&!t&&typeof document<"u"&&document.readyState==="loading"}function br(e,t){typeof process<"u"&&process.env||mn(`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 dc(e){typeof process<"u"&&process.env||mn(`stream-drop:${e}`,`[webjs] dropped a streamed Suspense resolve for "${e}": no #${e} boundary in the DOM. Benign if this navigation was superseded or degraded. A stuck skeleton here means the shell swap did not place the boundary.`)}function ss(){if(typeof process<"u"&&process.env||gr||typeof document>"u"||typeof getComputedStyle!="function")return;let e=document.documentElement;if(!e)return;gr=!0;let t;try{t=getComputedStyle(e).scrollBehavior}catch{return}t==="smooth"&&mn("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 on(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 Qe(e){let t=new Map,n=[],r=!1;function o(s){if(!r){if(s.nodeType===8){let i=s.data.trim();if(i.startsWith("wj:children:")){let a=i.slice(12),c=a.lastIndexOf(":");if(c<=0||c===a.length-1){r=!0;return}let l=a.slice(0,c),f=a.slice(c+1);if(t.has(l)||n.some(u=>u.segment===l)){r=!0;return}n.push({segment:l,routeKey:f,start:s});return}if(i.startsWith("/wj:children")){let a=i.slice(12).replace(/^:/,""),c=n.pop();if(!c||c.segment!==a){r=!0;return}if(c.start.parentNode!==s.parentNode){r=!0;return}{let l=c.start.parentNode.tagName;if(l==="TABLE"||l==="TBODY"||l==="THEAD"||l==="TFOOT"||l==="TR"){r=!0;return}}t.set(c.segment,{routeKey:c.routeKey,start:c.start,end:s});return}return}if(s.hasChildNodes&&s.hasChildNodes())for(let i=s.firstChild;i&&!r;i=i.nextSibling)o(i)}}return o(e),r||n.length>0?null:t}function ws(e,t){let n=[...e.keys()].filter(i=>t.has(i)).sort((i,a)=>i.length-a.length);if(n.length===0)return null;for(let i of n)if(e.get(i).routeKey!==t.get(i).routeKey){let a=null;for(let c of n){if(c===i)break;i.startsWith(c==="/"?c:c+"/")&&(a=c)}return a?{mode:"replace",segment:a,live:e.get(a),incoming:t.get(a)}:null}let r=n[n.length-1],o=i=>{let a=null;for(let c of i.keys())(a===null||c.length>a.length)&&(a=c);return a};return{mode:o(e)===r&&o(t)===r?"morph":"replace",segment:r,live:e.get(r),incoming:t.get(r)}}function _s(e){let t=Ne(e);document.dispatchEvent(new CustomEvent("webjs:before-cache",{detail:{url:e}})),F.has(t)&&F.delete(t);let n={html:document.documentElement.outerHTML,scrollX:typeof window<"u"&&window.scrollX||0,scrollY:typeof window<"u"&&window.scrollY||0};for(F.set(t,n);F.size>pc;){let r=F.keys().next().value;F.delete(r)}}function hc(e){let t=Ne(e),n=F.get(t);return n==null?null:(F.delete(t),F.set(t,n),typeof n=="string"?{html:n,scrollX:0,scrollY:0}:n)}function Ne(e){let t=new URL(e,location.href);return t.pathname+t.search}async function vr(e,t,n){if(ys(t,n)&&typeof location<"u"){br("readyState-loading",e),location.href=e;return}W&&W.abort(),W=new AbortController;let r=W.signal,o=++$;X&&_s(X);let s=setTimeout(()=>{on(!0),s=null},150),i=null;t||(i=Ms());try{if(t){let a=hc(e);if(a){let c=Er(a.html);if(c){Or(c,n,!0,null),typeof window<"u"&&window.scrollTo({left:a.scrollX,top:a.scrollY,behavior:"instant"}),cn(e,n,!1,i,"GET",null,r,o,!0).catch(()=>{});return}}typeof window<"u"&&window.scrollTo({left:0,top:0,behavior:"instant"})}await cn(e,n,!t,i,"GET",null,r,o)}finally{s&&clearTimeout(s),o===$&&(on(!1),typeof location<"u"&&(X=location.href))}}async function mc(e,t,n,r,o){W&&W.abort(),W=new AbortController;let s=W.signal,i=++$,a=t==="get"||t==="head",c=new URL(e,location.href);if(a){c.search="";for(let[p,g]of n)c.searchParams.append(p,typeof g=="string"?g:g.name)}X&&_s(X);let l=setTimeout(()=>{on(!0),l=null},150),f=Ms(),u=o?js(o,i,c.href):null,d=!1;try{let p=await cn(c.href,r,!0,f,a?"GET":t.toUpperCase(),a?null:n,s,i);d=!!(p&&p.ok),!a&&i===$&&(F.clear(),M.clear())}finally{u&&Rs(u,i,c.href,d),l&&clearTimeout(l),i===$&&(on(!1),typeof location<"u"&&(X=location.href))}}function Nr(){let e=Qe(document.body);return e?[...e.entries()].map(([t,n])=>`${t}:${n.routeKey}`).join(","):""}function jr(){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 Es(){try{if(typeof matchMedia=="function")return matchMedia("(hover: hover) and (pointer: fine)").matches}catch{}return!0}function _c(e){let t=e.getAttribute("rel");return t?t.toLowerCase().split(/\s+/).filter(Boolean):[]}function sn(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||hn.test(n.pathname)?null:t}function xs(e){if(e.hasAttribute("data-no-prefetch"))return!0;let t=_c(e);return t.includes("external")||t.includes("no-prefetch")}function an(e){if(xs(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 Es()?"intent":"viewport"}}function et(e){if(!pe||typeof fetch!="function"||jr())return;let t=Ne(e);if(Te.has(t)||wt.has(t))return;let n=M.get(t);if(n&&yr()-n.at<Ss)return;if(Te.size>=As){for(wt.add(t),Ye.push(e);Ye.length>gc;){let s=Ye.shift();wt.delete(Ne(s))}return}let r=Nr();if(!r&&typeof document<"u"&&document.readyState==="loading")return;Te.add(t);let o={"x-webjs-router":"1","x-webjs-prefetch":"1"};r&&(o["x-webjs-have"]=r),fetch(e,{method:"GET",headers:o,credentials:"same-origin"}).then(async s=>{let i=s.headers.get("content-type")||"";if(!/^text\/html\b/i.test(i)||s.status>=400)return;let a=s.headers.get("x-webjs-build"),c=s.headers.get("x-webjs-src"),l=typeof document<"u"?document.querySelector('script[type="importmap"]'):null,f=l?l.getAttribute("data-webjs-build"):null,u=l?l.getAttribute("data-webjs-src"):null;(a&&f&&a!==f||c&&u&&c!==u)&&(F.clear(),M.clear());let d=s.redirected&&s.url?s.url:e,p=await s.text();Ac(t,{html:p,build:a,src:c,finalUrl:d,at:yr()})}).catch(()=>{}).finally(()=>{Te.delete(t),Sc()})}function Sc(){for(;Ye.length&&Te.size<As;){let e=Ye.shift();wt.delete(Ne(e)),et(e)}}function Ac(e,t){for(M.has(e)&&M.delete(e),M.set(e,t);M.size>bc;){let n=M.keys().next().value;M.delete(n)}typeof document<"u"&&document.dispatchEvent(new CustomEvent("webjs:prefetch",{detail:{url:t.finalUrl,key:e,from:"prefetch"}}))}function Cs(e){let t=Ne(e),n=M.get(t);return!n||(M.delete(t),yr()-n.at>=Ss)?null:n}function yr(){try{if(typeof performance<"u"&&typeof performance.now=="function")return performance.now()}catch{}return 0}function Xe(e){if(!pe)return;let t=Ts(e.target);if(!t)return;let n=an(t);if(n==="none"||n==="render")return;let r=sn(t);if(r){if(e.type==="touchstart"){et(r);return}n==="intent"&&(_t===t&&Je||(bn(),_t=t,Je=setTimeout(()=>{Je=null,_t=null,et(r)},yc)))}}function ks(e){let t=Ts(e.target);t&&t===_t&&bn()}function bn(){Je&&(clearTimeout(Je),Je=null),_t=null}function Rr(){for(let e of St)clearTimeout(e);St.clear(),Ge=new WeakMap}function Ts(e){let t=e;for(;t;){if(t instanceof HTMLAnchorElement)return t;let n=t.nodeType===1?t:null;if(n){let o=n.closest&&n.closest("a");if(o instanceof HTMLAnchorElement)return o}let r=t.getRootNode?t.getRootNode():null;t=r&&r.host?r.host:null}return null}function wr(){if(typeof document>"u"||jr())return;let e=typeof IntersectionObserver<"u";e&&(de?(de.disconnect(),Rr()):de=new IntersectionObserver(t=>{for(let n of t){let r=n.target;if(n.isIntersecting){if(Ge.has(r))continue;let o=setTimeout(()=>{St.delete(o),Ge.delete(r),de.unobserve(r);let s=sn(r);s&&an(r)==="viewport"&&et(s)},wc);Ge.set(r,o),St.add(o)}else{let o=Ge.get(r);o&&(clearTimeout(o),St.delete(o),Ge.delete(r))}}},{threshold:.5}));for(let t of document.querySelectorAll("a[href]")){let n=an(t);if(n==="render"){let r=sn(t);r&&et(r)}else n==="viewport"&&e&&de.observe(t)}}function Ec(e){if(typeof document>"u"||!document.body)return!1;let t=Qe(document.body);if(!t)return!1;let n,r=-1;for(let[c,l]of t)c.length>r&&(r=c.length,n=l);if(!n)return!1;let o=n.start.parentNode;if(!o||n.start.parentNode!==n.end.parentNode)return!1;let s=document.createElement("div");s.setAttribute("role","alert"),s.setAttribute("data-webjs-nav-error","");let i=e?`This page could not be loaded. (status ${e})`:"This page could not be loaded.";s.textContent=i;let a=document.createRange();return a.setStartAfter(n.start),a.setEndBefore(n.end),a.deleteContents(),o.insertBefore(s,n.end),!0}function hr(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||Ec(t)||typeof location<"u"&&(location.href=e)}async function cn(e,t,n,r,o,s,i,a,c){o=o||"GET";let l=typeof a=="number"?a:$,f,u=null,d=null,p=null,g=null,b=!1,m=e,h=t?vs(t,l):null;try{try{let w=o==="GET"&&!s&&!t?Cs(e):null;if(w)f=w.html,d=w.build,p=w.src,m=w.finalUrl,g=200,b=!0;else{let C={"x-webjs-router":"1"},x=Nr();x&&(C["x-webjs-have"]=x),t&&(C["x-webjs-frame"]=t),s!=null&&o!=="GET"&&o!=="HEAD"&&(C.accept=os+", text/html");let k={method:o,headers:C,credentials:"same-origin"};i&&(k.signal=i),s!=null&&o!=="GET"&&o!=="HEAD"&&(k.body=s);let S=await fetch(e,k);g=S.status,b=S.ok;let E=S.headers.get("content-type")||"",A=/^text\/html\b/i.test(E);if(E.toLowerCase().indexOf(os)===0){let N=await S.text();return l===$&&(yt(r),fr(N)),{ok:b,status:g,aborted:!1}}if(S.redirected&&S.url&&(m=S.url),S.status===204||S.status===205)return l===$&&n&&history.pushState(null,"",m),{ok:b,status:g,aborted:!1};if(!A)return l===$&&(yt(r),hr(e,S.status,null)),{ok:!1,status:g,aborted:!1};d=S.headers.get("x-webjs-build"),p=S.headers.get("x-webjs-src");let I=await $s(S);f=I.shell,I.streaming&&(u=I)}}catch(w){return w&&w.name==="AbortError"?{ok:!1,status:null,aborted:!0}:l!==$?{ok:!1,status:null,aborted:!0}:(yt(r),hr(e,null,w instanceof Error?w:new Error(String(w))),{ok:!1,status:null,aborted:!1})}if(l!==$){if(u&&u.reader)try{u.reader.cancel()}catch{}return{ok:!1,status:g,aborted:!0}}let y=Er(f);if(!y)return yt(r),hr(e,null,new Error("navigation response did not parse as HTML")),{ok:!1,status:g,aborted:!1};if(Or(y,t,!!c,m,d,p)==="discard"){if(u&&u.reader)try{u.reader.cancel()}catch{}return{ok:b,status:g,aborted:!1}}if(n&&history.pushState(null,"",m),n){let w=new URL(m);if(w.hash){let C=document.getElementById(w.hash.slice(1));C?C.scrollIntoView():(ss(),window.scrollTo({left:0,top:0,behavior:"instant"}))}else ss(),window.scrollTo({left:0,top:0,behavior:"instant"})}return u&&(u.reader||u.rest)&&nn.then(()=>Bs(u.reader,u.dec,u.rest,()=>l===$)),document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:m,frameId:t,from:"navigate"}})),{ok:b,status:g,aborted:!1}}finally{h&&Ns(h,l)}}function vs(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=ln.has(n);return ln.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 Ns(e,t){if(ln.get(e)!==t)return;ln.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 js(e,t,n){let r=un.has(e);return un.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 Rs(e,t,n,r){if(un.get(e)!==t)return;un.delete(e),e.setAttribute("aria-busy","false");let o=new CustomEvent("webjs:submit-end",{bubbles:!0,detail:{form:e,url:n,ok:!!r}});e.isConnected?e.dispatchEvent(o):typeof document<"u"?document.dispatchEvent(o):e.dispatchEvent(o)}function is(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+=re(r);return n}function Os(){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 tn(e,t){let n=typeof document<"u"?document.startViewTransition:void 0;if(Os()&&typeof n=="function"){let r=n.call(document,e);return r&&r.finished&&typeof r.finished.then=="function"?r.finished.then(()=>{t&&t()}).catch(()=>{}):t&&t(),r&&r.updateCallbackDone&&typeof r.updateCallbackDone.then=="function"?r.updateCallbackDone.catch(()=>{}):Promise.resolve()}return e(),t&&t(),Promise.resolve()}function Ls(e,t){if(!e||!t||typeof e.querySelectorAll!="function")return;let n=e.querySelectorAll("[data-webjs-permanent][id]");for(let r of n){let o=r.id;if(!o)continue;let s=null;try{s=t.querySelector(`#${CSS.escape(o)}`)}catch{s=null}if(!s||!r.hasAttribute||!r.hasAttribute("data-webjs-permanent"))continue;let i=s.parentNode;i&&s!==r&&i.replaceChild(r,s)}}function gn(e,t){let n=[];for(let r of e){if(r.nodeType!==1)continue;let o=r;if(o.hasAttribute&&o.hasAttribute("data-webjs-permanent")&&o.id&&n.push(o),typeof o.querySelectorAll=="function")for(let s of o.querySelectorAll("[data-webjs-permanent][id]"))n.push(s)}if(n.length)for(let r of n){let o=r.id;if(!o)continue;let s=xc(t,o);if(!s||s===r)continue;let i=s.parentNode;if(i)i.replaceChild(r,s);else{let a=t.indexOf(s);a!==-1&&(t[a]=r)}}}function xc(e,t){for(let n of e){if(n.nodeType!==1)continue;let r=n;if(r.id===t)return r;if(typeof r.querySelector=="function"){let o=null;try{o=r.querySelector(`#${CSS.escape(t)}`)}catch{o=null}if(o)return o}}return null}function Cc(e){if(!(!e||!e.start))for(let t=e.start.nextSibling;t&&t!==e.end;t=t.nextSibling)t.nodeType===1&&ve(t)}function Or(e,t,n,r,o,s){try{Qt(e)}catch{}try{for(let u of e.querySelectorAll("[data-wj-host]"))u.setAttribute("data-wj-serialized","")}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"]'),d=u?u.getAttribute("data-webjs-build"):null,p=!1;if(o&&d&&(p=o!==d),!p&&e.head&&e.head.children.length>0){let g=is(document),b=is(e);g!==b&&(p=!0)}if(p&&typeof location<"u"){F.clear(),M.clear();try{let g="webjs:importmap-reload";if(sessionStorage&&sessionStorage.getItem(g))sessionStorage.removeItem(g);else{sessionStorage&&sessionStorage.setItem(g,"1"),location.href=r;return}}catch{location.href=r;return}}else if(!p){let g=u?u.getAttribute("data-webjs-src"):null;s&&g&&s!==g&&(F.clear(),M.clear(),u&&u.setAttribute("data-webjs-src",s));try{typeof sessionStorage<"u"&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}}}if(t){let u=document.querySelector(`webjs-frame#${CSS.escape(t)}`),d=e.querySelector(`webjs-frame#${CSS.escape(t)}`);if(u&&d){Ar(e.head),nn=tn(()=>{Lc(u,d),At(u),ve(u),as(e.body),rn()},()=>ve(u));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=Qe(document.body),a=Qe(e.body),c=i&&a?ws(i,a):null;if(c){let{mode:u,live:d,incoming:p}=c;Ar(e.head),nn=tn(()=>{u==="replace"?kc(d,p):Tc(d,p,e),Rc(d.start,p.start),as(e.body),rn()},()=>Cc(d));return}if(r&&!n&&typeof location<"u"){br(i?a?"no-shared-boundary":"incoming-boundaries-malformed":"live-boundaries-malformed",r),location.href=r;return}if(r&&n)return br("revalidation-discarded",r),"discard";Ps(e.head),Ls(document.body,e.body);let l=[...e.body.childNodes];nn=tn(()=>{document.body.replaceChildren(...l),At(document.body),ve(document.body),rn()},()=>ve(document.body))}function rn(){let e=document.activeElement;!e||e===document.body||e===document.documentElement||typeof e.blur=="function"&&e.blur()}function kc(e,t){let n=e.start.parentNode;if(!n)return;let r=[];for(let s=e.start.nextSibling;s&&s!==e.end;s=s.nextSibling)r.push(s);let o=[];for(let s=t.start.nextSibling;s&&s!==t.end;s=s.nextSibling)o.push(document.importNode(s,!0));gn(r,o);for(let s of r)s.parentNode===n&&n.removeChild(s);for(let s of o)n.insertBefore(s,e.end);for(let s=e.start.nextSibling;s&&s!==e.end;s=s.nextSibling)s.nodeType===1&&(At(s),ve(s))}function Tc(e,t,n){if(!e||!t)return;let r=e.start.parentNode;if(!r)return;let o=[];for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)o.push(i);let s=[];for(let i=t.start.nextSibling;i&&i!==t.end;i=i.nextSibling)s.push(document.importNode(i,!0));gn(o,s),vc(r,e.start,e.end,o,s);for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)i.nodeType===1&&(At(i),ve(i))}function vc(e,t,n,r,o){let s=new Map;for(let c of r){if(c.nodeType!==1)continue;let l=Ze(c);l&&s.set(l,c)}let i=n,a=[];for(let c of o){if(c.nodeType===1){let l=Ze(c);if(l&&s.has(l)){let f=s.get(l);fn(f,c),a.push(f),s.delete(l);continue}}a.push(c)}for(let c of r)if(c.parentNode===e){if(c.nodeType===1&&a.includes(c))continue;e.removeChild(c)}for(let c of a)e.insertBefore(c,i)}function fn(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),!_r.has(r.name)&&r.name!=="data-wj-serialized"&&e.getAttribute(r.name)!==r.value&&e.setAttribute(r.name,r.value);for(let r of[...e.attributes])_r.has(r.name)||n.has(r.name)||e.removeAttribute(r.name);if(Nc(e)){Oc(e,t);return}yn(e,t)}function Nc(e){let t=e;return t[Symbol.for("webjs.instance")]!=null||t[j]!=null}function jc(e,t){for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!1;return!0}function dn(e){let t=new Map,n=`slot[${L}][${q}="${K}"]`;for(let r of e.querySelectorAll(n)){let o=r;if(!jc(o,e)||ho(e,o))continue;let s=!1;for(let a=o.parentElement;a&&a!==e;a=a.parentElement)if(a.tagName==="SLOT"&&a.hasAttribute(L)&&a.getAttribute(q)===K){s=!0;break}if(s)continue;let i=V(o.getAttribute("name"));t.has(i)||t.set(i,o)}return t}function Rc(e,t){let n=e.parentNode;if(!n||n.nodeType!==1)return;let r=n;if(r.tagName!=="SLOT"||!r.hasAttribute(L))return;let o=null;for(let u=r.parentElement;u;u=u.parentElement){if(u[j]){o=u;break}if(u.tagName.includes("-"))return}if(!o)return;let s=V(r.getAttribute("name"));xe(o,s,[...r.childNodes]);let i=t.parentNode;if(!i||i.nodeType!==1)return;let a=i;if(a.tagName!=="SLOT")return;let c=null;for(let u=a.parentElement;u;u=u.parentElement)if(u.tagName.includes("-")){c=u;break}if(!c||c.tagName!==o.tagName)return;let l=dn(o),f=dn(c);for(let u of new Set([...l.keys(),...f.keys()])){if(u===s)continue;let d=f.get(u);d?xe(o,u,[...d.childNodes].map(p=>document.importNode(p,!0))):l.get(u)&&xe(o,u,null)}}function Oc(e,t){if(!e[j])return;let n=dn(e),r=dn(t);if(n.size===0&&r.size===0)return;let o=new Set([...n.keys(),...r.keys()]);for(let s of o){let i=n.get(s),a=r.get(s);i&&a?(yn(i,a),xe(e,s,[...i.childNodes])):a?xe(e,s,[...a.childNodes].map(c=>document.importNode(c,!0))):xe(e,s,null)}}function yn(e,t){let n=[...e.childNodes],r=[...t.childNodes].map(a=>document.importNode(a,!0));gn(n,r);let o=new Map;for(let a of n){if(a.nodeType!==1)continue;let c=Ze(a);c&&o.set(c,a)}let s=[];for(let a=0;a<r.length;a++){let c=r[a];if(c.nodeType===1){let l=Ze(c);if(l&&o.has(l)){let u=o.get(l);fn(u,c),s.push(u),o.delete(l);continue}let f=n[a];if(f&&f.nodeType===1&&!Ze(f)&&f.tagName===c.tagName){fn(f,c),s.push(f);continue}}else if(c.nodeType===3){let l=n[a];if(l&&l.nodeType===3){l.nodeValue!==c.nodeValue&&(l.nodeValue=c.nodeValue),s.push(l);continue}}else if(c.nodeType===8){let l=n[a];if(l&&l.nodeType===8){l.nodeValue!==c.nodeValue&&(l.nodeValue=c.nodeValue),s.push(l);continue}}s.push(c)}let i=new Set(s);for(let a of n)!i.has(a)&&a.parentNode===e&&e.removeChild(a);for(let a=0;a<s.length;a++){let c=s[a];(c.parentNode!==e||e.childNodes[a]!==c)&&e.insertBefore(c,e.childNodes[a]||null)}}function Ze(e){let t=e.getAttribute("data-key");return t?`${e.tagName}:k:${t}`:e.id?`${e.tagName}:i:${e.id}`:null}function Ms(){let e=Qe(document.body);if(!e||e.size===0)return null;let t=[...e.keys()].sort((a,c)=>c.length-a.length),n=null,r=null;for(let a of t){let c=document.getElementById(`wj-loading:${a}`);if(c instanceof HTMLTemplateElement){n=a,r=c;break}}if(n===null||r===null)return null;let o=e.get(n),s=[];for(let a=o.start.nextSibling;a&&a!==o.end;a=a.nextSibling)s.push(a);let i=document.createRange();return i.setStartAfter(o.start),i.setEndBefore(o.end),i.deleteContents(),o.start.parentNode.insertBefore(r.content.cloneNode(!0),o.end),{slot:o,oldChildren:s,token:$}}function yt(e){if(!e||e.token!==$)return;let{slot:t,oldChildren:n}=e;if(t.start.parentNode!==t.end.parentNode)return;let r=document.createRange();r.setStartAfter(t.start),r.setEndBefore(t.end),r.deleteContents();for(let o of n)t.start.parentNode.insertBefore(o,t.end)}function Lc(e,t){yn(e,t)}function Is(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function Lr(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=Is();return n&&t.setAttribute("nonce",n),t.textContent=e.textContent,t}function Mr(e){if(!e.hasAttribute("nonce"))return e.cloneNode(!0);let t=e.cloneNode(!0),n=Is();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function re(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function pn(e){let t=e.getAttribute("name");if(t)return"name="+t;let n=e.getAttribute("property");if(n)return"property="+n;let r=e.getAttribute("http-equiv");return r?"http-equiv="+r:e.hasAttribute("charset")?"charset":null}function Mc(e){if(!e.querySelector("meta"))return;let t=o=>{let s=new Map;for(let i of o.querySelectorAll("meta")){let a=pn(i);if(!a||a===Sr)continue;let c=s.get(a);c?c.push(i):s.set(a,[i])}return s},n=t(e),r=t(document.head);for(let[o,s]of n){let i=r.get(o)||[],a=s.map(re).join(`
2
+ `),c=i.map(re).join(`
3
+ `);if(a!==c){if(s.length===1&&i.length===1){let l=i[0];for(let f of[...l.attributes])l.removeAttribute(f.name);for(let f of s[0].attributes)l.setAttribute(f.name,f.value);continue}for(let l of i)l.remove();for(let l of s)document.head.appendChild(Mr(l))}}for(let[o,s]of r)if(!n.has(o))for(let i of s)i.remove()}function Ar(e){let t=e.querySelector("title");t&&(document.title=t.textContent||"");let n=new Set;for(let r of document.head.children)n.add(re(r));for(let r of e.children)r.tagName==="SCRIPT"&&r.getAttribute("type")==="importmap"||r.tagName!=="BASE"&&r.tagName!=="TITLE"&&(r.tagName==="META"&&pn(r)||n.has(re(r))||(r.tagName==="SCRIPT"?document.head.appendChild(Lr(r)):document.head.appendChild(Mr(r))));Mc(e)}function Ic(e){return e.tagName==="STYLE"?!0:e.tagName==="LINK"&&(e.getAttribute("rel")||"").toLowerCase().split(/\s+/).includes("stylesheet")}function Ps(e){let t=document.head,n=e.querySelector("title");n&&(document.title=n.textContent||"");let r=new Set;for(let s of t.children)s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&r.add(re(s));let o=new Set;for(let s of e.children)s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&o.add(re(s));for(let s of[...t.children])s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&s.tagName!=="TITLE"&&(Ic(s)||s.tagName==="META"&&pn(s)===Sr||o.has(re(s))||s.remove());for(let s of e.children)s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&s.tagName!=="TITLE"&&(s.tagName==="META"&&pn(s)===Sr||r.has(re(s))||(s.tagName==="SCRIPT"?t.appendChild(Lr(s)):t.appendChild(Mr(s))))}function ve(e){typeof customElements>"u"||Ir(e)}function Ir(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&&Ir(n.shadowRoot))}function as(e){for(let t of e.querySelectorAll("template[data-webjs-resolve]")){let n=t.cloneNode(!0);document.body.appendChild(n);let r=n.getAttribute("data-webjs-resolve"),o=window.__webjsResolve;r&&typeof o=="function"&&o(r)}}async function $s(e){if(!e.body||typeof e.body.getReader!="function")return{shell:await e.text(),streaming:!1};let t=e.body.getReader(),n=new TextDecoder,r="",o="<template data-webjs-resolve",s="<!--wj-stream-shell-->",i=/<\/html\s*>/i;for(;;){let{value:a,done:c}=await t.read();a&&(r+=n.decode(a,{stream:!0})),c&&(r+=n.decode());let l=r.indexOf(s);if(l!==-1)return{shell:r.slice(0,l),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(l+s.length)};let f=r.indexOf(o);if(f!==-1)return{shell:r.slice(0,f),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(f)};if(c)return{shell:r,streaming:!1};let u=i.exec(r);if(u){let d=u.index+u[0].length;return{shell:r.slice(0,d),streaming:!0,reader:t,dec:n,rest:r.slice(d)}}}}function Ds(e){let t=/<template\s+data-webjs-resolve="([^"]+)"\s*>/i.exec(e);if(!t)return null;let n=t[1],r=t.index+t[0].length,o=/<(\/?)template\b[^>]*>/gi;o.lastIndex=r;let s=1,i;for(;i=o.exec(e);)if(i[1]==="/"){if(s--,s===0)return{id:n,content:e.slice(r,i.index),rest:e.slice(i.index+i[0].length)}}else s++;return null}function Fs(e,t){let n=document.getElementById(e);if(!n){dc(e);return}let r=document.createElement("template");r.innerHTML=t;let o=[...r.content.childNodes];n.replaceWith(r.content);for(let s of o)s.nodeType===1&&Ir(s)}async function Bs(e,t,n,r){let o=n,s=()=>{let i;for(;i=Ds(o);){if(!r())return!1;Fs(i.id,i.content),o=i.rest}return!0};if(!e){s();return}try{for(;;){if(!s()){try{await e.cancel()}catch{}return}let{value:i,done:a}=await e.read();if(i&&(o+=t.decode(i,{stream:!0})),a){o+=t.decode(),s();return}}}catch{}}function At(e){for(let t of e.querySelectorAll("script"))t.replaceWith(Lr(t))}function Pc(e){return M.get(Ne(e))||null}function $c(){return Te.size}function Dc(){M.clear(),Te.clear(),Ye.length=0,wt.clear(),bn(),Rr()}function Fc(){return $}function Bc(){return++$}function qc(){return X}function Uc(e){X=e}function Hc(){mr.clear(),gr=!1}function Wc(e,t){return ys(e,t)}function zc(e){return hn.test(e)}var os,Ke,pe,W,$,pr,X,en,hn,gs,mr,gr,pc,F,bc,Ss,As,gc,yc,wc,M,Te,Ye,wt,Je,_t,de,Ge,St,ln,un,nn,_r,Sr,lr=se(()=>{cr();Zt();Zt();es();dr();$t();os="text/vnd.webjs-stream.html";Ke=null;pe=!1,W=null,$=0,pr=null;X=null,en=null;hn=/\.(?: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;gs="_top";mr=new Set;gr=!1;pc=16,F=new Map;bc=8,Ss=3e4,As=3,gc=24,yc=100,wc=250,M=new Map,Te=new Set,Ye=[],wt=new Set,Je=null,_t=null,de=null,Ge=new WeakMap,St=new Set;ln=new WeakMap;un=new WeakMap;nn=Promise.resolve();_r=new Set(["value","checked","selected","indeterminate","disabled","open","popover"]);Sr="name=csp-nonce";(typeof window>"u"||window.__WEBJS_CLIENT_ROUTER__!==!1)&&xr()});function An(e,...t){return{_$webjs:"template",strings:e,values:t}}function P(e){return!!e&&typeof e=="object"&&e._$webjs==="template"}var O="wjm-";function zs(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 je(e){return!!e&&typeof e=="object"&&e._$webjsCss===!0}function En(e,t){if(!(!t||!t.length))if("adoptedStyleSheets"in e&&typeof CSSStyleSheet<"u"){let n=t.map(r=>{let o=new CSSStyleSheet;return o.replaceSync(r.text),o});e.adoptedStyleSheets=n}else{let n=e,r=document.createElement("style");r.textContent=t.map(o=>o.text).join(`
2
4
  `),n.appendChild(r)}}function Et(e){return!e||!e.length?"":`<style>${e.map(t=>t.text).join(`
3
- `)}</style>`}var Re=Object.freeze({"@":"event",".":"prop","?":"bool"});function Dr(e){return Object.prototype.hasOwnProperty.call(Re,e)}function xt(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function H(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}var Fr=Symbol.for("webjs.repeat");function Br(e,t,n){return{[Fr]:!0,items:[...e],keyFn:t,templateFn:n}}function pe(e){return!!e&&typeof e=="object"&&e[Fr]===!0}function Sn(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function Oe(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function Hs(e){return{_$webjs:"live",value:e}}function Le(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function Ws(e,t){return{_$webjs:"keyed",key:e,value:t}}function he(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function zs(e,t){return{_$webjs:"guard",deps:e,fn:t}}function me(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function Vs(e){return{_$webjs:"template-content",template:e}}function Ie(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function Ks(e){return{_$webjs:"ref",target:e}}function be(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function Gs(){return{value:void 0}}function Ys(e){return{_$webjs:"cache",value:e}}function ge(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function Js(...e){return{_$webjs:"until",args:e}}function ye(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function Xs(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function Me(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function Zs(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function Pe(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function Qs(e){return{_$webjs:"watch",signal:e}}function we(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}var z=null,se=!1,De=0,$e=null,An=0,Ur=(e,t)=>Object.is(e,t),Tt=()=>{},qr=()=>!1;function Hr(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)Hr(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function rt(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)rt(n,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(n){console.error(n)}}}function Nn(e){if(se)throw new Error("Signal read during notification phase");if(z===null)return;let t=z,n=t.nextProducerIndex++;n<t.producers.length&&t.producers[n]!==e&&Cn(t)&&rt(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,Cn(t)&&Hr(e,t)),t.producerLastReadVersions[n]=e.version}function Cn(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function Wr(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=se;se=!0;try{for(let n of e.liveConsumers)n.dirty||ei(n)}finally{se=t}}function ei(e){e.dirty=!0,Wr(e),e.consumerMarkedDirty.call(e.wrapper||e)}function kt(e){if(!(!e.dirty&&e.lastCleanEpoch===De)){if(!e.producerMustRecompute()&&!ti(e)){e.dirty=!1,e.lastCleanEpoch=De;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=De}}function ti(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(kt(n),r!==n.version))return!0}return!1}function Tn(e){e&&(e.nextProducerIndex=0);let t=z;return z=e,t}function kn(e,t){if(z=t,!!e){if(Cn(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)rt(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var Nt=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=De,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=qr,this.producerRecomputeValue=Tt,this.consumerMarkedDirty=Tt,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||Ur,this.watched=n?.[vn],this.unwatched=n?.[jn]}get(){return Nn(this),this.__value}peek(){return this.__value}set(t){if(se)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,De++,$e!==null?zr(this):Wr(this))}};function zr(e){let t=se;se=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers)n.dirty||(n.dirty=!0,n.__isWatcher?$e.add(n):zr(n))}finally{se=t}}var En=Symbol("unset"),xn=Symbol("computing"),Ct=Symbol("errored"),ot=class{constructor(t,n){this.__fn=t,this.__value=En,this.__error=null,this.version=0,this.lastCleanEpoch=-1,this.dirty=!0,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!1,this.wrapper=this,this.__isSignal=!0,this.__isComputed=!0,this.__equal=n?.equals||Ur,this.watched=n?.[vn],this.unwatched=n?.[jn];let r=this;this.producerMustRecompute=function(){return r.__value===En||r.__value===xn},this.producerRecomputeValue=function(){if(r.__value===xn)throw new Error("Detected cycle in computations.");let o=r.__value;r.__value=xn;let s=Tn(r),i,c=!1;try{i=r.__fn.call(r.wrapper)}catch(l){i=Ct,r.__error=l,c=!0}finally{kn(r,s)}if(!c&&(o!==En&&o!==Ct)&&r.__equal.call(r.wrapper,o,i)){r.__value=o;return}r.__value=i,r.version++},this.consumerMarkedDirty=Tt}get(){if(kt(this),Nn(this),this.__value===Ct)throw this.__error;return this.__value}peek(){if(kt(this),this.__value===Ct)throw this.__error;return this.__value}},vt=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=De,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=qr,this.producerRecomputeValue=Tt,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=Tn(this);try{for(let r of t)Nn(r),r.__isComputed&&kt(r)}finally{kn(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(rt(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=Tn(this),r;try{r=t()}finally{kn(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)rt(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},vn=Symbol("watched"),jn=Symbol("unwatched");function ni(e){let t=z;z=null;try{return e()}finally{z=t}}function ri(e){return e.producers.slice()}function oi(e){return e.liveConsumers?[...e.liveConsumers]:[]}function si(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function ii(e){return e.producers.length>0}function ai(){return z&&z.__isComputed?z:null}function ci(e){An++,$e===null&&($e=new Set);try{e()}finally{if(An--,An===0){let t=$e;$e=null;for(let n of t)n.__fire()}}}var st={State:Nt,Computed:ot,subtle:{Watcher:vt,untrack:ni,introspectSources:ri,introspectSinks:oi,hasSinks:si,hasSources:ii,currentComputed:ai,watched:vn,unwatched:jn}};function li(e,t){return new Nt(e,t)}function ui(e,t){return new ot(e,t)}function fi(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function di(e){let t=!1,n=!1,r=new ot(e),o=new vt(()=>{t||n||(t=!0,queueMicrotask(()=>{if(t=!1,!n){try{r.get()}catch(s){console.error(s)}o.watch()}}))});o.watch(r);try{r.get()}catch(s){console.error(s)}return()=>{n||(n=!0,o.dispose())}}$t();function bo(e,t){let n=e&&e[j]?e:null;return n?It(n,t):t()}var ho=new WeakMap,Dt=Symbol.for("webjs.instance");function We(e,t){let n=t,r=n[D];n[D]=!0;try{let o=n[Dt];if(P(e)){let s=e;if(o&&o.strings===s.strings){qe(o,s.values);return}o&&mo(o,t);let i=t.firstChild;i&&i.nodeType===8&&i.data==="webjs-hydrate"&&i.remove(),n[Dt]=null;let c=Ri(s,t);n[Dt]=c;return}if(o&&mo(o,t),n[Dt]=null,t.replaceChildren(),e==null||e===!1||e===!0)return;if(Array.isArray(e)){for(let s of e){let i=document.createTextNode(String(s??""));t.appendChild(i)}return}t.appendChild(document.createTextNode(String(e)))}finally{n[D]=r,r||zn(n)}}function Bt(e){let{strings:t}=e,n=ho.get(t);if(n)return n;let r=[],o="",s="text",i="",c=0,a="",l=0,f=null,u="",d="";for(let g=0;g<t.length;g++){let b=t[g];for(let m=0;m<b.length;m++){let h=b[m];switch(s){case"text":o+=h,h==="<"&&(s="tag-open");break;case"tag-open":o+=h,h==="!"?s="bang-1":h==="/"?(s="tag-name",u=""):/[a-zA-Z]/.test(h)?(s="tag-name",u=h.toLowerCase()):s="text";break;case"bang-1":o+=h,s=h==="-"?"bang-dash":"tag-name";break;case"bang-dash":o+=h,h==="-"?(s="comment",l=0):s="tag-name";break;case"comment":o+=h,h==="-"?l+=1:(h===">"&&l>=2&&(s="text"),l=0);break;case"tag-name":o+=h,h===">"?(s=u==="script"||u==="style"?"rawtext":"text",s==="rawtext"&&(d="")):/\s/.test(h)?s="in-tag":u+=h.toLowerCase();break;case"in-tag":o+=h,h===">"?(s=u==="script"||u==="style"?"rawtext":"text",s==="rawtext"&&(d="")):!/\s/.test(h)&&h!=="/"&&(s="attr-name",i=h,c=o.length-1);break;case"rawtext":o+=h,d=(d+h.toLowerCase()).slice(-9),(d.endsWith("<\/script>")||d.endsWith("</style>"))&&(s="text",d="",u="");break;case"attr-name":h==="="?(s="after-eq",o+=h):/\s/.test(h)?(s="in-tag",i="",o+=h):h===">"?(s="text",i="",o+=h):(i+=h,o+=h);break;case"after-eq":h==='"'||h==="'"?(s="attr-quoted",a=h,o+=h):/\s/.test(h)?(s="in-tag",i="",o+=h):h===">"?(s="text",i="",o+=h):(s="attr-unquoted",o+=h);break;case"attr-unquoted":/\s/.test(h)?(s="in-tag",i="",o+=h):(h===">"&&(s="text",i=""),o+=h);break;case"attr-quoted":o+=h,h===a&&(s="in-tag",i="");break;case"skip-attr":if(h===a){if(f){let y=f.firstPartIdx,_=[];for(let E=y;E<r.length;E++)(r[E].kind==="noop"||r[E].kind==="attr-mixed")&&_.push(E);let w=[],C=t[_[0]],x=C.lastIndexOf(a);w.push(x>=0?C.slice(x+1):C);for(let E=1;E<_.length;E++)w.push(t[_[E]]);let T=t[_[_.length-1]+1],S=T.indexOf(a);w.push(S>=0?T.slice(0,S):T),r[y]={kind:"attr-mixed",path:[],name:f.name,statics:w,group:_};for(let E=1;E<_.length;E++)r[_[E]]={kind:"noop",path:[],mixedAnchor:y};f=null}s="in-tag",i=""}break}}if(g<t.length-1){let m=r.length;if(s==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(s==="rawtext"){d="",r.push({kind:"noop",path:[]});continue}if(s==="text")o+=`<!--${O}${m}-->`,r.push({kind:"child",path:[]});else if(s==="in-tag"){let h=`data-${O}${m}`;o+=`${h}=""`,r.push({kind:"element",path:[]})}else if(s==="after-eq"){let h=i[0],y=i.slice(1);if(Dr(h)){o=o.slice(0,c);let _=Re[h],w=`data-${O}${m}`;o+=`${w}=""`,r.push({kind:_,path:[],name:y})}else{o=o.slice(0,c);let _=`data-${O}${m}`;o+=`${_}=""`,r.push({kind:"attr",path:[],name:i})}s="in-tag",i=""}else if(s==="attr-quoted"||s==="attr-unquoted"){o=o.slice(0,c);let h=`data-${O}${m}`;o+=`${h}=""`,f={name:i,firstPartIdx:m},r.push({kind:"noop",path:[]}),s="skip-attr"}else s==="skip-attr"&&r.push({kind:"noop",path:[]})}}let p=document.createElement("template");return p.innerHTML=o,vi(p.content,r),ji(p.content,r),n={templateEl:p,parts:r},ho.set(t,n),n}function vi(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(L,"");let o=t.length;r.setAttribute(`data-${O}${o}`,""),t.push({kind:"slot",path:[]})}}function ji(e,t){let n=[];function r(o){for(let s=0;s<o.childNodes.length;s++){let i=o.childNodes[s];if(n.push(s),i.nodeType===8){let c=i.data;if(c.startsWith(O)){let a=Number(c.slice(O.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-${O}`)){let f=Number(l.name.slice(`data-${O}`.length));t[f]&&t[f].kind!=="child"&&(t[f].path=n.slice()),a.push(l.name)}for(let l of a)c.removeAttribute(l);r(i)}n.pop()}}r(e)}function Ri(e,t){let{templateEl:n,parts:r}=Bt(e),o=n.content.cloneNode(!0),s=document.createComment(`${O}s`),i=document.createComment(`${O}e`),c=r.map(f=>Ut(f,o)),a=[];for(let f=0;f<e.values.length;f++)Y(c[f],e.values[f],void 0,e.values),a.push(e.values[f]);t.replaceChildren(s,...o.childNodes,i);let l=t.nodeType===1&&t[j]?t:null;for(let f of c)f.kind==="slot"&&(l&&f.slotEl&&(f.slotEl[Lt]=l),Y(f,void 0,void 0,[]));return{strings:e.strings,bound:c,lastValues:a,startNode:s,endNode:i}}function Ut(e,t){if(e.kind==="noop")return{kind:"noop",mixedAnchor:e.mixedAnchor};let n=t;for(let o of e.path)n=n.childNodes[o];if(e.kind==="child")return{kind:"child",marker:n};let r=n;if(e.kind==="event"){let o={kind:"event",el:r,name:e.name||"",handler:null,dispatcher(s){o.handler?.(s)}};return r.addEventListener(o.name,o.dispatcher),o}if(e.kind==="attr")return{kind:"attr",el:r,name:e.name||""};if(e.kind==="attr-mixed")return{kind:"attr-mixed",el:r,name:e.name||"",statics:e.statics||[],group:e.group||[]};if(e.kind==="prop")return{kind:"prop",el:r,name:e.name||""};if(e.kind==="bool")return{kind:"bool",el:r,name:e.name||""};if(e.kind==="element")return{kind:"element",el:r};if(e.kind==="slot")return{kind:"slot",slotEl:r,applied:!1};throw new Error(`unknown part kind ${e.kind}`)}function qe(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(Object.is(r,e.lastValues[n]))continue;let o=e.bound[n],s=o.mixedAnchor;o.kind==="noop"&&s!=null?Y(e.bound[s],t[s],e.lastValues[s],t):Y(o,r,e.lastValues[n],t),e.lastValues[n]=r}}function mo(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=ct(n.slotEl);r&&po(r,n.slotEl)}}t.replaceChildren()}function Y(e,t,n,r){if(Le(t)){let o=t.value;if(e.kind==="prop"&&e.el[e.name]===o||e.kind==="attr"&&e.el.getAttribute(e.name)===String(o)||e.kind==="bool"&&e.el.hasAttribute(e.name)===!!o)return;t=o}switch(e.kind){case"child":Ii(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":Li(e,t);break;case"attr-mixed":{let o=e,s=o.statics[0];for(let i=0;i<o.group.length;i++)s+=String((r?r[o.group[i]]:t)??""),s+=o.statics[i+1]||"";e.el.setAttribute(e.name,s);break}case"slot":{if(e.applied)break;let o=e.slotEl,s=()=>{let c=ct(o);if(!c){e.applied=!0;return}if(!c.contains(o)){c.isConnected?queueMicrotask(s):e.applied=!0;return}if(e.applied=!0,Oi(o))return;let a=document.createDocumentFragment();for(;o.firstChild;)a.appendChild(o.firstChild);o[at]=a,queueMicrotask(()=>te(c))},i=ct(o);i&&i.contains(o)?s():queueMicrotask(s);break}case"noop":break}}function ct(e){let t=e[Lt];if(t&&t.isConnected)return t;let n=e.parentElement;for(;n;){if(n[j])return n;n=n.parentElement}return null}function Oi(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 Li(e,t){let n=e,r=be(t)?t.target:void 0,o=n.__refTarget,s=r!==o;if(s&&o)if(typeof o=="function")try{o(void 0)}catch{}else typeof o=="object"&&(o.value=void 0);if(s||n.__refElement!==e.el){if(n.__refTarget=r,r)if(typeof r=="function"){if(!s&&n.__refElement!==void 0)try{r(void 0)}catch{}try{r(e.el)}catch{}}else typeof r=="object"&&(r.value=e.el);n.__refElement=e.el,e.lastTarget=r}}function Ii(e,t){return Wi(e,t),G(e,t)}function G(e,t){return bo(e.marker&&e.marker.parentNode,()=>Mi(e,t))}function Mi(e,t){let n=e.marker;if(Oe(t)){ce(e);let o=String(t.value??""),s=document.createElement("template");s.innerHTML=o;let i=[...s.content.childNodes],c=document.createDocumentFragment();for(let a of i)c.appendChild(a);n.parentNode?.insertBefore(c,n),e.child=i;return}if(he(t)){let o=t,s=e.__keyedKey;s!==void 0&&!Object.is(s,o.key)&&ce(e),e.__keyedKey=o.key,G(e,o.value);return}if(me(t)){let o=t,s=e.__guardDeps,i=o.deps;if(s!==void 0&&(Array.isArray(s)&&Array.isArray(i)?Hi(s,i):Object.is(s,i)))return;e.__guardDeps=Array.isArray(i)?i.slice():i,G(e,o.fn());return}if(Ie(t)){ce(e);let o=t.template;if(o&&o.content){let s=o.content.cloneNode(!0),i=[...s.childNodes];n.parentNode?.insertBefore(s,n),e.child=i}return}if(be(t))return;if(ge(t))return zi(e,t.value);if(ye(t))return Vi(e,t.args);if(we(t))return Ki(e,t.signal);if(Me(t))return Gi(e,t);if(Pe(t))return Yi(e,t);if(pe(t)){if(e.child&&e.child.kind==="repeat"){Di(e,t);return}ce(e);let o={kind:"repeat",map:new Map};e.child=o,$i(n,o,t);return}if(Array.isArray(t)){if(e.child&&e.child.kind==="array"){Ui(e,t);return}ce(e);let o={kind:"array",items:[]};e.child=o,Bi(n,o,t);return}if(e.child){let o=e.child;if(o.kind==="repeat")go(o),e.child=void 0;else if(o.kind==="array")wo(o),e.child=void 0;else if(o.kind==="async-stream")Eo(o),e.child=void 0;else if("strings"in e.child){let s=e.child;if(P(t)&&s.strings===t.strings){qe(s,t.values);return}He(s.startNode,s.endNode),e.child=void 0}else{for(let s of e.child)s.parentNode&&s.parentNode.removeChild(s);e.child=void 0}}if(t==null||t===!1||t===!0)return;if(P(t)){let o=t,{templateEl:s,parts:i}=Bt(o),c=s.content.cloneNode(!0),a=document.createComment(`${O}s`),l=document.createComment(`${O}e`),f=i.map(p=>Ut(p,c)),u=[];for(let p=0;p<o.values.length;p++)Y(f[p],o.values[p],void 0,o.values),u.push(o.values[p]);let d=[a,...c.childNodes,l];n.parentNode?.insertBefore(Pi(d),n);for(let p of f)p.kind==="slot"&&Y(p,void 0,void 0,[]);e.child={strings:o.strings,bound:f,lastValues:u,startNode:a,endNode:l};return}let r=document.createTextNode(String(t));n.parentNode?.insertBefore(r,n),e.child=[r]}function Pi(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function He(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 Kn(e){let{templateEl:t,parts:n}=Bt(e),r=t.content.cloneNode(!0),o=document.createComment(`${O}s`),s=document.createComment(`${O}e`),i=n.map(l=>Ut(l,r)),c=[];for(let l=0;l<e.values.length;l++)Y(i[l],e.values[l],void 0,e.values),c.push(e.values[l]);for(let l of i)l.kind==="slot"&&Y(l,void 0,void 0,[]);let a=document.createDocumentFragment();for(a.appendChild(o);r.firstChild;)a.appendChild(r.firstChild);return a.appendChild(s),{inst:{strings:e.strings,bound:i,lastValues:c,startNode:o,endNode:s},frag:a}}function lt(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 $i(e,t,n){let{items:r,keyFn:o,templateFn:s}=n,i=e.parentNode;if(!i)return;let c=document.createDocumentFragment();for(let a=0;a<r.length;a++){let l=o(r[a],a),f=s(r[a],a);if(!P(f))continue;let{inst:u,frag:d}=Kn(f);t.map.set(l,u),c.appendChild(d)}i.insertBefore(c,e)}function Di(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let o=e.child,{items:s,keyFn:i,templateFn:c}=t,a=new Map;for(let l=0;l<s.length;l++){let f=i(s[l],l),u=c(s[l],l);if(!P(u))continue;let d=o.map.get(f);if(d&&d.strings===u.strings)qe(d,u.values),Vn(d.startNode,d.endNode,r,n),a.set(f,d),o.map.delete(f);else{d&&(lt(d),He(d.startNode,d.endNode),o.map.delete(f));let{inst:p,frag:g}=Kn(u);r.insertBefore(g,n),a.set(f,p)}}for(let l of o.map.values())lt(l),He(l.startNode,l.endNode);o.map=a}function go(e){for(let t of e.map.values())lt(t),He(t.startNode,t.endNode);e.map.clear()}function Fi(e){return e.type==="tpl"?e.inst.startNode:e.type==="text"?e.node:null}function Ft(e){e.type==="tpl"?(lt(e.inst),He(e.inst.startNode,e.inst.endNode)):e.type==="text"&&e.node.parentNode?.removeChild(e.node)}function yo(e){if(P(e)){let{inst:t,frag:n}=Kn(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 Bi(e,t,n){let r=e.parentNode;if(!r)return;let o=document.createDocumentFragment(),s=[];for(let i of n){let{item:c,frag:a}=yo(i);a&&o.appendChild(a),s.push(c)}r.insertBefore(o,e),t.items=s}function Ui(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let o=e.child,s=o.items,i=[];for(let c=0;c<t.length;c++){let a=t[c],l=s[c];if(P(a)){let d=a;if(l&&l.type==="tpl"&&l.inst.strings===d.strings){qe(l.inst,d.values),i.push(l);continue}}else if(a!=null&&a!==!1&&a!==!0){if(l&&l.type==="text"){let d=String(a);l.node.data!==d&&(l.node.data=d),i.push(l);continue}}else{l&&Ft(l),i.push({type:"empty"});continue}let{item:f,frag:u}=yo(a);u&&r.insertBefore(u,qi(s,c,n)),l&&Ft(l),i.push(f)}for(let c=t.length;c<s.length;c++)Ft(s[c]);o.items=i}function qi(e,t,n){for(let r=t;r<e.length;r++){let o=Fi(e[r]);if(o&&o.parentNode)return o}return n}function wo(e){for(let t of e.items)Ft(t);e.items=[]}function Vn(e,t,n,r){if(t.nextSibling===r&&e.parentNode===n)return;let o=document.createDocumentFragment(),s=e;for(;s;){let i=s.nextSibling;if(o.appendChild(s),s===t)break;s=i}n.insertBefore(o,r)}function Hi(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 ce(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&_o(t),!e.child)return;let n=e.child;if(n.kind==="repeat")go(n);else if(n.kind==="array")wo(n);else if(n.kind==="async-stream")Eo(n);else if("strings"in n){let r=e.child;lt(r),He(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function Wi(e,t){let n=e;n.__untilState&&!ye(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!me(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!ge(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!he(t)&&(n.__keyedKey=void 0),n.__watchSub&&!we(t)&&_o(n)}function zi(e,t){let n=e.marker,r=e,o=r.__cacheMap;o||(o=new Map,r.__cacheMap=o);let s=e.child;if(s&&"strings"in s){let c=s;if(P(t)&&c.strings===t.strings){qe(c,t.values);return}let a=document.createDocumentFragment();Vn(c.startNode,c.endNode,a,null),o.set(c.strings,{inst:c,holder:a}),e.child=void 0}if(P(t)){let c=t,a=o.get(c.strings);if(a){o.delete(c.strings),e.child&&ce(e),Vn(a.inst.startNode,a.inst.endNode,n.parentNode,n),qe(a.inst,c.values),e.child=a.inst;let l=new Set;for(let f=a.inst.startNode.nextSibling;f&&f!==a.inst.endNode;f=f.nextSibling){if(f.nodeType!==1)continue;let u=f;if(u.matches("slot[data-webjs-light]")){let d=ct(u);d&&l.add(d)}for(let d of u.querySelectorAll("slot[data-webjs-light]")){let p=ct(d);p&&l.add(p)}}for(let f of l)te(f);return}}G(e,t)}function Vi(e,t){let n=e,r=n.__untilState,o=n.__untilArgs,s=(d,p)=>!!(Object.is(d,p)||P(d)&&P(p)&&d.strings===p.strings),c=o&&o.length===t.length&&o.every((d,p)=>s(d,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,f;for(let d=0;d<t.length;d++){let p=t[d];if(!p||typeof p.then!="function"){l=d,f=p;break}}l!==-1&&l<=a.highestResolved?(G(e,f),a.highestResolved=l):l===-1&&!n.__untilEverRendered&&G(e,""),n.__untilEverRendered=!0;let u=Math.min(l===-1?t.length:l,a.highestResolved);for(let d=0;d<u;d++){let p=t[d];!p||typeof p.then!="function"||Promise.resolve(p).then(g=>{a.aborted||d>=a.highestResolved||(a.highestResolved=d,G(e,g))},()=>{})}}function Ki(e,t){let n=e;if(n.__watchSig===t&&n.__watchSub){let s;n.__watchSub.observe(()=>{s=t.get()}),G(e,s);return}n.__watchSub&&(n.__watchSub.dispose(),n.__watchSub=void 0),n.__watchSig=t;let r=new st.subtle.Watcher(()=>{queueMicrotask(()=>{if(n.__watchSub!==r)return;let s;r.observe(()=>{s=t.get()}),G(e,s)})});n.__watchSub=r;let o;r.observe(()=>{o=t.get()}),G(e,o)}function _o(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function Gi(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="append"&&n.iterable===t.iterable)return;ce(e);let r=t.iterable[Symbol.asyncIterator](),o={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=o,So(o,e,t)}function Yi(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="replace"&&n.iterable===t.iterable)return;ce(e);let r=t.iterable[Symbol.asyncIterator](),o={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=o,So(o,e,t)}async function So(e,t,n){let r=t.marker,o=0;try{for(;!e.aborted;){let s=await e.iterator.next();if(e.aborted||s.done)break;let i=n.mapper?n.mapper(s.value,o):s.value,c=Ao(i);bo(r.parentNode,()=>{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)}),o++}}catch(s){typeof console<"u"&&console.error("[webjs] asyncStream error:",s)}}function Ao(e){if(e==null||e===!1||e===!0)return[];if(P(e)){let t=e,{templateEl:n,parts:r}=Bt(t),o=n.content.cloneNode(!0),s=r.map(i=>Ut(i,o));for(let i=0;i<t.values.length;i++)Y(s[i],t.values[i],void 0,t.values);for(let i of s)i.kind==="slot"&&Y(i,void 0,void 0,[]);return[...o.childNodes]}if(Array.isArray(e)){let t=[];for(let n of e)t.push(...Ao(n));return t}return[document.createTextNode(String(e))]}function Eo(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 xo=null;function qt(e){xo=e||null}function Ji(){return xo||void 0}var Co=Symbol.for("webjs:registry"),To=Symbol.for("webjs:classToTag"),Ht=globalThis,J=Ht[Co]||(Ht[Co]=new Map),ko=Ht[To]||(Ht[To]=new WeakMap),Wt=typeof window<"u"&&typeof customElements<"u";function Gn(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=J.get(e);r?(r.cls=t,r.lazy=n):J.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),ko.set(t,e)}if(Wt){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),Gn(t,n)}}if(!Wt){let e=globalThis;e.customElements||(e.customElements={define(t,n){Gn(t,n)},get(t){return J.get(t)?.cls},upgrade(){},whenDefined(t){let n=J.get(t);return Promise.resolve(n?.cls)}})}function Yn(e,t){Wt?customElements.define(e,t):Gn(e,t)}function Xi(e,t){if(Wt)return;let n=J.get(e);if(n){n.moduleUrl=t;return}J.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e})}function Jn(e){return J.get(e)?.cls}function Zi(e){return J.get(e)?.moduleUrl||null}function Qi(e){return J.get(e)?.lazy===!0}function zt(e){return ko.get(e)}function Xn(){return[...J.keys()]}ze();$t();var Io=typeof window<"u"&&typeof HTMLElement<"u";function da(e,t){return e!==t}function pa(){return{states:new Set,shadowRoot:null,form:null,labels:[],role:"",willValidate:!0,validity:{},validationMessage:"",setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0}}}var Vt=class{constructor(){this.__ssrAttrs=new Map,this.__internals=null}get attributes(){return[...this.__ssrAttrs].map(([t,n])=>({name:t,value:n}))}getAttribute(t){let n=this.__ssrAttrs.get(String(t).toLowerCase());return n===void 0?null:n}setAttribute(t,n){this.__ssrAttrs.set(String(t).toLowerCase(),String(n))}removeAttribute(t){this.__ssrAttrs.delete(String(t).toLowerCase())}hasAttribute(t){return this.__ssrAttrs.has(String(t).toLowerCase())}toggleAttribute(t,n){let r=String(t).toLowerCase(),o=this.__ssrAttrs.has(r);return(n===void 0?!o:n)?(this.__ssrAttrs.set(r,""),!0):(this.__ssrAttrs.delete(r),!1)}getAttributeNames(){return[...this.__ssrAttrs.keys()]}closest(t){let n=String(t).trim().toLowerCase();if(!/^[a-z][a-z0-9-]*$/.test(n))return null;if(this.__ssrTag===n)return this;let r=this.__ssrAncestors;if(!Array.isArray(r))return null;for(let o=r.length-1;o>=0;o--)if(r[o]&&r[o].__ssrTag===n)return r[o];return null}get dataset(){if(this.__dataset)return this.__dataset;let t=this,n=r=>"data-"+String(r).replace(/[A-Z]/g,o=>"-"+o.toLowerCase());return this.__dataset=new Proxy({},{get(r,o){if(typeof o!="string")return;let s=t.getAttribute(n(o));return s===null?void 0:s},set(r,o,s){return typeof o=="string"&&t.setAttribute(n(o),s),!0},has(r,o){return typeof o=="string"&&t.hasAttribute(n(o))},deleteProperty(r,o){return typeof o=="string"&&t.removeAttribute(n(o)),!0},ownKeys(){return t.getAttributeNames().filter(r=>r.startsWith("data-")).map(r=>r.slice(5).replace(/-([a-z])/g,(o,s)=>s.toUpperCase()))},getOwnPropertyDescriptor(r,o){if(typeof o=="string"&&t.hasAttribute(n(o)))return{enumerable:!0,configurable:!0,value:t.getAttribute(n(o))}}}),this.__dataset}get className(){return this.getAttribute("class")??""}set className(t){this.setAttribute("class",t)}get hidden(){return this.hasAttribute("hidden")}set hidden(t){this.toggleAttribute("hidden",!!t)}get id(){return this.getAttribute("id")??""}set id(t){this.setAttribute("id",t)}get title(){return this.getAttribute("title")??""}set title(t){this.setAttribute("title",t)}get slot(){return this.getAttribute("slot")??""}set slot(t){this.setAttribute("slot",t)}get role(){return this.getAttribute("role")}set role(t){t==null?this.removeAttribute("role"):this.setAttribute("role",t)}get tabIndex(){let t=this.getAttribute("tabindex");return t===null?-1:Number.parseInt(t,10)||0}set tabIndex(t){this.setAttribute("tabindex",String(t))}addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return this.__internals=pa(),this.__internals}},ha=["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 ha){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(Vt.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}var ma=Io?HTMLElement:Vt,Mo=Symbol("webjs.factoryProps"),Oo=new WeakSet,Ve=class e extends ma{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){Yn(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||Zn(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(Oo.has(t))return;let n=t;for(;n&&n!==e;){if(Object.hasOwn(n,"properties")&&!Object.hasOwn(n,Mo)){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)}Oo.add(t)}_initializeProperties(){let n=this.constructor.properties;if(!(!n||typeof n!="object")){this.__propValues={};for(let[r,o]of Object.entries(n)){let s=typeof o=="object"?o:{type:o},i=this[r];Object.defineProperty(this,r,{configurable:!0,enumerable:!0,get:()=>this.__propValues[r],set:c=>{let a=this.__propValues[r];(s.hasChanged||da)(c,a)&&(this.__propValues[r]=c,s.reflect&&!s.state&&this._connected&&this._reflectAttribute(r,c,s),this.requestUpdate(r,a))}}),i!==void 0?this.__propValues[r]=i:s.default!==void 0&&(this.__propValues[r]=typeof s.default=="function"?s.default():s.default)}}}_reflectAttribute(t,n,r){let o=r.attribute||Zn(t);if(!this.__reflectingAttribute){this.__reflectingAttribute=!0;try{if(r.converter&&r.converter.toAttribute){let s=r.converter.toAttribute(n,r.type);s==null?this.removeAttribute(o):this.setAttribute(o,s)}else r.type===Boolean?n?this.setAttribute(o,""):this.removeAttribute(o):n==null?this.removeAttribute(o):r.type===Object||r.type===Array?this.setAttribute(o,JSON.stringify(n)):this.setAttribute(o,String(n))}finally{this.__reflectingAttribute=!1}}}connectedCallback(){if(!Io)return;if(this.__webjsPropsHydrated||(this.__webjsPropsHydrated=!0,this._hydratePropAttrs()),this.constructor.hydrate==="visible"&&typeof IntersectionObserver<"u"&&!this.__hydrationActivated){this.__hydrationActivated=!1,this.__hydrationObserver=new IntersectionObserver(n=>{for(let r of n)if(r.isIntersecting){this.__hydrationObserver.unobserve(this),this.__hydrationObserver.disconnect(),this.__hydrationObserver=null,this.__hydrationActivated=!0,this._activate();return}},{rootMargin:"200px"}),this.__hydrationObserver.observe(this);return}this._activate()}_hydratePropAttrs(){let t=[],n=this.attributes;for(let r=0;r<n.length;r++){let o=n[r].name;o.startsWith("data-webjs-prop-")&&t.push(o)}for(let r of t){let o=this.getAttribute(r);if(this.removeAttribute(r),o==null)continue;let s=Lo(r.slice(16));try{this[s]=ne(o)}catch(i){console.warn(`[webjs] failed to decode ${r} on <${this.tagName.toLowerCase()}>: ${i&&i.message}`)}}}_activate(){this._connected=!0,this._reflectDeclaredAttributes();let t=this.constructor;if(t.shadow!==!0&&!this.hasAttribute("data-wj-host")&&this.setAttribute("data-wj-host",""),t.shadow===!0){let n=!!this.shadowRoot;this.shadowRoot||this.attachShadow({mode:"open"}),this._renderRoot=this.shadowRoot;let r=t.styles,o=Array.isArray(r)?r:je(r)?[r]:[];if(o.length){if(n){let s=this.shadowRoot.querySelector("style");s&&s.remove()}_n(this._renderRoot,o)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${zt(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().`),Wn(this)?ao(this):this.__isHydrating()||this.hasAttribute("data-wj-serialized")||fo(this)?(this.removeAttribute("data-wj-serialized"),ee(this),Zr(this)):Xr(this),uo(this),oo(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)}})}__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),io(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 s=this.constructor.properties||{},i,c;for(let[f,u]of Object.entries(s))if(((typeof u=="object"?u:{type:u}).attribute||Zn(f))===t){i=f,c=u;break}if(c===void 0&&(i=Lo(t),c=s[i]||s[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 o of this.__controllers)o.hostUpdate&&o.hostUpdate();this.__renderToken=(this.__renderToken||0)+1,this.__renderAbort&&this.__renderAbort.abort(),this.__renderAbort=typeof AbortController<"u"?new AbortController:null,qt(this.__renderAbort?this.__renderAbort.signal:null);try{let o=this.update(t);o&&typeof o.then=="function"&&(r=o)}catch(o){this._handleRenderError(o)}finally{qt(null)}if(!r){for(let o of this.__controllers)o.hostUpdated&&o.hostUpdated();n=!0}}}catch(o){console.error("[webjs] lifecycle hook threw during update phase:",o)}finally{this._isUpdating=!1,(n||r)&&(this._changedProperties=new Map)}if(r){let o=this.__renderToken;this.__pendingAsyncCommits=(this.__pendingAsyncCommits||0)+1,r.then(()=>{if(this.__pendingAsyncCommits--,o===this.__renderToken){for(let s of this.__controllers)s.hostUpdated&&s.hostUpdated();this._postCommit(t)}});return}n?this._postCommit(t):this.__pendingAsyncCommits||this._resolveUpdate()}_resolveUpdate(){if(this._updateResolve){let t=this._changedProperties.size===0;this._updateResolve(t),this._updateResolve=null}}performServerUpdate(){let t=this._changedProperties;this._isUpdating=!0;try{this.willUpdate(t);for(let n of this.__controllers)n.hostUpdate&&n.hostUpdate();this._reflectDeclaredAttributes()}finally{this._isUpdating=!1}}_reflectDeclaredAttributes(){let t=this.constructor.properties||{};for(let n of Object.keys(t)){let r=t[n];!r||!r.reflect||r.state||this._reflectAttribute(n,this[n],r)}}shouldUpdate(t){return!0}willUpdate(t){}update(t){this.__signalWatcher||(this.__signalWatcher=new st.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n;if(this.__signalWatcher.observe(()=>{n=this.render()}),n&&typeof n.then=="function")return this._commitAsync(n);We(n,this._renderRoot)}_commitAsync(t){let n=this.__renderToken;if(this.__firstRendered&&this._overridesRenderFallback())try{let r=this.renderFallback();r!==void 0&&We(r,this._renderRoot)}catch(r){console.error("[webjs] renderFallback() threw:",r)}return Promise.resolve(t).then(r=>{n===this.__renderToken&&We(r,this._renderRoot)},r=>{n===this.__renderToken&&this._handleRenderError(r instanceof Error?r:new Error(String(r)))})}_overridesRenderFallback(){return this.renderFallback!==Kt.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${zt(this.constructor)||this.tagName?.toLowerCase()}>:`,t);try{let n=this.renderError(t);n!==void 0&&We(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 Zn(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Lo(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Kt(e){return new.target?Reflect.construct(Ve,arguments,new.target):class extends Ve{static properties=e;static[Mo]=!0}}Object.setPrototypeOf(Kt,Ve);Kt.prototype=Ve.prototype;function ba(e,t={}){return e&&typeof e=="object"&&!("call"in e)&&(t=e,e=void 0),{...e?{type:e}:{},...t}}var $l=Symbol.for("webjs.suspense");function ga(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function Gt(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}ze();var Qn=null;function ya(e){Qn=e}function er(){if(!Qn)return"";try{return Qn()||""}catch{return""}}async function wa(e,t={ssr:!0}){let n=t&&t.suspenseCtx,r=t&&t.dev!==void 0?t.dev:n&&n.dev;n&&n.dev===void 0&&r!==void 0&&(n.dev=r);let o=await R(e,n);return t&&t.ssr===!1?o:await ue(o,n,[],r)}async function R(e,t){if(e==null||e===!1||e===!0)return"";if(e&&typeof e.then=="function")return e=await e,R(e,t);if(Oe(e))return String(e.value??"");if(Le(e))return R(e.value,t);if(we(e))return R(e.signal.get(),t);if(he(e))return R(e.value,t);if(me(e))return R(e.fn(),t);if(Ie(e)){let n=e.template;return String(n?.innerHTML??"")}if(be(e))return"";if(ge(e))return R(e.value,t);if(ye(e)){let n=e.args;for(let r of n)if(!r||typeof r.then!="function")return R(r,t);if(n.length>0)try{let r=await Promise.race(n.map(o=>Promise.resolve(o).catch(()=>{})));return R(r,t)}catch{return""}return""}if(Me(e)||Pe(e))return"";if(Array.isArray(e))return(await Promise.all(e.map(r=>R(r,t)))).join("");if(pe(e)){let n=e;return(await Promise.all(n.items.map((o,s)=>R(n.templateFn(o,s),t)))).join("")}if(Gt(e)){let n=e,r=await R(n.fallback,t);if(t){let o=`s${t.nextId++}`;return t.pending.push({id:o,promise:Promise.resolve(n.children)}),`<webjs-boundary id="${o}">${r}</webjs-boundary>`}return r}return P(e)?_a(e,t):xt(String(e))}async function _a(e,t){let{strings:n,values:r}=e,o="",s="text",i="",c=0,a="",l=0,f="",u="";for(let d=0;d<n.length;d++){let p=n[d];for(let g=0;g<p.length;g++){let b=p[g];switch(s){case"text":o+=b,b==="<"&&(s="tag-open");break;case"tag-open":o+=b,b==="!"?s="bang-1":b==="/"?(s="tag-name",f=""):/[a-zA-Z]/.test(b)?(s="tag-name",f=b.toLowerCase()):s="text";break;case"bang-1":o+=b,s=b==="-"?"bang-dash":"tag-name";break;case"bang-dash":o+=b,b==="-"?(s="comment",l=0):s="tag-name";break;case"comment":o+=b,b==="-"?l+=1:(b===">"&&l>=2&&(s="text"),l=0);break;case"tag-name":o+=b,b===">"?(s=Yt(f)?"rawtext":"text",s==="rawtext"&&(u="")):/\s/.test(b)?s="in-tag":f+=b.toLowerCase();break;case"in-tag":o+=b,b===">"?(s=Yt(f)?"rawtext":"text",s==="rawtext"&&(u="")):!/\s/.test(b)&&b!=="/"&&(s="attr-name",i=b,c=o.length-1);break;case"rawtext":o+=b,u=(u+b.toLowerCase()).slice(-9),(u.endsWith("<\/script>")||u.endsWith("</style>"))&&(s="text",u="",f="");break;case"attr-name":b==="="?(s="after-eq",o+=b):/\s/.test(b)?(s="in-tag",i="",o+=b):b===">"?(s="text",i="",o+=b):(i+=b,o+=b);break;case"after-eq":b==='"'||b==="'"?(s="attr-quoted",a=b,o+=b):/\s/.test(b)?(s="in-tag",i="",o+=b):b===">"?(s="text",i="",o+=b):(s="attr-unquoted",o+=b);break;case"attr-unquoted":/\s/.test(b)?(s="in-tag",i="",o+=b):(b===">"&&(s="text",i=""),o+=b);break;case"attr-quoted":o+=b,b===a&&(s="in-tag",i="");break}}if(d<r.length){let g=r[d];if(g&&typeof g.then=="function"&&(g=await g),s==="comment")o+=String(g??""),l=0;else if(s==="rawtext")o+=String(g??""),u="";else if(s==="text")o+=await R(g,t);else if(s==="after-eq"){let b=i[0],m=i.slice(1),h=Re[b];if(h==="event")o=o.slice(0,c),s="in-tag",i="";else if(h==="prop"){if(o=o.slice(0,c),f==="webjs-suspense"&&m==="fallback"){let y=await R(g,t);o+=`data-webjs-fallback="${H(y)}"`,s="in-tag",i="";continue}if(!f.includes("-")){s="in-tag",i="";continue}if(g===void 0){s="in-tag",i="";continue}try{let y=await dt(g);o+=`data-webjs-prop-${Ma(m)}="${H(y)}"`}catch(y){console.warn(`[webjs] property binding .${m} has an unserializable value during SSR. Dropping. The browser will see the property as undefined. Detail: ${y&&y.message}`)}s="in-tag",i=""}else h==="bool"?(o=o.slice(0,c),g&&(o+=`${m}=""`),s="in-tag",i=""):(o+=`"${H(String(g??""))}"`,s="in-tag",i="")}else(s==="attr-quoted"||s==="attr-unquoted")&&(o+=H(String(g??"")))}}return o}var Sa=new Set(["document","window","localStorage","sessionStorage","navigator","matchMedia","requestAnimationFrame","getComputedStyle","IntersectionObserver","MutationObserver","ResizeObserver"]),Aa=new Set(["attachShadow","querySelector","querySelectorAll","getBoundingClientRect","focus","blur","scrollIntoView"]);function Ea(e){let t=e&&typeof e.message=="string"?e.message:"",n=/^(\w+) is not defined\b/.exec(t);return e instanceof ReferenceError&&n&&Sa.has(n[1])?`\`${n[1]}\` is a browser-only global and is undefined during SSR.`:(n=/\.(\w+) is not a function\b/.exec(t),e instanceof TypeError&&n&&Aa.has(n[1])?`\`${n[1]}\` is an HTMLElement method that does not exist on the server-side component instance during SSR.`:null)}function xa(){return typeof process<"u"&&process.env&&!0}function Fo(e,t,n){if(!(n===void 0?!xa():!!n))return"";let o=t&&t.message?t.message:String(t);return wn`<div data-webjs-error="${e}" style="border:1px solid #f5c2c7;background:#f8d7da;color:#842029;padding:8px 12px;border-radius:6px;font:13px/1.4 system-ui,sans-serif">
5
+ `)}</style>`}var Re=Object.freeze({"@":"event",".":"prop","?":"bool"});function Ur(e){return Object.prototype.hasOwnProperty.call(Re,e)}function xt(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function H(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}var Hr=Symbol.for("webjs.repeat");function Wr(e,t,n){return{[Hr]:!0,items:[...e],keyFn:t,templateFn:n}}function he(e){return!!e&&typeof e=="object"&&e[Hr]===!0}function xn(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function Oe(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function Vs(e){return{_$webjs:"live",value:e}}function Le(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function Ks(e,t){return{_$webjs:"keyed",key:e,value:t}}function me(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function Gs(e,t){return{_$webjs:"guard",deps:e,fn:t}}function be(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function Ys(e){return{_$webjs:"template-content",template:e}}function Me(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function Js(e){return{_$webjs:"ref",target:e}}function ge(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function Xs(){return{value:void 0}}function Zs(e){return{_$webjs:"cache",value:e}}function ye(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function Qs(...e){return{_$webjs:"until",args:e}}function we(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function ei(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function Ie(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function ti(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function Pe(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function ni(e){return{_$webjs:"watch",signal:e}}function _e(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}var z=null,ie=!1,De=0,$e=null,Cn=0,zr=(e,t)=>Object.is(e,t),kt=()=>{},Vr=()=>!1;function Kr(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)Kr(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function rt(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)rt(n,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(n){console.error(n)}}}function Rn(e){if(ie)throw new Error("Signal read during notification phase");if(z===null)return;let t=z,n=t.nextProducerIndex++;n<t.producers.length&&t.producers[n]!==e&&vn(t)&&rt(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,vn(t)&&Kr(e,t)),t.producerLastReadVersions[n]=e.version}function vn(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function Gr(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=ie;ie=!0;try{for(let n of e.liveConsumers)n.dirty||ri(n)}finally{ie=t}}function ri(e){e.dirty=!0,Gr(e),e.consumerMarkedDirty.call(e.wrapper||e)}function Tt(e){if(!(!e.dirty&&e.lastCleanEpoch===De)){if(!e.producerMustRecompute()&&!oi(e)){e.dirty=!1,e.lastCleanEpoch=De;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=De}}function oi(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(Tt(n),r!==n.version))return!0}return!1}function Nn(e){e&&(e.nextProducerIndex=0);let t=z;return z=e,t}function jn(e,t){if(z=t,!!e){if(vn(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)rt(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var vt=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=De,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=Vr,this.producerRecomputeValue=kt,this.consumerMarkedDirty=kt,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||zr,this.watched=n?.[On],this.unwatched=n?.[Ln]}get(){return Rn(this),this.__value}peek(){return this.__value}set(t){if(ie)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,De++,$e!==null?Yr(this):Gr(this))}};function Yr(e){let t=ie;ie=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers)n.dirty||(n.dirty=!0,n.__isWatcher?$e.add(n):Yr(n))}finally{ie=t}}var kn=Symbol("unset"),Tn=Symbol("computing"),Ct=Symbol("errored"),ot=class{constructor(t,n){this.__fn=t,this.__value=kn,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||zr,this.watched=n?.[On],this.unwatched=n?.[Ln];let r=this;this.producerMustRecompute=function(){return r.__value===kn||r.__value===Tn},this.producerRecomputeValue=function(){if(r.__value===Tn)throw new Error("Detected cycle in computations.");let o=r.__value;r.__value=Tn;let s=Nn(r),i,a=!1;try{i=r.__fn.call(r.wrapper)}catch(l){i=Ct,r.__error=l,a=!0}finally{jn(r,s)}if(!a&&(o!==kn&&o!==Ct)&&r.__equal.call(r.wrapper,o,i)){r.__value=o;return}r.__value=i,r.version++},this.consumerMarkedDirty=kt}get(){if(Tt(this),Rn(this),this.__value===Ct)throw this.__error;return this.__value}peek(){if(Tt(this),this.__value===Ct)throw this.__error;return this.__value}},Nt=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=De,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=Vr,this.producerRecomputeValue=kt,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=Nn(this);try{for(let r of t)Rn(r),r.__isComputed&&Tt(r)}finally{jn(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(rt(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=Nn(this),r;try{r=t()}finally{jn(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)rt(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},On=Symbol("watched"),Ln=Symbol("unwatched");function si(e){let t=z;z=null;try{return e()}finally{z=t}}function ii(e){return e.producers.slice()}function ai(e){return e.liveConsumers?[...e.liveConsumers]:[]}function ci(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function li(e){return e.producers.length>0}function ui(){return z&&z.__isComputed?z:null}function fi(e){Cn++,$e===null&&($e=new Set);try{e()}finally{if(Cn--,Cn===0){let t=$e;$e=null;for(let n of t)n.__fire()}}}var st={State:vt,Computed:ot,subtle:{Watcher:Nt,untrack:si,introspectSources:ii,introspectSinks:ai,hasSinks:ci,hasSources:li,currentComputed:ui,watched:On,unwatched:Ln}};function di(e,t){return new vt(e,t)}function pi(e,t){return new ot(e,t)}function hi(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function mi(e){let t=!1,n=!1,r=new ot(e),o=new Nt(()=>{t||n||(t=!0,queueMicrotask(()=>{if(t=!1,!n){try{r.get()}catch(s){console.error(s)}o.watch()}}))});o.watch(r);try{r.get()}catch(s){console.error(s)}return()=>{n||(n=!0,o.dispose())}}$t();function _o(e,t){let n=e&&e[j]?e:null;return n?Mt(n,t):t()}var yo=new WeakMap,Dt=Symbol.for("webjs.instance");function We(e,t){let n=t,r=n[D];n[D]=!0;try{let o=n[Dt];if(P(e)){let s=e;if(o&&o.strings===s.strings){Ue(o,s.values);return}o&&wo(o,t);let i=t.firstChild;i&&i.nodeType===8&&i.data==="webjs-hydrate"&&i.remove(),n[Dt]=null;let a=Mi(s,t);n[Dt]=a;return}if(o&&wo(o,t),n[Dt]=null,t.replaceChildren(),e==null||e===!1||e===!0)return;if(Array.isArray(e)){for(let s of e){let i=document.createTextNode(String(s??""));t.appendChild(i)}return}t.appendChild(document.createTextNode(String(e)))}finally{n[D]=r,r||Gn(n)}}function Bt(e){let{strings:t}=e,n=yo.get(t);if(n)return n;let r=[],o="",s="text",i="",a=0,c="",l=0,f=null,u="",d="";for(let g=0;g<t.length;g++){let b=t[g];for(let m=0;m<b.length;m++){let h=b[m];switch(s){case"text":o+=h,h==="<"&&(s="tag-open");break;case"tag-open":o+=h,h==="!"?s="bang-1":h==="/"?(s="tag-name",u=""):/[a-zA-Z]/.test(h)?(s="tag-name",u=h.toLowerCase()):s="text";break;case"bang-1":o+=h,s=h==="-"?"bang-dash":"tag-name";break;case"bang-dash":o+=h,h==="-"?(s="comment",l=0):s="tag-name";break;case"comment":o+=h,h==="-"?l+=1:(h===">"&&l>=2&&(s="text"),l=0);break;case"tag-name":o+=h,h===">"?(s=u==="script"||u==="style"?"rawtext":"text",s==="rawtext"&&(d="")):/\s/.test(h)?s="in-tag":u+=h.toLowerCase();break;case"in-tag":o+=h,h===">"?(s=u==="script"||u==="style"?"rawtext":"text",s==="rawtext"&&(d="")):!/\s/.test(h)&&h!=="/"&&(s="attr-name",i=h,a=o.length-1);break;case"rawtext":o+=h,d=(d+h.toLowerCase()).slice(-9),(d.endsWith("<\/script>")||d.endsWith("</style>"))&&(s="text",d="",u="");break;case"attr-name":h==="="?(s="after-eq",o+=h):/\s/.test(h)?(s="in-tag",i="",o+=h):h===">"?(s="text",i="",o+=h):(i+=h,o+=h);break;case"after-eq":h==='"'||h==="'"?(s="attr-quoted",c=h,o+=h):/\s/.test(h)?(s="in-tag",i="",o+=h):h===">"?(s="text",i="",o+=h):(s="attr-unquoted",o+=h);break;case"attr-unquoted":/\s/.test(h)?(s="in-tag",i="",o+=h):(h===">"&&(s="text",i=""),o+=h);break;case"attr-quoted":o+=h,h===c&&(s="in-tag",i="");break;case"skip-attr":if(h===c){if(f){let y=f.firstPartIdx,_=[];for(let E=y;E<r.length;E++)(r[E].kind==="noop"||r[E].kind==="attr-mixed")&&_.push(E);let w=[],C=t[_[0]],x=C.lastIndexOf(c);w.push(x>=0?C.slice(x+1):C);for(let E=1;E<_.length;E++)w.push(t[_[E]]);let k=t[_[_.length-1]+1],S=k.indexOf(c);w.push(S>=0?k.slice(0,S):k),r[y]={kind:"attr-mixed",path:[],name:f.name,statics:w,group:_};for(let E=1;E<_.length;E++)r[_[E]]={kind:"noop",path:[],mixedAnchor:y};f=null}s="in-tag",i=""}break}}if(g<t.length-1){let m=r.length;if(s==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(s==="rawtext"){d="",r.push({kind:"noop",path:[]});continue}if(s==="text")o+=`<!--${O}${m}-->`,r.push({kind:"child",path:[]});else if(s==="in-tag"){let h=`data-${O}${m}`;o+=`${h}=""`,r.push({kind:"element",path:[]})}else if(s==="after-eq"){let h=i[0],y=i.slice(1);if(Ur(h)){o=o.slice(0,a);let _=Re[h],w=`data-${O}${m}`;o+=`${w}=""`,r.push({kind:_,path:[],name:y})}else{o=o.slice(0,a);let _=`data-${O}${m}`;o+=`${_}=""`,r.push({kind:"attr",path:[],name:i})}s="in-tag",i=""}else if(s==="attr-quoted"||s==="attr-unquoted"){o=o.slice(0,a);let h=`data-${O}${m}`;o+=`${h}=""`,f={name:i,firstPartIdx:m},r.push({kind:"noop",path:[]}),s="skip-attr"}else s==="skip-attr"&&r.push({kind:"noop",path:[]})}}let p=document.createElement("template");return p.innerHTML=o,Oi(p.content,r),Li(p.content,r),n={templateEl:p,parts:r},yo.set(t,n),n}function Oi(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(L,"");let o=t.length;r.setAttribute(`data-${O}${o}`,""),t.push({kind:"slot",path:[]})}}function Li(e,t){let n=[];function r(o){for(let s=0;s<o.childNodes.length;s++){let i=o.childNodes[s];if(n.push(s),i.nodeType===8){let a=i.data;if(a.startsWith(O)){let c=Number(a.slice(O.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-${O}`)){let f=Number(l.name.slice(`data-${O}`.length));t[f]&&t[f].kind!=="child"&&(t[f].path=n.slice()),c.push(l.name)}for(let l of c)a.removeAttribute(l);r(i)}n.pop()}}r(e)}function Mi(e,t){let{templateEl:n,parts:r}=Bt(e),o=n.content.cloneNode(!0),s=document.createComment(`${O}s`),i=document.createComment(`${O}e`),a=r.map(f=>qt(f,o)),c=[];for(let f=0;f<e.values.length;f++)Y(a[f],e.values[f],void 0,e.values),c.push(e.values[f]);t.replaceChildren(s,...o.childNodes,i);let l=t.nodeType===1&&t[j]?t:null;for(let f of a)f.kind==="slot"&&(l&&f.slotEl&&(f.slotEl[Lt]=l),Y(f,void 0,void 0,[]));return{strings:e.strings,bound:a,lastValues:c,startNode:s,endNode:i}}function qt(e,t){if(e.kind==="noop")return{kind:"noop",mixedAnchor:e.mixedAnchor};let n=t;for(let o of e.path)n=n.childNodes[o];if(e.kind==="child")return{kind:"child",marker:n};let r=n;if(e.kind==="event"){let o={kind:"event",el:r,name:e.name||"",handler:null,dispatcher(s){o.handler?.(s)}};return r.addEventListener(o.name,o.dispatcher),o}if(e.kind==="attr")return{kind:"attr",el:r,name:e.name||""};if(e.kind==="attr-mixed")return{kind:"attr-mixed",el:r,name:e.name||"",statics:e.statics||[],group:e.group||[]};if(e.kind==="prop")return{kind:"prop",el:r,name:e.name||""};if(e.kind==="bool")return{kind:"bool",el:r,name:e.name||""};if(e.kind==="element")return{kind:"element",el:r};if(e.kind==="slot")return{kind:"slot",slotEl:r,applied:!1};throw new Error(`unknown part kind ${e.kind}`)}function Ue(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(Object.is(r,e.lastValues[n]))continue;let o=e.bound[n],s=o.mixedAnchor;o.kind==="noop"&&s!=null?Y(e.bound[s],t[s],e.lastValues[s],t):Y(o,r,e.lastValues[n],t),e.lastValues[n]=r}}function wo(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=ct(n.slotEl);r&&go(r,n.slotEl)}}t.replaceChildren()}function Y(e,t,n,r){if(Le(t)){let o=t.value;if(e.kind==="prop"&&e.el[e.name]===o||e.kind==="attr"&&e.el.getAttribute(e.name)===String(o)||e.kind==="bool"&&e.el.hasAttribute(e.name)===!!o)return;t=o}switch(e.kind){case"child":$i(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":Pi(e,t);break;case"attr-mixed":{let o=e,s=o.statics[0];for(let i=0;i<o.group.length;i++)s+=String((r?r[o.group[i]]:t)??""),s+=o.statics[i+1]||"";e.el.setAttribute(e.name,s);break}case"slot":{if(e.applied)break;let o=e.slotEl,s=()=>{let a=ct(o);if(!a){e.applied=!0;return}if(!a.contains(o)){a.isConnected?queueMicrotask(s):e.applied=!0;return}if(e.applied=!0,Ii(o))return;let c=document.createDocumentFragment();for(;o.firstChild;)c.appendChild(o.firstChild);o[at]=c,queueMicrotask(()=>te(a))},i=ct(o);i&&i.contains(o)?s():queueMicrotask(s);break}case"noop":break}}function ct(e){let t=e[Lt];if(t&&t.isConnected)return t;let n=e.parentElement;for(;n;){if(n[j])return n;n=n.parentElement}return null}function Ii(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 Pi(e,t){let n=e,r=ge(t)?t.target:void 0,o=n.__refTarget,s=r!==o;if(s&&o)if(typeof o=="function")try{o(void 0)}catch{}else typeof o=="object"&&(o.value=void 0);if(s||n.__refElement!==e.el){if(n.__refTarget=r,r)if(typeof r=="function"){if(!s&&n.__refElement!==void 0)try{r(void 0)}catch{}try{r(e.el)}catch{}}else typeof r=="object"&&(r.value=e.el);n.__refElement=e.el,e.lastTarget=r}}function $i(e,t){return Ki(e,t),G(e,t)}function G(e,t){return _o(e.marker&&e.marker.parentNode,()=>Di(e,t))}function Di(e,t){let n=e.marker;if(Oe(t)){le(e);let o=String(t.value??""),s=document.createElement("template");s.innerHTML=o;let i=[...s.content.childNodes],a=document.createDocumentFragment();for(let c of i)a.appendChild(c);n.parentNode?.insertBefore(a,n),e.child=i;return}if(me(t)){let o=t,s=e.__keyedKey;s!==void 0&&!Object.is(s,o.key)&&le(e),e.__keyedKey=o.key,G(e,o.value);return}if(be(t)){let o=t,s=e.__guardDeps,i=o.deps;if(s!==void 0&&(Array.isArray(s)&&Array.isArray(i)?Vi(s,i):Object.is(s,i)))return;e.__guardDeps=Array.isArray(i)?i.slice():i,G(e,o.fn());return}if(Me(t)){le(e);let o=t.template;if(o&&o.content){let s=o.content.cloneNode(!0),i=[...s.childNodes];n.parentNode?.insertBefore(s,n),e.child=i}return}if(ge(t))return;if(ye(t))return Gi(e,t.value);if(we(t))return Yi(e,t.args);if(_e(t))return Ji(e,t.signal);if(Ie(t))return Xi(e,t);if(Pe(t))return Zi(e,t);if(he(t)){if(e.child&&e.child.kind==="repeat"){qi(e,t);return}le(e);let o={kind:"repeat",map:new Map};e.child=o,Bi(n,o,t);return}if(Array.isArray(t)){if(e.child&&e.child.kind==="array"){Wi(e,t);return}le(e);let o={kind:"array",items:[]};e.child=o,Hi(n,o,t);return}if(e.child){let o=e.child;if(o.kind==="repeat")So(o),e.child=void 0;else if(o.kind==="array")Eo(o),e.child=void 0;else if(o.kind==="async-stream")To(o),e.child=void 0;else if("strings"in e.child){let s=e.child;if(P(t)&&s.strings===t.strings){Ue(s,t.values);return}He(s.startNode,s.endNode),e.child=void 0}else{for(let s of e.child)s.parentNode&&s.parentNode.removeChild(s);e.child=void 0}}if(t==null||t===!1||t===!0)return;if(P(t)){let o=t,{templateEl:s,parts:i}=Bt(o),a=s.content.cloneNode(!0),c=document.createComment(`${O}s`),l=document.createComment(`${O}e`),f=i.map(p=>qt(p,a)),u=[];for(let p=0;p<o.values.length;p++)Y(f[p],o.values[p],void 0,o.values),u.push(o.values[p]);let d=[c,...a.childNodes,l];n.parentNode?.insertBefore(Fi(d),n);for(let p of f)p.kind==="slot"&&Y(p,void 0,void 0,[]);e.child={strings:o.strings,bound:f,lastValues:u,startNode:c,endNode:l};return}let r=document.createTextNode(String(t));n.parentNode?.insertBefore(r,n),e.child=[r]}function Fi(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function He(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 Jn(e){let{templateEl:t,parts:n}=Bt(e),r=t.content.cloneNode(!0),o=document.createComment(`${O}s`),s=document.createComment(`${O}e`),i=n.map(l=>qt(l,r)),a=[];for(let l=0;l<e.values.length;l++)Y(i[l],e.values[l],void 0,e.values),a.push(e.values[l]);for(let l of i)l.kind==="slot"&&Y(l,void 0,void 0,[]);let c=document.createDocumentFragment();for(c.appendChild(o);r.firstChild;)c.appendChild(r.firstChild);return c.appendChild(s),{inst:{strings:e.strings,bound:i,lastValues:a,startNode:o,endNode:s},frag:c}}function lt(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 Bi(e,t,n){let{items:r,keyFn:o,templateFn:s}=n,i=e.parentNode;if(!i)return;let a=document.createDocumentFragment();for(let c=0;c<r.length;c++){let l=o(r[c],c),f=s(r[c],c);if(!P(f))continue;let{inst:u,frag:d}=Jn(f);t.map.set(l,u),a.appendChild(d)}i.insertBefore(a,e)}function qi(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let o=e.child,{items:s,keyFn:i,templateFn:a}=t,c=new Map;for(let l=0;l<s.length;l++){let f=i(s[l],l),u=a(s[l],l);if(!P(u))continue;let d=o.map.get(f);if(d&&d.strings===u.strings)Ue(d,u.values),Yn(d.startNode,d.endNode,r,n),c.set(f,d),o.map.delete(f);else{d&&(lt(d),He(d.startNode,d.endNode),o.map.delete(f));let{inst:p,frag:g}=Jn(u);r.insertBefore(g,n),c.set(f,p)}}for(let l of o.map.values())lt(l),He(l.startNode,l.endNode);o.map=c}function So(e){for(let t of e.map.values())lt(t),He(t.startNode,t.endNode);e.map.clear()}function Ui(e){return e.type==="tpl"?e.inst.startNode:e.type==="text"?e.node:null}function Ft(e){e.type==="tpl"?(lt(e.inst),He(e.inst.startNode,e.inst.endNode)):e.type==="text"&&e.node.parentNode?.removeChild(e.node)}function Ao(e){if(P(e)){let{inst:t,frag:n}=Jn(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 Hi(e,t,n){let r=e.parentNode;if(!r)return;let o=document.createDocumentFragment(),s=[];for(let i of n){let{item:a,frag:c}=Ao(i);c&&o.appendChild(c),s.push(a)}r.insertBefore(o,e),t.items=s}function Wi(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let o=e.child,s=o.items,i=[];for(let a=0;a<t.length;a++){let c=t[a],l=s[a];if(P(c)){let d=c;if(l&&l.type==="tpl"&&l.inst.strings===d.strings){Ue(l.inst,d.values),i.push(l);continue}}else if(c!=null&&c!==!1&&c!==!0){if(l&&l.type==="text"){let d=String(c);l.node.data!==d&&(l.node.data=d),i.push(l);continue}}else{l&&Ft(l),i.push({type:"empty"});continue}let{item:f,frag:u}=Ao(c);u&&r.insertBefore(u,zi(s,a,n)),l&&Ft(l),i.push(f)}for(let a=t.length;a<s.length;a++)Ft(s[a]);o.items=i}function zi(e,t,n){for(let r=t;r<e.length;r++){let o=Ui(e[r]);if(o&&o.parentNode)return o}return n}function Eo(e){for(let t of e.items)Ft(t);e.items=[]}function Yn(e,t,n,r){if(t.nextSibling===r&&e.parentNode===n)return;let o=document.createDocumentFragment(),s=e;for(;s;){let i=s.nextSibling;if(o.appendChild(s),s===t)break;s=i}n.insertBefore(o,r)}function Vi(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 le(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&xo(t),!e.child)return;let n=e.child;if(n.kind==="repeat")So(n);else if(n.kind==="array")Eo(n);else if(n.kind==="async-stream")To(n);else if("strings"in n){let r=e.child;lt(r),He(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function Ki(e,t){let n=e;n.__untilState&&!we(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!be(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!ye(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!me(t)&&(n.__keyedKey=void 0),n.__watchSub&&!_e(t)&&xo(n)}function Gi(e,t){let n=e.marker,r=e,o=r.__cacheMap;o||(o=new Map,r.__cacheMap=o);let s=e.child;if(s&&"strings"in s){let a=s;if(P(t)&&a.strings===t.strings){Ue(a,t.values);return}let c=document.createDocumentFragment();Yn(a.startNode,a.endNode,c,null),o.set(a.strings,{inst:a,holder:c}),e.child=void 0}if(P(t)){let a=t,c=o.get(a.strings);if(c){o.delete(a.strings),e.child&&le(e),Yn(c.inst.startNode,c.inst.endNode,n.parentNode,n),Ue(c.inst,a.values),e.child=c.inst;let l=new Set;for(let f=c.inst.startNode.nextSibling;f&&f!==c.inst.endNode;f=f.nextSibling){if(f.nodeType!==1)continue;let u=f;if(u.matches("slot[data-webjs-light]")){let d=ct(u);d&&l.add(d)}for(let d of u.querySelectorAll("slot[data-webjs-light]")){let p=ct(d);p&&l.add(p)}}for(let f of l)te(f);return}}G(e,t)}function Yi(e,t){let n=e,r=n.__untilState,o=n.__untilArgs,s=(d,p)=>!!(Object.is(d,p)||P(d)&&P(p)&&d.strings===p.strings),a=o&&o.length===t.length&&o.every((d,p)=>s(d,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,f;for(let d=0;d<t.length;d++){let p=t[d];if(!p||typeof p.then!="function"){l=d,f=p;break}}l!==-1&&l<=c.highestResolved?(G(e,f),c.highestResolved=l):l===-1&&!n.__untilEverRendered&&G(e,""),n.__untilEverRendered=!0;let u=Math.min(l===-1?t.length:l,c.highestResolved);for(let d=0;d<u;d++){let p=t[d];!p||typeof p.then!="function"||Promise.resolve(p).then(g=>{c.aborted||d>=c.highestResolved||(c.highestResolved=d,G(e,g))},()=>{})}}function Ji(e,t){let n=e;if(n.__watchSig===t&&n.__watchSub){let s;n.__watchSub.observe(()=>{s=t.get()}),G(e,s);return}n.__watchSub&&(n.__watchSub.dispose(),n.__watchSub=void 0),n.__watchSig=t;let r=new st.subtle.Watcher(()=>{queueMicrotask(()=>{if(n.__watchSub!==r)return;let s;r.observe(()=>{s=t.get()}),G(e,s)})});n.__watchSub=r;let o;r.observe(()=>{o=t.get()}),G(e,o)}function xo(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function Xi(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="append"&&n.iterable===t.iterable)return;le(e);let r=t.iterable[Symbol.asyncIterator](),o={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=o,Co(o,e,t)}function Zi(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="replace"&&n.iterable===t.iterable)return;le(e);let r=t.iterable[Symbol.asyncIterator](),o={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=o,Co(o,e,t)}async function Co(e,t,n){let r=t.marker,o=0;try{for(;!e.aborted;){let s=await e.iterator.next();if(e.aborted||s.done)break;let i=n.mapper?n.mapper(s.value,o):s.value,a=ko(i);_o(r.parentNode,()=>{if(e.mode==="replace"){for(let l of e.nodes)l.parentNode&&l.parentNode.removeChild(l);e.nodes=[]}let c=document.createDocumentFragment();for(let l of a)c.appendChild(l);r.parentNode?.insertBefore(c,r),e.nodes.push(...a)}),o++}}catch(s){typeof console<"u"&&console.error("[webjs] asyncStream error:",s)}}function ko(e){if(e==null||e===!1||e===!0)return[];if(P(e)){let t=e,{templateEl:n,parts:r}=Bt(t),o=n.content.cloneNode(!0),s=r.map(i=>qt(i,o));for(let i=0;i<t.values.length;i++)Y(s[i],t.values[i],void 0,t.values);for(let i of s)i.kind==="slot"&&Y(i,void 0,void 0,[]);return[...o.childNodes]}if(Array.isArray(e)){let t=[];for(let n of e)t.push(...ko(n));return t}return[document.createTextNode(String(e))]}function To(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 vo=null;function Ut(e){vo=e||null}function Qi(){return vo||void 0}var No=Symbol.for("webjs:registry"),jo=Symbol.for("webjs:classToTag"),Ht=globalThis,J=Ht[No]||(Ht[No]=new Map),Ro=Ht[jo]||(Ht[jo]=new WeakMap),Wt=typeof window<"u"&&typeof customElements<"u";function Xn(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=J.get(e);r?(r.cls=t,r.lazy=n):J.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),Ro.set(t,e)}if(Wt){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),Xn(t,n)}}if(!Wt){let e=globalThis;e.customElements||(e.customElements={define(t,n){Xn(t,n)},get(t){return J.get(t)?.cls},upgrade(){},whenDefined(t){let n=J.get(t);return Promise.resolve(n?.cls)}})}function Zn(e,t){Wt?customElements.define(e,t):Xn(e,t)}function ea(e,t){if(Wt)return;let n=J.get(e);if(n){n.moduleUrl=t;return}J.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e})}function Qn(e){return J.get(e)?.cls}function ta(e){return J.get(e)?.moduleUrl||null}function na(e){return J.get(e)?.lazy===!0}function zt(e){return Ro.get(e)}function er(){return[...J.keys()]}ze();$t();var Do=typeof window<"u"&&typeof HTMLElement<"u";function ma(e,t){return e!==t}function ba(){return{states:new Set,shadowRoot:null,form:null,labels:[],role:"",willValidate:!0,validity:{},validationMessage:"",setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0}}}var Vt=class{constructor(){this.__ssrAttrs=new Map,this.__internals=null}get attributes(){return[...this.__ssrAttrs].map(([t,n])=>({name:t,value:n}))}getAttribute(t){let n=this.__ssrAttrs.get(String(t).toLowerCase());return n===void 0?null:n}setAttribute(t,n){this.__ssrAttrs.set(String(t).toLowerCase(),String(n))}removeAttribute(t){this.__ssrAttrs.delete(String(t).toLowerCase())}hasAttribute(t){return this.__ssrAttrs.has(String(t).toLowerCase())}toggleAttribute(t,n){let r=String(t).toLowerCase(),o=this.__ssrAttrs.has(r);return(n===void 0?!o:n)?(this.__ssrAttrs.set(r,""),!0):(this.__ssrAttrs.delete(r),!1)}getAttributeNames(){return[...this.__ssrAttrs.keys()]}closest(t){let n=String(t).trim().toLowerCase();if(!/^[a-z][a-z0-9-]*$/.test(n))return null;if(this.__ssrTag===n)return this;let r=this.__ssrAncestors;if(!Array.isArray(r))return null;for(let o=r.length-1;o>=0;o--)if(r[o]&&r[o].__ssrTag===n)return r[o];return null}get dataset(){if(this.__dataset)return this.__dataset;let t=this,n=r=>"data-"+String(r).replace(/[A-Z]/g,o=>"-"+o.toLowerCase());return this.__dataset=new Proxy({},{get(r,o){if(typeof o!="string")return;let s=t.getAttribute(n(o));return s===null?void 0:s},set(r,o,s){return typeof o=="string"&&t.setAttribute(n(o),s),!0},has(r,o){return typeof o=="string"&&t.hasAttribute(n(o))},deleteProperty(r,o){return typeof o=="string"&&t.removeAttribute(n(o)),!0},ownKeys(){return t.getAttributeNames().filter(r=>r.startsWith("data-")).map(r=>r.slice(5).replace(/-([a-z])/g,(o,s)=>s.toUpperCase()))},getOwnPropertyDescriptor(r,o){if(typeof o=="string"&&t.hasAttribute(n(o)))return{enumerable:!0,configurable:!0,value:t.getAttribute(n(o))}}}),this.__dataset}get className(){return this.getAttribute("class")??""}set className(t){this.setAttribute("class",t)}get hidden(){return this.hasAttribute("hidden")}set hidden(t){this.toggleAttribute("hidden",!!t)}get id(){return this.getAttribute("id")??""}set id(t){this.setAttribute("id",t)}get title(){return this.getAttribute("title")??""}set title(t){this.setAttribute("title",t)}get slot(){return this.getAttribute("slot")??""}set slot(t){this.setAttribute("slot",t)}get role(){return this.getAttribute("role")}set role(t){t==null?this.removeAttribute("role"):this.setAttribute("role",t)}get tabIndex(){let t=this.getAttribute("tabindex");return t===null?-1:Number.parseInt(t,10)||0}set tabIndex(t){this.setAttribute("tabindex",String(t))}addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return this.__internals=ba(),this.__internals}},ga=["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 ga){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(Vt.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}var ya=Do?HTMLElement:Vt,Fo=Symbol("webjs.factoryProps"),Po=new WeakSet,Ve=class e extends ya{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){Zn(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||tr(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(Po.has(t))return;let n=t;for(;n&&n!==e;){if(Object.hasOwn(n,"properties")&&!Object.hasOwn(n,Fo)){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://webjs.dev/docs/components.`)}n=Object.getPrototypeOf(n)}Po.add(t)}_initializeProperties(){let n=this.constructor.properties;if(!(!n||typeof n!="object")){this.__propValues={};for(let[r,o]of Object.entries(n)){let s=typeof o=="object"?o:{type:o},i=this[r];Object.defineProperty(this,r,{configurable:!0,enumerable:!0,get:()=>this.__propValues[r],set:a=>{let c=this.__propValues[r];(s.hasChanged||ma)(a,c)&&(this.__propValues[r]=a,s.reflect&&!s.state&&this._connected&&this._reflectAttribute(r,a,s),this.requestUpdate(r,c))}}),i!==void 0?this.__propValues[r]=i:s.default!==void 0&&(this.__propValues[r]=typeof s.default=="function"?s.default():s.default)}}}_reflectAttribute(t,n,r){let o=r.attribute||tr(t);if(!this.__reflectingAttribute){this.__reflectingAttribute=!0;try{if(r.converter&&r.converter.toAttribute){let s=r.converter.toAttribute(n,r.type);s==null?this.removeAttribute(o):this.setAttribute(o,s)}else r.type===Boolean?n?this.setAttribute(o,""):this.removeAttribute(o):n==null?this.removeAttribute(o):r.type===Object||r.type===Array?this.setAttribute(o,JSON.stringify(n)):this.setAttribute(o,String(n))}finally{this.__reflectingAttribute=!1}}}connectedCallback(){if(!Do)return;if(this.__webjsPropsHydrated||(this.__webjsPropsHydrated=!0,this._hydratePropAttrs()),this.constructor.hydrate==="visible"&&typeof IntersectionObserver<"u"&&!this.__hydrationActivated){this.__hydrationActivated=!1,this.__hydrationObserver=new IntersectionObserver(n=>{for(let r of n)if(r.isIntersecting){this.__hydrationObserver.unobserve(this),this.__hydrationObserver.disconnect(),this.__hydrationObserver=null,this.__hydrationActivated=!0,this._activate();return}},{rootMargin:"200px"}),this.__hydrationObserver.observe(this);return}this._activate()}_hydratePropAttrs(){let t=[],n=this.attributes;for(let r=0;r<n.length;r++){let o=n[r].name;o.startsWith("data-webjs-prop-")&&t.push(o)}for(let r of t){let o=this.getAttribute(r);if(this.removeAttribute(r),o==null)continue;let s=$o(r.slice(16));try{this[s]=ne(o)}catch(i){console.warn(`[webjs] failed to decode ${r} on <${this.tagName.toLowerCase()}>: ${i&&i.message}`)}}}_activate(){this._connected=!0,this._reflectDeclaredAttributes();let t=this.constructor;if(t.shadow!==!0&&!this.hasAttribute("data-wj-host")&&this.setAttribute("data-wj-host",""),t.shadow===!0){let n=!!this.shadowRoot;this.shadowRoot||this.attachShadow({mode:"open"}),this._renderRoot=this.shadowRoot;let r=t.styles,o=Array.isArray(r)?r:je(r)?[r]:[];if(o.length){if(n){let s=this.shadowRoot.querySelector("style");s&&s.remove()}En(this._renderRoot,o)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${zt(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().`),Kn(this)?fo(this):this.__isHydrating()||this.hasAttribute("data-wj-serialized")||bo(this)?(this.removeAttribute("data-wj-serialized"),ee(this),no(this)):to(this),mo(this),co(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)}})}__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),uo(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 s=this.constructor.properties||{},i,a;for(let[f,u]of Object.entries(s))if(((typeof u=="object"?u:{type:u}).attribute||tr(f))===t){i=f,a=u;break}if(a===void 0&&(i=$o(t),a=s[i]||s[t]),a===void 0)return;let c=typeof a=="object"?a:{type:a},l;if(c.converter&&c.converter.fromAttribute)l=c.converter.fromAttribute(r,c.type);else if(c.type===Number)l=r==null?null:Number(r);else if(c.type===Boolean)l=r!=null&&r!=="false";else if(c.type===Object||c.type===Array)try{l=r==null?null:JSON.parse(r)}catch{l=r}else l=r;this[i]!==l&&(this[i]=l,this._connected&&this.requestUpdate())}requestUpdate(t,n){t!==void 0&&!this._changedProperties.has(t)&&this._changedProperties.set(t,n),this._scheduleUpdate()}_scheduleUpdate(){this._updateResolve===null&&(this._updatePromise=new Promise(t=>{this._updateResolve=t})),!this._isUpdating&&(this._scheduled||!this._connected||(this._scheduled=!0,queueMicrotask(()=>{this._scheduled=!1;try{this._performRender()}catch(t){console.error("[webjs] lifecycle hook threw during update cycle:",t)}})))}_performRender(){if(!this._renderRoot)return;let t=this._changedProperties;this._isUpdating=!0;let n=!1,r=null;try{if(this.shouldUpdate(t)){this.willUpdate(t);for(let o of this.__controllers)o.hostUpdate&&o.hostUpdate();this.__renderToken=(this.__renderToken||0)+1,this.__renderAbort&&this.__renderAbort.abort(),this.__renderAbort=typeof AbortController<"u"?new AbortController:null,Ut(this.__renderAbort?this.__renderAbort.signal:null);try{let o=this.update(t);o&&typeof o.then=="function"&&(r=o)}catch(o){this._handleRenderError(o)}finally{Ut(null)}if(!r){for(let o of this.__controllers)o.hostUpdated&&o.hostUpdated();n=!0}}}catch(o){console.error("[webjs] lifecycle hook threw during update phase:",o)}finally{this._isUpdating=!1,(n||r)&&(this._changedProperties=new Map)}if(r){let o=this.__renderToken;this.__pendingAsyncCommits=(this.__pendingAsyncCommits||0)+1,r.then(()=>{if(this.__pendingAsyncCommits--,o===this.__renderToken){for(let s of this.__controllers)s.hostUpdated&&s.hostUpdated();this._postCommit(t)}});return}n?this._postCommit(t):this.__pendingAsyncCommits||this._resolveUpdate()}_resolveUpdate(){if(this._updateResolve){let t=this._changedProperties.size===0;this._updateResolve(t),this._updateResolve=null}}performServerUpdate(){let t=this._changedProperties;this._isUpdating=!0;try{this.willUpdate(t);for(let n of this.__controllers)n.hostUpdate&&n.hostUpdate();this._reflectDeclaredAttributes()}finally{this._isUpdating=!1}}_reflectDeclaredAttributes(){let t=this.constructor.properties||{};for(let n of Object.keys(t)){let r=t[n];!r||!r.reflect||r.state||this._reflectAttribute(n,this[n],r)}}shouldUpdate(t){return!0}willUpdate(t){}update(t){this.__signalWatcher||(this.__signalWatcher=new st.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n;if(this.__signalWatcher.observe(()=>{n=this.render()}),n&&typeof n.then=="function")return this._commitAsync(n);We(n,this._renderRoot)}_commitAsync(t){let n=this.__renderToken;if(this.__firstRendered&&this._overridesRenderFallback())try{let r=this.renderFallback();r!==void 0&&We(r,this._renderRoot)}catch(r){console.error("[webjs] renderFallback() threw:",r)}return Promise.resolve(t).then(r=>{n===this.__renderToken&&We(r,this._renderRoot)},r=>{n===this.__renderToken&&this._handleRenderError(r instanceof Error?r:new Error(String(r)))})}_overridesRenderFallback(){return this.renderFallback!==Kt.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${zt(this.constructor)||this.tagName?.toLowerCase()}>:`,t);try{let n=this.renderError(t);n!==void 0&&We(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 tr(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function $o(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Kt(e){return new.target?Reflect.construct(Ve,arguments,new.target):class extends Ve{static properties=e;static[Fo]=!0}}Object.setPrototypeOf(Kt,Ve);Kt.prototype=Ve.prototype;function wa(e,t={}){return e&&typeof e=="object"&&!("call"in e)&&(t=e,e=void 0),{...e?{type:e}:{},...t}}var Ul=Symbol.for("webjs.suspense");function _a(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function Gt(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}ze();var nr=null;function Sa(e){nr=e}function rr(){if(!nr)return"";try{return nr()||""}catch{return""}}async function Aa(e,t={ssr:!0}){let n=t&&t.suspenseCtx,r=t&&t.dev!==void 0?t.dev:n&&n.dev;n&&n.dev===void 0&&r!==void 0&&(n.dev=r);let o=await R(e,n);return t&&t.ssr===!1?o:await fe(o,n,[],r)}async function R(e,t){if(e==null||e===!1||e===!0)return"";if(e&&typeof e.then=="function")return e=await e,R(e,t);if(Oe(e))return String(e.value??"");if(Le(e))return R(e.value,t);if(_e(e))return R(e.signal.get(),t);if(me(e))return R(e.value,t);if(be(e))return R(e.fn(),t);if(Me(e)){let n=e.template;return String(n?.innerHTML??"")}if(ge(e))return"";if(ye(e))return R(e.value,t);if(we(e)){let n=e.args;for(let r of n)if(!r||typeof r.then!="function")return R(r,t);if(n.length>0)try{let r=await Promise.race(n.map(o=>Promise.resolve(o).catch(()=>{})));return R(r,t)}catch{return""}return""}if(Ie(e)||Pe(e))return"";if(Array.isArray(e))return(await Promise.all(e.map(r=>R(r,t)))).join("");if(he(e)){let n=e;return(await Promise.all(n.items.map((o,s)=>R(n.templateFn(o,s),t)))).join("")}if(Gt(e)){let n=e,r=await R(n.fallback,t);if(t){let o=`s${t.nextId++}`;return t.pending.push({id:o,promise:Promise.resolve(n.children)}),`<webjs-boundary id="${o}">${r}</webjs-boundary>`}return r}return P(e)?Ea(e,t):xt(String(e))}async function Ea(e,t){let{strings:n,values:r}=e,o="",s="text",i="",a=0,c="",l=0,f="",u="";for(let d=0;d<n.length;d++){let p=n[d];for(let g=0;g<p.length;g++){let b=p[g];switch(s){case"text":o+=b,b==="<"&&(s="tag-open");break;case"tag-open":o+=b,b==="!"?s="bang-1":b==="/"?(s="tag-name",f=""):/[a-zA-Z]/.test(b)?(s="tag-name",f=b.toLowerCase()):s="text";break;case"bang-1":o+=b,s=b==="-"?"bang-dash":"tag-name";break;case"bang-dash":o+=b,b==="-"?(s="comment",l=0):s="tag-name";break;case"comment":o+=b,b==="-"?l+=1:(b===">"&&l>=2&&(s="text"),l=0);break;case"tag-name":o+=b,b===">"?(s=Yt(f)?"rawtext":"text",s==="rawtext"&&(u="")):/\s/.test(b)?s="in-tag":f+=b.toLowerCase();break;case"in-tag":o+=b,b===">"?(s=Yt(f)?"rawtext":"text",s==="rawtext"&&(u="")):!/\s/.test(b)&&b!=="/"&&(s="attr-name",i=b,a=o.length-1);break;case"rawtext":o+=b,u=(u+b.toLowerCase()).slice(-9),(u.endsWith("<\/script>")||u.endsWith("</style>"))&&(s="text",u="",f="");break;case"attr-name":b==="="?(s="after-eq",o+=b):/\s/.test(b)?(s="in-tag",i="",o+=b):b===">"?(s="text",i="",o+=b):(i+=b,o+=b);break;case"after-eq":b==='"'||b==="'"?(s="attr-quoted",c=b,o+=b):/\s/.test(b)?(s="in-tag",i="",o+=b):b===">"?(s="text",i="",o+=b):(s="attr-unquoted",o+=b);break;case"attr-unquoted":/\s/.test(b)?(s="in-tag",i="",o+=b):(b===">"&&(s="text",i=""),o+=b);break;case"attr-quoted":o+=b,b===c&&(s="in-tag",i="");break}}if(d<r.length){let g=r[d];if(g&&typeof g.then=="function"&&(g=await g),s==="comment")o+=String(g??""),l=0;else if(s==="rawtext")o+=String(g??""),u="";else if(s==="text")o+=await R(g,t);else if(s==="after-eq"){let b=i[0],m=i.slice(1),h=Re[b];if(h==="event")o=o.slice(0,a),s="in-tag",i="";else if(h==="prop"){if(o=o.slice(0,a),f==="webjs-suspense"&&m==="fallback"){let y=await R(g,t);o+=`data-webjs-fallback="${H(y)}"`,s="in-tag",i="";continue}if(!f.includes("-")){s="in-tag",i="";continue}if(g===void 0){s="in-tag",i="";continue}try{let y=await dt(g);o+=`data-webjs-prop-${Da(m)}="${H(y)}"`}catch(y){console.warn(`[webjs] property binding .${m} has an unserializable value during SSR. Dropping. The browser will see the property as undefined. Detail: ${y&&y.message}`)}s="in-tag",i=""}else h==="bool"?(o=o.slice(0,a),g&&(o+=`${m}=""`),s="in-tag",i=""):(o+=`"${H(String(g??""))}"`,s="in-tag",i="")}else(s==="attr-quoted"||s==="attr-unquoted")&&(o+=H(String(g??"")))}}return o}var xa=new Set(["document","window","localStorage","sessionStorage","navigator","matchMedia","requestAnimationFrame","getComputedStyle","IntersectionObserver","MutationObserver","ResizeObserver"]),Ca=new Set(["attachShadow","querySelector","querySelectorAll","getBoundingClientRect","focus","blur","scrollIntoView"]);function ka(e){let t=e&&typeof e.message=="string"?e.message:"",n=/^(\w+) is not defined\b/.exec(t);return e instanceof ReferenceError&&n&&xa.has(n[1])?`\`${n[1]}\` is a browser-only global and is undefined during SSR.`:(n=/\.(\w+) is not a function\b/.exec(t),e instanceof TypeError&&n&&Ca.has(n[1])?`\`${n[1]}\` is an HTMLElement method that does not exist on the server-side component instance during SSR.`:null)}function Ta(){return typeof process<"u"&&process.env&&!0}function Ho(e,t,n){if(!(n===void 0?!Ta():!!n))return"";let o=t&&t.message?t.message:String(t);return An`<div data-webjs-error="${e}" style="border:1px solid #f5c2c7;background:#f8d7da;color:#842029;padding:8px 12px;border-radius:6px;font:13px/1.4 system-ui,sans-serif">
4
6
  <strong>&lt;${e}&gt; failed to render</strong>
5
7
  <div style="margin-top:4px;white-space:pre-wrap">${o}</div>
6
- </div>`}async function ue(e,t,n=[],r){e=await ka(e,t,n,r);let o=Xn();if(!o.length)return e;let s=[...o].sort((u,d)=>d.length-u.length),i=new RegExp(`<(${s.map(pt).join("|")})(?=[\\s>/])((?:"[^"]*"|'[^']*'|[^>])*?)(/?)>`,"g"),c=[];for(let u of e.matchAll(i)){let[d,p,g,b]=u,m=Jn(p);if(!m)continue;t&&t.usedComponents&&t.usedComponents.add(p);let h=b?`<${p}${g}>`:d,y=null;try{let _=m.shadow===!0;y=new m,y.__ssrTag=p,y.__ssrAncestors=n;let w=$o(g),C=Pa(w),x=new Set(Object.keys($o(g)).map(M=>M.toLowerCase()));Ra(y,w),La(y,w,m);for(let[M,v]of Object.entries(C))y[M]=v;let T="",S=u.index+d.length;if(!b){let M=u.index+d.length,v=ht(e,M,p);if(v!==-1){T=e.slice(M,v);let nt=new RegExp(`</${pt(p)}\\s*>`,"i"),yn=e.slice(v),Pr=nt.exec(yn),Bs=Pr?Pr[0].length:`</${p}>`.length;S=v+Bs}else T=e.slice(M),S=e.length}let E=va(T);typeof y.performServerUpdate=="function"&&y.performServerUpdate();let A=y.render?y.render():"";A&&typeof A.then=="function"&&(A=await A),h=Oa(h,y,x),_||(h=Do(h));let q=await R(A,t);if(_){let M=await ue(q,t,[...n,y],r),v=m.styles,nt=Array.isArray(v)?v:v&&je(v)?[v]:[],yn=Et(nt);c.push({start:u.index,end:u.index+d.length,text:`${h}<template shadowrootmode="open">${yn}${M}</template>`})}else{if(q.trim()===""){c.push({start:u.index,end:u.index+d.length,text:`${h}<!--webjs-hydrate-->`});continue}let v=ja(q,E,p),nt=await ue(v,t,[...n,y],r);c.push({start:u.index,end:S,text:`${h}<!--webjs-hydrate-->${nt}</${p}>`})}}catch(_){let w=Ea(_);console.error(w?`[webjs] SSR failed for <${p}>: ${w} It was touched in the component's constructor or render(), which run during SSR. Move browser-only work to connectedCallback() or a lifecycle hook (firstUpdated/updated), which SSR never calls; seed first-paint defaults in the constructor only from server-known inputs (attributes / props).`:`[webjs] SSR failed for <${p}>:`,_);let C=_ instanceof Error?_:new Error(String(_)),x="";try{let A;y&&typeof y.renderError=="function"&&(A=y.renderError(C)),A===void 0&&(A=Fo(p,C,r)),x=await R(A,t),x.trim()&&(x=await ue(x,t,y?[...n,y]:n,r))}catch(A){console.error(`[webjs] renderError() for <${p}> also threw:`,A),x=""}let T=u.index+d.length;if(!b){let A=u.index+d.length,q=ht(e,A,p);if(q!==-1){let v=new RegExp(`</${pt(p)}\\s*>`,"i").exec(e.slice(q));T=q+(v?v[0].length:`</${p}>`.length)}else T=e.length}let S=m.shadow===!0;S||(h=Do(h));let E;if(S){let A=m.styles,q=Array.isArray(A)?A:A&&je(A)?[A]:[],M=Et(q);E=`${h}<template shadowrootmode="open">${M}${x}</template>`}else E=`${h}<!--webjs-hydrate-->${x}</${p}>`;c.push({start:u.index,end:T,text:E})}}if(!c.length)return e;c.sort((u,d)=>u.start-d.start);let a=[],l=-1;for(let u of c)u.start>=l&&(a.push(u),l=u.end);let f=e;for(let u=a.length-1;u>=0;u--){let{start:d,end:p,text:g}=a[u];f=f.slice(0,d)+g+f.slice(p)}return f}var Ca=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function Ta(e){return Ca.has(e.toLowerCase())}async function ka(e,t,n=[],r){if(e.indexOf("<webjs-suspense")===-1)return e;let o=/<webjs-suspense((?:"[^"]*"|'[^']*'|[^>])*?)>/i,s="",i=e;for(let c=0;c<1e4;c++){let a=o.exec(i);if(!a){s+=i;break}let l=a.index,f=a.index+a[0].length;s+=i.slice(0,l);let u=a[1]||"",d=/data-webjs-fallback="([^"]*)"/i.exec(u),p=d?Jt(d[1]):"",g=ht(i,f,"webjs-suspense"),b,m;if(g===-1)b=i.slice(f),m="";else{b=i.slice(f,g);let h=/<\/webjs-suspense\s*>/i.exec(i.slice(g));m=i.slice(g+(h?h[0].length:17))}if(t){let h=`s${t.nextId++}`;t.pending.push({id:h,promise:Promise.resolve(Sn(b))}),s+=`<webjs-suspense id="${h}">${p}</webjs-suspense>`}else{let h=await ue(b,t,n,r);s+=`<webjs-suspense>${h}</webjs-suspense>`}i=m}return s}function ht(e,t,n){let r=pt(n),o=new RegExp(`<${r}(?:[\\s>/])`,"gi"),s=new RegExp(`</${r}\\s*>`,"gi");o.lastIndex=t,s.lastIndex=t;let i=1;for(;i>0;){let c=o.exec(e),a=s.exec(e);if(!a)return-1;if(c&&c.index<a.index)i++,s.lastIndex=c.index+1;else{if(i--,i===0)return a.index;o.lastIndex=a.index+1}}return-1}function Na(e){let t=/\bslot\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(e);if(!t)return null;let n=t[1]??t[2]??t[3]??"";return n===""||n==="default"?null:n}function va(e){let t=new Map,n="",r=0;for(;r<e.length;){let o=e.indexOf("<",r);if(o===-1){n+=e.slice(r);break}o>r&&(n+=e.slice(r,o));let s=e.slice(o);if(s.startsWith("<!--")){let m=e.indexOf("-->",o+4);if(m===-1){n+=s,r=e.length;break}n+=e.slice(o,m+3),r=m+3;continue}if(s.startsWith("<!")||s.startsWith("</")){let m=e.indexOf(">",o);if(m===-1){n+=s,r=e.length;break}n+=e.slice(o,m+1),r=m+1;continue}let i=/^<([a-zA-Z][\w-]*)((?:"[^"]*"|'[^']*'|[^>])*?)(\/?)>/.exec(s);if(!i){n+="<",r=o+1;continue}let[c,a,l,f]=i,u=a.toLowerCase(),d=!!f||Ta(u),p=Na(l),g;if(d)g=o+c.length;else{let m=o+c.length,h=ht(e,m,u);if(h===-1){let x=e.slice(o);p!==null?Po(t,p,x):n+=x,r=e.length;continue}let y=new RegExp(`</${pt(u)}\\s*>`,"i"),_=e.slice(h),w=y.exec(_),C=w?w[0].length:`</${u}>`.length;g=h+C}let b=e.slice(o,g);p!==null?Po(t,p,b):n+=b,r=g}return n.length>0&&t.set(null,n),t}function Po(e,t,n){let r=e.get(t);r!==void 0?e.set(t,r+n):e.set(t,n)}function ja(e,t,n){let r=n?` data-wj-slot-owner="${H(n)}"`:"",o=new Set,s="",i=0,c=/<slot((?:"[^"]*"|'[^']*'|[^>])*?)(\/?)>/gi,a;for(;(a=c.exec(e))!==null;){s+=e.slice(i,a.index);let[l,f,u]=a,d=!!u,p=/\bname\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(f),g=p?p[1]??p[2]??p[3]:null,b=f.replace(/\bname\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,"").trim(),m="",h;if(d)h=a.index+l.length;else{let x=a.index+l.length,T=ht(e,x,"slot");if(T===-1)m=e.slice(x),h=e.length;else{m=e.slice(x,T);let S=/<\/slot\s*>/i,E=e.slice(T),A=S.exec(E),q=A?A[0].length:7;h=T+q}}let y=g==="default"||g===""?null:g,_=t.get(y),w=g!==null?` name="${H(g)}"`:"",C=b?` ${b}`:"";_!==void 0&&!o.has(y)?(o.add(y),s+=`<slot data-webjs-light data-projection="actual"${r}${w}${C}>${_}</slot>`):s+=`<slot data-webjs-light data-projection="fallback"${r}${w}${C}>${m}</slot>`,i=h,c.lastIndex=h}return s+=e.slice(i),s}function pt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Yt(e){return e==="script"||e==="style"}function $o(e){let t={},n=/([a-zA-Z_:][\w:.-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g,r;for(;(r=n.exec(e))!==null;)t[r[1]]=r[2]??r[3]??r[4]??"";return t}function Ra(e,t){if(!(!e||typeof e.setAttribute!="function"))for(let[n,r]of Object.entries(t))e.setAttribute(n,Jt(r))}function Do(e){return/\sdata-wj-host(?=[\s>=])/i.test(e)?e:`${e.slice(0,-1)} data-wj-host>`}function Oa(e,t,n){if(!t||typeof t.getAttributeNames!="function")return e;let r="";for(let o of t.getAttributeNames()){let s=String(o).toLowerCase();if(n.has(s))continue;let i=t.getAttribute(o);r+=i===""?` ${s}`:` ${s}="${H(String(i))}"`}return r?`${e.slice(0,-1)}${r}>`:e}function La(e,t,n){let r=n.properties||{};for(let[o,s]of Object.entries(t)){let i,c;for(let[l,f]of Object.entries(r))if(((typeof f=="object"?f:{type:f}).attribute||Ia(l))===o){i=l,c=f;break}if(c===void 0&&(c=r[o]||r[tr(o)],i=r[o]?o:tr(o)),!c){e[i]=s;continue}let a=typeof c=="object"?c:{type:c};if(a.type===Number)e[i]=Number(s);else if(a.type===Boolean)e[i]=s!=="false";else if(a.type===Object||a.type===Array)try{e[i]=JSON.parse(Jt(s))}catch{e[i]=s}else e[i]=s}}function tr(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Ia(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Ma(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Jt(e){return e.replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&amp;/g,"&")}function Pa(e){let t={};for(let n of Object.keys(e)){if(!n.startsWith("data-webjs-prop-"))continue;let r=tr(n.slice(16));try{t[r]=ne(Jt(e[n]))}catch{}delete e[n]}return t}function $a(e,t={ssr:!0}){let n=t&&t.suspenseCtx,r=t&&t.dev!==void 0?t.dev:n&&n.dev;return n&&n.dev===void 0&&r!==void 0&&(n.dev=r),new ReadableStream({async start(o){try{if(t&&t.ssr===!1)await B(e,n,o);else{let s=await R(e,n),i=await ue(s,n,[],r);o.enqueue(i)}n&&n.pending.length&&await Fa(n,o,r),o.close()}catch(s){o.error(s)}}})}async function B(e,t,n){if(!(e==null||e===!1||e===!0)){if(e&&typeof e.then=="function")return e=await e,B(e,t,n);if(Oe(e)){n.enqueue(String(e.value??""));return}if(Le(e))return B(e.value,t,n);if(we(e))return B(e.signal.get(),t,n);if(he(e))return B(e.value,t,n);if(me(e))return B(e.fn(),t,n);if(Ie(e)){let r=e.template;n.enqueue(String(r?.innerHTML??""));return}if(!be(e)){if(ge(e))return B(e.value,t,n);if(ye(e)){let r=e.args;for(let o of r)if(!o||typeof o.then!="function")return B(o,t,n);if(r.length>0)try{let o=await Promise.race(r.map(s=>Promise.resolve(s).catch(()=>{})));return B(o,t,n)}catch{return}return}if(!(Me(e)||Pe(e))){if(Array.isArray(e)){for(let r of e)await B(r,t,n);return}if(pe(e)){let r=e;for(let o=0;o<r.items.length;o++)await B(r.templateFn(r.items[o],o),t,n);return}if(Gt(e)){let r=e;if(t){let o=`s${t.nextId++}`;n.enqueue(`<webjs-boundary id="${o}">`),await B(r.fallback,t,n),n.enqueue("</webjs-boundary>"),t.pending.push({id:o,promise:Promise.resolve(r.children)})}else await B(r.fallback,t,n);return}if(P(e)){await Da(e,t,n);return}n.enqueue(xt(String(e)))}}}}async function Da(e,t,n){let{strings:r,values:o}=e,s="text",i="",c=0,a="",l=0,f="",u="",d="";for(let p=0;p<r.length;p++){let g=r[p];for(let b=0;b<g.length;b++){let m=g[b];switch(s){case"text":d+=m,m==="<"&&(s="tag-open");break;case"tag-open":d+=m,m==="!"?s="bang-1":m==="/"?(s="tag-name",f=""):/[a-zA-Z]/.test(m)?(s="tag-name",f=m.toLowerCase()):s="text";break;case"bang-1":d+=m,s=m==="-"?"bang-dash":"tag-name";break;case"bang-dash":d+=m,m==="-"?(s="comment",l=0):s="tag-name";break;case"comment":d+=m,m==="-"?l+=1:(m===">"&&l>=2&&(s="text"),l=0);break;case"tag-name":d+=m,m===">"?(s=Yt(f)?"rawtext":"text",s==="rawtext"&&(u="")):/\s/.test(m)?s="in-tag":f+=m.toLowerCase();break;case"in-tag":d+=m,m===">"?(s=Yt(f)?"rawtext":"text",s==="rawtext"&&(u="")):!/\s/.test(m)&&m!=="/"&&(s="attr-name",i=m,c=d.length-1);break;case"rawtext":d+=m,u=(u+m.toLowerCase()).slice(-9),(u.endsWith("<\/script>")||u.endsWith("</style>"))&&(s="text",u="",f="");break;case"attr-name":m==="="?(s="after-eq",d+=m):/\s/.test(m)?(s="in-tag",i="",d+=m):m===">"?(s="text",i="",d+=m):(i+=m,d+=m);break;case"after-eq":m==='"'||m==="'"?(s="attr-quoted",a=m,d+=m):/\s/.test(m)?(s="in-tag",i="",d+=m):m===">"?(s="text",i="",d+=m):(s="attr-unquoted",d+=m);break;case"attr-unquoted":/\s/.test(m)?(s="in-tag",i="",d+=m):(m===">"&&(s="text",i=""),d+=m);break;case"attr-quoted":d+=m,m===a&&(s="in-tag",i="");break}}if(p<o.length){let b=o[p];if(b&&typeof b.then=="function"&&(b=await b),s==="comment")d+=String(b??""),l=0;else if(s==="rawtext")d+=String(b??""),u="";else if(s==="text")d&&(n.enqueue(d),d=""),await B(b,t,n);else if(s==="after-eq"){let m=i[0],h=i.slice(1),y=Re[m];y==="event"||y==="prop"?(d=d.slice(0,c),s="in-tag",i=""):y==="bool"?(d=d.slice(0,c),b&&(d+=`${h}=""`),s="in-tag",i=""):(d+=`"${H(String(b??""))}"`,s="in-tag",i="")}else(s==="attr-quoted"||s==="attr-unquoted")&&(d+=H(String(b??"")))}}d&&n.enqueue(d)}async function Fa(e,t,n){let r=er(),o=r?` nonce="${H(r)}"`:"";for(;e.pending.length;){let s=e.pending.splice(0);await Promise.all(s.map(async({id:i,promise:c})=>{try{let a=await c,l=await R(a,e),f=await ue(l,e,[],n);t.enqueue(`<template data-webjs-resolve="${i}">${f}</template><script${o}>(function(){var t=document.currentScript.previousElementSibling;var b=document.getElementById("${i}");if(b&&t){b.replaceWith(t.content.cloneNode(true));t.remove()}document.currentScript.remove()})()<\/script>`)}catch(a){console.error(`[webjs] Suspense boundary "${i}" rejected:`,a);try{let l=a instanceof Error?a:new Error(String(a)),f=await ue(await R(Fo("webjs-suspense",l,n),e),e,[],n);t.enqueue(`<template data-webjs-resolve="${i}">${f}</template><script${o}>(function(){var t=document.currentScript.previousElementSibling;var b=document.getElementById("${i}");if(b&&t){b.replaceWith(t.content.cloneNode(true));t.remove()}document.currentScript.remove()})()<\/script>`)}catch(l){console.error(`[webjs] Suspense boundary "${i}" error render also threw:`,l)}}}))}}var Bo=Symbol.for("webjs.notFound"),Uo=Symbol.for("webjs.redirect"),qo=Symbol.for("webjs.forbidden"),Ho=Symbol.for("webjs.unauthorized");function Ba(){let e=new Error("webjs: notFound()");throw e.__webjs=Bo,e}function Ua(){let e=new Error("webjs: forbidden()");throw e.__webjs=qo,e}function qa(){let e=new Error("webjs: unauthorized()");throw e.__webjs=Ho,e}function Ha(e,t){let n=typeof t=="object"&&t!==null?t.status:t,r=new Error(`webjs: redirect(${e})`);throw r.__webjs=Uo,r.url=e,r.status=typeof n=="number"?n:void 0,r}function Wa(e){return!!e&&e.__webjs===Bo}function za(e){return!!e&&e.__webjs===Uo}function Va(e){return!!e&&e.__webjs===qo}function Ka(e){return!!e&&e.__webjs===Ho}function Ga(e,t={}){let n=t.reconnect!==!1,r=0,o=!1,s=null,i=[];function c(){o||(s=new WebSocket(Ya(e),t.protocols),s.onopen=a=>{for(r=0;i.length&&s&&s.readyState===WebSocket.OPEN;)s.send(i.shift());t.onOpen?.(a)},s.onmessage=a=>{let l=a.data;if(typeof l=="string")try{l=JSON.parse(l)}catch{}t.onMessage?.(l,a)},s.onerror=a=>{t.onError?.(a)},s.onclose=a=>{if(t.onClose?.(a),!o&&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);s&&s.readyState===WebSocket.OPEN?s.send(l):i.push(l)},close(a,l){o=!0;try{s?.close(a,l)}catch{}},get socket(){return s},get readyState(){return s?.readyState??3}}}function Ya(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}`}ze();var nr="application/vnd.webjs+json";async function Ja(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",nr);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 dt(r),n.has("content-type")||n.set("content-type",nr));let o=await fetch(e,{...t,headers:n,body:r}),s=o.headers.get("content-type")||"",i=await o.text(),c=s.includes(nr)?i?ne(i):null:s.includes("application/json")?i?JSON.parse(i):null:i;if(!o.ok){let a=c&&c.error||`richFetch ${e} -> ${o.status}`,l=new Error(a);throw l.status=o.status,l.body=c,l}return c}ze();ir();sr();Zt();var Or=class{constructor(t,n){this.host=t,this.options=n,this.updates=[],this._nextId=0}get value(){let t=this.options.source();if(!this.options.update)return this.updates.length>0?this.updates[this.updates.length-1].payload:t;for(let n of this.updates)t=this.options.update(t,n.payload);return t}add(t,n){let r=`opt-${++this._nextId}`;this.updates.push({id:r,payload:t}),this.host?.requestUpdate?.();let o=()=>{let s=this.updates.findIndex(i=>i.id===r);s!==-1&&(this.updates.splice(s,1),this.host?.requestUpdate?.())};return n&&typeof n.then=="function"&&(typeof n.finally=="function"?n.finally(()=>o()).catch(()=>{}):n.then(()=>o(),()=>o())),o}};async function Uc(e,t,n){let r=e.get();e.set(t);let o;try{o=await n()}catch(s){throw e.set(r),s}return o&&o.success===!1&&e.set(r),o}function qc(e,t,n){return e&&typeof e.get=="function"&&typeof e.set=="function"?Uc(e,t,n):new Or(e,t)}lr();var bn=0,Ds=new Map,tt=new Map,Hc=1e3;function Wc(e){if(!(!Array.isArray(e)||!e.length)){bn+=1;for(let t of e)t&&Ds.set(t,bn)}}function zc(){return bn}function Vc(e,t,n){if(!(!Array.isArray(t)||!t.length)&&(tt.delete(e),tt.set(e,{tags:t.slice(),since:typeof n=="number"?n:bn}),tt.size>Hc)){let r=tt.keys().next().value;r!==void 0&&tt.delete(r)}}function Kc(e){let t=tt.get(e);if(!t)return!1;for(let n of t.tags)if((Ds.get(n)||0)>t.since)return!0;return!1}function Gc(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}var Yc="application/vnd.webjs+stream",Jc=1,Xc=2,Zc=3,Fs=new Uint8Array(0);function Qc(e,t){let n=t||Fs,r=n.length,o=new Uint8Array(5+r);return o[0]=e&255,o[1]=r>>>24&255,o[2]=r>>>16&255,o[3]=r>>>8&255,o[4]=r&255,r&&o.set(n,5),o}function el(){let e=Fs;return{push(t){if(t&&t.length){let r=new Uint8Array(e.length+t.length);r.set(e,0),r.set(t,e.length),e=r}let n=[];for(;e.length>=5;){let r=e[0],o=(e[1]<<24|e[2]<<16|e[3]<<8|e[4])>>>0;if(e.length<5+o)break;let s=e.slice(5,5+o);n.push({type:r,payload:s}),e=e.slice(5+o)}return n}}}var tl=Symbol.for("webjs.context");function nl(e){return{__context__:tl,name:e}}var gn=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},Lr=class{constructor(t,{context:n,initialValue:r}){this._host=t,this._context=n,this._value=r,this._subscriptions=new Set,this._onRequest=o=>{let s=o;if(s.context===this._context)if(o.stopPropagation(),s.subscribe){let i={callback:s.callback},c=()=>{this._subscriptions.delete(i)};this._subscriptions.add(i),s.callback(this._value,c)}else s.callback(this._value)},typeof t.addController=="function"&&t.addController(this)}get value(){return this._value}setValue(t){if(!Object.is(this._value,t)){this._value=t;for(let n of this._subscriptions){let r=()=>{this._subscriptions.delete(n)};n.callback(t,r)}}}hostConnected(){this._host.addEventListener("context-request",this._onRequest)}hostDisconnected(){this._host.removeEventListener("context-request",this._onRequest),this._subscriptions.clear()}},Ir=class{constructor(t,{context:n,subscribe:r=!0}){this._host=t,this._context=n,this._subscribe=r,this._value=void 0,this._unsubscribe=void 0,typeof t.addController=="function"&&t.addController(this)}get value(){return this._value}hostConnected(){this._dispatchRequest()}hostDisconnected(){this._unsubscribe&&(this._unsubscribe(),this._unsubscribe=void 0)}_dispatchRequest(){let t=new gn(this._context,(n,r)=>{let o=this._value;this._value=n,r&&(this._unsubscribe=r),!Object.is(o,n)&&typeof this._host.requestUpdate=="function"&&this._host.requestUpdate()},this._subscribe);this._host.dispatchEvent(t)}};function rl(){return typeof window<"u"}var re={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},Mr=class{constructor(t,{task:n,args:r,autoRun:o=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=o,this._status=re.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=re.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=re.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=re.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 re.INITIAL:return t.initial?.();case re.PENDING:return t.pending?.();case re.COMPLETE:return t.complete?.(this._value);case re.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun||!rl())return;let t=this._argsFn();this._argsEqual(this._prevArgs,t)||this.run()}hostUpdated(){}hostConnected(){}hostDisconnected(){this.abort()}_requestHostUpdate(){typeof this._host.requestUpdate=="function"&&this._host.requestUpdate()}_argsEqual(t,n){if(t===null||t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==n[r])return!1;return!0}};export{Ir as ContextConsumer,Lr as ContextProvider,gn as ContextRequestEvent,Jc as FRAME_CHUNK,Xc as FRAME_END,Zc as FRAME_ERROR,O as MARKER,Qo as SEED_MISS,Yc as STREAM_CONTENT_TYPE,st as Signal,ga as Suspense,Mr as Task,re as TaskStatus,Kt as WebComponent,or as WebjsFrame,ar as WebjsStream,Ji as activeActionSignal,_n as adoptStyles,Xn as allTags,Xs as asyncAppend,Zs as asyncReplace,ci as batch,Ys as cache,ui as computed,Ga as connectWS,Kc as consumeStale,nl as createContext,el as createFrameDecoder,Gs as createRef,er as cspNonce,qs as css,jo as deserialize,os as disableClientRouter,di as effect,_r as enableClientRouter,Qc as encodeFrame,H as escapeAttr,xt as escapeText,zc as fetchMark,Ua as forbidden,zs as guard,wn as html,Me as isAsyncAppend,Pe as isAsyncReplace,je as isCSS,ge as isCache,Va as isForbidden,me as isGuard,he as isKeyed,Qi as isLazy,Le as isLive,Wa as isNotFound,za as isRedirect,be as isRef,pe as isRepeat,fi as isSignal,Gt as isSuspense,P as isTemplate,Ie as isTemplateContent,Ka as isUnauthorized,Oe as isUnsafeHTML,ye as isUntil,we as isWatch,Ws as keyed,Hs as live,Jn as lookup,Zi as lookupModuleUrl,Wc as markStale,ss as navigate,Ba as notFound,qc as optimistic,ne as parse,Gc as parseTagHeader,Xi as primeModuleUrl,ba as prop,Ha as redirect,Ks as ref,Yn as register,Vc as registerKeyTags,We as render,cr as renderStream,$a as renderToStream,wa as renderToString,Br as repeat,is as revalidate,Ja as richFetch,Qt as scanSeeds,vo as serialize,qt as setActiveActionSignal,ya as setCspNonceProvider,li as signal,dt as stringify,Et as stylesToString,zt as tagOf,rc as takeSeed,Vs as templateContent,qa as unauthorized,Sn as unsafeHTML,Js as until,Qs as watch};
8
+ </div>`}async function fe(e,t,n=[],r){e=await ja(e,t,n,r);let o=er();if(!o.length)return e;let s=[...o].sort((u,d)=>d.length-u.length),i=new RegExp(`<(${s.map(pt).join("|")})(?=[\\s>/])((?:"[^"]*"|'[^']*'|[^>])*?)(/?)>`,"g"),a=[];for(let u of e.matchAll(i)){let[d,p,g,b]=u,m=Qn(p);if(!m)continue;t&&t.usedComponents&&t.usedComponents.add(p);let h=b?`<${p}${g}>`:d,y=null;try{let _=m.shadow===!0;y=new m,y.__ssrTag=p,y.__ssrAncestors=n;let w=qo(g),C=Fa(w),x=new Set(Object.keys(qo(g)).map(I=>I.toLowerCase()));Ma(y,w),Pa(y,w,m);for(let[I,N]of Object.entries(C))y[I]=N;let k="",S=u.index+d.length;if(!b){let I=u.index+d.length,N=ht(e,I,p);if(N!==-1){k=e.slice(I,N);let nt=new RegExp(`</${pt(p)}\\s*>`,"i"),Sn=e.slice(N),Br=nt.exec(Sn),Hs=Br?Br[0].length:`</${p}>`.length;S=N+Hs}else k=e.slice(I),S=e.length}let E=Oa(k);typeof y.performServerUpdate=="function"&&y.performServerUpdate();let A=y.render?y.render():"";A&&typeof A.then=="function"&&(A=await A),h=Ia(h,y,x),_||(h=Uo(h));let U=await R(A,t);if(_){let I=await fe(U,t,[...n,y],r),N=m.styles,nt=Array.isArray(N)?N:N&&je(N)?[N]:[],Sn=Et(nt);a.push({start:u.index,end:u.index+d.length,text:`${h}<template shadowrootmode="open">${Sn}${I}</template>`})}else{if(U.trim()===""){a.push({start:u.index,end:u.index+d.length,text:`${h}<!--webjs-hydrate-->`});continue}let N=La(U,E,p),nt=await fe(N,t,[...n,y],r);a.push({start:u.index,end:S,text:`${h}<!--webjs-hydrate-->${nt}</${p}>`})}}catch(_){let w=ka(_);console.error(w?`[webjs] SSR failed for <${p}>: ${w} It was touched in the component's constructor or render(), which run during SSR. Move browser-only work to connectedCallback() or a lifecycle hook (firstUpdated/updated), which SSR never calls; seed first-paint defaults in the constructor only from server-known inputs (attributes / props).`:`[webjs] SSR failed for <${p}>:`,_);let C=_ instanceof Error?_:new Error(String(_)),x="";try{let A;y&&typeof y.renderError=="function"&&(A=y.renderError(C)),A===void 0&&(A=Ho(p,C,r)),x=await R(A,t),x.trim()&&(x=await fe(x,t,y?[...n,y]:n,r))}catch(A){console.error(`[webjs] renderError() for <${p}> also threw:`,A),x=""}let k=u.index+d.length;if(!b){let A=u.index+d.length,U=ht(e,A,p);if(U!==-1){let N=new RegExp(`</${pt(p)}\\s*>`,"i").exec(e.slice(U));k=U+(N?N[0].length:`</${p}>`.length)}else k=e.length}let S=m.shadow===!0;S||(h=Uo(h));let E;if(S){let A=m.styles,U=Array.isArray(A)?A:A&&je(A)?[A]:[],I=Et(U);E=`${h}<template shadowrootmode="open">${I}${x}</template>`}else E=`${h}<!--webjs-hydrate-->${x}</${p}>`;a.push({start:u.index,end:k,text:E})}}if(!a.length)return e;a.sort((u,d)=>u.start-d.start);let c=[],l=-1;for(let u of a)u.start>=l&&(c.push(u),l=u.end);let f=e;for(let u=c.length-1;u>=0;u--){let{start:d,end:p,text:g}=c[u];f=f.slice(0,d)+g+f.slice(p)}return f}var va=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function Na(e){return va.has(e.toLowerCase())}async function ja(e,t,n=[],r){if(e.indexOf("<webjs-suspense")===-1)return e;let o=/<webjs-suspense((?:"[^"]*"|'[^']*'|[^>])*?)>/i,s="",i=e;for(let a=0;a<1e4;a++){let c=o.exec(i);if(!c){s+=i;break}let l=c.index,f=c.index+c[0].length;s+=i.slice(0,l);let u=c[1]||"",d=/data-webjs-fallback="([^"]*)"/i.exec(u),p=d?Jt(d[1]):"",g=ht(i,f,"webjs-suspense"),b,m;if(g===-1)b=i.slice(f),m="";else{b=i.slice(f,g);let h=/<\/webjs-suspense\s*>/i.exec(i.slice(g));m=i.slice(g+(h?h[0].length:17))}if(t){let h=`s${t.nextId++}`;t.pending.push({id:h,promise:Promise.resolve(xn(b))}),s+=`<webjs-suspense id="${h}">${p}</webjs-suspense>`}else{let h=await fe(b,t,n,r);s+=`<webjs-suspense>${h}</webjs-suspense>`}i=m}return s}function ht(e,t,n){let r=pt(n),o=new RegExp(`<${r}(?:[\\s>/])`,"gi"),s=new RegExp(`</${r}\\s*>`,"gi");o.lastIndex=t,s.lastIndex=t;let i=1;for(;i>0;){let a=o.exec(e),c=s.exec(e);if(!c)return-1;if(a&&a.index<c.index)i++,s.lastIndex=a.index+1;else{if(i--,i===0)return c.index;o.lastIndex=c.index+1}}return-1}function Ra(e){let t=/\bslot\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(e);if(!t)return null;let n=t[1]??t[2]??t[3]??"";return n===""||n==="default"?null:n}function Oa(e){let t=new Map,n="",r=0;for(;r<e.length;){let o=e.indexOf("<",r);if(o===-1){n+=e.slice(r);break}o>r&&(n+=e.slice(r,o));let s=e.slice(o);if(s.startsWith("<!--")){let m=e.indexOf("-->",o+4);if(m===-1){n+=s,r=e.length;break}n+=e.slice(o,m+3),r=m+3;continue}if(s.startsWith("<!")||s.startsWith("</")){let m=e.indexOf(">",o);if(m===-1){n+=s,r=e.length;break}n+=e.slice(o,m+1),r=m+1;continue}let i=/^<([a-zA-Z][\w-]*)((?:"[^"]*"|'[^']*'|[^>])*?)(\/?)>/.exec(s);if(!i){n+="<",r=o+1;continue}let[a,c,l,f]=i,u=c.toLowerCase(),d=!!f||Na(u),p=Ra(l),g;if(d)g=o+a.length;else{let m=o+a.length,h=ht(e,m,u);if(h===-1){let x=e.slice(o);p!==null?Bo(t,p,x):n+=x,r=e.length;continue}let y=new RegExp(`</${pt(u)}\\s*>`,"i"),_=e.slice(h),w=y.exec(_),C=w?w[0].length:`</${u}>`.length;g=h+C}let b=e.slice(o,g);p!==null?Bo(t,p,b):n+=b,r=g}return n.length>0&&t.set(null,n),t}function Bo(e,t,n){let r=e.get(t);r!==void 0?e.set(t,r+n):e.set(t,n)}function La(e,t,n){let r=n?` data-wj-slot-owner="${H(n)}"`:"",o=new Set,s="",i=0,a=/<slot((?:"[^"]*"|'[^']*'|[^>])*?)(\/?)>/gi,c;for(;(c=a.exec(e))!==null;){s+=e.slice(i,c.index);let[l,f,u]=c,d=!!u,p=/\bname\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(f),g=p?p[1]??p[2]??p[3]:null,b=f.replace(/\bname\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,"").trim(),m="",h;if(d)h=c.index+l.length;else{let x=c.index+l.length,k=ht(e,x,"slot");if(k===-1)m=e.slice(x),h=e.length;else{m=e.slice(x,k);let S=/<\/slot\s*>/i,E=e.slice(k),A=S.exec(E),U=A?A[0].length:7;h=k+U}}let y=g==="default"||g===""?null:g,_=t.get(y),w=g!==null?` name="${H(g)}"`:"",C=b?` ${b}`:"";_!==void 0&&!o.has(y)?(o.add(y),s+=`<slot data-webjs-light data-projection="actual"${r}${w}${C}>${_}</slot>`):s+=`<slot data-webjs-light data-projection="fallback"${r}${w}${C}>${m}</slot>`,i=h,a.lastIndex=h}return s+=e.slice(i),s}function pt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Yt(e){return e==="script"||e==="style"}function qo(e){let t={},n=/([a-zA-Z_:][\w:.-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g,r;for(;(r=n.exec(e))!==null;)t[r[1]]=r[2]??r[3]??r[4]??"";return t}function Ma(e,t){if(!(!e||typeof e.setAttribute!="function"))for(let[n,r]of Object.entries(t))e.setAttribute(n,Jt(r))}function Uo(e){return/\sdata-wj-host(?=[\s>=])/i.test(e)?e:`${e.slice(0,-1)} data-wj-host>`}function Ia(e,t,n){if(!t||typeof t.getAttributeNames!="function")return e;let r="";for(let o of t.getAttributeNames()){let s=String(o).toLowerCase();if(n.has(s))continue;let i=t.getAttribute(o);r+=i===""?` ${s}`:` ${s}="${H(String(i))}"`}return r?`${e.slice(0,-1)}${r}>`:e}function Pa(e,t,n){let r=n.properties||{};for(let[o,s]of Object.entries(t)){let i,a;for(let[l,f]of Object.entries(r))if(((typeof f=="object"?f:{type:f}).attribute||$a(l))===o){i=l,a=f;break}if(a===void 0&&(a=r[o]||r[or(o)],i=r[o]?o:or(o)),!a){e[i]=s;continue}let c=typeof a=="object"?a:{type:a};if(c.type===Number)e[i]=Number(s);else if(c.type===Boolean)e[i]=s!=="false";else if(c.type===Object||c.type===Array)try{e[i]=JSON.parse(Jt(s))}catch{e[i]=s}else e[i]=s}}function or(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function $a(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Da(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Jt(e){return e.replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&amp;/g,"&")}function Fa(e){let t={};for(let n of Object.keys(e)){if(!n.startsWith("data-webjs-prop-"))continue;let r=or(n.slice(16));try{t[r]=ne(Jt(e[n]))}catch{}delete e[n]}return t}function Ba(e,t={ssr:!0}){let n=t&&t.suspenseCtx,r=t&&t.dev!==void 0?t.dev:n&&n.dev;return n&&n.dev===void 0&&r!==void 0&&(n.dev=r),new ReadableStream({async start(o){try{if(t&&t.ssr===!1)await B(e,n,o);else{let s=await R(e,n),i=await fe(s,n,[],r);o.enqueue(i)}n&&n.pending.length&&await Ua(n,o,r),o.close()}catch(s){o.error(s)}}})}async function B(e,t,n){if(!(e==null||e===!1||e===!0)){if(e&&typeof e.then=="function")return e=await e,B(e,t,n);if(Oe(e)){n.enqueue(String(e.value??""));return}if(Le(e))return B(e.value,t,n);if(_e(e))return B(e.signal.get(),t,n);if(me(e))return B(e.value,t,n);if(be(e))return B(e.fn(),t,n);if(Me(e)){let r=e.template;n.enqueue(String(r?.innerHTML??""));return}if(!ge(e)){if(ye(e))return B(e.value,t,n);if(we(e)){let r=e.args;for(let o of r)if(!o||typeof o.then!="function")return B(o,t,n);if(r.length>0)try{let o=await Promise.race(r.map(s=>Promise.resolve(s).catch(()=>{})));return B(o,t,n)}catch{return}return}if(!(Ie(e)||Pe(e))){if(Array.isArray(e)){for(let r of e)await B(r,t,n);return}if(he(e)){let r=e;for(let o=0;o<r.items.length;o++)await B(r.templateFn(r.items[o],o),t,n);return}if(Gt(e)){let r=e;if(t){let o=`s${t.nextId++}`;n.enqueue(`<webjs-boundary id="${o}">`),await B(r.fallback,t,n),n.enqueue("</webjs-boundary>"),t.pending.push({id:o,promise:Promise.resolve(r.children)})}else await B(r.fallback,t,n);return}if(P(e)){await qa(e,t,n);return}n.enqueue(xt(String(e)))}}}}async function qa(e,t,n){let{strings:r,values:o}=e,s="text",i="",a=0,c="",l=0,f="",u="",d="";for(let p=0;p<r.length;p++){let g=r[p];for(let b=0;b<g.length;b++){let m=g[b];switch(s){case"text":d+=m,m==="<"&&(s="tag-open");break;case"tag-open":d+=m,m==="!"?s="bang-1":m==="/"?(s="tag-name",f=""):/[a-zA-Z]/.test(m)?(s="tag-name",f=m.toLowerCase()):s="text";break;case"bang-1":d+=m,s=m==="-"?"bang-dash":"tag-name";break;case"bang-dash":d+=m,m==="-"?(s="comment",l=0):s="tag-name";break;case"comment":d+=m,m==="-"?l+=1:(m===">"&&l>=2&&(s="text"),l=0);break;case"tag-name":d+=m,m===">"?(s=Yt(f)?"rawtext":"text",s==="rawtext"&&(u="")):/\s/.test(m)?s="in-tag":f+=m.toLowerCase();break;case"in-tag":d+=m,m===">"?(s=Yt(f)?"rawtext":"text",s==="rawtext"&&(u="")):!/\s/.test(m)&&m!=="/"&&(s="attr-name",i=m,a=d.length-1);break;case"rawtext":d+=m,u=(u+m.toLowerCase()).slice(-9),(u.endsWith("<\/script>")||u.endsWith("</style>"))&&(s="text",u="",f="");break;case"attr-name":m==="="?(s="after-eq",d+=m):/\s/.test(m)?(s="in-tag",i="",d+=m):m===">"?(s="text",i="",d+=m):(i+=m,d+=m);break;case"after-eq":m==='"'||m==="'"?(s="attr-quoted",c=m,d+=m):/\s/.test(m)?(s="in-tag",i="",d+=m):m===">"?(s="text",i="",d+=m):(s="attr-unquoted",d+=m);break;case"attr-unquoted":/\s/.test(m)?(s="in-tag",i="",d+=m):(m===">"&&(s="text",i=""),d+=m);break;case"attr-quoted":d+=m,m===c&&(s="in-tag",i="");break}}if(p<o.length){let b=o[p];if(b&&typeof b.then=="function"&&(b=await b),s==="comment")d+=String(b??""),l=0;else if(s==="rawtext")d+=String(b??""),u="";else if(s==="text")d&&(n.enqueue(d),d=""),await B(b,t,n);else if(s==="after-eq"){let m=i[0],h=i.slice(1),y=Re[m];y==="event"||y==="prop"?(d=d.slice(0,a),s="in-tag",i=""):y==="bool"?(d=d.slice(0,a),b&&(d+=`${h}=""`),s="in-tag",i=""):(d+=`"${H(String(b??""))}"`,s="in-tag",i="")}else(s==="attr-quoted"||s==="attr-unquoted")&&(d+=H(String(b??"")))}}d&&n.enqueue(d)}async function Ua(e,t,n){let r=rr(),o=r?` nonce="${H(r)}"`:"";for(;e.pending.length;){let s=e.pending.splice(0);await Promise.all(s.map(async({id:i,promise:a})=>{try{let c=await a,l=await R(c,e),f=await fe(l,e,[],n);t.enqueue(`<template data-webjs-resolve="${i}">${f}</template><script${o}>(function(){var t=document.currentScript.previousElementSibling;var b=document.getElementById("${i}");if(b&&t){b.replaceWith(t.content.cloneNode(true));t.remove()}document.currentScript.remove()})()<\/script>`)}catch(c){console.error(`[webjs] Suspense boundary "${i}" rejected:`,c);try{let l=c instanceof Error?c:new Error(String(c)),f=await fe(await R(Ho("webjs-suspense",l,n),e),e,[],n);t.enqueue(`<template data-webjs-resolve="${i}">${f}</template><script${o}>(function(){var t=document.currentScript.previousElementSibling;var b=document.getElementById("${i}");if(b&&t){b.replaceWith(t.content.cloneNode(true));t.remove()}document.currentScript.remove()})()<\/script>`)}catch(l){console.error(`[webjs] Suspense boundary "${i}" error render also threw:`,l)}}}))}}var Wo=Symbol.for("webjs.notFound"),zo=Symbol.for("webjs.redirect"),Vo=Symbol.for("webjs.forbidden"),Ko=Symbol.for("webjs.unauthorized");function Ha(){let e=new Error("webjs: notFound()");throw e.__webjs=Wo,e}function Wa(){let e=new Error("webjs: forbidden()");throw e.__webjs=Vo,e}function za(){let e=new Error("webjs: unauthorized()");throw e.__webjs=Ko,e}function Va(e,t){let n=typeof t=="object"&&t!==null?t.status:t,r=new Error(`webjs: redirect(${e})`);throw r.__webjs=zo,r.url=e,r.status=typeof n=="number"?n:void 0,r}function Ka(e){return!!e&&e.__webjs===Wo}function Ga(e){return!!e&&e.__webjs===zo}function Ya(e){return!!e&&e.__webjs===Vo}function Ja(e){return!!e&&e.__webjs===Ko}function Xa(e,t={}){let n=t.reconnect!==!1,r=0,o=!1,s=null,i=[];function a(){o||(s=new WebSocket(Za(e),t.protocols),s.onopen=c=>{for(r=0;i.length&&s&&s.readyState===WebSocket.OPEN;)s.send(i.shift());t.onOpen?.(c)},s.onmessage=c=>{let l=c.data;if(typeof l=="string")try{l=JSON.parse(l)}catch{}t.onMessage?.(l,c)},s.onerror=c=>{t.onError?.(c)},s.onclose=c=>{if(t.onClose?.(c),!o&&n){let l=Math.min(1e3*2**r++,3e4);setTimeout(a,l)}})}return a(),{send(c){let l=typeof c=="string"||c instanceof ArrayBuffer||ArrayBuffer.isView(c)?c:JSON.stringify(c);s&&s.readyState===WebSocket.OPEN?s.send(l):i.push(l)},close(c,l){o=!0;try{s?.close(c,l)}catch{}},get socket(){return s},get readyState(){return s?.readyState??3}}}function Za(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}`}ze();var sr="application/vnd.webjs+json";async function Qa(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",sr);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 dt(r),n.has("content-type")||n.set("content-type",sr));let o=await fetch(e,{...t,headers:n,body:r}),s=o.headers.get("content-type")||"",i=await o.text(),a=s.includes(sr)?i?ne(i):null:s.includes("application/json")?i?JSON.parse(i):null:i;if(!o.ok){let c=a&&a.error||`richFetch ${e} -> ${o.status}`,l=new Error(c);throw l.status=o.status,l.body=a,l}return a}ze();lr();cr();Zt();var Pr=class{constructor(t,n){this.host=t,this.options=n,this.updates=[],this._nextId=0}get value(){let t=this.options.source();if(!this.options.update)return this.updates.length>0?this.updates[this.updates.length-1].payload:t;for(let n of this.updates)t=this.options.update(t,n.payload);return t}add(t,n){let r=`opt-${++this._nextId}`;this.updates.push({id:r,payload:t}),this.host?.requestUpdate?.();let o=()=>{let s=this.updates.findIndex(i=>i.id===r);s!==-1&&(this.updates.splice(s,1),this.host?.requestUpdate?.())};return n&&typeof n.then=="function"&&(typeof n.finally=="function"?n.finally(()=>o()).catch(()=>{}):n.then(()=>o(),()=>o())),o}};async function Vc(e,t,n){let r=e.get();e.set(t);let o;try{o=await n()}catch(s){throw e.set(r),s}return o&&o.success===!1&&e.set(r),o}function Kc(e,t,n){return e&&typeof e.get=="function"&&typeof e.set=="function"?Vc(e,t,n):new Pr(e,t)}dr();var wn=0,qs=new Map,tt=new Map,Gc=1e3;function Yc(e){if(!(!Array.isArray(e)||!e.length)){wn+=1;for(let t of e)t&&qs.set(t,wn)}}function Jc(){return wn}function Xc(e,t,n){if(!(!Array.isArray(t)||!t.length)&&(tt.delete(e),tt.set(e,{tags:t.slice(),since:typeof n=="number"?n:wn}),tt.size>Gc)){let r=tt.keys().next().value;r!==void 0&&tt.delete(r)}}function Zc(e){let t=tt.get(e);if(!t)return!1;for(let n of t.tags)if((qs.get(n)||0)>t.since)return!0;return!1}function Qc(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}var el="application/vnd.webjs+stream",tl=1,nl=2,rl=3,Us=new Uint8Array(0);function ol(e,t){let n=t||Us,r=n.length,o=new Uint8Array(5+r);return o[0]=e&255,o[1]=r>>>24&255,o[2]=r>>>16&255,o[3]=r>>>8&255,o[4]=r&255,r&&o.set(n,5),o}function sl(){let e=Us;return{push(t){if(t&&t.length){let r=new Uint8Array(e.length+t.length);r.set(e,0),r.set(t,e.length),e=r}let n=[];for(;e.length>=5;){let r=e[0],o=(e[1]<<24|e[2]<<16|e[3]<<8|e[4])>>>0;if(e.length<5+o)break;let s=e.slice(5,5+o);n.push({type:r,payload:s}),e=e.slice(5+o)}return n}}}var il=Symbol.for("webjs.context");function al(e){return{__context__:il,name:e}}var _n=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},$r=class{constructor(t,{context:n,initialValue:r}){this._host=t,this._context=n,this._value=r,this._subscriptions=new Set,this._onRequest=o=>{let s=o;if(s.context===this._context)if(o.stopPropagation(),s.subscribe){let i={callback:s.callback},a=()=>{this._subscriptions.delete(i)};this._subscriptions.add(i),s.callback(this._value,a)}else s.callback(this._value)},typeof t.addController=="function"&&t.addController(this)}get value(){return this._value}setValue(t){if(!Object.is(this._value,t)){this._value=t;for(let n of this._subscriptions){let r=()=>{this._subscriptions.delete(n)};n.callback(t,r)}}}hostConnected(){this._host.addEventListener("context-request",this._onRequest)}hostDisconnected(){this._host.removeEventListener("context-request",this._onRequest),this._subscriptions.clear()}},Dr=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 _n(this._context,(n,r)=>{let o=this._value;this._value=n,r&&(this._unsubscribe=r),!Object.is(o,n)&&typeof this._host.requestUpdate=="function"&&this._host.requestUpdate()},this._subscribe);this._host.dispatchEvent(t)}};function cl(){return typeof window<"u"}var oe={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},Fr=class{constructor(t,{task:n,args:r,autoRun:o=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=o,this._status=oe.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=oe.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=oe.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=oe.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 oe.INITIAL:return t.initial?.();case oe.PENDING:return t.pending?.();case oe.COMPLETE:return t.complete?.(this._value);case oe.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun||!cl())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{Dr as ContextConsumer,$r as ContextProvider,_n as ContextRequestEvent,tl as FRAME_CHUNK,nl as FRAME_END,rl as FRAME_ERROR,O as MARKER,rs as SEED_MISS,el as STREAM_CONTENT_TYPE,st as Signal,_a as Suspense,Fr as Task,oe as TaskStatus,Kt as WebComponent,ar as WebjsFrame,ur as WebjsStream,Qi as activeActionSignal,En as adoptStyles,er as allTags,ei as asyncAppend,ti as asyncReplace,fi as batch,Zs as cache,pi as computed,Xa as connectWS,Zc as consumeStale,al as createContext,sl as createFrameDecoder,Xs as createRef,rr as cspNonce,zs as css,Mo as deserialize,cs as disableClientRouter,mi as effect,xr as enableClientRouter,ol as encodeFrame,H as escapeAttr,xt as escapeText,Jc as fetchMark,Wa as forbidden,Gs as guard,An as html,Ie as isAsyncAppend,Pe as isAsyncReplace,je as isCSS,ye as isCache,Ya as isForbidden,be as isGuard,me as isKeyed,na as isLazy,Le as isLive,Ka as isNotFound,Ga as isRedirect,ge as isRef,he as isRepeat,hi as isSignal,Gt as isSuspense,P as isTemplate,Me as isTemplateContent,Ja as isUnauthorized,Oe as isUnsafeHTML,we as isUntil,_e as isWatch,Ks as keyed,Vs as live,Qn as lookup,ta as lookupModuleUrl,Yc as markStale,ls as navigate,Ha as notFound,Kc as optimistic,ne as parse,Qc as parseTagHeader,ea as primeModuleUrl,wa as prop,Va as redirect,Js as ref,Zn as register,Xc as registerKeyTags,We as render,fr as renderStream,Ba as renderToStream,Aa as renderToString,Wr as repeat,us as revalidate,Qa as richFetch,Qt as scanSeeds,Lo as serialize,Ut as setActiveActionSignal,Sa as setCspNonceProvider,di as signal,dt as stringify,Et as stylesToString,zt as tagOf,ic as takeSeed,Ys as templateContent,za as unauthorized,xn as unsafeHTML,Qs as until,ni as watch};
7
9
  //# sourceMappingURL=webjs-core.js.map