sveld 0.40.6 → 0.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{v,O,M,x,N,Te,q,Ce,be,z,T,l,o,n,C,t,A,c,m,w,je,Pe,k,p,F,_,i,b,P,E,ie,se,a,X,B,j,h,u,Ge,oe,V,Y,Q,d,ae,Z,pe,Ae,ee,le,We,we,g,S,s,ce,He,Ue,Je,ue,e,Ke,qe,de,ze,Xe,Ye,Qe,Ze,et,tt,ke,nt,rt,De,it,st,ot,at,Ne,_e,pt,$e,lt,ct,D,ut,dt,ft,mt,ht,gt,yt,xt,Et,Re,St,vt,Tt,Ct,bt,Pt,fe,At,wt,kt,Ie,Dt,Nt,_t,$t,f,Rt,It,Lt,me,he,G,Ot,Mt,Ft,ge,ye,R,xe,I}from"./chunk-9fmhgf46.js";function ci(){return{syntaxMode:"legacy",scriptLanguage:void 0,source:void 0,parsed:void 0,runesOptionOverride:void 0,sourceLocator:void 0,parsedJsDocByText:new Map,jsDocBlocksByStart:new Map,functionDocCommentStarts:new Set,rest_props:void 0,extends:void 0,customElementTag:void 0,customElement:void 0,componentComment:void 0,componentCommentSource:void 0,generics:null,scriptGenericsAttribute:void 0,diagnosticRecords:[],componentFilePath:"",props:new Map,moduleExports:new Map,propLocalToPublicName:new Map,reactive_vars:new Set,funcDecls:new Map,vars:new Set,valueImportBindingsByLocalName:new Map,pendingCallDefaultCandidates:[],pendingConstDefaultCandidates:[],pendingContextKeyCandidates:[],pendingDispatchEscapeCandidates:[],deferredEventNoSourceDiagnostics:[],runesPropsDeclarationMetadataByDeclaratorStart:new Map,typedRunesPropsDeclarations:[],explicitVariableTypesByName:new Map,explicitVariableTypeNodesByName:new Map,typeImportBindingsByLocalName:new Map,localTypeDeclarationsByName:new Map,additionalTypeDependencyNodes:[],additionalImportedTypes:new Map,wholePropsLocals:new Set,restPropLocals:new Set,componentScope:new Map,activeScopes:[],slots:new Map,snippetPropLocals:new Set,jsDocSlots:new Map,renderedSlots:new Set,slotsUntracked:!1,cssParts:[],cssProperties:[],deferredSlotBlockGenerics:[],events:new Map,eventDescriptions:new Map,forwardedEvents:new Map,jsDocEventNames:new Set,typedDispatcherEventNames:new Set,explicitDefaultPropNames:new Set,untypedJsDocEventNames:new Set,jsDocEventSources:new Map,bindings:new Map,typeCasts:{constAssertions:new WeakSet,typeAssertions:new WeakMap},contexts:new Map,typedefs:new Map,typedefMembersByName:new Map,variableInfoCache:void 0,sveldIgnoreDirectives:new Map,propIgnoreCodes:new Map}}function di(r,y){return r.propLocalToPublicName.get(y)??y}function br(r,y,L=y){r.propLocalToPublicName.set(L,y)}function ui(r,y){return r.props.get(di(r,y))}function jt(r,y){return ui(r,y)?.type}function en(r,y,L,W,H){r.diagnosticRecords.push(fi(r,y,L,W,H))}function fi(r,y,L,W,H){return a({component:r.componentFilePath,kind:y,name:L,message:W,...H?{source:H}:{},...mi(r,y,L)?{ignored:!0}:{}})}function ko(r,y){return`${r}:${y}`}function kn(r,y,L,W){if(!W||W.length===0)return;let H=ko(y,L),J=r.sveldIgnoreDirectives.get(H)??new Set;for(let U of W)J.add(U);r.sveldIgnoreDirectives.set(H,J)}function Jt(r,y,L){if(kn(r,"prop-unknown-type",y,L),kn(r,"bind-this-type-mismatch",y,L),L&&L.length>0)r.propIgnoreCodes.set(y,L)}function mi(r,y,L){let W=r.sveldIgnoreDirectives.get(ko(y,L));if(!W)return!1;return W.has("")||W.has(X[y])}var gi="/**",wo="*",vr="*/",Ql="```",yi=/^\s+/,Lo=/\s/,Zl=/^@[^\s/]+(?=\s|$)/,ep=/^@(\S+)\s*/,np=new Set(["extends","extendProps","generics","template","typedef"]);function Ut(r){let y=0;while(y<r.length){let L=r.charCodeAt(y);if(L!==32&&L!==9&&L!==13&&L!==10&&!Lo.test(r[y]))break;y++}return y}function tp(r,y){let L=r.slice(Ut(r)),W=!1;if(y)L=L.slice(gi.length),W=!0;else if(L.startsWith(wo)&&!L.startsWith(vr))L=L.slice(wo.length),W=!0;let H=L.slice(0,Ut(L));L=L.slice(H.length);let J=L.trimEnd(),U=J.endsWith(vr)?J.slice(0,-vr.length).trimEnd():L;return{indent:W?H.slice(1):H,content:U}}function rp(r,y,L){let W=L>y&&r.charCodeAt(L-1)===13?L-1:L;return r.slice(y,W)}function ip(r){let y=[],L=0;while(!0){let W=r.indexOf(gi,L);if(W===-1)break;let H=r.lastIndexOf(`
1
+ import{v,O,M,x,N,Te,q,Ce,be,z,T,l,o,n,C,t,A,c,m,k,je,Pe,w,p,F,_,i,b,P,E,ie,se,a,X,B,j,h,u,Ge,oe,V,Y,Q,d,ae,Z,pe,Ae,ee,le,We,ke,g,S,s,ce,He,Ue,Je,ue,e,Ke,qe,de,ze,Xe,Ye,Qe,Ze,et,tt,we,nt,rt,De,it,st,ot,at,Ne,_e,pt,$e,lt,ct,D,ut,dt,ft,mt,ht,gt,yt,xt,Et,Re,St,vt,Tt,Ct,bt,Pt,fe,At,kt,wt,Ie,Dt,Nt,_t,$t,f,Rt,It,Lt,me,he,G,Ot,Mt,Ft,ge,ye,R,xe,I}from"./chunk-h308tz7m.js";function ci(){return{syntaxMode:"legacy",scriptLanguage:void 0,source:void 0,parsed:void 0,runesOptionOverride:void 0,sourceLocator:void 0,parsedJsDocByText:new Map,jsDocBlocksByStart:new Map,functionDocCommentStarts:new Set,rest_props:void 0,extends:void 0,customElementTag:void 0,customElement:void 0,componentComment:void 0,componentCommentSource:void 0,generics:null,scriptGenericsAttribute:void 0,diagnosticRecords:[],componentFilePath:"",props:new Map,moduleExports:new Map,propLocalToPublicName:new Map,reactive_vars:new Set,funcDecls:new Map,vars:new Set,valueImportBindingsByLocalName:new Map,pendingCallDefaultCandidates:[],pendingConstDefaultCandidates:[],pendingContextKeyCandidates:[],pendingDispatchEscapeCandidates:[],deferredEventNoSourceDiagnostics:[],runesPropsDeclarationMetadataByDeclaratorStart:new Map,typedRunesPropsDeclarations:[],explicitVariableTypesByName:new Map,explicitVariableTypeNodesByName:new Map,typeImportBindingsByLocalName:new Map,localTypeDeclarationsByName:new Map,additionalTypeDependencyNodes:[],additionalImportedTypes:new Map,wholePropsLocals:new Set,restPropLocals:new Set,componentScope:new Map,activeScopes:[],slots:new Map,snippetPropLocals:new Set,jsDocSlots:new Map,renderedSlots:new Set,slotsUntracked:!1,cssParts:[],cssProperties:[],deferredSlotBlockGenerics:[],events:new Map,eventDescriptions:new Map,forwardedEvents:new Map,jsDocEventNames:new Set,typedDispatcherEventNames:new Set,explicitDefaultPropNames:new Set,untypedJsDocEventNames:new Set,jsDocEventSources:new Map,bindings:new Map,typeCasts:{constAssertions:new WeakSet,typeAssertions:new WeakMap},contexts:new Map,typedefs:new Map,typedefMembersByName:new Map,variableInfoCache:void 0,sveldIgnoreDirectives:new Map,propIgnoreCodes:new Map}}function di(r,y){return r.propLocalToPublicName.get(y)??y}function br(r,y,L=y){r.propLocalToPublicName.set(L,y)}function ui(r,y){return r.props.get(di(r,y))}function jt(r,y){return ui(r,y)?.type}function en(r,y,L,W,H){r.diagnosticRecords.push(fi(r,y,L,W,H))}function fi(r,y,L,W,H){return a({component:r.componentFilePath,kind:y,name:L,message:W,...H?{source:H}:{},...mi(r,y,L)?{ignored:!0}:{}})}function ko(r,y){return`${r}:${y}`}function kn(r,y,L,W){if(!W||W.length===0)return;let H=ko(y,L),J=r.sveldIgnoreDirectives.get(H)??new Set;for(let U of W)J.add(U);r.sveldIgnoreDirectives.set(H,J)}function Jt(r,y,L){if(kn(r,"prop-unknown-type",y,L),kn(r,"bind-this-type-mismatch",y,L),L&&L.length>0)r.propIgnoreCodes.set(y,L)}function mi(r,y,L){let W=r.sveldIgnoreDirectives.get(ko(y,L));if(!W)return!1;return W.has("")||W.has(X[y])}var gi="/**",wo="*",vr="*/",Ql="```",yi=/^\s+/,Lo=/\s/,Zl=/^@[^\s/]+(?=\s|$)/,ep=/^@(\S+)\s*/,np=new Set(["extends","extendProps","generics","template","typedef"]);function Ut(r){let y=0;while(y<r.length){let L=r.charCodeAt(y);if(L!==32&&L!==9&&L!==13&&L!==10&&!Lo.test(r[y]))break;y++}return y}function tp(r,y){let L=r.slice(Ut(r)),W=!1;if(y)L=L.slice(gi.length),W=!0;else if(L.startsWith(wo)&&!L.startsWith(vr))L=L.slice(wo.length),W=!0;let H=L.slice(0,Ut(L));L=L.slice(H.length);let J=L.trimEnd(),U=J.endsWith(vr)?J.slice(0,-vr.length).trimEnd():L;return{indent:W?H.slice(1):H,content:U}}function rp(r,y,L){let W=L>y&&r.charCodeAt(L-1)===13?L-1:L;return r.slice(y,W)}function ip(r){let y=[],L=0;while(!0){let W=r.indexOf(gi,L);if(W===-1)break;let H=r.lastIndexOf(`
2
2
  `,W-1)+1;if(r.charCodeAt(W+gi.length)===42||r.slice(H,W).trim()!==""){L=W+1;continue}let J=[],U=H,te=!1,K=0;while(U<=r.length){let Ee=r.indexOf(`
3
3
  `,U),Se=Ee===-1?r.length:Ee,ve=rp(r,U,Se),{indent:Le,content:Me}=tp(ve,J.length===0);J.push({raw:ve,start:U,number:J.length,indent:Le,content:Me});let Fe=ve.trimEnd();if(Fe.endsWith(vr)){te=!0,K=U+Fe.length,L=Se;break}if(Ee===-1)break;U=Ee+1}if(!te)break;y.push({start:W,end:K,lines:J})}return y}function op(r){let y=r;if(y.length>0&&y[0].content==="")y=y.slice(1);if(y.length>0&&y[y.length-1].content==="")y=y.slice(0,-1);return y}function sp(r){let y=[[]],L=!1;for(let W of r){if(Zl.test(W.content)&&!L)y.push([W]);else y[y.length-1].push(W);if(Xt(W.content))L=!L}return y}function Xt(r){return ap(r,Ql)%2===1}function ap(r,y){let L=0,W=r.indexOf(y);while(W!==-1)L++,W=r.indexOf(y,W+y.length);return L}function _o(r){return r.map((y)=>y.indent+y.content).join(`
4
4
  `)}function lp(r){let y=0;while(y<r.length-1&&r[y].content.trim()==="")y++;if(r[y].content[0]!=="{")return null;let L=r.slice(y).map((K)=>K.content).join(`
@@ -16,7 +16,7 @@ import{v,O,M,x,N,Te,q,Ce,be,z,T,l,o,n,C,t,A,c,m,w,je,Pe,k,p,F,_,i,b,P,E,ie,se,a,
16
16
  `,W-1)+1,ve=Pp.exec(L.slice(Se,W))?.[0]??"";return te.split(`
17
17
  `).map((Le,Me)=>(Me>0&&Le.startsWith(ve)?Le.slice(ve.length):Le).trimEnd()).filter((Le,Me)=>Me===0||Le!=="").join(`
18
18
  `).trim()}var Np=V(["TSInterfaceDeclaration","TSTypeAliasDeclaration","TSTypeAnnotation","TSTypeLiteral","TSTypeReference"]);function jo(r){return r.type==="Identifier"?r.name:r.right.name}function Wo(r){return r.type==="Identifier"?r.name:Wo(r.left)}function Ho(r,y,L){let W=y?.start,H=y?.end;if(W===void 0||H===void 0)return;return cn(r,W+L,H)?.trim()}function yn(r,y){return Ho(r,y,1)}function Fn(r,y){return Ho(r,y,0)}function An(r,y,L,W,H=new Set){if(!y)return;let J=(U)=>An(r,U,L,W,H);o(y,{enter(U){if(!Np(U))return;switch(U.type){case"TSInterfaceDeclaration":for(let te of U.extends??[])Go(r,te.expression,te.typeParameters?.params,L,W,H);return Vo(U.body.body,J),l;case"TSTypeAliasDeclaration":case"TSTypeAnnotation":return J(U.typeAnnotation),l;case"TSTypeLiteral":return Vo(U.members,J),l;case"TSTypeReference":return Go(r,U.typeName,U.typeArguments?.params,L,W,H),l}}})}function kp(r,y){let L=new Map;for(let W of Array.from(y).sort()){let H=r.valueImportBindingsByLocalName.get(W)??r.additionalImportedTypes.get(W),J=r.typeImportBindingsByLocalName.get(W)??(H?{...H,specifierType:"named"}:void 0);if(!J)continue;let U=L.get(J.source)??{default:[],named:[],namespace:[]};if(J.specifierType==="default")U.default.push(J.localName);else if(J.specifierType==="namespace")U.namespace.push(J.localName);else U.named.push({imported:J.importedName,local:J.localName});L.set(J.source,U)}return Array.from(L.entries()).sort(([W],[H])=>u(W,H)).map(([W,H])=>{if(H.namespace.length>0)return H.namespace.map((K)=>`import type * as ${K} from "${W}";`).join(`
19
- `);let J=H.named.map(({imported:K,local:Ee})=>{if(!K||K===Ee)return Ee;return`${K} as ${Ee}`}),U=H.default[0],te=J.length>0?`{ ${J.join(", ")} }`:"";if(U&&te)return`import type ${U}, ${te} from "${W}";`;if(U)return`import type ${U} from "${W}";`;return`import type ${te} from "${W}";`})}function Go(r,y,L,W,H,J){let U=Wo(y);if(r.typeImportBindingsByLocalName.has(U)||r.valueImportBindingsByLocalName.has(U))W.add(U);let te=r.localTypeDeclarationsByName.get(U);if(te&&!J.has(U))H.add(U),J.add(U),An(r,te.node,W,H,J),J.delete(U);for(let K of L??[])An(r,K,W,H,J)}function Vo(r,y){for(let L of r)if(L.type==="TSPropertySignature")y(L.typeAnnotation?.typeAnnotation)}function ln(r,y){if(y)r.additionalTypeDependencyNodes.push(y)}function wp(r){if(!r.const)return;let y=r.id.name,L=[];for(let W of r.members){let H=W.initializer;if(H?.type!=="Literal")return;let J=H.value;if(typeof J==="string")L.push(JSON.stringify(J));else if(typeof J==="number")L.push(String(J));else return}if(L.length===0)return;return`type ${y} = ${L.join(" | ")};`}function Jo(r,y){let L=wp(y);if(L)return L;let W=cn(r,y.start,y.end)?.trim();return W?`declare ${W}`:void 0}var Lp=/\/\*\*((?:(?!\*\/)[\s\S])*)\*\/\s*$/;function _p(r,y,L){if(y===void 0)return;let W=cn(r,y,L),H=W&&Lp.exec(W);return H?ne(H[0]):void 0}function Zt(r,y){let L=[],W="start"in y&&typeof y.start==="number"?y.start:void 0,H=(J)=>y.params.length===1?"arg":`arg${J}`;for(let[J,U]of y.params.entries()){let te=_p(r,W,U.start);W=U.end;let K=U.type==="TSParameterProperty"?U.parameter:U;if(K.type==="RestElement"){ln(r,K.typeAnnotation?.typeAnnotation),L.push({name:K.argument.type==="Identifier"?K.argument.name:"rest",type:yn(r,K.typeAnnotation)??te,optional:!1,rest:!0});continue}let Ee=K.type==="AssignmentPattern",Se=Ee?K.left:K,ve="typeAnnotation"in Se?Se.typeAnnotation:void 0;ln(r,ve?.typeAnnotation),L.push({name:Se.type==="Identifier"?Se.name:H(J),type:yn(r,ve)??te,optional:Ee||"optional"in K&&K.optional===!0,rest:!1})}ln(r,y.returnType?.typeAnnotation);for(let J of y.typeParameters?.params??[])ln(r,J.constraint),ln(r,J.default);return{params:L,returnType:yn(r,y.returnType),typeParameters:Fn(r,y.typeParameters)||void 0}}function zn(r,y,L="any"){let{params:W,returnType:H,typeParameters:J}=Zt(r,y),U=W.map(({name:K,type:Ee,optional:Se,rest:ve})=>ve?`...${K}: ${Ee??"any[]"}`:`${K}${Se?"?":""}: ${Ee??"any"}`),te=H!==void 0||J!==void 0||W.some((K)=>K.type!==void 0);return{signature:`${J??""}(${U.join(", ")}) => ${H??L}`,hasAnnotations:te}}function Qt(r){return r.length>0?r.slice():void 0}function Uo(r){let y=Qt(r.pendingCallDefaultCandidates),L=Qt(r.pendingConstDefaultCandidates.filter((te)=>te.location!=="props"||!r.explicitDefaultPropNames.has(te.propName))),W=Qt(r.pendingContextKeyCandidates),H=Qt(r.pendingDispatchEscapeCandidates);if(!y&&!L&&!W&&!H)return;let J=Qt(r.deferredEventNoSourceDiagnostics),U=H&&r.untypedJsDocEventNames.size>0?Array.from(r.untypedJsDocEventNames):void 0;return{...y?{pendingCallDefaultCandidates:y}:{},...L?{pendingConstDefaultCandidates:L}:{},...W?{pendingContextKeyCandidates:W}:{},...H?{pendingDispatchEscapeCandidates:H}:{},...J?{deferredEventNoSourceDiagnostics:J}:{},...U?{untypedJsDocEventNames:U}:{}}}function zo(r){let y=new Set,L=new Set;for(let K of r.additionalTypeDependencyNodes)An(r,K,y,L);for(let K of r.additionalImportedTypes.keys())y.add(K);let W=Array.from(r.localTypeDeclarationsByName.values()).filter((K)=>K.exported).sort((K,Ee)=>K.start-Ee.start);for(let K of W)An(r,K.node,y,L);let H=W.map((K)=>`export ${K.code}`),J=r.typedRunesPropsDeclarations.length===1?r.typedRunesPropsDeclarations[0]:void 0,U=J?.canonicalType;if(J&&U){for(let K of J.referencedImportedTypes)y.add(K);for(let K of J.referencedLocalTypes)L.add(K)}if(!U&&y.size===0&&L.size===0&&H.length===0)return;let te=Array.from(L).map((K)=>r.localTypeDeclarationsByName.get(K)).filter((K)=>K!==void 0&&!K.exported).sort((K,Ee)=>K.start-Ee.start).map((K)=>K.code);return{...U?{canonicalPropsType:U}:{},canonicalPropNames:J&&U?Array.from(J.props.keys()).sort():[],localTypeDeclarations:te,...H.length>0?{moduleTypeDeclarations:H}:{},typeImportStatements:kp(r,y)}}function Rp(r,y,L,W,H){for(let J of r){if(J.type!=="Block"||J.start<L||J.end>W)continue;H.push({start:J.start,end:J.end,isJsDoc:J.end-J.start>4&&y.startsWith("/**",J.start)})}}function Mp(r,y){for(let L of r){let{start:W}=L,H=L.type==="ExportNamedDeclaration"?L.declaration:L;if(H?.type==="FunctionDeclaration"){if(H.id?.name)y.push({name:H.id.name,start:W})}else if(H?.type==="VariableDeclaration"){for(let J of H.declarations)if(J.id.type==="Identifier"&&J.id.name)y.push({name:J.id.name,start:W})}}}function Ip(r,y,L){let W=0,H=r.length;while(W<H){let J=W+H>>>1;if(r[J].end<=y)W=J+1;else H=J}for(let J=W-1;J>=0;J--){let U=r[J];if(!U.isJsDoc)continue;return hi(L,U.end,y)?U:void 0}return}function Fp(r){let y=new Map;if(!r.source)return y;let L=[],W=[],H=r.parsed?.comments??[];for(let J of[r.parsed?.module,r.parsed?.instance]){let U=J?.content;if(!U)continue;Rp(H,r.source,U.start,U.end,L),Mp(U.body,W)}L.sort((J,U)=>J.end-U.end);for(let J of W){let U=Ip(L,J.start,r.source);if(!U)continue;let te=xi(r,r.source.slice(U.start,U.end)),{type:K,description:Ee,ignore:Se,internal:ve}=Nr(te);if(Se.length>0)kn(r,"context-any-type",J.name,Se);if(!K&&!Ee&&!ve)continue;y.set(J.name,{type:K?En(K.type):void 0,description:Ee||K&&Mo(K),internal:ve||void 0})}return y}function Xo(r,y){return r.variableInfoCache??=Fp(r),r.variableInfoCache.get(y)}function On(r,y){let L=ui(r,y);if(L?.type)return{type:L.type,description:L.description,internal:L.internal};let W=Xo(r,y),H=r.explicitVariableTypesByName.get(y);if(H)return{type:H,description:W?.description,internal:W?.internal};if(!W?.type)return null;return{type:W.type,description:W.description,internal:W.internal}}function Bn(r,y){let L=On(r,y);if(L&&L.type===r.explicitVariableTypesByName.get(y))ln(r,r.explicitVariableTypeNodesByName.get(y));return L}function vi(r,y){let L=Xo(r,y);return{...L?.description?{description:L.description}:{},...L?.internal?{internal:!0}:{}}}function Tn(r,y){for(let W of r.vars)if(W.declarations.some((H)=>H.id.type==="Identifier"&&H.id.name===y))return qo(r,W);let L=r.funcDecls.get(y);return L&&qo(r,L)}function qo(r,y){let L=pn(r,y);if(L)return L;for(let W of[r.parsed?.instance,r.parsed?.module])for(let H of W?.content.body??[])if(H.type==="ExportNamedDeclaration"&&H.declaration===y)return pn(r,H);return}var Op=/\w/,Bp=/^readonly\s+/;function Di(r,y){let L=r.trim();if(!L.startsWith("{")||!L.endsWith("}"))return;let W=i(L.slice(1,-1),";,").map((H)=>H.trim().replace(Bp,""));for(let H of W){if(!H.startsWith(y))continue;let J=H.slice(y.length);if(Op.test(J.charAt(0)))continue;let U=J.trimStart(),te=U.startsWith("?");if(te)U=U.slice(1).trimStart();if(!U.startsWith(":"))continue;let K=U.slice(1).trim();return te?`${K} | undefined`:K}return}function Ko(r,y){if(y.computed||y.object.type!=="Identifier"||y.property.type!=="Identifier")return;let L=y.object.name,W=y.property.name;if(r.wholePropsLocals.has(L))return jt(r,W);let H=jt(r,L)??On(r,L)?.type;if(!H)return;return Di(H,W)}function er(r,y,L){if(!y)return;br(r,y);let W=r.props.get(y);r.props.set(y,W?{...W,...L}:L)}function wr(r,y,L,W){if(y.pendingCallDefault)r.pendingCallDefaultCandidates.push({propName:L,location:W,...y.pendingCallDefault});if(y.pendingConstDefault)r.pendingConstDefaultCandidates.push({propName:L,location:W,...y.pendingConstDefault})}var $p=new Map([["Date","Date"],["Map","Map<any, any>"],["Set","Set<any>"],["WeakMap","WeakMap<object, any>"],["WeakSet","WeakSet<object>"],["Array","any[]"],["RegExp","RegExp"],["Regexp","RegExp"],["Error","Error"]]);function Sn(r,y,L=0){let W=Wp(r,y,L),H=y&&typeof y==="object"?ts(r,y):void 0;return H===void 0?W:{...W,type:H}}var Gp=/^\s*\(\s*$/;function ts(r,y){let{constAssertions:L,typeAssertions:W}=r.typeCasts;if(L.has(y))return xn(y,"const");let H=W.get(y);if(H)return ln(r,H),gn(r,H);return Vp(r,y)}function Vp(r,y){let L="start"in y&&typeof y.start==="number"?y.start:void 0;if(L===void 0)return;let W=r.parsed?.comments.findLast((H)=>H.end<=L);if(W?.type!=="Block"||!W.value.startsWith("*"))return;if(!Gp.test(cn(r,W.end,L)??""))return;return ne(W.value)}function jp(r){return n(r)&&"type"in r}function nr(r){return jp(r)?r:void 0}function Wp(r,y,L){let W=nr(y);if(!W)return{value:void 0,type:void 0,isFunction:!1};let H=ns(r,W),J=(U,te)=>({value:U,type:te,isFunction:!1,defaultValue:H});switch(W.type){case"ObjectExpression":case"ArrayExpression":return J(Ln(r,W),xn(W,"widen"));case"BinaryExpression":return J(Ln(r,W),mn(r,W,L));case"ArrowFunctionExpression":case"FunctionExpression":return{...J(es(r,W),os(r,W)),isFunction:!0};case"UnaryExpression":return J(Ln(r,W),mn(r,W,L));case"LogicalExpression":case"ConditionalExpression":case"SequenceExpression":{let U=Ln(r,W),te=U!==void 0&&W.type==="SequenceExpression"?`(${U})`:U;return J(te,mn(r,W,L))}case"NewExpression":{let{callee:U}=W,te=t(U)?$p.get(U.name)??U.name:void 0;return J(wn(r,W),te)}case"CallExpression":return Hp(r,W,H,L);case"Identifier":{let{name:U}=W;if(L<5){let te=ir(r,U);if(te){let Ee=Sn(r,Xp(te),L+1),Se=Tn(r,U);return{...Ee,resolvedType:Se?.type??Ee.resolvedType,resolvedDescription:Se?.description??Ee.resolvedDescription,resolvedParams:Se?.params??Ee.resolvedParams,resolvedReturnType:Se?.returnType??Ee.resolvedReturnType}}let K=r.funcDecls.get(U);if(K){let Ee=Tn(r,U);return{value:es(r,K),type:void 0,isFunction:!0,defaultValue:ns(r,K),resolvedType:Ee?.type??is(r,Ee,K),resolvedDescription:Ee?.description,resolvedParams:Ee?.params,resolvedReturnType:Ee?.returnType}}}return Yo(J(wn(r,W)),r.valueImportBindingsByLocalName.get(U))}case"MemberExpression":return Yo(J(wn(r,W),sc(W)?"number":void 0),le(r,W));case"TemplateLiteral":return J(wn(r,W),"string");case"Literal":return typeof W.raw==="string"?J(W.raw,$n(W)):J(void 0);case"AssignmentExpression":case"AwaitExpression":case"ChainExpression":case"ClassExpression":case"ImportExpression":case"MetaProperty":case"TaggedTemplateExpression":case"ThisExpression":case"TSAsExpression":case"TSInstantiationExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"UpdateExpression":case"YieldExpression":break}return J(void 0)}function Yo(r,y){if(!y)return r;let{source:L,importedName:W,members:H}=y;return{...r,pendingConstDefault:{importSource:L,importedName:W,...H?{members:H}:{}}}}function Hp(r,y,L,W){let H=wn(r,y),{callee:J}=y,U=t(J)?J.name:void 0;if((U==="$derived"||U==="$state")&&y.arguments.length===1&&W<5)return{...Sn(r,y.arguments[0],W+1),value:H,defaultValue:L};let te={value:H,type:void 0,isFunction:!1,defaultValue:L};if(U){let K=Kp(r,U);if(K?.declared)return{...te,resolvedType:K.type};if(K)return{...te,type:K.type};if(r.funcDecls.has(U)||rs(r,U))return{...te,pendingCallDefault:{calleeName:U}};let Ee=r.valueImportBindingsByLocalName.get(U);if(Ee)return{...te,pendingCallDefault:{calleeName:U,importSource:Ee.source,importedName:Ee.importedName}}}return{...te,pendingCallDefault:{calleeName:U??wn(r,J)??"call"}}}function $n(r){if("regex"in r&&r.regex)return"RegExp";if("bigint"in r&&r.bigint)return"bigint";return r.value==null?void 0:typeof r.value}var Jp=new Set(["-","*","/","%","**","<<",">>",">>>","&","|","^"]),Up=new Set(["==","!=","===","!==","<","<=",">",">=","in","instanceof"]);function mn(r,y,L){let W=nr(y);if(!W)return;switch(W.type){case"UnaryExpression":{let{operator:J,argument:U}=W;if(J==="!"||J==="delete")return"boolean";if(J==="typeof")return"string";if(J==="void")return;if(J==="+")return"number";return mn(r,U,L)==="bigint"?"bigint":"number"}case"BinaryExpression":{let{operator:J}=W;if(Up.has(J))return"boolean";let U=mn(r,W.left,L),te=mn(r,W.right,L);if(U==="bigint"&&te==="bigint")return"bigint";if(Jp.has(J))return"number";if(J!=="+")return;if(U==="string"||te==="string")return"string";if(U==="number"&&te==="number")return"number";return}case"LogicalExpression":return Qo([mn(r,W.left,L),mn(r,W.right,L)]);case"ConditionalExpression":return Qo([mn(r,W.consequent,L),mn(r,W.alternate,L)]);case"SequenceExpression":return mn(r,W.expressions[W.expressions.length-1],L);case"Identifier":{let{name:J}=W;if(J==="NaN"||J==="Infinity")return"number";if(J==="undefined")return;let U=On(r,J)?.type;if(U)return U;if(L>=5)return;return mn(r,ir(r,J),L+1)}case"ArrayExpression":case"ArrowFunctionExpression":case"AssignmentExpression":case"AwaitExpression":case"CallExpression":case"ChainExpression":case"ClassExpression":case"FunctionExpression":case"ImportExpression":case"Literal":case"MemberExpression":case"MetaProperty":case"NewExpression":case"ObjectExpression":case"TaggedTemplateExpression":case"TemplateLiteral":case"ThisExpression":case"TSAsExpression":case"TSInstantiationExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"UpdateExpression":case"YieldExpression":break}if(L>=5)return;let H=Sn(r,W,L+1);return H.type??H.resolvedType}function Qo(r){let y=new Set;for(let L of r){if(L===void 0)return;y.add(L.includes("=>")?`(${L})`:L)}return y.size===1?r[0]:[...y].join(" | ")}function xn(r,y){let L=nr(r),W=y==="widen";switch(L?.type){case"Literal":if("regex"in L&&L.regex)return"RegExp";if(L.value===null)return"null";return W?$n(L):L.raw??void 0;case"TemplateLiteral":if(L.expressions.length>0)return;return W?"string":`\`${L.quasis[0]?.value.raw??""}\``;case"Identifier":return L.name==="undefined"?"undefined":void 0;case"UnaryExpression":{let{operator:H,argument:J}=L;if(H!=="-"||J.type!=="Literal")return;let U=$n(J);if(U!=="number"&&U!=="bigint")return;return W?U:`-${J.raw}`}case"ArrayExpression":{let H=[];for(let te of L.elements){let K=te===null?void 0:xn(te,y);if(K===void 0)return;H.push(K)}if(y==="literal")return`[${H.join(", ")}]`;if(y==="const")return`readonly [${H.join(", ")}]`;let J=new Set(H);if(J.size===0)return"any[]";let U=[...J].join(" | ");return J.size===1?`${U}[]`:`(${U})[]`}case"ObjectExpression":{let H=new Map;for(let U of L.properties){if(U.type!=="Property"||U.kind!=="init"||U.computed||U.method||U.shorthand)return;let{key:te}=U,K=te.type==="Identifier"?te.name:te.type==="Literal"?te.raw:void 0,Ee=xn(U.value,y);if(K===void 0||Ee===void 0)return;H.delete(K),H.set(K,Ee)}if(H.size===0)return"{}";let J=y==="const"?"readonly ":"";return`{ ${[...H].map(([U,te])=>`${J}${U}: ${te}`).join("; ")} }`}case"ArrowFunctionExpression":case"AssignmentExpression":case"AwaitExpression":case"BinaryExpression":case"CallExpression":case"ChainExpression":case"ClassExpression":case"ConditionalExpression":case"FunctionExpression":case"ImportExpression":case"LogicalExpression":case"MemberExpression":case"MetaProperty":case"NewExpression":case"SequenceExpression":case"TaggedTemplateExpression":case"ThisExpression":case"TSAsExpression":case"TSInstantiationExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"UpdateExpression":case"YieldExpression":case void 0:break}return}function tr(r,y,L=!1){let W=ir(r,y);if(W===void 0){let J=r.funcDecls.get(y);return J&&Zo(r,y,J,L)}if(W.type==="ArrowFunctionExpression"||W.type==="FunctionExpression")return ts(r,W)??Zo(r,y,W,L);if(W.type==="CallExpression"){let J=rr(r,W);if(J)return J;let U=gn(r,W.callee);if(U==="$state"||U==="$state.raw"||U==="$derived"){let te=W.typeArguments?.params[0];if(te)return ln(r,te),gn(r,te);if(U==="$state.raw")return Sn(r,W.arguments[0],1).type}}let H=Sn(r,W);return H.type??H.resolvedType}function Zo(r,y,L,W){let H=W?or(L):sr(L),J=zn(r,L,H);if(J.hasAnnotations)return J.signature;let U=Tn(r,y);if(U?.type)return U.type;return W?Ai(U,L)??Xn(r,L):is(r,U,L)}var zp=new Map([["writable","Writable"],["readable","Readable"],["derived","Readable"],["readonly","Readable"]]),qp=/^(?:import\("svelte\/store"\)\.)?(?:Writable|Readable)<([\s\S]*)>$/;function rr(r,y){let L=t(y.callee)?r.valueImportBindingsByLocalName.get(y.callee.name):void 0,W=L?.source==="svelte/store"?zp.get(L.importedName):void 0;if(!W)return;let H=L?.importedName==="derived",J=y.typeArguments?.params[H?1:0],U;if(J)ln(r,J),U=gn(r,J);else if(L?.importedName==="readonly"){let[te]=y.arguments;U=(t(te)?Bn(r,te.name)?.type??tr(r,te.name):te?.type==="CallExpression"?rr(r,te):void 0)?.trim().match(qp)?.[1]}else if(H){let te=y.arguments[1];U=(te?.type==="ArrowFunctionExpression"||te?.type==="FunctionExpression")&&te.params.length<2?sr(te):void 0}else{let[te]=y.arguments;U=(t(te)?Bn(r,te.name)?.type:void 0)??mn(r,te,0)}return`import("svelte/store").${W}<${U??"any"}>`}function Xp(r){if(r.type!=="CallExpression"||r.arguments.length!==1)return r;let[y]=r.arguments;if(y.type==="SpreadElement")return r;let{callee:L}=r;return L.type==="Identifier"&&(L.name==="$state"||L.name==="$derived")||L.type==="MemberExpression"&&t(L.object)&&L.object.name==="$state"&&t(L.property)&&L.property.name==="raw"?y:r}function ir(r,y,L=!1){for(let W of r.vars){if(L&&W.kind!=="const")continue;for(let H of W.declarations)if(t(H.id)&&H.id.name===y&&H.init)return H.init}return}function qn(r,y){return ir(r,y,!0)}function Kp(r,y){let L=Tn(r,y);if(L?.returnType)return{type:L.returnType,declared:!0};let W=r.funcDecls.get(y)??rs(r,y);if(!W)return;let H=Qp(r,W)??Yp(r,y);if(H)return{type:H,declared:!0};let J=sr(W);return J==="any"?void 0:{type:J,declared:!1}}function rs(r,y){let L=ir(r,y);return L?.type==="ArrowFunctionExpression"||L?.type==="FunctionExpression"?L:void 0}function Yp(r,y){for(let L of r.vars)for(let W of L.declarations){let H=W.id;if(!t(H)||H.name!==y)continue;let J=H.typeAnnotation?.typeAnnotation;if(!J)return;return ie(cn(r,J.start,J.end))}return}function Qp(r,y){let L=y.returnType?.typeAnnotation;return L&&cn(r,L.start,L.end)}function is(r,y,L){let W=y?.returnType??"any",H=y?.params;if(H&&H.length>0)return`(${h(H)}) => ${W}`;if(y?.returnType)return`() => ${W}`;return os(r,L)}function os(r,y){let L=sr(y),W=zn(r,y,L);if(W.hasAnnotations)return W.signature;return`(${Zp(y)}) => ${L}`}function Zp({params:r}){let y=[];for(let L of r){if(!t(L))return"...args: any[]";y.push(`${L.name}: any`)}return y.length>0?y.join(", "):"...args: any[]"}function Xn(r,y){let L=or(y),W=zn(r,y,L);if(W.hasAnnotations)return W.signature;return`(${ss(y)}) => ${L}`}function ss(r){let y=(W)=>r.params.length===1?"arg":`arg${W}`;return r.params.map((W,H)=>{if(W.type==="RestElement")return`...${t(W.argument)?W.argument.name:"args"}: any[]`;if(W.type==="AssignmentPattern")return`${t(W.left)?W.left.name:y(H)}?: any`;return`${t(W)?W.name:y(H)}: any`}).join(", ")}function Ai(r,y){if(!r?.params?.length&&!r?.returnType)return;return`(${r.params?.length?h(r.params):ss(y)}) => ${r.returnType??or(y)}`}function or(r){return ec(r)?r.async?"Promise<void>":"void":sr(r)}function ec(r){return!r.generator&&r.body.type==="BlockStatement"&&Y(r.body).every((y)=>y===null)}function sr(r){if(r.async||r.generator)return"any";let{body:y}=r,L=y.type==="BlockStatement"?Y(y):[y],W=new Set(L.map(nc)),[H]=W;return W.size===1&&H?H:"any"}function nc(r){let y=nr(r);switch(y?.type){case"Literal":{let{value:L}=y;if(typeof L==="string")return"string";if(typeof L==="number")return"number";if(typeof L==="boolean")return"boolean";return null}case"TemplateLiteral":return"string";case"CallExpression":{let{callee:L}=y;if(!t(L))return null;if(L.name==="String")return"string";if(L.name==="Number")return"number";if(L.name==="Boolean")return"boolean";return null}case"ArrayExpression":case"ArrowFunctionExpression":case"AssignmentExpression":case"AwaitExpression":case"BinaryExpression":case"ChainExpression":case"ClassExpression":case"ConditionalExpression":case"FunctionExpression":case"Identifier":case"ImportExpression":case"LogicalExpression":case"MemberExpression":case"MetaProperty":case"NewExpression":case"ObjectExpression":case"SequenceExpression":case"TaggedTemplateExpression":case"ThisExpression":case"TSAsExpression":case"TSInstantiationExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"UnaryExpression":case"UpdateExpression":case"YieldExpression":case void 0:break}return null}function tc(r,{params:y}){if(y.length===0)return"";return cn(r,y[0].start,y[y.length-1].end)??""}function es(r,y){if(y.generator)return;let{body:L}=y,W=tc(r,y),H=y.async?"async ":"",J=(K,Ee)=>K.type==="ObjectExpression"?`(${Ee})`:Ee;if(L.type!=="BlockStatement"){let K=Ln(r,L);return K===void 0?void 0:`${H}(${W}) => ${J(L,K)}`}let U=L.body;if(U.length===0)return`${H}(${W}) => {}`;let[te]=U;if(U.length===1&&te.type==="ReturnStatement"&&te.argument){let K=Ln(r,te.argument);if(K!==void 0)return`${H}(${W}) => ${J(te.argument,K)}`}return}function rc(r){switch(r.type){case"Literal":case"UnaryExpression":return"literal";case"TemplateLiteral":return r.expressions.length===0?"literal":"expression";case"ArrayExpression":return"array";case"ObjectExpression":return"object";case"ArrowFunctionExpression":case"FunctionExpression":case"FunctionDeclaration":return"function";case"AssignmentExpression":case"AwaitExpression":case"BinaryExpression":case"CallExpression":case"ChainExpression":case"ClassExpression":case"ConditionalExpression":case"Identifier":case"ImportExpression":case"LogicalExpression":case"MemberExpression":case"MetaProperty":case"NewExpression":case"SequenceExpression":case"TaggedTemplateExpression":case"ThisExpression":case"TSAsExpression":case"TSInstantiationExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"UpdateExpression":case"YieldExpression":break}return"expression"}function ns(r,y){let L=Ln(r,y);if(!L)return;let W=rc(y);if(W!=="literal"&&W!=="array"&&W!=="object")return{raw:L,kind:W};let H=Pi(y);if(H.ok)return{raw:L,kind:W,value:H.value};return{raw:L,kind:y.type==="UnaryExpression"?"expression":W}}function Pi(r){let y=nr(r);switch(y?.type){case"Literal":return typeof y.value==="bigint"||"regex"in y?{ok:!1}:{ok:!0,value:y.value};case"UnaryExpression":{let{operator:L,argument:W}=y;if(W.type!=="Literal")return{ok:!1};let{value:H}=W;if(typeof H==="number"){if(L==="-")return{ok:!0,value:-H};if(L==="+")return{ok:!0,value:H}}if(typeof H==="boolean"&&L==="!")return{ok:!0,value:!H};return{ok:!1}}case"TemplateLiteral":{let{expressions:L,quasis:W}=y;if(L.length>0||W.length!==1)return{ok:!1};return{ok:!0,value:W[0].value.cooked??W[0].value.raw}}case"ArrayExpression":{let L=[];for(let W of y.elements){if(!W)return{ok:!1};let H=Pi(W);if(!H.ok)return{ok:!1};L.push(H.value)}return{ok:!0,value:L}}case"ObjectExpression":{let L={};for(let W of y.properties){if(W.type!=="Property"||W.computed)return{ok:!1};let H=p(W.key);if(!H)return{ok:!1};let J=Pi(W.value);if(!J.ok)return{ok:!1};L[H]=J.value}return{ok:!0,value:L}}case"ArrowFunctionExpression":case"AssignmentExpression":case"AwaitExpression":case"BinaryExpression":case"CallExpression":case"ChainExpression":case"ClassExpression":case"ConditionalExpression":case"FunctionExpression":case"Identifier":case"ImportExpression":case"LogicalExpression":case"MemberExpression":case"MetaProperty":case"NewExpression":case"SequenceExpression":case"TaggedTemplateExpression":case"ThisExpression":case"TSAsExpression":case"TSInstantiationExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"UpdateExpression":case"YieldExpression":case void 0:break}return{ok:!1}}var ic=new Set(["POSITIVE_INFINITY","NEGATIVE_INFINITY","MAX_VALUE","MIN_VALUE","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","EPSILON","NaN"]),oc=new Set(["PI","E","LN2","LN10","LOG2E","LOG10E","SQRT2","SQRT1_2"]);function sc({object:r,property:y}){if(!t(r)||!t(y))return!1;if(r.name==="Number")return ic.has(y.name);if(r.name==="Math")return oc.has(y.name);return!1}function ar(r,y,L){if(!y||r.has(y))return;r.set(y,L)}function Lr(r,y){for(let L=r.activeScopes.length-1;L>=0;L-=1){let W=r.activeScopes[L]?.get(y);if(!W)continue;return W.kind==="prop"?W.publicPropName:void 0}return}function Gn(r,y){for(let L=r.activeScopes.length-1;L>=0;L-=1){let W=r.activeScopes[L];if(W===r.componentScope)return!1;if(W?.has(y))return!0}return!1}function _r(r,y){let L=y;while(A(L))L=L.object;return t(L)&&Gn(r,L.name)}function un(r,y=new Set){if(r)for(let L of be(r))y.add(L.name);return y}function Ni(r,y){if(!y||typeof y!=="object"||!("type"in y))return;if(y.type==="Identifier"){let L=Lr(r,y.name);if(L)r.reactive_vars.add(L);return}if(y.type!=="ObjectPattern"&&y.type!=="ArrayPattern")return;for(let L of un(y)){let W=Lr(r,L);if(W)r.reactive_vars.add(W)}}function Yn(r){if(!r||typeof r!=="object"||!("type"in r))return!1;switch(String(r.type)){case"BlockStatement":case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"CatchClause":case"EachBlock":case"AwaitBlock":return!0;default:return!1}}function as(r){if(!r||typeof r!=="object"||!("type"in r))return!1;let y=String(r.type);return y==="FunctionDeclaration"||y==="FunctionExpression"||y==="ArrowFunctionExpression"}function ac(r){let y=[];if(r.id.type==="Identifier")return y.push({kind:"local",name:r.id.name}),y;if(r.id.type!=="ObjectPattern")return y;for(let L of r.id.properties){if(L.type==="RestElement"){if(L.argument.type==="Identifier")y.push({kind:"local",name:L.argument.name});continue}if(L.computed)continue;let W=p(L.key);if(!W)continue;let H=L.value.type==="AssignmentPattern"?L.value.left:L.value;if(H.type!=="Identifier"||!H.name)continue;y.push({kind:"prop",name:H.name,publicPropName:W})}return y}function ls(r,y,L,W){let H=r.kind==="var"?L:y;for(let J of r.declarations){if(W?.allowRunesProps&&m(J.init,"$props")){for(let U of ac(J))ar(U.kind==="prop"?y:L,U.name,U.kind==="prop"?{kind:"prop",publicPropName:U.publicPropName}:{kind:"local"});continue}for(let U of un(J.id))ar(H,U,W?.forceProp?{kind:"prop",publicPropName:U}:{kind:"local"})}}function Kn(r,...y){for(let L of y)for(let W of un(L))ar(r,W,{kind:"local"})}function ps(r,y,L,W){switch(r.type){case"VariableDeclaration":ls(r,y,L,W);break;case"FunctionDeclaration":case"ClassDeclaration":Kn(y,r.id);break;case"BlockStatement":case"BreakStatement":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExportAllDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":case"ExpressionStatement":case"ForInStatement":case"ForOfStatement":case"ForStatement":case"IfStatement":case"ImportDeclaration":case"LabeledStatement":case"ReturnStatement":case"StaticBlock":case"SwitchStatement":case"ThrowStatement":case"TryStatement":case"TSDeclareFunction":case"TSEnumDeclaration":case"TSExportAssignment":case"TSImportEqualsDeclaration":case"TSInterfaceDeclaration":case"TSModuleDeclaration":case"TSNamespaceExportDeclaration":case"TSTypeAliasDeclaration":case"WhileStatement":case"WithStatement":break}}function lc(r,y){for(let{local:L,exported:W}of y){if(L.type!=="Identifier")continue;let H=W.type==="Identifier"?W.name:String(W.value);if(r.componentScope.get(L.name)?.kind==="prop")continue;r.componentScope.set(L.name,{kind:"prop",publicPropName:H})}}function pc(r,y){let L=r.componentScope;for(let W of y?.content.body??[])if(W.type==="ImportDeclaration")Kn(L,...W.specifiers.map((H)=>H.local));else if(W.type!=="ExportNamedDeclaration")ps(W,L,L,{allowRunesProps:!0});else if(!W.declaration){if(W.source==null)lc(r,W.specifiers)}else if(W.declaration.type==="VariableDeclaration")ls(W.declaration,L,L,{forceProp:!0});else if(W.declaration.type==="FunctionDeclaration"&&W.declaration.id?.name){let{name:H}=W.declaration.id;ar(L,H,{kind:"prop",publicPropName:H})}}function cs(r){r.componentScope.clear(),r.activeScopes.length=0,pc(r,r.parsed?.instance)}function ds(r){return{varScopeStack:[r.componentScope]}}function us(r,y,L){if(!Yn(L))return;let W=new Map,H=y.varScopeStack[y.varScopeStack.length-1]??r.componentScope;switch(L.type){case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":Kn(W,L.id,...L.params.map((J)=>J.type==="TSParameterProperty"?J.parameter:J));break;case"BlockStatement":for(let J of L.body)ps(J,W,H);break;case"CatchClause":Kn(W,L.param);break;case"EachBlock":if(Kn(W,L.context),typeof L.index==="string")ar(W,L.index,{kind:"local"});break;case"AwaitBlock":Kn(W,L.value,L.error);break}if(as(L))y.varScopeStack.push(W);return W}function fs(r,y){if(as(y))r.varScopeStack.pop()}function lr(r,y,L=!0){let W=Bn(r,y);if(W||!L)return W;let H=tr(r,y,!0);if(!H)return null;let J=!Tn(r,y)?.params?.length;return{type:H,...vi(r,y),inferred:J}}var cc=/\bany\b/;function ki(r,y,L,W,H,J){if(H==="any"||!cc.test(H))return;en(r,"context-any-type",L,`Context "${y}" ${W} is inferred as "${H}"; annotate it to replace "any".`,Ve(r,J))}function dc(r,y,L){if(!t(y))return null;let W=qn(r,y.name);if(c(W))return Ss(r,W,L).properties;let H=lr(r,y.name);return H?d(H.type):null}function uc(r,y){return r.properties.some((L)=>L.type==="Property"&&L.kind==="get"&&p(L.key)===y)}function ms(r,y,L){if(!n(y)||!(L in y))return;let W=y[L];if(!W||typeof W!=="object"||!("typeAnnotation"in W))return;return gn(r,W.typeAnnotation)}function fc(r){let y=r?.body.body;if(y?.length!==1||y[0].type!=="ReturnStatement")return;return y[0].argument??void 0}function mc(r,y,L,W,H){let J=()=>(en(r,"context-any-type",L,`Context "${y}" property "${L}" has no type annotation; defaulted to "any".`,Ve(r,W)),{type:"any"});if(t(H))return lr(r,H.name)??J();if(H?.type==="ArrowFunctionExpression"||H?.type==="FunctionExpression")return{type:Xn(r,H),inferred:!0};if(C(H))return{type:$n(H)??"null"};if(H?.type==="MemberExpression"&&!H.computed&&t(H.object)&&t(H.property)){let Ee=lr(r,H.object.name)?.type,Se=Ee&&Di(Ee,H.property.name);if(Se)return{type:Se}}if(H===void 0)return{type:"any"};let U=H.type==="CallExpression"?rr(r,H):void 0;if(U)return{type:U,inferred:!0};let te=Sn(r,H),K=te.type??te.resolvedType;return K?{type:K,inferred:!0}:J()}function Ss(r,y,L){let W=[],H=!1;for(let J of y.properties){if(J.type==="SpreadElement"){let Me=dc(r,J.argument,L);if(Me)W.push(...Me);else H=!0,en(r,"spread-unresolved",L,`Context "${L}" spreads a value sveld can't resolve; its shape is widened to "Record<string, any>".`,Ve(r,J));continue}if(J.type!=="Property")continue;let U=p(J.key);if(!U)continue;if(J.kind==="set"&&uc(y,U))continue;let te=(J.kind==="get"||J.kind==="set")&&J.value.type==="FunctionExpression"?J.value:void 0,K=pn(r,J),Ee=!te&&(J.value.type==="ArrowFunctionExpression"||J.value.type==="FunctionExpression")?J.value:void 0,Se=!K?.type&&Ee?Ai(K,Ee):void 0,ve=te?J.kind==="get"?ms(r,te,"returnType"):ms(r,te.params[0],"typeAnnotation"):K?.type??Se,Le=ve?{type:ve,description:K?.description,inferred:Se!==void 0&&!K?.params?.length}:mc(r,L,U,J,J.kind==="get"?fc(te):J.kind==="set"?void 0:J.value);if(Le.inferred)ki(r,L,U,`property "${U}"`,Le.type,J);W.push({name:U,type:Le.type,description:Le.description||K?.description||void 0,optional:!1,...Le.internal?{internal:!0}:{}})}return{properties:W,hasUnresolvedSpread:H}}function gs(r,y,L){let{properties:W,hasUnresolvedSpread:H}=Ss(r,y,L);return{key:L,typeName:Q(L),properties:W,description:void 0,...H?{hasUnresolvedSpread:H}:{}}}function ys(r,y,L){if(c(y))return gs(r,y,L);let W=Q(L),H=(Ee)=>({key:L,typeName:W,type:Ee,properties:[]});if(y.type==="CallExpression"){let Ee=rr(r,y);if(Ee)ki(r,L,L,"value",Ee,y);return Ee?H(Ee):null}if(y.type==="Literal"&&y.value===null&&y.raw==="null")return H("null");if(t(y)&&y.name==="undefined")return H("undefined");if(!t(y))return null;let J=y.name,U=lr(r,J,!1),te=U?void 0:qn(r,J);if(c(te)){let{internal:Ee}=vi(r,J);return{...gs(r,te,L),...Ee?{internal:Ee}:{}}}let K=U??lr(r,J);if(K){if(K.inferred)ki(r,L,J,`variable "${J}"`,K.type,y);let Ee=d(K.type);return{key:L,typeName:W,...Ee?{}:{type:K.type},properties:Ee??[],description:K.description||void 0,...K.internal?{internal:!0}:{}}}return en(r,"context-any-type",J,`Context "${L}" variable "${J}" has no type annotation; defaulted to "any".`,Ve(r,y)),H("any")}function hs(r){let y=r.callee,L=y.type==="Identifier"&&y.name==="Symbol",W=y.type==="MemberExpression"&&!y.computed&&y.object.type==="Identifier"&&y.object.name==="Symbol"&&y.property.type==="Identifier"&&y.property.name==="for";if(!L&&!W)return null;let H=r.arguments[0];if(H?.type==="Literal"&&typeof H.value==="string")return H.value;if(H?.type==="TemplateLiteral"&&H.quasis.length===1)return H.quasis[0].value.cooked??"";return""}function Es(r){return{kind:"pending",importSource:r.source,importedName:r.importedName,...r.members?{members:r.members}:{}}}function xs(r,y,L=0){if(!y)return{kind:"unresolved"};if(y.type==="Literal"||y.type==="TemplateLiteral"){let W=k(y);return W==null?{kind:"unresolved"}:{kind:"resolved",key:W}}if(y.type==="CallExpression"||y.type==="NewExpression"){let W=hs(y);return W==null?{kind:"unresolved"}:{kind:"resolved",key:W}}if(y.type==="Identifier"){if(L>=5)return{kind:"unresolved"};let W=qn(r,y.name);if(W){if((W.type==="CallExpression"||W.type==="NewExpression")&&hs(W)==="")return{kind:"resolved",key:y.name};return xs(r,W,L+1)}let H=L===0&&Gn(r,y.name)?void 0:r.valueImportBindingsByLocalName.get(y.name);return H?Es(H):{kind:"unresolved"}}if(y.type==="MemberExpression"){let W=L===0&&_r(r,y)?void 0:le(r,y);if(W)return Es(W)}return{kind:"unresolved"}}function Ts(r,y,L,W,H){let J=gn(r,W)??"";en(r,"context-value-unresolved",y,`setContext(${L}, ${J}): the value isn't an object literal or a variable, so sveld can't describe its shape; the context is skipped.`,H)}function Cs(r,y,L){let W=y.arguments[0];if(!W)return;let H=xs(r,W);if(H.kind==="unresolved"||H.kind==="resolved"&&!H.key){let Se=gn(r,W)??"";en(r,"context-key-unresolved",Se,`setContext key \`${Se}\` isn't a string literal, const-bound string, Symbol(), or imported \`export const\` string; the context is skipped.`,Ve(r,y));return}let J=y.arguments[1];if(!J)return;let U=Ve(r,y),te=pn(r,L)?.internal===!0;if(H.kind==="pending"){let Se=pe(H),ve=ys(r,J,Se);if(ve)r.pendingContextKeyCandidates.push({importSource:H.importSource,importedName:H.importedName,...H.members?{members:H.members}:{},...ve.type===void 0?{}:{type:ve.type},properties:ve.properties,description:ve.description,...ve.hasUnresolvedSpread?{hasUnresolvedSpread:!0}:{},...ve.internal||te?{internal:!0}:{},source:U});else Ts(r,Se,Se,J,U);return}let K=H.key,Ee=ys(r,J,K);if(!Ee){Ts(r,K,JSON.stringify(K),J,U);return}if(r.contexts.has(K)){en(r,"context-duplicate-key",K,`setContext("${K}", ...) was called more than once; only the first call's shape is used.`,U);return}r.contexts.set(K,{...Ee,...te?{internal:!0}:{},source:U})}var gc=/\n/g,yc=/^[A-Za-z_$][\w$]*$/;function bs(r){return n(r)&&r.type==="ArrayExpression"&&Array.isArray(r.elements)}function wi(r,y){return{variableType:(L)=>{if(y?.has(L))return;return Bn(r,L)?.type??tr(r,L)}}}function pr(r,y,L){if(!y||typeof y!=="object"||!("type"in y))return L;if(t(y)){if(!Gn(r,y.name))return L;let H=L??new Set;return H.add(y.name),H}let W=L;if(c(y)){for(let H of y.properties)if(H.type==="Property")W=pr(r,H.value,W)}else if(bs(y))for(let H of y.elements)W=pr(r,H,W);return W}function vs(r,y){if(t(y))return r.variableType(y.name);return Wt(r,y)}function Wt(r,y){if(!y||typeof y!=="object"||!("type"in y))return;if(c(y))return hc(r,y);if(bs(y))return Ec(r,y);return}function Ds(r,y){return vs(r,y)??(C(y)?$n(y)??"null":"any")}function Li(r,y){if(C(y)&&y.raw==="null")return"null";let L=vs(r,y);if(L!==void 0)return L;let W=C(y)?y.value:void 0;return W==null?"":Ht(W)}function hc(r,y){if(y.properties.length===0)return"Record<string, never>";let L=[],W=!1;for(let H of y.properties){let J=H.type==="Property"&&!H.computed?p(H.key):void 0;if(H.type!=="Property"||!J){W=!0;continue}L.push({name:J,type:Ds(r,H.value)})}if(!W)return cr(L);if(L.length===0)return"Record<string, any>";return cr([...L,{name:"[key: string]",type:"any"}])}function Ec(r,y){let L=new Set(y.elements.filter((W)=>W!=null).map((W)=>Ds(r,W)));if(L.size===0)return"any[]";if(L.size===1)return`${[...L][0]}[]`;return`(${[...L].join(" | ")})[]`}function Ps(r,y){for(let[L,W]of r.arguments.entries()){if(t(W)&&W.name===y)return{argumentIndex:L};if(!c(W))continue;for(let H of W.properties){if(H.type!=="Property"||!t(H.value))continue;if(H.value.name!==y)continue;let J=!H.computed&&t(H.key)?H.key.name:void 0;return{argumentIndex:L,property:J??""}}}return}function Ht(r){return typeof r==="string"?JSON.stringify(r):String(r)}function _n(r,{name:y,detail:L,has_argument:W,description:H,deprecated:J,tags:U,internal:te,source:K}){let Ee=!W&&!L?"null":L||void 0,Se=r.events.get(y);if(Se?.type==="forwarded")r.events.set(y,{type:"dispatched",name:y,detail:Ee,description:H||Se.description,deprecated:J??Se.deprecated,tags:U??Se.tags,...te||Se.internal?{internal:!0}:{},source:K||Se.source});else if(Se){let ve=r.untypedJsDocEventNames.delete(y);r.events.set(y,{...Se,detail:Se.detail===void 0||ve?Ee:Se.detail,description:Se.description||H,deprecated:Se.deprecated??J,tags:Se.tags??U,...Se.internal||te?{internal:!0}:{},source:K||Se.source})}else r.events.set(y,{type:"dispatched",name:y,detail:Ee,description:H,deprecated:J,tags:U,...te?{internal:!0}:{},source:K})}function As(r,y){let L=y.arguments[0],W=Pe(L,"CustomEvent");if(!W&&!Pe(L,"Event"))return;let H=L.arguments[0],J=C(H)?H.value:void 0;if(J==null)return;let U=W?L.arguments[1]:void 0,te=!1,K;if(c(U)){let Ee=U.properties.find((Se)=>Se.type==="Property"&&t(Se.key)&&Se.key.name==="detail");if(Ee?.type==="Property")te=!0,K=Ee.value}return{name:String(J),detail:K,hasArgument:te,nestedBoundNames:pr(r,K),source:Ve(r,y)}}function Ns(r,y){_n(r,{name:y.name,detail:Li(wi(r,y.nestedBoundNames),y.detail),has_argument:y.hasArgument,source:y.source})}function cr(r,y=!1){if(r.length===0)return"null";let L=r.map(({name:W,type:H,description:J,optional:U,default:te})=>{let K=U?"?":"",Ee=yc.test(W)||W.startsWith("[")?W:JSON.stringify(W),Se=te?`@default ${te}`:"",ve=j(J&&Se?`${J} ${Se}`:J||Se);if(ve){if(y)return`${ve.includes(`
19
+ `);let J=H.named.map(({imported:K,local:Ee})=>{if(!K||K===Ee)return Ee;return`${K} as ${Ee}`}),U=H.default[0],te=J.length>0?`{ ${J.join(", ")} }`:"";if(U&&te)return`import type ${U}, ${te} from "${W}";`;if(U)return`import type ${U} from "${W}";`;return`import type ${te} from "${W}";`})}function Go(r,y,L,W,H,J){let U=Wo(y);if(r.typeImportBindingsByLocalName.has(U)||r.valueImportBindingsByLocalName.has(U))W.add(U);let te=r.localTypeDeclarationsByName.get(U);if(te&&!J.has(U))H.add(U),J.add(U),An(r,te.node,W,H,J),J.delete(U);for(let K of L??[])An(r,K,W,H,J)}function Vo(r,y){for(let L of r)if(L.type==="TSPropertySignature")y(L.typeAnnotation?.typeAnnotation)}function ln(r,y){if(y)r.additionalTypeDependencyNodes.push(y)}function wp(r){if(!r.const)return;let y=r.id.name,L=[];for(let W of r.members){let H=W.initializer;if(H?.type!=="Literal")return;let J=H.value;if(typeof J==="string")L.push(JSON.stringify(J));else if(typeof J==="number")L.push(String(J));else return}if(L.length===0)return;return`type ${y} = ${L.join(" | ")};`}function Jo(r,y){let L=wp(y);if(L)return L;let W=cn(r,y.start,y.end)?.trim();return W?`declare ${W}`:void 0}var Lp=/\/\*\*((?:(?!\*\/)[\s\S])*)\*\/\s*$/;function _p(r,y,L){if(y===void 0)return;let W=cn(r,y,L),H=W&&Lp.exec(W);return H?ne(H[0]):void 0}function Zt(r,y){let L=[],W="start"in y&&typeof y.start==="number"?y.start:void 0,H=(J)=>y.params.length===1?"arg":`arg${J}`;for(let[J,U]of y.params.entries()){let te=_p(r,W,U.start);W=U.end;let K=U.type==="TSParameterProperty"?U.parameter:U;if(K.type==="RestElement"){ln(r,K.typeAnnotation?.typeAnnotation),L.push({name:K.argument.type==="Identifier"?K.argument.name:"rest",type:yn(r,K.typeAnnotation)??te,optional:!1,rest:!0});continue}let Ee=K.type==="AssignmentPattern",Se=Ee?K.left:K,ve="typeAnnotation"in Se?Se.typeAnnotation:void 0;ln(r,ve?.typeAnnotation),L.push({name:Se.type==="Identifier"?Se.name:H(J),type:yn(r,ve)??te,optional:Ee||"optional"in K&&K.optional===!0,rest:!1})}ln(r,y.returnType?.typeAnnotation);for(let J of y.typeParameters?.params??[])ln(r,J.constraint),ln(r,J.default);return{params:L,returnType:yn(r,y.returnType),typeParameters:Fn(r,y.typeParameters)||void 0}}function zn(r,y,L="any"){let{params:W,returnType:H,typeParameters:J}=Zt(r,y),U=W.map(({name:K,type:Ee,optional:Se,rest:ve})=>ve?`...${K}: ${Ee??"any[]"}`:`${K}${Se?"?":""}: ${Ee??"any"}`),te=H!==void 0||J!==void 0||W.some((K)=>K.type!==void 0);return{signature:`${J??""}(${U.join(", ")}) => ${H??L}`,hasAnnotations:te}}function Qt(r){return r.length>0?r.slice():void 0}function Uo(r){let y=Qt(r.pendingCallDefaultCandidates),L=Qt(r.pendingConstDefaultCandidates.filter((te)=>te.location!=="props"||!r.explicitDefaultPropNames.has(te.propName))),W=Qt(r.pendingContextKeyCandidates),H=Qt(r.pendingDispatchEscapeCandidates);if(!y&&!L&&!W&&!H)return;let J=Qt(r.deferredEventNoSourceDiagnostics),U=H&&r.untypedJsDocEventNames.size>0?Array.from(r.untypedJsDocEventNames):void 0;return{...y?{pendingCallDefaultCandidates:y}:{},...L?{pendingConstDefaultCandidates:L}:{},...W?{pendingContextKeyCandidates:W}:{},...H?{pendingDispatchEscapeCandidates:H}:{},...J?{deferredEventNoSourceDiagnostics:J}:{},...U?{untypedJsDocEventNames:U}:{}}}function zo(r){let y=new Set,L=new Set;for(let K of r.additionalTypeDependencyNodes)An(r,K,y,L);for(let K of r.additionalImportedTypes.keys())y.add(K);let W=Array.from(r.localTypeDeclarationsByName.values()).filter((K)=>K.exported).sort((K,Ee)=>K.start-Ee.start);for(let K of W)An(r,K.node,y,L);let H=W.map((K)=>`export ${K.code}`),J=r.typedRunesPropsDeclarations.length===1?r.typedRunesPropsDeclarations[0]:void 0,U=J?.canonicalType;if(J&&U){for(let K of J.referencedImportedTypes)y.add(K);for(let K of J.referencedLocalTypes)L.add(K)}if(!U&&y.size===0&&L.size===0&&H.length===0)return;let te=Array.from(L).map((K)=>r.localTypeDeclarationsByName.get(K)).filter((K)=>K!==void 0&&!K.exported).sort((K,Ee)=>K.start-Ee.start).map((K)=>K.code);return{...U?{canonicalPropsType:U}:{},canonicalPropNames:J&&U?Array.from(J.props.keys()).sort():[],localTypeDeclarations:te,...H.length>0?{moduleTypeDeclarations:H}:{},typeImportStatements:kp(r,y)}}function Rp(r,y,L,W,H){for(let J of r){if(J.type!=="Block"||J.start<L||J.end>W)continue;H.push({start:J.start,end:J.end,isJsDoc:J.end-J.start>4&&y.startsWith("/**",J.start)})}}function Mp(r,y){for(let L of r){let{start:W}=L,H=L.type==="ExportNamedDeclaration"?L.declaration:L;if(H?.type==="FunctionDeclaration"){if(H.id?.name)y.push({name:H.id.name,start:W})}else if(H?.type==="VariableDeclaration"){for(let J of H.declarations)if(J.id.type==="Identifier"&&J.id.name)y.push({name:J.id.name,start:W})}}}function Ip(r,y,L){let W=0,H=r.length;while(W<H){let J=W+H>>>1;if(r[J].end<=y)W=J+1;else H=J}for(let J=W-1;J>=0;J--){let U=r[J];if(!U.isJsDoc)continue;return hi(L,U.end,y)?U:void 0}return}function Fp(r){let y=new Map;if(!r.source)return y;let L=[],W=[],H=r.parsed?.comments??[];for(let J of[r.parsed?.module,r.parsed?.instance]){let U=J?.content;if(!U)continue;Rp(H,r.source,U.start,U.end,L),Mp(U.body,W)}L.sort((J,U)=>J.end-U.end);for(let J of W){let U=Ip(L,J.start,r.source);if(!U)continue;let te=xi(r,r.source.slice(U.start,U.end)),{type:K,description:Ee,ignore:Se,internal:ve}=Nr(te);if(Se.length>0)kn(r,"context-any-type",J.name,Se);if(!K&&!Ee&&!ve)continue;y.set(J.name,{type:K?En(K.type):void 0,description:Ee||K&&Mo(K),internal:ve||void 0})}return y}function Xo(r,y){return r.variableInfoCache??=Fp(r),r.variableInfoCache.get(y)}function On(r,y){let L=ui(r,y);if(L?.type)return{type:L.type,description:L.description,internal:L.internal};let W=Xo(r,y),H=r.explicitVariableTypesByName.get(y);if(H)return{type:H,description:W?.description,internal:W?.internal};if(!W?.type)return null;return{type:W.type,description:W.description,internal:W.internal}}function Bn(r,y){let L=On(r,y);if(L&&L.type===r.explicitVariableTypesByName.get(y))ln(r,r.explicitVariableTypeNodesByName.get(y));return L}function vi(r,y){let L=Xo(r,y);return{...L?.description?{description:L.description}:{},...L?.internal?{internal:!0}:{}}}function Tn(r,y){for(let W of r.vars)if(W.declarations.some((H)=>H.id.type==="Identifier"&&H.id.name===y))return qo(r,W);let L=r.funcDecls.get(y);return L&&qo(r,L)}function qo(r,y){let L=pn(r,y);if(L)return L;for(let W of[r.parsed?.instance,r.parsed?.module])for(let H of W?.content.body??[])if(H.type==="ExportNamedDeclaration"&&H.declaration===y)return pn(r,H);return}var Op=/\w/,Bp=/^readonly\s+/;function Di(r,y){let L=r.trim();if(!L.startsWith("{")||!L.endsWith("}"))return;let W=i(L.slice(1,-1),";,").map((H)=>H.trim().replace(Bp,""));for(let H of W){if(!H.startsWith(y))continue;let J=H.slice(y.length);if(Op.test(J.charAt(0)))continue;let U=J.trimStart(),te=U.startsWith("?");if(te)U=U.slice(1).trimStart();if(!U.startsWith(":"))continue;let K=U.slice(1).trim();return te?`${K} | undefined`:K}return}function Ko(r,y){if(y.computed||y.object.type!=="Identifier"||y.property.type!=="Identifier")return;let L=y.object.name,W=y.property.name;if(r.wholePropsLocals.has(L))return jt(r,W);let H=jt(r,L)??On(r,L)?.type;if(!H)return;return Di(H,W)}function er(r,y,L){if(!y)return;br(r,y);let W=r.props.get(y);r.props.set(y,W?{...W,...L}:L)}function wr(r,y,L,W){if(y.pendingCallDefault)r.pendingCallDefaultCandidates.push({propName:L,location:W,...y.pendingCallDefault});if(y.pendingConstDefault)r.pendingConstDefaultCandidates.push({propName:L,location:W,...y.pendingConstDefault})}var $p=new Map([["Date","Date"],["Map","Map<any, any>"],["Set","Set<any>"],["WeakMap","WeakMap<object, any>"],["WeakSet","WeakSet<object>"],["Array","any[]"],["RegExp","RegExp"],["Regexp","RegExp"],["Error","Error"]]);function Sn(r,y,L=0){let W=Wp(r,y,L),H=y&&typeof y==="object"?ts(r,y):void 0;return H===void 0?W:{...W,type:H}}var Gp=/^\s*\(\s*$/;function ts(r,y){let{constAssertions:L,typeAssertions:W}=r.typeCasts;if(L.has(y))return xn(y,"const");let H=W.get(y);if(H)return ln(r,H),gn(r,H);return Vp(r,y)}function Vp(r,y){let L="start"in y&&typeof y.start==="number"?y.start:void 0;if(L===void 0)return;let W=r.parsed?.comments.findLast((H)=>H.end<=L);if(W?.type!=="Block"||!W.value.startsWith("*"))return;if(!Gp.test(cn(r,W.end,L)??""))return;return ne(W.value)}function jp(r){return n(r)&&"type"in r}function nr(r){return jp(r)?r:void 0}function Wp(r,y,L){let W=nr(y);if(!W)return{value:void 0,type:void 0,isFunction:!1};let H=ns(r,W),J=(U,te)=>({value:U,type:te,isFunction:!1,defaultValue:H});switch(W.type){case"ObjectExpression":case"ArrayExpression":return J(Ln(r,W),xn(W,"widen"));case"BinaryExpression":return J(Ln(r,W),mn(r,W,L));case"ArrowFunctionExpression":case"FunctionExpression":return{...J(es(r,W),os(r,W)),isFunction:!0};case"UnaryExpression":return J(Ln(r,W),mn(r,W,L));case"LogicalExpression":case"ConditionalExpression":case"SequenceExpression":{let U=Ln(r,W),te=U!==void 0&&W.type==="SequenceExpression"?`(${U})`:U;return J(te,mn(r,W,L))}case"NewExpression":{let{callee:U}=W,te=t(U)?$p.get(U.name)??U.name:void 0;return J(wn(r,W),te)}case"CallExpression":return Hp(r,W,H,L);case"Identifier":{let{name:U}=W;if(L<5){let te=ir(r,U);if(te){let Ee=Sn(r,Xp(te),L+1),Se=Tn(r,U);return{...Ee,resolvedType:Se?.type??Ee.resolvedType,resolvedDescription:Se?.description??Ee.resolvedDescription,resolvedParams:Se?.params??Ee.resolvedParams,resolvedReturnType:Se?.returnType??Ee.resolvedReturnType}}let K=r.funcDecls.get(U);if(K){let Ee=Tn(r,U);return{value:es(r,K),type:void 0,isFunction:!0,defaultValue:ns(r,K),resolvedType:Ee?.type??is(r,Ee,K),resolvedDescription:Ee?.description,resolvedParams:Ee?.params,resolvedReturnType:Ee?.returnType}}}return Yo(J(wn(r,W)),r.valueImportBindingsByLocalName.get(U))}case"MemberExpression":return Yo(J(wn(r,W),sc(W)?"number":void 0),le(r,W));case"TemplateLiteral":return J(wn(r,W),"string");case"Literal":return typeof W.raw==="string"?J(W.raw,$n(W)):J(void 0);case"AssignmentExpression":case"AwaitExpression":case"ChainExpression":case"ClassExpression":case"ImportExpression":case"MetaProperty":case"TaggedTemplateExpression":case"ThisExpression":case"TSAsExpression":case"TSInstantiationExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"UpdateExpression":case"YieldExpression":break}return J(void 0)}function Yo(r,y){if(!y)return r;let{source:L,importedName:W,members:H}=y;return{...r,pendingConstDefault:{importSource:L,importedName:W,...H?{members:H}:{}}}}function Hp(r,y,L,W){let H=wn(r,y),{callee:J}=y,U=t(J)?J.name:void 0;if((U==="$derived"||U==="$state")&&y.arguments.length===1&&W<5)return{...Sn(r,y.arguments[0],W+1),value:H,defaultValue:L};let te={value:H,type:void 0,isFunction:!1,defaultValue:L};if(U){let K=Kp(r,U);if(K?.declared)return{...te,resolvedType:K.type};if(K)return{...te,type:K.type};if(r.funcDecls.has(U)||rs(r,U))return{...te,pendingCallDefault:{calleeName:U}};let Ee=r.valueImportBindingsByLocalName.get(U);if(Ee)return{...te,pendingCallDefault:{calleeName:U,importSource:Ee.source,importedName:Ee.importedName}}}return{...te,pendingCallDefault:{calleeName:U??wn(r,J)??"call"}}}function $n(r){if("regex"in r&&r.regex)return"RegExp";if("bigint"in r&&r.bigint)return"bigint";return r.value==null?void 0:typeof r.value}var Jp=new Set(["-","*","/","%","**","<<",">>",">>>","&","|","^"]),Up=new Set(["==","!=","===","!==","<","<=",">",">=","in","instanceof"]);function mn(r,y,L){let W=nr(y);if(!W)return;switch(W.type){case"UnaryExpression":{let{operator:J,argument:U}=W;if(J==="!"||J==="delete")return"boolean";if(J==="typeof")return"string";if(J==="void")return;if(J==="+")return"number";return mn(r,U,L)==="bigint"?"bigint":"number"}case"BinaryExpression":{let{operator:J}=W;if(Up.has(J))return"boolean";let U=mn(r,W.left,L),te=mn(r,W.right,L);if(U==="bigint"&&te==="bigint")return"bigint";if(Jp.has(J))return"number";if(J!=="+")return;if(U==="string"||te==="string")return"string";if(U==="number"&&te==="number")return"number";return}case"LogicalExpression":return Qo([mn(r,W.left,L),mn(r,W.right,L)]);case"ConditionalExpression":return Qo([mn(r,W.consequent,L),mn(r,W.alternate,L)]);case"SequenceExpression":return mn(r,W.expressions[W.expressions.length-1],L);case"Identifier":{let{name:J}=W;if(J==="NaN"||J==="Infinity")return"number";if(J==="undefined")return;let U=On(r,J)?.type;if(U)return U;if(L>=5)return;return mn(r,ir(r,J),L+1)}case"ArrayExpression":case"ArrowFunctionExpression":case"AssignmentExpression":case"AwaitExpression":case"CallExpression":case"ChainExpression":case"ClassExpression":case"FunctionExpression":case"ImportExpression":case"Literal":case"MemberExpression":case"MetaProperty":case"NewExpression":case"ObjectExpression":case"TaggedTemplateExpression":case"TemplateLiteral":case"ThisExpression":case"TSAsExpression":case"TSInstantiationExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"UpdateExpression":case"YieldExpression":break}if(L>=5)return;let H=Sn(r,W,L+1);return H.type??H.resolvedType}function Qo(r){let y=new Set;for(let L of r){if(L===void 0)return;y.add(L.includes("=>")?`(${L})`:L)}return y.size===1?r[0]:[...y].join(" | ")}function xn(r,y){let L=nr(r),W=y==="widen";switch(L?.type){case"Literal":if("regex"in L&&L.regex)return"RegExp";if(L.value===null)return"null";return W?$n(L):L.raw??void 0;case"TemplateLiteral":if(L.expressions.length>0)return;return W?"string":`\`${L.quasis[0]?.value.raw??""}\``;case"Identifier":return L.name==="undefined"?"undefined":void 0;case"UnaryExpression":{let{operator:H,argument:J}=L;if(H!=="-"||J.type!=="Literal")return;let U=$n(J);if(U!=="number"&&U!=="bigint")return;return W?U:`-${J.raw}`}case"ArrayExpression":{let H=[];for(let te of L.elements){let K=te===null?void 0:xn(te,y);if(K===void 0)return;H.push(K)}if(y==="literal")return`[${H.join(", ")}]`;if(y==="const")return`readonly [${H.join(", ")}]`;let J=new Set(H);if(J.size===0)return"any[]";let U=[...J].join(" | ");return J.size===1?`${U}[]`:`(${U})[]`}case"ObjectExpression":{let H=new Map;for(let U of L.properties){if(U.type!=="Property"||U.kind!=="init"||U.computed||U.method||U.shorthand)return;let{key:te}=U,K=te.type==="Identifier"?te.name:te.type==="Literal"?te.raw:void 0,Ee=xn(U.value,y);if(K===void 0||Ee===void 0)return;H.delete(K),H.set(K,Ee)}if(H.size===0)return"{}";let J=y==="const"?"readonly ":"";return`{ ${[...H].map(([U,te])=>`${J}${U}: ${te}`).join("; ")} }`}case"ArrowFunctionExpression":case"AssignmentExpression":case"AwaitExpression":case"BinaryExpression":case"CallExpression":case"ChainExpression":case"ClassExpression":case"ConditionalExpression":case"FunctionExpression":case"ImportExpression":case"LogicalExpression":case"MemberExpression":case"MetaProperty":case"NewExpression":case"SequenceExpression":case"TaggedTemplateExpression":case"ThisExpression":case"TSAsExpression":case"TSInstantiationExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"UpdateExpression":case"YieldExpression":case void 0:break}return}function tr(r,y,L=!1){let W=ir(r,y);if(W===void 0){let J=r.funcDecls.get(y);return J&&Zo(r,y,J,L)}if(W.type==="ArrowFunctionExpression"||W.type==="FunctionExpression")return ts(r,W)??Zo(r,y,W,L);if(W.type==="CallExpression"){let J=rr(r,W);if(J)return J;let U=gn(r,W.callee);if(U==="$state"||U==="$state.raw"||U==="$derived"){let te=W.typeArguments?.params[0];if(te)return ln(r,te),gn(r,te);if(U==="$state.raw")return Sn(r,W.arguments[0],1).type}}let H=Sn(r,W);return H.type??H.resolvedType}function Zo(r,y,L,W){let H=W?or(L):sr(L),J=zn(r,L,H);if(J.hasAnnotations)return J.signature;let U=Tn(r,y);if(U?.type)return U.type;return W?Ai(U,L)??Xn(r,L):is(r,U,L)}var zp=new Map([["writable","Writable"],["readable","Readable"],["derived","Readable"],["readonly","Readable"]]),qp=/^(?:import\("svelte\/store"\)\.)?(?:Writable|Readable)<([\s\S]*)>$/;function rr(r,y){let L=t(y.callee)?r.valueImportBindingsByLocalName.get(y.callee.name):void 0,W=L?.source==="svelte/store"?zp.get(L.importedName):void 0;if(!W)return;let H=L?.importedName==="derived",J=y.typeArguments?.params[H?1:0],U;if(J)ln(r,J),U=gn(r,J);else if(L?.importedName==="readonly"){let[te]=y.arguments;U=(t(te)?Bn(r,te.name)?.type??tr(r,te.name):te?.type==="CallExpression"?rr(r,te):void 0)?.trim().match(qp)?.[1]}else if(H){let te=y.arguments[1];U=(te?.type==="ArrowFunctionExpression"||te?.type==="FunctionExpression")&&te.params.length<2?sr(te):void 0}else{let[te]=y.arguments;U=(t(te)?Bn(r,te.name)?.type:void 0)??mn(r,te,0)}return`import("svelte/store").${W}<${U??"any"}>`}function Xp(r){if(r.type!=="CallExpression"||r.arguments.length!==1)return r;let[y]=r.arguments;if(y.type==="SpreadElement")return r;let{callee:L}=r;return L.type==="Identifier"&&(L.name==="$state"||L.name==="$derived")||L.type==="MemberExpression"&&t(L.object)&&L.object.name==="$state"&&t(L.property)&&L.property.name==="raw"?y:r}function ir(r,y,L=!1){for(let W of r.vars){if(L&&W.kind!=="const")continue;for(let H of W.declarations)if(t(H.id)&&H.id.name===y&&H.init)return H.init}return}function qn(r,y){return ir(r,y,!0)}function Kp(r,y){let L=Tn(r,y);if(L?.returnType)return{type:L.returnType,declared:!0};let W=r.funcDecls.get(y)??rs(r,y);if(!W)return;let H=Qp(r,W)??Yp(r,y);if(H)return{type:H,declared:!0};let J=sr(W);return J==="any"?void 0:{type:J,declared:!1}}function rs(r,y){let L=ir(r,y);return L?.type==="ArrowFunctionExpression"||L?.type==="FunctionExpression"?L:void 0}function Yp(r,y){for(let L of r.vars)for(let W of L.declarations){let H=W.id;if(!t(H)||H.name!==y)continue;let J=H.typeAnnotation?.typeAnnotation;if(!J)return;return ie(cn(r,J.start,J.end))}return}function Qp(r,y){let L=y.returnType?.typeAnnotation;return L&&cn(r,L.start,L.end)}function is(r,y,L){let W=y?.returnType??"any",H=y?.params;if(H&&H.length>0)return`(${h(H)}) => ${W}`;if(y?.returnType)return`() => ${W}`;return os(r,L)}function os(r,y){let L=sr(y),W=zn(r,y,L);if(W.hasAnnotations)return W.signature;return`(${Zp(y)}) => ${L}`}function Zp({params:r}){let y=[];for(let L of r){if(!t(L))return"...args: any[]";y.push(`${L.name}: any`)}return y.length>0?y.join(", "):"...args: any[]"}function Xn(r,y){let L=or(y),W=zn(r,y,L);if(W.hasAnnotations)return W.signature;return`(${ss(y)}) => ${L}`}function ss(r){let y=(W)=>r.params.length===1?"arg":`arg${W}`;return r.params.map((W,H)=>{if(W.type==="RestElement")return`...${t(W.argument)?W.argument.name:"args"}: any[]`;if(W.type==="AssignmentPattern")return`${t(W.left)?W.left.name:y(H)}?: any`;return`${t(W)?W.name:y(H)}: any`}).join(", ")}function Ai(r,y){if(!r?.params?.length&&!r?.returnType)return;return`(${r.params?.length?h(r.params):ss(y)}) => ${r.returnType??or(y)}`}function or(r){return ec(r)?r.async?"Promise<void>":"void":sr(r)}function ec(r){return!r.generator&&r.body.type==="BlockStatement"&&Y(r.body).every((y)=>y===null)}function sr(r){if(r.async||r.generator)return"any";let{body:y}=r,L=y.type==="BlockStatement"?Y(y):[y],W=new Set(L.map(nc)),[H]=W;return W.size===1&&H?H:"any"}function nc(r){let y=nr(r);switch(y?.type){case"Literal":{let{value:L}=y;if(typeof L==="string")return"string";if(typeof L==="number")return"number";if(typeof L==="boolean")return"boolean";return null}case"TemplateLiteral":return"string";case"CallExpression":{let{callee:L}=y;if(!t(L))return null;if(L.name==="String")return"string";if(L.name==="Number")return"number";if(L.name==="Boolean")return"boolean";return null}case"ArrayExpression":case"ArrowFunctionExpression":case"AssignmentExpression":case"AwaitExpression":case"BinaryExpression":case"ChainExpression":case"ClassExpression":case"ConditionalExpression":case"FunctionExpression":case"Identifier":case"ImportExpression":case"LogicalExpression":case"MemberExpression":case"MetaProperty":case"NewExpression":case"ObjectExpression":case"SequenceExpression":case"TaggedTemplateExpression":case"ThisExpression":case"TSAsExpression":case"TSInstantiationExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"UnaryExpression":case"UpdateExpression":case"YieldExpression":case void 0:break}return null}function tc(r,{params:y}){if(y.length===0)return"";return cn(r,y[0].start,y[y.length-1].end)??""}function es(r,y){if(y.generator)return;let{body:L}=y,W=tc(r,y),H=y.async?"async ":"",J=(K,Ee)=>K.type==="ObjectExpression"?`(${Ee})`:Ee;if(L.type!=="BlockStatement"){let K=Ln(r,L);return K===void 0?void 0:`${H}(${W}) => ${J(L,K)}`}let U=L.body;if(U.length===0)return`${H}(${W}) => {}`;let[te]=U;if(U.length===1&&te.type==="ReturnStatement"&&te.argument){let K=Ln(r,te.argument);if(K!==void 0)return`${H}(${W}) => ${J(te.argument,K)}`}return}function rc(r){switch(r.type){case"Literal":case"UnaryExpression":return"literal";case"TemplateLiteral":return r.expressions.length===0?"literal":"expression";case"ArrayExpression":return"array";case"ObjectExpression":return"object";case"ArrowFunctionExpression":case"FunctionExpression":case"FunctionDeclaration":return"function";case"AssignmentExpression":case"AwaitExpression":case"BinaryExpression":case"CallExpression":case"ChainExpression":case"ClassExpression":case"ConditionalExpression":case"Identifier":case"ImportExpression":case"LogicalExpression":case"MemberExpression":case"MetaProperty":case"NewExpression":case"SequenceExpression":case"TaggedTemplateExpression":case"ThisExpression":case"TSAsExpression":case"TSInstantiationExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"UpdateExpression":case"YieldExpression":break}return"expression"}function ns(r,y){let L=Ln(r,y);if(!L)return;let W=rc(y);if(W!=="literal"&&W!=="array"&&W!=="object")return{raw:L,kind:W};let H=Pi(y);if(H.ok)return{raw:L,kind:W,value:H.value};return{raw:L,kind:y.type==="UnaryExpression"?"expression":W}}function Pi(r){let y=nr(r);switch(y?.type){case"Literal":return typeof y.value==="bigint"||"regex"in y?{ok:!1}:{ok:!0,value:y.value};case"UnaryExpression":{let{operator:L,argument:W}=y;if(W.type!=="Literal")return{ok:!1};let{value:H}=W;if(typeof H==="number"){if(L==="-")return{ok:!0,value:-H};if(L==="+")return{ok:!0,value:H}}if(typeof H==="boolean"&&L==="!")return{ok:!0,value:!H};return{ok:!1}}case"TemplateLiteral":{let{expressions:L,quasis:W}=y;if(L.length>0||W.length!==1)return{ok:!1};return{ok:!0,value:W[0].value.cooked??W[0].value.raw}}case"ArrayExpression":{let L=[];for(let W of y.elements){if(!W)return{ok:!1};let H=Pi(W);if(!H.ok)return{ok:!1};L.push(H.value)}return{ok:!0,value:L}}case"ObjectExpression":{let L={};for(let W of y.properties){if(W.type!=="Property"||W.computed)return{ok:!1};let H=p(W.key);if(!H)return{ok:!1};let J=Pi(W.value);if(!J.ok)return{ok:!1};L[H]=J.value}return{ok:!0,value:L}}case"ArrowFunctionExpression":case"AssignmentExpression":case"AwaitExpression":case"BinaryExpression":case"CallExpression":case"ChainExpression":case"ClassExpression":case"ConditionalExpression":case"FunctionExpression":case"Identifier":case"ImportExpression":case"LogicalExpression":case"MemberExpression":case"MetaProperty":case"NewExpression":case"SequenceExpression":case"TaggedTemplateExpression":case"ThisExpression":case"TSAsExpression":case"TSInstantiationExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"UpdateExpression":case"YieldExpression":case void 0:break}return{ok:!1}}var ic=new Set(["POSITIVE_INFINITY","NEGATIVE_INFINITY","MAX_VALUE","MIN_VALUE","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","EPSILON","NaN"]),oc=new Set(["PI","E","LN2","LN10","LOG2E","LOG10E","SQRT2","SQRT1_2"]);function sc({object:r,property:y}){if(!t(r)||!t(y))return!1;if(r.name==="Number")return ic.has(y.name);if(r.name==="Math")return oc.has(y.name);return!1}function ar(r,y,L){if(!y||r.has(y))return;r.set(y,L)}function Lr(r,y){for(let L=r.activeScopes.length-1;L>=0;L-=1){let W=r.activeScopes[L]?.get(y);if(!W)continue;return W.kind==="prop"?W.publicPropName:void 0}return}function Gn(r,y){for(let L=r.activeScopes.length-1;L>=0;L-=1){let W=r.activeScopes[L];if(W===r.componentScope)return!1;if(W?.has(y))return!0}return!1}function _r(r,y){let L=y;while(A(L))L=L.object;return t(L)&&Gn(r,L.name)}function un(r,y=new Set){if(r)for(let L of be(r))y.add(L.name);return y}function Ni(r,y){if(!y||typeof y!=="object"||!("type"in y))return;if(y.type==="Identifier"){let L=Lr(r,y.name);if(L)r.reactive_vars.add(L);return}if(y.type!=="ObjectPattern"&&y.type!=="ArrayPattern")return;for(let L of un(y)){let W=Lr(r,L);if(W)r.reactive_vars.add(W)}}function Yn(r){if(!r||typeof r!=="object"||!("type"in r))return!1;switch(String(r.type)){case"BlockStatement":case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"CatchClause":case"EachBlock":case"AwaitBlock":return!0;default:return!1}}function as(r){if(!r||typeof r!=="object"||!("type"in r))return!1;let y=String(r.type);return y==="FunctionDeclaration"||y==="FunctionExpression"||y==="ArrowFunctionExpression"}function ac(r){let y=[];if(r.id.type==="Identifier")return y.push({kind:"local",name:r.id.name}),y;if(r.id.type!=="ObjectPattern")return y;for(let L of r.id.properties){if(L.type==="RestElement"){if(L.argument.type==="Identifier")y.push({kind:"local",name:L.argument.name});continue}if(L.computed)continue;let W=p(L.key);if(!W)continue;let H=L.value.type==="AssignmentPattern"?L.value.left:L.value;if(H.type!=="Identifier"||!H.name)continue;y.push({kind:"prop",name:H.name,publicPropName:W})}return y}function ls(r,y,L,W){let H=r.kind==="var"?L:y;for(let J of r.declarations){if(W?.allowRunesProps&&m(J.init,"$props")){for(let U of ac(J))ar(U.kind==="prop"?y:L,U.name,U.kind==="prop"?{kind:"prop",publicPropName:U.publicPropName}:{kind:"local"});continue}for(let U of un(J.id))ar(H,U,W?.forceProp?{kind:"prop",publicPropName:U}:{kind:"local"})}}function Kn(r,...y){for(let L of y)for(let W of un(L))ar(r,W,{kind:"local"})}function ps(r,y,L,W){switch(r.type){case"VariableDeclaration":ls(r,y,L,W);break;case"FunctionDeclaration":case"ClassDeclaration":Kn(y,r.id);break;case"BlockStatement":case"BreakStatement":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExportAllDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":case"ExpressionStatement":case"ForInStatement":case"ForOfStatement":case"ForStatement":case"IfStatement":case"ImportDeclaration":case"LabeledStatement":case"ReturnStatement":case"StaticBlock":case"SwitchStatement":case"ThrowStatement":case"TryStatement":case"TSDeclareFunction":case"TSEnumDeclaration":case"TSExportAssignment":case"TSImportEqualsDeclaration":case"TSInterfaceDeclaration":case"TSModuleDeclaration":case"TSNamespaceExportDeclaration":case"TSTypeAliasDeclaration":case"WhileStatement":case"WithStatement":break}}function lc(r,y){for(let{local:L,exported:W}of y){if(L.type!=="Identifier")continue;let H=W.type==="Identifier"?W.name:String(W.value);if(r.componentScope.get(L.name)?.kind==="prop")continue;r.componentScope.set(L.name,{kind:"prop",publicPropName:H})}}function pc(r,y){let L=r.componentScope;for(let W of y?.content.body??[])if(W.type==="ImportDeclaration")Kn(L,...W.specifiers.map((H)=>H.local));else if(W.type!=="ExportNamedDeclaration")ps(W,L,L,{allowRunesProps:!0});else if(!W.declaration){if(W.source==null)lc(r,W.specifiers)}else if(W.declaration.type==="VariableDeclaration")ls(W.declaration,L,L,{forceProp:!0});else if(W.declaration.type==="FunctionDeclaration"&&W.declaration.id?.name){let{name:H}=W.declaration.id;ar(L,H,{kind:"prop",publicPropName:H})}}function cs(r){r.componentScope.clear(),r.activeScopes.length=0,pc(r,r.parsed?.instance)}function ds(r){return{varScopeStack:[r.componentScope]}}function us(r,y,L){if(!Yn(L))return;let W=new Map,H=y.varScopeStack[y.varScopeStack.length-1]??r.componentScope;switch(L.type){case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":Kn(W,L.id,...L.params.map((J)=>J.type==="TSParameterProperty"?J.parameter:J));break;case"BlockStatement":for(let J of L.body)ps(J,W,H);break;case"CatchClause":Kn(W,L.param);break;case"EachBlock":if(Kn(W,L.context),typeof L.index==="string")ar(W,L.index,{kind:"local"});break;case"AwaitBlock":Kn(W,L.value,L.error);break}if(as(L))y.varScopeStack.push(W);return W}function fs(r,y){if(as(y))r.varScopeStack.pop()}function lr(r,y,L=!0){let W=Bn(r,y);if(W||!L)return W;let H=tr(r,y,!0);if(!H)return null;let J=!Tn(r,y)?.params?.length;return{type:H,...vi(r,y),inferred:J}}var cc=/\bany\b/;function ki(r,y,L,W,H,J){if(H==="any"||!cc.test(H))return;en(r,"context-any-type",L,`Context "${y}" ${W} is inferred as "${H}"; annotate it to replace "any".`,Ve(r,J))}function dc(r,y,L){if(!t(y))return null;let W=qn(r,y.name);if(c(W))return Ss(r,W,L).properties;let H=lr(r,y.name);return H?d(H.type):null}function uc(r,y){return r.properties.some((L)=>L.type==="Property"&&L.kind==="get"&&p(L.key)===y)}function ms(r,y,L){if(!n(y)||!(L in y))return;let W=y[L];if(!W||typeof W!=="object"||!("typeAnnotation"in W))return;return gn(r,W.typeAnnotation)}function fc(r){let y=r?.body.body;if(y?.length!==1||y[0].type!=="ReturnStatement")return;return y[0].argument??void 0}function mc(r,y,L,W,H){let J=()=>(en(r,"context-any-type",L,`Context "${y}" property "${L}" has no type annotation; defaulted to "any".`,Ve(r,W)),{type:"any"});if(t(H))return lr(r,H.name)??J();if(H?.type==="ArrowFunctionExpression"||H?.type==="FunctionExpression")return{type:Xn(r,H),inferred:!0};if(C(H))return{type:$n(H)??"null"};if(H?.type==="MemberExpression"&&!H.computed&&t(H.object)&&t(H.property)){let Ee=lr(r,H.object.name)?.type,Se=Ee&&Di(Ee,H.property.name);if(Se)return{type:Se}}if(H===void 0)return{type:"any"};let U=H.type==="CallExpression"?rr(r,H):void 0;if(U)return{type:U,inferred:!0};let te=Sn(r,H),K=te.type??te.resolvedType;return K?{type:K,inferred:!0}:J()}function Ss(r,y,L){let W=[],H=!1;for(let J of y.properties){if(J.type==="SpreadElement"){let Me=dc(r,J.argument,L);if(Me)W.push(...Me);else H=!0,en(r,"spread-unresolved",L,`Context "${L}" spreads a value sveld can't resolve; its shape is widened to "Record<string, any>".`,Ve(r,J));continue}if(J.type!=="Property")continue;let U=p(J.key);if(!U)continue;if(J.kind==="set"&&uc(y,U))continue;let te=(J.kind==="get"||J.kind==="set")&&J.value.type==="FunctionExpression"?J.value:void 0,K=pn(r,J),Ee=!te&&(J.value.type==="ArrowFunctionExpression"||J.value.type==="FunctionExpression")?J.value:void 0,Se=!K?.type&&Ee?Ai(K,Ee):void 0,ve=te?J.kind==="get"?ms(r,te,"returnType"):ms(r,te.params[0],"typeAnnotation"):K?.type??Se,Le=ve?{type:ve,description:K?.description,inferred:Se!==void 0&&!K?.params?.length}:mc(r,L,U,J,J.kind==="get"?fc(te):J.kind==="set"?void 0:J.value);if(Le.inferred)ki(r,L,U,`property "${U}"`,Le.type,J);W.push({name:U,type:Le.type,description:Le.description||K?.description||void 0,optional:!1,...Le.internal?{internal:!0}:{}})}return{properties:W,hasUnresolvedSpread:H}}function gs(r,y,L){let{properties:W,hasUnresolvedSpread:H}=Ss(r,y,L);return{key:L,typeName:Q(L),properties:W,description:void 0,...H?{hasUnresolvedSpread:H}:{}}}function ys(r,y,L){if(c(y))return gs(r,y,L);let W=Q(L),H=(Ee)=>({key:L,typeName:W,type:Ee,properties:[]});if(y.type==="CallExpression"){let Ee=rr(r,y);if(Ee)ki(r,L,L,"value",Ee,y);return Ee?H(Ee):null}if(y.type==="Literal"&&y.value===null&&y.raw==="null")return H("null");if(t(y)&&y.name==="undefined")return H("undefined");if(!t(y))return null;let J=y.name,U=lr(r,J,!1),te=U?void 0:qn(r,J);if(c(te)){let{internal:Ee}=vi(r,J);return{...gs(r,te,L),...Ee?{internal:Ee}:{}}}let K=U??lr(r,J);if(K){if(K.inferred)ki(r,L,J,`variable "${J}"`,K.type,y);let Ee=d(K.type);return{key:L,typeName:W,...Ee?{}:{type:K.type},properties:Ee??[],description:K.description||void 0,...K.internal?{internal:!0}:{}}}return en(r,"context-any-type",J,`Context "${L}" variable "${J}" has no type annotation; defaulted to "any".`,Ve(r,y)),H("any")}function hs(r){let y=r.callee,L=y.type==="Identifier"&&y.name==="Symbol",W=y.type==="MemberExpression"&&!y.computed&&y.object.type==="Identifier"&&y.object.name==="Symbol"&&y.property.type==="Identifier"&&y.property.name==="for";if(!L&&!W)return null;let H=r.arguments[0];if(H?.type==="Literal"&&typeof H.value==="string")return H.value;if(H?.type==="TemplateLiteral"&&H.quasis.length===1)return H.quasis[0].value.cooked??"";return""}function Es(r){return{kind:"pending",importSource:r.source,importedName:r.importedName,...r.members?{members:r.members}:{}}}function xs(r,y,L=0){if(!y)return{kind:"unresolved"};if(y.type==="Literal"||y.type==="TemplateLiteral"){let W=w(y);return W==null?{kind:"unresolved"}:{kind:"resolved",key:W}}if(y.type==="CallExpression"||y.type==="NewExpression"){let W=hs(y);return W==null?{kind:"unresolved"}:{kind:"resolved",key:W}}if(y.type==="Identifier"){if(L>=5)return{kind:"unresolved"};let W=qn(r,y.name);if(W){if((W.type==="CallExpression"||W.type==="NewExpression")&&hs(W)==="")return{kind:"resolved",key:y.name};return xs(r,W,L+1)}let H=L===0&&Gn(r,y.name)?void 0:r.valueImportBindingsByLocalName.get(y.name);return H?Es(H):{kind:"unresolved"}}if(y.type==="MemberExpression"){let W=L===0&&_r(r,y)?void 0:le(r,y);if(W)return Es(W)}return{kind:"unresolved"}}function Ts(r,y,L,W,H){let J=gn(r,W)??"";en(r,"context-value-unresolved",y,`setContext(${L}, ${J}): the value isn't an object literal or a variable, so sveld can't describe its shape; the context is skipped.`,H)}function Cs(r,y,L){let W=y.arguments[0];if(!W)return;let H=xs(r,W);if(H.kind==="unresolved"||H.kind==="resolved"&&!H.key){let Se=gn(r,W)??"";en(r,"context-key-unresolved",Se,`setContext key \`${Se}\` isn't a string literal, const-bound string, Symbol(), or imported \`export const\` string; the context is skipped.`,Ve(r,y));return}let J=y.arguments[1];if(!J)return;let U=Ve(r,y),te=pn(r,L)?.internal===!0;if(H.kind==="pending"){let Se=pe(H),ve=ys(r,J,Se);if(ve)r.pendingContextKeyCandidates.push({importSource:H.importSource,importedName:H.importedName,...H.members?{members:H.members}:{},...ve.type===void 0?{}:{type:ve.type},properties:ve.properties,description:ve.description,...ve.hasUnresolvedSpread?{hasUnresolvedSpread:!0}:{},...ve.internal||te?{internal:!0}:{},source:U});else Ts(r,Se,Se,J,U);return}let K=H.key,Ee=ys(r,J,K);if(!Ee){Ts(r,K,JSON.stringify(K),J,U);return}if(r.contexts.has(K)){en(r,"context-duplicate-key",K,`setContext("${K}", ...) was called more than once; only the first call's shape is used.`,U);return}r.contexts.set(K,{...Ee,...te?{internal:!0}:{},source:U})}var gc=/\n/g,yc=/^[A-Za-z_$][\w$]*$/;function bs(r){return n(r)&&r.type==="ArrayExpression"&&Array.isArray(r.elements)}function wi(r,y){return{variableType:(L)=>{if(y?.has(L))return;return Bn(r,L)?.type??tr(r,L)}}}function pr(r,y,L){if(!y||typeof y!=="object"||!("type"in y))return L;if(t(y)){if(!Gn(r,y.name))return L;let H=L??new Set;return H.add(y.name),H}let W=L;if(c(y)){for(let H of y.properties)if(H.type==="Property")W=pr(r,H.value,W)}else if(bs(y))for(let H of y.elements)W=pr(r,H,W);return W}function vs(r,y){if(t(y))return r.variableType(y.name);return Wt(r,y)}function Wt(r,y){if(!y||typeof y!=="object"||!("type"in y))return;if(c(y))return hc(r,y);if(bs(y))return Ec(r,y);return}function Ds(r,y){return vs(r,y)??(C(y)?$n(y)??"null":"any")}function Li(r,y){if(C(y)&&y.raw==="null")return"null";let L=vs(r,y);if(L!==void 0)return L;let W=C(y)?y.value:void 0;return W==null?"":Ht(W)}function hc(r,y){if(y.properties.length===0)return"Record<string, never>";let L=[],W=!1;for(let H of y.properties){let J=H.type==="Property"&&!H.computed?p(H.key):void 0;if(H.type!=="Property"||!J){W=!0;continue}L.push({name:J,type:Ds(r,H.value)})}if(!W)return cr(L);if(L.length===0)return"Record<string, any>";return cr([...L,{name:"[key: string]",type:"any"}])}function Ec(r,y){let L=new Set(y.elements.filter((W)=>W!=null).map((W)=>Ds(r,W)));if(L.size===0)return"any[]";if(L.size===1)return`${[...L][0]}[]`;return`(${[...L].join(" | ")})[]`}function Ps(r,y){for(let[L,W]of r.arguments.entries()){if(t(W)&&W.name===y)return{argumentIndex:L};if(!c(W))continue;for(let H of W.properties){if(H.type!=="Property"||!t(H.value))continue;if(H.value.name!==y)continue;let J=!H.computed&&t(H.key)?H.key.name:void 0;return{argumentIndex:L,property:J??""}}}return}function Ht(r){return typeof r==="string"?JSON.stringify(r):String(r)}function _n(r,{name:y,detail:L,has_argument:W,description:H,deprecated:J,tags:U,internal:te,source:K}){let Ee=!W&&!L?"null":L||void 0,Se=r.events.get(y);if(Se?.type==="forwarded")r.events.set(y,{type:"dispatched",name:y,detail:Ee,description:H||Se.description,deprecated:J??Se.deprecated,tags:U??Se.tags,...te||Se.internal?{internal:!0}:{},source:K||Se.source});else if(Se){let ve=r.untypedJsDocEventNames.delete(y);r.events.set(y,{...Se,detail:Se.detail===void 0||ve?Ee:Se.detail,description:Se.description||H,deprecated:Se.deprecated??J,tags:Se.tags??U,...Se.internal||te?{internal:!0}:{},source:K||Se.source})}else r.events.set(y,{type:"dispatched",name:y,detail:Ee,description:H,deprecated:J,tags:U,...te?{internal:!0}:{},source:K})}function As(r,y){let L=y.arguments[0],W=Pe(L,"CustomEvent");if(!W&&!Pe(L,"Event"))return;let H=L.arguments[0],J=C(H)?H.value:void 0;if(J==null)return;let U=W?L.arguments[1]:void 0,te=!1,K;if(c(U)){let Ee=U.properties.find((Se)=>Se.type==="Property"&&t(Se.key)&&Se.key.name==="detail");if(Ee?.type==="Property")te=!0,K=Ee.value}return{name:String(J),detail:K,hasArgument:te,nestedBoundNames:pr(r,K),source:Ve(r,y)}}function Ns(r,y){_n(r,{name:y.name,detail:Li(wi(r,y.nestedBoundNames),y.detail),has_argument:y.hasArgument,source:y.source})}function cr(r,y=!1){if(r.length===0)return"null";let L=r.map(({name:W,type:H,description:J,optional:U,default:te})=>{let K=U?"?":"",Ee=yc.test(W)||W.startsWith("[")?W:JSON.stringify(W),Se=te?`@default ${te}`:"",ve=j(J&&Se?`${J} ${Se}`:J||Se);if(ve){if(y)return`${ve.includes(`
20
20
  `)?`/**
21
21
  ${ve.split(`
22
22
  `).map((Me)=>Me?` * ${Me}`:" *").join(`
@@ -25,16 +25,16 @@ ${ve.split(`
25
25
  ${Ee}${K}: ${H};`;return`/** ${ve.replace(gc," ")} */ ${Ee}${K}: ${H};`}return`${Ee}${K}: ${H};`}).join(y?`
26
26
  `:" ");return y?`{
27
27
  ${L}
28
- }`:`{ ${L} }`}function Tc({hasTypeScriptType:r,hasJSDocType:y,inferredType:L,finalType:W}){if(r)return"typescript";if(y)return"jsdoc";if(L!==void 0)return"default";if(W!==void 0)return"inferred";return"unknown"}function dr(r){let y=r.explicitType??r.jsdocType??r.resolvedType??r.typeSeed,L=r.jsdocParams??r.resolvedParams,W=r.jsdocReturnType??r.resolvedReturnType;if((r.isFunctionDeclaration||r.initializerIsFunction)&&y===r.typeSeed&&(W||r.isFunctionDeclaration&&L?.length))y=`${r.jsdocTypeParameters?`<${r.jsdocTypeParameters}>`:""}(${h(L??[])}) => ${W??"any"}`;let J=r.jsdocDescription??r.resolvedDescription;if(J===void 0&&y!==void 0)J=r.typedefs?.get(y)?.description;let U=Tc({hasTypeScriptType:r.explicitType!==void 0,hasJSDocType:r.jsdocType!==void 0||r.jsdocParams!==void 0||r.jsdocReturnType!==void 0||r.resolvedType!==void 0,inferredType:r.inferredTypeForSource,finalType:y}),te=r.initializerIsFunction||r.isFunctionDeclaration||!!r.jsdocParams?.length||r.jsdocReturnType!==void 0||se(r.jsdocType)||se(r.resolvedType)||se(r.explicitType),K=te?r.jsdocTypeParameters:void 0;return{type:y,typeSource:U,description:J,params:L,returnType:W,isFunction:te,typeParameters:K}}function ur(r,y,L){if(L?.explicitDefault===void 0)return L;return r.explicitDefaultPropNames.add(y),{...L,description:L.descriptionWithoutDefault}}function fr(r){return{binding:r?.binding,deprecated:r?.deprecated,tags:r?.tags,...r?.internal?{internal:!0}:{}}}function Rr(r){if(r?.type==="Identifier")return r.name;return typeof r?.value==="string"?r.value:void 0}function ks(r,y){for(let L of r?.body??[]){let W=L.type==="ExportNamedDeclaration"&&L.declaration?L.declaration:L;if(W.type==="VariableDeclaration"){let H=W.declarations.find((J)=>J.id.type==="Identifier"?J.id.name===y:un(J.id).has(y));if(H)return{declaration:W,declarator:H,statement:L}}else if((W.type==="FunctionDeclaration"||W.type==="ClassDeclaration")&&W.id?.name===y)return{declaration:W,statement:L}}return}function Sc(r){return!r.type.startsWith("TS")}function xc(r,y){for(let L of r?.body??[]){if(L.type!=="LabeledStatement"||L.label.name!=="$")continue;if(L.body.type!=="ExpressionStatement")continue;let W=L.body.expression;if(W.type!=="AssignmentExpression"||W.operator!=="=")continue;let{left:H}=W;if(!Sc(H))continue;if(!un(H).has(y))continue;let J={type:"VariableDeclarator",id:H,init:W.right,start:W.start,end:W.end};return{declaration:{type:"VariableDeclaration",kind:"let",declarations:[J],start:L.start,end:L.end},declarator:J,statement:L}}return}function Cc(r){if(r==="var")return"let";if(r==="using"||r==="await using")return"const";return r}function _i(r,y,L,W,H){let J=Rr(L.local),U=Rr(L.exported);if(!J||!U)return;if(y.source!=null)return{localName:J,exportedName:U};let te=ks(W,J);if(!te&&H==="instance")te=ks(r.parsed?.module?.content,J)??xc(W,J);return{localName:J,exportedName:U,...te}}function Ri(r,y,L,W){let H=y.source?.value,J=typeof H==="string"?`it re-exports from "${H}"`:r.valueImportBindingsByLocalName.has(L)?"it re-exports an imported binding":"no matching local declaration was found";en(r,"export-unresolved",W,`export "${W}" was skipped because ${J}; sveld only resolves exports of a local declaration.`,Ve(r,y))}function mr(r,y,L){if(!L)return pn(r,y);let W=y.specifiers.length===1?pn(r,y):void 0,H=pn(r,L.statement);if(!W||!H)return W??H;let J=Object.fromEntries(Object.entries(W).filter(([,U])=>U!==void 0));return{...H,...J,internal:W.internal||H.internal}}function Mi(r,y,L,W){let H=[];if(y.type==="FunctionDeclaration"){if(!y.id)return H;let te=r.scriptLanguage==="ts"?zn(r,y,or(y)):void 0;return H.push({prop_name:L?.exportedName??y.id.name,kind:"function",isFunctionDeclaration:!0,value:void 0,typeSeed:te?.hasAnnotations?void 0:Xn(r,y),explicitType:te?.hasAnnotations?te.signature:void 0,initializerIsFunction:!0,isRequired:!1,localName:y.id.name,defaultValue:void 0,inferredTypeForSource:void 0,resolvedJSDoc:void 0}),H}if(y.type!=="VariableDeclaration")return H;let J=Cc(y.kind),U=L?.declarator?[L.declarator]:y.declarations;for(let{id:te,init:K}of U){if(te.type!=="Identifier"){for(let rn of un(te)){if(L&&L.localName!==rn)continue;H.push({prop_name:L?.exportedName??rn,kind:J,isFunctionDeclaration:!1,value:void 0,typeSeed:void 0,explicitType:void 0,initializerIsFunction:!1,isRequired:!1,localName:rn,defaultValue:void 0,inferredTypeForSource:void 0,resolvedJSDoc:void 0})}continue}let Ee=te.name,Se=L?.exportedName??Ee,ve=K==null?{isFunction:!1}:Sn(r,K),{value:Le,isFunction:Me,defaultValue:Fe}=ve,sn=J==="const"&&(K?.type==="ObjectExpression"||K?.type==="ArrayExpression")&&!r.typeCasts.constAssertions.has(K),nn=(J==="const"&&(K?.type==="ArrowFunctionExpression"||K?.type==="FunctionExpression")?Xn(r,K):void 0)??(sn?xn(K,"literal"):void 0)??ve.type;wr(r,ve,Se,W),H.push({prop_name:Se,kind:J,isFunctionDeclaration:!1,value:Le,typeSeed:nn,explicitType:bc(r,te),initializerIsFunction:Me,isRequired:J==="let"&&K==null,localName:Ee,defaultValue:Fe,inferredTypeForSource:nn,resolvedJSDoc:ve})}return H}function bc(r,y){return ln(r,y.typeAnnotation?.typeAnnotation),yn(r,y.typeAnnotation)}function Ii(r,y,L){let{resolvedJSDoc:W}=y;return dr({explicitType:y.explicitType,typeSeed:y.typeSeed,inferredTypeForSource:y.inferredTypeForSource,jsdocType:L?.type,jsdocDescription:L?.description,jsdocParams:L?.params,jsdocReturnType:L?.returnType,jsdocTypeParameters:L?.typeParameters,resolvedType:W?.resolvedType,resolvedDescription:W?.resolvedDescription,resolvedParams:W?.resolvedParams,resolvedReturnType:W?.resolvedReturnType,initializerIsFunction:y.initializerIsFunction,isFunctionDeclaration:y.isFunctionDeclaration,typedefs:r.typedefs})}function vc(r,y,L){en(r,"export-unresolved",L,`export "${L}" was skipped because a class can't be a prop; export it from the module script instead.`,Ve(r,y))}function ws(r,y,L,W){if(L.type==="ClassDeclaration"){if(L.id)vc(r,y,W?.exportedName??L.id.name);return}let H=Mi(r,L,W,"props");if(H.length===0)return;let J=mr(r,y,W);for(let U of H){let{prop_name:te,kind:K,localName:Ee}=U,Se=ur(r,te,J),{type:ve,typeSource:Le,description:Me,params:Fe,returnType:sn,isFunction:an,typeParameters:nn}=Ii(r,U,Se);Jt(r,te,J?.sveldIgnore),er(r,te,{name:te,...Ee!==void 0&&Ee!==te?{localName:Ee}:{},kind:K,description:Me,...fr(J),type:ve,typeSource:Le,value:Se?.explicitDefault??U.value,defaultValue:U.defaultValue,params:Fe,returnType:sn,typeParameters:nn,isFunction:an,isFunctionDeclaration:U.isFunctionDeclaration,isRequired:U.isRequired,constant:K==="const",reactive:r.reactive_vars.has(te),source:Ve(r,y)})}}function Ls(r,y,L){if(y.declaration!=null){ws(r,y,y.declaration);return}for(let W of y.specifiers){let H=_i(r,y,W,L,"instance");if(!H)continue;if(H.declaration)ws(r,y,H.declaration,H);else Ri(r,y,H.localName,H.exportedName)}}function Dc(r){if(!r||typeof r!=="object"||!("type"in r))return;let y=String(r.type),L=F(y);if(!L&&!_(y))return;let W="name"in r&&typeof r.name==="string"?r.name:void 0;if(!W)return;if(L)return{type:"InlineComponent",name:W};let H={type:"Element",name:W};if(W==="svelte:element"&&"tag"in r&&n(r.tag)){let{tag:J}=r;if(J.type==="Literal"&&typeof J.value==="string")H.thisValue=J.value}return H}function Rs(r,y,L){let W=Dc(y);if(!W)return;if(r.rest_props!==void 0&&!(r.rest_props.type==="InlineComponent"&&W.type==="Element"))return;r.rest_props=W;let H=y&&typeof y==="object"&&"tag"in y?y.tag:void 0;r.restPropsTagLocal=W.name==="svelte:element"&&t(H)?H.name:void 0,r.restPropsSource=Ve(r,L)}function _s(r,y){let L=w(y);if(m(L,"$derived")){let[W]=L.arguments;L=W?.type==="SpreadElement"?void 0:w(W)}if(!c(L))return;for(let W of L.properties){if(W.type!=="SpreadElement"||!t(W.argument))continue;let{name:H}=W.argument;if(H==="$$restProps"||r.restPropLocals.has(H))return H}return}function Ms(r,y){let L=new Map;for(let W of y?.content.body??[]){if(W.type==="VariableDeclaration"){for(let{id:U,init:te}of W.declarations){let K=t(U)?_s(r,te):void 0;if(K&&t(U))L.set(U.name,K)}continue}if(W.type!=="LabeledStatement"||W.label.name!=="$")continue;if(W.body.type!=="ExpressionStatement")continue;let H=W.body.expression;if(H.type!=="AssignmentExpression"||H.operator!=="="||!t(H.left))continue;let J=_s(r,H.right);if(J)L.set(H.left.name,J)}return L}var Pc=/^[A-Za-z_$][\w$]*/,Ac=/[A-Za-z_$][\w$]*/g,Nc=/^(?:(?:const|in|out)\s+)+/;function Is(r){let y=i(r,",").map((W)=>W.trim()).filter((W)=>W.length>0);if(y.length===0)return null;return[y.map((W)=>W.replace(Nc,"").match(Pc)?.[0]??W).join(", "),y.join(", ")]}function Fs(r,y,L){let W=r.scriptGenericsAttribute?.value;if(!W)return;for(let[H]of W.matchAll(Ac)){if(r.typeImportBindingsByLocalName.has(H))y.add(H);if(L.has(H))continue;let J=r.localTypeDeclarationsByName.get(H);if(!J)continue;L.add(H),An(r,J.node,y,L)}}function Mr(r,y,L){if(r.generics)r.generics=[`${r.generics[0]}, ${y}`,`${r.generics[1]}, ${L}`];else r.generics=[y,L]}function Os(r){if(!Array.isArray(r.value))return;return r.value.map((y)=>y.type==="Text"?y.data:"").join("").trim()}function Bs(r){let y=[r.instance,r.module].filter((W)=>W!==void 0),L=!1;for(let W of y){let H=W.attributes.find((J)=>J.name==="lang");if(!H){L=!0;continue}if(Os(H)?.toLowerCase()==="ts")return"ts"}return L?"js":void 0}function $s(r,y){let L=y.instance?.attributes.find((J)=>J.name==="generics");if(!L)return;let W=Ve(r,L),H=Os(L);if(!H)return;return{value:H,source:W}}var Gs=/[A-Za-z_$][\w$]*/y,kc=/[\w$]/,wc=/^\s*\??\s*:/,Lc=/(?:^|[{;,(\n]|\breadonly)\s*$/,_c=/^\s*\[/,Rc=/\b(?:keyof|readonly|unique)\s+$/,Mc=/&\s*$/,Ic=/^\s*&/,Fc=/(?:\||\bextends)\s*$/,Oc=/^\s*(?:\||extends\b)/,Bc=/^(?:keyof|readonly|unique|typeof|infer)\s/,$c=/^(?:abstract\s+)?new\b/,Gc=V(["TSTypeLiteral","TSInterfaceDeclaration","TSTypeAliasDeclaration","TSParenthesizedType","TSTypeReference","TSIntersectionType"]);function Vc(r){let y=r.trim();if(P(y)!==-1||b(y,"?")!==-1||$c.test(y))return 4;if(i(y,"|").length>1)return 3;if(i(y,"&").length>1)return 2;return Bc.test(y)?1:0}function jc(r,y){if(_c.test(y))return 0;if(Rc.test(r))return 1;if(Mc.test(r)||Ic.test(y))return 2;if(Fc.test(r)||Oc.test(y))return 3;return 4}function Wc(r,y){for(let L=y+1;L<r.length;L++)if(r[L]==="\\")L++;else if(r[L]===r[y])return L+1;return r.length}function Hc(r,y){for(let L=y;L<r.length;L++)if(r[L]==="\\")L++;else if(r[L]==="`")return{end:L+1,opensExpression:!1};else if(r[L]==="$"&&r[L+1]==="{")return{end:L+2,opensExpression:!0};return{end:r.length,opensExpression:!1}}function Jc(r,y){if(y.size===0)return r;let L="",W=[],H=0;while(H<r.length){let J=r[H],U=W.length-1;if(J==='"'||J==="'"){let Le=Wc(r,H);L+=r.slice(H,Le),H=Le;continue}if(J==="`"||J==="}"&&W[U]===0){if(J==="}")W.pop();let{end:Le,opensExpression:Me}=Hc(r,H+1);if(Me)W.push(0);L+=r.slice(H,Le),H=Le;continue}if(U>=0&&J==="{")W[U]++;if(U>=0&&J==="}")W[U]--;Gs.lastIndex=H;let te=kc.test(r[H-1]??"")?void 0:Gs.exec(r)?.[0];if(!te){L+=J,H++;continue}H+=te.length;let K=y.get(te),Ee=r.slice(0,H-te.length),Se=r.slice(H),ve=Ee.trimEnd();if(K===void 0||ve.endsWith(".")&&!ve.endsWith("...")||Lc.test(Ee)&&wc.test(Se))L+=te;else L+=Vc(K)>jc(Ee,Se)?`(${K})`:K}return L}function Uc(r,y,L){let W=new Map,H=y.type==="TSInterfaceDeclaration"||y.type==="TSTypeAliasDeclaration"?y.typeParameters?.params:void 0,J=L.typeArguments?.params;if(!H?.length||!J?.length)return W;for(let U=0;U<H.length;U++){let te=H[U]?.name,K=J[U];if(!te||K?.start===void 0||K?.end===void 0)continue;let Ee=cn(r,K.start,K.end)?.trim();if(Ee)W.set(te,Ee)}return W}function Ir(r,y,L,W=new Set){let H=new Map;if(!y?.type)return H;let J=(te)=>{for(let K of te){if(K?.type!=="TSPropertySignature"||K.computed||!K.key)continue;let Ee=p(K.key);if(!Ee)continue;let Se=K.typeAnnotation?.start,ve=K.typeAnnotation?.end;if(Se===void 0||ve===void 0)continue;let Le=cn(r,Se+1,ve)?.trim();if(!Le)continue;ln(r,K.typeAnnotation?.typeAnnotation);let Me=pn(r,K);H.set(Ee,{type:Le,optional:K.optional===!0,source:Ve(r,K),...Me?{jsdoc:Me}:{}})}},U=(te)=>{let K=Ir(r,te,L,W);for(let[Ee,Se]of K)H.set(Ee,Se)};if(!Gc(y))return H;switch(y.type){case"TSTypeLiteral":J(y.members??[]);break;case"TSInterfaceDeclaration":for(let te of y.extends??[]){let K={type:"TSTypeReference",typeName:te.expression,typeArguments:te.typeParameters,start:te.start,end:te.end};U(K)}J(y.body?.body??[]);break;case"TSTypeAliasDeclaration":case"TSParenthesizedType":U(y.typeAnnotation);break;case"TSTypeReference":{let te=jo(y.typeName);if(!te||W.has(te))break;let K=L.get(te);if(!K)break;W.add(te);let Ee=Ir(r,K,L,W);W.delete(te);let Se=Uc(r,K,y);for(let[ve,Le]of Ee)H.set(ve,Se.size===0?Le:{...Le,type:Jc(Le.type,Se)});break}case"TSIntersectionType":for(let te of y.types??[])U(te);break}return H}function Vs(r){return new Map(Array.from(r.localTypeDeclarationsByName,([y,L])=>[y,L.node]))}function zc(r){let y={};for(let[L,W]of Object.entries(r))y[L]={...W.attribute===void 0?{}:{attribute:W.attribute},...W.reflect===void 0?{}:{reflect:W.reflect},...W.type===void 0?{}:{type:W.type}};return y}function Fi(r,y,L){if(y.type==="ImportDeclaration"&&y.source?.value)for(let W of y.specifiers){let H=W.type==="ImportSpecifier";if(y.importKind!=="type"&&!(H&&W.importKind==="type"))continue;let J=W.local.name;r.typeImportBindingsByLocalName.set(J,{importedName:H?ae(W):void 0,localName:J,source:String(y.source.value),specifierType:H?"named":W.type==="ImportDefaultSpecifier"?"default":"namespace"})}if(y.type==="TSEnumDeclaration"||y.type==="TSInterfaceDeclaration"||y.type==="TSTypeAliasDeclaration"){let W=y.type==="TSEnumDeclaration"?Jo(r,y):cn(r,y.start,y.end)?.trim();r.localTypeDeclarationsByName.set(y.id.name,{code:W??"",node:y,start:y.start,...L?{exported:L}:{}})}}function js(r,y){if(r.runesPropsDeclarationMetadataByDeclaratorStart.clear(),r.explicitVariableTypesByName.clear(),r.explicitVariableTypeNodesByName.clear(),r.typeImportBindingsByLocalName.clear(),r.localTypeDeclarationsByName.clear(),r.additionalTypeDependencyNodes.length=0,r.typedRunesPropsDeclarations.length=0,!r.source)return;r.scriptLanguage=Bs(y);let L=y.options?.customElement;r.customElementTag=L?.tag,r.customElement=L?{...L.tag===void 0?{}:{tag:L.tag},...L.shadow==="open"||L.shadow==="none"?{shadow:L.shadow}:{},...L.props?{props:zc(L.props)}:{},...L.extend===void 0?{}:{extend:!0}}:void 0,r.runesOptionOverride=y.options?.runes,r.scriptGenericsAttribute=$s(r,y);let W=new Set;for(let J of y.module?.content.body??[]){if(!J?.type)continue;if(J.type==="ExportNamedDeclaration"&&J.declaration)Fi(r,J.declaration,!0);else if(J.type==="ExportNamedDeclaration"&&!J.source)for(let U of J.specifiers){if(U.local.type!=="Identifier"||U.exported.type!=="Identifier")continue;if(U.local.name===U.exported.name)W.add(U.local.name)}else Fi(r,J,!1)}for(let J of W){let U=r.localTypeDeclarationsByName.get(J);if(U)U.exported=!0}let H=y.instance?.content.body??[];for(let J of H){if(Fi(r,J,!1),J.type!=="VariableDeclaration")continue;for(let{id:U}of J.declarations){if(U.type!=="Identifier")continue;let te=yn(r,U.typeAnnotation);if(!te)continue;let K=U.typeAnnotation?.typeAnnotation;if(r.explicitVariableTypesByName.set(U.name,te),K)r.explicitVariableTypeNodesByName.set(U.name,K)}}for(let J of H){if(J.type!=="VariableDeclaration")continue;for(let U of J.declarations){if(!m(w(U.init),"$props"))continue;let te="typeAnnotation"in U.id?U.id.typeAnnotation:void 0,K=te?void 0:je(U.init),Ee=te?.typeAnnotation??K,Se=te?yn(r,te):Fn(r,K),ve=Ir(r,Ee,Vs(r)),Le=new Set,Me=new Set;An(r,Ee,Le,Me),Fs(r,Le,Me);let Fe={canonicalType:Se,props:ve,referencedImportedTypes:Le,referencedLocalTypes:Me};if(r.runesPropsDeclarationMetadataByDeclaratorStart.set(U.start,Fe),Se)r.typedRunesPropsDeclarations.push(Fe)}}}function qc(r,y){let L=y?.trim();if(!L)return;let W=r.typedefMembersByName.get(L)??d(L,{skipIndexSignatures:!0});return W?new Map(W.map((H)=>[H.name,H])):void 0}function Xc(r){return m(r,"$bindable")?{init:r.arguments[0],bindable:!0}:{init:r,bindable:!1}}function Ws(r,y){for(let L of y.declarations){if(!m(L.init,"$props"))continue;let W=r.runesPropsDeclarationMetadataByDeclaratorStart.get(L.start),H=pn(r,y),J=W?.props.size?void 0:qc(r,H?.type);if(L.id.type==="Identifier"){r.wholePropsLocals.add(L.id.name),r.restPropLocals.add(L.id.name);let te=[...Array.from(J?.values()??[],(K)=>({name:K.name,member:K,typeMetadata:void 0})),...Array.from(W?.props??[],([K,Ee])=>({name:K,member:void 0,typeMetadata:Ee}))];for(let{name:K,member:Ee,typeMetadata:Se}of te){let ve=ur(r,K,Se?.jsdoc),{type:Le,typeSource:Me,description:Fe,params:sn,returnType:an,isFunction:nn}=dr({explicitType:Se?.type,jsdocType:ve?.type??Ee?.type,jsdocDescription:ve?.description??Ee?.description,jsdocParams:ve?.params,jsdocReturnType:ve?.returnType,initializerIsFunction:!1,isFunctionDeclaration:!1,typedefs:r.typedefs});Jt(r,K,ve?.sveldIgnore),er(r,K,{name:K,kind:"let",description:Fe,...fr(ve),type:Le,typeSource:Me,value:ve?.explicitDefault,params:sn,returnType:an,isFunction:nn,isFunctionDeclaration:!1,isRequired:!(Se?.optional??Ee?.optional),constant:!1,reactive:!1,source:Se?.source})}continue}if(L.id.type!=="ObjectPattern")continue;let U=L.id.properties.filter((te)=>{if(te.type!=="Property"||te.computed)return!1;if(!p(te.key))return!1;if(te.value.type==="Identifier")return!0;return te.value.type==="AssignmentPattern"&&te.value.left.type==="Identifier"}).length;for(let te of L.id.properties){if(te.type==="RestElement"){if(te.argument.type==="Identifier")r.restPropLocals.add(te.argument.name);continue}let K=p(te.key);if(!K)continue;let Ee,Se;if(te.value.type==="Identifier")Ee=te.value.name;else{let No=te.value;Ee=No.left.name,Se=No.right}if(!Ee)continue;if(br(r,K,Ee),K==="children")r.snippetPropLocals.add(Ee);let ve=J?.get(K),Le=W?.props.get(K),Me=ur(r,K,pn(r,te)??Le?.jsdoc??(U===1&&!J?H:void 0)),{init:Fe,bindable:sn}=Xc(Se),an=Fe==null?{isFunction:!1}:Sn(r,Fe),{value:nn,type:rn,isFunction:hn,defaultValue:Hl}=an,Jl=Le?.type===void 0&&Me?.type===void 0?an.resolvedType:void 0;wr(r,an,K,"props");let{type:Ul,typeSource:zl,description:ql,params:Xl,returnType:Kl,isFunction:Yl}=dr({explicitType:Le?.type,typeSeed:rn,inferredTypeForSource:rn,jsdocType:Me?.type??ve?.type,jsdocDescription:Me?.description??ve?.description,jsdocParams:Me?.params,jsdocReturnType:Me?.returnType,resolvedType:Jl,resolvedDescription:an.resolvedDescription,resolvedParams:an.resolvedParams,resolvedReturnType:an.resolvedReturnType,initializerIsFunction:hn,isFunctionDeclaration:!1,typedefs:r.typedefs});if(sn)r.reactive_vars.add(K);Jt(r,K,Me?.sveldIgnore),er(r,K,{name:K,...Ee===K?{}:{localName:Ee},kind:"let",description:ql,...fr(Me),...sn?{bindable:!0}:{},type:Ul,typeSource:zl,value:Me?.explicitDefault??nn,defaultValue:Hl,params:Xl,returnType:Kl,isFunction:Yl,isFunctionDeclaration:!1,isRequired:!sn&&Fe==null&&Le?.optional!==!0&&ve?.optional!==!0,constant:!1,reactive:sn,source:Ve(r,te)})}}}function Kc(r){let L=r.indexOf("EventDispatcher");if(L===-1)return;let W=L+15;while(r[W]===" ")W++;if(r[W]!=="<")return;let H=E(r,W);return H===-1?void 0:r.slice(W+1,H)}var Yc=/^["']|["']$/g,Qc=/\?$/,Zc=/^\{/,ed=/\}$/;function nd(r){let y=b(r,":");if(y===-1)return;let L=r.slice(0,y).trim().replace(Qc,"").replace(Yc,""),W=r.slice(y+1).trim();if(!L||!W)return;return{name:L,type:W}}function Hs(r,y,L,W){if(y){for(let[te,K]of Ir(r,y,Vs(r)))r.typedDispatcherEventNames.add(te),_n(r,{name:te,detail:K.type,has_argument:!0,source:K.source});return}let H=Tn(r,L)?.type,J=H?Kc(H):void 0;if(!J)return;let U=J.trim().replace(Zc,"").replace(ed,"");for(let te of i(U,";,")){let K=nd(te.trim());if(!K)continue;r.typedDispatcherEventNames.add(K.name),_n(r,{name:K.name,detail:K.type,has_argument:!0,source:W})}}function Js(r,y){if(r.syntaxMode!=="runes")return;for(let[L,W]of Array.from(r.events.entries())){if(W.type!=="dispatched")continue;if(y.has(L)||r.forwardedEvents.has(L))continue;let H=`on${L}`,J=r.props.get(H);if(!J)continue;let U=J.type!==void 0||J.params!==void 0||J.returnType!==void 0,te=W.detail===void 0||W.detail==="undefined"||W.detail==="null"?"() => void":`(detail: ${W.detail}) => void`;r.props.set(H,{...J,description:J.description??W.description,type:U?J.type:te,typeSource:U?J.typeSource:"inferred",isFunction:!0}),r.events.delete(L)}}var Rn=null;function Mn(r){return!r||r==="default"?Rn:r}function Oi(r,y){switch(y.type){case"Identifier":return{value:y.name,replace:!0};case"Literal":return{value:typeof y.value==="string"?JSON.stringify(y.value):String(y.value),replace:!1};case"MemberExpression":return{value:Ko(r,y),replace:!1};case"ObjectExpression":case"TemplateLiteral":return{value:cn(r,y.start,y.end),replace:!1};case"ArrayExpression":case"ArrayPattern":case"ArrowFunctionExpression":case"AssignmentExpression":case"AssignmentPattern":case"AwaitExpression":case"BinaryExpression":case"CallExpression":case"ChainExpression":case"ClassExpression":case"ConditionalExpression":case"FunctionExpression":case"ImportExpression":case"LogicalExpression":case"MetaProperty":case"NewExpression":case"ObjectPattern":case"RestElement":case"SequenceExpression":case"TaggedTemplateExpression":case"ThisExpression":case"TSAsExpression":case"TSInstantiationExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"UnaryExpression":case"UpdateExpression":case"YieldExpression":break}return{value:void 0,replace:!1}}function td(r,y,L){if(!t(y))return null;let W=qn(r,y.name);if(c(W))return $i(r,W,L).slot_props;let H=On(r,y.name);if(!H)return null;let J=d(H.type);if(!J)return null;let U={};for(let te of J)U[te.name]={value:te.type,replace:!1};return U}function Bi(r,y,L,W,H){let J=td(r,L,H);if(J)return Object.assign(y,J),!0;if(H)return!1;return en(r,"spread-unresolved","slot_props",`Slot props spread a value sveld can't resolve; its shape is widened to "Record<string, any>".`,Ve(r,W)),!1}function $i(r,y,L){let W={},H=!1;for(let J of y.properties){if(J.type==="SpreadElement"){if(!Bi(r,W,J.argument,J,L))H=!0;continue}if(J.type!=="Property"||J.computed)continue;let U=p(J.key);if(!U)continue;W[U]=Oi(r,J.value)}return{slot_props:W,hasUnresolvedSpread:H}}function rd(r,y){if(y.type==="Identifier"){let H=r.propLocalToPublicName.get(y.name);return H?{publicName:H,trackingName:y.name}:null}if(y.type!=="MemberExpression")return null;if(y.object.type!=="Identifier"||!r.wholePropsLocals.has(y.object.name))return null;let{property:L}=y,W;if(!y.computed&&L.type==="Identifier")W=L.name;else if(L.type==="Literal"&&L.value!=null)W=String(L.value);return W?{publicName:W,trackingName:W}:null}function Gi(r){return r.type==="ChainExpression"?r.expression:r}function Us(r,y){let L=Gi(y),W=rd(r,L.callee);return W&&{...W,arguments:L.arguments}}function gr(r,{slot_name:y,slot_props:L,slot_props_unresolved_spread:W,slot_fallback:H,slot_description:J,slot_deprecated:U,slot_tags:te,slot_internal:K,source:Ee}){let Se=Mn(y),ve=r.slots.get(Se);r.slots.set(Se,{name:Se,default:ve?.default??Se===Rn,fallback:H||void 0,slot_props:ve?.slot_props??(L===""?void 0:L),slot_props_unresolved_spread:ve?.slot_props_unresolved_spread||W,description:ve?.description||J?.trim()||void 0,deprecated:ve?.deprecated??U,tags:ve?.tags||te,...ve?.internal||K?{internal:!0}:{},source:Ee||ve?.source})}var zs=/^@component/,id=/\r/g,od=V(["AssignmentExpression","UpdateExpression","CallExpression","SpreadAttribute","FunctionDeclaration","ImportDeclaration","VariableDeclaration","ExportNamedDeclaration","Comment","SlotElement","RenderTag","OnDirective","BindDirective"]);function qs(r){return r&&"id"in r&&r.id&&"name"in r.id?r.id.name:void 0}function sd(r,y,L,W){let H=L.callee.type==="Identifier"?L.callee.name:void 0;if(H==="createEventDispatcher"){let J=qs(W);if(J!==void 0)y.dispatcherName=J,y.dispatcherDeclaratorNode=W;y.dispatcherTypeArgument=L.typeArguments?.params?.[0]}if(H==="$host"){let J=qs(W);if(J!==void 0)y.hostLocalNames.add(J)}if(H==="setContext")Cs(r,L,W?.type==="ExpressionStatement"?W:null);if(L.arguments.length>0){if(y.callsWithArguments.push(L),_r(r,L.callee))y.locallyBoundCalls.add(L)}if(H)y.callees.push({name:H,arguments:L.arguments,node:L,nestedBoundDetailNames:pr(r,L.arguments[1])});if(A(L.callee)&&t(L.callee.property)&&L.callee.property.name==="dispatchEvent"&&(m(L.callee.object,"$host")||t(L.callee.object)&&y.hostLocalNames.has(L.callee.object.name))){let J=As(r,L);if(J)y.hostDispatchedEventNames.add(J.name),y.hostDispatches.push(J)}}function ad(r,y){let L=Array.isArray(y)?y[0]:y;if(L?.type==="Text")return{value:JSON.stringify(L.raw),replace:!1};if(L?.type==="ExpressionTag")return Oi(r,L.expression);return{value:void 0,replace:!1}}function ld(r,y){let L=y.attributes.find((Ee)=>("name"in Ee)&&Ee.name==="name"),W=L&&"value"in L?L.value:void 0,H=Array.isArray(W)?W[0]:void 0,J=H?.type==="Text"?H.data:void 0,U={},te=!1;for(let Ee of y.attributes){if(Ee.type==="SpreadAttribute"){let Se=r.jsDocSlots.has(Mn(J));if(!Bi(r,U,Ee.expression,Ee,Se))te=!0;continue}if(!("value"in Ee)||Ee.name==="name"||Ee.value===!0)continue;U[Ee.name]=ad(r,Ee.value)}let K=y.fragment.nodes.map(({start:Ee,end:Se})=>cn(r,Ee,Se)??"").join("").trim();r.renderedSlots.add(Mn(J)),gr(r,{slot_name:J,slot_props:U,slot_props_unresolved_spread:te||void 0,slot_fallback:K,source:Ve(r,y)})}function pd(r,y){let L=Us(r,y.expression);if(!L){let{callee:K}=Gi(y.expression);if(A(K)&&t(K.object)&&r.wholePropsLocals.has(K.object.name))r.slotsUntracked=!0;return}let W=L.publicName==="children"?void 0:L.publicName,[H,...J]=L.arguments,U,te=!1;if(H===void 0)U={};else if(J.length===0&&H.type==="ObjectExpression"){let K=$i(r,H,r.jsDocSlots.has(Mn(W)));U=K.slot_props,te=K.hasUnresolvedSpread}if(r.renderedSlots.add(Mn(W)),U!==void 0)gr(r,{slot_name:W,slot_props:U,slot_props_unresolved_spread:te||void 0,source:Ve(r,y)});if(U!==void 0||r.slots.has(W??Rn))r.snippetPropLocals.add(L.trackingName)}function cd(r,y,L){let W=y.name;if(y.expression!=null||!W)return;if(L==null||!("name"in L)||typeof L.name!=="string"||!L.name)return;let H=F(L.type)?{type:"InlineComponent",name:L.name}:{type:"Element",name:L.name};r.forwardedEvents.set(W,H);let J=r.events.get(W),U=r.eventDescriptions.get(W);if(!J)r.events.set(W,{type:"forwarded",name:W,element:H,description:U,deprecated:void 0,source:Ve(r,y)});else if(J.type==="forwarded"&&U&&!J.description)r.events.set(W,{...J,description:U,source:J.source||Ve(r,y)})}function dd(r){let{expression:y}=r;if(y.type==="Identifier")return{name:y.name,indexed:!1};if(y.type!=="MemberExpression")return;let L=y;while(L.type==="MemberExpression")L=L.object;if(L.type!=="Identifier")return;let W=r.name==="this"&&y.computed&&y.object.type==="Identifier";return{name:L.name,indexed:W}}function ud(r,y,L,W){if(!L||!(_(L.type)||F(L.type)))return;let H=dd(y);if(!H)return;let J=Lr(r,H.name);if(!J)return;r.reactive_vars.add(J);let U=y.expression.type==="MemberExpression";if(y.name!=="this"||U&&!H.indexed)return;if(!("name"in L)||typeof L.name!=="string")return;let te=H.indexed?"indexed":"direct",K=r.bindings.get(J)??{elements:[],components:[],target:te};if(K.target!==te)K.target="mixed";if(_(L.type)){let Ee=L.name,Se="tag"in L&&t(L.tag)?L.tag.name:void 0;if(!K.elements.some((Le)=>Le.tag===Ee&&Le.namespace===W&&Le.tagLocal===Se))K.elements.push({tag:Ee,namespace:W,...Se?{tagLocal:Se}:{}})}else{let Ee=L.type==="Component"?ee(r,L.name):void 0;if(!Ee)return;if(!K.components.includes(L.name))K.components.push(L.name);r.additionalImportedTypes.set(L.name,{localName:L.name,...Ee})}r.bindings.set(J,K)}function Xs(r){let y={dispatcherName:void 0,dispatcherDeclaratorNode:void 0,dispatcherTypeArgument:void 0,hostLocalNames:new Set,hostDispatchedEventNames:new Set,hostDispatches:[],callees:[],callsWithArguments:[],locallyBoundCalls:new Set};cs(r),r.activeScopes.push(r.componentScope);let L=ds(r),W=new WeakMap,H=r.parsed?.options?.namespace,J=[H==="svg"||H==="mathml"?H:"html"],U=new Map,te={enter(K,Ee){if(oe(K.type))return l;let Se=us(r,L,K);if(Se)r.activeScopes.push(Se);if(_(K.type)){let ve="name"in K?K.name:void 0,Le=ve==="svg"?"svg":ve==="math"?"mathml":J[J.length-1];W.set(K,Le),J.push(ve==="foreignObject"?"html":Le)}if(!od(K))return;switch(K.type){case"AssignmentExpression":Ni(r,K.left);break;case"UpdateExpression":Ni(r,K.argument);break;case"CallExpression":sd(r,y,K,Ee);break;case"SpreadAttribute":{let ve=K.expression.type==="Identifier"?K.expression.name:void 0,Le=(ve!==void 0&&!Gn(r,ve)?U.get(ve):void 0)??ve,Me=r.restPropLocals.has(Le??"");if(Le==="$$restProps"||Me)Rs(r,Ee,K);if((Le==="$$props"||Me)&&Ee&&F(Ee.type))r.slotsUntracked=!0;break}case"FunctionDeclaration":if(K.id?.name)r.funcDecls.set(K.id.name,K);break;case"ImportDeclaration":Z(r,K);break;case"VariableDeclaration":if(r.vars.add(K),Ee?.type==="Program"&&K.declarations.some((ve)=>m(ve.init,"$props")))Ws(r,K);break;case"ExportNamedDeclaration":Ls(r,K,Ee?.type==="Program"?Ee:null);break;case"Comment":{let ve=K.data.trim();if(zs.test(ve))r.componentComment=ve.replace(zs,"").replace(id,""),r.componentCommentSource=Ve(r,K);break}case"SlotElement":ld(r,K);break;case"RenderTag":pd(r,K);break;case"OnDirective":cd(r,K,Ee);break;case"BindDirective":ud(r,K,Ee,(Ee&&W.get(Ee))??"html");break}},leave(K){if(_(K.type))J.pop();if(Yn(K))r.activeScopes.pop(),fs(L,K)}};if(r.parsed?.instance)o(r.parsed.instance,te);if(U=Ms(r,r.parsed?.instance),r.parsed?.fragment)o(r.parsed.fragment,te);return y}var Vi=new Set("abstract accessor arguments as asserts async await break case catch class const continue debugger declare default delete do else enum eval export extends false finally for function get global if implements import in infer instanceof interface intrinsic is keyof let module namespace new null of out override package private protected public readonly return satisfies set static super switch this throw true try type typeof unique var void while with yield".split(" ")),fd=new Set("any bigint boolean false never null number object string symbol true undefined unknown void".split(" ")),md=new Set("get set new readonly static public private protected".split(" "));function Ks(r){return r>=97&&r<=122||r>=65&&r<=90||r===95||r===36}function Fr(r){return r>=48&&r<=57}function ji(r){return Ks(r)||Fr(r)}class Ys{text;pos=0;constructor(r){this.text=r}readAll(){if(!this.type())return!1;return this.peek(),this.pos===this.text.length}peek(){let r=this.text,y=this.pos,L=r.charCodeAt(y);while(L===32||L===9)L=r.charCodeAt(++y);return this.pos=y,L}eat(r){if(this.peek()!==r.charCodeAt(0))return!1;return this.pos++,!0}word(){let r=this.pos;return this.skipWord()?this.text.slice(r,this.pos):void 0}skipWord(){if(!Ks(this.peek()))return!1;let r=this.pos+1;while(ji(this.text.charCodeAt(r)))r++;return this.pos=r,!0}keyword(r){this.peek();let y=this.pos+r.length;if(!this.text.startsWith(r,this.pos)||ji(this.text.charCodeAt(y)))return!1;return this.pos=y,!0}name(){let r=this.word();return r!==void 0&&!Vi.has(r)}string(){let r=this.peek();if(r!==34&&r!==39)return!1;let y=this.text;for(let L=this.pos+1;L<y.length;L++){let W=y.charCodeAt(L);if(W===r)return this.pos=L+1,!0;if(W===92||W===10||W===13||W===8232||W===8233)return!1}return!1}number(){let r=this.text,y=this.pos;if(r.charCodeAt(y)===45)y++;let L=y;while(Fr(r.charCodeAt(y)))y++;if(y===L||y-L>1&&r.charCodeAt(L)===48)return!1;if(r.charCodeAt(y)===46){let H=++y;while(Fr(r.charCodeAt(y)))y++;if(y===H)return!1}let W=r.charCodeAt(y);if(ji(W)||W===46)return!1;return this.pos=y,!0}type(){if(this.peek()===40){let r=this.pos;if(this.functionType())return!0;this.pos=r}do do if(!this.operatorType())return!1;while(this.eat("&"));while(this.eat("|"));return!0}operatorType(){if(this.keyword("keyof"))return this.operatorType();if(!this.primaryType())return!1;while(this.eat("[")){if(this.eat("]"))continue;if(!this.type()||!this.eat("]"))return!1}return!0}primaryType(){let r=this.peek();if(r===40)return this.pos++,this.type()&&this.eat(")");if(r===123)return this.objectType();if(r===91)return this.tupleType();if(r===34||r===39)return this.string();if(r===45||Fr(r))return this.number();let y=this.word();if(y===void 0)return!1;if(y==="typeof")return this.typeQuery();if(y==="import")return this.importType(!0);if(fd.has(y)){let L=this.peek();return L!==46&&L!==60}if(Vi.has(y))return!1;while(this.eat("."))if(!this.skipWord())return!1;return!this.eat("<")||this.typeArguments()}typeArguments(){do if(!this.type())return!1;while(this.eat(","));return this.eat(">")}typeQuery(){if(this.keyword("import"))return this.importType(!1);do if(!this.name())return!1;while(this.eat("."));return!0}importType(r){if(!this.eat("(")||!this.string()||!this.eat(")"))return!1;while(this.eat("."))if(!this.name())return!1;return!r||!this.eat("<")||this.typeArguments()}objectType(){this.pos++;while(!this.eat("}")){if(!this.typeMember())return!1;if(!this.eat(";")&&!this.eat(",")&&this.peek()!==125)return!1}return!0}typeMember(){let r=this.peek();if(this.eat("[")){let y=this.peek();if(y===34||y===39){if(!this.string()||!this.eat("]"))return!1}else return this.name()&&this.eat(":")&&this.type()&&this.eat("]")&&this.eat(":")&&this.type()}else if(r===34||r===39){if(!this.string())return!1}else{let y=this.word();if(y===void 0||md.has(y))return!1}return this.eat("?"),this.eat(":")&&this.type()}tupleType(){if(this.pos++,this.eat("]"))return!0;do if(!this.type())return!1;while(this.eat(","));return this.eat("]")}functionType(){if(this.pos++,!this.eat(")")){let r=new Set;for(;;){this.peek();let y=this.text.startsWith("...",this.pos);if(y)this.pos+=3;let L=this.word();if(L===void 0||Vi.has(L)||r.has(L))return!1;if(r.add(L),!y)this.eat("?");if(!this.eat(":")||!this.type())return!1;if(y||!this.eat(","))break}if(!this.eat(")"))return!1}if(this.peek(),!this.text.startsWith("=>",this.pos))return!1;return this.pos+=2,this.type()}}function gd(r){return new Ys(r).readAll()}var yd=s.extend(ce);function Or(r,y={}){return gd(r)||hd(r,y.inline??!1)}function hd(r,y){let L=!1,W=new yd(y?{ecmaVersion:16,sourceType:"module",onComment:(H,J,U,te)=>{if(!H&&te===r.length)L=!0}}:{ecmaVersion:16,sourceType:"module"},r);try{return W.parseWholeType(),!L}catch(H){if(H instanceof SyntaxError)return!1;throw H}}var Wi=/<!--[\s\S]*?-->|<script\s+(?:[^>]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)\s+)*)lang=(["'])?([^"' >]+)\1[^>]*>/y;function $r(r){return r.charCodeAt(0)===65279?r.slice(1):r}function Dn(r){return r>=48&&r<=57}function dn(r){if(r===32||r<=13&&r>=9)return!0;if(r<160)return!1;return r===160||r===5760||r>=8192&&r<=8202||r===8232||r===8233||r===8239||r===8287||r===12288||r===65279}function on(r,y){let L=y;while(L<r.length&&dn(r.charCodeAt(L)))L++;return L}function Gr(r){let y=r.indexOf("<");while(y!==-1){let L=r.charCodeAt(y+1);if(L===33||L===115){Wi.lastIndex=y;let W=Wi.exec(r);if(W){if(L===115)return W[2]==="ts";y=r.indexOf("<",Wi.lastIndex);continue}}y=r.indexOf("<",y+1)}return!1}function Vr(r,y){let L=r.indexOf("</script",y);while(L!==-1){if(r.charCodeAt(on(r,L+8))===Br)return L;L=r.indexOf("</script",L+8)}return-1}function jr(r,y){return on(r,y+8)+1}var Ed=new Set("area base br col command embed hr img input keygen link meta param source track wbr".split(" "));function yr(r){return Ed.has(r)||r.charCodeAt(0)===33&&r.toLowerCase()==="!doctype"}function Wr(r,y){let L=y;while(L<r.length){let W=r.charCodeAt(L);if(W===47&&r.charCodeAt(L+1)===42){let H=r.indexOf("*/",L+2);L=H===-1?r.length:H+2}else if(W===34||W===39){L++;while(L<r.length){let H=r.charCodeAt(L);if(H===W||H===10)break;L+=H===92?2:1}L++}else if(W===60&&r.startsWith("</style",L))break;else L++}return Math.min(L,r.length)}var Td=34,Sd=39,Qs=47,Zs=61,Br=62,Cn=(r)=>r===Td||r===Sd;function Vn(r,y,L){let W=y;for(;W<r.length;W++){let H=r.charCodeAt(W);if(dn(H)||H===Qs||H===Br)break;if(L&&(Cn(H)||H===Zs))break}return W}function Hr(r,y){let L=r.charCodeAt(y);return dn(L)||Cn(L)||L===Zs||L===60||L===Br||L===96||L===Qs&&r.charCodeAt(y+1)===Br}var jn=0,Oe=1,Pn=2,tn=3,ta=0,ea=1,ra=2,Er=3,qi=4,Qn=4,Ui=5,Jr=6,ia=7,xd={await:Oe,case:Oe,default:Oe,delete:Oe,extends:Oe,in:Oe,instanceof:Oe,new:Oe,of:Oe,return:Oe,throw:Oe,typeof:Oe,void:Oe,yield:Oe,do:Pn,else:Pn,finally:Pn,try:Pn,for:Qn,if:Qn,while:Qn,with:Qn,import:Ui,export:Jr,require:ia},oa=10,zi=Array(Xi(128,0)).fill(null);for(let r of Object.entries(xd)){let y=Xi(r[0].charCodeAt(0),r[0].length),L=zi[y]??[];L.push(r),zi[y]=L}function Xi(r,y){return r*(oa+1)+y}function sa(r,y,L){let W=r.charCodeAt(y);if(W>=128||L-y>oa)return tn;let H=Xi(W,L-y),J=zi[H];if(J===null)return tn;for(let U=0;U<J.length;U++)if(r.startsWith(J[U][0],y))return J[U][1];return tn}var aa=new Uint8Array(128);for(let r of["az","AZ","09","__","$$","\\\\"])for(let y=r.charCodeAt(0);y<=r.charCodeAt(1);y++)aa[y]=1;function Wn(r){return r>=128?!dn(r):aa[r]===1}function la(r,y,L,W=!1){Cd(r,bd(r,y,W),y,W,L,void 0,void 0)}function Cd(r,y,L,W,H,J,U){let te=[],K=r.startsWith("#!")?da(r,2):0,Ee=jn,Se=!1,ve=!1,Le=-1,Me=()=>{if(Ee=jn,te.length===0)Le=-1};while(K<=y){let Fe=r.charCodeAt(K);if(Fe===32||Fe===10||dn(Fe)){K++;continue}if(Fe===47){let nn=Ki(r,K);if(nn!==-1){K=nn;continue}}let sn=Se,an=ve;if(Se=!1,ve=!1,Wn(Fe)||Fe===35){let nn=K;K=ua(r,K+1);let rn=sn?tn:sa(r,nn,K);if(U!==void 0&&(rn===Ui||rn===ia))U(nn,Ee===jn||Ee===tn);if(H!==void 0&&te.length===0&&(rn===Jr?L||ga(r,K,W):rn===Ui&&ma(r,K)))K=Math.max(K,H(Le!==-1&&rn===Jr?Le:nn,nn)),Me();else if(rn===Jr)Ee=Pn;else if(rn===Qn)ve=!0,Ee=tn;else Ee=rn===Oe||rn===Pn?rn:tn;continue}switch(K++,Fe){case 34:case 39:{let nn=K-1;K=Yi(r,K,Fe),J?.(nn,K,!1),Ee=tn;break}case 96:{let nn=K;K=zr(r,K,te),J?.(nn,na(r,K),!0),Ee=r.charCodeAt(K-1)===123?Oe:tn;break}case 47:{let nn=Ee===tn?-1:fa(r,K);if(nn===-1)Ee=Oe;else K=Ur(r,nn),Ee=tn;break}case 40:te.push(an?ea:ta),Ee=Oe;break;case 41:Ee=te.pop()===ea?Pn:tn;break;case 123:te.push(Ee===Oe?Er:ra),Ee=jn;break;case 125:{let nn=te.pop();if(nn===qi){let rn=K;K=zr(r,K,te),J?.(rn,na(r,K),!0),Ee=r.charCodeAt(K-1)===123?Oe:tn}else if(nn===Er)Ee=tn;else Me();break}case 59:Me();break;case 44:Ee=te[te.length-1]===Er?jn:Oe;break;case 93:Ee=tn;break;case 46:if(Dn(r.charCodeAt(K)))K=Ur(r,K),Ee=tn;else if(r.startsWith("..",K))K+=2,Ee=Oe;else Se=!0,Ee=Oe;break;case 63:if(r.charCodeAt(K)===46&&!Dn(r.charCodeAt(K+1)))K++,Se=!0;Ee=Oe;break;case 33:Ee=Ee===tn&&!dn(r.charCodeAt(K-2))?tn:Oe;break;case 43:case 45:if(r.charCodeAt(K)===Fe&&Ee===tn)K++;else Ee=Oe;break;case 61:if(Ee=r.charCodeAt(K)===62?Pn:Oe,Ee===Pn)K++;break;case 64:if(te.length===0&&Le===-1)Le=K-1;Ee=Oe;break;default:Ee=Oe}}}function pa(r,y,L){let W=r.length,H=[],J=y,U=Oe,te=!1;while(J<W){let K=r.charCodeAt(J);if(K===32||K===10||dn(K)){J++;continue}if(K===47){let Se=Ki(r,J);if(Se!==-1){J=Se;continue}}let Ee=te;if(te=!1,Wn(K)||K===35){let Se=J;if(J=ua(r,J+1),!Ee&&L?.(Se,J))return-1;let ve=Ee?tn:sa(r,Se,J);U=ve===Oe||ve===Pn||ve===Qn?Oe:tn;continue}switch(J++,K){case 34:case 39:J=Yi(r,J,K),U=tn;break;case 96:J=zr(r,J,H),U=r.charCodeAt(J-1)===123?Oe:tn;break;case 47:{let Se=U===tn?-1:fa(r,J);if(Se===-1)U=Oe;else J=Ur(r,Se),U=tn;break}case 40:H.push(ta),U=Oe;break;case 41:if(H.length===0)return J-1;H.pop(),U=tn;break;case 123:H.push(U===Oe?Er:ra),U=jn;break;case 125:{if(H.length===0)return J-1;let Se=H.pop();if(Se===qi)J=zr(r,J,H),U=r.charCodeAt(J-1)===123?Oe:tn;else U=Se===Er?tn:jn;break}case 93:U=tn;break;case 46:if(Dn(r.charCodeAt(J)))J=Ur(r,J),U=tn;else if(r.startsWith("..",J))J+=2,U=Oe;else te=!0,U=Oe;break;case 63:if(r.charCodeAt(J)===46&&!Dn(r.charCodeAt(J+1)))J++,te=!0;U=Oe;break;case 33:U=U===tn&&!dn(r.charCodeAt(J-2))?tn:Oe;break;case 43:case 45:if(r.charCodeAt(J)===K&&U===tn)J++;else U=Oe;break;case 61:if(r.charCodeAt(J)===62)J++;U=Oe;break;default:U=Oe}}return W}function ca(r){return r===10||r===13||r===8232||r===8233}function da(r,y){for(let L=y;L<r.length;L++)if(ca(r.charCodeAt(L)))return L;return r.length}function Ki(r,y){let L=r.charCodeAt(y+1);if(L===47)return da(r,y+2);if(L!==42)return-1;let W=r.indexOf("*/",y+2);return W===-1?r.length:W+2}function ua(r,y){let L=y;while(L<r.length){let W=r.charCodeAt(L);if(W===92)L+=2;else if(Wn(W))L++;else break}return L}function Ur(r,y){let L=y;while(L<r.length&&Wn(r.charCodeAt(L)))L++;return L}function Yi(r,y,L){for(let W=y;W<r.length;W++){let H=r.charCodeAt(W);if(H===L)return W+1;if(H===92)W+=r.startsWith(`\r
28
+ }`:`{ ${L} }`}function Tc({hasTypeScriptType:r,hasJSDocType:y,inferredType:L,finalType:W}){if(r)return"typescript";if(y)return"jsdoc";if(L!==void 0)return"default";if(W!==void 0)return"inferred";return"unknown"}function dr(r){let y=r.explicitType??r.jsdocType??r.resolvedType??r.typeSeed,L=r.jsdocParams??r.resolvedParams,W=r.jsdocReturnType??r.resolvedReturnType;if((r.isFunctionDeclaration||r.initializerIsFunction)&&y===r.typeSeed&&(W||r.isFunctionDeclaration&&L?.length))y=`${r.jsdocTypeParameters?`<${r.jsdocTypeParameters}>`:""}(${h(L??[])}) => ${W??"any"}`;let J=r.jsdocDescription??r.resolvedDescription;if(J===void 0&&y!==void 0)J=r.typedefs?.get(y)?.description;let U=Tc({hasTypeScriptType:r.explicitType!==void 0,hasJSDocType:r.jsdocType!==void 0||r.jsdocParams!==void 0||r.jsdocReturnType!==void 0||r.resolvedType!==void 0,inferredType:r.inferredTypeForSource,finalType:y}),te=r.initializerIsFunction||r.isFunctionDeclaration||!!r.jsdocParams?.length||r.jsdocReturnType!==void 0||se(r.jsdocType)||se(r.resolvedType)||se(r.explicitType),K=te?r.jsdocTypeParameters:void 0;return{type:y,typeSource:U,description:J,params:L,returnType:W,isFunction:te,typeParameters:K}}function ur(r,y,L){if(L?.explicitDefault===void 0)return L;return r.explicitDefaultPropNames.add(y),{...L,description:L.descriptionWithoutDefault}}function fr(r){return{binding:r?.binding,deprecated:r?.deprecated,tags:r?.tags,...r?.internal?{internal:!0}:{}}}function Rr(r){if(r?.type==="Identifier")return r.name;return typeof r?.value==="string"?r.value:void 0}function ks(r,y){for(let L of r?.body??[]){let W=L.type==="ExportNamedDeclaration"&&L.declaration?L.declaration:L;if(W.type==="VariableDeclaration"){let H=W.declarations.find((J)=>J.id.type==="Identifier"?J.id.name===y:un(J.id).has(y));if(H)return{declaration:W,declarator:H,statement:L}}else if((W.type==="FunctionDeclaration"||W.type==="ClassDeclaration")&&W.id?.name===y)return{declaration:W,statement:L}}return}function Sc(r){return!r.type.startsWith("TS")}function xc(r,y){for(let L of r?.body??[]){if(L.type!=="LabeledStatement"||L.label.name!=="$")continue;if(L.body.type!=="ExpressionStatement")continue;let W=L.body.expression;if(W.type!=="AssignmentExpression"||W.operator!=="=")continue;let{left:H}=W;if(!Sc(H))continue;if(!un(H).has(y))continue;let J={type:"VariableDeclarator",id:H,init:W.right,start:W.start,end:W.end};return{declaration:{type:"VariableDeclaration",kind:"let",declarations:[J],start:L.start,end:L.end},declarator:J,statement:L}}return}function Cc(r){if(r==="var")return"let";if(r==="using"||r==="await using")return"const";return r}function _i(r,y,L,W,H){let J=Rr(L.local),U=Rr(L.exported);if(!J||!U)return;if(y.source!=null)return{localName:J,exportedName:U};let te=ks(W,J);if(!te&&H==="instance")te=ks(r.parsed?.module?.content,J)??xc(W,J);return{localName:J,exportedName:U,...te}}function Ri(r,y,L,W){let H=y.source?.value,J=typeof H==="string"?`it re-exports from "${H}"`:r.valueImportBindingsByLocalName.has(L)?"it re-exports an imported binding":"no matching local declaration was found";en(r,"export-unresolved",W,`export "${W}" was skipped because ${J}; sveld only resolves exports of a local declaration.`,Ve(r,y))}function mr(r,y,L){if(!L)return pn(r,y);let W=y.specifiers.length===1?pn(r,y):void 0,H=pn(r,L.statement);if(!W||!H)return W??H;let J=Object.fromEntries(Object.entries(W).filter(([,U])=>U!==void 0));return{...H,...J,internal:W.internal||H.internal}}function Mi(r,y,L,W){let H=[];if(y.type==="FunctionDeclaration"){if(!y.id)return H;let te=r.scriptLanguage==="ts"?zn(r,y,or(y)):void 0;return H.push({prop_name:L?.exportedName??y.id.name,kind:"function",isFunctionDeclaration:!0,value:void 0,typeSeed:te?.hasAnnotations?void 0:Xn(r,y),explicitType:te?.hasAnnotations?te.signature:void 0,initializerIsFunction:!0,isRequired:!1,localName:y.id.name,defaultValue:void 0,inferredTypeForSource:void 0,resolvedJSDoc:void 0}),H}if(y.type!=="VariableDeclaration")return H;let J=Cc(y.kind),U=L?.declarator?[L.declarator]:y.declarations;for(let{id:te,init:K}of U){if(te.type!=="Identifier"){for(let rn of un(te)){if(L&&L.localName!==rn)continue;H.push({prop_name:L?.exportedName??rn,kind:J,isFunctionDeclaration:!1,value:void 0,typeSeed:void 0,explicitType:void 0,initializerIsFunction:!1,isRequired:!1,localName:rn,defaultValue:void 0,inferredTypeForSource:void 0,resolvedJSDoc:void 0})}continue}let Ee=te.name,Se=L?.exportedName??Ee,ve=K==null?{isFunction:!1}:Sn(r,K),{value:Le,isFunction:Me,defaultValue:Fe}=ve,sn=J==="const"&&(K?.type==="ObjectExpression"||K?.type==="ArrayExpression")&&!r.typeCasts.constAssertions.has(K),nn=(J==="const"&&(K?.type==="ArrowFunctionExpression"||K?.type==="FunctionExpression")?Xn(r,K):void 0)??(sn?xn(K,"literal"):void 0)??ve.type;wr(r,ve,Se,W),H.push({prop_name:Se,kind:J,isFunctionDeclaration:!1,value:Le,typeSeed:nn,explicitType:bc(r,te),initializerIsFunction:Me,isRequired:J==="let"&&K==null,localName:Ee,defaultValue:Fe,inferredTypeForSource:nn,resolvedJSDoc:ve})}return H}function bc(r,y){return ln(r,y.typeAnnotation?.typeAnnotation),yn(r,y.typeAnnotation)}function Ii(r,y,L){let{resolvedJSDoc:W}=y;return dr({explicitType:y.explicitType,typeSeed:y.typeSeed,inferredTypeForSource:y.inferredTypeForSource,jsdocType:L?.type,jsdocDescription:L?.description,jsdocParams:L?.params,jsdocReturnType:L?.returnType,jsdocTypeParameters:L?.typeParameters,resolvedType:W?.resolvedType,resolvedDescription:W?.resolvedDescription,resolvedParams:W?.resolvedParams,resolvedReturnType:W?.resolvedReturnType,initializerIsFunction:y.initializerIsFunction,isFunctionDeclaration:y.isFunctionDeclaration,typedefs:r.typedefs})}function vc(r,y,L){en(r,"export-unresolved",L,`export "${L}" was skipped because a class can't be a prop; export it from the module script instead.`,Ve(r,y))}function ws(r,y,L,W){if(L.type==="ClassDeclaration"){if(L.id)vc(r,y,W?.exportedName??L.id.name);return}let H=Mi(r,L,W,"props");if(H.length===0)return;let J=mr(r,y,W);for(let U of H){let{prop_name:te,kind:K,localName:Ee}=U,Se=ur(r,te,J),{type:ve,typeSource:Le,description:Me,params:Fe,returnType:sn,isFunction:an,typeParameters:nn}=Ii(r,U,Se);Jt(r,te,J?.sveldIgnore),er(r,te,{name:te,...Ee!==void 0&&Ee!==te?{localName:Ee}:{},kind:K,description:Me,...fr(J),type:ve,typeSource:Le,value:Se?.explicitDefault??U.value,defaultValue:U.defaultValue,params:Fe,returnType:sn,typeParameters:nn,isFunction:an,isFunctionDeclaration:U.isFunctionDeclaration,isRequired:U.isRequired,constant:K==="const",reactive:r.reactive_vars.has(te),source:Ve(r,y)})}}function Ls(r,y,L){if(y.declaration!=null){ws(r,y,y.declaration);return}for(let W of y.specifiers){let H=_i(r,y,W,L,"instance");if(!H)continue;if(H.declaration)ws(r,y,H.declaration,H);else Ri(r,y,H.localName,H.exportedName)}}function Dc(r){if(!r||typeof r!=="object"||!("type"in r))return;let y=String(r.type),L=F(y);if(!L&&!_(y))return;let W="name"in r&&typeof r.name==="string"?r.name:void 0;if(!W)return;if(L)return{type:"InlineComponent",name:W};let H={type:"Element",name:W};if(W==="svelte:element"&&"tag"in r&&n(r.tag)){let{tag:J}=r;if(J.type==="Literal"&&typeof J.value==="string")H.thisValue=J.value}return H}function Rs(r,y,L){let W=Dc(y);if(!W)return;if(r.rest_props!==void 0&&!(r.rest_props.type==="InlineComponent"&&W.type==="Element"))return;r.rest_props=W;let H=y&&typeof y==="object"&&"tag"in y?y.tag:void 0;r.restPropsTagLocal=W.name==="svelte:element"&&t(H)?H.name:void 0,r.restPropsSource=Ve(r,L)}function _s(r,y){let L=k(y);if(m(L,"$derived")){let[W]=L.arguments;L=W?.type==="SpreadElement"?void 0:k(W)}if(!c(L))return;for(let W of L.properties){if(W.type!=="SpreadElement"||!t(W.argument))continue;let{name:H}=W.argument;if(H==="$$restProps"||r.restPropLocals.has(H))return H}return}function Ms(r,y){let L=new Map;for(let W of y?.content.body??[]){if(W.type==="VariableDeclaration"){for(let{id:U,init:te}of W.declarations){let K=t(U)?_s(r,te):void 0;if(K&&t(U))L.set(U.name,K)}continue}if(W.type!=="LabeledStatement"||W.label.name!=="$")continue;if(W.body.type!=="ExpressionStatement")continue;let H=W.body.expression;if(H.type!=="AssignmentExpression"||H.operator!=="="||!t(H.left))continue;let J=_s(r,H.right);if(J)L.set(H.left.name,J)}return L}var Pc=/^[A-Za-z_$][\w$]*/,Ac=/[A-Za-z_$][\w$]*/g,Nc=/^(?:(?:const|in|out)\s+)+/;function Is(r){let y=i(r,",").map((W)=>W.trim()).filter((W)=>W.length>0);if(y.length===0)return null;return[y.map((W)=>W.replace(Nc,"").match(Pc)?.[0]??W).join(", "),y.join(", ")]}function Fs(r,y,L){let W=r.scriptGenericsAttribute?.value;if(!W)return;for(let[H]of W.matchAll(Ac)){if(r.typeImportBindingsByLocalName.has(H))y.add(H);if(L.has(H))continue;let J=r.localTypeDeclarationsByName.get(H);if(!J)continue;L.add(H),An(r,J.node,y,L)}}function Mr(r,y,L){if(r.generics)r.generics=[`${r.generics[0]}, ${y}`,`${r.generics[1]}, ${L}`];else r.generics=[y,L]}function Os(r){if(!Array.isArray(r.value))return;return r.value.map((y)=>y.type==="Text"?y.data:"").join("").trim()}function Bs(r){let y=[r.instance,r.module].filter((W)=>W!==void 0),L=!1;for(let W of y){let H=W.attributes.find((J)=>J.name==="lang");if(!H){L=!0;continue}if(Os(H)?.toLowerCase()==="ts")return"ts"}return L?"js":void 0}function $s(r,y){let L=y.instance?.attributes.find((J)=>J.name==="generics");if(!L)return;let W=Ve(r,L),H=Os(L);if(!H)return;return{value:H,source:W}}var Gs=/[A-Za-z_$][\w$]*/y,kc=/[\w$]/,wc=/^\s*\??\s*:/,Lc=/(?:^|[{;,(\n]|\breadonly)\s*$/,_c=/^\s*\[/,Rc=/\b(?:keyof|readonly|unique)\s+$/,Mc=/&\s*$/,Ic=/^\s*&/,Fc=/(?:\||\bextends)\s*$/,Oc=/^\s*(?:\||extends\b)/,Bc=/^(?:keyof|readonly|unique|typeof|infer)\s/,$c=/^(?:abstract\s+)?new\b/,Gc=V(["TSTypeLiteral","TSInterfaceDeclaration","TSTypeAliasDeclaration","TSParenthesizedType","TSTypeReference","TSIntersectionType"]);function Vc(r){let y=r.trim();if(P(y)!==-1||b(y,"?")!==-1||$c.test(y))return 4;if(i(y,"|").length>1)return 3;if(i(y,"&").length>1)return 2;return Bc.test(y)?1:0}function jc(r,y){if(_c.test(y))return 0;if(Rc.test(r))return 1;if(Mc.test(r)||Ic.test(y))return 2;if(Fc.test(r)||Oc.test(y))return 3;return 4}function Wc(r,y){for(let L=y+1;L<r.length;L++)if(r[L]==="\\")L++;else if(r[L]===r[y])return L+1;return r.length}function Hc(r,y){for(let L=y;L<r.length;L++)if(r[L]==="\\")L++;else if(r[L]==="`")return{end:L+1,opensExpression:!1};else if(r[L]==="$"&&r[L+1]==="{")return{end:L+2,opensExpression:!0};return{end:r.length,opensExpression:!1}}function Jc(r,y){if(y.size===0)return r;let L="",W=[],H=0;while(H<r.length){let J=r[H],U=W.length-1;if(J==='"'||J==="'"){let Le=Wc(r,H);L+=r.slice(H,Le),H=Le;continue}if(J==="`"||J==="}"&&W[U]===0){if(J==="}")W.pop();let{end:Le,opensExpression:Me}=Hc(r,H+1);if(Me)W.push(0);L+=r.slice(H,Le),H=Le;continue}if(U>=0&&J==="{")W[U]++;if(U>=0&&J==="}")W[U]--;Gs.lastIndex=H;let te=kc.test(r[H-1]??"")?void 0:Gs.exec(r)?.[0];if(!te){L+=J,H++;continue}H+=te.length;let K=y.get(te),Ee=r.slice(0,H-te.length),Se=r.slice(H),ve=Ee.trimEnd();if(K===void 0||ve.endsWith(".")&&!ve.endsWith("...")||Lc.test(Ee)&&wc.test(Se))L+=te;else L+=Vc(K)>jc(Ee,Se)?`(${K})`:K}return L}function Uc(r,y,L){let W=new Map,H=y.type==="TSInterfaceDeclaration"||y.type==="TSTypeAliasDeclaration"?y.typeParameters?.params:void 0,J=L.typeArguments?.params;if(!H?.length||!J?.length)return W;for(let U=0;U<H.length;U++){let te=H[U]?.name,K=J[U];if(!te||K?.start===void 0||K?.end===void 0)continue;let Ee=cn(r,K.start,K.end)?.trim();if(Ee)W.set(te,Ee)}return W}function Ir(r,y,L,W=new Set){let H=new Map;if(!y?.type)return H;let J=(te)=>{for(let K of te){if(K?.type!=="TSPropertySignature"||K.computed||!K.key)continue;let Ee=p(K.key);if(!Ee)continue;let Se=K.typeAnnotation?.start,ve=K.typeAnnotation?.end;if(Se===void 0||ve===void 0)continue;let Le=cn(r,Se+1,ve)?.trim();if(!Le)continue;ln(r,K.typeAnnotation?.typeAnnotation);let Me=pn(r,K);H.set(Ee,{type:Le,optional:K.optional===!0,source:Ve(r,K),...Me?{jsdoc:Me}:{}})}},U=(te)=>{let K=Ir(r,te,L,W);for(let[Ee,Se]of K)H.set(Ee,Se)};if(!Gc(y))return H;switch(y.type){case"TSTypeLiteral":J(y.members??[]);break;case"TSInterfaceDeclaration":for(let te of y.extends??[]){let K={type:"TSTypeReference",typeName:te.expression,typeArguments:te.typeParameters,start:te.start,end:te.end};U(K)}J(y.body?.body??[]);break;case"TSTypeAliasDeclaration":case"TSParenthesizedType":U(y.typeAnnotation);break;case"TSTypeReference":{let te=jo(y.typeName);if(!te||W.has(te))break;let K=L.get(te);if(!K)break;W.add(te);let Ee=Ir(r,K,L,W);W.delete(te);let Se=Uc(r,K,y);for(let[ve,Le]of Ee)H.set(ve,Se.size===0?Le:{...Le,type:Jc(Le.type,Se)});break}case"TSIntersectionType":for(let te of y.types??[])U(te);break}return H}function Vs(r){return new Map(Array.from(r.localTypeDeclarationsByName,([y,L])=>[y,L.node]))}function zc(r){let y={};for(let[L,W]of Object.entries(r))y[L]={...W.attribute===void 0?{}:{attribute:W.attribute},...W.reflect===void 0?{}:{reflect:W.reflect},...W.type===void 0?{}:{type:W.type}};return y}function Fi(r,y,L){if(y.type==="ImportDeclaration"&&y.source?.value)for(let W of y.specifiers){let H=W.type==="ImportSpecifier";if(y.importKind!=="type"&&!(H&&W.importKind==="type"))continue;let J=W.local.name;r.typeImportBindingsByLocalName.set(J,{importedName:H?ae(W):void 0,localName:J,source:String(y.source.value),specifierType:H?"named":W.type==="ImportDefaultSpecifier"?"default":"namespace"})}if(y.type==="TSEnumDeclaration"||y.type==="TSInterfaceDeclaration"||y.type==="TSTypeAliasDeclaration"){let W=y.type==="TSEnumDeclaration"?Jo(r,y):cn(r,y.start,y.end)?.trim();r.localTypeDeclarationsByName.set(y.id.name,{code:W??"",node:y,start:y.start,...L?{exported:L}:{}})}}function js(r,y){if(r.runesPropsDeclarationMetadataByDeclaratorStart.clear(),r.explicitVariableTypesByName.clear(),r.explicitVariableTypeNodesByName.clear(),r.typeImportBindingsByLocalName.clear(),r.localTypeDeclarationsByName.clear(),r.additionalTypeDependencyNodes.length=0,r.typedRunesPropsDeclarations.length=0,!r.source)return;r.scriptLanguage=Bs(y);let L=y.options?.customElement;r.customElementTag=L?.tag,r.customElement=L?{...L.tag===void 0?{}:{tag:L.tag},...L.shadow==="open"||L.shadow==="none"?{shadow:L.shadow}:{},...L.props?{props:zc(L.props)}:{},...L.extend===void 0?{}:{extend:!0}}:void 0,r.runesOptionOverride=y.options?.runes,r.scriptGenericsAttribute=$s(r,y);let W=new Set;for(let J of y.module?.content.body??[]){if(!J?.type)continue;if(J.type==="ExportNamedDeclaration"&&J.declaration)Fi(r,J.declaration,!0);else if(J.type==="ExportNamedDeclaration"&&!J.source)for(let U of J.specifiers){if(U.local.type!=="Identifier"||U.exported.type!=="Identifier")continue;if(U.local.name===U.exported.name)W.add(U.local.name)}else Fi(r,J,!1)}for(let J of W){let U=r.localTypeDeclarationsByName.get(J);if(U)U.exported=!0}let H=y.instance?.content.body??[];for(let J of H){if(Fi(r,J,!1),J.type!=="VariableDeclaration")continue;for(let{id:U}of J.declarations){if(U.type!=="Identifier")continue;let te=yn(r,U.typeAnnotation);if(!te)continue;let K=U.typeAnnotation?.typeAnnotation;if(r.explicitVariableTypesByName.set(U.name,te),K)r.explicitVariableTypeNodesByName.set(U.name,K)}}for(let J of H){if(J.type!=="VariableDeclaration")continue;for(let U of J.declarations){if(!m(k(U.init),"$props"))continue;let te="typeAnnotation"in U.id?U.id.typeAnnotation:void 0,K=te?void 0:je(U.init),Ee=te?.typeAnnotation??K,Se=te?yn(r,te):Fn(r,K),ve=Ir(r,Ee,Vs(r)),Le=new Set,Me=new Set;An(r,Ee,Le,Me),Fs(r,Le,Me);let Fe={canonicalType:Se,props:ve,referencedImportedTypes:Le,referencedLocalTypes:Me};if(r.runesPropsDeclarationMetadataByDeclaratorStart.set(U.start,Fe),Se)r.typedRunesPropsDeclarations.push(Fe)}}}function qc(r,y){let L=y?.trim();if(!L)return;let W=r.typedefMembersByName.get(L)??d(L,{skipIndexSignatures:!0});return W?new Map(W.map((H)=>[H.name,H])):void 0}function Xc(r){return m(r,"$bindable")?{init:r.arguments[0],bindable:!0}:{init:r,bindable:!1}}function Ws(r,y){for(let L of y.declarations){if(!m(L.init,"$props"))continue;let W=r.runesPropsDeclarationMetadataByDeclaratorStart.get(L.start),H=pn(r,y),J=W?.props.size?void 0:qc(r,H?.type);if(L.id.type==="Identifier"){r.wholePropsLocals.add(L.id.name),r.restPropLocals.add(L.id.name);let te=[...Array.from(J?.values()??[],(K)=>({name:K.name,member:K,typeMetadata:void 0})),...Array.from(W?.props??[],([K,Ee])=>({name:K,member:void 0,typeMetadata:Ee}))];for(let{name:K,member:Ee,typeMetadata:Se}of te){let ve=ur(r,K,Se?.jsdoc),{type:Le,typeSource:Me,description:Fe,params:sn,returnType:an,isFunction:nn}=dr({explicitType:Se?.type,jsdocType:ve?.type??Ee?.type,jsdocDescription:ve?.description??Ee?.description,jsdocParams:ve?.params,jsdocReturnType:ve?.returnType,initializerIsFunction:!1,isFunctionDeclaration:!1,typedefs:r.typedefs});Jt(r,K,ve?.sveldIgnore),er(r,K,{name:K,kind:"let",description:Fe,...fr(ve),type:Le,typeSource:Me,value:ve?.explicitDefault,params:sn,returnType:an,isFunction:nn,isFunctionDeclaration:!1,isRequired:!(Se?.optional??Ee?.optional),constant:!1,reactive:!1,source:Se?.source})}continue}if(L.id.type!=="ObjectPattern")continue;let U=L.id.properties.filter((te)=>{if(te.type!=="Property"||te.computed)return!1;if(!p(te.key))return!1;if(te.value.type==="Identifier")return!0;return te.value.type==="AssignmentPattern"&&te.value.left.type==="Identifier"}).length;for(let te of L.id.properties){if(te.type==="RestElement"){if(te.argument.type==="Identifier")r.restPropLocals.add(te.argument.name);continue}let K=p(te.key);if(!K)continue;let Ee,Se;if(te.value.type==="Identifier")Ee=te.value.name;else{let No=te.value;Ee=No.left.name,Se=No.right}if(!Ee)continue;if(br(r,K,Ee),K==="children")r.snippetPropLocals.add(Ee);let ve=J?.get(K),Le=W?.props.get(K),Me=ur(r,K,pn(r,te)??Le?.jsdoc??(U===1&&!J?H:void 0)),{init:Fe,bindable:sn}=Xc(Se),an=Fe==null?{isFunction:!1}:Sn(r,Fe),{value:nn,type:rn,isFunction:hn,defaultValue:Hl}=an,Jl=Le?.type===void 0&&Me?.type===void 0?an.resolvedType:void 0;wr(r,an,K,"props");let{type:Ul,typeSource:zl,description:ql,params:Xl,returnType:Kl,isFunction:Yl}=dr({explicitType:Le?.type,typeSeed:rn,inferredTypeForSource:rn,jsdocType:Me?.type??ve?.type,jsdocDescription:Me?.description??ve?.description,jsdocParams:Me?.params,jsdocReturnType:Me?.returnType,resolvedType:Jl,resolvedDescription:an.resolvedDescription,resolvedParams:an.resolvedParams,resolvedReturnType:an.resolvedReturnType,initializerIsFunction:hn,isFunctionDeclaration:!1,typedefs:r.typedefs});if(sn)r.reactive_vars.add(K);Jt(r,K,Me?.sveldIgnore),er(r,K,{name:K,...Ee===K?{}:{localName:Ee},kind:"let",description:ql,...fr(Me),...sn?{bindable:!0}:{},type:Ul,typeSource:zl,value:Me?.explicitDefault??nn,defaultValue:Hl,params:Xl,returnType:Kl,isFunction:Yl,isFunctionDeclaration:!1,isRequired:!sn&&Fe==null&&Le?.optional!==!0&&ve?.optional!==!0,constant:!1,reactive:sn,source:Ve(r,te)})}}}function Kc(r){let L=r.indexOf("EventDispatcher");if(L===-1)return;let W=L+15;while(r[W]===" ")W++;if(r[W]!=="<")return;let H=E(r,W);return H===-1?void 0:r.slice(W+1,H)}var Yc=/^["']|["']$/g,Qc=/\?$/,Zc=/^\{/,ed=/\}$/;function nd(r){let y=b(r,":");if(y===-1)return;let L=r.slice(0,y).trim().replace(Qc,"").replace(Yc,""),W=r.slice(y+1).trim();if(!L||!W)return;return{name:L,type:W}}function Hs(r,y,L,W){if(y){for(let[te,K]of Ir(r,y,Vs(r)))r.typedDispatcherEventNames.add(te),_n(r,{name:te,detail:K.type,has_argument:!0,source:K.source});return}let H=Tn(r,L)?.type,J=H?Kc(H):void 0;if(!J)return;let U=J.trim().replace(Zc,"").replace(ed,"");for(let te of i(U,";,")){let K=nd(te.trim());if(!K)continue;r.typedDispatcherEventNames.add(K.name),_n(r,{name:K.name,detail:K.type,has_argument:!0,source:W})}}function Js(r,y){if(r.syntaxMode!=="runes")return;for(let[L,W]of Array.from(r.events.entries())){if(W.type!=="dispatched")continue;if(y.has(L)||r.forwardedEvents.has(L))continue;let H=`on${L}`,J=r.props.get(H);if(!J)continue;let U=J.type!==void 0||J.params!==void 0||J.returnType!==void 0,te=W.detail===void 0||W.detail==="undefined"||W.detail==="null"?"() => void":`(detail: ${W.detail}) => void`;r.props.set(H,{...J,description:J.description??W.description,type:U?J.type:te,typeSource:U?J.typeSource:"inferred",isFunction:!0}),r.events.delete(L)}}var Rn=null;function Mn(r){return!r||r==="default"?Rn:r}function Oi(r,y){switch(y.type){case"Identifier":return{value:y.name,replace:!0};case"Literal":return{value:typeof y.value==="string"?JSON.stringify(y.value):String(y.value),replace:!1};case"MemberExpression":return{value:Ko(r,y),replace:!1};case"ObjectExpression":case"TemplateLiteral":return{value:cn(r,y.start,y.end),replace:!1};case"ArrayExpression":case"ArrayPattern":case"ArrowFunctionExpression":case"AssignmentExpression":case"AssignmentPattern":case"AwaitExpression":case"BinaryExpression":case"CallExpression":case"ChainExpression":case"ClassExpression":case"ConditionalExpression":case"FunctionExpression":case"ImportExpression":case"LogicalExpression":case"MetaProperty":case"NewExpression":case"ObjectPattern":case"RestElement":case"SequenceExpression":case"TaggedTemplateExpression":case"ThisExpression":case"TSAsExpression":case"TSInstantiationExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"UnaryExpression":case"UpdateExpression":case"YieldExpression":break}return{value:void 0,replace:!1}}function td(r,y,L){if(!t(y))return null;let W=qn(r,y.name);if(c(W))return $i(r,W,L).slot_props;let H=On(r,y.name);if(!H)return null;let J=d(H.type);if(!J)return null;let U={};for(let te of J)U[te.name]={value:te.type,replace:!1};return U}function Bi(r,y,L,W,H){let J=td(r,L,H);if(J)return Object.assign(y,J),!0;if(H)return!1;return en(r,"spread-unresolved","slot_props",`Slot props spread a value sveld can't resolve; its shape is widened to "Record<string, any>".`,Ve(r,W)),!1}function $i(r,y,L){let W={},H=!1;for(let J of y.properties){if(J.type==="SpreadElement"){if(!Bi(r,W,J.argument,J,L))H=!0;continue}if(J.type!=="Property"||J.computed)continue;let U=p(J.key);if(!U)continue;W[U]=Oi(r,J.value)}return{slot_props:W,hasUnresolvedSpread:H}}function rd(r,y){if(y.type==="Identifier"){let H=r.propLocalToPublicName.get(y.name);return H?{publicName:H,trackingName:y.name}:null}if(y.type!=="MemberExpression")return null;if(y.object.type!=="Identifier"||!r.wholePropsLocals.has(y.object.name))return null;let{property:L}=y,W;if(!y.computed&&L.type==="Identifier")W=L.name;else if(L.type==="Literal"&&L.value!=null)W=String(L.value);return W?{publicName:W,trackingName:W}:null}function Gi(r){return r.type==="ChainExpression"?r.expression:r}function Us(r,y){let L=Gi(y),W=rd(r,L.callee);return W&&{...W,arguments:L.arguments}}function gr(r,{slot_name:y,slot_props:L,slot_props_unresolved_spread:W,slot_fallback:H,slot_description:J,slot_deprecated:U,slot_tags:te,slot_internal:K,source:Ee}){let Se=Mn(y),ve=r.slots.get(Se);r.slots.set(Se,{name:Se,default:ve?.default??Se===Rn,fallback:H||void 0,slot_props:ve?.slot_props??(L===""?void 0:L),slot_props_unresolved_spread:ve?.slot_props_unresolved_spread||W,description:ve?.description||J?.trim()||void 0,deprecated:ve?.deprecated??U,tags:ve?.tags||te,...ve?.internal||K?{internal:!0}:{},source:Ee||ve?.source})}var zs=/^@component/,id=/\r/g,od=V(["AssignmentExpression","UpdateExpression","CallExpression","SpreadAttribute","FunctionDeclaration","ImportDeclaration","VariableDeclaration","ExportNamedDeclaration","Comment","SlotElement","RenderTag","OnDirective","BindDirective"]);function qs(r){return r&&"id"in r&&r.id&&"name"in r.id?r.id.name:void 0}function sd(r,y,L,W){let H=L.callee.type==="Identifier"?L.callee.name:void 0;if(H==="createEventDispatcher"){let J=qs(W);if(J!==void 0)y.dispatcherName=J,y.dispatcherDeclaratorNode=W;y.dispatcherTypeArgument=L.typeArguments?.params?.[0]}if(H==="$host"){let J=qs(W);if(J!==void 0)y.hostLocalNames.add(J)}if(H==="setContext")Cs(r,L,W?.type==="ExpressionStatement"?W:null);if(L.arguments.length>0){if(y.callsWithArguments.push(L),_r(r,L.callee))y.locallyBoundCalls.add(L)}if(H)y.callees.push({name:H,arguments:L.arguments,node:L,nestedBoundDetailNames:pr(r,L.arguments[1])});if(A(L.callee)&&t(L.callee.property)&&L.callee.property.name==="dispatchEvent"&&(m(L.callee.object,"$host")||t(L.callee.object)&&y.hostLocalNames.has(L.callee.object.name))){let J=As(r,L);if(J)y.hostDispatchedEventNames.add(J.name),y.hostDispatches.push(J)}}function ad(r,y){let L=Array.isArray(y)?y[0]:y;if(L?.type==="Text")return{value:JSON.stringify(L.raw),replace:!1};if(L?.type==="ExpressionTag")return Oi(r,L.expression);return{value:void 0,replace:!1}}function ld(r,y){let L=y.attributes.find((Ee)=>("name"in Ee)&&Ee.name==="name"),W=L&&"value"in L?L.value:void 0,H=Array.isArray(W)?W[0]:void 0,J=H?.type==="Text"?H.data:void 0,U={},te=!1;for(let Ee of y.attributes){if(Ee.type==="SpreadAttribute"){let Se=r.jsDocSlots.has(Mn(J));if(!Bi(r,U,Ee.expression,Ee,Se))te=!0;continue}if(!("value"in Ee)||Ee.name==="name"||Ee.value===!0)continue;U[Ee.name]=ad(r,Ee.value)}let K=y.fragment.nodes.map(({start:Ee,end:Se})=>cn(r,Ee,Se)??"").join("").trim();r.renderedSlots.add(Mn(J)),gr(r,{slot_name:J,slot_props:U,slot_props_unresolved_spread:te||void 0,slot_fallback:K,source:Ve(r,y)})}function pd(r,y){let L=Us(r,y.expression);if(!L){let{callee:K}=Gi(y.expression);if(A(K)&&t(K.object)&&r.wholePropsLocals.has(K.object.name))r.slotsUntracked=!0;return}let W=L.publicName==="children"?void 0:L.publicName,[H,...J]=L.arguments,U,te=!1;if(H===void 0)U={};else if(J.length===0&&H.type==="ObjectExpression"){let K=$i(r,H,r.jsDocSlots.has(Mn(W)));U=K.slot_props,te=K.hasUnresolvedSpread}if(r.renderedSlots.add(Mn(W)),U!==void 0)gr(r,{slot_name:W,slot_props:U,slot_props_unresolved_spread:te||void 0,source:Ve(r,y)});if(U!==void 0||r.slots.has(W??Rn))r.snippetPropLocals.add(L.trackingName)}function cd(r,y,L){let W=y.name;if(y.expression!=null||!W)return;if(L==null||!("name"in L)||typeof L.name!=="string"||!L.name)return;let H=F(L.type)?{type:"InlineComponent",name:L.name}:{type:"Element",name:L.name};r.forwardedEvents.set(W,H);let J=r.events.get(W),U=r.eventDescriptions.get(W);if(!J)r.events.set(W,{type:"forwarded",name:W,element:H,description:U,deprecated:void 0,source:Ve(r,y)});else if(J.type==="forwarded"&&U&&!J.description)r.events.set(W,{...J,description:U,source:J.source||Ve(r,y)})}function dd(r){let{expression:y}=r;if(y.type==="Identifier")return{name:y.name,indexed:!1};if(y.type!=="MemberExpression")return;let L=y;while(L.type==="MemberExpression")L=L.object;if(L.type!=="Identifier")return;let W=r.name==="this"&&y.computed&&y.object.type==="Identifier";return{name:L.name,indexed:W}}function ud(r,y,L,W){if(!L||!(_(L.type)||F(L.type)))return;let H=dd(y);if(!H)return;let J=Lr(r,H.name);if(!J)return;r.reactive_vars.add(J);let U=y.expression.type==="MemberExpression";if(y.name!=="this"||U&&!H.indexed)return;if(!("name"in L)||typeof L.name!=="string")return;let te=H.indexed?"indexed":"direct",K=r.bindings.get(J)??{elements:[],components:[],target:te};if(K.target!==te)K.target="mixed";if(_(L.type)){let Ee=L.name,Se="tag"in L&&t(L.tag)?L.tag.name:void 0;if(!K.elements.some((Le)=>Le.tag===Ee&&Le.namespace===W&&Le.tagLocal===Se))K.elements.push({tag:Ee,namespace:W,...Se?{tagLocal:Se}:{}})}else{let Ee=L.type==="Component"?ee(r,L.name):void 0;if(!Ee)return;if(!K.components.includes(L.name))K.components.push(L.name);r.additionalImportedTypes.set(L.name,{localName:L.name,...Ee})}r.bindings.set(J,K)}function Xs(r){let y={dispatcherName:void 0,dispatcherDeclaratorNode:void 0,dispatcherTypeArgument:void 0,hostLocalNames:new Set,hostDispatchedEventNames:new Set,hostDispatches:[],callees:[],callsWithArguments:[],locallyBoundCalls:new Set};cs(r),r.activeScopes.push(r.componentScope);let L=ds(r),W=new WeakMap,H=r.parsed?.options?.namespace,J=[H==="svg"||H==="mathml"?H:"html"],U=new Map,te={enter(K,Ee){if(oe(K.type))return l;let Se=us(r,L,K);if(Se)r.activeScopes.push(Se);if(_(K.type)){let ve="name"in K?K.name:void 0,Le=ve==="svg"?"svg":ve==="math"?"mathml":J[J.length-1];W.set(K,Le),J.push(ve==="foreignObject"?"html":Le)}if(!od(K))return;switch(K.type){case"AssignmentExpression":Ni(r,K.left);break;case"UpdateExpression":Ni(r,K.argument);break;case"CallExpression":sd(r,y,K,Ee);break;case"SpreadAttribute":{let ve=K.expression.type==="Identifier"?K.expression.name:void 0,Le=(ve!==void 0&&!Gn(r,ve)?U.get(ve):void 0)??ve,Me=r.restPropLocals.has(Le??"");if(Le==="$$restProps"||Me)Rs(r,Ee,K);if((Le==="$$props"||Me)&&Ee&&F(Ee.type))r.slotsUntracked=!0;break}case"FunctionDeclaration":if(K.id?.name)r.funcDecls.set(K.id.name,K);break;case"ImportDeclaration":Z(r,K);break;case"VariableDeclaration":if(r.vars.add(K),Ee?.type==="Program"&&K.declarations.some((ve)=>m(ve.init,"$props")))Ws(r,K);break;case"ExportNamedDeclaration":Ls(r,K,Ee?.type==="Program"?Ee:null);break;case"Comment":{let ve=K.data.trim();if(zs.test(ve))r.componentComment=ve.replace(zs,"").replace(id,""),r.componentCommentSource=Ve(r,K);break}case"SlotElement":ld(r,K);break;case"RenderTag":pd(r,K);break;case"OnDirective":cd(r,K,Ee);break;case"BindDirective":ud(r,K,Ee,(Ee&&W.get(Ee))??"html");break}},leave(K){if(_(K.type))J.pop();if(Yn(K))r.activeScopes.pop(),fs(L,K)}};if(r.parsed?.instance)o(r.parsed.instance,te);if(U=Ms(r,r.parsed?.instance),r.parsed?.fragment)o(r.parsed.fragment,te);return y}var Vi=new Set("abstract accessor arguments as asserts async await break case catch class const continue debugger declare default delete do else enum eval export extends false finally for function get global if implements import in infer instanceof interface intrinsic is keyof let module namespace new null of out override package private protected public readonly return satisfies set static super switch this throw true try type typeof unique var void while with yield".split(" ")),fd=new Set("any bigint boolean false never null number object string symbol true undefined unknown void".split(" ")),md=new Set("get set new readonly static public private protected".split(" "));function Ks(r){return r>=97&&r<=122||r>=65&&r<=90||r===95||r===36}function Fr(r){return r>=48&&r<=57}function ji(r){return Ks(r)||Fr(r)}class Ys{text;pos=0;constructor(r){this.text=r}readAll(){if(!this.type())return!1;return this.peek(),this.pos===this.text.length}peek(){let r=this.text,y=this.pos,L=r.charCodeAt(y);while(L===32||L===9)L=r.charCodeAt(++y);return this.pos=y,L}eat(r){if(this.peek()!==r.charCodeAt(0))return!1;return this.pos++,!0}word(){let r=this.pos;return this.skipWord()?this.text.slice(r,this.pos):void 0}skipWord(){if(!Ks(this.peek()))return!1;let r=this.pos+1;while(ji(this.text.charCodeAt(r)))r++;return this.pos=r,!0}keyword(r){this.peek();let y=this.pos+r.length;if(!this.text.startsWith(r,this.pos)||ji(this.text.charCodeAt(y)))return!1;return this.pos=y,!0}name(){let r=this.word();return r!==void 0&&!Vi.has(r)}string(){let r=this.peek();if(r!==34&&r!==39)return!1;let y=this.text;for(let L=this.pos+1;L<y.length;L++){let W=y.charCodeAt(L);if(W===r)return this.pos=L+1,!0;if(W===92||W===10||W===13||W===8232||W===8233)return!1}return!1}number(){let r=this.text,y=this.pos;if(r.charCodeAt(y)===45)y++;let L=y;while(Fr(r.charCodeAt(y)))y++;if(y===L||y-L>1&&r.charCodeAt(L)===48)return!1;if(r.charCodeAt(y)===46){let H=++y;while(Fr(r.charCodeAt(y)))y++;if(y===H)return!1}let W=r.charCodeAt(y);if(ji(W)||W===46)return!1;return this.pos=y,!0}type(){if(this.peek()===40){let r=this.pos;if(this.functionType())return!0;this.pos=r}do do if(!this.operatorType())return!1;while(this.eat("&"));while(this.eat("|"));return!0}operatorType(){if(this.keyword("keyof"))return this.operatorType();if(!this.primaryType())return!1;while(this.eat("[")){if(this.eat("]"))continue;if(!this.type()||!this.eat("]"))return!1}return!0}primaryType(){let r=this.peek();if(r===40)return this.pos++,this.type()&&this.eat(")");if(r===123)return this.objectType();if(r===91)return this.tupleType();if(r===34||r===39)return this.string();if(r===45||Fr(r))return this.number();let y=this.word();if(y===void 0)return!1;if(y==="typeof")return this.typeQuery();if(y==="import")return this.importType(!0);if(fd.has(y)){let L=this.peek();return L!==46&&L!==60}if(Vi.has(y))return!1;while(this.eat("."))if(!this.skipWord())return!1;return!this.eat("<")||this.typeArguments()}typeArguments(){do if(!this.type())return!1;while(this.eat(","));return this.eat(">")}typeQuery(){if(this.keyword("import"))return this.importType(!1);do if(!this.name())return!1;while(this.eat("."));return!0}importType(r){if(!this.eat("(")||!this.string()||!this.eat(")"))return!1;while(this.eat("."))if(!this.name())return!1;return!r||!this.eat("<")||this.typeArguments()}objectType(){this.pos++;while(!this.eat("}")){if(!this.typeMember())return!1;if(!this.eat(";")&&!this.eat(",")&&this.peek()!==125)return!1}return!0}typeMember(){let r=this.peek();if(this.eat("[")){let y=this.peek();if(y===34||y===39){if(!this.string()||!this.eat("]"))return!1}else return this.name()&&this.eat(":")&&this.type()&&this.eat("]")&&this.eat(":")&&this.type()}else if(r===34||r===39){if(!this.string())return!1}else{let y=this.word();if(y===void 0||md.has(y))return!1}return this.eat("?"),this.eat(":")&&this.type()}tupleType(){if(this.pos++,this.eat("]"))return!0;do if(!this.type())return!1;while(this.eat(","));return this.eat("]")}functionType(){if(this.pos++,!this.eat(")")){let r=new Set;for(;;){this.peek();let y=this.text.startsWith("...",this.pos);if(y)this.pos+=3;let L=this.word();if(L===void 0||Vi.has(L)||r.has(L))return!1;if(r.add(L),!y)this.eat("?");if(!this.eat(":")||!this.type())return!1;if(y||!this.eat(","))break}if(!this.eat(")"))return!1}if(this.peek(),!this.text.startsWith("=>",this.pos))return!1;return this.pos+=2,this.type()}}function gd(r){return new Ys(r).readAll()}var yd=s.extend(ce);function Or(r,y={}){return gd(r)||hd(r,y.inline??!1)}function hd(r,y){let L=!1,W=new yd(y?{ecmaVersion:16,sourceType:"module",onComment:(H,J,U,te)=>{if(!H&&te===r.length)L=!0}}:{ecmaVersion:16,sourceType:"module"},r);try{return W.parseWholeType(),!L}catch(H){if(H instanceof SyntaxError)return!1;throw H}}var Wi=/<!--[\s\S]*?-->|<script\s+(?:[^>]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)\s+)*)lang=(["'])?([^"' >]+)\1[^>]*>/y;function $r(r){return r.charCodeAt(0)===65279?r.slice(1):r}function Dn(r){return r>=48&&r<=57}function dn(r){if(r===32||r<=13&&r>=9)return!0;if(r<160)return!1;return r===160||r===5760||r>=8192&&r<=8202||r===8232||r===8233||r===8239||r===8287||r===12288||r===65279}function on(r,y){let L=y;while(L<r.length&&dn(r.charCodeAt(L)))L++;return L}function Gr(r){let y=r.indexOf("<");while(y!==-1){let L=r.charCodeAt(y+1);if(L===33||L===115){Wi.lastIndex=y;let W=Wi.exec(r);if(W){if(L===115)return W[2]==="ts";y=r.indexOf("<",Wi.lastIndex);continue}}y=r.indexOf("<",y+1)}return!1}function Vr(r,y){let L=r.indexOf("</script",y);while(L!==-1){if(r.charCodeAt(on(r,L+8))===Br)return L;L=r.indexOf("</script",L+8)}return-1}function jr(r,y){return on(r,y+8)+1}var Ed=new Set("area base br col command embed hr img input keygen link meta param source track wbr".split(" "));function yr(r){return Ed.has(r)||r.charCodeAt(0)===33&&r.toLowerCase()==="!doctype"}function Wr(r,y){let L=y;while(L<r.length){let W=r.charCodeAt(L);if(W===47&&r.charCodeAt(L+1)===42){let H=r.indexOf("*/",L+2);L=H===-1?r.length:H+2}else if(W===34||W===39){L++;while(L<r.length){let H=r.charCodeAt(L);if(H===W||H===10)break;L+=H===92?2:1}L++}else if(W===60&&r.startsWith("</style",L))break;else L++}return Math.min(L,r.length)}var Td=34,Sd=39,Qs=47,Zs=61,Br=62,Cn=(r)=>r===Td||r===Sd;function Vn(r,y,L){let W=y;for(;W<r.length;W++){let H=r.charCodeAt(W);if(dn(H)||H===Qs||H===Br)break;if(L&&(Cn(H)||H===Zs))break}return W}function Hr(r,y){let L=r.charCodeAt(y);return dn(L)||Cn(L)||L===Zs||L===60||L===Br||L===96||L===Qs&&r.charCodeAt(y+1)===Br}var jn=0,Oe=1,Pn=2,tn=3,ta=0,ea=1,ra=2,Er=3,qi=4,Qn=4,Ui=5,Jr=6,ia=7,xd={await:Oe,case:Oe,default:Oe,delete:Oe,extends:Oe,in:Oe,instanceof:Oe,new:Oe,of:Oe,return:Oe,throw:Oe,typeof:Oe,void:Oe,yield:Oe,do:Pn,else:Pn,finally:Pn,try:Pn,for:Qn,if:Qn,while:Qn,with:Qn,import:Ui,export:Jr,require:ia},oa=10,zi=Array(Xi(128,0)).fill(null);for(let r of Object.entries(xd)){let y=Xi(r[0].charCodeAt(0),r[0].length),L=zi[y]??[];L.push(r),zi[y]=L}function Xi(r,y){return r*(oa+1)+y}function sa(r,y,L){let W=r.charCodeAt(y);if(W>=128||L-y>oa)return tn;let H=Xi(W,L-y),J=zi[H];if(J===null)return tn;for(let U=0;U<J.length;U++)if(r.startsWith(J[U][0],y))return J[U][1];return tn}var aa=new Uint8Array(128);for(let r of["az","AZ","09","__","$$","\\\\"])for(let y=r.charCodeAt(0);y<=r.charCodeAt(1);y++)aa[y]=1;function Wn(r){return r>=128?!dn(r):aa[r]===1}function la(r,y,L,W=!1){Cd(r,bd(r,y,W),y,W,L,void 0,void 0)}function Cd(r,y,L,W,H,J,U){let te=[],K=r.startsWith("#!")?da(r,2):0,Ee=jn,Se=!1,ve=!1,Le=-1,Me=()=>{if(Ee=jn,te.length===0)Le=-1};while(K<=y){let Fe=r.charCodeAt(K);if(Fe===32||Fe===10||dn(Fe)){K++;continue}if(Fe===47){let nn=Ki(r,K);if(nn!==-1){K=nn;continue}}let sn=Se,an=ve;if(Se=!1,ve=!1,Wn(Fe)||Fe===35){let nn=K;K=ua(r,K+1);let rn=sn?tn:sa(r,nn,K);if(U!==void 0&&(rn===Ui||rn===ia))U(nn,Ee===jn||Ee===tn);if(H!==void 0&&te.length===0&&(rn===Jr?L||ga(r,K,W):rn===Ui&&ma(r,K)))K=Math.max(K,H(Le!==-1&&rn===Jr?Le:nn,nn)),Me();else if(rn===Jr)Ee=Pn;else if(rn===Qn)ve=!0,Ee=tn;else Ee=rn===Oe||rn===Pn?rn:tn;continue}switch(K++,Fe){case 34:case 39:{let nn=K-1;K=Yi(r,K,Fe),J?.(nn,K,!1),Ee=tn;break}case 96:{let nn=K;K=zr(r,K,te),J?.(nn,na(r,K),!0),Ee=r.charCodeAt(K-1)===123?Oe:tn;break}case 47:{let nn=Ee===tn?-1:fa(r,K);if(nn===-1)Ee=Oe;else K=Ur(r,nn),Ee=tn;break}case 40:te.push(an?ea:ta),Ee=Oe;break;case 41:Ee=te.pop()===ea?Pn:tn;break;case 123:te.push(Ee===Oe?Er:ra),Ee=jn;break;case 125:{let nn=te.pop();if(nn===qi){let rn=K;K=zr(r,K,te),J?.(rn,na(r,K),!0),Ee=r.charCodeAt(K-1)===123?Oe:tn}else if(nn===Er)Ee=tn;else Me();break}case 59:Me();break;case 44:Ee=te[te.length-1]===Er?jn:Oe;break;case 93:Ee=tn;break;case 46:if(Dn(r.charCodeAt(K)))K=Ur(r,K),Ee=tn;else if(r.startsWith("..",K))K+=2,Ee=Oe;else Se=!0,Ee=Oe;break;case 63:if(r.charCodeAt(K)===46&&!Dn(r.charCodeAt(K+1)))K++,Se=!0;Ee=Oe;break;case 33:Ee=Ee===tn&&!dn(r.charCodeAt(K-2))?tn:Oe;break;case 43:case 45:if(r.charCodeAt(K)===Fe&&Ee===tn)K++;else Ee=Oe;break;case 61:if(Ee=r.charCodeAt(K)===62?Pn:Oe,Ee===Pn)K++;break;case 64:if(te.length===0&&Le===-1)Le=K-1;Ee=Oe;break;default:Ee=Oe}}}function pa(r,y,L){let W=r.length,H=[],J=y,U=Oe,te=!1;while(J<W){let K=r.charCodeAt(J);if(K===32||K===10||dn(K)){J++;continue}if(K===47){let Se=Ki(r,J);if(Se!==-1){J=Se;continue}}let Ee=te;if(te=!1,Wn(K)||K===35){let Se=J;if(J=ua(r,J+1),!Ee&&L?.(Se,J))return-1;let ve=Ee?tn:sa(r,Se,J);U=ve===Oe||ve===Pn||ve===Qn?Oe:tn;continue}switch(J++,K){case 34:case 39:J=Yi(r,J,K),U=tn;break;case 96:J=zr(r,J,H),U=r.charCodeAt(J-1)===123?Oe:tn;break;case 47:{let Se=U===tn?-1:fa(r,J);if(Se===-1)U=Oe;else J=Ur(r,Se),U=tn;break}case 40:H.push(ta),U=Oe;break;case 41:if(H.length===0)return J-1;H.pop(),U=tn;break;case 123:H.push(U===Oe?Er:ra),U=jn;break;case 125:{if(H.length===0)return J-1;let Se=H.pop();if(Se===qi)J=zr(r,J,H),U=r.charCodeAt(J-1)===123?Oe:tn;else U=Se===Er?tn:jn;break}case 93:U=tn;break;case 46:if(Dn(r.charCodeAt(J)))J=Ur(r,J),U=tn;else if(r.startsWith("..",J))J+=2,U=Oe;else te=!0,U=Oe;break;case 63:if(r.charCodeAt(J)===46&&!Dn(r.charCodeAt(J+1)))J++,te=!0;U=Oe;break;case 33:U=U===tn&&!dn(r.charCodeAt(J-2))?tn:Oe;break;case 43:case 45:if(r.charCodeAt(J)===K&&U===tn)J++;else U=Oe;break;case 61:if(r.charCodeAt(J)===62)J++;U=Oe;break;default:U=Oe}}return W}function ca(r){return r===10||r===13||r===8232||r===8233}function da(r,y){for(let L=y;L<r.length;L++)if(ca(r.charCodeAt(L)))return L;return r.length}function Ki(r,y){let L=r.charCodeAt(y+1);if(L===47)return da(r,y+2);if(L!==42)return-1;let W=r.indexOf("*/",y+2);return W===-1?r.length:W+2}function ua(r,y){let L=y;while(L<r.length){let W=r.charCodeAt(L);if(W===92)L+=2;else if(Wn(W))L++;else break}return L}function Ur(r,y){let L=y;while(L<r.length&&Wn(r.charCodeAt(L)))L++;return L}function Yi(r,y,L){for(let W=y;W<r.length;W++){let H=r.charCodeAt(W);if(H===L)return W+1;if(H===92)W+=r.startsWith(`\r
29
29
  `,W+1)?2:1;else if(H===10||H===13)return W}return r.length}function zr(r,y,L){for(let W=y;W<r.length;W++){let H=r.charCodeAt(W);if(H===96)return W+1;if(H===92)W++;else if(H===36&&r.charCodeAt(W+1)===123)return L.push(qi),W+2}return r.length}function na(r,y){let L=r.charCodeAt(y-1);if(L===96)return y-1;if(L===123&&r.charCodeAt(y-2)===36)return y-2;return y}function fa(r,y){let L=!1;for(let W=y;W<r.length;W++){let H=r.charCodeAt(W);if(ca(H))return-1;if(H===92)W++;else if(H===91)L=!0;else if(H===93)L=!1;else if(H===47&&!L)return W+1}return-1}function hr(r,y){let L=y;while(L<r.length){let W=r.charCodeAt(L);if(dn(W)){L++;continue}let H=W===47?Ki(r,L):-1;if(H===-1)return L;L=H}return r.length}function Hi(r,y,L){return r.charCodeAt(y)===L.charCodeAt(0)&&r.startsWith(L,y)&&!Wn(r.charCodeAt(y+L.length))}function ma(r,y){let L=r.charCodeAt(hr(r,y));return L!==40&&L!==46}function ga(r,y,L){let W=hr(r,y);if(Hi(r,W,"import"))return!0;if(Hi(r,W,"type"))W=hr(r,W+4);let H=r.charCodeAt(W);if(H===42)return!0;if(H!==123)return!1;if(L)return!0;for(W++;W<r.length;W++){let J=r.charCodeAt(W);if(J===125)break;if(J===34||J===39)W=Yi(r,W+1,J)-1;else if(J===47)W=Math.max(W,hr(r,W)-1)}return Hi(r,hr(r,W+1),"from")}var Ji=/import|export/g;function bd(r,y,L){let W=-1;Ji.lastIndex=0;for(let H=Ji.exec(r);H!==null;H=Ji.exec(r)){let J=H.index,U=J+6;if(!Wn(r.charCodeAt(J-1))&&!Wn(r.charCodeAt(U))&&(r.charCodeAt(J)===105?ma(r,U):y||ga(r,U,L)))W=J}return W}var ya={li:["li"],dt:["dt","dd"],dd:["dt","dd"],p:"address article aside blockquote div dl fieldset footer form h1 h2 h3 h4 h5 h6 header hgroup hr main menu nav ol p pre section table ul".split(" "),rt:["rt","rp"],rp:["rt","rp"],optgroup:["optgroup"],option:["option","optgroup"],thead:["tbody","tfoot"],tbody:["tbody","tfoot"],tfoot:["tbody"],tr:["tr","tbody"],td:["td","th","tr"],th:["td","th","tr"]};function qr(r,y){return Object.hasOwn(ya,r)&&ya[r].includes(y)}var ha="{",Sa=60,Zi=62,Hn=47,xa=61,Sr=123,Ea=/\s*>/y,Qi=/<\/textarea(\s[^>]*)?>/iy,vd=["cript","tyle","velte:options"],Ta="</svelte:options";function eo(r){let y=$r(r).trimEnd();return ba(y,Gr(y),null)}function Ca(r){let y={tags:[],comments:[]};return ba(r,!1,y),y}function ba(r,y,L){let W={typescript:y,instance:null,module:null,css:null,options:null},H=Dd(r),J=[],U=0;while(U<=H){let te=r.charCodeAt(U);if(te===Sa)U=Nd(r,U,J,W,L);else if(te===Sr)U=Ad(r,U,J);else U++}return W}function Dd(r){let y=-1,L=r.indexOf("<s");while(L!==-1){let W=Pd(r,L+2);if(W!==-1){let H=r.charCodeAt(W);if(W===r.length||dn(H)||H===Hn||H===Zi)y=L}L=r.indexOf("<s",L+2)}return y}function Pd(r,y){for(let L of vd)if(r.startsWith(L,y))return y+L.length;return-1}function xr(r,y){return Math.min(pa(r,y)+1,r.length)}function Ad(r,y,L){let W=on(r,y+1),H=r.charCodeAt(W),J=r.charCodeAt(W+1);if(H===35||H===58||H===64||H===Hn&&J!==Hn&&J!==42){W++;while(W<r.length){let U=r.charCodeAt(W);if(U<97||U>122)break;W++}if(H===35)L.push(ha);else if(H===Hn){let U=L.lastIndexOf(ha);if(U!==-1)L.length=U}}return xr(r,W)}function Nd(r,y,L,W,H){if(r.startsWith("!--",y+1)){let Se=r.indexOf("-->",y+4),ve=Se===-1?r.length:Se+3;if(H&&L.length===0)H.comments.push(y,ve);return ve}if(r.charCodeAt(y+1)===Hn){let Se=y+2,ve=r.slice(Se,Vn(r,Se,!1)),Le=L.lastIndexOf(ve);if(Le!==-1)L.length=Le;return Tr(r,on(r,Se+ve.length))}let J=r.slice(y+1,Vn(r,y+1,!1)),U=on(r,y+1+J.length),te=L[L.length-1];if(te!==void 0&&qr(te,J))L.pop();let K=L.length===0;if(H&&K&&(J==="script"||J==="style"||J==="svelte:options"))H.tags.push(y);if(K&&(J==="script"||J==="style")){let Se=[];if(U=Tr(r,Ld(r,U,Se)),J==="script"){let Le=kd(r,y,U,Se);if(Le.context==="module")W.module??=Le;else W.instance??=Le;return Le.end}let ve=wd(r,y,U,Se);return W.css??=ve,ve.end}let Ee=K&&J==="svelte:options"?[]:null;if(U=_d(r,U,Ee),r.charCodeAt(U)===Hn||yr(J)){if(r.charCodeAt(U)===Hn)U++;U=Tr(r,U)}else{if(U=Tr(r,U),J==="textarea")return Md(r,U);if(J==="script"||J==="style"){let Se=`</${J}>`,ve=r.indexOf(Se,U);return ve===-1?r.length:ve+Se.length}if(Ee&&r.startsWith(Ta,U))U=Tr(r,on(r,U+Ta.length));else return L.push(J),U}if(Ee)W.options??={start:y,end:U,attributes:Ee};return U}function Tr(r,y){return r.charCodeAt(y)===Zi?y+1:y}function kd(r,y,L,W){let H=Vr(r,L),J=H===-1?r.length:H,U=W.some((te)=>te.name==="module"||te.name==="context");return{start:y,end:H===-1?r.length:jr(r,H),context:U?"module":"default",attributes:W,content:{start:L,end:J}}}function wd(r,y,L,W){let H=Wr(r,L),J=H;if(r.startsWith("</style",J)){J+=7,Ea.lastIndex=J;let U=Ea.exec(r);if(U)J+=U[0].length}return{start:y,end:J,attributes:W,content:{start:L,end:H}}}function Ld(r,y,L){let W=y;for(;;){let H=W,J=Vn(r,W,!0);if(J===H)return W;W=J;let U=!0;if(r.charCodeAt(W)===xa){let te=on(r,W+1),K=r.charCodeAt(te),Ee=-1;if(Cn(K)){let ve=r.indexOf(r[te],te+1);if(ve!==-1)Ee=ve+1}if(Ee===-1){Ee=te;while(Ee<r.length&&r.charCodeAt(Ee)!==Zi&&!dn(r.charCodeAt(Ee)))Ee++}let Se=Cn(K)?1:0;U=r.slice(te+Se,Ee-Se),W=Ee}L.push({name:r.slice(H,J),value:U,start:H,end:W}),W=on(r,W)}}function _d(r,y,L){let W=y;for(;;){for(;;){if(r.startsWith("/*",W)){let K=r.indexOf("*/",W+2);W=K===-1?r.length:K+2}else if(r.startsWith("//",W)){let K=r.indexOf(`
30
30
  `,W+2);W=K===-1?r.length:K}else break;W=on(r,W)}let H=W;if(r.charCodeAt(W)===Sr){W=on(r,xr(r,W+1));continue}let J=Vn(r,W,!0);if(J===H)return W;let U=J,te=!0;if(W=on(r,J),r.charCodeAt(W)===xa){let K=on(r,W+1);U=r.startsWith("/>",K)?K+1:Rd(r,K),te=Cn(r.charCodeAt(K))?r.slice(K+1,Math.max(K+1,U-1)):r.slice(K,U),W=on(r,U)}L?.push({name:r.slice(H,J),value:te,start:H,end:U})}}function Rd(r,y){let L=r.charCodeAt(y);if(Cn(L)){let H=y+1;while(H<r.length){let J=r.charCodeAt(H);if(J===L)return H+1;H=J===Sr?xr(r,H+1):H+1}return r.length}let W=y;while(W<r.length&&!Hr(r,W))W=r.charCodeAt(W)===Sr?xr(r,W+1):W+1;return W}function Md(r,y){let L=y;while(L<r.length){let W=r.charCodeAt(L);if(W===Sa){if(Qi.lastIndex=L,Qi.test(r))return Qi.lastIndex}L=W===Sr?xr(r,L+1):L+1}return r.length}var va={a:"HTMLAnchorElement",abbr:"HTMLElement",address:"HTMLElement",applet:"HTMLUnknownElement",area:"HTMLAreaElement",article:"HTMLElement",aside:"HTMLElement",audio:"HTMLAudioElement",b:"HTMLElement",base:"HTMLBaseElement",basefont:"HTMLElement",bdi:"HTMLElement",bdo:"HTMLElement",bgsound:"HTMLUnknownElement",blink:"HTMLUnknownElement",blockquote:"HTMLQuoteElement",body:"HTMLBodyElement",br:"HTMLBRElement",button:"HTMLButtonElement",canvas:"HTMLCanvasElement",caption:"HTMLTableCaptionElement",cite:"HTMLElement",code:"HTMLElement",col:"HTMLTableColElement",colgroup:"HTMLTableColElement",data:"HTMLDataElement",datalist:"HTMLDataListElement",dd:"HTMLElement",del:"HTMLModElement",details:"HTMLDetailsElement",dfn:"HTMLElement",dialog:"HTMLDialogElement",dir:"HTMLDirectoryElement",div:"HTMLDivElement",dl:"HTMLDListElement",dt:"HTMLElement",em:"HTMLElement",embed:"HTMLEmbedElement",fieldset:"HTMLFieldSetElement",figcaption:"HTMLElement",figure:"HTMLElement",font:"HTMLFontElement",footer:"HTMLElement",form:"HTMLFormElement",frame:"HTMLFrameElement",frameset:"HTMLFrameSetElement",h1:"HTMLHeadingElement",h2:"HTMLHeadingElement",h3:"HTMLHeadingElement",h4:"HTMLHeadingElement",h5:"HTMLHeadingElement",h6:"HTMLHeadingElement",head:"HTMLHeadElement",header:"HTMLElement",hgroup:"HTMLElement",hr:"HTMLHRElement",html:"HTMLHtmlElement",i:"HTMLElement",iframe:"HTMLIFrameElement",img:"HTMLImageElement",input:"HTMLInputElement",ins:"HTMLModElement",isindex:"HTMLUnknownElement",kbd:"HTMLElement",keygen:"HTMLUnknownElement",label:"HTMLLabelElement",legend:"HTMLLegendElement",li:"HTMLLIElement",link:"HTMLLinkElement",listing:"HTMLPreElement",main:"HTMLElement",map:"HTMLMapElement",mark:"HTMLElement",marquee:"HTMLMarqueeElement",menu:"HTMLMenuElement",meta:"HTMLMetaElement",meter:"HTMLMeterElement",multicol:"HTMLUnknownElement",nav:"HTMLElement",nextid:"HTMLUnknownElement",noscript:"HTMLElement",object:"HTMLObjectElement",ol:"HTMLOListElement",optgroup:"HTMLOptGroupElement",option:"HTMLOptionElement",output:"HTMLOutputElement",p:"HTMLParagraphElement",param:"HTMLParamElement",picture:"HTMLPictureElement",pre:"HTMLPreElement",progress:"HTMLProgressElement",q:"HTMLQuoteElement",rp:"HTMLElement",rt:"HTMLElement",ruby:"HTMLElement",s:"HTMLElement",samp:"HTMLElement",script:"HTMLScriptElement",search:"HTMLElement",section:"HTMLElement",select:"HTMLSelectElement",slot:"HTMLSlotElement",small:"HTMLElement",source:"HTMLSourceElement",spacer:"HTMLUnknownElement",span:"HTMLSpanElement",strong:"HTMLElement",style:"HTMLStyleElement",sub:"HTMLElement",summary:"HTMLElement",sup:"HTMLElement",table:"HTMLTableElement",tbody:"HTMLTableSectionElement",td:"HTMLTableCellElement",template:"HTMLTemplateElement",textarea:"HTMLTextAreaElement",tfoot:"HTMLTableSectionElement",th:"HTMLTableCellElement",thead:"HTMLTableSectionElement",time:"HTMLTimeElement",title:"HTMLTitleElement",tr:"HTMLTableRowElement",track:"HTMLTrackElement",u:"HTMLElement",ul:"HTMLUListElement",var:"HTMLElement",video:"HTMLVideoElement",wbr:"HTMLElement",xmp:"HTMLPreElement"},Da={a:"SVGAElement",animate:"SVGAnimateElement",animateMotion:"SVGAnimateMotionElement",animateTransform:"SVGAnimateTransformElement",circle:"SVGCircleElement",clipPath:"SVGClipPathElement",defs:"SVGDefsElement",desc:"SVGDescElement",ellipse:"SVGEllipseElement",feBlend:"SVGFEBlendElement",feColorMatrix:"SVGFEColorMatrixElement",feComponentTransfer:"SVGFEComponentTransferElement",feComposite:"SVGFECompositeElement",feConvolveMatrix:"SVGFEConvolveMatrixElement",feDiffuseLighting:"SVGFEDiffuseLightingElement",feDisplacementMap:"SVGFEDisplacementMapElement",feDistantLight:"SVGFEDistantLightElement",feDropShadow:"SVGFEDropShadowElement",feFlood:"SVGFEFloodElement",feFuncA:"SVGFEFuncAElement",feFuncB:"SVGFEFuncBElement",feFuncG:"SVGFEFuncGElement",feFuncR:"SVGFEFuncRElement",feGaussianBlur:"SVGFEGaussianBlurElement",feImage:"SVGFEImageElement",feMerge:"SVGFEMergeElement",feMergeNode:"SVGFEMergeNodeElement",feMorphology:"SVGFEMorphologyElement",feOffset:"SVGFEOffsetElement",fePointLight:"SVGFEPointLightElement",feSpecularLighting:"SVGFESpecularLightingElement",feSpotLight:"SVGFESpotLightElement",feTile:"SVGFETileElement",feTurbulence:"SVGFETurbulenceElement",filter:"SVGFilterElement",foreignObject:"SVGForeignObjectElement",g:"SVGGElement",image:"SVGImageElement",line:"SVGLineElement",linearGradient:"SVGLinearGradientElement",marker:"SVGMarkerElement",mask:"SVGMaskElement",metadata:"SVGMetadataElement",mpath:"SVGMPathElement",path:"SVGPathElement",pattern:"SVGPatternElement",polygon:"SVGPolygonElement",polyline:"SVGPolylineElement",radialGradient:"SVGRadialGradientElement",rect:"SVGRectElement",script:"SVGScriptElement",set:"SVGSetElement",stop:"SVGStopElement",style:"SVGStyleElement",svg:"SVGSVGElement",switch:"SVGSwitchElement",symbol:"SVGSymbolElement",text:"SVGTextElement",textPath:"SVGTextPathElement",title:"SVGTitleElement",tspan:"SVGTSpanElement",use:"SVGUseElement",view:"SVGViewElement"},Pa=new Set(["a","annotation","annotation-xml","maction","math","merror","mfrac","mi","mmultiscripts","mn","mo","mover","mpadded","mphantom","mprescripts","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msubsup","msup","mtable","mtd","mtext","mtr","munder","munderover","semantics"]);function Xr(r,y){return Object.hasOwn(r,y)?r[y]:void 0}function Aa(r,y="html"){if(y==="svg")return Xr(Da,r)??"SVGElement";if(y==="mathml")return Pa.has(r)?"MathMLElement":Xr(va,r)??"MathMLElement";return Xr(va,r)??Xr(Da,r)??(Pa.has(r)?"MathMLElement":"HTMLElement")}var Na=new Map;function ka(r){let y=Na.get(r);if(y!==void 0)return y;let L=Or(r,{inline:!0});return Na.set(r,L),L}var Id=/^["']|["']$/g,Fd=/^([\w$]+)\s+extends\s/,Od=/^\{\s*\}$/;function Zn(r){return Array.from(r.values())}function no(r,y){if(!r){y.dynamic=!0;return}if(r.type==="Literal"){let{value:L}=r;if(typeof L==="string"||typeof L==="number")y.names.push(String(L));else y.dynamic=!0}else if(r.type==="ConditionalExpression")no(r.consequent,y),no(r.alternate,y);else if(r.type==="TemplateLiteral"){let L=r.quasis.map((W)=>W.value.cooked??W.value.raw);if(L.length===1)y.names.push(L[0]);else y.patterns.push(new RegExp(`^${L.map(B).join("[^]*")}$`))}else y.dynamic=!0}function Bd(r,y){let{dispatcherName:L,callees:W}=y,H=new Set(y.hostDispatchedEventNames),J=[],U=!1;for(let te of y.hostDispatches)Ns(r,te);if(L!==void 0){Hs(r,y.dispatcherTypeArgument,L,Ve(r,y.dispatcherDeclaratorNode));for(let te of W){if(te.name!==L||te.arguments.length===0)continue;let K={names:[],patterns:[],dynamic:!1};if(no(te.arguments[0],K),J.push(...K.patterns),U||=K.dynamic,K.names.length===0)continue;let Ee=te.arguments[1],Se=Li(wi(r,te.nestedBoundDetailNames),Ee);for(let ve of K.names)_n(r,{name:ve,detail:Se,has_argument:Boolean(Ee),source:Ve(r,te.node)}),H.add(ve)}}for(let[te,K]of r.forwardedEvents){let Ee=r.events.get(te);if(Ee&&Ee.type==="dispatched"&&!H.has(te)){let Se=r.eventDescriptions.get(te),ve={type:"forwarded",name:te,element:K,description:Se,deprecated:Ee.deprecated,tags:Ee.tags,source:Ee.source};if(Ee.internal)ve.internal=!0;if(Ee.detail!==void 0&&Ee.detail!=="undefined")ve.detail=Ee.detail;r.events.set(te,ve)}}return{names:H,mayDispatch:(te)=>U||J.some((K)=>K.test(te))}}function $d(r){return`(typeof ${r} extends abstract new (...args: any) => infer I ? I : typeof ${r} extends (...args: any) => infer R ? R : never)`}function wa(r,y){let L=[...La(r,y),...r.components.sort().map($d)].join(" | ");return r.target==="indexed"?`(null | ${L})[]`:`null | ${L}`}function La(r,y){return r.elements.sort((L,W)=>L.tag<W.tag?-1:L.tag>W.tag?1:0).map(({tag:L,namespace:W,tagLocal:H})=>{let J=H&&y?.get(H);return J?`HTMLElementTagNameMap[${J}]`:Aa(L,W)})}function Gd(r){let y=r.syntaxMode==="runes"?new Set(Array.from(r.snippetPropLocals,(L)=>di(r,L))):new Set;return Zn(r.props).filter((L)=>!(y.has(L.name)&&r.slots.has(L.name==="children"?Rn:L.name))).map((L)=>{let W=L.reactive||r.reactive_vars.has(L.name),H=r.bindings.get(L.name),J=H?.target==="indexed"&&L.type!==void 0&&!L.type.endsWith("[]"),U=L.typeSource==="typescript"||L.typeSource==="jsdoc";if(!H||H.target==="mixed"||J||U)return{...L,reactive:W};return{...L,type:wa(H),typeSource:"inferred",reactive:W}})}function Vd(r){return Zn(r.slots).map((y)=>{let{slot_props_unresolved_spread:L,...W}=y,{slot_props:H}=y;if(!H)return{...W,slot_props:H};if(typeof H==="string")return{...W,slot_props:Od.test(H)?"Record<string, never>":H};let J=[];for(let[K,Ee]of Object.entries(H)){if(Ee.replace&&Ee.value!==void 0)Ee.value=jt(r,Ee.value);Ee.value??="any",J.push(`${K}: ${Ee.value}`)}let U=L?" & Record<string, any>":"",te=J.length===0?L?"Record<string, any>":"Record<string, never>":J.length===1?`{ ${J[0]} }${U}`:`{
31
31
  ${J.join(`;
32
32
  `)};
33
33
  }${U}`;return{...W,slot_props:te}}).sort((y,L)=>{let W=y.name??"",H=L.name??"";if(W<H)return-1;if(W>H)return 1;return 0})}function jd(r,y,L){if(r.deferredSlotBlockGenerics.length>0){let W=[...y.map((H)=>H.type??""),...L.map((H)=>H.slot_props??"")].join(`
34
- `);for(let{name:H,constraint:J}of r.deferredSlotBlockGenerics){if(!Ge(W,H))continue;Mr(r,H,J)}}if(r.scriptGenericsAttribute){if(r.generics)en(r,"syntax-skipped","generics",'Both the "generics" script attribute and @generics/@template JSDoc tags declare component generics; the script attribute takes precedence and the JSDoc declaration was ignored.',r.scriptGenericsAttribute.source);r.generics=Is(r.scriptGenericsAttribute.value)}}function Wd(r){return Zn(r.events).map((y)=>y.type==="forwarded"?{...y,element:y.element.name}:y).sort(xe)}function Hd(r,y){let L=new Map(r.pendingCallDefaultCandidates.filter((W)=>W.location==="props").map((W)=>[W.propName,W]));for(let W of y)if(W.typeSource==="unknown"){let H=L.get(W.name),J=H?H.importSource?`Prop "${W.name}" default calls "${H.calleeName}()" imported from "${H.importSource}"; falling back to "any" pending cross-file resolution.`:`Prop "${W.name}" default calls "${H.calleeName}()", but its return type could not be inferred; falling back to "any".`:`Prop "${W.name}" type could not be inferred; falling back to "any".`;en(r,"prop-unknown-type",W.name,J,W.source)}}function Kr(r,y,L,W){if(y===void 0||ka(y))return!0;let H=Or(y)?"has a `//` comment, which would comment out the code after it in the .d.ts":"is not valid TypeScript";return en(r,"type-syntax-error",L,`Type \`${y}\` of "${L}" ${H}; falling back to "any".`,W),!1}function Jd(r,y,L,W,H){for(let J of y)if(J.typeSource==="jsdoc"&&!Kr(r,J.type,J.name,J.source))J.type="any";for(let J of L)if(J.type==="dispatched"&&!Kr(r,J.detail,J.name,J.source))J.detail="any";for(let J of W)if(!Kr(r,J.slot_props,J.name??"default",J.source))J.slot_props="any";for(let J of H)if(!Kr(r,J.type,J.name,J.source))J.type="any",J.ts=`type ${J.name} = any;`}function Ud(r,y){let{dispatcherName:L}=y,W=[];if(L===void 0)return W;let H=[];for(let U of y.callsWithArguments){let te=Ps(U,L);if(te)H.push({call:U,...te})}if(H.length>0)kn(r,"dispatch-escapes",L,Tn(r,L)?.sveldIgnore);let J=mi(r,"dispatch-escapes",L);for(let{call:U,argumentIndex:te,property:K}of H){let Ee=y.locallyBoundCalls.has(U)?void 0:Ae(r,U.callee);if(!Ee){W.push(U);continue}let Se=Ve(r,U);r.pendingDispatchEscapeCandidates.push({importSource:Ee.source,importedName:Ee.importedName,...Ee.members?{members:Ee.members}:{},calleeText:gn(r,U.callee)??Ee.importedName,dispatcherName:L,argumentIndex:te,...K===void 0?{}:{property:K},...Se?{source:Se}:{},...J?{ignored:J}:{}})}return W}function zd(r,y,L){for(let W of r.jsDocEventNames){if(y.names.has(W)||y.mayDispatch(W))continue;if(r.forwardedEvents.has(W)||r.typedDispatcherEventNames.has(W))continue;if(r.props.has(`on${W}`))continue;if(L.length>0)continue;let H=fi(r,"event-no-source",W,`@event "${W}" has no matching dispatch or callback prop.`,r.jsDocEventSources.get(W));if(r.pendingDispatchEscapeCandidates.length>0)r.deferredEventNoSourceDiagnostics.push(H);else r.diagnosticRecords.push(H)}}function qd(r){if(r.slotsUntracked)return;let y=r.syntaxMode==="runes";for(let[L,{tag:W,source:H}]of r.jsDocSlots){let J=L??"children";if(r.renderedSlots.has(L)||y&&r.props.has(J))continue;let U=L===Rn?"default <slot>":`<slot name="${L}">`,te=y?`{@render ${J}()} or "${J}" prop`:U,K=L===Rn?`@${W} documents the default slot, but the component has no ${te}.`:`@${W} "${L}" has no matching ${te} in the component.`;en(r,"slot-not-rendered",L??"default",K,H)}}function Xd(r){let y=r.rest_props;if(y?.type!=="InlineComponent")return;let L=ee(r,y.name),W=r.extends?.import.replace(Id,"");if(L?.importedName==="default"&&L.source===W)return;en(r,"rest-props-unresolved","$$restProps",`$$restProps is only spread onto component "${y.name}"; sveld cannot infer its rest-prop type. Spread onto a plain element or add an @restProps tag.`,r.restPropsSource)}function Kd(r,y){let L=y.typedefs.filter((H)=>H.internal).map((H)=>{let J=H.name.split("<")[0];return{name:J,regex:new RegExp(`\\b${J}\\b`)}});if(L.length===0)return;let W=(H,J,U)=>{if(!J)return;for(let{name:te,regex:K}of L){if(!K.test(J))continue;en(r,"internal-typedef-referenced",H,`"${H}" references "${te}", which is @internal and excluded from output; the generated .d.ts will contain a dangling reference to it.`,U)}};for(let H of[...y.props,...y.moduleExports]){if(H.internal)continue;W(H.name,H.type,H.source)}for(let H of y.typedefs){if(H.internal)continue;W(H.name,H.ts)}for(let H of y.events){if(H.internal||H.type!=="dispatched")continue;W(H.name,H.detail,H.source)}for(let H of y.slots){if(H.internal)continue;W(H.name??"default",H.slot_props,H.source)}for(let H of y.contexts){if(H.internal)continue;if(H.type!==void 0)W(H.typeName,H.type,H.source);for(let J of H.properties)W(J.name,J.type)}}function Yd(r){let y=new Set;for(let L of i(r?.[1]??"",",")){let W=L.trim().match(Fd)?.[1];if(W)y.add(W)}return y}function Qd(r,y){let L=Yd(r.generics),W=new Map;for(let H of y){let J=H.type?.trim();if(J&&L.has(J))W.set(H.localName??H.name,J)}return W}function Zd(r,y,L){if(L.size===0)return;let W=r.rest_props,H=r.restPropsTagLocal===void 0?void 0:L.get(r.restPropsTagLocal);if(W?.type==="Element"&&W.name==="svelte:element"&&!W.thisValue&&H)r.rest_props={...W,thisType:H};for(let[J,U]of y.entries()){let te=r.bindings.get(U.name);if(U.typeSource!=="inferred"||!te?.elements.some(({tagLocal:K})=>K&&L.has(K)))continue;y[J]={...U,type:wa(te,L)}}}var eu=/^(?:(?:HTML|SVG|MathML)\w*)?Element$|^HTMLElementTagNameMap\[[\w$]+\]$/;function nu(r,y,L){for(let W of y){if(W.typeSource!=="typescript"&&W.typeSource!=="jsdoc")continue;let H=r.bindings.get(W.name);if(H?.target!=="direct"||H.components.length>0||W.type===void 0)continue;let J=({tag:Me,tagLocal:Fe})=>Me==="svelte:element"&&!(Fe&&L.has(Fe));if(H.elements.some(J))continue;let U=(Me)=>Me==="null"||Me==="undefined",te=i(W.type,"|").map((Me)=>Me.trim()).filter(Boolean),K=te.filter(U),Ee=te.filter((Me)=>!U(Me));if(!Ee.every((Me)=>eu.test(Me)))continue;let Se=[...new Set(La(H,L))];if(Ee.every((Me)=>Se.includes(Me)))continue;let ve=H.elements.map(({tag:Me,tagLocal:Fe})=>Me==="svelte:element"?`<svelte:element this={${Fe}}>`:`<${Me}>`),Le=(U(te[0]??"")?[...K,...Se]:[...Se,...K]).join(" | ");en(r,"bind-this-type-mismatch",W.name,`Prop "${W.name}" is declared as "${W.type}", but \`bind:this\` only binds it to ${tu(ve)}. Declare "${Le}" instead.`,W.source)}}function tu(r){return r.length<2?r.join(""):`${r.slice(0,-1).join(", ")} and ${r[r.length-1]}`}function _a(r,y){let L=Bd(r,y);Js(r,L.names);let W=Gd(r);r.activeScopes.length=0;let H=Vd(r);jd(r,W,H);let J=Qd(r,W);Zd(r,W,J);let U=Zn(r.moduleExports),te=Wd(r),K=Zn(r.typedefs),Ee=Zn(r.contexts);Hd(r,W),nu(r,W,J),Jd(r,W,te,H,K);let Se=Ud(r,y);zd(r,L,Se),qd(r);let{dispatcherName:ve}=y;for(let sn of Se){let an=gn(r,sn.callee)??"";en(r,"dispatch-escapes",ve??"",`\`${ve}\` is passed to \`${an}\`, which sveld can't follow: it only reads a function imported from another module, by name, as its default export, or through a namespace import. Document the events dispatched there with @event tags.`,Ve(r,sn))}Xd(r),Kd(r,{props:W,moduleExports:U,typedefs:K,events:te,slots:H,contexts:Ee});let Le={source:kr(r,0,r.source?.length),syntaxMode:r.syntaxMode,...r.scriptLanguage?{scriptLanguage:r.scriptLanguage}:{},props:W,moduleExports:U,slots:H,events:te,typedefs:K,generics:r.generics,rest_props:r.rest_props,extends:r.extends,componentComment:r.componentComment,componentCommentSource:r.componentCommentSource,contexts:Ee,customElementTag:r.customElementTag,customElement:r.customElement,...r.cssParts.length>0?{cssParts:r.cssParts.slice()}:{},...r.cssProperties.length>0?{cssProperties:r.cssProperties.slice()}:{},diagnostics:r.diagnosticRecords.slice()},Me=zo(r);if(Me)Le[v]=Me;if(r.propIgnoreCodes.size>0)Le[O]=Object.fromEntries(r.propIgnoreCodes);let Fe=Uo(r);return Fe?{component:Le,pending:Fe}:{component:Le}}function ru(r){if(r.computed)return;if(r.key.type==="Identifier")return r.key.name;if(r.key.type==="Literal"&&(typeof r.key.value==="string"||typeof r.key.value==="number"))return String(r.key.value);return}function Ra(r){return r==="private"||r==="protected"}function Bt(r){return{...r?.description?{description:r.description}:{},...r?.deprecated===void 0?{}:{deprecated:r.deprecated},...r?.tags?{tags:r.tags}:{}}}function Ia(r){return r?.slice(1,-1).trim()||void 0}function iu(r){let y=r?.type==="TSParameterProperty"?r.parameter:r;return y?.type==="AssignmentPattern"?xn(y.right,"widen"):void 0}function to(r,y,L){let W=Zt(r,y),H=new Map((L?.params??[]).map((K)=>[K.name,K])),J=W.params.map(({name:K,type:Ee,optional:Se,rest:ve},Le)=>{let Me=H.get(K);return{name:ve?`...${K}`:K,type:Ee??Me?.type??iu(y.params[Le])??(ve?"any[]":"any"),...Me?.description?{description:Me.description}:{},...!ve&&(Se||Me?.optional)?{optional:!0}:{}}}),U=W.returnType??L?.returnType??(y.async?"Promise<any>":void 0),te=Ia(W.typeParameters)??L?.typeParameters;return{...J.length>0?{params:J}:{},...U?{returnType:U}:{},...te?{typeParameters:te}:{}}}function Fa(r,y){let L=[],W=new Map,H=new Set,J=new Set,U,te=-1;for(let Se of y.body.body){if(Se.type==="TSIndexSignature"){let[an]=Se.parameters;if(!an)continue;ln(r,Se.typeAnnotation?.typeAnnotation),L.push({kind:"index",name:`[${an.name}: ${yn(r,an.typeAnnotation)??"string"}]`,type:yn(r,Se.typeAnnotation)??"any",...Se.static?{static:!0}:{},...Se.readonly?{readonly:!0}:{}});continue}if(Se.type!=="MethodDefinition"&&Se.type!=="PropertyDefinition")continue;if(Ra(Se.accessibility))continue;let ve=ru(Se);if(ve===void 0)continue;let Le=pn(r,Se);if(Le?.internal)continue;let Me=`${Se.static?"static ":""}${ve}`,Fe={...Se.static?{static:!0}:{},...Se.optional?{optional:!0}:{},...Se.abstract?{abstract:!0}:{}};if(Se.type!=="MethodDefinition"){if(ln(r,Se.typeAnnotation?.typeAnnotation),!Se.static)J.add(ve);L.push({kind:"property",name:ve,type:yn(r,Se.typeAnnotation)??Le?.type??xn(Se.value,"widen")??"any",...Fe,...Se.readonly?{readonly:!0}:{},...Bt(Le)});continue}let sn=Se.typeParameters?{...Se.value,typeParameters:Se.typeParameters}:Se.value;if(Se.kind==="constructor"){let an=to(r,sn,Le);L.push({kind:"constructor",name:"constructor",params:an.params,...Bt(Le)}),te=L.length,U=sn.type==="FunctionExpression"?sn.body.body:void 0;for(let[nn,rn]of sn.params.entries()){if(rn.type!=="TSParameterProperty"||Ra(rn.accessibility))continue;let hn=an.params?.[nn];if(!hn)continue;J.add(hn.name),L.push({kind:"property",name:hn.name,type:hn.type,...rn.readonly?{readonly:!0}:{},...hn.description?{description:hn.description}:{}})}continue}if(Se.kind==="get"||Se.kind==="set"){let an=to(r,sn,Le),nn=Se.kind==="get"?an.returnType??Le?.type:an.params?.[0]?.type??Le?.type,rn=W.get(Me);if(rn){if(Se.kind==="set")rn.readonly=void 0;if(nn&&nn!=="any"&&(rn.type==="any"||Se.kind==="get"))rn.type=nn;if(!rn.description&&!rn.deprecated)Object.assign(rn,Bt(Le));continue}let hn={kind:"property",name:ve,type:nn??"any",...Fe,...Se.kind==="get"?{readonly:!0}:{},...Bt(Le)};W.set(Me,hn),L.push(hn);continue}if(sn.type==="TSDeclareMethod"&&!Se.abstract)H.add(Me);else if(sn.type!=="TSDeclareMethod"&&H.has(Me))continue;L.push({kind:"method",name:ve,...Fe,...to(r,sn,Le),...Bt(Le)})}if(r.scriptLanguage!=="ts"&&U)L.splice(te,0,...su(r,U,J));for(let Se of y.typeParameters?.params??[])ln(r,Se.constraint),ln(r,Se.default);let K=Ia(Fn(r,y.typeParameters)),Ee=ou(r,y);return{members:L,...K?{typeParameters:K}:{},...Ee}}function ou(r,y){let L={},W=y.superClass;if(W){if(L.extends=Fn(r,{start:W.start,end:y.superTypeParameters?.end??W.end}),W.type==="Identifier")Ma(r,W,y.superTypeParameters)}let H=(y.implements??[]).map((J)=>(Ma(r,J.expression,J.typeParameters),Fn(r,J))).filter((J)=>Boolean(J));if(H.length>0)L.implements=H;return L}function Ma(r,y,L){ln(r,{type:"TSTypeReference",typeName:y,start:y.start,end:L?.end??y.end,...L?{typeArguments:L}:{}})}function su(r,y,L){let W=[];for(let H of y){let J=H.type==="ExpressionStatement"?H.expression:void 0;if(J?.type!=="AssignmentExpression"||J.operator!=="=")continue;let U=J.left;if(U.type!=="MemberExpression"||U.computed||U.object.type!=="ThisExpression")continue;let te=U.property.type==="Identifier"?U.property.name:void 0;if(!te||L.has(te))continue;L.add(te);let K=pn(r,H);if(K?.internal)continue;W.push({kind:"property",name:te,type:K?.type??"any",...Bt(K)})}return W}var au=/^[A-Za-z_$][\w$]*(?=\s*(?:<|$))/;function Yr(r,y,L){if(!y)return;let W=r.moduleExports.get(y);r.moduleExports.set(y,W?{...W,...L}:L)}function Oa(r,y,L,W){let H=pn(r,y);Yr(r,L==="*"?`* from ${W.from}`:L,{name:L,kind:"re-export",description:H?.description,deprecated:H?.deprecated,tags:H?.tags,...H?.internal?{internal:!0}:{},isFunction:!1,isFunctionDeclaration:!1,isRequired:!1,constant:!1,reactive:!1,reExport:W,source:Ve(r,y)})}function Ba(r,y){en(r,"module-export-conflict","default",`export "default" was skipped because it collides with the component's own default export.`,Ve(r,y))}function lu(r,y,L,W){let H=L.id?.name;if(!H)return;let J=W?.exportedName??H,U=mr(r,y,W),{members:te,typeParameters:K,extends:Ee,implements:Se}=Fa(r,L),ve=K??U?.typeParameters;Yr(r,J,{name:J,...H===J?{}:{localName:H},kind:"class",description:U?.description,deprecated:U?.deprecated,tags:U?.tags,...U?.internal?{internal:!0}:{},type:`typeof ${H}`,...ve?{typeParameters:ve}:{},members:te,...L.abstract?{abstract:!0}:{},...Ee?{extends:Ee}:{},...Se?{implements:Se}:{},isFunction:!1,isFunctionDeclaration:!1,isRequired:!1,constant:!1,reactive:!1,source:Ve(r,y)})}function $a(r,y,L,W){if(L.type==="ClassDeclaration"){lu(r,y,L,W);return}let H=Mi(r,L,W,"moduleExports");if(H.length===0)return;let J=mr(r,y,W);for(let U of H){let{prop_name:te,kind:K}=U,{type:Ee,typeSource:Se,description:ve,params:Le,returnType:Me,isFunction:Fe,typeParameters:sn}=Ii(r,U,J);Yr(r,te,{name:te,kind:K,description:ve,deprecated:J?.deprecated,tags:J?.tags,...J?.internal?{internal:!0}:{},type:Ee,typeSource:Se,value:U.value,defaultValue:U.defaultValue,params:Le,returnType:Me,typeParameters:sn,isFunction:Fe,isFunctionDeclaration:U.isFunctionDeclaration,isRequired:!1,constant:K==="const",reactive:!1,source:Ve(r,y)})}}function pu(r,y){return r.parsed?.fragment.nodes.find((L)=>L.type==="SnippetBlock"&&L.expression.name===y)}function cu(r,y){let L;try{L=R(`function f<${y}>() {}`,{typescript:!0})}catch{return}let W=L.body[0];if(W?.type!=="FunctionDeclaration")return;for(let H of W.typeParameters?.params??[])ln(r,H.constraint),ln(r,H.default)}function du(r,y,L,W){let H=Zt(r,{params:L.parameters}).params,U=H.map((Se,ve)=>{let Le=L.parameters[ve];if(Se.type||Le?.type!=="AssignmentPattern")return Se;return{...Se,type:xn(Le.right,"widen")}}).map((Se)=>`${Se.name}${Se.optional?"?":""}: ${Se.type??"any"}`).join(", ");if(L.typeParams)cu(r,L.typeParams);let te=L.typeParams?`<${L.typeParams}>(${U}) => ReturnType<Snippet>`:U?`Snippet<[${U}]>`:"Snippet",K=mr(r,y,W),Ee=W.exportedName;Yr(r,Ee,{name:Ee,...W.localName===Ee?{}:{localName:W.localName},kind:"const",description:K?.description,deprecated:K?.deprecated,tags:K?.tags,...K?.internal?{internal:!0}:{},type:te,typeSource:r.scriptLanguage==="ts"&&H.every((Se)=>Se.type)?"typescript":"inferred",isFunction:L.typeParams!==void 0,isFunctionDeclaration:!1,isRequired:!1,constant:!0,reactive:!1,source:Ve(r,y)})}function uu(r){let y=Array.from(r.moduleExports.values()).filter((W)=>W.kind==="class"),L=new Set(y.map((W)=>W.localName??W.name));for(let W of y){if(!W.extends)continue;let H=au.exec(W.extends)?.[0];if(H&&(L.has(H)||r.valueImportBindingsByLocalName.has(H)||r.typeImportBindingsByLocalName.has(H)))continue;en(r,"export-unresolved",W.name,`class "${W.name}" extends \`${W.extends}\`, which isn't imported or an exported class, so the .d.ts declares it without \`extends\` and its inherited members are missing. Export the base class from the module script.`,W.source),W.extends=void 0}}function Ga(r){let y=r.parsed?.module;if(!y)return;let L=We(y);o(y,{enter(W,H){if(W.type==="ImportDeclaration")Z(r,W);if(W.type==="FunctionDeclaration"&&W.id?.name)r.funcDecls.set(W.id.name,W);if(W.type==="VariableDeclaration")r.vars.add(W);if(W.type==="ExportNamedDeclaration"){if(W.declaration!=null){$a(r,W,W.declaration);return}let J=W.source?.value,U=H?.type==="Program"?H:null;for(let te of W.specifiers){let K=_i(r,W,te,U,"module");if(!K)continue;if(K.exportedName==="default"){Ba(r,W);continue}let Ee=typeof J==="string"?{from:J,imported:K.localName}:L.get(K.localName),Se=K.declaration||Ee?void 0:pu(r,K.localName);if(K.declaration)$a(r,W,K.declaration,K);else if(Se)du(r,W,Se,K);else if(Ee)Oa(r,W,K.exportedName,Ee);else if(!r.localTypeDeclarationsByName.get(K.localName)?.exported)Ri(r,W,K.localName,K.exportedName)}}if(W.type==="ExportAllDeclaration"&&typeof W.source.value==="string"){let J=(W.exported&&Rr(W.exported))??"*";if(J==="default"){Ba(r,W);return}Oa(r,W,J,{from:W.source.value,imported:"*"})}}}),uu(r)}var fu=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376],mu=/[:!]/;function gu(r){let y;return()=>(y??=yu(r),y)}function yu(r){let y=new Map,L=0,W="";for(let H of r.split(" ")){let J=H.search(mu);W=W.slice(0,Number.parseInt(H[0],36))+H.slice(1,J);let U=Number.parseInt(H.slice(J+1),36);if(y.set(`${W};`,U),H[J]==="!")y.set(W,U);L=Math.max(L,W.length+1)}return{table:y,longest:L}}var ja=gu("0amp!12 1pos:13 0gt!1q 0lt!1o 0quot!y"),ro=(r)=>r>=48&&r<=57,hu=(r)=>ro(r)||r>=65&&r<=70||r>=97&&r<=102,Va=(r)=>ro(r)||r>=65&&r<=90||r>=97&&r<=122,Qr=0;function Eu(r,y,L,W){if(r.charCodeAt(y)===35){let te=(r.charCodeAt(y+1)|32)===120,K=y+(te?2:1),Ee=K;while(Ee<r.length&&(te?hu:ro)(r.charCodeAt(Ee)))Ee++;if(Ee===K)return 0;return Qr=r.charCodeAt(Ee)===59?Ee+1:Ee,Number.parseInt(r.slice(K,Ee),te?16:10)}let{table:H,longest:J}=W(),U=y;while(U-y<J&&Va(r.charCodeAt(U)))U++;if(r.charCodeAt(U)===59){let te=H.get(r.slice(y,U+1));if(te!==void 0)return Qr=U+1,te}for(let te=U;te>y;te--){let K=H.get(r.slice(y,te));if(K===void 0)continue;if(L){let Ee=r.charCodeAt(te);if(Va(Ee)||Ee===95||Ee===61)continue}return Qr=te,K}return 0}function Tu(r,y){if(r===10&&!y)return 32;if(r<128)return r;if(r<=159)return fu[r-128];if(r>=55296&&r<=57343)return 0;if(r<=196607)return r;if(r>=917504&&r<=917631||r>=917760&&r<=917999)return r;return 0}function Gt(r,y,L){let W=r.indexOf("&");if(W===-1)return r;let H="",J=0;while(W!==-1){let U=Eu(r,W+1,y,L);if(U)H+=r.slice(J,W)+String.fromCodePoint(Tu(U,y)),J=Qr;W=r.indexOf("&",U?J:W+1)}return H+r.slice(J)}var Wa=new WeakMap;function io(r,y){let L=Wa.get(r);if(L===void 0)Wa.set(r,[y]);else L.push(y)}var Su=/\r(?!\n)|[\u2028\u2029]/,sl=/\s*}/y;function lo(r,y){let L=r.codePointAt(y);if(L===void 0||!g(L,!0))return y;let W=y+(L<=65535?1:2),H=r.codePointAt(W);while(H!==void 0&&S(H,!0))W+=H<=65535?1:2,H=r.codePointAt(W);return W}class al{source;index=0;loc;lfOnly;isTypeScript;typescript;entityNames;css;script;comments;root;stack;fragments;metaTags=new Set;lastAutoClosedTag;nextAngle=-1;nextBrace=-1;constructor(r,y,L,W={}){if(this.source=r,this.loc=W.loc??!1,this.lfOnly=this.loc&&!Su.test(r),this.isTypeScript=Gr(r),this.typescript=L.typescript,this.isTypeScript&&!this.typescript)ue();this.entityNames=L.entityNames,this.css=W.css??!0,this.script=W.script??!0,this.comments=W.comments??!0,this.root={type:"Root",start:0,end:y,css:null,js:[],options:null,fragment:{type:"Fragment",nodes:[]},comments:[]},this.stack=[this.root],this.fragments=[this.root.fragment]}match(r){if(r.length===1)return this.source.charCodeAt(this.index)===r.charCodeAt(0);return this.source.startsWith(r,this.index)}matchRegex(r){return r.lastIndex=this.index,r.exec(this.source)?.[0]??null}eat(r,y=!1){if(this.match(r))return this.index+=r.length,!0;if(y)D(this.index,r);return!1}read(r){let y=this.matchRegex(r);if(y)this.index+=y.length;return y}readUntil(r){if(this.index>=this.source.length)f(this.source.length);let y=this.source.indexOf(r,this.index),L=y===-1?this.source.length:y,W=this.source.slice(this.index,L);return this.index=L,W}allowWhitespace(){this.index=on(this.source,this.index)}requireWhitespace(){if(!dn(this.source.charCodeAt(this.index)))ut(this.index);this.allowWhitespace()}eatClosingBrace(){this.allowWhitespace(),this.eat("}",!0)}sourceLocation(r,y){return this.loc?{start:x(r),end:x(y)}:void 0}readIdentifierName(){let r=this.index,y=lo(this.source,r),L=this.source.slice(r,y);if(this.index=y,me.has(L))Rt(r,L);let W={type:"Identifier",name:L,start:r,end:y};if(this.loc)W.loc=this.sourceLocation(r,y);return W}current(){return this.stack[this.stack.length-1]}append(r){this.fragments[this.fragments.length-1].nodes.push(r)}open(r,y){this.append(r),this.stack.push(r),this.fragments.push(y)}setFragment(r){this.fragments[this.fragments.length-1]=r}close(){this.stack.pop(),this.fragments.pop()}}var xu={"||":1,"??":1,"&&":2,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"+":9,"-":9,"*":10,"/":10,"%":10};function po(r,y,L,W){return{type:"Literal",start:y,end:L,value:W,raw:r.slice(y,L)}}function Ha(r,y){let L=r.charCodeAt(y);if(L===34||L===39){for(let H=y+1;H<r.length;H++){let J=r.charCodeAt(H);if(J===L)return po(r,y,H+1,r.slice(y+1,H));if(J===92||J===10||J===13)return null}return null}let W=y;for(;W<r.length;W++){let H=r.charCodeAt(W);if(H<48||H>57)break}if(W===y||L===48&&W-y>1)return null;return po(r,y,W,Number(r.slice(y,W)))}function Cu(r,y,L){let W=lo(r,y);if(W===y)return Ha(r,y);let H=r.slice(y,W);if(H==="true"||H==="false"||H==="null")return po(r,y,W,H==="null"?null:H==="true");if(me.has(H))return null;let J={type:"Identifier",start:y,end:W,name:H};for(let U=W;;){let te=r.charCodeAt(U);if(te===40){let Se=bu(r,U+1,L);if(!Se)return null;J={type:"CallExpression",start:y,end:Se.end,callee:J,arguments:Se.arguments,optional:!1},U=Se.end;continue}let K,Ee;if(te===46){if(Ee=lo(r,U+1),Ee===U+1)return null;K={type:"Identifier",start:U+1,end:Ee,name:r.slice(U+1,Ee)}}else if(te===91){if(K=Ha(r,U+1),!K||r.charCodeAt(K.end)!==93)return null;Ee=K.end+1}else return J;J={type:"MemberExpression",start:y,end:Ee,object:J,property:K,computed:te===91,optional:!1},U=Ee}}function bu(r,y,L){let W=[],H=on(r,y);if(r.charCodeAt(H)===41)return{arguments:W,end:H+1};for(;;){let J=ei(r,H,L);if(!J)return null;W.push(J),H=on(r,J.end);let U=r.charCodeAt(H);if(U===41)return{arguments:W,end:H+1};if(U!==44)return null;if(H=on(r,H+1),r.charCodeAt(H)===41)return null}}function go(r,y,L){let W=r.charCodeAt(y),H=r.charCodeAt(y+1);if(!(W===33&&H!==61)&&!(W===45&&H!==45&&H!==61))return Cu(r,y,L);let J=go(r,on(r,y+1),L);if(!J)return null;return{type:"UnaryExpression",start:y,end:J.end,operator:W===33?"!":"-",prefix:!0,argument:J}}function Ja(r,y,L){let W=r.charCodeAt(y),H=r.charCodeAt(y+1);switch(W){case 124:return H===124&&r.charCodeAt(y+2)!==61?"||":null;case 38:return H===38&&r.charCodeAt(y+2)!==61?"&&":null;case 63:return H===63&&r.charCodeAt(y+2)!==61?"??":null;case 61:if(H!==61)return null;return r.charCodeAt(y+2)===61?"===":"==";case 33:if(H!==61)return null;return r.charCodeAt(y+2)===61?"!==":"!=";case 60:case 62:if(L||H===W)return null;if(H===61)return W===60?"<=":">=";return W===60?"<":">";case 43:return H===43||H===61?null:"+";case 45:return H===45||H===61?null:"-";case 42:return H===42||H===61?null:"*";case 47:return H===47||H===42||H===61?null:"/";case 37:return H===61?null:"%";default:return null}}function co(r,y,L,W){if(ll(r.charCodeAt(y.end)))return y;let H=on(r,y.end),J=Ja(r,H,W);if(J===null)return y;let U=xu[J];if(U<=L)return y;let te=go(r,on(r,H+J.length),W);if(!te)return null;let K=co(r,te,J==="??"?2:U,W);if(!K)return null;let Ee;if(J==="||"||J==="&&"||J==="??"){let Se=Ja(r,on(r,K.end),W);if(J==="??"?Se==="||"||Se==="&&":Se==="??")return null;Ee={type:"LogicalExpression",start:y.start,end:K.end,left:y,operator:J,right:K}}else Ee={type:"BinaryExpression",start:y.start,end:K.end,left:y,operator:J,right:K};return co(r,Ee,L,W)}function ei(r,y,L){let W=go(r,y,L);if(!W)return null;let H=co(r,W,-1,L);if(!H||ll(r.charCodeAt(H.end)))return H;let J=on(r,H.end);if(r.charCodeAt(J)!==63)return H;let U=r.charCodeAt(J+1);if(U===46||U===63)return null;let te=ei(r,on(r,J+1),L);if(!te)return null;let K=on(r,te.end);if(r.charCodeAt(K)!==58)return null;let Ee=ei(r,on(r,K+1),L);if(!Ee)return null;return{type:"ConditionalExpression",start:H.start,end:Ee.end,test:H,consequent:te,alternate:Ee}}function ll(r){return r===125||r===41||r===44||r===58}function vu(r,y){let L=r.charCodeAt(on(r,y));return L===125||L===41}function Du(r,y,L){let W=ei(r,y,L);return W&&vu(r,W.end)?W:null}function bn(r){switch(r.loc={start:N(r.start),end:N(r.end)},r.type){case"MemberExpression":bn(r.object),bn(r.property);break;case"CallExpression":bn(r.callee);for(let y of r.arguments)bn(y);break;case"UnaryExpression":bn(r.argument);break;case"BinaryExpression":case"LogicalExpression":bn(r.left),bn(r.right);break;case"ConditionalExpression":bn(r.test),bn(r.consequent),bn(r.alternate);break}}function fn(r){let y=!r.loc||r.lfOnly?Du(r.source,r.index,r.isTypeScript):null;if(y){if(r.index=y.end,r.loc)bn(y);return y}let{node:L,end:W}=G(r,r.source,r.index);return r.index=W,L}var Pu=new Set(["server","client","worker","test","default"]);function Au(r,y,L){let{source:W,index:H}=r;if(H>=W.length)f(W.length);let J=Vr(W,H);if(J===-1)Ne(W.length,"script");r.index=jr(W,J);let U=r.script?he(r,W.slice(0,J),H):{type:"Program",start:H,end:J,body:[],sourceType:"module"};if(U.start=H,U.loc)Object.assign(U.loc.start,N(y)),Object.assign(U.loc.end,N(r.index));else if(r.loc)U.loc={start:N(y),end:N(r.index)};let te="default";for(let K of L){if(Pu.has(K.name))gt(K,K.name);if(K.name==="module"){if(K.value!==!0)mt(K,K.name);te="module"}if(K.name==="context"){let Ee=K.value;if(!Array.isArray(Ee)||Ee.length!==1||Ee[0].type!=="Text"||Ee[0].data!=="module")ht(K);te="module"}}return{type:"Script",start:y,end:r.index,context:te,content:U,attributes:L}}var Nu=/(even|odd|\+?(\d+|\d*n(\s*[+-]\s*\d+)?)|-\d*n(\s*\+\s*\d+))((?=\s*[,)])|\s+of(\s+|(?=[.#[*:&])))/y,ku=/\d+(\.\d+)?%/y,wu=/\\[0-9a-fA-F]{1,6}(\r\n|\s)?/y,Lu=/\s*>/y,In=-1,pl=34,_u=35,Ru=36,Mu=38,cl=39,Iu=40,Fu=41,ri=42,Ou=43,Bu=45,$u=46,dl=47,uo=58,Gu=59,Vu=60,Ua=61,ju=62,Wu=91,yo=92,Hu=93,Ju=94,ul=123,fo=124,Uu=125,fl=126,ni=[];function zu(r,y,L){let W=r.index;ni=[];let H=r.css?Xu(r):qu(r),J=r.index;return r.eat("</style",!0),r.read(Lu),{type:"StyleSheet",start:y,end:r.index,attributes:L,children:H,comments:ni,content:{start:W,end:J,styles:r.source.slice(W,J),comment:null}}}function qu(r){return r.index=Wr(r.source,r.index),[]}function Xu(r){let y=[];for(;;){if(Vt(r,!0),r.match("</style")||r.index>=r.source.length)break;y.push(r.match("@")?ml(r):gl(r))}return y}function ml(r){let y=r.index;r.eat("@",!0);let L=Jn(r),W=ho(r,!0),H=null;if(r.match("{"))H=El(r);else r.eat(";",!0);return{type:"Atrule",start:y,end:r.index,name:L,prelude:W,block:H}}function gl(r){let y=r.index;return{type:"Rule",prelude:yl(r,!1),block:El(r),start:y,end:r.index}}function yl(r,y){let L=[];Vt(r,!0);let W=r.index;while(r.index<r.source.length){L.push(Ku(r,y));let H=r.index;if(Vt(r,!0),r.match(y?")":"{"))return{type:"SelectorList",start:W,end:H,children:L};r.eat(",",!0),Vt(r,!0)}return f(r.source.length)}function za(r,y){return{type:"RelativeSelector",combinator:r,selectors:[],start:y,end:-1}}function Ku(r,y){let{source:L,index:W}=r,H=[],J=za(null,r.index);while(r.index<L.length){let U=r.index,te=L.charCodeAt(U),K=J.selectors;if(te===Mu)r.index++,K.push({type:"NestingSelector",name:"&",start:U,end:r.index});else if(te===ri)r.index++,K.push(qa(r,U,"*"));else if(te===_u)r.index++,K.push({type:"IdSelector",name:Jn(r),start:U,end:r.index});else if(te===$u)r.index++,K.push({type:"ClassSelector",name:Jn(r),start:U,end:r.index});else if(te===uo){let Le=L.charCodeAt(U+1)===uo;r.index+=Le?2:1;let Me=Jn(r),Fe=null;if(r.eat("("))Fe=yl(r,!0),r.eat(")",!0);if(Le)K.push({type:"PseudoElementSelector",name:Me,start:U,end:r.index,...Fe&&{args:Fe}});else K.push({type:"PseudoClassSelector",name:Me,args:Fe,start:U,end:r.index})}else if(te===Wu)r.index++,K.push(Yu(r,U));else{let Le=y?r.read(Nu):null,Me=!Le&&Dn(te)?r.read(ku):null;if(Le)K.push({type:"Nth",value:Le,start:U,end:r.index});else if(Me)K.push({type:"Percentage",value:Me,start:U,end:r.index});else if(hl(L,U)===0){let Fe=Jn(r);K.push(qa(r,U,Fe))}}let Ee=r.index;Vt(r,!1);let Se=r.match(",")||r.match(y?")":"{");if(r.index=Ee,Se)return J.end=Ee,H.push(J),{type:"ComplexSelector",start:W,end:Ee,children:H};let ve=Qu(r);if(ve){if(J.selectors.length>0)J.end=Ee,H.push(J);if(J=za(ve,ve.start),r.allowWhitespace(),r.match(",")||r.match(y?")":"{"))nt(r.index)}}return f(L.length)}function qa(r,y,L){let W=L,H;if(r.eat("|"))H=W,W=r.eat("*")?"*":Jn(r);return{type:"TypeSelector",name:W,...H!==void 0&&{namespace:H},start:y,end:r.index}}function Yu(r,y){let L=r.source;r.allowWhitespace();let W=Jn(r);r.allowWhitespace();let H=null,J=null,U=L.charCodeAt(r.index);if(U===Ua)J="=";else if((U===fl||U===Ju||U===Ru||U===ri||U===fo)&&L.charCodeAt(r.index+1)===Ua)J=L.slice(r.index,r.index+2);if(J)r.index+=J.length,r.allowWhitespace(),H=tf(r);r.allowWhitespace();let te=r.index;while(Sl(L.charCodeAt(r.index)))r.index++;let K=r.index>te?L.slice(te,r.index):null;return r.allowWhitespace(),r.eat("]",!0),{type:"AttributeSelector",start:y,end:r.index,name:W,matcher:J,value:H,flags:K}}function hl(r,y){let L=r.charCodeAt(y);if(L===Ou||L===fl||L===ju)return 1;if(L===fo&&r.charCodeAt(y+1)===fo)return 2;return 0}function Qu(r){let y=r.index;r.allowWhitespace();let L=r.index,W=hl(r.source,L);if(W>0){r.index+=W;let H=r.index;return r.allowWhitespace(),{type:"Combinator",name:r.source.slice(L,H),start:L,end:H}}if(r.index!==y)return{type:"Combinator",name:" ",start:y,end:r.index};return null}function El(r){let y=r.index;r.eat("{",!0);let L=[];while(r.index<r.source.length){if(Vt(r,!0),r.match("}"))break;L.push(Zu(r))}return r.eat("}",!0),{type:"Block",start:y,end:r.index,children:L}}function Zu(r){if(r.match("@"))return ml(r);let y=r.index;ho(r,!1);let L=r.source.charCodeAt(r.index);return r.index=y,L===ul?gl(r):ef(r)}function ef(r){let{source:y,index:L}=r;if(L>=y.length)f(y.length);let W=L;while(W<y.length){let K=y.charCodeAt(W);if(K===uo||dn(K))break;W++}let H=y.slice(L,W);r.index=W,r.allowWhitespace(),r.eat(":");let J=r.index;r.allowWhitespace();let U=ho(r,!0);if(!U&&!H.startsWith("--"))tt({start:L,end:J});let te=r.index;if(!r.match("}"))r.eat(";",!0);return{type:"Declaration",start:L,end:te,property:H,value:U}}function ho(r,y){let L=r.source,W=L.length,H="",J=r.index,U=null,te=!1,K=!1,Ee=In,Se=r.index;while(Se<W){let ve=L.charCodeAt(Se);if(te){te=!1,Se++;continue}if(ve===yo){te=!0,Se++;continue}if(ve===Ee)Ee=In;else if(ve===Fu)K=!1;else if(Ee===In&&(ve===pl||ve===cl))Ee=ve;else if(ve===Iu){if(nf(L,H,J,Se))K=!0}else if((ve===Gu||ve===ul||ve===Uu)&&!K&&Ee===In){if(r.index=Se,!y)return"";if(H+=L.slice(J,Se),U){let Le=H.length-H.trimStart().length;for(let Me of U)Me.position=Math.max(0,(Me.position??0)-Le)}return H.trim()}else if(ve===dl&&!K&&Ee===In&&L.charCodeAt(Se+1)===ri){H+=L.slice(J,Se),r.index=Se;let Le=Tl(r);if(y)Le.position=H.length,ni.push(Le),U??=[],U.push(Le);Se=r.index,J=Se;continue}Se++}return r.index=W,f(W)}function nf(r,y,L,W){if(W-L>=3)return r.charCodeAt(W-3)===117&&r.charCodeAt(W-2)===114&&r.charCodeAt(W-1)===108;return(y+r.slice(L,W)).endsWith("url")}function tf(r){let y=r.source,L=In;if(r.eat('"'))L=pl;else if(r.eat("'"))L=cl;let W=r.index,H=!1,J=W;while(J<y.length){let U=y.charCodeAt(J);if(H)H=!1;else if(U===yo)H=!0;else if(L===In?U===Hu||dn(U):U===L)return r.index=L===In?J:J+1,y.slice(W,J).trim();J++}return r.index=J,f(y.length)}function Jn(r){let{source:y,index:L}=r,W=y.charCodeAt(L);if(Dn(W)||W===Bu&&Dn(y.charCodeAt(L+1)))ke(L);let H="",J=L,U=L;while(U<y.length){let te=y.charCodeAt(U);if(te===yo){H+=y.slice(J,U),r.index=U;let K=r.matchRegex(wu);if(K){let Ee=String.fromCodePoint(Number.parseInt(K.slice(1),16));H+=Ee==="\\"?"\\\\":Ee,U+=K.length}else H+=`\\${y[U+1]}`,U+=2;J=U}else if(te>=160||rf(te))U++;else break}if(H+=y.slice(J,U),r.index=U,H==="")ke(L);return H}function Vt(r,y){let L=r.source;r.allowWhitespace();for(;;){let W=L.charCodeAt(r.index);if(W===dl&&L.charCodeAt(r.index+1)===ri){let H=Tl(r);if(y)ni.push(H)}else if(W===Vu&&r.eat("<!--"))r.readUntil("-->"),r.eat("-->",!0);else break;r.allowWhitespace()}}function Tl(r){let y=r.index;r.eat("/*",!0);let L=r.readUntil("*/");return r.eat("*/",!0),{type:"CSSComment",value:L,start:y,end:r.index}}function Sl(r){return r>=65&&r<=90||r>=97&&r<=122}function rf(r){return Sl(r)||Dn(r)||r===95||r===45}var oo=/<\/textarea(\s[^>]*)?>/iy,of=/^![a-zA-Z]+$/,sf=/^[a-zA-Z][a-zA-Z0-9]*:[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$/,af=/^[a-zA-Z][a-zA-Z0-9]*(-[a-zA-Z0-9.\-_\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}]*)?$/u,so="\\u200C\\u200D",lf=new RegExp(`^(?:\\p{Lu}[$${so}\\p{ID_Continue}.]*|\\p{ID_Start}[$${so}\\p{ID_Continue}]*(?:\\.[$${so}\\p{ID_Continue}]+)+)$`,"u"),pf=new Map([["use","UseDirective"],["animate","AnimateDirective"],["bind","BindDirective"],["class","ClassDirective"],["style","StyleDirective"],["on","OnDirective"],["let","LetDirective"],["in","TransitionDirective"],["out","TransitionDirective"],["transition","TransitionDirective"]]),Eo=new Map([["svelte:head",["SvelteHead",!0]],["svelte:options",["SvelteOptions",!0]],["svelte:window",["SvelteWindow",!0]],["svelte:document",["SvelteDocument",!0]],["svelte:body",["SvelteBody",!0]],["svelte:element",["SvelteElement",!1]],["svelte:component",["SvelteComponent",!1]],["svelte:self",["SvelteSelf",!1]],["svelte:fragment",["SvelteFragment",!1]],["svelte:boundary",["SvelteBoundary",!1]]]),Xa=[...Eo.keys()],cf=`${Xa.slice(0,-1).join(", ")} or ${Xa.at(-1)}`,df=62,Ka=123;function ii(r,y){let L=r.index;if(L>=r.source.length)f(r.source.length);let W=Vn(r.source,L,y);return r.index=W,{name:r.source.slice(L,W),start:L,end:W,loc:r.sourceLocation(L,W)}}var Cr=(r,y,L,W=L)=>({start:r,end:y,type:"Text",raw:L,data:W});function uf(r){let y=r.charCodeAt(0);if(y>=97&&y<=122&&!r.includes("."))return!1;return lf.test(r)}function ff(r){let y=!0;for(let L=0;L<r.length&&y;L++){let W=r.charCodeAt(L);y=W>=97&&W<=122||L>0&&W>=48&&W<=57}return y&&r.length>0||of.test(r)||sf.test(r)||af.test(r)}function Ya(r,y){for(let L=r.length-1;L>=0;L--){let W=y(r[L]);if(W!==void 0)return W}return!1}function mf(r,y,L){let W=Eo.get(y);if(W)return W[0];if(L)return"Component";if(y==="title"){if(Ya(r.stack,({type:H})=>{if(H==="SvelteHead")return!0;return H==="RegularElement"||H==="Component"?!1:void 0}))return"TitleElement"}if(y==="slot"){if(!Ya(r.stack,(H)=>H.type==="RegularElement"&&H.attributes.some((J)=>J.type==="Attribute"&&J.name==="shadowrootmode")?!0:void 0))return"SlotElement"}return"RegularElement"}function To(r){let y=r.index++;if(r.eat("!--")){let L=r.readUntil("-->");r.eat("-->",!0),r.append({type:"Comment",start:y,end:r.index,data:L})}else if(r.eat("/"))gf(r,y);else hf(r,y)}function gf(r,y){let{name:L}=ii(r,!1);if(r.allowWhitespace(),r.eat(">",!0),yr(L))Lt(y);let W=r.current();while(!("name"in W)||W.name!==L){if(W.type==="RegularElement"){if(r.lastAutoClosedTag?.tag!==L)xl(r,W,y,`</${L}>`)}else{let H=r.lastAutoClosedTag;if(H?.tag===L)at(y,L,H.reason);ot(y,L)}W.end=y,r.close(),W=r.current()}if(W.end=r.index,r.close(),r.stack.length<(r.lastAutoClosedTag?.depth??0))r.lastAutoClosedTag=void 0}function xl(r,y,L,W){io(r.root,{code:"element_implicitly_closed",start:y.start,end:y.fragment.nodes[0]?.start??L,by:W,closing:`</${y.name}>`})}function yf(r,y,L){return{type:r,start:y,end:-1,name:L}}function hf(r,y){let L=ii(r,!1),{name:W}=L,H=Eo.get(W);if(!H&&W.startsWith("svelte:"))Ct(L,cf);let J=uf(W);if(!J&&!ff(W))_t(L);if(H?.[1]){if(r.metaTags.has(W))St(y,W);if(r.current().type!=="Root")Tt(y,W);r.metaTags.add(W)}let U=yf(mf(r,W,J),y,W);if(r.loc)U.name_loc=L.loc;U.attributes=[],U.fragment={type:"Fragment",nodes:[]},r.allowWhitespace();let te=r.current();if(te.type==="RegularElement"&&qr(te.name,W))xl(r,te,y,`<${W}>`),te.end=y,r.close(),r.lastAutoClosedTag={tag:te.name,reason:W,depth:r.stack.length};if((W==="script"||W==="style")&&r.current().type==="Root"){let K=[];U.attributes=K,el(r,K,bf),Tf(r,U,y,K);return}if(el(r,U.attributes,Df),U.type==="SvelteComponent"){let K=Qa(U);if(!K)Et(y);if(!ao(K.value))xt(K.start);U.expression=Za(K.value)}else if(U.type==="SvelteElement"){let K=Qa(U);if(!K)Re(y);if(K.value===!0)Re(K);if(!ao(K.value))io(r.root,{code:"svelte_element_invalid_this",start:K.start,end:K.end});U.tag=ao(K.value)?Za(K.value):Cf(K.value[0])}if(!r.eat("/")&&!yr(W))if(r.eat(">",!0),W==="textarea")U.fragment.nodes=bl(r,(K,Ee)=>(oo.lastIndex=Ee,oo.test(K)),"inside <textarea>"),r.read(oo);else if(W==="script"||W==="style")U.fragment.nodes.push(Ef(r,`</${W}>`));else{r.open(U,U.fragment);return}else r.eat(">",!0);U.end=r.index,r.append(U)}function Ef(r,y){let L=r.index,W=r.source.indexOf(y,L);r.index=W===-1?r.source.length:W;let H=Cr(L,r.index,r.source.slice(L,r.index));return r.eat(y,!0),H}function Tf(r,y,L,W){r.eat(">",!0);let H=Sf(r.root.fragment.nodes,L);if(y.name==="style"){let te=zu(r,L,W);if(te.content.comment=H,r.root.css)yt(L);r.root.css=te;return}let J=Au(r,L,W);if(H&&r.comments)J.content.leadingComments=[{type:"Line",value:H.data}];let U=J.context==="module"?"module":"instance";if(r.root[U])ft(L);r.root[U]=J}function Sf(r,y){let L=r.length-1;if(L<0||r[L].end!==y)return null;for(let W=L;W>=0;W--){let H=r[W];if(H.type==="Comment")return H;if(H.type!=="Text"||H.data.trim())return null}return null}var xf=(r)=>r.type==="Attribute"&&r.name==="this";function Qa(r){let y=r.attributes.find(xf);if(y)r.attributes.splice(r.attributes.indexOf(y),1);return y}function ao(r){if(r===!0)return!1;if(!Array.isArray(r))return!0;return r.length===1&&r[0].type==="ExpressionTag"}function Za(r){return(Array.isArray(r)?r[0]:r).expression}function Cf(r){if(r.type!=="Text")return r.expression;return{type:"Literal",value:r.data,raw:`'${r.raw}'`,start:r.start,end:r.end}}function el(r,y,L){let W=new Set;for(;;){let H=L(r);if(!H)return;let{type:J}=H;if(J==="Attribute"||J==="BindDirective"||J==="StyleDirective"||J==="ClassDirective"){let U=`${J==="BindDirective"?"Attribute":J}${H.name}`;if(W.has(U))Ke(H);if(H.name!=="this")W.add(U)}y.push(H),r.allowWhitespace()}}function So(r,y,L,W,H){return r.loc?{type:"Attribute",start:L,end:W,name:y.name,name_loc:y.loc,value:H}:{type:"Attribute",start:L,end:W,name:y.name,value:H}}function Cl(r){if(Cn(r.source.charCodeAt(r.index)))D(r.index,"=")}function bf(r){let y=r.index,L=ii(r,!0);if(!L.name)return null;let W=!0;if(r.eat("=")){r.allowWhitespace();let{source:H}=r,J=r.index,U=Cn(H.charCodeAt(J)),te=-1;if(U){let Se=H.indexOf(H[J],J+1);if(Se!==-1)te=Se+1}if(te===-1){te=J;while(te<H.length&&H.charCodeAt(te)!==df&&!dn(H.charCodeAt(te)))te++;if(te===J)_e(J)}r.index=te;let K=U?1:0,Ee=H.slice(J+K,te-K);W=[Cr(te-Ee.length-K,te-K,Ee,Gt(Ee,!0,r.entityNames))]}return Cl(r),So(r,L,y,r.index,W)}function vf(r){let y=r.index,L=r.match("/*");if(!L&&!r.match("//"))return!1;r.index+=2;let W=r.readUntil(L?"*/":`
35
- `);if(L)r.eat("*/");let H={type:L?"Block":"Line",start:y,end:r.index,value:W},J=r.sourceLocation(y,r.index);if(J)H.loc=J;if(r.comments)r.root.comments.push(H);return!0}function Df(r){while(vf(r))r.allowWhitespace();let y=r.index;if(r.eat("{"))return Pf(r,y);let L=ii(r,!0);if(!L.name)return null;let W=r.index;r.allowWhitespace();let H=!0;if(r.eat("=")){if(r.allowWhitespace(),r.match("/>"))H=[Cr(r.index,r.index+1,"/")],r.index++;else H=kf(r);W=r.index}else Cl(r);let J=L.name.indexOf(":"),U=J>0?pf.get(L.name.slice(0,J)):void 0;return U?Nf(r,U,L,J,y,W,H):So(r,L,y,W,H)}function Pf(r,y){if(r.allowWhitespace(),r.eat("@attach")){r.requireWhitespace();let H=fn(r);return r.eatClosingBrace(),{type:"AttachTag",start:y,end:r.index,expression:H}}if(r.eat("...")){let H=fn(r);return r.eatClosingBrace(),{type:"SpreadAttribute",start:y,end:r.index,expression:H}}let L=r.readIdentifierName();if(L.name==="")qe(y);r.eatClosingBrace();let W={type:"ExpressionTag",start:L.start,end:L.end,expression:L};return So(r,L,y,r.index,W)}function Af(r){if(r===!0)return;return Array.isArray(r)?r[0]:r}function Nf(r,y,L,W,H,J,U){let[te,...K]=L.name.slice(W+1).split("|");if(te==="")st({start:H,end:H+W+1},L.name);let Ee={start:H,end:J,type:y,name:te};if(r.loc)Ee.name_loc=L.loc;if(y==="StyleDirective")return Ee.modifiers=K,Ee.value=U,Ee;let Se=Af(U);if(Se&&(Array.isArray(U)&&U.length>1||Se.type==="Text"))it(Se.start);if(Ee.expression=Se?.expression??null,Ee.modifiers=K,y==="TransitionDirective"){let ve=L.name.slice(0,W);Ee.intro=ve!=="out",Ee.outro=ve!=="in"}if((y==="BindDirective"||y==="ClassDirective")&&!Ee.expression)Ee.expression={start:H+W+1,end:J,type:"Identifier",name:te};return Ee}function kf(r){let y=r.source.charCodeAt(r.index),L=Cn(y);if(L){if(r.index++,r.source.charCodeAt(r.index)===y)return r.index++,[Cr(r.index-1,r.index-1,"")]}let W;try{W=bl(r,L?(H,J)=>H.charCodeAt(J)===y:Hr,"in attribute value",L?y:void 0)}catch(H){let J=H instanceof e&&H.code==="js_parse_error"?H.position?.[0]:void 0;if(J!==void 0&&r.source.startsWith("/>",J-1))r.index=J,D(J,L?String.fromCharCode(y):"}");throw H}if(L)r.index++;else if(W.length===0)_e(r.index);return L||W.length>1||W[0].type==="Text"?W:W[0]}function bl(r,y,L,W){let{source:H}=r,J=[],U=r.index,te=(K)=>{if(K<=U)return;let Ee=H.slice(U,K);J.push(Cr(U,K,Ee,Gt(Ee,!0,r.entityNames)))};while(r.index<H.length){let K=r.index;if(y(H,K))return te(K),J;if(H.charCodeAt(K)!==Ka){if(r.index++,W!==void 0)while(r.index<H.length&&H.charCodeAt(r.index)!==Ka&&H.charCodeAt(r.index)!==W)r.index++;continue}r.index++;let Ee=H.charCodeAt(r.index);if(Ee===35||Ee===64){r.index++;let ve=r.index;while(r.index<H.length&&H.charCodeAt(r.index)>=97&&H.charCodeAt(r.index)<=122)r.index++;let Le=H.slice(ve,r.index);(Ee===35?Ye:$t)(K,Le,L)}te(K),r.allowWhitespace();let Se=fn(r);r.eatClosingBrace(),J.push({type:"ExpressionTag",start:K,end:r.index,expression:Se}),U=r.index}f(H.length)}var wf=new Map([["html","html"],["svg","svg"],["mathml","mathml"],["http://www.w3.org/2000/svg","svg"],["http://www.w3.org/1998/Math/MathML","mathml"]]),Lf=new Map([["type",(r,y)=>{if(y!=="String"&&y!=="Number"&&y!=="Boolean"&&y!=="Array"&&y!=="Object")return!1;return r.type=y,!0}],["reflect",(r,y)=>{if(typeof y!=="boolean")return!1;return r.reflect=y,!0}],["attribute",(r,y)=>{if(typeof y!=="string")return!1;return r.attribute=y,!0}]]),nl="[a-z0-9_.\\xB7\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u203F-\\u2040\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u{10000}-\\u{EFFFF}-]",_f=new RegExp(`^[a-z]${nl}*-${nl}*$`,"u"),Rf=new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" ")),Zr=(r)=>(y,L)=>{let W=ti(L);if(typeof W!=="boolean")fe(L,"true or false");y[r]=W},Mf=new Map([["runes",Zr("runes")],["immutable",Zr("immutable")],["preserveWhitespace",Zr("preserveWhitespace")],["accessors",Zr("accessors")],["namespace",(r,y)=>{let L=wf.get(ti(y));if(!L)fe(y,'"html", "mathml" or "svg"');r.namespace=L}],["css",(r,y)=>{if(ti(y)!=="injected")fe(y,'"injected"');r.css="injected"}],["tag",(r,y)=>bt(y)],["customElement",(r,y)=>{let L=Of(y);if(L)r.customElement=L}]]);function If(r){let y=[],L={start:r.start,end:r.end,attributes:y};for(let W of r.attributes){if(W.type!=="Attribute")Pt(W);y.push(W);let H=Mf.get(W.name);if(!H)Nt(W,W.name);H(L,W)}return L}function ti({value:r}){if(r===!0)return!0;let y=Array.isArray(r)?r:[r];if(y.length===0)return!0;if(y.length>1)return null;let[L]=y;if(L.type==="Text")return L.data;return L.expression.type==="Literal"?L.expression.value:null}function tl(r,y){if(typeof y!=="string")Ie(r);if(!y)return;if(!_f.test(y))Ie(r);if(Rf.has(y))Dt(r)}function mo(r){return r.type==="Property"&&!r.computed&&r.key.type==="Identifier"}function Ff(r,y){let L=new Map;for(let W of r.properties){if(!mo(W))y();if(!L.has(W.key.name))L.set(W.key.name,W.value)}return L}function Of(r){let y=()=>At(r);if(r.value===!0)y();let L=Array.isArray(r.value)?r.value[0]:r.value;if(L.type==="Text"){let Se=ti(r);return tl(r,Se),{tag:Se}}let{expression:W}=L;if(W.type!=="ObjectExpression"){if(W.type==="Literal"&&W.value===null)return;y()}let H=Ff(W,y),J={},U=H.get("tag");if(U){let Se=U.type==="Literal"?U.value:void 0;tl(null,Se),J.tag=Se}let te=H.get("props");if(te){let Se=()=>wt(r);if(te.type!=="ObjectExpression")Se();J.props={};for(let ve of te.properties){if(!mo(ve)||ve.value.type!=="ObjectExpression")Se();let Le={};J.props[ve.key.name]=Le;for(let Me of ve.value.properties){if(!mo(Me)||Me.value.type!=="Literal")Se();if(!Lf.get(Me.key.name)?.(Le,Me.value.value))Se()}}}let K=H.get("shadow");if(K)if(K.type==="ObjectExpression")J.shadow=K;else if(K.type==="Literal"&&(K.value==="open"||K.value==="none"))J.shadow=K.value;else kt(r);let Ee=H.get("extend");if(Ee)J.extend=Ee;return J}var Bf={"{":"}","(":")","[":"]"};function xo(r,y,L=Bf){let W=Object.values(L),H=[],J=y;while(J<r.length){let U=r[J++];if(U==="'"||U==='"'||U==="`")J=$f(r,J,U);else if(U===">"&&r[J-2]==="="&&W.includes(">"));else if(Object.hasOwn(L,U))H.push(U);else if(W.includes(U)){let te=L[H.pop()??""];if(U!==te)D(J-1,te);if(H.length===0)return J}}f(r.length)}function $f(r,y,L){let W=y;while(W<r.length){let H=r[W++];if(H===L)return W;if(H==="\\")W++;else if(L==="`"&&H==="$"&&r[W]==="{")W=xo(r,W)}It(y)}var Gf=/\?(?=\s*:)/g;function oi(r){let y=r.index,L=r.readIdentifierName();if(L.name!=="")return{...L,typeAnnotation:rl(r)};let W=r.source[r.index];if(W!=="{"&&W!=="[")lt(r.index);r.index=xo(r.source,y);let H=Ot(r,r.source.slice(0,r.index),y)??Vf(r,y);Ce(H,"ObjectPattern","ArrayPattern");let J=rl(r);if(H.typeAnnotation=J,J)H.end=J.end;return H}function Vf(r,y){let{node:L}=G(r,`${r.source.slice(0,r.index)} = 1`,y);return Ce(L,"AssignmentExpression"),L.left}function rl(r){let y=r.index;if(r.allowWhitespace(),!r.eat(":")){r.index=y;return}let L="_ as ",W=r.index-L.length,H=r.source.slice(0,W)+L+r.source.slice(r.index).replace(Gf," "),J=G(r,H,W).node;if(J.type==="AssignmentExpression"){let U=J.right.start;while(H[U]!=="=")U-=1;J=G(r,H.slice(0,U),W).node}if(J.type==="SequenceExpression")J=J.expressions[0];return r.index=J.end,{type:"TSTypeAnnotation",start:y,end:r.index,typeAnnotation:J.type==="TSAsExpression"?J.typeAnnotation:void 0}}var jf={IfBlock:"if",EachBlock:"each",KeyBlock:"key",AwaitBlock:"await",SnippetBlock:"snippet"},Nn=()=>({type:"Fragment",nodes:[]});function Wf(r,y){if(r.eat("if")){r.requireWhitespace();let L=fn(r);r.eatClosingBrace();let W=Nn();r.open({type:"IfBlock",elseif:!1,start:y,end:-1,test:L,consequent:W,alternate:null},W)}else if(r.eat("each"))Jf(r,y);else if(r.eat("await")){r.requireWhitespace();let L=fn(r);r.allowWhitespace();let W={type:"AwaitBlock",start:y,end:-1,expression:L,value:null,error:null,pending:null,then:null,catch:null},H=Nn();if(r.eat("then"))W.value=il(r),W.then=H;else if(r.eat("catch"))W.error=il(r),W.catch=H;else W.pending=H;r.eat("}",!0),r.open(W,H)}else if(r.eat("key")){r.requireWhitespace();let L=fn(r);r.eatClosingBrace();let W=Nn();r.open({type:"KeyBlock",start:y,end:-1,expression:L,fragment:W},W)}else if(r.eat("snippet"))Uf(r,y);else pt(r.index)}function il(r){if(r.matchRegex(sl))return r.allowWhitespace(),null;r.requireWhitespace();let y=oi(r);return r.allowWhitespace(),y}function Hf(r){let y={assertion:null},L=r.end,W=(J)=>{if(J.type==="TSAsExpression"&&J.end===r.end)return y.assertion=J,L=J.expression.end,J.expression;return q(J,W),J},H=r;if(r.type==="TSAsExpression")y.assertion=r,H=r.expression,L=H.end;else q(r,W);return H.end=L,{expression:H,assertion:y.assertion}}function Jf(r,y){r.requireWhitespace();let L=r.source,W;while(!W)try{W=fn(r)}catch(K){let Ee=((K instanceof e?K.position:void 0)?.[0]??y)-2;while(Ee>y&&r.source.slice(Ee,Ee+2)!=="as")Ee-=1;if(Ee<=y)throw r.source=L,K;r.source=L.slice(0,Ee)}if(r.source=L,r.allowWhitespace(),!r.match("as")){if(W.type==="SequenceExpression")W=W.expressions[0];let K=Hf(W);if(W=K.expression,K.assertion){let Ee=K.assertion.typeAnnotation.start-2;while(r.source.slice(Ee,Ee+2)!=="as")Ee-=1;r.index=Ee}}let H=null,J,U;if(r.eat("as"))r.requireWhitespace(),H=oi(r);else r.index=W.end;if(r.allowWhitespace(),r.eat(",")){if(r.allowWhitespace(),J=r.readIdentifierName().name,!J)$e(r.index);r.allowWhitespace()}if(r.eat("("))r.allowWhitespace(),U=fn(r),r.allowWhitespace(),r.eat(")",!0),r.allowWhitespace();r.eat("}",!0);let te=Nn();r.open({type:"EachBlock",start:y,end:-1,expression:W,body:te,context:H,index:J,key:U},te)}function Uf(r,y){r.requireWhitespace();let L=r.readIdentifierName();if(L.name==="")$e(r.index);r.allowWhitespace();let W=r.index,H;if(r.isTypeScript&&r.match("<")){let K=xo(r.source,W,{"<":">"});H=r.source.slice(W+1,K-1),r.index=K}r.allowWhitespace(),r.eat("(",!0);let J=1;while(r.index<r.source.length&&(!r.match(")")||J!==1)){if(r.match("("))J++;if(r.match(")"))J--;r.index+=1}r.eat(")",!0);let{node:U}=G(r,`${r.source.slice(0,r.index)} => {}`,W,!0);r.eatClosingBrace();let te=Nn();r.open({type:"SnippetBlock",start:y,end:-1,expression:L,typeParams:H,parameters:U.type==="ArrowFunctionExpression"?U.params:void 0,body:te},te)}function zf(r,y){let L=r.index-1,W=r.current();if(W.type==="IfBlock"){if(!r.eat("else"))D(L,"{:else} or {:else if}");if(r.eat("if"))Xe(L);if(W.alternate)de(L,"{:else}");if(r.allowWhitespace(),W.alternate=Nn(),r.setFragment(W.alternate),r.eat("if")){r.requireWhitespace();let H=fn(r);r.eatClosingBrace();let J=Nn();r.open({start:y,end:-1,type:"IfBlock",elseif:!0,test:H,consequent:J,alternate:null},J)}else r.eatClosingBrace()}else if(W.type==="EachBlock"){if(!r.eat("else"))D(L,"{:else}");if(W.fallback)de(L,"{:else}");r.eatClosingBrace(),W.fallback=Nn(),r.setFragment(W.fallback)}else if(W.type==="AwaitBlock"){let H;if(r.eat("then"))H="then";else if(r.eat("catch"))H="catch";else D(L,"{:then ...} or {:catch ...}");if(W[H])de(L,`{:${H}}`);if(!r.eat("}")){r.requireWhitespace();let U=oi(r);if(H==="then")W.value=U;else W.error=U;r.eatClosingBrace()}let J=Nn();W[H]=J,r.setFragment(J)}else ze(L)}function qf(r){let y=r.current(),L=jf[y.type];if(!L)Ze(r.index-1);r.eat(L,!0),r.eatClosingBrace();while(y.type==="IfBlock"&&y.elseif)y.end=r.index,r.close(),y=r.current();y.end=r.index,r.close()}function Xf(r){return r.type==="CallExpression"||r.type==="ChainExpression"&&r.expression.type==="CallExpression"}function Kf(r,y){if(r.eat("html")){r.requireWhitespace();let L=fn(r);r.eatClosingBrace(),r.append({type:"HtmlTag",start:y,end:r.index,expression:L})}else if(r.eat("debug")){let L=[];if(!r.read(sl)){let W=fn(r),H=W.type==="SequenceExpression"?W.expressions:[W];for(let J of H){if(J.type!=="Identifier")rt(J.start);L.push(J)}r.eatClosingBrace()}r.append({type:"DebugTag",start:y,end:r.index,identifiers:L})}else if(r.eat("const")){r.requireWhitespace();let L=oi(r);r.allowWhitespace(),r.eat("=",!0),r.allowWhitespace();let W=r.index,H=fn(r),J=r.index;if(H.type==="SequenceExpression"&&!r.source.slice(W,H.start).includes("("))et(H);r.eatClosingBrace();let U={type:"VariableDeclarator",id:L,init:H,start:L.start,end:J};r.append({type:"ConstTag",start:y,end:r.index,declaration:{type:"VariableDeclaration",kind:"const",declarations:[U],start:y+2,end:r.index-1}})}else if(r.eat("render")){r.requireWhitespace();let L=fn(r);if(!Xf(L))dt(L);r.eatClosingBrace(),r.append({type:"RenderTag",start:y,end:r.index,expression:L})}else ct(r.index)}var Yf=/(?:var|interface|enum)\b/y,Qf=/(?:let|const|type)\b/y;function Zf(r){let y=r.index;if(r.index+=1,r.allowWhitespace(),r.eat("#"))Wf(r,y);else if(r.eat(":"))zf(r,y);else if(r.eat("@"))Kf(r,y);else if(r.match("/")&&!r.match("/*")&&!r.match("//"))r.index+=1,qf(r);else if(!em(r,y)){let L=fn(r);r.eatClosingBrace(),r.append({type:"ExpressionTag",start:y,end:r.index,expression:L})}}function em(r,y){let L=r.index,W=r.matchRegex(Yf);if(W)De({start:L,end:L+W.length});if(!r.matchRegex(Qf))return!1;let H=r.root.comments.length,J=Mt(r,r.source,L);if(J.type==="ExpressionStatement")return r.root.comments.length=H,!1;if(J.type!=="VariableDeclaration"||J.kind!=="let"&&J.kind!=="const")De(J);return r.index=J.end,r.eatClosingBrace(),r.append({type:"DeclarationTag",start:y,end:r.index,declaration:J}),!0}function nm(r){let{source:y,index:L}=r;if(r.nextAngle<L)r.nextAngle=ol(y,"<",L);if(r.nextBrace<L)r.nextBrace=ol(y,"{",L);let W=Math.min(r.nextAngle,r.nextBrace);r.index=W;let H=y.slice(L,W);r.append({type:"Text",start:L,end:W,raw:H,data:Gt(H,!1,r.entityNames)})}function ol(r,y,L){let W=r.indexOf(y,L);return W===-1?r.length:W}function vl(r,y,L){let W=Co(r,y,L);while(W.index<W.source.length)vo(W);return bo(W)}function Co(r,y,L){let W=$r(r);return M(W),new al(W.trimEnd(),W.length,L,y)}function bo(r){if(r.stack.length>1){let H=r.current();if(H.end=H.start+1,H.type==="RegularElement")Ne(H,H.name);Qe(H)}let{nodes:y}=r.root.fragment,L=y.findIndex((H)=>H.type==="SvelteOptions"),W=y[L];if(W?.type==="SvelteOptions"){y.splice(L,1),r.root.options=If(W);let{nodes:H}=W.fragment;if(H.length>0)vt({start:H[0].start,end:H[H.length-1].end},W.name)}return r.root}function vo(r){if(r.match("<"))To(r);else if(r.match("{"))Zf(r);else nm(r)}function Dl(r,y,L){M(r);let W={isTypeScript:y.typescript??!1,typescript:L,loc:!1,comments:!1,root:{comments:[]}};return Ft(W,r,(H)=>la(r,y.localExports??!0,H))}function Pl(r,y,L){let W=Co(r,y,L);return tm(W),bo(W)}function tm(r){let{source:y}=r,{tags:L,comments:W}=Ca(y),H=r.root.fragment.nodes,J=(Ee,Se)=>{if(Se<=Ee)return;let ve=y.slice(Ee,Se),Le=ve.includes("<")||ve.includes("{")?ve:Gt(ve,!1,r.entityNames);H.push({type:"Text",start:Ee,end:Se,raw:ve,data:Le})},U=0,te=0;for(let Ee of L){for(;te<W.length&&W[te]<Ee;te+=2){let Se=W[te];if(Se<U)continue;let ve=W[te+1];J(U,Se),H.push({type:"Comment",start:Se,end:ve,data:y.slice(Se+4,ve-3)}),U=ve}if(Ee<U)continue;J(U,Ee),r.index=Ee,To(r);while(r.stack.length>1&&r.index<y.length)vo(r);U=r.index}let K=H.filter((Ee)=>Ee.type==="SvelteOptions");H.length=0,H.push(...K)}function Al(r={}){let y=kl(r),{typescript:L}=y;return{parse:(W,H)=>vl(W,H,y),parseModule:(W,H={})=>ye(W,H,L),parseImportsExports:(W,H={})=>Dl(W,H,L)}}function Nl(r={}){let y=kl(r);return{parseSections:(L,W)=>Pl(L,W,y)}}function kl(r){return{typescript:Ue(r.typescript),entityNames:Je(r.entities)??ja}}var Do=He(ge);var wl,Ll;function Be(r){return wl??=Al({typescript:Do}),wl.parse(r,{css:!1})}function zt(r){return Ll??=Nl({typescript:Do}),Ll.parseSections(r,{css:!1})}var rm=/\s*=\s*/,im=/^[^"'`\s]\S*$/;function om(r){let y=r.indexOf("<");if(y===-1||!r.endsWith(">"))return r;let L=r.slice(0,y),W=r.slice(y+1,-1),H=i(W,",").map((J)=>J.trim().replace(rm," = ")).join(", ");return`${L}<${H}>`}var sm=new Set(["restProps","slot","snippet","event","typedef","callback"]),Po=new Set(["property","type"]),_l=new Set(["slot","snippet","typedef","callback"]);function si(r){if(r.length===0)return;return Un(r[Ei(r)].content)}function Rl(r){return!r||!r.tag&&!r.continuesType&&r.content.trim()===""}function am(r){return r.text.split(`
34
+ `);for(let{name:H,constraint:J}of r.deferredSlotBlockGenerics){if(!Ge(W,H))continue;Mr(r,H,J)}}if(r.scriptGenericsAttribute){if(r.generics)en(r,"syntax-skipped","generics",'Both the "generics" script attribute and @generics/@template JSDoc tags declare component generics; the script attribute takes precedence and the JSDoc declaration was ignored.',r.scriptGenericsAttribute.source);r.generics=Is(r.scriptGenericsAttribute.value)}}function Wd(r){return Zn(r.events).map((y)=>y.type==="forwarded"?{...y,element:y.element.name}:y).sort(xe)}function Hd(r,y){let L=new Map(r.pendingCallDefaultCandidates.filter((W)=>W.location==="props").map((W)=>[W.propName,W]));for(let W of y)if(W.typeSource==="unknown"){let H=L.get(W.name),J=H?H.importSource?`Prop "${W.name}" default calls "${H.calleeName}()" imported from "${H.importSource}"; falling back to "any" pending cross-file resolution.`:`Prop "${W.name}" default calls "${H.calleeName}()", but its return type could not be inferred; falling back to "any".`:`Prop "${W.name}" type could not be inferred; falling back to "any".`;en(r,"prop-unknown-type",W.name,J,W.source)}}function Kr(r,y,L,W){if(y===void 0||ka(y))return!0;let H=Or(y)?"has a `//` comment, which would comment out the code after it in the .d.ts":"is not valid TypeScript";return en(r,"type-syntax-error",L,`Type \`${y}\` of "${L}" ${H}; falling back to "any".`,W),!1}function Jd(r,y,L,W,H){for(let J of y)if(J.typeSource==="jsdoc"&&!Kr(r,J.type,J.name,J.source))J.type="any";for(let J of L)if(J.type==="dispatched"&&!Kr(r,J.detail,J.name,J.source))J.detail="any";for(let J of W)if(!Kr(r,J.slot_props,J.name??"default",J.source))J.slot_props="any";for(let J of H)if(!Kr(r,J.type,J.name,J.source))J.type="any",J.ts=`type ${J.name} = any;`}function Ud(r,y){let{dispatcherName:L}=y,W=[];if(L===void 0)return W;let H=[];for(let U of y.callsWithArguments){let te=Ps(U,L);if(te)H.push({call:U,...te})}if(H.length>0)kn(r,"dispatch-escapes",L,Tn(r,L)?.sveldIgnore);let J=mi(r,"dispatch-escapes",L);for(let{call:U,argumentIndex:te,property:K}of H){let Ee=y.locallyBoundCalls.has(U)?void 0:Ae(r,U.callee);if(!Ee){W.push(U);continue}let Se=Ve(r,U);r.pendingDispatchEscapeCandidates.push({importSource:Ee.source,importedName:Ee.importedName,...Ee.members?{members:Ee.members}:{},calleeText:gn(r,U.callee)??Ee.importedName,dispatcherName:L,argumentIndex:te,...K===void 0?{}:{property:K},...Se?{source:Se}:{},...J?{ignored:J}:{}})}return W}function zd(r,y,L){for(let W of r.jsDocEventNames){if(y.names.has(W)||y.mayDispatch(W))continue;if(r.forwardedEvents.has(W)||r.typedDispatcherEventNames.has(W))continue;if(r.props.has(`on${W}`))continue;if(L.length>0)continue;let H=fi(r,"event-no-source",W,`@event "${W}" has no matching dispatch or callback prop.`,r.jsDocEventSources.get(W));if(r.pendingDispatchEscapeCandidates.length>0)r.deferredEventNoSourceDiagnostics.push(H);else r.diagnosticRecords.push(H)}}function qd(r){if(r.slotsUntracked)return;let y=r.syntaxMode==="runes";for(let[L,{tag:W,source:H}]of r.jsDocSlots){let J=L??"children";if(r.renderedSlots.has(L)||y&&r.props.has(J))continue;let U=L===Rn?"default <slot>":`<slot name="${L}">`,te=y?`{@render ${J}()} or "${J}" prop`:U,K=L===Rn?`@${W} documents the default slot, but the component has no ${te}.`:`@${W} "${L}" has no matching ${te} in the component.`;en(r,"slot-not-rendered",L??"default",K,H)}}function Xd(r){let y=r.rest_props;if(y?.type!=="InlineComponent")return;let L=ee(r,y.name),W=r.extends?.import.replace(Id,"");if(L?.importedName==="default"&&L.source===W)return;en(r,"rest-props-unresolved","$$restProps",`$$restProps is only spread onto component "${y.name}"; sveld cannot infer its rest-prop type. Spread onto a plain element or add an @restProps tag.`,r.restPropsSource)}function Kd(r,y){let L=y.typedefs.filter((H)=>H.internal).map((H)=>{let J=H.name.split("<")[0];return{name:J,regex:new RegExp(`\\b${J}\\b`)}});if(L.length===0)return;let W=(H,J,U)=>{if(!J)return;for(let{name:te,regex:K}of L){if(!K.test(J))continue;en(r,"internal-typedef-referenced",H,`"${H}" references "${te}", which is @internal and excluded from output; the generated .d.ts will contain a dangling reference to it.`,U)}};for(let H of[...y.props,...y.moduleExports]){if(H.internal)continue;W(H.name,H.type,H.source)}for(let H of y.typedefs){if(H.internal)continue;W(H.name,H.ts)}for(let H of y.events){if(H.internal||H.type!=="dispatched")continue;W(H.name,H.detail,H.source)}for(let H of y.slots){if(H.internal)continue;W(H.name??"default",H.slot_props,H.source)}for(let H of y.contexts){if(H.internal)continue;if(H.type!==void 0)W(H.typeName,H.type,H.source);for(let J of H.properties)W(J.name,J.type)}}function Yd(r){let y=new Set;for(let L of i(r?.[1]??"",",")){let W=L.trim().match(Fd)?.[1];if(W)y.add(W)}return y}function Qd(r,y){let L=Yd(r.generics),W=new Map;for(let H of y){let J=H.type?.trim();if(J&&L.has(J))W.set(H.localName??H.name,J)}return W}function Zd(r,y,L){if(L.size===0)return;let W=r.rest_props,H=r.restPropsTagLocal===void 0?void 0:L.get(r.restPropsTagLocal);if(W?.type==="Element"&&W.name==="svelte:element"&&!W.thisValue&&H)r.rest_props={...W,thisType:H};for(let[J,U]of y.entries()){let te=r.bindings.get(U.name);if(U.typeSource!=="inferred"||!te?.elements.some(({tagLocal:K})=>K&&L.has(K)))continue;y[J]={...U,type:wa(te,L)}}}var eu=/^(?:(?:HTML|SVG|MathML)\w*)?Element$|^HTMLElementTagNameMap\[[\w$]+\]$/;function nu(r,y,L){for(let W of y){if(W.typeSource!=="typescript"&&W.typeSource!=="jsdoc")continue;let H=r.bindings.get(W.name);if(H?.target!=="direct"||H.components.length>0||W.type===void 0)continue;let J=({tag:Me,tagLocal:Fe})=>Me==="svelte:element"&&!(Fe&&L.has(Fe));if(H.elements.some(J))continue;let U=(Me)=>Me==="null"||Me==="undefined",te=i(W.type,"|").map((Me)=>Me.trim()).filter(Boolean),K=te.filter(U),Ee=te.filter((Me)=>!U(Me));if(!Ee.every((Me)=>eu.test(Me)))continue;let Se=[...new Set(La(H,L))];if(Ee.every((Me)=>Se.includes(Me)))continue;let ve=H.elements.map(({tag:Me,tagLocal:Fe})=>Me==="svelte:element"?`<svelte:element this={${Fe}}>`:`<${Me}>`),Le=(U(te[0]??"")?[...K,...Se]:[...Se,...K]).join(" | ");en(r,"bind-this-type-mismatch",W.name,`Prop "${W.name}" is declared as "${W.type}", but \`bind:this\` only binds it to ${tu(ve)}. Declare "${Le}" instead.`,W.source)}}function tu(r){return r.length<2?r.join(""):`${r.slice(0,-1).join(", ")} and ${r[r.length-1]}`}function _a(r,y){let L=Bd(r,y);Js(r,L.names);let W=Gd(r);r.activeScopes.length=0;let H=Vd(r);jd(r,W,H);let J=Qd(r,W);Zd(r,W,J);let U=Zn(r.moduleExports),te=Wd(r),K=Zn(r.typedefs),Ee=Zn(r.contexts);Hd(r,W),nu(r,W,J),Jd(r,W,te,H,K);let Se=Ud(r,y);zd(r,L,Se),qd(r);let{dispatcherName:ve}=y;for(let sn of Se){let an=gn(r,sn.callee)??"";en(r,"dispatch-escapes",ve??"",`\`${ve}\` is passed to \`${an}\`, which sveld can't follow: it only reads a function imported from another module, by name, as its default export, or through a namespace import. Document the events dispatched there with @event tags.`,Ve(r,sn))}Xd(r),Kd(r,{props:W,moduleExports:U,typedefs:K,events:te,slots:H,contexts:Ee});let Le={source:kr(r,0,r.source?.length),syntaxMode:r.syntaxMode,...r.scriptLanguage?{scriptLanguage:r.scriptLanguage}:{},props:W,moduleExports:U,slots:H,events:te,typedefs:K,generics:r.generics,rest_props:r.rest_props,extends:r.extends,componentComment:r.componentComment,componentCommentSource:r.componentCommentSource,contexts:Ee,customElementTag:r.customElementTag,customElement:r.customElement,...r.cssParts.length>0?{cssParts:r.cssParts.slice()}:{},...r.cssProperties.length>0?{cssProperties:r.cssProperties.slice()}:{},diagnostics:r.diagnosticRecords.slice()},Me=zo(r);if(Me)Le[v]=Me;if(r.propIgnoreCodes.size>0)Le[O]=Object.fromEntries(r.propIgnoreCodes);let Fe=Uo(r);return Fe?{component:Le,pending:Fe}:{component:Le}}function ru(r){if(r.computed)return;if(r.key.type==="Identifier")return r.key.name;if(r.key.type==="Literal"&&(typeof r.key.value==="string"||typeof r.key.value==="number"))return String(r.key.value);return}function Ra(r){return r==="private"||r==="protected"}function Bt(r){return{...r?.description?{description:r.description}:{},...r?.deprecated===void 0?{}:{deprecated:r.deprecated},...r?.tags?{tags:r.tags}:{}}}function Ia(r){return r?.slice(1,-1).trim()||void 0}function iu(r){let y=r?.type==="TSParameterProperty"?r.parameter:r;return y?.type==="AssignmentPattern"?xn(y.right,"widen"):void 0}function to(r,y,L){let W=Zt(r,y),H=new Map((L?.params??[]).map((K)=>[K.name,K])),J=W.params.map(({name:K,type:Ee,optional:Se,rest:ve},Le)=>{let Me=H.get(K);return{name:ve?`...${K}`:K,type:Ee??Me?.type??iu(y.params[Le])??(ve?"any[]":"any"),...Me?.description?{description:Me.description}:{},...!ve&&(Se||Me?.optional)?{optional:!0}:{}}}),U=W.returnType??L?.returnType??(y.async?"Promise<any>":void 0),te=Ia(W.typeParameters)??L?.typeParameters;return{...J.length>0?{params:J}:{},...U?{returnType:U}:{},...te?{typeParameters:te}:{}}}function Fa(r,y){let L=[],W=new Map,H=new Set,J=new Set,U,te=-1;for(let Se of y.body.body){if(Se.type==="TSIndexSignature"){let[an]=Se.parameters;if(!an)continue;ln(r,Se.typeAnnotation?.typeAnnotation),L.push({kind:"index",name:`[${an.name}: ${yn(r,an.typeAnnotation)??"string"}]`,type:yn(r,Se.typeAnnotation)??"any",...Se.static?{static:!0}:{},...Se.readonly?{readonly:!0}:{}});continue}if(Se.type!=="MethodDefinition"&&Se.type!=="PropertyDefinition")continue;if(Ra(Se.accessibility))continue;let ve=ru(Se);if(ve===void 0)continue;let Le=pn(r,Se);if(Le?.internal)continue;let Me=`${Se.static?"static ":""}${ve}`,Fe={...Se.static?{static:!0}:{},...Se.optional?{optional:!0}:{},...Se.abstract?{abstract:!0}:{}};if(Se.type!=="MethodDefinition"){if(ln(r,Se.typeAnnotation?.typeAnnotation),!Se.static)J.add(ve);L.push({kind:"property",name:ve,type:yn(r,Se.typeAnnotation)??Le?.type??xn(Se.value,"widen")??"any",...Fe,...Se.readonly?{readonly:!0}:{},...Bt(Le)});continue}let sn=Se.typeParameters?{...Se.value,typeParameters:Se.typeParameters}:Se.value;if(Se.kind==="constructor"){let an=to(r,sn,Le);L.push({kind:"constructor",name:"constructor",params:an.params,...Bt(Le)}),te=L.length,U=sn.type==="FunctionExpression"?sn.body.body:void 0;for(let[nn,rn]of sn.params.entries()){if(rn.type!=="TSParameterProperty"||Ra(rn.accessibility))continue;let hn=an.params?.[nn];if(!hn)continue;J.add(hn.name),L.push({kind:"property",name:hn.name,type:hn.type,...rn.readonly?{readonly:!0}:{},...hn.description?{description:hn.description}:{}})}continue}if(Se.kind==="get"||Se.kind==="set"){let an=to(r,sn,Le),nn=Se.kind==="get"?an.returnType??Le?.type:an.params?.[0]?.type??Le?.type,rn=W.get(Me);if(rn){if(Se.kind==="set")rn.readonly=void 0;if(nn&&nn!=="any"&&(rn.type==="any"||Se.kind==="get"))rn.type=nn;if(!rn.description&&!rn.deprecated)Object.assign(rn,Bt(Le));continue}let hn={kind:"property",name:ve,type:nn??"any",...Fe,...Se.kind==="get"?{readonly:!0}:{},...Bt(Le)};W.set(Me,hn),L.push(hn);continue}if(sn.type==="TSDeclareMethod"&&!Se.abstract)H.add(Me);else if(sn.type!=="TSDeclareMethod"&&H.has(Me))continue;L.push({kind:"method",name:ve,...Fe,...to(r,sn,Le),...Bt(Le)})}if(r.scriptLanguage!=="ts"&&U)L.splice(te,0,...su(r,U,J));for(let Se of y.typeParameters?.params??[])ln(r,Se.constraint),ln(r,Se.default);let K=Ia(Fn(r,y.typeParameters)),Ee=ou(r,y);return{members:L,...K?{typeParameters:K}:{},...Ee}}function ou(r,y){let L={},W=y.superClass;if(W){if(L.extends=Fn(r,{start:W.start,end:y.superTypeParameters?.end??W.end}),W.type==="Identifier")Ma(r,W,y.superTypeParameters)}let H=(y.implements??[]).map((J)=>(Ma(r,J.expression,J.typeParameters),Fn(r,J))).filter((J)=>Boolean(J));if(H.length>0)L.implements=H;return L}function Ma(r,y,L){ln(r,{type:"TSTypeReference",typeName:y,start:y.start,end:L?.end??y.end,...L?{typeArguments:L}:{}})}function su(r,y,L){let W=[];for(let H of y){let J=H.type==="ExpressionStatement"?H.expression:void 0;if(J?.type!=="AssignmentExpression"||J.operator!=="=")continue;let U=J.left;if(U.type!=="MemberExpression"||U.computed||U.object.type!=="ThisExpression")continue;let te=U.property.type==="Identifier"?U.property.name:void 0;if(!te||L.has(te))continue;L.add(te);let K=pn(r,H);if(K?.internal)continue;W.push({kind:"property",name:te,type:K?.type??"any",...Bt(K)})}return W}var au=/^[A-Za-z_$][\w$]*(?=\s*(?:<|$))/;function Yr(r,y,L){if(!y)return;let W=r.moduleExports.get(y);r.moduleExports.set(y,W?{...W,...L}:L)}function Oa(r,y,L,W){let H=pn(r,y);Yr(r,L==="*"?`* from ${W.from}`:L,{name:L,kind:"re-export",description:H?.description,deprecated:H?.deprecated,tags:H?.tags,...H?.internal?{internal:!0}:{},isFunction:!1,isFunctionDeclaration:!1,isRequired:!1,constant:!1,reactive:!1,reExport:W,source:Ve(r,y)})}function Ba(r,y){en(r,"module-export-conflict","default",`export "default" was skipped because it collides with the component's own default export.`,Ve(r,y))}function lu(r,y,L,W){let H=L.id?.name;if(!H)return;let J=W?.exportedName??H,U=mr(r,y,W),{members:te,typeParameters:K,extends:Ee,implements:Se}=Fa(r,L),ve=K??U?.typeParameters;Yr(r,J,{name:J,...H===J?{}:{localName:H},kind:"class",description:U?.description,deprecated:U?.deprecated,tags:U?.tags,...U?.internal?{internal:!0}:{},type:`typeof ${H}`,...ve?{typeParameters:ve}:{},members:te,...L.abstract?{abstract:!0}:{},...Ee?{extends:Ee}:{},...Se?{implements:Se}:{},isFunction:!1,isFunctionDeclaration:!1,isRequired:!1,constant:!1,reactive:!1,source:Ve(r,y)})}function $a(r,y,L,W){if(L.type==="ClassDeclaration"){lu(r,y,L,W);return}let H=Mi(r,L,W,"moduleExports");if(H.length===0)return;let J=mr(r,y,W);for(let U of H){let{prop_name:te,kind:K}=U,{type:Ee,typeSource:Se,description:ve,params:Le,returnType:Me,isFunction:Fe,typeParameters:sn}=Ii(r,U,J);Yr(r,te,{name:te,kind:K,description:ve,deprecated:J?.deprecated,tags:J?.tags,...J?.internal?{internal:!0}:{},type:Ee,typeSource:Se,value:U.value,defaultValue:U.defaultValue,params:Le,returnType:Me,typeParameters:sn,isFunction:Fe,isFunctionDeclaration:U.isFunctionDeclaration,isRequired:!1,constant:K==="const",reactive:!1,source:Ve(r,y)})}}function pu(r,y){return r.parsed?.fragment.nodes.find((L)=>L.type==="SnippetBlock"&&L.expression.name===y)}function cu(r,y){let L;try{L=R(`function f<${y}>() {}`,{typescript:!0})}catch{return}let W=L.body[0];if(W?.type!=="FunctionDeclaration")return;for(let H of W.typeParameters?.params??[])ln(r,H.constraint),ln(r,H.default)}function du(r,y,L,W){let H=Zt(r,{params:L.parameters}).params,U=H.map((Se,ve)=>{let Le=L.parameters[ve];if(Se.type||Le?.type!=="AssignmentPattern")return Se;return{...Se,type:xn(Le.right,"widen")}}).map((Se)=>`${Se.name}${Se.optional?"?":""}: ${Se.type??"any"}`).join(", ");if(L.typeParams)cu(r,L.typeParams);let te=L.typeParams?`<${L.typeParams}>(${U}) => ReturnType<Snippet>`:U?`Snippet<[${U}]>`:"Snippet",K=mr(r,y,W),Ee=W.exportedName;Yr(r,Ee,{name:Ee,...W.localName===Ee?{}:{localName:W.localName},kind:"const",description:K?.description,deprecated:K?.deprecated,tags:K?.tags,...K?.internal?{internal:!0}:{},type:te,typeSource:r.scriptLanguage==="ts"&&H.every((Se)=>Se.type)?"typescript":"inferred",isFunction:L.typeParams!==void 0,isFunctionDeclaration:!1,isRequired:!1,constant:!0,reactive:!1,source:Ve(r,y)})}function uu(r){let y=Array.from(r.moduleExports.values()).filter((W)=>W.kind==="class"),L=new Set(y.map((W)=>W.localName??W.name));for(let W of y){if(!W.extends)continue;let H=au.exec(W.extends)?.[0];if(H&&(L.has(H)||r.valueImportBindingsByLocalName.has(H)||r.typeImportBindingsByLocalName.has(H)))continue;en(r,"export-unresolved",W.name,`class "${W.name}" extends \`${W.extends}\`, which isn't imported or an exported class, so the .d.ts declares it without \`extends\` and its inherited members are missing. Export the base class from the module script.`,W.source),W.extends=void 0}}function Ga(r){let y=r.parsed?.module;if(!y)return;let L=We(y);o(y,{enter(W,H){if(W.type==="ImportDeclaration")Z(r,W);if(W.type==="FunctionDeclaration"&&W.id?.name)r.funcDecls.set(W.id.name,W);if(W.type==="VariableDeclaration")r.vars.add(W);if(W.type==="ExportNamedDeclaration"){if(W.declaration!=null){$a(r,W,W.declaration);return}let J=W.source?.value,U=H?.type==="Program"?H:null;for(let te of W.specifiers){let K=_i(r,W,te,U,"module");if(!K)continue;if(K.exportedName==="default"){Ba(r,W);continue}let Ee=typeof J==="string"?{from:J,imported:K.localName}:L.get(K.localName),Se=K.declaration||Ee?void 0:pu(r,K.localName);if(K.declaration)$a(r,W,K.declaration,K);else if(Se)du(r,W,Se,K);else if(Ee)Oa(r,W,K.exportedName,Ee);else if(!r.localTypeDeclarationsByName.get(K.localName)?.exported)Ri(r,W,K.localName,K.exportedName)}}if(W.type==="ExportAllDeclaration"&&typeof W.source.value==="string"){let J=(W.exported&&Rr(W.exported))??"*";if(J==="default"){Ba(r,W);return}Oa(r,W,J,{from:W.source.value,imported:"*"})}}}),uu(r)}var fu=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376],mu=/[:!]/;function gu(r){let y;return()=>(y??=yu(r),y)}function yu(r){let y=new Map,L=0,W="";for(let H of r.split(" ")){let J=H.search(mu);W=W.slice(0,Number.parseInt(H[0],36))+H.slice(1,J);let U=Number.parseInt(H.slice(J+1),36);if(y.set(`${W};`,U),H[J]==="!")y.set(W,U);L=Math.max(L,W.length+1)}return{table:y,longest:L}}var ja=gu("0amp!12 1pos:13 0gt!1q 0lt!1o 0quot!y"),ro=(r)=>r>=48&&r<=57,hu=(r)=>ro(r)||r>=65&&r<=70||r>=97&&r<=102,Va=(r)=>ro(r)||r>=65&&r<=90||r>=97&&r<=122,Qr=0;function Eu(r,y,L,W){if(r.charCodeAt(y)===35){let te=(r.charCodeAt(y+1)|32)===120,K=y+(te?2:1),Ee=K;while(Ee<r.length&&(te?hu:ro)(r.charCodeAt(Ee)))Ee++;if(Ee===K)return 0;return Qr=r.charCodeAt(Ee)===59?Ee+1:Ee,Number.parseInt(r.slice(K,Ee),te?16:10)}let{table:H,longest:J}=W(),U=y;while(U-y<J&&Va(r.charCodeAt(U)))U++;if(r.charCodeAt(U)===59){let te=H.get(r.slice(y,U+1));if(te!==void 0)return Qr=U+1,te}for(let te=U;te>y;te--){let K=H.get(r.slice(y,te));if(K===void 0)continue;if(L){let Ee=r.charCodeAt(te);if(Va(Ee)||Ee===95||Ee===61)continue}return Qr=te,K}return 0}function Tu(r,y){if(r===10&&!y)return 32;if(r<128)return r;if(r<=159)return fu[r-128];if(r>=55296&&r<=57343)return 0;if(r<=196607)return r;if(r>=917504&&r<=917631||r>=917760&&r<=917999)return r;return 0}function Gt(r,y,L){let W=r.indexOf("&");if(W===-1)return r;let H="",J=0;while(W!==-1){let U=Eu(r,W+1,y,L);if(U)H+=r.slice(J,W)+String.fromCodePoint(Tu(U,y)),J=Qr;W=r.indexOf("&",U?J:W+1)}return H+r.slice(J)}var Wa=new WeakMap;function io(r,y){let L=Wa.get(r);if(L===void 0)Wa.set(r,[y]);else L.push(y)}var Su=/\r(?!\n)|[\u2028\u2029]/,sl=/\s*}/y;function lo(r,y){let L=r.codePointAt(y);if(L===void 0||!g(L,!0))return y;let W=y+(L<=65535?1:2),H=r.codePointAt(W);while(H!==void 0&&S(H,!0))W+=H<=65535?1:2,H=r.codePointAt(W);return W}class al{source;index=0;loc;lfOnly;isTypeScript;typescript;entityNames;css;script;comments;root;stack;fragments;metaTags=new Set;lastAutoClosedTag;nextAngle=-1;nextBrace=-1;constructor(r,y,L,W={}){if(this.source=r,this.loc=W.loc??!1,this.lfOnly=this.loc&&!Su.test(r),this.isTypeScript=Gr(r),this.typescript=L.typescript,this.isTypeScript&&!this.typescript)ue();this.entityNames=L.entityNames,this.css=W.css??!0,this.script=W.script??!0,this.comments=W.comments??!0,this.root={type:"Root",start:0,end:y,css:null,js:[],options:null,fragment:{type:"Fragment",nodes:[]},comments:[]},this.stack=[this.root],this.fragments=[this.root.fragment]}match(r){if(r.length===1)return this.source.charCodeAt(this.index)===r.charCodeAt(0);return this.source.startsWith(r,this.index)}matchRegex(r){return r.lastIndex=this.index,r.exec(this.source)?.[0]??null}eat(r,y=!1){if(this.match(r))return this.index+=r.length,!0;if(y)D(this.index,r);return!1}read(r){let y=this.matchRegex(r);if(y)this.index+=y.length;return y}readUntil(r){if(this.index>=this.source.length)f(this.source.length);let y=this.source.indexOf(r,this.index),L=y===-1?this.source.length:y,W=this.source.slice(this.index,L);return this.index=L,W}allowWhitespace(){this.index=on(this.source,this.index)}requireWhitespace(){if(!dn(this.source.charCodeAt(this.index)))ut(this.index);this.allowWhitespace()}eatClosingBrace(){this.allowWhitespace(),this.eat("}",!0)}sourceLocation(r,y){return this.loc?{start:x(r),end:x(y)}:void 0}readIdentifierName(){let r=this.index,y=lo(this.source,r),L=this.source.slice(r,y);if(this.index=y,me.has(L))Rt(r,L);let W={type:"Identifier",name:L,start:r,end:y};if(this.loc)W.loc=this.sourceLocation(r,y);return W}current(){return this.stack[this.stack.length-1]}append(r){this.fragments[this.fragments.length-1].nodes.push(r)}open(r,y){this.append(r),this.stack.push(r),this.fragments.push(y)}setFragment(r){this.fragments[this.fragments.length-1]=r}close(){this.stack.pop(),this.fragments.pop()}}var xu={"||":1,"??":1,"&&":2,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"+":9,"-":9,"*":10,"/":10,"%":10};function po(r,y,L,W){return{type:"Literal",start:y,end:L,value:W,raw:r.slice(y,L)}}function Ha(r,y){let L=r.charCodeAt(y);if(L===34||L===39){for(let H=y+1;H<r.length;H++){let J=r.charCodeAt(H);if(J===L)return po(r,y,H+1,r.slice(y+1,H));if(J===92||J===10||J===13)return null}return null}let W=y;for(;W<r.length;W++){let H=r.charCodeAt(W);if(H<48||H>57)break}if(W===y||L===48&&W-y>1)return null;return po(r,y,W,Number(r.slice(y,W)))}function Cu(r,y,L){let W=lo(r,y);if(W===y)return Ha(r,y);let H=r.slice(y,W);if(H==="true"||H==="false"||H==="null")return po(r,y,W,H==="null"?null:H==="true");if(me.has(H))return null;let J={type:"Identifier",start:y,end:W,name:H};for(let U=W;;){let te=r.charCodeAt(U);if(te===40){let Se=bu(r,U+1,L);if(!Se)return null;J={type:"CallExpression",start:y,end:Se.end,callee:J,arguments:Se.arguments,optional:!1},U=Se.end;continue}let K,Ee;if(te===46){if(Ee=lo(r,U+1),Ee===U+1)return null;K={type:"Identifier",start:U+1,end:Ee,name:r.slice(U+1,Ee)}}else if(te===91){if(K=Ha(r,U+1),!K||r.charCodeAt(K.end)!==93)return null;Ee=K.end+1}else return J;J={type:"MemberExpression",start:y,end:Ee,object:J,property:K,computed:te===91,optional:!1},U=Ee}}function bu(r,y,L){let W=[],H=on(r,y);if(r.charCodeAt(H)===41)return{arguments:W,end:H+1};for(;;){let J=ei(r,H,L);if(!J)return null;W.push(J),H=on(r,J.end);let U=r.charCodeAt(H);if(U===41)return{arguments:W,end:H+1};if(U!==44)return null;if(H=on(r,H+1),r.charCodeAt(H)===41)return null}}function go(r,y,L){let W=r.charCodeAt(y),H=r.charCodeAt(y+1);if(!(W===33&&H!==61)&&!(W===45&&H!==45&&H!==61))return Cu(r,y,L);let J=go(r,on(r,y+1),L);if(!J)return null;return{type:"UnaryExpression",start:y,end:J.end,operator:W===33?"!":"-",prefix:!0,argument:J}}function Ja(r,y,L){let W=r.charCodeAt(y),H=r.charCodeAt(y+1);switch(W){case 124:return H===124&&r.charCodeAt(y+2)!==61?"||":null;case 38:return H===38&&r.charCodeAt(y+2)!==61?"&&":null;case 63:return H===63&&r.charCodeAt(y+2)!==61?"??":null;case 61:if(H!==61)return null;return r.charCodeAt(y+2)===61?"===":"==";case 33:if(H!==61)return null;return r.charCodeAt(y+2)===61?"!==":"!=";case 60:case 62:if(L||H===W)return null;if(H===61)return W===60?"<=":">=";return W===60?"<":">";case 43:return H===43||H===61?null:"+";case 45:return H===45||H===61?null:"-";case 42:return H===42||H===61?null:"*";case 47:return H===47||H===42||H===61?null:"/";case 37:return H===61?null:"%";default:return null}}function co(r,y,L,W){if(ll(r.charCodeAt(y.end)))return y;let H=on(r,y.end),J=Ja(r,H,W);if(J===null)return y;let U=xu[J];if(U<=L)return y;let te=go(r,on(r,H+J.length),W);if(!te)return null;let K=co(r,te,J==="??"?2:U,W);if(!K)return null;let Ee;if(J==="||"||J==="&&"||J==="??"){let Se=Ja(r,on(r,K.end),W);if(J==="??"?Se==="||"||Se==="&&":Se==="??")return null;Ee={type:"LogicalExpression",start:y.start,end:K.end,left:y,operator:J,right:K}}else Ee={type:"BinaryExpression",start:y.start,end:K.end,left:y,operator:J,right:K};return co(r,Ee,L,W)}function ei(r,y,L){let W=go(r,y,L);if(!W)return null;let H=co(r,W,-1,L);if(!H||ll(r.charCodeAt(H.end)))return H;let J=on(r,H.end);if(r.charCodeAt(J)!==63)return H;let U=r.charCodeAt(J+1);if(U===46||U===63)return null;let te=ei(r,on(r,J+1),L);if(!te)return null;let K=on(r,te.end);if(r.charCodeAt(K)!==58)return null;let Ee=ei(r,on(r,K+1),L);if(!Ee)return null;return{type:"ConditionalExpression",start:H.start,end:Ee.end,test:H,consequent:te,alternate:Ee}}function ll(r){return r===125||r===41||r===44||r===58}function vu(r,y){let L=r.charCodeAt(on(r,y));return L===125||L===41}function Du(r,y,L){let W=ei(r,y,L);return W&&vu(r,W.end)?W:null}function bn(r){switch(r.loc={start:N(r.start),end:N(r.end)},r.type){case"MemberExpression":bn(r.object),bn(r.property);break;case"CallExpression":bn(r.callee);for(let y of r.arguments)bn(y);break;case"UnaryExpression":bn(r.argument);break;case"BinaryExpression":case"LogicalExpression":bn(r.left),bn(r.right);break;case"ConditionalExpression":bn(r.test),bn(r.consequent),bn(r.alternate);break}}function fn(r){let y=!r.loc||r.lfOnly?Du(r.source,r.index,r.isTypeScript):null;if(y){if(r.index=y.end,r.loc)bn(y);return y}let{node:L,end:W}=G(r,r.source,r.index);return r.index=W,L}var Pu=new Set(["server","client","worker","test","default"]);function Au(r,y,L){let{source:W,index:H}=r;if(H>=W.length)f(W.length);let J=Vr(W,H);if(J===-1)Ne(W.length,"script");r.index=jr(W,J);let U=r.script?he(r,W.slice(0,J),H):{type:"Program",start:H,end:J,body:[],sourceType:"module"};if(U.start=H,U.loc)Object.assign(U.loc.start,N(y)),Object.assign(U.loc.end,N(r.index));else if(r.loc)U.loc={start:N(y),end:N(r.index)};let te="default";for(let K of L){if(Pu.has(K.name))gt(K,K.name);if(K.name==="module"){if(K.value!==!0)mt(K,K.name);te="module"}if(K.name==="context"){let Ee=K.value;if(!Array.isArray(Ee)||Ee.length!==1||Ee[0].type!=="Text"||Ee[0].data!=="module")ht(K);te="module"}}return{type:"Script",start:y,end:r.index,context:te,content:U,attributes:L}}var Nu=/(even|odd|\+?(\d+|\d*n(\s*[+-]\s*\d+)?)|-\d*n(\s*\+\s*\d+))((?=\s*[,)])|\s+of(\s+|(?=[.#[*:&])))/y,ku=/\d+(\.\d+)?%/y,wu=/\\[0-9a-fA-F]{1,6}(\r\n|\s)?/y,Lu=/\s*>/y,In=-1,pl=34,_u=35,Ru=36,Mu=38,cl=39,Iu=40,Fu=41,ri=42,Ou=43,Bu=45,$u=46,dl=47,uo=58,Gu=59,Vu=60,Ua=61,ju=62,Wu=91,yo=92,Hu=93,Ju=94,ul=123,fo=124,Uu=125,fl=126,ni=[];function zu(r,y,L){let W=r.index;ni=[];let H=r.css?Xu(r):qu(r),J=r.index;return r.eat("</style",!0),r.read(Lu),{type:"StyleSheet",start:y,end:r.index,attributes:L,children:H,comments:ni,content:{start:W,end:J,styles:r.source.slice(W,J),comment:null}}}function qu(r){return r.index=Wr(r.source,r.index),[]}function Xu(r){let y=[];for(;;){if(Vt(r,!0),r.match("</style")||r.index>=r.source.length)break;y.push(r.match("@")?ml(r):gl(r))}return y}function ml(r){let y=r.index;r.eat("@",!0);let L=Jn(r),W=ho(r,!0),H=null;if(r.match("{"))H=El(r);else r.eat(";",!0);return{type:"Atrule",start:y,end:r.index,name:L,prelude:W,block:H}}function gl(r){let y=r.index;return{type:"Rule",prelude:yl(r,!1),block:El(r),start:y,end:r.index}}function yl(r,y){let L=[];Vt(r,!0);let W=r.index;while(r.index<r.source.length){L.push(Ku(r,y));let H=r.index;if(Vt(r,!0),r.match(y?")":"{"))return{type:"SelectorList",start:W,end:H,children:L};r.eat(",",!0),Vt(r,!0)}return f(r.source.length)}function za(r,y){return{type:"RelativeSelector",combinator:r,selectors:[],start:y,end:-1}}function Ku(r,y){let{source:L,index:W}=r,H=[],J=za(null,r.index);while(r.index<L.length){let U=r.index,te=L.charCodeAt(U),K=J.selectors;if(te===Mu)r.index++,K.push({type:"NestingSelector",name:"&",start:U,end:r.index});else if(te===ri)r.index++,K.push(qa(r,U,"*"));else if(te===_u)r.index++,K.push({type:"IdSelector",name:Jn(r),start:U,end:r.index});else if(te===$u)r.index++,K.push({type:"ClassSelector",name:Jn(r),start:U,end:r.index});else if(te===uo){let Le=L.charCodeAt(U+1)===uo;r.index+=Le?2:1;let Me=Jn(r),Fe=null;if(r.eat("("))Fe=yl(r,!0),r.eat(")",!0);if(Le)K.push({type:"PseudoElementSelector",name:Me,start:U,end:r.index,...Fe&&{args:Fe}});else K.push({type:"PseudoClassSelector",name:Me,args:Fe,start:U,end:r.index})}else if(te===Wu)r.index++,K.push(Yu(r,U));else{let Le=y?r.read(Nu):null,Me=!Le&&Dn(te)?r.read(ku):null;if(Le)K.push({type:"Nth",value:Le,start:U,end:r.index});else if(Me)K.push({type:"Percentage",value:Me,start:U,end:r.index});else if(hl(L,U)===0){let Fe=Jn(r);K.push(qa(r,U,Fe))}}let Ee=r.index;Vt(r,!1);let Se=r.match(",")||r.match(y?")":"{");if(r.index=Ee,Se)return J.end=Ee,H.push(J),{type:"ComplexSelector",start:W,end:Ee,children:H};let ve=Qu(r);if(ve){if(J.selectors.length>0)J.end=Ee,H.push(J);if(J=za(ve,ve.start),r.allowWhitespace(),r.match(",")||r.match(y?")":"{"))nt(r.index)}}return f(L.length)}function qa(r,y,L){let W=L,H;if(r.eat("|"))H=W,W=r.eat("*")?"*":Jn(r);return{type:"TypeSelector",name:W,...H!==void 0&&{namespace:H},start:y,end:r.index}}function Yu(r,y){let L=r.source;r.allowWhitespace();let W=Jn(r);r.allowWhitespace();let H=null,J=null,U=L.charCodeAt(r.index);if(U===Ua)J="=";else if((U===fl||U===Ju||U===Ru||U===ri||U===fo)&&L.charCodeAt(r.index+1)===Ua)J=L.slice(r.index,r.index+2);if(J)r.index+=J.length,r.allowWhitespace(),H=tf(r);r.allowWhitespace();let te=r.index;while(Sl(L.charCodeAt(r.index)))r.index++;let K=r.index>te?L.slice(te,r.index):null;return r.allowWhitespace(),r.eat("]",!0),{type:"AttributeSelector",start:y,end:r.index,name:W,matcher:J,value:H,flags:K}}function hl(r,y){let L=r.charCodeAt(y);if(L===Ou||L===fl||L===ju)return 1;if(L===fo&&r.charCodeAt(y+1)===fo)return 2;return 0}function Qu(r){let y=r.index;r.allowWhitespace();let L=r.index,W=hl(r.source,L);if(W>0){r.index+=W;let H=r.index;return r.allowWhitespace(),{type:"Combinator",name:r.source.slice(L,H),start:L,end:H}}if(r.index!==y)return{type:"Combinator",name:" ",start:y,end:r.index};return null}function El(r){let y=r.index;r.eat("{",!0);let L=[];while(r.index<r.source.length){if(Vt(r,!0),r.match("}"))break;L.push(Zu(r))}return r.eat("}",!0),{type:"Block",start:y,end:r.index,children:L}}function Zu(r){if(r.match("@"))return ml(r);let y=r.index;ho(r,!1);let L=r.source.charCodeAt(r.index);return r.index=y,L===ul?gl(r):ef(r)}function ef(r){let{source:y,index:L}=r;if(L>=y.length)f(y.length);let W=L;while(W<y.length){let K=y.charCodeAt(W);if(K===uo||dn(K))break;W++}let H=y.slice(L,W);r.index=W,r.allowWhitespace(),r.eat(":");let J=r.index;r.allowWhitespace();let U=ho(r,!0);if(!U&&!H.startsWith("--"))tt({start:L,end:J});let te=r.index;if(!r.match("}"))r.eat(";",!0);return{type:"Declaration",start:L,end:te,property:H,value:U}}function ho(r,y){let L=r.source,W=L.length,H="",J=r.index,U=null,te=!1,K=!1,Ee=In,Se=r.index;while(Se<W){let ve=L.charCodeAt(Se);if(te){te=!1,Se++;continue}if(ve===yo){te=!0,Se++;continue}if(ve===Ee)Ee=In;else if(ve===Fu)K=!1;else if(Ee===In&&(ve===pl||ve===cl))Ee=ve;else if(ve===Iu){if(nf(L,H,J,Se))K=!0}else if((ve===Gu||ve===ul||ve===Uu)&&!K&&Ee===In){if(r.index=Se,!y)return"";if(H+=L.slice(J,Se),U){let Le=H.length-H.trimStart().length;for(let Me of U)Me.position=Math.max(0,(Me.position??0)-Le)}return H.trim()}else if(ve===dl&&!K&&Ee===In&&L.charCodeAt(Se+1)===ri){H+=L.slice(J,Se),r.index=Se;let Le=Tl(r);if(y)Le.position=H.length,ni.push(Le),U??=[],U.push(Le);Se=r.index,J=Se;continue}Se++}return r.index=W,f(W)}function nf(r,y,L,W){if(W-L>=3)return r.charCodeAt(W-3)===117&&r.charCodeAt(W-2)===114&&r.charCodeAt(W-1)===108;return(y+r.slice(L,W)).endsWith("url")}function tf(r){let y=r.source,L=In;if(r.eat('"'))L=pl;else if(r.eat("'"))L=cl;let W=r.index,H=!1,J=W;while(J<y.length){let U=y.charCodeAt(J);if(H)H=!1;else if(U===yo)H=!0;else if(L===In?U===Hu||dn(U):U===L)return r.index=L===In?J:J+1,y.slice(W,J).trim();J++}return r.index=J,f(y.length)}function Jn(r){let{source:y,index:L}=r,W=y.charCodeAt(L);if(Dn(W)||W===Bu&&Dn(y.charCodeAt(L+1)))we(L);let H="",J=L,U=L;while(U<y.length){let te=y.charCodeAt(U);if(te===yo){H+=y.slice(J,U),r.index=U;let K=r.matchRegex(wu);if(K){let Ee=String.fromCodePoint(Number.parseInt(K.slice(1),16));H+=Ee==="\\"?"\\\\":Ee,U+=K.length}else H+=`\\${y[U+1]}`,U+=2;J=U}else if(te>=160||rf(te))U++;else break}if(H+=y.slice(J,U),r.index=U,H==="")we(L);return H}function Vt(r,y){let L=r.source;r.allowWhitespace();for(;;){let W=L.charCodeAt(r.index);if(W===dl&&L.charCodeAt(r.index+1)===ri){let H=Tl(r);if(y)ni.push(H)}else if(W===Vu&&r.eat("<!--"))r.readUntil("-->"),r.eat("-->",!0);else break;r.allowWhitespace()}}function Tl(r){let y=r.index;r.eat("/*",!0);let L=r.readUntil("*/");return r.eat("*/",!0),{type:"CSSComment",value:L,start:y,end:r.index}}function Sl(r){return r>=65&&r<=90||r>=97&&r<=122}function rf(r){return Sl(r)||Dn(r)||r===95||r===45}var oo=/<\/textarea(\s[^>]*)?>/iy,of=/^![a-zA-Z]+$/,sf=/^[a-zA-Z][a-zA-Z0-9]*:[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$/,af=/^[a-zA-Z][a-zA-Z0-9]*(-[a-zA-Z0-9.\-_\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}]*)?$/u,so="\\u200C\\u200D",lf=new RegExp(`^(?:\\p{Lu}[$${so}\\p{ID_Continue}.]*|\\p{ID_Start}[$${so}\\p{ID_Continue}]*(?:\\.[$${so}\\p{ID_Continue}]+)+)$`,"u"),pf=new Map([["use","UseDirective"],["animate","AnimateDirective"],["bind","BindDirective"],["class","ClassDirective"],["style","StyleDirective"],["on","OnDirective"],["let","LetDirective"],["in","TransitionDirective"],["out","TransitionDirective"],["transition","TransitionDirective"]]),Eo=new Map([["svelte:head",["SvelteHead",!0]],["svelte:options",["SvelteOptions",!0]],["svelte:window",["SvelteWindow",!0]],["svelte:document",["SvelteDocument",!0]],["svelte:body",["SvelteBody",!0]],["svelte:element",["SvelteElement",!1]],["svelte:component",["SvelteComponent",!1]],["svelte:self",["SvelteSelf",!1]],["svelte:fragment",["SvelteFragment",!1]],["svelte:boundary",["SvelteBoundary",!1]]]),Xa=[...Eo.keys()],cf=`${Xa.slice(0,-1).join(", ")} or ${Xa.at(-1)}`,df=62,Ka=123;function ii(r,y){let L=r.index;if(L>=r.source.length)f(r.source.length);let W=Vn(r.source,L,y);return r.index=W,{name:r.source.slice(L,W),start:L,end:W,loc:r.sourceLocation(L,W)}}var Cr=(r,y,L,W=L)=>({start:r,end:y,type:"Text",raw:L,data:W});function uf(r){let y=r.charCodeAt(0);if(y>=97&&y<=122&&!r.includes("."))return!1;return lf.test(r)}function ff(r){let y=!0;for(let L=0;L<r.length&&y;L++){let W=r.charCodeAt(L);y=W>=97&&W<=122||L>0&&W>=48&&W<=57}return y&&r.length>0||of.test(r)||sf.test(r)||af.test(r)}function Ya(r,y){for(let L=r.length-1;L>=0;L--){let W=y(r[L]);if(W!==void 0)return W}return!1}function mf(r,y,L){let W=Eo.get(y);if(W)return W[0];if(L)return"Component";if(y==="title"){if(Ya(r.stack,({type:H})=>{if(H==="SvelteHead")return!0;return H==="RegularElement"||H==="Component"?!1:void 0}))return"TitleElement"}if(y==="slot"){if(!Ya(r.stack,(H)=>H.type==="RegularElement"&&H.attributes.some((J)=>J.type==="Attribute"&&J.name==="shadowrootmode")?!0:void 0))return"SlotElement"}return"RegularElement"}function To(r){let y=r.index++;if(r.eat("!--")){let L=r.readUntil("-->");r.eat("-->",!0),r.append({type:"Comment",start:y,end:r.index,data:L})}else if(r.eat("/"))gf(r,y);else hf(r,y)}function gf(r,y){let{name:L}=ii(r,!1);if(r.allowWhitespace(),r.eat(">",!0),yr(L))Lt(y);let W=r.current();while(!("name"in W)||W.name!==L){if(W.type==="RegularElement"){if(r.lastAutoClosedTag?.tag!==L)xl(r,W,y,`</${L}>`)}else{let H=r.lastAutoClosedTag;if(H?.tag===L)at(y,L,H.reason);ot(y,L)}W.end=y,r.close(),W=r.current()}if(W.end=r.index,r.close(),r.stack.length<(r.lastAutoClosedTag?.depth??0))r.lastAutoClosedTag=void 0}function xl(r,y,L,W){io(r.root,{code:"element_implicitly_closed",start:y.start,end:y.fragment.nodes[0]?.start??L,by:W,closing:`</${y.name}>`})}function yf(r,y,L){return{type:r,start:y,end:-1,name:L}}function hf(r,y){let L=ii(r,!1),{name:W}=L,H=Eo.get(W);if(!H&&W.startsWith("svelte:"))Ct(L,cf);let J=uf(W);if(!J&&!ff(W))_t(L);if(H?.[1]){if(r.metaTags.has(W))St(y,W);if(r.current().type!=="Root")Tt(y,W);r.metaTags.add(W)}let U=yf(mf(r,W,J),y,W);if(r.loc)U.name_loc=L.loc;U.attributes=[],U.fragment={type:"Fragment",nodes:[]},r.allowWhitespace();let te=r.current();if(te.type==="RegularElement"&&qr(te.name,W))xl(r,te,y,`<${W}>`),te.end=y,r.close(),r.lastAutoClosedTag={tag:te.name,reason:W,depth:r.stack.length};if((W==="script"||W==="style")&&r.current().type==="Root"){let K=[];U.attributes=K,el(r,K,bf),Tf(r,U,y,K);return}if(el(r,U.attributes,Df),U.type==="SvelteComponent"){let K=Qa(U);if(!K)Et(y);if(!ao(K.value))xt(K.start);U.expression=Za(K.value)}else if(U.type==="SvelteElement"){let K=Qa(U);if(!K)Re(y);if(K.value===!0)Re(K);if(!ao(K.value))io(r.root,{code:"svelte_element_invalid_this",start:K.start,end:K.end});U.tag=ao(K.value)?Za(K.value):Cf(K.value[0])}if(!r.eat("/")&&!yr(W))if(r.eat(">",!0),W==="textarea")U.fragment.nodes=bl(r,(K,Ee)=>(oo.lastIndex=Ee,oo.test(K)),"inside <textarea>"),r.read(oo);else if(W==="script"||W==="style")U.fragment.nodes.push(Ef(r,`</${W}>`));else{r.open(U,U.fragment);return}else r.eat(">",!0);U.end=r.index,r.append(U)}function Ef(r,y){let L=r.index,W=r.source.indexOf(y,L);r.index=W===-1?r.source.length:W;let H=Cr(L,r.index,r.source.slice(L,r.index));return r.eat(y,!0),H}function Tf(r,y,L,W){r.eat(">",!0);let H=Sf(r.root.fragment.nodes,L);if(y.name==="style"){let te=zu(r,L,W);if(te.content.comment=H,r.root.css)yt(L);r.root.css=te;return}let J=Au(r,L,W);if(H&&r.comments)J.content.leadingComments=[{type:"Line",value:H.data}];let U=J.context==="module"?"module":"instance";if(r.root[U])ft(L);r.root[U]=J}function Sf(r,y){let L=r.length-1;if(L<0||r[L].end!==y)return null;for(let W=L;W>=0;W--){let H=r[W];if(H.type==="Comment")return H;if(H.type!=="Text"||H.data.trim())return null}return null}var xf=(r)=>r.type==="Attribute"&&r.name==="this";function Qa(r){let y=r.attributes.find(xf);if(y)r.attributes.splice(r.attributes.indexOf(y),1);return y}function ao(r){if(r===!0)return!1;if(!Array.isArray(r))return!0;return r.length===1&&r[0].type==="ExpressionTag"}function Za(r){return(Array.isArray(r)?r[0]:r).expression}function Cf(r){if(r.type!=="Text")return r.expression;return{type:"Literal",value:r.data,raw:`'${r.raw}'`,start:r.start,end:r.end}}function el(r,y,L){let W=new Set;for(;;){let H=L(r);if(!H)return;let{type:J}=H;if(J==="Attribute"||J==="BindDirective"||J==="StyleDirective"||J==="ClassDirective"){let U=`${J==="BindDirective"?"Attribute":J}${H.name}`;if(W.has(U))Ke(H);if(H.name!=="this")W.add(U)}y.push(H),r.allowWhitespace()}}function So(r,y,L,W,H){return r.loc?{type:"Attribute",start:L,end:W,name:y.name,name_loc:y.loc,value:H}:{type:"Attribute",start:L,end:W,name:y.name,value:H}}function Cl(r){if(Cn(r.source.charCodeAt(r.index)))D(r.index,"=")}function bf(r){let y=r.index,L=ii(r,!0);if(!L.name)return null;let W=!0;if(r.eat("=")){r.allowWhitespace();let{source:H}=r,J=r.index,U=Cn(H.charCodeAt(J)),te=-1;if(U){let Se=H.indexOf(H[J],J+1);if(Se!==-1)te=Se+1}if(te===-1){te=J;while(te<H.length&&H.charCodeAt(te)!==df&&!dn(H.charCodeAt(te)))te++;if(te===J)_e(J)}r.index=te;let K=U?1:0,Ee=H.slice(J+K,te-K);W=[Cr(te-Ee.length-K,te-K,Ee,Gt(Ee,!0,r.entityNames))]}return Cl(r),So(r,L,y,r.index,W)}function vf(r){let y=r.index,L=r.match("/*");if(!L&&!r.match("//"))return!1;r.index+=2;let W=r.readUntil(L?"*/":`
35
+ `);if(L)r.eat("*/");let H={type:L?"Block":"Line",start:y,end:r.index,value:W},J=r.sourceLocation(y,r.index);if(J)H.loc=J;if(r.comments)r.root.comments.push(H);return!0}function Df(r){while(vf(r))r.allowWhitespace();let y=r.index;if(r.eat("{"))return Pf(r,y);let L=ii(r,!0);if(!L.name)return null;let W=r.index;r.allowWhitespace();let H=!0;if(r.eat("=")){if(r.allowWhitespace(),r.match("/>"))H=[Cr(r.index,r.index+1,"/")],r.index++;else H=kf(r);W=r.index}else Cl(r);let J=L.name.indexOf(":"),U=J>0?pf.get(L.name.slice(0,J)):void 0;return U?Nf(r,U,L,J,y,W,H):So(r,L,y,W,H)}function Pf(r,y){if(r.allowWhitespace(),r.eat("@attach")){r.requireWhitespace();let H=fn(r);return r.eatClosingBrace(),{type:"AttachTag",start:y,end:r.index,expression:H}}if(r.eat("...")){let H=fn(r);return r.eatClosingBrace(),{type:"SpreadAttribute",start:y,end:r.index,expression:H}}let L=r.readIdentifierName();if(L.name==="")qe(y);r.eatClosingBrace();let W={type:"ExpressionTag",start:L.start,end:L.end,expression:L};return So(r,L,y,r.index,W)}function Af(r){if(r===!0)return;return Array.isArray(r)?r[0]:r}function Nf(r,y,L,W,H,J,U){let[te,...K]=L.name.slice(W+1).split("|");if(te==="")st({start:H,end:H+W+1},L.name);let Ee={start:H,end:J,type:y,name:te};if(r.loc)Ee.name_loc=L.loc;if(y==="StyleDirective")return Ee.modifiers=K,Ee.value=U,Ee;let Se=Af(U);if(Se&&(Array.isArray(U)&&U.length>1||Se.type==="Text"))it(Se.start);if(Ee.expression=Se?.expression??null,Ee.modifiers=K,y==="TransitionDirective"){let ve=L.name.slice(0,W);Ee.intro=ve!=="out",Ee.outro=ve!=="in"}if((y==="BindDirective"||y==="ClassDirective")&&!Ee.expression)Ee.expression={start:H+W+1,end:J,type:"Identifier",name:te};return Ee}function kf(r){let y=r.source.charCodeAt(r.index),L=Cn(y);if(L){if(r.index++,r.source.charCodeAt(r.index)===y)return r.index++,[Cr(r.index-1,r.index-1,"")]}let W;try{W=bl(r,L?(H,J)=>H.charCodeAt(J)===y:Hr,"in attribute value",L?y:void 0)}catch(H){let J=H instanceof e&&H.code==="js_parse_error"?H.position?.[0]:void 0;if(J!==void 0&&r.source.startsWith("/>",J-1))r.index=J,D(J,L?String.fromCharCode(y):"}");throw H}if(L)r.index++;else if(W.length===0)_e(r.index);return L||W.length>1||W[0].type==="Text"?W:W[0]}function bl(r,y,L,W){let{source:H}=r,J=[],U=r.index,te=(K)=>{if(K<=U)return;let Ee=H.slice(U,K);J.push(Cr(U,K,Ee,Gt(Ee,!0,r.entityNames)))};while(r.index<H.length){let K=r.index;if(y(H,K))return te(K),J;if(H.charCodeAt(K)!==Ka){if(r.index++,W!==void 0)while(r.index<H.length&&H.charCodeAt(r.index)!==Ka&&H.charCodeAt(r.index)!==W)r.index++;continue}r.index++;let Ee=H.charCodeAt(r.index);if(Ee===35||Ee===64){r.index++;let ve=r.index;while(r.index<H.length&&H.charCodeAt(r.index)>=97&&H.charCodeAt(r.index)<=122)r.index++;let Le=H.slice(ve,r.index);(Ee===35?Ye:$t)(K,Le,L)}te(K),r.allowWhitespace();let Se=fn(r);r.eatClosingBrace(),J.push({type:"ExpressionTag",start:K,end:r.index,expression:Se}),U=r.index}f(H.length)}var wf=new Map([["html","html"],["svg","svg"],["mathml","mathml"],["http://www.w3.org/2000/svg","svg"],["http://www.w3.org/1998/Math/MathML","mathml"]]),Lf=new Map([["type",(r,y)=>{if(y!=="String"&&y!=="Number"&&y!=="Boolean"&&y!=="Array"&&y!=="Object")return!1;return r.type=y,!0}],["reflect",(r,y)=>{if(typeof y!=="boolean")return!1;return r.reflect=y,!0}],["attribute",(r,y)=>{if(typeof y!=="string")return!1;return r.attribute=y,!0}]]),nl="[a-z0-9_.\\xB7\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u203F-\\u2040\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u{10000}-\\u{EFFFF}-]",_f=new RegExp(`^[a-z]${nl}*-${nl}*$`,"u"),Rf=new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" ")),Zr=(r)=>(y,L)=>{let W=ti(L);if(typeof W!=="boolean")fe(L,"true or false");y[r]=W},Mf=new Map([["runes",Zr("runes")],["immutable",Zr("immutable")],["preserveWhitespace",Zr("preserveWhitespace")],["accessors",Zr("accessors")],["namespace",(r,y)=>{let L=wf.get(ti(y));if(!L)fe(y,'"html", "mathml" or "svg"');r.namespace=L}],["css",(r,y)=>{if(ti(y)!=="injected")fe(y,'"injected"');r.css="injected"}],["tag",(r,y)=>bt(y)],["customElement",(r,y)=>{let L=Of(y);if(L)r.customElement=L}]]);function If(r){let y=[],L={start:r.start,end:r.end,attributes:y};for(let W of r.attributes){if(W.type!=="Attribute")Pt(W);y.push(W);let H=Mf.get(W.name);if(!H)Nt(W,W.name);H(L,W)}return L}function ti({value:r}){if(r===!0)return!0;let y=Array.isArray(r)?r:[r];if(y.length===0)return!0;if(y.length>1)return null;let[L]=y;if(L.type==="Text")return L.data;return L.expression.type==="Literal"?L.expression.value:null}function tl(r,y){if(typeof y!=="string")Ie(r);if(!y)return;if(!_f.test(y))Ie(r);if(Rf.has(y))Dt(r)}function mo(r){return r.type==="Property"&&!r.computed&&r.key.type==="Identifier"}function Ff(r,y){let L=new Map;for(let W of r.properties){if(!mo(W))y();if(!L.has(W.key.name))L.set(W.key.name,W.value)}return L}function Of(r){let y=()=>At(r);if(r.value===!0)y();let L=Array.isArray(r.value)?r.value[0]:r.value;if(L.type==="Text"){let Se=ti(r);return tl(r,Se),{tag:Se}}let{expression:W}=L;if(W.type!=="ObjectExpression"){if(W.type==="Literal"&&W.value===null)return;y()}let H=Ff(W,y),J={},U=H.get("tag");if(U){let Se=U.type==="Literal"?U.value:void 0;tl(null,Se),J.tag=Se}let te=H.get("props");if(te){let Se=()=>kt(r);if(te.type!=="ObjectExpression")Se();J.props={};for(let ve of te.properties){if(!mo(ve)||ve.value.type!=="ObjectExpression")Se();let Le={};J.props[ve.key.name]=Le;for(let Me of ve.value.properties){if(!mo(Me)||Me.value.type!=="Literal")Se();if(!Lf.get(Me.key.name)?.(Le,Me.value.value))Se()}}}let K=H.get("shadow");if(K)if(K.type==="ObjectExpression")J.shadow=K;else if(K.type==="Literal"&&(K.value==="open"||K.value==="none"))J.shadow=K.value;else wt(r);let Ee=H.get("extend");if(Ee)J.extend=Ee;return J}var Bf={"{":"}","(":")","[":"]"};function xo(r,y,L=Bf){let W=Object.values(L),H=[],J=y;while(J<r.length){let U=r[J++];if(U==="'"||U==='"'||U==="`")J=$f(r,J,U);else if(U===">"&&r[J-2]==="="&&W.includes(">"));else if(Object.hasOwn(L,U))H.push(U);else if(W.includes(U)){let te=L[H.pop()??""];if(U!==te)D(J-1,te);if(H.length===0)return J}}f(r.length)}function $f(r,y,L){let W=y;while(W<r.length){let H=r[W++];if(H===L)return W;if(H==="\\")W++;else if(L==="`"&&H==="$"&&r[W]==="{")W=xo(r,W)}It(y)}var Gf=/\?(?=\s*:)/g;function oi(r){let y=r.index,L=r.readIdentifierName();if(L.name!=="")return{...L,typeAnnotation:rl(r)};let W=r.source[r.index];if(W!=="{"&&W!=="[")lt(r.index);r.index=xo(r.source,y);let H=Ot(r,r.source.slice(0,r.index),y)??Vf(r,y);Ce(H,"ObjectPattern","ArrayPattern");let J=rl(r);if(H.typeAnnotation=J,J)H.end=J.end;return H}function Vf(r,y){let{node:L}=G(r,`${r.source.slice(0,r.index)} = 1`,y);return Ce(L,"AssignmentExpression"),L.left}function rl(r){let y=r.index;if(r.allowWhitespace(),!r.eat(":")){r.index=y;return}let L="_ as ",W=r.index-L.length,H=r.source.slice(0,W)+L+r.source.slice(r.index).replace(Gf," "),J=G(r,H,W).node;if(J.type==="AssignmentExpression"){let U=J.right.start;while(H[U]!=="=")U-=1;J=G(r,H.slice(0,U),W).node}if(J.type==="SequenceExpression")J=J.expressions[0];return r.index=J.end,{type:"TSTypeAnnotation",start:y,end:r.index,typeAnnotation:J.type==="TSAsExpression"?J.typeAnnotation:void 0}}var jf={IfBlock:"if",EachBlock:"each",KeyBlock:"key",AwaitBlock:"await",SnippetBlock:"snippet"},Nn=()=>({type:"Fragment",nodes:[]});function Wf(r,y){if(r.eat("if")){r.requireWhitespace();let L=fn(r);r.eatClosingBrace();let W=Nn();r.open({type:"IfBlock",elseif:!1,start:y,end:-1,test:L,consequent:W,alternate:null},W)}else if(r.eat("each"))Jf(r,y);else if(r.eat("await")){r.requireWhitespace();let L=fn(r);r.allowWhitespace();let W={type:"AwaitBlock",start:y,end:-1,expression:L,value:null,error:null,pending:null,then:null,catch:null},H=Nn();if(r.eat("then"))W.value=il(r),W.then=H;else if(r.eat("catch"))W.error=il(r),W.catch=H;else W.pending=H;r.eat("}",!0),r.open(W,H)}else if(r.eat("key")){r.requireWhitespace();let L=fn(r);r.eatClosingBrace();let W=Nn();r.open({type:"KeyBlock",start:y,end:-1,expression:L,fragment:W},W)}else if(r.eat("snippet"))Uf(r,y);else pt(r.index)}function il(r){if(r.matchRegex(sl))return r.allowWhitespace(),null;r.requireWhitespace();let y=oi(r);return r.allowWhitespace(),y}function Hf(r){let y={assertion:null},L=r.end,W=(J)=>{if(J.type==="TSAsExpression"&&J.end===r.end)return y.assertion=J,L=J.expression.end,J.expression;return q(J,W),J},H=r;if(r.type==="TSAsExpression")y.assertion=r,H=r.expression,L=H.end;else q(r,W);return H.end=L,{expression:H,assertion:y.assertion}}function Jf(r,y){r.requireWhitespace();let L=r.source,W;while(!W)try{W=fn(r)}catch(K){let Ee=((K instanceof e?K.position:void 0)?.[0]??y)-2;while(Ee>y&&r.source.slice(Ee,Ee+2)!=="as")Ee-=1;if(Ee<=y)throw r.source=L,K;r.source=L.slice(0,Ee)}if(r.source=L,r.allowWhitespace(),!r.match("as")){if(W.type==="SequenceExpression")W=W.expressions[0];let K=Hf(W);if(W=K.expression,K.assertion){let Ee=K.assertion.typeAnnotation.start-2;while(r.source.slice(Ee,Ee+2)!=="as")Ee-=1;r.index=Ee}}let H=null,J,U;if(r.eat("as"))r.requireWhitespace(),H=oi(r);else r.index=W.end;if(r.allowWhitespace(),r.eat(",")){if(r.allowWhitespace(),J=r.readIdentifierName().name,!J)$e(r.index);r.allowWhitespace()}if(r.eat("("))r.allowWhitespace(),U=fn(r),r.allowWhitespace(),r.eat(")",!0),r.allowWhitespace();r.eat("}",!0);let te=Nn();r.open({type:"EachBlock",start:y,end:-1,expression:W,body:te,context:H,index:J,key:U},te)}function Uf(r,y){r.requireWhitespace();let L=r.readIdentifierName();if(L.name==="")$e(r.index);r.allowWhitespace();let W=r.index,H;if(r.isTypeScript&&r.match("<")){let K=xo(r.source,W,{"<":">"});H=r.source.slice(W+1,K-1),r.index=K}r.allowWhitespace(),r.eat("(",!0);let J=1;while(r.index<r.source.length&&(!r.match(")")||J!==1)){if(r.match("("))J++;if(r.match(")"))J--;r.index+=1}r.eat(")",!0);let{node:U}=G(r,`${r.source.slice(0,r.index)} => {}`,W,!0);r.eatClosingBrace();let te=Nn();r.open({type:"SnippetBlock",start:y,end:-1,expression:L,typeParams:H,parameters:U.type==="ArrowFunctionExpression"?U.params:void 0,body:te},te)}function zf(r,y){let L=r.index-1,W=r.current();if(W.type==="IfBlock"){if(!r.eat("else"))D(L,"{:else} or {:else if}");if(r.eat("if"))Xe(L);if(W.alternate)de(L,"{:else}");if(r.allowWhitespace(),W.alternate=Nn(),r.setFragment(W.alternate),r.eat("if")){r.requireWhitespace();let H=fn(r);r.eatClosingBrace();let J=Nn();r.open({start:y,end:-1,type:"IfBlock",elseif:!0,test:H,consequent:J,alternate:null},J)}else r.eatClosingBrace()}else if(W.type==="EachBlock"){if(!r.eat("else"))D(L,"{:else}");if(W.fallback)de(L,"{:else}");r.eatClosingBrace(),W.fallback=Nn(),r.setFragment(W.fallback)}else if(W.type==="AwaitBlock"){let H;if(r.eat("then"))H="then";else if(r.eat("catch"))H="catch";else D(L,"{:then ...} or {:catch ...}");if(W[H])de(L,`{:${H}}`);if(!r.eat("}")){r.requireWhitespace();let U=oi(r);if(H==="then")W.value=U;else W.error=U;r.eatClosingBrace()}let J=Nn();W[H]=J,r.setFragment(J)}else ze(L)}function qf(r){let y=r.current(),L=jf[y.type];if(!L)Ze(r.index-1);r.eat(L,!0),r.eatClosingBrace();while(y.type==="IfBlock"&&y.elseif)y.end=r.index,r.close(),y=r.current();y.end=r.index,r.close()}function Xf(r){return r.type==="CallExpression"||r.type==="ChainExpression"&&r.expression.type==="CallExpression"}function Kf(r,y){if(r.eat("html")){r.requireWhitespace();let L=fn(r);r.eatClosingBrace(),r.append({type:"HtmlTag",start:y,end:r.index,expression:L})}else if(r.eat("debug")){let L=[];if(!r.read(sl)){let W=fn(r),H=W.type==="SequenceExpression"?W.expressions:[W];for(let J of H){if(J.type!=="Identifier")rt(J.start);L.push(J)}r.eatClosingBrace()}r.append({type:"DebugTag",start:y,end:r.index,identifiers:L})}else if(r.eat("const")){r.requireWhitespace();let L=oi(r);r.allowWhitespace(),r.eat("=",!0),r.allowWhitespace();let W=r.index,H=fn(r),J=r.index;if(H.type==="SequenceExpression"&&!r.source.slice(W,H.start).includes("("))et(H);r.eatClosingBrace();let U={type:"VariableDeclarator",id:L,init:H,start:L.start,end:J};r.append({type:"ConstTag",start:y,end:r.index,declaration:{type:"VariableDeclaration",kind:"const",declarations:[U],start:y+2,end:r.index-1}})}else if(r.eat("render")){r.requireWhitespace();let L=fn(r);if(!Xf(L))dt(L);r.eatClosingBrace(),r.append({type:"RenderTag",start:y,end:r.index,expression:L})}else ct(r.index)}var Yf=/(?:var|interface|enum)\b/y,Qf=/(?:let|const|type)\b/y;function Zf(r){let y=r.index;if(r.index+=1,r.allowWhitespace(),r.eat("#"))Wf(r,y);else if(r.eat(":"))zf(r,y);else if(r.eat("@"))Kf(r,y);else if(r.match("/")&&!r.match("/*")&&!r.match("//"))r.index+=1,qf(r);else if(!em(r,y)){let L=fn(r);r.eatClosingBrace(),r.append({type:"ExpressionTag",start:y,end:r.index,expression:L})}}function em(r,y){let L=r.index,W=r.matchRegex(Yf);if(W)De({start:L,end:L+W.length});if(!r.matchRegex(Qf))return!1;let H=r.root.comments.length,J=Mt(r,r.source,L);if(J.type==="ExpressionStatement")return r.root.comments.length=H,!1;if(J.type!=="VariableDeclaration"||J.kind!=="let"&&J.kind!=="const")De(J);return r.index=J.end,r.eatClosingBrace(),r.append({type:"DeclarationTag",start:y,end:r.index,declaration:J}),!0}function nm(r){let{source:y,index:L}=r;if(r.nextAngle<L)r.nextAngle=ol(y,"<",L);if(r.nextBrace<L)r.nextBrace=ol(y,"{",L);let W=Math.min(r.nextAngle,r.nextBrace);r.index=W;let H=y.slice(L,W);r.append({type:"Text",start:L,end:W,raw:H,data:Gt(H,!1,r.entityNames)})}function ol(r,y,L){let W=r.indexOf(y,L);return W===-1?r.length:W}function vl(r,y,L){let W=Co(r,y,L);while(W.index<W.source.length)vo(W);return bo(W)}function Co(r,y,L){let W=$r(r);return M(W),new al(W.trimEnd(),W.length,L,y)}function bo(r){if(r.stack.length>1){let H=r.current();if(H.end=H.start+1,H.type==="RegularElement")Ne(H,H.name);Qe(H)}let{nodes:y}=r.root.fragment,L=y.findIndex((H)=>H.type==="SvelteOptions"),W=y[L];if(W?.type==="SvelteOptions"){y.splice(L,1),r.root.options=If(W);let{nodes:H}=W.fragment;if(H.length>0)vt({start:H[0].start,end:H[H.length-1].end},W.name)}return r.root}function vo(r){if(r.match("<"))To(r);else if(r.match("{"))Zf(r);else nm(r)}function Dl(r,y,L){M(r);let W={isTypeScript:y.typescript??!1,typescript:L,loc:!1,comments:!1,root:{comments:[]}};return Ft(W,r,(H)=>la(r,y.localExports??!0,H))}function Pl(r,y,L){let W=Co(r,y,L);return tm(W),bo(W)}function tm(r){let{source:y}=r,{tags:L,comments:W}=Ca(y),H=r.root.fragment.nodes,J=(Ee,Se)=>{if(Se<=Ee)return;let ve=y.slice(Ee,Se),Le=ve.includes("<")||ve.includes("{")?ve:Gt(ve,!1,r.entityNames);H.push({type:"Text",start:Ee,end:Se,raw:ve,data:Le})},U=0,te=0;for(let Ee of L){for(;te<W.length&&W[te]<Ee;te+=2){let Se=W[te];if(Se<U)continue;let ve=W[te+1];J(U,Se),H.push({type:"Comment",start:Se,end:ve,data:y.slice(Se+4,ve-3)}),U=ve}if(Ee<U)continue;J(U,Ee),r.index=Ee,To(r);while(r.stack.length>1&&r.index<y.length)vo(r);U=r.index}let K=H.filter((Ee)=>Ee.type==="SvelteOptions");H.length=0,H.push(...K)}function Al(r={}){let y=kl(r),{typescript:L}=y;return{parse:(W,H)=>vl(W,H,y),parseModule:(W,H={})=>ye(W,H,L),parseImportsExports:(W,H={})=>Dl(W,H,L)}}function Nl(r={}){let y=kl(r);return{parseSections:(L,W)=>Pl(L,W,y)}}function kl(r){return{typescript:Ue(r.typescript),entityNames:Je(r.entities)??ja}}var Do=He(ge);var wl,Ll;function Be(r){return wl??=Al({typescript:Do}),wl.parse(r,{css:!1})}function zt(r){return Ll??=Nl({typescript:Do}),Ll.parseSections(r,{css:!1})}var rm=/\s*=\s*/,im=/^[^"'`\s]\S*$/;function om(r){let y=r.indexOf("<");if(y===-1||!r.endsWith(">"))return r;let L=r.slice(0,y),W=r.slice(y+1,-1),H=i(W,",").map((J)=>J.trim().replace(rm," = ")).join(", ");return`${L}<${H}>`}var sm=new Set(["restProps","slot","snippet","event","typedef","callback"]),Po=new Set(["property","type"]),_l=new Set(["slot","snippet","typedef","callback"]);function si(r){if(r.length===0)return;return Un(r[Ei(r)].content)}function Rl(r){return!r||!r.tag&&!r.continuesType&&r.content.trim()===""}function am(r){return r.text.split(`
36
36
  `).length===r.lines.length}function ai(r,y){if(y<=0)return r;return r.split(`
37
37
  `).slice(0,-y).join(`
38
38
  `).trimEnd()}var lm=new Set(["abstract","access","alias","alpha","arg","argument","async","augments","author","beta","borrows","const","constructs","copyright","defaultValue","description","emits","experimental","exports","external","fires","function","global","import","inner","instance","kind","lends","license","link","listens","member","name","override","package","private","prop","protected","public","readonly","remarks","requires","satisfies","sealed","static","summary","throws","todo","tutorial","typeParam","version","virtual","yields"]),pm=[...Pr,...Ti,"type","param","returns","typedef","property","callback","template","generics","slot","snippet","event","restProps","extends","extendProps","deprecated","ignore","internal","sveld-ignore","csspart","cssprop"],cm=/;$/;function dm(r){let y=r.trim().replace(cm,"").trimEnd();if(!y.startsWith("{")||!y.endsWith("}"))return!1;return E(y,0)===y.length-1}var um=/[\w$]+/g,fm=new Set(["property","param","returns","return"]);function mm(r,y,L){let W=[r[y].type];for(let J=y+1;fm.has(r[J]?.tag);J++)W.push(r[J].type);let H=new Set(W.join(" ").match(um));return L.some(({name:J})=>H.has(J))}function gm(r){let y=r.trim();return!y||y==="object"||y==="Object"}function Ml(r,y){if(y.usedGenericsTag&&y.usedTemplateTag&&!y.warnedMixedGenericsTags){y.warnedMixedGenericsTags=!0;let L=r.componentFilePath?` in ${r.componentFilePath}`:"";console.warn(`Warning: Both @generics and @template tags are used to declare component generics${L}; their declarations are combined in the order encountered.`)}}function Il(r,y,L,W){if(y.seenGenericNames.has(L))en(r,"generics-conflict",L,`Duplicate generic name "${L}".`,W);else y.seenGenericNames.add(L)}function Fl(r,y,L){if(r.generics){let H=i(r.generics[0],",").map((J)=>J.trim()).indexOf(y.trim());if(H!==-1){let J=i(r.generics[1],",").map((U)=>U.trim());J[H]=L,r.generics=[r.generics[0],J.join(", ")];return}}Mr(r,y,L)}function Ol(r,{name:y,description:L,tags:W,internal:H,source:J},U,te){if(r.typedefs.has(y))en(r,"typedef-duplicate",y,`Duplicate typedef/callback name "${y}"; the later declaration overwrites the earlier one.`,J);r.typedefs.set(y,{type:U,name:y,description:L||void 0,ts:te,tags:W.length>0?W:void 0,...H?{internal:!0}:{},source:J})}function ym(r,y,L,W,H){let J=y.findIndex((U)=>U.name===L.name);if(J===-1)y.push(L);else{let U=W?` of "${W}"`:"";en(r,"property-duplicate",L.name,`Duplicate property "${L.name}"${U}; the later declaration overwrites the earlier one.`,H),y[J]=L}}class Bl{tags;lines;commentDescription;commentDescriptionUsed=!1;isFirstTag=!0;event;typedef;callback;typeDeclaration;attachTrailingTag;pendingTags=[];pendingDeprecated;pendingInternal=!1;pendingTypeParameters=[];lineDescriptions=new Map;tagLineNumbers=new Set;consumedDescriptionLines=new Set;indentedContinuationLines=new Set;trimBodyAbove;trimThisBody;hasSlotOrSnippetTag;hasExtendsTag;ctx;generics;documentsFunction;constructor(r,y,L,W){this.ctx=r,this.generics=y,this.documentsFunction=W;let{tags:H,lines:J}=L;this.tags=H,this.lines=J,this.commentDescription=L.description,this.hasSlotOrSnippetTag=H.some((K)=>K.tag==="slot"||K.tag==="snippet"),this.hasExtendsTag=H.some((K)=>K.tag==="extends"||K.tag==="extendProps");for(let K of H)if(K.lines.length>0)this.tagLineNumbers.add(K.lines[0].number);for(let K of J)if(K.continuesType)this.tagLineNumbers.add(K.number);let U=!1,te=!1;for(let K of J){if(!K.tag&&!K.continuesType&&K.content&&(te||K.content.trim()!=="}"))this.lineDescriptions.set(K.number,K.content);if(K.tag!==void 0||K.continuesType)U=!0;else if(!K.content.trim());else if(U&&(K.indent||te))this.indentedContinuationLines.add(K.number);else U=!1;if(Xt(K.content))te=!te}}orCommentDescription(r){if(r||!this.isFirstTag||this.commentDescriptionUsed||!this.commentDescription)return r;return this.commentDescriptionUsed=!0,this.commentDescription}typeDeclarationName(r){if(this.pendingTypeParameters.length===0)return om(r);let y=`${r}<${this.pendingTypeParameters.join(", ")}>`;return this.pendingTypeParameters.length=0,y}joinBlockLines(r,y){let L=y?y.text.split(`
39
- `):[],W=y?.line;for(let H of r){if(W!==void 0&&H-W>1){let U=W+1;while(U<H&&Rl(this.lines[U]))U++;if(U===H)for(let te=W+1;te<H;te++)L.push("")}let J=this.lines[H];L.push(J.indent+J.content),W=H}return Dr(L)}getPrecedingDescription(r){if(r.length===0)return;let y=r[0].number,L=[],W=!1;for(let H=y-1;H>=0;H--){if(this.tagLineNumbers.has(H)||this.indentedContinuationLines.has(H)||this.consumedDescriptionLines.has(H))break;if(this.lineDescriptions.has(H))L.unshift(H),W=!0;else if(W&&!Rl(this.lines[H]))break}if(L.length===0)return;for(let H of L)this.consumedDescriptionLines.add(H);return this.trimBodyAbove?.(L[0]),this.joinBlockLines(L)}claimBodyLines(r,y){if(!am(r)){for(let W=1;W<r.lines.length;W++)this.consumedDescriptionLines.add(r.lines[W].number);return}let L=r.lines[r.lines.length-1].number;this.trimThisBody=(W)=>y(L-W+1)}getTagDescription(r,y,L=!1){let W=si(r),H=y!==void 0&&sm.has(y.tag)&&!si(y.lines),J=L&&(y===void 0||!Po.has(y.tag)),U=[];for(let te=1;te<r.length;te++){let K=r[te];if((H||J)&&!this.indentedContinuationLines.has(K.number))continue;if(!this.lineDescriptions.get(K.number)?.trim()||this.consumedDescriptionLines.has(K.number))continue;U.push(K.number),this.consumedDescriptionLines.add(K.number)}if(U.length===0)return W;return this.joinBlockLines(U,{text:W??"",line:r[Ei(r)].number})}flagDescriptionAfterEvent(r,y,L,W){let{event:H}=this;if(H===void 0||H.description)return;if(H.tagLine!==void 0&&this.indentedContinuationLines.has(H.tagLine+1))return;if(W?.tag!=="event"&&!Po.has(W?.tag??""))return;if(si(L))return;let J=y?`@${r} "${y}"`:`@${r}`;en(this.ctx,"event-description-ambiguous",H.name,`Text after @event "${H.name}" was used as the description of ${J}. Move it above the tag it describes, indent it as a continuation line, or give each event its own comment block.`,vn(this.ctx,L))}takePrecedingDescription(r){let{tag:y,name:L,lines:W}=this.tags[r],H=this.getPrecedingDescription(W);if(H)this.flagDescriptionAfterEvent(y,L,W,this.tags[r-1]);return H}finalizeEvent(){let{ctx:r,event:y}=this;if(y===void 0)return;this.event=void 0;let W=(y.type&&y.type!=="object"&&y.type!=="Object"?y.type:void 0)??(y.properties.length>0?cr(y.properties,!0):y.type||""),{tagLine:H}=y;if(H!==void 0){let Ee=this.tags.find((ve)=>{let Le=ve.lines[0]?.number;return Le!==void 0&&Le>H&&!Po.has(ve.tag)})?.lines[0].number,Se=Array.from(this.lineDescriptions.keys()).sort((ve,Le)=>ve-Le).filter((ve)=>ve>H&&(Ee===void 0||ve<Ee)&&!this.consumedDescriptionLines.has(ve)&&this.lineDescriptions.get(ve)?.trim());for(let ve of Se)this.consumedDescriptionLines.add(ve);if(Se.length>0)y.description=this.joinBlockLines(Se,y.description?{text:y.description,line:H}:void 0)}let{name:J,description:U,source:te}=y,K=W===""&&(!r.events.has(J)||r.untypedJsDocEventNames.has(J));if(_n(r,{name:J,detail:W,has_argument:!1,description:U,deprecated:y.deprecated,tags:y.tags.length>0?y.tags:void 0,internal:y.internal||void 0,source:te}),K)r.untypedJsDocEventNames.add(J);r.eventDescriptions.set(J,U),r.jsDocEventNames.add(J),r.jsDocEventSources.set(J,te),kn(r,"event-no-source",J,y.ignores)}finalizeTypedef(){let{ctx:r,typedef:y}=this;if(y===void 0)return;this.typedef=void 0;let{properties:L}=y,W=L.length>0,H=W?cr(L,!0):y.type||"{}",J=!W&&y.type&&dm(H)?`interface ${y.name} ${H}`:`type ${y.name} = ${H};`,U=W?L.filter(({name:te})=>!te.includes(".")&&!te.startsWith("[")).map(({name:te,type:K,optional:Ee,description:Se})=>({name:te,type:K,optional:Ee===!0,...Se?{description:Se}:{}})):d(H,{skipIndexSignatures:!0});if(U)r.typedefMembersByName.set(y.name,U);Ol(r,y,H,J)}finalizeCallback(){let{callback:r}=this;if(r===void 0)return;this.callback=void 0;let y=`(${h(r.params)}) => ${r.returnType||"void"}`;Ol(this.ctx,r,y,`type ${r.name} = ${y};`)}openTypeDeclaration(r){let{name:y,lines:L}=this.tags[r],W={name:this.typeDeclarationName(y),source:vn(this.ctx,L),description:this.orCommentDescription(this.getTagDescription(L,this.tags[r+1])||this.takePrecedingDescription(r)),tags:this.pendingTags.splice(0),internal:this.pendingInternal},{tags:H}=W;if(this.pendingDeprecated!==void 0)H.push({name:"deprecated",body:this.pendingDeprecated===!0?"":this.pendingDeprecated}),this.pendingDeprecated=void 0;return this.pendingInternal=!1,this.attachTrailingTag=(J)=>H.push(J),this.isFirstTag=!1,W}readExtends(r,y){let{name:L,lines:W}=this.tags[r];if(this.ctx.extends!==void 0)en(this.ctx,"extend-props-duplicate",L,`A second @extends/@extendProps tag ("${L}") overwrote the first ("${this.ctx.extends.interface}"); only one is used.`,vn(this.ctx,W));this.ctx.extends={interface:L,import:im.test(y)?JSON.stringify(y):y},this.isFirstTag=!1}readRestProps(r,y){let{name:L,description:W}=this.tags[r],H=L?W?`${L} ${W}`:L:W,J=Un(H),U=this.orCommentDescription(J||this.takePrecedingDescription(r)),te={type:"Element",name:y,description:U||void 0};if(this.ctx.rest_props=te,J)this.claimBodyLines(this.tags[r],(K)=>{te.description=Un(ai(H,K))||void 0});this.isFirstTag=!1}readSlot(r,y){let{tag:L,name:W,lines:H}=this.tags[r],J=W==="-"||L==="snippet"&&W==="children"?void 0:W,U=this.orCommentDescription(this.getTagDescription(H,this.tags[r+1]));if(!U&&this.pendingTags.length===0)U=this.takePrecedingDescription(r);this.isFirstTag=!1;let te=y||"Record<string, never>",K=vn(this.ctx,H);if(!y)en(this.ctx,"slot-missing-type",J||"default",`@${L}${J?` "${J}"`:""} is missing a required {Type} annotation; falling back to "${te}".`,K);let Ee=this.pendingTags.splice(0),Se=Mn(J);this.ctx.jsDocSlots.set(Se,{tag:L,source:K}),gr(this.ctx,{slot_name:J,slot_props:te,slot_description:U||void 0,slot_deprecated:this.pendingDeprecated,slot_tags:Ee.length>0?Ee:void 0,slot_internal:this.pendingInternal||void 0,source:K}),this.pendingDeprecated=void 0,this.pendingInternal=!1,this.typeDeclaration=void 0,this.attachTrailingTag=(ve)=>{let Le=this.ctx.slots.get(Se);if(Le)Le.tags=[...Le.tags??[],ve]}}readEvent(r,y){let{name:L,lines:W}=this.tags[r],H=si(W)||this.takePrecedingDescription(r);this.finalizeEvent();let J=this.pendingTags.splice(0);this.event={name:L,type:y,tagLine:W.length>0?W[0].number:void 0,description:this.orCommentDescription(H),source:vn(this.ctx,W),tags:J,internal:this.pendingInternal,deprecated:this.pendingDeprecated,ignores:[],properties:[]},this.pendingInternal=!1,this.pendingDeprecated=void 0,this.typeDeclaration=void 0,this.attachTrailingTag=(U)=>J.push(U),this.isFirstTag=!1}readProperty(r,y){let{name:L,optional:W,default:H,lines:J}=this.tags[r],U=this.getTagDescription(J,this.tags[r+1],this.event!==void 0),te=this.event??(this.typedef&&gm(this.typedef.type)?this.typedef:void 0);if(te===void 0)return;ym(this.ctx,te.properties,{name:L,type:y,description:U,optional:W||!1,default:H},te.name,vn(this.ctx,J))}readTypedef(r,y){this.finalizeTypedef(),this.typedef={...this.openTypeDeclaration(r),type:y,properties:[]},this.typeDeclaration=this.typedef}readCallback(r){this.finalizeCallback(),this.callback={...this.openTypeDeclaration(r),params:[],returnType:void 0},this.typeDeclaration=this.callback}readGenerics(r,y){let{name:L,lines:W}=this.tags[r],H=vn(this.ctx,W);for(let J of i(L,","))Il(this.ctx,this.generics,J.trim(),H);this.generics.usedGenericsTag=!0,Ml(this.ctx,this.generics),Fl(this.ctx,L,y||L),this.isFirstTag=!1}readTemplate(r,y){let{tags:L}=this,W=Ci(L[r],y),H=r+1;while(L[H]?.tag==="template")H++;let J=L[H];if((J?.tag==="typedef"||J?.tag==="callback")&&!J.name.includes("<")&&mm(L,H,W)){this.pendingTypeParameters.push(...W.map(({constraint:te})=>te));return}if(this.hasSlotOrSnippetTag&&!this.hasExtendsTag){this.ctx.deferredSlotBlockGenerics.push(...W);return}if(this.documentsFunction)return;let U=vn(this.ctx,L[r].lines);for(let te of W)Il(this.ctx,this.generics,te.name,U),Fl(this.ctx,te.name,te.constraint);this.generics.usedTemplateTag=!0,Ml(this.ctx,this.generics),this.isFirstTag=!1}readDeprecated(r){let{text:y}=this.tags[r],{event:L}=this;if(!L&&this.typeDeclaration){let H={name:"deprecated",body:y};this.typeDeclaration.tags.push(H),this.claimBodyLines(this.tags[r],(J)=>{H.body=ai(y,J)});return}if((L?L.deprecated:this.pendingDeprecated)!==void 0)return;let W=(H)=>{if(L)L.deprecated=H;else this.pendingDeprecated=H};W(Ar(y)),this.claimBodyLines(this.tags[r],(H)=>{W(Ar(ai(y,H)))})}readPassthrough(r){let{tag:y,text:L,lines:W}=this.tags[r],H={name:y,body:L};if(this.claimBodyLines(this.tags[r],(J)=>{H.body=ai(L,J)}),!Pr.has(y)&&!Ti.has(y)){let J=lm.has(y)?void 0:I(y,pm,y.length<=4?1:2);en(this.ctx,"jsdoc-unknown-tag",y,J?`Unknown JSDoc tag "@${y}"; did you mean "@${J}"? Passed through unchanged.`:`Unknown JSDoc tag "@${y}"; passed through unchanged. If this is a typo, fix the tag name.`,vn(this.ctx,W))}if(this.attachTrailingTag)this.attachTrailingTag(H);else this.pendingTags.push(H)}read(){let{tags:r}=this;for(let W=0;W<r.length;W++){let{tag:H,type:J,name:U,optional:te}=r[W],K=En(J);switch(this.trimBodyAbove=this.trimThisBody,this.trimThisBody=void 0,H){case"extends":case"extendProps":this.readExtends(W,K);break;case"restProps":this.readRestProps(W,K);break;case"slot":case"snippet":this.readSlot(W,K);break;case"csspart":{let Ee=this.getTagDescription(r[W].lines,r[W+1]);this.ctx.cssParts.push({name:U,...Ee?{description:Ee}:{}});break}case"cssprop":case"cssproperty":{let Ee=this.getTagDescription(r[W].lines,r[W+1]),Se=r[W].default;this.ctx.cssProperties.push({name:U,...K?{type:K}:{},...Se===void 0?{}:{default:Se},...Ee?{description:Ee}:{}});break}case"event":this.readEvent(W,K);break;case"type":if(this.event)this.event.type=K;break;case"param":this.callback?.params.push({name:U,type:K,optional:te||!1});break;case"returns":case"return":if(this.callback)this.callback.returnType=K;break;case"property":this.readProperty(W,K);break;case"typedef":this.readTypedef(W,K);break;case"callback":this.readCallback(W);break;case"generics":this.readGenerics(W,K);break;case"template":this.readTemplate(W,K);break;case"deprecated":this.readDeprecated(W);break;case"ignore":case"internal":if(this.event)this.event.internal=!0;else if(this.typeDeclaration)this.typeDeclaration.internal=!0;else this.pendingInternal=!0;break;case"sveld-ignore":this.event?.ignores.push(U);break;case"enum":case"class":case"implements":case"this":case"namespace":case"memberof":case"module":case"file":case"overview":break;default:this.readPassthrough(W);break}if(_l.has(H))this.finalizeEvent()}this.finalizeEvent(),this.finalizeTypedef(),this.finalizeCallback();let y=[...this.pendingTags,...this.pendingDeprecated===void 0?[]:[{name:"deprecated"}],...this.pendingInternal?[{name:"internal"}]:[]];if(y.length===0)return;if(!r.some((W)=>W.tag==="event"||_l.has(W.tag)))return;for(let W of y)en(this.ctx,"jsdoc-tag-dropped",W.name,`@${W.name} could not attach to a @slot/@snippet/@event/@typedef/@callback tag in the same comment block and was dropped.`)}}function $l(r,y=r.source){if(!y)return;let L={usedGenericsTag:!1,usedTemplateTag:!1,warnedMixedGenericsTags:!1,seenGenericNames:new Set},W=y.includes("@template")?Bo(r):new Set;r.functionDocCommentStarts=W;let H=Yt(y);for(let J of H)r.jsDocBlocksByStart.set(J.start,J);for(let J of H)new Bl(r,L,J,W.has(J.start)).read()}var Vl=new Set(["$state","$derived","$effect","$props","$bindable","$inspect","$host"]),hm=Array.from(Vl);function Gl(r){return r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r===95||r===36}function Em(r){if(r.includes("\\u"))return!0;for(let y of hm){let L=r.indexOf(y);while(L!==-1){if(!Gl(r.charCodeAt(L-1))&&!Gl(r.charCodeAt(L+y.length)))return!0;L=r.indexOf(y,L+1)}}return!1}function Tm(r,y){for(let L=y.length-1;L>=0;L-=1)if(y[L]?.has(r))return!0;return!1}function Sm(r){let y=new Set;switch(r.type){case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":if(r.type!=="ArrowFunctionExpression"&&r.id)y.add(r.id.name);for(let L of r.params)un(L,y);break;case"BlockStatement":li(r.body,y);break;case"CatchClause":un(r.param,y);break;case"EachBlock":if(un(r.context,y),r.index)y.add(r.index);break;case"AwaitBlock":un(r.value,y),un(r.error,y);break}return y}function li(r,y){for(let L of r??[])switch(L.type){case"ImportDeclaration":for(let W of L.specifiers)y.add(W.local.name);break;case"VariableDeclaration":for(let W of L.declarations)un(W.id,y);break;case"FunctionDeclaration":case"ClassDeclaration":if(L.id?.name)y.add(L.id.name);break;case"ExportNamedDeclaration":if(L.declaration)li([L.declaration],y);break;case"BlockStatement":case"BreakStatement":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExportAllDeclaration":case"ExportDefaultDeclaration":case"ExpressionStatement":case"ForInStatement":case"ForOfStatement":case"ForStatement":case"IfStatement":case"LabeledStatement":case"ReturnStatement":case"StaticBlock":case"SwitchStatement":case"ThrowStatement":case"TryStatement":case"TSDeclareFunction":case"TSEnumDeclaration":case"TSExportAssignment":case"TSImportEqualsDeclaration":case"TSInterfaceDeclaration":case"TSModuleDeclaration":case"TSNamespaceExportDeclaration":case"TSTypeAliasDeclaration":case"WhileStatement":case"WithStatement":break}}function Ao(r,y){if(!r)return!1;let L=[...y],W=!1;return o(r,{enter(H,J){if(oe(H.type))return l;if(Yn(H))L.push(Sm(H));if(H.type==="Identifier"&&Vl.has(H.name)&&z(H,J)&&!Tm(H.name,L))return W=!0,T},leave(H){if(Yn(H))L.pop()}}),W}function jl(r){if(r.runesOptionOverride!==void 0)return r.runesOptionOverride?"runes":"legacy";let y=r.parsed;if(!y)return"legacy";if(r.source!==void 0&&!Em(r.source))return"legacy";let L=new Set;li(y.module?.content.body,L);let W=new Set;return li(y.instance?.content.body,W),Ao(y.module,[L])||Ao(y.instance,[L,W])||Ao(y.fragment,[L,W])?"runes":"legacy"}var xm=new Set(["TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion","TSInstantiationExpression"]);function Cm(r){if(r.type!=="TSAsExpression"&&r.type!=="TSTypeAssertion")return!1;let y="typeAnnotation"in r?r.typeAnnotation:void 0;return y?.type==="TSTypeReference"&&y.typeName.type==="Identifier"&&y.typeName.name==="const"}function pi(r,y){if(!r)return;o(r,{enter(L){if(!xm.has(L.type)||!("expression"in L)||!L.expression)return;let{expression:W}=L;if(typeof W!=="object")return W;let H=y.typeAssertions.get(L);if(y.constAssertions.has(L)||H===void 0&&Cm(L))y.constAssertions.add(W);else if(H!==void 0)y.typeAssertions.set(W,H);else if((L.type==="TSAsExpression"||L.type==="TSTypeAssertion")&&"typeAnnotation"in L)y.typeAssertions.set(W,L.typeAnnotation);return W}})}var bm=/\/\/(?<!^[ \t]*\*.*\/\/)\s*@ts-[^\n\r]*/gm;function vm(r){if(!r.includes("@ts-"))return r;let y=r.charCodeAt(0)===65279?1:0,{instance:L,module:W}=eo(r),H=[L,W].flatMap((te)=>te?[te.content]:[]).sort((te,K)=>te.start-K.start),J="",U=0;for(let{start:te,end:K}of H)J+=r.slice(U,te+y),J+=r.slice(te+y,K+y).replace(bm,""),U=K+y;return J+r.slice(U)}function Wl(r,y,L){r.componentFilePath=L;let W=vm(y);r.source=W;let H=Be(W);if(js(r,H),r.parsed=H,r.scriptLanguage==="ts")pi(H.module,r.typeCasts),pi(H.instance,r.typeCasts),pi(H.fragment,r.typeCasts);r.syntaxMode=jl(r);let J=H.css,U=J?W.slice(0,J.start)+" ".repeat(J.end-J.start)+W.slice(J.end):W;we(r,H.module),we(r,H.instance),$l(r,U)}class re{ctx=ci();cleanup(){this.ctx=ci()}parseSvelteComponent(r,y){let{component:L,pending:W}=this.parse(r,y);if(W)L[v]={...L[v]??{canonicalPropNames:[],localTypeDeclarations:[],typeImportStatements:[]},...W};return L}parse(r,y){this.cleanup();let L=this.ctx;Wl(L,r,y.filePath),Ga(L);let W=Xs(L);return _a(L,W)}}
39
+ `):[],W=y?.line;for(let H of r){if(W!==void 0&&H-W>1){let U=W+1;while(U<H&&Rl(this.lines[U]))U++;if(U===H)for(let te=W+1;te<H;te++)L.push("")}let J=this.lines[H];L.push(J.indent+J.content),W=H}return Dr(L)}getPrecedingDescription(r){if(r.length===0)return;let y=r[0].number,L=[],W=!1;for(let H=y-1;H>=0;H--){if(this.tagLineNumbers.has(H)||this.indentedContinuationLines.has(H)||this.consumedDescriptionLines.has(H))break;if(this.lineDescriptions.has(H))L.unshift(H),W=!0;else if(W&&!Rl(this.lines[H]))break}if(L.length===0)return;for(let H of L)this.consumedDescriptionLines.add(H);return this.trimBodyAbove?.(L[0]),this.joinBlockLines(L)}claimBodyLines(r,y){if(!am(r)){for(let W=1;W<r.lines.length;W++)this.consumedDescriptionLines.add(r.lines[W].number);return}let L=r.lines[r.lines.length-1].number;this.trimThisBody=(W)=>y(L-W+1)}getTagDescription(r,y,L=!1){let W=si(r),H=y!==void 0&&sm.has(y.tag)&&!si(y.lines),J=L&&(y===void 0||!Po.has(y.tag)),U=[];for(let te=1;te<r.length;te++){let K=r[te];if((H||J)&&!this.indentedContinuationLines.has(K.number))continue;if(!this.lineDescriptions.get(K.number)?.trim()||this.consumedDescriptionLines.has(K.number))continue;U.push(K.number),this.consumedDescriptionLines.add(K.number)}if(U.length===0)return W;return this.joinBlockLines(U,{text:W??"",line:r[Ei(r)].number})}flagDescriptionAfterEvent(r,y,L,W){let{event:H}=this;if(H===void 0||H.description)return;if(H.tagLine!==void 0&&this.indentedContinuationLines.has(H.tagLine+1))return;if(W?.tag!=="event"&&!Po.has(W?.tag??""))return;if(si(L))return;let J=y?`@${r} "${y}"`:`@${r}`;en(this.ctx,"event-description-ambiguous",H.name,`Text after @event "${H.name}" was used as the description of ${J}. Move it above the tag it describes, indent it as a continuation line, or give each event its own comment block.`,vn(this.ctx,L))}takePrecedingDescription(r){let{tag:y,name:L,lines:W}=this.tags[r],H=this.getPrecedingDescription(W);if(H)this.flagDescriptionAfterEvent(y,L,W,this.tags[r-1]);return H}finalizeEvent(){let{ctx:r,event:y}=this;if(y===void 0)return;this.event=void 0;let W=(y.type&&y.type!=="object"&&y.type!=="Object"?y.type:void 0)??(y.properties.length>0?cr(y.properties,!0):y.type||""),{tagLine:H}=y;if(H!==void 0){let Ee=this.tags.find((ve)=>{let Le=ve.lines[0]?.number;return Le!==void 0&&Le>H&&!Po.has(ve.tag)})?.lines[0].number,Se=Array.from(this.lineDescriptions.keys()).sort((ve,Le)=>ve-Le).filter((ve)=>ve>H&&(Ee===void 0||ve<Ee)&&!this.consumedDescriptionLines.has(ve)&&this.lineDescriptions.get(ve)?.trim());for(let ve of Se)this.consumedDescriptionLines.add(ve);if(Se.length>0)y.description=this.joinBlockLines(Se,y.description?{text:y.description,line:H}:void 0)}let{name:J,description:U,source:te}=y,K=W===""&&(!r.events.has(J)||r.untypedJsDocEventNames.has(J));if(_n(r,{name:J,detail:W,has_argument:!1,description:U,deprecated:y.deprecated,tags:y.tags.length>0?y.tags:void 0,internal:y.internal||void 0,source:te}),K)r.untypedJsDocEventNames.add(J);r.eventDescriptions.set(J,U),r.jsDocEventNames.add(J),r.jsDocEventSources.set(J,te),kn(r,"event-no-source",J,y.ignores)}finalizeTypedef(){let{ctx:r,typedef:y}=this;if(y===void 0)return;this.typedef=void 0;let{properties:L}=y,W=L.length>0,H=W?cr(L,!0):y.type||"{}",J=!W&&y.type&&dm(H)?`interface ${y.name} ${H}`:`type ${y.name} = ${H};`,U=W?L.filter(({name:te})=>!te.includes(".")&&!te.startsWith("[")).map(({name:te,type:K,optional:Ee,description:Se})=>({name:te,type:K,optional:Ee===!0,...Se?{description:Se}:{}})):d(H,{skipIndexSignatures:!0});if(U)r.typedefMembersByName.set(y.name,U);Ol(r,y,H,J)}finalizeCallback(){let{callback:r}=this;if(r===void 0)return;this.callback=void 0;let y=`(${h(r.params)}) => ${r.returnType||"void"}`;Ol(this.ctx,r,y,`type ${r.name} = ${y};`)}openTypeDeclaration(r){let{name:y,lines:L}=this.tags[r],W={name:this.typeDeclarationName(y),source:vn(this.ctx,L),description:this.orCommentDescription(this.getTagDescription(L,this.tags[r+1])||this.takePrecedingDescription(r)),tags:this.pendingTags.splice(0),internal:this.pendingInternal},{tags:H}=W;if(this.pendingDeprecated!==void 0)H.push({name:"deprecated",body:this.pendingDeprecated===!0?"":this.pendingDeprecated}),this.pendingDeprecated=void 0;return this.pendingInternal=!1,this.attachTrailingTag=(J)=>H.push(J),this.isFirstTag=!1,W}readExtends(r,y){let{name:L,lines:W}=this.tags[r];if(this.ctx.extends!==void 0)en(this.ctx,"extend-props-duplicate",L,`A second @extends/@extendProps tag ("${L}") overwrote the first ("${this.ctx.extends.interface}"); only one is used.`,vn(this.ctx,W));this.ctx.extends={interface:L,import:im.test(y)?JSON.stringify(y):y},this.isFirstTag=!1}readRestProps(r,y){let{name:L,description:W}=this.tags[r],H=L?W?`${L} ${W}`:L:W,J=Un(H),U=this.orCommentDescription(J||this.takePrecedingDescription(r)),te={type:"Element",name:y,description:U||void 0};if(this.ctx.rest_props=te,J)this.claimBodyLines(this.tags[r],(K)=>{te.description=Un(ai(H,K))||void 0});this.isFirstTag=!1}readSlot(r,y){let{tag:L,name:W,lines:H}=this.tags[r],J=W==="-"||L==="snippet"&&W==="children"?void 0:W,U=this.orCommentDescription(this.getTagDescription(H,this.tags[r+1]));if(!U&&this.pendingTags.length===0)U=this.takePrecedingDescription(r);this.isFirstTag=!1;let te=y||"Record<string, never>",K=vn(this.ctx,H);if(!y)en(this.ctx,"slot-missing-type",J||"default",`@${L}${J?` "${J}"`:""} is missing a required {Type} annotation; falling back to "${te}".`,K);let Ee=this.pendingTags.splice(0),Se=Mn(J);this.ctx.jsDocSlots.set(Se,{tag:L,source:K}),gr(this.ctx,{slot_name:J,slot_props:te,slot_description:U||void 0,slot_deprecated:this.pendingDeprecated,slot_tags:Ee.length>0?Ee:void 0,slot_internal:this.pendingInternal||void 0,source:K}),this.pendingDeprecated=void 0,this.pendingInternal=!1,this.typeDeclaration=void 0,this.attachTrailingTag=(ve)=>{let Le=this.ctx.slots.get(Se);if(Le)Le.tags=[...Le.tags??[],ve]}}readEvent(r,y){let{name:L,lines:W}=this.tags[r],H=si(W)||this.takePrecedingDescription(r);this.finalizeEvent();let J=this.pendingTags.splice(0);this.event={name:L,type:y,tagLine:W.length>0?W[0].number:void 0,description:this.orCommentDescription(H),source:vn(this.ctx,W),tags:J,internal:this.pendingInternal,deprecated:this.pendingDeprecated,ignores:[],properties:[]},this.pendingInternal=!1,this.pendingDeprecated=void 0,this.typeDeclaration=void 0,this.attachTrailingTag=(U)=>J.push(U),this.isFirstTag=!1}readProperty(r,y){let{name:L,optional:W,default:H,lines:J}=this.tags[r],U=this.getTagDescription(J,this.tags[r+1],this.event!==void 0),te=this.event??(this.typedef&&gm(this.typedef.type)?this.typedef:void 0);if(te===void 0)return;ym(this.ctx,te.properties,{name:L,type:y,description:U,optional:W||!1,default:H},te.name,vn(this.ctx,J))}readTypedef(r,y){this.finalizeTypedef(),this.typedef={...this.openTypeDeclaration(r),type:y,properties:[]},this.typeDeclaration=this.typedef}readCallback(r){this.finalizeCallback(),this.callback={...this.openTypeDeclaration(r),params:[],returnType:void 0},this.typeDeclaration=this.callback}readGenerics(r,y){let{name:L,lines:W}=this.tags[r],H=vn(this.ctx,W);for(let J of i(L,","))Il(this.ctx,this.generics,J.trim(),H);this.generics.usedGenericsTag=!0,Ml(this.ctx,this.generics),Fl(this.ctx,L,y||L),this.isFirstTag=!1}readTemplate(r,y){let{tags:L}=this,W=Ci(L[r],y),H=r+1;while(L[H]?.tag==="template")H++;let J=L[H];if((J?.tag==="typedef"||J?.tag==="callback")&&!J.name.includes("<")&&mm(L,H,W)){this.pendingTypeParameters.push(...W.map(({constraint:te})=>te));return}if(this.hasSlotOrSnippetTag&&!this.hasExtendsTag){this.ctx.deferredSlotBlockGenerics.push(...W);return}if(this.documentsFunction)return;let U=vn(this.ctx,L[r].lines);for(let te of W)Il(this.ctx,this.generics,te.name,U),Fl(this.ctx,te.name,te.constraint);this.generics.usedTemplateTag=!0,Ml(this.ctx,this.generics),this.isFirstTag=!1}readDeprecated(r){let{text:y}=this.tags[r],{event:L}=this;if(!L&&this.typeDeclaration){let H={name:"deprecated",body:y};this.typeDeclaration.tags.push(H),this.claimBodyLines(this.tags[r],(J)=>{H.body=ai(y,J)});return}if((L?L.deprecated:this.pendingDeprecated)!==void 0)return;let W=(H)=>{if(L)L.deprecated=H;else this.pendingDeprecated=H};W(Ar(y)),this.claimBodyLines(this.tags[r],(H)=>{W(Ar(ai(y,H)))})}readPassthrough(r){let{tag:y,text:L,lines:W}=this.tags[r],H={name:y,body:L};if(this.claimBodyLines(this.tags[r],(J)=>{H.body=ai(L,J)}),!Pr.has(y)&&!Ti.has(y)){let J=lm.has(y)?void 0:I(y,pm,y.length<=4?1:2);en(this.ctx,"jsdoc-unknown-tag",y,J?`Unknown JSDoc tag "@${y}"; did you mean "@${J}"? Passed through unchanged.`:`Unknown JSDoc tag "@${y}"; passed through unchanged. If this is a typo, fix the tag name.`,vn(this.ctx,W))}if(this.attachTrailingTag)this.attachTrailingTag(H);else this.pendingTags.push(H)}read(){let{tags:r}=this;for(let W=0;W<r.length;W++){let{tag:H,type:J,name:U,optional:te}=r[W],K=En(J);switch(this.trimBodyAbove=this.trimThisBody,this.trimThisBody=void 0,H){case"extends":case"extendProps":this.readExtends(W,K);break;case"restProps":this.readRestProps(W,K);break;case"slot":case"snippet":this.readSlot(W,K);break;case"csspart":{let Ee=this.getTagDescription(r[W].lines,r[W+1]);this.ctx.cssParts.push({name:U,...Ee?{description:Ee}:{}});break}case"cssprop":case"cssproperty":{let Ee=this.getTagDescription(r[W].lines,r[W+1]),Se=r[W].default;this.ctx.cssProperties.push({name:U,...K?{type:K}:{},...Se===void 0?{}:{default:Se},...Ee?{description:Ee}:{}});break}case"event":this.readEvent(W,K);break;case"type":if(this.event)this.event.type=K;break;case"param":this.callback?.params.push({name:U,type:K,optional:te||!1});break;case"returns":case"return":if(this.callback)this.callback.returnType=K;break;case"property":this.readProperty(W,K);break;case"typedef":this.readTypedef(W,K);break;case"callback":this.readCallback(W);break;case"generics":this.readGenerics(W,K);break;case"template":this.readTemplate(W,K);break;case"deprecated":this.readDeprecated(W);break;case"ignore":case"internal":if(this.event)this.event.internal=!0;else if(this.typeDeclaration)this.typeDeclaration.internal=!0;else this.pendingInternal=!0;break;case"sveld-ignore":this.event?.ignores.push(U);break;case"enum":case"class":case"implements":case"this":case"namespace":case"memberof":case"module":case"file":case"overview":break;default:this.readPassthrough(W);break}if(_l.has(H))this.finalizeEvent()}this.finalizeEvent(),this.finalizeTypedef(),this.finalizeCallback();let y=[...this.pendingTags,...this.pendingDeprecated===void 0?[]:[{name:"deprecated"}],...this.pendingInternal?[{name:"internal"}]:[]];if(y.length===0)return;if(!r.some((W)=>W.tag==="event"||_l.has(W.tag)))return;for(let W of y)en(this.ctx,"jsdoc-tag-dropped",W.name,`@${W.name} could not attach to a @slot/@snippet/@event/@typedef/@callback tag in the same comment block and was dropped.`)}}function $l(r,y=r.source){if(!y)return;let L={usedGenericsTag:!1,usedTemplateTag:!1,warnedMixedGenericsTags:!1,seenGenericNames:new Set},W=y.includes("@template")?Bo(r):new Set;r.functionDocCommentStarts=W;let H=Yt(y);for(let J of H)r.jsDocBlocksByStart.set(J.start,J);for(let J of H)new Bl(r,L,J,W.has(J.start)).read()}var Vl=new Set(["$state","$derived","$effect","$props","$bindable","$inspect","$host"]),hm=Array.from(Vl);function Gl(r){return r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r===95||r===36}function Em(r){if(r.includes("\\u"))return!0;for(let y of hm){let L=r.indexOf(y);while(L!==-1){if(!Gl(r.charCodeAt(L-1))&&!Gl(r.charCodeAt(L+y.length)))return!0;L=r.indexOf(y,L+1)}}return!1}function Tm(r,y){for(let L=y.length-1;L>=0;L-=1)if(y[L]?.has(r))return!0;return!1}function Sm(r){let y=new Set;switch(r.type){case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":if(r.type!=="ArrowFunctionExpression"&&r.id)y.add(r.id.name);for(let L of r.params)un(L,y);break;case"BlockStatement":li(r.body,y);break;case"CatchClause":un(r.param,y);break;case"EachBlock":if(un(r.context,y),r.index)y.add(r.index);break;case"AwaitBlock":un(r.value,y),un(r.error,y);break}return y}function li(r,y){for(let L of r??[])switch(L.type){case"ImportDeclaration":for(let W of L.specifiers)y.add(W.local.name);break;case"VariableDeclaration":for(let W of L.declarations)un(W.id,y);break;case"FunctionDeclaration":case"ClassDeclaration":if(L.id?.name)y.add(L.id.name);break;case"ExportNamedDeclaration":if(L.declaration)li([L.declaration],y);break;case"BlockStatement":case"BreakStatement":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExportAllDeclaration":case"ExportDefaultDeclaration":case"ExpressionStatement":case"ForInStatement":case"ForOfStatement":case"ForStatement":case"IfStatement":case"LabeledStatement":case"ReturnStatement":case"StaticBlock":case"SwitchStatement":case"ThrowStatement":case"TryStatement":case"TSDeclareFunction":case"TSEnumDeclaration":case"TSExportAssignment":case"TSImportEqualsDeclaration":case"TSInterfaceDeclaration":case"TSModuleDeclaration":case"TSNamespaceExportDeclaration":case"TSTypeAliasDeclaration":case"WhileStatement":case"WithStatement":break}}function Ao(r,y){if(!r)return!1;let L=[...y],W=!1;return o(r,{enter(H,J){if(oe(H.type))return l;if(Yn(H))L.push(Sm(H));if(H.type==="Identifier"&&Vl.has(H.name)&&z(H,J)&&!Tm(H.name,L))return W=!0,T},leave(H){if(Yn(H))L.pop()}}),W}function jl(r){if(r.runesOptionOverride!==void 0)return r.runesOptionOverride?"runes":"legacy";let y=r.parsed;if(!y)return"legacy";if(r.source!==void 0&&!Em(r.source))return"legacy";let L=new Set;li(y.module?.content.body,L);let W=new Set;return li(y.instance?.content.body,W),Ao(y.module,[L])||Ao(y.instance,[L,W])||Ao(y.fragment,[L,W])?"runes":"legacy"}var xm=new Set(["TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion","TSInstantiationExpression"]);function Cm(r){if(r.type!=="TSAsExpression"&&r.type!=="TSTypeAssertion")return!1;let y="typeAnnotation"in r?r.typeAnnotation:void 0;return y?.type==="TSTypeReference"&&y.typeName.type==="Identifier"&&y.typeName.name==="const"}function pi(r,y){if(!r)return;o(r,{enter(L){if(!xm.has(L.type)||!("expression"in L)||!L.expression)return;let{expression:W}=L;if(typeof W!=="object")return W;let H=y.typeAssertions.get(L);if(y.constAssertions.has(L)||H===void 0&&Cm(L))y.constAssertions.add(W);else if(H!==void 0)y.typeAssertions.set(W,H);else if((L.type==="TSAsExpression"||L.type==="TSTypeAssertion")&&"typeAnnotation"in L)y.typeAssertions.set(W,L.typeAnnotation);return W}})}var bm=/\/\/(?<!^[ \t]*\*.*\/\/)\s*@ts-[^\n\r]*/gm;function vm(r){if(!r.includes("@ts-"))return r;let y=r.charCodeAt(0)===65279?1:0,{instance:L,module:W}=eo(r),H=[L,W].flatMap((te)=>te?[te.content]:[]).sort((te,K)=>te.start-K.start),J="",U=0;for(let{start:te,end:K}of H)J+=r.slice(U,te+y),J+=r.slice(te+y,K+y).replace(bm,""),U=K+y;return J+r.slice(U)}function Wl(r,y,L){r.componentFilePath=L;let W=vm(y);r.source=W;let H=Be(W);if(js(r,H),r.parsed=H,r.scriptLanguage==="ts")pi(H.module,r.typeCasts),pi(H.instance,r.typeCasts),pi(H.fragment,r.typeCasts);r.syntaxMode=jl(r);let J=H.css,U=J?W.slice(0,J.start)+" ".repeat(J.end-J.start)+W.slice(J.end):W;ke(r,H.module),ke(r,H.instance),$l(r,U)}class re{ctx=ci();cleanup(){this.ctx=ci()}parseSvelteComponent(r,y){let{component:L,pending:W}=this.parse(r,y);if(W)L[v]={...L[v]??{canonicalPropNames:[],localTypeDeclarations:[],typeImportStatements:[]},...W};return L}parse(r,y){this.cleanup();let L=this.ctx;Wl(L,r,y.filePath),Ga(L);let W=Xs(L);return _a(L,W)}}
40
40
  export{Kt,ne,qt,Wt,Ht,Be,zt,re};