@nextwebwg/html-next 1.0.0-alpha.1 → 1.0.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.js CHANGED
@@ -1,9 +1,9 @@
1
- var K=class extends Error{diagnostic;constructor(e){let n=e.source?`${e.source}: `:"";super(`${n}${e.code}: ${e.message}`),this.name="HtmlDiagnosticError",this.diagnostic=Object.freeze({...e})}};function y(t,e,n){throw new K(n===void 0?{code:t,message:e}:{code:t,message:e,source:n})}function at([t],[e]){return t.localeCompare(e)}async function ct(t,e){let n=new Map,r=new Map,o=new Map,i=async c=>{let l=new URL(c.url).href,f=r.get(l)??l,d=n.get(f);if(d!==void 0)return d.url;let h;try{h=await e.fetchComponent(l)}catch(g){if(g instanceof K)throw g;y("HL009",`Component \`${l}\` failed to load: ${g instanceof Error?g.message:String(g)}.`,l)}let u=e.resolver.assertFinalURL(c,h.url,l);r.set(l,u);let p=n.get(u);if(p!==void 0)return p.url;let m=e.parseComponentResource(h.source,u),w=m.definition,k=o.get(w.contract.tag);k!==void 0&&k!==u&&y("HL007",`Both \`${k}\` and \`${u}\` declare <${w.contract.tag}>.`,u),o.set(w.contract.tag,u);let x={url:u,trustRoot:c.trustRoot,definition:w,dependencies:[],shadowedByCustomElement:e.isCustomElementRegistered?.(w.contract.tag)??!1,complete:!1};if(n.set(u,x),w.controller!==void 0){let g=e.resolver.resolveDependency(w.controller,u,c.trustRoot);x.controller=Object.freeze({specifier:w.controller,url:g.url})}for(let g of m.dependencies){let b=e.resolver.resolveDependency(g,u,c.trustRoot),v=await i(b);x.dependencies.includes(v)||x.dependencies.push(v)}return x.complete=!0,u},a=[];for(let c of t)a.push(await i(e.resolver.resolveRoot(c)));let s=[];for(let[c,l]of Array.from(n).sort(at))l.complete||y("HL008",`Component graph did not finish loading \`${c}\`.`),s.push([c,Object.freeze({url:c,trustRoot:l.trustRoot,definition:l.definition,dependencies:Object.freeze(Array.from(l.dependencies)),...l.controller===void 0?{}:{controller:l.controller},shadowedByCustomElement:l.shadowedByCustomElement})]);return Object.freeze({roots:Object.freeze(a),nodes:new Map(s),tags:new Map(Array.from(o).sort(at))})}function J(t){if(typeof t!="object"||t===null||Object.isFrozen(t))return t;for(let e of Object.values(t))J(e);return Object.freeze(t)}function dt(t){let e="",n=!0;for(let r of t)r==="-"?n=!0:(e+=n?r.toUpperCase():r,n=!1);return e}function Re(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}var hn=new Set(["string","boolean","number","integer","null","absent","trusted-html","trusted-script","function","unknown"]),ce=class extends SyntaxError{constructor(n,r){super(`${n} at character ${r+1}.`);this.position=r;this.name="TypeSyntaxError"}position},Se=class{constructor(e){this.source=e}source;#e=0;parse(){let e=this.#t();return this.#d(),this.#e!==this.source.length&&this.#l("Unexpected type syntax"),e}#t(){let e=[this.#n()];for(;this.#s("|");)e.push(this.#n());return e.length===1?e[0]:Ne(e)}#n(){let e=this.#o();for(;this.#s("?");)e=Ne([e,{kind:"terminal",name:"null"},{kind:"terminal",name:"absent"}]);return e}#o(){if(this.#s("(")){let r=this.#t();return this.#a(")"),r}let e=this.#c();if(e!==void 0)return{kind:"keyword",value:e};let n=this.#r();if(n===void 0&&this.#l("Expected a type, keyword, or group"),n==="list"||n==="record"){this.#a("(");let r=this.#t();return this.#a(")"),n==="list"?{kind:"list",item:r}:{kind:"record",value:r}}return n==="object"?this.#i():hn.has(n)?{kind:"terminal",name:n}:{kind:"keyword",value:n}}#i(){this.#a("("),this.#a("{");let e=[],n=!1;for(;!this.#s("}");){if(this.#d(),this.source.startsWith("...",this.#e))this.#e+=3,n=!0;else{let r=this.#c()??this.#r();r===void 0&&this.#l("Expected an object field or `...`");let o=this.#s("?");this.#a(":");let i=this.#t();e.some(a=>a.name===r)&&this.#l(`Duplicate object field \`${r}\``),e.push({name:r,type:i,optional:o})}if(this.#s("}"))break;this.#a(","),n&&(this.#d(),this.source.startsWith("}",this.#e)||this.#l("The open marker must be last"))}return this.#a(")"),{kind:"object",fields:e,open:n}}#r(){this.#d();let e=/^[A-Za-z_][A-Za-z0-9_-]*/.exec(this.source.slice(this.#e));if(e!==null)return this.#e+=e[0].length,e[0]}#c(){this.#d();let e=this.source[this.#e];if(e!=='"'&&e!=="'")return;this.#e+=1;let n="";for(;this.#e<this.source.length;){let r=this.source[this.#e++];if(r===e)return n;if(r!=="\\"){n+=r;continue}this.#e>=this.source.length&&this.#l("Unterminated escape");let o=this.source[this.#e++];n+={n:`
2
- `,r:"\r",t:" ","\\":"\\",'"':'"',"'":"'"}[o]??o}this.#l("Unterminated quoted keyword")}#s(e){return this.#d(),this.source.startsWith(e,this.#e)?(this.#e+=e.length,!0):!1}#a(e){this.#s(e)||this.#l(`Expected \`${e}\``)}#d(){for(;/\s/.test(this.source[this.#e]??"");)this.#e+=1}#l(e){throw new ce(e,this.#e)}};function Ne(t){let e=t.flatMap(o=>o.kind==="union"?o.members:[o]),n=new Map(e.map(o=>[U(o),o])),r=Array.from(n.values());return r.length===1?r[0]:{kind:"union",members:r}}function de(t){if(t.trim()==="")throw new ce("A type expression cannot be empty",0);return J(new Se(t).parse())}function $e(t){return typeof t=="object"&&t!==null&&"kind"in t&&["terminal","keyword","union","list","record","object"].includes(String(t.kind))}function le(t){return $e(t)?t:typeof t=="string"?{kind:"terminal",name:t}:Ne(t.enum.map(e=>({kind:"keyword",value:e})))}function U(t){let e=$e(t)?t:le(t);switch(e.kind){case"terminal":return e.name;case"keyword":return/^[A-Za-z_][A-Za-z0-9_-]*$/.test(e.value)?e.value:JSON.stringify(e.value);case"union":return e.members.map(n=>U(n)).join(" | ");case"list":return`list(${U(e.item)})`;case"record":return`record(${U(e.value)})`;case"object":return`object({ ${[...e.fields.map(n=>`${n.name}${n.optional?"?":""}: ${U(n.type)}`),...e.open?["..."]:[]].join(", ")} })`}}function j(t,e,n){return{ok:!1,issues:[{reason:t,message:e,path:n}]}}function Q(t,e){return typeof e=="number"?`${t}[${e}]`:/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(e)?`${t}.${e}`:`${t}[${JSON.stringify(e)}]`}function lt(t){if(typeof t!="object"||t===null||Array.isArray(t))return!1;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}function Te(t){if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return Symbol.for("html-next.bad-json")}}function yn(t,e){if(typeof t!="object"||t===null)return!1;if(t.kind===e&&"value"in t)return!0;let n=e==="trusted-html"?"TrustedHTML":"TrustedScript";return t.constructor?.name===n||Object.prototype.toString.call(t)===`[object ${n}]`}function gn(t,e,n){switch(e){case"string":return typeof t=="string"?{ok:!0,value:t}:j("typeMismatch","Must be a string.",n);case"boolean":return typeof t=="boolean"?{ok:!0,value:t}:t===""||t==="true"?{ok:!0,value:!0}:t==="false"?{ok:!0,value:!1}:j("typeMismatch","Must be true or false.",n);case"number":case"integer":{let r=typeof t=="number"?t:typeof t=="string"&&t.trim()!==""?Number(t):Number.NaN;return Number.isFinite(r)?e==="integer"&&!Number.isInteger(r)?j("typeMismatch","Must be an integer.",n):{ok:!0,value:r}:j("badInput",`Must be ${e==="integer"?"an integer":"a finite number"}.`,n)}case"null":return t===null?{ok:!0,value:null}:j("typeMismatch","Must be null.",n);case"absent":return t===void 0?{ok:!0,value:void 0}:j("typeMismatch","Must be absent.",n);case"trusted-html":case"trusted-script":return yn(t,e)?{ok:!0,value:t}:j("untrustedValue",`Must be a ${e==="trusted-html"?"TrustedHTML":"TrustedScript"} value.`,n);case"function":return typeof t=="function"?{ok:!0,value:t}:j("typeMismatch","Must be a function supplied through a property.",n);case"unknown":return{ok:!0,value:t}}}function Y(t,e,n){switch(e.kind){case"terminal":return gn(t,e.name,n);case"keyword":return t===e.value?{ok:!0,value:t}:j("typeMismatch",`Must be ${JSON.stringify(e.value)}.`,n);case"union":{for(let r of e.members){let o=Y(t,r,n);if(o.ok)return o}return j("typeMismatch",`Must match ${U(e)}.`,n)}case"list":{let r=Te(t);if(!Array.isArray(r))return j("typeMismatch","Must be a list.",n);let o=[],i=[];return r.forEach((a,s)=>{let c=Y(a,e.item,Q(n,s));c.ok?o.push(c.value):i.push(...c.issues)}),i.length===0?{ok:!0,value:o}:{ok:!1,issues:i}}case"record":{let r=Te(t);if(!lt(r))return j("typeMismatch","Must be a string-keyed record.",n);let o={},i=[];for(let[a,s]of Object.entries(r)){let c=Y(s,e.value,Q(n,a));c.ok?o[a]=c.value:i.push(...c.issues)}return i.length===0?{ok:!0,value:o}:{ok:!1,issues:i}}case"object":{let r=Te(t);if(!lt(r))return j("typeMismatch","Must be an object.",n);let o={},i=[],a=new Map(e.fields.map(s=>[s.name,s]));for(let s of e.fields){if(!(s.name in r)){s.optional||i.push({reason:"typeMismatch",message:"Required field is absent.",path:Q(n,s.name)});continue}let c=Y(r[s.name],s.type,Q(n,s.name));c.ok?o[s.name]=c.value:i.push(...c.issues)}for(let[s,c]of Object.entries(r))a.has(s)||(e.open?o[s]=c:i.push({reason:"typeMismatch",message:"Field is not declared by this closed object type.",path:Q(n,s)}));return i.length===0?{ok:!0,value:o}:{ok:!1,issues:i}}}}function _(t,e,n="$"){return Y(t,le(e),n)}function Ae(t,e){let n=_(t,e);if(!n.ok)throw new TypeError(n.issues.map(o=>`${o.path}: ${o.message}`).join("; "));let r=le(e);if(r.kind==="terminal"&&(r.name==="function"||r.name==="unknown"))throw new TypeError(`The ${r.name} type is property-only and cannot be serialized.`);return r.kind==="list"||r.kind==="record"||r.kind==="object"||r.kind==="union"&&typeof n.value=="object"&&n.value!==null?JSON.stringify(n.value):n.value===null?"null":n.value===void 0?"":String(n.value)}function B(t){let e=le(t);return e.kind==="terminal"?!["function","unknown","trusted-html","trusted-script"].includes(e.name):e.kind==="keyword"?!0:e.kind==="union"?e.members.every(B):e.kind==="list"?B(e.item):e.kind==="record"?B(e.value):e.fields.every(n=>B(n.type))}function ut(t){let e;try{e=de(t)}catch(n){y("HC013",n instanceof Error?n.message:"Invalid prop type expression.")}return e.kind==="terminal"&&(e.name==="string"||e.name==="boolean"||e.name==="number")?e.name:e.kind==="keyword"?{enum:[e.value]}:e.kind==="union"&&e.members.every(n=>n.kind==="keyword")?{enum:e.members.map(n=>n.value)}:e}var E=Symbol("absent"),ee=class extends Error{constructor(n){super(`\`${n}\` is not declared in scope.`);this.identifier=n;this.name="UndeclaredName"}identifier},He=/\s*(?:(<=|>=|!=|\^=|\$=|\*=)|(\d+(?:\.\d*)?|\.\d+)|("(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*')|([A-Za-z_$][A-Za-z0-9_$]*)|([=<>+*/%(),.:{}[\]-])|$)/y,bn=/\\([\s\S])/g,wn=/%s/g,vn={or:1,and:2,"=":3,"!=":3,"^=":3,"$=":3,"*=":3,"<":4,"<=":4,">":4,">=":4,"+":5,"-":5,"*":6,"/":6,"%":6};function ft(t){return vn[t]??0}function kn(t){return t==="round"||t==="clamp"||t==="min"||t==="max"||t==="abs"||t==="format"}function Cn(t){let e=0,n=0,r="";function o(){He.lastIndex=e;let d=He.exec(t);if(d===null){let h=t.slice(e).trimStart()[0];throw h==='"'||h==="'"?new SyntaxError("Unterminated string literal."):new SyntaxError(`Unexpected character \`${h}\`.`)}e=He.lastIndex,d[1]!==void 0||d[5]!==void 0?(n=4,r=d[1]??d[5]):d[2]!==void 0?(n=1,r=Number(d[2])):d[3]!==void 0?(n=2,r=d[3].slice(1,-1).replace(bn,"$1")):d[4]!==void 0?(n=3,r=d[4]):(n=0,r="")}function i(d){return r!==d?!1:(o(),!0)}function a(d){if(!i(d))throw new SyntaxError(`Expected \`${d}\`.`)}function s(d){let h=c(),u=ft(r);for(;u>=d;){let p=r;o(),h={kind:"binary",op:p,left:h,right:s(u+1)},u=ft(r)}return h}function c(){if(n===3&&r==="not")return o(),{kind:"unary",op:"not",operand:c()};if(i("-"))return{kind:"unary",op:"-",operand:c()};let d=l();for(;n===4;)if(i(".")){if(n!==3)throw new SyntaxError("Expected a property name after `.`.");let h=r;o(),d={kind:"member",object:d,key:h}}else if(i("[")){let h=s(1);a("]"),d={kind:"index",object:d,index:h}}else break;return d}function l(){let d=n,h=r;if(d===1||d===2)return o(),{kind:"literal",value:h};if(d===4&&h==="("){o();let u=s(1);return a(")"),u}if(d===4&&h==="{"){o();let u=[];if(!i("}")){do{if(r==="}")break;if(n!==3&&n!==2)throw new SyntaxError("Object keys must be identifiers or strings.");let p=r;o(),a(":"),u.push({key:p,value:s(1)})}while(i(","));a("}")}return{kind:"object",pairs:u}}if(d===4&&h==="["){o();let u=[];if(!i("]")){do{if(r==="]")break;u.push(s(1))}while(i(","));a("]")}return{kind:"array",items:u}}if(d===3){let u=h;if(o(),u==="true")return{kind:"literal",value:!0};if(u==="false")return{kind:"literal",value:!1};if(u==="null")return{kind:"literal",value:null};if(r==="("&&kn(u)){o();let p=[];if(!i(")")){do p.push(s(1));while(i(","));a(")")}return{kind:"call",fn:u,args:p}}return{kind:"id",name:u}}throw new SyntaxError("Unexpected end of expression.")}o();let f=s(1);if(n!==0)throw new SyntaxError("Unexpected trailing input in expression.");return f}function X(t){return t===E||t===null}function L(t){if(t===E||t===null||t===!1)return!1;if(t===!0)return!0;if(typeof t=="string")return t.length>0;if(typeof t=="number")return t!==0&&t===t;if(Array.isArray(t))return t.length>0;for(let e in t)if(Object.hasOwn(t,e))return!0;return!1}function ue(t){return typeof t=="number"&&t===t?t:E}function H(t,e){switch(t.kind){case"literal":return t.value;case"id":{let n=e.get(t.name);if(n===void 0)throw new ee(t.name);return n}case"member":{let n=H(t.object,e);if(X(n)||typeof n!="object"||Array.isArray(n))return E;let r=n[t.key];return r===void 0?E:r}case"index":{let n=H(t.object,e),r=H(t.index,e);if(X(n)||X(r))return E;if(Array.isArray(n)&&typeof r=="number"){let o=n[r];return o===void 0?E:o}if(typeof n=="object"&&typeof r=="string"){let o=n[r];return o===void 0?E:o}return E}case"unary":{let n=H(t.operand,e);if(t.op==="not")return!L(n);let r=ue(n);return r===E?E:-r}case"binary":return xn(t,e);case"call":return En(t,e);case"object":{let n={};for(let r of t.pairs)n[r.key]=H(r.value,e);return n}case"array":{let n=[];for(let r of t.items)n.push(H(r,e));return n}}}function xn(t,e){let{op:n}=t;if(n==="and")return L(H(t.left,e))&&L(H(t.right,e));if(n==="or")return L(H(t.left,e))||L(H(t.right,e));let r=H(t.left,e),o=H(t.right,e);if(n==="=")return r===o;if(n==="!=")return r!==o;if(n==="^="||n==="$="||n==="*=")return typeof r!="string"||typeof o!="string"?E:n==="^="?r.startsWith(o):n==="$="?r.endsWith(o):r.includes(o);let i=ue(r),a=ue(o);if(i===E||a===E)return E;switch(n){case"<":return i<a;case"<=":return i<=a;case">":return i>a;case">=":return i>=a;case"+":return i+a;case"-":return i-a;case"*":return i*a;case"/":return i/a;case"%":return i%a;default:return E}}function En(t,e){let{args:n,fn:r}=t,o=[];for(let a of n)o.push(H(a,e));if(r==="format"){let a=o[0];if(typeof a!="string")return E;let s=1;return a.replace(wn,()=>s<o.length?P(o[s++]):"%s")}for(let a=0;a<o.length;a+=1){let s=ue(o[a]);if(s===E)return E;o[a]=s}let i=o;switch(r){case"abs":return i.length===1?Math.abs(i[0]):E;case"round":return i.length===1?Math.round(i[0]):E;case"min":return i.length>0?Math.min(...i):E;case"max":return i.length>0?Math.max(...i):E;case"clamp":return i.length===3?Math.min(Math.max(i[0],i[1]),i[2]):E;default:return E}}var pt=new Map;function De(t){if(t.kind==="id")return t.name;if(t.kind==="member"){let e=De(t.object);return e===void 0?void 0:`${e}.${t.key}`}if(t.kind==="index"&&t.index.kind==="literal"){let e=t.index.value;if(typeof e!="string"&&typeof e!="number")return;let n=De(t.object);return n===void 0?void 0:`${n}.${e}`}}function O(t,e){let n=De(t);if(n!==void 0){e.includes(n)||e.push(n);return}switch(t.kind){case"literal":return;case"id":return;case"member":O(t.object,e);return;case"index":O(t.object,e),O(t.index,e);return;case"unary":O(t.operand,e);return;case"binary":O(t.left,e),O(t.right,e);return;case"call":for(let r of t.args)O(r,e);return;case"object":for(let r of t.pairs)O(r.value,e);return;case"array":for(let r of t.items)O(r,e)}}function Me(t,e){if(t.kind==="id")return e.push(t.name),!0;if(t.kind==="member")return Me(t.object,e)?(e.push(t.key),!0):!1;if(t.kind!=="index"||!Me(t.object,e))return!1;let n=t.index,r=n.kind==="literal"?n.value:void 0;return e.push(typeof r=="string"||typeof r=="number"?r:{kind:"index",expression:n}),!0}function fe(t){let e=pt.get(t);if(e!==void 0)return e;let n=Cn(t),r=[];return O(n,r),r.sort(),e={source:t,ast:n,dependencies:r},pt.set(t,e),e}function Pe(t,e){let n=[];if(!(!Me(fe(t).ast,n)||!e.has(n[0])))return n}function mt(t,e){return H(fe(t).ast,e)}function I(t,e){return H("ast"in t?t.ast:t,e)}function P(t){return X(t)?"":Array.isArray(t)?t.map(P).join(" "):typeof t=="object"?"":String(t)}function Rn(t){return t.startsWith("aria-")||t==="contenteditable"||t==="draggable"||t==="spellcheck"}function ht(t,e=""){return typeof t=="boolean"&&Rn(e)?String(t):X(t)||t===!1?null:t===!0?"":typeof t=="number"||typeof t=="string"?String(t):Array.isArray(t)?t.map(P).join(" "):null}var Tn=new Set(["href","src","action","formaction","poster","data","xlink:href"]),Sn=new Set(["base","embed","iframe","link","meta","object","script","style","template"]),Nn=new Set(["srcdoc","style"]);function te(t){let e=t.replace(/[\u0000-\u0020\u007f]+/g,"");return/^(?:data|javascript|vbscript):/i.test(e)}function ne(t){return Tn.has(t.toLowerCase())}function je(t,e,n){let r=e.createElement("template");r.innerHTML=t;for(let o of Array.from(r.content.querySelectorAll("*"))){if(n?.(o),Sn.has(o.localName)){o.remove();continue}for(let i of Array.from(o.attributes)){let a=i.name.toLowerCase();(a.startsWith("on")||Nn.has(a)||ne(a)&&te(i.value))&&o.removeAttribute(i.name)}}return r.content}var $n=/^(?:if|else-if|else|for|with|value|state|computed|data)$/,An=/^(?:@|v-|#|on:|use:|transition:|animate:)/,Hn=/^(?:innerhtml|outerhtml|srcdoc)$/,Dn=/^(?:base|embed|link|meta|object|script|style)$/;function yt(t){return $n.test(t)}function Le(t,e){return Dn.test(t.toLowerCase())&&y("HT009",`<${t}> is not permitted in rendered component markup.`,e),t}function Oe(t,e,n=""){let r=t.toLowerCase();return(r.startsWith("on")||An.test(r))&&y("HT010",`Literal attribute \`${t}\` uses target-framework directive syntax that is not supported.`,e),r==="srcdoc"&&y("HT007","Literal `srcdoc` is not permitted in a component definition.",e),ne(r)&&te(n)&&y("HT007",`Literal \`${t}\` contains an executable URL.`,e),t}function gt(t,e){let n=t.toLowerCase();return(n.startsWith("on")||Hn.test(n))&&y("HT007",`Dynamic ${t} requires a future trusted-content type.`,e),t}function z(t){return"tagName"in t}function re(t){return t.nodeName==="#text"}function N(t){return"localName"in t?t.localName:t.tagName}function pe(t){return"attrs"in t?t.attrs:t.attributes}function V(t){return(N(t)==="template"?t.content:void 0)?.childNodes??t.childNodes}function oe(t){return"value"in t?t.value:"nodeValue"in t?t.nodeValue??"":""}function vt(t){let e=[];for(let n of t)n.nodeName!=="#comment"&&(!re(n)||oe(n).trim()!=="")&&e.push(n);return e}function C(t,e){return"attrs"in t?t.attrs.find(n=>n.name===e)?.value:t.getAttribute(e)??void 0}function kt(t){let e="";for(let n of V(t))re(n)&&(e+=oe(n));return e}function Ct(t,e){let n=[];for(let r of V(t))z(r)&&N(r)===e&&n.push(r);return n}function xt(t,e){for(let n of V(t)){if(!z(n))continue;let r=N(n);r==="link"&&y("HL001","External definition dependencies require the application-owned graph resolver.",e),Le(r,e);for(let o of pe(n))/^on(?!:)/i.test(o.name)&&Oe(o.name,e,o.value);xt(n,e)}}var Mn=/^\$(?:if|each|where|sort|limit|key|with|match|when|else)$/,bt=/^(?:innerhtml|outerhtml|textcontent|innertext|srcdoc)$/,Pn=/^\s*([A-Za-z_$][\w$]*)\s*(?:,\s*([A-Za-z_$][\w$]*)\s*)?\bof\b\s*(.+)$/,wt=/^\s*(.+?)\s+\bas\b\s+([A-Za-z_$][\w$]*)\s*$/,Ie=/^[a-z][a-z0-9-]*$/,jn=/^(?:prevent|stop|self|once|passive|capture|left|middle|right|ctrl|shift|alt|meta|exact|enter|escape|space|tab|up|down)$/,qe=/^[A-Za-z_$][A-Za-z0-9_$-]*$/;function ze(t,...e){let n=new Set(t.roots);for(let r of e)r!==void 0&&n.add(r);return{roots:n,writableRoots:t.writableRoots,handlers:t.handlers}}function S(t,e,n){let r=Vn(t,n);return Ln(r,e,n),r}function Ln(t,e,n){for(let r of t.dependencies){let o=r.split(".",1)[0];e.roots.has(o)||y("HT003",`Expression root \`${o}\` is not declared in this scope.`,n)}}function On(t,e,n){let r=Object.create(null),o=(a,s)=>{r[a]??=s},i=a=>{for(let s of pe(a))if(s.name.startsWith(":"))/^[A-Za-z][A-Za-z0-9_-]*$/.test(s.value)&&o(s.value,{attribute:s.name.slice(1).toLowerCase()});else if(s.name.startsWith(".")){let c=s.name.slice(1).toLowerCase();if(/^[A-Za-z][A-Za-z0-9_-]*$/.test(s.value)){let l=n.resolveDomProperty(N(a),c)??(s.value.toLowerCase()===c?s.value:c);o(s.value,{property:l})}}for(let s of V(a))z(s)&&N(s)!=="slot"&&i(s)};return i(t),r}function In(t,e,n,r=!0){let o=Object.create(null),i=Object.create(null);if(t===void 0)return o;let a=Ct(t,"prop");a.sort((s,c)=>{let l=C(s,"name")??"",f=C(c,"name")??"";return l<f?-1:l>f?1:0});for(let s of a){let c=C(s,"name");(c===void 0||c==="")&&y("HC010","A <prop> requires a `name` attribute.",n),/^[A-Za-z][A-Za-z0-9_-]*$/.test(c)||y("HC010",`Invalid prop name \`${c}\`.`,n);let l=C(s,"type");(l===void 0||l==="")&&y("HC013",`Prop \`${c}\` requires a \`type\` attribute.`,n);let f=c.toLowerCase(),d=i[f];d!==void 0&&y("HC011",`Props \`${d}\` and \`${c}\` collide after lowercase normalization.`,n),i[f]=c;let h=e[c];h===void 0&&r&&y("HC018",`Prop \`${c}\` is declared but never bound in the markup.`,n),h??={attribute:c.toLowerCase()};let u=ut(l),p=C(s,"required")!==void 0,m=kt(s).trim();m===""&&y("HC003",`\`props.${c}.description\` must be a non-empty string.`,n),B(u)||y("HC017",`Prop \`${c}\` cannot be written as an HTML attribute; function, unknown, and trusted content types have no text form.`,n);let w=C(s,"default");p&&w!==void 0&&y("HC019",`Required prop \`${c}\` cannot also declare a default.`,n);let k={type:u,required:p,target:h,description:m};if(w!==void 0){let x=_(w,u);x.ok||y("HC015",`Default for prop \`${c}\` does not satisfy its type.`,n),k.default=x.value}o[c]=k}return o}function zn(t,e,n,r,o,i,a){let s=C(t,"component")??"";s.trim()===""&&y("HC003","`component` must be a non-empty string.",i),/^[a-z][a-z0-9]*(?:-[a-z0-9]+)+$/.test(s)||y("HC005","The `component` tag must be lowercase and contain a hyphen.",i);let c=C(t,"status");c!==void 0&&!/^(?:early|experimental|stable|deprecated)$/.test(c)&&y("HC007","Component `status` is not recognized.",i);let l=C(t,"summary");return l!==void 0&&l.trim()===""&&y("HC003","`summary` must be a non-empty string.",i),(!/^[a-z][a-z0-9-]*$/.test(n)||r&&!/^[a-z][a-z0-9]*(?:-[a-z0-9]+)+$/.test(n))&&y("HC008","`nativeElement` must be a lowercase HTML element or component tag.",i),{version:1,name:dt(s),tag:s,...c===void 0?{}:{status:c},...l===void 0?{}:{summary:l},nativeElement:n,props:In(e,o,i,a)}}function Vn(t,e){try{return fe(t)}catch{y("HT013",`Malformed expression \`${t}\`.`,e)}}function qn(t,e,n){let r=[];for(let o of vt(V(t))){z(o)||y("HC023","Handler bodies contain declarative step elements only.",n);let i=C(o,"$if"),a=i===void 0?void 0:S(i,e,n);if(N(o)==="set"){let s=C(o,"name")??"",c=C(o,":value"),l=C(o,"value");(s===""||c===void 0==(l===void 0))&&y("HC023","A <set> requires `name` and exactly one of `value` or `:value`.",n),S(s,e,n);let f=Pe(s,e.writableRoots);f===void 0&&y("HT005",`Handler write \`${s}\` is not rooted in declared state.`,n);let d={kind:"set",path:s,writablePath:f,value:S(c??JSON.stringify(l),e,n)};a!==void 0&&(d.guard=a),r.push(d);continue}if(N(o)==="dispatch"){let s=C(o,"event")??"";Ie.test(s)||y("HC023","A <dispatch> requires a valid `event` name.",n);let c=C(o,":value"),l=C(o,"value");c!==void 0&&l!==void 0&&y("HC023","A <dispatch> may declare only one of `value` or `:value`.",n);let f=c===void 0&&l===void 0?void 0:S(c??JSON.stringify(l),e,n),d={kind:"dispatch",event:s};f!==void 0&&(d.value=f),a!==void 0&&(d.guard=a),r.push(d);continue}if(N(o)==="validate"||N(o)==="focus"){let s=C(o,"target")??C(o,"ref")??C(o,"name")??"";qe.test(s)||y("HC023",`<${N(o)}> requires a valid target reference.`,n);let c={kind:N(o),target:s};a!==void 0&&(c.guard=a),r.push(c);continue}y("HC023",`<${N(o)}> is not a recognized handler step.`,n)}return r}function Un(t,e,n){let r=[],o=new Set(Object.keys(e.props)),i=new Set,a=new Set;if(t===void 0)return{declarations:r,scope:{roots:o,writableRoots:i,handlers:a}};let s=[],c=new Set,l=new Set;for(let d of V(t)){if(!z(d))continue;let h=d;s.push(h);let u=N(h);/^(?:prop|state|computed|data|handler|event|method)$/.test(u)||y("HC021",`<${u}> is not a recognized definition declaration.`,n);let p=C(h,"name")??"";if(p===""&&y("HC010",`A <${u}> requires a \`name\` attribute.`,n),u==="event"){l.has(p)&&y("HC020",`Event \`${p}\` is declared more than once.`,n),l.add(p);continue}c.has(p)&&y("HC020",`Declaration \`${p}\` collides in the flat component scope.`,n),c.add(p),o.add(p),u==="state"?i.add(p):u==="handler"&&a.add(p)}let f={roots:o,writableRoots:i,handlers:a};for(let d of s){let h=N(d);if(h==="prop")continue;let u=C(d,"name");if(h==="state"){let p=C(d,":value"),m=C(d,"value");p!==void 0&&m!==void 0&&y("HC013",`<state name="${u}"> may declare only one of \`value\` or \`:value\`.`,n);let w=p===void 0&&m===void 0?void 0:S(p??JSON.stringify(m),f,n),k={kind:h,name:u};m!==void 0&&(k.value=m),w!==void 0&&(k.expression=w),r.push(k);continue}if(h==="computed"){let p=C(d,"from");(p===void 0||p==="")&&y("HC013",`<computed name="${u}"> requires a \`from\` expression.`,n),r.push({kind:h,name:u,expression:S(p,f,n)});continue}if(h==="data"){let p=C(d,"src"),m=C(d,"type"),w=C(d,"debounce"),k=C(d,"poll"),x=[],g=new Set;for(let v of Ct(d,"param")){let R=C(v,"name")??"",T=C(v,":value");(!qe.test(R)||T===void 0)&&y("HC024","A data <param> requires a valid `name` and a `:value` expression.",n),g.has(R)&&y("HC024",`Data source \`${u}\` repeats a parameter name.`,n),g.add(R),x.push({name:R,expression:S(T,f,n)})}let b={kind:h,name:u,parameters:x};p!==void 0&&(b.source=p),m!==void 0&&(b.type=m),w!==void 0&&(b.debounce=w),k!==void 0&&(b.poll=k),r.push(b);continue}if(h==="event"){r.push({kind:h,name:u,type:C(d,"type")??"object",bubbles:C(d,"bubbles")!=="false",composed:C(d,"composed")!=="false",cancelable:C(d,"cancelable")==="true"});continue}if(h==="method"){r.push({kind:h,name:u,exportName:C(d,"export")??u,returns:C(d,"returns")??"undefined"});continue}r.push({kind:"handler",name:u,steps:qn(d,f,n)})}for(let d of r)if(d.kind==="handler")for(let h of d.steps)h.kind==="dispatch"&&!l.has(h.event)&&y("HC023",`Handler \`${d.name}\` dispatches undeclared component event \`${h.event}\`.`,n);return{declarations:r,scope:f}}function Bn(t,e,n,r,o,i){let a=[];for(let s of t){if(s.name.startsWith("bind:")){let c=s.name.slice(5).toLowerCase();(c===""||bt.test(c))&&y("HT007",`Two-way binding cannot target \`${c||s.name}\`.`,o);let l=S(s.value,r,o),f=Pe(s.value,r.writableRoots);f===void 0&&y("HT005",`\`${s.value}\` is not a writable state-rooted path.`,o),a.push({kind:"attribute",name:c,expression:s.value,expressionPlan:l,twoWay:!0,writablePath:f});continue}if(s.name.startsWith("class:")||s.name.startsWith("style:")){let c=s.name.startsWith("class:")?"class":"style",l=s.name.slice(c.length+1);(c==="class"?l!==""&&!/\s/.test(l):/^(?:--[a-z0-9_-]+|[a-z][a-z0-9-]*)$/.test(l))||y("HT020",`\`${s.name}\` does not name a valid ${c} binding target.`,o),a.push({kind:"attribute",name:l,expression:s.value,expressionPlan:S(s.value,r,o),target:c});continue}if(s.name.startsWith("$")){let c=s.name.slice(1).toLowerCase();c!=="value"&&c!=="html"&&y("HT012",`\`$${c}\` is not a known content directive.`,o),a.push({kind:"directive",name:c,expression:s.value,expressionPlan:S(s.value,r,o)});continue}if(s.name.startsWith(":")){let c=s.name.slice(1).toLowerCase();bt.test(c)&&y("HT007",`\`:${c}\` cannot bind a raw content sink.`,o);let l=S(s.value,r,o);a.push({kind:"attribute",name:c,expression:s.value,expressionPlan:l});continue}if(s.name.startsWith(".")){let c=s.name.slice(1).toLowerCase(),l=S(s.value,r,o),f=i.resolveDomProperty(e,c);f===void 0&&y("HP001",`\`${c}\` is not a native property of <${e}>.`,o),gt(f,o),a.push({kind:"property",key:c,name:f,expression:s.value,expressionPlan:l});continue}Oe(s.name,o,s.value),a.push({kind:"literal",name:s.name,value:s.value})}return a}function _n(t,e,n){if(t===void 0)return;let r=[];for(let o of t){let[i="",...a]=o.name.slice(3).split(".");(!Ie.test(i)||a.some(s=>!Ie.test(s)))&&y("HT010",`\`${o.name}\` is not a valid declarative event binding.`,n);for(let s=0;s<a.length;s+=1){let c=a[s];a.indexOf(c)!==s&&y("HT010",`\`${o.name}\` repeats an event modifier.`,n),jn.test(c)||y("HT010",`\`${o.name}\` contains an unsupported event modifier.`,n)}a.includes("passive")&&a.includes("prevent")&&y("HT010",`\`${o.name}\` cannot combine passive and prevent.`,n),e.handlers.has(o.value)||y("HT010",`Event binding \`${o.name}\` names undeclared handler \`${o.value}\`.`,n),r.push({name:i,handler:o.value,modifiers:a})}return r}function Wn(t,e,n){if(t!==void 0)return qe.test(t)||y("HT019","`$ref` requires a valid non-empty name.",n),e.has(t)&&y("HT019",`Reference \`${t}\` is duplicated.`,n),e.add(t),t}function Fn(t,e,n){if(t===void 0)return;let r=[],o=[];t.$if!==void 0&&r.push("$if"),t.$each!==void 0&&r.push("$each"),t.$with!==void 0&&r.push("$with"),t.$match!==void 0&&r.push("$match"),t.$when!==void 0&&r.push("$when"),t.$else!==void 0&&r.push("$else"),t.$where!==void 0&&o.push("$where"),t.$sort!==void 0&&o.push("$sort"),t.$limit!==void 0&&o.push("$limit"),t.$key!==void 0&&o.push("$key"),r.length>1&&y("HT014",`An element carries one structural directive; found ${r.join(", ")}.`,n);let i=t.$each;i===void 0&&o.length>0&&y("HT014",`${o.join(", ")} may only modify \`$each\`.`,n);let a=t.$if;if(a!==void 0){let f=a;return{kind:"if",test:f,testPlan:S(f,e,n)}}let s=t.$with;if(s!==void 0){let f=wt.exec(s);return f===null&&y("HT015","`$with` must be written `expr as name`.",n),{kind:"with",expr:f[1],expressionPlan:S(f[1],e,n),alias:f[2]}}if(i!==void 0){let f=Pn.exec(i);f===null&&y("HT016","`$each` must be written `item of items` (optionally `item, i of items`).",n);let d=f[1],h=f[2];(e.roots.has(d)||h!==void 0&&e.roots.has(h))&&y("HC020","Loop locals may not collide with an existing scope name.",n);let u=ze(e,d,h,"loop"),p={kind:"each",item:d,list:f[3],listPlan:S(f[3],e,n)};h!==void 0&&(p.index=h);let m=t.$where;m!==void 0&&(p.where=m,p.wherePlan=S(m,u,n)),t.$sort!==void 0&&(p.sort=t.$sort);let w=t.$limit;w!==void 0&&(p.limit=w,p.limitPlan=S(w,u,n));let k=t.$key;return k!==void 0&&(p.key=k,p.keyPlan=S(k,u,n)),p}let c=t.$match;if(c!==void 0){let f=c.trim();if(f==="")return{kind:"match"};let d=wt.exec(f);return d===null&&y("HT017","`$match` scope must be written `expr as name`.",n),{kind:"match",expr:d[1],expressionPlan:S(d[1],e,n),alias:d[2]}}let l=t.$when;if(l!==void 0){let f=l;return{kind:"when",test:f,testPlan:S(f,e,n)}}if(t.$else!==void 0)return{kind:"else"}}function Ve(t,e,n,r,o,i){let a=N(t);yt(a)&&y("HT009",`<${a}> is reserved but not supported by this profile.`,r),Le(a,r);let s,c=[],l,f;for(let g of pe(t))Mn.test(g.name)?(s??={})[g.name]=g.value:g.name==="$ref"?f=g.value:g.name.startsWith("on:")?(l??=[]).push(g):g.name!=="as"&&c.push(g);let d=Fn(s,n,r),h=d?.kind==="each"?ze(n,d.item,d.index,"loop"):d?.kind==="with"||d?.kind==="match"&&d.alias!==void 0?ze(n,d.alias):n,u=Bn(c,a,e,h,r,i),p=_n(l,h,r),m=Wn(f,o.refs,r),w=[],k=V(t);for(let g of k)if(g.nodeName!=="#comment"){if(re(g)){let b=oe(g);b.trim()!==""&&w.push({kind:"text",value:b});continue}if(z(g)){if(N(g)==="slot"){let b=C(g,"name"),v=C(g,":name");b!==void 0&&v!==void 0&&y("HT008","A slot cannot declare both `name` and `:name`.",r);for(let M of pe(g))M.name!=="name"&&M.name!==":name"&&y("HT008","A slot has an unsupported attribute.",r);b===void 0&&v===void 0&&(o.defaults+=1,o.defaults>1&&y("HT008","A component may declare one default slot.",r)),b!==void 0&&((b===""||o.names.has(b))&&y("HT008",`Slot name \`${b}\` is empty or duplicated.`,r),o.names.add(b));let R=[];for(let M of V(g))if(M.nodeName!=="#comment")if(re(M)){let ae=oe(M);ae.trim()!==""&&R.push({kind:"text",value:ae})}else z(M)&&R.push(Ve(M,e,h,r,o,i));let A={dynamic:v!==void 0,required:R.length===0};if(b!==void 0&&(A.name=b),o.contracts.push(A),b===void 0&&v===void 0&&R.length===0)w.push({kind:"slot"});else{let M={kind:"slot",fallback:R};b!==void 0&&(M.name=b),v!==void 0&&(M.nameExpression=S(v,h,r)),w.push(M)}continue}w.push(Ve(g,e,h,r,o,i))}}if(u.some(g=>g.kind==="directive")&&w.length>0&&y("HT006","A content directive cannot coexist with children.",r),u.some(g=>g.kind==="property"&&g.name==="textContent")&&w.length>0&&y("HT006","A content-replacing property binding cannot coexist with children.",r),d?.kind==="match"){let g=0;for(let v of w)v.kind==="element"&&(g+=1);let b=!1;for(let v of w)v.kind==="element"&&(g-=1,v.flow?.kind==="when"?b&&y("HT018","A `$when` arm may not follow `$else`.",r):v.flow?.kind==="else"?(b&&y("HT018","A `$match` has at most one `$else`.",r),b=!0,g!==0&&y("HT018","`$else` must be the last arm.",r)):y("HT018","Every direct child of a `$match` must be a `$when` or `$else` arm.",r))}let x={kind:"element",name:a,attributes:u,children:w};return d!==void 0&&(x.flow=d),p!==void 0&&(x.events=p),m!==void 0&&(x.ref=m),x}function Et(t,e,n){let r=vt(t);(r.length!==1||!z(r[0])||N(r[0])!=="template"||C(r[0],"component")===void 0)&&y("HS001","A source must contain exactly one top-level <template component>.",e);let o=r[0],i,a=!1,s,c;for(let b of V(o)){if(b.nodeName==="#comment"||re(b)&&oe(b).trim()==="")continue;z(b)||y("HT001","A component's markup must be exactly one element root.",e);let v=N(b);v==="props"||v==="defs"?(i!==void 0&&y("HS002","A component has one optional declaration group, one markup root, and one optional <style>.",e),i=b,a=v==="props",xt(b,e)):v==="style"?(s!==void 0&&y("HS002","A component has one optional declaration group, one markup root, and one optional <style>.",e),s=b):c===void 0?c=b:y("HT001","A component's markup must be exactly one element root.",e)}c===void 0&&y("HT001","A component's markup must be exactly one element root.",e);let l=N(c),f=(C(c,"as")??l).split("|");for(let b=f.length-1;b>=0;b-=1)f[b]=f[b].trim(),f[b]===""&&f.splice(b,1);let d=!n.isNativeElement(l);d&&C(c,"as")!==void 0&&y("HT021","A delegated component root cannot also declare native `as` choices.",e),!d&&(f.length===0||!f.includes(l)||f.some((b,v)=>f.indexOf(b)!==v)||f.some(b=>!n.isNativeElement(b)))&&y("HT021","A polymorphic root must list unique native choices including its markup root.",e);let h=On(c,e,n),u=zn(o,i,l,d,h,e,a),{declarations:p,scope:m}=Un(a?void 0:i,u,e),w={defaults:0,names:new Set,contracts:[],refs:new Set},k=Ve(c,u,m,e,w,n),x=C(o,"controller");x===""&&y("HC022","A controller specifier cannot be empty.",e);let g={source:{file:e},contract:u,template:k,css:s===void 0?"":kt(s).trim(),declarations:p,slots:w.contracts,root:d?{kind:"component",tag:l}:{kind:"native",element:l,choices:f}};return x!==void 0&&(g.controller=x),J(g)}var Rt=new WeakMap;function Gn(t){let e={},n={},r=o=>{if(o.includes("-"))return!1;if(Object.hasOwn(e,o))return e[o];let i=t.createElement(o),a=t.defaultView?.HTMLUnknownElement,s=a===void 0?i.constructor.name!=="HTMLUnknownElement":!(i instanceof a);return e[o]=s,s};return{isNativeElement:r,resolveDomProperty(o,i){if(!r(o))return;let a=`${o}:${i}`;if(a in n)return n[a]||void 0;let s=t.createElement(o),c=i.toLowerCase();for(;s!==null;){for(let l of Object.getOwnPropertyNames(s))if(l.toLowerCase()===c)return n[a]=l,l;s=Object.getPrototypeOf(s)}n[a]=""}}}function Ue(t,e=t.ownerDocument.URL){(t.localName!=="template"||!t.hasAttribute("component"))&&y("HS001","A browser component carrier must be a <template component>.",e);let n=t.ownerDocument,r=Rt.get(n);return r===void 0&&(r=Gn(n),Rt.set(n,r)),Et([t],e,r)}function Tt(t,e,n){let r=n.createElement("template");r.innerHTML=t;let o;for(let a of r.content.childNodes)a.nodeType===1&&a.localName==="template"&&a.hasAttribute("component")&&(o!==void 0&&y("HS001","A component resource must contain exactly one <template component>.",e),o=a);o===void 0&&y("HS001","A component resource must contain exactly one <template component>.",e);let i=[];for(let a of r.content.childNodes){if(a===o||a.nodeType===8||a.nodeType===3&&(a.nodeValue??"").trim()==="")continue;(a.nodeType!==1||a.localName!=="link"||a.getAttribute("rel")!=="component")&&y("HT009","A component resource may contain only dependency links and one inert carrier.",e);let s=a.getAttribute("href");(s===null||s.trim()==="")&&y("HL006","A component dependency link requires a non-empty `href`.",e),i.push(s)}return{definition:Ue(o,e),dependencies:i}}var me=class{#e=new Map;#t=new Map;define(e,n){this.#e.has(e)&&y("HR001",`More than one definition declares <${e}>.`),this.#e.set(e,Object.freeze(n));for(let r of this.#t.get(e)??[])r();this.#t.delete(e)}get(e){return this.#e.get(e)}whenDefined(e){return this.#e.has(e)?Promise.resolve():new Promise(n=>{let r=this.#t.get(e)??[];r.push(n),this.#t.set(e,r)})}addGraph(e,n){for(let r of e.nodes.values())r.shadowedByCustomElement||this.define(r.definition.contract.tag,{node:r,...r.controller===void 0||n===void 0?{}:{loadController:()=>n(r)}})}};var St=/^(?:[A-Za-z][A-Za-z\d+.-]*:|\/|\.\.?\/)/;function Nt(t){return new URL("./",t).href}function Zn(t,e){return t.endsWith("/")?e:Nt(e)}var he=class{#e;#t;constructor(e={},n="file:///"){this.#e=new URL(n).href,this.#t=new Map(Object.entries(e.imports??{}).map(([r,o])=>[r,new URL(o,this.#e).href]))}resolveRoot(e){if(St.test(e)){let n=new URL(e,this.#e).href;return Object.freeze({url:n,trustRoot:Nt(n)})}return this.#n(e)}resolveDependency(e,n,r){if(!St.test(e))return this.#n(e);let o=new URL(e,n).href;return Object.freeze({url:o,trustRoot:r})}assertFinalURL(e,n){return new URL(n,e.url).href}#n(e){let n=this.#t.get(e);if(n!==void 0)return Object.freeze({url:n,trustRoot:Zn(e,n),mapping:e});let r=Array.from(this.#t.keys()).filter(i=>i.endsWith("/")&&e.startsWith(i)).sort((i,a)=>a.length-i.length)[0];r===void 0&&y("HL002",`Bare resource specifier \`${e}\` is not mapped by the application.`);let o=this.#t.get(r);return Object.freeze({url:new URL(e.slice(r.length),o).href,trustRoot:o,mapping:r})}};var $t=new Map;function Be(t,e=n=>import(n)){let n=t.controller;if(n===void 0)return Promise.reject(new TypeError(`<${t.definition.contract.tag}> does not declare a controller.`));let r=$t.get(n.url);return r===void 0&&(r=e(n.url).then(o=>{let i=o?.default;return typeof i!="function"&&y("HJ002",`Controller module \`${n.url}\` must default-export a function.`,t.url),Object.freeze({...o,default:i})}).catch(o=>{if(o instanceof Error&&"diagnostic"in o)throw o;y("HJ001",`Controller module \`${n.url}\` failed to load: ${o instanceof Error?o.message:String(o)}.`,t.url)}),$t.set(n.url,r)),r}async function At(t,e=n=>import(n)){return(await Be(t,e)).default}function Kn(t,e,n){let r=new Set,o=t.replace(/\{([A-Za-z_$][A-Za-z0-9_$-]*)\}/g,(a,s)=>{r.add(s);let c=n[s];return c==null?"":encodeURIComponent(String(c))}),i=new URL(o,e);for(let[a,s]of Object.entries(n))if(!(r.has(a)||s==null))if(Array.isArray(s))for(let c of s)i.searchParams.append(a,String(c));else i.searchParams.set(a,String(s));return i.href}var ye=class{constructor(e){this.options=e;this.#e=e.fetch??globalThis.fetch.bind(globalThis),this.#t=e.setTimer??((n,r)=>setTimeout(n,r)),this.#n=e.clearTimer??(n=>clearTimeout(n))}options;#e;#t;#n;#o={};#i;#r;#c=0;#s=!1;update(e){this.#o={...e},this.#s=!0,this.#a();let n=++this.#c,r=()=>{this.#l(n)};(this.options.debounce??0)>0?this.#r=this.#t(r,this.options.debounce):r()}disconnect(){this.#s&&(this.#s=!1,this.#c+=1,this.#a())}#a(){this.#i?.abort(),this.#i=void 0,this.#r!==void 0&&this.#n(this.#r),this.#r=void 0}#d(e){return!this.#s||e!==this.#c}async#l(e){if(this.#d(e))return;let n=new AbortController;this.#i=n;let r=this.options;r.onState({pending:!0,value:null,error:null,ok:!1});try{let o=await this.#e(Kn(r.source,r.baseURL,this.#o),{signal:n.signal});if(!o.ok)throw new TypeError(`Request failed with ${o.status}.`);let i=r.type==="text"?await o.text():await o.json(),a=r.adapt===void 0?i:r.adapt(i);if(this.#d(e))return;r.onState({pending:!1,value:a,error:null,ok:!0})}catch(o){if(n.signal.aborted||this.#d(e))return;r.onState({pending:!1,value:null,error:o,ok:!1})}finally{this.#i===n&&(this.#i=void 0),!this.#d(e)&&(r.poll??0)>0&&(this.#r=this.#t(()=>{this.#l(e)},r.poll))}}};var $,Jn=0,Ht=100,_e=new WeakMap,ge=new WeakMap;function Dt(t){let{dependency:e,previousSubscriber:n,nextSubscriber:r}=t;n===void 0?e.first=r:n.nextSubscriber=r,r===void 0?e.last=n:r.previousSubscriber=n}function Mt(t){if(t.length>8)return[];for(;t.length>0;)t.pop();return t}var We=class{#e=[];#t=[];#n=!1;#o=!1;enqueue(e){e.stopped||e.queued||(e.queued=!0,this.#e.push(e),!this.#n&&!this.#o&&(this.#n=!0,queueMicrotask(()=>{this.#n=!1,this.flush()})))}enqueueDependency(e){if(this.#o||this.#e.length>0)return!1;for(let n=e.first;n!==void 0;n=n.nextSubscriber){let r=n.effect;if(r.scheduler!==this){for(let o of this.#e)o.queued=!1;return this.#e=[],!1}r.queued||(r.queued=!0,this.#e.push(r))}return this.#n||(this.#n=!0,queueMicrotask(()=>{this.#n=!1,this.flush()})),!0}flush(){this.#o||this.#e.length===0||this.#i()}#i(){this.#o=!0;let e=0,n,r=0;try{for(;this.#e.length>0;){if(e+=1,e>Ht){for(let o of this.#e)o.queued=!1;this.#e=[],y("HR006","A reactive flush exceeded the propagation-depth limit.")}if(n=this.#e,n.length>1){let o=1,i=n[0];for(;o<n.length;){let a=n[o];if(i.priority>a.priority||i.priority===a.priority&&i.id>a.id)break;i=a,o+=1}o<n.length&&n.sort((a,s)=>a.priority-s.priority||a.id-s.id)}this.#e=this.#t,r=0;do{let o=n[r];if(o.queued=!1,r+=1,o.computed===void 0?o.execute():o.computed.refresh(),this.#e.length===1&&r===n.length&&this.#e[0].computed===void 0){e+=1,e>Ht&&(this.#e[0].queued=!1,this.#e=[],y("HR006","A reactive flush exceeded the propagation-depth limit."));let i=this.#e;this.#e=Mt(n),n=i,r=0}else this.#e.length>0&&this.#r(n,r)}while(r<n.length);this.#t=Mt(n),n=void 0}}finally{if(n!==void 0){for(;r<n.length;)n[r++].queued=!1;this.#t=[]}if(this.#e.length>0){for(let o of this.#e)o.queued=!1;this.#e=[]}this.#o=!1}}#r(e,n){if(this.#e.some(r=>r.computed!==void 0))for(let r=e.length-1;r>=n;r-=1){let o=e[r];o.computed===void 0&&(e.splice(r,1),this.#e.push(o))}}},be=class{constructor(e,n,r,o){this.scheduler=e;this.run=n;this.priority=r;this.computed=o}scheduler;run;priority;computed;id=Jn++;dependencies=void 0;stopped=!1;paused=!1;queued=!1;#e=void 0;#t=void 0;execute(){if(this.stopped||this.paused)return;if(this.#t=void 0,this.#e!==void 0){let n=this.#e;this.#e=void 0,n()}let e=$;$=this;try{let n=this.run();n!==void 0&&(this.#e=n)}finally{$=e;let n=this.#t,r=n===void 0?this.dependencies:n.nextDependency;for(n===void 0?this.dependencies=void 0:n.nextDependency=void 0;r!==void 0;){let o=r.nextDependency;Dt(r),r=o}}}track(e){let n=this.#t===void 0?this.dependencies:this.#t.nextDependency;if(n?.dependency===e){this.#t=n;return}for(let i=this.dependencies;i!==n;i=i?.nextDependency)if(i?.dependency===e)return;let r={dependency:e,effect:this,nextDependency:n,previousSubscriber:void 0,nextSubscriber:void 0};this.#t===void 0?this.dependencies=r:this.#t.nextDependency=r,this.#t=r;let o=e.first;if(this.computed!==void 0&&o!==void 0)r.nextSubscriber=o,o.previousSubscriber=r,e.first=r;else{let i=e.last;r.previousSubscriber=i,i===void 0?e.first=r:i.nextSubscriber=r,e.last=r}}schedule(){if(this.computed!==void 0){this.computed.invalidate();return}this.paused||this.scheduler.enqueue(this)}pause(){this.stopped||this.paused||(this.paused=!0,this.#n(),this.#e?.(),this.#e=void 0)}resume(){this.stopped||!this.paused||(this.paused=!1,this.execute())}stop(){this.stopped||(this.stopped=!0,this.#n(),this.#e?.(),this.#e=void 0)}#n(){let e=this.dependencies;for(;e!==void 0;){let n=e.nextDependency;Dt(e),e=n}this.dependencies=void 0,this.#t=void 0}},Fe=class{#e={first:void 0,last:void 0};#t;constructor(e){this.#t=e}get(){return $!==void 0&&$.track(this.#e),this.#t}set(e){Object.is(this.#t,e)||(this.#t=e,W(this.#e))}update(e){this.set(e(this.#t))}},we=class{#e;#t;#n;#o;#i=!1;#r=!0;#c=!1;#s=!1;constructor(e,n,r={first:void 0,last:void 0}){this.#e=r,this.#t=n,this.#n=new be(e,()=>this.#l(),0,this)}get(){return this.#n.paused||this.#n.stopped?this.#d():(this.#a(),$!==void 0&&$.track(this.#e),this.#o)}invalidate(){if(!(this.#n.stopped||this.#r)){this.#r=!0;for(let e=this.#e.first;e!==void 0;e=e.nextSubscriber)if(e.effect.computed===void 0){this.#n.scheduler.enqueue(this.#n);return}W(this.#e)}}refresh(){this.#a()}pause(){this.#n.stopped||this.#n.paused||(this.#r=!0,this.#n.pause())}resume(){this.#n.stopped||!this.#n.paused||(this.#n.paused=!1)}stop(){this.#n.stop()}#a(){if(this.#c&&y("HR006","A reactive computed value depends on itself."),!this.#r||this.#n.stopped||this.#n.paused)return;let e=this.#i;this.#n.execute(),e&&this.#s&&W(this.#e,$?.computed===void 0?void 0:$)}#d(){this.#c&&y("HR006","A reactive computed value depends on itself.");let e=$;this.#c=!0,$=void 0;try{return this.#t()}finally{$=e,this.#c=!1}}#l(){this.#c=!0,this.#r=!1;try{let e=this.#t();this.#s=!this.#i||!Object.is(this.#o,e),this.#o=e,this.#i=!0}catch(e){throw this.#r=!0,e}finally{this.#c=!1}}};function W(t,e){let n=t?.first;if(n===void 0)return;let r=n!==t.last;if(!r&&n.effect.computed!==void 0){n.effect!==e&&n.effect.computed.invalidate();return}if(n.effect.computed===void 0){if(e===void 0&&r&&n.effect.scheduler.enqueueDependency(t))return;for(let o=n;o!==void 0;){let i=o.nextSubscriber;o.effect!==e&&o.effect.schedule(),o=i}return}for(let o=n;o!==void 0;){let i=o.nextSubscriber;o.effect!==e&&o.effect.schedule(),o=i}}function Pt(t){return new Fe(t)}function jt(t,e){return new we(t,e)}function F(t,e,n=1,r=!0){let o=new be(t,e,n);return r?o.execute():o.paused=!0,o}var ve=class t{constructor(e=[],n=new We,r){this.scheduler=n;this.parent=r;for(let[o,i]of e)this.set(o,i)}scheduler;parent;#e=new Map;#t;#n;has(e){return this.#o(e)!==void 0||this.parent?.has(e)===!0}get(e){let n=this.#o(e);return n===void 0?this.parent?.get(e):($!==void 0&&$.track(n),n.value)}set(e,n){let r=this.#r(n),o=this.#o(e);if(o===void 0){o={value:r,first:void 0,last:void 0},this.#e.set(e,o),this.#n=o;return}Object.is(o.value,r)||(o.value=r,W(o))}defineComputed(e,n){let r=this.#o(e);r===void 0&&(r={value:null,first:void 0,last:void 0},this.#e.set(e,r),this.#n=r);let o=new we(this.scheduler,()=>this.#r(n()),r);return r.computed=o,Object.hasOwn(this,"get")||(this.get=this.#i),o}fork(e=[]){return new t(e,this.scheduler,this)}#o(e){return e!==this.#t&&(this.#t=e,this.#n=this.#e.get(e)),this.#n}#i(e){let n=this.#o(e);return n===void 0?this.parent?.get(e):n.computed!==void 0?n.computed.get():($!==void 0&&$.track(n),n.value)}#r(e){if(e===null||typeof e!="object")return e;let n=_e.get(e);if(n!==void 0)return n;let r=new Proxy(e,{get:(o,i,a)=>{if($!==void 0){let s=ge.get(o);s===void 0&&(s=new Map,ge.set(o,s));let c=s.get(i);c===void 0&&(c={first:void 0,last:void 0},s.set(i,c)),$.track(c)}return this.#r(Reflect.get(o,i,a))},set:(o,i,a,s)=>{let c=Reflect.get(o,i,s),l=this.#r(a),f=Reflect.set(o,i,l,s);return Object.is(c,l)||W(ge.get(o)?.get(i)),f},deleteProperty:(o,i)=>{let a=Reflect.has(o,i),s=Reflect.deleteProperty(o,i);return a&&W(ge.get(o)?.get(i)),s}});return _e.set(e,r),_e.set(r,r),r}};var Qn=/\/\*[\s\S]*?\*\/|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|--[\w-]+\s*:[^;{}]*|:(user-invalid|invalid|valid)(?![\w-])/g;function Lt(t){return t.replace(Qn,(e,n)=>n===void 0?e:`:is(:${n}, [data-${n}])`)}var G="data-component",ke="data-slotted";function It(t,e,n){let r=new Set((t.getAttribute(e)??"").split(/\s+/).filter(Boolean));r.add(n),t.setAttribute(e,Array.from(r).join(" "))}function Ce(t){t.nodeType===1&&t.setAttribute(ke,"")}function Ge(t){return`data-${t}-state`}var Ot={slotted:"[--slotted]",state:"[--state]"},Yn=/\/\*[\s\S]*?\*\/|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|:(slotted|host-state)\(/g;function Xn(t,e=["slotted","host-state"]){return t.replace(Yn,(n,r)=>r===void 0||!e.includes(r)?n:`:where(${r==="slotted"?Ot.slotted:Ot.state}):is(`)}function er(t){return/:where\(\s*\[--slotted\]\s*\)/.test(t)?"slotted":"own"}function tr(t,e){let n=0;for(let r=e;r<t.length;r+=1){let o=t[r];if(o==='"'||o==="'"){let i=t.indexOf(o,r+1);r=i===-1?t.length:i}else if(o==="(")n+=1;else if(o===")"&&--n===0)return r}return t.length}var nr=/\[\s*([\w-]+)\s*(?:=\s*(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|([^\]\s]+))\s*)?\]/g;function rr(t,e,n,r){let o="";for(let i of t.matchAll(nr)){let a=r(i[1]),s=i[2]??i[3]??i[4];n.add(a),o+=`[${Ge(e)}~="${s===void 0?a:`${a}=${encodeURIComponent(s)}`}"]`}return o}function or(t){let e="";for(let n=0;n<t.length;n+=1){let r=t[n];if(r==="["){let s=t.indexOf("]",n),c=s===-1?t.length:s+1;e+=t.slice(n,c),n=c-1;continue}let o=e.at(-1),a=o===void 0||/[\s>+~(,]/.test(o)?/^[a-z][a-z0-9]*(?:-[a-z0-9]+)+(?![\w-]|\()/.exec(t.slice(n))?.[0]:void 0;if(a!==void 0){e+=`:is(${a}, :where([${G}~="${a}"]))`,n+=a.length-1;continue}e+=r}return e}function ir(t,e,n,r,o=i=>i){/:scope(?![\w-])/.test(t)&&y("HY003",`\`:scope\` is not part of component styles; select the root with \`:host\` (in <${e}>).`);let i="",a=0,s=/:where\(\s*\[--state\]\s*\):is\(/g;for(let c=s.exec(t);c!==null;c=s.exec(t)){let l=c.index+c[0].length-1,f=tr(t,l);i+=`${t.slice(a,c.index)}${n}${rr(t.slice(l+1,f),e,r,o)}`,a=f+1,s.lastIndex=a}return i+=t.slice(a),i=i.replace(/:where\(\s*\[--slotted\]\s*\):is\(/g,`:where([${ke}], [${ke}] *):is(`).replace(/:host(?![\w-])/g,n),or(Lt(i))}function sr(t,e,n,r){let o=`[${G}~="${t}"]`;return[r,e.trim()===""?"":`@scope (${o}) to ([${G}], [${ke}]) {
1
+ var K=class extends Error{diagnostic;constructor(e){let n=e.source?`${e.source}: `:"";super(`${n}${e.code}: ${e.message}`),this.name="HtmlDiagnosticError",this.diagnostic=Object.freeze({...e})}};function y(t,e,n){throw new K(n===void 0?{code:t,message:e}:{code:t,message:e,source:n})}function ct([t],[e]){return t.localeCompare(e)}async function dt(t,e){let n=new Map,r=new Map,o=new Map,i=async c=>{let l=new URL(c.url).href,f=r.get(l)??l,d=n.get(f);if(d!==void 0)return d.url;let h;try{h=await e.fetchComponent(l)}catch(g){if(g instanceof K)throw g;y("HL009",`Component \`${l}\` failed to load: ${g instanceof Error?g.message:String(g)}.`,l)}let u=e.resolver.assertFinalURL(c,h.url,l);r.set(l,u);let p=n.get(u);if(p!==void 0)return p.url;let m=e.parseComponentResource(h.source,u),w=m.definition,C=o.get(w.contract.tag);C!==void 0&&C!==u&&y("HL007",`Both \`${C}\` and \`${u}\` declare <${w.contract.tag}>.`,u),o.set(w.contract.tag,u);let k={url:u,trustRoot:c.trustRoot,definition:w,dependencies:[],shadowedByCustomElement:e.isCustomElementRegistered?.(w.contract.tag)??!1,complete:!1};if(n.set(u,k),w.controller!==void 0){let g=e.resolver.resolveDependency(w.controller,u,c.trustRoot);k.controller=Object.freeze({specifier:w.controller,url:g.url})}for(let g of m.dependencies){let b=e.resolver.resolveDependency(g,u,c.trustRoot),v=await i(b);k.dependencies.includes(v)||k.dependencies.push(v)}return k.complete=!0,u},a=[];for(let c of t)a.push(await i(e.resolver.resolveRoot(c)));let s=[];for(let[c,l]of Array.from(n).sort(ct))l.complete||y("HL008",`Component graph did not finish loading \`${c}\`.`),s.push([c,Object.freeze({url:c,trustRoot:l.trustRoot,definition:l.definition,dependencies:Object.freeze(Array.from(l.dependencies)),...l.controller===void 0?{}:{controller:l.controller},shadowedByCustomElement:l.shadowedByCustomElement})]);return Object.freeze({roots:Object.freeze(a),nodes:new Map(s),tags:new Map(Array.from(o).sort(ct))})}function J(t){if(typeof t!="object"||t===null||Object.isFrozen(t))return t;for(let e of Object.values(t))J(e);return Object.freeze(t)}function lt(t){let e="",n=!0;for(let r of t)r==="-"?n=!0:(e+=n?r.toUpperCase():r,n=!1);return e}function Re(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}var hn=new Set(["string","boolean","number","integer","null","absent","trusted-html","trusted-script","function","unknown"]),ce=class extends SyntaxError{constructor(n,r){super(`${n} at character ${r+1}.`);this.position=r;this.name="TypeSyntaxError"}position},Se=class{constructor(e){this.source=e}source;#e=0;parse(){let e=this.#t();return this.#d(),this.#e!==this.source.length&&this.#l("Unexpected type syntax"),e}#t(){let e=[this.#n()];for(;this.#s("|");)e.push(this.#n());return e.length===1?e[0]:Ne(e)}#n(){let e=this.#o();for(;this.#s("?");)e=Ne([e,{kind:"terminal",name:"null"},{kind:"terminal",name:"absent"}]);return e}#o(){if(this.#s("(")){let r=this.#t();return this.#a(")"),r}let e=this.#c();if(e!==void 0)return{kind:"keyword",value:e};let n=this.#r();if(n===void 0&&this.#l("Expected a type, keyword, or group"),n==="list"||n==="record"){this.#a("(");let r=this.#t();return this.#a(")"),n==="list"?{kind:"list",item:r}:{kind:"record",value:r}}return n==="object"?this.#i():hn.has(n)?{kind:"terminal",name:n}:{kind:"keyword",value:n}}#i(){this.#a("("),this.#a("{");let e=[],n=!1;for(;!this.#s("}");){if(this.#d(),this.source.startsWith("...",this.#e))this.#e+=3,n=!0;else{let r=this.#c()??this.#r();r===void 0&&this.#l("Expected an object field or `...`");let o=this.#s("?");this.#a(":");let i=this.#t();e.some(a=>a.name===r)&&this.#l(`Duplicate object field \`${r}\``),e.push({name:r,type:i,optional:o})}if(this.#s("}"))break;this.#a(","),n&&(this.#d(),this.source.startsWith("}",this.#e)||this.#l("The open marker must be last"))}return this.#a(")"),{kind:"object",fields:e,open:n}}#r(){this.#d();let e=/^[A-Za-z_][A-Za-z0-9_-]*/.exec(this.source.slice(this.#e));if(e!==null)return this.#e+=e[0].length,e[0]}#c(){this.#d();let e=this.source[this.#e];if(e!=='"'&&e!=="'")return;this.#e+=1;let n="";for(;this.#e<this.source.length;){let r=this.source[this.#e++];if(r===e)return n;if(r!=="\\"){n+=r;continue}this.#e>=this.source.length&&this.#l("Unterminated escape");let o=this.source[this.#e++];n+={n:`
2
+ `,r:"\r",t:" ","\\":"\\",'"':'"',"'":"'"}[o]??o}this.#l("Unterminated quoted keyword")}#s(e){return this.#d(),this.source.startsWith(e,this.#e)?(this.#e+=e.length,!0):!1}#a(e){this.#s(e)||this.#l(`Expected \`${e}\``)}#d(){for(;/\s/.test(this.source[this.#e]??"");)this.#e+=1}#l(e){throw new ce(e,this.#e)}};function Ne(t){let e=t.flatMap(o=>o.kind==="union"?o.members:[o]),n=new Map(e.map(o=>[U(o),o])),r=Array.from(n.values());return r.length===1?r[0]:{kind:"union",members:r}}function de(t){if(t.trim()==="")throw new ce("A type expression cannot be empty",0);return J(new Se(t).parse())}function $e(t){return typeof t=="object"&&t!==null&&"kind"in t&&["terminal","keyword","union","list","record","object"].includes(String(t.kind))}function le(t){return $e(t)?t:typeof t=="string"?{kind:"terminal",name:t}:Ne(t.enum.map(e=>({kind:"keyword",value:e})))}function U(t){let e=$e(t)?t:le(t);switch(e.kind){case"terminal":return e.name;case"keyword":return/^[A-Za-z_][A-Za-z0-9_-]*$/.test(e.value)?e.value:JSON.stringify(e.value);case"union":return e.members.map(n=>U(n)).join(" | ");case"list":return`list(${U(e.item)})`;case"record":return`record(${U(e.value)})`;case"object":return`object({ ${[...e.fields.map(n=>`${n.name}${n.optional?"?":""}: ${U(n.type)}`),...e.open?["..."]:[]].join(", ")} })`}}function j(t,e,n){return{ok:!1,issues:[{reason:t,message:e,path:n}]}}function Q(t,e){return typeof e=="number"?`${t}[${e}]`:/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(e)?`${t}.${e}`:`${t}[${JSON.stringify(e)}]`}function ut(t){if(typeof t!="object"||t===null||Array.isArray(t))return!1;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}function Te(t){if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return Symbol.for("html-next.bad-json")}}function yn(t,e){if(typeof t!="object"||t===null)return!1;if(t.kind===e&&"value"in t)return!0;let n=e==="trusted-html"?"TrustedHTML":"TrustedScript";return t.constructor?.name===n||Object.prototype.toString.call(t)===`[object ${n}]`}function gn(t,e,n){switch(e){case"string":return typeof t=="string"?{ok:!0,value:t}:j("typeMismatch","Must be a string.",n);case"boolean":return typeof t=="boolean"?{ok:!0,value:t}:t===""||t==="true"?{ok:!0,value:!0}:t==="false"?{ok:!0,value:!1}:j("typeMismatch","Must be true or false.",n);case"number":case"integer":{let r=typeof t=="number"?t:typeof t=="string"&&t.trim()!==""?Number(t):Number.NaN;return Number.isFinite(r)?e==="integer"&&!Number.isInteger(r)?j("typeMismatch","Must be an integer.",n):{ok:!0,value:r}:j("badInput",`Must be ${e==="integer"?"an integer":"a finite number"}.`,n)}case"null":return t===null?{ok:!0,value:null}:j("typeMismatch","Must be null.",n);case"absent":return t===void 0?{ok:!0,value:void 0}:j("typeMismatch","Must be absent.",n);case"trusted-html":case"trusted-script":return yn(t,e)?{ok:!0,value:t}:j("untrustedValue",`Must be a ${e==="trusted-html"?"TrustedHTML":"TrustedScript"} value.`,n);case"function":return typeof t=="function"?{ok:!0,value:t}:j("typeMismatch","Must be a function supplied through a property.",n);case"unknown":return{ok:!0,value:t}}}function Y(t,e,n){switch(e.kind){case"terminal":return gn(t,e.name,n);case"keyword":return t===e.value?{ok:!0,value:t}:j("typeMismatch",`Must be ${JSON.stringify(e.value)}.`,n);case"union":{for(let r of e.members){let o=Y(t,r,n);if(o.ok)return o}return j("typeMismatch",`Must match ${U(e)}.`,n)}case"list":{let r=Te(t);if(!Array.isArray(r))return j("typeMismatch","Must be a list.",n);let o=[],i=[];return r.forEach((a,s)=>{let c=Y(a,e.item,Q(n,s));c.ok?o.push(c.value):i.push(...c.issues)}),i.length===0?{ok:!0,value:o}:{ok:!1,issues:i}}case"record":{let r=Te(t);if(!ut(r))return j("typeMismatch","Must be a string-keyed record.",n);let o={},i=[];for(let[a,s]of Object.entries(r)){let c=Y(s,e.value,Q(n,a));c.ok?o[a]=c.value:i.push(...c.issues)}return i.length===0?{ok:!0,value:o}:{ok:!1,issues:i}}case"object":{let r=Te(t);if(!ut(r))return j("typeMismatch","Must be an object.",n);let o={},i=[],a=new Map(e.fields.map(s=>[s.name,s]));for(let s of e.fields){if(!(s.name in r)){s.optional||i.push({reason:"typeMismatch",message:"Required field is absent.",path:Q(n,s.name)});continue}let c=Y(r[s.name],s.type,Q(n,s.name));c.ok?o[s.name]=c.value:i.push(...c.issues)}for(let[s,c]of Object.entries(r))a.has(s)||(e.open?o[s]=c:i.push({reason:"typeMismatch",message:"Field is not declared by this closed object type.",path:Q(n,s)}));return i.length===0?{ok:!0,value:o}:{ok:!1,issues:i}}}}function _(t,e,n="$"){return Y(t,le(e),n)}function Ae(t,e){let n=_(t,e);if(!n.ok)throw new TypeError(n.issues.map(o=>`${o.path}: ${o.message}`).join("; "));let r=le(e);if(r.kind==="terminal"&&(r.name==="function"||r.name==="unknown"))throw new TypeError(`The ${r.name} type is property-only and cannot be serialized.`);return r.kind==="list"||r.kind==="record"||r.kind==="object"||r.kind==="union"&&typeof n.value=="object"&&n.value!==null?JSON.stringify(n.value):n.value===null?"null":n.value===void 0?"":String(n.value)}function B(t){let e=le(t);return e.kind==="terminal"?!["function","unknown","trusted-html","trusted-script"].includes(e.name):e.kind==="keyword"?!0:e.kind==="union"?e.members.every(B):e.kind==="list"?B(e.item):e.kind==="record"?B(e.value):e.fields.every(n=>B(n.type))}function He(t){let e;try{e=de(t)}catch(n){y("HC013",n instanceof Error?n.message:"Invalid prop type expression.")}return e.kind==="terminal"&&(e.name==="string"||e.name==="boolean"||e.name==="number")?e.name:e.kind==="keyword"?{enum:[e.value]}:e.kind==="union"&&e.members.every(n=>n.kind==="keyword")?{enum:e.members.map(n=>n.value)}:e}var E=Symbol("absent"),ee=class extends Error{constructor(n){super(`\`${n}\` is not declared in scope.`);this.identifier=n;this.name="UndeclaredName"}identifier},De=/\s*(?:(<=|>=|!=|\^=|\$=|\*=)|(\d+(?:\.\d*)?|\.\d+)|("(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*')|([A-Za-z_$][A-Za-z0-9_$]*)|([=<>+*/%(),.:{}[\]-])|$)/y,bn=/\\([\s\S])/g,wn=/%s/g,vn={or:1,and:2,"=":3,"!=":3,"^=":3,"$=":3,"*=":3,"<":4,"<=":4,">":4,">=":4,"+":5,"-":5,"*":6,"/":6,"%":6};function ft(t){return vn[t]??0}function kn(t){return t==="round"||t==="clamp"||t==="min"||t==="max"||t==="abs"||t==="format"}function Cn(t){let e=0,n=0,r="";function o(){De.lastIndex=e;let d=De.exec(t);if(d===null){let h=t.slice(e).trimStart()[0];throw h==='"'||h==="'"?new SyntaxError("Unterminated string literal."):new SyntaxError(`Unexpected character \`${h}\`.`)}e=De.lastIndex,d[1]!==void 0||d[5]!==void 0?(n=4,r=d[1]??d[5]):d[2]!==void 0?(n=1,r=Number(d[2])):d[3]!==void 0?(n=2,r=d[3].slice(1,-1).replace(bn,"$1")):d[4]!==void 0?(n=3,r=d[4]):(n=0,r="")}function i(d){return r!==d?!1:(o(),!0)}function a(d){if(!i(d))throw new SyntaxError(`Expected \`${d}\`.`)}function s(d){let h=c(),u=ft(r);for(;u>=d;){let p=r;o(),h={kind:"binary",op:p,left:h,right:s(u+1)},u=ft(r)}return h}function c(){if(n===3&&r==="not")return o(),{kind:"unary",op:"not",operand:c()};if(i("-"))return{kind:"unary",op:"-",operand:c()};let d=l();for(;n===4;)if(i(".")){if(n!==3)throw new SyntaxError("Expected a property name after `.`.");let h=r;o(),d={kind:"member",object:d,key:h}}else if(i("[")){let h=s(1);a("]"),d={kind:"index",object:d,index:h}}else break;return d}function l(){let d=n,h=r;if(d===1||d===2)return o(),{kind:"literal",value:h};if(d===4&&h==="("){o();let u=s(1);return a(")"),u}if(d===4&&h==="{"){o();let u=[];if(!i("}")){do{if(r==="}")break;if(n!==3&&n!==2)throw new SyntaxError("Object keys must be identifiers or strings.");let p=r;o(),a(":"),u.push({key:p,value:s(1)})}while(i(","));a("}")}return{kind:"object",pairs:u}}if(d===4&&h==="["){o();let u=[];if(!i("]")){do{if(r==="]")break;u.push(s(1))}while(i(","));a("]")}return{kind:"array",items:u}}if(d===3){let u=h;if(o(),u==="true")return{kind:"literal",value:!0};if(u==="false")return{kind:"literal",value:!1};if(u==="null")return{kind:"literal",value:null};if(r==="("&&kn(u)){o();let p=[];if(!i(")")){do p.push(s(1));while(i(","));a(")")}return{kind:"call",fn:u,args:p}}return{kind:"id",name:u}}throw new SyntaxError("Unexpected end of expression.")}o();let f=s(1);if(n!==0)throw new SyntaxError("Unexpected trailing input in expression.");return f}function X(t){return t===E||t===null}function L(t){if(t===E||t===null||t===!1)return!1;if(t===!0)return!0;if(typeof t=="string")return t.length>0;if(typeof t=="number")return t!==0&&t===t;if(Array.isArray(t))return t.length>0;for(let e in t)if(Object.hasOwn(t,e))return!0;return!1}function ue(t){return typeof t=="number"&&t===t?t:E}function H(t,e){switch(t.kind){case"literal":return t.value;case"id":{let n=e.get(t.name);if(n===void 0)throw new ee(t.name);return n}case"member":{let n=H(t.object,e);if(X(n)||typeof n!="object"||Array.isArray(n))return E;let r=n[t.key];return r===void 0?E:r}case"index":{let n=H(t.object,e),r=H(t.index,e);if(X(n)||X(r))return E;if(Array.isArray(n)&&typeof r=="number"){let o=n[r];return o===void 0?E:o}if(typeof n=="object"&&typeof r=="string"){let o=n[r];return o===void 0?E:o}return E}case"unary":{let n=H(t.operand,e);if(t.op==="not")return!L(n);let r=ue(n);return r===E?E:-r}case"binary":return xn(t,e);case"call":return En(t,e);case"object":{let n={};for(let r of t.pairs)n[r.key]=H(r.value,e);return n}case"array":{let n=[];for(let r of t.items)n.push(H(r,e));return n}}}function xn(t,e){let{op:n}=t;if(n==="and")return L(H(t.left,e))&&L(H(t.right,e));if(n==="or")return L(H(t.left,e))||L(H(t.right,e));let r=H(t.left,e),o=H(t.right,e);if(n==="=")return r===o;if(n==="!=")return r!==o;if(n==="^="||n==="$="||n==="*=")return typeof r!="string"||typeof o!="string"?E:n==="^="?r.startsWith(o):n==="$="?r.endsWith(o):r.includes(o);let i=ue(r),a=ue(o);if(i===E||a===E)return E;switch(n){case"<":return i<a;case"<=":return i<=a;case">":return i>a;case">=":return i>=a;case"+":return i+a;case"-":return i-a;case"*":return i*a;case"/":return i/a;case"%":return i%a;default:return E}}function En(t,e){let{args:n,fn:r}=t,o=[];for(let a of n)o.push(H(a,e));if(r==="format"){let a=o[0];if(typeof a!="string")return E;let s=1;return a.replace(wn,()=>s<o.length?P(o[s++]):"%s")}for(let a=0;a<o.length;a+=1){let s=ue(o[a]);if(s===E)return E;o[a]=s}let i=o;switch(r){case"abs":return i.length===1?Math.abs(i[0]):E;case"round":return i.length===1?Math.round(i[0]):E;case"min":return i.length>0?Math.min(...i):E;case"max":return i.length>0?Math.max(...i):E;case"clamp":return i.length===3?Math.min(Math.max(i[0],i[1]),i[2]):E;default:return E}}var pt=new Map;function Me(t){if(t.kind==="id")return t.name;if(t.kind==="member"){let e=Me(t.object);return e===void 0?void 0:`${e}.${t.key}`}if(t.kind==="index"&&t.index.kind==="literal"){let e=t.index.value;if(typeof e!="string"&&typeof e!="number")return;let n=Me(t.object);return n===void 0?void 0:`${n}.${e}`}}function O(t,e){let n=Me(t);if(n!==void 0){e.includes(n)||e.push(n);return}switch(t.kind){case"literal":return;case"id":return;case"member":O(t.object,e);return;case"index":O(t.object,e),O(t.index,e);return;case"unary":O(t.operand,e);return;case"binary":O(t.left,e),O(t.right,e);return;case"call":for(let r of t.args)O(r,e);return;case"object":for(let r of t.pairs)O(r.value,e);return;case"array":for(let r of t.items)O(r,e)}}function Pe(t,e){if(t.kind==="id")return e.push(t.name),!0;if(t.kind==="member")return Pe(t.object,e)?(e.push(t.key),!0):!1;if(t.kind!=="index"||!Pe(t.object,e))return!1;let n=t.index,r=n.kind==="literal"?n.value:void 0;return e.push(typeof r=="string"||typeof r=="number"?r:{kind:"index",expression:n}),!0}function fe(t){let e=pt.get(t);if(e!==void 0)return e;let n=Cn(t),r=[];return O(n,r),r.sort(),e={source:t,ast:n,dependencies:r},pt.set(t,e),e}function je(t,e){let n=[];if(!(!Pe(fe(t).ast,n)||!e.has(n[0])))return n}function mt(t,e){return H(fe(t).ast,e)}function I(t,e){return H("ast"in t?t.ast:t,e)}function P(t){return X(t)?"":Array.isArray(t)?t.map(P).join(" "):typeof t=="object"?"":String(t)}function Rn(t){return t.startsWith("aria-")||t==="contenteditable"||t==="draggable"||t==="spellcheck"}function ht(t,e=""){return typeof t=="boolean"&&Rn(e)?String(t):X(t)||t===!1?null:t===!0?"":typeof t=="number"||typeof t=="string"?String(t):Array.isArray(t)?t.map(P).join(" "):null}var Tn=new Set(["href","src","action","formaction","poster","data","xlink:href"]),Sn=new Set(["base","embed","iframe","link","meta","object","script","style","template"]),Nn=new Set(["srcdoc","style"]);function te(t){let e=t.replace(/[\u0000-\u0020\u007f]+/g,"");return/^(?:data|javascript|vbscript):/i.test(e)}function ne(t){return Tn.has(t.toLowerCase())}function Le(t,e,n){let r=e.createElement("template");r.innerHTML=t;for(let o of Array.from(r.content.querySelectorAll("*"))){if(n?.(o),Sn.has(o.localName)){o.remove();continue}for(let i of Array.from(o.attributes)){let a=i.name.toLowerCase();(a.startsWith("on")||Nn.has(a)||ne(a)&&te(i.value))&&o.removeAttribute(i.name)}}return r.content}var $n=/^(?:if|else-if|else|for|with|value|state|computed|data)$/,An=/^(?:@|v-|#|on:|use:|transition:|animate:)/,Hn=/^(?:innerhtml|outerhtml|srcdoc)$/,Dn=/^(?:base|embed|link|meta|object|script|style)$/;function yt(t){return $n.test(t)}function Oe(t,e){return Dn.test(t.toLowerCase())&&y("HT009",`<${t}> is not permitted in rendered component markup.`,e),t}function Ie(t,e,n=""){let r=t.toLowerCase();return(r.startsWith("on")||An.test(r))&&y("HT010",`Literal attribute \`${t}\` uses target-framework directive syntax that is not supported.`,e),r==="srcdoc"&&y("HT007","Literal `srcdoc` is not permitted in a component definition.",e),ne(r)&&te(n)&&y("HT007",`Literal \`${t}\` contains an executable URL.`,e),t}function gt(t,e){let n=t.toLowerCase();return(n.startsWith("on")||Hn.test(n))&&y("HT007",`Dynamic ${t} requires a future trusted-content type.`,e),t}function z(t){return"tagName"in t}function re(t){return t.nodeName==="#text"}function N(t){return"localName"in t?t.localName:t.tagName}function pe(t){return"attrs"in t?t.attrs:t.attributes}function V(t){return(N(t)==="template"?t.content:void 0)?.childNodes??t.childNodes}function oe(t){return"value"in t?t.value:"nodeValue"in t?t.nodeValue??"":""}function vt(t){let e=[];for(let n of t)n.nodeName!=="#comment"&&(!re(n)||oe(n).trim()!=="")&&e.push(n);return e}function x(t,e){return"attrs"in t?t.attrs.find(n=>n.name===e)?.value:t.getAttribute(e)??void 0}function kt(t){let e="";for(let n of V(t))re(n)&&(e+=oe(n));return e}function Ct(t,e){let n=[];for(let r of V(t))z(r)&&N(r)===e&&n.push(r);return n}function xt(t,e){for(let n of V(t)){if(!z(n))continue;let r=N(n);r==="link"&&y("HL001","External definition dependencies require the application-owned graph resolver.",e),Oe(r,e);for(let o of pe(n))/^on(?!:)/i.test(o.name)&&Ie(o.name,e,o.value);xt(n,e)}}var Mn=/^\$(?:if|each|where|sort|limit|key|with|match|when|else)$/,bt=/^(?:innerhtml|outerhtml|textcontent|innertext|srcdoc)$/,Pn=/^\s*([A-Za-z_$][\w$]*)\s*(?:,\s*([A-Za-z_$][\w$]*)\s*)?\bof\b\s*(.+)$/,wt=/^\s*(.+?)\s+\bas\b\s+([A-Za-z_$][\w$]*)\s*$/,ze=/^[a-z][a-z0-9-]*$/,jn=/^(?:prevent|stop|self|once|passive|capture|left|middle|right|ctrl|shift|alt|meta|exact|enter|escape|space|tab|up|down)$/,Ue=/^[A-Za-z_$][A-Za-z0-9_$-]*$/;function Ve(t,...e){let n=new Set(t.roots);for(let r of e)r!==void 0&&n.add(r);return{roots:n,writableRoots:t.writableRoots,handlers:t.handlers}}function S(t,e,n){let r=Vn(t,n);return Ln(r,e,n),r}function Ln(t,e,n){for(let r of t.dependencies){let o=r.split(".",1)[0];e.roots.has(o)||y("HT003",`Expression root \`${o}\` is not declared in this scope.`,n)}}function On(t,e,n){let r=Object.create(null),o=(a,s)=>{r[a]??=s},i=a=>{for(let s of pe(a))if(s.name.startsWith(":"))/^[A-Za-z][A-Za-z0-9_-]*$/.test(s.value)&&o(s.value,{attribute:s.name.slice(1).toLowerCase()});else if(s.name.startsWith(".")){let c=s.name.slice(1).toLowerCase();if(/^[A-Za-z][A-Za-z0-9_-]*$/.test(s.value)){let l=n.resolveDomProperty(N(a),c)??(s.value.toLowerCase()===c?s.value:c);o(s.value,{property:l})}}for(let s of V(a))z(s)&&N(s)!=="slot"&&i(s)};return i(t),r}function In(t,e,n,r=!0){let o=Object.create(null),i=Object.create(null);if(t===void 0)return o;let a=Ct(t,"prop");a.sort((s,c)=>{let l=x(s,"name")??"",f=x(c,"name")??"";return l<f?-1:l>f?1:0});for(let s of a){let c=x(s,"name");(c===void 0||c==="")&&y("HC010","A <prop> requires a `name` attribute.",n),/^[A-Za-z][A-Za-z0-9_-]*$/.test(c)||y("HC010",`Invalid prop name \`${c}\`.`,n);let l=x(s,"type");(l===void 0||l==="")&&y("HC013",`Prop \`${c}\` requires a \`type\` attribute.`,n);let f=c.toLowerCase(),d=i[f];d!==void 0&&y("HC011",`Props \`${d}\` and \`${c}\` collide after lowercase normalization.`,n),i[f]=c;let h=e[c];h===void 0&&r&&y("HC018",`Prop \`${c}\` is declared but never bound in the markup.`,n),h??={attribute:c.toLowerCase()};let u=He(l),p=x(s,"required")!==void 0,m=kt(s).trim();m===""&&y("HC003",`\`props.${c}.description\` must be a non-empty string.`,n),B(u)||y("HC017",`Prop \`${c}\` cannot be written as an HTML attribute; function, unknown, and trusted content types have no text form.`,n);let w=x(s,"default");p&&w!==void 0&&y("HC019",`Required prop \`${c}\` cannot also declare a default.`,n);let C={type:u,required:p,target:h,description:m};if(w!==void 0){let k=_(w,u);k.ok||y("HC015",`Default for prop \`${c}\` does not satisfy its type.`,n),C.default=k.value}o[c]=C}return o}function zn(t,e,n,r,o,i,a){let s=x(t,"component")??"";s.trim()===""&&y("HC003","`component` must be a non-empty string.",i),/^[a-z][a-z0-9]*(?:-[a-z0-9]+)+$/.test(s)||y("HC005","The `component` tag must be lowercase and contain a hyphen.",i);let c=x(t,"status");c!==void 0&&!/^(?:early|experimental|stable|deprecated)$/.test(c)&&y("HC007","Component `status` is not recognized.",i);let l=x(t,"summary");return l!==void 0&&l.trim()===""&&y("HC003","`summary` must be a non-empty string.",i),(!/^[a-z][a-z0-9-]*$/.test(n)||r&&!/^[a-z][a-z0-9]*(?:-[a-z0-9]+)+$/.test(n))&&y("HC008","`nativeElement` must be a lowercase HTML element or component tag.",i),{version:1,name:lt(s),tag:s,...c===void 0?{}:{status:c},...l===void 0?{}:{summary:l},nativeElement:n,props:In(e,o,i,a)}}function Vn(t,e){try{return fe(t)}catch{y("HT013",`Malformed expression \`${t}\`.`,e)}}function qn(t,e,n){let r=[];for(let o of vt(V(t))){z(o)||y("HC023","Handler bodies contain declarative step elements only.",n);let i=x(o,"$if"),a=i===void 0?void 0:S(i,e,n);if(N(o)==="set"){let s=x(o,"name")??"",c=x(o,":value"),l=x(o,"value");(s===""||c===void 0==(l===void 0))&&y("HC023","A <set> requires `name` and exactly one of `value` or `:value`.",n),S(s,e,n);let f=je(s,e.writableRoots);f===void 0&&y("HT005",`Handler write \`${s}\` is not rooted in declared state.`,n);let d={kind:"set",path:s,writablePath:f,value:S(c??JSON.stringify(l),e,n)};a!==void 0&&(d.guard=a),r.push(d);continue}if(N(o)==="dispatch"){let s=x(o,"event")??"";ze.test(s)||y("HC023","A <dispatch> requires a valid `event` name.",n);let c=x(o,":value"),l=x(o,"value");c!==void 0&&l!==void 0&&y("HC023","A <dispatch> may declare only one of `value` or `:value`.",n);let f=c===void 0&&l===void 0?void 0:S(c??JSON.stringify(l),e,n),d={kind:"dispatch",event:s};f!==void 0&&(d.value=f),a!==void 0&&(d.guard=a),r.push(d);continue}if(N(o)==="validate"||N(o)==="focus"){let s=x(o,"target")??x(o,"ref")??x(o,"name")??"";Ue.test(s)||y("HC023",`<${N(o)}> requires a valid target reference.`,n);let c={kind:N(o),target:s};a!==void 0&&(c.guard=a),r.push(c);continue}y("HC023",`<${N(o)}> is not a recognized handler step.`,n)}return r}function Un(t,e,n){let r=[],o=new Set(Object.keys(e.props)),i=new Set,a=new Set;if(t===void 0)return{declarations:r,scope:{roots:o,writableRoots:i,handlers:a}};let s=[],c=new Set,l=new Set;for(let d of V(t)){if(!z(d))continue;let h=d;s.push(h);let u=N(h);/^(?:prop|state|computed|data|handler|event|method)$/.test(u)||y("HC021",`<${u}> is not a recognized definition declaration.`,n);let p=x(h,"name")??"";if(p===""&&y("HC010",`A <${u}> requires a \`name\` attribute.`,n),u==="event"){l.has(p)&&y("HC020",`Event \`${p}\` is declared more than once.`,n),l.add(p);continue}c.has(p)&&y("HC020",`Declaration \`${p}\` collides in the flat component scope.`,n),c.add(p),o.add(p),u==="state"?i.add(p):u==="handler"&&a.add(p)}let f={roots:o,writableRoots:i,handlers:a};for(let d of s){let h=N(d);if(h==="prop")continue;let u=x(d,"name");if(h==="state"){let p=x(d,":value"),m=x(d,"value");p!==void 0&&m!==void 0&&y("HC013",`<state name="${u}"> may declare only one of \`value\` or \`:value\`.`,n);let w=p===void 0&&m===void 0?void 0:S(p??JSON.stringify(m),f,n),C={kind:h,name:u},k=x(d,"type");k!==void 0&&(He(k),C.type=k),m!==void 0&&(C.value=m),w!==void 0&&(C.expression=w),r.push(C);continue}if(h==="computed"){let p=x(d,"from");(p===void 0||p==="")&&y("HC013",`<computed name="${u}"> requires a \`from\` expression.`,n),r.push({kind:h,name:u,expression:S(p,f,n)});continue}if(h==="data"){let p=x(d,"src"),m=x(d,"type"),w=x(d,"debounce"),C=x(d,"poll"),k=[],g=new Set;for(let v of Ct(d,"param")){let R=x(v,"name")??"",T=x(v,":value");(!Ue.test(R)||T===void 0)&&y("HC024","A data <param> requires a valid `name` and a `:value` expression.",n),g.has(R)&&y("HC024",`Data source \`${u}\` repeats a parameter name.`,n),g.add(R),k.push({name:R,expression:S(T,f,n)})}let b={kind:h,name:u,parameters:k};p!==void 0&&(b.source=p),m!==void 0&&(b.type=m),w!==void 0&&(b.debounce=w),C!==void 0&&(b.poll=C),r.push(b);continue}if(h==="event"){r.push({kind:h,name:u,type:x(d,"type")??"object",bubbles:x(d,"bubbles")!=="false",composed:x(d,"composed")!=="false",cancelable:x(d,"cancelable")==="true"});continue}if(h==="method"){r.push({kind:h,name:u,exportName:x(d,"export")??u,returns:x(d,"returns")??"undefined"});continue}r.push({kind:"handler",name:u,steps:qn(d,f,n)})}for(let d of r)if(d.kind==="handler")for(let h of d.steps)h.kind==="dispatch"&&!l.has(h.event)&&y("HC023",`Handler \`${d.name}\` dispatches undeclared component event \`${h.event}\`.`,n);return{declarations:r,scope:f}}function Bn(t,e,n,r,o,i){let a=[];for(let s of t){if(s.name.startsWith("bind:")){let c=s.name.slice(5).toLowerCase();(c===""||bt.test(c))&&y("HT007",`Two-way binding cannot target \`${c||s.name}\`.`,o);let l=S(s.value,r,o),f=je(s.value,r.writableRoots);f===void 0&&y("HT005",`\`${s.value}\` is not a writable state-rooted path.`,o),a.push({kind:"attribute",name:c,expression:s.value,expressionPlan:l,twoWay:!0,writablePath:f});continue}if(s.name.startsWith("class:")||s.name.startsWith("style:")){let c=s.name.startsWith("class:")?"class":"style",l=s.name.slice(c.length+1);(c==="class"?l!==""&&!/\s/.test(l):/^(?:--[a-z0-9_-]+|[a-z][a-z0-9-]*)$/.test(l))||y("HT020",`\`${s.name}\` does not name a valid ${c} binding target.`,o),a.push({kind:"attribute",name:l,expression:s.value,expressionPlan:S(s.value,r,o),target:c});continue}if(s.name.startsWith("$")){let c=s.name.slice(1).toLowerCase();c!=="value"&&c!=="html"&&y("HT012",`\`$${c}\` is not a known content directive.`,o),a.push({kind:"directive",name:c,expression:s.value,expressionPlan:S(s.value,r,o)});continue}if(s.name.startsWith(":")){let c=s.name.slice(1).toLowerCase();bt.test(c)&&y("HT007",`\`:${c}\` cannot bind a raw content sink.`,o);let l=S(s.value,r,o);a.push({kind:"attribute",name:c,expression:s.value,expressionPlan:l});continue}if(s.name.startsWith(".")){let c=s.name.slice(1).toLowerCase(),l=S(s.value,r,o),f=i.resolveDomProperty(e,c);f===void 0&&y("HP001",`\`${c}\` is not a native property of <${e}>.`,o),gt(f,o),a.push({kind:"property",key:c,name:f,expression:s.value,expressionPlan:l});continue}Ie(s.name,o,s.value),a.push({kind:"literal",name:s.name,value:s.value})}return a}function _n(t,e,n){if(t===void 0)return;let r=[];for(let o of t){let[i="",...a]=o.name.slice(3).split(".");(!ze.test(i)||a.some(s=>!ze.test(s)))&&y("HT010",`\`${o.name}\` is not a valid declarative event binding.`,n);for(let s=0;s<a.length;s+=1){let c=a[s];a.indexOf(c)!==s&&y("HT010",`\`${o.name}\` repeats an event modifier.`,n),jn.test(c)||y("HT010",`\`${o.name}\` contains an unsupported event modifier.`,n)}a.includes("passive")&&a.includes("prevent")&&y("HT010",`\`${o.name}\` cannot combine passive and prevent.`,n),e.handlers.has(o.value)||y("HT010",`Event binding \`${o.name}\` names undeclared handler \`${o.value}\`.`,n),r.push({name:i,handler:o.value,modifiers:a})}return r}function Wn(t,e,n){if(t!==void 0)return Ue.test(t)||y("HT019","`$ref` requires a valid non-empty name.",n),e.has(t)&&y("HT019",`Reference \`${t}\` is duplicated.`,n),e.add(t),t}function Fn(t,e,n){if(t===void 0)return;let r=[],o=[];t.$if!==void 0&&r.push("$if"),t.$each!==void 0&&r.push("$each"),t.$with!==void 0&&r.push("$with"),t.$match!==void 0&&r.push("$match"),t.$when!==void 0&&r.push("$when"),t.$else!==void 0&&r.push("$else"),t.$where!==void 0&&o.push("$where"),t.$sort!==void 0&&o.push("$sort"),t.$limit!==void 0&&o.push("$limit"),t.$key!==void 0&&o.push("$key"),r.length>1&&y("HT014",`An element carries one structural directive; found ${r.join(", ")}.`,n);let i=t.$each;i===void 0&&o.length>0&&y("HT014",`${o.join(", ")} may only modify \`$each\`.`,n);let a=t.$if;if(a!==void 0){let f=a;return{kind:"if",test:f,testPlan:S(f,e,n)}}let s=t.$with;if(s!==void 0){let f=wt.exec(s);return f===null&&y("HT015","`$with` must be written `expr as name`.",n),{kind:"with",expr:f[1],expressionPlan:S(f[1],e,n),alias:f[2]}}if(i!==void 0){let f=Pn.exec(i);f===null&&y("HT016","`$each` must be written `item of items` (optionally `item, i of items`).",n);let d=f[1],h=f[2];(e.roots.has(d)||h!==void 0&&e.roots.has(h))&&y("HC020","Loop locals may not collide with an existing scope name.",n);let u=Ve(e,d,h,"loop"),p={kind:"each",item:d,list:f[3],listPlan:S(f[3],e,n)};h!==void 0&&(p.index=h);let m=t.$where;m!==void 0&&(p.where=m,p.wherePlan=S(m,u,n)),t.$sort!==void 0&&(p.sort=t.$sort);let w=t.$limit;w!==void 0&&(p.limit=w,p.limitPlan=S(w,u,n));let C=t.$key;return C!==void 0&&(p.key=C,p.keyPlan=S(C,u,n)),p}let c=t.$match;if(c!==void 0){let f=c.trim();if(f==="")return{kind:"match"};let d=wt.exec(f);return d===null&&y("HT017","`$match` scope must be written `expr as name`.",n),{kind:"match",expr:d[1],expressionPlan:S(d[1],e,n),alias:d[2]}}let l=t.$when;if(l!==void 0){let f=l;return{kind:"when",test:f,testPlan:S(f,e,n)}}if(t.$else!==void 0)return{kind:"else"}}function qe(t,e,n,r,o,i){let a=N(t);yt(a)&&y("HT009",`<${a}> is reserved but not supported by this profile.`,r),Oe(a,r);let s,c=[],l,f;for(let g of pe(t))Mn.test(g.name)?(s??={})[g.name]=g.value:g.name==="$ref"?f=g.value:g.name.startsWith("on:")?(l??=[]).push(g):g.name!=="as"&&c.push(g);let d=Fn(s,n,r),h=d?.kind==="each"?Ve(n,d.item,d.index,"loop"):d?.kind==="with"||d?.kind==="match"&&d.alias!==void 0?Ve(n,d.alias):n,u=Bn(c,a,e,h,r,i),p=_n(l,h,r),m=Wn(f,o.refs,r),w=[],C=V(t);for(let g of C)if(g.nodeName!=="#comment"){if(re(g)){let b=oe(g);b.trim()!==""&&w.push({kind:"text",value:b});continue}if(z(g)){if(N(g)==="slot"){let b=x(g,"name"),v=x(g,":name");b!==void 0&&v!==void 0&&y("HT008","A slot cannot declare both `name` and `:name`.",r);for(let M of pe(g))M.name!=="name"&&M.name!==":name"&&y("HT008","A slot has an unsupported attribute.",r);b===void 0&&v===void 0&&(o.defaults+=1,o.defaults>1&&y("HT008","A component may declare one default slot.",r)),b!==void 0&&((b===""||o.names.has(b))&&y("HT008",`Slot name \`${b}\` is empty or duplicated.`,r),o.names.add(b));let R=[];for(let M of V(g))if(M.nodeName!=="#comment")if(re(M)){let ae=oe(M);ae.trim()!==""&&R.push({kind:"text",value:ae})}else z(M)&&R.push(qe(M,e,h,r,o,i));let A={dynamic:v!==void 0,required:R.length===0};if(b!==void 0&&(A.name=b),o.contracts.push(A),b===void 0&&v===void 0&&R.length===0)w.push({kind:"slot"});else{let M={kind:"slot",fallback:R};b!==void 0&&(M.name=b),v!==void 0&&(M.nameExpression=S(v,h,r)),w.push(M)}continue}w.push(qe(g,e,h,r,o,i))}}if(u.some(g=>g.kind==="directive")&&w.length>0&&y("HT006","A content directive cannot coexist with children.",r),u.some(g=>g.kind==="property"&&g.name==="textContent")&&w.length>0&&y("HT006","A content-replacing property binding cannot coexist with children.",r),d?.kind==="match"){let g=0;for(let v of w)v.kind==="element"&&(g+=1);let b=!1;for(let v of w)v.kind==="element"&&(g-=1,v.flow?.kind==="when"?b&&y("HT018","A `$when` arm may not follow `$else`.",r):v.flow?.kind==="else"?(b&&y("HT018","A `$match` has at most one `$else`.",r),b=!0,g!==0&&y("HT018","`$else` must be the last arm.",r)):y("HT018","Every direct child of a `$match` must be a `$when` or `$else` arm.",r))}let k={kind:"element",name:a,attributes:u,children:w};return d!==void 0&&(k.flow=d),p!==void 0&&(k.events=p),m!==void 0&&(k.ref=m),k}function Et(t,e,n){let r=vt(t);(r.length!==1||!z(r[0])||N(r[0])!=="template"||x(r[0],"component")===void 0)&&y("HS001","A source must contain exactly one top-level <template component>.",e);let o=r[0],i,a=!1,s,c;for(let b of V(o)){if(b.nodeName==="#comment"||re(b)&&oe(b).trim()==="")continue;z(b)||y("HT001","A component's markup must be exactly one element root.",e);let v=N(b);v==="props"||v==="defs"?(i!==void 0&&y("HS002","A component has one optional declaration group, one markup root, and one optional <style>.",e),i=b,a=v==="props",xt(b,e)):v==="style"?(s!==void 0&&y("HS002","A component has one optional declaration group, one markup root, and one optional <style>.",e),s=b):c===void 0?c=b:y("HT001","A component's markup must be exactly one element root.",e)}c===void 0&&y("HT001","A component's markup must be exactly one element root.",e);let l=N(c),f=(x(c,"as")??l).split("|");for(let b=f.length-1;b>=0;b-=1)f[b]=f[b].trim(),f[b]===""&&f.splice(b,1);let d=!n.isNativeElement(l);d&&x(c,"as")!==void 0&&y("HT021","A delegated component root cannot also declare native `as` choices.",e),!d&&(f.length===0||!f.includes(l)||f.some((b,v)=>f.indexOf(b)!==v)||f.some(b=>!n.isNativeElement(b)))&&y("HT021","A polymorphic root must list unique native choices including its markup root.",e);let h=On(c,e,n),u=zn(o,i,l,d,h,e,a),{declarations:p,scope:m}=Un(a?void 0:i,u,e),w={defaults:0,names:new Set,contracts:[],refs:new Set},C=qe(c,u,m,e,w,n),k=x(o,"controller");k===""&&y("HC022","A controller specifier cannot be empty.",e);let g={source:{file:e},contract:u,template:C,css:s===void 0?"":kt(s).trim(),declarations:p,slots:w.contracts,root:d?{kind:"component",tag:l}:{kind:"native",element:l,choices:f}};return k!==void 0&&(g.controller=k),J(g)}var Rt=new WeakMap;function Gn(t){let e={},n={},r=o=>{if(o.includes("-"))return!1;if(Object.hasOwn(e,o))return e[o];let i=t.createElement(o),a=t.defaultView?.HTMLUnknownElement,s=a===void 0?i.constructor.name!=="HTMLUnknownElement":!(i instanceof a);return e[o]=s,s};return{isNativeElement:r,resolveDomProperty(o,i){if(!r(o))return;let a=`${o}:${i}`;if(a in n)return n[a]||void 0;let s=t.createElement(o),c=i.toLowerCase();for(;s!==null;){for(let l of Object.getOwnPropertyNames(s))if(l.toLowerCase()===c)return n[a]=l,l;s=Object.getPrototypeOf(s)}n[a]=""}}}function Be(t,e=t.ownerDocument.URL){(t.localName!=="template"||!t.hasAttribute("component"))&&y("HS001","A browser component carrier must be a <template component>.",e);let n=t.ownerDocument,r=Rt.get(n);return r===void 0&&(r=Gn(n),Rt.set(n,r)),Et([t],e,r)}function Tt(t,e,n){let r=n.createElement("template");r.innerHTML=t;let o;for(let a of r.content.childNodes)a.nodeType===1&&a.localName==="template"&&a.hasAttribute("component")&&(o!==void 0&&y("HS001","A component resource must contain exactly one <template component>.",e),o=a);o===void 0&&y("HS001","A component resource must contain exactly one <template component>.",e);let i=[];for(let a of r.content.childNodes){if(a===o||a.nodeType===8||a.nodeType===3&&(a.nodeValue??"").trim()==="")continue;(a.nodeType!==1||a.localName!=="link"||a.getAttribute("rel")!=="component")&&y("HT009","A component resource may contain only dependency links and one inert carrier.",e);let s=a.getAttribute("href");(s===null||s.trim()==="")&&y("HL006","A component dependency link requires a non-empty `href`.",e),i.push(s)}return{definition:Be(o,e),dependencies:i}}var me=class{#e=new Map;#t=new Map;define(e,n){this.#e.has(e)&&y("HR001",`More than one definition declares <${e}>.`),this.#e.set(e,Object.freeze(n));for(let r of this.#t.get(e)??[])r();this.#t.delete(e)}get(e){return this.#e.get(e)}whenDefined(e){return this.#e.has(e)?Promise.resolve():new Promise(n=>{let r=this.#t.get(e)??[];r.push(n),this.#t.set(e,r)})}addGraph(e,n){for(let r of e.nodes.values())r.shadowedByCustomElement||this.define(r.definition.contract.tag,{node:r,...r.controller===void 0||n===void 0?{}:{loadController:()=>n(r)}})}};var St=/^(?:[A-Za-z][A-Za-z\d+.-]*:|\/|\.\.?\/)/;function Nt(t){return new URL("./",t).href}function Zn(t,e){return t.endsWith("/")?e:Nt(e)}var he=class{#e;#t;constructor(e={},n="file:///"){this.#e=new URL(n).href,this.#t=new Map(Object.entries(e.imports??{}).map(([r,o])=>[r,new URL(o,this.#e).href]))}resolveRoot(e){if(St.test(e)){let n=new URL(e,this.#e).href;return Object.freeze({url:n,trustRoot:Nt(n)})}return this.#n(e)}resolveDependency(e,n,r){if(!St.test(e))return this.#n(e);let o=new URL(e,n).href;return Object.freeze({url:o,trustRoot:r})}assertFinalURL(e,n){return new URL(n,e.url).href}#n(e){let n=this.#t.get(e);if(n!==void 0)return Object.freeze({url:n,trustRoot:Zn(e,n),mapping:e});let r=Array.from(this.#t.keys()).filter(i=>i.endsWith("/")&&e.startsWith(i)).sort((i,a)=>a.length-i.length)[0];r===void 0&&y("HL002",`Bare resource specifier \`${e}\` is not mapped by the application.`);let o=this.#t.get(r);return Object.freeze({url:new URL(e.slice(r.length),o).href,trustRoot:o,mapping:r})}};var $t=new Map;function _e(t,e=n=>import(n)){let n=t.controller;if(n===void 0)return Promise.reject(new TypeError(`<${t.definition.contract.tag}> does not declare a controller.`));let r=$t.get(n.url);return r===void 0&&(r=e(n.url).then(o=>{let i=o?.default;return typeof i!="function"&&y("HJ002",`Controller module \`${n.url}\` must default-export a function.`,t.url),Object.freeze({...o,default:i})}).catch(o=>{if(o instanceof Error&&"diagnostic"in o)throw o;y("HJ001",`Controller module \`${n.url}\` failed to load: ${o instanceof Error?o.message:String(o)}.`,t.url)}),$t.set(n.url,r)),r}async function At(t,e=n=>import(n)){return(await _e(t,e)).default}function Kn(t,e,n){let r=new Set,o=t.replace(/\{([A-Za-z_$][A-Za-z0-9_$-]*)\}/g,(a,s)=>{r.add(s);let c=n[s];return c==null?"":encodeURIComponent(String(c))}),i=new URL(o,e);for(let[a,s]of Object.entries(n))if(!(r.has(a)||s==null))if(Array.isArray(s))for(let c of s)i.searchParams.append(a,String(c));else i.searchParams.set(a,String(s));return i.href}var ye=class{constructor(e){this.options=e;this.#e=e.fetch??globalThis.fetch.bind(globalThis),this.#t=e.setTimer??((n,r)=>setTimeout(n,r)),this.#n=e.clearTimer??(n=>clearTimeout(n))}options;#e;#t;#n;#o={};#i;#r;#c=0;#s=!1;update(e){this.#o={...e},this.#s=!0,this.#a();let n=++this.#c,r=()=>{this.#l(n)};(this.options.debounce??0)>0?this.#r=this.#t(r,this.options.debounce):r()}disconnect(){this.#s&&(this.#s=!1,this.#c+=1,this.#a())}#a(){this.#i?.abort(),this.#i=void 0,this.#r!==void 0&&this.#n(this.#r),this.#r=void 0}#d(e){return!this.#s||e!==this.#c}async#l(e){if(this.#d(e))return;let n=new AbortController;this.#i=n;let r=this.options;r.onState({pending:!0,value:null,error:null,ok:!1});try{let o=await this.#e(Kn(r.source,r.baseURL,this.#o),{signal:n.signal});if(!o.ok)throw new TypeError(`Request failed with ${o.status}.`);let i=r.type==="text"?await o.text():await o.json(),a=r.adapt===void 0?i:r.adapt(i);if(this.#d(e))return;r.onState({pending:!1,value:a,error:null,ok:!0})}catch(o){if(n.signal.aborted||this.#d(e))return;r.onState({pending:!1,value:null,error:o,ok:!1})}finally{this.#i===n&&(this.#i=void 0),!this.#d(e)&&(r.poll??0)>0&&(this.#r=this.#t(()=>{this.#l(e)},r.poll))}}};var $,Jn=0,Ht=100,We=new WeakMap,ge=new WeakMap;function Dt(t){let{dependency:e,previousSubscriber:n,nextSubscriber:r}=t;n===void 0?e.first=r:n.nextSubscriber=r,r===void 0?e.last=n:r.previousSubscriber=n}function Mt(t){if(t.length>8)return[];for(;t.length>0;)t.pop();return t}var Fe=class{#e=[];#t=[];#n=!1;#o=!1;enqueue(e){e.stopped||e.queued||(e.queued=!0,this.#e.push(e),!this.#n&&!this.#o&&(this.#n=!0,queueMicrotask(()=>{this.#n=!1,this.flush()})))}enqueueDependency(e){if(this.#o||this.#e.length>0)return!1;for(let n=e.first;n!==void 0;n=n.nextSubscriber){let r=n.effect;if(r.scheduler!==this){for(let o of this.#e)o.queued=!1;return this.#e=[],!1}r.queued||(r.queued=!0,this.#e.push(r))}return this.#n||(this.#n=!0,queueMicrotask(()=>{this.#n=!1,this.flush()})),!0}flush(){this.#o||this.#e.length===0||this.#i()}#i(){this.#o=!0;let e=0,n,r=0;try{for(;this.#e.length>0;){if(e+=1,e>Ht){for(let o of this.#e)o.queued=!1;this.#e=[],y("HR006","A reactive flush exceeded the propagation-depth limit.")}if(n=this.#e,n.length>1){let o=1,i=n[0];for(;o<n.length;){let a=n[o];if(i.priority>a.priority||i.priority===a.priority&&i.id>a.id)break;i=a,o+=1}o<n.length&&n.sort((a,s)=>a.priority-s.priority||a.id-s.id)}this.#e=this.#t,r=0;do{let o=n[r];if(o.queued=!1,r+=1,o.computed===void 0?o.execute():o.computed.refresh(),this.#e.length===1&&r===n.length&&this.#e[0].computed===void 0){e+=1,e>Ht&&(this.#e[0].queued=!1,this.#e=[],y("HR006","A reactive flush exceeded the propagation-depth limit."));let i=this.#e;this.#e=Mt(n),n=i,r=0}else this.#e.length>0&&this.#r(n,r)}while(r<n.length);this.#t=Mt(n),n=void 0}}finally{if(n!==void 0){for(;r<n.length;)n[r++].queued=!1;this.#t=[]}if(this.#e.length>0){for(let o of this.#e)o.queued=!1;this.#e=[]}this.#o=!1}}#r(e,n){if(this.#e.some(r=>r.computed!==void 0))for(let r=e.length-1;r>=n;r-=1){let o=e[r];o.computed===void 0&&(e.splice(r,1),this.#e.push(o))}}},be=class{constructor(e,n,r,o){this.scheduler=e;this.run=n;this.priority=r;this.computed=o}scheduler;run;priority;computed;id=Jn++;dependencies=void 0;stopped=!1;paused=!1;queued=!1;#e=void 0;#t=void 0;execute(){if(this.stopped||this.paused)return;if(this.#t=void 0,this.#e!==void 0){let n=this.#e;this.#e=void 0,n()}let e=$;$=this;try{let n=this.run();n!==void 0&&(this.#e=n)}finally{$=e;let n=this.#t,r=n===void 0?this.dependencies:n.nextDependency;for(n===void 0?this.dependencies=void 0:n.nextDependency=void 0;r!==void 0;){let o=r.nextDependency;Dt(r),r=o}}}track(e){let n=this.#t===void 0?this.dependencies:this.#t.nextDependency;if(n?.dependency===e){this.#t=n;return}for(let i=this.dependencies;i!==n;i=i?.nextDependency)if(i?.dependency===e)return;let r={dependency:e,effect:this,nextDependency:n,previousSubscriber:void 0,nextSubscriber:void 0};this.#t===void 0?this.dependencies=r:this.#t.nextDependency=r,this.#t=r;let o=e.first;if(this.computed!==void 0&&o!==void 0)r.nextSubscriber=o,o.previousSubscriber=r,e.first=r;else{let i=e.last;r.previousSubscriber=i,i===void 0?e.first=r:i.nextSubscriber=r,e.last=r}}schedule(){if(this.computed!==void 0){this.computed.invalidate();return}this.paused||this.scheduler.enqueue(this)}pause(){this.stopped||this.paused||(this.paused=!0,this.#n(),this.#e?.(),this.#e=void 0)}resume(){this.stopped||!this.paused||(this.paused=!1,this.execute())}stop(){this.stopped||(this.stopped=!0,this.#n(),this.#e?.(),this.#e=void 0)}#n(){let e=this.dependencies;for(;e!==void 0;){let n=e.nextDependency;Dt(e),e=n}this.dependencies=void 0,this.#t=void 0}},Ge=class{#e={first:void 0,last:void 0};#t;constructor(e){this.#t=e}get(){return $!==void 0&&$.track(this.#e),this.#t}set(e){Object.is(this.#t,e)||(this.#t=e,W(this.#e))}update(e){this.set(e(this.#t))}},we=class{#e;#t;#n;#o;#i=!1;#r=!0;#c=!1;#s=!1;constructor(e,n,r={first:void 0,last:void 0}){this.#e=r,this.#t=n,this.#n=new be(e,()=>this.#l(),0,this)}get(){return this.#n.paused||this.#n.stopped?this.#d():(this.#a(),$!==void 0&&$.track(this.#e),this.#o)}invalidate(){if(!(this.#n.stopped||this.#r)){this.#r=!0;for(let e=this.#e.first;e!==void 0;e=e.nextSubscriber)if(e.effect.computed===void 0){this.#n.scheduler.enqueue(this.#n);return}W(this.#e)}}refresh(){this.#a()}pause(){this.#n.stopped||this.#n.paused||(this.#r=!0,this.#n.pause())}resume(){this.#n.stopped||!this.#n.paused||(this.#n.paused=!1)}stop(){this.#n.stop()}#a(){if(this.#c&&y("HR006","A reactive computed value depends on itself."),!this.#r||this.#n.stopped||this.#n.paused)return;let e=this.#i;this.#n.execute(),e&&this.#s&&W(this.#e,$?.computed===void 0?void 0:$)}#d(){this.#c&&y("HR006","A reactive computed value depends on itself.");let e=$;this.#c=!0,$=void 0;try{return this.#t()}finally{$=e,this.#c=!1}}#l(){this.#c=!0,this.#r=!1;try{let e=this.#t();this.#s=!this.#i||!Object.is(this.#o,e),this.#o=e,this.#i=!0}catch(e){throw this.#r=!0,e}finally{this.#c=!1}}};function W(t,e){let n=t?.first;if(n===void 0)return;let r=n!==t.last;if(!r&&n.effect.computed!==void 0){n.effect!==e&&n.effect.computed.invalidate();return}if(n.effect.computed===void 0){if(e===void 0&&r&&n.effect.scheduler.enqueueDependency(t))return;for(let o=n;o!==void 0;){let i=o.nextSubscriber;o.effect!==e&&o.effect.schedule(),o=i}return}for(let o=n;o!==void 0;){let i=o.nextSubscriber;o.effect!==e&&o.effect.schedule(),o=i}}function Pt(t){return new Ge(t)}function jt(t,e){return new we(t,e)}function F(t,e,n=1,r=!0){let o=new be(t,e,n);return r?o.execute():o.paused=!0,o}var ve=class t{constructor(e=[],n=new Fe,r){this.scheduler=n;this.parent=r;for(let[o,i]of e)this.set(o,i)}scheduler;parent;#e=new Map;#t;#n;has(e){return this.#o(e)!==void 0||this.parent?.has(e)===!0}get(e){let n=this.#o(e);return n===void 0?this.parent?.get(e):($!==void 0&&$.track(n),n.value)}set(e,n){let r=this.#r(n),o=this.#o(e);if(o===void 0){o={value:r,first:void 0,last:void 0},this.#e.set(e,o),this.#n=o;return}Object.is(o.value,r)||(o.value=r,W(o))}defineComputed(e,n){let r=this.#o(e);r===void 0&&(r={value:null,first:void 0,last:void 0},this.#e.set(e,r),this.#n=r);let o=new we(this.scheduler,()=>this.#r(n()),r);return r.computed=o,Object.hasOwn(this,"get")||(this.get=this.#i),o}fork(e=[]){return new t(e,this.scheduler,this)}#o(e){return e!==this.#t&&(this.#t=e,this.#n=this.#e.get(e)),this.#n}#i(e){let n=this.#o(e);return n===void 0?this.parent?.get(e):n.computed!==void 0?n.computed.get():($!==void 0&&$.track(n),n.value)}#r(e){if(e===null||typeof e!="object")return e;let n=We.get(e);if(n!==void 0)return n;let r=new Proxy(e,{get:(o,i,a)=>{if($!==void 0){let s=ge.get(o);s===void 0&&(s=new Map,ge.set(o,s));let c=s.get(i);c===void 0&&(c={first:void 0,last:void 0},s.set(i,c)),$.track(c)}return this.#r(Reflect.get(o,i,a))},set:(o,i,a,s)=>{let c=Reflect.get(o,i,s),l=this.#r(a),f=Reflect.set(o,i,l,s);return Object.is(c,l)||W(ge.get(o)?.get(i)),f},deleteProperty:(o,i)=>{let a=Reflect.has(o,i),s=Reflect.deleteProperty(o,i);return a&&W(ge.get(o)?.get(i)),s}});return We.set(e,r),We.set(r,r),r}};var Qn=/\/\*[\s\S]*?\*\/|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|--[\w-]+\s*:[^;{}]*|:(user-invalid|invalid|valid)(?![\w-])/g;function Lt(t){return t.replace(Qn,(e,n)=>n===void 0?e:`:is(:${n}, [data-${n}])`)}var G="data-component",ke="data-slotted";function It(t,e,n){let r=new Set((t.getAttribute(e)??"").split(/\s+/).filter(Boolean));r.add(n),t.setAttribute(e,Array.from(r).join(" "))}function Ce(t){t.nodeType===1&&t.setAttribute(ke,"")}function Ze(t){return`data-${t}-state`}var Ot={slotted:"[--slotted]",state:"[--state]"},Yn=/\/\*[\s\S]*?\*\/|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|:(slotted|host-state)\(/g;function Xn(t,e=["slotted","host-state"]){return t.replace(Yn,(n,r)=>r===void 0||!e.includes(r)?n:`:where(${r==="slotted"?Ot.slotted:Ot.state}):is(`)}function er(t){return/:where\(\s*\[--slotted\]\s*\)/.test(t)?"slotted":"own"}function tr(t,e){let n=0;for(let r=e;r<t.length;r+=1){let o=t[r];if(o==='"'||o==="'"){let i=t.indexOf(o,r+1);r=i===-1?t.length:i}else if(o==="(")n+=1;else if(o===")"&&--n===0)return r}return t.length}var nr=/\[\s*([\w-]+)\s*(?:=\s*(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|([^\]\s]+))\s*)?\]/g;function rr(t,e,n,r){let o="";for(let i of t.matchAll(nr)){let a=r(i[1]),s=i[2]??i[3]??i[4];n.add(a),o+=`[${Ze(e)}~="${s===void 0?a:`${a}=${encodeURIComponent(s)}`}"]`}return o}function or(t){let e="";for(let n=0;n<t.length;n+=1){let r=t[n];if(r==="["){let s=t.indexOf("]",n),c=s===-1?t.length:s+1;e+=t.slice(n,c),n=c-1;continue}let o=e.at(-1),a=o===void 0||/[\s>+~(,]/.test(o)?/^[a-z][a-z0-9]*(?:-[a-z0-9]+)+(?![\w-]|\()/.exec(t.slice(n))?.[0]:void 0;if(a!==void 0){e+=`:is(${a}, :where([${G}~="${a}"]))`,n+=a.length-1;continue}e+=r}return e}function ir(t,e,n,r,o=i=>i){/:scope(?![\w-])/.test(t)&&y("HY003",`\`:scope\` is not part of component styles; select the root with \`:host\` (in <${e}>).`);let i="",a=0,s=/:where\(\s*\[--state\]\s*\):is\(/g;for(let c=s.exec(t);c!==null;c=s.exec(t)){let l=c.index+c[0].length-1,f=tr(t,l);i+=`${t.slice(a,c.index)}${n}${rr(t.slice(l+1,f),e,r,o)}`,a=f+1,s.lastIndex=a}return i+=t.slice(a),i=i.replace(/:where\(\s*\[--slotted\]\s*\):is\(/g,`:where([${ke}], [${ke}] *):is(`).replace(/:host(?![\w-])/g,n),or(Lt(i))}function sr(t,e,n,r){let o=`[${G}~="${t}"]`;return[r,e.trim()===""?"":`@scope (${o}) to ([${G}], [${ke}]) {
3
3
  ${e}
4
4
  }`,n.trim()===""?"":`@scope (${o}) to ([${G}]) {
5
5
  ${n}
6
6
  }`].filter(i=>i!=="").join(`
7
7
  `)}function zt(t){if(typeof t=="string")return!0;if(t===null||typeof t!="object")return!1;if("enum"in t)return!0;let e=t;return e.kind==="union"?(e.members??[]).every(zt):e.kind!=="list"&&e.kind!=="record"&&e.kind!=="object"}function ar(t,e,n){let r=new Set((t.declarations??[]).filter(o=>o.kind==="state").map(o=>o.name));for(let o of e){let i=t.contract.props[o];i===void 0&&!r.has(o)&&y("HY001",`\`:host-state()\` tests \`${o}\`, which is not a declared prop or state.`,n),i!==void 0&&!zt(i.type)&&y("HY002",`\`:host-state()\` cannot test \`${o}\`, whose type is structured.`,n)}}function Vt(t,e,n,r){let o=e.contract.tag;if(t.trim()==="")return{css:"",stateNames:[]};let i=(n.defaultView??globalThis).CSSStyleSheet,a=Xn(t),s=new Set,c=[],l=n.defaultView??globalThis,f=l.CSSStyleRule,d=l.CSSGroupingRule,h=new Map([...Object.keys(e.contract.props),...(e.declarations??[]).filter(g=>g.kind==="state").map(g=>g.name)].map(g=>[g.toLowerCase(),g])),u=g=>h.get(g.toLowerCase())??g,p=g=>{g.selectorText=ir(g.selectorText,o,":scope",s,u);for(let b of Array.from(g.cssRules??[]))b instanceof f&&p(b)},m=(g,b,v)=>{let R=g.cssRules;for(let T=0;T<R.length;){let A=R[T];A instanceof f?er(A.selectorText)===b?(p(A),T+=1):g.deleteRule(T):A instanceof d?(m(A,b,!1),T+=1):(v&&b==="own"&&c.push(A.cssText),g.deleteRule(T))}},w=g=>{let b=new i;return b.replaceSync(a),m(b,g,!0),Array.from(b.cssRules,v=>v.cssText).join(`
8
- `)},k=w("own"),x=w("slotted");return ar(e,s,r),{css:sr(o,k,x,c.join(`
9
- `)),stateNames:[...s]}}function qt(t,e){let n=[];for(let r of t){let o=e(r);(o===!0||typeof o=="string"&&o.length>0||typeof o=="number"&&o!==0&&!Number.isNaN(o))&&n.push(r),(typeof o=="string"||typeof o=="number")&&n.push(`${r}=${encodeURIComponent(String(o))}`)}return n.join(" ")}var xe=new WeakSet,Kt=new WeakMap,Ut=new WeakMap,cr=Symbol.for("@nextwebwg/html-next.runtime.v1");function Je(t){return t[cr]??={}}function Z(t){return Kt.get(t)}function Jt(t){let e=Je(t),n=e.registry;return(n===void 0||n.root!==t.documentElement)&&(n={root:t.documentElement,definitions:new Map,discoverySelector:void 0},e.registry=n),n}var Qt=new WeakMap;function Yt(t,e,n){let r=Vt(t,e,n);return Qt.set(e,r.stateNames),r.css}function Xt(t,e,n){t.definitions.set(e,n),t.discoverySelector!==void 0&&(t.discoverySelector+=`,${e}`)}function dr(t){return t.discoverySelector??=["template[component]","[data-component]",...Array.from(t.definitions.keys())].join(",")}function lr(t,e){let n=t.getAttribute("component")??"",r=`${t.ownerDocument.URL}#template[component="${n}"][${e+1}]`;t.hasAttribute("src")&&y("HL001","External definitions require the application-owned graph resolver.",r);let o=Ue(t,r),i=Array.from(t.content.children).find(a=>a.localName==="style");return{wrapper:t,style:i,definition:o}}function en(t,e=document){let n=Jt(e),r=0;for(let o of t.nodes.values()){if(o.shadowedByCustomElement)continue;let i=o.definition.contract.tag;n.definitions.has(i)&&y("HR001",`More than one definition declares <${i}>.`);let a=o.definition.css===""?void 0:e.createElement("style");a!==void 0&&(a.textContent=Yt(o.definition.css,o.definition,e),e.head.append(a)),Xt(n,i,{definition:o.definition,style:a}),r+=1}return r}function Qe(t,e,n=!1){let r=t.type==="boolean"&&n&&e===""?!0:e,o=_(r,t.type);if(!o.ok){let i=o.issues.map(a=>`${a.path}: ${a.message}`).join("; ");y("HR002",`A prop invocation value does not satisfy its declared type. ${i}`)}return o.value}function ur(t,e,n){return n!==void 0?Qe(e,n):(e.required&&y("HC020",`Required prop \`${t}\` was not provided.`),e.default===void 0?E:e.default)}function fr(t,e){let n=Ut.get(t);if(n===void 0){let r=Object.create(null),o=Object.create(null);for(let i of Object.keys(t.contract.props)){let a=Re(i);r[a]=i,o[`data-${a}`]=i,a!==i.toLowerCase()&&(o[`data-${i.toLowerCase()}`]=i)}n=[r,o],Ut.set(t,n)}return n[e?1:0]}function pr(t,e,n=!1){let r=e.contract,o=fr(e,n),i=Object.create(null),a=[],s;for(let p of Array.from(t.attributes)){if(p.name.toLowerCase()==="as"&&e.root?.kind==="native"){s=p.value.toLowerCase();continue}let m=o[p.name.toLowerCase()];if(m===void 0){n||a.push(p);continue}i[m]=Qe(r.props[m],p.value,!n)}let c=e.root?.kind==="native"?n?t.localName:s??e.root.element:e.template.name;e.root?.kind==="native"&&!e.root.choices.includes(c)&&y(n?"HR005":"HR002",`<${r.tag}> cannot use root <${c}>; expected one of ${e.root.choices.join(", ")}.`);let l=new Set(Object.keys(i).filter(p=>i[p]!==void 0)),f=new ve;for(let[p,m]of Object.entries(r.props))m.required&&i[p]===void 0&&y("HC020",`Required prop \`${p}\` was not provided.`),f.set(p,i[p]!==void 0?i[p]:m.default===void 0?E:m.default);let d=e.declarations??[];for(let p of d)(p.kind==="state"||p.kind==="computed"||p.kind==="data")&&f.set(p.name,null);for(let p of d)p.kind==="data"?f.set(p.name,{pending:!0,value:null,error:null,ok:!1}):p.kind==="state"&&f.set(p.name,p.expression===void 0?null:D(p.expression.source,f));let h=[];for(let p of d)p.kind!=="computed"||p.expression===void 0||h.push(f.defineComputed(p.name,()=>I(p.expression,f)));let u=(()=>{try{return new URL(e.source.file,t.ownerDocument.baseURI).href}catch{return t.ownerDocument.baseURI}})();for(let p of d){if(p.kind!=="data"||p.source===void 0)continue;let m=p,w=p.source,k=new ye({source:w,baseURL:u,...m.type===void 0?{}:{type:m.type},...m.debounce===void 0?{}:{debounce:Number(m.debounce)},...m.poll===void 0?{}:{poll:Number(m.poll)},onState:x=>f.set(m.name,x)});h.push(F(f.scheduler,()=>{let x=Object.fromEntries(m.parameters.map(g=>[g.name,I(g.expression,f)]));return k.update(x),()=>k.disconnect()},0))}return{scope:f,passThrough:a,effects:h,rootName:c,explicit:l}}function Ke(t,e){return t.fork(Object.entries(e))}function D(t,e){try{return mt(t,e)}catch(n){throw n instanceof ee&&y("HB001",n.message),n}}var ie="http://www.w3.org/2000/svg",Bt=new Map;function mr(t,e){if(t.namespaceURI!==ie)return e;let n=Bt.get(e);if(n===void 0){let r=t.ownerDocument.createElement("template");r.innerHTML=`<svg ${e}>`,n=r.content.firstChild.attributes[0]?.name??e,Bt.set(e,n)}return n}function tn(t,e,n){return e==="svg"||n.namespace===ie?t.createElementNS(ie,e):t.createElement(e)}function hr(t,e){let n=t.namespaceURI===ie&&t.localName!=="foreignObject"?ie:void 0;return n===e.namespace?e:Object.create(e,{namespace:{value:n,enumerable:!0}})}function q(t,e,n,r=1){t.effects.push(F(e.scheduler,n,r))}function nn(t,e,n){let[r,...o]=e;if(typeof r!="string")return;if(o.length===0){t.set(r,n);return}let i=t.get(r);for(let c=0;c<o.length-1;c+=1){let l=o[c],f=typeof l=="object"?I(l.expression,t):l;if(typeof f!="string"&&typeof f!="number"||i==null)return;i=i[f]}let a=o.at(-1),s=typeof a=="object"?I(a.expression,t):a;(typeof s=="string"||typeof s=="number")&&i!=null&&(i[s]=n)}function yr(t){return t instanceof HTMLInputElement?t.type==="checkbox"||t.type==="radio"?t.checked:t.type==="number"||t.type==="range"?Number.isNaN(t.valueAsNumber)?null:t.valueAsNumber:t.value:t instanceof HTMLSelectElement?t.multiple?Array.from(t.selectedOptions,e=>e.value):t.value:t instanceof HTMLTextAreaElement?t.value:t.value??t.getAttribute("value")}function gr(t,e,n){let r=e.toLowerCase();if(r==="checked"&&t instanceof HTMLInputElement)return t.checked=L(n),!0;if(r==="value"&&t instanceof HTMLSelectElement&&t.multiple){let o=new Set(Array.isArray(n)?n.map(String):[]);for(let i of Array.from(t.options))i.selected=o.has(i.value);return!0}return r==="value"&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement)?(t.value=n==null?"":String(n),!0):!1}function br(t,e,n,r){for(let o of t.steps)if(!(o.guard!==void 0&&!L(I(o.guard,n))))if(o.kind==="set")nn(n,o.writablePath,I(o.value,n));else if(o.kind==="dispatch"){let i=rn(r.definition,o.event),a=o.value===void 0?void 0:I(o.value,n);i!==void 0&&a!==void 0&&(_(a,de(i.type)).ok||y("HR002",`Event \`${o.event}\` detail does not satisfy its declared type.`)),on(r.root??e,o.event,a,i)}else{let i=r.refs[o.target];o.kind==="focus"?i?.focus():i?.reportValidity?.()}}function rn(t,e){return(t.declarations??[]).find(n=>n.kind==="event"&&n.name===e)}function on(t,e,n,r){return t.dispatchEvent(new CustomEvent(e,{detail:n,bubbles:r?.bubbles??!0,composed:r?.composed??!0,cancelable:r?.cancelable??!1}))}function wr(t,e,n){if(n.includes("self")&&t.target!==e)return!1;if(t instanceof MouseEvent){let o=n.filter(a=>["left","middle","right"].includes(a)),i={left:0,middle:1,right:2};if(o.length>0&&!o.some(a=>t.button===i[a]))return!1}let r=["ctrl","shift","alt","meta"];for(let o of r)if(n.includes(o)&&!t[`${o}Key`])return!1;if(n.includes("exact")&&r.some(o=>!n.includes(o)&&t[`${o}Key`]))return!1;if(t instanceof KeyboardEvent){let o=n.filter(a=>["enter","escape","space","tab","up","down","left","right"].includes(a)),i={enter:"Enter",escape:"Escape",space:" ",tab:"Tab",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight"};if(o.length>0&&!o.some(a=>t.key===i[a]))return!1}return!0}function _t(t,e,n,r){for(let o of e.events??[]){let i=(r.definition.declarations??[]).find(s=>s.kind==="handler"&&s.name===o.handler),a=s=>{wr(s,t,o.modifiers)&&(o.modifiers.includes("prevent")&&s.preventDefault(),o.modifiers.includes("stop")&&s.stopPropagation(),br(i,t,n,r))};if(o.name==="connect"||o.name==="disconnect"){(o.name==="connect"?r.connectCallbacks:r.disconnectCallbacks).add(()=>a(new Event(o.name)));continue}q(r,n,()=>(t.addEventListener(o.name,a,{capture:o.modifiers.includes("capture"),passive:o.modifiers.includes("passive"),once:o.modifiers.includes("once")}),()=>t.removeEventListener(o.name,a,{capture:o.modifiers.includes("capture")})),2)}}function vr(t,e,n){e=mr(t,e),n===null||ne(e)&&te(n)?t.removeAttribute(e):t.setAttribute(e,n)}function kr(t,e,n,r){let o=D(e.expression,n);e.name==="value"?t.textContent=P(o):t.replaceChildren(je(P(o),r,i=>xe.add(i)))}function Cr(t,e,n){let r=D(t.expression,e);return t.name==="value"?n.createTextNode(P(r)):je(P(r),n,o=>xe.add(o))}function xr(t,e){return typeof t=="number"&&typeof e=="number"?t-e:P(t).localeCompare(P(e))}function Er(t,e,n){let r=t.slice();if(e.where!==void 0){let o=e.where;r=r.filter(i=>L(D(o,Ke(n,{[e.item]:i}))))}if(e.sort!==void 0){let o=e.sort.split(",").map(a=>a.trim()).filter(a=>a!==""),i=(a,s)=>a!==null&&typeof a=="object"&&!Array.isArray(a)?D(`${e.item}.${s}`,Ke(n,{[e.item]:a})):a;r.sort((a,s)=>{for(let c of o){let l=c.startsWith("-"),f=l?c.slice(1).trim():c,d=xr(i(a,f),i(s,f));if(d!==0)return l?-d:d}return 0})}if(e.limit!==void 0){let o=D(e.limit,n);typeof o=="number"&&(r=r.slice(0,Math.max(0,Math.trunc(o))))}return r}function sn(t,e){let n=e.createDocumentFragment();return n.append(...t),Array.from(n.childNodes)}function Rr(t,e){let n=t.nextSibling;for(;n!==null&&n!==e;){let r=n.nextSibling;n.remove(),n=r}}function Tr(t,e,n,r,o){if(t.flow?.kind==="each")return Ar(t,e,n,r,o);let i=n.createComment("html-next:start"),a=n.createComment("html-next:end"),s=n.createDocumentFragment();s.append(i,a);let c=[];return q(o,e,()=>{for(let d of c)d.stop();c=[],Rr(i,a);let l=o.effects.length,f=[];if(t.flow?.kind==="if"){if(L(D(t.flow.test,e))){let{flow:d,...h}=t;f=se(h,e,n,r,o)}}else if(t.flow?.kind==="with"){let d=e.fork([[t.flow.alias,D(t.flow.expr,e)]]),{flow:h,...u}=t;f=se(u,d,n,r,o)}else t.flow?.kind==="match"&&(f=Hr(t,e,n,o));c=o.effects.slice(l),a.before(...sn(f,n))}),[s]}function Sr(t,e){if(t.end.nextSibling===e)return;let n=[],r=t.start;for(;r!==null&&(n.push(r),r!==t.end);)r=r.nextSibling;let o=e.parentNode;if(o===null)return;let i=o.moveBefore;for(let a of n)i===void 0?o.insertBefore(a,e):i.call(o,a,e)}function Nr(t){for(let n of t.effects)n.stop();let e=t.start;for(;e!==null;){let n=e.nextSibling;if(e.parentNode?.removeChild(e),e===t.end)break;e=n}}function $r(t){let e=-1,n=!0;for(let s of t)s<0||(s<e&&(n=!1),e=s);if(n)return;let r=[],o=new Int32Array(t.length).fill(-1);for(let s=0;s<t.length;s+=1){let c=t[s];if(c<0)continue;let l=0,f=r.length;for(;l<f;){let d=l+f>>>1;t[r[d]]<c?l=d+1:f=d}l>0&&(o[s]=r[l-1]),r[l]=s}let i=new Uint8Array(t.length),a=r.at(-1)??-1;for(;a>=0;)i[a]=1,a=o[a];return i}function Ar(t,e,n,r,o){let i=t.flow,a=n.createComment("html-next:each-start"),s=n.createComment("html-next:each-end"),c=n.createDocumentFragment();c.append(a,s);let l=new Map;return q(o,e,()=>{let f=D(i.list,e),d=Array.isArray(f)?Er(f,i,e):[],h=new Map,u=i.key!==void 0,p=u?[]:void 0,m;if(u){m=new Map;let g=0;for(let b of l.keys())m.set(b,g++)}let w=u?[]:void 0,{flow:k,...x}=t;for(let g=0;g<d.length;g+=1){let b=d[g],v={[i.item]:b,loop:{index:g,first:g===0,last:g===d.length-1,count:d.length}};i.index!==void 0&&(v[i.index]=g);let R,T=g;i.key!==void 0&&(R=e.fork(Object.entries(v)),T=D(i.key,R)),h.has(T)&&y("HR004",`A keyed list produced duplicate key \`${P(T)}\`.`);let A=l.get(T);if(A===void 0){R??=e.fork(Object.entries(v));let M=o.effects.length,ae=sn(se(x,R,n,r,o),n),it=n.createComment("html-next:item-start"),st=n.createComment("html-next:item-end");s.before(it,...ae,st),A={start:it,end:st,scope:R,effects:o.effects.slice(M)}}else A.scope.set(i.item,b),i.index!==void 0&&A.scope.set(i.index,g),A.scope.set("loop",v.loop);h.set(T,A),p?.push(A),w?.push(m?.get(T)??-1)}for(let[g,b]of l)h.has(g)||Nr(b);if(p!==void 0&&w!==void 0){let g=$r(w),b=s;for(let v=p.length-1;v>=0;v-=1){let R=p[v];(w[v]<0||g!==void 0&&g[v]!==1)&&Sr(R,b),b=R.start}}l=h}),[c]}function an(t,e,n,r,o,i){return t.flow?.kind==="if"||t.flow?.kind==="each"||t.flow?.kind==="with"||t.flow?.kind==="match"?o.committed&&o.frameworkOwned&&i!==void 0?[i]:Tr(t,e,n,r,o):se(t,e,n,r,o,i)}function Hr(t,e,n,r){let o=t.flow,i=o.expr!==void 0?Ke(e,{[o.alias]:D(o.expr,e)}):e,a;for(let d of t.children)if(d.kind==="element"){if(d.flow?.kind==="when"&&L(D(d.flow.test,i))){a=d;break}if(d.flow?.kind==="else"){a=d;break}}if(a===void 0)return[];let{flow:s,...c}=a,l=se(c,i,n,[],r);if(t.name==="template")return l;let f=tn(n,t.name,r);for(let d of t.attributes)d.kind==="literal"&&f.setAttribute(d.name,d.value);return f.append(...l),[f]}function se(t,e,n,r,o,i){let a=t.attributes.find(m=>m.kind==="directive");if(t.name==="template"){if(a!==void 0){let m=n.createTextNode("");return q(o,e,()=>{let w=D(a.expression,e);a.name==="value"&&(m.data=P(w))}),a.name==="value"?[m]:[Cr(a,e,n)]}return cn(t.children,e,n,o)}let s=t===o.definition.template?o.rootName:t.name;if(o.frameworkOwned&&i instanceof Element&&i.localName!==s&&(i.getAttribute("data-component")??"").split(/\s+/).includes(t.name))return[i];if(o.hydrationRanges!==void 0&&!o.frameworkOwned&&i instanceof Element&&i.localName!==s&&(i.getAttribute("data-component")??"").split(/\s+/).includes(t.name)){let m=Ye(i,!1),w=b=>b.kind==="element"?b.attributes.find(v=>v.kind==="literal"&&v.name==="slot")?.value??"":"",k=m?.ranges.filter(b=>!b.fallback)??[],x=(b,v)=>{let R=0;for(let T of b)R+=Ee(T,e,n,o,v[R]).length};for(let b of k)x(t.children.filter(v=>w(v)===b.slot),b.content);let g=new Set(k.map(b=>b.slot));return x(t.children.filter(b=>!g.has(w(b))),m?.carried??[]),[i]}let c=i instanceof Element&&i.localName===s,l=c?i:tn(n,s,o);t===o.definition.template&&(o.root=l);let f=c?Array.from(l.childNodes):[],d=c&&(l instanceof HTMLInputElement||l instanceof HTMLTextAreaElement||l instanceof HTMLSelectElement)?{value:l.value,focused:l.ownerDocument.activeElement===l,...l instanceof HTMLInputElement?{checked:l.checked}:{},...l instanceof HTMLInputElement||l instanceof HTMLTextAreaElement?{selectionStart:l.selectionStart,selectionEnd:l.selectionEnd}:{}}:void 0;t.ref!==void 0&&(o.refs[t.ref]=l);for(let m of t.attributes)m.kind==="literal"&&l.setAttribute(m.name,m.value);for(let m of r){let w=m.name==="class"||m.name==="style"?l.getAttribute(m.name):null;l.setAttribute(m.name,w===null||w===""?m.value:`${w}${m.name==="class"?" ":"; "}${m.value}`)}for(let m of t.attributes)if(m.kind==="attribute"){if(q(o,e,()=>{let w=D(m.expression,e);m.target==="class"?l.classList.toggle(m.name,L(w)):m.target==="style"?l.style.setProperty(m.name,P(w)):m.twoWay===!0&&gr(l,m.name,w)||vr(l,m.name,ht(w,m.name))}),m.twoWay===!0&&m.writablePath!==void 0){let w=l instanceof HTMLSelectElement||l instanceof HTMLInputElement&&["checkbox","radio","file"].includes(l.type)?"change":"input",k=()=>{l instanceof HTMLInputElement&&l.type==="radio"&&!l.checked||nn(e,m.writablePath,yr(l))};q(o,e,()=>(l.addEventListener(w,k),()=>l.removeEventListener(w,k)),2)}}else m.kind==="property"&&q(o,e,()=>{l[m.name]=D(m.expression,e)});if(a!==void 0)return q(o,e,()=>kr(l,a,e,n)),_t(l,t,e,o),[l];let h=[],u=0,p=hr(l,o);for(let m of t.children){let w=u;if(o.frameworkOwned&&m.kind==="element"){let x=f.findIndex((g,b)=>b<u?!1:g instanceof Element&&(g.localName===m.name||(g.getAttribute("data-component")??"").split(/\s+/).includes(m.name)));x<0&&m.flow!==void 0&&(x=f.findIndex((g,b)=>b>=u&&g instanceof Comment)),x>=0&&(w=x)}let k=Ee(m,e,n,p,f[w]);h.push(...k),u=w+k.length}if(c&&!o.frameworkOwned){h=h.flatMap(m=>m.nodeType===11?Array.from(m.childNodes):[m]);for(let m=0;m<h.length;m+=1){let w=h[m];l.childNodes[m]!==w&&l.insertBefore(w,l.childNodes[m]??null)}for(;l.childNodes.length>h.length;)l.lastChild.remove()}else c||l.append(...h);return d!==void 0&&(l.value=d.value,l instanceof HTMLInputElement&&"checked"in d&&(l.checked=d.checked),(l instanceof HTMLInputElement||l instanceof HTMLTextAreaElement)&&"selectionStart"in d&&typeof d.selectionStart=="number"&&typeof d.selectionEnd=="number"&&(d.focused&&l.focus({preventScroll:!0}),l.setSelectionRange(d.selectionStart,d.selectionEnd))),_t(l,t,e,o),[l]}function cn(t,e,n,r){let o=[];for(let i of t)o.push(...Ee(i,e,n,r));return o}function Dr(t,e){return e.projectedSlotNames.get(t)??(t instanceof Element?t.getAttribute("slot")??"":"")}function Mr(t,e,n,r){let o=t.nameExpression===void 0?t.name??"":P(I(t.nameExpression,e)),i=r.projectedNodes.filter(d=>Dr(d,r)===o),a=r.hydrationRanges?.shift();if(a!==void 0){if(a.fallback){let d=[],h=0;for(let u of t.fallback??[]){let p=Ee(u,e,n,r,a.content[h]);d.push(...p),h+=p.length}return[a.markers[0],...d,...a.markers.slice(1)]}for(let d of a.content)Ce(d);return a.markers.length===1?[a.markers[0]]:[a.markers[0],...a.content,a.markers[1]]}let s=d=>`"${d.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}"`,c=(d,h)=>Pr(n,d,h),l=(d,h)=>{if(d.length===0)return[c("marker",`slot=${s(o)}`)];let u=`slot=${s(o)}${h?' fallback=""':""}`;return[c("start",u),...d,c("end","")]};if(i.length===0)return l(cn(t.fallback??[],e,n,r),!0);if(r.committed){for(let d of i)Ce(d);return l([...i],!1)}let f=n.createComment(`html-next:slot:${o}`);return r.slotInsertions.push({anchor:f,nodes:i}),l([f],!1)}function Wt(t){let e=new Map,n=t.trim(),r={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};for(;n!=="";){let o=/^([A-Za-z_:][-A-Za-z0-9._:]*)\s*=\s*(?:"([^"<]*)"|'([^'<]*)')(?:\s+|$)/.exec(n);if(o===null||e.has(o[1]))return new Map;let i=(o[2]??o[3]).replace(/&(#x[0-9a-fA-F]+|#\d+|amp|lt|gt|quot|apos);/g,(a,s)=>s.startsWith("#x")?String.fromCodePoint(parseInt(s.slice(2),16)):s.startsWith("#")?String.fromCodePoint(Number(s.slice(1))):r[s]);e.set(o[1],i),n=n.slice(o[0].length)}return e}var Ft=new WeakMap;function dn(t){let e=Ft.get(t);if(e===void 0){let n=t.createElement("div");n.innerHTML='<?probe x="1"?>',e=n.firstChild?.nodeType===7,Ft.set(t,e)}return e}function Pr(t,e,n){return dn(t)?t.createProcessingInstruction(e,n):t.createComment(`?${e}${n===""?"":` ${n}`}?`)}function Ze(t){if(t.nodeType===7){let n=t;return{target:n.target,attributes:Wt(n.data)}}if(t.nodeType!==8||dn(t.ownerDocument))return;let e=/^\?([A-Za-z][-A-Za-z0-9]*)(?:\s+([\s\S]*?))?\s*\??$/.exec(t.data);return e===null?void 0:{target:e[1],attributes:Wt(e[2]??"")}}function Ye(t,e=!0){let n=[],r=new Set,o=(s,c)=>{for(let l=0;l<s.length;l+=1){let f=s[l],d=Ze(f);if(d?.target==="marker"&&d.attributes.has("slot")){c.push({slot:d.attributes.get("slot"),fallback:!1,markers:[f],content:[]});continue}if(d?.target==="start"){let h=1,u=[],p;for(l+=1;l<s.length;l+=1){let m=Ze(s[l]);if(m?.target==="start")h+=1;else if(m?.target==="end"&&--h===0){p=s[l];break}u.push(s[l])}if(d.attributes.has("slot")){c.push({slot:d.attributes.get("slot"),fallback:d.attributes.has("fallback"),markers:p?[f,p]:[f],content:u});for(let m of u)r.add(m)}else o(u,c);continue}if(f instanceof Element)if(f!==t&&f.hasAttribute("data-component")){let h=Ye(f,!1);for(let u of h?.ranges??[])o(u.content,c)}else o(Array.from(f.childNodes),c)}};o(Array.from(t.childNodes),n);let i=Array.from(t.children).find(s=>s instanceof HTMLTemplateElement&&!r.has(s)&&s.previousSibling!==null&&Ze(s.previousSibling)?.target==="carrier");if(n.length===0&&i===void 0)return;let a=[];if(i!==void 0&&e){for(let s of Array.from(i.content.childNodes))a.push(t.ownerDocument.adoptNode(s));i.previousSibling.remove(),i.remove()}else i!==void 0&&a.push(...Array.from(i.content.childNodes));return{ranges:n,carried:a}}function Ee(t,e,n,r,o){if(t.kind==="text"){let i=o instanceof Text?o:n.createTextNode("");return i.data=t.value,[i]}return t.kind==="slot"?Mr(t,e,n,r):an(t,e,n,[],r,o)}function jr(t,e){let n=Qt.get(e.definition)??[];if(n.length===0)return;let r=Ge(e.definition.contract.tag);e.effects.push(F(e.scope.scheduler,()=>{let o=qt(n,i=>e.scope.get(i));o===""?t.removeAttribute(r):t.getAttribute(r)!==o&&t.setAttribute(r,o)},2))}function Lr(t,e){let n=e.definition.contract.props,r={},o={};for(let[f,d]of Object.entries(n)){let h=`data-${Re(f)}`;r[h]=f;let u=e.definition.template.attributes.some(p=>p.kind==="attribute"&&p.name===h);e.effects.push(F(e.scope.scheduler,()=>{let p=e.scope.get(f);if(!u&&!e.explicit.has(f))return;let m=p===void 0||p===E||p===null?null:Ae(p,d.type);o[h]=m,m===null?t.removeAttribute(h):t.setAttribute(h,m)},2))}let i=t.ownerDocument.defaultView?.MutationObserver,a=Object.keys(r);if(i===void 0||a.length===0)return;let s=new i(f=>{for(let d of f){let h=d.attributeName;if(h===null)continue;let u=r[h];if(u===void 0)continue;let p=t.getAttribute(h);if(h in o&&o[h]===p){delete o[h];continue}delete o[h];let m=n[u];p===null?e.explicit.delete(u):e.explicit.add(u),e.scope.set(u,p===null?ur(u,m,void 0):Qe(m,p,!0))}}),c=()=>s.observe(t,{attributes:!0,attributeFilter:a}),l=()=>s.disconnect();e.connectCallbacks.add(c),e.disconnectCallbacks.add(l)}function Or(t,e){for(let n of e.definition.declarations??[])n.kind==="method"&&Object.defineProperty(t,n.name,{configurable:!0,enumerable:!1,value:(...r)=>e.controllerModule===void 0?Promise.reject(new TypeError(`Controller method \`${n.name}\` is not ready for <${e.definition.contract.tag}>.`)):e.controllerModule.then(o=>{let i=o[n.exportName];return typeof i!="function"&&y("HJ003",`Controller does not export method \`${n.exportName}\`.`),Reflect.apply(i,void 0,[Xe(t),...r])})})}function Ir(t,e,n,r,o=new WeakMap,i=!1){let a=n&&t.contains(t.ownerDocument.activeElement)?t.ownerDocument.activeElement:null,s=a instanceof HTMLInputElement||a instanceof HTMLTextAreaElement?[a.selectionStart,a.selectionEnd]:void 0,{scope:c,passThrough:l,effects:f,rootName:d,explicit:h}=pr(t,e,n),u=r,p;if(n&&u===void 0){let b=Ye(t);if(b!==void 0){p=b.ranges;let v=[];for(let R of b.ranges)if(!R.fallback)for(let T of R.content)o.set(T,R.slot),v.push(T);v.push(...b.carried),u=v}else(e.slots??[]).length>0?y("HR005",`<${e.contract.tag}> has slots but its server-rendered root has no slot marks.`):u=[]}let m=n?u:Array.from(t.childNodes),w={definition:e,scope:c,refs:{},effects:f,connectCallbacks:new Set,disconnectCallbacks:new Set,connected:!1,explicit:h,frameworkOwned:i,projection:{nodes:n?u:Array.from(t.childNodes),slotNames:o}},k={definition:e,effects:f,refs:w.refs,connectCallbacks:w.connectCallbacks,disconnectCallbacks:w.disconnectCallbacks,projectedNodes:m,projectedSlotNames:o,slotInsertions:[],rootName:d,frameworkOwned:i,committed:n,hydrationRanges:p},x=an(e.template,c,t.ownerDocument,l,k,n?t:void 0);k.hydrationRanges=void 0;let g=x[0];return n&&g!==t&&y("HR005",`Server markup for <${e.contract.tag}> has an incompatible root.`),a instanceof HTMLElement&&(a.focus({preventScroll:!0}),s!==void 0&&(a instanceof HTMLInputElement||a instanceof HTMLTextAreaElement)&&typeof s[0]=="number"&&typeof s[1]=="number"&&a.setSelectionRange(s[0],s[1])),It(g,G,e.contract.tag),w.element=g,{invocation:t,nativeRoot:g,context:k,definition:e,instance:w,replace:!n}}function zr(t,e){e.sort((n,r)=>n.invocation.contains(r.invocation)?-1:r.invocation.contains(n.invocation)?1:0);for(let n of e){for(let r of n.context.slotInsertions){for(let o of r.nodes)Ce(o);r.anchor.replaceWith(...r.nodes)}n.replace&&n.invocation.replaceWith(n.nativeRoot),n.context.committed=!0,Kt.set(n.nativeRoot,n.instance),Lr(n.nativeRoot,n.instance),jr(n.nativeRoot,n.instance),Or(n.nativeRoot,n.instance),ln(n.instance)}}function Gt(t,e,n){t.nodeType===1&&t.matches(e)&&n.add(t);for(let r of t.querySelectorAll(e))n.add(r)}function Vr(t,e){let n=t.nodeType===1?t:void 0;if(n?.matches("[data-component]")===!0&&e(n),n?.childElementCount!==0)for(let r of t.querySelectorAll("[data-component]"))e(r)}function qr(t,e,n){let r=Jt(t),o=new Set,i=dr(r);for(let u of e)Gt(u,i,o);let a=[];for(let u of o)u.localName==="template"&&u.hasAttribute("component")&&!xe.has(u)&&a.push(lr(u,a.length));let s=new Map;for(let u of a){let p=u.definition.contract.tag;(r.definitions.has(p)||s.has(p))&&y("HR001",`More than one definition declares <${p}>.`),s.set(p,u)}let c=[],l=new Set,f=(u,p,m)=>{let{definition:w}=u;return xe.has(p)||t.defaultView?.customElements.get(w.contract.tag)!==void 0||n?.(p,w,m)===!1?!1:(c.push(Ir(p,w,m)),!0)},d=(u,p)=>{for(let m of p){let w=u.get(m.localName);if(w!==void 0&&f(w,m,!1),!m.hasAttribute("data-component"))continue;let k=Z(m);if(k!==void 0){k.frameworkOwned||l.add(m);continue}let x=!1;for(let g of new Set((m.getAttribute("data-component")??"").split(/\s+/))){let b=u.get(g);b!==void 0&&f(b,m,!0)&&(x=!0)}x&&l.add(m)}};if(d(r.definitions,o),s.size>0){let u=["[data-component]",...Array.from(s.keys())].join(","),p=new Set;Gt(t,u,p),d(s,p)}for(let u of a)Xt(r,u.definition.contract.tag,u),u.style!==void 0&&(u.style.textContent=Yt(u.style.textContent??"",u.definition,u.wrapper.ownerDocument),u.wrapper.ownerDocument.head.append(u.style)),u.wrapper.remove();zr(r,c);let h=c.map(u=>u.nativeRoot);for(let u of h)l.add(u);return{lowered:h,roots:Array.from(l)}}function Ur(t,e){let n=Je(t),r=n.mutationHub;if(r===void 0){let i=t.defaultView?.MutationObserver;i===void 0&&y("HR003","Automatic component management requires a browser MutationObserver.");let a=new Set,s=new i(c=>{for(let l of Array.from(a))l(c)});r={observer:s,subscribers:a},n.mutationHub=r,s.observe(t,{childList:!0,subtree:!0})}r.subscribers.add(e);let o=!0;return()=>{o&&(o=!1,r.subscribers.delete(e),r.subscribers.size===0&&(r.observer.disconnect(),delete n.mutationHub))}}function ln(t){if(!t.connected){t.connected=!0;for(let e of t.effects)e.resume();for(let e of t.connectCallbacks)e();t.element?.dispatchEvent(new Event("connect"))}}function Zt(t){if(t.connected){t.element?.dispatchEvent(new Event("disconnect"));for(let e of t.disconnectCallbacks)e();t.connected=!1;for(let e of t.effects)e.pause()}}function Xe(t){let e=Z(t);if(e===void 0)return;if(e.host!==void 0)return e.host;let n=new Set((e.definition.declarations??[]).filter(a=>a.kind==="state").map(a=>a.name)),r=new Proxy({},{get:(a,s)=>{if(typeof s!="string")return;let c=e.scope.get(s);return c===E?void 0:c},set:(a,s,c)=>{if(typeof s!="string"||!n.has(s))throw new TypeError(`Only declared state roots are writable; \`${String(s)}\` is read-only.`);return e.scope.set(s,c),!0},has:(a,s)=>typeof s=="string"&&e.scope.has(s)}),o=new Proxy({},{get:(a,s)=>typeof s!="string"?void 0:(t instanceof HTMLFormElement?t:t.querySelector("form"))?.elements.namedItem(s)??t.querySelector(`[name="${CSS.escape(s)}"]`)??void 0}),i={element:t,state:r,refs:e.refs,elements:o,signal(a){return Pt(a)},computed(a){let s=jt(e.scope.scheduler,a);return e.connected||s.pause(),e.effects.unshift(s),s},effect(a){let s=F(e.scope.scheduler,a,2,e.connected);return e.effects.push(s),()=>s.stop()},on(a,s){if(a==="connect"){let c=s;return e.connectCallbacks.add(c),e.connected&&s(),()=>e.connectCallbacks.delete(c)}if(a==="disconnect"){let c=s;return e.disconnectCallbacks.add(c),()=>e.disconnectCallbacks.delete(c)}return t.addEventListener(a,s),()=>t.removeEventListener(a,s)},dispatch(a,s){return on(t,a,s,rn(e.definition,a))}};return e.host=Object.freeze(i),e.host}function un(t,e){let n=Z(t);n===void 0&&y("HJ003","A controller can attach only to a lowered component root."),n.controllerModule=e}function fn(t=document,e={}){let n=Je(t);n.observer!==void 0&&y("HR003","This document is already being observed.");let r=new Map,o=e.onError??(d=>console.error(d)),i=!1,a=d=>{let h=r.get(d);r.delete(d);let u=Z(d);u!==void 0&&Zt(u);try{h?.()}catch(p){o(p)}},s=d=>{let h=Z(d);if(!(h===void 0||h.frameworkOwned||r.has(d)||!t.contains(d))){r.set(d,void 0);try{ln(h);let u=e.onConnect?.(d,h.definition);i?u?.():r.set(d,u)}catch(u){o(u)}}},c=d=>{if(i)return;let h=[];if(d===void 0)h.push(t);else{let u=[];for(let p of d){for(let m of p.removedNodes)m.nodeType===1&&Vr(m,w=>{r.has(w)&&u.push(w)});for(let m of p.addedNodes)m.nodeType===1&&h.push(m)}for(let p of u)t.contains(p)||a(p)}if(h.length>0)try{for(let u of qr(t,h,e.shouldLower).roots){if(i)break;s(u)}}catch(u){o(u)}};n.release=d=>{r.has(d)&&a(d)};let l=Ur(t,c),f=()=>{if(!i){i=!0,l(),delete n.observer,delete n.release;for(let d of r.values())try{d?.()}catch(h){o(h)}for(let d of r.keys()){let h=Z(d);h!==void 0&&Zt(h)}r.clear()}};return n.observer=f,c(),f}function Br(t){let e={};for(let n of t.querySelectorAll('script[type="importmap"]')){let r=JSON.parse(n.textContent??"{}");Object.assign(e,r.imports??{})}return{imports:e}}async function et(t,e={}){let n=e.document??document,r=e.fetch??fetch,o=new he(e.importMap??Br(n),n.baseURI),i=await ct(t,{resolver:o,fetchComponent:async s=>{let c=await r(s);if(!c.ok)throw new TypeError(`Component request \`${s}\` failed with ${c.status}.`);return{url:c.url||s,source:await c.text()}},parseComponentResource:(s,c)=>Tt(s,c,n),isCustomElementRegistered:s=>n.defaultView?.customElements.get(s)!==void 0}),a=e.registry??new me;return a.addGraph(i,s=>At(s,e.importer)),Object.freeze({graph:i,registry:a})}function tt(t=document){return Object.freeze(Array.from(t.querySelectorAll('link[rel="component"][href]'),e=>e.getAttribute("href")).filter(e=>e.trim()!==""))}function nt(t=document,e={}){return et(tt(t),{...e,document:t})}async function rt(t=document,e={}){let n=await nt(t,e);en(n.graph,t);let r=e.onError??(i=>console.error(i)),o=fn(t,{onError:r,onConnect(i,a){let s=n.registry.get(a.contract.tag)?.node;if(s?.controller===void 0)return;let c=Be(s,e.importer);un(i,c);let l=!1,f;return c.then(d=>l?void 0:d.default(Xe(i))).then(d=>{typeof d=="function"&&(l?d():f=d)}).catch(r),()=>{l=!0,f?.()}}});return Object.freeze({...n,stop:o})}var pn=Symbol.for("@nextwebwg/html-next/browser"),ot=globalThis,mn=ot[pn]??Object.freeze({ready:rt()});ot[pn]=mn;var _r=mn.ready;ot.HTMLNext??=Object.freeze({ready:_r,documentComponentRoots:tt,loadBrowserComponents:et,loadDocumentComponents:nt,startBrowserComponents:rt});export{tt as documentComponentRoots,et as loadBrowserComponents,nt as loadDocumentComponents,_r as ready,rt as startBrowserComponents};
8
+ `)},C=w("own"),k=w("slotted");return ar(e,s,r),{css:sr(o,C,k,c.join(`
9
+ `)),stateNames:[...s]}}function qt(t,e){let n=[];for(let r of t){let o=e(r);(o===!0||typeof o=="string"&&o.length>0||typeof o=="number"&&o!==0&&!Number.isNaN(o))&&n.push(r),(typeof o=="string"||typeof o=="number")&&n.push(`${r}=${encodeURIComponent(String(o))}`)}return n.join(" ")}var xe=new WeakSet,Kt=new WeakMap,Ut=new WeakMap,cr=Symbol.for("@nextwebwg/html-next.runtime.v1");function Qe(t){return t[cr]??={}}function Z(t){return Kt.get(t)}function Jt(t){let e=Qe(t),n=e.registry;return(n===void 0||n.root!==t.documentElement)&&(n={root:t.documentElement,definitions:new Map,discoverySelector:void 0},e.registry=n),n}var Qt=new WeakMap;function Yt(t,e,n){let r=Vt(t,e,n);return Qt.set(e,r.stateNames),r.css}function Xt(t,e,n){t.definitions.set(e,n),t.discoverySelector!==void 0&&(t.discoverySelector+=`,${e}`)}function dr(t){return t.discoverySelector??=["template[component]","[data-component]",...Array.from(t.definitions.keys())].join(",")}function lr(t,e){let n=t.getAttribute("component")??"",r=`${t.ownerDocument.URL}#template[component="${n}"][${e+1}]`;t.hasAttribute("src")&&y("HL001","External definitions require the application-owned graph resolver.",r);let o=Be(t,r),i=Array.from(t.content.children).find(a=>a.localName==="style");return{wrapper:t,style:i,definition:o}}function en(t,e=document){let n=Jt(e),r=0;for(let o of t.nodes.values()){if(o.shadowedByCustomElement)continue;let i=o.definition.contract.tag;n.definitions.has(i)&&y("HR001",`More than one definition declares <${i}>.`);let a=o.definition.css===""?void 0:e.createElement("style");a!==void 0&&(a.textContent=Yt(o.definition.css,o.definition,e),e.head.append(a)),Xt(n,i,{definition:o.definition,style:a}),r+=1}return r}function Ye(t,e,n=!1){let r=t.type==="boolean"&&n&&e===""?!0:e,o=_(r,t.type);if(!o.ok){let i=o.issues.map(a=>`${a.path}: ${a.message}`).join("; ");y("HR002",`A prop invocation value does not satisfy its declared type. ${i}`)}return o.value}function ur(t,e,n){return n!==void 0?Ye(e,n):(e.required&&y("HC020",`Required prop \`${t}\` was not provided.`),e.default===void 0?E:e.default)}function fr(t,e){let n=Ut.get(t);if(n===void 0){let r=Object.create(null),o=Object.create(null);for(let i of Object.keys(t.contract.props)){let a=Re(i);r[a]=i,o[`data-${a}`]=i,a!==i.toLowerCase()&&(o[`data-${i.toLowerCase()}`]=i)}n=[r,o],Ut.set(t,n)}return n[e?1:0]}function pr(t,e,n=!1){let r=e.contract,o=fr(e,n),i=Object.create(null),a=[],s;for(let p of Array.from(t.attributes)){if(p.name.toLowerCase()==="as"&&e.root?.kind==="native"){s=p.value.toLowerCase();continue}let m=o[p.name.toLowerCase()];if(m===void 0){n||a.push(p);continue}i[m]=Ye(r.props[m],p.value,!n)}let c=e.root?.kind==="native"?n?t.localName:s??e.root.element:e.template.name;e.root?.kind==="native"&&!e.root.choices.includes(c)&&y(n?"HR005":"HR002",`<${r.tag}> cannot use root <${c}>; expected one of ${e.root.choices.join(", ")}.`);let l=new Set(Object.keys(i).filter(p=>i[p]!==void 0)),f=new ve;for(let[p,m]of Object.entries(r.props))m.required&&i[p]===void 0&&y("HC020",`Required prop \`${p}\` was not provided.`),f.set(p,i[p]!==void 0?i[p]:m.default===void 0?E:m.default);let d=e.declarations??[];for(let p of d)(p.kind==="state"||p.kind==="computed"||p.kind==="data")&&f.set(p.name,null);for(let p of d)p.kind==="data"?f.set(p.name,{pending:!0,value:null,error:null,ok:!1}):p.kind==="state"&&f.set(p.name,p.expression===void 0?null:D(p.expression.source,f));let h=[];for(let p of d)p.kind!=="computed"||p.expression===void 0||h.push(f.defineComputed(p.name,()=>I(p.expression,f)));let u=(()=>{try{return new URL(e.source.file,t.ownerDocument.baseURI).href}catch{return t.ownerDocument.baseURI}})();for(let p of d){if(p.kind!=="data"||p.source===void 0)continue;let m=p,w=p.source,C=new ye({source:w,baseURL:u,...m.type===void 0?{}:{type:m.type},...m.debounce===void 0?{}:{debounce:Number(m.debounce)},...m.poll===void 0?{}:{poll:Number(m.poll)},onState:k=>f.set(m.name,k)});h.push(F(f.scheduler,()=>{let k=Object.fromEntries(m.parameters.map(g=>[g.name,I(g.expression,f)]));return C.update(k),()=>C.disconnect()},0))}return{scope:f,passThrough:a,effects:h,rootName:c,explicit:l}}function Je(t,e){return t.fork(Object.entries(e))}function D(t,e){try{return mt(t,e)}catch(n){throw n instanceof ee&&y("HB001",n.message),n}}var ie="http://www.w3.org/2000/svg",Bt=new Map;function mr(t,e){if(t.namespaceURI!==ie)return e;let n=Bt.get(e);if(n===void 0){let r=t.ownerDocument.createElement("template");r.innerHTML=`<svg ${e}>`,n=r.content.firstChild.attributes[0]?.name??e,Bt.set(e,n)}return n}function tn(t,e,n){return e==="svg"||n.namespace===ie?t.createElementNS(ie,e):t.createElement(e)}function hr(t,e){let n=t.namespaceURI===ie&&t.localName!=="foreignObject"?ie:void 0;return n===e.namespace?e:Object.create(e,{namespace:{value:n,enumerable:!0}})}function q(t,e,n,r=1){t.effects.push(F(e.scheduler,n,r))}function nn(t,e,n){let[r,...o]=e;if(typeof r!="string")return;if(o.length===0){t.set(r,n);return}let i=t.get(r);for(let c=0;c<o.length-1;c+=1){let l=o[c],f=typeof l=="object"?I(l.expression,t):l;if(typeof f!="string"&&typeof f!="number"||i==null)return;i=i[f]}let a=o.at(-1),s=typeof a=="object"?I(a.expression,t):a;(typeof s=="string"||typeof s=="number")&&i!=null&&(i[s]=n)}function yr(t){return t instanceof HTMLInputElement?t.type==="checkbox"||t.type==="radio"?t.checked:t.type==="number"||t.type==="range"?Number.isNaN(t.valueAsNumber)?null:t.valueAsNumber:t.value:t instanceof HTMLSelectElement?t.multiple?Array.from(t.selectedOptions,e=>e.value):t.value:t instanceof HTMLTextAreaElement?t.value:t.value??t.getAttribute("value")}function gr(t,e,n){let r=e.toLowerCase();if(r==="checked"&&t instanceof HTMLInputElement)return t.checked=L(n),!0;if(r==="value"&&t instanceof HTMLSelectElement&&t.multiple){let o=new Set(Array.isArray(n)?n.map(String):[]);for(let i of Array.from(t.options))i.selected=o.has(i.value);return!0}return r==="value"&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement)?(t.value=n==null?"":String(n),!0):!1}function br(t,e,n,r){for(let o of t.steps)if(!(o.guard!==void 0&&!L(I(o.guard,n))))if(o.kind==="set")nn(n,o.writablePath,I(o.value,n));else if(o.kind==="dispatch"){let i=rn(r.definition,o.event),a=o.value===void 0?void 0:I(o.value,n);i!==void 0&&a!==void 0&&(_(a,de(i.type)).ok||y("HR002",`Event \`${o.event}\` detail does not satisfy its declared type.`)),on(r.root??e,o.event,a,i)}else{let i=r.refs[o.target];o.kind==="focus"?i?.focus():i?.reportValidity?.()}}function rn(t,e){return(t.declarations??[]).find(n=>n.kind==="event"&&n.name===e)}function on(t,e,n,r){return t.dispatchEvent(new CustomEvent(e,{detail:n,bubbles:r?.bubbles??!0,composed:r?.composed??!0,cancelable:r?.cancelable??!1}))}function wr(t,e,n){if(n.includes("self")&&t.target!==e)return!1;if(t instanceof MouseEvent){let o=n.filter(a=>["left","middle","right"].includes(a)),i={left:0,middle:1,right:2};if(o.length>0&&!o.some(a=>t.button===i[a]))return!1}let r=["ctrl","shift","alt","meta"];for(let o of r)if(n.includes(o)&&!t[`${o}Key`])return!1;if(n.includes("exact")&&r.some(o=>!n.includes(o)&&t[`${o}Key`]))return!1;if(t instanceof KeyboardEvent){let o=n.filter(a=>["enter","escape","space","tab","up","down","left","right"].includes(a)),i={enter:"Enter",escape:"Escape",space:" ",tab:"Tab",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight"};if(o.length>0&&!o.some(a=>t.key===i[a]))return!1}return!0}function _t(t,e,n,r){for(let o of e.events??[]){let i=(r.definition.declarations??[]).find(s=>s.kind==="handler"&&s.name===o.handler),a=s=>{wr(s,t,o.modifiers)&&(o.modifiers.includes("prevent")&&s.preventDefault(),o.modifiers.includes("stop")&&s.stopPropagation(),br(i,t,n,r))};if(o.name==="connect"||o.name==="disconnect"){(o.name==="connect"?r.connectCallbacks:r.disconnectCallbacks).add(()=>a(new Event(o.name)));continue}q(r,n,()=>(t.addEventListener(o.name,a,{capture:o.modifiers.includes("capture"),passive:o.modifiers.includes("passive"),once:o.modifiers.includes("once")}),()=>t.removeEventListener(o.name,a,{capture:o.modifiers.includes("capture")})),2)}}function vr(t,e,n){e=mr(t,e),n===null||ne(e)&&te(n)?t.removeAttribute(e):t.setAttribute(e,n)}function kr(t,e,n,r){let o=D(e.expression,n);e.name==="value"?t.textContent=P(o):t.replaceChildren(Le(P(o),r,i=>xe.add(i)))}function Cr(t,e,n){let r=D(t.expression,e);return t.name==="value"?n.createTextNode(P(r)):Le(P(r),n,o=>xe.add(o))}function xr(t,e){return typeof t=="number"&&typeof e=="number"?t-e:P(t).localeCompare(P(e))}function Er(t,e,n){let r=t.slice();if(e.where!==void 0){let o=e.where;r=r.filter(i=>L(D(o,Je(n,{[e.item]:i}))))}if(e.sort!==void 0){let o=e.sort.split(",").map(a=>a.trim()).filter(a=>a!==""),i=(a,s)=>a!==null&&typeof a=="object"&&!Array.isArray(a)?D(`${e.item}.${s}`,Je(n,{[e.item]:a})):a;r.sort((a,s)=>{for(let c of o){let l=c.startsWith("-"),f=l?c.slice(1).trim():c,d=xr(i(a,f),i(s,f));if(d!==0)return l?-d:d}return 0})}if(e.limit!==void 0){let o=D(e.limit,n);typeof o=="number"&&(r=r.slice(0,Math.max(0,Math.trunc(o))))}return r}function sn(t,e){let n=e.createDocumentFragment();return n.append(...t),Array.from(n.childNodes)}function Rr(t,e){let n=t.nextSibling;for(;n!==null&&n!==e;){let r=n.nextSibling;n.remove(),n=r}}function Tr(t,e,n,r,o){if(t.flow?.kind==="each")return Ar(t,e,n,r,o);let i=n.createComment("html-next:start"),a=n.createComment("html-next:end"),s=n.createDocumentFragment();s.append(i,a);let c=[];return q(o,e,()=>{for(let d of c)d.stop();c=[],Rr(i,a);let l=o.effects.length,f=[];if(t.flow?.kind==="if"){if(L(D(t.flow.test,e))){let{flow:d,...h}=t;f=se(h,e,n,r,o)}}else if(t.flow?.kind==="with"){let d=e.fork([[t.flow.alias,D(t.flow.expr,e)]]),{flow:h,...u}=t;f=se(u,d,n,r,o)}else t.flow?.kind==="match"&&(f=Hr(t,e,n,o));c=o.effects.slice(l),a.before(...sn(f,n))}),[s]}function Sr(t,e){if(t.end.nextSibling===e)return;let n=[],r=t.start;for(;r!==null&&(n.push(r),r!==t.end);)r=r.nextSibling;let o=e.parentNode;if(o===null)return;let i=o.moveBefore;for(let a of n)i===void 0?o.insertBefore(a,e):i.call(o,a,e)}function Nr(t){for(let n of t.effects)n.stop();let e=t.start;for(;e!==null;){let n=e.nextSibling;if(e.parentNode?.removeChild(e),e===t.end)break;e=n}}function $r(t){let e=-1,n=!0;for(let s of t)s<0||(s<e&&(n=!1),e=s);if(n)return;let r=[],o=new Int32Array(t.length).fill(-1);for(let s=0;s<t.length;s+=1){let c=t[s];if(c<0)continue;let l=0,f=r.length;for(;l<f;){let d=l+f>>>1;t[r[d]]<c?l=d+1:f=d}l>0&&(o[s]=r[l-1]),r[l]=s}let i=new Uint8Array(t.length),a=r.at(-1)??-1;for(;a>=0;)i[a]=1,a=o[a];return i}function Ar(t,e,n,r,o){let i=t.flow,a=n.createComment("html-next:each-start"),s=n.createComment("html-next:each-end"),c=n.createDocumentFragment();c.append(a,s);let l=new Map;return q(o,e,()=>{let f=D(i.list,e),d=Array.isArray(f)?Er(f,i,e):[],h=new Map,u=i.key!==void 0,p=u?[]:void 0,m;if(u){m=new Map;let g=0;for(let b of l.keys())m.set(b,g++)}let w=u?[]:void 0,{flow:C,...k}=t;for(let g=0;g<d.length;g+=1){let b=d[g],v={[i.item]:b,loop:{index:g,first:g===0,last:g===d.length-1,count:d.length}};i.index!==void 0&&(v[i.index]=g);let R,T=g;i.key!==void 0&&(R=e.fork(Object.entries(v)),T=D(i.key,R)),h.has(T)&&y("HR004",`A keyed list produced duplicate key \`${P(T)}\`.`);let A=l.get(T);if(A===void 0){R??=e.fork(Object.entries(v));let M=o.effects.length,ae=sn(se(k,R,n,r,o),n),st=n.createComment("html-next:item-start"),at=n.createComment("html-next:item-end");s.before(st,...ae,at),A={start:st,end:at,scope:R,effects:o.effects.slice(M)}}else A.scope.set(i.item,b),i.index!==void 0&&A.scope.set(i.index,g),A.scope.set("loop",v.loop);h.set(T,A),p?.push(A),w?.push(m?.get(T)??-1)}for(let[g,b]of l)h.has(g)||Nr(b);if(p!==void 0&&w!==void 0){let g=$r(w),b=s;for(let v=p.length-1;v>=0;v-=1){let R=p[v];(w[v]<0||g!==void 0&&g[v]!==1)&&Sr(R,b),b=R.start}}l=h}),[c]}function an(t,e,n,r,o,i){return t.flow?.kind==="if"||t.flow?.kind==="each"||t.flow?.kind==="with"||t.flow?.kind==="match"?o.committed&&o.frameworkOwned&&i!==void 0?[i]:Tr(t,e,n,r,o):se(t,e,n,r,o,i)}function Hr(t,e,n,r){let o=t.flow,i=o.expr!==void 0?Je(e,{[o.alias]:D(o.expr,e)}):e,a;for(let d of t.children)if(d.kind==="element"){if(d.flow?.kind==="when"&&L(D(d.flow.test,i))){a=d;break}if(d.flow?.kind==="else"){a=d;break}}if(a===void 0)return[];let{flow:s,...c}=a,l=se(c,i,n,[],r);if(t.name==="template")return l;let f=tn(n,t.name,r);for(let d of t.attributes)d.kind==="literal"&&f.setAttribute(d.name,d.value);return f.append(...l),[f]}function se(t,e,n,r,o,i){let a=t.attributes.find(m=>m.kind==="directive");if(t.name==="template"){if(a!==void 0){let m=n.createTextNode("");return q(o,e,()=>{let w=D(a.expression,e);a.name==="value"&&(m.data=P(w))}),a.name==="value"?[m]:[Cr(a,e,n)]}return cn(t.children,e,n,o)}let s=t===o.definition.template?o.rootName:t.name;if(o.frameworkOwned&&i instanceof Element&&i.localName!==s&&(i.getAttribute("data-component")??"").split(/\s+/).includes(t.name))return[i];if(o.hydrationRanges!==void 0&&!o.frameworkOwned&&i instanceof Element&&i.localName!==s&&(i.getAttribute("data-component")??"").split(/\s+/).includes(t.name)){let m=Xe(i,!1),w=b=>b.kind==="element"?b.attributes.find(v=>v.kind==="literal"&&v.name==="slot")?.value??"":"",C=m?.ranges.filter(b=>!b.fallback)??[],k=(b,v)=>{let R=0;for(let T of b)R+=Ee(T,e,n,o,v[R]).length};for(let b of C)k(t.children.filter(v=>w(v)===b.slot),b.content);let g=new Set(C.map(b=>b.slot));return k(t.children.filter(b=>!g.has(w(b))),m?.carried??[]),[i]}let c=i instanceof Element&&i.localName===s,l=c?i:tn(n,s,o);t===o.definition.template&&(o.root=l);let f=c?Array.from(l.childNodes):[],d=c&&(l instanceof HTMLInputElement||l instanceof HTMLTextAreaElement||l instanceof HTMLSelectElement)?{value:l.value,focused:l.ownerDocument.activeElement===l,...l instanceof HTMLInputElement?{checked:l.checked}:{},...l instanceof HTMLInputElement||l instanceof HTMLTextAreaElement?{selectionStart:l.selectionStart,selectionEnd:l.selectionEnd}:{}}:void 0;t.ref!==void 0&&(o.refs[t.ref]=l);for(let m of t.attributes)m.kind==="literal"&&l.setAttribute(m.name,m.value);for(let m of r){let w=m.name==="class"||m.name==="style"?l.getAttribute(m.name):null;l.setAttribute(m.name,w===null||w===""?m.value:`${w}${m.name==="class"?" ":"; "}${m.value}`)}for(let m of t.attributes)if(m.kind==="attribute"){if(q(o,e,()=>{let w=D(m.expression,e);m.target==="class"?l.classList.toggle(m.name,L(w)):m.target==="style"?l.style.setProperty(m.name,P(w)):m.twoWay===!0&&gr(l,m.name,w)||vr(l,m.name,ht(w,m.name))}),m.twoWay===!0&&m.writablePath!==void 0){let w=l instanceof HTMLSelectElement||l instanceof HTMLInputElement&&["checkbox","radio","file"].includes(l.type)?"change":"input",C=()=>{l instanceof HTMLInputElement&&l.type==="radio"&&!l.checked||nn(e,m.writablePath,yr(l))};q(o,e,()=>(l.addEventListener(w,C),()=>l.removeEventListener(w,C)),2)}}else m.kind==="property"&&q(o,e,()=>{l[m.name]=D(m.expression,e)});if(a!==void 0)return q(o,e,()=>kr(l,a,e,n)),_t(l,t,e,o),[l];let h=[],u=0,p=hr(l,o);for(let m of t.children){let w=u;if(o.frameworkOwned&&m.kind==="element"){let k=f.findIndex((g,b)=>b<u?!1:g instanceof Element&&(g.localName===m.name||(g.getAttribute("data-component")??"").split(/\s+/).includes(m.name)));k<0&&m.flow!==void 0&&(k=f.findIndex((g,b)=>b>=u&&g instanceof Comment)),k>=0&&(w=k)}let C=Ee(m,e,n,p,f[w]);h.push(...C),u=w+C.length}if(c&&!o.frameworkOwned){h=h.flatMap(m=>m.nodeType===11?Array.from(m.childNodes):[m]);for(let m=0;m<h.length;m+=1){let w=h[m];l.childNodes[m]!==w&&l.insertBefore(w,l.childNodes[m]??null)}for(;l.childNodes.length>h.length;)l.lastChild.remove()}else c||l.append(...h);return d!==void 0&&(l.value=d.value,l instanceof HTMLInputElement&&"checked"in d&&(l.checked=d.checked),(l instanceof HTMLInputElement||l instanceof HTMLTextAreaElement)&&"selectionStart"in d&&typeof d.selectionStart=="number"&&typeof d.selectionEnd=="number"&&(d.focused&&l.focus({preventScroll:!0}),l.setSelectionRange(d.selectionStart,d.selectionEnd))),_t(l,t,e,o),[l]}function cn(t,e,n,r){let o=[];for(let i of t)o.push(...Ee(i,e,n,r));return o}function Dr(t,e){return e.projectedSlotNames.get(t)??(t instanceof Element?t.getAttribute("slot")??"":"")}function Mr(t,e,n,r){let o=t.nameExpression===void 0?t.name??"":P(I(t.nameExpression,e)),i=r.projectedNodes.filter(d=>Dr(d,r)===o),a=r.hydrationRanges?.shift();if(a!==void 0){if(a.fallback){let d=[],h=0;for(let u of t.fallback??[]){let p=Ee(u,e,n,r,a.content[h]);d.push(...p),h+=p.length}return[a.markers[0],...d,...a.markers.slice(1)]}for(let d of a.content)Ce(d);return a.markers.length===1?[a.markers[0]]:[a.markers[0],...a.content,a.markers[1]]}let s=d=>`"${d.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}"`,c=(d,h)=>Pr(n,d,h),l=(d,h)=>{if(d.length===0)return[c("marker",`slot=${s(o)}`)];let u=`slot=${s(o)}${h?' fallback=""':""}`;return[c("start",u),...d,c("end","")]};if(i.length===0)return l(cn(t.fallback??[],e,n,r),!0);if(r.committed){for(let d of i)Ce(d);return l([...i],!1)}let f=n.createComment(`html-next:slot:${o}`);return r.slotInsertions.push({anchor:f,nodes:i}),l([f],!1)}function Wt(t){let e=new Map,n=t.trim(),r={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};for(;n!=="";){let o=/^([A-Za-z_:][-A-Za-z0-9._:]*)\s*=\s*(?:"([^"<]*)"|'([^'<]*)')(?:\s+|$)/.exec(n);if(o===null||e.has(o[1]))return new Map;let i=(o[2]??o[3]).replace(/&(#x[0-9a-fA-F]+|#\d+|amp|lt|gt|quot|apos);/g,(a,s)=>s.startsWith("#x")?String.fromCodePoint(parseInt(s.slice(2),16)):s.startsWith("#")?String.fromCodePoint(Number(s.slice(1))):r[s]);e.set(o[1],i),n=n.slice(o[0].length)}return e}var Ft=new WeakMap;function dn(t){let e=Ft.get(t);if(e===void 0){let n=t.createElement("div");n.innerHTML='<?probe x="1"?>',e=n.firstChild?.nodeType===7,Ft.set(t,e)}return e}function Pr(t,e,n){return dn(t)?t.createProcessingInstruction(e,n):t.createComment(`?${e}${n===""?"":` ${n}`}?`)}function Ke(t){if(t.nodeType===7){let n=t;return{target:n.target,attributes:Wt(n.data)}}if(t.nodeType!==8||dn(t.ownerDocument))return;let e=/^\?([A-Za-z][-A-Za-z0-9]*)(?:\s+([\s\S]*?))?\s*\??$/.exec(t.data);return e===null?void 0:{target:e[1],attributes:Wt(e[2]??"")}}function Xe(t,e=!0){let n=[],r=new Set,o=(s,c)=>{for(let l=0;l<s.length;l+=1){let f=s[l],d=Ke(f);if(d?.target==="marker"&&d.attributes.has("slot")){c.push({slot:d.attributes.get("slot"),fallback:!1,markers:[f],content:[]});continue}if(d?.target==="start"){let h=1,u=[],p;for(l+=1;l<s.length;l+=1){let m=Ke(s[l]);if(m?.target==="start")h+=1;else if(m?.target==="end"&&--h===0){p=s[l];break}u.push(s[l])}if(d.attributes.has("slot")){c.push({slot:d.attributes.get("slot"),fallback:d.attributes.has("fallback"),markers:p?[f,p]:[f],content:u});for(let m of u)r.add(m)}else o(u,c);continue}if(f instanceof Element)if(f!==t&&f.hasAttribute("data-component")){let h=Xe(f,!1);for(let u of h?.ranges??[])o(u.content,c)}else o(Array.from(f.childNodes),c)}};o(Array.from(t.childNodes),n);let i=Array.from(t.children).find(s=>s instanceof HTMLTemplateElement&&!r.has(s)&&s.previousSibling!==null&&Ke(s.previousSibling)?.target==="carrier");if(n.length===0&&i===void 0)return;let a=[];if(i!==void 0&&e){for(let s of Array.from(i.content.childNodes))a.push(t.ownerDocument.adoptNode(s));i.previousSibling.remove(),i.remove()}else i!==void 0&&a.push(...Array.from(i.content.childNodes));return{ranges:n,carried:a}}function Ee(t,e,n,r,o){if(t.kind==="text"){let i=o instanceof Text?o:n.createTextNode("");return i.data=t.value,[i]}return t.kind==="slot"?Mr(t,e,n,r):an(t,e,n,[],r,o)}function jr(t,e){let n=Qt.get(e.definition)??[];if(n.length===0)return;let r=Ze(e.definition.contract.tag);e.effects.push(F(e.scope.scheduler,()=>{let o=qt(n,i=>e.scope.get(i));o===""?t.removeAttribute(r):t.getAttribute(r)!==o&&t.setAttribute(r,o)},2))}function Lr(t,e){let n=e.definition.contract.props,r={},o={};for(let[f,d]of Object.entries(n)){let h=`data-${Re(f)}`;r[h]=f;let u=e.definition.template.attributes.some(p=>p.kind==="attribute"&&p.name===h);e.effects.push(F(e.scope.scheduler,()=>{let p=e.scope.get(f);if(!u&&!e.explicit.has(f))return;let m=p===void 0||p===E||p===null?null:Ae(p,d.type);o[h]=m,m===null?t.removeAttribute(h):t.setAttribute(h,m)},2))}let i=t.ownerDocument.defaultView?.MutationObserver,a=Object.keys(r);if(i===void 0||a.length===0)return;let s=new i(f=>{for(let d of f){let h=d.attributeName;if(h===null)continue;let u=r[h];if(u===void 0)continue;let p=t.getAttribute(h);if(h in o&&o[h]===p){delete o[h];continue}delete o[h];let m=n[u];p===null?e.explicit.delete(u):e.explicit.add(u),e.scope.set(u,p===null?ur(u,m,void 0):Ye(m,p,!0))}}),c=()=>s.observe(t,{attributes:!0,attributeFilter:a}),l=()=>s.disconnect();e.connectCallbacks.add(c),e.disconnectCallbacks.add(l)}function Or(t,e){for(let n of e.definition.declarations??[])n.kind==="method"&&Object.defineProperty(t,n.name,{configurable:!0,enumerable:!1,value:(...r)=>e.controllerModule===void 0?Promise.reject(new TypeError(`Controller method \`${n.name}\` is not ready for <${e.definition.contract.tag}>.`)):e.controllerModule.then(o=>{let i=o[n.exportName];return typeof i!="function"&&y("HJ003",`Controller does not export method \`${n.exportName}\`.`),Reflect.apply(i,void 0,[et(t),...r])})})}function Ir(t,e,n,r,o=new WeakMap,i=!1){let a=n&&t.contains(t.ownerDocument.activeElement)?t.ownerDocument.activeElement:null,s=a instanceof HTMLInputElement||a instanceof HTMLTextAreaElement?[a.selectionStart,a.selectionEnd]:void 0,{scope:c,passThrough:l,effects:f,rootName:d,explicit:h}=pr(t,e,n),u=r,p;if(n&&u===void 0){let b=Xe(t);if(b!==void 0){p=b.ranges;let v=[];for(let R of b.ranges)if(!R.fallback)for(let T of R.content)o.set(T,R.slot),v.push(T);v.push(...b.carried),u=v}else(e.slots??[]).length>0?y("HR005",`<${e.contract.tag}> has slots but its server-rendered root has no slot marks.`):u=[]}let m=n?u:Array.from(t.childNodes),w={definition:e,scope:c,refs:{},effects:f,connectCallbacks:new Set,disconnectCallbacks:new Set,connected:!1,explicit:h,frameworkOwned:i,projection:{nodes:n?u:Array.from(t.childNodes),slotNames:o}},C={definition:e,effects:f,refs:w.refs,connectCallbacks:w.connectCallbacks,disconnectCallbacks:w.disconnectCallbacks,projectedNodes:m,projectedSlotNames:o,slotInsertions:[],rootName:d,frameworkOwned:i,committed:n,hydrationRanges:p},k=an(e.template,c,t.ownerDocument,l,C,n?t:void 0);C.hydrationRanges=void 0;let g=k[0];return n&&g!==t&&y("HR005",`Server markup for <${e.contract.tag}> has an incompatible root.`),a instanceof HTMLElement&&(a.focus({preventScroll:!0}),s!==void 0&&(a instanceof HTMLInputElement||a instanceof HTMLTextAreaElement)&&typeof s[0]=="number"&&typeof s[1]=="number"&&a.setSelectionRange(s[0],s[1])),It(g,G,e.contract.tag),w.element=g,{invocation:t,nativeRoot:g,context:C,definition:e,instance:w,replace:!n}}function zr(t,e){e.sort((n,r)=>n.invocation.contains(r.invocation)?-1:r.invocation.contains(n.invocation)?1:0);for(let n of e){for(let r of n.context.slotInsertions){for(let o of r.nodes)Ce(o);r.anchor.replaceWith(...r.nodes)}n.replace&&n.invocation.replaceWith(n.nativeRoot),n.context.committed=!0,Kt.set(n.nativeRoot,n.instance),Lr(n.nativeRoot,n.instance),jr(n.nativeRoot,n.instance),Or(n.nativeRoot,n.instance),ln(n.instance)}}function Gt(t,e,n){t.nodeType===1&&t.matches(e)&&n.add(t);for(let r of t.querySelectorAll(e))n.add(r)}function Vr(t,e){let n=t.nodeType===1?t:void 0;if(n?.matches("[data-component]")===!0&&e(n),n?.childElementCount!==0)for(let r of t.querySelectorAll("[data-component]"))e(r)}function qr(t,e,n){let r=Jt(t),o=new Set,i=dr(r);for(let u of e)Gt(u,i,o);let a=[];for(let u of o)u.localName==="template"&&u.hasAttribute("component")&&!xe.has(u)&&a.push(lr(u,a.length));let s=new Map;for(let u of a){let p=u.definition.contract.tag;(r.definitions.has(p)||s.has(p))&&y("HR001",`More than one definition declares <${p}>.`),s.set(p,u)}let c=[],l=new Set,f=(u,p,m)=>{let{definition:w}=u;return xe.has(p)||t.defaultView?.customElements.get(w.contract.tag)!==void 0||n?.(p,w,m)===!1?!1:(c.push(Ir(p,w,m)),!0)},d=(u,p)=>{for(let m of p){let w=u.get(m.localName);if(w!==void 0&&f(w,m,!1),!m.hasAttribute("data-component"))continue;let C=Z(m);if(C!==void 0){C.frameworkOwned||l.add(m);continue}let k=!1;for(let g of new Set((m.getAttribute("data-component")??"").split(/\s+/))){let b=u.get(g);b!==void 0&&f(b,m,!0)&&(k=!0)}k&&l.add(m)}};if(d(r.definitions,o),s.size>0){let u=["[data-component]",...Array.from(s.keys())].join(","),p=new Set;Gt(t,u,p),d(s,p)}for(let u of a)Xt(r,u.definition.contract.tag,u),u.style!==void 0&&(u.style.textContent=Yt(u.style.textContent??"",u.definition,u.wrapper.ownerDocument),u.wrapper.ownerDocument.head.append(u.style)),u.wrapper.remove();zr(r,c);let h=c.map(u=>u.nativeRoot);for(let u of h)l.add(u);return{lowered:h,roots:Array.from(l)}}function Ur(t,e){let n=Qe(t),r=n.mutationHub;if(r===void 0){let i=t.defaultView?.MutationObserver;i===void 0&&y("HR003","Automatic component management requires a browser MutationObserver.");let a=new Set,s=new i(c=>{for(let l of Array.from(a))l(c)});r={observer:s,subscribers:a},n.mutationHub=r,s.observe(t,{childList:!0,subtree:!0})}r.subscribers.add(e);let o=!0;return()=>{o&&(o=!1,r.subscribers.delete(e),r.subscribers.size===0&&(r.observer.disconnect(),delete n.mutationHub))}}function ln(t){if(!t.connected){t.connected=!0;for(let e of t.effects)e.resume();for(let e of t.connectCallbacks)e();t.element?.dispatchEvent(new Event("connect"))}}function Zt(t){if(t.connected){t.element?.dispatchEvent(new Event("disconnect"));for(let e of t.disconnectCallbacks)e();t.connected=!1;for(let e of t.effects)e.pause()}}function et(t){let e=Z(t);if(e===void 0)return;if(e.host!==void 0)return e.host;let n=new Set((e.definition.declarations??[]).filter(a=>a.kind==="state").map(a=>a.name)),r=new Proxy({},{get:(a,s)=>{if(typeof s!="string")return;let c=e.scope.get(s);return c===E?void 0:c},set:(a,s,c)=>{if(typeof s!="string"||!n.has(s))throw new TypeError(`Only declared state roots are writable; \`${String(s)}\` is read-only.`);return e.scope.set(s,c),!0},has:(a,s)=>typeof s=="string"&&e.scope.has(s)}),o=new Proxy({},{get:(a,s)=>typeof s!="string"?void 0:(t instanceof HTMLFormElement?t:t.querySelector("form"))?.elements.namedItem(s)??t.querySelector(`[name="${CSS.escape(s)}"]`)??void 0}),i={element:t,state:r,refs:e.refs,elements:o,signal(a){return Pt(a)},computed(a){let s=jt(e.scope.scheduler,a);return e.connected||s.pause(),e.effects.unshift(s),s},effect(a){let s=F(e.scope.scheduler,a,2,e.connected);return e.effects.push(s),()=>s.stop()},on(a,s){if(a==="connect"){let c=s;return e.connectCallbacks.add(c),e.connected&&s(),()=>e.connectCallbacks.delete(c)}if(a==="disconnect"){let c=s;return e.disconnectCallbacks.add(c),()=>e.disconnectCallbacks.delete(c)}return t.addEventListener(a,s),()=>t.removeEventListener(a,s)},dispatch(a,s){return on(t,a,s,rn(e.definition,a))}};return e.host=Object.freeze(i),e.host}function un(t,e){let n=Z(t);n===void 0&&y("HJ003","A controller can attach only to a lowered component root."),n.controllerModule=e}function fn(t=document,e={}){let n=Qe(t);n.observer!==void 0&&y("HR003","This document is already being observed.");let r=new Map,o=e.onError??(d=>console.error(d)),i=!1,a=d=>{let h=r.get(d);r.delete(d);let u=Z(d);u!==void 0&&Zt(u);try{h?.()}catch(p){o(p)}},s=d=>{let h=Z(d);if(!(h===void 0||h.frameworkOwned||r.has(d)||!t.contains(d))){r.set(d,void 0);try{ln(h);let u=e.onConnect?.(d,h.definition);i?u?.():r.set(d,u)}catch(u){o(u)}}},c=d=>{if(i)return;let h=[];if(d===void 0)h.push(t);else{let u=[];for(let p of d){for(let m of p.removedNodes)m.nodeType===1&&Vr(m,w=>{r.has(w)&&u.push(w)});for(let m of p.addedNodes)m.nodeType===1&&h.push(m)}for(let p of u)t.contains(p)||a(p)}if(h.length>0)try{for(let u of qr(t,h,e.shouldLower).roots){if(i)break;s(u)}}catch(u){o(u)}};n.release=d=>{r.has(d)&&a(d)};let l=Ur(t,c),f=()=>{if(!i){i=!0,l(),delete n.observer,delete n.release;for(let d of r.values())try{d?.()}catch(h){o(h)}for(let d of r.keys()){let h=Z(d);h!==void 0&&Zt(h)}r.clear()}};return n.observer=f,c(),f}function Br(t){let e={};for(let n of t.querySelectorAll('script[type="importmap"]')){let r=JSON.parse(n.textContent??"{}");Object.assign(e,r.imports??{})}return{imports:e}}async function tt(t,e={}){let n=e.document??document,r=e.fetch??fetch,o=new he(e.importMap??Br(n),n.baseURI),i=await dt(t,{resolver:o,fetchComponent:async s=>{let c=await r(s);if(!c.ok)throw new TypeError(`Component request \`${s}\` failed with ${c.status}.`);return{url:c.url||s,source:await c.text()}},parseComponentResource:(s,c)=>Tt(s,c,n),isCustomElementRegistered:s=>n.defaultView?.customElements.get(s)!==void 0}),a=e.registry??new me;return a.addGraph(i,s=>At(s,e.importer)),Object.freeze({graph:i,registry:a})}function nt(t=document){return Object.freeze(Array.from(t.querySelectorAll('link[rel="component"][href]'),e=>e.getAttribute("href")).filter(e=>e.trim()!==""))}function rt(t=document,e={}){return tt(nt(t),{...e,document:t})}async function ot(t=document,e={}){let n=await rt(t,e);en(n.graph,t);let r=e.onError??(i=>console.error(i)),o=fn(t,{onError:r,onConnect(i,a){let s=n.registry.get(a.contract.tag)?.node;if(s?.controller===void 0)return;let c=_e(s,e.importer);un(i,c);let l=!1,f;return c.then(d=>l?void 0:d.default(et(i))).then(d=>{typeof d=="function"&&(l?d():f=d)}).catch(r),()=>{l=!0,f?.()}}});return Object.freeze({...n,stop:o})}var pn=Symbol.for("@nextwebwg/html-next/browser"),it=globalThis,mn=it[pn]??Object.freeze({ready:ot()});it[pn]=mn;var _r=mn.ready;it.HTMLNext??=Object.freeze({ready:_r,documentComponentRoots:nt,loadBrowserComponents:tt,loadDocumentComponents:rt,startBrowserComponents:ot});export{nt as documentComponentRoots,tt as loadBrowserComponents,rt as loadDocumentComponents,_r as ready,ot as startBrowserComponents};
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAgBA,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,KAAK,CAAC;AAEhE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;CAC3C;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,UAAU,EAAE,SAAS;QAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;QACtC,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;QACzC,QAAQ,CAAC,UAAU,EAAE,IAAI,GAAG,MAAM,CAAC;KACpC,EAAE,CAAC;CACL;AAoBD,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,KAAK,EAAE,SAAS,MA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EAAE,SAAS,MAAM,EAAE,CAAC;QACtC,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;QACzC,QAAQ,CAAC,UAAU,EAAE,IAAI,GAAG,MAAM,CAAC;KACpC,EAAE,CAAC;CACL;AAoBD,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,UAAU,EAAE,SAAS;QAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;QACzC,QAAQ,CAAC,UAAU,EAAE,IAAI,GAAG,MAAM,CAAC;QACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;KACjC,EAAE,CAAC;IACJ,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAgBpG;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAElG;AAED,wBAAsB,eAAe,CACnC,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,aAAa,CAAC,CAmExB"}
package/dist/cli.js CHANGED
@@ -3,7 +3,7 @@ import { mkdir, readFile, writeFile } from "node:fs/promises";
3
3
  import { dirname, relative, resolve, sep } from "node:path";
4
4
  import { fileURLToPath, pathToFileURL } from "node:url";
5
5
  import ts from "typescript-compiler";
6
- import { generateComponent, GENERATOR_VERSION, } from "./generate.js";
6
+ import { generateComponent, importsVueHost, vueHostArtifact, GENERATOR_VERSION, } from "./generate.js";
7
7
  import { addControllerGraph } from "./controller-files.js";
8
8
  import { loadNodeComponents } from "./node-loader.js";
9
9
  async function componentGraph(entries) {
@@ -79,6 +79,10 @@ export async function buildComponents(entries, outDirectory, options = {}) {
79
79
  controller: node.controller === undefined ? null : displayPath(node.controller.url),
80
80
  });
81
81
  }
82
+ if ([...artifacts.values()].some((artifact) => importsVueHost(artifact.content))) {
83
+ const host = vueHostArtifact();
84
+ artifacts.set(host.path, host);
85
+ }
82
86
  await mkdir(outputRoot, { recursive: true });
83
87
  for (const artifact of artifacts.values()) {
84
88
  const path = resolve(outputRoot, artifact.path);
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAExD,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAErC,OAAO,EACL,iBAAiB,EACjB,iBAAiB,GAElB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAA2B,MAAM,kBAAkB,CAAC;AAoB/E,KAAK,UAAU,cAAc,CAAC,OAA0B;IACtD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IACxF,MAAM,OAAO,GAAG,aAAa,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC;IAC7D,OAAO,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,OAAO,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ACxG,CAAC;AAED,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IACvD,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACpC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACtE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
@@ -1,10 +1,13 @@
1
1
  import type { ComponentDefinition } from "./template.js";
2
- export declare const GENERATOR_VERSION = "1.0.0-alpha.1";
2
+ export declare const GENERATOR_VERSION = "1.0.0-alpha.3";
3
3
  export interface GeneratedArtifact {
4
4
  readonly path: string;
5
5
  readonly content: string;
6
6
  }
7
7
  export declare function generateComponent(definition: ComponentDefinition): readonly GeneratedArtifact[];
8
+ /** The one module the converted Vue components share; every package that emits Vue ships it once. */
9
+ export declare function vueHostArtifact(): GeneratedArtifact;
10
+ export { importsVueHost } from "./targets/vue-host.js";
8
11
  export type { ComponentDefinition } from "./template.js";
9
12
  /** Converts one definition to a Vue single-file component, failing with a diagnostic if it cannot. */
10
13
  export declare function generateVueComponent(definition: ComponentDefinition): string;
@@ -1 +1 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGzD,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;AAEjD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,mBAAmB,GAC9B,SAAS,iBAAiB,EAAE,CAgB9B;AAED,YAAY,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAezD,sGAAsG;AACtG,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,mBAAmB,GAAG,MAAM,CAE5E"}
1
+ {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGzD,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;AAEjD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,mBAAmB,GAC9B,SAAS,iBAAiB,EAAE,CAgB9B;AAED,qGAAqG;AACrG,wBAAgB,eAAe,IAAI,iBAAiB,CAEnD;AAED,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,YAAY,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAezD,sGAAsG;AACtG,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,mBAAmB,GAAG,MAAM,CAE5E"}
package/dist/generate.js CHANGED
@@ -1,9 +1,10 @@
1
1
  import { generateDocs } from "./targets/docs.js";
2
2
  import { generateVanilla } from "./targets/vanilla.js";
3
3
  import { generateVue } from "./targets/vue.js";
4
+ import { VUE_HOST_PATH, vueHostModule } from "./targets/vue-host.js";
4
5
  import { HtmlDiagnosticError } from "./diagnostics.js";
5
6
  import { compileComponentStylesForBuild } from "./component-styles-build.js";
6
- export const GENERATOR_VERSION = "1.0.0-alpha.1";
7
+ export const GENERATOR_VERSION = "1.0.0-alpha.3";
7
8
  export function generateComponent(definition) {
8
9
  const vanilla = generateVanilla(definition, GENERATOR_VERSION);
9
10
  const vue = convertedToVue(definition);
@@ -20,6 +21,11 @@ export function generateComponent(definition) {
20
21
  Object.freeze({ path: `docs/${tag}.md`, content: docs }),
21
22
  ]);
22
23
  }
24
+ /** The one module the converted Vue components share; every package that emits Vue ships it once. */
25
+ export function vueHostArtifact() {
26
+ return Object.freeze({ path: VUE_HOST_PATH, content: vueHostModule(GENERATOR_VERSION) });
27
+ }
28
+ export { importsVueHost } from "./targets/vue-host.js";
23
29
  /**
24
30
  * The Vue conversion, or nothing when the definition uses a construct Vue conversion does not map
25
31
  * yet. HTML Next's own outputs do not depend on it; `generateVueComponent` reports the reason.
@@ -1 +1 @@
1
- {"version":3,"file":"generate.js","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAE7E,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC;AAOjD,MAAM,UAAU,iBAAiB,CAC/B,UAA+B;IAE/B,MAAM,OAAO,GAAG,eAAe,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;IAC/D,MAAM,GAAG,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;IACvC,MAAM,IAAI,GAAG,YAAY,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;IACzD,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,UAAU,CAAC,QAAQ,CAAC;IAE1C,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,WAAW,IAAI,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;Q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,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAmHD,oGAAoG;AACpG,wBAAsB,wBAAwB,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAkHxG;AAED,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"package.d.ts","sourceRoot":"","sources":["../src/package.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAKlE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAmHD,oGAAoG;AACpG,wBAAsB,wBAAwB,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAuHxG;AAED,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC"}