@webjsdev/core 0.8.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/webjs-core-browser.js +6 -5
- package/dist/webjs-core-browser.js.map +3 -3
- package/dist/webjs-core-testing.js +20 -19
- package/dist/webjs-core-testing.js.map +3 -3
- package/dist/webjs-core.js +7 -6
- package/dist/webjs-core.js.map +3 -3
- package/index-browser.js +14 -9
- package/index.d.ts +53 -10
- package/index.js +17 -9
- package/package.json +15 -2
- package/src/action-effects-client.d.ts +5 -0
- package/src/action-effects-client.js +84 -0
- package/src/action-seed-client.js +5 -5
- package/src/asset-url.d.ts +18 -0
- package/src/asset-url.js +12 -13
- package/src/async-directive.d.ts +18 -0
- package/src/async-directive.js +88 -0
- package/src/attribute-reader.js +197 -23
- package/src/binding-prefixes.js +0 -12
- package/src/component/lifecycle.js +760 -209
- package/src/component/reactive.js +2 -10
- package/src/component/server-element.js +23 -1
- package/src/component.d.ts +151 -41
- package/src/context.d.ts +94 -18
- package/src/context.js +341 -217
- package/src/converters.d.ts +7 -0
- package/src/converters.js +38 -0
- package/src/csp-nonce.d.ts +18 -0
- package/src/css.d.ts +32 -6
- package/src/css.js +178 -14
- package/src/directive.d.ts +58 -0
- package/src/directive.js +119 -0
- package/src/directives.d.ts +38 -1
- package/src/directives.js +158 -1
- package/src/form-action.d.ts +13 -0
- package/src/form-action.js +139 -4
- package/src/hot.js +23 -0
- package/src/html.d.ts +4 -0
- package/src/html.js +35 -3
- package/src/is-server.d.ts +2 -0
- package/src/is-server.js +18 -0
- package/src/jsx-guard.js +130 -0
- package/src/metadata.d.ts +22 -3
- package/src/nav.d.ts +4 -1
- package/src/nav.js +44 -11
- package/src/optimistic.js +2 -2
- package/src/refresh-header.js +52 -0
- package/src/registry.js +10 -1
- package/src/render-client/adopt-slots.js +8 -3
- package/src/render-client/parts.js +745 -31
- package/src/render-client/reconciler.js +56 -11
- package/src/render-client/template-compiler.js +139 -44
- package/src/render-client.d.ts +5 -1
- package/src/render-server/attrs.js +2 -2
- package/src/render-server/compile.js +34 -0
- package/src/render-server/errors.js +37 -0
- package/src/render-server/expand.js +61 -8
- package/src/render-server/served-attrs.js +1 -2
- package/src/render-server/walk.js +135 -3
- package/src/render-server.d.ts +3 -0
- package/src/render-server.js +2 -0
- package/src/repeat.d.ts +7 -2
- package/src/repeat.js +20 -6
- package/src/router-client/dom-differ.js +17 -0
- package/src/router-client/fetch-apply.js +86 -5
- package/src/router-client/navigator.js +45 -9
- package/src/router-client/prefetch.js +3 -4
- package/src/router-client/root-attrs.js +43 -0
- package/src/router-client/stream.js +7 -0
- package/src/router-client/swap.js +4 -1
- package/src/routes.d.ts +75 -18
- package/src/serialize.d.ts +2 -0
- package/src/serialize.js +35 -4
- package/src/signal.d.ts +7 -0
- package/src/signal.js +26 -6
- package/src/slot/polyfills.js +3 -3
- package/src/slot.js +4 -8
- package/src/static-html.d.ts +22 -0
- package/src/static-html.js +144 -0
- package/src/task.d.ts +63 -20
- package/src/task.js +326 -293
- package/src/testing.d.ts +42 -0
- package/src/webjs-config.d.ts +1 -8
- package/src/websocket-client.d.ts +24 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
var Pl=Object.defineProperty;var w=(e,t)=>()=>(e&&(t=e(e=0)),t);var Bs=(e,t)=>{for(var n in t)Pl(e,n,{get:t[n],enumerable:!0})};var P,V,Ot=w(()=>{P=Symbol.for("webjs.nothing"),V=Symbol.for("webjs.noChange")});function Lt(e){return Object.prototype.hasOwnProperty.call(gr,e)}function ln(e,t){return t===P||t===V?null:String(t??"")}var gr,un=w(()=>{Ot();gr=Object.freeze({"@":"event",".":"prop","?":"bool"})});function Hl(e){let t=String(e);return Dl.test(t)?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"):t}function Hs(e){let t=String(e);return Bl.test(t)?t.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<"):t}var Dl,Bl,qo=w(()=>{Dl=/[&<>]/,Bl=/[&"<]/});function Ko(e){if(typeof e!="function")return null;let t=e[Us];return typeof t=="string"&&t?t:null}function wr(e,t,n){if(typeof e!="function")return!1;let r=String(t).toLowerCase(),o=String(n||"").toLowerCase();return r==="action"?o==="form":r==="formaction"?o==="button"||o==="input":!1}function qs(e,t,n=!0){if(!e||e===H&&n)return;let r=e===H?'a second "name" attribute':`name="${e}"`;throw new Error(`[webjs] formaction=\${action} on <${t||"button"}> cannot be used when the element already carries a "name" attribute (found ${r}). The action identity is submitted as the button's own name/value pair, so there is no room for a second one. Move the action to the enclosing <form action=\${action}> or drop the submitter's "name".`)}function Ks(e,t){let n=String(e||"").toLowerCase(),r=t==null?null:String(t).toLowerCase();if(Ul(n,r)){if(n==="input"&&r==="image")throw new Error('[webjs] formaction=${action} is not supported on <input type="image"> because image submitters submit coordinate pairs (name.x/name.y) instead of name=value, so the action identity would never arrive. Use a <button> instead.');if(n==="input")throw new Error('[webjs] formaction=${action} is not supported on <input type="submit"> because the action identity has to occupy the submitter\'s "value", which on this control is also its visible label, so the button would render captioned with the action\'s id and could not be given a real one. Use <button formaction=${action}>Publish</button>, whose label is its children.');return}throw new Error(`[webjs] formaction=\${action} on <${n}>${r?` type="${r}"`:""} requires a submitter control, and formaction is inert on anything else. Use <button formaction=\${action}>.`)}function Ul(e,t){let n=t==null?null:String(t).toLowerCase();return e==="button"?n==null||n===""||n==="submit":e==="input"?n==="submit"||n==="image":!1}function Ws(e){throw new Error(`[webjs] formaction=\${action} on <${e||"button"}> cannot be used when the element already carries a "value" attribute. The action identity is submitted as the button's own name/value pair, so both halves are taken. Drop the "value", or dispatch on it from one form-level action instead.`)}function Vs(e){throw new Error(`[webjs] a bound formaction=\${action} on <${e||"button"}> cannot also carry a plain formaction attribute: the two name different targets and the renderers resolve them differently. Drop the static attribute.`)}function zs(e){throw new Error(`[webjs] formaction=\${action} on <${e||"button"}> cannot be used with a "form" attribute, which re-points the submitter at a form other than the bound one it sits in. Keep the submitter inside its bound <form>.`)}function Gs(e,t){if(e)throw new Error(`[webjs] two formaction=\${action} holes were found on one <${t||"button"}>. Only one can win, and the two renderers pick differently, so bind exactly one action per submitter.`)}function Ys(e,t){let r=(e||[]).filter(o=>Wo(o))[0];if(r)throw new Error(`[webjs] a <${t||"button"}> submitter binds .${r}=. That property is a reflected IDL attribute on a submitter, so a property binding is dropped at SSR and written to the attribute in the browser: the page would render on the server and throw on hydration. Write it as a plain attribute.`)}function Wo(e){let t=String(e).toLowerCase();return t==="name"||t==="value"||t==="formaction"||t==="formmethod"||t==="formenctype"}function ql(e,t,n){let r=t==null?null:String(t),o=n==null?null:String(n);if(r!=null&&/^dialog$/i.test(r))throw new Error(`[webjs] formaction=\${action} on <${e}> cannot be combined with formmethod="dialog", which dismisses a <dialog> instead of submitting, so the bound action would never run. Drop one of the two.`);if(r!=null&&!/^post$/i.test(r))throw new Error(`[webjs] <${e} formmethod="${r}" formaction=\${action}> cannot work: a bound server action is submitted as a POST body, and a "${r}" submission sends none, so the action would never run. Drop the formmethod attribute (WebJs emits formmethod="post" on a bound submitter), or drop the binding.`);if(o!=null&&!Xs.has(o.toLowerCase()))throw new Error(`[webjs] <${e} formenctype="${o}" formaction=\${action}> cannot work: a form submission is parsed as multipart/form-data or application/x-www-form-urlencoded, and a "${o}" body is neither, so the bound action could never read it. Drop the formenctype attribute (WebJs emits multipart/form-data on a bound submitter).`)}function dn(e,t,n){if(_r(e)&&Jl(t))throw new Error(Xl(t,n))}function Js(e,t,n){Yl(t,n)&&dn(e,t,n)}function Vo(e,t){if(e)return e;let n=t==="button"||t==="input"?"formaction=":"action=";throw new Error(`[webjs] the function in ${n} on <${t||"form"}> is not a server action. Only a function imported from a 'use server' *.server.{js,ts} module can be bound to a form or a submitter, because the identity the browser submits has to resolve back to something the server can run. Move the handler into a server action and import it, or pass a url string.`)}function Kl(e,t){if(e!=null&&!/^post$/i.test(e))throw new Error(`[webjs] <form method="${e}" action=\${action}> cannot work: a bound server action is submitted as a POST body, and a "${e}" form sends no body. Drop the method attribute (WebJs emits method="post") or remove the bound action.`);if(t!=null&&!Xs.has(t.toLowerCase()))throw new Error(`[webjs] <form enctype="${t}" action=\${action}> cannot work: a form submission is parsed as multipart/form-data or application/x-www-form-urlencoded, and a "${t}" body is neither, so the submission would run under JS and do nothing without it. Drop the enctype attribute (WebJs emits multipart/form-data).`)}function Wl(e){if(e.duplicateAction)throw new Error("[webjs] two action=${...} holes were found on one <form>. A form can carry only one action binding. Move one to a submit button's formaction=${action} or remove the duplicate.");if(e.staticAction)throw new Error('[webjs] a bound <form action=${action}> also carries a plain action="..." attribute. A bound form posts to the page\'s own url, so the two say different things: without JS the browser would post to the written url and with JS it would not. Drop the action attribute, or drop the binding.');let t=e.propAttrs&&e.propAttrs[0];if(t)throw new Error(`[webjs] a bound <form action=\${action}> also binds .${t}=. A property binding on a native element is dropped at SSR and applied in the browser, so the form would submit one way with JS and another way without it. Write it as a plain attribute.`)}function Vl(e,t){let n=e!==z&&e!=null,r=t!==z&&t!=null;return Kl(n?e:null,r?t:null),{method:n?null:"post",enctype:r?null:"multipart/form-data"}}function Zs(e,t,n){let r=t!==z&&t!=null,o=n!==z&&n!=null;return ql(e,r?t:null,o?n:null),{formMethod:r?null:"post",formEnctype:o?null:"multipart/form-data"}}function Qs(e,t,n,r,o){let i=typeof t=="function"?Ko(t):null;if(!i){typeof t=="function"&&Vo(null,e.localName),Gl(e,n,r,o.propAttrs);return}Wl(o);let s=Vl(n,r);e.removeAttribute("action"),fn(e,"method",n,s.method),fn(e,"enctype",r,s.enctype),zl(e,i)}function fn(e,t,n,r){if(r!==null){e.setAttribute(t,r);return}n!==z&&e.getAttribute(t)!==n&&e.setAttribute(t,n)}function zl(e,t){let n=e.firstElementChild,r=n&&n.localName==="input"&&n.getAttribute("name")===H?n:null;if(!r){for(let o of e.children)if(o.localName==="input"&&o.getAttribute("name")===H){r=o;break}}r||(r=e.ownerDocument.createElement("input"),r.setAttribute("type","hidden"),r.setAttribute("name",H),e.insertBefore(r,e.firstChild)),r.getAttribute("value")!==t&&r.setAttribute("value",t)}function Gl(e,t,n,r){let o=e.firstElementChild;if(o&&o.localName==="input"&&o.getAttribute("name")===H)o.remove();else for(let s of e.children)if(s.localName==="input"&&s.getAttribute("name")===H){s.remove();break}let i=s=>(r||[]).some(a=>{let c=String(a).toLowerCase();return c===s||s==="enctype"&&c==="encoding"});t===z&&!i("method")&&e.removeAttribute("method"),n===z&&!i("enctype")&&e.removeAttribute("enctype")}function ea(e,t,n,r){let o=i=>(r||[]).some(s=>String(s).toLowerCase()===i);t===z&&!o("formmethod")&&e.removeAttribute("formmethod"),n===z&&!o("formenctype")&&e.removeAttribute("formenctype")}function Yl(e,t){let n=String(e).toLowerCase();Lt(n[0])&&(n=n.slice(1));let r=String(t||"").toLowerCase();return n==="action"?r==="form":n==="formaction"?r==="button"||r==="input":!1}function _r(e,t){if(typeof e=="function")return!0;if(!Array.isArray(e))return!1;let n=t||new Set;return n.has(e)?!1:(n.add(e),e.some(r=>_r(r,n)))}function Jl(e){let t=String(e).toLowerCase();return Lt(t[0])&&(t=t.slice(1)),t==="action"||t==="formaction"}function Xl(e,t){return`[webjs] a function was interpolated into ${String(e).toLowerCase()}= on <${t||"form"}>. Stringifying a function into HTML would leak its source (a 'use server' action's body included) to every visitor, so this is refused. To run a server action from a form, write an unquoted action=\${action} on the <form> itself or a formaction=\${action} on a <button> inside a bound form. Anywhere else, pass a URL string.`}var H,Us,Xs,z,Fe=w(()=>{un();qo();H="__webjs_action",Us="$$webjsAction";Xs=new Set(["multipart/form-data","application/x-www-form-urlencoded"]);z=Symbol("webjs.attr.absent")});var S,A,N,M,Xo,pe,rt,pn,ca,O,Zo,he,v,$e=w(()=>{S=Symbol("webjs.slot.state"),A="data-webjs-light",N="data-projection",M="actual",Xo="fallback",pe=Symbol("webjs.slot.fallbackFrag"),rt=Symbol("webjs.slot.templateOwner"),pn="data-wj-slot-owner",ca=64,O=Symbol("webjs.slot.rendering"),Zo=Symbol("webjs.slot.intercepted"),he=Symbol("webjs.slot.park"),v=new WeakSet});function j(e){let t=e,n=t[S];return n||(n={host:e,authored:[],assignedByName:new Map,lastSnapshot:new WeakMap},t[S]=n),n}function ot(e){return!!e[S]}function Qo(e){let t=j(e);for(;e.firstChild;){let n=e.firstChild;t.authored.push(n),v.add(n),e.removeChild(n)}me(t)}function me(e){let t=e.assignedByName;t.clear();for(let n of e.authored)fu(t,De(e,n),n)}function De(e,t){let n=mn(e,t);if(n)return $(n.getAttribute("name"));if(e.adoptedKey){let r=e.adoptedKey.get(t);if(r!==void 0)return r}return la(t)}function ei(e){let t=j(e);t.adopted=!0;let n=new Set,r=e.querySelectorAll(`slot[${A}]`);for(let o of r){let i=o;if(!K(e,i)||i.getAttribute(N)!==M||jt(t,e,i))continue;let s=$(i.getAttribute("name"));if(!n.has(s)){n.add(s);let a=Array.from(i.childNodes);for(let c of a)t.authored.push(c),la(c)!==s&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(c,s));t.lastSnapshot.set(i,a.slice())}}for(let o of e.querySelectorAll("wj-slot-park"))if(K(e,o)){for(let i of Array.from(o.childNodes))v.add(i),t.authored.push(i);o.remove()}me(t)}function $(e){return e==null||e===""||e==="default"?null:e}function la(e){return e.nodeType!==1?null:$(e.getAttribute("slot"))}function fu(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}var it=w(()=>{at();hn();st();$e()});function ua(){be||!Z||(be=Node.prototype.appendChild,ti=Node.prototype.insertBefore,Be=Node.prototype.removeChild,Cr=Node.prototype.replaceChild,ni=Element.prototype.append,ri=Element.prototype.prepend,oi=Element.prototype.replaceChildren,bn=Object.getOwnPropertyDescriptor(Element.prototype,"innerHTML"),kr=Object.getOwnPropertyDescriptor(Node.prototype,"textContent"))}function ct(e,t){let n=e[O];e[O]=!0;try{return t()}finally{e[O]=n,n||Rr(e)}}function ii(e){if(!Z)return;let t=e,n=j(e);n.backstop||(n.backstop=new MutationObserver(r=>yn(e,n,r)),n.backstop.observe(e,{childList:!0,subtree:!1}),n.flipSensor=new MutationObserver(r=>fa(e,r)),n.flipSensor.observe(e,{attributes:!0,attributeFilter:["slot","name"],subtree:!0}))}function yn(e,t,n){let r=e,o=r[he],i=r[Symbol.for("webjs.instance")],s=!1,a=new Set;for(let c of n){for(let l of c.addedNodes)if(a.add(l),l!==o&&!(i&&ci(i,l))){if(t.authored.indexOf(l)!==-1){s=!0;continue}v.add(l),t.authored.push(l),s=!0}for(let l of c.removedNodes){let u=t.authored.indexOf(l);if(u===-1||e.contains(l))continue;v.has(l)&&l.parentNode==null&&!a.has(l)||(t.authored.splice(u,1),s=!0)}}s&&G(e)}function Rr(e){let t=e,n=t[S];if(!(n&&n.backstop))return;let r=n.backstop.takeRecords();(!(Symbol.for("webjs.instance")in t)||t[Symbol.for("webjs.instance")])&&yn(e,n,r)}function fa(e,t){let n=e[S];if(!n)return;let r=!1;for(let o of t){if(o.type!=="attributes")continue;let i=o.target;o.attributeName==="name"?i.tagName==="SLOT"&&i.hasAttribute(A)&&K(e,i)&&(r=!0):o.attributeName==="slot"&&(n.adoptedKey&&n.adoptedKey.delete(i),n.authored.indexOf(i)!==-1&&(r=!0))}r&&G(e)}function si(e){let t=e[S];t&&(t.backstop&&(yn(e,t,t.backstop.takeRecords()),t.backstop.disconnect(),t.backstop=void 0),t.flipSensor&&(fa(e,t.flipSensor.takeRecords()),t.flipSensor.disconnect(),t.flipSensor=void 0))}function ai(e){if(!Z)return;let t=e,n=t[S];if(!n)return;let r=t[Symbol.for("webjs.instance")],o=Symbol.for("webjs.instance")in t,i=!o&&n.adopted===!0,s=!1;for(let a of Array.from(e.childNodes))if(a!==t[he]){if(n.authored.indexOf(a)!==-1){s=!0;continue}o&&(!r||ci(r,a))||!o&&i||(v.add(a),n.authored.push(a),s=!0)}s&&G(e)}var be,ti,Be,Cr,ni,ri,oi,bn,kr,Or=w(()=>{at();hn();st();gn();it();$e();be=null,ti=null,Be=null,Cr=null,ni=null,ri=null,oi=null,bn=null,kr=null});function ci(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 da(e){let t=e,n=t[he];return(!n||!n.isConnected)&&(n||(n=e.ownerDocument.createElement("wj-slot-park"),n.setAttribute("hidden",""),n.style.display="none",t[he]=n),ct(e,()=>be.call(e,n))),n}function lt(e){return e instanceof Node||!!(e&&typeof e=="object"&&e.ownerDocument&&e.ownerDocument.defaultView&&e instanceof e.ownerDocument.defaultView.Node)}function li(e,t,n){if(n&&!lt(t))return[e.ownerDocument.createTextNode(`${t}`)];if(!lt(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);Lr(e,r);for(let o of r)Be.call(t,o);return r}return Lr(e,[t]),[t]}function Lr(e,t){Pt(e,t);for(let n of t){if(!lt(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 Pt(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 ui(e,t,n){let r=e.authored;for(let i of t){let s=r.indexOf(i);s!==-1&&r.splice(s,1)}let o=n==null?r.length:r.indexOf(n);o===-1&&(o=r.length),r.splice(o,0,...t)}function pi(e,t){let n=e[S];return n?jt(n,e,t):!1}function jt(e,t,n){for(let r=n;r&&r!==t;r=r.parentNode)if(e.authored.indexOf(r)!==-1)return!0;return!1}function fi(e,t){if(v.has(t))return!0;let n=t.parentNode;if(n==null)return!1;if(n===e||n===e[he])return!0;let r=e[S];return n.nodeType===1&&n.tagName==="SLOT"&&n.hasAttribute(A)&&(r&&r.lastSnapshot.has(n)||e.contains(n)&&K(e,n))}function di(e,t){let n=[];for(let i of t)lt(i)?i.nodeType===11?n.push({frag:i}):n.push({node:i}):n.push({text:`${i}`});for(let i of n)i.frag?Pt(e,Array.from(i.frag.childNodes)):i.node&&Lr(e,[i.node]);let r=e.ownerDocument.createDocumentFragment();for(let i of n)if(i.text!==void 0)be.call(r,e.ownerDocument.createTextNode(i.text));else if(i.frag){let s=Array.from(i.frag.childNodes);Lr(e,s);for(let a of s)be.call(r,a)}else i.node&&(Pt(e,[i.node]),be.call(r,i.node));let o=Array.from(r.childNodes);Pt(e,o);for(let i of o)Be.call(r,i);return o}function Te(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);me(t),G(e)}function hi(e){if(!Z)return;let t=e;if(t[Zo])return;ua(),t[Zo]=!0;let n=j(e);t.appendChild=function(r){if(t[O])return be.call(this,r);let o=li(e,r,!1);for(let i of o)v.add(i);return ui(n,o,null),Te(e,n,o),r},t.insertBefore=function(r,o){if(t[O])return ti.call(this,r,o);if(!lt(r))throw new TypeError("Failed to execute insertBefore on the host: parameter 1 is not of type Node.");if(o!=null&&!lt(o))throw new TypeError("Failed to execute insertBefore on the host: parameter 2 is not of type Node.");if(Pt(e,r.nodeType===11?Array.from(r.childNodes):[r]),o!=null&&(n.authored.indexOf(o)===-1||!fi(e,o)))throw new DOMException("insertBefore: reference node is not an assigned child of this host","NotFoundError");if(r===o)return r;let i=li(e,r,!1);for(let s of i)v.add(s);return ui(n,i,o||null),Te(e,n,i),r},t.removeChild=function(r){if(t[O])return Be.call(this,r);let o=n.authored.indexOf(r);if(o===-1)return Be.call(this,r);if(!fi(e,r))throw new DOMException("removeChild: the node is not an assigned child of this host","NotFoundError");return n.authored.splice(o,1),Te(e,n,[r]),r},t.replaceChild=function(r,o){if(t[O])return Cr.call(this,r,o);if(n.authored.indexOf(o)===-1)return Cr.call(this,r,o);if(!lt(r))throw new TypeError("Failed to execute replaceChild on the host: parameter 1 is not of type Node.");if(Pt(e,r.nodeType===11?Array.from(r.childNodes):[r]),!fi(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 s=li(e,r,!1);for(let c of s)v.add(c);for(let c of s){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,...s),Te(e,n,[...s,o]),o},t.append=function(...r){if(t[O])return ni.apply(this,r);let o=di(e,r);for(let i of o)v.add(i);ui(n,o,null),Te(e,n,o)},t.prepend=function(...r){if(t[O])return ri.apply(this,r);let o=di(e,r);for(let i of o)v.add(i);for(let i of o){let s=n.authored.indexOf(i);s!==-1&&n.authored.splice(s,1)}n.authored.unshift(...o),Te(e,n,o)},t.replaceChildren=function(...r){if(t[O])return oi.apply(this,r);let o=di(e,r);for(let s of o)v.add(s);let i=n.authored;n.authored=o.slice(),Te(e,n,[...i,...o])},Object.defineProperty(t,"innerHTML",{configurable:!0,get(){return bn.get.call(this)},set(r){if(t[O]){bn.set.call(this,r);return}let o=e.ownerDocument.createElement("div");bn.set.call(o,r===null?"":`${r}`);let i=Array.from(o.childNodes);for(let a of i)v.add(a);let s=n.authored;n.authored=i,Te(e,n,[...s,...i])}}),Object.defineProperty(t,"textContent",{configurable:!0,get(){return kr.get.call(this)},set(r){if(t[O]){kr.set.call(this,r);return}let o=r==null||r===""?[]:[e.ownerDocument.createTextNode(`${r}`)];for(let s of o)v.add(s);let i=n.authored;n.authored=o,Te(e,n,[...i,...o])}})}var pa,hn=w(()=>{at();st();gn();Or();it();$e();pa=new Set});function He(e,t,n){let r=j(e),o=$(t),i=Array.isArray(n)?n.filter(Boolean):n?[n]:[],s=r.authored.findIndex(c=>De(r,c)===o),a=r.authored.filter(c=>De(r,c)===o);r.authored=r.authored.filter(c=>De(r,c)!==o),(s===-1||s>r.authored.length)&&(s=r.authored.length);for(let c of i)c.nodeType===1&&!mn(r,c)&&(o==null?c.removeAttribute("slot"):c.setAttribute("slot",o)),v.add(c);if(r.authored.splice(s,0,...i),r.applying&&r.pendingRecordNodes){for(let c of a)r.pendingRecordNodes.add(c);for(let c of i)r.pendingRecordNodes.add(c)}else r.pendingRecordNodes=new Set([...a,...i]);if(r.adoptedKey){for(let c of a)r.adoptedKey.delete(c);for(let c of i)r.adoptedKey.delete(c)}me(r),G(e)}function G(e){if(!Z)return;let t=e[S];if(t){if(t.applying){t.reapply=!0;return}t.applying=!0;try{do{t.reapply=!1;let n=t.pendingRecordNodes||pa;t.pendingRecordNodes=void 0,du(e,t,n),pu(e,t),me(t);let r=[],o=new Set;for(let u of e.querySelectorAll(`slot[${A}]`))if(K(e,u)&&!jt(t,e,u)){if(!u.hasAttribute(N)&&!(pe in u)){o.add($(u.getAttribute("name")));continue}r.push(u)}let i=new Map;for(let u of r){let f=$(u.getAttribute("name")),d=i.get(f);d||(d=[],i.set(f,d)),d.push(u)}let s=[];for(let[u,f]of i){let d=t.assignedByName.get(u)||[];for(let p=0;p<f.length;p++){let b=f[p],y=d.filter(g=>{let m=mn(t,g);return m?m===b:p===0}),h=y.filter(g=>g===e||g.nodeType===1&&g.contains(e));if(h.length){for(let g of h)v.delete(g);y=y.filter(g=>h.indexOf(g)===-1)}y.length>0?mi(t,b,y)&&s.push(b):bi(t,b)&&s.push(b)}}for(let u of s)yi(t,u);let a=new Set(i.keys());for(let u of o)a.add(u);let c=new Set;for(let u of t.authored)a.has(De(t,u))||c.add(u);let l=e[he];if(l)for(let u of Array.from(l.childNodes))c.has(u)||Be.call(l,u);if(c.size){let u=da(e);for(let f of c)f.parentNode!==u&&(v.delete(f),ct(e,()=>be.call(u,f)))}if(t.backstop){let u=t.backstop.takeRecords();u.length&&yn(e,t,u)}}while(t.reapply)}finally{t.applying=!1}}}function du(e,t,n){for(let r of e.querySelectorAll(`slot[${A}][${N}="${M}"]`)){if(!K(e,r)||jt(t,e,r))continue;let o=r,i=t.lastSnapshot.get(o);if(!i)continue;let s=Array.from(o.childNodes);if(jr(s,i))continue;let a=t.authored,c=$(o.getAttribute("name")),l=s.filter(b=>!n.has(b));for(let b of l)a.indexOf(b)===-1&&De(t,b)!==c&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(b,c));for(let b of a){if(l.indexOf(b)!==-1||De(t,b)!==c)continue;let y=a.indexOf(b),h=0;for(let g=0;g<l.length;g++){let m=a.indexOf(l[g]);m!==-1&&m<y&&(h=g+1)}l.splice(h,0,b)}let u=new Set(l);for(let b of i)u.add(b);let f=-1,d=0;for(let b of a){if(u.has(b)){f===-1&&(f=d);continue}d+=1}let p=a.filter(b=>!u.has(b));(f===-1||f>p.length)&&(f=p.length),p.splice(f,0,...l),t.authored=p}}function pu(e,t){let n=e[he];t.authored=t.authored.filter(r=>{if(v.has(r))return!0;let o=r.parentNode;return o==null?!1:!!(o===e||o===n||o.nodeType===1&&o.tagName==="SLOT"&&o.hasAttribute(A)&&(t.lastSnapshot.has(o)||e.contains(o)&&K(e,o)))})}var gn=w(()=>{at();hn();st();Or();it();$e()});function ba(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}function ya(){if(ha||(Z=ba(),!Z))return;wn=HTMLSlotElement.prototype.assignedNodes,gi=HTMLSlotElement.prototype.assignedElements,Pr=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(n){return this.hasAttribute(A)&&!_i(this)?Si(this,n):wn?wn.call(this,n):[]},HTMLSlotElement.prototype.assignedElements=function(n){return this.hasAttribute(A)&&!_i(this)?Si(this,n).filter(r=>r.nodeType===1):gi?gi.call(this,n):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let n=Pr&&Pr.get?Pr.get.call(this):null;return n||ma(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||ma(this)}}),wi=HTMLSlotElement.prototype.assign,HTMLSlotElement.prototype.assign=function(...n){if(this.hasAttribute(A)&&!_i(this)){let r=hu(this);if(r){let o=j(r);o.manualAssign||(o.manualAssign=new Map);let i=n.filter(Boolean);for(let[s,a]of o.manualAssign){if(s===this)continue;let c=a.filter(l=>{let u=l.deref();return u!==void 0&&i.indexOf(u)===-1});c.length!==a.length&&(c.length?o.manualAssign.set(s,c):o.manualAssign.delete(s))}if(i.length?o.manualAssign.set(this,i.map(s=>new WeakRef(s))):o.manualAssign.delete(this),o.applying&&o.pendingRecordNodes)for(let s of i)o.pendingRecordNodes.add(s);else o.pendingRecordNodes=new Set(i);me(o),G(r)}return}return wi?wi.apply(this,n):void 0},ha=!0}function mn(e,t){let n=e.manualAssign;if(!n||!n.size)return null;for(let[r,o]of n){let i=!1,s=o.filter(a=>{let c=a.deref();return c===void 0?!1:(c===t&&(i=!0),!0)});if(s.length!==o.length&&(s.length?n.set(r,s):n.delete(r)),i){let a=e.host;return a&&(r===a||a.contains(r))?r:null}}return null}function hu(e){for(let t=e.parentElement;t;t=t.parentElement)if(t[S])return K(t,e)?t:null;return null}function _i(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 Si(e,t){if(e.getAttribute(N)!==M)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:Ai(n,new Set,0)}function Ai(e,t,n){if(n>=ca)return e.slice();let r=[];for(let o of e)if(o.nodeType===1&&o.tagName==="SLOT"){let i=o;if(t.has(i))continue;if(t.add(i),i.hasAttribute(A)){let s=Si(i,{flatten:!1});if(s.length>0)for(let a of Ai(s,t,n+1))r.push(a);else for(let a of Ai(Array.from(i.childNodes),t,n+1))r.push(a)}else if(wn){let s=wn.call(i,{flatten:!0});for(let a of s)r.push(a)}else r.push(o)}else r.push(o);return r}function ma(e){let t=e.parentElement;return t&&t.tagName==="SLOT"&&t.hasAttribute(A)&&t.getAttribute(N)===M?t:null}var Z,wn,gi,Pr,wi,ha,st=w(()=>{at();gn();it();$e();Z=ba(),wn=null,gi=null,Pr=null,wi=null,ha=!1;ya()});function vi(e){if(!Z)return!1;for(let t of e.querySelectorAll(`slot[${A}][${N}]`))if(K(e,t))return!0;return!1}function K(e,t){let n=t[rt];if(n)return n===e;let r=typeof t.getAttribute=="function"?t.getAttribute(pn):null;if(r){let o=mu(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 mu(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 mi(e,t,n){for(let l of n)v.delete(l);let r=t.getAttribute(N)!==M,o=e.lastSnapshot.get(t)||[],i=r||!jr(o,n);if(!r&&jr(Array.from(t.childNodes),n))return e.lastSnapshot.set(t,n.slice()),i;let s=t[pe];if(r&&s)for(;t.firstChild;)s.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(N,M),e.lastSnapshot.set(t,n.slice()),i}function bi(e,t){let n=t.getAttribute(N)===M;if(t.setAttribute(N,Xo),!n)return ga(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return ga(t),!0}function ga(e){let t=e[pe];!t||t.childNodes.length===0||e.appendChild(t)}function xi(e,t){if(!ot(e))return;let n=j(e),r=$(t.getAttribute("name")),o=n.assignedByName.get(r);if(o)for(let i of o)i.parentNode===t&&(v.add(i),t.removeChild(i));n.lastSnapshot.delete(t)}function wa(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function yi(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)wa(r)}))}function jr(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 at=w(()=>{st();it();$e()});var Ue=w(()=>{at();hn();st();gn();Or();it();$e()});function ec(e,t,n){sf.has(t)?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}async function qi(e){return JSON.stringify(await tc(e))}function mt(e){return nc(JSON.parse(e))}async function tc(e){let t=af();return await cf(e,t),ht(e,t)}function nc(e){return We(e,df())}function af(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map,fdEntries:new Map}}async function cf(e,t){let n=[e];for(;n.length;){let r=n.pop();if(!hf(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 i=new Uint8Array(await r.arrayBuffer());t.blobBytes.set(r,i);continue}if(typeof FormData<"u"&&r instanceof FormData){let i=t.fdEntries.get(r)||[...r.entries()];t.fdEntries.set(r,i);for(let[,s]of i)typeof s!="string"&&n.push(s);continue}if(Array.isArray(r))for(let i=0;i<r.length;i++)n.push(r[i]);else if(r instanceof Map)for(let[i,s]of r)n.push(i),n.push(s);else if(r instanceof Set)for(let i of r)n.push(i);else if(mf(r))for(let i in r)Object.prototype.hasOwnProperty.call(r,i)&&n.push(r[i])}}for(let[r,o]of t.refCount)o>1&&t.idOf.set(r,t.nextId++)}function ht(e,t){if(e===null)return null;if(e===void 0)return{[R]:"undef"};let n=typeof e;if(n==="string"||n==="boolean")return e;if(n==="number")return Number.isNaN(e)?{[R]:"NaN"}:e===1/0?{[R]:"Inf"}:e===-1/0?{[R]:"-Inf"}:Object.is(e,-0)?{[R]:"-0"}:e;if(n==="bigint")return{[R]:"BigInt",v:e.toString()};if(n==="symbol"){let i=Symbol.keyFor(e);if(i===void 0)throw new TypeError("Cannot serialize a local Symbol; only Symbol.for() registered symbols are supported.");return{[R]:"Sym",v:i}}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{[R]:"Ref",v:r};r!==void 0&&t.emitted.add(r);let o;if(e instanceof Date)o={[R]:"Date",v:Number.isNaN(e.getTime())?null:e.toISOString()};else if(e instanceof Error)o={[R]:"Error",v:{name:e.name,message:e.message,stack:e.stack||null}};else if(typeof Blob<"u"&&e instanceof Blob){let i=t.blobBytes.get(e);typeof File<"u"&&e instanceof File?o={[R]:"File",v:Tn(i),n:e.name,t:e.type||"",m:e.lastModified}:o={[R]:"Blob",v:Tn(i),t:e.type||""}}else if(typeof FormData<"u"&&e instanceof FormData){let i=t.fdEntries.get(e)||[...e.entries()],s=[];for(let[a,c]of i)s.push([a,ht(c,t)]);o={[R]:"FD",v:s}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)o=lf(e);else if(e instanceof Map){let i=[];for(let[s,a]of e)i.push([ht(s,t),ht(a,t)]);o={[R]:"Map",v:i}}else if(e instanceof Set){let i=[];for(let s of e)i.push(ht(s,t));o={[R]:"Set",v:i}}else if(Array.isArray(e))o=e.map(i=>ht(i,t));else{o={};for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let s=bf(i)?"_"+i:i;ec(o,s,ht(e[i],t))}}if(r!==void 0){if(Array.isArray(o))return{[R]:"Arr",_id:r,v:o};o._id=r}return o}function lf(e){if(e instanceof ArrayBuffer)return{[R]:"buf",v:Tn(new Uint8Array(e))};if(e instanceof DataView)return{[R]:"dv",v:Tn(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=uf[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[R]:n,v:Tn(r)}}function df(){return{refs:new Map}}function We(e,t){if(e===null||typeof e!="object")return e;if(Array.isArray(e)){let i=[];for(let s=0;s<e.length;s++)i.push(We(e[s],t));return i}let n=e[R];if(typeof n=="string")return pf(e,n,t);let r={},o=e._id;typeof o=="number"&&t.refs.set(o,r);for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i)||i==="_id")continue;let s=yf(i)?i.slice(1):i;ec(r,s,We(e[i],t))}return r}function pf(e,t,n){let r=e._id,o=i=>(typeof r=="number"&&n.refs.set(r,i),i);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 i=new Error(e.v.message);return i.name=e.v.name,e.v.stack&&(i.stack=e.v.stack),typeof r=="number"&&n.refs.set(r,i),i}case"Map":{let i=new Map;typeof r=="number"&&n.refs.set(r,i);for(let[s,a]of e.v)i.set(We(s,n),We(a,n));return i}case"Set":{let i=new Set;typeof r=="number"&&n.refs.set(r,i);for(let s of e.v)i.add(We(s,n));return i}case"Arr":{let i=[];typeof r=="number"&&n.refs.set(r,i);for(let s of e.v)i.push(We(s,n));return i}case"Ref":{let i=n.refs.get(e.v);if(i===void 0)throw new TypeError(`Dangling reference: id=${e.v}`);return i}case"Blob":{if(typeof Blob>"u")throw new TypeError("Blob is not available in this environment.");let i=En(e.v);return o(new Blob([i],{type:e.t||""}))}case"File":{if(typeof File>"u")throw new TypeError("File is not available in this environment.");let i=En(e.v);return o(new File([i],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 i=new FormData;o(i);for(let[s,a]of e.v){let c=We(a,n);i.append(s,c)}return i}default:{if(t==="buf"){let s=En(e.v);return o(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength))}if(t==="dv"){let s=En(e.v);return o(new DataView(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)))}let i=ff[t];if(i){let s=En(e.v),a=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength);return o(new i(a))}throw new TypeError(`Unknown serialization tag: ${t}`)}}}function hf(e){return e!==null&&typeof e=="object"}function mf(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function bf(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function yf(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}function Tn(e){if(rc)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 En(e){if(rc){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 R,sf,uf,ff,rc,Nn=w(()=>{R="_$wj",sf=new Set(["__proto__","constructor","prototype"]);uf={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},ff={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};rc=typeof Buffer<"u"&&typeof Buffer.from=="function"});var _c={};Bs(_c,{observeLazy:()=>Hf,observeViewportOnce:()=>Kf});function wc(e){let t=zi.get(e);return t||(t=import(e).finally(()=>zi.delete(e)),zi.set(e,t),t)}function Hf(e){for(let[t,n]of Object.entries(e))Ve.set(t.toLowerCase(),n);if(typeof IntersectionObserver>"u"){for(let t of Ve.values())wc(t);Ve.clear();return}Ln||(Ln=new IntersectionObserver(Uf,{rootMargin:"200px"})),gc(),!Vi&&typeof MutationObserver<"u"&&(Vi=new MutationObserver(()=>gc()),Vi.observe(document.body,{childList:!0,subtree:!0}))}function gc(){if(!(!Ln||!Ve.size))for(let e of Ve.keys()){if(customElements.get(e)){Ve.delete(e);continue}for(let t of document.querySelectorAll(e))Ln.observe(t)}}function Uf(e){for(let t of e){if(!t.isIntersecting)continue;let n=t.target.tagName.toLowerCase(),r=Ve.get(n);r&&(wc(r),Ve.delete(n),Ln?.unobserve(t.target))}}function qf(e){for(let t of e){if(!t.isIntersecting)continue;let n=Yr.get(t.target);Yr.delete(t.target),On?.unobserve(t.target),n&&n()}}function Kf(e,t){return typeof IntersectionObserver>"u"?(t(),()=>{}):(On||(On=new IntersectionObserver(qf,{rootMargin:"200px"})),Yr.set(e,t),On.observe(e),()=>{Yr.delete(e),On?.unobserve(e)})}var Ve,Ln,Vi,zi,On,Yr,Sc=w(()=>{Ve=new Map,Ln=null,Vi=null,zi=new Map;On=null,Yr=new WeakMap});var Gi,Yi=w(()=>{Gi=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(()=>(Sc(),_c)).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(()=>(Jr(),Ac)).then(({loadFrame:n})=>{this._webjsLoadedSrc!==t||!this.isConnected||n(this,t)})}}:null;typeof customElements<"u"&&Gi&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",Gi)});function Vf(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 Xi(e,t){let n=t||(typeof document<"u"?document:null);if(!n)return;let r=null;if(typeof e=="string"){let i=n.createElement("template");i.innerHTML=e,r=i.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 i of o)n.body.append(i);else n.body.append(r)}var Wf,Ji,jn=w(()=>{Wf=new Set(["append","prepend","before","after","replace","update"]);Ji=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 s=n.getElementById(o);s&&(r=[s])}else{let s=this.getAttribute("targets");if(s)try{r=Array.from(n.querySelectorAll(s))}catch{r=[]}}let i=Wf.has(t)?this.querySelector("template"):null;try{for(let s of r){let a=i?i.content.cloneNode(!0):null;Vf(t,s,a)}}finally{this.remove()}}}:null;typeof customElements<"u"&&Ji&&!customElements.get("webjs-stream")&&customElements.define("webjs-stream",Ji)});var vc,xc=w(()=>{vc=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this.style.display||(this.style.display="contents")}}:null;typeof customElements<"u"&&vc&&!customElements.get("webjs-suspense")&&customElements.define("webjs-suspense",vc)});function Xr(e,t){let n=typeof document<"u"?document:null,r=e||n;if(!r||typeof r.querySelectorAll!="function")return;if(t&&t.frame===!0){Zi(r,!0);return}Nc();let o=r===n,i=!!n&&!o&&typeof n.contains=="function"&&n.contains(r),s=!!n&&!o&&!i;s&&(Zi(n,!0),ze.clear(),es.clear()),(o||s)&&(Qi=!0);let a=D.ingested+D.replaced;Yf(Zi(r),a)}function Zi(e,t){let n=null;for(let r of e.querySelectorAll('script[type="application/json"]#__webjs-seeds, script[type="application/json"][data-webjs-seeds]')){let o=Gf(r.getAttribute?.("data-webjs-dev"));o!==null&&(n=o),Ec(t?null:r.textContent,r)}for(let r of e.querySelectorAll("[data-webjs-seed]"))Ec(t?null:r.getAttribute("data-webjs-seed"),r,()=>r.removeAttribute("data-webjs-seed"));return n}function Ec(e,t,n){if(e)try{let r=mt(e);if(r&&typeof r=="object")for(let o in r){ze.has(o)?D.replaced++:D.ingested++,ze.set(o,r[o]);let i=o.indexOf("/",o.indexOf("/")+1);i>0&&es.add(o.slice(0,i))}}catch{}n?n():t.remove?.()}function Gf(e){return typeof e!="string"?null:e||"ok"}function Yf(e,t){if(e===null)return;let n=++zf;Ht={epoch:n,hits:D.hits,misses:D.misses,keyMisses:D.keyMisses,merged:t,marker:e};let r=()=>{!Ht||Ht.epoch!==n||Nc()};try{typeof requestIdleCallback=="function"?requestIdleCallback(r,{timeout:1e3}):setTimeout(r,250)}catch{Ht=null}}function Nc(){let e=Ht;if(Ht=null,!!e)try{Jf(e)}catch{}}function Jf(e){let t=D.hits-e.hits,n=D.misses-e.misses,r=D.ingested+D.replaced-e.merged,o=D.keyMisses-e.keyMisses;if(n===0)return;let i=e.marker==="streamed"?"This page streams (a Suspense or <webjs-suspense> boundary), and a streamed render emits no seeds, so every action call on it goes to the network.":e.marker==="drop"?"The page's seeds could not be serialized, so the whole block was dropped. Something an action returned is not serializer-safe; the server response reports collected above emitted.":o===0?null:"The key is the action file hash plus the function name plus the serialized arguments, so an argument the SSR render never used misses (a deliberate refetch after hydration misses too, and is expected). A miss on an action this page never seeded is NOT counted here, because a mutation or a client-only read could never have been seeded.";if(i===null)return;let a=e.marker==="streamed"||e.marker==="drop"?`${n} of ${t+n} action call(s) in the hydration window went to the network`:`${o} action call(s) in the hydration window asked for a key this page seeded under DIFFERENT arguments`;console.warn(`[webjs] SSR action seeding: ${a} (${r} seed(s) on this page, ${ze.size} still unconsumed). ${i} See https://webjs.dev/docs/data-fetching for the seeding reference.`)}function Xf(e,t,n){Qi||(Qi=!0,Xr());let r=`${e}/${t}/${n}`;if(ze.has(r)){let o=ze.get(r);return ze.delete(r),D.hits++,o}return D.misses++,es.has(`${e}/${t}`)&&D.keyMisses++,Tc}function Zf(){return{...D,pending:ze.size}}var ze,Tc,Qi,D,es,Ht,zf,Zr=w(()=>{Nn();ze=new Map,Tc=Symbol("webjs.seed.miss"),Qi=!1,D={ingested:0,replaced:0,hits:0,misses:0,keyMisses:0},es=new Set,Ht=null,zf=0});function ts(e){if(!(!Array.isArray(e)||!e.length)){Qr+=1;for(let t of e)t&&Cc.set(t,Qr)}}function ed(){return Qr}function td(e,t,n){if(!(!Array.isArray(t)||!t.length)&&(Ut.delete(e),Ut.set(e,{tags:t.slice(),since:typeof n=="number"?n:Qr}),Ut.size>Qf)){let r=Ut.keys().next().value;r!==void 0&&Ut.delete(r)}}function nd(e){let t=Ut.get(e);if(!t)return!1;for(let n of t.tags)if((Cc.get(n)||0)>t.since)return!0;return!1}function ns(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}var Qr,Cc,Ut,Qf,eo=w(()=>{Qr=0,Cc=new Map,Ut=new Map,Qf=1e3});function kc(e){return qt.test(e)}function no(e){let t=is(e);return t.includes("stylesheet")&&!t.includes("alternate")}function is(e){return(e.getAttribute("rel")||"").toLowerCase().split(/\s+/)}var rs,os,qt,Pn,yt,Ne,to,Rc,se,I=w(()=>{rs="text/vnd.webjs-stream.html",os=["wheel","touchmove","keydown","pointerdown"],qt=/\.(?: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,Pn="_top",yt="webjs:nav-fallback",Ne=new Set(["value","checked","selected","indeterminate","disabled","open","popover"]),to="name=csp-nonce";Rc=250,se="data-webjs-preload-style"});function Ge(e,t,n="warn"){if(ss.has(e)||(ss.add(e),typeof console>"u"))return;let r=n==="error"?console.error:console.warn;r&&r.call(console,t)}function Lc(e,t,n,r){if(typeof process<"u"&&process.env||!r.has(H))return;let o="";try{o=new URL(e.getAttribute("action")||location.href,location.href).pathname}catch{o=location.pathname}if(n!=="post"){Ge(`submit-nowhere:${o}:${n}`,`[webjs] this submission carries a bound server action's identity but submits as ${n.toUpperCase()}, which sends no body, so the identity rides the query string and the action never runs. A submitter's own formmethod overrides the form's, and WebJs honours it rather than refusing it, so check for a formmethod on the button that was pressed.`,"error");return}let i=t&&t.getAttribute("formenctype")||e.getAttribute("enctype")||"application/x-www-form-urlencoded";if(i.toLowerCase()==="text/plain"){Ge(`submit-nowhere:${o}:${i}`,`[webjs] this submission carries a bound server action's identity but declares enctype="${i}", which the server cannot parse. The router declines to send it so both paths behave the same way, and both are answered with a 405. Drop the enctype and let the binding supply it.`,"error");return}o&&o!==location.pathname&&Ge(`submit-elsewhere:${o}`,`[webjs] this submission carries a bound server action's identity but posts to "${o}" rather than this page, because the enclosing <form> declares its own action. A bound submitter emits no formaction, so the form's target wins, which is what native HTML does. The action runs only if "${o}" is a page route; against a route.ts or another origin the identity is ignored and nothing runs. Drop the form's action attribute to keep the submission on this page.`)}function cs(e,t){return!e&&!t&&typeof document<"u"&&document.readyState==="loading"}function ro(e,t,n,r){if(e!=="navigate"||!t||r&&r===n)return!1;try{return new URL(t).origin===new URL(n).origin}catch{return!1}}function jc(){if(typeof location>"u"||Oc)return;Oc=!0;let e=null;try{e=sessionStorage.getItem(yt),sessionStorage.removeItem(yt)}catch{}let t="";try{let n=performance.getEntriesByType("navigation")[0];t=n?n.type:""}catch{}ro(t,document.referrer,location.href,e)&&ae("pre-boot-navigation",location.href,!1)}function ae(e,t,n=!0){if(n)try{sessionStorage.setItem(yt,t)}catch{}if(typeof document<"u"&&typeof CustomEvent<"u")try{document.dispatchEvent(new CustomEvent("webjs:navigation-fallback",{detail:{cause:e,href:t,willReload:n}}))}catch{}typeof process<"u"&&process.env||Ge(`fallback:${e}`,n?`[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.`:`[webjs] client router degraded a soft navigation (${e}) for ${t}, without a full page load.`)}function Pc(e){typeof process<"u"&&process.env||Ge(`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 Mc(){if(typeof process<"u"&&process.env||as||typeof document>"u"||typeof getComputedStyle!="function")return;let e=document.documentElement;if(!e)return;as=!0;let t;try{t=getComputedStyle(e).scrollBehavior}catch{return}t==="smooth"&&Ge("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 Mn(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 Ic(){ss.clear(),as=!1}function Fc(e,t){return cs(e,t)}var ss,Oc,as,ce=w(()=>{Fe();I();ss=new Set;Oc=!1;as=!1});function le(e){let t=new Map,n=[],r=!1;function o(i){if(!r){if(i.nodeType===8){let s=i.data.trim();if(s.startsWith("wj:children:")){let a=s.slice(12),c=a.lastIndexOf(":");if(c<=0||c===a.length-1){r=!0;return}let l=a.slice(0,c),u=a.slice(c+1);if(t.has(l)||n.some(f=>f.segment===l)){r=!0;return}n.push({segment:l,routeKey:u,start:i});return}if(s.startsWith("/wj:children")){let a=s.slice(12).replace(/^:/,""),c=n.pop();if(!c||c.segment!==a){r=!0;return}if(c.start.parentNode!==i.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:i});return}return}if(i.hasChildNodes&&i.hasChildNodes())for(let s=i.firstChild;s&&!r;s=s.nextSibling)o(s)}}return o(e),r||n.length>0?null:t}function Kt(e,t){return e===t||e.startsWith(t==="/"?"/":t+"/")}function In(e,t){let n=[...e.keys()].filter(s=>t.has(s)).sort((s,a)=>s.length-a.length);if(n.length===0)return null;for(let s of n)if(e.get(s).routeKey!==t.get(s).routeKey){let a=null;for(let c of n){if(c===s)break;s!==c&&Kt(s,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=s=>{let a=null;for(let c of s.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 Se(){let e=le(document.body);return e?[...e.entries()].map(([t,n])=>`${t}:${n.routeKey}`).join(","):""}var Ce=w(()=>{});function $c(e){Ae=e||(t=>{location.href=t})}function Dc(){return T}function Bc(){return++T}function oo(){return++T}function ls(e){Y=e}function Hc(e){Fn=e}function Uc(e){let t=Fn!==null&&Fn===e;return Fn=null,t}function io(){Fn=null}var T,Ae,Y,Fn,ke=w(()=>{T=0,Ae=e=>{location.href=e};Y=!1;Fn=null});function gt(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"&&rd()?Document.parseHTMLUnsafe(e):od(e)}function rd(){if(Wt!==null)return Wt;try{Wt=Document.parseHTMLUnsafe("<!doctype html><body><!--c--><i></i>")?.body?.firstChild?.nodeType===8}catch{Wt=!1}return Wt}function us(){Wt=null}function od(e){return typeof DOMParser>"u"?null:new DOMParser().parseFromString(e,"text/html")}var Wt,$n=w(()=>{Wt=null});function so(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function fs(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=typeof ShadowRoot<"u"&&r instanceof ShadowRoot?r.host:null}return null}var ao=w(()=>{});function Dn(e,t){return((t&&t.hasAttribute("formmethod")?t.getAttribute("formmethod")||"":e.getAttribute("method")||"")||"get").toLowerCase()}function Bn(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function id(e){let t=String(e||"").toLowerCase();return t==="multipart/form-data"?"multipart/form-data":t==="text/plain"?"text/plain":"application/x-www-form-urlencoded"}function Hn(e,t){return id(t&&t.hasAttribute("formenctype")?t.getAttribute("formenctype"):e.getAttribute("enctype"))}function Un(e,t){if(t==="multipart/form-data")return e;let n=new URLSearchParams;for(let[r,o]of e)n.append(r,typeof o=="string"?o:o.name);return n}function qn(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}}var co=w(()=>{});function Re(e){return e.tagName==="LINK"&&!!e.getAttribute("href")&&no(e)}function ad(e){return((e.hasAttribute(J)?e.getAttribute(J):e.getAttribute("media"))||"").trim()}function lo(e,t){let n=e.getAttribute("href");if(!n)return null;try{let r=new URL(n,t);r.searchParams.delete(sd);let o=ad(e);return o&&o!=="all"?`${r.href} ${o}`:r.href}catch{return null}}function uo(){if(!(typeof document>"u"||!document.head))for(let e of document.querySelectorAll("link[href]")){if(Kn.has(e)||!Re(e))continue;let t=lo(e,document.baseURI);t&&Kn.set(e,t)}}function qc(e){let t=Kn.get(e);return t||(t=lo(e,document.baseURI)||"",t&&Kn.set(e,t)),t||null}function hs(e){e.hasAttribute(J)||(e.setAttribute(J,e.getAttribute("media")||""),e.setAttribute("media","not all"))}function ps(e){if(!e.hasAttribute(J))return;let t=e.getAttribute(J);e.removeAttribute(J),t?e.setAttribute("media",t):e.removeAttribute("media")}function Kc(e,t){if(t?e.setAttribute(Ye,""):e.removeAttribute(Ye),!t){ps(e),e.sheet&&(e.sheet.disabled=!1);return}if(e.sheet){e.sheet.disabled=!0;return}if(hs(e),ds.has(e))return;ds.add(e);let n=()=>{e.removeEventListener("load",n),e.removeEventListener("error",n),ds.delete(e),e.hasAttribute(Ye)&&(ps(e),e.sheet&&(e.sheet.disabled=!0))};e.addEventListener("load",n),e.addEventListener("error",n)}function ms(e,t){let n=null,r=null;for(let o of document.head.querySelectorAll(`link[${ve}]`))o===e||!Re(o)||(r||(r=o),Kt(t,o.getAttribute(ve))&&(n=o));n?n.after(e):r?r.before(e):document.head.appendChild(e)}function fo(e={}){let t=e.base||(typeof document<"u"?document.baseURI:""),n=new Map,r=new Map;for(let o of document.querySelectorAll("link[href]")){if(!Re(o))continue;let i=o.parentNode===document.head;if(!i&&e.leaving&&e.leaving(o))continue;let s=qc(o);if(!s)continue;let a=o.hasAttribute(se)?i?r:null:n;a&&!a.has(s)&&a.set(s,o)}return(o,i)=>{if(o.hasAttribute(Ye)||o.hasAttribute(se))return!0;let s=lo(o,t);if(!s)return!1;let a=o.getAttribute(ve),c=n.get(s);if(c){if(e.frame)return!0;let f=c.hasAttribute(Ye);f&&Kc(c,!1);let d=c.getAttribute(ve);return a&&d!==null&&d!==a&&(!f&&!(e.segment!=null&&Kt(d,e.segment))&&Kt(a,d)||c.setAttribute(ve,a)),!0}let l=e.frame?null:r.get(s);if(l){for(let f of o.attributes)f.name==="href"||f.name==="nonce"||(f.name==="media"&&l.hasAttribute(J)?l.setAttribute(J,f.value):l.setAttribute(f.name,f.value));return l.removeAttribute(se),r.delete(s),n.set(s,l),!0}if(!a)return!1;if(e.frame)return!0;let u=i(o);try{u.setAttribute("href",new URL(o.getAttribute("href"),t).href)}catch{}return ms(u,a),Kn.set(u,s),n.set(s,u),!0}}function po(){if(!(typeof document>"u"||!document.head))for(let e of document.head.querySelectorAll(`link[${J}]`))e.hasAttribute(Ye)||ps(e)}function bs(e,t,n){if(typeof document>"u"||!document.head)return;let r=n||document.baseURI,o=new Set;if(t)for(let i of t.querySelectorAll("link[href]")){if(!Re(i)||i.hasAttribute(Ye)||i.hasAttribute(se))continue;let s=lo(i,r);s&&o.add(s)}for(let i of document.head.querySelectorAll(`link[${ve}]`)){if(i.hasAttribute(se)||i.hasAttribute(Ye)||i.hasAttribute("disabled")||!Re(i))continue;let s=i.getAttribute(ve);if(!Kt(s,e))continue;let a=qc(i);a&&o.has(a)||Kc(i,!0)}}var ve,Ye,J,sd,Kn,ds,Wn=w(()=>{Ce();I();ve="data-wj-style-owner",Ye="data-wj-style-off",J="data-wj-style-media",sd="__webjs_dev";Kn=new WeakMap;ds=new WeakSet});function mo(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function Vn(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=mo();return n&&t.setAttribute("nonce",n),t.textContent=e.textContent,t}function wt(e){if(!e.hasAttribute("nonce"))return e.cloneNode(!0);let t=e.cloneNode(!0),n=mo();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function Q(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function ho(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 cd(e){if(!e.querySelector("meta"))return;let t=o=>{let i=new Map;for(let s of o.querySelectorAll("meta")){let a=ho(s);if(!a||a===to)continue;let c=i.get(a);c?c.push(s):i.set(a,[s])}return i},n=t(e),r=t(document.head);for(let[o,i]of n){let s=r.get(o)||[],a=i.map(Q).join(`
|
|
2
|
-
`),c=s.map(
|
|
3
|
-
`);if(a!==c){if(i.length===1&&s.length===1){let l=s[0];for(let u of[...l.attributes])l.removeAttribute(u.name);for(let u of i[0].attributes)l.setAttribute(u.name,u.value);continue}for(let l of s)l.remove();for(let l of i)document.head.appendChild(wt(l))}}for(let[o,i]of r)if(!n.has(o))for(let s of i)s.remove()}function Vt(e,t={}){let n=t.styles===!1?null:fo(t),r=e.querySelector("title");r&&(document.title=r.textContent||"");let o=new Set;for(let i of document.head.children)o.add(Q(i));for(let i of e.children)i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&i.tagName!=="TITLE"&&(i.tagName==="META"&&ho(i)||Re(i)&&(!n||n(i,wt))||o.has(Q(i))||(i.tagName==="SCRIPT"?document.head.appendChild(Vn(i)):document.head.appendChild(wt(i))));cd(e)}function ys(e,t={}){let n=fo(t),r=new Set;for(let o of document.head.children)r.add(Q(o));for(let o of e.children)!Re(o)||n(o,wt)||r.has(Q(o))||document.head.appendChild(wt(o))}function ld(e){return e.tagName==="STYLE"?!0:e.tagName==="LINK"&&is(e).includes("stylesheet")}function zn(e,t={}){let n=t.styles===!1?null:fo(t),r=document.head,o=e.querySelector("title");o&&(document.title=o.textContent||"");let i=new Set;for(let a of r.children)a.tagName==="SCRIPT"&&a.getAttribute("type")==="importmap"||a.tagName!=="BASE"&&i.add(Q(a));let s=new Set;for(let a of e.children)a.tagName==="SCRIPT"&&a.getAttribute("type")==="importmap"||a.tagName!=="BASE"&&s.add(Q(a));for(let a of[...r.children])a.tagName==="SCRIPT"&&a.getAttribute("type")==="importmap"||a.tagName!=="BASE"&&a.tagName!=="TITLE"&&(ld(a)||a.tagName==="META"&&ho(a)===to||s.has(Q(a))||a.remove());for(let a of e.children)a.tagName==="SCRIPT"&&a.getAttribute("type")==="importmap"||a.tagName!=="BASE"&&a.tagName!=="TITLE"&&(a.tagName==="META"&&ho(a)===to||Re(a)&&(!n||n(a,wt))||i.has(Q(a))||(a.tagName==="SCRIPT"?r.appendChild(Vn(a)):r.appendChild(wt(a))))}var zt=w(()=>{I();Wn()});function go(e){let t=e;for(;t;){let n=t.closest("webjs-frame");if(n&&n.id)return n.id;let r=t.getRootNode();if(typeof ShadowRoot<"u"&&r instanceof ShadowRoot)t=r.host;else break}return null}function ue(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===Pn)return null;let r=typeof document<"u"?document.getElementById(n):null;return r&&r.tagName&&r.tagName.toLowerCase()==="webjs-frame"?n:(Ge(`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 go(e)}function gs(e){if(!e||typeof document>"u")return null;let t=null;try{t=document.querySelector(`webjs-frame#${CSS.escape(e)}`)}catch{t=document.getElementById(e)}return!t||!t.tagName||t.tagName.toLowerCase()!=="webjs-frame"?null:t}function Gn(e,t){let n=gs(e);if(!n)return null;let r=bo.has(n);return bo.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 Yn(e,t){if(bo.get(e)!==t)return;bo.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 Jn(e,t,n){let r=yo.has(e);return yo.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 Xn(e,t,n,r){if(yo.get(e)!==t)return;yo.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 ws(e){if(!e||!e.head)return"";let t=e.head.querySelectorAll('[data-webjs-track="reload"]');if(!t.length)return"";let n="";for(let r of t)n+=Q(r);return n}var bo,yo,Je=w(()=>{I();ce();zt();bo=new WeakMap;yo=new WeakMap});function zc(e,t){if(typeof document>"u"||!document.documentElement)return()=>{};ee&&ee();let n=document.documentElement,r=n.style.getPropertyValue("overflow-anchor");n.style.setProperty("overflow-anchor","none");let o=null,i=typeof t=="number",a=i&&typeof setTimeout=="function"?setTimeout(()=>{i=!1},Rc):null,c=typeof t=="number"&&typeof window<"u"?()=>{i&&(Math.abs(window.scrollY-t)<=1&&Math.abs(window.scrollX-(e||0))<=1||window.scrollTo({left:e||0,top:t,behavior:"instant"}))}:null,l=()=>{if(ee===l){if(ee=null,o&&(clearTimeout(o),o=null),a&&clearTimeout(a),i=!1,typeof window<"u"){for(let u of os)window.removeEventListener(u,l,{capture:!0});c&&window.removeEventListener("scroll",c)}r?n.style.setProperty("overflow-anchor",r):n.style.removeProperty("overflow-anchor")}};if(ee=l,o=setTimeout(l,2e3),typeof window<"u"){for(let u of os)window.addEventListener(u,l,{capture:!0,passive:!0});c&&window.addEventListener("scroll",c,{passive:!0})}return l}function Gc(e){if(typeof document>"u"||!document.documentElement)return()=>{};if(te&&te(),!(e>0))return()=>{};let t=document.documentElement,n=t.style.getPropertyValue("min-height");t.style.setProperty("min-height",e+"px");let r=null,o=()=>{te===o&&(te=null,r&&(clearTimeout(r),r=null),n?t.style.setProperty("min-height",n):t.style.removeProperty("min-height"))};return te=o,r=setTimeout(o,2e3),o}function _o(e){if(typeof requestAnimationFrame!="function"){setTimeout(e,0);return}requestAnimationFrame(()=>requestAnimationFrame(e))}function So(){wo+=1}function Zn(e,t){let n=Wc(e)||Wc(t);return n?(n.getAttribute("data-preserve-scroll")||"").toLowerCase().trim()!=="false":!1}function Wc(e){return!e||typeof e.closest!="function"?null:e.closest("[data-preserve-scroll]")}var ee,te,wo,Ao=w(()=>{I();ee=null;te=null;wo=0});function _s(e){if(!Y||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=so(e);if(!t||t.hasAttribute("download")||t.target&&t.target!=="_self")return;let n=t.href;if(!n)return;let r=new URL(n);if(r.origin!==location.origin)return;if(r.pathname===location.pathname&&r.search===location.search&&r.href.includes("#")){Hc(r.href);return}if(t.hasAttribute("data-no-router")||qt.test(r.pathname))return;e.preventDefault();let o=ue(t);Qn(n,!1,o,{preserveScroll:Zn(t)})}function Gt(e){Yc(location.href)||Qn(location.href,!0,null)}function Yt(e){if(!Y||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.hasAttribute("formtarget")?n.getAttribute("formtarget")||"":t.getAttribute("target")||"";if(r&&r!=="_self")return;let o=Dn(t,n);if(o==="dialog")return;let i=Hn(t,n),s=o==="get"||o==="head",a=Bn(t,n),c;try{c=new URL(a,location.href)}catch{return}if(c.origin!==location.origin||qt.test(c.pathname))return;let l=qn(t,n);if(Lc(t,n,o,l),!s&&i==="text/plain")return;let u=Un(l,i);e.preventDefault();let f=ue(n||t),d=Zn(n||t,t);Jc(c.href,o,u,f,t,{preserveScroll:d})}var vo=w(()=>{ao();I();ke();ce();co();Je();Ao();er()});function Ss(e){let t=xe(e);document.dispatchEvent(new CustomEvent("webjs:before-cache",{detail:{url:e}})),C.has(t)&&C.delete(t);let n={html:document.documentElement.outerHTML,scrollX:typeof window<"u"&&window.scrollX||0,scrollY:typeof window<"u"&&window.scrollY||0,scrollHeight:typeof document<"u"&&document.documentElement&&document.documentElement.scrollHeight||0};for(C.set(t,n);C.size>16;){let r=C.keys().next().value;C.delete(r)}}function Xc(e){let t=xe(e),n=C.get(t);return n==null?null:(C.delete(t),C.set(t,n),n)}function xe(e,t){let n=new URL(e,location.href),r=n.pathname+n.search;return t?`${t} ${r}`:r}var C,Jt=w(()=>{I();C=new Map});function bd(e){let t=Ee.get(e);return t==null?!1:ir()-t>=As?(Ee.delete(e),!1):!0}function nn(){Ee.clear()}function yd(e){for(Ee.has(e)&&Ee.delete(e),Ee.set(e,ir());Ee.size>md;)Ee.delete(Ee.keys().next().value)}function sr(){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 xo(){try{if(typeof matchMedia=="function")return matchMedia("(hover: hover) and (pointer: fine)").matches}catch{}return!0}function gd(e){let t=e.getAttribute("rel");return t?t.toLowerCase().split(/\s+/).filter(Boolean):[]}function en(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.href.includes("#")||qt.test(n.pathname)?null:t}function Eo(e){if(e.hasAttribute("data-no-prefetch"))return!0;let t=gd(e);return t.includes("external")||t.includes("no-prefetch")}function tn(e){if(Eo(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 xo()?"intent":"viewport"}}function Ze(e,t){if(!Y||typeof fetch!="function"||sr())return;let n=xe(e,t);if(typeof location<"u"&&n===xe(location.href,t)||Oe.has(n)||tr.has(n))return;let r=E.get(n);if(r&&ir()-r.at<As||bd(n))return;if(Oe.size>=Zc){for(tr.add(n),Zt.push({href:e,frameId:t||null});Zt.length>dd;){let s=Zt.shift();tr.delete(xe(s.href,s.frameId))}return}let o=Se();if(!o&&typeof document<"u"&&document.readyState==="loading")return;Oe.add(n);let i={"x-webjs-router":"1","x-webjs-prefetch":"1"};o&&(i["x-webjs-have"]=o),t&&(i["x-webjs-frame"]=t),fetch(e,{method:"GET",headers:i,credentials:"same-origin",cache:"no-cache"}).then(async s=>{let a=s.headers.get("content-type")||"";if(!/^text\/html\b/i.test(a)||s.status>=400)return;let c=s.headers.get("x-webjs-build"),l=s.headers.get("x-webjs-src"),u=typeof document<"u"?document.querySelector('script[type="importmap"]'):null,f=u?u.getAttribute("data-webjs-build"):null,d=u?u.getAttribute("data-webjs-src"):null;if((c&&f&&c!==f||l&&d&&l!==d)&&(C.clear(),St(n),nn()),(s.headers.get("x-webjs-frame")||null)!==(t||null)){yd(n);return}let b=s.redirected&&s.url?s.url:e,y=await s.text();or.has(n)||_d(n,{html:y,build:c,src:l,finalUrl:b,frameId:t||null,at:ir()})}).catch(()=>{}).finally(()=>{Oe.delete(n),or.delete(n),wd()})}function wd(){for(;Zt.length&&Oe.size<Zc;){let{href:e,frameId:t}=Zt.shift();tr.delete(xe(e,t)),Ze(e,t)}}function _d(e,t){for(E.has(e)&&E.delete(e),E.set(e,t);E.size>fd;){let n=E.keys().next().value;E.delete(n)}typeof document<"u"&&document.dispatchEvent(new CustomEvent("webjs:prefetch",{detail:{url:t.finalUrl,key:e,from:"prefetch"}}))}function To(e){let t=/<!--wj:children:([^>]*?)-->/.exec(e||"");return t?t[1]:null}function ar(e,t,n){let r=xe(e,n),o=E.get(r);if(!o)return null;if(ir()-o.at>=As)return E.delete(r),null;if(o.frameId)return E.delete(r),gs(o.frameId)?o:null;let i=To(o.html);return i&&!new Set(String(t??(Se()||"")).split(",").filter(Boolean)).has(i)?(E.delete(r),null):(E.delete(r),o)}function ir(){try{if(typeof performance<"u"&&typeof performance.now=="function")return performance.now()}catch{}return 0}function _t(e){if(!Y)return;let t=fs(e.target);if(!t)return;let n=tn(t);if(n==="none"||n==="render")return;let r=en(t);if(r){if(e.type==="touchstart"){Ze(r,ue(t));return}n==="intent"&&(nr===t&&Qt||(cr(),nr=t,Qt=setTimeout(()=>{Qt=null,nr=null,t.isConnected&&Ze(r,ue(t))},pd)))}}function vs(e){let t=fs(e.target);t&&t===nr&&cr()}function cr(){Qt&&(clearTimeout(Qt),Qt=null),nr=null}function No(){for(let e of rr)clearTimeout(e);rr.clear(),Xt=new WeakMap}function Co(){if(typeof document>"u"||sr())return;let e=typeof IntersectionObserver<"u";e&&(Xe?(Xe.disconnect(),No()):Xe=new IntersectionObserver(t=>{for(let n of t){let r=n.target;if(n.isIntersecting){if(Xt.has(r))continue;let o=setTimeout(()=>{rr.delete(o),Xt.delete(r),Xe.unobserve(r);let i=en(r);i&&tn(r)==="viewport"&&Ze(i,ue(r))},hd);Xt.set(r,o),rr.add(o)}else{let o=Xt.get(r);o&&(clearTimeout(o),rr.delete(o),Xt.delete(r))}}},{threshold:.5}));for(let t of document.querySelectorAll("a[href]")){let n=tn(t);if(n==="render"){let r=en(t);r&&Ze(r,ue(t))}else n==="viewport"&&e&&Xe.observe(t)}}function St(e){E.clear();for(let t of Oe)t!==e&&or.add(t)}function Qc(e,t){let n=xe(e,t);E.delete(n),Oe.has(n)&&or.add(n)}function el(e,t){return E.get(xe(e,t))||null}function tl(){return Oe.size}function nl(){E.clear(),Ee.clear(),Oe.clear(),or.clear(),Zt.length=0,tr.clear(),cr(),No()}function rl(){Xe&&(Xe.disconnect(),Xe=null)}var fd,As,Zc,dd,pd,hd,E,Ee,md,Oe,or,Zt,tr,Qt,nr,Xe,Xt,rr,At=w(()=>{ao();Ce();I();Je();ke();Jt();fd=8,As=3e4,Zc=3,dd=24,pd=100,hd=250,E=new Map,Ee=new Map,md=16;Oe=new Set,or=new Set,Zt=[],tr=new Set,Qt=null,nr=null,Xe=null,Xt=new WeakMap,rr=new Set});function xs(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 lr(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",i="<!--wj-stream-shell-->",s=/<\/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(i);if(l!==-1)return{shell:r.slice(0,l),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(l+i.length)};let u=r.indexOf(o);if(u!==-1)return{shell:r.slice(0,u),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(u)};if(c)return{shell:r,streaming:!1};let f=s.exec(r);if(f){let d=f.index+f[0].length;return{shell:r.slice(0,d),streaming:!0,reader:t,dec:n,rest:r.slice(d)}}}}function ko(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 i=1,s;for(;s=o.exec(e);)if(s[1]==="/"){if(i--,i===0)return{id:n,content:e.slice(r,s.index),rest:e.slice(s.index+s[0].length)}}else i++;return null}function Ro(e,t){let n=document.getElementById(e);if(!n){Pc(e);return}let r=document.createElement("template");r.innerHTML=t;let o=[...r.content.childNodes];n.replaceWith(r.content);for(let i of o)i.nodeType===1&&Oo(i)}async function ur(e,t,n,r){let o=n,i=()=>{let s;for(;s=ko(o);){if(!r())return!1;Ro(s.id,s.content),o=s.rest}return!0};if(!e){i();return}try{for(;;){if(!i()){try{await e.cancel()}catch{}return}let{value:s,done:a}=await e.read();if(s&&(o+=t.decode(s,{stream:!0})),a){o+=t.decode(),i();return}}}catch{}}var fr=w(()=>{ce();vt()});function on(){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 xt(e,t){let n=typeof document<"u"?document.startViewTransition:void 0;if(on()&&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 dr(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 i=null;try{i=t.querySelector(`#${CSS.escape(o)}`)}catch{i=null}if(!i||!r.hasAttribute||!r.hasAttribute("data-webjs-permanent"))continue;let s=i.parentNode;s&&i!==r&&(s.replaceChild(r,i),rn.add(r))}}function Le(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 i of o.querySelectorAll("[data-webjs-permanent][id]"))n.push(i)}if(n.length)for(let r of n){let o=r.id;if(!o)continue;let i=Sd(t,o);if(!i||i===r)continue;let s=i.parentNode;if(s)s.replaceChild(r,i),rn.add(r);else{let a=t.indexOf(i);a!==-1&&(t[a]=r,rn.add(r))}}}function Sd(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}var rn,Et=w(()=>{rn=new WeakSet});function ol(e,t){let n=[];for(let r=e.parentNode;r;r=r.parentNode)if(n.unshift(r),r===t)return n;return null}function al(e,t,n,r){let o=ol(e.start,n),i=ol(t.start,r);if(!o||!i||o.length!==i.length)return null;for(let s=1;s<o.length;s++)if(o[s].tagName!==i[s].tagName||Es(o[s]))return null;return{live:o,incoming:i,liveRange:e,incomingRange:t}}function il(e,t,n){let r=[],o=[],i=r;for(let s=e.firstChild;s;s=s.nextSibling)s===t&&(i=null),i&&i.push(s),s===n&&(i=o);return{before:r,after:o}}function Ad(e,t){for(let n of t.attributes)Ne.has(n.name)||n.name==="data-wj-serialized"||e.getAttribute(n.name)!==n.value&&e.setAttribute(n.name,n.value);for(let n of[...e.attributes])Ne.has(n.name)||t.hasAttribute(n.name)||e.removeAttribute(n.name)}function vd(e,t){let n=new Map;for(let s of e){if(s.nodeType!==1)continue;let a=ne(s);a&&n.set(a,s)}let r=new Set,o=0,i=[];for(let s of t){if(s.nodeType===1){let c=ne(s),l=c?n.get(c):null;if(l&&!r.has(l)){r.add(l),je(l,s),i.push(l),o=Math.max(o,e.indexOf(l)+1);continue}}let a=o;for(;a<e.length;a++){let c=e[a];if(r.has(c)||c.nodeType!==s.nodeType)continue;if(c.nodeType!==1)break;let l=c;if(!ne(l)&&l.tagName===s.tagName)break}if(a<e.length&&(s.nodeType===1||s.nodeType===3||s.nodeType===8)){let c=e[a];r.add(c),c.nodeType===1?je(c,s):c.nodeValue!==s.nodeValue&&(c.nodeValue=s.nodeValue),i.push(c),o=a+1;continue}i.push(s)}return i}function sl(e,t,n,r,o){let i=n.map(u=>document.importNode(u,!0));Le(t,i);let s=vd(t,i),a=new Set(s),c=r;if(o){let u=-1;for(let d=0;d<t.length;d++)a.has(t[d])&&(u=d);let f=t.slice(u+1);if(f.length){for(let d of f)a.add(d);c=f[0]}}for(let u of t)!a.has(u)&&u.parentNode===e&&e.removeChild(u);for(let u=s.length-1;u>=0;u--){let f=s[u];(f.parentNode!==e||f.nextSibling!==c)&&e.insertBefore(f,c),c=f}let l=new Set(t);return s.filter(u=>!l.has(u))}function cl(e){let{live:t,incoming:n,liveRange:r,incomingRange:o}=e,i=[];for(let s=0;s<t.length;s++){let a=t[s],c=n[s];s>0&&Ad(a,c);let l=s===t.length-1,u=l?r.start:t[s+1],f=l?r.end:t[s+1],d=l?o.start:n[s+1],p=l?o.end:n[s+1],b=il(a,u,f),y=il(c,d,p),h=[...sl(a,b.before,y.before,u,!1),...sl(a,b.after,y.after,null,s===0)];for(let g of h)g.nodeType===1&&i.push(Qe(g));for(let g of[b.before,b.after])for(let m of g)m.nodeType===1&&m.isConnected&&i.push(m)}for(let s of i)s.isConnected&&Pe(s)}var ll=w(()=>{I();Tt();vt();Et()});function Ct(e,t,n,r,o,i,s,a){let c=typeof location<"u"?location.href:"";if(r)try{c=new URL(r,c).href}catch{}uo();let l=!1,u=()=>{if(!l){l=!0;try{Xr(e,{frame:!!t})}catch{}}};try{for(let y of e.querySelectorAll("[data-wj-host]"))y.setAttribute("data-wj-serialized","")}catch{}try{typeof sessionStorage<"u"&&(!r||t||n)&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}if(r&&!t&&!n){let y=document.querySelector('script[type="importmap"]'),h=y?y.getAttribute("data-webjs-build"):null,g=!1;if(o&&h&&(g=o!==h),!g&&e.head&&e.head.children.length>0){let m=ws(document),_=ws(e);m!==_&&(g=!0)}if(g&&typeof location<"u"){C.clear(),St(),nn();try{let m="webjs:importmap-reload";if(sessionStorage&&sessionStorage.getItem(m))sessionStorage.removeItem(m),ae("deploy-mismatch-reload-suppressed",r,!1);else return sessionStorage&&sessionStorage.setItem(m,"1"),ae("deploy-mismatch",r),Ae(r),"none"}catch{return ae("deploy-mismatch",r),Ae(r),"none"}}else if(!g){let m=y?y.getAttribute("data-webjs-src"):null;i&&m&&i!==m&&(C.clear(),St(),nn(),y&&y.setAttribute("data-webjs-src",i));try{typeof sessionStorage<"u"&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}}}if(t){u();let y=document.querySelector(`webjs-frame#${CSS.escape(t)}`),h=e.querySelector(`webjs-frame#${CSS.escape(t)}`);if(y&&h){a&&a(),Vt(e.head,{base:c,frame:!0}),Me=xt(()=>{po(),hl(y,h),Qe(y),Pe(y),xs(e.body),Nt()},()=>Pe(y));return}let g=new CustomEvent("webjs:frame-missing",{bubbles:!0,cancelable:!0,detail:{frameId:t,url:r||(typeof location<"u"?location.href:null),document:e}});return(y||document).dispatchEvent(g),g.defaultPrevented||console.warn(`[webjs] frame "${t}" was not in the navigation response, leaving it unchanged. Handle "webjs:frame-missing" (preventDefault) to override.`),"none"}if(s==="shell"){u(),a&&a(),Ts(e,c,!0);return}let f=le(document.body),d=le(e.body),p=f&&d?In(f,d):null,b=p&&s==="layouts"?al(p.live,p.incoming,document.body,e.body):null;if(p&&s==="layouts"&&!b){u(),a&&a(),Ts(e,c,!0);return}if(p){u(),a&&a();let{mode:y,live:h,incoming:g}=p;Vt(e.head,{base:c,styles:!1});let m=_=>!!(h.start.compareDocumentPosition(_)&Node.DOCUMENT_POSITION_FOLLOWING)&&!!(h.end.compareDocumentPosition(_)&Node.DOCUMENT_POSITION_PRECEDING);Me=xt(()=>{ys(e.head,{base:c,segment:p.segment,leaving:m}),po(),y==="replace"?fl(h,g):dl(h,g,e),bs(p.segment,e,c),pl(h.start,g.start),b&&cl(b),xs(e.body),Nt()},()=>ul(h));return}if(r&&!n&&typeof location<"u")return ae(f?d?"no-shared-boundary":"incoming-boundaries-malformed":"live-boundaries-malformed",r),Ae(r),"none";if(r&&n)return ae("revalidation-discarded",r,!1),"discard";u(),a&&a(),Ts(e,c,!1)}function Ts(e,t,n){zn(e.head,{base:t,styles:!1}),dr(document.body,e.body);let r=[...e.body.childNodes];Me=xt(()=>{ys(e.head,{base:t,segment:"/",leaving:()=>!0}),po(),document.body.replaceChildren(...r),n&&bs("/",e,t),Qe(document.body),Pe(document.body),Nt()},()=>Pe(document.body))}var Me,pr=w(()=>{Zr();Ce();ce();Tt();Je();zt();ll();Wn();At();Jt();ke();fr();vt();Et();Me=Promise.resolve()});function ml(){Ns||typeof MutationObserver>"u"||typeof customElements>"u"||(Ns=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)}}),Ns.observe(document.body,{childList:!0,subtree:!0}))}function ul(e){if(!(!e||!e.start))for(let t=e.start.nextSibling;t&&t!==e.end;t=t.nextSibling)t.nodeType===1&&Pe(t)}function Pe(e){typeof customElements>"u"||Oo(e)}function Oo(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&&Oo(n.shadowRoot))}function Qe(e){if(e.tagName==="SCRIPT"){let n=Vn(e);return e.replaceWith(n),n}let t=[];rn.has(e)&&t.push(e);for(let n of e.querySelectorAll("[data-webjs-permanent]"))rn.has(n)&&t.push(n);for(let n of e.querySelectorAll("script"))t.length&&t.some(r=>r!==n&&r.contains(n))||n.replaceWith(Vn(n));return e}function hr(e){let t=[];for(let n=e.start.nextSibling;n&&n!==e.end;n=n.nextSibling)n.nodeType===1&&t.push(n);for(let n of t){let r=Qe(n);r.isConnected!==!1&&Pe(r)}}var Ns,vt=w(()=>{Ce();I();ce();Tt();$n();vo();co();Je();zt();At();Jt();fr();pr();Et();Ns=null});function Nt(){let e=document.activeElement;!e||e===document.body||e===document.documentElement||typeof e.blur=="function"&&e.blur()}function fl(e,t){let n=e.start.parentNode;if(!n)return;let r=[];for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)r.push(i);let o=[];for(let i=t.start.nextSibling;i&&i!==t.end;i=i.nextSibling)o.push(document.importNode(i,!0));Le(r,o);for(let i of r)i.parentNode===n&&n.removeChild(i);for(let i of o)n.insertBefore(i,e.end);hr(e)}function dl(e,t,n){if(!e||!t)return;let r=e.start.parentNode;if(!r)return;let o=[];for(let s=e.start.nextSibling;s&&s!==e.end;s=s.nextSibling)o.push(s);let i=[];for(let s=t.start.nextSibling;s&&s!==t.end;s=s.nextSibling)i.push(document.importNode(s,!0));Le(o,i),xd(r,e.start,e.end,o,i),hr(e)}function xd(e,t,n,r,o){let i=new Map;for(let c of r){if(c.nodeType!==1)continue;let l=ne(c);l&&i.set(l,c)}let s=n,a=[];for(let c of o){if(c.nodeType===1){let l=ne(c);if(l&&i.has(l)){let u=i.get(l);je(u,c),a.push(u),i.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,s)}function je(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),!Ne.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])Ne.has(r.name)||n.has(r.name)||e.removeAttribute(r.name);if(Es(e)){Td(e,t);return}sn(e,t)}function Es(e){let t=e;return t[Symbol.for("webjs.instance")]!=null||t[S]!=null}function Ed(e,t){for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!1;return!0}function Lo(e){let t=new Map,n=`slot[${A}][${N}="${M}"]`;for(let r of e.querySelectorAll(n)){let o=r;if(!Ed(o,e)||pi(e,o))continue;let i=!1;for(let a=o.parentElement;a&&a!==e;a=a.parentElement)if(a.tagName==="SLOT"&&a.hasAttribute(A)&&a.getAttribute(N)===M){i=!0;break}if(i)continue;let s=$(o.getAttribute("name"));t.has(s)||t.set(s,o)}return t}function pl(e,t){let n=e.parentNode;if(!n||n.nodeType!==1)return;let r=n;if(r.tagName!=="SLOT"||!r.hasAttribute(A))return;let o=null;for(let f=r.parentElement;f;f=f.parentElement){if(f[S]){o=f;break}if(f.tagName.includes("-"))return}if(!o)return;let i=$(r.getAttribute("name"));He(o,i,[...r.childNodes]);let s=t.parentNode;if(!s||s.nodeType!==1)return;let a=s;if(a.tagName!=="SLOT")return;let c=null;for(let f=a.parentElement;f;f=f.parentElement)if(f.tagName.includes("-")){c=f;break}if(!c||c.tagName!==o.tagName)return;let l=Lo(o),u=Lo(c);for(let f of new Set([...l.keys(),...u.keys()])){if(f===i)continue;let d=u.get(f);d?He(o,f,[...d.childNodes].map(p=>document.importNode(p,!0))):l.get(f)&&He(o,f,null)}}function Td(e,t){if(!e[S])return;let n=Lo(e),r=Lo(t);if(n.size===0&&r.size===0)return;let o=new Set([...n.keys(),...r.keys()]);for(let i of o){let s=n.get(i),a=r.get(i);s&&a?(sn(s,a),He(e,i,[...s.childNodes])):a?He(e,i,[...a.childNodes].map(c=>document.importNode(c,!0))):He(e,i,null)}}function sn(e,t){let n=[...e.childNodes],r=[...t.childNodes].map(a=>document.importNode(a,!0));Le(n,r);let o=new Map;for(let a of n){if(a.nodeType!==1)continue;let c=ne(a);c&&o.set(c,a)}let i=[];for(let a=0;a<r.length;a++){let c=r[a];if(c.nodeType===1){let l=ne(c);if(l&&o.has(l)){let f=o.get(l);je(f,c),i.push(f),o.delete(l);continue}let u=n[a];if(u&&u.nodeType===1&&!ne(u)&&u.tagName===c.tagName&&Nd(u,c)){je(u,c),i.push(u);continue}}else if(c.nodeType===3){let l=n[a];if(l&&l.nodeType===3){l.nodeValue!==c.nodeValue&&(l.nodeValue=c.nodeValue),i.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),i.push(l);continue}}i.push(c)}let s=new Set(i);for(let a of n)!s.has(a)&&a.parentNode===e&&e.removeChild(a);for(let a=0;a<i.length;a++){let c=i[a];(c.parentNode!==e||e.childNodes[a]!==c)&&e.insertBefore(c,e.childNodes[a]||null)}}function Nd(e,t){let n=e.localName;return n!=="input"&&n!=="select"&&n!=="textarea"?!0:!(e.getAttribute("name")!==t.getAttribute("name")||n==="input"&&(e.getAttribute("type")||"text").toLowerCase()!==(t.getAttribute("type")||"text").toLowerCase())}function ne(e){let t=e.getAttribute("data-key");return t?`${e.tagName}:k:${t}`:e.id?`${e.tagName}:i:${e.id}`:null}function an(){let e=le(document.body);if(!e||e.size===0)return null;let t=[...e.keys()].sort((c,l)=>l.length-c.length),n=null,r=null;for(let c of t){let l=document.getElementById(`wj-loading:${c}`);if(l instanceof HTMLTemplateElement){n=c,r=l;break}}if(n===null||r===null)return null;let o=e.get(n),i=Se(),s=[];for(let c=o.start.nextSibling;c&&c!==o.end;c=c.nextSibling)s.push(c);let a=document.createRange();return a.setStartAfter(o.start),a.setEndBefore(o.end),a.deleteContents(),o.start.parentNode.insertBefore(r.content.cloneNode(!0),o.end),{slot:o,oldChildren:s,token:T,haveKeys:i}}function et(e){if(!e||e.token!==T)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 hl(e,t){sn(e,t)}var Tt=w(()=>{Ue();Ce();I();ke();vt();Et()});function Cd(e){if(typeof document>"u"||!document.body)return!1;let t=le(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 i=document.createElement("div");i.setAttribute("role","alert"),i.setAttribute("data-webjs-nav-error","");let s=e?`This page could not be loaded. (status ${e})`:"This page could not be loaded.";i.textContent=s;let a=document.createRange();return a.setStartAfter(n.start),a.setEndBefore(n.end),a.deleteContents(),o.insertBefore(i,n.end),!0}function jo(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||Cd(t)||typeof location<"u"&&(ae("navigation-error-unrecoverable",e),Ae(e))}var bl=w(()=>{Ce();ce();ke()});function Cs(e){if(!no(e)||e.hasAttribute("disabled")||!e.getAttribute("href"))return!1;let t=e.hasAttribute(J)?e.getAttribute(J):e.getAttribute("media");if(t&&typeof matchMedia=="function")try{if(!matchMedia(t).matches)return!1}catch{return!1}return!0}function gl(e,t){return new Promise(n=>{let r=()=>{clearTimeout(o),e.removeEventListener("load",r),e.removeEventListener("error",r),n()},o=setTimeout(r,t);e.addEventListener("load",r),e.addEventListener("error",r)})}function wl(e,t,n,r=yl){if(typeof document>"u"||!e||!document.head)return null;let o=e;if(n)try{o=e.querySelector(`webjs-frame#${CSS.escape(n)}`)}catch{o=null}if(!o)return null;let i=t||document.baseURI,s=f=>{try{return new URL(f,i).href}catch{return null}},a=new Set;for(let f of document.querySelectorAll("link[href]")){if(f.hasAttribute(se)||!Cs(f))continue;let d=f.href;d&&a.add(d)}let c=mo(),l=[],u=[];for(let f of o.querySelectorAll("link[href]")){if(!Cs(f))continue;let d=s(f.getAttribute("href"));if(!d||a.has(d))continue;a.add(d);let p=document.createElement("link");p.rel="stylesheet",p.setAttribute(se,"");for(let y of["media","crossorigin","integrity","referrerpolicy"]){let h=f.getAttribute(y);h&&p.setAttribute(y,h)}c&&p.setAttribute("nonce",c),p.href=d,hs(p),l.push(p),u.push(gl(p,r));let b=f.getAttribute(ve);b?(p.setAttribute(ve,b),ms(p,b)):document.head.appendChild(p)}return l.length?{ready:Promise.all(u).then(()=>{}),copies:l}:null}function Po(e,t=yl){if(!(!e||typeof document>"u"))for(let n of e.copies){if(!n.isConnected||!n.hasAttribute(se))continue;let r=null;for(let o of document.querySelectorAll("link[href]"))if(!(o===n||o.hasAttribute(se)||!Cs(o))&&o.href===n.href){r=o;break}if(!r||r.sheet){n.remove();continue}gl(r,t).then(()=>n.remove())}}var yl,_l=w(()=>{I();Wn();zt();yl=2e3});async function mr(e,t,n,r,o,i,s,a,c,l){o=o||"GET";let u=l&&l.refresh||void 0,f=i!=null&&o!=="GET"&&o!=="HEAD"&&!t,d=!!(l&&l.noPrefetch),p=!!(l&&l.preserveScroll),b=typeof a=="number"?a:T,y,h=null,g=null,m=null,_=null,x=!1,F=e,kt=t?Gn(t,b):null;try{try{let U=o==="GET"&&!i&&!u&&!d?ar(e,r?r.haveKeys:void 0,t):null;if(U)y=U.html,g=U.build,m=U.src,F=U.finalUrl,_=200,x=!0;else{let nt={"x-webjs-router":"1"},Fs=u||f?"":Se();Fs&&(nt["x-webjs-have"]=Fs),t&&(nt["x-webjs-frame"]=t),i!=null&&o!=="GET"&&o!=="HEAD"&&(nt.accept=rs+", text/html");let Do={method:o,headers:nt,credentials:"same-origin",cache:"no-cache"};s&&(Do.signal=s),i!=null&&o!=="GET"&&o!=="HEAD"&&(Do.body=i);let q=await fetch(e,Do);_=q.status,x=q.ok;let $s=ns(q.headers.get("x-webjs-invalidate"));$s.length&&ts($s);let Ds=q.headers.get("content-type")||"",Ll=/^text\/html\b/i.test(Ds);if(Ds.toLowerCase().indexOf(rs)===0){let jl=await q.text(),yr=b===T;return yr&&(et(r),Xi(jl)),{ok:yr&&x,status:_,aborted:!yr,applied:yr}}if(q.redirected&&q.url&&(F=q.url),q.status===204||q.status===205)return b===T&&n&&history.pushState(null,"",F),{ok:x,status:_,aborted:!1,applied:!1};if(!Ll)return b===T&&(et(r),jo(e,q.status,null)),{ok:!1,status:_,aborted:!1,applied:!1};g=q.headers.get("x-webjs-build"),m=q.headers.get("x-webjs-src");let Bo=await lr(q);y=Bo.shell,Bo.streaming&&(h=Bo)}}catch(U){return U&&U.name==="AbortError"?{ok:!1,status:null,aborted:!0,applied:!1}:b!==T?{ok:!1,status:null,aborted:!0,applied:!1}:(et(r),jo(e,null,U instanceof Error?U:new Error(String(U))),{ok:!1,status:null,aborted:!1,applied:!1})}if(b!==T){if(h&&h.reader)try{h.reader.cancel()}catch{}return{ok:!1,status:_,aborted:!0,applied:!1}}let Rt=gt(y);if(!Rt)return et(r),jo(e,null,new Error("navigation response did not parse as HTML")),{ok:!1,status:_,aborted:!1,applied:!1};let fe=wl(Rt,F||e,t);if(fe&&(await fe.ready,b!==T)){if(Po(fe),h&&h.reader)try{h.reader.cancel()}catch{}return{ok:!1,status:_,aborted:!0,applied:!1}}let cn=!1,tt=n?()=>{cn||(cn=!0,history.pushState(null,"",F))}:null,L=Ct(Rt,t,!!c,F,g,m,u||(f?"layouts":void 0),tt);fe&&Me.then(()=>Po(fe),()=>Po(fe));let Ol=L!=="none";if(L==="discard"){if(h&&h.reader)try{h.reader.cancel()}catch{}return{ok:x,status:_,aborted:!1,applied:!1}}if(tt&&tt(),n&&!t){let U=new URL(F),nt=U.hash?document.getElementById(U.hash.slice(1)):null;nt?nt.scrollIntoView():p||(Mc(),window.scrollTo({left:0,top:0,behavior:"instant"}))}return h&&(h.reader||h.rest)&&Me.then(()=>ur(h.reader,h.dec,h.rest,()=>b===T)),document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:F,frameId:t,from:"navigate"}})),{ok:x,status:_,aborted:!1,applied:Ol}}finally{kt&&Yn(kt,b)}}var Sl=w(()=>{eo();jn();Ce();I();ce();Tt();$n();Je();bl();er();At();ke();fr();_l();pr()});function ks(e){if(e.id)return`id:${e.id}`;let t=e.querySelector(`input[name="${Al}"]`);return t?`act:${t.getAttribute("value")||""}`:`url:${e.getAttribute("action")||""}`}function Rd(e,t){let n=0;for(let r of document.querySelectorAll("form")){if(r===e)return n;ks(r)===t&&n++}return-1}function Od(e){let t=e.localName;if(t==="textarea")return"text";if(t==="select")return"select";if(t!=="input")return null;let n=(e.getAttribute("type")||"text").toLowerCase();return kd.has(n)?null:n==="checkbox"||n==="radio"?"check":"text"}function vl(e){let t=new Map,n=[],r=e.elements?[...e.elements]:[...e.querySelectorAll("input, textarea, select")];for(let o of r){let i=o.getAttribute&&o.getAttribute("name");if(!i||i===Al)continue;let s=Od(o);if(!s)continue;let a=s==="check"?`${i}\0${o.getAttribute("value")??"on"}`:i,c=t.get(a)||0;t.set(a,c+1),n.push({el:o,name:i,kind:s,n:c})}return n}function xl(e,t){if(t==="check")return{def:String(!!e.defaultChecked),cur:String(!!e.checked)};if(t==="select"){let n=[...e.options];return{def:JSON.stringify(n.map(r=>r.defaultSelected)),cur:JSON.stringify(n.filter(r=>r.selected).map(r=>r.value))}}return{def:e.defaultValue??"",cur:e.value??""}}function El(e){if(!e||e.getAttribute("data-preserve-values")==="false")return null;let t=ks(e),n=vl(e).map(({el:r,name:o,kind:i,n:s})=>({name:o,kind:i,n:s,...i==="check"?{value:r.getAttribute("value")??"on"}:{},...xl(r,i)}));return n.length?{form:e,key:t,ord:Rd(e,t),controls:n}:null}function Ld(e){if(e.form.isConnected)return e.form;let t=0;for(let n of document.querySelectorAll("form"))if(ks(n)===e.key){if(t===e.ord)return n;t++}return null}function Tl(e){if(!e)return 0;let t=Ld(e);if(!t)return 0;let n=new Map;for(let o of vl(t)){let i=o.kind==="check"?`${o.name}\0${o.el.getAttribute("value")??"on"}\0${o.n}`:`${o.name}\0${o.n}`;n.set(i,o)}let r=0;for(let o of e.controls){let i=o.kind==="check"?`${o.name}\0${o.value}\0${o.n}`:`${o.name}\0${o.n}`,s=n.get(i);if(!s||s.kind!==o.kind)continue;let a=xl(s.el,s.kind);if(a.def===o.def&&a.cur!==o.cur){if(o.kind==="check")s.el.checked=o.cur==="true";else if(o.kind==="select"){let c=new Set(JSON.parse(o.cur));for(let l of s.el.options)l.selected=c.has(l.value)}else s.el.value=o.cur;r++}}return r}var Al,kd,Nl=w(()=>{Al="__webjs_action",kd=new Set(["password","file","hidden","submit","button","image","reset"])});function Yc(e){if(!Uc(e)||!X)return!1;let t,n;try{t=new URL(X),n=new URL(e,location.href)}catch{return!1}return t.pathname!==n.pathname||t.search!==n.search?!1:(X=n.href,!0)}function br(){Y||typeof document>"u"||(ls(!0),uo(),globalThis.__webjsRefreshPage=Fo,document.addEventListener("click",_s,!1),document.addEventListener("submit",Yt,!1),window.addEventListener("popstate",Gt),document.addEventListener("pointerover",_t,!0),document.addEventListener("focusin",_t,!0),document.addEventListener("touchstart",_t,{capture:!0,passive:!0}),document.addEventListener("pointerout",vs,!0),document.addEventListener("webjs:navigate",Co),ml(),Co(),typeof history<"u"&&"scrollRestoration"in history&&(Mo=history.scrollRestoration,history.scrollRestoration="auto"),typeof location<"u"&&(X=location.href),jc())}function Rs(){Y&&(ls(!1),document.removeEventListener("click",_s,!1),document.removeEventListener("submit",Yt,!1),window.removeEventListener("popstate",Gt),io(),document.removeEventListener("pointerover",_t,!0),document.removeEventListener("focusin",_t,!0),document.removeEventListener("touchstart",_t,{capture:!0}),document.removeEventListener("pointerout",vs,!0),document.removeEventListener("webjs:navigate",Co),cr(),No(),rl(),typeof history<"u"&&Mo!==null&&(history.scrollRestoration=Mo,Mo=null),So(),ee&&ee(),te&&te(),X=null,delete globalThis.__webjsRefreshPage)}async function Os(e,t){let n=new URL(e,location.href);if(n.origin!==location.origin){Ae(e);return}await Qn(n.href,t?.replace??!1,null,{preserveScroll:t?.scroll===!1})}async function Ls(e,t){if(typeof location>"u")return{ok:!1,status:null,aborted:!1,applied:!1};let n=e&&e.id;if(!n)return{ok:!1,status:null,aborted:!1,applied:!1};let r=new URL(t,location.href);if(r.origin!==location.origin)return{ok:!1,status:null,aborted:!1,applied:!1};re&&re.abort(),re=new AbortController;let o=re.signal,i=oo(),s=await mr(r.href,n,!1,null,"GET",null,o,i,!1,{noPrefetch:!0});return s&&s.applied&&Qc(r.href,n),s}function Io(e){if(!e){C.clear(),St();return}let t=new URL(e,location.href),n=t.pathname+t.search;C.delete(n),E.delete(n);let r=` ${n}`;for(let o of[...E.keys()])o.endsWith(r)&&E.delete(o)}async function Fo(e){if(!Y||typeof location>"u")return!1;Io(),nn();try{let t=await Qn(location.href,!1,null,{refresh:e==="shell"?"shell":"page"});return!t||t.aborted?!0:t.applied}catch{return!1}}async function Qn(e,t,n,r){io();let o=r&&r.refresh||void 0,i=!!(r&&r.preserveScroll);if(cs(t,n)&&typeof location<"u")return ae("readyState-loading",e),Ae(e),null;re&&re.abort(),re=new AbortController;let s=re.signal,a=oo();n||(So(),ee&&ee(),te&&te()),!o&&X&&Ss(X);let c=setTimeout(()=>{Mn(!0),c=null},150),l=null;!t&&!o&&(l=an());let u=!1;try{if(t){let d=Xc(e);if(d){let p=gt(d.html);if(p){let b=Gc(d.scrollHeight);Ct(p,n,!0,null);let y=()=>{};if(typeof window<"u"){let m=()=>{y=zc(d.scrollX,d.scrollY)};if(on()&&typeof document.startViewTransition=="function"){let _=wo;Me.then(()=>{_!==wo||!Y||m()}).catch(()=>{})}else m()}let h=mr(e,n,!1,l,"GET",null,s,a,!0).catch(()=>{}),g=new Promise(m=>setTimeout(m,500));return Promise.all([h,g]).then(()=>_o(()=>{y(),_o(b)})),null}}u=!0,typeof window<"u"&&window.scrollTo({left:0,top:0,behavior:"instant"})}let f=await mr(e,n,!t&&!o,l,"GET",null,s,a,!1,{refresh:o,preserveScroll:i});return u&&f&&f.applied&&typeof window<"u"&&_o(()=>{a!==T||!Y||window.scrollTo({left:0,top:0,behavior:"instant"})}),f}finally{c&&clearTimeout(c),a===T&&(Mn(!1),typeof location<"u"&&(X=location.href))}}async function Jc(e,t,n,r,o,i){io(),re&&re.abort(),re=new AbortController;let s=re.signal,a=oo();r||(So(),ee&&ee(),te&&te());let c=t==="get"||t==="head",l=new URL(e,location.href);if(c){l.search="";for(let[y,h]of n)l.searchParams.append(y,typeof h=="string"?h:h.name)}X&&Ss(X);let u=setTimeout(()=>{Mn(!0),u=null},150),f=an(),d=o?Jn(o,a,l.href):null,p=c?null:El(o),b=!1;try{let y=await mr(l.href,r,!0,f,c?"GET":t.toUpperCase(),c?null:n,s,a,!1,{preserveScroll:!!(i&&i.preserveScroll)});b=!!(y&&y.ok),p&&y&&y.applied&&!y.ok&&a===T&&(await Me,a===T&&Tl(p)),!c&&a===T&&(C.clear(),St())}finally{d&&Xn(d,a,l.href,b),u&&clearTimeout(u),a===T&&(Mn(!1),typeof location<"u"&&(X=location.href))}}function Cl(){return X}function kl(e){X=e}var re,X,Mo,er=w(()=>{I();ce();Tt();$n();vo();Sl();Je();Nl();At();Ao();Jt();ke();Wn();pr();vt();Et();re=null,X=null;Mo=null});var Ac={};Bs(Ac,{_FALLBACK_MARKER_KEY:()=>yt,_FRAME_TOP:()=>Pn,_LIVE_ATTRS:()=>Ne,_activateSwappedRange:()=>hr,_activeFrameId:()=>go,_addNewHeadElements:()=>Vt,_applyOptimisticLoading:()=>an,_applyStreamedResolve:()=>Ro,_applySwap:()=>Ct,_blurOutgoingFocus:()=>Nt,_buildHaveHeader:()=>Se,_buildSubmitFormData:()=>qn,_bumpNavToken:()=>Bc,_clearFormBusy:()=>Xn,_clearFrameBusy:()=>Yn,_collectBoundaries:()=>le,_currentPageUrl:()=>Cl,_diffElementInPlace:()=>je,_eligibleAnchorHref:()=>en,_encodeSubmitBody:()=>Un,_findAnchorInPath:()=>so,_getSubmitAction:()=>Bn,_getSubmitEnctype:()=>Hn,_getSubmitMethod:()=>Dn,_isNonHtmlPath:()=>kc,_isPreBootNavigation:()=>ro,_keyOf:()=>ne,_markFormBusy:()=>Jn,_markFrameBusy:()=>Gn,_mergeHead:()=>zn,_navToken:()=>Dc,_onPopState:()=>Gt,_onSubmit:()=>Yt,_parseHTML:()=>gt,_planBoundarySwap:()=>In,_prefetch:()=>Ze,_prefetchAnchor:()=>To,_prefetchCache:()=>E,_prefetchHasHoverPointer:()=>xo,_prefetchInflightSize:()=>tl,_prefetchMode:()=>tn,_prefetchPeek:()=>el,_prefetchSaysSaveData:()=>sr,_prefetchSuppressed:()=>Eo,_prefetchTake:()=>ar,_reactivateScripts:()=>Qe,_readStreamedShell:()=>lr,_reconcileChildren:()=>sn,_regraftPermanentElements:()=>dr,_regraftPermanentInSlice:()=>Le,_resetParseProbe:()=>us,_resetPrefetch:()=>nl,_resetWarnOnce:()=>Ic,_resolvePreserveScroll:()=>Zn,_resolveTargetFrameId:()=>ue,_restoreOptimistic:()=>et,_runWithTransition:()=>xt,_setCurrentPageUrl:()=>kl,_setHardNavigate:()=>$c,_shouldFullLoadDuringParse:()=>Fc,_snapshotCache:()=>C,_streamBoundariesProgressively:()=>ur,_takeResolveUnit:()=>ko,_viewTransitionsEnabled:()=>on,disableClientRouter:()=>Rs,enableClientRouter:()=>br,loadFrame:()=>Ls,navigate:()=>Os,refreshPage:()=>Fo,revalidate:()=>Io});var Jr=w(()=>{Yi();jn();jn();Fe();xc();Zr();eo();Ue();er();I();ce();er();At();ke();Ce();I();ce();Tt();$n();ao();vo();co();Je();zt();At();Ao();Jt();fr();pr();vt();Et();(typeof window>"u"||window.__WEBJS_CLIENT_ROUTER__!==!1)&&br()});function Ml(e,...t){return{_$webjs:"template",strings:e,values:t}}function Il(e,...t){return{_$webjs:"template",strings:e,values:t,svg:!0}}function B(e){return!!e&&typeof e=="object"&&e._$webjs==="template"}var k="wjm-";function Fl(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 Ho(e){return!!e&&typeof e=="object"&&e._$webjsCss===!0}function Uo(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(`
|
|
4
|
-
`),n.appendChild(r)}}function
|
|
5
|
-
`)}</style>`}Ot();Fe();var ta=Symbol.for("webjs.repeat");function na(e,t,n){return{[ta]:!0,items:[...e],keyFn:t,templateFn:n}}function Sr(e){return!!e&&typeof e=="object"&&e[ta]===!0}Ot();function ra(e){return{_$webjs:"class-map",value:e}}function oa(e){return{_$webjs:"style-map",value:e}}function ia(e){return e??P}function sa(e){return e&&(e._$webjs==="class-map"||e._$webjs==="style-map")}function Zl(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function aa(e,t){if(e.kind!=="attr"&&e.kind!=="attr-mixed")throw new Error("classMap/styleMap require an attribute binding.");let n=t._$webjs==="class-map";if(e.name!==(n?"class":"style"))throw new Error("classMap/styleMap must be used in a class/style attribute.");if(e.group&&e.group.length!==1)throw new Error("classMap/styleMap require a single expression.");e.__mapKind!==t._$webjs&&(e.el.setAttribute(e.name,(e.statics||[]).join(n?" ":"")),e.__mapKind=t._$webjs,e.__mapKeys=new Set,e.__staticClasses=n?new Set(e.el.classList):new Set);let r=new Set;for(let[o,i]of Object.entries(t.value))if(n)i&&!e.__staticClasses.has(o)&&(e.el.classList.add(o),r.add(o));else if(i!=null){let s=Zl(o),a=String(i);e.el.style.setProperty(s,a.replace(/\s*!important\s*$/,""),/!important\s*$/.test(a)?"important":""),r.add(s)}for(let o of e.__mapKeys)r.has(o)||(n?e.el.classList.remove(o):e.el.style.removeProperty(o));e.__mapKeys=r}function Ql(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function zo(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function eu(e){return{_$webjs:"live",value:e}}function de(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function tu(e,t){return{_$webjs:"keyed",key:e,value:t}}function Ar(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function nu(e,t){return{_$webjs:"guard",deps:e,fn:t}}function vr(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function ru(e){return{_$webjs:"template-content",template:e}}function Go(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function ou(e){return{_$webjs:"ref",target:e}}function xr(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function iu(){return{value:void 0}}function su(e){return{_$webjs:"cache",value:e}}function Er(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function au(...e){return{_$webjs:"until",args:e}}function Tr(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function cu(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function Yo(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function lu(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function Jo(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function uu(e){return{_$webjs:"watch",signal:e}}function Nr(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}un();Ue();un();Fe();Ue();var Mr=new WeakMap,Ir=new WeakMap,_n=Symbol.for("webjs.instance");function Mt(e){let{strings:t}=e,n=Mr.get(t);if(n)return n;let r=[],o="",i="text",s="",a=0,c="",l=0,u=null,f="",d="";for(let y=0;y<t.length;y++){let h=t[y];for(let g=0;g<h.length;g++){let m=h[g];switch(i){case"text":o+=m,m==="<"&&(i="tag-open");break;case"tag-open":o+=m,m==="!"?i="bang-1":m==="/"?(i="tag-name",f=""):/[a-zA-Z]/.test(m)?(i="tag-name",f=m.toLowerCase()):i="text";break;case"bang-1":o+=m,i=m==="-"?"bang-dash":"tag-name";break;case"bang-dash":o+=m,m==="-"?(i="comment",l=0):i="tag-name";break;case"comment":o+=m,m==="-"?l+=1:(m===">"&&l>=2&&(i="text"),l=0);break;case"tag-name":o+=m,m===">"?(i=f==="script"||f==="style"?"rawtext":"text",i==="rawtext"&&(d="")):/\s/.test(m)?i="in-tag":f+=m.toLowerCase();break;case"in-tag":o+=m,m===">"?(i=f==="script"||f==="style"?"rawtext":"text",i==="rawtext"&&(d="")):!/\s/.test(m)&&m!=="/"&&(i="attr-name",s=m,a=o.length-1);break;case"rawtext":o+=m,d=(d+m.toLowerCase()).slice(-9),(d.endsWith("<\/script>")||d.endsWith("</style>"))&&(i="text",d="",f="");break;case"attr-name":m==="="?(i="after-eq",o+=m):/\s/.test(m)?(i="in-tag",s="",o+=m):m===">"?(i="text",s="",o+=m):(s+=m,o+=m);break;case"after-eq":m==='"'||m==="'"?(i="attr-quoted",c=m,o+=m):/\s/.test(m)?(i="in-tag",s="",o+=m):m===">"?(i="text",s="",o+=m):(i="attr-unquoted",o+=m);break;case"attr-unquoted":/\s/.test(m)?(i="in-tag",s="",o+=m):(m===">"&&(i="text",s=""),o+=m);break;case"attr-quoted":o+=m,m===c&&(i="in-tag",s="");break;case"skip-attr":if(m===c){if(u){let _=u.firstPartIdx,x=[];for(let L=_;L<r.length;L++)(r[L].kind==="noop"||r[L].kind==="attr-mixed")&&x.push(L);let F=[],kt=t[x[0]],Rt=kt.lastIndexOf(c);F.push(Rt>=0?kt.slice(Rt+1):kt);for(let L=1;L<x.length;L++)F.push(t[x[L]]);let fe=t[x[x.length-1]+1],cn=fe.indexOf(c);F.push(cn>=0?fe.slice(0,cn):fe);let tt=Lt(u.name[0]);if(tt&&(x.length!==1||F.some(L=>L!=="")))throw new Error("Event, property and boolean bindings require exactly one expression with no surrounding text.");r[_]={kind:tt?gr[u.name[0]]:"attr-mixed",path:[],name:tt?u.name.slice(1):u.name,statics:F,group:x};for(let L=1;L<x.length;L++)r[x[L]]={kind:"noop",path:[],mixedAnchor:_};u=null}i="in-tag",s=""}break}}if(y<t.length-1){let g=r.length;if(i==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(i==="rawtext"){d="",r.push({kind:"noop",path:[]});continue}if(i==="text")o+=`<!--${k}${g}-->`,r.push({kind:"child",path:[]});else if(i==="in-tag"){let m=`data-${k}${g}`;o+=`${m}=""`,r.push({kind:"element",path:[]})}else if(i==="after-eq"){let m=s[0],_=s.slice(1);if(Lt(m)){o=o.slice(0,a);let x=gr[m],F=`data-${k}${g}`;o+=`${F}=""`,r.push({kind:x,path:[],name:_})}else{o=o.slice(0,a);let x=`data-${k}${g}`;o+=`${x}=""`,r.push({kind:"attr",path:[],name:s})}i="in-tag",s=""}else if(i==="attr-quoted"||i==="attr-unquoted"){o=o.slice(0,a);let m=`data-${k}${g}`;o+=`${m}=""`,u={name:s,firstPartIdx:g},r.push({kind:"noop",path:[]}),i="skip-attr"}else i==="skip-attr"&&r.push({kind:"noop",path:[]})}}let p=document.createElement("template");if(e.svg){p.innerHTML=`<svg>${o}</svg>`;let y=p.content.firstChild;y.replaceWith(...y.childNodes)}else p.innerHTML=o;bu(p.content,r);let b=yu(p.content,r);return n={templateEl:p,parts:r,formActions:b},Mr.set(t,n),n}function bu(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(A,"");let o=t.length;r.setAttribute(`data-${k}${o}`,""),t.push({kind:"slot",path:[]})}}function yu(e,t){let n=[],r=[];function o(i){for(let s=0;s<i.childNodes.length;s++){let a=i.childNodes[s];if(n.push(s),a.nodeType===8){let c=a.data;if(c.startsWith(k)){let l=Number(c.slice(k.length));t[l]&&t[l].kind==="child"&&(t[l].path=n.slice())}}else if(a.nodeType===1){let c=a,l=[],u=[];for(let f of c.attributes)if(f.name.startsWith(`data-${k}`)){let d=Number(f.name.slice(`data-${k}`.length));t[d]&&t[d].kind!=="child"&&(t[d].path=n.slice(),u.push({idx:d,kind:t[d].kind,name:t[d].name||""})),l.push(f.name)}if(c.localName==="form"||c.localName==="button"||c.localName==="input"){let f=gu(c,u,t);f&&r.push(f)}for(let f of l)c.removeAttribute(f);o(a)}n.pop()}}return o(e),r.length?r:null}function gu(e,t,n){let r=e.localName==="form",o=r?"action":"formaction",i=r?"method":"formmethod",s=r?"enctype":"formenctype",a=t.filter(h=>h.kind==="attr"&&h.name.toLowerCase()===o);if(!a.length)return null;let c=[],l=[],u=[],f=r?[]:t.filter(h=>h.name.toLowerCase()==="name"&&(h.kind==="attr"||h.kind==="attr-mixed"||h.kind==="bool")).map(h=>({i:h.idx,kind:h.kind})),d=!r&&e.hasAttribute("name"),p=!r&&e.hasAttribute("form"),b=!r&&e.hasAttribute("value"),y=r?[]:t.filter(h=>h.name.toLowerCase()==="value"&&(h.kind==="attr"||h.kind==="attr-mixed"||h.kind==="bool")).map(h=>({i:h.idx,kind:h.kind}));for(let h of t){let g=String(h.name).toLowerCase();if(h.kind==="prop"){r?(g==="method"||g==="enctype"||g==="encoding")&&u.push(h.name):Wo(g)&&u.push(h.name);continue}if(g!==i&&g!==s||h.kind!=="attr"&&h.kind!=="attr-mixed"&&h.kind!=="bool")continue;let m=n[h.idx],_={i:h.idx,kind:h.kind};h.kind==="attr-mixed"&&(_.statics=m.statics||[],_.group=m.group||[]),(g===i?c:l).push(_)}return{isForm:r,tag:e.localName,actionIdxs:a.map(h=>h.idx),duplicateAction:a.length>1,staticAction:e.getAttribute(o)!=null,authoredName:d,authoredValue:b,authoredForm:p,propAttrs:u,nameParts:f,valueParts:y,staticMethod:e.getAttribute(i),staticEnctype:e.getAttribute(s),methodParts:c,enctypeParts:l}}Ue();var Fr=new WeakSet;function Aa(e,t,n){if(e.nodeType!==1||!ot(e))return null;let r=j(e),o=new Set;for(let l of n)(l.kind==="attr"||l.kind==="attr-mixed"||l.kind==="bool")&&l.name==="name"&&o.add(l.el);let i=new Map,s=new Set,a=[],c=[];for(let l of n){if(l.kind!=="slot")continue;let u=l.slotEl;if(o.has(u))continue;let f=r.assignedByName.get($(u.getAttribute("name")));if(!f||f.length===0)continue;let d=f[0].parentNode;if(!d||d.nodeType!==1||d.localName!=="slot"||s.has(d)||d.getAttribute(N)!==M||!wu(d.childNodes,f))continue;let p=Sa(u,t),b=Sa(d,e);if(!p||!b||p.length!==b.length)continue;let y=!0;for(let h=0;h<p.length&&y;h++){let g=p[h],m=b[h],_=g.localName;if(_!==m.localName||_.includes("-")||_==="form")y=!1;else{let x=i.get(g);(x?x!==m:s.has(m))&&(y=!1)}}if(y){i.set(u,d),s.add(d),a.push([u,d]);for(let h=0;h<p.length;h++)i.has(p[h])||(i.set(p[h],b[h]),s.add(b[h]),c.push([p[h],b[h]]))}}if(a.length===0)return null;for(let l of[t,...c.map(([u])=>u)]){let u=null;for(let f of l.childNodes){let d=i.get(f);if(d){if(u&&!(u.compareDocumentPosition(d)&Node.DOCUMENT_POSITION_FOLLOWING))return null;u=d}}}return{map:i,slots:a,chains:c}}function va(e,t){let n=new Map;for(let r of t){if(r.kind==="slot"){let i=e.map.get(r.slotEl);i&&(r.slotEl=i);continue}if(!r.el)continue;let o=e.map.get(r.el);if(o&&(r.kind==="event"&&(r.el.removeEventListener(r.name,r.dispatcher),o.addEventListener(r.name,r.dispatcher)),r.el=o,r.kind==="attr"||r.kind==="attr-mixed"||r.kind==="bool")){let i=n.get(o);i||n.set(o,i=new Set),i.add(r.name)}}for(let[r,o]of[...e.chains,...e.slots]){let i=o.localName==="slot",s=n.get(o);for(let a of Array.from(o.attributes))r.hasAttribute(a.name)||s?.has(a.name)||i&&(a.name===N||a.name===pn)||o.removeAttribute(a.name);for(let a of Array.from(r.attributes))o.getAttribute(a.name)!==a.value&&o.setAttribute(a.name,a.value)}}function xa(e,t,n){let r=i=>e.map.get(i)||i,o=j(t);for(let[i,s]of e.chains)_a(s,Array.from(i.childNodes,r));_a(t,n.map(r));for(let[i,s]of e.slots){let a=document.createDocumentFragment();for(;i.firstChild;)a.appendChild(i.firstChild);s[pe]=a,Fr.add(s),o.lastSnapshot.delete(s)}}function _a(e,t){let n=new Set(t);for(let o of Array.from(e.childNodes))n.has(o)||e.removeChild(o);let r=e.firstChild;for(let o of t){if(o===r){r=r.nextSibling;continue}e.insertBefore(o,r)}}function Sa(e,t){let n=[],r=e.parentNode;for(;r&&r!==t;){if(r.nodeType!==1)return null;n.push(r),r=r.parentNode}return r===t?n:null}function wu(e,t){if(e.length!==t.length)return!1;for(let n=0;n<t.length;n++)if(e[n]!==t[n])return!1;return!0}Ot();Fe();var oe=null,qe=!1,Ft=0,It=null,Ei=0,Ea=(e,t)=>Object.is(e,t),Dr=()=>{},Ta=()=>!1;function Na(e,t){e.liveConsumers||(e.liveConsumers=new Map);let n=e.liveConsumers.size===0;if(e.liveConsumers.set(t,(e.liveConsumers.get(t)||0)+1),n){if(e.producers&&e.producers.length>0)for(let r of e.producers)Na(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function Sn(e,t){if(!e.liveConsumers)return;let n=e.liveConsumers.get(t);if(n!==void 0){if(n>1){e.liveConsumers.set(t,n-1);return}if(e.liveConsumers.delete(t),e.liveConsumers.size===0){if(e.producers&&e.producers.length>0)for(let r of e.producers)Sn(r,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(r){console.error(r)}}}}function Oi(e){if(qe)throw new Error("Signal read during notification phase");if(oe===null)return;let t=oe,n=t.nextProducerIndex++;n<t.producers.length&&t.producers[n]!==e&&Ci(t)&&Sn(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,Ci(t)&&Na(e,t)),t.producerLastReadVersions[n]=e.version}function Ci(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function Ca(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=qe;qe=!0;try{for(let n of e.liveConsumers.keys())n.dirty||_u(n)}finally{qe=t}}function _u(e){e.dirty=!0,Ca(e),e.consumerMarkedDirty.call(e.wrapper||e)}function Br(e){if(!(!e.dirty&&e.lastCleanEpoch===Ft)){if(!e.producerMustRecompute()&&!Su(e)){e.dirty=!1,e.lastCleanEpoch=Ft;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=Ft}}function Su(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(Br(n),r!==n.version))return!0}return!1}function ki(e){e&&(e.nextProducerIndex=0);let t=oe;return oe=e,t}function Ri(e,t){if(oe=t,!!e){if(Ci(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)Sn(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var Hr=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=Ft,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=Ta,this.producerRecomputeValue=Dr,this.consumerMarkedDirty=Dr,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||Ea,this.watched=n?.[Li],this.unwatched=n?.[ji]}get(){return Oi(this),this.__value}peek(){return this.__value}set(t){if(qe)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,Ft++,It!==null?ka(this):Ca(this))}};function ka(e){let t=qe;qe=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers.keys())n.dirty||(n.dirty=!0,n.__isWatcher?It.add(n):ka(n))}finally{qe=t}}var Ti=Symbol("unset"),Ni=Symbol("computing"),$r=Symbol("errored"),An=class{constructor(t,n){this.__fn=t,this.__value=Ti,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||Ea,this.watched=n?.[Li],this.unwatched=n?.[ji];let r=this;this.producerMustRecompute=function(){return r.__value===Ti||r.__value===Ni},this.producerRecomputeValue=function(){if(r.__value===Ni)throw new Error("Detected cycle in computations.");let o=r.__value;r.__value=Ni;let i=ki(r),s,a=!1;try{s=r.__fn.call(r.wrapper)}catch(l){s=$r,r.__error=l,a=!0}finally{Ri(r,i)}if(!a&&(o!==Ti&&o!==$r)&&r.__equal.call(r.wrapper,o,s)){r.__value=o;return}r.__value=s,r.version++},this.consumerMarkedDirty=Dr}get(){if(Br(this),Oi(this),this.__value===$r)throw this.__error;return this.__value}peek(){if(Br(this),this.__value===$r)throw this.__error;return this.__value}},Ur=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=Ft,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=Ta,this.producerRecomputeValue=Dr,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=ki(this);try{for(let r of t)Oi(r),r.__isComputed&&Br(r)}finally{Ri(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(Sn(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=ki(this),r;try{r=t()}finally{Ri(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)Sn(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},Li=Symbol("watched"),ji=Symbol("unwatched");function Au(e){let t=oe;oe=null;try{return e()}finally{oe=t}}function vu(e){return e.producers.slice()}function xu(e){return e.liveConsumers?[...e.liveConsumers.keys()]:[]}function Eu(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function Tu(e){return e.producers.length>0}function Nu(){return oe&&oe.__isComputed?oe:null}function Cu(e){Ei++,It===null&&(It=new Set);try{e()}finally{if(Ei--,Ei===0){let t=It;It=null;for(let n of t)n.__fire()}}}var ye={State:Hr,Computed:An,subtle:{Watcher:Ur,untrack:Au,introspectSources:vu,introspectSinks:xu,hasSinks:Eu,hasSources:Tu,currentComputed:Nu,watched:Li,unwatched:ji}};function ku(e,t){return new Hr(e,t)}function Ru(e,t){return new An(e,t)}function Ou(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function Lu(e){let t=!1,n=!1,r=new An(e),o=new Ur(()=>{t||n||(t=!0,queueMicrotask(()=>{if(t=!1,!n){try{r.get()}catch(i){console.error(i)}o.watch()}}))});o.watch(r);try{r.get()}catch(i){console.error(i)}return()=>{n||(n=!0,o.dispose())}}Ue();un();var ge;function Mi(e){ge=e}var W=null;function Ii(e){W=e}function Oa(e,t){let n=e&&e[S]?e:null;return n?ct(n,t):t()}function Kr(e){return e?e.nodeType===11&&e.host?e.host:e:null}function Fi(e,t){let n=e.__commitOwner,r=W,o=ge;ge=e.__eventHost,n&&(W=n);try{t()}finally{W=r}}function xn(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,__eventHost:ge};let r=n;if(e.kind==="event"){let o={kind:"event",el:r,name:e.name||"",handler:null,eventHost:ge,dispatcher(i){typeof o.handler=="function"?o.handler.call(o.eventHost??o.el,i):o.handler?.handleEvent(i)}};return 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 ie(e,t,n,r,o){if(t!==V){if(sa(t)){aa(e,t);return}if(e.__mapKind=void 0,de(t)){let i=t.value;if(e.kind==="prop"&&e.el[e.name]===i||e.kind==="attr"&&e.el.getAttribute(e.name)===String(i)||e.kind==="bool"&&e.el.hasAttribute(e.name)===!!i)return;t=i}switch(e.kind){case"child":Mu(e,t,o);break;case"attr":{let i=ln(e.name,t);i===null?e.el.removeAttribute(e.name):wr(t,e.name,e.el.localName)||(dn(t,e.name,e.el.localName),e.el.setAttribute(e.name,i));break}case"prop":Js(t,e.name,e.el.localName),e.el[e.name]=t===P?void 0:t;break;case"bool":dn(t,e.name,e.el.localName),t&&t!==P?e.el.setAttribute(e.name,""):e.el.removeAttribute(e.name);break;case"event":{let i=e.handler,s=t==null||t===P?null:t,a=i?.capture!==s?.capture||i?.once!==s?.once||i?.passive!==s?.passive;i&&(!s||a)&&e.el.removeEventListener(e.name,e.dispatcher,i),s&&(!i||a)&&e.el.addEventListener(e.name,e.dispatcher,s),e.handler=s}break;case"element":Pu(e,t);break;case"attr-mixed":{let i=e,s=i.statics[0];for(let a=0;a<i.group.length;a++){let c=r?r[i.group[a]]:t;if(de(c)&&(c=c.value),dn(c,e.name,e.el.localName),c===P){e.el.removeAttribute(e.name);return}s+=String(c??""),s+=i.statics[a+1]||""}e.el.setAttribute(e.name,s);break}case"slot":{if(e.applied)break;let i=e.slotEl,s=()=>{let c=$t(i);if(!c){e.applied=!0;return}if(!c.contains(i)){c.isConnected?queueMicrotask(s):e.applied=!0;return}if(e.applied=!0,!ju(i)){if(Fr.has(i))Fr.delete(i);else{let l=document.createDocumentFragment();for(;i.firstChild;)l.appendChild(i.firstChild);i[pe]=l}queueMicrotask(()=>G(c))}},a=$t(i);a&&a.contains(i)?s():queueMicrotask(s);break}case"noop":break}}}function $t(e){let t=e[rt];if(t&&t.isConnected)return t;let n=e.parentElement;for(;n;){if(n[S])return n;n=n.parentElement}return null}function ju(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 Pu(e,t){let n=e,r=xr(t)?t.target:void 0,o=n.__refTarget,i=r!==o;if(i&&o)if(typeof o=="function")try{o(void 0)}catch{}else typeof o=="object"&&(o.value=void 0);if(i||n.__refElement!==e.el){if(n.__refTarget=r,r)if(typeof r=="function"){if(!i&&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 Mu(e,t,n){if(t!==V)return Ku(e,t),we(e,t,n)}function we(e,t,n){let r=ge;ge=e.__eventHost;try{return Oa(e.marker&&e.marker.parentNode,()=>La(e,t,n))}finally{ge=r}}function La(e,t,n){let r=e.marker;if(de(t))return La(e,t.value,n);if(zo(t)){Ke(e);let i=String(t.value??""),s=document.createElement("template");s.innerHTML=i;let a=[...s.content.childNodes],c=document.createDocumentFragment();for(let l of a)c.appendChild(l);r.parentNode?.insertBefore(c,r),e.child=a;return}if(Ar(t)){let i=t,s=e.__keyedKey;s!==void 0&&!Object.is(s,i.key)&&Ke(e),e.__keyedKey=i.key,we(e,i.value,n);return}if(vr(t)){let i=t,s=e.__guardDeps,a=i.deps;if(s!==void 0&&(Array.isArray(s)&&Array.isArray(a)?qu(s,a):Object.is(s,a)))return;let c=Array.isArray(a)?a.slice():a;we(e,i.fn(),n),e.__guardDeps=c;return}if(Go(t)){Ke(e);let i=t.template;if(i&&i.content){let s=i.content.cloneNode(!0),a=[...s.childNodes];r.parentNode?.insertBefore(s,r),e.child=a}return}if(xr(t))return;if(Er(t))return Wu(e,t.value,n);if(Tr(t))return Vu(e,t.args,n);if(Nr(t))return zu(e,t.signal,n);if(Yo(t))return Gu(e,t,n);if(Jo(t))return Yu(e,t,n);if(Sr(t)){if(e.child&&e.child.kind==="repeat"){$u(e,t,n);return}Ke(e);let i={kind:"repeat",map:new Map};e.child=i,Fu(r,i,t,n);return}if(Array.isArray(t)){if(e.child&&e.child.kind==="array"){Hu(e,t,n);return}Ke(e);let i={kind:"array",items:[]};e.child=i,Bu(r,i,t,n);return}if(e.child){let i=e.child;if(i.kind==="repeat")ja(i),e.child=void 0;else if(i.kind==="array")Ma(i),e.child=void 0;else if(i.kind==="async-stream")Da(i),e.child=void 0;else if("strings"in e.child){let s=e.child;if(B(t)&&s.strings===t.strings){ut(s,t.values,n);return}Dt(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===P||t===V)return;if(B(t)){let i=t,{templateEl:s,parts:a,formActions:c}=Mt(i),l=s.content.cloneNode(!0),u=document.createComment(`${k}s`),f=document.createComment(`${k}e`),d=a.map(y=>xn(y,l)),p=[];for(let y=0;y<i.values.length;y++)ie(d[y],i.values[y],void 0,i.values,n),p.push(i.values[y]);n&&n(c,d,i.values);let b=[u,...l.childNodes,f];r.parentNode?.insertBefore(Iu(b),r);for(let y of d)y.kind==="slot"&&ie(y,void 0,void 0,[],n);e.child={strings:i.strings,bound:d,lastValues:p,startNode:u,endNode:f};return}let o=document.createTextNode(String(t));r.parentNode?.insertBefore(o,r),e.child=[o]}function ut(e,t,n){t=t.map((r,o)=>r===V?e.lastValues[o]??P:r);for(let r=0;r<t.length;r++){let o=t[r];if(Object.is(o,e.lastValues[r]))continue;let i=e.bound[r],s=i.mixedAnchor;try{i.kind==="noop"&&s!=null?ie(e.bound[s],t[s],e.lastValues[s],t,n):ie(i,o,e.lastValues[r],t,n)}catch(a){throw e.lastValues[r]=Ra,i.kind==="noop"&&s!=null&&(e.lastValues[s]=Ra),a}e.lastValues[r]=o}n&&n(Mr.get(e.strings)?.formActions??null,e.bound,t)}var Ra=Symbol("webjs.commitFailed");function Dt(e,t){let n=e.parentNode;if(!n)return;let r=e;for(;r&&r!==t;){let o=r.nextSibling;r.parentNode?.removeChild(r),r=o}t.parentNode===n&&n.removeChild(t)}function Iu(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function $i(e,t){let{templateEl:n,parts:r,formActions:o}=Mt(e),i=n.content.cloneNode(!0),s=document.createComment(`${k}s`),a=document.createComment(`${k}e`),c=r.map(f=>xn(f,i)),l=[];for(let f=0;f<e.values.length;f++)ie(c[f],e.values[f],void 0,e.values,t),l.push(e.values[f]);t&&t(o,c,e.values);for(let f of c)f.kind==="slot"&&ie(f,void 0,void 0,[],t);let u=document.createDocumentFragment();for(u.appendChild(s);i.firstChild;)u.appendChild(i.firstChild);return u.appendChild(a),{inst:{strings:e.strings,bound:c,lastValues:l,startNode:s,endNode:a},frag:u}}function vn(e){for(let t of e.bound)if(t.kind==="event"&&t.el.removeEventListener(t.name,t.dispatcher,t.handler),t.kind==="element"){let n=t.lastTarget;if(n){if(typeof n=="function")try{n(void 0)}catch{}else if(typeof n=="object")try{n.value=void 0}catch{}t.lastTarget=void 0,t.__lastEl=void 0}}}function Fu(e,t,n,r){let{items:o,keyFn:i,templateFn:s}=n,a=e.parentNode;if(!a)return;let c=document.createDocumentFragment();for(let l=0;l<o.length;l++){let u=i(o[l],l),f=s(o[l],l);if(!B(f))continue;let{inst:d,frag:p}=$i(f,r);t.map.set(u,d),c.appendChild(p)}a.insertBefore(c,e)}function $u(e,t,n){let r=e.marker,o=r.parentNode;if(!o)return;let i=e.child,{items:s,keyFn:a,templateFn:c}=t,l=new Map;try{for(let u=0;u<s.length;u++){let f=a(s[u],u),d=c(s[u],u);if(!B(d))continue;let p=i.map.get(f);if(p&&p.strings===d.strings)ut(p,d.values,n),Pi(p.startNode,p.endNode,o,r),l.set(f,p),i.map.delete(f);else{p&&(i.map.delete(f),vn(p),Dt(p.startNode,p.endNode));let{inst:b,frag:y}=$i(d,n);o.insertBefore(y,r),l.set(f,b)}}for(let[u,f]of[...i.map]){i.map.delete(u);try{vn(f)}finally{Dt(f.startNode,f.endNode)}}i.map=l}catch(u){for(let[f,d]of l)i.map.set(f,d);throw u}}function ja(e){for(let[t,n]of[...e.map]){e.map.delete(t);try{vn(n)}finally{Dt(n.startNode,n.endNode)}}e.map.clear()}function Du(e){return e.type==="tpl"?e.inst.startNode:e.type==="text"?e.node:null}function qr(e){e.type==="tpl"?(vn(e.inst),Dt(e.inst.startNode,e.inst.endNode)):e.type==="text"&&e.node.parentNode?.removeChild(e.node)}function Pa(e,t){if(de(e)&&(e=e.value),B(e)){let{inst:n,frag:r}=$i(e,t);return{item:{type:"tpl",inst:n},frag:r}}if(e!=null&&e!==P&&e!==V){let n=document.createTextNode(String(e));return{item:{type:"text",node:n},frag:n}}return{item:{type:"empty"},frag:null}}function Bu(e,t,n,r){let o=e.parentNode;if(!o)return;let i=document.createDocumentFragment(),s=[];for(let a of n){let{item:c,frag:l}=Pa(a,r);l&&i.appendChild(l),s.push(c)}o.insertBefore(i,e),t.items=s}function Hu(e,t,n){let r=e.marker,o=r.parentNode;if(!o)return;let i=e.child,s=i.items,a=[],c=0;try{for(let l=0;l<t.length;l++){let u=t[l],f=de(u)?u.value:u,d=s[l];if(B(f)){let y=f;if(d&&d.type==="tpl"&&d.inst.strings===y.strings){ut(d.inst,y.values,n),a.push(d),c=l+1;continue}}else if(f!=null&&f!==P&&f!==V){if(d&&d.type==="text"){let y=String(f);d.node.data!==y&&(d.node.data=y),a.push(d),c=l+1;continue}}else{d&&qr(d),a.push({type:"empty"}),c=l+1;continue}let{item:p,frag:b}=Pa(f,n);b&&o.insertBefore(b,Uu(s,l,r)),a.push(p),d&&qr(d),c=l+1}for(let l=t.length;l<s.length;l++)qr(s[l]),c=l+1;i.items=a}catch(l){throw i.items=a.concat(s.slice(c)),l}}function Uu(e,t,n){for(let r=t;r<e.length;r++){let o=Du(e[r]);if(o&&o.parentNode)return o}return n}function Ma(e){for(let t of e.items)qr(t);e.items=[]}function Pi(e,t,n,r){if(t.nextSibling===r&&e.parentNode===n)return;let o=document.createDocumentFragment(),i=e;for(;i;){let s=i.nextSibling;if(o.appendChild(i),i===t)break;i=s}n.insertBefore(o,r)}function qu(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 Ke(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&Ia(t),!e.child)return;let n=e.child;if(n.kind==="repeat")ja(n);else if(n.kind==="array")Ma(n);else if(n.kind==="async-stream")Da(n);else if("strings"in n){let r=e.child;vn(r),Dt(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function Ku(e,t){let n=e;n.__untilState&&!Tr(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!vr(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!Er(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!Ar(t)&&(n.__keyedKey=void 0),n.__watchSub&&!Nr(t)&&Ia(n)}function Wu(e,t,n){let r=e.marker,o=e,i=o.__cacheMap;i||(i=new Map,o.__cacheMap=i);let s=e.child;if(s&&"strings"in s){let c=s;if(B(t)&&c.strings===t.strings){ut(c,t.values,n);return}let l=document.createDocumentFragment();Pi(c.startNode,c.endNode,l,null),i.set(c.strings,{inst:c,holder:l}),e.child=void 0}if(B(t)){let c=t,l=i.get(c.strings);if(l){i.delete(c.strings),e.child&&Ke(e),Pi(l.inst.startNode,l.inst.endNode,r.parentNode,r),ut(l.inst,c.values,n),e.child=l.inst;let u=new Set;for(let f=l.inst.startNode.nextSibling;f&&f!==l.inst.endNode;f=f.nextSibling){if(f.nodeType!==1)continue;let d=f;if(d.matches("slot[data-webjs-light]")){let p=$t(d);p&&u.add(p)}for(let p of d.querySelectorAll("slot[data-webjs-light]")){let b=$t(p);b&&u.add(b)}}for(let f of u)G(f);return}}we(e,t,n)}function Vu(e,t,n){let r=e;W&&(r.__commitOwner=Kr(W));let o=r.__untilState,i=r.__untilArgs,s=(p,b)=>!!(Object.is(p,b)||B(p)&&B(b)&&p.strings===b.strings),c=i&&i.length===t.length&&i.every((p,b)=>s(p,t[b]))&&o?o.highestResolved:1/0;o&&(o.aborted=!0),r.__untilArgs=t.slice();let l={aborted:!1,highestResolved:c};r.__untilState=l;let u=-1,f;for(let p=0;p<t.length;p++){let b=t[p];if(!b||typeof b.then!="function"){u=p,f=b;break}}u!==-1&&u<=l.highestResolved?(we(e,f,n),l.highestResolved=u):u===-1&&!r.__untilEverRendered&&we(e,"",n),r.__untilEverRendered=!0;let d=Math.min(u===-1?t.length:u,l.highestResolved);for(let p=0;p<d;p++){let b=t[p];!b||typeof b.then!="function"||Promise.resolve(b).then(y=>{if(!l.aborted&&!(p>=l.highestResolved)){try{Fi(e,()=>we(e,y,n))}catch(h){Di(e,h);return}l.highestResolved=p}},()=>{})}}function Di(e,t){let n;try{n=t instanceof Error?t:new Error(String(t))}catch{n=new Error("render error (unstringifiable thrown value)")}let r=e.__commitOwner;if(r&&typeof r._handleRenderError=="function"){r._handleRenderError(n);return}throw n}function zu(e,t,n){let r=e;if(W&&(r.__commitOwner=Kr(W)),r.__watchSig===t&&r.__watchSub){let s;r.__watchSub.observe(()=>{s=t.get()}),we(e,s,n);return}r.__watchSub&&(r.__watchSub.dispose(),r.__watchSub=void 0),r.__watchSig=t;let o=new ye.subtle.Watcher(()=>{queueMicrotask(()=>{if(r.__watchSub!==o)return;let s;try{o.observe(()=>{s=t.get()}),Fi(e,()=>we(e,s,n))}catch(a){Di(e,a)}})});r.__watchSub=o;let i;o.observe(()=>{i=t.get()}),we(e,i,n)}function Ia(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function Gu(e,t,n){let r=e;W&&(r.__commitOwner=Kr(W));let o=e.child;if(o&&o.kind==="async-stream"&&o.mode==="append"&&o.iterable===t.iterable)return;Ke(e);let i=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:i,nodes:[]};e.child=s,Fa(s,e,t,n)}function Yu(e,t,n){let r=e;W&&(r.__commitOwner=Kr(W));let o=e.child;if(o&&o.kind==="async-stream"&&o.mode==="replace"&&o.iterable===t.iterable)return;Ke(e);let i=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:i,nodes:[]};e.child=s,Fa(s,e,t,n)}async function Fa(e,t,n,r){let o=t.marker,i=0;for(;!e.aborted;){let s,a;try{if(s=await e.iterator.next(),e.aborted||s.done)break;a=n.mapper?n.mapper(s.value,i):s.value}catch(c){typeof console<"u"&&console.error("[webjs] asyncStream error:",c);return}try{Fi(t,()=>{let c=$a(a,r);Oa(o.parentNode,()=>{if(e.mode==="replace"){for(let u of e.nodes)u.parentNode&&u.parentNode.removeChild(u);e.nodes=[]}let l=document.createDocumentFragment();for(let u of c)l.appendChild(u);o.parentNode?.insertBefore(l,o),e.nodes.push(...c)})})}catch(c){e.aborted=!0;try{e.iterator.return?.()?.catch?.(()=>{})}catch{}Di(t,c);return}i++}}function $a(e,t){if(de(e)&&(e=e.value),e==null||e===P||e===V)return[];if(B(e)){let n=e,{templateEl:r,parts:o,formActions:i}=Mt(n),s=r.content.cloneNode(!0),a=o.map(c=>xn(c,s));for(let c=0;c<n.values.length;c++)ie(a[c],n.values[c],void 0,n.values,t);t&&t(i,a,n.values);for(let c of a)c.kind==="slot"&&ie(c,void 0,void 0,[],t);return[...s.childNodes]}if(Array.isArray(e)){let n=[];for(let r of e)n.push(...$a(r,t));return n}return[document.createTextNode(String(e))]}function Da(e){e.aborted=!0;for(let t of e.nodes)t.parentNode&&t.parentNode.removeChild(t);e.nodes=[];try{e.iterator.return?.()?.catch?.(()=>{})}catch{}}function dt(e,t,n={}){if(e===V)return;let r=t,o=r[O];r[O]=!0;let i=ge;Mi(n.host);let s=W;Ii(t);try{let a=r[_n];if(B(e)){let c=e;if(a&&a.strings===c.strings){ut(a,c.values,Vr);return}a&&Ba(a,t);let l=t.firstChild,u=!!l&&l.nodeType===8&&l.data==="webjs-hydrate";u&&l.remove(),r[_n]=null;let f=Zu(c,t,u);r[_n]=f;return}if(a&&Ba(a,t),r[_n]=null,t.replaceChildren(),e==null||e===P)return;if(Array.isArray(e)){for(let c of e){let l=document.createTextNode(String(c??""));t.appendChild(l)}return}t.appendChild(document.createTextNode(String(e)))}finally{Ii(s),Mi(i),r[O]=o,o||Rr(r)}}function Vr(e,t,n){if(e)for(let r of[!0,!1])for(let o of e){if(o.isForm!==r)continue;let i=o.actionIdxs[0],s=o.isForm?"action":"formaction";for(let l of o.actionIdxs)if(wr(ft(n[l]),s,o.tag)){i=l;break}let a=t[i];if(!a||!a.el)continue;let c=ft(n[i]);if(o.isForm)Qs(a.el,c,Wr(o.methodParts,o.staticMethod,n),Wr(o.enctypeParts,o.staticEnctype,n),o);else{let l=u=>u.some(f=>f.kind==="bool"?!!ft(n[f.i]):f.kind==="attr"?ln("name",ft(n[f.i]))!==null:!0);Xu(a.el,c,o,l(o.nameParts),l(o.valueParts),Wr(o.methodParts,o.staticMethod,n),Wr(o.enctypeParts,o.staticEnctype,n))}}}function Ju(e){(Ir.has(e)||e.getAttribute("name")===H)&&(e.getAttribute("name")===H&&e.removeAttribute("name"),e.removeAttribute("value"),Ir.delete(e))}function Xu(e,t,n,r,o,i,s){let a=typeof t=="function"?Ko(t):null;if(!a){typeof t=="function"&&Vo(null,e.localName),Ju(e),ea(e,i,s,n.propAttrs);return}Gs(n.duplicateAction,e.localName),Ys(n.propAttrs,e.localName),n.staticAction&&Vs(e.localName),(n.authoredValue||o)&&Ws(e.localName),(n.authoredName||r)&&qs(e.getAttribute("name")||H,e.localName,!1),(n.authoredForm||e.hasAttribute("form"))&&zs(e.localName),Ks(e.localName,e.getAttribute("type"));let c=Zs(e.localName,i,s);e.removeAttribute("formaction"),e.setAttribute("name",H),e.setAttribute("value",a),fn(e,"formmethod",i,c.formMethod),fn(e,"formenctype",s,c.formEnctype),Ir.set(e,a)}function Wr(e,t,n){for(let r of e){if(r.kind==="bool")return ft(n[r.i])?"":z;if(r.kind==="attr"){let a=ln("method",ft(n[r.i]));return a===null?z:a}let o=r.statics||[],i=r.group||[],s=o[0]||"";for(let a=0;a<i.length;a++)s+=String(ft(n[i[a]])??""),s+=o[a+1]||"";return s}return t??z}function ft(e){return de(e)?e.value:e}function Zu(e,t,n=!1){let{templateEl:r,parts:o,formActions:i}=Mt(e),s=r.content.cloneNode(!0),a=document.createComment(`${k}s`),c=document.createComment(`${k}e`),l=o.map(p=>xn(p,s)),u=n?Aa(t,s,l):null;u&&va(u,l);let f=[];for(let p=0;p<e.values.length;p++)ie(l[p],e.values[p],void 0,e.values,Vr),f.push(e.values[p]);Vr(i,l,e.values),u?xa(u,t,[a,...s.childNodes,c]):t.replaceChildren(a,...s.childNodes,c);let d=t.nodeType===1&&t[S]?t:null;for(let p of l)p.kind==="slot"&&(d&&p.slotEl&&(p.slotEl[rt]=d),ie(p,void 0,void 0,[],Vr));return{strings:e.strings,bound:l,lastValues:f,startNode:a,endNode:c}}function Ba(e,t){for(let n of e.bound){if(n.kind==="event"&&n.el.removeEventListener(n.name,n.dispatcher,n.handler),n.kind==="element"){let r=n.lastTarget;if(r){if(typeof r=="function")try{r(void 0)}catch{}else if(typeof r=="object")try{r.value=void 0}catch{}n.lastTarget=void 0,n.__lastEl=void 0}}if(n.kind==="slot"){let r=$t(n.slotEl);r&&xi(r,n.slotEl)}}t.replaceChildren()}function Bi(e){return!!e&&e.state!==!0&&e.attribute!==!1}function qa(e,t){if(e.converter&&e.converter.fromAttribute)return e.converter.fromAttribute(t,e.type);if(e.type===Number)return t==null?null:Number(t);if(e.type===Boolean)return t!=null&&t!=="false";if(e.type===Object||e.type===Array){if(t==null)return null;try{return JSON.parse(t)}catch{return null}}return t}function Qu(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Ka(e,t){let n;for(let{propName:r,def:o,primary:i,alias:s}of Va(e)){if(i===t)return{propName:r,def:o};n===void 0&&s===t&&(n={propName:r,def:o})}return n}function Wa(e){let t=new Set,n=Va(e);for(let{primary:r}of n)t.add(r);for(let{alias:r}of n)r&&t.add(r);return[...t]}function Va(e){if(e&&typeof e=="function"){let t=Ha.get(e);if(t)return t;let n=Ua(e);return Ha.set(e,n),n}return Ua(e)}var Ha=new WeakMap;function Ua(e){let t=e&&e.properties||{},n=[];for(let[r,o]of Object.entries(t)){let i=typeof o=="object"&&o!==null?o:{type:o};if(!Bi(i))continue;let s=i.attribute||Qu(r),a=r.toLowerCase(),c=!i.attribute&&a!==s?a:void 0;n.push({propName:r,def:i,primary:s,alias:c})}return n}var za=null;function zr(e){za=e||null}function Hi(){return za||void 0}Fe();var Ga=Symbol.for("webjs:registry"),Ya=Symbol.for("webjs:classToTag"),Bt=globalThis,_e=Bt[Ga]||(Bt[Ga]=new Map),Xa=Bt[Ya]||(Bt[Ya]=new WeakMap),Ja=Symbol.for("webjs:registryVersion"),Za=Bt[Ja]||(Bt[Ja]={v:0}),Gr=typeof window<"u"&&typeof customElements<"u";function Ui(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=_e.get(e);r?(r.cls=t,r.lazy=n):(_e.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),Za.v+=1),Xa.set(t,e)}if(Gr){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),Ui(t,n)}}if(!Gr){let e=globalThis;e.customElements||(e.customElements={define(t,n){Ui(t,n)},get(t){return _e.get(t)?.cls},upgrade(){},whenDefined(t){let n=_e.get(t);return Promise.resolve(n?.cls)}})}function Qa(e,t){Gr?customElements.define(e,t):Ui(e,t)}function ef(e,t){if(Gr)return;let n=_e.get(e);if(n){n.moduleUrl=t;return}_e.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e}),Za.v+=1}function tf(e){return _e.get(e)?.cls}function nf(e){return _e.get(e)?.moduleUrl||null}function rf(e){return _e.get(e)?.lazy===!0}function pt(e){return Xa.get(e)}function of(){return[..._e.keys()]}Nn();Ue();function gf(){return{states:new Set,shadowRoot:null,form:null,labels:[],role:"",willValidate:!0,validity:{},validationMessage:"",setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0}}}var Cn=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 i=t.getAttribute(n(o));return i===null?void 0:i},set(r,o,i){return typeof o=="string"&&t.setAttribute(n(o),i),!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,i)=>i.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=gf(),this.__internals}},wf=["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 wf){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(Cn.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}function oc(e,t){return!Object.is(e,t)}function ic(e){try{return String(e)}catch{return Object.prototype.toString.call(e)}}function Ki(e,t,n){if(typeof console>"u"||!console.warn)return;let r=pt(e.constructor)||e.tagName?.toLowerCase()||"unknown";console.warn(`[webjs] reflect:true property "${t}" on <${r}> holds a function (or an array carrying one), which has no HTML attribute representation. Removing "${n}" instead of stringifying it (a stringified function writes its source into the page, so a server action's body would ship to the browser). Pass a string, or drop reflect on this property.`)}function sc(e,t,n,r){if(typeof console>"u"||!console.warn)return;let o=pt(e.constructor)||e.tagName?.toLowerCase()||"unknown";console.warn(`[webjs] reflect:true property "${t}" on <${o}> holds a value JSON.stringify cannot serialize (a cycle, a BigInt, or a throwing toJSON), so it has no HTML attribute representation. Removing "${n}" instead. Detail: ${r}`)}function ac(e,t={}){return e&&typeof e=="object"&&!("call"in e)&&(t=e,e=void 0),{...e?{type:e}:{},...t}}var lc=typeof window<"u"&&typeof HTMLElement<"u",_f=lc?HTMLElement:Cn,uc=Symbol("webjs.factoryProps"),cc=new WeakSet,Sf=Promise.resolve(!0),kn=new Set,fc=new WeakMap;function Af(e,t){let n=[];for(let[r,o]of Object.entries(t)){let i=typeof o=="object"&&o!==null?o:{type:o};n.push({propName:r,decl:i});let s=i.hasChanged||oc;Object.defineProperty(e.prototype,r,{configurable:!0,enumerable:!0,get(){return this.__propValues[r]},set(a){let c=this.__propValues[r];this.__propValues[r]=a,s(a,c)&&(i.reflect&&(this._connected?this._reflectAttribute(r,a,i):(this.__reflectPending??=new Set).add(r)),this.requestUpdate(r,c))}})}return fc.set(e,n),n}var bt=class e extends _f{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){Qa(t,this)}static get observedAttributes(){return Wa(this)}constructor(){super(),this._renderRoot=null,this._scheduled=!1,this._connected=!1,this.__controllers=null,this.__firstRendered=!1,this._changedProperties=new Map,this._updateResolve=null,this._updatePromise=Sf,this._isUpdating=!1,this._assertFactoryProperties(),this._initializeProperties()}_assertFactoryProperties(){let t=this.constructor;if(cc.has(t))return;let n=t;for(;n&&n!==e;){if(Object.hasOwn(n,"properties")&&!Object.hasOwn(n,uc)){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)}cc.add(t)}_initializeProperties(){let t=this.constructor,n=t.properties;if(!n||typeof n!="object")return;this.__propValues={};let r=fc.get(t);r===void 0&&(r=Af(t,n));for(let o=0;o<r.length;o++){let{propName:i,decl:s}=r[o],a;Object.hasOwn(this,i)&&(a=this[i],delete this[i]),a!==void 0?this.__propValues[i]=a:s.default!==void 0&&(this.__propValues[i]=typeof s.default=="function"?s.default():s.default)}}_reflectAttribute(t,n,r){if(!Bi(r))return;let o=r.attribute||vf(t);if(!this.__reflectingAttribute){this.__reflectingAttribute=!0;try{if(r.converter&&r.converter.toAttribute){let i=r.converter.toAttribute(n,r.type);i==null?this.removeAttribute(o):this.setAttribute(o,i)}else if(typeof n=="function")this.removeAttribute(o),Ki(this,t,o);else if(r.type===Boolean)n?this.setAttribute(o,""):this.removeAttribute(o);else if(n==null)this.removeAttribute(o);else if(r.type===Object||r.type===Array){let i,s=!0;try{i=JSON.stringify(n)}catch(a){s=!1,this.removeAttribute(o),sc(this,t,o,a&&a.message)}s&&this.setAttribute(o,i)}else _r(n)?(this.removeAttribute(o),Ki(this,t,o)):this.setAttribute(o,String(n))}finally{this.__reflectingAttribute=!1}}}connectedCallback(){if(!lc)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 i=xf(r.slice(16));try{this[i]=mt(o)}catch(s){console.warn(`[webjs] failed to decode ${r} on <${this.tagName.toLowerCase()}>: ${s&&s.message}`)}}}_activate(){this._connected=!0,this.__accessorsLifted||(this.__accessorsLifted=!0,Ef(this)),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:Ho(r)?[r]:[];if(o.length){if(n){let i=this.shadowRoot.querySelector("style");i&&i.remove()}Uo(this._renderRoot,o)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${pt(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().`),ot(this)?ai(this):this.__isHydrating()||this.hasAttribute("data-wj-serialized")||vi(this)?(this.removeAttribute("data-wj-serialized"),j(this),ei(this)):Qo(this),hi(this),ii(this);for(let n of this.__controllers||kn)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),si(this);for(let t of["__signalWatcher","__postWatcher"]){let n=this;n[t]&&(n[t].dispose(),n[t]=void 0)}for(let t of this.__controllers||kn)t.hostDisconnected&&t.hostDisconnected()}attributeChangedCallback(t,n,r){if(this.__reflectingAttribute)return;let o=Ka(this.constructor,t);if(o===void 0)return;let{propName:i,def:s}=o,a=qa(s,r);this[i]!==a&&(this[i]=a,this._connected&&this.requestUpdate())}requestUpdate(t,n){t!==void 0&&!this._changedProperties.has(t)&&this._changedProperties.set(t,n),this._scheduleUpdate()}_scheduleUpdate(){this._updateResolve===null&&(this._updatePromise=new Promise(t=>{this._updateResolve=t})),!this._isUpdating&&(this._scheduled||!this._connected||(this._scheduled=!0,queueMicrotask(()=>{this._scheduled=!1;try{this._performRender()}catch(t){console.error("[webjs] lifecycle hook threw during update cycle:",t)}})))}_performRender(){if(!this._renderRoot)return;this.__cycleRendered=!1;let t=this._tracked("__signalWatcher",()=>this._runUpdateCycle());t&&t()}_tracked(t,n){let r=this,o=r[t];o||(o=r[t]=new ye.subtle.Watcher(()=>{!o.__inPhase&&this._connected&&this.requestUpdate()}));let i=t==="__signalWatcher"?ye.subtle.introspectSources(o):null;o.__inPhase=!0;try{return o.observe(n)}finally{o.__inPhase=!1,i&&!this.__cycleRendered&&o.watch(...new Set([...i,...ye.subtle.introspectSources(o)])),this._connected||(o.dispose(),r[t]===o&&(r[t]=void 0))}}_runUpdateCycle(){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||kn)o.hostUpdate&&o.hostUpdate();this.__renderToken=(this.__renderToken||0)+1,this.__renderAbort&&this.__renderAbort.abort(),this.__renderAbort=typeof AbortController<"u"?new AbortController:null,this.__cycleRendered=!0;try{let o=this.update(t);o&&typeof o.then=="function"&&(r=o)}catch(o){this._handleRenderError(o)}r||(n=!0)}}catch(o){console.error("[webjs] lifecycle hook threw during update phase:",o)}finally{this._isUpdating=!1,this._changedProperties=new Map}if(r){let o=this.__renderToken;this.__pendingAsyncCommits=(this.__pendingAsyncCommits||0)+1;let i=()=>{this.__pendingAsyncCommits--,o===this.__renderToken&&this._postCommit(t)};r.then(i,s=>{try{o===this.__renderToken&&this._handleRenderError(s instanceof Error?s:new Error(ic(s)))}finally{i()}});return}if(n)return()=>this._postCommit(t);this.__pendingAsyncCommits||this._resolveUpdate(),!n&&this.__postWatcher&&this.__postWatcher.watch()}_resolveUpdate(){if(this._updateResolve){let t=!this._scheduled;this._updateResolve(t),this._updateResolve=null}}performServerUpdate(){let t=this._changedProperties;this._isUpdating=!0;try{this.willUpdate(t);for(let n of this.__controllers||kn)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||this._reflectAttribute(n,this[n],r)}}shouldUpdate(t){return!0}willUpdate(t){}update(t){let n=this.__reflectPending;this.__reflectPending=void 0;for(let i of n||[]){let s=this.constructor.properties[i];this._reflectAttribute(i,this[i],s)}let r,o=Hi();zr(this.__renderAbort?this.__renderAbort.signal:null);try{r=this.render()}finally{zr(o||null)}if(r&&typeof r.then=="function")return this._commitAsync(r);ye.subtle.untrack(()=>dt(r,this._renderRoot,{host:this}))}_commitAsync(t){let n=this.__renderToken;if(this.__firstRendered&&this._overridesRenderFallback())try{let r=this.renderFallback();r!==void 0&&ye.subtle.untrack(()=>dt(r,this._renderRoot,{host:this}))}catch(r){console.error("[webjs] renderFallback() threw:",r)}return Promise.resolve(t).then(r=>{if(n===this.__renderToken)try{dt(r,this._renderRoot,{host:this})}catch(o){this._handleRenderError(o instanceof Error?o:new Error(String(o)))}},r=>{n===this.__renderToken&&this._handleRenderError(r instanceof Error?r:new Error(String(r)))})}_overridesRenderFallback(){return this.renderFallback!==Rn.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${pt(this.constructor)||this.tagName?.toLowerCase()}>:`,t);try{let n=this.renderError(t);n!==void 0&&ye.subtle.untrack(()=>dt(n,this._renderRoot,{host:this}))}catch(n){console.error("[webjs] renderError() also threw:",n)}}_postCommit(t){let n=this._updateResolve;this._updateResolve=null;try{this._tracked("__postWatcher",()=>{for(let r of this.__controllers||kn)r.hostUpdated?.();this.__firstRendered||(this.__firstRendered=!0,this.firstUpdated(t)),this.updated(t)})}catch(r){console.error("[webjs] lifecycle hook threw during post-commit phase:",r)}finally{n?.(!this._scheduled)}}updated(t){}firstUpdated(t){}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._updatePromise}addController(t){(this.__controllers??=new Set).add(t),this._connected&&t.hostConnected&&t.hostConnected()}removeController(t){this.__controllers&&this.__controllers.delete(t)}render(){return""}renderError(t){}renderFallback(){}};function vf(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function xf(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Rn(e){return new.target?Reflect.construct(bt,arguments,new.target):class extends bt{static properties=e;static[uc]=!0}}function Ef(e){for(let t of Object.keys(e))for(let n=Object.getPrototypeOf(e);n&&n!==bt.prototype;n=Object.getPrototypeOf(n)){let r=Object.getOwnPropertyDescriptor(n,t);if(r){if(r.set){let o=e[t];delete e[t],e[t]=o}break}}}Object.setPrototypeOf(Rn,bt);Rn.prototype=bt.prototype;qo();var dc=Symbol.for("webjs.notFound"),pc=Symbol.for("webjs.redirect"),hc=Symbol.for("webjs.forbidden"),mc=Symbol.for("webjs.unauthorized");function Tf(){let e=new Error("webjs: notFound()");throw e.__webjs=dc,e}function Nf(){let e=new Error("webjs: forbidden()");throw e.__webjs=hc,e}function Cf(){let e=new Error("webjs: unauthorized()");throw e.__webjs=mc,e}function kf(e,t){let n=typeof t=="object"&&t!==null?t.status:t,r=new Error(`webjs: redirect(${e})`);throw r.__webjs=pc,r.url=e,r.status=typeof n=="number"?n:void 0,r}function Rf(e){return!!e&&e.__webjs===dc}function Of(e){return!!e&&e.__webjs===pc}function Lf(e){return!!e&&e.__webjs===hc}function jf(e){return!!e&&e.__webjs===mc}var bc=null;function Pf(){if(!bc)return"";try{return bc()||""}catch{return""}}var yc=null;function Mf(e){if(typeof e!="string"||!e||!yc)return e;try{return yc(e)||e}catch{return e}}Fe();var rm=Symbol.for("webjs.suspense");function If(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function Ff(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}function $f(e,t={}){let n=t.reconnect!==!1,r=0,o=!1,i=null,s=[];function a(){o||(i=new WebSocket(Df(e),t.protocols),i.onopen=c=>{for(r=0;s.length&&i&&i.readyState===WebSocket.OPEN;)i.send(s.shift());t.onOpen?.(c)},i.onmessage=c=>{let l=c.data;if(typeof l=="string")try{l=JSON.parse(l)}catch{}t.onMessage?.(l,c)},i.onerror=c=>{t.onError?.(c)},i.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);i&&i.readyState===WebSocket.OPEN?i.send(l):s.push(l)},close(c,l){o=!0;try{i?.close(c,l)}catch{}},get socket(){return i},get readyState(){return i?.readyState??3}}}function Df(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}`}Nn();var Wi="application/vnd.webjs+json";async function Bf(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",Wi);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 qi(r),n.has("content-type")||n.set("content-type",Wi));let o=await fetch(e,{...t,headers:n,body:r}),i=o.headers.get("content-type")||"",s=await o.text(),a=i.includes(Wi)?s?mt(s):null:i.includes("application/json")?s?JSON.parse(s):null:s;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}Nn();Jr();Jr();Yi();jn();var js=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 i=this.updates.findIndex(s=>s.id===r);i!==-1&&(this.updates.splice(i,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 Pd(e,t,n){let r=e.get();e.set(t);let o;try{o=await n()}catch(i){throw e.set(r),i}return o&&o.success===!1&&e.set(r),o}function Md(e,t,n){return e&&typeof e.get=="function"&&typeof e.set=="function"?Pd(e,t,n):new js(e,t)}Zr();eo();var Id="application/vnd.webjs+stream",Fd=1,$d=2,Dd=3,Rl=new Uint8Array(0);function Bd(e,t){let n=t||Rl,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 Hd(){let e=Rl;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 i=e.slice(5,5+o);n.push({type:r,payload:i}),e=e.slice(5+o)}return n}}}var Ud=Symbol.for("webjs.context");function qd(e){return{__context__:Ud,name:e}}var $o=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},Ps=class{constructor(t,{context:n,initialValue:r}){this._host=t,this._context=n,this._value=r,this._subscriptions=new Set,this._onRequest=o=>{let i=o;if(i.context===this._context)if(o.stopPropagation(),i.subscribe){let s={callback:i.callback},a=()=>{this._subscriptions.delete(s)};this._subscriptions.add(s),i.callback(this._value,a)}else i.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()}},Ms=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 $o(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 Kd(){return typeof window<"u"}var Ie={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},Is=class{constructor(t,{task:n,args:r,autoRun:o=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=o,this._status=Ie.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=Ie.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=Ie.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=Ie.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 Ie.INITIAL:return t.initial?.();case Ie.PENDING:return t.pending?.();case Ie.COMPLETE:return t.complete?.(this._value);case Ie.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun||!Kd())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}};Ot();export{Ms as ContextConsumer,Ps as ContextProvider,$o as ContextRequestEvent,H as FORM_ACTION_FIELD,Us as FORM_ACTION_ID_KEY,Fd as FRAME_CHUNK,$d as FRAME_END,Dd as FRAME_ERROR,k as MARKER,Tc as SEED_MISS,Id as STREAM_CONTENT_TYPE,ye as Signal,If as Suspense,Is as Task,Ie as TaskStatus,Rn as WebComponent,Gi as WebjsFrame,Ji as WebjsStream,Hi as activeActionSignal,Uo as adoptStyles,of as allTags,Mf as asset,cu as asyncAppend,lu as asyncReplace,Cu as batch,su as cache,ra as classMap,Ru as computed,$f as connectWS,nd as consumeStale,qd as createContext,Hd as createFrameDecoder,iu as createRef,Pf as cspNonce,Fl as css,nc as deserialize,Rs as disableClientRouter,Lu as effect,br as enableClientRouter,Bd as encodeFrame,Hs as escapeAttr,Hl as escapeText,ed as fetchMark,Nf as forbidden,nu as guard,Ml as html,ia as ifDefined,Yo as isAsyncAppend,Jo as isAsyncReplace,Ho as isCSS,Er as isCache,Lf as isForbidden,vr as isGuard,Ar as isKeyed,rf as isLazy,de as isLive,Rf as isNotFound,Of as isRedirect,xr as isRef,Sr as isRepeat,Ou as isSignal,Ff as isSuspense,B as isTemplate,Go as isTemplateContent,jf as isUnauthorized,zo as isUnsafeHTML,Tr as isUntil,Nr as isWatch,tu as keyed,eu as live,Ls as loadFrame,tf as lookup,nf as lookupModuleUrl,ts as markStale,Os as navigate,V as noChange,Tf as notFound,P as nothing,Md as optimistic,mt as parse,ns as parseTagHeader,ef as primeModuleUrl,ac as prop,kf as redirect,ou as ref,Fo as refreshPage,td as registerKeyTags,dt as render,Xi as renderStream,na as repeat,Io as revalidate,Bf as richFetch,Xr as scanSeeds,Zf as seedStats,tc as serialize,zr as setActiveActionSignal,ku as signal,qi as stringify,oa as styleMap,$l as stylesToString,Il as svg,pt as tagOf,Xf as takeSeed,ru as templateContent,Cf as unauthorized,Ql as unsafeHTML,au as until,uu as watch};
|
|
1
|
+
var ff=Object.defineProperty;var _=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ia=(e,t)=>{for(var n in t)ff(e,n,{get:t[n],enumerable:!0})};var R,A,We=_(()=>{R=Symbol.for("webjs.nothing"),A=Symbol.for("webjs.noChange")});function Vt(e){return Object.prototype.hasOwnProperty.call(Jr,e)}function Pn(e,t){return t===R||t===A?null:String(t??"")}var Jr,In=_(()=>{We();Jr=Object.freeze({"@":"event",".":"prop","?":"bool"})});function Af(e){let t=String(e);return _f.test(t)?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"):t}function qa(e){let t=String(e);return Sf.test(t)?t.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<"):t}var _f,Sf,Si=_(()=>{_f=/[&<>]/,Sf=/[&"<]/});function Wa(e,t,n){vf.has(t)?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}async function Ai(e){return JSON.stringify(await Ka(e))}function vi(e){let t=za();if(Ga(e,t).length)throw new TypeError("[webjs] a File or Blob cannot be serialized synchronously (it cannot be a bound argument of a form action).");return JSON.stringify(Ke(e,t))}function Le(e){return Va(JSON.parse(e))}async function Ka(e){let t=za();return await xf(e,t),Ke(e,t)}function Va(e){return Ve(e,Cf())}function za(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map,fdEntries:new Map}}async function xf(e,t){for(let n of Ga(e,t))t.blobBytes.set(n,new Uint8Array(await n.arrayBuffer()))}function Ga(e,t){let n=[],r=[e];for(;r.length;){let o=r.pop();if(!Rf(o))continue;let i=t.refCount.get(o)||0;if(t.refCount.set(o,i+1),!(i>0)){if(typeof Blob<"u"&&o instanceof Blob){n.push(o);continue}if(typeof FormData<"u"&&o instanceof FormData){let s=t.fdEntries.get(o)||[...o.entries()];t.fdEntries.set(o,s);for(let[,a]of s)typeof a!="string"&&r.push(a);continue}if(Array.isArray(o))for(let s=0;s<o.length;s++)r.push(o[s]);else if(o instanceof Map)for(let[s,a]of o)r.push(s),r.push(a);else if(o instanceof Set)for(let s of o)r.push(s);else if(Of(o))for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&r.push(o[s])}}for(let[o,i]of t.refCount)i>1&&t.idOf.set(o,t.nextId++);return n}function Ke(e,t){if(e===null)return null;if(e===void 0)return{[I]:"undef"};let n=typeof e;if(n==="string"||n==="boolean")return e;if(n==="number")return Number.isNaN(e)?{[I]:"NaN"}:e===1/0?{[I]:"Inf"}:e===-1/0?{[I]:"-Inf"}:Object.is(e,-0)?{[I]:"-0"}:e;if(n==="bigint")return{[I]:"BigInt",v:e.toString()};if(n==="symbol"){let i=Symbol.keyFor(e);if(i===void 0)throw new TypeError("Cannot serialize a local Symbol; only Symbol.for() registered symbols are supported.");return{[I]:"Sym",v:i}}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{[I]:"Ref",v:r};r!==void 0&&t.emitted.add(r);let o;if(e instanceof Date)o={[I]:"Date",v:Number.isNaN(e.getTime())?null:e.toISOString()};else if(e instanceof Error)o={[I]:"Error",v:{name:e.name,message:e.message,stack:e.stack||null}};else if(typeof Blob<"u"&&e instanceof Blob){let i=t.blobBytes.get(e);typeof File<"u"&&e instanceof File?o={[I]:"File",v:Dn(i),n:e.name,t:e.type||"",m:e.lastModified}:o={[I]:"Blob",v:Dn(i),t:e.type||""}}else if(typeof FormData<"u"&&e instanceof FormData){let i=t.fdEntries.get(e)||[...e.entries()],s=[];for(let[a,c]of i)s.push([a,Ke(c,t)]);o={[I]:"FD",v:s}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)o=Ef(e);else if(e instanceof Map){let i=[];for(let[s,a]of e)i.push([Ke(s,t),Ke(a,t)]);o={[I]:"Map",v:i}}else if(e instanceof Set){let i=[];for(let s of e)i.push(Ke(s,t));o={[I]:"Set",v:i}}else if(Array.isArray(e))o=e.map(i=>Ke(i,t));else{o={};for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let s=Lf(i)?"_"+i:i;Wa(o,s,Ke(e[i],t))}}if(r!==void 0){if(Array.isArray(o))return{[I]:"Arr",_id:r,v:o};o._id=r}return o}function Ef(e){if(e instanceof ArrayBuffer)return{[I]:"buf",v:Dn(new Uint8Array(e))};if(e instanceof DataView)return{[I]:"dv",v:Dn(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=Tf[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[I]:n,v:Dn(r)}}function Cf(){return{refs:new Map}}function Ve(e,t){if(e===null||typeof e!="object")return e;if(Array.isArray(e)){let i=[];for(let s=0;s<e.length;s++)i.push(Ve(e[s],t));return i}let n=e[I];if(typeof n=="string")return Nf(e,n,t);let r={},o=e._id;typeof o=="number"&&t.refs.set(o,r);for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i)||i==="_id")continue;let s=jf(i)?i.slice(1):i;Wa(r,s,Ve(e[i],t))}return r}function Nf(e,t,n){let r=e._id,o=i=>(typeof r=="number"&&n.refs.set(r,i),i);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 i=new Error(e.v.message);return i.name=e.v.name,e.v.stack&&(i.stack=e.v.stack),typeof r=="number"&&n.refs.set(r,i),i}case"Map":{let i=new Map;typeof r=="number"&&n.refs.set(r,i);for(let[s,a]of e.v)i.set(Ve(s,n),Ve(a,n));return i}case"Set":{let i=new Set;typeof r=="number"&&n.refs.set(r,i);for(let s of e.v)i.add(Ve(s,n));return i}case"Arr":{let i=[];typeof r=="number"&&n.refs.set(r,i);for(let s of e.v)i.push(Ve(s,n));return i}case"Ref":{let i=n.refs.get(e.v);if(i===void 0)throw new TypeError(`Dangling reference: id=${e.v}`);return i}case"Blob":{if(typeof Blob>"u")throw new TypeError("Blob is not available in this environment.");let i=Mn(e.v);return o(new Blob([i],{type:e.t||""}))}case"File":{if(typeof File>"u")throw new TypeError("File is not available in this environment.");let i=Mn(e.v);return o(new File([i],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 i=new FormData;o(i);for(let[s,a]of e.v){let c=Ve(a,n);i.append(s,c)}return i}default:{if(t==="buf"){let s=Mn(e.v);return o(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength))}if(t==="dv"){let s=Mn(e.v);return o(new DataView(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)))}let i=kf[t];if(i){let s=Mn(e.v),a=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength);return o(new i(a))}throw new TypeError(`Unknown serialization tag: ${t}`)}}}function Rf(e){return e!==null&&typeof e=="object"}function Of(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Lf(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function jf(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}function Dn(e){if(Ja)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 Mn(e){if(Ja){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 I,vf,Tf,kf,Ja,zt=_(()=>{I="_$wj",vf=new Set(["__proto__","constructor","prototype"]);Tf={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},kf={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};Ja=typeof Buffer<"u"&&typeof Buffer.from=="function"});function Za(e,t){return t.length?`${e}${Xa}${encodeURIComponent(vi(t))}`:e}function Pf(e){let t=e.indexOf(Xa);if(t===-1)return{id:e,args:[]};let n=Le(decodeURIComponent(e.slice(t+1)));if(!Array.isArray(n))throw new TypeError("bound action arguments are not a list");return{id:e.slice(0,t),args:n}}function Qa(e){if(typeof e!="function"||Object.prototype.hasOwnProperty.call(e,"bind"))return e;try{Object.defineProperty(e,"bind",{value:If,configurable:!0,writable:!0})}catch{}return e}function If(e,...t){let n=Function.prototype.bind.call(this,e,...t),r=Ya.get(this),o=r?r.target:this,i=r?[...r.args,...t]:t;Ya.set(n,{target:o,args:i});let s=Yr(o);if(s)try{Object.defineProperty(n,xi,{get:()=>Za(s,i)})}catch{}return Qa(n)}function Yr(e){if(typeof e!="function")return null;let t=e[xi];return typeof t=="string"&&t?t:null}function Xr(e,t,n){if(typeof e!="function")return!1;let r=String(t).toLowerCase(),o=String(n||"").toLowerCase();return r==="action"?o==="form":r==="formaction"?o==="button"||o==="input":!1}function ec(e,t,n=!0){if(!e||e===z&&n)return;let r=e===z?'a second "name" attribute':`name="${e}"`;throw new Error(`[webjs] formaction=\${action} on <${t||"button"}> cannot be used when the element already carries a "name" attribute (found ${r}). The action identity is submitted as the button's own name/value pair, so there is no room for a second one. Move the action to the enclosing <form action=\${action}> or drop the submitter's "name".`)}function tc(e,t){let n=String(e||"").toLowerCase(),r=t==null?null:String(t).toLowerCase();if(Mf(n,r)){if(n==="input"&&r==="image")throw new Error('[webjs] formaction=${action} is not supported on <input type="image"> because image submitters submit coordinate pairs (name.x/name.y) instead of name=value, so the action identity would never arrive. Use a <button> instead.');if(n==="input")throw new Error('[webjs] formaction=${action} is not supported on <input type="submit"> because the action identity has to occupy the submitter\'s "value", which on this control is also its visible label, so the button would render captioned with the action\'s id and could not be given a real one. Use <button formaction=${action}>Publish</button>, whose label is its children.');return}throw new Error(`[webjs] formaction=\${action} on <${n}>${r?` type="${r}"`:""} requires a submitter control, and formaction is inert on anything else. Use <button formaction=\${action}>.`)}function Mf(e,t){let n=t==null?null:String(t).toLowerCase();return e==="button"?n==null||n===""||n==="submit":e==="input"?n==="submit"||n==="image":!1}function nc(e){throw new Error(`[webjs] formaction=\${action} on <${e||"button"}> cannot be used when the element already carries a "value" attribute. The action identity is submitted as the button's own name/value pair, so both halves are taken. Drop the "value", or dispatch on it from one form-level action instead.`)}function rc(e){throw new Error(`[webjs] a bound formaction=\${action} on <${e||"button"}> cannot also carry a plain formaction attribute: the two name different targets and the renderers resolve them differently. Drop the static attribute.`)}function oc(e){throw new Error(`[webjs] formaction=\${action} on <${e||"button"}> cannot be used with a "form" attribute, which re-points the submitter at a form other than the bound one it sits in. Keep the submitter inside its bound <form>.`)}function ic(e,t){if(e)throw new Error(`[webjs] two formaction=\${action} holes were found on one <${t||"button"}>. Only one can win, and the two renderers pick differently, so bind exactly one action per submitter.`)}function sc(e,t){let r=(e||[]).filter(o=>Ei(o))[0];if(r)throw new Error(`[webjs] a <${t||"button"}> submitter binds .${r}=. That property is a reflected IDL attribute on a submitter, so a property binding is dropped at SSR and written to the attribute in the browser: the page would render on the server and throw on hydration. Write it as a plain attribute.`)}function Ei(e){let t=String(e).toLowerCase();return t==="name"||t==="value"||t==="formaction"||t==="formmethod"||t==="formenctype"}function Df(e,t,n){let r=t==null?null:String(t),o=n==null?null:String(n);if(r!=null&&/^dialog$/i.test(r))throw new Error(`[webjs] formaction=\${action} on <${e}> cannot be combined with formmethod="dialog", which dismisses a <dialog> instead of submitting, so the bound action would never run. Drop one of the two.`);if(r!=null&&!/^post$/i.test(r))throw new Error(`[webjs] <${e} formmethod="${r}" formaction=\${action}> cannot work: a bound server action is submitted as a POST body, and a "${r}" submission sends none, so the action would never run. Drop the formmethod attribute (WebJs emits formmethod="post" on a bound submitter), or drop the binding.`);if(o!=null&&!cc.has(o.toLowerCase()))throw new Error(`[webjs] <${e} formenctype="${o}" formaction=\${action}> cannot work: a form submission is parsed as multipart/form-data or application/x-www-form-urlencoded, and a "${o}" body is neither, so the bound action could never read it. Drop the formenctype attribute (WebJs emits multipart/form-data on a bound submitter).`)}function Gt(e,t,n){if(Fn(e)&&(Vf(e,t,n),!!Wf(t)))throw new Error(Kf(t,n))}function ac(e,t,n){qf(t,n)&&Gt(e,t,n)}function Ti(e,t,n){if(e)return e;let r=t==="button"||t==="input"?"formaction=":"action=";throw typeof n=="function"&&/^bound /.test(n.name)?new Error(`[webjs] the function in ${r} on <${t||"form"}> is a bound function that is not a server action. Bind the imported action itself: action.bind(null, id) on a function exported from a 'use server' *.server.{js,ts} module keeps its identity, and the bound arguments arrive before the form data. See https://webjs.dev/docs/server-actions#bound-arguments`):new Error(`[webjs] the function in ${r} on <${t||"form"}> is not a server action. Only a function imported from a 'use server' *.server.{js,ts} module can be bound to a form or a submitter, because the identity the browser submits has to resolve back to something the server can run. A 'use server' directive inside a function body (Next.js's inline action) is not one: the boundary is a file. Move the function into its own module, e.g. modules/<feature>/actions/<name>.server.ts starting with 'use server', export it and import it here, or pass a url string. See https://webjs.dev/docs/troubleshooting#inline-use-server`)}function $f(e,t){if(e!=null&&!/^post$/i.test(e))throw new Error(`[webjs] <form method="${e}" action=\${action}> cannot work: a bound server action is submitted as a POST body, and a "${e}" form sends no body. Drop the method attribute (WebJs emits method="post") or remove the bound action.`);if(t!=null&&!cc.has(t.toLowerCase()))throw new Error(`[webjs] <form enctype="${t}" action=\${action}> cannot work: a form submission is parsed as multipart/form-data or application/x-www-form-urlencoded, and a "${t}" body is neither, so the submission would run under JS and do nothing without it. Drop the enctype attribute (WebJs emits multipart/form-data).`)}function Ff(e){if(e.duplicateAction)throw new Error("[webjs] two action=${...} holes were found on one <form>. A form can carry only one action binding. Move one to a submit button's formaction=${action} or remove the duplicate.");if(e.staticAction)throw new Error('[webjs] a bound <form action=${action}> also carries a plain action="..." attribute. A bound form posts to the page\'s own url, so the two say different things: without JS the browser would post to the written url and with JS it would not. Drop the action attribute, or drop the binding.');let t=e.propAttrs&&e.propAttrs[0];if(t)throw new Error(`[webjs] a bound <form action=\${action}> also binds .${t}=. A property binding on a native element is dropped at SSR and applied in the browser, so the form would submit one way with JS and another way without it. Write it as a plain attribute.`)}function Hf(e,t){let n=e!==Z&&e!=null,r=t!==Z&&t!=null;return $f(n?e:null,r?t:null),{method:n?null:"post",enctype:r?null:"multipart/form-data"}}function lc(e,t,n){let r=t!==Z&&t!=null,o=n!==Z&&n!=null;return Df(e,r?t:null,o?n:null),{formMethod:r?null:"post",formEnctype:o?null:"multipart/form-data"}}function uc(e,t,n,r,o){let i=typeof t=="function"?Yr(t):null;if(!i){typeof t=="function"&&Ti(null,e.localName,t),Uf(e,n,r,o.propAttrs);return}Ff(o);let s=Hf(n,r);e.removeAttribute("action"),$n(e,"method",n,s.method),$n(e,"enctype",r,s.enctype),Bf(e,i)}function $n(e,t,n,r){if(r!==null){e.setAttribute(t,r);return}n!==Z&&e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Bf(e,t){let n=e.firstElementChild,r=n&&n.localName==="input"&&n.getAttribute("name")===z?n:null;if(!r){for(let o of e.children)if(o.localName==="input"&&o.getAttribute("name")===z){r=o;break}}r||(r=e.ownerDocument.createElement("input"),r.setAttribute("type","hidden"),r.setAttribute("name",z),e.insertBefore(r,e.firstChild)),r.getAttribute("value")!==t&&r.setAttribute("value",t)}function Uf(e,t,n,r){let o=e.firstElementChild;if(o&&o.localName==="input"&&o.getAttribute("name")===z)o.remove();else for(let s of e.children)if(s.localName==="input"&&s.getAttribute("name")===z){s.remove();break}let i=s=>(r||[]).some(a=>{let c=String(a).toLowerCase();return c===s||s==="enctype"&&c==="encoding"});t===Z&&!i("method")&&e.removeAttribute("method"),n===Z&&!i("enctype")&&e.removeAttribute("enctype")}function fc(e,t,n,r){let o=i=>(r||[]).some(s=>String(s).toLowerCase()===i);t===Z&&!o("formmethod")&&e.removeAttribute("formmethod"),n===Z&&!o("formenctype")&&e.removeAttribute("formenctype")}function qf(e,t){let n=String(e).toLowerCase();Vt(n[0])&&(n=n.slice(1));let r=String(t||"").toLowerCase();return n==="action"?r==="form":n==="formaction"?r==="button"||r==="input":!1}function Fn(e,t){if(typeof e=="function")return!0;if(!Array.isArray(e))return!1;let n=t||new Set;return n.has(e)?!1:(n.add(e),e.some(r=>Fn(r,n)))}function Wf(e){let t=String(e).toLowerCase();return Vt(t[0])&&(t=t.slice(1)),t==="action"||t==="formaction"}function Kf(e,t){return`[webjs] a function was interpolated into ${String(e).toLowerCase()}= on <${t||"form"}>. Stringifying a function into HTML would leak its source (a 'use server' action's body included) to every visitor, so this is refused. To run a server action from a form, write an unquoted action=\${action} on the <form> itself or a formaction=\${action} on a <button> inside a bound form. Anywhere else, pass a URL string.`}function Vf(e,t,n){if(!Fn(e))return;let r=String(t||"").replace(/^[?.@]/,"");if(!/^on[a-z]/i.test(r))return;let o=r.slice(2).toLowerCase();throw new Error(`webjs: a function was interpolated into the \`${r}\` attribute on <${n||"element"}>. An attribute is a string, so the function's source would be written into the HTML as an inline handler that runs without its closure. Bind the event with \`@${o}=\${handler}\` in a WebComponent's render() (a page or layout never hydrates, so its handlers must live in a component). See https://webjs.dev/docs/troubleshooting#function-in-on-attribute`)}var z,xi,Xa,Ya,cc,Z,ze=_(()=>{In();Si();zt();z="__webjs_action",xi="$$webjsAction",Xa="#";Ya=new WeakMap;cc=new Set(["multipart/form-data","application/x-www-form-urlencoded"]);Z=Symbol("webjs.attr.absent")});var v,x,O,H,ji,Se,gt,Hn,wc,M,Pi,Ae,E,Ge=_(()=>{v=Symbol("webjs.slot.state"),x="data-webjs-light",O="data-projection",H="actual",ji="fallback",Se=Symbol("webjs.slot.fallbackFrag"),gt=Symbol("webjs.slot.templateOwner"),Hn="data-wj-slot-owner",wc=64,M=Symbol("webjs.slot.rendering"),Pi=Symbol("webjs.slot.intercepted"),Ae=Symbol("webjs.slot.park"),E=new WeakSet});function D(e){let t=e,n=t[v];return n||(n={host:e,authored:[],assignedByName:new Map,lastSnapshot:new WeakMap},t[v]=n),n}function Je(e){return!!e[v]}function Ii(e){let t=D(e);for(;e.firstChild;){let n=e.firstChild;t.authored.push(n),E.add(n),e.removeChild(n)}ve(t)}function ve(e){let t=e.assignedByName;t.clear();for(let n of e.authored)pd(t,Ye(e,n),n)}function Ye(e,t){let n=Un(e,t);if(n)return W(n.getAttribute("name"));if(e.adoptedKey){let r=e.adoptedKey.get(t);if(r!==void 0)return r}return _c(t)}function Mi(e){let t=D(e);t.adopted=!0;let n=new Set,r=e.querySelectorAll(`slot[${x}]`);for(let o of r){let i=o;if(!Y(e,i)||i.getAttribute(O)!==H||Xt(t,e,i))continue;let s=W(i.getAttribute("name"));if(!n.has(s)){n.add(s);let a=Array.from(i.childNodes);for(let c of a)t.authored.push(c),_c(c)!==s&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(c,s));t.lastSnapshot.set(i,a.slice())}}for(let o of e.querySelectorAll("wj-slot-park"))if(Y(e,o)){for(let i of Array.from(o.childNodes))E.add(i),t.authored.push(i);o.remove()}ve(t)}function W(e){return e==null||e===""||e==="default"?null:e}function _c(e){return e.nodeType!==1?null:W(e.getAttribute("slot"))}function pd(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}var wt=_(()=>{St();Bn();_t();Ge()});function Sc(){xe||!oe||(xe=Node.prototype.appendChild,Di=Node.prototype.insertBefore,Xe=Node.prototype.removeChild,eo=Node.prototype.replaceChild,$i=Element.prototype.append,Fi=Element.prototype.prepend,Hi=Element.prototype.replaceChildren,qn=Object.getOwnPropertyDescriptor(Element.prototype,"innerHTML"),to=Object.getOwnPropertyDescriptor(Node.prototype,"textContent"))}function At(e,t){let n=e[M];e[M]=!0;try{return t()}finally{e[M]=n,n||no(e)}}function Bi(e){if(!oe)return;let t=e,n=D(e);n.backstop||(n.backstop=new MutationObserver(r=>Wn(e,n,r)),n.backstop.observe(e,{childList:!0,subtree:!1}),n.flipSensor=new MutationObserver(r=>Ac(e,r)),n.flipSensor.observe(e,{attributes:!0,attributeFilter:["slot","name"],subtree:!0}))}function Wn(e,t,n){let r=e,o=r[Ae],i=r[Symbol.for("webjs.instance")],s=!1,a=new Set;for(let c of n){for(let l of c.addedNodes)if(a.add(l),l!==o&&!(i&&Wi(i,l))){if(t.authored.indexOf(l)!==-1){s=!0;continue}E.add(l),t.authored.push(l),s=!0}for(let l of c.removedNodes){let u=t.authored.indexOf(l);if(u===-1||e.contains(l))continue;E.has(l)&&l.parentNode==null&&!a.has(l)||(t.authored.splice(u,1),s=!0)}}s&&Q(e)}function no(e){let t=e,n=t[v];if(!(n&&n.backstop))return;let r=n.backstop.takeRecords();(!(Symbol.for("webjs.instance")in t)||t[Symbol.for("webjs.instance")])&&Wn(e,n,r)}function Ac(e,t){let n=e[v];if(!n)return;let r=!1;for(let o of t){if(o.type!=="attributes")continue;let i=o.target;o.attributeName==="name"?i.tagName==="SLOT"&&i.hasAttribute(x)&&Y(e,i)&&(r=!0):o.attributeName==="slot"&&(n.adoptedKey&&n.adoptedKey.delete(i),n.authored.indexOf(i)!==-1&&(r=!0))}r&&Q(e)}function Ui(e){let t=e[v];t&&(t.backstop&&(Wn(e,t,t.backstop.takeRecords()),t.backstop.disconnect(),t.backstop=void 0),t.flipSensor&&(Ac(e,t.flipSensor.takeRecords()),t.flipSensor.disconnect(),t.flipSensor=void 0))}function qi(e){if(!oe)return;let t=e,n=t[v];if(!n)return;let r=t[Symbol.for("webjs.instance")],o=Symbol.for("webjs.instance")in t,i=!o&&n.adopted===!0,s=!1;for(let a of Array.from(e.childNodes))if(a!==t[Ae]){if(n.authored.indexOf(a)!==-1){s=!0;continue}o&&(!r||Wi(r,a))||!o&&i||(E.add(a),n.authored.push(a),s=!0)}s&&Q(e)}var xe,Di,Xe,eo,$i,Fi,Hi,qn,to,ro=_(()=>{St();Bn();_t();Kn();wt();Ge();xe=null,Di=null,Xe=null,eo=null,$i=null,Fi=null,Hi=null,qn=null,to=null});function Wi(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 vc(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),At(e,()=>xe.call(e,n))),n}function vt(e){return e instanceof Node||!!(e&&typeof e=="object"&&e.ownerDocument&&e.ownerDocument.defaultView&&e instanceof e.ownerDocument.defaultView.Node)}function Ki(e,t,n){if(n&&!vt(t))return[e.ownerDocument.createTextNode(`${t}`)];if(!vt(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);oo(e,r);for(let o of r)Xe.call(t,o);return r}return oo(e,[t]),[t]}function oo(e,t){Zt(e,t);for(let n of t){if(!vt(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 Zt(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 Vi(e,t,n){let r=e.authored;for(let i of t){let s=r.indexOf(i);s!==-1&&r.splice(s,1)}let o=n==null?r.length:r.indexOf(n);o===-1&&(o=r.length),r.splice(o,0,...t)}function Ji(e,t){let n=e[v];return n?Xt(n,e,t):!1}function Xt(e,t,n){for(let r=n;r&&r!==t;r=r.parentNode)if(e.authored.indexOf(r)!==-1)return!0;return!1}function zi(e,t){if(E.has(t))return!0;let n=t.parentNode;if(n==null)return!1;if(n===e||n===e[Ae])return!0;let r=e[v];return n.nodeType===1&&n.tagName==="SLOT"&&n.hasAttribute(x)&&(r&&r.lastSnapshot.has(n)||e.contains(n)&&Y(e,n))}function Gi(e,t){let n=[];for(let i of t)vt(i)?i.nodeType===11?n.push({frag:i}):n.push({node:i}):n.push({text:`${i}`});for(let i of n)i.frag?Zt(e,Array.from(i.frag.childNodes)):i.node&&oo(e,[i.node]);let r=e.ownerDocument.createDocumentFragment();for(let i of n)if(i.text!==void 0)xe.call(r,e.ownerDocument.createTextNode(i.text));else if(i.frag){let s=Array.from(i.frag.childNodes);oo(e,s);for(let a of s)xe.call(r,a)}else i.node&&(Zt(e,[i.node]),xe.call(r,i.node));let o=Array.from(r.childNodes);Zt(e,o);for(let i of o)Xe.call(r,i);return o}function je(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);ve(t),Q(e)}function Yi(e){if(!oe)return;let t=e;if(t[Pi])return;Sc(),t[Pi]=!0;let n=D(e);t.appendChild=function(r){if(t[M])return xe.call(this,r);let o=Ki(e,r,!1);for(let i of o)E.add(i);return Vi(n,o,null),je(e,n,o),r},t.insertBefore=function(r,o){if(t[M])return Di.call(this,r,o);if(!vt(r))throw new TypeError("Failed to execute insertBefore on the host: parameter 1 is not of type Node.");if(o!=null&&!vt(o))throw new TypeError("Failed to execute insertBefore on the host: parameter 2 is not of type Node.");if(Zt(e,r.nodeType===11?Array.from(r.childNodes):[r]),o!=null&&(n.authored.indexOf(o)===-1||!zi(e,o)))throw new DOMException("insertBefore: reference node is not an assigned child of this host","NotFoundError");if(r===o)return r;let i=Ki(e,r,!1);for(let s of i)E.add(s);return Vi(n,i,o||null),je(e,n,i),r},t.removeChild=function(r){if(t[M])return Xe.call(this,r);let o=n.authored.indexOf(r);if(o===-1)return Xe.call(this,r);if(!zi(e,r))throw new DOMException("removeChild: the node is not an assigned child of this host","NotFoundError");return n.authored.splice(o,1),je(e,n,[r]),r},t.replaceChild=function(r,o){if(t[M])return eo.call(this,r,o);if(n.authored.indexOf(o)===-1)return eo.call(this,r,o);if(!vt(r))throw new TypeError("Failed to execute replaceChild on the host: parameter 1 is not of type Node.");if(Zt(e,r.nodeType===11?Array.from(r.childNodes):[r]),!zi(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 s=Ki(e,r,!1);for(let c of s)E.add(c);for(let c of s){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,...s),je(e,n,[...s,o]),o},t.append=function(...r){if(t[M])return $i.apply(this,r);let o=Gi(e,r);for(let i of o)E.add(i);Vi(n,o,null),je(e,n,o)},t.prepend=function(...r){if(t[M])return Fi.apply(this,r);let o=Gi(e,r);for(let i of o)E.add(i);for(let i of o){let s=n.authored.indexOf(i);s!==-1&&n.authored.splice(s,1)}n.authored.unshift(...o),je(e,n,o)},t.replaceChildren=function(...r){if(t[M])return Hi.apply(this,r);let o=Gi(e,r);for(let s of o)E.add(s);let i=n.authored;n.authored=o.slice(),je(e,n,[...i,...o])},Object.defineProperty(t,"innerHTML",{configurable:!0,get(){return qn.get.call(this)},set(r){if(t[M]){qn.set.call(this,r);return}let o=e.ownerDocument.createElement("div");qn.set.call(o,r===null?"":`${r}`);let i=Array.from(o.childNodes);for(let a of i)E.add(a);let s=n.authored;n.authored=i,je(e,n,[...s,...i])}}),Object.defineProperty(t,"textContent",{configurable:!0,get(){return to.get.call(this)},set(r){if(t[M]){to.set.call(this,r);return}let o=r==null||r===""?[]:[e.ownerDocument.createTextNode(`${r}`)];for(let s of o)E.add(s);let i=n.authored;n.authored=o,je(e,n,[...i,...o])}})}var xc,Bn=_(()=>{St();_t();Kn();ro();wt();Ge();xc=new Set});function Ze(e,t,n){let r=D(e),o=W(t),i=Array.isArray(n)?n.filter(Boolean):n?[n]:[],s=r.authored.findIndex(c=>Ye(r,c)===o),a=r.authored.filter(c=>Ye(r,c)===o);r.authored=r.authored.filter(c=>Ye(r,c)!==o),(s===-1||s>r.authored.length)&&(s=r.authored.length);for(let c of i)c.nodeType===1&&!Un(r,c)&&(o==null?c.removeAttribute("slot"):c.setAttribute("slot",o)),E.add(c);if(r.authored.splice(s,0,...i),r.applying&&r.pendingRecordNodes){for(let c of a)r.pendingRecordNodes.add(c);for(let c of i)r.pendingRecordNodes.add(c)}else r.pendingRecordNodes=new Set([...a,...i]);if(r.adoptedKey){for(let c of a)r.adoptedKey.delete(c);for(let c of i)r.adoptedKey.delete(c)}ve(r),Q(e)}function Q(e){if(!oe)return;let t=e[v];if(t){if(t.applying){t.reapply=!0;return}t.applying=!0;try{do{t.reapply=!1;let n=t.pendingRecordNodes||xc;t.pendingRecordNodes=void 0,hd(e,t,n),md(e,t),ve(t);let r=[],o=new Set;for(let u of e.querySelectorAll(`slot[${x}]`))if(Y(e,u)&&!Xt(t,e,u)){if(!u.hasAttribute(O)&&!(Se in u)){o.add(W(u.getAttribute("name")));continue}r.push(u)}let i=new Map;for(let u of r){let f=W(u.getAttribute("name")),d=i.get(f);d||(d=[],i.set(f,d)),d.push(u)}let s=[];for(let[u,f]of i){let d=t.assignedByName.get(u)||[];for(let p=0;p<f.length;p++){let h=f[p],b=d.filter(g=>{let w=Un(t,g);return w?w===h:p===0}),m=b.filter(g=>g===e||g.nodeType===1&&g.contains(e));if(m.length){for(let g of m)E.delete(g);b=b.filter(g=>m.indexOf(g)===-1)}b.length>0?Xi(t,h,b)&&s.push(h):Zi(t,h)&&s.push(h)}}for(let u of s)Qi(t,u);let a=new Set(i.keys());for(let u of o)a.add(u);let c=new Set;for(let u of t.authored)a.has(Ye(t,u))||c.add(u);let l=e[Ae];if(l)for(let u of Array.from(l.childNodes))c.has(u)||Xe.call(l,u);if(c.size){let u=vc(e);for(let f of c)f.parentNode!==u&&(E.delete(f),At(e,()=>xe.call(u,f)))}if(t.backstop){let u=t.backstop.takeRecords();u.length&&Wn(e,t,u)}}while(t.reapply)}finally{t.applying=!1}}}function hd(e,t,n){for(let r of e.querySelectorAll(`slot[${x}][${O}="${H}"]`)){if(!Y(e,r)||Xt(t,e,r))continue;let o=r,i=t.lastSnapshot.get(o);if(!i)continue;let s=Array.from(o.childNodes);if(io(s,i))continue;let a=t.authored,c=W(o.getAttribute("name")),l=s.filter(h=>!n.has(h));for(let h of l)a.indexOf(h)===-1&&Ye(t,h)!==c&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(h,c));for(let h of a){if(l.indexOf(h)!==-1||Ye(t,h)!==c)continue;let b=a.indexOf(h),m=0;for(let g=0;g<l.length;g++){let w=a.indexOf(l[g]);w!==-1&&w<b&&(m=g+1)}l.splice(m,0,h)}let u=new Set(l);for(let h of i)u.add(h);let f=-1,d=0;for(let h of a){if(u.has(h)){f===-1&&(f=d);continue}d+=1}let p=a.filter(h=>!u.has(h));(f===-1||f>p.length)&&(f=p.length),p.splice(f,0,...l),t.authored=p}}function md(e,t){let n=e[Ae];t.authored=t.authored.filter(r=>{if(E.has(r))return!0;let o=r.parentNode;return o==null?!1:!!(o===e||o===n||o.nodeType===1&&o.tagName==="SLOT"&&o.hasAttribute(x)&&(t.lastSnapshot.has(o)||e.contains(o)&&Y(e,o)))})}var Kn=_(()=>{St();Bn();_t();ro();wt();Ge()});function kc(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}function Cc(){if(Ec||(oe=kc(),!oe))return;Vn=HTMLSlotElement.prototype.assignedNodes,es=HTMLSlotElement.prototype.assignedElements,so=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(n){return this.hasAttribute(x)&&!ns(this)?rs(this,n):Vn?Vn.call(this,n):[]},HTMLSlotElement.prototype.assignedElements=function(n){return this.hasAttribute(x)&&!ns(this)?rs(this,n).filter(r=>r.nodeType===1):es?es.call(this,n):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let n=so&&so.get?so.get.call(this):null;return n||Tc(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||Tc(this)}}),ts=HTMLSlotElement.prototype.assign,HTMLSlotElement.prototype.assign=function(...n){if(this.hasAttribute(x)&&!ns(this)){let r=bd(this);if(r){let o=D(r);o.manualAssign||(o.manualAssign=new Map);let i=n.filter(Boolean);for(let[s,a]of o.manualAssign){if(s===this)continue;let c=a.filter(l=>{let u=l.deref();return u!==void 0&&i.indexOf(u)===-1});c.length!==a.length&&(c.length?o.manualAssign.set(s,c):o.manualAssign.delete(s))}if(i.length?o.manualAssign.set(this,i.map(s=>new WeakRef(s))):o.manualAssign.delete(this),o.applying&&o.pendingRecordNodes)for(let s of i)o.pendingRecordNodes.add(s);else o.pendingRecordNodes=new Set(i);ve(o),Q(r)}return}return ts?ts.apply(this,n):void 0},Ec=!0}function Un(e,t){let n=e.manualAssign;if(!n||!n.size)return null;for(let[r,o]of n){let i=!1,s=o.filter(a=>{let c=a.deref();return c===void 0?!1:(c===t&&(i=!0),!0)});if(s.length!==o.length&&(s.length?n.set(r,s):n.delete(r)),i){let a=e.host;return a&&(r===a||a.contains(r))?r:null}}return null}function bd(e){for(let t=e.parentElement;t;t=t.parentElement)if(t[v])return Y(t,e)?t:null;return null}function ns(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 rs(e,t){if(e.getAttribute(O)!==H)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:os(n,new Set,0)}function os(e,t,n){if(n>=wc)return e.slice();let r=[];for(let o of e)if(o.nodeType===1&&o.tagName==="SLOT"){let i=o;if(t.has(i))continue;if(t.add(i),i.hasAttribute(x)){let s=rs(i,{flatten:!1});if(s.length>0)for(let a of os(s,t,n+1))r.push(a);else for(let a of os(Array.from(i.childNodes),t,n+1))r.push(a)}else if(Vn){let s=Vn.call(i,{flatten:!0});for(let a of s)r.push(a)}else r.push(o)}else r.push(o);return r}function Tc(e){let t=e.parentElement;return t&&t.tagName==="SLOT"&&t.hasAttribute(x)&&t.getAttribute(O)===H?t:null}var oe,Vn,es,so,ts,Ec,_t=_(()=>{St();Kn();wt();Ge();oe=kc(),Vn=null,es=null,so=null,ts=null,Ec=!1;Cc()});function is(e){if(!oe)return!1;for(let t of e.querySelectorAll(`slot[${x}][${O}]`))if(Y(e,t))return!0;return!1}function Y(e,t){let n=t[gt];if(n)return n===e;let r=typeof t.getAttribute=="function"?t.getAttribute(Hn):null;if(r){let o=yd(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 yd(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 Xi(e,t,n){for(let l of n)E.delete(l);let r=t.getAttribute(O)!==H,o=e.lastSnapshot.get(t)||[],i=r||!io(o,n);if(!r&&io(Array.from(t.childNodes),n))return e.lastSnapshot.set(t,n.slice()),i;let s=t[Se];if(r&&s)for(;t.firstChild;)s.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(O,H),e.lastSnapshot.set(t,n.slice()),i}function Zi(e,t){let n=t.getAttribute(O)===H;if(t.setAttribute(O,ji),!n)return Nc(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return Nc(t),!0}function Nc(e){let t=e[Se];!t||t.childNodes.length===0||e.appendChild(t)}function ss(e,t){if(!Je(e))return;let n=D(e),r=W(t.getAttribute("name")),o=n.assignedByName.get(r);if(o)for(let i of o)i.parentNode===t&&(E.add(i),t.removeChild(i));n.lastSnapshot.delete(t)}function Rc(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function Qi(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)Rc(r)}))}function io(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 St=_(()=>{_t();wt();Ge()});var Qe=_(()=>{St();Bn();_t();Kn();ro();wt();Ge()});var ql={};Ia(ql,{observeLazy:()=>Jp,observeViewportOnce:()=>Zp});function Ul(e){let t=Hs.get(e);return t||(t=import(e).finally(()=>Hs.delete(e)),Hs.set(e,t),t)}function Jp(e){for(let[t,n]of Object.entries(e))ot.set(t.toLowerCase(),n);if(typeof IntersectionObserver>"u"){for(let t of ot.values())Ul(t);ot.clear();return}cr||(cr=new IntersectionObserver(Yp,{rootMargin:"200px"})),Bl(),!Fs&&typeof MutationObserver<"u"&&(Fs=new MutationObserver(()=>Bl()),Fs.observe(document.body,{childList:!0,subtree:!0}))}function Bl(){if(!(!cr||!ot.size))for(let e of ot.keys()){if(customElements.get(e)){ot.delete(e);continue}for(let t of document.querySelectorAll(e))cr.observe(t)}}function Yp(e){for(let t of e){if(!t.isIntersecting)continue;let n=t.target.tagName.toLowerCase(),r=ot.get(n);r&&(Ul(r),ot.delete(n),cr?.unobserve(t.target))}}function Xp(e){for(let t of e){if(!t.isIntersecting)continue;let n=xo.get(t.target);xo.delete(t.target),ar?.unobserve(t.target),n&&n()}}function Zp(e,t){return typeof IntersectionObserver>"u"?(t(),()=>{}):(ar||(ar=new IntersectionObserver(Xp,{rootMargin:"200px"})),xo.set(e,t),ar.observe(e),()=>{xo.delete(e),ar?.unobserve(e)})}var ot,cr,Fs,Hs,ar,xo,Wl=_(()=>{ot=new Map,cr=null,Fs=null,Hs=new Map;ar=null,xo=new WeakMap});var Bs,Us=_(()=>{Bs=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(()=>(Wl(),ql)).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(()=>(Eo(),Kl)).then(({loadFrame:n})=>{this._webjsLoadedSrc!==t||!this.isConnected||n(this,t)})}}:null;typeof customElements<"u"&&Bs&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",Bs)});function eh(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 Ws(e,t){let n=t||(typeof document<"u"?document:null);if(!n)return;let r=null;if(typeof e=="string"){let i=n.createElement("template");i.innerHTML=e,r=i.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 i of o)n.body.append(i);else n.body.append(r)}var Qp,qs,lr=_(()=>{Qp=new Set(["append","prepend","before","after","replace","update"]);qs=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 s=n.getElementById(o);s&&(r=[s])}else{let s=this.getAttribute("targets");if(s)try{r=Array.from(n.querySelectorAll(s))}catch{r=[]}}let i=Qp.has(t)?this.querySelector("template"):null;try{for(let s of r){let a=i?i.content.cloneNode(!0):null;eh(t,s,a)}}finally{this.remove()}}}:null;typeof customElements<"u"&&qs&&!customElements.get("webjs-stream")&&customElements.define("webjs-stream",qs)});var Vl,zl=_(()=>{Vl=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this.style.display||(this.style.display="contents")}}:null;typeof customElements<"u"&&Vl&&!customElements.get("webjs-suspense")&&customElements.define("webjs-suspense",Vl)});function To(e,t){let n=typeof document<"u"?document:null,r=e||n;if(!r||typeof r.querySelectorAll!="function")return;if(t&&t.frame===!0){Ks(r,!0);return}Yl();let o=r===n,i=!!n&&!o&&typeof n.contains=="function"&&n.contains(r),s=!!n&&!o&&!i;s&&(Ks(n,!0),it.clear(),zs.clear()),(o||s)&&(Vs=!0);let a=V.ingested+V.replaced;rh(Ks(r),a)}function Ks(e,t){let n=null;for(let r of e.querySelectorAll('script[type="application/json"]#__webjs-seeds, script[type="application/json"][data-webjs-seeds]')){let o=nh(r.getAttribute?.("data-webjs-dev"));o!==null&&(n=o),Gl(t?null:r.textContent,r)}for(let r of e.querySelectorAll("[data-webjs-seed]"))Gl(t?null:r.getAttribute("data-webjs-seed"),r,()=>r.removeAttribute("data-webjs-seed"));return n}function Gl(e,t,n){if(e)try{let r=Le(e);if(r&&typeof r=="object")for(let o in r){it.has(o)?V.replaced++:V.ingested++,it.set(o,r[o]);let i=o.indexOf("/",o.indexOf("/")+1);i>0&&zs.add(o.slice(0,i))}}catch{}n?n():t.remove?.()}function nh(e){return typeof e!="string"?null:e||"ok"}function rh(e,t){if(e===null)return;let n=++th;un={epoch:n,hits:V.hits,misses:V.misses,keyMisses:V.keyMisses,merged:t,marker:e};let r=()=>{!un||un.epoch!==n||Yl()};try{typeof requestIdleCallback=="function"?requestIdleCallback(r,{timeout:1e3}):setTimeout(r,250)}catch{un=null}}function Yl(){let e=un;if(un=null,!!e)try{oh(e)}catch{}}function oh(e){let t=V.hits-e.hits,n=V.misses-e.misses,r=V.ingested+V.replaced-e.merged,o=V.keyMisses-e.keyMisses;if(n===0)return;let i=e.marker==="streamed"?"This page streams (a Suspense or <webjs-suspense> boundary), and a streamed render emits no seeds, so every action call on it goes to the network.":e.marker==="drop"?"The page's seeds could not be serialized, so the whole block was dropped. Something an action returned is not serializer-safe; the server response reports collected above emitted.":o===0?null:"The key is the action file hash plus the function name plus the serialized arguments, so an argument the SSR render never used misses (a deliberate refetch after hydration misses too, and is expected). A miss on an action this page never seeded is NOT counted here, because a mutation or a client-only read could never have been seeded.";if(i===null)return;let a=e.marker==="streamed"||e.marker==="drop"?`${n} of ${t+n} action call(s) in the hydration window went to the network`:`${o} action call(s) in the hydration window asked for a key this page seeded under DIFFERENT arguments`;console.warn(`[webjs] SSR action seeding: ${a} (${r} seed(s) on this page, ${it.size} still unconsumed). ${i} See https://webjs.dev/docs/data-fetching for the seeding reference.`)}function ih(e,t,n){Vs||(Vs=!0,To());let r=`${e}/${t}/${n}`;if(it.has(r)){let o=it.get(r);return it.delete(r),V.hits++,o}return V.misses++,zs.has(`${e}/${t}`)&&V.keyMisses++,Jl}function sh(){return{...V,pending:it.size}}var it,Jl,Vs,V,zs,un,th,ko=_(()=>{zt();it=new Map,Jl=Symbol("webjs.seed.miss"),Vs=!1,V={ingested:0,replaced:0,hits:0,misses:0,keyMisses:0},zs=new Set,un=null,th=0});function Gs(e){if(!(!Array.isArray(e)||!e.length)){Co+=1;for(let t of e)t&&Xl.set(t,Co)}}function ch(){return Co}function lh(e,t,n){if(!(!Array.isArray(t)||!t.length)&&(fn.delete(e),fn.set(e,{tags:t.slice(),since:typeof n=="number"?n:Co}),fn.size>ah)){let r=fn.keys().next().value;r!==void 0&&fn.delete(r)}}function uh(e){let t=fn.get(e);if(!t)return!1;for(let n of t.tags)if((Xl.get(n)||0)>t.since)return!0;return!1}function Js(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}var Co,Xl,fn,ah,No=_(()=>{Co=0,Xl=new Map,fn=new Map,ah=1e3});function Zl(e){return dn.test(e)}function Oo(e){let t=Zs(e);return t.includes("stylesheet")&&!t.includes("alternate")}function Zs(e){return(e.getAttribute("rel")||"").toLowerCase().split(/\s+/)}var Ys,Xs,dn,ur,Ot,Me,Ro,Ql,he,B=_(()=>{Ys="text/vnd.webjs-stream.html",Xs=["wheel","touchmove","keydown","pointerdown"],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,ur="_top",Ot="webjs:nav-fallback",Me=new Set(["value","checked","selected","indeterminate","disabled","open","popover"]),Ro="name=csp-nonce";Ql=250,he="data-webjs-preload-style"});function st(e,t,n="warn"){if(Qs.has(e)||(Qs.add(e),typeof console>"u"))return;let r=n==="error"?console.error:console.warn;r&&r.call(console,t)}function tu(e,t,n,r){if(typeof process<"u"&&process.env||!r.has(z))return;let o="";try{o=new URL(e.getAttribute("action")||location.href,location.href).pathname}catch{o=location.pathname}if(n!=="post"){st(`submit-nowhere:${o}:${n}`,`[webjs] this submission carries a bound server action's identity but submits as ${n.toUpperCase()}, which sends no body, so the identity rides the query string and the action never runs. A submitter's own formmethod overrides the form's, and WebJs honours it rather than refusing it, so check for a formmethod on the button that was pressed.`,"error");return}let i=t&&t.getAttribute("formenctype")||e.getAttribute("enctype")||"application/x-www-form-urlencoded";if(i.toLowerCase()==="text/plain"){st(`submit-nowhere:${o}:${i}`,`[webjs] this submission carries a bound server action's identity but declares enctype="${i}", which the server cannot parse. The router declines to send it so both paths behave the same way, and both are answered with a 405. Drop the enctype and let the binding supply it.`,"error");return}o&&o!==location.pathname&&st(`submit-elsewhere:${o}`,`[webjs] this submission carries a bound server action's identity but posts to "${o}" rather than this page, because the enclosing <form> declares its own action. A bound submitter emits no formaction, so the form's target wins, which is what native HTML does. The action runs only if "${o}" is a page route; against a route.ts or another origin the identity is ignored and nothing runs. Drop the form's action attribute to keep the submission on this page.`)}function ta(e,t){return!e&&!t&&typeof document<"u"&&document.readyState==="loading"}function Lo(e,t,n,r){if(e!=="navigate"||!t||r&&r===n)return!1;try{return new URL(t).origin===new URL(n).origin}catch{return!1}}function nu(){if(typeof location>"u"||eu)return;eu=!0;let e=null;try{e=sessionStorage.getItem(Ot),sessionStorage.removeItem(Ot)}catch{}let t="";try{let n=performance.getEntriesByType("navigation")[0];t=n?n.type:""}catch{}Lo(t,document.referrer,location.href,e)&&me("pre-boot-navigation",location.href,!1)}function me(e,t,n=!0){if(n)try{sessionStorage.setItem(Ot,t)}catch{}if(typeof document<"u"&&typeof CustomEvent<"u")try{document.dispatchEvent(new CustomEvent("webjs:navigation-fallback",{detail:{cause:e,href:t,willReload:n}}))}catch{}typeof process<"u"&&process.env||st(`fallback:${e}`,n?`[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.`:`[webjs] client router degraded a soft navigation (${e}) for ${t}, without a full page load.`)}function ru(e){typeof process<"u"&&process.env||st(`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 ou(){if(typeof process<"u"&&process.env||ea||typeof document>"u"||typeof getComputedStyle!="function")return;let e=document.documentElement;if(!e)return;ea=!0;let t;try{t=getComputedStyle(e).scrollBehavior}catch{return}t==="smooth"&&st("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 fr(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 iu(){Qs.clear(),ea=!1}function su(e,t){return ta(e,t)}var Qs,eu,ea,be=_(()=>{ze();B();Qs=new Set;eu=!1;ea=!1});function ye(e){let t=new Map,n=[],r=!1;function o(i){if(!r){if(i.nodeType===8){let s=i.data.trim();if(s.startsWith("wj:children:")){let a=s.slice(12),c=a.lastIndexOf(":");if(c<=0||c===a.length-1){r=!0;return}let l=a.slice(0,c),u=a.slice(c+1);if(t.has(l)||n.some(f=>f.segment===l)){r=!0;return}n.push({segment:l,routeKey:u,start:i});return}if(s.startsWith("/wj:children")){let a=s.slice(12).replace(/^:/,""),c=n.pop();if(!c||c.segment!==a){r=!0;return}if(c.start.parentNode!==i.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:i});return}return}if(i.hasChildNodes&&i.hasChildNodes())for(let s=i.firstChild;s&&!r;s=s.nextSibling)o(s)}}return o(e),r||n.length>0?null:t}function pn(e,t){return e===t||e.startsWith(t==="/"?"/":t+"/")}function dr(e,t){let n=[...e.keys()].filter(s=>t.has(s)).sort((s,a)=>s.length-a.length);if(n.length===0)return null;for(let s of n)if(e.get(s).routeKey!==t.get(s).routeKey){let a=null;for(let c of n){if(c===s)break;s!==c&&pn(s,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=s=>{let a=null;for(let c of s.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 Te(){let e=ye(document.body);return e?[...e.entries()].map(([t,n])=>`${t}:${n.routeKey}`).join(","):""}var De=_(()=>{});function au(e){ke=e||(t=>{location.href=t})}function cu(){return T}function lu(){return++T}function jo(){return++T}function na(e){ee=e}function uu(e){pr=e}function fu(e){let t=pr!==null&&pr===e;return pr=null,t}function Po(){pr=null}var T,ke,ee,pr,$e=_(()=>{T=0,ke=e=>{location.href=e};ee=!1;pr=null});function Lt(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"&&fh()?Document.parseHTMLUnsafe(e):dh(e)}function fh(){if(hn!==null)return hn;try{hn=Document.parseHTMLUnsafe("<!doctype html><body><!--c--><i></i>")?.body?.firstChild?.nodeType===8}catch{hn=!1}return hn}function ra(){hn=null}function dh(e){return typeof DOMParser>"u"?null:new DOMParser().parseFromString(e,"text/html")}var hn,hr=_(()=>{hn=null});function Io(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function oa(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=typeof ShadowRoot<"u"&&r instanceof ShadowRoot?r.host:null}return null}var Mo=_(()=>{});function mr(e,t){return((t&&t.hasAttribute("formmethod")?t.getAttribute("formmethod")||"":e.getAttribute("method")||"")||"get").toLowerCase()}function br(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function ph(e){let t=String(e||"").toLowerCase();return t==="multipart/form-data"?"multipart/form-data":t==="text/plain"?"text/plain":"application/x-www-form-urlencoded"}function yr(e,t){return ph(t&&t.hasAttribute("formenctype")?t.getAttribute("formenctype"):e.getAttribute("enctype"))}function gr(e,t){if(t==="multipart/form-data")return e;let n=new URLSearchParams;for(let[r,o]of e)n.append(r,typeof o=="string"?o:o.name);return n}function wr(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}}var Do=_(()=>{});function Fe(e){return e.tagName==="LINK"&&!!e.getAttribute("href")&&Oo(e)}function mh(e){return((e.hasAttribute(te)?e.getAttribute(te):e.getAttribute("media"))||"").trim()}function $o(e,t){let n=e.getAttribute("href");if(!n)return null;try{let r=new URL(n,t);r.searchParams.delete(hh);let o=mh(e);return o&&o!=="all"?`${r.href} ${o}`:r.href}catch{return null}}function Fo(){if(!(typeof document>"u"||!document.head))for(let e of document.querySelectorAll("link[href]")){if(_r.has(e)||!Fe(e))continue;let t=$o(e,document.baseURI);t&&_r.set(e,t)}}function du(e){let t=_r.get(e);return t||(t=$o(e,document.baseURI)||"",t&&_r.set(e,t)),t||null}function aa(e){e.hasAttribute(te)||(e.setAttribute(te,e.getAttribute("media")||""),e.setAttribute("media","not all"))}function sa(e){if(!e.hasAttribute(te))return;let t=e.getAttribute(te);e.removeAttribute(te),t?e.setAttribute("media",t):e.removeAttribute("media")}function pu(e,t){if(t?e.setAttribute(at,""):e.removeAttribute(at),!t){sa(e),e.sheet&&(e.sheet.disabled=!1);return}if(e.sheet){e.sheet.disabled=!0;return}if(aa(e),ia.has(e))return;ia.add(e);let n=()=>{e.removeEventListener("load",n),e.removeEventListener("error",n),ia.delete(e),e.hasAttribute(at)&&(sa(e),e.sheet&&(e.sheet.disabled=!0))};e.addEventListener("load",n),e.addEventListener("error",n)}function ca(e,t){let n=null,r=null;for(let o of document.head.querySelectorAll(`link[${Ce}]`))o===e||!Fe(o)||(r||(r=o),pn(t,o.getAttribute(Ce))&&(n=o));n?n.after(e):r?r.before(e):document.head.appendChild(e)}function Ho(e={}){let t=e.base||(typeof document<"u"?document.baseURI:""),n=new Map,r=new Map;for(let o of document.querySelectorAll("link[href]")){if(!Fe(o))continue;let i=o.parentNode===document.head;if(!i&&e.leaving&&e.leaving(o))continue;let s=du(o);if(!s)continue;let a=o.hasAttribute(he)?i?r:null:n;a&&!a.has(s)&&a.set(s,o)}return(o,i)=>{if(o.hasAttribute(at)||o.hasAttribute(he))return!0;let s=$o(o,t);if(!s)return!1;let a=o.getAttribute(Ce),c=n.get(s);if(c){if(e.frame)return!0;let f=c.hasAttribute(at);f&&pu(c,!1);let d=c.getAttribute(Ce);return a&&d!==null&&d!==a&&(!f&&!(e.segment!=null&&pn(d,e.segment))&&pn(a,d)||c.setAttribute(Ce,a)),!0}let l=e.frame?null:r.get(s);if(l){for(let f of o.attributes)f.name==="href"||f.name==="nonce"||(f.name==="media"&&l.hasAttribute(te)?l.setAttribute(te,f.value):l.setAttribute(f.name,f.value));return l.removeAttribute(he),r.delete(s),n.set(s,l),!0}if(!a)return!1;if(e.frame)return!0;let u=i(o);try{u.setAttribute("href",new URL(o.getAttribute("href"),t).href)}catch{}return ca(u,a),_r.set(u,s),n.set(s,u),!0}}function Bo(){if(!(typeof document>"u"||!document.head))for(let e of document.head.querySelectorAll(`link[${te}]`))e.hasAttribute(at)||sa(e)}function la(e,t,n){if(typeof document>"u"||!document.head)return;let r=n||document.baseURI,o=new Set;if(t)for(let i of t.querySelectorAll("link[href]")){if(!Fe(i)||i.hasAttribute(at)||i.hasAttribute(he))continue;let s=$o(i,r);s&&o.add(s)}for(let i of document.head.querySelectorAll(`link[${Ce}]`)){if(i.hasAttribute(he)||i.hasAttribute(at)||i.hasAttribute("disabled")||!Fe(i))continue;let s=i.getAttribute(Ce);if(!pn(s,e))continue;let a=du(i);a&&o.has(a)||pu(i,!0)}}var Ce,at,te,hh,_r,ia,Sr=_(()=>{De();B();Ce="data-wj-style-owner",at="data-wj-style-off",te="data-wj-style-media",hh="__webjs_dev";_r=new WeakMap;ia=new WeakSet});function qo(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function Ar(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=qo();return n&&t.setAttribute("nonce",n),t.textContent=e.textContent,t}function jt(e){if(!e.hasAttribute("nonce"))return e.cloneNode(!0);let t=e.cloneNode(!0),n=qo();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function se(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function Uo(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 bh(e){if(!e.querySelector("meta"))return;let t=o=>{let i=new Map;for(let s of o.querySelectorAll("meta")){let a=Uo(s);if(!a||a===Ro)continue;let c=i.get(a);c?c.push(s):i.set(a,[s])}return i},n=t(e),r=t(document.head);for(let[o,i]of n){let s=r.get(o)||[],a=i.map(se).join(`
|
|
2
|
+
`),c=s.map(se).join(`
|
|
3
|
+
`);if(a!==c){if(i.length===1&&s.length===1){let l=s[0];for(let u of[...l.attributes])l.removeAttribute(u.name);for(let u of i[0].attributes)l.setAttribute(u.name,u.value);continue}for(let l of s)l.remove();for(let l of i)document.head.appendChild(jt(l))}}for(let[o,i]of r)if(!n.has(o))for(let s of i)s.remove()}function mn(e,t={}){let n=t.styles===!1?null:Ho(t),r=e.querySelector("title");r&&(document.title=r.textContent||"");let o=new Set;for(let i of document.head.children)o.add(se(i));for(let i of e.children)i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&i.tagName!=="TITLE"&&(i.tagName==="META"&&Uo(i)||Fe(i)&&(!n||n(i,jt))||o.has(se(i))||(i.tagName==="SCRIPT"?document.head.appendChild(Ar(i)):document.head.appendChild(jt(i))));bh(e)}function ua(e,t={}){let n=Ho(t),r=new Set;for(let o of document.head.children)r.add(se(o));for(let o of e.children)!Fe(o)||n(o,jt)||r.has(se(o))||document.head.appendChild(jt(o))}function yh(e){return e.tagName==="STYLE"?!0:e.tagName==="LINK"&&Zs(e).includes("stylesheet")}function vr(e,t={}){let n=t.styles===!1?null:Ho(t),r=document.head,o=e.querySelector("title");o&&(document.title=o.textContent||"");let i=new Set;for(let a of r.children)a.tagName==="SCRIPT"&&a.getAttribute("type")==="importmap"||a.tagName!=="BASE"&&i.add(se(a));let s=new Set;for(let a of e.children)a.tagName==="SCRIPT"&&a.getAttribute("type")==="importmap"||a.tagName!=="BASE"&&s.add(se(a));for(let a of[...r.children])a.tagName==="SCRIPT"&&a.getAttribute("type")==="importmap"||a.tagName!=="BASE"&&a.tagName!=="TITLE"&&(yh(a)||a.tagName==="META"&&Uo(a)===Ro||s.has(se(a))||a.remove());for(let a of e.children)a.tagName==="SCRIPT"&&a.getAttribute("type")==="importmap"||a.tagName!=="BASE"&&a.tagName!=="TITLE"&&(a.tagName==="META"&&Uo(a)===Ro||Fe(a)&&(!n||n(a,jt))||i.has(se(a))||(a.tagName==="SCRIPT"?r.appendChild(Ar(a)):r.appendChild(jt(a))))}var bn=_(()=>{B();Sr()});function Vo(e){let t=e;for(;t;){let n=t.closest("webjs-frame");if(n&&n.id)return n.id;let r=t.getRootNode();if(typeof ShadowRoot<"u"&&r instanceof ShadowRoot)t=r.host;else break}return null}function ge(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===ur)return null;let r=typeof document<"u"?document.getElementById(n):null;return r&&r.tagName&&r.tagName.toLowerCase()==="webjs-frame"?n:(st(`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 Vo(e)}function fa(e){if(!e||typeof document>"u")return null;let t=null;try{t=document.querySelector(`webjs-frame#${CSS.escape(e)}`)}catch{t=document.getElementById(e)}return!t||!t.tagName||t.tagName.toLowerCase()!=="webjs-frame"?null:t}function xr(e,t){let n=fa(e);if(!n)return null;let r=Wo.has(n);return Wo.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 Er(e,t){if(Wo.get(e)!==t)return;Wo.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 Tr(e,t,n){let r=Ko.has(e);return Ko.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 kr(e,t,n,r){if(Ko.get(e)!==t)return;Ko.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 da(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+=se(r);return n}var Wo,Ko,ct=_(()=>{B();be();bn();Wo=new WeakMap;Ko=new WeakMap});function bu(e,t){if(typeof document>"u"||!document.documentElement)return()=>{};ae&&ae();let n=document.documentElement,r=n.style.getPropertyValue("overflow-anchor");n.style.setProperty("overflow-anchor","none");let o=null,i=typeof t=="number",a=i&&typeof setTimeout=="function"?setTimeout(()=>{i=!1},Ql):null,c=typeof t=="number"&&typeof window<"u"?()=>{i&&(Math.abs(window.scrollY-t)<=1&&Math.abs(window.scrollX-(e||0))<=1||window.scrollTo({left:e||0,top:t,behavior:"instant"}))}:null,l=()=>{if(ae===l){if(ae=null,o&&(clearTimeout(o),o=null),a&&clearTimeout(a),i=!1,typeof window<"u"){for(let u of Xs)window.removeEventListener(u,l,{capture:!0});c&&window.removeEventListener("scroll",c)}r?n.style.setProperty("overflow-anchor",r):n.style.removeProperty("overflow-anchor")}};if(ae=l,o=setTimeout(l,2e3),typeof window<"u"){for(let u of Xs)window.addEventListener(u,l,{capture:!0,passive:!0});c&&window.addEventListener("scroll",c,{passive:!0})}return l}function yu(e){if(typeof document>"u"||!document.documentElement)return()=>{};if(ce&&ce(),!(e>0))return()=>{};let t=document.documentElement,n=t.style.getPropertyValue("min-height");t.style.setProperty("min-height",e+"px");let r=null,o=()=>{ce===o&&(ce=null,r&&(clearTimeout(r),r=null),n?t.style.setProperty("min-height",n):t.style.removeProperty("min-height"))};return ce=o,r=setTimeout(o,2e3),o}function Go(e){if(typeof requestAnimationFrame!="function"){setTimeout(e,0);return}requestAnimationFrame(()=>requestAnimationFrame(e))}function Jo(){zo+=1}function Cr(e,t){let n=hu(e)||hu(t);return n?(n.getAttribute("data-preserve-scroll")||"").toLowerCase().trim()!=="false":!1}function hu(e){return!e||typeof e.closest!="function"?null:e.closest("[data-preserve-scroll]")}var ae,ce,zo,Yo=_(()=>{B();ae=null;ce=null;zo=0});function pa(e){if(!ee||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=Io(e);if(!t||t.hasAttribute("download")||t.target&&t.target!=="_self")return;let n=t.href;if(!n)return;let r=new URL(n);if(r.origin!==location.origin)return;if(r.pathname===location.pathname&&r.search===location.search&&r.href.includes("#")){uu(r.href);return}if(t.hasAttribute("data-no-router")||dn.test(r.pathname))return;e.preventDefault();let o=ge(t);Nr(n,!1,o,{preserveScroll:Cr(t)})}function yn(e){gu(location.href)||Nr(location.href,!0,null)}function gn(e){if(!ee||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.hasAttribute("formtarget")?n.getAttribute("formtarget")||"":t.getAttribute("target")||"";if(r&&r!=="_self")return;let o=mr(t,n);if(o==="dialog")return;let i=yr(t,n),s=o==="get"||o==="head",a=br(t,n),c;try{c=new URL(a,location.href)}catch{return}if(c.origin!==location.origin||dn.test(c.pathname))return;let l=wr(t,n);if(tu(t,n,o,l),!s&&i==="text/plain")return;let u=gr(l,i);e.preventDefault();let f=ge(n||t),d=Cr(n||t,t);wu(c.href,o,u,f,t,{preserveScroll:d})}var Xo=_(()=>{Mo();B();$e();be();Do();ct();Yo();Pt()});function ha(e){let t=Ne(e);document.dispatchEvent(new CustomEvent("webjs:before-cache",{detail:{url:e}})),j.has(t)&&j.delete(t);let n={html:document.documentElement.outerHTML,scrollX:typeof window<"u"&&window.scrollX||0,scrollY:typeof window<"u"&&window.scrollY||0,scrollHeight:typeof document<"u"&&document.documentElement&&document.documentElement.scrollHeight||0};for(j.set(t,n);j.size>16;){let r=j.keys().next().value;j.delete(r)}}function _u(e){let t=Ne(e),n=j.get(t);return n==null?null:(j.delete(t),j.set(t,n),n)}function Ne(e,t){let n=new URL(e,location.href),r=n.pathname+n.search;return t?`${t} ${r}`:r}var j,wn=_(()=>{B();j=new Map});function xh(e){let t=Re.get(e);return t==null?!1:Pr()-t>=ma?(Re.delete(e),!1):!0}function En(){Re.clear()}function Eh(e){for(Re.has(e)&&Re.delete(e),Re.set(e,Pr());Re.size>vh;)Re.delete(Re.keys().next().value)}function Ir(){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 Zo(){try{if(typeof matchMedia=="function")return matchMedia("(hover: hover) and (pointer: fine)").matches}catch{}return!0}function Th(e){let t=e.getAttribute("rel");return t?t.toLowerCase().split(/\s+/).filter(Boolean):[]}function vn(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.href.includes("#")||dn.test(n.pathname)?null:t}function Qo(e){if(e.hasAttribute("data-no-prefetch"))return!0;let t=Th(e);return t.includes("external")||t.includes("no-prefetch")}function xn(e){if(Qo(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 Zo()?"intent":"viewport"}}function ut(e,t){if(!ee||typeof fetch!="function"||Ir())return;let n=Ne(e,t);if(typeof location<"u"&&n===Ne(location.href,t)||He.has(n)||Rr.has(n))return;let r=k.get(n);if(r&&Pr()-r.at<ma||xh(n))return;if(He.size>=Su){for(Rr.add(n),Sn.push({href:e,frameId:t||null});Sn.length>_h;){let s=Sn.shift();Rr.delete(Ne(s.href,s.frameId))}return}let o=Te();if(!o&&typeof document<"u"&&document.readyState==="loading")return;He.add(n);let i={"x-webjs-router":"1","x-webjs-prefetch":"1"};o&&(i["x-webjs-have"]=o),t&&(i["x-webjs-frame"]=t),fetch(e,{method:"GET",headers:i,credentials:"same-origin",cache:"no-cache"}).then(async s=>{let a=s.headers.get("content-type")||"";if(!/^text\/html\b/i.test(a)||s.status>=400)return;let c=s.headers.get("x-webjs-build"),l=s.headers.get("x-webjs-src"),u=typeof document<"u"?document.querySelector('script[type="importmap"]'):null,f=u?u.getAttribute("data-webjs-build"):null,d=u?u.getAttribute("data-webjs-src"):null;if((c&&f&&c!==f||l&&d&&l!==d)&&(j.clear(),Mt(n),En()),(s.headers.get("x-webjs-frame")||null)!==(t||null)){Eh(n);return}let h=s.redirected&&s.url?s.url:e,b=await s.text();jr.has(n)||Ch(n,{html:b,build:c,src:l,finalUrl:h,frameId:t||null,at:Pr()})}).catch(()=>{}).finally(()=>{He.delete(n),jr.delete(n),kh()})}function kh(){for(;Sn.length&&He.size<Su;){let{href:e,frameId:t}=Sn.shift();Rr.delete(Ne(e,t)),ut(e,t)}}function Ch(e,t){for(k.has(e)&&k.delete(e),k.set(e,t);k.size>wh;){let n=k.keys().next().value;k.delete(n)}typeof document<"u"&&document.dispatchEvent(new CustomEvent("webjs:prefetch",{detail:{url:t.finalUrl,key:e,from:"prefetch"}}))}function ei(e){let t=/<!--wj:children:([^>]*?)-->/.exec(e||"");return t?t[1]:null}function Mr(e,t,n){let r=Ne(e,n),o=k.get(r);if(!o)return null;if(Pr()-o.at>=ma)return k.delete(r),null;if(o.frameId)return k.delete(r),fa(o.frameId)?o:null;let i=ei(o.html);return i&&!new Set(String(t??(Te()||"")).split(",").filter(Boolean)).has(i)?(k.delete(r),null):(k.delete(r),o)}function Pr(){try{if(typeof performance<"u"&&typeof performance.now=="function")return performance.now()}catch{}return 0}function It(e){if(!ee)return;let t=oa(e.target);if(!t)return;let n=xn(t);if(n==="none"||n==="render")return;let r=vn(t);if(r){if(e.type==="touchstart"){ut(r,ge(t));return}n==="intent"&&(Or===t&&An||(Dr(),Or=t,An=setTimeout(()=>{An=null,Or=null,t.isConnected&&ut(r,ge(t))},Sh)))}}function ba(e){let t=oa(e.target);t&&t===Or&&Dr()}function Dr(){An&&(clearTimeout(An),An=null),Or=null}function ti(){for(let e of Lr)clearTimeout(e);Lr.clear(),_n=new WeakMap}function ni(){if(typeof document>"u"||Ir())return;let e=typeof IntersectionObserver<"u";e&&(lt?(lt.disconnect(),ti()):lt=new IntersectionObserver(t=>{for(let n of t){let r=n.target;if(n.isIntersecting){if(_n.has(r))continue;let o=setTimeout(()=>{Lr.delete(o),_n.delete(r),lt.unobserve(r);let i=vn(r);i&&xn(r)==="viewport"&&ut(i,ge(r))},Ah);_n.set(r,o),Lr.add(o)}else{let o=_n.get(r);o&&(clearTimeout(o),Lr.delete(o),_n.delete(r))}}},{threshold:.5}));for(let t of document.querySelectorAll("a[href]")){let n=xn(t);if(n==="render"){let r=vn(t);r&&ut(r,ge(t))}else n==="viewport"&&e&<.observe(t)}}function Mt(e){k.clear();for(let t of He)t!==e&&jr.add(t)}function Au(e,t){let n=Ne(e,t);k.delete(n),He.has(n)&&jr.add(n)}function vu(e,t){return k.get(Ne(e,t))||null}function xu(){return He.size}function Eu(){k.clear(),Re.clear(),He.clear(),jr.clear(),Sn.length=0,Rr.clear(),Dr(),ti()}function Tu(){lt&&(lt.disconnect(),lt=null)}var wh,ma,Su,_h,Sh,Ah,k,Re,vh,He,jr,Sn,Rr,An,Or,lt,_n,Lr,Dt=_(()=>{Mo();De();B();ct();$e();wn();wh=8,ma=3e4,Su=3,_h=24,Sh=100,Ah=250,k=new Map,Re=new Map,vh=16;He=new Set,jr=new Set,Sn=[],Rr=new Set,An=null,Or=null,lt=null,_n=new WeakMap,Lr=new Set});function ya(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 $r(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",i="<!--wj-stream-shell-->",s=/<\/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(i);if(l!==-1)return{shell:r.slice(0,l),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(l+i.length)};let u=r.indexOf(o);if(u!==-1)return{shell:r.slice(0,u),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(u)};if(c)return{shell:r,streaming:!1};let f=s.exec(r);if(f){let d=f.index+f[0].length;return{shell:r.slice(0,d),streaming:!0,reader:t,dec:n,rest:r.slice(d)}}}}function ri(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 i=1,s;for(;s=o.exec(e);)if(s[1]==="/"){if(i--,i===0)return{id:n,content:e.slice(r,s.index),rest:e.slice(s.index+s[0].length)}}else i++;return null}function oi(e,t){let n=document.getElementById(e);if(!n){ru(e);return}let r=document.createElement("template");r.innerHTML=t;let o=[...r.content.childNodes];for(let i of o){let s=i.nodeType===1?i.getAttribute("data-webjs-redirect"):null;if(s){Ft(s,{replace:!0});return}}n.replaceWith(r.content);for(let i of o)i.nodeType===1&&ii(i)}async function Fr(e,t,n,r){let o=n,i=()=>{let s;for(;s=ri(o);){if(!r())return!1;oi(s.id,s.content),o=s.rest}return!0};if(!e){i();return}try{for(;;){if(!i()){try{await e.cancel()}catch{}return}let{value:s,done:a}=await e.read();if(s&&(o+=t.decode(s,{stream:!0})),a){o+=t.decode(),i();return}}}catch{}}var Hr=_(()=>{be();$t();Pt()});function Cu(e){if(!(typeof document>"u"||!e))for(let[t,n]of Nh){let r=e[t],o=document[t];if(!r||!o||!r.hasAttribute(n))continue;let i=ku(r.getAttribute(n));for(let s of ku(o.getAttribute(n)))i.includes(s)||o.removeAttribute(s);for(let s of i){let a=r.getAttribute(s);a===null?o.removeAttribute(s):o.getAttribute(s)!==a&&o.setAttribute(s,a)}o.setAttribute(n,i.join(" "))}}var Nh,ku,Nu=_(()=>{Nh=[["documentElement","data-wj-html"],["body","data-wj-body"]],ku=e=>(e||"").split(/\s+/).filter(Boolean)});function kn(){if(typeof document>"u")return!1;let e=document.querySelector('meta[name="view-transition"]');return e?(e.getAttribute("content")||"").trim().toLowerCase()==="same-origin":!1}function Ht(e,t){let n=typeof document<"u"?document.startViewTransition:void 0;if(kn()&&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 Br(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 i=null;try{i=t.querySelector(`#${CSS.escape(o)}`)}catch{i=null}if(!i||!r.hasAttribute||!r.hasAttribute("data-webjs-permanent"))continue;let s=i.parentNode;s&&i!==r&&(s.replaceChild(r,i),Tn.add(r))}}function Be(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 i of o.querySelectorAll("[data-webjs-permanent][id]"))n.push(i)}if(n.length)for(let r of n){let o=r.id;if(!o)continue;let i=Rh(t,o);if(!i||i===r)continue;let s=i.parentNode;if(s)s.replaceChild(r,i),Tn.add(r);else{let a=t.indexOf(i);a!==-1&&(t[a]=r,Tn.add(r))}}}function Rh(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}var Tn,Bt=_(()=>{Tn=new WeakSet});function Ru(e,t){let n=[];for(let r=e.parentNode;r;r=r.parentNode)if(n.unshift(r),r===t)return n;return null}function ju(e,t,n,r){let o=Ru(e.start,n),i=Ru(t.start,r);if(!o||!i||o.length!==i.length)return null;for(let s=1;s<o.length;s++)if(o[s].tagName!==i[s].tagName||si(o[s]))return null;return{live:o,incoming:i,liveRange:e,incomingRange:t}}function Ou(e,t,n){let r=[],o=[],i=r;for(let s=e.firstChild;s;s=s.nextSibling)s===t&&(i=null),i&&i.push(s),s===n&&(i=o);return{before:r,after:o}}function Oh(e,t){for(let n of t.attributes)Me.has(n.name)||n.name==="data-wj-serialized"||e.getAttribute(n.name)!==n.value&&e.setAttribute(n.name,n.value);for(let n of[...e.attributes])Me.has(n.name)||t.hasAttribute(n.name)||e.removeAttribute(n.name)}function Lh(e,t){let n=new Map;for(let s of e){if(s.nodeType!==1)continue;let a=le(s);a&&n.set(a,s)}let r=new Set,o=0,i=[];for(let s of t){if(s.nodeType===1){let c=le(s),l=c?n.get(c):null;if(l&&!r.has(l)){r.add(l),Ue(l,s),i.push(l),o=Math.max(o,e.indexOf(l)+1);continue}}let a=o;for(;a<e.length;a++){let c=e[a];if(r.has(c)||c.nodeType!==s.nodeType)continue;if(c.nodeType!==1)break;let l=c;if(!le(l)&&l.tagName===s.tagName)break}if(a<e.length&&(s.nodeType===1||s.nodeType===3||s.nodeType===8)){let c=e[a];r.add(c),c.nodeType===1?Ue(c,s):c.nodeValue!==s.nodeValue&&(c.nodeValue=s.nodeValue),i.push(c),o=a+1;continue}i.push(s)}return i}function Lu(e,t,n,r,o){let i=n.map(u=>document.importNode(u,!0));Be(t,i);let s=Lh(t,i),a=new Set(s),c=r;if(o){let u=-1;for(let d=0;d<t.length;d++)a.has(t[d])&&(u=d);let f=t.slice(u+1);if(f.length){for(let d of f)a.add(d);c=f[0]}}for(let u of t)!a.has(u)&&u.parentNode===e&&e.removeChild(u);for(let u=s.length-1;u>=0;u--){let f=s[u];(f.parentNode!==e||f.nextSibling!==c)&&e.insertBefore(f,c),c=f}let l=new Set(t);return s.filter(u=>!l.has(u))}function Pu(e){let{live:t,incoming:n,liveRange:r,incomingRange:o}=e,i=[];for(let s=0;s<t.length;s++){let a=t[s],c=n[s];s>0&&Oh(a,c);let l=s===t.length-1,u=l?r.start:t[s+1],f=l?r.end:t[s+1],d=l?o.start:n[s+1],p=l?o.end:n[s+1],h=Ou(a,u,f),b=Ou(c,d,p),m=[...Lu(a,h.before,b.before,u,!1),...Lu(a,h.after,b.after,null,s===0)];for(let g of m)g.nodeType===1&&i.push(ft(g));for(let g of[h.before,h.after])for(let w of g)w.nodeType===1&&w.isConnected&&i.push(w)}for(let s of i)s.isConnected&&qe(s)}var Iu=_(()=>{B();Ut();$t();Bt()});function Wt(e,t,n,r,o,i,s,a){let c=typeof location<"u"?location.href:"";if(r)try{c=new URL(r,c).href}catch{}Fo();let l=!1,u=()=>{if(!l){l=!0;try{To(e,{frame:!!t})}catch{}if(!t)try{Cu(e)}catch{}}};try{for(let b of e.querySelectorAll("[data-wj-host]"))b.setAttribute("data-wj-serialized","")}catch{}try{typeof sessionStorage<"u"&&(!r||t||n)&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}if(r&&!t&&!n){let b=document.querySelector('script[type="importmap"]'),m=b?b.getAttribute("data-webjs-build"):null,g=!1;if(o&&m&&(g=o!==m),!g&&e.head&&e.head.children.length>0){let w=da(document),S=da(e);w!==S&&(g=!0)}if(g&&typeof location<"u"){j.clear(),Mt(),En();try{let w="webjs:importmap-reload";if(sessionStorage&&sessionStorage.getItem(w))sessionStorage.removeItem(w),me("deploy-mismatch-reload-suppressed",r,!1);else return sessionStorage&&sessionStorage.setItem(w,"1"),me("deploy-mismatch",r),ke(r),"none"}catch{return me("deploy-mismatch",r),ke(r),"none"}}else if(!g){let w=b?b.getAttribute("data-webjs-src"):null;i&&w&&i!==w&&(j.clear(),Mt(),En(),b&&b.setAttribute("data-webjs-src",i));try{typeof sessionStorage<"u"&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}}}if(t){u();let b=document.querySelector(`webjs-frame#${CSS.escape(t)}`),m=e.querySelector(`webjs-frame#${CSS.escape(t)}`);if(b&&m){a&&a(),mn(e.head,{base:c,frame:!0}),we=Ht(()=>{Bo(),Hu(b,m),ft(b),qe(b),ya(e.body),qt()},()=>qe(b));return}let g=new CustomEvent("webjs:frame-missing",{bubbles:!0,cancelable:!0,detail:{frameId:t,url:r||(typeof location<"u"?location.href:null),document:e}});return(b||document).dispatchEvent(g),g.defaultPrevented||console.warn(`[webjs] frame "${t}" was not in the navigation response, leaving it unchanged. Handle "webjs:frame-missing" (preventDefault) to override.`),"none"}if(s==="shell"){u(),a&&a(),ga(e,c,!0);return}let f=ye(document.body),d=ye(e.body),p=f&&d?dr(f,d):null,h=p&&s==="layouts"?ju(p.live,p.incoming,document.body,e.body):null;if(p&&s==="layouts"&&!h){u(),a&&a(),ga(e,c,!0);return}if(p){u(),a&&a();let{mode:b,live:m,incoming:g}=p;mn(e.head,{base:c,styles:!1});let w=S=>!!(m.start.compareDocumentPosition(S)&Node.DOCUMENT_POSITION_FOLLOWING)&&!!(m.end.compareDocumentPosition(S)&Node.DOCUMENT_POSITION_PRECEDING);we=Ht(()=>{ua(e.head,{base:c,segment:p.segment,leaving:w}),Bo(),b==="replace"?Du(m,g):$u(m,g,e),la(p.segment,e,c),Fu(m.start,g.start),h&&Pu(h),ya(e.body),qt()},()=>Mu(m));return}if(r&&!n&&typeof location<"u")return me(f?d?"no-shared-boundary":"incoming-boundaries-malformed":"live-boundaries-malformed",r),ke(r),"none";if(r&&n)return me("revalidation-discarded",r,!1),"discard";u(),a&&a(),ga(e,c,!1)}function ga(e,t,n){vr(e.head,{base:t,styles:!1}),Br(document.body,e.body);let r=[...e.body.childNodes];we=Ht(()=>{ua(e.head,{base:t,segment:"/",leaving:()=>!0}),Bo(),document.body.replaceChildren(...r),n&&la("/",e,t),ft(document.body),qe(document.body),qt()},()=>qe(document.body))}var we,Ur=_(()=>{ko();Nu();De();be();Ut();ct();bn();Iu();Sr();Dt();wn();$e();Hr();$t();Bt();we=Promise.resolve()});function Bu(){wa||typeof MutationObserver>"u"||typeof customElements>"u"||(wa=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)}}),wa.observe(document.body,{childList:!0,subtree:!0}))}function Mu(e){if(!(!e||!e.start))for(let t=e.start.nextSibling;t&&t!==e.end;t=t.nextSibling)t.nodeType===1&&qe(t)}function qe(e){typeof customElements>"u"||ii(e)}function ii(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&&ii(n.shadowRoot))}function ft(e){if(e.tagName==="SCRIPT"){let n=Ar(e);return e.replaceWith(n),n}let t=[];Tn.has(e)&&t.push(e);for(let n of e.querySelectorAll("[data-webjs-permanent]"))Tn.has(n)&&t.push(n);for(let n of e.querySelectorAll("script"))t.length&&t.some(r=>r!==n&&r.contains(n))||n.replaceWith(Ar(n));return e}function qr(e){let t=[];for(let n=e.start.nextSibling;n&&n!==e.end;n=n.nextSibling)n.nodeType===1&&t.push(n);for(let n of t){let r=ft(n);r.isConnected!==!1&&qe(r)}}var wa,$t=_(()=>{De();B();be();Ut();hr();Xo();Do();ct();bn();Dt();wn();Hr();Ur();Bt();wa=null});function qt(){let e=document.activeElement;!e||e===document.body||e===document.documentElement||typeof e.blur=="function"&&e.blur()}function Du(e,t){let n=e.start.parentNode;if(!n)return;let r=[];for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)r.push(i);let o=[];for(let i=t.start.nextSibling;i&&i!==t.end;i=i.nextSibling)o.push(document.importNode(i,!0));Be(r,o);for(let i of r)i.parentNode===n&&n.removeChild(i);for(let i of o)n.insertBefore(i,e.end);qr(e)}function $u(e,t,n){if(!e||!t)return;let r=e.start.parentNode;if(!r)return;let o=[];for(let s=e.start.nextSibling;s&&s!==e.end;s=s.nextSibling)o.push(s);let i=[];for(let s=t.start.nextSibling;s&&s!==t.end;s=s.nextSibling)i.push(document.importNode(s,!0));Be(o,i),jh(r,e.start,e.end,o,i),qr(e)}function jh(e,t,n,r,o){let i=new Map;for(let c of r){if(c.nodeType!==1)continue;let l=le(c);l&&i.set(l,c)}let s=n,a=[];for(let c of o){if(c.nodeType===1){let l=le(c);if(l&&i.has(l)){let u=i.get(l);Ue(u,c),a.push(u),i.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,s)}function Ue(e,t){if(e===t)return;if(e.tagName!==t.tagName){e.replaceWith(t);return}let n=new Set,r=si(e)&&typeof e._hydratePropAttrs=="function",o=!1;for(let i of t.attributes)if(n.add(i.name),!Me.has(i.name)){if(r&&i.name.startsWith("data-webjs-prop-")){let s=e.__webjsPropAttrValues;(!s||s.get(i.name)!==i.value)&&(e.setAttribute(i.name,i.value),o=!0);continue}i.name!=="data-wj-serialized"&&e.getAttribute(i.name)!==i.value&&e.setAttribute(i.name,i.value)}for(let i of[...e.attributes])Me.has(i.name)||n.has(i.name)||e.removeAttribute(i.name);if(o&&e._hydratePropAttrs(),si(e)){Ih(e,t);return}Cn(e,t)}function si(e){let t=e;return t[Symbol.for("webjs.instance")]!=null||t[v]!=null}function Ph(e,t){for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!1;return!0}function ai(e){let t=new Map,n=`slot[${x}][${O}="${H}"]`;for(let r of e.querySelectorAll(n)){let o=r;if(!Ph(o,e)||Ji(e,o))continue;let i=!1;for(let a=o.parentElement;a&&a!==e;a=a.parentElement)if(a.tagName==="SLOT"&&a.hasAttribute(x)&&a.getAttribute(O)===H){i=!0;break}if(i)continue;let s=W(o.getAttribute("name"));t.has(s)||t.set(s,o)}return t}function Fu(e,t){let n=e.parentNode;if(!n||n.nodeType!==1)return;let r=n;if(r.tagName!=="SLOT"||!r.hasAttribute(x))return;let o=null;for(let f=r.parentElement;f;f=f.parentElement){if(f[v]){o=f;break}if(f.tagName.includes("-"))return}if(!o)return;let i=W(r.getAttribute("name"));Ze(o,i,[...r.childNodes]);let s=t.parentNode;if(!s||s.nodeType!==1)return;let a=s;if(a.tagName!=="SLOT")return;let c=null;for(let f=a.parentElement;f;f=f.parentElement)if(f.tagName.includes("-")){c=f;break}if(!c||c.tagName!==o.tagName)return;let l=ai(o),u=ai(c);for(let f of new Set([...l.keys(),...u.keys()])){if(f===i)continue;let d=u.get(f);d?Ze(o,f,[...d.childNodes].map(p=>document.importNode(p,!0))):l.get(f)&&Ze(o,f,null)}}function Ih(e,t){if(!e[v])return;let n=ai(e),r=ai(t);if(n.size===0&&r.size===0)return;let o=new Set([...n.keys(),...r.keys()]);for(let i of o){let s=n.get(i),a=r.get(i);s&&a?(Cn(s,a),Ze(e,i,[...s.childNodes])):a?Ze(e,i,[...a.childNodes].map(c=>document.importNode(c,!0))):Ze(e,i,null)}}function Cn(e,t){let n=[...e.childNodes],r=[...t.childNodes].map(a=>document.importNode(a,!0));Be(n,r);let o=new Map;for(let a of n){if(a.nodeType!==1)continue;let c=le(a);c&&o.set(c,a)}let i=[];for(let a=0;a<r.length;a++){let c=r[a];if(c.nodeType===1){let l=le(c);if(l&&o.has(l)){let f=o.get(l);Ue(f,c),i.push(f),o.delete(l);continue}let u=n[a];if(u&&u.nodeType===1&&!le(u)&&u.tagName===c.tagName&&Mh(u,c)){Ue(u,c),i.push(u);continue}}else if(c.nodeType===3){let l=n[a];if(l&&l.nodeType===3){l.nodeValue!==c.nodeValue&&(l.nodeValue=c.nodeValue),i.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),i.push(l);continue}}i.push(c)}let s=new Set(i);for(let a of n)!s.has(a)&&a.parentNode===e&&e.removeChild(a);for(let a=0;a<i.length;a++){let c=i[a];(c.parentNode!==e||e.childNodes[a]!==c)&&e.insertBefore(c,e.childNodes[a]||null)}}function Mh(e,t){let n=e.localName;return n!=="input"&&n!=="select"&&n!=="textarea"?!0:!(e.getAttribute("name")!==t.getAttribute("name")||n==="input"&&(e.getAttribute("type")||"text").toLowerCase()!==(t.getAttribute("type")||"text").toLowerCase())}function le(e){let t=e.getAttribute("data-key");return t?`${e.tagName}:k:${t}`:e.id?`${e.tagName}:i:${e.id}`:null}function Nn(){let e=ye(document.body);if(!e||e.size===0)return null;let t=[...e.keys()].sort((c,l)=>l.length-c.length),n=null,r=null;for(let c of t){let l=document.getElementById(`wj-loading:${c}`);if(l instanceof HTMLTemplateElement){n=c,r=l;break}}if(n===null||r===null)return null;let o=e.get(n),i=Te(),s=[];for(let c=o.start.nextSibling;c&&c!==o.end;c=c.nextSibling)s.push(c);let a=document.createRange();return a.setStartAfter(o.start),a.setEndBefore(o.end),a.deleteContents(),o.start.parentNode.insertBefore(r.content.cloneNode(!0),o.end),{slot:o,oldChildren:s,token:T,haveKeys:i}}function dt(e){if(!e||e.token!==T)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 Hu(e,t){Cn(e,t)}var Ut=_(()=>{Qe();De();B();$e();$t();Bt()});function Dh(e){if(typeof document>"u"||!document.body)return!1;let t=ye(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 i=document.createElement("div");i.setAttribute("role","alert"),i.setAttribute("data-webjs-nav-error","");let s=e?`This page could not be loaded. (status ${e})`:"This page could not be loaded.";i.textContent=s;let a=document.createRange();return a.setStartAfter(n.start),a.setEndBefore(n.end),a.deleteContents(),o.insertBefore(i,n.end),!0}function ci(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||Dh(t)||typeof location<"u"&&(me("navigation-error-unrecoverable",e),ke(e))}var Uu=_(()=>{De();be();$e()});function li(e){if(!e)return[];let t=[];for(let n of String(e).split(",")){let r=n.trim();if(!r)continue;let o=r.endsWith(";layout"),i=o?r.slice(0,-7):r;try{i=decodeURIComponent(i)}catch{}i.startsWith("/")&&t.push({path:i,layout:o})}return t}function qu(e,t){let n=e.path.split("/").filter(Boolean),r=t.split("/").filter(Boolean);for(let o=0;o<n.length;o++){let i=n[o];if(/^\[\[\.\.\./.test(i))return!0;if(/^\[\.\.\./.test(i))return r.length>o;if(o>=r.length)return!1;if(!/^\[[^\]]+\]$/.test(i)&&i!==r[o])return!1}return e.layout||r.length===n.length}var _a=_(()=>{});function Sa(e){if(!Oo(e)||e.hasAttribute("disabled")||!e.getAttribute("href"))return!1;let t=e.hasAttribute(te)?e.getAttribute(te):e.getAttribute("media");if(t&&typeof matchMedia=="function")try{if(!matchMedia(t).matches)return!1}catch{return!1}return!0}function Ku(e,t){return new Promise(n=>{let r=()=>{clearTimeout(o),e.removeEventListener("load",r),e.removeEventListener("error",r),n()},o=setTimeout(r,t);e.addEventListener("load",r),e.addEventListener("error",r)})}function Vu(e,t,n,r=Wu){if(typeof document>"u"||!e||!document.head)return null;let o=e;if(n)try{o=e.querySelector(`webjs-frame#${CSS.escape(n)}`)}catch{o=null}if(!o)return null;let i=t||document.baseURI,s=f=>{try{return new URL(f,i).href}catch{return null}},a=new Set;for(let f of document.querySelectorAll("link[href]")){if(f.hasAttribute(he)||!Sa(f))continue;let d=f.href;d&&a.add(d)}let c=qo(),l=[],u=[];for(let f of o.querySelectorAll("link[href]")){if(!Sa(f))continue;let d=s(f.getAttribute("href"));if(!d||a.has(d))continue;a.add(d);let p=document.createElement("link");p.rel="stylesheet",p.setAttribute(he,"");for(let b of["media","crossorigin","integrity","referrerpolicy"]){let m=f.getAttribute(b);m&&p.setAttribute(b,m)}c&&p.setAttribute("nonce",c),p.href=d,aa(p),l.push(p),u.push(Ku(p,r));let h=f.getAttribute(Ce);h?(p.setAttribute(Ce,h),ca(p,h)):document.head.appendChild(p)}return l.length?{ready:Promise.all(u).then(()=>{}),copies:l}:null}function ui(e,t=Wu){if(!(!e||typeof document>"u"))for(let n of e.copies){if(!n.isConnected||!n.hasAttribute(he))continue;let r=null;for(let o of document.querySelectorAll("link[href]"))if(!(o===n||o.hasAttribute(he)||!Sa(o))&&o.href===n.href){r=o;break}if(!r||r.sheet){n.remove();continue}Ku(r,t).then(()=>n.remove())}}var Wu,zu=_(()=>{B();Sr();bn();Wu=2e3});function $h(e,t){try{let n=new URL(e,location.href),r=new URL(t,location.href);return n.origin===r.origin&&n.pathname===r.pathname&&n.search===r.search}catch{return!1}}function Fh(){let e=document.activeElement;if(!e||e===document.body||e===document.documentElement)return null;let t=e,n=null,r=null;try{n=t.selectionStart??null,r=t.selectionEnd??null}catch{}return{el:e,start:n,end:r}}function Hh(e){let{el:t,start:n,end:r}=e;if(!t.isConnected||document.activeElement===t)return;let o=t;if(typeof o.focus!="function")return;let i=window.scrollX,s=window.scrollY;if(o.focus({preventScroll:!0}),n!==null&&r!==null)try{o.setSelectionRange(n,r)}catch{}(window.scrollX!==i||window.scrollY!==s)&&window.scrollTo({left:i,top:s,behavior:"instant"})}async function Wr(e,t,n,r,o,i,s,a,c,l){o=o||"GET";let u=l&&l.refresh||void 0,f=i!=null&&o!=="GET"&&o!=="HEAD"&&!t,d=!!(l&&l.noPrefetch),p=!!(l&&l.preserveScroll),h=typeof a=="number"?a:T,b,m=null,g=null,w=null,S=null,y=!1,U=e,P=t?xr(t,h):null;try{try{let J=o==="GET"&&!i&&!u&&!d?Mr(e,r?r.haveKeys:void 0,t):null;if(J)b=J.html,g=J.build,w=J.src,U=J.finalUrl,S=200,y=!0;else{let ht={"x-webjs-router":"1"},La=u||f?"":Te();La&&(ht["x-webjs-have"]=La),t&&(ht["x-webjs-frame"]=t),i!=null&&o!=="GET"&&o!=="HEAD"&&(ht.accept=Ys+", text/html");let hi={method:o,headers:ht,credentials:"same-origin",cache:"no-cache"};s&&(hi.signal=s),i!=null&&o!=="GET"&&o!=="HEAD"&&(hi.body=i);let $=await fetch(e,hi);if(S=$.status,y=$.ok,u&&$.headers.get("x-webjs-dev-error")==="1"){try{await $.body?.cancel()}catch{}return{ok:!1,status:S,aborted:!1,applied:!1,devError:!0}}let ja=Js($.headers.get("x-webjs-invalidate"));ja.length&&Gs(ja);for(let Kt of li($.headers.get("x-webjs-refresh")))Kt.layout||Kt.path.includes("[")?Oe():Oe(Kt.path);let Pa=$.headers.get("content-type")||"",uf=/^text\/html\b/i.test(Pa);if(Pa.toLowerCase().indexOf(Ys)===0){let Kt=await $.text(),zr=h===T;return zr&&(dt(r),Ws(Kt)),{ok:zr&&y,status:S,aborted:!zr,applied:zr}}if($.redirected&&$.url&&(U=$.url),$.status===204||$.status===205)return h===T&&n&&history.pushState(null,"",U),{ok:y,status:S,aborted:!1,applied:!1};if(!uf)return h===T&&(dt(r),ci(e,$.status,null)),{ok:!1,status:S,aborted:!1,applied:!1};g=$.headers.get("x-webjs-build"),w=$.headers.get("x-webjs-src");let mi=await $r($);b=mi.shell,mi.streaming&&(m=mi)}}catch(J){return J&&J.name==="AbortError"?{ok:!1,status:null,aborted:!0,applied:!1}:h!==T?{ok:!1,status:null,aborted:!0,applied:!1}:(dt(r),ci(e,null,J instanceof Error?J:new Error(String(J))),{ok:!1,status:null,aborted:!1,applied:!1})}if(h!==T){if(m&&m.reader)try{m.reader.cancel()}catch{}return{ok:!1,status:S,aborted:!0,applied:!1}}let re=Lt(b);if(!re)return dt(r),ci(e,null,new Error("navigation response did not parse as HTML")),{ok:!1,status:S,aborted:!1,applied:!1};let q=Vu(re,U||e,t);if(q&&(await q.ready,h!==T)){if(ui(q),m&&m.reader)try{m.reader.cancel()}catch{}return{ok:!1,status:S,aborted:!0,applied:!1}}let _e=f&&!u&&$h(U,location.href),On=!1,pt=n?()=>{On||(On=!0,_e?history.replaceState(history.state,"",U):history.pushState(null,"",U))}:null,C=_e?Fh():null,Oa=Wt(re,t,!!c,U,g,w,u||(f?"layouts":void 0),pt);q&&we.then(()=>ui(q),()=>ui(q)),C&&we.then(()=>{h===T&&Hh(C)},()=>{});let lf=Oa!=="none";if(Oa==="discard"){if(m&&m.reader)try{m.reader.cancel()}catch{}return{ok:y,status:S,aborted:!1,applied:!1}}if(pt&&pt(),n&&!t){let J=new URL(U),ht=J.hash?document.getElementById(J.hash.slice(1)):null;ht?ht.scrollIntoView():!p&&!_e&&(ou(),window.scrollTo({left:0,top:0,behavior:"instant"}))}return m&&(m.reader||m.rest)&&we.then(()=>Fr(m.reader,m.dec,m.rest,()=>h===T)),document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:U,frameId:t,from:"navigate"}})),{ok:y,status:S,aborted:!1,applied:lf,samePage:_e}}finally{P&&Er(P,h)}}var Gu=_(()=>{No();lr();De();B();be();Ut();hr();ct();Uu();Pt();_a();Dt();$e();Hr();zu();Ur()});function Aa(e){if(e.id)return`id:${e.id}`;let t=e.querySelector(`input[name="${Ju}"]`);return t?`act:${t.getAttribute("value")||""}`:`url:${e.getAttribute("action")||""}`}function Uh(e,t){let n=0;for(let r of document.querySelectorAll("form")){if(r===e)return n;Aa(r)===t&&n++}return-1}function qh(e){let t=e.localName;if(t==="textarea")return"text";if(t==="select")return"select";if(t!=="input")return null;let n=(e.getAttribute("type")||"text").toLowerCase();return Bh.has(n)?null:n==="checkbox"||n==="radio"?"check":"text"}function Yu(e){let t=new Map,n=[],r=e.elements?[...e.elements]:[...e.querySelectorAll("input, textarea, select")];for(let o of r){let i=o.getAttribute&&o.getAttribute("name");if(!i||i===Ju)continue;let s=qh(o);if(!s)continue;let a=s==="check"?`${i}\0${o.getAttribute("value")??"on"}`:i,c=t.get(a)||0;t.set(a,c+1),n.push({el:o,name:i,kind:s,n:c})}return n}function Xu(e,t){if(t==="check")return{def:String(!!e.defaultChecked),cur:String(!!e.checked)};if(t==="select"){let n=[...e.options];return{def:JSON.stringify(n.map(r=>r.defaultSelected)),cur:JSON.stringify(n.filter(r=>r.selected).map(r=>r.value))}}return{def:e.defaultValue??"",cur:e.value??""}}function Zu(e){if(!e||e.getAttribute("data-preserve-values")==="false")return null;let t=Aa(e),n=Yu(e).map(({el:r,name:o,kind:i,n:s})=>({name:o,kind:i,n:s,...i==="check"?{value:r.getAttribute("value")??"on"}:{},...Xu(r,i)}));return n.length?{form:e,key:t,ord:Uh(e,t),controls:n}:null}function Wh(e){if(e.form.isConnected)return e.form;let t=0;for(let n of document.querySelectorAll("form"))if(Aa(n)===e.key){if(t===e.ord)return n;t++}return null}function Qu(e){if(!e)return 0;let t=Wh(e);if(!t)return 0;let n=new Map;for(let o of Yu(t)){let i=o.kind==="check"?`${o.name}\0${o.el.getAttribute("value")??"on"}\0${o.n}`:`${o.name}\0${o.n}`;n.set(i,o)}let r=0;for(let o of e.controls){let i=o.kind==="check"?`${o.name}\0${o.value}\0${o.n}`:`${o.name}\0${o.n}`,s=n.get(i);if(!s||s.kind!==o.kind)continue;let a=Xu(s.el,s.kind);if(a.def===o.def&&a.cur!==o.cur){if(o.kind==="check")s.el.checked=o.cur==="true";else if(o.kind==="select"){let c=new Set(JSON.parse(o.cur));for(let l of s.el.options)l.selected=c.has(l.value)}else s.el.value=o.cur;r++}}return r}var Ju,Bh,ef=_(()=>{Ju="__webjs_action",Bh=new Set(["password","file","hidden","submit","button","image","reset"])});function gu(e){if(!fu(e)||!ne)return!1;let t,n;try{t=new URL(ne),n=new URL(e,location.href)}catch{return!1}return t.pathname!==n.pathname||t.search!==n.search?!1:(ne=n.href,!0)}function Kr(){ee||typeof document>"u"||(na(!0),Fo(),globalThis.__webjsRefreshPage=tf,document.addEventListener("click",pa,!1),document.addEventListener("submit",gn,!1),window.addEventListener("popstate",yn),document.addEventListener("pointerover",It,!0),document.addEventListener("focusin",It,!0),document.addEventListener("touchstart",It,{capture:!0,passive:!0}),document.addEventListener("pointerout",ba,!0),document.addEventListener("webjs:navigate",ni),Bu(),ni(),typeof history<"u"&&"scrollRestoration"in history&&(fi=history.scrollRestoration,history.scrollRestoration="auto"),typeof location<"u"&&(ne=location.href),nu())}function va(){ee&&(na(!1),document.removeEventListener("click",pa,!1),document.removeEventListener("submit",gn,!1),window.removeEventListener("popstate",yn),Po(),document.removeEventListener("pointerover",It,!0),document.removeEventListener("focusin",It,!0),document.removeEventListener("touchstart",It,{capture:!0}),document.removeEventListener("pointerout",ba,!0),document.removeEventListener("webjs:navigate",ni),Dr(),ti(),Tu(),typeof history<"u"&&fi!==null&&(history.scrollRestoration=fi,fi=null),Jo(),ae&&ae(),ce&&ce(),ne=null,delete globalThis.__webjsRefreshPage)}async function Ft(e,t){let n=new URL(e,location.href);if(n.origin!==location.origin){ke(e);return}await Nr(n.href,t?.replace??!1,null,{preserveScroll:t?.scroll===!1})}async function xa(e,t){if(typeof location>"u")return{ok:!1,status:null,aborted:!1,applied:!1};let n=e&&e.id;if(!n)return{ok:!1,status:null,aborted:!1,applied:!1};let r=new URL(t,location.href);if(r.origin!==location.origin)return{ok:!1,status:null,aborted:!1,applied:!1};ue&&ue.abort(),ue=new AbortController;let o=ue.signal,i=jo(),s=await Wr(r.href,n,!1,null,"GET",null,o,i,!1,{noPrefetch:!0});return s&&s.applied&&Au(r.href,n),s}function Oe(e){if(!e){j.clear(),Mt();return}let t=new URL(e,location.href),n=t.pathname+t.search;j.delete(n),k.delete(n);let r=` ${n}`;for(let o of[...k.keys()])o.endsWith(r)&&k.delete(o)}async function Vr(e){return await tf(e)!=="failed"}async function tf(e){if(!ee||typeof location>"u")return"failed";Oe(),En();try{let t=await Nr(location.href,!1,null,{refresh:e==="shell"?"shell":"page"});return!t||t.aborted?"settled":t.devError?"dev-error":t.applied?"applied":"failed"}catch{return"failed"}}async function Nr(e,t,n,r){Po();let o=r&&r.refresh||void 0,i=!!(r&&r.preserveScroll);if(ta(t,n)&&typeof location<"u")return me("readyState-loading",e),ke(e),null;ue&&ue.abort(),ue=new AbortController;let s=ue.signal,a=jo();n||(Jo(),ae&&ae(),ce&&ce()),!o&&ne&&ha(ne);let c=setTimeout(()=>{fr(!0),c=null},150),l=null;!t&&!o&&(l=Nn());let u=!1;try{if(t){let d=_u(e);if(d){let p=Lt(d.html);if(p){let h=yu(d.scrollHeight);Wt(p,n,!0,null);let b=()=>{};if(typeof window<"u"){let w=()=>{b=bu(d.scrollX,d.scrollY)};if(kn()&&typeof document.startViewTransition=="function"){let S=zo;we.then(()=>{S!==zo||!ee||w()}).catch(()=>{})}else w()}let m=Wr(e,n,!1,l,"GET",null,s,a,!0).catch(()=>{}),g=new Promise(w=>setTimeout(w,500));return Promise.all([m,g]).then(()=>Go(()=>{b(),Go(h)})),null}}u=!0,typeof window<"u"&&window.scrollTo({left:0,top:0,behavior:"instant"})}let f=await Wr(e,n,!t&&!o,l,"GET",null,s,a,!1,{refresh:o,preserveScroll:i});return u&&f&&f.applied&&typeof window<"u"&&Go(()=>{a!==T||!ee||window.scrollTo({left:0,top:0,behavior:"instant"})}),f}finally{c&&clearTimeout(c),a===T&&(fr(!1),typeof location<"u"&&(ne=location.href))}}async function wu(e,t,n,r,o,i){Po(),ue&&ue.abort(),ue=new AbortController;let s=ue.signal,a=jo();r||(Jo(),ae&&ae(),ce&&ce());let c=t==="get"||t==="head",l=new URL(e,location.href);if(c){l.search="";for(let[b,m]of n)l.searchParams.append(b,typeof m=="string"?m:m.name)}ne&&ha(ne);let u=setTimeout(()=>{fr(!0),u=null},150),f=c?Nn():null,d=o?Tr(o,a,l.href):null,p=c?null:Zu(o),h=!1;try{let b=await Wr(l.href,r,!0,f,c?"GET":t.toUpperCase(),c?null:n,s,a,!1,{preserveScroll:!!(i&&i.preserveScroll)});h=!!(b&&b.ok),p&&b&&b.applied&&!b.ok&&a===T&&(await we,a===T&&Qu(p)),!c&&o&&b&&b.ok&&b.applied&&b.samePage&&a===T&&(await we,a===T&&o.isConnected&&typeof o.reset=="function"&&o.reset()),!c&&a===T&&(j.clear(),Mt())}finally{d&&kr(d,a,l.href,h),u&&clearTimeout(u),a===T&&(fr(!1),typeof location<"u"&&(ne=location.href))}}function nf(){return ne}function rf(e){ne=e}var ue,ne,fi,Pt=_(()=>{B();be();Ut();hr();Xo();Gu();ct();ef();Dt();Yo();wn();$e();Sr();Ur();$t();Bt();ue=null,ne=null;fi=null});var Kl={};Ia(Kl,{_FALLBACK_MARKER_KEY:()=>Ot,_FRAME_TOP:()=>ur,_LIVE_ATTRS:()=>Me,_activateSwappedRange:()=>qr,_activeFrameId:()=>Vo,_addNewHeadElements:()=>mn,_applyOptimisticLoading:()=>Nn,_applyStreamedResolve:()=>oi,_applySwap:()=>Wt,_blurOutgoingFocus:()=>qt,_buildHaveHeader:()=>Te,_buildSubmitFormData:()=>wr,_bumpNavToken:()=>lu,_clearFormBusy:()=>kr,_clearFrameBusy:()=>Er,_collectBoundaries:()=>ye,_currentPageUrl:()=>nf,_diffElementInPlace:()=>Ue,_eligibleAnchorHref:()=>vn,_encodeSubmitBody:()=>gr,_findAnchorInPath:()=>Io,_getSubmitAction:()=>br,_getSubmitEnctype:()=>yr,_getSubmitMethod:()=>mr,_isNonHtmlPath:()=>Zl,_isPreBootNavigation:()=>Lo,_keyOf:()=>le,_markFormBusy:()=>Tr,_markFrameBusy:()=>xr,_mergeHead:()=>vr,_navToken:()=>cu,_onPopState:()=>yn,_onSubmit:()=>gn,_parseHTML:()=>Lt,_planBoundarySwap:()=>dr,_prefetch:()=>ut,_prefetchAnchor:()=>ei,_prefetchCache:()=>k,_prefetchHasHoverPointer:()=>Zo,_prefetchInflightSize:()=>xu,_prefetchMode:()=>xn,_prefetchPeek:()=>vu,_prefetchSaysSaveData:()=>Ir,_prefetchSuppressed:()=>Qo,_prefetchTake:()=>Mr,_reactivateScripts:()=>ft,_readStreamedShell:()=>$r,_reconcileChildren:()=>Cn,_regraftPermanentElements:()=>Br,_regraftPermanentInSlice:()=>Be,_resetParseProbe:()=>ra,_resetPrefetch:()=>Eu,_resetWarnOnce:()=>iu,_resolvePreserveScroll:()=>Cr,_resolveTargetFrameId:()=>ge,_restoreOptimistic:()=>dt,_runWithTransition:()=>Ht,_setCurrentPageUrl:()=>rf,_setHardNavigate:()=>au,_shouldFullLoadDuringParse:()=>su,_snapshotCache:()=>j,_streamBoundariesProgressively:()=>Fr,_takeResolveUnit:()=>ri,_viewTransitionsEnabled:()=>kn,disableClientRouter:()=>va,enableClientRouter:()=>Kr,loadFrame:()=>xa,navigate:()=>Ft,refreshPage:()=>Vr,revalidate:()=>Oe});var Eo=_(()=>{Us();lr();lr();ze();zl();ko();No();Qe();Pt();B();be();Pt();Dt();$e();De();B();be();Ut();hr();Mo();Xo();Do();ct();bn();Dt();Yo();wn();Hr();Ur();$t();Bt();(typeof window>"u"||window.__WEBJS_CLIENT_ROUTER__!==!1)&&Kr()});var Ma=Symbol.for("webjs.hot"),Da=globalThis;function Gr(e,t){let n=Da[Ma];return n===void 0?e:n.strings(e,t)}function $a(){let e=Da[Ma];return e===void 0?null:e.replace}function bi(e,...t){return{_$webjs:"template",strings:Gr(yi(e),0),values:t}}function yi(e){if(!Array.isArray(e)||Object.prototype.hasOwnProperty.call(e,"raw"))return e;let t=Object.isExtensible(e)?e:e.slice();return Object.defineProperty(t,"raw",{value:t}),t}function df(e,...t){return{_$webjs:"template",strings:Gr(yi(e),1),values:t,svg:!0}}function pf(e,...t){return{_$webjs:"template",strings:Gr(yi(e),2),values:t,mathml:!0}}function F(e){return!!e&&typeof e=="object"&&e._$webjs==="template"}var N="wjm-";var hf=!(typeof window<"u"&&typeof document<"u");var wi=Symbol(),Fa=new WeakMap,Ln=class{constructor(t,n,r){if(r!==wi)throw new Error("[webjs] CSSResult is not constructable. Use `css` or `unsafeCSS` instead.");this._$webjsCss=!0,this.cssText=t,this._styleSheet=void 0,this._strings=n}get text(){return this.cssText}get styleSheet(){if(this._styleSheet===void 0&&typeof CSSStyleSheet<"u"){let t=this._strings,n=t!==void 0&&t.length===1,r=n?Fa.get(t):void 0;r===void 0&&(r=new CSSStyleSheet,r.replaceSync(this.cssText),n&&Fa.set(t,r)),this._styleSheet=r}return this._styleSheet}toString(){return this.cssText}};function mf(e,...t){let n=e[0];for(let r=1;r<e.length;r++)n+=bf(t[r-1])+e[r];return new Ln(n,e,wi)}function bf(e){if(jn(e))return e.cssText??e.text;if(typeof e=="number")return String(e);throw new Error(`[webjs] Value passed to 'css' must be a 'css' result or a number, got ${yf(e)}. Compose another css\`...\` result, or wrap a trusted string in unsafeCSS() from '@webjsdev/core'. Never pass user input through unsafeCSS().`)}function yf(e){return e===null?"null":typeof e=="string"?JSON.stringify(e.length>40?e.slice(0,40)+"...":e):typeof e}function gf(e){return new Ln(typeof e=="string"?e:String(e),void 0,wi)}function jn(e){return!!e&&typeof e=="object"&&e._$webjsCss===!0}function Ba(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let r of n)Ha(r)&&t.unshift(r)}else Ha(e)&&t.push(e);return t}function Ha(e){return jn(e)||typeof CSSStyleSheet<"u"&&e instanceof CSSStyleSheet}function _i(e,t){if(!(!t||!t.length))if("adoptedStyleSheets"in e&&typeof CSSStyleSheet<"u")e.adoptedStyleSheets=t.map(n=>{if(n instanceof CSSStyleSheet)return n;let r=n.styleSheet;if(r)return r;let o=new CSSStyleSheet;return o.replaceSync(gi(n)),o});else{let n=e,r=document.createElement("style");r.textContent=t.map(gi).join(`
|
|
4
|
+
`),n.appendChild(r)}}function gi(e){return jn(e)?e.cssText??e.text:e&&e.cssRules?Array.from(e.cssRules,t=>t.cssText).join(`
|
|
5
|
+
`):""}function wf(e){if(!e||!e.length)return"";let t=e.filter(jn).map(gi);return t.length?`<style>${t.join(`
|
|
6
|
+
`)}</style>`:""}function Ua(e){return`[webjs] <${e}> declares static styles but renders into light DOM, so the styles are never applied. Add \`static shadow = true\` to scope them in a shadow root, or style the light-DOM markup with Tailwind utilities or a global stylesheet (prefix custom class selectors with the tag name).`}We();ze();We();var ki=Symbol.for("webjs.repeat"),zf=(e,t)=>t;function dc(e,t,n){return n===void 0?{[ki]:!0,items:[...e],keyFn:zf,templateFn:t}:{[ki]:!0,items:[...e],keyFn:t,templateFn:n}}function Zr(e){return!!e&&typeof e=="object"&&e[ki]===!0}We();function pc(e){return{_$webjs:"class-map",value:e}}function hc(e){return{_$webjs:"style-map",value:e}}function mc(e){return e??R}function bc(e){return e&&(e._$webjs==="class-map"||e._$webjs==="style-map")}function Gf(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function yc(e,t){if(e.kind!=="attr"&&e.kind!=="attr-mixed")throw new Error("classMap/styleMap require an attribute binding.");let n=t._$webjs==="class-map";if(e.name!==(n?"class":"style"))throw new Error("classMap/styleMap must be used in a class/style attribute.");if(e.group&&e.group.length!==1)throw new Error("classMap/styleMap require a single expression.");e.__mapKind!==t._$webjs&&(e.el.setAttribute(e.name,(e.statics||[]).join(n?" ":"")),e.__mapKind=t._$webjs,e.__mapKeys=new Set,e.__staticClasses=n?new Set(e.el.classList):new Set);let r=new Set;for(let[o,i]of Object.entries(t.value))if(n)i&&!e.__staticClasses.has(o)&&(e.el.classList.add(o),r.add(o));else if(i!=null){let s=Gf(o),a=String(i);e.el.style.setProperty(s,a.replace(/\s*!important\s*$/,""),/!important\s*$/.test(a)?"important":""),r.add(s)}for(let o of e.__mapKeys)r.has(o)||(n?e.el.classList.remove(o):e.el.style.removeProperty(o));e.__mapKeys=r}function Jf(e){let t=Ci(e,"unsafeHTML");return typeof t=="string"?{_$webjs:"unsafe-html",value:t}:t}function Ci(e,t){if(e==null||e===R)return R;if(e===A)return A;if(typeof e!="string")throw new Error(`${t}() takes a string of trusted markup, not ${Array.isArray(e)?"an array":typeof e}.`);return e}function Ni(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function Yf(e){let t=Ci(e,"unsafeSVG");return typeof t=="string"?{_$webjs:"unsafe-html",value:t,ns:"svg"}:t}function Xf(e){let t=Ci(e,"unsafeMathML");return typeof t=="string"?{_$webjs:"unsafe-html",value:t,ns:"mathml"}:t}function Zf(e){return{_$webjs:"live",value:e}}function fe(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function Qf(e,t){return{_$webjs:"keyed",key:e,value:t}}function mt(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function ed(e,t){return{_$webjs:"guard",deps:e,fn:t}}function bt(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function td(e){return{_$webjs:"template-content",template:e}}function Ri(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function nd(e){return{_$webjs:"ref",target:e}}function Qr(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function rd(){return{value:void 0}}function od(e){return{_$webjs:"cache",value:e}}function yt(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function id(...e){return{_$webjs:"until",args:e}}function Jt(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function sd(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function Oi(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function ad(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function Li(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function gc(e){return{_$webjs:"watch",signal:e}}function Yt(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}function cd(e,t,n){return e?t(e):n?.(e)}function ld(e,t,n){for(let[r,o]of t)if(r===e)return o();return n?.()}function*ud(e,t){if(e===void 0)return;let n=0;for(let r of e)yield t(r,n++)}function*fd(e,t){if(e===void 0)return;let n=typeof t=="function",r=-1;for(let o of e)r>-1&&(yield n?t(r):t),r++,yield o}function*dd(e,t,n=1){let r=t===void 0?0:e;t??=e;for(let o=r;n>0?o<t:t<o;o+=n)yield o}In();Qe();In();ze();Qe();var gd=new Set(["script","style","textarea","title"]);function wd(e){let t="text",n="",r="",o="",i=!1,s="";for(let a=0;a<e.length;a++){let c=e[a];a>0&&(t==="tagname"?t="tag":t==="attr"&&(r="",t="tag"));for(let l=0;l<c.length;l++){let u=c[l];switch(t){case"text":u==="<"&&(c.startsWith("<!--",l)?(t="comment",l+=3):/[A-Za-z/]/.test(c[l+1]||"")&&(i=c[l+1]==="/",i&&l++,t="tagname",o=""));break;case"tagname":if(/[\s/>]/.test(u)){if(!i&&/^[A-Z](?=.*[a-z])/.test(o))return{kind:"tag",name:o};t=u===">"?as(o,i):"tag",t==="raw"&&(s=o.toLowerCase())}else o+=u;break;case"tag":u===">"?(t=as(o,i),t==="raw"&&(s=o.toLowerCase())):u==='"'||u==="'"?(t="q",n=u):/[\s/=]/.test(u)||(t="attr",r=u);break;case"attr":if(/[\s=/>]/.test(u)){if(r==="className"||r==="htmlFor")return{kind:"attr",name:r};r="",u===">"?(t=as(o,i),t==="raw"&&(s=o.toLowerCase())):t="tag"}else r+=u;break;case"q":u===n&&(t="tag");break;case"comment":c.startsWith("-->",l)&&(t="text",l+=2);break;case"raw":u==="<"&&c.slice(l+2,l+2+s.length).toLowerCase()===s&&c[l+1]==="/"&&(t="tagname",i=!0,o="",l+=1);break;default:break}}}return t==="attr"&&(r==="className"||r==="htmlFor")?{kind:"attr",name:r}:null}function as(e,t){return!t&&gd.has(e.toLowerCase())?"raw":"text"}function _d(e){if(e.kind==="attr"){let t=e.name==="className"?"class":"for";return`webjs: \`${e.name}=\` in an html template is JSX, not HTML: the browser reads it as an unknown \`${e.name.toLowerCase()}\` attribute and it does nothing. Write \`${t}=\` instead (\`${t}=\${...}\` for a dynamic value). See https://webjs.dev/docs/troubleshooting#jsx-in-html-template`}return`webjs: \`<${e.name}>\` in an html template is a JSX component, not HTML: the browser lowercases it into an unknown \`<${e.name.toLowerCase()}>\` element and renders nothing. Use the custom element's tag (\`<my-${e.name.toLowerCase()}>\`, registered with ${e.name}.register('my-${e.name.toLowerCase()}')), or a plain element such as \`<a href>\` for a link. See https://webjs.dev/docs/troubleshooting#jsx-in-html-template`}function Oc(e){let t=wd(e);if(t)throw new Error(_d(t))}var ao=new WeakMap,co=new WeakMap,Qt=Symbol.for("webjs.instance"),Sd=new Set(["script","style","textarea","title"]),xt=/[ \t\n\f\r]/,zn="\uE000";function en(e){let{strings:t}=e,n=ao.get(t);if(n)return n;if(!Array.isArray(t)||!Object.prototype.hasOwnProperty.call(t,"raw"))throw new Error("[webjs] refusing to render a template result whose strings are not a tagged template's (a TemplateResult built from data, not by html``).");Oc(t);let r=[],o="",i="text",s="",a=0,c="",l=0,u=null,f="",d=!1,p="",h=()=>(p="",!d&&Sd.has(f)?"rawtext":"text");for(let g=0;g<t.length;g++){let w=t[g];for(let S=0;S<w.length;S++){let y=w[S];switch(i){case"text":o+=y,y==="<"&&(i="tag-open");break;case"tag-open":o+=y,y==="!"?i="bang-1":y==="/"?(i="tag-name",f="",d=!0):/[a-zA-Z]/.test(y)?(i="tag-name",f=y.toLowerCase(),d=!1):i="text";break;case"bang-1":o+=y,i=y==="-"?"bang-dash":"bogus";break;case"bang-dash":o+=y,y==="-"?(i="comment",l=0):i="bogus";break;case"bogus":o+=y,y===">"&&(i="text");break;case"comment":o+=y,y==="-"?l+=1:(y===">"&&l>=2&&(i="text"),l=0);break;case"tag-name":o+=y,d&&f===""&&y!==">"&&!/[a-zA-Z]/.test(y)?i="bogus":y===">"?i=h():xt.test(y)?i="in-tag":f+=y.toLowerCase();break;case"in-tag":o+=y,y===">"?i=h():!xt.test(y)&&y!=="/"&&(i="attr-name",s=y,a=o.length-1);break;case"rawtext":o+=y,p=(p+y.toLowerCase()).slice(-(f.length+3)),p===`</${f}>`&&(i="text",p="",f="");break;case"attr-name":y==="="?(i="after-eq",o+=y):xt.test(y)?(i="after-name",o+=y):y===">"?(i=h(),s="",o+=y):(s+=y,o+=y);break;case"after-name":o+=y,y==="="?i="after-eq":y===">"?(i=h(),s=""):y==="/"?(i="in-tag",s=""):xt.test(y)||(i="attr-name",s=y,a=o.length-1);break;case"after-eq":y==='"'||y==="'"?(i="attr-quoted",c=y,o+=y):xt.test(y)?o+=y:y===">"?(i=h(),s="",o+=y):(i="attr-unquoted",o+=y);break;case"attr-unquoted":xt.test(y)?(i="in-tag",s="",o+=y):(y===">"&&(i=h(),s=""),o+=y);break;case"attr-quoted":o+=y,y===c&&(i="in-tag",s="");break;case"skip-attr":if(c===""?xt.test(y)||y===">"||y==="/"&&w[S+1]===">":y===c){if(u){let U=u.firstPartIdx,P=[];for(let C=U;C<r.length;C++)(r[C].kind==="noop"||r[C].kind==="attr-mixed")&&P.push(C);let re=[],q=t[P[0]];if(c==="")re.push(q.slice(q.lastIndexOf("=")+1).trimStart());else{let C=q.lastIndexOf(c);re.push(C>=0?q.slice(C+1):q)}for(let C=1;C<P.length;C++)re.push(t[P[C]]);let _e=t[P[P.length-1]+1],On=c===""?S:_e.indexOf(c);re.push(On>=0?_e.slice(0,On):_e);let pt=Vt(u.name[0]);if(pt&&(P.length!==1||re.some(C=>C!=="")))throw new Error("Event, property and boolean bindings require exactly one expression with no surrounding text.");r[U]={kind:pt?Jr[u.name[0]]:"attr-mixed",path:[],name:pt?u.name.slice(1):u.name,statics:re,group:P};for(let C=1;C<P.length;C++)r[P[C]]={kind:"noop",path:[],mixedAnchor:U};u=null}s="",c===""&&(o+=y),i=c===""&&y===">"?h():"in-tag"}break}}if(g<t.length-1){let S=r.length;if(i==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(i==="rawtext"){p="",o+=`${zn}${S}${zn}`,r.push({kind:"child",path:[]});continue}let y=t[g+1],U=i==="after-eq"&&(y===""?g+1<t.length-1:!/^([ \t\n\f\r]|>|\/>)/.test(y));if(i==="text")o+=`<!--${N}${S}-->`,r.push({kind:"child",path:[]});else if(i==="in-tag"||i==="after-name"){let P=`data-${N}${S}`;o+=`${P}=""`,r.push({kind:"element",path:[]}),i="in-tag",s=""}else if(i==="after-eq"&&!U){let P=s[0],re=s.slice(1);if(Vt(P)){o=o.slice(0,a);let q=Jr[P],_e=`data-${N}${S}`;o+=`${_e}=""`,r.push({kind:q,path:[],name:re})}else{o=o.slice(0,a);let q=`data-${N}${S}`;o+=`${q}=""`,r.push({kind:"attr",path:[],name:s})}i="in-tag",s=""}else if(i==="attr-quoted"||i==="attr-unquoted"||i==="after-eq"){i!=="attr-quoted"&&(c=""),o=o.slice(0,a);let P=`data-${N}${S}`;o+=`${P}=""`,u={name:s,firstPartIdx:S},r.push({kind:"noop",path:[]}),i="skip-attr"}else r.push({kind:"noop",path:[]})}}let b=document.createElement("template");if(e.svg||e.mathml){let g=e.svg?"svg":"math";b.innerHTML=`<${g}>${o}</${g}>`;let w=b.content.firstChild;w.replaceWith(...w.childNodes)}else b.innerHTML=o;o.includes(zn)&&Ad(b.content),vd(b.content,r);let m=xd(b.content,r);return n={templateEl:b,parts:r,formActions:m},ao.set(t,n),n}function Ad(e){let t=[],n=r=>{for(let o of r.childNodes)o.nodeType===3?o.data.includes(zn)&&t.push(o):n(o)};n(e);for(let r of t){let o=r.data.split(zn),i=[];for(let s=0;s<o.length;s++)s%2?i.push(document.createComment(`${N}${o[s]}`)):o[s]&&i.push(document.createTextNode(o[s]));r.replaceWith(...i)}}function vd(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(x,"");let o=t.length;r.setAttribute(`data-${N}${o}`,""),t.push({kind:"slot",path:[]})}}function xd(e,t){let n=[],r=[];function o(i){for(let s=0;s<i.childNodes.length;s++){let a=i.childNodes[s];if(n.push(s),a.nodeType===8){let c=a.data;if(c.startsWith(N)){let l=Number(c.slice(N.length));t[l]&&t[l].kind==="child"&&(t[l].path=n.slice())}}else if(a.nodeType===1){let c=a,l=[],u=[];for(let f of c.attributes)if(f.name.startsWith(`data-${N}`)){let d=Number(f.name.slice(`data-${N}`.length));t[d]&&t[d].kind!=="child"&&(t[d].path=n.slice(),u.push({idx:d,kind:t[d].kind,name:t[d].name||""})),l.push(f.name)}if(c.localName==="form"||c.localName==="button"||c.localName==="input"){let f=Ed(c,u,t);f&&r.push(f)}for(let f of l)c.removeAttribute(f);o(a)}n.pop()}}return o(e),r.length?r:null}function Ed(e,t,n){let r=e.localName==="form",o=r?"action":"formaction",i=r?"method":"formmethod",s=r?"enctype":"formenctype",a=t.filter(m=>m.kind==="attr"&&m.name.toLowerCase()===o);if(!a.length)return null;let c=[],l=[],u=[],f=r?[]:t.filter(m=>m.name.toLowerCase()==="name"&&(m.kind==="attr"||m.kind==="attr-mixed"||m.kind==="bool")).map(m=>({i:m.idx,kind:m.kind})),d=!r&&e.hasAttribute("name"),p=!r&&e.hasAttribute("form"),h=!r&&e.hasAttribute("value"),b=r?[]:t.filter(m=>m.name.toLowerCase()==="value"&&(m.kind==="attr"||m.kind==="attr-mixed"||m.kind==="bool")).map(m=>({i:m.idx,kind:m.kind}));for(let m of t){let g=String(m.name).toLowerCase();if(m.kind==="prop"){r?(g==="method"||g==="enctype"||g==="encoding")&&u.push(m.name):Ei(g)&&u.push(m.name);continue}if(g!==i&&g!==s||m.kind!=="attr"&&m.kind!=="attr-mixed"&&m.kind!=="bool")continue;let w=n[m.idx],S={i:m.idx,kind:m.kind};m.kind==="attr-mixed"&&(S.statics=w.statics||[],S.group=w.group||[]),(g===i?c:l).push(S)}return{isForm:r,tag:e.localName,actionIdxs:a.map(m=>m.idx),duplicateAction:a.length>1,staticAction:e.getAttribute(o)!=null,authoredName:d,authoredValue:h,authoredForm:p,propAttrs:u,nameParts:f,valueParts:b,staticMethod:e.getAttribute(i),staticEnctype:e.getAttribute(s),methodParts:c,enctypeParts:l}}Qe();var lo=new WeakSet;function Pc(e,t,n){if(e.nodeType!==1||!Je(e))return null;let r=D(e),o=new Set;for(let l of n)(l.kind==="attr"||l.kind==="attr-mixed"||l.kind==="bool")&&l.name==="name"&&o.add(l.el);let i=new Map,s=new Set,a=[],c=[];for(let l of n){if(l.kind!=="slot")continue;let u=l.slotEl;if(o.has(u))continue;let f=r.assignedByName.get(W(u.getAttribute("name")));if(!f||f.length===0)continue;let d=f[0].parentNode;if(!d||d.nodeType!==1||d.localName!=="slot"||s.has(d)||d.getAttribute(O)!==H||!Td(d.childNodes,f))continue;let p=jc(u,t),h=jc(d,e);if(!p||!h||p.length!==h.length)continue;let b=!0;for(let m=0;m<p.length&&b;m++){let g=p[m],w=h[m],S=g.localName;if(S!==w.localName||S.includes("-")||S==="form")b=!1;else{let y=i.get(g);(y?y!==w:s.has(w))&&(b=!1)}}if(b){i.set(u,d),s.add(d),a.push([u,d]);for(let m=0;m<p.length;m++)i.has(p[m])||(i.set(p[m],h[m]),s.add(h[m]),c.push([p[m],h[m]]))}}if(a.length===0)return null;for(let l of[t,...c.map(([u])=>u)]){let u=null;for(let f of l.childNodes){let d=i.get(f);if(d){if(u&&!(u.compareDocumentPosition(d)&Node.DOCUMENT_POSITION_FOLLOWING))return null;u=d}}}return{map:i,slots:a,chains:c}}function Ic(e,t){let n=new Map;for(let r of t){if(r.kind==="slot"){let i=e.map.get(r.slotEl);i&&(r.slotEl=i);continue}if(!r.el)continue;let o=e.map.get(r.el);if(o&&(r.kind==="event"&&r.handler&&(r.el.removeEventListener(r.name,r.dispatcher,r.handler),o.addEventListener(r.name,r.dispatcher,r.handler)),r.el=o,r.kind==="attr"||r.kind==="attr-mixed"||r.kind==="bool")){let i=n.get(o);i||n.set(o,i=new Set),i.add(r.name)}}for(let[r,o]of[...e.chains,...e.slots]){let i=o.localName==="slot",s=n.get(o);for(let a of Array.from(o.attributes))r.hasAttribute(a.name)||s?.has(a.name)||i&&(a.name===O||a.name===Hn)||o.removeAttribute(a.name);for(let a of Array.from(r.attributes))o.getAttribute(a.name)!==a.value&&o.setAttribute(a.name,a.value)}}function Mc(e,t,n){let r=i=>e.map.get(i)||i,o=D(t);for(let[i,s]of e.chains)Lc(s,Array.from(i.childNodes,r));Lc(t,n.map(r));for(let[i,s]of e.slots){let a=document.createDocumentFragment();for(;i.firstChild;)a.appendChild(i.firstChild);s[Se]=a,lo.add(s),o.lastSnapshot.delete(s)}}function Lc(e,t){let n=new Set(t);for(let o of Array.from(e.childNodes))n.has(o)||e.removeChild(o);let r=e.firstChild;for(let o of t){if(o===r){r=r.nextSibling;continue}e.insertBefore(o,r)}}function jc(e,t){let n=[],r=e.parentNode;for(;r&&r!==t;){if(r.nodeType!==1)return null;n.push(r),r=r.parentNode}return r===t?n:null}function Td(e,t){if(e.length!==t.length)return!1;for(let n=0;n<t.length;n++)if(e[n]!==t[n])return!1;return!0}We();ze();var Et=Object.freeze({ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6});function Tt(e){return!!e&&typeof e=="object"&&e._$webjs==="directive"}var de=null,et=!1,nn=0,tn=null,cs=0,Dc=(e,t)=>Object.is(e,t),fo=()=>{},$c=()=>!1;function Fc(e,t){e.liveConsumers||(e.liveConsumers=new Map);let n=e.liveConsumers.size===0;if(e.liveConsumers.set(t,(e.liveConsumers.get(t)||0)+1),n){if(e.producers&&e.producers.length>0)for(let r of e.producers)Fc(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function Gn(e,t){if(!e.liveConsumers)return;let n=e.liveConsumers.get(t);if(n!==void 0){if(n>1){e.liveConsumers.set(t,n-1);return}if(e.liveConsumers.delete(t),e.liveConsumers.size===0){if(e.producers&&e.producers.length>0)for(let r of e.producers)Gn(r,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(r){console.error(r)}}}}function hs(e){if(et)throw new Error("Signal read during notification phase");if(de===null)return;let t=de,n=t.nextProducerIndex++;n<t.producers.length&&t.producers[n]!==e&&fs(t)&&Gn(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,fs(t)&&Fc(e,t)),t.producerLastReadVersions[n]=e.version}function fs(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function Hc(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=et;et=!0;try{for(let n of e.liveConsumers.keys())n.dirty||kd(n)}finally{et=t}}function kd(e){e.dirty=!0,Hc(e),e.consumerMarkedDirty.call(e.wrapper||e)}function po(e){if(!(!e.dirty&&e.lastCleanEpoch===nn)){if(!e.producerMustRecompute()&&!Cd(e)){e.dirty=!1,e.lastCleanEpoch=nn;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=nn}}function Cd(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(po(n),r!==n.version))return!0}return!1}function ds(e){e&&(e.nextProducerIndex=0);let t=de;return de=e,t}function ps(e,t){if(de=t,!!e){if(fs(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)Gn(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var ho=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=nn,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=$c,this.producerRecomputeValue=fo,this.consumerMarkedDirty=fo,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||Dc,this.watched=n?.[ms],this.unwatched=n?.[bs]}get(){return hs(this),this.__value}peek(){return this.__value}set(t){if(et)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,nn++,tn!==null?Bc(this):Hc(this))}};function Bc(e){let t=et;et=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers.keys())n.dirty||(n.dirty=!0,n.__isWatcher?tn.add(n):Bc(n))}finally{et=t}}var ls=Symbol("unset"),us=Symbol("computing"),uo=Symbol("errored"),Jn=class{constructor(t,n){this.__fn=t,this.__value=ls,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||Dc,this.watched=n?.[ms],this.unwatched=n?.[bs];let r=this;this.producerMustRecompute=function(){return r.__value===ls||r.__value===us},this.producerRecomputeValue=function(){if(r.__value===us)throw new Error("Detected cycle in computations.");let o=r.__value;r.__value=us;let i=ds(r),s,a=!1;try{s=r.__fn.call(r.wrapper)}catch(l){s=uo,r.__error=l,a=!0}finally{ps(r,i)}if(!a&&(o!==ls&&o!==uo)&&r.__equal.call(r.wrapper,o,s)){r.__value=o;return}r.__value=s,r.version++},this.consumerMarkedDirty=fo}get(){if(po(this),hs(this),this.__value===uo)throw this.__error;return this.__value}peek(){if(po(this),this.__value===uo)throw this.__error;return this.__value}},mo=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=nn,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=$c,this.producerRecomputeValue=fo,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=ds(this);try{for(let r of t)hs(r),r.__isComputed&&po(r)}finally{ps(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(Gn(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=ds(this),r;try{r=t()}finally{ps(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)Gn(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},ms=Symbol("watched"),bs=Symbol("unwatched");function Nd(e){let t=de;de=null;try{return e()}finally{de=t}}function Rd(e){return e.producers.slice()}function Od(e){return e.liveConsumers?[...e.liveConsumers.keys()]:[]}function Ld(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function jd(e){return e.producers.length>0}function Pd(){return de&&de.__isComputed?de:null}function Id(e){cs++,tn===null&&(tn=new Set);try{e()}finally{if(cs--,cs===0){let t=tn;tn=null;for(let n of t)n.__fire()}}}var pe={State:ho,Computed:Jn,subtle:{Watcher:mo,untrack:Nd,introspectSources:Rd,introspectSinks:Od,hasSinks:Ld,hasSources:jd,currentComputed:Pd,watched:ms,unwatched:bs}};function Md(e,t){return new ho(e,t)}function Dd(e,t){return new Jn(e,t)}function Yn(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function $d(e){let t=!1,n=!1,r=new Jn(e),o=new mo(()=>{t||n||(t=!0,queueMicrotask(()=>{if(t=!1,!n){try{r.get()}catch(i){console.error(i)}o.watch()}}))});o.watch(r);try{r.get()}catch(i){console.error(i)}return()=>{n||(n=!0,o.dispose())}}function Fd(e){return e}Qe();In();var K;function Ss(e){K=e}var L=null;function As(e){L=e}var bo=null;function Kc(e){return e&&e.nodeType===11&&!e.host&&e!==L?bo??L??e:e}function Vc(e,t){let n=e&&e[v]?e:null;return n?At(n,t):t()}function cn(e){return e?e.nodeType===11&&e.host?e.host:e:null}function Qn(e,t){let n=e.__commitOwner,r=L,o=K;K=e.__eventHost,n&&(L=n);try{t()}finally{L=r}}function er(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,__eventHost:K};let r=n;if(e.kind==="event"){let o={kind:"event",el:r,name:e.name||"",handler:null,eventHost:K,dispatcher(i){typeof o.handler=="function"?o.handler.call(o.eventHost??o.el,i):o.handler?.handleEvent(i)}};return 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,refHost:K};if(e.kind==="slot")return{kind:"slot",slotEl:r,applied:!1};throw new Error(`unknown part kind ${e.kind}`)}var ws=Symbol.for("webjs.asyncDirectives");function Hd(e,t){let n={host:e.__eventHost??e.eventHost??K};switch(e.kind){case"child":return{type:Et.CHILD,options:n,get parentNode(){return Kc(e.marker.parentNode)},get endNode(){return e.marker},get startNode(){let r=e.child,o=r&&(r.startNode||(Array.isArray(r)?r[0]:void 0));return o?o.previousSibling:e.marker.previousSibling}};case"attr":case"attr-mixed":return{type:Et.ATTRIBUTE,options:n,element:e.el,name:e.name,tagName:e.el.tagName,strings:e.kind==="attr-mixed"?e.statics:void 0,piece:t};case"prop":return{type:Et.PROPERTY,options:n,element:e.el,name:e.name,tagName:e.el.tagName};case"bool":return{type:Et.BOOLEAN_ATTRIBUTE,options:n,element:e.el,name:e.name,tagName:e.el.tagName};case"event":return{type:Et.EVENT,options:n,element:e.el,name:e.name,tagName:e.el.tagName};default:return{type:Et.ELEMENT,options:n,element:e.el}}}function go(e){for(let t=e;t;t=t.child)if(t.released=!0,typeof t.inst._$webjsSetConnected=="function"){t.inst._$webjsCommit=void 0;try{t.inst._$webjsSetConnected(!1)}catch(n){console.error("[webjs] an async directive's disconnected() threw:",n)}t.host?.[ws]?.delete(t)}}function Bd(e,t){if(!e||typeof e.addController!="function")return;let n=e[ws];if(!n){let r=n=e[ws]=new Set;e.addController({hostConnected(){for(let o of[...r])o.inst._$webjsSetConnected(!0)},hostDisconnected(){for(let o of[...r])o.inst._$webjsSetConnected(!1)}})}n.add(t),t.host=e}function Zn(e,t,n,r,o,i,s){if(e.__settingValue)return r;let a=t,c=n,l=0;for(;Tt(r);){if(++l>100)throw new Error("[webjs] a custom directive kept returning directives (more than 100 levels deep).");let u=r,f=a[c];if(!f||f.ctor!==u.ctor){f&&go(f);let d=Hd(e,s),p=d,h=new u.ctor({type:p.type,name:p.name,tagName:p.tagName,strings:p.strings});if(f=a[c]={ctor:u.ctor,inst:h,facade:d,child:void 0,host:void 0,released:!1},typeof h._$webjsSetConnected=="function"){L&&(e.__commitOwner=cn(L)),e.kind!=="child"&&(e.__eventHost??=K);let b=f;L?.[vs]&&(h.isConnected=!1);let m=e.__eventHost??K;m&&m.isConnected===!1&&typeof m.addController=="function"&&(h.isConnected=!1),h._$webjsCommit=g=>{if(!b.released)try{Qn(e,()=>{let w=Zn(e,b,"child",g,o,!0,s);w!==A&&o(w)})}catch(w){tr(e,w)}},Bd(e.__eventHost??K,f)}}r=f.inst.update(f.facade,u.values),a=f,c="child"}return a[c]&&r!==A&&(l>0||i)&&(go(a[c]),a[c]=void 0),r}var vs=Symbol("webjs.rootDisconnected");function Xn(e,t){if(!(!e||!e.bound))for(let n of e.bound)zc(n,t)}function zc(e,t){let n=o=>{for(let i=o;i;i=i.child)typeof i.inst._$webjsSetConnected=="function"&&i.inst._$webjsSetConnected(t)};if(n(e.__directive),e.__pieceDirectives)for(let o of Object.keys(e.__pieceDirectives))n(e.__pieceDirectives[o]);let r=e.kind==="child"?e.child:null;if(r)if(r.kind==="repeat")for(let o of r.map.values())Xn(o,t);else if(r.kind==="array")for(let o of r.items)o.type==="tpl"?Xn(o.inst,t):o.type==="part"&&zc(o.sub,t);else"strings"in r&&Xn(r,t)}function xs(e){if(e.__sigSub&&ks(e),e.__watchSub&&Cs(e),e.__directive&&(go(e.__directive),e.__directive=void 0),e.__pieceDirectives){for(let t of Object.keys(e.__pieceDirectives))go(e.__pieceDirectives[t]);e.__pieceDirectives=void 0}e.kind==="child"&&e.child&&Ud(e.child)}function Ud(e){if(e){if(e.kind==="repeat"){for(let t of e.map.values())rn(t);return}if(e.kind==="array"){for(let t of e.items)t.type==="tpl"?rn(t.inst):t.type==="part"&&xs(t.sub);return}"strings"in e&&rn(e)}}function rn(e){if(!(!e||!e.bound))for(let t of e.bound)xs(t)}function qd(e){return mt(e)||bt(e)||yt(e)||fe(e)}var ys=new WeakMap;function Gc(e,t,n){let r=c=>!!c&&typeof c.then=="function",o=e.findIndex(c=>!r(c)),i=o<0?e.length:o,s=o<0?{has:!1}:{has:!0,value:e[o]};for(let c=0;c<i;c++)if(ys.has(e[c])){s={has:!0,value:ys.get(e[c])},i=c;break}let a=i;for(let c=0;c<i;c++){let l=e[c];Promise.resolve(l).then(u=>{ys.set(l,u),!(!t()||c>=a)&&(a=c,n(u))},()=>{})}return s}function Jc(e,t){return e===void 0?!1:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&t.every((n,r)=>Object.is(n,e[r])):Object.is(e,t)}function Wd(e,t,n,r,o){let i=e.__pieceGuardDeps??=[],s=e.__pieceUntil??=[];if(s[t]=null,bt(n)){let l=n.deps;if(Jc(i[t],l))return r[t]??"";i[t]=l,n=n.fn()}else i[t]=void 0;for(;mt(n)||yt(n);)n=n.value;if(!Jt(n))return n;let a={};s[t]=a;let c=Gc(n.args,()=>s[t]===a,l=>{if(l===R){e.el.removeAttribute(e.name);return}Gt(l,e.name,e.el.localName),r[t]=String(l??"");let u=o.statics[0];for(let f=0;f<o.group.length;f++)u+=(r[f]??"")+(o.statics[f+1]||"");e.el.setAttribute(e.name,u)});return c.has?c.value:r[t]??""}function X(e,t,n,r,o){if(t===A&&e.kind!=="attr-mixed"||e.kind!=="child"&&e.kind!=="attr-mixed"&&e.kind!=="slot"&&e.kind!=="noop"&&(e.__directive||Tt(t))&&(t=Zn(e,e,"__directive",t,s=>{let a=e;a.__settingValue=!0;try{X(e,s,void 0,void 0,o)}finally{a.__settingValue=!1}},!0),t===A))return;let i=e;if((e.kind==="attr"||e.kind==="bool"||e.kind==="attr-mixed")&&!i.__applyingSignal){if(e.kind==="attr-mixed"?e.group.some(a=>gs(r?r[a]:t)):gs(t)){op(e,()=>{i.__applyingSignal=!0;try{X(e,e.kind==="attr-mixed"?t:Wc(t),n,r,o)}finally{i.__applyingSignal=!1}});return}i.__sigSub&&ks(i)}if(bc(t)){yc(e,t);return}if(e.__mapKind=void 0,e.kind==="attr"||e.kind==="prop"||e.kind==="bool"||e.kind==="event"){if(!i.__untilApplying)if(i.__attrUntil=null,bt(t)){let s=t.deps;if(Jc(i.__attrGuardDeps,s))return;i.__attrGuardDeps=s,t=t.fn()}else i.__attrGuardDeps=void 0;for(;mt(t)||yt(t);)t=t.value;if(Jt(t)){let s={};i.__attrUntil=s;let a=Gc(t.args,()=>i.__attrUntil===s,c=>{i.__untilApplying=!0;try{X(e,c,void 0,r,o)}finally{i.__untilApplying=!1}});if(!a.has)return;t=a.value}}if(fe(t)){let s=t.value;if(s===A||e.kind==="prop"&&e.el[e.name]===s||e.kind==="attr"&&e.el.getAttribute(e.name)===String(s)||e.kind==="bool"&&e.el.hasAttribute(e.name)===!!s)return;t=s}switch(e.kind){case"child":Es(e,t,o);break;case"attr":{let s=Pn(e.name,t);s===null?e.el.removeAttribute(e.name):Xr(t,e.name,e.el.localName)||(Gt(t,e.name,e.el.localName),e.el.setAttribute(e.name,s));break}case"prop":ac(t,e.name,e.el.localName),e.el[e.name]=t===R?void 0:t;break;case"bool":Gt(t,e.name,e.el.localName),t&&t!==R?e.el.setAttribute(e.name,""):e.el.removeAttribute(e.name);break;case"event":{let s=e.handler,a=t==null||t===R?null:t,c=s?.capture!==a?.capture||s?.once!==a?.once||s?.passive!==a?.passive;s&&(!a||c)&&e.el.removeEventListener(e.name,e.dispatcher,s),a&&(!s||c)&&e.el.addEventListener(e.name,e.dispatcher,a),e.handler=a}break;case"element":Vd(e,t);break;case"attr-mixed":{let s=e,a=s.statics[0],c=e.__pieces??=[];if(s.group.length===1&&!s.statics[0]&&!s.statics[1]&&!c.length&&(r?r[s.group[0]]:t)===A)break;let l=!1;for(let u=0;u<s.group.length;u++){let f=r?r[s.group[u]]:t,d=e.__pieceDirectives;if(Tt(f)||d&&d[u]){let p=e.__pieceDirectives??={},h=u;f=Zn(e,p,String(u),f,b=>{if(b===A)return;if(b===R){e.el.removeAttribute(e.name);return}c[h]=String(b??"");let m=s.statics[0];for(let g=0;g<s.group.length;g++)m+=(c[g]??"")+(s.statics[g+1]||"");e.el.setAttribute(e.name,m)},!0,u)}if(gs(f)&&(f=Wc(f)),f===A&&(f=c[u]??""),fe(f)&&(f=f.value,l=!0,f===A&&(f=c[u]??"")),f=Wd(e,u,f,c,s),Gt(f,e.name,e.el.localName),f===R){e.el.removeAttribute(e.name);return}c[u]=String(f??""),a+=c[u],a+=s.statics[u+1]||""}if(l&&e.el.getAttribute(e.name)===a)break;e.el.setAttribute(e.name,a);break}case"slot":{if(e.applied)break;let s=e.slotEl,a=()=>{let l=sn(s);if(!l){e.applied=!0;return}if(!l.contains(s)){l.isConnected?queueMicrotask(a):e.applied=!0;return}if(e.applied=!0,!Kd(s)){if(lo.has(s))lo.delete(s);else{let u=document.createDocumentFragment();for(;s.firstChild;)u.appendChild(s.firstChild);s[Se]=u}queueMicrotask(()=>Q(l))}},c=sn(s);c&&c.contains(s)?a():queueMicrotask(a);break}case"noop":break}}function sn(e){let t=e[gt];if(t&&t.isConnected)return t;let n=e.parentElement;for(;n;){if(n[v])return n;n=n.parentElement}return null}function Kd(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 Vd(e,t){let n=e,r=Qr(t)?t.target:void 0,o=n.__refTarget,i=r!==o;if(i&&o)if(typeof o=="function")try{o.call(n.refHost,void 0)}catch{}else typeof o=="object"&&(o.value=void 0);if(i||n.__refElement!==e.el){if(n.__refTarget=r,r)if(typeof r=="function"){if(!i&&n.__refElement!==void 0)try{r.call(n.refHost,void 0)}catch{}try{r.call(n.refHost,e.el)}catch{}}else typeof r=="object"&&(r.value=e.el);n.__refElement=e.el,e.lastTarget=r}}function Es(e,t,n){if(!(t===A||(e.__directive||Tt(t))&&(t=Zn(e,e,"__directive",t,o=>ie(e,o,n),!qd(t)),t===A)))return tp(e,t),ie(e,t,n)}function ie(e,t,n){let r=K;K=e.__eventHost;let o=bo;bo=Kc(e.marker&&e.marker.parentNode);try{return Vc(e.marker&&e.marker.parentNode,()=>Yc(e,t,n))}finally{K=r,bo=o}}function Yc(e,t,n){let r=e.marker;if(Tt(t)&&(t=Zn(e,e,"__directive",t,i=>ie(e,i,n),!1),t===A))return;if(fe(t))return Yc(e,t.value,n);if(Ni(t)){let i=String(t.value??""),s=t.ns,a=e.__unsafeCommitted;if(a&&a.str===i&&a.ns===s&&e.child===a.nodes)return;Pe(e);let c=document.createElement("template"),l=s==="svg"?"svg":s==="mathml"?"math":null;if(c.innerHTML=l?`<${l}>${i}</${l}>`:i,l){let d=c.content.firstChild;d.replaceWith(...d.childNodes)}let u=[...c.content.childNodes],f=document.createDocumentFragment();for(let d of u)f.appendChild(d);r.parentNode?.insertBefore(f,r),e.child=u,e.__unsafeCommitted={str:i,ns:s,nodes:u};return}if(mt(t)){let i=t,s=e.__keyedKey;s!==void 0&&!Object.is(s,i.key)&&Pe(e),e.__keyedKey=i.key,ie(e,i.value,n);return}if(bt(t)){let i=t,s=e.__guardDeps,a=i.deps;if(s!==void 0&&(Array.isArray(s)&&Array.isArray(a)?ep(s,a):Object.is(s,a)))return;let c=Array.isArray(a)?a.slice():a;ie(e,i.fn(),n),e.__guardDeps=c;return}if(Ri(t)){Pe(e);let i=t.template;if(i&&i.content){let s=document.importNode(i.content,!0),a=[...s.childNodes];r.parentNode?.insertBefore(s,r),e.child=a}return}if(Qr(t))return;if(yt(t))return np(e,t.value,n);if(Jt(t))return rp(e,t.args,n);if(Yt(t))return qc(e,t.signal,n);if(Yn(t))return qc(e,t,n);if(Oi(t))return ip(e,t,n);if(Li(t))return sp(e,t,n);if(Zr(t)){if(e.child&&e.child.kind==="repeat"){Jd(e,t,n);return}Pe(e);let i={kind:"repeat",map:new Map};e.child=i,Gd(r,i,t,n);return}if(t!==null&&typeof t=="object"&&!Array.isArray(t)&&!on(t)&&typeof t[Symbol.iterator]=="function"&&(t=Array.from(t)),Array.isArray(t)){if(e.child&&e.child.kind==="array"){Zd(e,t,n);return}Pe(e);let i={kind:"array",items:[]};e.child=i,Xd(r,i,t,n);return}if(on(t)&&Array.isArray(e.child)&&e.child.length===1&&e.child[0]===t)return;if(e.child){let i=e.child;if(i.kind==="repeat")Zc(i),e.child=void 0;else if(i.kind==="array")tl(i),e.child=void 0;else if(i.kind==="async-stream")ol(i),e.child=void 0;else if("strings"in e.child){let s=e.child;if(F(t)&&s.strings===t.strings){kt(s,t.values,n);return}an(s),Ct(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===R||t===A||t==="")return;if(F(t)){let i=t,{templateEl:s,parts:a,formActions:c}=en(i),l=document.importNode(s.content,!0),u=document.createComment(`${N}s`),f=document.createComment(`${N}e`),d=a.map(b=>er(b,l)),p=[];for(let b=0;b<i.values.length;b++)X(d[b],i.values[b],void 0,i.values,n),p.push(i.values[b]);n&&n(c,d,i.values);let h=[u,...l.childNodes,f];r.parentNode?.insertBefore(zd(h),r);for(let b of d)b.kind==="slot"&&X(b,void 0,void 0,[],n);e.child={strings:i.strings,bound:d,lastValues:p,startNode:u,endNode:f};return}let o=on(t)?t:document.createTextNode(String(t));r.parentNode?.insertBefore(o,r),e.child=[o]}function on(e){return e!==null&&typeof e=="object"&&typeof e.nodeType=="number"&&typeof e.cloneNode=="function"}function kt(e,t,n){t=t.map((o,i)=>o===A?e.lastValues[i]:o);let r=null;for(let o=0;o<t.length;o++){let i=t[o];if(Object.is(i,e.lastValues[o])&&!Tt(i))continue;let s=e.bound[o],a=s.kind==="attr-mixed"?o:s.mixedAnchor;if(a!=null){if(r?.has(a)){e.lastValues[o]=i;continue}(r??=new Set).add(a)}let c=s.mixedAnchor;try{s.kind==="noop"&&c!=null?X(e.bound[c],t[c],e.lastValues[c],t,n):X(s,i,e.lastValues[o],t,n)}catch(l){throw e.lastValues[o]=Uc,s.kind==="noop"&&c!=null&&(e.lastValues[c]=Uc),l}e.lastValues[o]=i}n&&n(ao.get(e.strings)?.formActions??null,e.bound,t)}var Uc=Symbol("webjs.commitFailed");function Ct(e,t){let n=e.parentNode;if(!n)return;let r=e;for(;r&&r!==t;){let o=r.nextSibling;r.parentNode?.removeChild(r),r=o}t.parentNode===n&&n.removeChild(t)}function zd(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function Ts(e,t){let{templateEl:n,parts:r,formActions:o}=en(e),i=document.importNode(n.content,!0),s=document.createComment(`${N}s`),a=document.createComment(`${N}e`),c=r.map(f=>er(f,i)),l=[];for(let f=0;f<e.values.length;f++)X(c[f],e.values[f],void 0,e.values,t),l.push(e.values[f]);t&&t(o,c,e.values);for(let f of c)f.kind==="slot"&&X(f,void 0,void 0,[],t);let u=document.createDocumentFragment();for(u.appendChild(s);i.firstChild;)u.appendChild(i.firstChild);return u.appendChild(a),{inst:{strings:e.strings,bound:c,lastValues:l,startNode:s,endNode:a},frag:u}}function an(e){rn(e);for(let t of e.bound)if(t.kind==="event"&&t.el.removeEventListener(t.name,t.dispatcher,t.handler),t.kind==="element"){let n=t.lastTarget;if(n){if(typeof n=="function")try{n.call(t.refHost,void 0)}catch{}else if(typeof n=="object")try{n.value=void 0}catch{}t.lastTarget=void 0,t.__lastEl=void 0}}}function Gd(e,t,n,r){let{items:o,keyFn:i,templateFn:s}=n,a=e.parentNode;if(!a)return;let c=document.createDocumentFragment(),l=new Map;for(let u=0;u<o.length;u++){let f=Xc(t,i(o[u],u),l),d=s(o[u],u);if(!F(d))continue;let{inst:p,frag:h}=Ts(d,r);t.map.set(f,p),c.appendChild(h)}a.insertBefore(c,e)}function Xc(e,t,n){let r=n.get(t)??0;if(n.set(t,r+1),r===0)return t;let o=e.dups??=new Map,i=o.get(t);return i||o.set(t,i=[]),i[r-1]??={duplicateOf:t,n:r}}function Jd(e,t,n){let r=e.marker,o=r.parentNode;if(!o)return;let i=e.child,{items:s,keyFn:a,templateFn:c}=t,l=new Map,u=new Map;try{for(let f=0;f<s.length;f++){let d=Xc(i,a(s[f],f),u),p=c(s[f],f);if(!F(p))continue;let h=i.map.get(d);if(h&&h.strings===p.strings)kt(h,p.values,n),_s(h.startNode,h.endNode,o,r),l.set(d,h),i.map.delete(d);else{h&&(i.map.delete(d),an(h),Ct(h.startNode,h.endNode));let{inst:b,frag:m}=Ts(p,n);o.insertBefore(m,r),l.set(d,b)}}for(let[f,d]of[...i.map]){i.map.delete(f);try{an(d)}finally{Ct(d.startNode,d.endNode)}}i.map=l}catch(f){for(let[d,p]of l)i.map.set(d,p);throw f}}function Zc(e){for(let[t,n]of[...e.map]){e.map.delete(t);try{an(n)}finally{Ct(n.startNode,n.endNode)}}e.map.clear()}function Yd(e){return e.type==="part"?e.start:e.type==="tpl"?e.inst.startNode:e.type==="text"||e.type==="node"?e.node:null}function yo(e){e.type==="part"?(xs(e.sub),Pe(e.sub),Ct(e.start,e.sub.marker)):e.type==="tpl"?(an(e.inst),Ct(e.inst.startNode,e.inst.endNode)):(e.type==="text"||e.type==="node")&&e.node.parentNode?.removeChild(e.node)}function Qc(e,t){if(fe(e)&&(e=e.value),el(e)){let n=document.createComment(""),r=document.createComment(""),o=document.createDocumentFragment();o.append(n,r);let i={kind:"child",marker:r,__eventHost:K};return{item:{type:"part",start:n,sub:i},frag:o,fill:()=>Es(i,e,t)}}if(F(e)){let{inst:n,frag:r}=Ts(e,t);return{item:{type:"tpl",inst:n},frag:r}}if(on(e))return{item:{type:"node",node:e},frag:e};if(e!=null&&e!==R&&e!==A&&e!==""){let n=document.createTextNode(String(e));return{item:{type:"text",node:n},frag:n}}return{item:{type:"empty"},frag:null}}function Xd(e,t,n,r){let o=e.parentNode;if(!o)return;let i=document.createDocumentFragment(),s=[],a=[];for(let c of n){let{item:l,frag:u,fill:f}=Qc(c,r);u&&i.appendChild(u),f&&a.push(f),s.push(l)}o.insertBefore(i,e),t.items=s;for(let c of a)c()}function el(e){return e!==null&&typeof e=="object"&&!F(e)&&!on(e)}function Zd(e,t,n){let r=e.marker,o=r.parentNode;if(!o)return;let i=e.child,s=i.items,a=[],c=0;try{for(let l=0;l<t.length;l++){let u=t[l],f=fe(u)?u.value:u,d=s[l];if(el(f)){if(d&&d.type==="part"){Es(d.sub,f,n),a.push(d),c=l+1;continue}}else if(F(f)){let m=f;if(d&&d.type==="tpl"&&d.inst.strings===m.strings){kt(d.inst,m.values,n),a.push(d),c=l+1;continue}}else if(on(f)){if(d&&d.type==="node"&&d.node===f){a.push(d),c=l+1;continue}}else if(f!=null&&f!==R&&f!==A&&f!==""){if(d&&d.type==="text"){let m=String(f);d.node.data!==m&&(d.node.data=m),a.push(d),c=l+1;continue}}else{d&&yo(d),a.push({type:"empty"}),c=l+1;continue}let{item:p,frag:h,fill:b}=Qc(f,n);h&&o.insertBefore(h,Qd(s,l,r)),a.push(p),b&&b(),d&&yo(d),c=l+1}for(let l=t.length;l<s.length;l++)yo(s[l]),c=l+1;i.items=a}catch(l){throw i.items=a.concat(s.slice(c)),l}}function Qd(e,t,n){for(let r=t;r<e.length;r++){let o=Yd(e[r]);if(o&&o.parentNode)return o}return n}function tl(e){for(let t of e.items)yo(t);e.items=[]}function _s(e,t,n,r){if(t.nextSibling===r&&e.parentNode===n)return;let o=document.createDocumentFragment(),i=e;for(;i;){let s=i.nextSibling;if(o.appendChild(i),i===t)break;i=s}n.insertBefore(o,r)}function ep(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 Pe(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&Cs(t),!e.child)return;let n=e.child;if(n.kind==="repeat")Zc(n);else if(n.kind==="array")tl(n);else if(n.kind==="async-stream")ol(n);else if("strings"in n){let r=e.child;an(r),Ct(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function tp(e,t){let n=e;n.__untilState&&!Jt(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!bt(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!yt(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!mt(t)&&(n.__keyedKey=void 0),n.__watchSub&&!Yt(t)&&!Yn(t)&&Cs(n)}function np(e,t,n){let r=e.marker,o=e,i=o.__cacheMap;i||(i=new Map,o.__cacheMap=i);let s=e.child;if(s&&"strings"in s){let c=s;if(F(t)&&c.strings===t.strings){kt(c,t.values,n);return}let l=document.createDocumentFragment();_s(c.startNode,c.endNode,l,null),i.set(c.strings,{inst:c,holder:l}),e.child=void 0}if(F(t)){let c=t,l=i.get(c.strings);if(l){i.delete(c.strings),e.child&&Pe(e),_s(l.inst.startNode,l.inst.endNode,r.parentNode,r),kt(l.inst,c.values,n),e.child=l.inst;let u=new Set;for(let f=l.inst.startNode.nextSibling;f&&f!==l.inst.endNode;f=f.nextSibling){if(f.nodeType!==1)continue;let d=f;if(d.matches("slot[data-webjs-light]")){let p=sn(d);p&&u.add(p)}for(let p of d.querySelectorAll("slot[data-webjs-light]")){let h=sn(p);h&&u.add(h)}}for(let f of u)Q(f);return}}ie(e,t,n)}function rp(e,t,n){let r=e;L&&(r.__commitOwner=cn(L));let o=r.__untilState,i=r.__untilArgs,s=(p,h)=>!!(Object.is(p,h)||F(p)&&F(h)&&p.strings===h.strings),c=i&&i.length===t.length&&i.every((p,h)=>s(p,t[h]))&&o?o.highestResolved:1/0;o&&(o.aborted=!0),r.__untilArgs=t.slice();let l={aborted:!1,highestResolved:c};r.__untilState=l;let u=-1,f;for(let p=0;p<t.length;p++){let h=t[p];if(!h||typeof h.then!="function"){u=p,f=h;break}}u!==-1&&u<=l.highestResolved?(ie(e,f,n),l.highestResolved=u):u===-1&&!r.__untilEverRendered&&ie(e,"",n),r.__untilEverRendered=!0;let d=Math.min(u===-1?t.length:u,l.highestResolved);for(let p=0;p<d;p++){let h=t[p];!h||typeof h.then!="function"||Promise.resolve(h).then(b=>{if(!l.aborted&&!(p>=l.highestResolved)){try{Qn(e,()=>ie(e,b,n))}catch(m){tr(e,m);return}l.highestResolved=p}},()=>{})}}function tr(e,t){let n;try{n=t instanceof Error?t:new Error(String(t))}catch{n=new Error("render error (unstringifiable thrown value)")}let r=e.__commitOwner;if(r&&typeof r._handleRenderError=="function"){r._handleRenderError(n);return}throw n}function qc(e,t,n){let r=e;if(L&&(r.__commitOwner=cn(L)),r.__watchSig===t&&r.__watchSub){let s;r.__watchSub.observe(()=>{s=t.get()}),ie(e,s,n);return}r.__watchSub&&(r.__watchSub.dispose(),r.__watchSub=void 0),r.__watchSig=t;let o=new pe.subtle.Watcher(()=>{queueMicrotask(()=>{if(r.__watchSub!==o)return;let s;try{o.observe(()=>{s=t.get()}),Qn(e,()=>ie(e,s,n))}catch(a){tr(e,a)}})});r.__watchSub=o;let i;o.observe(()=>{i=t.get()}),ie(e,i,n)}function op(e,t){ks(e),L&&(e.__commitOwner=cn(L));let n=new pe.subtle.Watcher(()=>{queueMicrotask(()=>{if(e.__sigSub===n)try{Qn(e,()=>n.observe(t))}catch(r){tr(e,r)}})});e.__sigSub=n,n.observe(t)}function gs(e){return Yn(e)||Yt(e)}function Wc(e){return Yt(e)?e.signal.get():e.get()}function ks(e){e.__sigSub&&(e.__sigSub.dispose(),e.__sigSub=void 0)}function Cs(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function ip(e,t,n){let r=e;L&&(r.__commitOwner=cn(L));let o=e.child;if(o&&o.kind==="async-stream"&&o.mode==="append"&&o.iterable===t.iterable)return;Pe(e);let i=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:i,nodes:[]};e.child=s,nl(s,e,t,n)}function sp(e,t,n){let r=e;L&&(r.__commitOwner=cn(L));let o=e.child;if(o&&o.kind==="async-stream"&&o.mode==="replace"&&o.iterable===t.iterable)return;Pe(e);let i=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:i,nodes:[]};e.child=s,nl(s,e,t,n)}async function nl(e,t,n,r){let o=t.marker,i=0;for(;!e.aborted;){let s,a;try{if(s=await e.iterator.next(),e.aborted||s.done)break;a=n.mapper?n.mapper(s.value,i):s.value}catch(c){typeof console<"u"&&console.error("[webjs] asyncStream error:",c);return}try{Qn(t,()=>{let c=rl(a,r);Vc(o.parentNode,()=>{if(e.mode==="replace"){for(let u of e.nodes)u.parentNode&&u.parentNode.removeChild(u);e.nodes=[]}let l=document.createDocumentFragment();for(let u of c)l.appendChild(u);o.parentNode?.insertBefore(l,o),e.nodes.push(...c)})})}catch(c){e.aborted=!0;try{e.iterator.return?.()?.catch?.(()=>{})}catch{}tr(t,c);return}i++}}function rl(e,t){if(fe(e)&&(e=e.value),e==null||e===R||e===A)return[];if(F(e)){let n=e,{templateEl:r,parts:o,formActions:i}=en(n),s=document.importNode(r.content,!0),a=o.map(c=>er(c,s));for(let c=0;c<n.values.length;c++)X(a[c],n.values[c],void 0,n.values,t);t&&t(i,a,n.values);for(let c of a)c.kind==="slot"&&X(c,void 0,void 0,[],t);return[...s.childNodes]}if(Array.isArray(e)){let n=[];for(let r of e)n.push(...rl(r,t));return n}return[document.createTextNode(String(e))]}function ol(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 ap=e=>bi`${e}`;function Rt(e,t,n={}){return lp(e,t,n),cp(t)}var il=new WeakMap;function cp(e){let t=il.get(e);return t||(t={setConnected(n){e[vs]=!n,Xn(e[Qt],n)}},il.set(e,t)),t}function lp(e,t,n){if(e===A)return;e!==null&&typeof e=="object"&&!F(e)&&(e=ap(e));let r=t,o=r[M];r[M]=!0;let i=K;Ss(n.host);let s=L;As(t);try{let a=r[Qt];if(F(e)){let c=e;if(a&&a.strings===c.strings){kt(a,c.values,_o);return}a&&sl(a,t);let l=t.firstChild,u=!!l&&l.nodeType===8&&l.data==="webjs-hydrate";u&&l.remove(),r[Qt]=null;let f=dp(c,t,u);r[Qt]=f;return}if(a&&sl(a,t),r[Qt]=null,t.replaceChildren(),e==null||e===R)return;t.appendChild(document.createTextNode(String(e)))}finally{As(s),Ss(i),r[M]=o,o||no(r)}}function _o(e,t,n){if(e)for(let r of[!0,!1])for(let o of e){if(o.isForm!==r)continue;let i=o.actionIdxs[0],s=o.isForm?"action":"formaction";for(let l of o.actionIdxs)if(Xr(Nt(n[l]),s,o.tag)){i=l;break}let a=t[i];if(!a||!a.el)continue;let c=Nt(n[i]);if(o.isForm)uc(a.el,c,wo(o.methodParts,o.staticMethod,n),wo(o.enctypeParts,o.staticEnctype,n),o);else{let l=u=>u.some(f=>f.kind==="bool"?!!Nt(n[f.i]):f.kind==="attr"?Pn("name",Nt(n[f.i]))!==null:!0);fp(a.el,c,o,l(o.nameParts),l(o.valueParts),wo(o.methodParts,o.staticMethod,n),wo(o.enctypeParts,o.staticEnctype,n))}}}function up(e){(co.has(e)||e.getAttribute("name")===z)&&(e.getAttribute("name")===z&&e.removeAttribute("name"),e.removeAttribute("value"),co.delete(e))}function fp(e,t,n,r,o,i,s){let a=typeof t=="function"?Yr(t):null;if(!a){typeof t=="function"&&Ti(null,e.localName,t),up(e),fc(e,i,s,n.propAttrs);return}ic(n.duplicateAction,e.localName),sc(n.propAttrs,e.localName),n.staticAction&&rc(e.localName),(n.authoredValue||o)&&nc(e.localName),(n.authoredName||r)&&ec(e.getAttribute("name")||z,e.localName,!1),(n.authoredForm||e.hasAttribute("form"))&&oc(e.localName),tc(e.localName,e.getAttribute("type"));let c=lc(e.localName,i,s);e.removeAttribute("formaction"),e.setAttribute("name",z),e.setAttribute("value",a),$n(e,"formmethod",i,c.formMethod),$n(e,"formenctype",s,c.formEnctype),co.set(e,a)}function wo(e,t,n){for(let r of e){if(r.kind==="bool")return Nt(n[r.i])?"":Z;if(r.kind==="attr"){let a=Pn("method",Nt(n[r.i]));return a===null?Z:a}let o=r.statics||[],i=r.group||[],s=o[0]||"";for(let a=0;a<i.length;a++)s+=String(Nt(n[i[a]])??""),s+=o[a+1]||"";return s}return t??Z}function Nt(e){return fe(e)?e.value:e}function dp(e,t,n=!1){let{templateEl:r,parts:o,formActions:i}=en(e),s=document.importNode(r.content,!0),a=document.createComment(`${N}s`),c=document.createComment(`${N}e`),l=o.map(p=>er(p,s)),u=n?Pc(t,s,l):null;u&&Ic(u,l);let f=[];for(let p=0;p<e.values.length;p++)X(l[p],e.values[p],void 0,e.values,_o),f.push(e.values[p]);_o(i,l,e.values),u?Mc(u,t,[a,...s.childNodes,c]):t.replaceChildren(a,...s.childNodes,c);let d=t.nodeType===1&&t[v]?t:null;for(let p of l)p.kind==="slot"&&(d&&p.slotEl&&(p.slotEl[gt]=d),X(p,void 0,void 0,[],_o));return{strings:e.strings,bound:l,lastValues:f,startNode:a,endNode:c}}function sl(e,t){rn(e);for(let n of e.bound){if(n.kind==="event"&&n.el.removeEventListener(n.name,n.dispatcher,n.handler),n.kind==="element"){let r=n.lastTarget;if(r){if(typeof r=="function")try{r.call(n.refHost,void 0)}catch{}else if(typeof r=="object")try{r.value=void 0}catch{}n.lastTarget=void 0,n.__lastEl=void 0}}if(n.kind==="slot"){let r=sn(n.slotEl);r&&ss(r,n.slotEl)}}t.replaceChildren()}function pp(e){return!!e&&e.state!==!0&&e.attribute!==!1}function fl(e,t,n){if(typeof e.converter=="function")return e.converter(t,e.type);if(e.converter&&e.converter.fromAttribute)return e.converter.fromAttribute(t,e.type);if(e.type===Number)return t==null?null:Number(t);if(e.type===Boolean)return t==="false"&&hp(e,n),t!=null;if(e.type===Object||e.type===Array){if(t==null)return null;try{return JSON.parse(t)}catch{return null}}return t}var al=new WeakSet;function hp(e,t){if(al.has(e))return;al.add(e);let n=t?`\`${String(t)}\``:"A Boolean property";console.warn(`[webjs] ${n} received the attribute value "false", which is TRUE: a Boolean property is on whenever its attribute is present, as in HTML and Lit. To turn it off, leave the attribute out, or bind it with ?attr=\${false} in a template.`)}function mp(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function So(e,t){if(pp(t)){if(typeof t.attribute=="string")return t.attribute;if(typeof e=="string")return e.toLowerCase()}}function dl(e,t){let n,r;for(let{propName:o,def:i,primary:s,alias:a}of bl(e))if(s===t){if(o===t)return{propName:o,def:i};n===void 0&&(n={propName:o,def:i})}else r===void 0&&a===t&&(r={propName:o,def:i});return n??r}function pl(e){let t=new Set,n=bl(e);for(let{primary:r}of n)t.add(r);for(let{alias:r}of n)r&&t.add(r);return[...t]}function nt(e){if(!e||typeof e!="function")return e&&e.properties||{};let t=cl.get(e);if(t&&t.epoch===tt)return t.merged;let n=Object.getPrototypeOf(e),r=n&&n!==Function.prototype?nt(n):bp,o=Ns.get(e)??0;if(t&&t.inherited===r&&t.version===o)return t.epoch=tt,t.merged;let i=Object.hasOwn(e,"properties")?e.properties:void 0,s=Rs.get(e),a=i&&typeof i=="object"?{...r,...i}:r;return s&&(a={...a,...s}),cl.set(e,{epoch:tt,inherited:r,version:o,merged:a}),a}var cl=new WeakMap,bp=Object.freeze({}),Ns=new WeakMap,tt=0;function hl(){return tt}var Rs=new WeakMap;function nr(e){return typeof e=="object"&&e!==null?e:{type:e}}function ml(e,t,n){let r=Rs.get(e);r||Rs.set(e,r={}),r[t]=n,yp(e)}function yp(e){Ns.set(e,(Ns.get(e)??0)+1),tt++}function bl(e){if(e&&typeof e=="function"){let t=ll.get(e);if(t&&t.epoch===tt)return t.built;let n=nt(e);if(t&&t.merged===n)return t.epoch=tt,t.built;let r=ul(e);return ll.set(e,{epoch:tt,merged:n,built:r}),r}return ul(e)}var ll=new WeakMap;function ul(e){let t=nt(e),n=[];for(let r of Reflect.ownKeys(t)){let o=nr(t[r]),i=So(r,o);if(i===void 0)continue;let s=typeof r=="string"?mp(r):i,a=typeof o.attribute!="string"&&s!==i?s:void 0;n.push({propName:r,def:o,primary:i,alias:a})}return n}var yl=null;function Ao(e){yl=e||null}function Os(){return yl||void 0}ze();var gl=Symbol.for("webjs:registry"),wl=Symbol.for("webjs:classToTag"),ln=globalThis,Ee=ln[gl]||(ln[gl]=new Map),Sl=ln[wl]||(ln[wl]=new WeakMap),_l=Symbol.for("webjs:registryVersion"),Al=ln[_l]||(ln[_l]={v:0}),vo=typeof window<"u"&&typeof customElements<"u";function Ls(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=Ee.get(e);r?(r.cls=t,r.lazy=n):(Ee.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),Al.v+=1),Sl.set(t,e)}if(vo){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){let o=customElements.get(t);if(!o)e(t,n,r);else if(o!==n){let i=$a();i&&(n=i(t,o,n))}Ls(t,n)}}if(!vo){let e=globalThis;e.customElements||(e.customElements={define(t,n){Ls(t,n)},get(t){return Ee.get(t)?.cls},upgrade(){},whenDefined(t){let n=Ee.get(t);return Promise.resolve(n?.cls)}})}function vl(e,t){typeof t.finalize=="function"&&t.finalize(),vo?customElements.define(e,t):Ls(e,t)}function gp(e,t){if(vo)return;let n=Ee.get(e);if(n){n.moduleUrl=t;return}Ee.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e}),Al.v+=1}function wp(e){return Ee.get(e)?.cls}function _p(e){return Ee.get(e)?.moduleUrl||null}function Sp(e){return Ee.get(e)?.lazy===!0}function Ie(e){return Sl.get(e)}function Ap(){return[...Ee.keys()]}zt();We();Qe();function vp(){return{states:new Set,shadowRoot:null,form:null,labels:[],role:"",willValidate:!0,validity:{},validationMessage:"",setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0}}}var rr=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 i=t.getAttribute(n(o));return i===null?void 0:i},set(r,o,i){return typeof o=="string"&&t.setAttribute(n(o),i),!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,i)=>i.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}get shadowRoot(){return null}attachShadow(){throw new Error("[webjs] attachShadow() was called during SSR, which has no DOM. Declare `static shadow = true` (and `static shadowRootOptions` for the attachShadow options) instead: the server writes the shadow root as Declarative Shadow DOM and the browser attaches it.")}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=vp(),this.__internals}},xp=["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 xp){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(rr.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}function xl(e,t){return!Object.is(e,t)}function El(e){try{return String(e)}catch{return Object.prototype.toString.call(e)}}function js(e,t,n){if(typeof console>"u"||!console.warn)return;let r=Ie(e.constructor)||e.tagName?.toLowerCase()||"unknown";console.warn(`[webjs] reflect:true property "${String(t)}" on <${r}> holds a function (or an array carrying one), which has no HTML attribute representation. Removing "${n}" instead of stringifying it (a stringified function writes its source into the page, so a server action's body would ship to the browser). Pass a string, or drop reflect on this property.`)}function Tl(e,t,n,r){if(typeof console>"u"||!console.warn)return;let o=Ie(e.constructor)||e.tagName?.toLowerCase()||"unknown";console.warn(`[webjs] reflect:true property "${String(t)}" on <${o}> holds a value JSON.stringify cannot serialize (a cycle, a BigInt, or a throwing toJSON), so it has no HTML attribute representation. Removing "${n}" instead. Detail: ${r}`)}function kl(e,t={}){return e&&typeof e=="object"&&!("call"in e)&&(t=e,e=void 0),{...e?{type:e}:{},...t}}var Ps=typeof window<"u"&&typeof HTMLElement<"u",Ep=Ps?HTMLElement:rr,Tp=Promise.resolve(!0),or=new Set,ir=new WeakMap,Cl=new WeakSet,Nl=new WeakMap,Is=new WeakSet,Rl=new WeakMap,Ol=new WeakSet,Ll=new WeakSet,kp=Object.freeze({type:String}),Ms=new WeakMap;function jl(e,t){for(let n=e.prototype;n&&n!==rt.prototype;n=Object.getPrototypeOf(n)){let r=Object.getOwnPropertyDescriptor(n,t);if(r)return r.set&&Ms.has(r.set)?Ms.get(r.set)??null:r.get||r.set?{get:r.get,set:r.set}:null}return null}function Cp(e,t){let n=[];for(let r of Reflect.ownKeys(t)){let o=t[r],i=nr(o),s=jl(e,r),a=!i.noAccessor&&s===null,c=Symbol(String(r));if(n.push({propName:r,decl:i,builtIn:a,wrapped:s!==null,key:c}),i.noAccessor)continue;let l=e.getPropertyDescriptor(r,c,i);l!==void 0&&Object.defineProperty(e.prototype,r,l)}ir.set(e,n);for(let r=Object.getPrototypeOf(e);r&&r!==Function.prototype;r=Object.getPrototypeOf(r))Is.add(r);return n}function Np(e){if(typeof e.attachInternals!="function")return null;let t;try{t=e.attachInternals()}catch{return null}return Object.defineProperty(e,"attachInternals",{value:()=>t,configurable:!0,writable:!0}),t.shadowRoot??null}var rt=class e extends Ep{static shadow=!1;static shadowRootOptions={mode:"open"};static hydrate=void 0;static properties={};static styles=null;static get elementStyles(){let t=Rl.get(this);return t===void 0&&(t=this.finalizeStyles(this.styles),Rl.set(this,t)),t}static finalizeStyles(t){return Ba(t)}static register(t){vl(t,this)}get renderRoot(){return this._renderRoot}set renderRoot(t){this._renderRoot=t}get hasUpdated(){return!!this.__firstRendered}get isUpdatePending(){return this._scheduled||this._isUpdating||this._initialUpdatePending}static get observedAttributes(){return this.finalize(),pl(this)}static get elementProperties(){let t=hl(),n=Nl.get(this);if(n&&n.epoch===t)return n.map;let r=nt(this);if(n&&n.merged===r)return n.epoch=t,n.map;let o=new Map;for(let i of Reflect.ownKeys(r))o.set(i,nr(r[i]));return Nl.set(this,{epoch:t,merged:r,map:o}),o}static getPropertyOptions(t){return this.elementProperties.get(t)??kp}static createProperty(t,n={}){if(ir.has(this)||Is.has(this))throw new Error(`[webjs] ${this.name||"A component"}.createProperty('${t}') ran after an instance of the class${Is.has(this)&&!ir.has(this)?", or of a subclass,":""} was constructed. Declare the property in \`static properties\` (or the WebComponent({ ... }) factory), or call createProperty at class definition time, before any element is created.`);ml(this,t,n)}static getPropertyDescriptor(t,n,r){let o=jl(this,t),i;if(o){let{get:s,set:a}=o;i={configurable:!0,enumerable:!0,get(){return s?.call(this)},set(c){let l=s?.call(this);a?.call(this,c),this.requestUpdate(t,l,r)}}}else i={configurable:!0,enumerable:!0,get(){return this[n]},set(s){let a=this[n];this[n]=s,this.requestUpdate(t,a,r)}};return Ms.set(i.set,o),i}static finalize(){if(Cl.has(this))return;Cl.add(this);let t=Object.getPrototypeOf(this);if(t&&typeof t.finalize=="function"&&t.finalize(),this.createProperty!==e.createProperty&&Object.hasOwn(this,"properties")){let n=this.properties;if(n&&typeof n=="object")for(let r of Reflect.ownKeys(n))this.createProperty(r,nr(n[r]))}this.elementProperties,this.elementStyles}static addInitializer(t){if(!Object.hasOwn(this,"_initializers")){let n=Object.getPrototypeOf(this)._initializers;this._initializers=n?[...n]:[]}this._initializers.push(t)}constructor(){super(),this._renderRoot=void 0,this._scheduled=!1,this._connected=!1,this._initialUpdatePending=!0,this.__controllers=null,this.__firstRendered=!1,this._changedProperties=new Map,this._updateResolve=null,this._updatePromise=Tp,this._isUpdating=!1,this._initializeProperties();let t=this.constructor._initializers;if(t)for(let n of t)n(this)}_initializeProperties(){let t=this.constructor,n=ir.get(t);n===void 0&&(t.finalize(),n=Cp(t,nt(t)));for(let r=0;r<n.length;r++){let{propName:o,decl:i,builtIn:s,key:a}=n[r];if(Object.hasOwn(this,o)&&((this.__instanceProperties??=new Map).set(o,this[o]),delete this[o]),!!s&&i.default!==void 0){let c=typeof i.default=="function"?i.default():i.default;this[a]=c,i.useDefault&&(this.__defaultValues??=new Map).set(o,c)}}}_reflectAttribute(t,n,r){let o=So(t,r);if(o!==void 0&&!this.__reflectingAttribute){this.__reflectingAttribute=!0;try{if(r.converter&&r.converter.toAttribute){let i=r.converter.toAttribute(n,r.type);i==null?this.removeAttribute(o):this.setAttribute(o,i)}else if(typeof n=="function")this.removeAttribute(o),js(this,t,o);else if(r.type===Boolean)n?this.setAttribute(o,""):this.removeAttribute(o);else if(n==null)this.removeAttribute(o);else if(r.type===Object||r.type===Array){let i,s=!0;try{i=JSON.stringify(n)}catch(a){s=!1,this.removeAttribute(o),Tl(this,t,o,a&&a.message)}s&&this.setAttribute(o,i)}else Fn(n)?(this.removeAttribute(o),js(this,t,o)):this.setAttribute(o,String(n))}finally{this.__reflectingAttribute=!1}}}connectedCallback(){if(!Ps)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 o=0;o<n.length;o++){let i=n[o].name;i.startsWith("data-webjs-prop-")&&t.push(i)}let r=this;r.__webjsPropAttrValues||(r.__webjsPropAttrValues=new Map);for(let o of t){let i=this.getAttribute(o);if(this.removeAttribute(o),i==null)continue;r.__webjsPropAttrValues.set(o,i);let s=Op(o.slice(16));try{this[s]=Le(i)}catch(a){console.warn(`[webjs] failed to decode ${o} on <${this.tagName.toLowerCase()}>: ${a&&a.message}`)}}}_activate(){this._connected=!0,this.__accessorsLifted||(this.__accessorsLifted=!0,Lp(this)),this._reflectDeclaredAttributes();let t=this.constructor;t.shadow!==!0&&!this.hasAttribute("data-wj-host")&&this.setAttribute("data-wj-host",""),this._setupRenderRoot(),t.shadow!==!0&&this._renderRoot===this&&Je(this)&&(Yi(this),Bi(this));for(let n of this.__controllers||or)n.hostConnected&&n.hostConnected();this._updateResolve===null&&(this._updatePromise=new Promise(n=>{this._updateResolve=n})),this.__updatingEnabled=!0,this.enableUpdating(!0),!this._scheduled&&(this._scheduled=!0,queueMicrotask(()=>this._runScheduledUpdate("initial render")))}_setupRenderRoot(){let t=this.constructor;if(this._renderRoot===void 0){let n=this.createRenderRoot(),r=typeof ShadowRoot<"u"&&n instanceof ShadowRoot;if(r!==(t.shadow===!0)){let o=Ie(t)||this.tagName?.toLowerCase();throw new Error(r?`[webjs] <${o}> createRenderRoot() returned a shadow root, but the class does not declare \`static shadow = true\`. WebJs renders on the server from \`static shadow\`, so add \`static shadow = true\` (with \`static shadowRootOptions\` for the attachShadow options) and drop the override, or call \`super.createRenderRoot()\` from it.`:`[webjs] <${o}> declares \`static shadow = true\`, but createRenderRoot() returned something other than a shadow root. Return \`super.createRenderRoot()\` from the override, or remove \`static shadow = true\` to render into light DOM.`)}this._renderRoot=n}t.shadow!==!0&&this._renderRoot===this&&(t.styles&&!Ol.has(t)&&(Ol.add(t),console.error(Ua(Ie(t)||this.tagName?.toLowerCase()))),this.render===e.prototype.render?this.removeAttribute("data-wj-serialized"):Je(this)?qi(this):this.__isHydrating()||this.hasAttribute("data-wj-serialized")||is(this)?(this.removeAttribute("data-wj-serialized"),D(this),Mi(this)):Ii(this))}_runScheduledUpdate(t){try{let n=this.scheduleUpdate();n&&typeof n.then=="function"&&n.then(void 0,r=>{console.error(`[webjs] lifecycle hook threw during ${t}:`,r)})}catch(n){console.error(`[webjs] lifecycle hook threw during ${t}:`,n)}}scheduleUpdate(){return this.performUpdate()}performUpdate(){!this._scheduled&&!this._initialUpdatePending||(this.__firstRendered||this._prepareFirstUpdate(),this._scheduled=!1,this._initialUpdatePending=!1,this._performRender())}_prepareFirstUpdate(){this._renderRoot===void 0&&this._setupRenderRoot();let t=this.__instanceProperties;if(t){this.__instanceProperties=void 0;for(let[n,r]of t)this[n]=r}for(let{propName:n,decl:r,wrapped:o}of ir.get(this.constructor)||[]){let i=this[n];if(!(!o||this._changedProperties.has(n)||i===void 0)){if(r.useDefault&&!(this.__defaultValues??=new Map).has(n)){this.__defaultValues.set(n,i);continue}this._changedProperties.set(n,void 0),r.reflect&&(this.__reflectPending??=new Set).add(n)}}}enableUpdating(t){}createRenderRoot(){let t=this.constructor;if(t.shadow!==!0)return this;let n=t.shadowRootOptions??{mode:"open"},r=this.shadowRoot??(n.mode==="closed"?Np(this):null),o=r??this.attachShadow(n),i=t.elementStyles;if(i.length){if(r){let s=r.querySelector("style");s&&s.remove()}_i(o,i)}return o}__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),Ui(this);for(let t of["__signalWatcher","__postWatcher"]){let n=this;n[t]&&(n[t].dispose(),n[t]=void 0)}for(let t of this.__controllers||or)t.hostDisconnected&&t.hostDisconnected()}attributeChangedCallback(t,n,r){if(this.__reflectingAttribute)return;let o=dl(this.constructor,t);if(o===void 0)return;let{propName:i,def:s}=o;if(this.__attributeToProperty===i)return;let a=fl(s,r,i);a==null&&s.useDefault&&this.__defaultValues?.has(i)&&(a=this.__defaultValues.get(i)),this.__attributeToProperty=i;try{this[i]=a}finally{this.__attributeToProperty=void 0}}requestUpdate(t,n,r){if(t!==void 0){let o=r??this.constructor.getPropertyOptions(t),i=o.hasChanged||xl,s=this[t];if(o.useDefault&&!(this.__defaultValues??=new Map).has(t)&&(this.__defaultValues.set(t,n!==void 0?n:s),n===void 0)){this._scheduleUpdate();return}let a=o.useDefault&&o.reflect?So(t,o):void 0,c=a!==void 0&&Object.is(s,this.__defaultValues?.get(t))&&!this.hasAttribute(a);if(!i(s,n)&&!c)return;this._changedProperties.has(t)||this._changedProperties.set(t,this.__firstRendered||o.useDefault?n:void 0),o.reflect&&this.__attributeToProperty!==t&&(this._connected?this._reflectAttribute(t,s,o):(this.__reflectPending??=new Set).add(t))}this._scheduleUpdate()}_scheduleUpdate(){if(this._updateResolve===null&&(this._updatePromise=new Promise(n=>{this._updateResolve=n})),this._isUpdating||this._scheduled||!this.__updatingEnabled)return;this._scheduled=!0;let t=this.__settlingPromise;t?t.then(()=>this._runScheduledUpdate("update cycle")):queueMicrotask(()=>this._runScheduledUpdate("update cycle"))}_performRender(){if(!this._renderRoot)return;this.__cycleRendered=!1;let t=this._tracked("__signalWatcher",()=>this._runUpdateCycle());t&&t()}_tracked(t,n){let r=this,o=r[t];o||(o=r[t]=new pe.subtle.Watcher(()=>{!o.__inPhase&&this._connected&&this.requestUpdate()}));let i=t==="__signalWatcher"?pe.subtle.introspectSources(o):null;o.__inPhase=!0;try{return o.observe(n)}finally{o.__inPhase=!1,i&&!this.__cycleRendered&&o.watch(...new Set([...i,...pe.subtle.introspectSources(o)])),this._connected||(o.dispose(),r[t]===o&&(r[t]=void 0))}}_runUpdateCycle(){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||or)o.hostUpdate&&o.hostUpdate();this.__renderToken=(this.__renderToken||0)+1,this.__renderAbort&&this.__renderAbort.abort(),this.__renderAbort=typeof AbortController<"u"?new AbortController:null,this.__cycleRendered=!0;try{let o=this.update(t);o&&typeof o.then=="function"&&(r=o)}catch(o){this._handleRenderError(o)}r||(n=!0)}}catch(o){console.error("[webjs] lifecycle hook threw during update phase:",o)}finally{this._isUpdating=!1,this._changedProperties===t&&(this._changedProperties=new Map)}if(r){let o=this.__renderToken;this.__pendingAsyncCommits=(this.__pendingAsyncCommits||0)+1;let i=()=>{this.__pendingAsyncCommits--,o===this.__renderToken&&this._postCommit(t)};r.then(i,s=>{try{o===this.__renderToken&&this._handleRenderError(s instanceof Error?s:new Error(El(s)))}finally{i()}});return}if(n)return()=>this._postCommit(t);this.__pendingAsyncCommits||this._resolveUpdate(),!n&&this.__postWatcher&&this.__postWatcher.watch()}_resolveUpdate(){if(this._updateResolve){let t=!this._scheduled;this._updateResolve(t),this._updateResolve=null}}performServerUpdate(){let t=this._changedProperties;this._isUpdating=!0;try{this.willUpdate(t);for(let n of this.__controllers||or)if(n.hostUpdate)try{n.hostUpdate()}catch(r){Rp(this,n,r)}this._reflectDeclaredAttributes()}finally{this._isUpdating=!1}}_reflectDeclaredAttributes(){let t=nt(this.constructor);for(let n of Reflect.ownKeys(t)){let r=t[n];!r||!r.reflect||this[n]!==void 0&&(r.useDefault&&(!this.__defaultValues?.has(n)||Object.is(this[n],this.__defaultValues.get(n)))||this._reflectAttribute(n,this[n],r))}}shouldUpdate(t){return!0}willUpdate(t){}update(t){let n=this.__reflectPending;this.__reflectPending=void 0;for(let i of n||[]){let s=nt(this.constructor)[i];this._reflectAttribute(i,this[i],s)}let r,o=Os();Ao(this.__renderAbort?this.__renderAbort.signal:null);try{r=this.render()}finally{Ao(o||null)}if(r&&typeof r.then=="function")return this._commitAsync(r);this._markUpdated(),pe.subtle.untrack(()=>Rt(r,this._renderRoot,{host:this}))}_markUpdated(){this._isUpdating=!1,this._changedProperties=new Map,this.__cycleResolve=this._updateResolve,this.__settlingPromise=this._updatePromise,this._updateResolve=null}_commitAsync(t){let n=this.__renderToken;if(this.__firstRendered&&this._overridesRenderFallback())try{let r=this.renderFallback();r!==void 0&&pe.subtle.untrack(()=>Rt(r,this._renderRoot,{host:this}))}catch(r){console.error("[webjs] renderFallback() threw:",r)}return Promise.resolve(t).then(r=>{if(n===this.__renderToken)try{Rt(r,this._renderRoot,{host:this})}catch(o){this._handleRenderError(o instanceof Error?o:new Error(String(o)))}},r=>{n===this.__renderToken&&this._handleRenderError(r instanceof Error?r:new Error(String(r)))})}_overridesRenderFallback(){return this.renderFallback!==sr.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${Ie(this.constructor)||this.tagName?.toLowerCase()}>:`,t);try{let n=this.renderError(t);n!==void 0&&pe.subtle.untrack(()=>Rt(n,this._renderRoot,{host:this}))}catch(n){console.error("[webjs] renderError() also threw:",n)}}_postCommit(t){let n;this.__cycleResolve!==void 0?(n=this.__cycleResolve,this.__cycleResolve=void 0):(n=this._updateResolve,this._updateResolve=null,this.__settlingPromise=this._updatePromise);try{this._tracked("__postWatcher",()=>{for(let r of this.__controllers||or)r.hostUpdated?.();this.__firstRendered||(this.__firstRendered=!0,this.firstUpdated(t)),this.updated(t)})}catch(r){console.error("[webjs] lifecycle hook threw during post-commit phase:",r)}finally{this.__settlingPromise=void 0,n?.(!this._scheduled)}}updated(t){}firstUpdated(t){}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return Ps&&this._initialUpdatePending&&this._updateResolve===null&&(this._updatePromise=new Promise(t=>{this._updateResolve=t})),this._updatePromise}addController(t){(this.__controllers??=new Set).add(t),this._connected&&t.hostConnected&&t.hostConnected()}removeController(t){this.__controllers&&this.__controllers.delete(t)}render(){return A}renderError(t){}renderFallback(){}};function Rp(e,t,n){let r=t&&t.constructor;if(r&&Ll.has(r))return;r&&Ll.add(r);let o=e.__ssrTag||Ie(e.constructor)||"a component";console.error(`[webjs] ${r&&r.name?r.name:"A controller"}.hostUpdate() threw during SSR of <${o}>, so it was skipped and the component rendered without it. Controllers' hostUpdate() runs on the server too; guard browser-only work with \`if (isServer) return;\` (isServer from '@webjsdev/core'), or move it to hostConnected() or hostUpdated(), which never run at SSR.`,n)}function Op(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function sr(e){return new.target?Reflect.construct(rt,arguments,new.target):class extends rt{static properties=e}}function Lp(e){for(let t of Object.keys(e))for(let n=Object.getPrototypeOf(e);n&&n!==rt.prototype;n=Object.getPrototypeOf(n)){let r=Object.getOwnPropertyDescriptor(n,t);if(r){if(r.set){let o=e[t];delete e[t],e[t]=o}break}}}Object.setPrototypeOf(sr,rt);sr.prototype=rt.prototype;var jp={toAttribute(e,t){return t===Boolean?e?"":null:t===Object||t===Array?e==null?e:JSON.stringify(e):e},fromAttribute(e,t){if(t===Boolean)return e!==null;if(t===Number)return e===null?null:Number(e);if(t===Object||t===Array)try{return JSON.parse(e)}catch{return null}return e}},Pp=(e,t)=>!Object.is(e,t);Si();var Pl=Symbol.for("webjs.notFound"),Il=Symbol.for("webjs.redirect"),Ml=Symbol.for("webjs.forbidden"),Dl=Symbol.for("webjs.unauthorized");function Ip(){let e=new Error("webjs: notFound()");throw e.__webjs=Pl,e}function Mp(){let e=new Error("webjs: forbidden()");throw e.__webjs=Ml,e}function Dp(){let e=new Error("webjs: unauthorized()");throw e.__webjs=Dl,e}function $l(e,t){let n,r;t==="push"||t==="replace"?r=t:typeof t=="object"&&t!==null?(n=t.status,(t.type==="push"||t.type==="replace")&&(r=t.type)):typeof t=="number"&&(n=t);let o=new Error(`webjs: redirect(${e})`);throw o.__webjs=Il,o.url=e,o.status=typeof n=="number"?n:void 0,o.redirectType=r,o}function $p(e,t){return $l(e,{status:308,type:t})}function Fp(e){return!!e&&e.__webjs===Pl}function Ds(e){return!!e&&e.__webjs===Il}function Hp(e){return!!e&&e.__webjs===Ml}function Bp(e){return!!e&&e.__webjs===Dl}var Fl=null;function Up(){if(!Fl)return"";try{return Fl()||""}catch{return""}}var Hl=null;function qp(e){if(typeof e!="string"||!e||!Hl)return e;try{return Hl(e)||e}catch{return e}}ze();var Oy=Symbol.for("webjs.suspense");function Wp(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function Kp(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}function Vp(e,t={}){let n=t.reconnect!==!1,r=0,o=!1,i=null,s=[];function a(){o||(i=new WebSocket(zp(e),t.protocols),i.onopen=c=>{for(r=0;s.length&&i&&i.readyState===WebSocket.OPEN;)i.send(s.shift());t.onOpen?.(c)},i.onmessage=c=>{let l=c.data;if(typeof l=="string")try{l=JSON.parse(l)}catch{}t.onMessage?.(l,c)},i.onerror=c=>{t.onError?.(c)},i.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);i&&i.readyState===WebSocket.OPEN?i.send(l):s.push(l)},close(c,l){o=!0;try{i?.close(c,l)}catch{}},get socket(){return i},get readyState(){return i?.readyState??3}}}function zp(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}`}zt();var $s="application/vnd.webjs+json";async function Gp(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",$s);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 Ai(r),n.has("content-type")||n.set("content-type",$s));let o=await fetch(e,{...t,headers:n,body:r}),i=o.headers.get("content-type")||"",s=await o.text(),a=i.includes($s)?s?Le(s):null:i.includes("application/json")?s?JSON.parse(s):null:s;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}zt();Eo();Eo();Us();lr();var Ea=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 i=this.updates.findIndex(s=>s.id===r);i!==-1&&(this.updates.splice(i,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 Vh(e,t,n){let r=e.get();e.set(t);let o;try{o=await n()}catch(i){throw e.set(r),i}return o&&o.success===!1&&e.set(r),o}function zh(e,t,n){return e&&typeof e.get=="function"&&typeof e.set=="function"?Vh(e,t,n):new Ea(e,t)}ko();No();Pt();_a();async function Gh(e){let t=li(e);if(!t.length||typeof location>"u")return!1;let n=!1,r=!1;for(let o of t)o.layout||o.path.includes("[")?Oe():Oe(o.path),qu(o,location.pathname)&&(n=!0,o.layout&&(r=!0));if(!n)return!1;try{return await Vr(r?"shell":"page")}catch{return!1}}var of=!1;function Jh(e){let t=e.lastIndexOf(";"),n=t===-1?e:e.slice(0,t),r=t!==-1&&e.slice(t+1)==="replace",o=new Error(`webjs: redirect(${n})`);if(o.__webjs=Symbol.for("webjs.redirect"),o.url=n,typeof location<"u"){!of&&typeof addEventListener=="function"&&(of=!0,addEventListener("unhandledrejection",s=>{Ds(s.reason)&&s.preventDefault()}));let i;try{i=new URL(n,location.href)}catch{i=null}i&&i.origin===location.origin?Promise.resolve(Ft(i.pathname+i.search+i.hash,{replace:r})).catch(()=>location.assign(i.href)):i&&(r?location.replace(i.href):location.assign(i.href))}return Promise.reject(o)}var Yh="application/vnd.webjs+stream",Xh=1,Zh=2,Qh=3,sf=new Uint8Array(0);function em(e,t){let n=t||sf,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 tm(){let e=sf;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 i=e.slice(5,5+o);n.push({type:r,payload:i}),e=e.slice(5+o)}return n}}}function nm(e){return e}var Rn=class extends Event{constructor(t,n,r,o){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=n,this.callback=r,this.subscribe=o??!1}},di=class extends Event{constructor(t,n){super("context-provider",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=n}},Ta=class{constructor(t){this.subscriptions=new Map,this._value=void 0,t!==void 0&&(this.value=t)}get value(){return this._value}set value(t){this.setValue(t)}setValue(t,n=!1){let r=n||!Object.is(t,this._value);this._value=t,r&&this.updateObservers()}updateObservers=()=>{for(let[t,{disposer:n}]of this.subscriptions)t(this._value,n)};addCallback(t,n,r){if(!r){t(this.value);return}this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:n});let{disposer:o}=this.subscriptions.get(t);t(this.value,o)}clearCallbacks(){this.subscriptions.clear()}},ka=class extends Ta{constructor(t,n,r){let o=n!=null&&n.context!==void 0;super(o?n.initialValue:r),this.host=t,this.context=o?n.context:n,this.attachListeners(),this.host.addController?.(this)}onContextRequest=t=>{let n=t;if(n.context!==this.context)return;let r=n.contextTarget??n.composedPath()[0];r!==this.host&&(n.stopPropagation(),this.addCallback(n.callback,r,n.subscribe))};onProviderRequest=t=>{let n=t;if(n.context!==this.context||(n.contextTarget??n.composedPath()[0])===this.host)return;let o=new Set;for(let[i,{consumerHost:s}]of this.subscriptions)o.has(i)||(o.add(i),s.dispatchEvent(new Rn(this.context,s,i,!0)));n.stopPropagation()};attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new di(this.context,this.host))}},Ca=class{constructor(t,n,r,o){this.host=t,this.provided=!1,this.value=void 0,this.unsubscribe=void 0,n!=null&&n.context!==void 0?(this.context=n.context,this.callback=n.callback,this.subscribe=n.subscribe??!1):(this.context=n,this.callback=r,this.subscribe=o??!1),this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new Rn(this.context,this.host,this._callback,this.subscribe))}_callback=(t,n)=>{this.unsubscribe&&(this.unsubscribe!==n&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=t,this.host.requestUpdate(),(!this.provided||this.subscribe)&&(this.provided=!0,this.callback&&this.callback(t,n)),this.unsubscribe=n}},Na=class{constructor(){this.pendingContextRequests=new Map}attach(t){t.addEventListener("context-request",this.onContextRequest),t.addEventListener("context-provider",this.onContextProvider)}detach(t){t.removeEventListener("context-request",this.onContextRequest),t.removeEventListener("context-provider",this.onContextProvider)}onContextProvider=t=>{let n=t,r=this.pendingContextRequests.get(n.context);if(r!==void 0){this.pendingContextRequests.delete(n.context);for(let{elementRef:o,callbackRef:i}of r.requests){let s=o.deref(),a=i.deref();s===void 0||a===void 0||s.dispatchEvent(new Rn(n.context,s,a,!0))}}};onContextRequest=t=>{let n=t;if(n.subscribe!==!0)return;let r=n.contextTarget??n.composedPath()[0],o=n.callback,i=this.pendingContextRequests.get(n.context);i===void 0&&this.pendingContextRequests.set(n.context,i={callbacks:new WeakMap,requests:[]});let s=i.callbacks.get(r);s===void 0&&i.callbacks.set(r,s=new WeakSet),!s.has(o)&&(s.add(o),i.requests.push({elementRef:new WeakRef(r),callbackRef:new WeakRef(o)}))}};var G={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},af=Symbol("webjs.task.initialState");function rm(){return typeof window<"u"}var cf=(e,t)=>e===t||e.length===t.length&&e.every((n,r)=>Object.is(n,t[r])),pi=(e,t)=>{if(Object.is(e,t))return!0;if(e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"){let n=e,r=t;if(n.constructor!==r.constructor)return!1;if(Array.isArray(n))return n.length!==r.length?!1:n.every((i,s)=>pi(i,r[s]));if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===r.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===r.toString();if(n instanceof Map&&r instanceof Map){if(n.size!==r.size)return!1;for(let[i,s]of n.entries())if(pi(s,r.get(i))===!1||s===void 0&&r.has(i)===!1)return!1;return!0}if(n instanceof Set&&r instanceof Set){if(n.size!==r.size)return!1;for(let i of n.keys())if(r.has(i)===!1)return!1;return!0}if(n instanceof RegExp)return n.source===r.source&&n.flags===r.flags;let o=Object.keys(n);if(o.length!==Object.keys(r).length)return!1;for(let i of o)if(!Object.hasOwn(r,i)||!pi(n[i],r[i]))return!1;return!0}return!1},om=(e,t)=>e===t||e.length===t.length&&e.every((n,r)=>pi(n,t[r])),Ra=class{constructor(t,n,r){this._host=t,t.addController(this);let o=typeof n=="object"&&n!==null?n:{task:n,args:r};if(typeof o.task!="function")throw new TypeError("[webjs] new Task(host, { task, args }) needs a task function. Pass a config object or new Task(host, taskFn, argsFn).");this._task=o.task,this._argsFn=o.args,this._argsEqual=o.argsEqual??cf,this._onComplete=o.onComplete,this._onError=o.onError,this.autoRun=o.autoRun??!0,this._status=G.INITIAL,this._value=void 0,this._error=void 0,this._previousArgs=void 0,this._callId=0,this._abortController=void 0,this._taskComplete=void 0,this._resolveTaskComplete=void 0,this._rejectTaskComplete=void 0,"initialValue"in o&&(this._value=o.initialValue,this._status=G.COMPLETE,this._previousArgs=this._getArgs())}get taskComplete(){return this._taskComplete?this._taskComplete:(this._status===G.PENDING?this._taskComplete=new Promise((t,n)=>{this._resolveTaskComplete=t,this._rejectTaskComplete=n}):this._status===G.ERROR?this._taskComplete=Promise.reject(this._error):this._taskComplete=Promise.resolve(this._value),this._taskComplete)}get status(){return this._status}get value(){return this._value}get error(){return this._error}hostUpdate(){this.autoRun===!0&&this._performTask()}hostUpdated(){this.autoRun==="afterUpdate"&&this._performTask()}_getArgs(){if(this._argsFn===void 0)return;let t=this._argsFn();if(!Array.isArray(t))throw new Error("[webjs] The Task args function must return an array.");return t}async _performTask(){if(!rm())return;let t=this._getArgs(),n=this._previousArgs;this._previousArgs=t,t!==n&&t!==void 0&&(n===void 0||!this._argsEqual(n,t))&&await this.run(t)}async run(t){t??=this._getArgs(),this._previousArgs=t,this._status===G.PENDING?this._abortController?.abort():(this._taskComplete=void 0,this._resolveTaskComplete=void 0,this._rejectTaskComplete=void 0),this._status=G.PENDING;let n,r;this.autoRun==="afterUpdate"?queueMicrotask(()=>this._host.requestUpdate()):this._host.requestUpdate();let o=++this._callId;this._abortController=new AbortController;let i=!1;try{n=await this._task(t,{signal:this._abortController.signal})}catch(s){i=!0,r=s}if(this._callId===o){if(n===af)this._status=G.INITIAL;else{if(i===!1){try{this._onComplete?.(n)}catch{}this._status=G.COMPLETE,this._resolveTaskComplete?.(n)}else{try{this._onError?.(r)}catch{}this._status=G.ERROR,this._rejectTaskComplete?.(r)}this._value=n,this._error=r}this._host.requestUpdate()}}abort(t){this._status===G.PENDING&&this._abortController?.abort(t)}render(t){switch(this._status){case G.INITIAL:return t.initial?.();case G.PENDING:return t.pending?.();case G.COMPLETE:return t.complete?.(this._value);case G.ERROR:return t.error?.(this._error);default:throw new Error(`[webjs] Unexpected Task status: ${this._status}`)}}};We();export{Ln as CSSResult,Ca as ContextConsumer,ka as ContextProvider,di as ContextProviderEvent,Rn as ContextRequestEvent,Na as ContextRoot,z as FORM_ACTION_FIELD,xi as FORM_ACTION_ID_KEY,Xh as FRAME_CHUNK,Zh as FRAME_END,Qh as FRAME_ERROR,N as MARKER,Jl as SEED_MISS,Yh as STREAM_CONTENT_TYPE,pe as Signal,Fd as SignalWatcher,Wp as Suspense,Ra as Task,G as TaskStatus,sr as WebComponent,Bs as WebjsFrame,qs as WebjsStream,Os as activeActionSignal,_i as adoptStyles,Ap as allTags,Gh as applyActionRefresh,qp as asset,sd as asyncAppend,ad as asyncReplace,Id as batch,Za as bindActionId,od as cache,ld as choose,pc as classMap,Dd as computed,Vp as connectWS,uh as consumeStale,nm as createContext,tm as createFrameDecoder,rd as createRef,Up as cspNonce,mf as css,om as deepArrayEquals,jp as defaultConverter,Va as deserialize,va as disableClientRouter,$d as effect,Kr as enableClientRouter,em as encodeFrame,qa as escapeAttr,Af as escapeText,ch as fetchMark,Jh as followActionRedirect,Mp as forbidden,ed as guard,bi as html,mc as ifDefined,af as initialState,Qa as installActionBind,Oi as isAsyncAppend,Li as isAsyncReplace,jn as isCSS,yt as isCache,Hp as isForbidden,bt as isGuard,mt as isKeyed,Sp as isLazy,fe as isLive,Fp as isNotFound,Ds as isRedirect,Qr as isRef,Zr as isRepeat,hf as isServer,Yn as isSignal,Kp as isSuspense,F as isTemplate,Ri as isTemplateContent,Bp as isUnauthorized,Ni as isUnsafeHTML,Jt as isUntil,Yt as isWatch,fd as join,Qf as keyed,Zf as live,xa as loadFrame,wp as lookup,_p as lookupModuleUrl,ud as map,Gs as markStale,pf as mathml,Ft as navigate,A as noChange,Pp as notEqual,Ip as notFound,R as nothing,zh as optimistic,Le as parse,Js as parseTagHeader,$p as permanentRedirect,gp as primeModuleUrl,kl as prop,dd as range,$l as redirect,nd as ref,Vr as refreshPage,lh as registerKeyTags,Rt as render,Ws as renderStream,dc as repeat,Oe as revalidate,Gp as richFetch,To as scanSeeds,sh as seedStats,Ka as serialize,Ao as setActiveActionSignal,cf as shallowArrayEquals,Md as signal,Pf as splitActionId,Ai as stringify,vi as stringifySync,hc as styleMap,wf as stylesToString,df as svg,Ie as tagOf,ih as takeSeed,td as templateContent,Dp as unauthorized,gf as unsafeCSS,Jf as unsafeHTML,Xf as unsafeMathML,Yf as unsafeSVG,id as until,gc as watch,cd as when};
|
|
6
7
|
//# sourceMappingURL=webjs-core-browser.js.map
|