sveld 0.37.9 → 0.38.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.
@@ -0,0 +1,244 @@
1
+ import{createRequire as Ha}from"node:module";var La=Object.create;var{getPrototypeOf:Ma,defineProperty:sr,getOwnPropertyNames:Fa}=Object;var Mi=Object.prototype.hasOwnProperty;function Ba(B){return this[B]}var Va,ja,we=(B,G,ie)=>{var se=B!=null&&typeof B==="object";if(se){var de=G?Va??=new WeakMap:ja??=new WeakMap,ke=de.get(B);if(ke)return ke}ie=B!=null?La(Ma(B)):{};let Pe=G||!B||!B.__esModule||!Mi.call(B,"default")?sr(ie,"default",{value:B,enumerable:!0}):ie;if(B&&typeof B==="object"||typeof B==="function"){for(let _e of Fa(B))if(!Mi.call(Pe,_e))sr(Pe,_e,{get:Ba.bind(B,_e),enumerable:!0})}if(se)de.set(B,Pe);return Pe};var s=(B,G)=>()=>(G||B((G={exports:{}}).exports,G),G.exports);var Ga=(B)=>B;function Wa(B,G){this[B]=Ga.bind(null,G)}var Ua=(B,G)=>{for(var ie in G)sr(B,ie,{get:G[ie],enumerable:!0,configurable:!0,set:Wa.bind(G,ie)})};var P=Ha(import.meta.url);function Ka(B){let G="";for(let ie=0;ie<B.length;ie++){let se=B[ie];if(se==="*"&&B[ie+1]==="*"){if(G+=".*",ie++,B[ie+1]==="/")ie++;continue}if(se==="*"){G+="[^/]*";continue}if(se==="?"){G+="[^/]";continue}G+=".+^$()[]{}|\\".includes(se)?`\\${se}`:se}return G}function Fi(B,G){return new RegExp(`^${Ka(B)}$`).test(G)}var j={"prop-unknown-type":"sveld/prop-unknown-type","context-any-type":"sveld/context-any-type","slot-missing-type":"sveld/slot-missing-type","event-no-source":"sveld/event-no-source","dispatch-escapes":"sveld/dispatch-escapes","example-compile-error":"sveld/example-compile-error","example-syntax-error":"sveld/example-syntax-error","syntax-skipped":"sveld/syntax-skipped","type-syntax-error":"sveld/type-syntax-error","rest-props-unresolved":"sveld/rest-props-unresolved","context-duplicate-key":"sveld/context-duplicate-key","context-key-unresolved":"sveld/context-key-unresolved","context-value-unresolved":"sveld/context-value-unresolved","spread-unresolved":"sveld/spread-unresolved","export-unresolved":"sveld/export-unresolved","module-export-conflict":"sveld/module-export-conflict","extend-props-target-missing":"sveld/extend-props-target-missing","extend-props-duplicate":"sveld/extend-props-duplicate","extend-props-override":"sveld/extend-props-override","jsdoc-unknown-tag":"sveld/jsdoc-unknown-tag","typedef-duplicate":"sveld/typedef-duplicate","property-duplicate":"sveld/property-duplicate","generics-conflict":"sveld/generics-conflict","event-description-ambiguous":"sveld/event-description-ambiguous","jsdoc-tag-dropped":"sveld/jsdoc-tag-dropped","internal-typedef-referenced":"sveld/internal-typedef-referenced","cross-file-unresolved":"sveld/cross-file-unresolved","export-ambiguous":"sveld/export-ambiguous"},za={"prop-unknown-type":"warning","context-any-type":"warning","slot-missing-type":"warning","event-no-source":"warning","dispatch-escapes":"warning","example-compile-error":"error","example-syntax-error":"error","syntax-skipped":"error","type-syntax-error":"error","rest-props-unresolved":"warning","context-duplicate-key":"warning","context-key-unresolved":"warning","context-value-unresolved":"warning","spread-unresolved":"warning","export-unresolved":"warning","module-export-conflict":"warning","extend-props-target-missing":"error","extend-props-duplicate":"warning","extend-props-override":"warning","jsdoc-unknown-tag":"warning","typedef-duplicate":"warning","property-duplicate":"warning","generics-conflict":"warning","event-description-ambiguous":"warning","jsdoc-tag-dropped":"warning","internal-typedef-referenced":"error","cross-file-unresolved":"warning","export-ambiguous":"warning"};function i(B){return{...B,code:j[B.kind],severity:za[B.kind]}}function z(B,G){if(G)return B;return B.filter((ie)=>ie.kind!=="jsdoc-unknown-tag")}function Bi(B,G){if(!G)return[];return B.filter((ie)=>!ie.ignored&&(G!=="errors"||ie.severity==="error"))}function Xa(B,G){if(G.code!==void 0&&G.code!==B.code)return!1;if(G.name!==void 0&&G.name!==B.name)return!1;if(G.component!==void 0&&!Fi(G.component,B.component))return!1;return!0}function Vi(B,G){if(!G||G.length===0)return B;return B.map((ie)=>ie.ignored||G.some((se)=>Xa(ie,se))?{...ie,ignored:!0}:ie)}var qa={"prop-unknown-type":"Props without inferred types","context-any-type":"Context values typed as `any`","slot-missing-type":"@slot/@snippet tags missing a {Type} annotation","event-no-source":"@event tags with no dispatch or callback","dispatch-escapes":"Dispatchers passed to functions sveld can't follow","example-compile-error":"@example blocks that failed to compile","example-syntax-error":"@example blocks that failed to parse","syntax-skipped":"Component syntax sveld skipped","type-syntax-error":"JSDoc types that aren't valid TypeScript","rest-props-unresolved":"$$restProps spread only onto components","context-duplicate-key":"Duplicate setContext keys","context-key-unresolved":"setContext keys sveld couldn't resolve","context-value-unresolved":"setContext values sveld couldn't describe","spread-unresolved":"Unresolved spreads widened to Record<string, any>","export-unresolved":"Unresolved named export specifiers","module-export-conflict":"Module-script exports colliding with generated names","extend-props-target-missing":"@extends/@extendProps targets that couldn't be verified","extend-props-duplicate":"Duplicate @extends/@extendProps tags","extend-props-override":"Own props overriding an @extends target's prop","jsdoc-unknown-tag":"Unknown JSDoc tags","typedef-duplicate":"Duplicate @typedef/@callback names","property-duplicate":"Duplicate @property names","generics-conflict":"Duplicate @generics/@template names","event-description-ambiguous":"Text after an @event read as the next tag's description","jsdoc-tag-dropped":"Passthrough JSDoc tags that couldn't attach","internal-typedef-referenced":"Public types referencing an @internal typedef","cross-file-unresolved":"Imports a standalone parse couldn't read","export-ambiguous":"Ambiguous `export *` names left out of the entry exports"},Ja=["prop-unknown-type","context-any-type","slot-missing-type","event-no-source","dispatch-escapes","example-compile-error","example-syntax-error","syntax-skipped","type-syntax-error","rest-props-unresolved","context-duplicate-key","context-key-unresolved","context-value-unresolved","spread-unresolved","export-unresolved","module-export-conflict","extend-props-target-missing","extend-props-duplicate","extend-props-override","jsdoc-unknown-tag","typedef-duplicate","property-duplicate","generics-conflict","event-description-ambiguous","jsdoc-tag-dropped","internal-typedef-referenced","cross-file-unresolved","export-ambiguous"];function ji(B){let G=new Set,ie=[];for(let se of B){let de=`${se.component}:${se.kind}:${se.name}`;if(G.has(de))continue;G.add(de),ie.push(se)}return ie}function X(B){let G=B.filter((Ae)=>!Ae.ignored),ie=B.length-G.length,se=ie>0?` (${ie} ignored)`:"";if(G.length===0)return`sveld: no diagnostics${se}.`;let de=[],ke=(Ae,De)=>`${Ae} ${De}${Ae===1?"":"s"}`,Pe=G.filter((Ae)=>Ae.severity==="error").length,_e=`${ke(Pe,"error")}, ${ke(G.length-Pe,"warning")}`;de.push(`sveld: ${ke(G.length,"diagnostic")} (${_e})${se}.`);for(let Ae of Ja){let De=G.filter((Oe)=>Oe.kind===Ae);if(De.length===0)continue;de.push(""),de.push(`${qa[Ae]} (${De.length}):`);let Re=new Map;for(let Oe of De){let Ie=Re.get(Oe.component)??[];Ie.push(Oe),Re.set(Oe.component,Ie)}for(let[Oe,Ie]of Re){de.push(` ${Oe}`);for(let $e of Ie){let Me=$e.source?` (${Oe}:${$e.source.start.line}:${$e.source.start.column})`:"";de.push(` - ${$e.message}${Me} [${$e.code}]`)}}}return de.join(`
2
+ `)}var ge=1;function Q(B){return`${JSON.stringify({kind:"diagnostics",schemaVersion:ge,diagnostics:B},null,2)}
3
+ `}function or(B,G){if(G.length===0)return;B.diagnostics=[...B.diagnostics??[],...G]}import Gi,{sep as ar}from"node:path";var yt=/\.svelte$/,Wt=[".ts",".mts",".cts",".tsx",".js",".mjs",".cjs",".jsx",".d.ts"],Wi=/\.(?:svelte|[mc]?ts|[mc]?js|tsx|jsx)$/;function Ut(B){if(!B.endsWith(".svelte"))return!1;let G=B.length-7;if(G===0)return!1;let ie=B.charCodeAt(G-1);return ie!==47&&(ar==="/"||ie!==92)}function t(B){return ar==="/"?B:B.split(ar).join("/")}function Ui(B,G){return t(Gi.join(G,Gi.normalize(B)))}function nn(B){return`${JSON.stringify(B,null,2)}
4
+ `}var Hi="sveld",gn="0.38.0";var xe={name:Hi,version:gn,license:"Apache-2.0",description:"Generate TypeScript definitions and component documentation for your Svelte components.",type:"module",main:"./lib/index.js",types:"./lib/index.d.ts",exports:{".":{types:"./lib/index.d.ts",import:"./lib/index.js",default:"./lib/index.js"},"./browser":{types:"./lib/browser.d.ts",import:"./lib/browser.js",default:"./lib/browser.js"},"./schema/component-api.schema.json":"./schema/component-api.schema.json"},scripts:{test:"bun test --parallel","test:update":"SVELD_UPDATE_FIXTURES=1 bun test tests/fixtures.test.ts","test:fixtures-types":"tsc --project tsconfig.fixtures.json","test:types-matrix":"bun scripts/typecheck-option-matrix.ts","test:svelte-versions":"bun scripts/typecheck-svelte-versions.ts","test:e2e":"bun tests/test-e2e.ts",format:"biome format --write .",lint:"biome check --error-on-warnings .","lint:fix":"biome check --write --unsafe .","lint:fix:changed":"biome check --write --unsafe --changed --no-errors-on-unmatched",build:"bun scripts/build.ts",bench:"bun scripts/bench.ts","bench:cache":"bun scripts/bench.ts --cache","bench:ostia":"ostia bench scripts/bench-ostia.ts",fuzz:"bun scripts/fuzz-parser.ts",typecheck:"tsc --noEmit"},devDependencies:{"@biomejs/biome":"2.5.14","@sveltejs/acorn-typescript":"1.0.13","@types/bun":"^1.4.2","@types/jest":"^30.0.0","@typescript/typescript6":"^6.0.2",acorn:"^8.18.0",ajv:"^8.20.0",culls:"^0.2.0",ostia:"^0.2.7",svelte:"^5.57.1",typescript:"^7.0.2"},bin:{sveld:"cli.js"},files:["lib","cli.js","schema"],repository:{type:"git",url:"git+https://github.com/carbon-design-system/sveld.git"},homepage:"https://github.com/carbon-design-system/sveld",bugs:"https://github.com/carbon-design-system/sveld/issues",keywords:["svelte","svelte component","documentation","docgen","typescript","definitions","JSDocs","vite","vite-plugin"],maintainers:["Eric Liu (https://github.com/metonym)"]};var Ya=/\*\//g;function g(B){return B.replace(Ya,"*\\/")}function T(B){return B.map((G)=>`${G.name}${G.optional?"?":""}: ${G.type}`).join(", ")}function p(B){return B===void 0||B===""?void 0:B}var Qa=new Intl.Collator("en");function u(B,G){return Qa.compare(B,G)}var rn="5.57.1";var xn=1;function Pt(B){return B.some((G)=>G.internal)?B.filter((G)=>!G.internal):B}function ec(B){return{...B,props:Pt(B.props),moduleExports:Pt(B.moduleExports),slots:Pt(B.slots),events:Pt(B.events),typedefs:Pt(B.typedefs),...B.contexts?{contexts:Pt(B.contexts).map((G)=>({...G,properties:Pt(G.properties)}))}:{}}}function f(B,G={}){let ie=Array.from(B,([,ke])=>{let{diagnostics:Pe,..._e}=ke;return ec(_e)}).sort((ke,Pe)=>u(ke.moduleName,Pe.moduleName)),se={schemaVersion:xn,generator:{name:Hi,version:gn,svelteVersion:rn},total:ie.length,components:ie},de=G.entryExports?Pt(G.entryExports):void 0;if(de&&de.length>0)se.totalExports=de.length,se.exports=de;return se}import{readFile as nc}from"node:fs/promises";import pr from"node:path";function Ht(B,G,ie=0,se=B.length,de=0){let ke=de;for(let Pe=ie;Pe<se;Pe++){let _e=B.charCodeAt(Pe);if(_e===34||_e===39||_e===96){Pe=tc(B,Pe,se);continue}if(_e===123||_e===40||_e===91||_e===60)ke++;else if(_e===125||_e===41||_e===93||_e===62&&B.charCodeAt(Pe-1)!==61){if(ke>0)ke--}if(G?.(Pe,ke)===!0)break}return ke}function tc(B,G,ie){let se=B.charCodeAt(G);for(let de=G+1;de<ie;de++){let ke=B.charCodeAt(de);if(ke===92)de++;else if(ke===se)return de}return ie-1}function n(B,G){let ie=[],se=0;return Ht(B,(de,ke)=>{if(ke===0&&G.includes(B[de]))ie.push(B.slice(se,de)),se=de+1;return!1}),ie.push(B.slice(se)),ie}function H(B,G){let ie=-1;return Ht(B,(se,de)=>{if(de===0&&G.includes(B[se]))ie=se;return ie!==-1}),ie}function ur(B){let G=-1;return Ht(B,(ie,se)=>{if(se===0&&B[ie]==="="&&B[ie+1]===">")G=ie;return G!==-1}),G}function D(B,G){let ie=-1;return Ht(B,(se,de)=>{if(de===0)ie=se;return ie!==-1},G),ie}function W(B){if(!B)return;let G=ur(B);if(G===-1)return;return B.slice(G+2).trim()||void 0}var rc=/[:=]/,yn={none:0,patch:1,minor:2,major:3};function ic(B,G){return yn[G]>yn[B]?G:B}function sc(B){return B.reduce((G,ie)=>ic(G,ie.bump),"none")}function Yi(B,G){return yn[B]>=yn[G]}function Ki(B){return new Set(n(B,"|").map((G)=>G.trim()).filter((G)=>G.length>0))}function zi(B){let G=ur(B);if(G===-1)return;let ie=B.slice(0,G).trim(),se=B.slice(G+2).trim();if(!ie.startsWith("(")||!ie.endsWith(")"))return;let de=ie.slice(1,-1).trim();return{params:de.length===0?[]:n(de,",").map((Pe)=>Pe.trim()),returnType:se}}function oc(B){return(B.split(rc,1)[0]??"").trimEnd().endsWith("?")}function ac(B,G){if(B.returnType!==G.returnType)return"major";if(G.params.length<B.params.length)return"major";for(let se=0;se<B.params.length;se++)if(B.params[se]!==G.params[se])return"major";if(G.params.length===B.params.length)return"none";return G.params.slice(B.params.length).every(oc)?"minor":"major"}function lr(B,G){if(B===G)return"none";if(B===void 0||G===void 0)return"major";let ie=zi(B),se=zi(G);if(ie&&se)return ac(ie,se);let de=Ki(B),ke=Ki(G),Pe=[...ke].some((Ae)=>!de.has(Ae)),_e=[...de].some((Ae)=>!ke.has(Ae));if(!Pe&&!_e)return"none";if(Pe&&!_e)return"minor";if(_e&&!Pe)return"major";return"major"}function Xi(B){return B.bindable===!0||B.binding==="writable"}function qi(B,G,ie,se){let de=G==="prop"?"prop":"export",ke=[],Pe=new Map(ie.map((Ae)=>[Ae.name,Ae])),_e=new Map(se.map((Ae)=>[Ae.name,Ae]));for(let[Ae,De]of _e){if(Pe.has(Ae))continue;ke.push({component:B,kind:G,name:Ae,bump:De.isRequired?"major":"minor",message:`${de} "${Ae}" added${De.isRequired?" (required)":""}`})}for(let[Ae]of Pe){if(_e.has(Ae))continue;ke.push({component:B,kind:G,name:Ae,bump:"major",message:`${de} "${Ae}" removed`})}for(let[Ae,De]of Pe){let Re=_e.get(Ae);if(!Re)continue;if(De.isRequired!==Re.isRequired)ke.push({component:B,kind:G,name:Ae,bump:Re.isRequired?"major":"minor",message:`${de} "${Ae}" became ${Re.isRequired?"required":"optional"}`});let Oe=lr(De.type,Re.type);if(Oe!=="none")ke.push({component:B,kind:G,name:Ae,bump:Oe,message:`${de} "${Ae}" type changed from \`${De.type??"unknown"}\` to \`${Re.type??"unknown"}\``});let Ie=Xi(De),$e=Xi(Re);if(Ie!==$e)ke.push({component:B,kind:G,name:Ae,bump:$e?"minor":"major",message:`${de} "${Ae}" ${$e?"gained a writable binding":"lost its writable binding"}`});if(De.value!==Re.value&&Oe==="none")ke.push({component:B,kind:G,name:Ae,bump:"patch",message:`${de} "${Ae}" default changed from \`${De.value??"none"}\` to \`${Re.value??"none"}\``});let Me=De.deprecated!==void 0,Le=Re.deprecated!==void 0;if(Me!==Le)ke.push({component:B,kind:G,name:Ae,bump:Le?"minor":"patch",message:`${de} "${Ae}" ${Le?"marked as deprecated":"no longer deprecated"}`});if(De.constant!==Re.constant)ke.push({component:B,kind:G,name:Ae,bump:"minor",message:`${de} "${Ae}" ${Re.constant?"became constant":"became mutable"}`});if(De.reactive!==Re.reactive)ke.push({component:B,kind:G,name:Ae,bump:"minor",message:`${de} "${Ae}" ${Re.reactive?"became reactive":"stopped being reactive"}`})}return ke}function cc(B,G,ie){let se=[],de=new Map(G.map((Pe)=>[Pe.name,Pe])),ke=new Map(ie.map((Pe)=>[Pe.name,Pe]));for(let[Pe]of ke){if(de.has(Pe))continue;se.push({component:B,kind:"event",name:Pe,bump:"minor",message:`event "${Pe}" added`})}for(let[Pe]of de){if(ke.has(Pe))continue;se.push({component:B,kind:"event",name:Pe,bump:"major",message:`event "${Pe}" removed`})}for(let[Pe,_e]of de){let Ae=ke.get(Pe);if(!Ae)continue;if(_e.type!==Ae.type){se.push({component:B,kind:"event",name:Pe,bump:"major",message:`event "${Pe}" changed from ${_e.type} to ${Ae.type}`});continue}let De=_e.type==="dispatched"?_e.detail:void 0,Re=Ae.type==="dispatched"?Ae.detail:void 0,Oe=lr(De,Re);if(Oe!=="none")se.push({component:B,kind:"event",name:Pe,bump:Oe,message:`event "${Pe}" detail changed from \`${De??"unknown"}\` to \`${Re??"unknown"}\``})}return se}function Ji(B){return B.name??"default"}function uc(B,G,ie){let se=[],de=new Map(G.map((Pe)=>[Ji(Pe),Pe])),ke=new Map(ie.map((Pe)=>[Ji(Pe),Pe]));for(let[Pe]of ke){if(de.has(Pe))continue;se.push({component:B,kind:"slot",name:Pe,bump:"minor",message:`slot "${Pe}" added`})}for(let[Pe]of de){if(ke.has(Pe))continue;se.push({component:B,kind:"slot",name:Pe,bump:"major",message:`slot "${Pe}" removed`})}for(let[Pe,_e]of de){let Ae=ke.get(Pe);if(!Ae)continue;let De=lr(_e.slot_props,Ae.slot_props);if(De!=="none")se.push({component:B,kind:"slot",name:Pe,bump:De,message:`slot "${Pe}" props changed from \`${_e.slot_props??"none"}\` to \`${Ae.slot_props??"none"}\``})}return se}var pc=new Set(["description","source","componentCommentSource","tags"]);function vn(B){if(Array.isArray(B))return B.map(vn);if(B!==null&&typeof B==="object"){let G={};for(let[ie,se]of Object.entries(B)){if(pc.has(ie))continue;G[ie]=vn(se)}return G}return B}var lc=["generics","rest_props","extends","contexts","typedefs"];function fc(B,G,ie){let se=[];for(let de of lc){let ke=JSON.stringify(vn(G[de])),Pe=JSON.stringify(vn(ie[de]));if(ke!==Pe)se.push({component:B,kind:"shape",name:de,bump:"major",message:`"${de}" changed (breaking)`})}return se}function dc(B,G){let ie=G.moduleName;return[...qi(ie,"prop",B.props,G.props),...qi(ie,"moduleExport",B.moduleExports,G.moduleExports),...cc(ie,B.events,G.events),...uc(ie,B.slots,G.slots),...fc(ie,B,G)]}function Te(B,G){let ie=[],se=new Map(B.components.map((ke)=>[ke.moduleName,ke])),de=new Map(G.components.map((ke)=>[ke.moduleName,ke]));for(let[ke]of de){if(se.has(ke))continue;ie.push({component:ke,kind:"component",bump:"minor",message:`component "${ke}" added`})}for(let[ke]of se){if(de.has(ke))continue;ie.push({component:ke,kind:"component",bump:"major",message:`component "${ke}" removed`})}for(let[ke,Pe]of se){let _e=de.get(ke);if(!_e)continue;ie.push(...dc(Pe,_e))}return ie}async function hc(B){let G;try{G=await nc(pr.resolve(B),"utf-8")}catch(ie){if(ie.code==="ENOENT")return null;throw ie}try{return JSON.parse(G)}catch{throw Error(`sveld: could not parse "${B}" as JSON. Is it a sveld COMPONENT_API.json snapshot?`)}}function ee(B){if(typeof B.check==="string")return B.check;return B.jsonOptions?.outFile??"COMPONENT_API.json"}function te(B,G){if(!B.json||B.stdout||B.jsonOptions?.outDir)return!1;return pr.resolve(B.jsonOptions?.outFile??"COMPONENT_API.json")===pr.resolve(G)}async function I(B,G,ie={}){let se=await hc(G);if(se===null)return{snapshotExists:!1,snapshotFile:G,changes:[],bump:"none"};if(se.schemaVersion!==xn)return{snapshotExists:!0,snapshotFile:G,changes:[{component:"*",kind:"schema",bump:"none",message:`snapshot schemaVersion ${se.schemaVersion} differs from ${xn}; regenerate the snapshot`}],bump:"none"};let de=f(B,{entryExports:ie.entryExports}),ke=Te(se,de);return{snapshotExists:!0,snapshotFile:G,changes:ke,bump:sc(ke)}}var mc={major:"BREAKING",minor:"additive",patch:"patch",none:"no change"};function re(B){if(!B.snapshotExists){let de=B.snapshotFile==="COMPONENT_API.json"?"`sveld --json`":`\`sveld --json\` with \`jsonOptions.outFile: "${B.snapshotFile}"\``;return`sveld --check: no snapshot found at "${B.snapshotFile}". Generate it with ${de} and commit it.`}if(B.changes.length===0)return`sveld --check: no API changes detected against "${B.snapshotFile}".`;let G=[],ie=B.changes.length;G.push(`sveld --check: ${ie} API change${ie===1?"":"s"} detected against "${B.snapshotFile}".`),G.push(`Suggested semver bump: ${B.bump}.`);let se=new Map;for(let de of B.changes){let ke=se.get(de.component)??[];ke.push(de),se.set(de.component,ke)}for(let[de,ke]of se){G.push(""),G.push(` ${de}`);for(let Pe of ke){let _e=Pe.kind==="schema"?"schema":mc[Pe.bump];G.push(` [${_e}] ${Pe.message}`)}}return G.join(`
5
+ `)}var Ee=1;function ne(B){let G={kind:"check-report",schemaVersion:Ee,...B};return nn(G)}import{existsSync as vc}from"node:fs";import{join as Cc}from"node:path";import{pathToFileURL as bc}from"node:url";function Ye(B){return typeof B==="object"&&B!==null}function me(B){return Ye(B)&&B.type==="VariableDeclaration"&&Array.isArray(B.declarations)}function b(B){return Ye(B)&&B.type==="Literal"}function e(B){return Ye(B)&&B.type==="Identifier"&&typeof B.name==="string"}function A(B){return Ye(B)&&B.type==="MemberExpression"}function l(B){return Ye(B)&&B.type==="ObjectExpression"&&Array.isArray(B.properties)}function gc(B){return Ye(B)&&B.type==="CallExpression"}function d(B,G){if(!gc(B))return!1;return!!B.callee&&Ye(B.callee)&&B.callee.type==="Identifier"&&B.callee.name===G}function m(B){if(Ye(B)&&(B.type==="TSAsExpression"||B.type==="TSSatisfiesExpression")&&"expression"in B)return m(B.expression);return B}function he(B){if(Ye(B)&&(B.type==="TSAsExpression"||B.type==="TSSatisfiesExpression")&&"typeAnnotation"in B)return B.typeAnnotation;return}function xc(B){return Ye(B)&&B.type==="NewExpression"}function oe(B,G){if(!xc(B))return!1;return!!B.callee&&Ye(B.callee)&&B.callee.type==="Identifier"&&B.callee.name===G}function y(B){if(!Ye(B)||typeof B.type!=="string")return null;if(B.type==="Literal"){let G=B.value;if(typeof G==="string")return G;return G==null?null:String(G)}if(B.type==="TemplateLiteral"){let G=B.quasis;if(G?.length===1){let ie=G[0]?.value?.cooked;return ie==null?null:ie}}return null}function o(B){if(!B||typeof B!=="object"||!("type"in B))return;if(e(B))return B.name;if(b(B))return B.value==null?void 0:String(B.value);return}function yc(B,G){let ie=B.length+1,se=G.length+1,de=Array.from({length:ie},()=>Array(se).fill(0));for(let ke=0;ke<ie;ke++)de[ke][0]=ke;for(let ke=0;ke<se;ke++)de[0][ke]=ke;for(let ke=1;ke<ie;ke++)for(let Pe=1;Pe<se;Pe++){let _e=B[ke-1]===G[Pe-1]?0:1;if(de[ke][Pe]=Math.min(de[ke-1][Pe]+1,de[ke][Pe-1]+1,de[ke-1][Pe-1]+_e),ke>1&&Pe>1&&B[ke-1]===G[Pe-2]&&B[ke-2]===G[Pe-1])de[ke][Pe]=Math.min(de[ke][Pe],de[ke-2][Pe-2]+1)}return de[ie-1][se-1]}function k(B,G,ie=3){let se,de=Number.POSITIVE_INFINITY;for(let ke of G){let Pe=yc(B,ke);if(Pe<de)se=ke,de=Pe}if(se===void 0||de>ie)return;return se}var Ec=["sveld.config.js","sveld.config.mjs","sveld.config.ts"];function Ce(B){return B}function Sc(B=process.cwd()){for(let G of Ec){let ie=Cc(B,G);if(vc(ie))return ie}return null}async function V(B){let G;try{G=await import(`${bc(B).href}?t=${Date.now()}`)}catch(se){let de=se instanceof Error?se.message:String(se);throw Error(`sveld: failed to load config file "${B}".
6
+ ${de}`)}let ie=G.default;if(!Ye(ie)||Array.isArray(ie))throw Error(`sveld: config file "${B}" must export a configuration object as its default export. Did you forget \`export default defineConfig({ ... })\`?`);return ie}async function L(B=process.cwd()){let G=Sc(B);if(G===null)return{};return V(G)}function w(...B){let G={};for(let ie of B){if(!ie)continue;for(let[se,de]of Object.entries(ie)){let ke=G[se];G[se]=Ye(ke)&&!Array.isArray(ke)&&Ye(de)&&!Array.isArray(de)?{...ke,...de}:de}}return G}var Qi=["entry","glob","quiet","documentExports","types","typesOptions","json","jsonOptions","markdown","markdownOptions","failFast","watch","config","cache","checkExamples","reportDiagnostics","strict","check","checkLevel","stdout","format","diagnostics"],kc={typesOptions:["outDir","preamble","format","transform","indexTypes"],jsonOptions:["outFile","outDir","source"],markdownOptions:["outFile","outDir","onAppend"],diagnostics:["ignore"]};function Zi(B,G,ie){let se=B===null?G:`${B}.${G}`,de=k(G,ie),ke=de===void 0?void 0:B===null?de:`${B}.${de}`;console.warn(`sveld: unknown option "${se}".${ke?` Did you mean "${ke}"?`:""}`)}function R(B){for(let G of Object.keys(B))if(!Qi.includes(G))Zi(null,G,Qi);for(let[G,ie]of Object.entries(kc)){let se=B[G];if(!Ye(se))continue;for(let de of Object.keys(se))if(!ie.includes(de))Zi(G,de,ie)}}import{dirname as Ta,isAbsolute as fd,resolve as dd}from"node:path";import{lstatSync as Jo}from"node:fs";import{readFile as Df}from"node:fs/promises";import{resolve as di}from"node:path";import{dirname as Vu}from"node:path";var h=Symbol("sveld.parsedComponentTypeScriptMetadata");function es(B){return B[h]}var wc=" ",Pc=120,_c=/\binterface\s+[A-Za-z_$][\w$]*(\s*<[^{};]*>)?\s*$/,Ac=200,is=/\s/,Tc=/\s{2}|[^\S ]/,Nc=/["'`{}/]/g,Dc=/["'`{};/]/g,ss=9,fr=10,Rc=13,sn=32,bn=34,Ic=38,En=39,$c=40,Oc=41,Cn=42,ts=46,hr=47,os=59,Lc=62,Mc=91,mr=92,Fc=93,Sn=96,gr=123,Bc=124,xr=125;function Vc(B){return _c.test(B.slice(-200))}var ns=[""];function jc(B){let G=ns[B];if(G===void 0)G=wc.repeat(B),ns[B]=G;return G}function Gc(B,G){let ie="";for(let se=B.length-1;se>=0&&ie.length<G;se--)ie=B[se]+ie;return ie.length>G?ie.slice(-G):ie}function Wc(B){if(B.length===0)return!1;let G=B[B.length-1];return G.charCodeAt(G.length-1)===fr}function Uc(B){while(B.length>0){let G=B[B.length-1],ie=G.length;while(ie>0){let se=G.charCodeAt(ie-1);if(se!==sn&&se!==ss)break;ie--}if(ie===G.length)return;if(ie===0){B.pop();continue}B[B.length-1]=G.slice(0,ie);return}}function Hc(B){while(B.length>0){let G=B[B.length-1];if(!is.test(G[G.length-1]))return;let ie=G.trimEnd();if(ie.length===G.length)return;if(ie.length===0){B.pop();continue}B[B.length-1]=ie;return}}function Kc(B){if(B.includes("{"))return!1;let G=0,ie=0;for(let se=0;se<B.length;se++){let de=B.charCodeAt(se);if(G!==0){if(de===G&&B.charCodeAt(se-1)!==mr)G=0;continue}if(de===bn||de===En||de===Sn){G=de;continue}if(de===os&&++ie>=2)return!0}return!1}function zc(B){if(!Tc.test(B))return B.trimEnd();let G="",ie=null,se=!1;for(let de=0;de<B.length;de++){let ke=B[de],Pe=B[de-1];if(ie){if(G+=ke,ie==="double"&&ke==='"'&&Pe!=="\\"||ie==="single"&&ke==="'"&&Pe!=="\\"||ie==="template"&&ke==="`"&&Pe!=="\\")ie=null;se=!1;continue}if(ke==='"'||ke==="'"||ke==="`"){ie=ke==='"'?"double":ke==="'"?"single":"template",G+=ke,se=!1;continue}if(is.test(ke)){if(!se&&G.length>0)G+=" ",se=!0;continue}G+=ke,se=!1}return G.trimEnd()}function as(B,G){let ie=B[G],se=B.indexOf(ie,G+1);while(se!==-1&&B.charCodeAt(se-1)===mr)se=B.indexOf(ie,se+1);return se}function cs(B,G){let ie=B.indexOf("*/",G+1);return ie===-1?-1:ie+1}function Xc(B){let G=new Map,ie=[],se=Nc,de=0;while(de<B.length){if(se.lastIndex=de,!se.test(B))break;de=se.lastIndex-1;let ke=B.charCodeAt(de);if(ke===hr){if(B.charCodeAt(de+1)===Cn){let Pe=cs(B,de);if(Pe===-1)break;de=Pe}}else if(ke===bn||ke===En||ke===Sn){let Pe=as(B,de);if(Pe===-1)break;de=Pe}else if(ke===gr)ie.push(de);else if(ke===xr&&ie.length>0)G.set(ie.pop(),de);de++}return G}function qc(B,G,ie){for(let se=G;se<ie;se++)if(!dr(B.charCodeAt(se)))return!1;return!0}function dr(B){if(B<=sn)return B===sn||B>=ss&&B<=Rc;if(B<160)return!1;return B===160||B===5760||B>=8192&&B<=8202||B===8232||B===8233||B===8239||B===8287||B===12288||B===65279}function us(B,G,ie,se){let de=[],ke=Dc,Pe=G,_e=G;while(_e<ie){if(ke.lastIndex=_e,!ke.test(B))break;if(_e=ke.lastIndex-1,_e>=ie)break;let Ae=B.charCodeAt(_e);if(Ae===hr){if(B.charCodeAt(_e+1)===Cn){let De=cs(B,_e);if(De===-1)break;_e=De}_e++;continue}if(Ae===bn||Ae===En||Ae===Sn){let De=as(B,_e);if(De===-1)break;_e=De+1;continue}if(Ae===gr){let De=se.get(_e);if(De===void 0||De>=ie){_e++;continue}if(Pe<_e)de.push(B.slice(Pe,_e));let Re=_e+1;if(qc(B,Re,De)){de.push("{}"),_e=De+1,Pe=_e;continue}let Oe=B.slice(Re,De),Ie=B.charCodeAt(Re)===fr;if(!Ie&&!Oe.includes("/*")&&!Kc(Oe)&&!Vc(Gc(de,Ac))){let $e=us(B,Re,De,se),Me=$e.trim();if(!Me.includes(`
7
+ `)){let Le=Me.endsWith(";")?Me.slice(0,-1):Me,Ve=`{ ${zc(Le)} }`;if(Ve.length<=Pc){de.push(Ve),_e=De+1,Pe=_e;continue}}if(de.push("{"),$e.charCodeAt(0)!==os)de.push(`
8
+ `);if($e.length>0)de.push($e);_e=De,Pe=De;continue}if(de.push("{"),!Ie)de.push(`
9
+ `);_e=Re,Pe=Re;continue}if(Ae===xr){if(Pe<_e)de.push(B.slice(Pe,_e));if(Uc(de),!Wc(de))de.push(`
10
+ `);de.push("}"),_e++,Pe=_e;continue}if(Pe<_e)de.push(B.slice(Pe,_e));if(Hc(de),de.push(";"),B.charCodeAt(_e+1)!==fr)de.push(`
11
+ `);_e++,Pe=_e}if(Pe<ie)de.push(B.slice(Pe,ie));return de.join("")}function Jc(B){return us(B,0,B.length,Xc(B))}function Yc(B){if(!B.includes(" "))return B;let G="",ie=0;for(let se=0;se<B.length;se++){let de=B.charCodeAt(se);if(ie!==0){if(G+=B[se],de===ie&&B.charCodeAt(se-1)!==mr)ie=0;continue}if(de===bn||de===En||de===Sn){ie=de,G+=B[se];continue}if(de===sn&&G.charCodeAt(G.length-1)===sn)continue;G+=B[se]}return G}function Qc(B){return B===xr||B===Fc||B===Oc||B===Lc}function Zc(B,G,ie){return ie-G>=3&&B.charCodeAt(G)===hr&&B.charCodeAt(G+1)===Cn&&B.charCodeAt(G+2)===Cn}function rs(B,G,ie){let se=B.indexOf("*/",G);return se!==-1&&se+2<=ie}function eu(B,G,ie){let se=B.charCodeAt(G);if(se===Bc||se===Ic)return!0;return se===ts&&G+1<ie&&B.charCodeAt(G+1)!==ts}function tu(B){let G=[],ie=[],se=B.length,de=0,ke=!1,Pe=0,_e=0;while(_e<=se){let Re=B.indexOf(`
12
+ `,_e);if(Re===-1)Re=se;let Oe=Re+1,Ie=_e,$e=Re;while(Ie<$e&&dr(B.charCodeAt(Ie)))Ie++;while($e>Ie&&dr(B.charCodeAt($e-1)))$e--;if(Ie===$e){let Ue=ie.length>0?ie[ie.length-1]:void 0;if(Ue!==void 0&&Ue!==""){let Xe=Ue.charCodeAt(Ue.length-1);if(Xe!==gr&&Xe!==$c&&Xe!==Mc)G.push(0),ie.push("")}_e=Oe;continue}if(ke){if(G.push(Pe),ie.push(` ${B.slice(Ie,$e)}`),rs(B,Ie,$e))ke=!1;_e=Oe;continue}let Me=Zc(B,Ie,$e),Le=Me&&rs(B,Ie,$e);if(Me&&!Le){G.push(de),ie.push(B.slice(Ie,$e)),ke=!0,Pe=de,_e=Oe;continue}let Ve=Qc(B.charCodeAt(Ie)),We=Math.max(0,de-(Ve?1:0))+(eu(B,Ie,$e)?1:0);if(Ve&&We===0&&ie.length>0&&ie[ie.length-1]==="")G.pop(),ie.pop();if(G.push(We),ie.push(Yc(B.slice(Ie,$e))),_e=Oe,Le)continue;de=Ht(B,void 0,Ie,$e,de)}let Ae=ie.length;while(Ae>0&&ie[Ae-1]==="")Ae--;let De=[];for(let Re=0;Re<Ae;Re++){if(Re>0)De.push(`
13
+ `);let Oe=G[Re];if(Oe>0)De.push(jc(Oe));De.push(ie[Re])}return De.join("")}function ps(B){return`${tu(Jc(B))}
14
+ `}var ht="any",ot="",nu="Record<string, any>",br="Record<string, never>",Er=/^[A-Za-z_$][A-Za-z0-9_$]*$/,ru=/CustomEvent/,iu=/^[A-Z]/,su=/\n/,ms=/=>/,ou=/(?:^|\n)@default\b/,Sr=/\n/g,au=/^([ \t]*\*) +$/gm,cu=/\s+/g,Kt=/(^|[^.\w])Snippet(?:\s*<|\b)/,uu=/import\s+type\s+[^;]*\bSnippet\b[^;]*from\s+"svelte";/,pu=/[.*+?^${}()|[\]\\]/g,lu=/^const\s+/,fu=/^export /,du=/[^\w$]/g;function kr(B){return B.replace(lu,"")}function hu(B){if(!B)return;return B.replace(Sr,`
15
+ * `)}function wn(B){if(!B)return"";return`/** ${g(B)} */`}function Pn(B){if(!B)return"";return`/**
16
+ * ${g(B).replace(Sr,`
17
+ * `)}
18
+ */`}function gs(B){if(B===void 0)return;return B===!0?"@deprecated":`@deprecated ${B}`}function mu(B){let G=gs(B);if(G===void 0)return;return`* ${G.replace(Sr,`
19
+ * `)}
20
+ `}function gu(B,G){if(!G)return[`@${B}`];if(!G.includes(`
21
+ `))return[`@${B} ${G}`];return[`@${B}`,...G.split(`
22
+ `)]}function wr(B){let G=[];for(let{name:ie,body:se}of B??[])G.push(...gu(ie,se));return G}function kn(B,G,ie){let se=gs(ie),de=wr(G),ke=de.length>0;if(!B&&!ke&&!se)return"";if(!ke&&!se)return B?.includes(`
23
+ `)?Pn(B):wn(B);let Pe=[];if(B)Pe.push(...B.split(`
24
+ `));if(Pe.push(...de),se)Pe.push(...se.split(`
25
+ `));return`/**
26
+ * ${g(Pe.join(`
27
+ * `))}
28
+ */`}function xu(B){let G=wr(B);if(G.length===0)return"";return G.map((ie)=>`* ${ie}
29
+ `).join("")}function _n(B){if(B===void 0)return ht;return`${B}
30
+ `}function An(B){if(B.typedefs.length===0)return ot;return B.typedefs.map((G)=>{let ie,se=wr(G.tags);if(se.length===0)ie=G.description?`${Pn(G.description)}
31
+ `:"";else{let de=G.description?[...G.description.split(`
32
+ `),...se]:se;ie=`/**
33
+ * ${g(de.join(`
34
+ * `))}
35
+ */
36
+ `}return`${ie}export ${G.ts}`.replace(au,"$1")}).join(`
37
+
38
+ `)}var ls=new Map;function vr(B,G){let ie=ls.get(G);if(ie===void 0){let se=G.replace(pu,"\\$&");ie=new RegExp(`\\b${se}\\b`),ls.set(G,ie)}return ie.test(B)}var fs,ds=[];function Pr(B){if(B!==fs)fs=B,ds=n(B,",");return ds}function yu(B){if(B===null)return[];return B[0].split(",").map((G,ie)=>({name:G.trim(),constraint:(Pr(B[1]??"")[ie]??G).trim()}))}function vu(B,G){let ie=yu(B).filter(({name:se})=>vr(G,se));if(ie.length===0)return{declSuffix:ot,refSuffix:ot};return{declSuffix:`<${ie.map(({constraint:se})=>kr(se)).join(", ")}>`,refSuffix:`<${ie.map(({name:se})=>se).join(", ")}>`}}function xs(B){if(!B.contexts||B.contexts.length===0)return ot;let G=B.generics===null?[]:B.generics[0].split(",").map((ie,se)=>({name:ie.trim(),constraint:(Pr(B.generics?.[1]??"")[se]??ie).trim()}));return B.contexts.map((ie)=>{let se=ie.properties.map((Ae)=>{let De=Ae.description?`${wn(Ae.description)}
39
+ `:"",Re=Ae.optional?"?":"";return`${De}${Ae.name}${Re}: ${Ae.type};`}).join(`
40
+ `),de=ie.description?`${Pn(ie.description)}
41
+ `:"",ke=G.filter(({name:Ae})=>ie.type!==void 0&&vr(ie.type,Ae)||ie.properties.some((De)=>vr(De.type,Ae))).map(({constraint:Ae})=>Ae),Pe=ke.length>0?`<${ke.map(kr).join(", ")}>`:"";if(ie.type!==void 0)return`${de}export type ${ie.typeName}${Pe} = ${ie.type};`;if(ie.properties.length===0)return ie.hasUnresolvedSpread?`${de}export type ${ie.typeName} = Record<string, any>;`:`${de}export type ${ie.typeName} = Record<string, never>;`;let _e=ie.hasUnresolvedSpread?" & Record<string, any>":"";return`${de}export type ${ie.typeName}${Pe} = {
42
+ ${se}
43
+ }${_e};`}).join(`
44
+
45
+ `)}function Rt(B){return Er.test(B)?B:JSON.stringify(B)}function ys(B,G){if(!B)return;return`* ${G||B}
46
+ `}function zt(B,G,ie){return[ys(hu(B)),mu(G),xu(ie)].filter(Boolean).join("")}function It(B){return B.length>0?`/**
47
+ ${g(B)}*/`:ot}function Cu(B){let G=B.props.filter((Le)=>!Le.isFunctionDeclaration&&Le.kind!=="const"),ie=new Set([...G.map((Le)=>Le.name),...Array.from(B.canonicalPropNames??[])]),se=G.map((Le)=>{let Ve=typeof Le.value==="string"?Le.value.replace(cu," "):Le.value,Ue=ou.test(Le.description??"")||Le.value===void 0||Le.value==="undefined",Xe=[zt(Le.description,Le.deprecated,Le.tags),ys(Le.constant,"@constant"),Ue?null:`* @default ${Ve}
48
+ `].filter(Boolean).join(""),Qe=Le.constant&&!Le.isFunction?Le.value:Le.type||ht;return`
49
+ ${It(Xe)}
50
+ ${Rt(Le.name)}${Le.isRequired?"":"?"}: ${Qe};`}),de=B.canonicalPropsType?se.filter((Le,Ve)=>{let We=G[Ve];return We?!(B.canonicalPropNames?.has(We.name)??!1):!0}):se,ke=(B.slots||[]).filter((Le)=>!Le.default&&Le.name!=null&&!ie.has(Le.name)).map((Le)=>{let Ve=Le.name,We=Rt(Ve),Ue=kn(Le.description,Le.tags,Le.deprecated),Xe=Ue?`${Ue}
51
+ `:"",Je=Le.slot_props&&Le.slot_props!=="Record<string, never>"?`(this: void, ...args: [${Le.slot_props}]) => void`:"(this: void) => void";return`
52
+ ${Xe}${We}?: ${Je};`}),Pe=(B.slots||[]).find((Le)=>Le.default||Le.name===null),_e=Pe&&!ie.has("children")?(()=>{let Le=kn(Pe.description,Pe.tags,Pe.deprecated),Ve=Le?`${Le}
53
+ `:"",Ue=Pe.slot_props&&Pe.slot_props!=="Record<string, never>"?`(this: void, ...args: [${Pe.slot_props}]) => void`:"(this: void) => void";return`
54
+ ${Ve}children?: ${Ue};`})():"",Ae=[...ke,_e].filter(Boolean),De=[...de,...Ae].join(`
55
+ `),Re=Xt(B.moduleName),Oe=ot,Ie=B.generics?`<${Pr(B.generics[1]).map((Le)=>kr(Le.trim())).join(", ")}>`:"",$e=B.generics?`<${B.generics[0]}>`:"",Me=B.canonicalPropsType?`
56
+ type $Props${Ie} = ${B.canonicalPropsType}${De.trim()===""?"":` & {${De}
57
+ }`};
58
+ `:`
59
+ type $Props${Ie} = {
60
+ ${De}
61
+ };
62
+ `;if(B.rest_props?.type==="Element"){let Le;if(B.rest_props.name==="svelte:element")if(B.rest_props.thisValue)Le=`SvelteHTMLElements["${B.rest_props.thisValue}"]`;else Le="HTMLAttributes<HTMLElement>";else Le=B.rest_props.name.split("|").map((Ue)=>`SvelteHTMLElements["${Ue.trim()}"]`).join(" & ");let Ve="[key: `data-${string}`]: unknown;",We=B.rest_props.description?B.rest_props.description.includes(`
63
+ `)?`${Pn(B.rest_props.description)}
64
+ `:`${wn(B.rest_props.description)}
65
+ `:"";if(B.extends===void 0)Oe=`
66
+ ${We}${Le?`type $RestProps = ${Le};
67
+ `:""}
68
+ ${B.canonicalPropsType?`type $Props${Ie} = (${B.canonicalPropsType}) & {${De}
69
+
70
+ ${Ve}
71
+ };`:`type $Props${Ie} = {
72
+ ${De}
73
+
74
+ ${Ve}
75
+ };`}
76
+
77
+ export type ${Re}${Ie} = Omit<$RestProps, keyof $Props${$e}> & $Props${$e};
78
+ `;else Oe=`
79
+ ${We}${Le?`type $RestProps = ${Le};
80
+ `:""}
81
+ ${B.canonicalPropsType?`type $Props${Ie} = (${B.canonicalPropsType}) & {${De}
82
+
83
+ ${Ve}
84
+ };`:`type $Props${Ie} = {
85
+ ${De}
86
+
87
+ ${Ve}
88
+ };`}
89
+
90
+ export type ${Re}${Ie} = Omit<$RestProps, keyof ($Props${$e} & ${B.extends.interface})> & Omit<${B.extends.interface}, keyof $Props${$e}> & $Props${$e};
91
+ `}else if(De.trim()===""&&B.extends===void 0&&!B.canonicalPropsType)Oe=`
92
+ export type ${Re}${Ie} = ${br};
93
+ `;else if(B.canonicalPropsType)Oe=`
94
+ ${Me}
95
+ export type ${Re}${Ie} = ${B.extends===void 0?"":`Omit<${B.extends.interface}, keyof $Props${$e}> & `}$Props${$e};
96
+ `;else if(B.extends===void 0)Oe=`
97
+ export type ${Re}${Ie} = {
98
+ ${De}
99
+ };
100
+ `;else Oe=`
101
+ type $Props${Ie} = {
102
+ ${De}
103
+ };
104
+
105
+ export type ${Re}${Ie} = Omit<${B.extends.interface}, keyof $Props${$e}> & $Props${$e};
106
+ `;return{props_name:Re,prop_def:Oe}}function bu(B){if(B.slots.length===0)return br;let G=B.slots.map(({name:ie,slot_props:se,...de})=>{let ke=de.default||ie===null?"default":Rt(ie??""),Pe=kn(de.description,de.tags,de.deprecated);return`${Pe?`${Pe}
107
+ `:""}${ke}: ${_n(se)};`}).join(`
108
+ `);return B.slots.length===1?`{${G}}`:`{
109
+ ${G}
110
+ }`}var Eu=()=>"WindowEventMap",Su=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave","contextmenu","wheel","keydown","keyup","keypress","submit","change","input","focus","blur","focusin","focusout","reset","select","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragover","dragenter","dragleave","drop","pointerdown","pointerup","pointermove","pointerover","pointerout","pointerenter","pointerleave","pointercancel","gotpointercapture","lostpointercapture","play","pause","ended","volumechange","timeupdate","loadeddata","loadedmetadata","canplay","canplaythrough","seeking","seeked","playing","waiting","stalled","suspend","abort","error","emptied","ratechange","durationchange","loadstart","progress","loadend","animationstart","animationend","animationiteration","animationcancel","transitionstart","transitionend","transitionrun","transitioncancel","scroll","resize","load","unload","beforeunload","cut","copy","paste","compositionstart","compositionupdate","compositionend"]);function yr(B=ht){if(ru.test(B))return B;return`CustomEvent<${B}>`}function ku(B){return Su.has(B)}function wu(B){switch(B.type){case"dispatched":return yr(B.detail);case"forwarded":{let G=B.element,se=!(G&&iu.test(G))||ku(B.name),de=B.detail!==void 0&&B.detail!=="undefined"&&!(B.detail==="null"&&se),ke=B.detail==="null"&&!se;if(de||ke)return yr(B.detail);else if(se)return`${Eu()}["${B.name}"]`;else return yr()}default:return B}}function hs(B){if(B.events.length===0)return nu;let G=B.events.map((ie)=>{let se="",de=kn(ie.description,ie.tags,ie.deprecated);if(de)se=`${de}
111
+ `;return`${se}${Rt(ie.name)}: ${wu(ie)};
112
+ `}).join("");return B.events.length===1?`{${G}}`:`{
113
+ ${G}}`}function Pu(B){let G=B.type==="() => any";if(B.type&&ms.test(B.type)&&!G)return B.type;else if(B.params&&B.params.length>0)return`(${T(B.params)}) => ${B.returnType||ht}`;else if(B.returnType)return`() => ${B.returnType}`;else return B.type||ht}function vs(B){return B.props.filter((G)=>G.isFunctionDeclaration||G.kind==="const").map((G)=>{let ie=zt(G.description,G.deprecated,G.tags),se=Pu(G);return`
114
+ ${It(ie)}
115
+ ${Rt(G.name)}: ${se};`}).join(`
116
+ `)}function _u(B){let G=on(B.moduleName),ie=vs({props:B.props});if(ie.trim()==="")return{exports_name:G,exports_ref:G,exports_def:`export type ${G} = ${br};`};let{declSuffix:se,refSuffix:de}=vu(B.generics,ie);return{exports_name:G,exports_ref:`${G}${de}`,exports_def:`export type ${G}${se} = {${ie}
117
+ };`}}function Au(B){let G=B.props.filter((ie)=>ie.bindable===!0||ie.binding==="writable").map((ie)=>JSON.stringify(ie.name));return G.length===0?ot:G.join(" | ")}function Cs(B){return B==="default"?"$$Component":B}function Tu(B){let G=Cs(B.moduleName),ie=B.bindings===ot?'""':B.bindings;return`declare const ${G}: Component<
118
+ ${B.propsRef},
119
+ ${B.exportsRef},
120
+ ${ie}
121
+ >;
122
+ export default ${G};`}function Nu(B){let G=Cs(B.moduleName),ie=`${G}Component`,se=B.bindings===ot?'""':B.bindings,de=B.eventsRef?`$on?<K extends keyof ${B.eventsRef} & string>(type: K, callback: (e: ${B.eventsRef}[K]) => void): () => void;`:"$on?(type: string, callback: (e: any) => void): () => void;";return`interface ${ie} {
123
+ new ${B.generic}(
124
+ options: ComponentConstructorOptions<${B.propsRef}>
125
+ ): SvelteComponent<${B.propsRef}${B.eventsRef?`, ${B.eventsRef}`:""}> & ${B.exportsRef};
126
+ ${B.generic}(
127
+ this: void,
128
+ internals: ComponentInternals,
129
+ props: ${B.propsRef}
130
+ ): {
131
+ ${de}
132
+ $set?(props: Partial<${B.propsRef}>): void;
133
+ } & ${B.exportsRef};
134
+ element?: typeof HTMLElement;
135
+ z_$$bindings?: ${se};
136
+ }
137
+ declare const ${G}: ${ie};
138
+ export default ${G};`}function Du(B){if(B.extends===void 0)return"";return`import type { ${B.extends.interface} } from ${B.extends.import};`}function Ru(B){if(!B.componentComment)return"";if(!su.test(B.componentComment))return wn(B.componentComment.trim());return`/*${g(B.componentComment).split(`
139
+ `).map((G)=>`* ${G}`).join(`
140
+ `)}
141
+ */`}function Cr(B){return Er.test(B)?B:JSON.stringify(B)}function Iu(B){let G=[],ie=new Map;for(let se of B.moduleExports){if(se.kind!=="re-export"||!se.reExport)continue;let{from:de,imported:ke}=se.reExport,Pe=zt(se.description,se.deprecated,se.tags),_e=Cr(se.name);if(ke==="*"){let Re=se.name==="*"?"*":`* as ${_e}`;G.push(`${It(Pe)}
142
+ export ${Re} from ${JSON.stringify(de)};`);continue}let Ae=`${de}\x00${Pe}`,De=ie.get(Ae);if(!De)De={comments:Pe,from:de,specifiers:[]},ie.set(Ae,De),G.push(Ae);De.specifiers.push(ke===se.name?_e:`${Cr(ke)} as ${_e}`)}return G.map((se)=>{let de=ie.get(se);if(!de)return se;return`${It(de.comments)}
143
+ export { ${de.specifiers.join(", ")} } from ${JSON.stringify(de.from)};`}).join(`
144
+
145
+ `)}function _r(B){let G=[B.static?"static ":"",B.abstract?"abstract ":"",B.readonly?"readonly ":""].join(""),ie=B.optional?"?":"";if(B.kind==="property")return`${G}${Rt(B.name)}${ie}: ${B.type??ht}`;let se=T(B.params??[]);if(B.kind==="constructor")return`constructor(${se})`;let de=B.typeParameters?`<${B.typeParameters}>`:"";return`${G}${Rt(B.name)}${ie}${de}(${se}): ${B.returnType??ht}`}function $u(B,G){let ie=B.localName??B.name,se=ie!==B.name,de=`export { ${ie}${se?` as ${Cr(B.name)}`:""} };`;if(G.has(ie))return de;G.add(ie);let ke=B.typeParameters?`<${B.typeParameters}>`:"",Pe=(B.members??[]).map((Re)=>[It(zt(Re.description,Re.deprecated,Re.tags)),`${_r(Re)};`].filter(Boolean).join(`
146
+ `)).join(`
147
+
148
+ `),_e=`${B.extends?` extends ${B.extends}`:""}${B.implements?.length?` implements ${B.implements.join(", ")}`:""}`,Ae=`${se?"":"export "}declare ${B.abstract?"abstract ":""}class ${ie}${ke}${_e}`;return`
149
+ ${[It(zt(B.description,B.deprecated,B.tags)),Pe?`${Ae} {
150
+ ${Pe}
151
+ }`:`${Ae} {}`,se?de:""].filter(Boolean).join(`
152
+ `)}`}function Ou(B){let G=Iu(B),ie=new Set,se=B.moduleExports.filter((de)=>de.kind!=="re-export").map((de)=>{if(de.kind==="class")return $u(de,ie);let ke=!Er.test(de.name),Pe=ke?{...de,name:Lu(de.name)}:de,_e=zt(Pe.description,Pe.deprecated,Pe.tags),Ae,De=Pe.type&&ms.test(Pe.type),Re=Pe.type==="() => any",Oe=Pe.typeParameters?`<${Pe.typeParameters}>`:"";if(Pe.kind==="const"&&!De)Ae=`export declare const ${Pe.name}: ${Pe.type||ht};
153
+ `;else if(Pe.params&&Pe.params.length>0)Ae=`export declare function ${Pe.name}${Oe}(${T(Pe.params)}): ${Pe.returnType||ht};`;else if(Pe.returnType)Ae=`export declare function ${Pe.name}${Oe}(): ${Pe.returnType};`;else if(De&&Pe.type&&!Re){let[Ie,$e,...Me]=Pe.type.split("=>"),Le=Me.map((Ve)=>` => ${Ve.trim()}`).join("");Ae=`export declare function ${Pe.name}${Ie.trimEnd()}: ${$e.trim()}${Le};`}else if(De&&Pe.type){let[Ie,$e,...Me]=Pe.type.split("=>"),Le=Me.map((Ve)=>` => ${Ve.trim()}`).join("");Ae=`export declare function ${Pe.name}${Ie.trimEnd()}: ${$e.trim()}${Le};`}else if(Pe.kind==="const")Ae=`export declare const ${Pe.name}: ${Pe.type||ht};
154
+ `;else Ae=`export declare let ${Pe.name}: ${Pe.type||ht};`;if(ke)Ae=`${Ae.replace(fu,"").trimEnd()}
155
+ export { ${Pe.name} as ${JSON.stringify(de.name)} };`;return`
156
+ ${It(_e)}
157
+ ${Ae}`}).join(`
158
+ `);return[G,se].filter(Boolean).join(`
159
+
160
+ `)}function Lu(B){return`__export_${B.replace(du,"_")}`}var Mu=120;function Fu(B){let ie=`export default class ${B.moduleName==="default"?"":B.moduleName}${B.generic} extends SvelteComponentTyped<`,se=[B.genericProps,B.events,B.slots];if(B.accessors.trim()===""&&se.every((de)=>!de.includes(`
161
+ `))){let de=`${ie}${se.join(", ")}> {}`;if(de.length<=Mu)return de}return`${ie}
162
+ ${B.genericProps},
163
+ ${B.events},
164
+ ${B.slots}
165
+ > {
166
+ ${B.accessors}
167
+ }`}function Xt(B){return`${B}Props`}function on(B){return`${B}Exports`}function Ar(B){return{format:B.format}}var Bu={format:"class"};function bs(B){let G=Ar(B??{}),ie={};for(let[se,de]of Object.entries(G))ie[se]=de??Bu[se];return JSON.stringify(ie)}function Tr(B,G){let ie=es(B),{moduleName:se,typedefs:de,generics:ke,props:Pe,moduleExports:_e,slots:Ae,events:De,rest_props:Re,extends:Oe,componentComment:Ie,contexts:$e}=B,Me=G?.format==="component",Le=ke!==null,{props_name:Ve,prop_def:We}=Cu({moduleName:se,props:Pe,rest_props:Re,extends:Oe,generics:ke,slots:Ae,canonicalPropNames:new Set(ie?.canonicalPropNames??[]),canonicalPropsType:ie?.canonicalPropsType}),Ue=ke?`<${ke[1]}>`:"",Xe=ke?`${Ve}<${ke[0]}>`:Ve,Qe=Me&&De.length>0?`type $Events${Ue} = ${hs({events:De})};`:"",Je=ke?`$Events<${ke[0]}>`:"$Events",st=Me&&(Le||Qe!==""),en=Ou({moduleExports:_e}),tn=An({typedefs:de}),rt=xs({contexts:$e,generics:ke}),Gt=(ie?.typeImportStatements??[]).join(`
168
+ `),Ii=[...ie?.localTypeDeclarations??[],...ie?.moduleTypeDeclarations??[]].join(`
169
+
170
+ `),{exports_ref:$i,exports_def:Oi}=Me?_u({props:Pe,moduleName:se,generics:ke}):{exports_ref:ot,exports_def:ot},Li=Me?Au({props:Pe}):ot,ir=!uu.test(Gt)&&(Kt.test(We)||Kt.test(en)||Kt.test(tn)||Kt.test(rt)||Kt.test(Ii)||Kt.test(Oi)),Na=Re?.type==="Element"&&(Re.name!=="svelte:element"||Re.name==="svelte:element"&&Re.thisValue),Da=Re?.type==="Element"&&Re.name==="svelte:element"&&!Re.thisValue,Ra=[Me?st?`import type { SvelteComponent, ComponentConstructorOptions, ComponentInternals${ir?", Snippet":""} } from "svelte";`:`import type { Component${ir?", Snippet":""} } from "svelte";`:`import { SvelteComponentTyped${ir?", type Snippet":""} } from "svelte";`,Na?'import type { SvelteHTMLElements } from "svelte/elements";':"",Da?'import type { HTMLAttributes } from "svelte/elements";':"",Gt,Du({extends:Oe})].filter(Boolean).join(`
171
+ `),Ia=Me?st?Nu({moduleName:se,generic:Ue,propsRef:Xe,exportsRef:$i,bindings:Li,...Qe?{eventsRef:Je}:{}}):Tu({moduleName:se,propsRef:Xe,exportsRef:$i,bindings:Li}):Fu({moduleName:se,generic:Ue,genericProps:Xe,events:hs({events:De}),slots:bu({slots:Ae}),accessors:vs({props:Pe})}),$a=[en,tn,Ii,rt,We,Oi,Qe,[Ru({componentComment:Ie}),Ia].filter(Boolean).join(`
172
+ `)].map((Oa)=>Oa.trim()).filter(Boolean).join(`
173
+
174
+ `);return ps([Ra,$a].filter(Boolean).join(`
175
+
176
+ `))}var ju=[...Wt,".svelte"];function Gu(B){let G=B.trim();if(G.length<2)return;let ie=G[0],se=G[G.length-1];if((ie==='"'||ie==="'"||ie==="`")&&ie===se)return G.slice(1,-1);return}function Es(B){let G=[],ie=B.moduleExports.filter((de)=>de.kind==="re-export");if(ie.length===0)return G;let se=new Set([Xt(B.moduleName),on(B.moduleName)]);for(let de of ie){if(!se.has(de.name))continue;G.push(i({component:B.filePath,kind:"module-export-conflict",name:de.name,message:`Re-export "${de.name}" has the same name as the generated "${de.name}" type; the .d.ts won't type-check if "${de.reExport?.from}" exports a type by that name.`,source:de.source}))}return G}function Ss(B,G,ie){let se=new Map(Array.from(B.values()).map((de)=>[G(de.filePath),de]));return(de)=>{let ke=de.extends;if(!ke)return[];let Pe=Gu(ke.import);if(Pe===void 0||!Pe.startsWith(".")&&!Pe.startsWith("/"))return[];let _e=G(de.filePath),Ae=ie.resolve(Pe,Vu(_e),ju);if(Ae===null)return[i({component:de.filePath,kind:"extend-props-target-missing",name:ke.interface,message:`@extends/@extendProps target "${Pe}" was not found on disk.`})];let De=se.get(Ae);if(!De)return[];let Re=Xt(De.moduleName);if(ke.interface!==Re)return[i({component:de.filePath,kind:"extend-props-target-missing",name:ke.interface,message:`@extends/@extendProps names "${ke.interface}", but "${Pe}" generates "${Re}".`})];let Oe=[];for(let Ie of de.props){let $e=De.props.find((Me)=>Me.name===Ie.name);if($e&&$e.type!==Ie.type)Oe.push(i({component:de.filePath,kind:"extend-props-override",name:Ie.name,message:`Own prop "${Ie.name}" (${Ie.type}) overrides "${Re}"'s "${Ie.name}" (${$e.type}).`}))}return Oe}}import{lstatSync as Jp,readFileSync as Yp,realpathSync as Qp,statSync as Zp}from"node:fs";import{basename as el,dirname as tl,isAbsolute as nl,join as So,parse as rl,relative as Qr,resolve as Un}from"node:path";function U(B){return B}function bt(B){if(B==="")return B;return B.startsWith(".")?B:`./${B}`}import{readFileSync as bo}from"node:fs";import{dirname as Jr,join as Xp,relative as vo,resolve as Co}from"node:path";import{readFileSync as Bp,statSync as Vp}from"node:fs";import{basename as qr,dirname as Wn,isAbsolute as jp,join as Gp,resolve as Wp}from"node:path";var ue={};Ua(ue,{Node:()=>ln,Parser:()=>r,Position:()=>qt,SourceLocation:()=>un,TokContext:()=>ut,Token:()=>Vn,TokenType:()=>ze,defaultOptions:()=>Nn,getLineInfo:()=>Mr,isIdentifierChar:()=>c,isIdentifierStart:()=>a,isNewLine:()=>Ot,keywordTypes:()=>On,lineBreak:()=>nt,lineBreakG:()=>Ds,nonASCIIwhitespace:()=>Lr,parse:()=>Wr,parseExpressionAt:()=>kp,tokContexts:()=>qe,tokTypes:()=>Ne,tokenizer:()=>wp,version:()=>po});var Wu=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],As=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],Uu="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫝᫠-᫫ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",Ts="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ƛ꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Nr={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},Dr="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",Hu={5:Dr,"5module":Dr+" export import",6:Dr+" const class extends export import super"},Ns=/^in(stanceof)?$/,Ku=new RegExp("["+Ts+"]"),zu=new RegExp("["+Ts+Uu+"]");function Rr(B,G){var ie=65536;for(var se=0;se<G.length;se+=2){if(ie+=G[se],ie>B)return!1;if(ie+=G[se+1],ie>=B)return!0}return!1}function a(B,G){if(B<65)return B===36;if(B<91)return!0;if(B<97)return B===95;if(B<123)return!0;if(B<=65535)return B>=170&&Ku.test(String.fromCharCode(B));if(G===!1)return!1;return Rr(B,As)}function c(B,G){if(B<48)return B===36;if(B<58)return!0;if(B<65)return!1;if(B<91)return!0;if(B<97)return B===95;if(B<123)return!0;if(B<=65535)return B>=170&&zu.test(String.fromCharCode(B));if(G===!1)return!1;return Rr(B,As)||Rr(B,Wu)}var ze=function(G,ie){if(ie===void 0)ie={};this.label=G,this.keyword=ie.keyword,this.beforeExpr=!!ie.beforeExpr,this.startsExpr=!!ie.startsExpr,this.isLoop=!!ie.isLoop,this.isAssign=!!ie.isAssign,this.prefix=!!ie.prefix,this.postfix=!!ie.postfix,this.binop=ie.binop||null,this.updateContext=null};function at(B,G){return new ze(B,{beforeExpr:!0,binop:G})}var ct={beforeExpr:!0},it={startsExpr:!0},On={};function Ke(B,G){if(G===void 0)G={};return G.keyword=B,On[B]=new ze(B,G)}var Ne={num:new ze("num",it),regexp:new ze("regexp",it),string:new ze("string",it),name:new ze("name",it),privateId:new ze("privateId",it),eof:new ze("eof"),bracketL:new ze("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new ze("]"),braceL:new ze("{",{beforeExpr:!0,startsExpr:!0}),braceR:new ze("}"),parenL:new ze("(",{beforeExpr:!0,startsExpr:!0}),parenR:new ze(")"),comma:new ze(",",ct),semi:new ze(";",ct),colon:new ze(":",ct),dot:new ze("."),question:new ze("?",ct),questionDot:new ze("?."),arrow:new ze("=>",ct),template:new ze("template"),invalidTemplate:new ze("invalidTemplate"),ellipsis:new ze("...",ct),backQuote:new ze("`",it),dollarBraceL:new ze("${",{beforeExpr:!0,startsExpr:!0}),eq:new ze("=",{beforeExpr:!0,isAssign:!0}),assign:new ze("_=",{beforeExpr:!0,isAssign:!0}),incDec:new ze("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new ze("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:at("||",1),logicalAND:at("&&",2),bitwiseOR:at("|",3),bitwiseXOR:at("^",4),bitwiseAND:at("&",5),equality:at("==/!=/===/!==",6),relational:at("</>/<=/>=",7),bitShift:at("<</>>/>>>",8),plusMin:new ze("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:at("%",10),star:at("*",10),slash:at("/",10),starstar:new ze("**",{beforeExpr:!0}),coalesce:at("??",1),_break:Ke("break"),_case:Ke("case",ct),_catch:Ke("catch"),_continue:Ke("continue"),_debugger:Ke("debugger"),_default:Ke("default",ct),_do:Ke("do",{isLoop:!0,beforeExpr:!0}),_else:Ke("else",ct),_finally:Ke("finally"),_for:Ke("for",{isLoop:!0}),_function:Ke("function",it),_if:Ke("if"),_return:Ke("return",ct),_switch:Ke("switch"),_throw:Ke("throw",ct),_try:Ke("try"),_var:Ke("var"),_const:Ke("const"),_while:Ke("while",{isLoop:!0}),_with:Ke("with"),_new:Ke("new",{beforeExpr:!0,startsExpr:!0}),_this:Ke("this",it),_super:Ke("super",it),_class:Ke("class",it),_extends:Ke("extends",ct),_export:Ke("export"),_import:Ke("import",it),_null:Ke("null",it),_true:Ke("true",it),_false:Ke("false",it),_in:Ke("in",{beforeExpr:!0,binop:7}),_instanceof:Ke("instanceof",{beforeExpr:!0,binop:7}),_typeof:Ke("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:Ke("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:Ke("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},nt=/\r\n?|\n|\u2028|\u2029/,Ds=new RegExp(nt.source,"g");function Ot(B){return B===10||B===13||B===8232||B===8233}function Rs(B,G,ie){if(ie===void 0)ie=B.length;for(var se=G;se<ie;se++){var de=B.charCodeAt(se);if(Ot(de))return se<ie-1&&de===13&&B.charCodeAt(se+1)===10?se+2:se+1}return-1}var Lr=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Ze=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Is=Object.prototype,{hasOwnProperty:Xu,toString:qu}=Is,Jt=Object.hasOwn||function(B,G){return Xu.call(B,G)},ks=Array.isArray||function(B){return qu.call(B)==="[object Array]"},ws=Object.create(null);function _t(B){return ws[B]||(ws[B]=new RegExp("^(?:"+B.replace(/ /g,"|")+")$"))}function Et(B){if(B<=65535)return String.fromCharCode(B);return B-=65536,String.fromCharCode((B>>10)+55296,(B&1023)+56320)}var Ju=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,qt=function(G,ie){this.line=G,this.column=ie};qt.prototype.offset=function(G){return new qt(this.line,this.column+G)};var un=function(G,ie,se){if(this.start=ie,this.end=se,G.sourceFile!==null)this.source=G.sourceFile};function Mr(B,G){for(var ie=1,se=0;;){var de=Rs(B,se,G);if(de<0)return new qt(ie,G-se);++ie,se=de}}var Nn={ecmaVersion:null,sourceType:"script",strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,startLocation:null,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},Ps=!1;function Yu(B){var G={};for(var ie in Nn)G[ie]=B&&Jt(B,ie)?B[ie]:Nn[ie];if(G.ecmaVersion==="latest")G.ecmaVersion=1e8;else if(G.ecmaVersion==null){if(!Ps&&typeof console==="object"&&console.warn)Ps=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
177
+ Defaulting to 2020, but this will stop working in the future.`);G.ecmaVersion=11}else if(G.ecmaVersion>=2015)G.ecmaVersion-=2009;if(G.allowReserved==null)G.allowReserved=G.ecmaVersion<5;if(!B||B.allowHashBang==null)G.allowHashBang=G.ecmaVersion>=14;if(ks(G.onToken)){var se=G.onToken;G.onToken=function(de){return se.push(de)}}if(ks(G.onComment))G.onComment=Qu(G,G.onComment);if(G.sourceType==="commonjs"&&G.allowAwaitOutsideFunction)throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return G}function Qu(B,G){return function(ie,se,de,ke,Pe,_e){var Ae={type:ie?"Block":"Line",value:se,start:de,end:ke};if(B.locations)Ae.loc=new un(this,Pe,_e);if(B.ranges)Ae.range=[de,ke];G.push(Ae)}}var $t=1,Lt=2,Fr=4,$s=8,Br=16,Os=32,Ln=64,Ls=128,Mt=256,pn=512,Ms=1024,Mn=$t|Lt|Mt;function Vr(B,G){return Lt|(B?Fr:0)|(G?$s:0)}var Dn=0,jr=1,kt=2,Fs=3,Bs=4,Vs=5,r=function(G,ie,se){this.options=G=Yu(G),this.sourceFile=G.sourceFile,this.keywords=_t(Hu[G.ecmaVersion>=6?6:G.sourceType==="module"?"5module":5]);var de="";if(G.allowReserved!==!0){if(de=Nr[G.ecmaVersion>=6?6:G.ecmaVersion===5?5:3],G.sourceType==="module")de+=" await"}this.reservedWords=_t(de);var ke=(de?de+" ":"")+Nr.strict;if(this.reservedWordsStrict=_t(ke),this.reservedWordsStrictBind=_t(ke+" "+Nr.strictBind),this.input=String(ie),this.containsEsc=!1,this.pos=se||0,this.curLine=1,G.startLocation)this.lineStart=this.pos-G.startLocation.column,this.curLine=G.startLocation.line;else if(se){if(this.lineStart=this.input.lastIndexOf(`
178
+ `,se-1)+1,this.options.locations)this.curLine=this.input.slice(0,this.lineStart).split(nt).length}else this.lineStart=0;if(this.type=Ne.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=G.sourceType==="module",this.strict=this.inModule||G.strict===!0||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&G.allowHashBang&&this.input.slice(0,2)==="#!")this.skipLineComment(2);this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?Lt:$t),this.regexpState=null,this.privateNameStack=[]},lt={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};r.prototype.parse=function(){var G=this,ie=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return G.parseTopLevel(ie)})};lt.inFunction.get=function(){return(this.currentVarScope().flags&Lt)>0};lt.inGenerator.get=function(){return(this.currentVarScope().flags&$s)>0};lt.inAsync.get=function(){return(this.currentVarScope().flags&Fr)>0};lt.canAwait.get=function(){for(var B=this.scopeStack.length-1;B>=0;B--){var G=this.scopeStack[B],ie=G.flags;if(ie&(Mt|pn))return!1;if(ie&Lt)return(ie&Fr)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};lt.allowReturn.get=function(){if(this.inFunction)return!0;if(this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&$t)return!0;return!1};lt.allowSuper.get=function(){var B=this.currentThisScope(),G=B.flags;return(G&Ln)>0||this.options.allowSuperOutsideMethod};lt.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Ls)>0};lt.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};lt.allowNewDotTarget.get=function(){for(var B=this.scopeStack.length-1;B>=0;B--){var G=this.scopeStack[B],ie=G.flags;if(ie&(Mt|pn)||ie&Lt&&!(ie&Br))return!0}return!1};lt.allowUsing.get=function(){var B=this.currentScope(),G=B.flags;if(G&Ms)return!1;if(!this.inModule&&G&$t)return!1;return!0};lt.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Mt)>0};r.extend=function(){var G=[],ie=arguments.length;while(ie--)G[ie]=arguments[ie];var se=this;for(var de=0;de<G.length;de++)se=G[de](se);return se};r.parse=function(G,ie){return new this(ie,G).parse()};r.parseExpressionAt=function(G,ie,se){var de=new this(se,G,ie);return de.nextToken(),de.parseExpression()};r.tokenizer=function(G,ie){return new this(ie,G)};Object.defineProperties(r.prototype,lt);var et=r.prototype,Zu=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;et.strictDirective=function(B){if(this.options.ecmaVersion<5)return!1;for(;;){Ze.lastIndex=B,B+=Ze.exec(this.input)[0].length;var G=Zu.exec(this.input.slice(B));if(!G)return!1;if((G[1]||G[2])==="use strict"){Ze.lastIndex=B+G[0].length;var ie=Ze.exec(this.input),se=ie.index+ie[0].length,de=this.input.charAt(se);return de===";"||de==="}"||nt.test(ie[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(de)||de==="!"&&this.input.charAt(se+1)==="=")}if(B+=G[0].length,Ze.lastIndex=B,B+=Ze.exec(this.input)[0].length,this.input[B]===";")B++}};et.eat=function(B){if(this.type===B)return this.next(),!0;else return!1};et.isContextual=function(B){return this.type===Ne.name&&this.value===B&&!this.containsEsc};et.eatContextual=function(B){if(!this.isContextual(B))return!1;return this.next(),!0};et.catchStackOverflow=function(B){try{return B()}catch(G){if(G instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(G.message)||/\btoo much recursion\b/i.test(G.message)))this.raise(this.start,"Not enough stack space to parse input");else throw G}};et.expectContextual=function(B){if(!this.eatContextual(B))this.unexpected()};et.canInsertSemicolon=function(){return this.type===Ne.eof||this.type===Ne.braceR||nt.test(this.input.slice(this.lastTokEnd,this.start))};et.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon)this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc);return!0}};et.semicolon=function(){if(!this.eat(Ne.semi)&&!this.insertSemicolon())this.unexpected()};et.afterTrailingComma=function(B,G){if(this.type===B){if(this.options.onTrailingComma)this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc);if(!G)this.next();return!0}};et.expect=function(B){this.eat(B)||this.unexpected()};et.unexpected=function(B){this.raise(B!=null?B:this.start,"Unexpected token")};var Fn=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};et.checkPatternErrors=function(B,G){if(!B)return;if(B.trailingComma>-1)this.raiseRecoverable(B.trailingComma,"Comma is not permitted after the rest element");var ie=G?B.parenthesizedAssign:B.parenthesizedBind;if(ie>-1)this.raiseRecoverable(ie,G?"Assigning to rvalue":"Parenthesized pattern")};et.checkExpressionErrors=function(B,G){if(!B)return!1;var{shorthandAssign:ie,doubleProto:se}=B;if(!G)return ie>=0||se>=0;if(ie>=0)this.raise(ie,"Shorthand property assignments are valid only in destructuring patterns");if(se>=0)this.raiseRecoverable(se,"Redefinition of __proto__ property")};et.checkYieldAwaitInDefaultParams=function(){if(this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos))this.raise(this.yieldPos,"Yield expression cannot be a default value");if(this.awaitPos)this.raise(this.awaitPos,"Await expression cannot be a default value")};et.isSimpleAssignTarget=function(B){if(B.type==="ParenthesizedExpression")return this.isSimpleAssignTarget(B.expression);return B.type==="Identifier"||B.type==="MemberExpression"};var Be=r.prototype;Be.parseTopLevel=function(B){var G=Object.create(null);if(!B.body)B.body=[];while(this.type!==Ne.eof){var ie=this.parseStatement(null,!0,G);B.body.push(ie)}if(this.inModule)for(var se=0,de=Object.keys(this.undefinedExports);se<de.length;se+=1){var ke=de[se];this.raiseRecoverable(this.undefinedExports[ke].start,"Export '"+ke+"' is not defined")}return this.adaptDirectivePrologue(B.body),this.next(),B.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(B,"Program")};var Gr={kind:"loop"},ep={kind:"switch"};Be.isLet=function(B){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;Ze.lastIndex=this.pos;var G=Ze.exec(this.input),ie=this.pos+G[0].length,se=this.fullCharCodeAt(ie);if(se===91||se===92)return!0;if(B)return!1;if(se===123)return!0;if(a(se)){var de=ie;do ie+=se<=65535?1:2;while(c(se=this.fullCharCodeAt(ie)));if(se===92)return!0;var ke=this.input.slice(de,ie);if(!Ns.test(ke))return!0}return!1};Be.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;Ze.lastIndex=this.pos;var B=Ze.exec(this.input),G=this.pos+B[0].length,ie;return!nt.test(this.input.slice(this.pos,G))&&this.input.slice(G,G+8)==="function"&&(G+8===this.input.length||!(c(ie=this.fullCharCodeAt(G+8))||ie===92))};Be.isUsingKeyword=function(B,G){if(this.options.ecmaVersion<17||!this.isContextual(B?"await":"using"))return!1;Ze.lastIndex=this.pos;var ie=Ze.exec(this.input),se=this.pos+ie[0].length;if(nt.test(this.input.slice(this.pos,se)))return!1;if(B){var de=se+5,ke;if(this.input.slice(se,de)!=="using"||de===this.input.length||c(ke=this.fullCharCodeAt(de))||ke===92)return!1;Ze.lastIndex=de;var Pe=Ze.exec(this.input);if(se=de+Pe[0].length,Pe&&nt.test(this.input.slice(de,se)))return!1}var _e=this.fullCharCodeAt(se);if(!a(_e)&&_e!==92)return!1;var Ae=se;do se+=_e<=65535?1:2;while(c(_e=this.fullCharCodeAt(se)));if(_e===92)return!0;var De=this.input.slice(Ae,se);if(Ns.test(De))return!1;if(G&&!B&&De==="of"){Ze.lastIndex=se;var Re=Ze.exec(this.input);if(se=se+Re[0].length,this.input.charCodeAt(se)!==61||(_e=this.input.charCodeAt(se+1))===61||_e===62)return!1}return!0};Be.isAwaitUsing=function(B){return this.isUsingKeyword(!0,B)};Be.isUsing=function(B){return this.isUsingKeyword(!1,B)};Be.parseStatement=function(B,G,ie){var se=this.type,de=this.startNode(),ke;if(this.isLet(B))se=Ne._var,ke="let";switch(se){case Ne._break:case Ne._continue:return this.parseBreakContinueStatement(de,se.keyword);case Ne._debugger:return this.parseDebuggerStatement(de);case Ne._do:return this.parseDoStatement(de);case Ne._for:return this.parseForStatement(de);case Ne._function:if(B&&(this.strict||B!=="if"&&B!=="label")&&this.options.ecmaVersion>=6)this.unexpected();return this.parseFunctionStatement(de,!1,!B);case Ne._class:if(B)this.unexpected();return this.parseClass(de,!0);case Ne._if:return this.parseIfStatement(de);case Ne._return:return this.parseReturnStatement(de);case Ne._switch:return this.parseSwitchStatement(de);case Ne._throw:return this.parseThrowStatement(de);case Ne._try:return this.parseTryStatement(de);case Ne._const:case Ne._var:if(ke=ke||this.value,B&&ke!=="var")this.unexpected();return this.parseVarStatement(de,ke);case Ne._while:return this.parseWhileStatement(de);case Ne._with:return this.parseWithStatement(de);case Ne.braceL:return this.parseBlock(!0,de);case Ne.semi:return this.parseEmptyStatement(de);case Ne._export:case Ne._import:if(this.options.ecmaVersion>10&&se===Ne._import){Ze.lastIndex=this.pos;var Pe=Ze.exec(this.input),_e=this.pos+Pe[0].length,Ae=this.input.charCodeAt(_e);if(Ae===40||Ae===46)return this.parseExpressionStatement(de,this.parseExpression())}if(!this.options.allowImportExportEverywhere){if(!G)this.raise(this.start,"'import' and 'export' may only appear at the top level");if(!this.inModule)this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")}return se===Ne._import?this.parseImport(de):this.parseExport(de,ie);default:if(this.isAsyncFunction()){if(B)this.unexpected();return this.next(),this.parseFunctionStatement(de,!0,!B)}var De=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(De){if(!this.allowUsing)this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement");if(B)this.raise(this.start,"Using declaration is not allowed in single-statement positions");if(De==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.next(),this.parseVar(de,!1,De),this.semicolon(),this.finishNode(de,"VariableDeclaration")}var Re=this.value,Oe=this.parseExpression();if(se===Ne.name&&Oe.type==="Identifier"&&this.eat(Ne.colon))return this.parseLabeledStatement(de,Re,Oe,B);else return this.parseExpressionStatement(de,Oe)}};Be.parseBreakContinueStatement=function(B,G){var ie=G==="break";if(this.next(),this.eat(Ne.semi)||this.insertSemicolon())B.label=null;else if(this.type!==Ne.name)this.unexpected();else B.label=this.parseIdent(),this.semicolon();var se=0;for(;se<this.labels.length;++se){var de=this.labels[se];if(B.label==null||de.name===B.label.name){if(de.kind!=null&&(ie||de.kind==="loop"))break;if(B.label&&ie)break}}if(se===this.labels.length)this.raise(B.start,"Unsyntactic "+G);return this.finishNode(B,ie?"BreakStatement":"ContinueStatement")};Be.parseDebuggerStatement=function(B){return this.next(),this.semicolon(),this.finishNode(B,"DebuggerStatement")};Be.parseDoStatement=function(B){if(this.next(),this.labels.push(Gr),B.body=this.parseStatement("do"),this.labels.pop(),this.expect(Ne._while),B.test=this.parseParenExpression(),this.options.ecmaVersion>=6)this.eat(Ne.semi);else this.semicolon();return this.finishNode(B,"DoWhileStatement")};Be.parseForStatement=function(B){this.next();var G=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Gr),this.enterScope(0),this.expect(Ne.parenL),this.type===Ne.semi){if(G>-1)this.unexpected(G);return this.parseFor(B,null)}var ie=this.isLet();if(this.type===Ne._var||this.type===Ne._const||ie){var se=this.startNode(),de=ie?"let":this.value;return this.next(),this.parseVar(se,!0,de),this.finishNode(se,"VariableDeclaration"),this.parseForAfterInit(B,se,G)}var ke=this.isContextual("let"),Pe=!1,_e=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(_e){var Ae=this.startNode();if(this.next(),_e==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.parseVar(Ae,!0,_e),this.finishNode(Ae,"VariableDeclaration"),this.parseForAfterInit(B,Ae,G)}var De=this.containsEsc,Re=new Fn,Oe=this.start,Ie=G>-1?this.parseExprSubscripts(Re,"await"):this.parseExpression(!0,Re);if(this.type===Ne._in||(Pe=this.options.ecmaVersion>=6&&this.isContextual("of"))){if(G>-1){if(this.type===Ne._in)this.unexpected(G);B.await=!0}else if(Pe&&this.options.ecmaVersion>=8){if(Ie.start===Oe&&!De&&Ie.type==="Identifier"&&Ie.name==="async")this.unexpected();else if(this.options.ecmaVersion>=9)B.await=!1}if(ke&&Pe)this.raise(Ie.start,"The left-hand side of a for-of loop may not start with 'let'.");return this.toAssignable(Ie,!1,Re),this.checkLValPattern(Ie),this.parseForIn(B,Ie)}else this.checkExpressionErrors(Re,!0);if(G>-1)this.unexpected(G);return this.parseFor(B,Ie)};Be.parseForAfterInit=function(B,G,ie){if((this.type===Ne._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&G.declarations.length===1){if(this.type===Ne._in){if((G.kind==="using"||G.kind==="await using")&&!G.declarations[0].init)this.raise(this.start,"Using declaration is not allowed in for-in loops");if(this.options.ecmaVersion>=9&&ie>-1)this.unexpected(ie)}else if(this.options.ecmaVersion>=9)B.await=ie>-1;return this.parseForIn(B,G)}if(ie>-1)this.unexpected(ie);return this.parseFor(B,G)};Be.parseFunctionStatement=function(B,G,ie){return this.next(),this.parseFunction(B,cn|(ie?0:Ir),!1,G)};Be.parseIfStatement=function(B){return this.next(),B.test=this.parseParenExpression(),B.consequent=this.parseStatement("if"),B.alternate=this.eat(Ne._else)?this.parseStatement("if"):null,this.finishNode(B,"IfStatement")};Be.parseReturnStatement=function(B){if(!this.allowReturn)this.raise(this.start,"'return' outside of function");if(this.next(),this.eat(Ne.semi)||this.insertSemicolon())B.argument=null;else B.argument=this.parseExpression(),this.semicolon();return this.finishNode(B,"ReturnStatement")};Be.parseSwitchStatement=function(B){this.next(),B.discriminant=this.parseParenExpression(),B.cases=[],this.expect(Ne.braceL),this.labels.push(ep),this.enterScope(Ms);var G;for(var ie=!1;this.type!==Ne.braceR;)if(this.type===Ne._case||this.type===Ne._default){var se=this.type===Ne._case;if(G)this.finishNode(G,"SwitchCase");if(B.cases.push(G=this.startNode()),G.consequent=[],this.next(),se)G.test=this.parseExpression();else{if(ie)this.raiseRecoverable(this.lastTokStart,"Multiple default clauses");ie=!0,G.test=null}this.expect(Ne.colon)}else{if(!G)this.unexpected();G.consequent.push(this.parseStatement(null))}if(this.exitScope(),G)this.finishNode(G,"SwitchCase");return this.next(),this.labels.pop(),this.finishNode(B,"SwitchStatement")};Be.parseThrowStatement=function(B){if(this.next(),nt.test(this.input.slice(this.lastTokEnd,this.start)))this.raise(this.lastTokEnd,"Illegal newline after throw");return B.argument=this.parseExpression(),this.semicolon(),this.finishNode(B,"ThrowStatement")};var tp=[];Be.parseCatchClauseParam=function(){var B=this.parseBindingAtom(),G=B.type==="Identifier";return this.enterScope(G?Os:0),this.checkLValPattern(B,G?Bs:kt),this.expect(Ne.parenR),B};Be.parseTryStatement=function(B){if(this.next(),B.block=this.parseBlock(),B.handler=null,this.type===Ne._catch){var G=this.startNode();if(this.next(),this.eat(Ne.parenL))G.param=this.parseCatchClauseParam();else{if(this.options.ecmaVersion<10)this.unexpected();G.param=null,this.enterScope(0)}G.body=this.parseBlock(!1),this.exitScope(),B.handler=this.finishNode(G,"CatchClause")}if(B.finalizer=this.eat(Ne._finally)?this.parseBlock():null,!B.handler&&!B.finalizer)this.raise(B.start,"Missing catch or finally clause");return this.finishNode(B,"TryStatement")};Be.parseVarStatement=function(B,G,ie){return this.next(),this.parseVar(B,!1,G,ie),this.semicolon(),this.finishNode(B,"VariableDeclaration")};Be.parseWhileStatement=function(B){return this.next(),B.test=this.parseParenExpression(),this.labels.push(Gr),B.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(B,"WhileStatement")};Be.parseWithStatement=function(B){if(this.strict)this.raise(this.start,"'with' in strict mode");return this.next(),B.object=this.parseParenExpression(),B.body=this.parseStatement("with"),this.finishNode(B,"WithStatement")};Be.parseEmptyStatement=function(B){return this.next(),this.finishNode(B,"EmptyStatement")};Be.parseLabeledStatement=function(B,G,ie,se){for(var de=0,ke=this.labels;de<ke.length;de+=1){var Pe=ke[de];if(Pe.name===G)this.raise(ie.start,"Label '"+G+"' is already declared")}var _e=this.type.isLoop?"loop":this.type===Ne._switch?"switch":null;for(var Ae=this.labels.length-1;Ae>=0;Ae--){var De=this.labels[Ae];if(De.statementStart===B.start)De.statementStart=this.start,De.kind=_e;else break}return this.labels.push({name:G,kind:_e,statementStart:this.start}),B.body=this.parseStatement(se?se.indexOf("label")===-1?se+"label":se:"label"),this.labels.pop(),B.label=ie,this.finishNode(B,"LabeledStatement")};Be.parseExpressionStatement=function(B,G){return B.expression=G,this.semicolon(),this.finishNode(B,"ExpressionStatement")};Be.parseBlock=function(B,G,ie){if(B===void 0)B=!0;if(G===void 0)G=this.startNode();if(G.body=[],this.expect(Ne.braceL),B)this.enterScope(0);while(this.type!==Ne.braceR){var se=this.parseStatement(null);G.body.push(se)}if(ie)this.strict=!1;if(this.next(),B)this.exitScope();return this.finishNode(G,"BlockStatement")};Be.parseFor=function(B,G){return B.init=G,this.expect(Ne.semi),B.test=this.type===Ne.semi?null:this.parseExpression(),this.expect(Ne.semi),B.update=this.type===Ne.parenR?null:this.parseExpression(),this.expect(Ne.parenR),B.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(B,"ForStatement")};Be.parseForIn=function(B,G){var ie=this.type===Ne._in;if(this.next(),G.type==="VariableDeclaration"&&G.declarations[0].init!=null&&(!ie||this.options.ecmaVersion<8||this.strict||G.kind!=="var"||G.declarations[0].id.type!=="Identifier"))this.raise(G.start,(ie?"for-in":"for-of")+" loop variable declaration may not have an initializer");return B.left=G,B.right=ie?this.parseExpression():this.parseMaybeAssign(),this.expect(Ne.parenR),B.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(B,ie?"ForInStatement":"ForOfStatement")};Be.parseVar=function(B,G,ie,se){B.declarations=[],B.kind=ie;for(;;){var de=this.startNode();if(this.parseVarId(de,ie),this.eat(Ne.eq))de.init=this.parseMaybeAssign(G);else if(!se&&ie==="const"&&!(this.type===Ne._in||this.options.ecmaVersion>=6&&this.isContextual("of")))this.unexpected();else if(!se&&(ie==="using"||ie==="await using")&&this.options.ecmaVersion>=17&&this.type!==Ne._in&&!this.isContextual("of"))this.raise(this.lastTokEnd,"Missing initializer in "+ie+" declaration");else if(!se&&de.id.type!=="Identifier"&&!(G&&(this.type===Ne._in||this.isContextual("of"))))this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value");else de.init=null;if(B.declarations.push(this.finishNode(de,"VariableDeclarator")),!this.eat(Ne.comma))break}return B};Be.parseVarId=function(B,G){B.id=G==="using"||G==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(B.id,G==="var"?jr:kt,!1)};var cn=1,Ir=2,js=4;Be.parseFunction=function(B,G,ie,se,de){if(this.initFunction(B),this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!se){if(this.type===Ne.star&&G&Ir)this.unexpected();B.generator=this.eat(Ne.star)}if(this.options.ecmaVersion>=8)B.async=!!se;if(G&cn){if(B.id=G&js&&this.type!==Ne.name?null:this.parseIdent(),B.id&&!(G&Ir))this.checkLValSimple(B.id,this.strict||B.generator||B.async?this.treatFunctionsAsVar?jr:kt:Fs)}var ke=this.yieldPos,Pe=this.awaitPos,_e=this.awaitIdentPos;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Vr(B.async,B.generator)),!(G&cn))B.id=this.type===Ne.name?this.parseIdent():null;return this.parseFunctionParams(B),this.parseFunctionBody(B,ie,!1,de),this.yieldPos=ke,this.awaitPos=Pe,this.awaitIdentPos=_e,this.finishNode(B,G&cn?"FunctionDeclaration":"FunctionExpression")};Be.parseFunctionParams=function(B){this.expect(Ne.parenL),B.params=this.parseBindingList(Ne.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};Be.parseClass=function(B,G){this.next();var ie=this.strict;this.strict=!0,this.parseClassId(B,G),this.parseClassSuper(B);var se=this.enterClassBody(),de=this.startNode(),ke=!1;de.body=[],this.expect(Ne.braceL);while(this.type!==Ne.braceR){var Pe=this.parseClassElement(B.superClass!==null);if(Pe){if(de.body.push(Pe),Pe.type==="MethodDefinition"&&Pe.kind==="constructor"){if(ke)this.raiseRecoverable(Pe.start,"Duplicate constructor in the same class");ke=!0}else if(Pe.key&&Pe.key.type==="PrivateIdentifier"&&np(se,Pe))this.raiseRecoverable(Pe.key.start,"Identifier '#"+Pe.key.name+"' has already been declared")}}return this.strict=ie,this.next(),B.body=this.finishNode(de,"ClassBody"),this.exitClassBody(),this.finishNode(B,G?"ClassDeclaration":"ClassExpression")};Be.parseClassElement=function(B){if(this.eat(Ne.semi))return null;var G=this.options.ecmaVersion,ie=this.startNode(),se="",de=!1,ke=!1,Pe="method",_e=!1;if(this.eatContextual("static")){if(G>=13&&this.eat(Ne.braceL))return this.parseClassStaticBlock(ie),ie;if(this.isClassElementNameStart()||this.type===Ne.star)_e=!0;else se="static"}if(ie.static=_e,!se&&G>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===Ne.star)&&!this.canInsertSemicolon())ke=!0;else se="async";if(!se&&(G>=9||!ke)&&this.eat(Ne.star))de=!0;if(!se&&!ke&&!de){var Ae=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())Pe=Ae;else se=Ae}if(se)ie.computed=!1,ie.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),ie.key.name=se,this.finishNode(ie.key,"Identifier");else this.parseClassElementName(ie);if(G<13||this.type===Ne.parenL||Pe!=="method"||de||ke){var De=!ie.static&&Rn(ie,"constructor"),Re=De&&B;if(De&&Pe!=="method")this.raise(ie.key.start,"Constructor can't have get/set modifier");ie.kind=De?"constructor":Pe,this.parseClassMethod(ie,de,ke,Re)}else this.parseClassField(ie);return ie};Be.isClassElementNameStart=function(){return this.type===Ne.name||this.type===Ne.privateId||this.type===Ne.num||this.type===Ne.string||this.type===Ne.bracketL||this.type.keyword};Be.parseClassElementName=function(B){if(this.type===Ne.privateId){if(this.value==="constructor")this.raise(this.start,"Classes can't have an element named '#constructor'");B.computed=!1,B.key=this.parsePrivateIdent()}else this.parsePropertyName(B)};Be.parseClassMethod=function(B,G,ie,se){var de=B.key;if(B.kind==="constructor"){if(G)this.raise(de.start,"Constructor can't be a generator");if(ie)this.raise(de.start,"Constructor can't be an async method")}else if(B.static&&Rn(B,"prototype"))this.raise(de.start,"Classes may not have a static property named prototype");var ke=B.value=this.parseMethod(G,ie,se);if(B.kind==="get"&&ke.params.length!==0)this.raiseRecoverable(ke.start,"getter should have no params");if(B.kind==="set"&&ke.params.length!==1)this.raiseRecoverable(ke.start,"setter should have exactly one param");if(B.kind==="set"&&ke.params[0].type==="RestElement")this.raiseRecoverable(ke.params[0].start,"Setter cannot use rest params");return this.finishNode(B,"MethodDefinition")};Be.parseClassField=function(B){if(Rn(B,"constructor"))this.raise(B.key.start,"Classes can't have a field named 'constructor'");else if(B.static&&Rn(B,"prototype"))this.raise(B.key.start,"Classes can't have a static field named 'prototype'");if(this.eat(Ne.eq))this.enterScope(pn|Ln),B.value=this.parseMaybeAssign(),this.exitScope();else B.value=null;return this.semicolon(),this.finishNode(B,"PropertyDefinition")};Be.parseClassStaticBlock=function(B){B.body=[];var G=this.labels;this.labels=[],this.enterScope(Mt|Ln);while(this.type!==Ne.braceR){var ie=this.parseStatement(null);B.body.push(ie)}return this.next(),this.exitScope(),this.labels=G,this.finishNode(B,"StaticBlock")};Be.parseClassId=function(B,G){if(this.type===Ne.name){if(B.id=this.parseIdent(),G)this.checkLValSimple(B.id,kt,!1)}else{if(G===!0)this.unexpected();B.id=null}};Be.parseClassSuper=function(B){B.superClass=this.eat(Ne._extends)?this.parseExprSubscripts(null,!1):null};Be.enterClassBody=function(){var B={declared:Object.create(null),used:[]};return this.privateNameStack.push(B),B.declared};Be.exitClassBody=function(){var B=this.privateNameStack.pop(),{declared:G,used:ie}=B;if(!this.options.checkPrivateFields)return;var se=this.privateNameStack.length,de=se===0?null:this.privateNameStack[se-1];for(var ke=0;ke<ie.length;++ke){var Pe=ie[ke];if(!Jt(G,Pe.name))if(de)de.used.push(Pe);else this.raiseRecoverable(Pe.start,"Private field '#"+Pe.name+"' must be declared in an enclosing class")}};function np(B,G){var ie=G.key.name,se=B[ie],de="true";if(G.type==="MethodDefinition"&&(G.kind==="get"||G.kind==="set"))de=(G.static?"s":"i")+G.kind;if(se==="iget"&&de==="iset"||se==="iset"&&de==="iget"||se==="sget"&&de==="sset"||se==="sset"&&de==="sget")return B[ie]="true",!1;else if(!se)return B[ie]=de,!1;else return!0}function Rn(B,G){var{computed:ie,key:se}=B;return!ie&&(se.type==="Identifier"&&se.name===G||se.type==="Literal"&&se.value===G)}Be.parseExportAllDeclaration=function(B,G){if(this.options.ecmaVersion>=11)if(this.eatContextual("as"))B.exported=this.parseModuleExportName(),this.checkExport(G,B.exported,this.lastTokStart);else B.exported=null;if(this.expectContextual("from"),this.type!==Ne.string)this.unexpected();if(B.source=this.parseExprAtom(),this.options.ecmaVersion>=16)B.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(B,"ExportAllDeclaration")};Be.parseExport=function(B,G){if(this.next(),this.eat(Ne.star))return this.parseExportAllDeclaration(B,G);if(this.eat(Ne._default))return this.checkExport(G,"default",this.lastTokStart),B.declaration=this.parseExportDefaultDeclaration(),this.finishNode(B,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(B.declaration=this.parseExportDeclaration(B),B.declaration.type==="VariableDeclaration")this.checkVariableExport(G,B.declaration.declarations);else this.checkExport(G,B.declaration.id,B.declaration.id.start);if(B.specifiers=[],B.source=null,this.options.ecmaVersion>=16)B.attributes=[]}else{if(B.declaration=null,B.specifiers=this.parseExportSpecifiers(G),this.eatContextual("from")){if(this.type!==Ne.string)this.unexpected();if(B.source=this.parseExprAtom(),this.options.ecmaVersion>=16)B.attributes=this.parseWithClause()}else{for(var ie=0,se=B.specifiers;ie<se.length;ie+=1){var de=se[ie];if(this.checkUnreserved(de.local),this.checkLocalExport(de.local),de.local.type==="Literal")this.raise(de.local.start,"A string literal cannot be used as an exported binding without `from`.")}if(B.source=null,this.options.ecmaVersion>=16)B.attributes=[]}this.semicolon()}return this.finishNode(B,"ExportNamedDeclaration")};Be.parseExportDeclaration=function(B){return this.parseStatement(null)};Be.parseExportDefaultDeclaration=function(){var B;if(this.type===Ne._function||(B=this.isAsyncFunction())){var G=this.startNode();if(this.next(),B)this.next();return this.parseFunction(G,cn|js,!1,B)}else if(this.type===Ne._class){var ie=this.startNode();return this.parseClass(ie,"nullableID")}else{var se=this.parseMaybeAssign();return this.semicolon(),se}};Be.checkExport=function(B,G,ie){if(!B)return;if(typeof G!=="string")G=G.type==="Identifier"?G.name:G.value;if(Jt(B,G))this.raiseRecoverable(ie,"Duplicate export '"+G+"'");B[G]=!0};Be.checkPatternExport=function(B,G){var ie=G.type;if(ie==="Identifier")this.checkExport(B,G,G.start);else if(ie==="ObjectPattern")for(var se=0,de=G.properties;se<de.length;se+=1){var ke=de[se];this.checkPatternExport(B,ke)}else if(ie==="ArrayPattern")for(var Pe=0,_e=G.elements;Pe<_e.length;Pe+=1){var Ae=_e[Pe];if(Ae)this.checkPatternExport(B,Ae)}else if(ie==="Property")this.checkPatternExport(B,G.value);else if(ie==="AssignmentPattern")this.checkPatternExport(B,G.left);else if(ie==="RestElement")this.checkPatternExport(B,G.argument)};Be.checkVariableExport=function(B,G){if(!B)return;for(var ie=0,se=G;ie<se.length;ie+=1){var de=se[ie];this.checkPatternExport(B,de.id)}};Be.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};Be.parseExportSpecifier=function(B){var G=this.startNode();return G.local=this.parseModuleExportName(),G.exported=this.eatContextual("as")?this.parseModuleExportName():G.local,this.checkExport(B,G.exported,G.exported.start),this.finishNode(G,"ExportSpecifier")};Be.parseExportSpecifiers=function(B){var G=[],ie=!0;this.expect(Ne.braceL);while(!this.eat(Ne.braceR)){if(!ie){if(this.expect(Ne.comma),this.afterTrailingComma(Ne.braceR))break}else ie=!1;G.push(this.parseExportSpecifier(B))}return G};Be.parseImport=function(B){if(this.next(),this.type===Ne.string)B.specifiers=tp,B.source=this.parseExprAtom();else B.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),B.source=this.type===Ne.string?this.parseExprAtom():this.unexpected();if(this.options.ecmaVersion>=16)B.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(B,"ImportDeclaration")};Be.parseImportSpecifier=function(){var B=this.startNode();if(B.imported=this.parseModuleExportName(),this.eatContextual("as"))B.local=this.parseIdent();else this.checkUnreserved(B.imported),B.local=B.imported;return this.checkLValSimple(B.local,kt),this.finishNode(B,"ImportSpecifier")};Be.parseImportDefaultSpecifier=function(){var B=this.startNode();return B.local=this.parseIdent(),this.checkLValSimple(B.local,kt),this.finishNode(B,"ImportDefaultSpecifier")};Be.parseImportNamespaceSpecifier=function(){var B=this.startNode();return this.next(),this.expectContextual("as"),B.local=this.parseIdent(),this.checkLValSimple(B.local,kt),this.finishNode(B,"ImportNamespaceSpecifier")};Be.parseImportSpecifiers=function(){var B=[],G=!0;if(this.type===Ne.name){if(B.push(this.parseImportDefaultSpecifier()),!this.eat(Ne.comma))return B}if(this.type===Ne.star)return B.push(this.parseImportNamespaceSpecifier()),B;this.expect(Ne.braceL);while(!this.eat(Ne.braceR)){if(!G){if(this.expect(Ne.comma),this.afterTrailingComma(Ne.braceR))break}else G=!1;B.push(this.parseImportSpecifier())}return B};Be.parseWithClause=function(){var B=[];if(!this.eat(Ne._with))return B;this.expect(Ne.braceL);var G={},ie=!0;while(!this.eat(Ne.braceR)){if(!ie){if(this.expect(Ne.comma),this.afterTrailingComma(Ne.braceR))break}else ie=!1;var se=this.parseImportAttribute(),de=se.key.type==="Identifier"?se.key.name:se.key.value;if(Jt(G,de))this.raiseRecoverable(se.key.start,"Duplicate attribute key '"+de+"'");G[de]=!0,B.push(se)}return B};Be.parseImportAttribute=function(){var B=this.startNode();if(B.key=this.type===Ne.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(Ne.colon),this.type!==Ne.string)this.unexpected();return B.value=this.parseExprAtom(),this.finishNode(B,"ImportAttribute")};Be.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===Ne.string){var B=this.parseLiteral(this.value);if(Ju.test(B.value))this.raise(B.start,"An export name cannot include a lone surrogate.");return B}return this.parseIdent(!0)};Be.adaptDirectivePrologue=function(B){for(var G=0;G<B.length&&this.isDirectiveCandidate(B[G]);++G)B[G].directive=B[G].expression.raw.slice(1,-1)};Be.isDirectiveCandidate=function(B){return this.options.ecmaVersion>=5&&B.type==="ExpressionStatement"&&B.expression.type==="Literal"&&typeof B.expression.value==="string"&&(this.input[B.start]==='"'||this.input[B.start]==="'")};var ft=r.prototype;ft.toAssignable=function(B,G,ie){if(this.options.ecmaVersion>=6&&B)switch(B.type){case"Identifier":if(this.inAsync&&B.name==="await")this.raise(B.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":if(B.type="ObjectPattern",ie)this.checkPatternErrors(ie,!0);for(var se=0,de=B.properties;se<de.length;se+=1){var ke=de[se];if(this.toAssignable(ke,G),ke.type==="RestElement"&&(ke.argument.type==="ArrayPattern"||ke.argument.type==="ObjectPattern"))this.raise(ke.argument.start,"Unexpected token")}break;case"Property":if(B.kind!=="init")this.raise(B.key.start,"Object pattern can't contain getter or setter");this.toAssignable(B.value,G);break;case"ArrayExpression":if(B.type="ArrayPattern",ie)this.checkPatternErrors(ie,!0);this.toAssignableList(B.elements,G);break;case"SpreadElement":if(B.type="RestElement",this.toAssignable(B.argument,G),B.argument.type==="AssignmentPattern")this.raise(B.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":if(B.operator!=="=")this.raise(B.left.end,"Only '=' operator can be used for specifying default value.");B.type="AssignmentPattern",delete B.operator,this.toAssignable(B.left,G);break;case"ParenthesizedExpression":this.toAssignable(B.expression,G,ie);break;case"ChainExpression":this.raiseRecoverable(B.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!G)break;default:this.raise(B.start,"Assigning to rvalue")}else if(ie)this.checkPatternErrors(ie,!0);return B};ft.toAssignableList=function(B,G){var ie=B.length;for(var se=0;se<ie;se++){var de=B[se];if(de)this.toAssignable(de,G)}if(ie){var ke=B[ie-1];if(this.options.ecmaVersion===6&&G&&ke&&ke.type==="RestElement"&&ke.argument.type!=="Identifier")this.unexpected(ke.argument.start)}return B};ft.parseSpread=function(B){var G=this.startNode();return this.next(),G.argument=this.parseMaybeAssign(!1,B),this.finishNode(G,"SpreadElement")};ft.parseRestBinding=function(){var B=this.startNode();if(this.next(),this.options.ecmaVersion===6&&this.type!==Ne.name)this.unexpected();return B.argument=this.parseBindingAtom(),this.finishNode(B,"RestElement")};ft.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case Ne.bracketL:var B=this.startNode();return this.next(),B.elements=this.parseBindingList(Ne.bracketR,!0,!0),this.finishNode(B,"ArrayPattern");case Ne.braceL:return this.parseObj(!0)}return this.parseIdent()};ft.parseBindingList=function(B,G,ie,se){var de=[],ke=!0;while(!this.eat(B)){if(ke)ke=!1;else this.expect(Ne.comma);if(G&&this.type===Ne.comma)de.push(null);else if(ie&&this.afterTrailingComma(B))break;else if(this.type===Ne.ellipsis){var Pe=this.parseRestBinding();if(this.parseBindingListItem(Pe),de.push(Pe),this.type===Ne.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");this.expect(B);break}else de.push(this.parseAssignableListItem(se))}return de};ft.parseAssignableListItem=function(B){var G=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(G),G};ft.parseBindingListItem=function(B){return B};ft.parseMaybeDefault=function(B,G,ie){if(ie=ie||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(Ne.eq))return ie;var se=this.startNodeAt(B,G);return se.left=ie,se.right=this.parseMaybeAssign(),this.finishNode(se,"AssignmentPattern")};ft.checkLValSimple=function(B,G,ie){if(G===void 0)G=Dn;var se=G!==Dn;switch(B.type){case"Identifier":if(this.strict&&this.reservedWordsStrictBind.test(B.name))this.raiseRecoverable(B.start,(se?"Binding ":"Assigning to ")+B.name+" in strict mode");if(se){if(G===kt&&B.name==="let")this.raiseRecoverable(B.start,"let is disallowed as a lexically bound name");if(ie){if(Jt(ie,B.name))this.raiseRecoverable(B.start,"Argument name clash");ie[B.name]=!0}if(G!==Vs)this.declareName(B.name,G,B.start)}break;case"ChainExpression":this.raiseRecoverable(B.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(se)this.raiseRecoverable(B.start,"Binding member expression");break;case"ParenthesizedExpression":if(se)this.raiseRecoverable(B.start,"Binding parenthesized expression");return this.checkLValSimple(B.expression,G,ie);default:this.raise(B.start,(se?"Binding":"Assigning to")+" rvalue")}};ft.checkLValPattern=function(B,G,ie){if(G===void 0)G=Dn;switch(B.type){case"ObjectPattern":for(var se=0,de=B.properties;se<de.length;se+=1){var ke=de[se];this.checkLValInnerPattern(ke,G,ie)}break;case"ArrayPattern":for(var Pe=0,_e=B.elements;Pe<_e.length;Pe+=1){var Ae=_e[Pe];if(Ae)this.checkLValInnerPattern(Ae,G,ie)}break;default:this.checkLValSimple(B,G,ie)}};ft.checkLValInnerPattern=function(B,G,ie){if(G===void 0)G=Dn;switch(B.type){case"Property":this.checkLValInnerPattern(B.value,G,ie);break;case"AssignmentPattern":this.checkLValPattern(B.left,G,ie);break;case"RestElement":this.checkLValPattern(B.argument,G,ie);break;default:this.checkLValPattern(B,G,ie)}};var ut=function(G,ie,se,de,ke){this.token=G,this.isExpr=!!ie,this.preserveSpace=!!se,this.override=de,this.generator=!!ke},qe={b_stat:new ut("{",!1),b_expr:new ut("{",!0),b_tmpl:new ut("${",!1),p_stat:new ut("(",!1),p_expr:new ut("(",!0),q_tmpl:new ut("`",!0,!0,function(B){return B.tryReadTemplateToken()}),f_stat:new ut("function",!1),f_expr:new ut("function",!0),f_expr_gen:new ut("function",!0,!1,null,!0),f_gen:new ut("function",!1,!1,null,!0)},Yt=r.prototype;Yt.initialContext=function(){return[qe.b_stat]};Yt.curContext=function(){return this.context[this.context.length-1]};Yt.braceIsBlock=function(B){var G=this.curContext();if(G===qe.f_expr||G===qe.f_stat)return!0;if(B===Ne.colon&&(G===qe.b_stat||G===qe.b_expr))return!G.isExpr;if(B===Ne._return||B===Ne.name&&this.exprAllowed)return nt.test(this.input.slice(this.lastTokEnd,this.start));if(B===Ne._else||B===Ne.semi||B===Ne.eof||B===Ne.parenR||B===Ne.arrow)return!0;if(B===Ne.braceL)return G===qe.b_stat;if(B===Ne._var||B===Ne._const||B===Ne.name)return!1;return!this.exprAllowed};Yt.inGeneratorContext=function(){for(var B=this.context.length-1;B>=1;B--){var G=this.context[B];if(G.token==="function")return G.generator}return!1};Yt.updateContext=function(B){var G,ie=this.type;if(ie.keyword&&B===Ne.dot)this.exprAllowed=!1;else if(G=ie.updateContext)G.call(this,B);else this.exprAllowed=ie.beforeExpr};Yt.overrideContext=function(B){if(this.curContext()!==B)this.context[this.context.length-1]=B};Ne.parenR.updateContext=Ne.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var B=this.context.pop();if(B===qe.b_stat&&this.curContext().token==="function")B=this.context.pop();this.exprAllowed=!B.isExpr};Ne.braceL.updateContext=function(B){this.context.push(this.braceIsBlock(B)?qe.b_stat:qe.b_expr),this.exprAllowed=!0};Ne.dollarBraceL.updateContext=function(){this.context.push(qe.b_tmpl),this.exprAllowed=!0};Ne.parenL.updateContext=function(B){var G=B===Ne._if||B===Ne._for||B===Ne._with||B===Ne._while;this.context.push(G?qe.p_stat:qe.p_expr),this.exprAllowed=!0};Ne.incDec.updateContext=function(){};Ne._function.updateContext=Ne._class.updateContext=function(B){if(B.beforeExpr&&B!==Ne._else&&!(B===Ne.semi&&this.curContext()!==qe.p_stat)&&!(B===Ne._return&&nt.test(this.input.slice(this.lastTokEnd,this.start)))&&!((B===Ne.colon||B===Ne.braceL)&&this.curContext()===qe.b_stat))this.context.push(qe.f_expr);else this.context.push(qe.f_stat);this.exprAllowed=!1};Ne.colon.updateContext=function(){if(this.curContext().token==="function")this.context.pop();this.exprAllowed=!0};Ne.backQuote.updateContext=function(){if(this.curContext()===qe.q_tmpl)this.context.pop();else this.context.push(qe.q_tmpl);this.exprAllowed=!1};Ne.star.updateContext=function(B){if(B===Ne._function){var G=this.context.length-1;if(this.context[G]===qe.f_expr)this.context[G]=qe.f_expr_gen;else this.context[G]=qe.f_gen}this.exprAllowed=!0};Ne.name.updateContext=function(B){var G=!1;if(this.options.ecmaVersion>=6&&B!==Ne.dot){if(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())G=!0}this.exprAllowed=G};var Ge=r.prototype;Ge.checkPropClash=function(B,G,ie){if(this.options.ecmaVersion>=9&&B.type==="SpreadElement")return;if(this.options.ecmaVersion>=6&&(B.computed||B.method||B.shorthand))return;var se=B.key,de;switch(se.type){case"Identifier":de=se.name;break;case"Literal":de=String(se.value);break;default:return}var ke=B.kind;if(this.options.ecmaVersion>=6){if(de==="__proto__"&&ke==="init"){if(G.proto)if(ie){if(ie.doubleProto<0)ie.doubleProto=se.start}else this.raiseRecoverable(se.start,"Redefinition of __proto__ property");G.proto=!0}return}de="$"+de;var Pe=G[de];if(Pe){var _e;if(ke==="init")_e=this.strict&&Pe.init||Pe.get||Pe.set;else _e=Pe.init||Pe[ke];if(_e)this.raiseRecoverable(se.start,"Redefinition of property")}else Pe=G[de]={init:!1,get:!1,set:!1};Pe[ke]=!0};Ge.parseExpression=function(B,G){var ie=this;return this.catchStackOverflow(function(){var{start:se,startLoc:de}=ie,ke=ie.parseMaybeAssign(B,G);if(ie.type===Ne.comma){var Pe=ie.startNodeAt(se,de);Pe.expressions=[ke];while(ie.eat(Ne.comma))Pe.expressions.push(ie.parseMaybeAssign(B,G));return ie.finishNode(Pe,"SequenceExpression")}return ke})};Ge.parseMaybeAssign=function(B,G,ie){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(B);else this.exprAllowed=!1;var se=!1,de=-1,ke=-1,Pe=-1;if(G)de=G.parenthesizedAssign,ke=G.trailingComma,Pe=G.doubleProto,G.parenthesizedAssign=G.trailingComma=-1;else G=new Fn,se=!0;var _e=this.start,Ae=this.startLoc;if(this.type===Ne.parenL||this.type===Ne.name)this.potentialArrowAt=this.start,this.potentialArrowInForAwait=B==="await";var De=this.parseMaybeConditional(B,G);if(ie)De=ie.call(this,De,_e,Ae);if(this.type.isAssign){var Re=this.startNodeAt(_e,Ae);if(Re.operator=this.value,this.type===Ne.eq)De=this.toAssignable(De,!1,G);if(!se)G.parenthesizedAssign=G.trailingComma=G.doubleProto=-1;if(G.shorthandAssign>=De.start)G.shorthandAssign=-1;if(this.type===Ne.eq)this.checkLValPattern(De);else this.checkLValSimple(De);if(Re.left=De,this.next(),Re.right=this.parseMaybeAssign(B),Pe>-1)G.doubleProto=Pe;return this.finishNode(Re,"AssignmentExpression")}else if(se)this.checkExpressionErrors(G,!0);if(de>-1)G.parenthesizedAssign=de;if(ke>-1)G.trailingComma=ke;return De};Ge.parseMaybeConditional=function(B,G){var ie=this.start,se=this.startLoc,de=this.parseExprOps(B,G);if(this.checkExpressionErrors(G))return de;if(!(de.type==="ArrowFunctionExpression"&&de.start===ie)&&this.eat(Ne.question)){var ke=this.startNodeAt(ie,se);return ke.test=de,ke.consequent=this.parseMaybeAssign(),this.expect(Ne.colon),ke.alternate=this.parseMaybeAssign(B),this.finishNode(ke,"ConditionalExpression")}return de};Ge.parseExprOps=function(B,G){var ie=this.start,se=this.startLoc,de=this.parseMaybeUnary(G,!1,!1,B);if(this.checkExpressionErrors(G))return de;return de.start===ie&&de.type==="ArrowFunctionExpression"?de:this.parseExprOp(de,ie,se,-1,B)};Ge.parseExprOp=function(B,G,ie,se,de){var ke=this.type.binop;if(ke!=null&&(!de||this.type!==Ne._in)){if(ke>se){var Pe=this.type===Ne.logicalOR||this.type===Ne.logicalAND,_e=this.type===Ne.coalesce;if(_e)ke=Ne.logicalAND.binop;var Ae=this.value;this.next();var De=this.start,Re=this.startLoc,Oe=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,de),De,Re,ke,de),Ie=this.buildBinary(G,ie,B,Oe,Ae,Pe||_e);if(Pe&&this.type===Ne.coalesce||_e&&(this.type===Ne.logicalOR||this.type===Ne.logicalAND))this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");return this.parseExprOp(Ie,G,ie,se,de)}}return B};Ge.buildBinary=function(B,G,ie,se,de,ke){if(se.type==="PrivateIdentifier")this.raise(se.start,"Private identifier can only be left side of binary expression");var Pe=this.startNodeAt(B,G);return Pe.left=ie,Pe.operator=de,Pe.right=se,this.finishNode(Pe,ke?"LogicalExpression":"BinaryExpression")};Ge.parseMaybeUnary=function(B,G,ie,se){var de=this.start,ke=this.startLoc,Pe;if(this.isContextual("await")&&this.canAwait)Pe=this.parseAwait(se),G=!0;else if(this.type.prefix){var _e=this.startNode(),Ae=this.type===Ne.incDec;if(_e.operator=this.value,_e.prefix=!0,this.next(),_e.argument=this.parseMaybeUnary(null,!0,Ae,se),this.checkExpressionErrors(B,!0),Ae)this.checkLValSimple(_e.argument);else if(this.strict&&_e.operator==="delete"&&Gs(_e.argument))this.raiseRecoverable(_e.start,"Deleting local variable in strict mode");else if(_e.operator==="delete"&&$r(_e.argument))this.raiseRecoverable(_e.start,"Private fields can not be deleted");else G=!0;Pe=this.finishNode(_e,Ae?"UpdateExpression":"UnaryExpression")}else if(!G&&this.type===Ne.privateId){if((se||this.privateNameStack.length===0)&&this.options.checkPrivateFields)this.unexpected();if(Pe=this.parsePrivateIdent(),this.type!==Ne._in)this.unexpected()}else{if(Pe=this.parseExprSubscripts(B,se),this.checkExpressionErrors(B))return Pe;while(this.type.postfix&&!this.canInsertSemicolon()){var De=this.startNodeAt(de,ke);De.operator=this.value,De.prefix=!1,De.argument=Pe,this.checkLValSimple(Pe),this.next(),Pe=this.finishNode(De,"UpdateExpression")}}if(!ie&&!(Pe.type==="ArrowFunctionExpression"&&Pe.start===de)&&this.eat(Ne.starstar))if(G)this.unexpected(this.lastTokStart);else return this.buildBinary(de,ke,Pe,this.parseMaybeUnary(null,!1,!1,se),"**",!1);else return Pe};function Gs(B){return B.type==="Identifier"||B.type==="ParenthesizedExpression"&&Gs(B.expression)}function $r(B){return B.type==="MemberExpression"&&B.property.type==="PrivateIdentifier"||B.type==="ChainExpression"&&$r(B.expression)||B.type==="ParenthesizedExpression"&&$r(B.expression)}Ge.parseExprSubscripts=function(B,G){var ie=this.start,se=this.startLoc,de=this.parseExprAtom(B,G);if(de.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return de;var ke=this.parseSubscripts(de,ie,se,!1,G);if(B&&ke.type==="MemberExpression"){if(B.parenthesizedAssign>=ke.start)B.parenthesizedAssign=-1;if(B.parenthesizedBind>=ke.start)B.parenthesizedBind=-1;if(B.trailingComma>=ke.start)B.trailingComma=-1}return ke};Ge.parseSubscripts=function(B,G,ie,se,de){var ke=this.options.ecmaVersion>=8&&B.type==="Identifier"&&B.name==="async"&&this.lastTokEnd===B.end&&!this.canInsertSemicolon()&&B.end-B.start===5&&this.potentialArrowAt===B.start,Pe=!1;while(!0){var _e=this.parseSubscript(B,G,ie,se,ke,Pe,de);if(_e.optional)Pe=!0;if(_e===B||_e.type==="ArrowFunctionExpression"){if(Pe){var Ae=this.startNodeAt(G,ie);Ae.expression=_e,_e=this.finishNode(Ae,"ChainExpression")}return _e}B=_e}};Ge.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(Ne.arrow)};Ge.parseSubscriptAsyncArrow=function(B,G,ie,se){return this.parseArrowExpression(this.startNodeAt(B,G),ie,!0,se)};Ge.parseSubscript=function(B,G,ie,se,de,ke,Pe){var _e=this.options.ecmaVersion>=11,Ae=_e&&this.eat(Ne.questionDot);if(se&&Ae)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var De=this.eat(Ne.bracketL);if(De||Ae&&this.type!==Ne.parenL&&this.type!==Ne.backQuote||this.eat(Ne.dot)){var Re=this.startNodeAt(G,ie);if(Re.object=B,De)Re.property=this.parseExpression(),this.expect(Ne.bracketR);else if(this.type===Ne.privateId&&B.type!=="Super")Re.property=this.parsePrivateIdent();else Re.property=this.parseIdent(this.options.allowReserved!=="never");if(Re.computed=!!De,_e)Re.optional=Ae;B=this.finishNode(Re,"MemberExpression")}else if(!se&&this.eat(Ne.parenL)){var Oe=new Fn,Ie=this.yieldPos,$e=this.awaitPos,Me=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var Le=this.parseExprList(Ne.parenR,this.options.ecmaVersion>=8,!1,Oe);if(de&&!Ae&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(Oe,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");return this.yieldPos=Ie,this.awaitPos=$e,this.awaitIdentPos=Me,this.parseSubscriptAsyncArrow(G,ie,Le,Pe)}this.checkExpressionErrors(Oe,!0),this.yieldPos=Ie||this.yieldPos,this.awaitPos=$e||this.awaitPos,this.awaitIdentPos=Me||this.awaitIdentPos;var Ve=this.startNodeAt(G,ie);if(Ve.callee=B,Ve.arguments=Le,_e)Ve.optional=Ae;B=this.finishNode(Ve,"CallExpression")}else if(this.type===Ne.backQuote){if(Ae||ke)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var We=this.startNodeAt(G,ie);We.tag=B,We.quasi=this.parseTemplate({isTagged:!0}),B=this.finishNode(We,"TaggedTemplateExpression")}return B};Ge.parseExprAtom=function(B,G,ie){if(this.type===Ne.slash)this.readRegexp();var se,de=this.potentialArrowAt===this.start;switch(this.type){case Ne._super:if(!this.allowSuper)this.raise(this.start,"'super' keyword outside a method");if(se=this.startNode(),this.next(),this.type===Ne.parenL&&!this.allowDirectSuper)this.raise(se.start,"super() call outside constructor of a subclass");if(this.type!==Ne.dot&&this.type!==Ne.bracketL&&this.type!==Ne.parenL)this.unexpected();return this.finishNode(se,"Super");case Ne._this:return se=this.startNode(),this.next(),this.finishNode(se,"ThisExpression");case Ne.name:var ke=this.start,Pe=this.startLoc,_e=this.containsEsc,Ae=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!_e&&Ae.name==="async"&&!this.canInsertSemicolon()&&this.eat(Ne._function))return this.overrideContext(qe.f_expr),this.parseFunction(this.startNodeAt(ke,Pe),0,!1,!0,G);if(de&&!this.canInsertSemicolon()){if(this.eat(Ne.arrow))return this.parseArrowExpression(this.startNodeAt(ke,Pe),[Ae],!1,G);if(this.options.ecmaVersion>=8&&Ae.name==="async"&&this.type===Ne.name&&!_e&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(Ae=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(Ne.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(ke,Pe),[Ae],!0,G)}}return Ae;case Ne.regexp:var De=this.value;return se=this.parseLiteral(De.value),se.regex={pattern:De.pattern,flags:De.flags},se;case Ne.num:case Ne.string:return this.parseLiteral(this.value);case Ne._null:case Ne._true:case Ne._false:return se=this.startNode(),se.value=this.type===Ne._null?null:this.type===Ne._true,se.raw=this.type.keyword,this.next(),this.finishNode(se,"Literal");case Ne.parenL:var Re=this.start,Oe=this.parseParenAndDistinguishExpression(de,G);if(B){if(B.parenthesizedAssign<0&&!this.isSimpleAssignTarget(Oe))B.parenthesizedAssign=Re;if(B.parenthesizedBind<0)B.parenthesizedBind=Re}return Oe;case Ne.bracketL:return se=this.startNode(),this.next(),se.elements=this.parseExprList(Ne.bracketR,!0,!0,B),this.finishNode(se,"ArrayExpression");case Ne.braceL:return this.overrideContext(qe.b_expr),this.parseObj(!1,B);case Ne._function:return se=this.startNode(),this.next(),this.parseFunction(se,0);case Ne._class:return this.parseClass(this.startNode(),!1);case Ne._new:return this.parseNew();case Ne.backQuote:return this.parseTemplate();case Ne._import:if(this.options.ecmaVersion>=11)return this.parseExprImport(ie);else return this.unexpected();default:return this.parseExprAtomDefault()}};Ge.parseExprAtomDefault=function(){this.unexpected()};Ge.parseExprImport=function(B){var G=this.startNode();if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword import");if(this.next(),this.type===Ne.parenL&&!B)return this.parseDynamicImport(G);else if(this.type===Ne.dot){var ie=this.startNodeAt(G.start,G.loc&&G.loc.start);return ie.name="import",G.meta=this.finishNode(ie,"Identifier"),this.parseImportMeta(G)}else this.unexpected()};Ge.parseDynamicImport=function(B){if(this.next(),B.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)if(!this.eat(Ne.parenR))if(this.expect(Ne.comma),!this.afterTrailingComma(Ne.parenR)){if(B.options=this.parseMaybeAssign(),!this.eat(Ne.parenR)){if(this.expect(Ne.comma),!this.afterTrailingComma(Ne.parenR))this.unexpected()}}else B.options=null;else B.options=null;else if(!this.eat(Ne.parenR)){var G=this.start;if(this.eat(Ne.comma)&&this.eat(Ne.parenR))this.raiseRecoverable(G,"Trailing comma is not allowed in import()");else this.unexpected(G)}return this.finishNode(B,"ImportExpression")};Ge.parseImportMeta=function(B){this.next();var G=this.containsEsc;if(B.property=this.parseIdent(!0),B.property.name!=="meta")this.raiseRecoverable(B.property.start,"The only valid meta property for import is 'import.meta'");if(G)this.raiseRecoverable(B.start,"'import.meta' must not contain escaped characters");if(this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere)this.raiseRecoverable(B.start,"Cannot use 'import.meta' outside a module");return this.finishNode(B,"MetaProperty")};Ge.parseLiteral=function(B){var G=this.startNode();if(G.value=B,G.raw=this.input.slice(this.start,this.end),G.raw.charCodeAt(G.raw.length-1)===110)G.bigint=G.value!=null?G.value.toString():G.raw.slice(0,-1).replace(/_/g,"");return this.next(),this.finishNode(G,"Literal")};Ge.parseParenExpression=function(){this.expect(Ne.parenL);var B=this.parseExpression();return this.expect(Ne.parenR),B};Ge.shouldParseArrow=function(B){return!this.canInsertSemicolon()};Ge.parseParenAndDistinguishExpression=function(B,G){var ie=this.start,se=this.startLoc,de,ke=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var Pe=this.start,_e=this.startLoc,Ae=[],De=!0,Re=!1,Oe=new Fn,Ie=this.yieldPos,$e=this.awaitPos,Me;this.yieldPos=0,this.awaitPos=0;while(this.type!==Ne.parenR)if(De?De=!1:this.expect(Ne.comma),ke&&this.afterTrailingComma(Ne.parenR,!0)){Re=!0;break}else if(this.type===Ne.ellipsis){if(Me=this.start,Ae.push(this.parseParenItem(this.parseRestBinding())),this.type===Ne.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else Ae.push(this.parseMaybeAssign(!1,Oe,this.parseParenItem));var Le=this.lastTokEnd,Ve=this.lastTokEndLoc;if(this.expect(Ne.parenR),B&&this.shouldParseArrow(Ae)&&this.eat(Ne.arrow))return this.checkPatternErrors(Oe,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=Ie,this.awaitPos=$e,this.parseParenArrowList(ie,se,Ae,G);if(!Ae.length||Re)this.unexpected(this.lastTokStart);if(Me)this.unexpected(Me);if(this.checkExpressionErrors(Oe,!0),this.yieldPos=Ie||this.yieldPos,this.awaitPos=$e||this.awaitPos,Ae.length>1)de=this.startNodeAt(Pe,_e),de.expressions=Ae,this.finishNodeAt(de,"SequenceExpression",Le,Ve);else de=Ae[0]}else de=this.parseParenExpression();if(this.options.preserveParens){var We=this.startNodeAt(ie,se);return We.expression=de,this.finishNode(We,"ParenthesizedExpression")}else return de};Ge.parseParenItem=function(B){return B};Ge.parseParenArrowList=function(B,G,ie,se){return this.parseArrowExpression(this.startNodeAt(B,G),ie,!1,se)};var rp=[];Ge.parseNew=function(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");var B=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===Ne.dot){var G=this.startNodeAt(B.start,B.loc&&B.loc.start);G.name="new",B.meta=this.finishNode(G,"Identifier"),this.next();var ie=this.containsEsc;if(B.property=this.parseIdent(!0),B.property.name!=="target")this.raiseRecoverable(B.property.start,"The only valid meta property for new is 'new.target'");if(ie)this.raiseRecoverable(B.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(B.start,"'new.target' can only be used in functions and class static block");return this.finishNode(B,"MetaProperty")}var se=this.start,de=this.startLoc;if(B.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),se,de,!0,!1),B.callee.type==="Super")this.raiseRecoverable(se,"Invalid use of 'super'");if(this.eat(Ne.parenL))B.arguments=this.parseExprList(Ne.parenR,this.options.ecmaVersion>=8,!1);else B.arguments=rp;return this.finishNode(B,"NewExpression")};Ge.parseTemplateElement=function(B){var G=B.isTagged,ie=this.startNode();if(this.type===Ne.invalidTemplate){if(!G)this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal");ie.value={raw:this.value.replace(/\r\n?/g,`
179
+ `),cooked:null}}else ie.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
180
+ `),cooked:this.value};return this.next(),ie.tail=this.type===Ne.backQuote,this.finishNode(ie,"TemplateElement")};Ge.parseTemplate=function(B){if(B===void 0)B={};var G=B.isTagged;if(G===void 0)G=!1;var ie=this.startNode();this.next(),ie.expressions=[];var se=this.parseTemplateElement({isTagged:G});ie.quasis=[se];while(!se.tail){if(this.type===Ne.eof)this.raise(this.pos,"Unterminated template literal");this.expect(Ne.dollarBraceL),ie.expressions.push(this.parseExpression()),this.expect(Ne.braceR),ie.quasis.push(se=this.parseTemplateElement({isTagged:G}))}return this.next(),this.finishNode(ie,"TemplateLiteral")};Ge.isAsyncProp=function(B){return!B.computed&&B.key.type==="Identifier"&&B.key.name==="async"&&(this.type===Ne.name||this.type===Ne.num||this.type===Ne.string||this.type===Ne.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===Ne.star)&&!nt.test(this.input.slice(this.lastTokEnd,this.start))};Ge.parseObj=function(B,G){var ie=this.startNode(),se=!0,de={};ie.properties=[],this.next();while(!this.eat(Ne.braceR)){if(!se){if(this.expect(Ne.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(Ne.braceR))break}else se=!1;var ke=this.parseProperty(B,G);if(!B)this.checkPropClash(ke,de,G);ie.properties.push(ke)}return this.finishNode(ie,B?"ObjectPattern":"ObjectExpression")};Ge.parseProperty=function(B,G){var ie=this.startNode(),se,de,ke,Pe;if(this.options.ecmaVersion>=9&&this.eat(Ne.ellipsis)){if(B){if(ie.argument=this.parseIdent(!1),this.type===Ne.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");return this.finishNode(ie,"RestElement")}if(ie.argument=this.parseMaybeAssign(!1,G),this.type===Ne.comma&&G&&G.trailingComma<0)G.trailingComma=this.start;return this.finishNode(ie,"SpreadElement")}if(this.options.ecmaVersion>=6){if(ie.method=!1,ie.shorthand=!1,B||G)ke=this.start,Pe=this.startLoc;if(!B)se=this.eat(Ne.star)}var _e=this.containsEsc;if(this.parsePropertyName(ie),!B&&!_e&&this.options.ecmaVersion>=8&&!se&&this.isAsyncProp(ie))de=!0,se=this.options.ecmaVersion>=9&&this.eat(Ne.star),this.parsePropertyName(ie);else de=!1;return this.parsePropertyValue(ie,B,se,de,ke,Pe,G,_e),this.finishNode(ie,"Property")};Ge.parseGetterSetter=function(B){var G=B.key.name;this.parsePropertyName(B),B.value=this.parseMethod(!1),B.kind=G;var ie=B.kind==="get"?0:1;if(B.value.params.length!==ie){var se=B.value.start;if(B.kind==="get")this.raiseRecoverable(se,"getter should have no params");else this.raiseRecoverable(se,"setter should have exactly one param")}else if(B.kind==="set"&&B.value.params[0].type==="RestElement")this.raiseRecoverable(B.value.params[0].start,"Setter cannot use rest params")};Ge.parsePropertyValue=function(B,G,ie,se,de,ke,Pe,_e){if((ie||se)&&this.type===Ne.colon)this.unexpected();if(this.eat(Ne.colon))B.value=G?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,Pe),B.kind="init";else if(this.options.ecmaVersion>=6&&this.type===Ne.parenL){if(G)this.unexpected();B.method=!0,B.value=this.parseMethod(ie,se),B.kind="init"}else if(!G&&!_e&&this.options.ecmaVersion>=5&&!B.computed&&B.key.type==="Identifier"&&(B.key.name==="get"||B.key.name==="set")&&(this.type!==Ne.comma&&this.type!==Ne.braceR&&this.type!==Ne.eq)){if(ie||se)this.unexpected();this.parseGetterSetter(B)}else if(this.options.ecmaVersion>=6&&!B.computed&&B.key.type==="Identifier"){if(ie||se)this.unexpected();if(this.checkUnreserved(B.key),B.key.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=de;if(G)B.value=this.parseMaybeDefault(de,ke,this.copyNode(B.key));else if(this.type===Ne.eq&&Pe){if(Pe.shorthandAssign<0)Pe.shorthandAssign=this.start;B.value=this.parseMaybeDefault(de,ke,this.copyNode(B.key))}else B.value=this.copyNode(B.key);B.kind="init",B.shorthand=!0}else this.unexpected()};Ge.parsePropertyName=function(B){if(this.options.ecmaVersion>=6)if(this.eat(Ne.bracketL))return B.computed=!0,B.key=this.parseMaybeAssign(),this.expect(Ne.bracketR),B.key;else B.computed=!1;return B.key=this.type===Ne.num||this.type===Ne.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};Ge.initFunction=function(B){if(B.id=null,this.options.ecmaVersion>=6)B.generator=B.expression=!1;if(this.options.ecmaVersion>=8)B.async=!1};Ge.parseMethod=function(B,G,ie){var se=this.startNode(),de=this.yieldPos,ke=this.awaitPos,Pe=this.awaitIdentPos;if(this.initFunction(se),this.options.ecmaVersion>=6)se.generator=B;if(this.options.ecmaVersion>=8)se.async=!!G;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Vr(G,se.generator)|Ln|(ie?Ls:0)),this.expect(Ne.parenL),se.params=this.parseBindingList(Ne.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(se,!1,!0,!1),this.yieldPos=de,this.awaitPos=ke,this.awaitIdentPos=Pe,this.finishNode(se,"FunctionExpression")};Ge.parseArrowExpression=function(B,G,ie,se){var de=this.yieldPos,ke=this.awaitPos,Pe=this.awaitIdentPos;if(this.enterScope(Vr(ie,!1)|Br),this.initFunction(B),this.options.ecmaVersion>=8)B.async=!!ie;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,B.params=this.toAssignableList(G,!0),this.parseFunctionBody(B,!0,!1,se),this.yieldPos=de,this.awaitPos=ke,this.awaitIdentPos=Pe,this.finishNode(B,"ArrowFunctionExpression")};Ge.parseFunctionBody=function(B,G,ie,se){var de=G&&this.type!==Ne.braceL,ke=this.strict,Pe=!1;if(de)B.body=this.parseMaybeAssign(se),B.expression=!0,this.checkParams(B,!1);else{var _e=this.options.ecmaVersion>=7&&!this.isSimpleParamList(B.params);if(!ke||_e){if(Pe=this.strictDirective(this.end),Pe&&_e)this.raiseRecoverable(B.start,"Illegal 'use strict' directive in function with non-simple parameter list")}var Ae=this.labels;if(this.labels=[],Pe)this.strict=!0;if(this.checkParams(B,!ke&&!Pe&&!G&&!ie&&this.isSimpleParamList(B.params)),this.strict&&B.id)this.checkLValSimple(B.id,Vs);B.body=this.parseBlock(!1,void 0,Pe&&!ke),B.expression=!1,this.adaptDirectivePrologue(B.body.body),this.labels=Ae}this.exitScope()};Ge.isSimpleParamList=function(B){for(var G=0,ie=B;G<ie.length;G+=1){var se=ie[G];if(se.type!=="Identifier")return!1}return!0};Ge.checkParams=function(B,G){var ie=Object.create(null);for(var se=0,de=B.params;se<de.length;se+=1){var ke=de[se];this.checkLValInnerPattern(ke,jr,G?null:ie)}};Ge.parseExprList=function(B,G,ie,se){var de=[],ke=!0;while(!this.eat(B)){if(!ke){if(this.expect(Ne.comma),G&&this.afterTrailingComma(B))break}else ke=!1;var Pe=void 0;if(ie&&this.type===Ne.comma)Pe=null;else if(this.type===Ne.ellipsis){if(Pe=this.parseSpread(se),se&&this.type===Ne.comma&&se.trailingComma<0)se.trailingComma=this.start}else Pe=this.parseMaybeAssign(!1,se);de.push(Pe)}return de};Ge.checkUnreserved=function(B){var{start:G,end:ie,name:se}=B;if(this.inGenerator&&se==="yield")this.raiseRecoverable(G,"Cannot use 'yield' as identifier inside a generator");if(this.inAsync&&se==="await")this.raiseRecoverable(G,"Cannot use 'await' as identifier inside an async function");if(!(this.currentThisScope().flags&Mn)&&se==="arguments")this.raiseRecoverable(G,"Cannot use 'arguments' in class field initializer");if(this.inClassStaticBlock&&(se==="arguments"||se==="await"))this.raise(G,"Cannot use "+se+" in class static initialization block");if(this.keywords.test(se))this.raise(G,"Unexpected keyword '"+se+"'");if(this.options.ecmaVersion<6&&this.input.slice(G,ie).indexOf("\\")!==-1)return;var de=this.strict?this.reservedWordsStrict:this.reservedWords;if(de.test(se)){if(!this.inAsync&&se==="await")this.raiseRecoverable(G,"Cannot use keyword 'await' outside an async function");this.raiseRecoverable(G,"The keyword '"+se+"' is reserved")}};Ge.parseIdent=function(B){var G=this.parseIdentNode();if(this.next(!!B),this.finishNode(G,"Identifier"),!B){if(this.checkUnreserved(G),G.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=G.start}return G};Ge.parseIdentNode=function(){var B=this.startNode();if(this.type===Ne.name)B.name=this.value;else if(this.type.keyword){if(B.name=this.type.keyword,(B.name==="class"||B.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46))this.context.pop();this.type=Ne.name}else this.unexpected();return B};Ge.parsePrivateIdent=function(){var B=this.startNode();if(this.type===Ne.privateId)B.name=this.value;else this.unexpected();if(this.next(),this.finishNode(B,"PrivateIdentifier"),this.options.checkPrivateFields)if(this.privateNameStack.length===0)this.raise(B.start,"Private field '#"+B.name+"' must be declared in an enclosing class");else this.privateNameStack[this.privateNameStack.length-1].used.push(B);return B};Ge.parseYield=function(B){if(!this.yieldPos)this.yieldPos=this.start;var G=this.startNode();if(this.next(),this.type===Ne.semi||this.canInsertSemicolon()||this.type!==Ne.star&&!this.type.startsExpr)G.delegate=!1,G.argument=null;else G.delegate=this.eat(Ne.star),G.argument=this.parseMaybeAssign(B);return this.finishNode(G,"YieldExpression")};Ge.parseAwait=function(B){if(!this.awaitPos)this.awaitPos=this.start;var G=this.startNode();return this.next(),G.argument=this.parseMaybeUnary(null,!0,!1,B),this.finishNode(G,"AwaitExpression")};var In=r.prototype;In.raise=function(B,G){var ie=Mr(this.input,B);if(G+=" ("+ie.line+":"+ie.column+")",this.sourceFile)G+=" in "+this.sourceFile;var se=SyntaxError(G);throw se.pos=B,se.loc=ie,se.raisedAt=this.pos,se};In.raiseRecoverable=In.raise;In.curPosition=function(){if(this.options.locations)return new qt(this.curLine,this.pos-this.lineStart)};var At=r.prototype,ip=function(G){this.flags=G,this.var=[],this.lexical=[],this.functions=[]};At.enterScope=function(B){this.scopeStack.push(new ip(B))};At.exitScope=function(){this.scopeStack.pop()};At.treatFunctionsAsVarInScope=function(B){return B.flags&Lt||!this.inModule&&B.flags&$t};At.declareName=function(B,G,ie){var se=!1;if(G===kt){var de=this.currentScope();if(se=de.lexical.indexOf(B)>-1||de.functions.indexOf(B)>-1||de.var.indexOf(B)>-1,de.lexical.push(B),this.inModule&&de.flags&$t)delete this.undefinedExports[B]}else if(G===Bs){var ke=this.currentScope();ke.lexical.push(B)}else if(G===Fs){var Pe=this.currentScope();if(this.treatFunctionsAsVar)se=Pe.lexical.indexOf(B)>-1;else se=Pe.lexical.indexOf(B)>-1||Pe.var.indexOf(B)>-1;Pe.functions.push(B)}else for(var _e=this.scopeStack.length-1;_e>=0;--_e){var Ae=this.scopeStack[_e];if(Ae.lexical.indexOf(B)>-1&&!(Ae.flags&Os&&Ae.lexical[0]===B)||!this.treatFunctionsAsVarInScope(Ae)&&Ae.functions.indexOf(B)>-1){se=!0;break}if(Ae.var.push(B),this.inModule&&Ae.flags&$t)delete this.undefinedExports[B];if(Ae.flags&Mn)break}if(se)this.raiseRecoverable(ie,"Identifier '"+B+"' has already been declared")};At.checkLocalExport=function(B){if(this.scopeStack[0].lexical.indexOf(B.name)===-1&&this.scopeStack[0].var.indexOf(B.name)===-1)this.undefinedExports[B.name]=B};At.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};At.currentVarScope=function(){for(var B=this.scopeStack.length-1;;B--){var G=this.scopeStack[B];if(G.flags&(Mn|pn|Mt))return G}};At.currentThisScope=function(){for(var B=this.scopeStack.length-1;;B--){var G=this.scopeStack[B];if(G.flags&(Mn|pn|Mt)&&!(G.flags&Br))return G}};var ln=function(G,ie,se){if(this.type="",this.start=ie,this.end=0,G.options.locations)this.loc=new un(G,se);if(G.options.directSourceFile)this.sourceFile=G.options.directSourceFile;if(G.options.ranges)this.range=[ie,0]},fn=r.prototype;fn.startNode=function(){return new ln(this,this.start,this.startLoc)};fn.startNodeAt=function(B,G){return new ln(this,B,G)};function Ws(B,G,ie,se){if(B.type=G,B.end=ie,this.options.locations)B.loc.end=se;if(this.options.ranges)B.range[1]=ie;return B}fn.finishNode=function(B,G){return Ws.call(this,B,G,this.lastTokEnd,this.lastTokEndLoc)};fn.finishNodeAt=function(B,G,ie,se){return Ws.call(this,B,G,ie,se)};fn.copyNode=function(B){var G=new ln(this,B.start,this.startLoc);for(var ie in B)G[ie]=B[ie];return G};var sp="Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz",Us="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Hs=Us+" Extended_Pictographic",Ks=Hs,zs=Ks+" EBase EComp EMod EPres ExtPict",Xs=zs,op=Xs,ap={9:Us,10:Hs,11:Ks,12:zs,13:Xs,14:op},cp="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",up={9:"",10:"",11:"",12:"",13:"",14:cp},_s="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",qs="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Js=qs+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Ys=Js+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Qs=Ys+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Zs=Qs+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",pp=Zs+" "+sp,lp={9:qs,10:Js,11:Ys,12:Qs,13:Zs,14:pp},eo={};function fp(B){var G=eo[B]={binary:_t(ap[B]+" "+_s),binaryOfStrings:_t(up[B]),nonBinary:{General_Category:_t(_s),Script:_t(lp[B])}};G.nonBinary.Script_Extensions=G.nonBinary.Script,G.nonBinary.gc=G.nonBinary.General_Category,G.nonBinary.sc=G.nonBinary.Script,G.nonBinary.scx=G.nonBinary.Script_Extensions}for(an=0,Tn=[9,10,11,12,13,14];an<Tn.length;an+=1)Or=Tn[an],fp(Or);var Or,an,Tn,Fe=r.prototype,$n=function(G,ie){this.parent=G,this.base=ie||this};$n.prototype.separatedFrom=function(G){for(var ie=this;ie;ie=ie.parent)for(var se=G;se;se=se.parent)if(ie.base===se.base&&ie!==se)return!0;return!1};$n.prototype.sibling=function(){return new $n(this.parent,this.base)};var vt=function(G){this.parser=G,this.validFlags="gim"+(G.options.ecmaVersion>=6?"uy":"")+(G.options.ecmaVersion>=9?"s":"")+(G.options.ecmaVersion>=13?"d":"")+(G.options.ecmaVersion>=15?"v":""),this.unicodeProperties=eo[G.options.ecmaVersion>=14?14:G.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};vt.prototype.reset=function(G,ie,se){var de=se.indexOf("v")!==-1,ke=se.indexOf("u")!==-1;if(this.start=G|0,this.source=ie+"",this.flags=se,de&&this.parser.options.ecmaVersion>=15)this.switchU=!0,this.switchV=!0,this.switchN=!0;else this.switchU=ke&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=ke&&this.parser.options.ecmaVersion>=9};vt.prototype.raise=function(G){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+G)};vt.prototype.at=function(G,ie){if(ie===void 0)ie=!1;var se=this.source,de=se.length;if(G>=de)return-1;var ke=se.charCodeAt(G);if(!(ie||this.switchU)||ke<=55295||ke>=57344||G+1>=de)return ke;var Pe=se.charCodeAt(G+1);return Pe>=56320&&Pe<=57343?(ke<<10)+Pe-56613888:ke};vt.prototype.nextIndex=function(G,ie){if(ie===void 0)ie=!1;var se=this.source,de=se.length;if(G>=de)return de;var ke=se.charCodeAt(G),Pe;if(!(ie||this.switchU)||ke<=55295||ke>=57344||G+1>=de||(Pe=se.charCodeAt(G+1))<56320||Pe>57343)return G+1;return G+2};vt.prototype.current=function(G){if(G===void 0)G=!1;return this.at(this.pos,G)};vt.prototype.lookahead=function(G){if(G===void 0)G=!1;return this.at(this.nextIndex(this.pos,G),G)};vt.prototype.advance=function(G){if(G===void 0)G=!1;this.pos=this.nextIndex(this.pos,G)};vt.prototype.eat=function(G,ie){if(ie===void 0)ie=!1;if(this.current(ie)===G)return this.advance(ie),!0;return!1};vt.prototype.eatChars=function(G,ie){if(ie===void 0)ie=!1;var se=this.pos;for(var de=0,ke=G;de<ke.length;de+=1){var Pe=ke[de],_e=this.at(se,ie);if(_e===-1||_e!==Pe)return!1;se=this.nextIndex(se,ie)}return this.pos=se,!0};Fe.validateRegExpFlags=function(B){var{validFlags:G,flags:ie}=B,se=!1,de=!1;for(var ke=0;ke<ie.length;ke++){var Pe=ie.charAt(ke);if(G.indexOf(Pe)===-1)this.raise(B.start,"Invalid regular expression flag");if(ie.indexOf(Pe,ke+1)>-1)this.raise(B.start,"Duplicate regular expression flag");if(Pe==="u")se=!0;if(Pe==="v")de=!0}if(this.options.ecmaVersion>=15&&se&&de)this.raise(B.start,"Invalid regular expression flag")};function dp(B){for(var G in B)return!0;return!1}Fe.validateRegExpPattern=function(B){if(this.regexp_pattern(B),!B.switchN&&this.options.ecmaVersion>=9&&dp(B.groupNames))B.switchN=!0,this.regexp_pattern(B)};Fe.regexp_pattern=function(B){if(B.pos=0,B.lastIntValue=0,B.lastStringValue="",B.lastAssertionIsQuantifiable=!1,B.numCapturingParens=0,B.maxBackReference=0,B.groupNames=Object.create(null),B.backReferenceNames.length=0,B.branchID=null,this.regexp_disjunction(B),B.pos!==B.source.length){if(B.eat(41))B.raise("Unmatched ')'");if(B.eat(93)||B.eat(125))B.raise("Lone quantifier brackets")}if(B.maxBackReference>B.numCapturingParens)B.raise("Invalid escape");for(var G=0,ie=B.backReferenceNames;G<ie.length;G+=1){var se=ie[G];if(!B.groupNames[se])B.raise("Invalid named capture referenced")}};Fe.regexp_disjunction=function(B){var G=this.options.ecmaVersion>=16;if(G)B.branchID=new $n(B.branchID,null);this.regexp_alternative(B);while(B.eat(124)){if(G)B.branchID=B.branchID.sibling();this.regexp_alternative(B)}if(G)B.branchID=B.branchID.parent;if(this.regexp_eatQuantifier(B,!0))B.raise("Nothing to repeat");if(B.eat(123))B.raise("Lone quantifier brackets")};Fe.regexp_alternative=function(B){while(B.pos<B.source.length&&this.regexp_eatTerm(B));};Fe.regexp_eatTerm=function(B){if(this.regexp_eatAssertion(B)){if(B.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(B)){if(B.switchU)B.raise("Invalid quantifier")}return!0}if(B.switchU?this.regexp_eatAtom(B):this.regexp_eatExtendedAtom(B))return this.regexp_eatQuantifier(B),!0;return!1};Fe.regexp_eatAssertion=function(B){var G=B.pos;if(B.lastAssertionIsQuantifiable=!1,B.eat(94)||B.eat(36))return!0;if(B.eat(92)){if(B.eat(66)||B.eat(98))return!0;B.pos=G}if(B.eat(40)&&B.eat(63)){var ie=!1;if(this.options.ecmaVersion>=9)ie=B.eat(60);if(B.eat(61)||B.eat(33)){if(this.regexp_disjunction(B),!B.eat(41))B.raise("Unterminated group");return B.lastAssertionIsQuantifiable=!ie,!0}}return B.pos=G,!1};Fe.regexp_eatQuantifier=function(B,G){if(G===void 0)G=!1;if(this.regexp_eatQuantifierPrefix(B,G))return B.eat(63),!0;return!1};Fe.regexp_eatQuantifierPrefix=function(B,G){return B.eat(42)||B.eat(43)||B.eat(63)||this.regexp_eatBracedQuantifier(B,G)};Fe.regexp_eatBracedQuantifier=function(B,G){var ie=B.pos;if(B.eat(123)){var se=0,de=-1;if(this.regexp_eatDecimalDigits(B)){if(se=B.lastIntValue,B.eat(44)&&this.regexp_eatDecimalDigits(B))de=B.lastIntValue;if(B.eat(125)){if(de!==-1&&de<se&&!G)B.raise("numbers out of order in {} quantifier");return!0}}if(B.switchU&&!G)B.raise("Incomplete quantifier");B.pos=ie}return!1};Fe.regexp_eatAtom=function(B){return this.regexp_eatPatternCharacters(B)||B.eat(46)||this.regexp_eatReverseSolidusAtomEscape(B)||this.regexp_eatCharacterClass(B)||this.regexp_eatUncapturingGroup(B)||this.regexp_eatCapturingGroup(B)};Fe.regexp_eatReverseSolidusAtomEscape=function(B){var G=B.pos;if(B.eat(92)){if(this.regexp_eatAtomEscape(B))return!0;B.pos=G}return!1};Fe.regexp_eatUncapturingGroup=function(B){var G=B.pos;if(B.eat(40)){if(B.eat(63)){if(this.options.ecmaVersion>=16){var ie=this.regexp_eatModifiers(B),se=B.eat(45);if(ie||se){for(var de=0;de<ie.length;de++){var ke=ie.charAt(de);if(ie.indexOf(ke,de+1)>-1)B.raise("Duplicate regular expression modifiers")}if(se){var Pe=this.regexp_eatModifiers(B);if(!ie&&!Pe&&B.current()===58)B.raise("Invalid regular expression modifiers");for(var _e=0;_e<Pe.length;_e++){var Ae=Pe.charAt(_e);if(Pe.indexOf(Ae,_e+1)>-1||ie.indexOf(Ae)>-1)B.raise("Duplicate regular expression modifiers")}}}}if(B.eat(58)){if(this.regexp_disjunction(B),B.eat(41))return!0;B.raise("Unterminated group")}}B.pos=G}return!1};Fe.regexp_eatCapturingGroup=function(B){if(B.eat(40)){if(this.options.ecmaVersion>=9)this.regexp_groupSpecifier(B);else if(B.current()===63)B.raise("Invalid group");if(this.regexp_disjunction(B),B.eat(41))return B.numCapturingParens+=1,!0;B.raise("Unterminated group")}return!1};Fe.regexp_eatModifiers=function(B){var G="",ie=0;while((ie=B.current())!==-1&&hp(ie))G+=Et(ie),B.advance();return G};function hp(B){return B===105||B===109||B===115}Fe.regexp_eatExtendedAtom=function(B){return B.eat(46)||this.regexp_eatReverseSolidusAtomEscape(B)||this.regexp_eatCharacterClass(B)||this.regexp_eatUncapturingGroup(B)||this.regexp_eatCapturingGroup(B)||this.regexp_eatInvalidBracedQuantifier(B)||this.regexp_eatExtendedPatternCharacter(B)};Fe.regexp_eatInvalidBracedQuantifier=function(B){if(this.regexp_eatBracedQuantifier(B,!0))B.raise("Nothing to repeat");return!1};Fe.regexp_eatSyntaxCharacter=function(B){var G=B.current();if(to(G))return B.lastIntValue=G,B.advance(),!0;return!1};function to(B){return B===36||B>=40&&B<=43||B===46||B===63||B>=91&&B<=94||B>=123&&B<=125}Fe.regexp_eatPatternCharacters=function(B){var G=B.pos,ie=0;while((ie=B.current())!==-1&&!to(ie))B.advance();return B.pos!==G};Fe.regexp_eatExtendedPatternCharacter=function(B){var G=B.current();if(G!==-1&&G!==36&&!(G>=40&&G<=43)&&G!==46&&G!==63&&G!==91&&G!==94&&G!==124)return B.advance(),!0;return!1};Fe.regexp_groupSpecifier=function(B){if(B.eat(63)){if(!this.regexp_eatGroupName(B))B.raise("Invalid group");var G=this.options.ecmaVersion>=16,ie=B.groupNames[B.lastStringValue];if(ie)if(G)for(var se=0,de=ie;se<de.length;se+=1){var ke=de[se];if(!ke.separatedFrom(B.branchID))B.raise("Duplicate capture group name")}else B.raise("Duplicate capture group name");if(G)(ie||(B.groupNames[B.lastStringValue]=[])).push(B.branchID);else B.groupNames[B.lastStringValue]=!0}};Fe.regexp_eatGroupName=function(B){if(B.lastStringValue="",B.eat(60)){if(this.regexp_eatRegExpIdentifierName(B)&&B.eat(62))return!0;B.raise("Invalid capture group name")}return!1};Fe.regexp_eatRegExpIdentifierName=function(B){if(B.lastStringValue="",this.regexp_eatRegExpIdentifierStart(B)){B.lastStringValue+=Et(B.lastIntValue);while(this.regexp_eatRegExpIdentifierPart(B))B.lastStringValue+=Et(B.lastIntValue);return!0}return!1};Fe.regexp_eatRegExpIdentifierStart=function(B){var G=B.pos,ie=this.options.ecmaVersion>=11,se=B.current(ie);if(B.advance(ie),se===92&&this.regexp_eatRegExpUnicodeEscapeSequence(B,ie))se=B.lastIntValue;if(mp(se))return B.lastIntValue=se,!0;return B.pos=G,!1};function mp(B){return a(B,!0)||B===36||B===95}Fe.regexp_eatRegExpIdentifierPart=function(B){var G=B.pos,ie=this.options.ecmaVersion>=11,se=B.current(ie);if(B.advance(ie),se===92&&this.regexp_eatRegExpUnicodeEscapeSequence(B,ie))se=B.lastIntValue;if(gp(se))return B.lastIntValue=se,!0;return B.pos=G,!1};function gp(B){return c(B,!0)||B===36||B===95||B===8204||B===8205}Fe.regexp_eatAtomEscape=function(B){if(this.regexp_eatBackReference(B)||this.regexp_eatCharacterClassEscape(B)||this.regexp_eatCharacterEscape(B)||B.switchN&&this.regexp_eatKGroupName(B))return!0;if(B.switchU){if(B.current()===99)B.raise("Invalid unicode escape");B.raise("Invalid escape")}return!1};Fe.regexp_eatBackReference=function(B){var G=B.pos;if(this.regexp_eatDecimalEscape(B)){var ie=B.lastIntValue;if(B.switchU){if(ie>B.maxBackReference)B.maxBackReference=ie;return!0}if(ie<=B.numCapturingParens)return!0;B.pos=G}return!1};Fe.regexp_eatKGroupName=function(B){if(B.eat(107)){if(this.regexp_eatGroupName(B))return B.backReferenceNames.push(B.lastStringValue),!0;B.raise("Invalid named reference")}return!1};Fe.regexp_eatCharacterEscape=function(B){return this.regexp_eatControlEscape(B)||this.regexp_eatCControlLetter(B)||this.regexp_eatZero(B)||this.regexp_eatHexEscapeSequence(B)||this.regexp_eatRegExpUnicodeEscapeSequence(B,!1)||!B.switchU&&this.regexp_eatLegacyOctalEscapeSequence(B)||this.regexp_eatIdentityEscape(B)};Fe.regexp_eatCControlLetter=function(B){var G=B.pos;if(B.eat(99)){if(this.regexp_eatControlLetter(B))return!0;B.pos=G}return!1};Fe.regexp_eatZero=function(B){if(B.current()===48&&!Bn(B.lookahead()))return B.lastIntValue=0,B.advance(),!0;return!1};Fe.regexp_eatControlEscape=function(B){var G=B.current();if(G===116)return B.lastIntValue=9,B.advance(),!0;if(G===110)return B.lastIntValue=10,B.advance(),!0;if(G===118)return B.lastIntValue=11,B.advance(),!0;if(G===102)return B.lastIntValue=12,B.advance(),!0;if(G===114)return B.lastIntValue=13,B.advance(),!0;return!1};Fe.regexp_eatControlLetter=function(B){var G=B.current();if(no(G))return B.lastIntValue=G%32,B.advance(),!0;return!1};function no(B){return B>=65&&B<=90||B>=97&&B<=122}Fe.regexp_eatRegExpUnicodeEscapeSequence=function(B,G){if(G===void 0)G=!1;var ie=B.pos,se=G||B.switchU;if(B.eat(117)){if(this.regexp_eatFixedHexDigits(B,4)){var de=B.lastIntValue;if(se&&de>=55296&&de<=56319){var ke=B.pos;if(B.eat(92)&&B.eat(117)&&this.regexp_eatFixedHexDigits(B,4)){var Pe=B.lastIntValue;if(Pe>=56320&&Pe<=57343)return B.lastIntValue=(de-55296)*1024+(Pe-56320)+65536,!0}B.pos=ke,B.lastIntValue=de}return!0}if(se&&B.eat(123)&&this.regexp_eatHexDigits(B)&&B.eat(125)&&xp(B.lastIntValue))return!0;if(se)B.raise("Invalid unicode escape");B.pos=ie}return!1};function xp(B){return B>=0&&B<=1114111}Fe.regexp_eatIdentityEscape=function(B){if(B.switchU){if(this.regexp_eatSyntaxCharacter(B))return!0;if(B.eat(47))return B.lastIntValue=47,!0;return!1}var G=B.current();if(G!==99&&(!B.switchN||G!==107))return B.lastIntValue=G,B.advance(),!0;return!1};Fe.regexp_eatDecimalEscape=function(B){B.lastIntValue=0;var G=B.current();if(G>=49&&G<=57){do B.lastIntValue=10*B.lastIntValue+(G-48),B.advance();while((G=B.current())>=48&&G<=57);return!0}return!1};var ro=0,St=1,pt=2;Fe.regexp_eatCharacterClassEscape=function(B){var G=B.current();if(yp(G))return B.lastIntValue=-1,B.advance(),St;var ie=!1;if(B.switchU&&this.options.ecmaVersion>=9&&((ie=G===80)||G===112)){B.lastIntValue=-1,B.advance();var se;if(B.eat(123)&&(se=this.regexp_eatUnicodePropertyValueExpression(B))&&B.eat(125)){if(ie&&se===pt)B.raise("Invalid property name");return se}B.raise("Invalid property name")}return ro};function yp(B){return B===100||B===68||B===115||B===83||B===119||B===87}Fe.regexp_eatUnicodePropertyValueExpression=function(B){var G=B.pos;if(this.regexp_eatUnicodePropertyName(B)&&B.eat(61)){var ie=B.lastStringValue;if(this.regexp_eatUnicodePropertyValue(B)){var se=B.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(B,ie,se),St}}if(B.pos=G,this.regexp_eatLoneUnicodePropertyNameOrValue(B)){var de=B.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(B,de)}return ro};Fe.regexp_validateUnicodePropertyNameAndValue=function(B,G,ie){if(!Jt(B.unicodeProperties.nonBinary,G))B.raise("Invalid property name");if(!B.unicodeProperties.nonBinary[G].test(ie))B.raise("Invalid property value")};Fe.regexp_validateUnicodePropertyNameOrValue=function(B,G){if(B.unicodeProperties.binary.test(G))return St;if(B.switchV&&B.unicodeProperties.binaryOfStrings.test(G))return pt;B.raise("Invalid property name")};Fe.regexp_eatUnicodePropertyName=function(B){var G=0;B.lastStringValue="";while(io(G=B.current()))B.lastStringValue+=Et(G),B.advance();return B.lastStringValue!==""};function io(B){return no(B)||B===95}Fe.regexp_eatUnicodePropertyValue=function(B){var G=0;B.lastStringValue="";while(vp(G=B.current()))B.lastStringValue+=Et(G),B.advance();return B.lastStringValue!==""};function vp(B){return io(B)||Bn(B)}Fe.regexp_eatLoneUnicodePropertyNameOrValue=function(B){return this.regexp_eatUnicodePropertyValue(B)};Fe.regexp_eatCharacterClass=function(B){if(B.eat(91)){var G=B.eat(94),ie=this.regexp_classContents(B);if(!B.eat(93))B.raise("Unterminated character class");if(G&&ie===pt)B.raise("Negated character class may contain strings");return!0}return!1};Fe.regexp_classContents=function(B){if(B.current()===93)return St;if(B.switchV)return this.regexp_classSetExpression(B);return this.regexp_nonEmptyClassRanges(B),St};Fe.regexp_nonEmptyClassRanges=function(B){while(this.regexp_eatClassAtom(B)){var G=B.lastIntValue;if(B.eat(45)&&this.regexp_eatClassAtom(B)){var ie=B.lastIntValue;if(B.switchU&&(G===-1||ie===-1))B.raise("Invalid character class");if(G!==-1&&ie!==-1&&G>ie)B.raise("Range out of order in character class")}}};Fe.regexp_eatClassAtom=function(B){var G=B.pos;if(B.eat(92)){if(this.regexp_eatClassEscape(B))return!0;if(B.switchU){var ie=B.current();if(ie===99||ao(ie))B.raise("Invalid class escape");B.raise("Invalid escape")}B.pos=G}var se=B.current();if(se!==93)return B.lastIntValue=se,B.advance(),!0;return!1};Fe.regexp_eatClassEscape=function(B){var G=B.pos;if(B.eat(98))return B.lastIntValue=8,!0;if(B.switchU&&B.eat(45))return B.lastIntValue=45,!0;if(!B.switchU&&B.eat(99)){if(this.regexp_eatClassControlLetter(B))return!0;B.pos=G}return this.regexp_eatCharacterClassEscape(B)||this.regexp_eatCharacterEscape(B)};Fe.regexp_classSetExpression=function(B){var G=St,ie;if(this.regexp_eatClassSetRange(B));else if(ie=this.regexp_eatClassSetOperand(B)){if(ie===pt)G=pt;var se=B.pos;while(B.eatChars([38,38])){if(B.current()!==38&&(ie=this.regexp_eatClassSetOperand(B))){if(ie!==pt)G=St;continue}B.raise("Invalid character in character class")}if(se!==B.pos)return G;while(B.eatChars([45,45])){if(this.regexp_eatClassSetOperand(B))continue;B.raise("Invalid character in character class")}if(se!==B.pos)return G}else B.raise("Invalid character in character class");for(;;){if(this.regexp_eatClassSetRange(B))continue;if(ie=this.regexp_eatClassSetOperand(B),!ie)return G;if(ie===pt)G=pt}};Fe.regexp_eatClassSetRange=function(B){var G=B.pos;if(this.regexp_eatClassSetCharacter(B)){var ie=B.lastIntValue;if(B.eat(45)&&this.regexp_eatClassSetCharacter(B)){var se=B.lastIntValue;if(ie!==-1&&se!==-1&&ie>se)B.raise("Range out of order in character class");return!0}B.pos=G}return!1};Fe.regexp_eatClassSetOperand=function(B){if(this.regexp_eatClassSetCharacter(B))return St;return this.regexp_eatClassStringDisjunction(B)||this.regexp_eatNestedClass(B)};Fe.regexp_eatNestedClass=function(B){var G=B.pos;if(B.eat(91)){var ie=B.eat(94),se=this.regexp_classContents(B);if(B.eat(93)){if(ie&&se===pt)B.raise("Negated character class may contain strings");return se}B.pos=G}if(B.eat(92)){var de=this.regexp_eatCharacterClassEscape(B);if(de)return de;B.pos=G}return null};Fe.regexp_eatClassStringDisjunction=function(B){var G=B.pos;if(B.eatChars([92,113])){if(B.eat(123)){var ie=this.regexp_classStringDisjunctionContents(B);if(B.eat(125))return ie}else B.raise("Invalid escape");B.pos=G}return null};Fe.regexp_classStringDisjunctionContents=function(B){var G=this.regexp_classString(B);while(B.eat(124))if(this.regexp_classString(B)===pt)G=pt;return G};Fe.regexp_classString=function(B){var G=0;while(this.regexp_eatClassSetCharacter(B))G++;return G===1?St:pt};Fe.regexp_eatClassSetCharacter=function(B){var G=B.pos;if(B.eat(92)){if(this.regexp_eatCharacterEscape(B)||this.regexp_eatClassSetReservedPunctuator(B))return!0;if(B.eat(98))return B.lastIntValue=8,!0;return B.pos=G,!1}var ie=B.current();if(ie<0||ie===B.lookahead()&&Cp(ie))return!1;if(bp(ie))return!1;return B.advance(),B.lastIntValue=ie,!0};function Cp(B){return B===33||B>=35&&B<=38||B>=42&&B<=44||B===46||B>=58&&B<=64||B===94||B===96||B===126}function bp(B){return B===40||B===41||B===45||B===47||B>=91&&B<=93||B>=123&&B<=125}Fe.regexp_eatClassSetReservedPunctuator=function(B){var G=B.current();if(Ep(G))return B.lastIntValue=G,B.advance(),!0;return!1};function Ep(B){return B===33||B===35||B===37||B===38||B===44||B===45||B>=58&&B<=62||B===64||B===96||B===126}Fe.regexp_eatClassControlLetter=function(B){var G=B.current();if(Bn(G)||G===95)return B.lastIntValue=G%32,B.advance(),!0;return!1};Fe.regexp_eatHexEscapeSequence=function(B){var G=B.pos;if(B.eat(120)){if(this.regexp_eatFixedHexDigits(B,2))return!0;if(B.switchU)B.raise("Invalid escape");B.pos=G}return!1};Fe.regexp_eatDecimalDigits=function(B){var G=B.pos,ie=0;B.lastIntValue=0;while(Bn(ie=B.current()))B.lastIntValue=10*B.lastIntValue+(ie-48),B.advance();return B.pos!==G};function Bn(B){return B>=48&&B<=57}Fe.regexp_eatHexDigits=function(B){var G=B.pos,ie=0;B.lastIntValue=0;while(so(ie=B.current()))B.lastIntValue=16*B.lastIntValue+oo(ie),B.advance();return B.pos!==G};function so(B){return B>=48&&B<=57||B>=65&&B<=70||B>=97&&B<=102}function oo(B){if(B>=65&&B<=70)return 10+(B-65);if(B>=97&&B<=102)return 10+(B-97);return B-48}Fe.regexp_eatLegacyOctalEscapeSequence=function(B){if(this.regexp_eatOctalDigit(B)){var G=B.lastIntValue;if(this.regexp_eatOctalDigit(B)){var ie=B.lastIntValue;if(G<=3&&this.regexp_eatOctalDigit(B))B.lastIntValue=G*64+ie*8+B.lastIntValue;else B.lastIntValue=G*8+ie}else B.lastIntValue=G;return!0}return!1};Fe.regexp_eatOctalDigit=function(B){var G=B.current();if(ao(G))return B.lastIntValue=G-48,B.advance(),!0;return B.lastIntValue=0,!1};function ao(B){return B>=48&&B<=55}Fe.regexp_eatFixedHexDigits=function(B,G){var ie=B.pos;B.lastIntValue=0;for(var se=0;se<G;++se){var de=B.current();if(!so(de))return B.pos=ie,!1;B.lastIntValue=16*B.lastIntValue+oo(de),B.advance()}return!0};var Vn=function(G){if(this.type=G.type,this.value=G.value,this.start=G.start,this.end=G.end,G.options.locations)this.loc=new un(G,G.startLoc,G.endLoc);if(G.options.ranges)this.range=[G.start,G.end]},He=r.prototype;He.next=function(B){if(!B&&this.type.keyword&&this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword);if(this.options.onToken)this.options.onToken(new Vn(this));this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};He.getToken=function(){return this.next(),new Vn(this)};if(typeof Symbol<"u")He[Symbol.iterator]=function(){var B=this;return{next:function(){var G=B.getToken();return{done:G.type===Ne.eof,value:G}}}};He.nextToken=function(){var B=this.curContext();if(!B||!B.preserveSpace)this.skipSpace();if(this.start=this.pos,this.options.locations)this.startLoc=this.curPosition();if(this.pos>=this.input.length)return this.finishToken(Ne.eof);if(B.override)return B.override(this);else this.readToken(this.fullCharCodeAtPos())};He.readToken=function(B){if(a(B,this.options.ecmaVersion>=6)||B===92)return this.readWord();return this.getTokenFromCode(B)};He.fullCharCodeAt=function(B){var G=this.input.charCodeAt(B);if(G<=55295||G>=56320)return G;var ie=this.input.charCodeAt(B+1);return ie<=56319||ie>=57344?G:(G<<10)+ie-56613888};He.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};He.skipBlockComment=function(){var B=this.options.onComment&&this.curPosition(),G=this.pos,ie=this.input.indexOf("*/",this.pos+=2);if(ie===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=ie+2,this.options.locations)for(var se=void 0,de=G;(se=Rs(this.input,de,this.pos))>-1;)++this.curLine,de=this.lineStart=se;if(this.options.onComment)this.options.onComment(!0,this.input.slice(G+2,ie),G,this.pos,B,this.curPosition())};He.skipLineComment=function(B){var G=this.pos,ie=this.options.onComment&&this.curPosition(),se=this.input.charCodeAt(this.pos+=B);while(this.pos<this.input.length&&!Ot(se))se=this.input.charCodeAt(++this.pos);if(this.options.onComment)this.options.onComment(!1,this.input.slice(G+B,this.pos),G,this.pos,ie,this.curPosition())};He.skipSpace=function(){e:while(this.pos<this.input.length){var B=this.input.charCodeAt(this.pos);switch(B){case 32:case 160:++this.pos;break;case 13:if(this.input.charCodeAt(this.pos+1)===10)++this.pos;case 10:case 8232:case 8233:if(++this.pos,this.options.locations)++this.curLine,this.lineStart=this.pos;break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(B>8&&B<14||B>=5760&&Lr.test(String.fromCharCode(B)))++this.pos;else break e}}};He.finishToken=function(B,G){if(this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();var ie=this.type;this.type=B,this.value=G,this.updateContext(ie)};He.readToken_dot=function(){var B=this.input.charCodeAt(this.pos+1);if(B>=48&&B<=57)return this.readNumber(!0);var G=this.input.charCodeAt(this.pos+2);if(this.options.ecmaVersion>=6&&B===46&&G===46)return this.pos+=3,this.finishToken(Ne.ellipsis);else return++this.pos,this.finishToken(Ne.dot)};He.readToken_slash=function(){var B=this.input.charCodeAt(this.pos+1);if(this.exprAllowed)return++this.pos,this.readRegexp();if(B===61)return this.finishOp(Ne.assign,2);return this.finishOp(Ne.slash,1)};He.readToken_mult_modulo_exp=function(B){var G=this.input.charCodeAt(this.pos+1),ie=1,se=B===42?Ne.star:Ne.modulo;if(this.options.ecmaVersion>=7&&B===42&&G===42)++ie,se=Ne.starstar,G=this.input.charCodeAt(this.pos+2);if(G===61)return this.finishOp(Ne.assign,ie+1);return this.finishOp(se,ie)};He.readToken_pipe_amp=function(B){var G=this.input.charCodeAt(this.pos+1);if(G===B){if(this.options.ecmaVersion>=12){var ie=this.input.charCodeAt(this.pos+2);if(ie===61)return this.finishOp(Ne.assign,3)}return this.finishOp(B===124?Ne.logicalOR:Ne.logicalAND,2)}if(G===61)return this.finishOp(Ne.assign,2);return this.finishOp(B===124?Ne.bitwiseOR:Ne.bitwiseAND,1)};He.readToken_caret=function(){var B=this.input.charCodeAt(this.pos+1);if(B===61)return this.finishOp(Ne.assign,2);return this.finishOp(Ne.bitwiseXOR,1)};He.readToken_plus_min=function(B){var G=this.input.charCodeAt(this.pos+1);if(G===B){if(G===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||nt.test(this.input.slice(this.lastTokEnd,this.pos))))return this.skipLineComment(3),this.skipSpace(),this.nextToken();return this.finishOp(Ne.incDec,2)}if(G===61)return this.finishOp(Ne.assign,2);return this.finishOp(Ne.plusMin,1)};He.readToken_lt_gt=function(B){var G=this.input.charCodeAt(this.pos+1),ie=1;if(G===B){if(ie=B===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+ie)===61)return this.finishOp(Ne.assign,ie+1);return this.finishOp(Ne.bitShift,ie)}if(G===33&&B===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45)return this.skipLineComment(4),this.skipSpace(),this.nextToken();if(G===61)ie=2;return this.finishOp(Ne.relational,ie)};He.readToken_eq_excl=function(B){var G=this.input.charCodeAt(this.pos+1);if(G===61)return this.finishOp(Ne.equality,this.input.charCodeAt(this.pos+2)===61?3:2);if(B===61&&G===62&&this.options.ecmaVersion>=6)return this.pos+=2,this.finishToken(Ne.arrow);return this.finishOp(B===61?Ne.eq:Ne.prefix,1)};He.readToken_question=function(){var B=this.options.ecmaVersion;if(B>=11){var G=this.input.charCodeAt(this.pos+1);if(G===46){var ie=this.input.charCodeAt(this.pos+2);if(ie<48||ie>57)return this.finishOp(Ne.questionDot,2)}if(G===63){if(B>=12){var se=this.input.charCodeAt(this.pos+2);if(se===61)return this.finishOp(Ne.assign,3)}return this.finishOp(Ne.coalesce,2)}}return this.finishOp(Ne.question,1)};He.readToken_numberSign=function(){var B=this.options.ecmaVersion,G=35;if(B>=13){if(++this.pos,G=this.fullCharCodeAtPos(),a(G,!0)||G===92)return this.finishToken(Ne.privateId,this.readWord1())}this.raise(this.pos,"Unexpected character '"+Et(G)+"'")};He.getTokenFromCode=function(B){switch(B){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(Ne.parenL);case 41:return++this.pos,this.finishToken(Ne.parenR);case 59:return++this.pos,this.finishToken(Ne.semi);case 44:return++this.pos,this.finishToken(Ne.comma);case 91:return++this.pos,this.finishToken(Ne.bracketL);case 93:return++this.pos,this.finishToken(Ne.bracketR);case 123:return++this.pos,this.finishToken(Ne.braceL);case 125:return++this.pos,this.finishToken(Ne.braceR);case 58:return++this.pos,this.finishToken(Ne.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(Ne.backQuote);case 48:var G=this.input.charCodeAt(this.pos+1);if(G===120||G===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(G===111||G===79)return this.readRadixNumber(8);if(G===98||G===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(B);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(B);case 124:case 38:return this.readToken_pipe_amp(B);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(B);case 60:case 62:return this.readToken_lt_gt(B);case 61:case 33:return this.readToken_eq_excl(B);case 63:return this.readToken_question();case 126:return this.finishOp(Ne.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Et(B)+"'")};He.finishOp=function(B,G){var ie=this.input.slice(this.pos,this.pos+G);return this.pos+=G,this.finishToken(B,ie)};He.readRegexp=function(){var B,G,ie=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(ie,"Unterminated regular expression");var se=this.input.charAt(this.pos);if(nt.test(se))this.raise(ie,"Unterminated regular expression");if(!B){if(se==="[")G=!0;else if(se==="]"&&G)G=!1;else if(se==="/"&&!G)break;B=se==="\\"}else B=!1;++this.pos}var de=this.input.slice(ie,this.pos);++this.pos;var ke=this.pos,Pe=this.readWord1();if(this.containsEsc)this.unexpected(ke);var _e=this.regexpState||(this.regexpState=new vt(this));_e.reset(ie,de,Pe),this.validateRegExpFlags(_e),this.validateRegExpPattern(_e);var Ae=null;try{Ae=new RegExp(de,Pe)}catch(De){}return this.finishToken(Ne.regexp,{pattern:de,flags:Pe,value:Ae})};He.readInt=function(B,G,ie){var se=this.options.ecmaVersion>=12&&G===void 0,de=ie&&this.input.charCodeAt(this.pos)===48,ke=this.pos,Pe=0,_e=0;for(var Ae=0,De=G==null?1/0:G;Ae<De;++Ae,++this.pos){var Re=this.input.charCodeAt(this.pos),Oe=void 0;if(se&&Re===95){if(de)this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals");if(_e===95)this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore");if(Ae===0)this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits");_e=Re;continue}if(Re>=97)Oe=Re-97+10;else if(Re>=65)Oe=Re-65+10;else if(Re>=48&&Re<=57)Oe=Re-48;else Oe=1/0;if(Oe>=B)break;_e=Re,Pe=Pe*B+Oe}if(se&&_e===95)this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits");if(this.pos===ke||G!=null&&this.pos-ke!==G)return null;return Pe};function Sp(B,G){if(G)return parseInt(B,8);return parseFloat(B.replace(/_/g,""))}function co(B){if(typeof BigInt!=="function")return null;return BigInt(B.replace(/_/g,""))}He.readRadixNumber=function(B){var G=this.pos;this.pos+=2;var ie=this.readInt(B);if(ie==null)this.raise(this.start+2,"Expected number in radix "+B);if(this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110)ie=co(this.input.slice(G,this.pos)),++this.pos;else if(a(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(Ne.num,ie)};He.readNumber=function(B){var G=this.pos;if(!B&&this.readInt(10,void 0,!0)===null)this.raise(G,"Invalid number");var ie=this.pos-G>=2&&this.input.charCodeAt(G)===48;if(ie&&this.strict)this.raise(G,"Invalid number");var se=this.input.charCodeAt(this.pos);if(!ie&&!B&&this.options.ecmaVersion>=11&&se===110){var de=co(this.input.slice(G,this.pos));if(++this.pos,a(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(Ne.num,de)}if(ie&&/[89]/.test(this.input.slice(G,this.pos)))ie=!1;if(se===46&&!ie)++this.pos,this.readInt(10),se=this.input.charCodeAt(this.pos);if((se===69||se===101)&&!ie){if(se=this.input.charCodeAt(++this.pos),se===43||se===45)++this.pos;if(this.readInt(10)===null)this.raise(G,"Invalid number")}if(a(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");var ke=Sp(this.input.slice(G,this.pos),ie);return this.finishToken(Ne.num,ke)};He.readCodePoint=function(){var B=this.input.charCodeAt(this.pos),G;if(B===123){if(this.options.ecmaVersion<6)this.unexpected();var ie=++this.pos;if(G=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,G>1114111)this.invalidStringToken(ie,"Code point out of bounds")}else G=this.readHexChar(4);return G};He.readString=function(B){var G="",ie=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");var se=this.input.charCodeAt(this.pos);if(se===B)break;if(se===92)G+=this.input.slice(ie,this.pos),G+=this.readEscapedChar(!1),ie=this.pos;else if(se===8232||se===8233){if(this.options.ecmaVersion<10)this.raise(this.start,"Unterminated string constant");if(++this.pos,this.options.locations)this.curLine++,this.lineStart=this.pos}else{if(Ot(se))this.raise(this.start,"Unterminated string constant");++this.pos}}return G+=this.input.slice(ie,this.pos++),this.finishToken(Ne.string,G)};var uo={};He.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(B){if(B===uo)this.readInvalidTemplateToken();else throw B}this.inTemplateElement=!1};He.invalidStringToken=function(B,G){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw uo;else this.raise(B,G)};He.readTmplToken=function(){var B="",G=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated template");var ie=this.input.charCodeAt(this.pos);if(ie===96||ie===36&&this.input.charCodeAt(this.pos+1)===123){if(this.pos===this.start&&(this.type===Ne.template||this.type===Ne.invalidTemplate))if(ie===36)return this.pos+=2,this.finishToken(Ne.dollarBraceL);else return++this.pos,this.finishToken(Ne.backQuote);return B+=this.input.slice(G,this.pos),this.finishToken(Ne.template,B)}if(ie===92)B+=this.input.slice(G,this.pos),B+=this.readEscapedChar(!0),G=this.pos;else if(Ot(ie)){switch(B+=this.input.slice(G,this.pos),++this.pos,ie){case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:B+=`
181
+ `;break;default:B+=String.fromCharCode(ie);break}if(this.options.locations)++this.curLine,this.lineStart=this.pos;G=this.pos}else++this.pos}};He.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(Ne.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":if(this.input[this.pos+1]===`
182
+ `)++this.pos;case`
183
+ `:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};He.readEscapedChar=function(B){var G=this.input.charCodeAt(++this.pos);switch(++this.pos,G){case 110:return`
184
+ `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Et(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:if(this.options.locations)this.lineStart=this.pos,++this.curLine;return"";case 56:case 57:if(this.strict)this.invalidStringToken(this.pos-1,"Invalid escape sequence");if(B){var ie=this.pos-1;this.invalidStringToken(ie,"Invalid escape sequence in template string")}default:if(G>=48&&G<=55){var se=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],de=parseInt(se,8);if(de>255)se=se.slice(0,-1),de=parseInt(se,8);if(this.pos+=se.length-1,G=this.input.charCodeAt(this.pos),(se!=="0"||G===56||G===57)&&(this.strict||B))this.invalidStringToken(this.pos-1-se.length,B?"Octal literal in template string":"Octal literal in strict mode");return String.fromCharCode(de)}if(Ot(G)){if(this.options.locations)this.lineStart=this.pos,++this.curLine;return""}return String.fromCharCode(G)}};He.readHexChar=function(B){var G=this.pos,ie=this.readInt(16,B);if(ie===null)this.invalidStringToken(G,"Bad character escape sequence");return ie};He.readWord1=function(){this.containsEsc=!1;var B="",G=!0,ie=this.pos,se=this.options.ecmaVersion>=6;while(this.pos<this.input.length){var de=this.fullCharCodeAtPos();if(c(de,se))this.pos+=de<=65535?1:2;else if(de===92){this.containsEsc=!0,B+=this.input.slice(ie,this.pos);var ke=this.pos;if(this.input.charCodeAt(++this.pos)!==117)this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX");++this.pos;var Pe=this.readCodePoint();if(!(G?a:c)(Pe,se))this.invalidStringToken(ke,"Invalid Unicode escape");B+=Et(Pe),ie=this.pos}else break;G=!1}return B+this.input.slice(ie,this.pos)};He.readWord=function(){var B=this.readWord1(),G=Ne.name;if(this.keywords.test(B))G=On[B];return this.finishToken(G,B)};var po="8.18.0";r.acorn={Parser:r,version:po,defaultOptions:Nn,Position:qt,SourceLocation:un,getLineInfo:Mr,Node:ln,TokenType:ze,tokTypes:Ne,keywordTypes:On,TokContext:ut,tokContexts:qe,isIdentifierChar:c,isIdentifierStart:a,Token:Vn,isNewLine:Ot,lineBreak:nt,lineBreakG:Ds,nonASCIIwhitespace:Lr};function Wr(B,G){return r.parse(B,G)}function kp(B,G,ie){return r.parseExpressionAt(B,G,ie)}function wp(B,G){return r.tokenizer(B,G)}import{existsSync as Pp,readdirSync as _p}from"node:fs";import{join as Ap}from"node:path";function lo(B){return B.normalize("NFC").toLowerCase()}class Ur{listings=new Map;clear(){this.listings.clear()}entries(B){return this.read(B)?.entries??null}entry(B,G){let ie=this.read(B);if(ie===null)return;if(ie.byName===void 0){ie.byName=new Map;for(let se of ie.entries)ie.byName.set(se.name,se)}return ie.byName.get(G)}has(B,G){let ie=this.read(B);if(ie===null)return!1;if(ie.names.has(G))return!0;if(ie.folded===void 0){ie.folded=new Map;for(let de of ie.names)ie.folded.set(lo(de),de)}let se=ie.folded.get(lo(G));return se!==void 0&&se!==G&&Pp(Ap(B,G))}read(B){let G=this.listings.get(B);if(G!==void 0)return G;try{let ie=_p(B,{withFileTypes:!0}),se=new Set;for(let de of ie)se.add(de.name);G={entries:ie,names:se}}catch{G=null}return this.listings.set(B,G),G}}var Hr=!1;function O(B){Hr=B}function wt(B){if(!Hr)console.error(B)}function fo(B){if(!Hr)console.error(B)}var dn=null,Kr=null;function Tt(){if(dn)return Promise.resolve(dn);if(!Kr)Kr=import("./chunk-bkyrjqfv.js").then((B)=>(dn=B,B));return Kr}function mt(){if(!dn)throw Error("sveld: internal error, parser stack read before loadParserStack() resolved.");return dn}import{existsSync as jn,readFileSync as Tp}from"node:fs";import{dirname as zr,isAbsolute as Np,join as Dp,relative as Rp,resolve as Gn}from"node:path";function ho(B){if(!Ye(B))return{};let G={};if(typeof B.svelte==="string")G.svelte=B.svelte;if(typeof B.name==="string")G.name=B.name;if(typeof B.description==="string")G.description=B.description;return G}function mo(B){if(!Ye(B))return{};let G={};if(typeof B.extends==="string")G.extends=B.extends;if(Ye(B.compilerOptions)){let ie={};if(typeof B.compilerOptions.baseUrl==="string")ie.baseUrl=B.compilerOptions.baseUrl;if(Ye(B.compilerOptions.paths)){let se={};for(let[de,ke]of Object.entries(B.compilerOptions.paths))if(Array.isArray(ke)&&ke.every((Pe)=>typeof Pe==="string"))se[de]=ke;if(Object.keys(se).length>0)ie.paths=se}if(Object.keys(ie).length>0)G.compilerOptions=ie}return G}var go=new Map,Ip=/\/\*[\s\S]*?\*\/|\/\/.*/g,$p=/[.+?^${}()|[\]\\]/g,Op=[".svelte",...Wt];class M extends Error{specifier;fromFile;searched;constructor(B,G,ie){super(`cannot resolve "${B}" from ${G||"."} (${ie})`);this.name="UnresolvedModuleError",this.specifier=B,this.fromFile=G,this.searched=ie}}function Lp(B){if(jn(B))return!0;return Op.some((G)=>jn(B+G))}function xo(B){let G=B.indexOf("*");return G===-1?B.length:G}function Mp(B){let G=B,ie=Gn(G,"/");while(G!==ie){for(let se of["tsconfig.json","jsconfig.json"]){let de=Dp(G,se);if(jn(de))return de}G=zr(G)}return null}function yo(B,G){if(G.has(B))return G.get(B)??null;try{let ie=Tp(B,"utf-8"),se;try{se=JSON.parse(ie)}catch{let ke=ie.replace(Ip,"");se=JSON.parse(ke)}let de=mo(se);if(de.extends){let ke=Np(de.extends)?de.extends:Gn(zr(B),de.extends),Pe=ke.endsWith(".json")?ke:`${ke}.json`;if(jn(Pe)){let _e=yo(Pe,G);if(_e)de.compilerOptions={..._e.compilerOptions,...de.compilerOptions,paths:{..._e.compilerOptions?.paths,...de.compilerOptions?.paths}}}}return G.set(B,de),de}catch{return G.set(B,null),null}}function Fp(B){let G=go.get(B);if(!G){let ie=B.split("*").map((se)=>se.replace($p,"\\$&")).join("(.*)");G=new RegExp(`^${ie}$`),go.set(B,G)}return G}class Xr{configs=new Map;lookup(B,G){if(B.startsWith(".")||B.startsWith("/"))return{resolved:B,unresolved:!1,searched:""};let ie=Mp(G);if(!ie)return{resolved:B,unresolved:!0,searched:"no tsconfig/jsconfig paths found"};let se=yo(ie,this.configs);if(!se?.compilerOptions?.paths)return{resolved:B,unresolved:!0,searched:"no tsconfig/jsconfig paths found"};let{baseUrl:de=".",paths:ke}=se.compilerOptions,Pe=zr(ie),_e=Gn(Pe,de),Ae=Object.entries(ke).sort(([De],[Re])=>xo(Re)-xo(De));for(let[De,Re]of Ae){let Oe=B.match(Fp(De));if(!Oe)continue;let Ie;for(let $e of Re){let Me=$e;for(let Ve=1;Ve<Oe.length;Ve++)Me=Me.replace("*",Oe[Ve]);let Le=Gn(_e,Me);if(Ie===void 0)Ie=Le;if(Lp(Le))return{resolved:Le,unresolved:!1,searched:ie}}return{resolved:Ie??B,unresolved:!1,searched:ie}}return{resolved:B,unresolved:!0,searched:`tsconfig paths (${ie})`}}absolute(B,G){return this.lookup(B,G).resolved}relative(B,G){if(B.startsWith(".")||B.startsWith("/"))return B;let ie=this.absolute(B,G);if(ie===B)return B;let se=Rp(G,ie);return se=t(se),se.startsWith(".")?se:`./${se}`}}var Up=/\.[mc]?jsx?$/,Hp={".js":[".ts",".tsx",".d.ts"],".jsx":[".tsx",".d.ts"],".mjs":[".mts",".d.mts"],".cjs":[".cts",".d.cts"]};function je(B){return B&&typeof B==="object"?B:void 0}function gt(B){return Array.isArray(B)?B:[]}function Kp(B){return B==="."||B===".."||B.startsWith("./")||B.startsWith("../")||jp(B)}class Nt{aliases=new Xr;listings=new Ur;modules=new Map;programs=new Map;listDirectory(B){return this.listings.entries(B)}exists(B){return this.listings.has(Wn(B),qr(B))}resolve(B,G,ie=Wt){let se=this.aliases.absolute(B,G);if(se===B&&!Kp(B))return null;let de=Wp(G,se),ke=Wn(de),Pe=qr(de);if(this.listings.has(ke,Pe)){let _e=this.listings.entry(ke,Pe),Ae=_e&&!_e.isSymbolicLink()?_e:Vp(de,{throwIfNoEntry:!1});if(Ae?.isFile())return de;for(let De of ie)if(this.listings.has(ke,Pe+De))return de+De;if(Ae?.isDirectory()){for(let De of ie)if(this.listings.has(de,`index${De}`))return Gp(de,`index${De}`)}return null}for(let _e of ie)if(this.listings.has(ke,Pe+_e))return de+_e;return this.typeScriptCounterpart(de)??null}parse(B){let G=this.modules.get(B);if(G===void 0)G=zp(B),this.modules.set(B,G);return G}parseJavaScript(B,G){let ie=this.programs.get(B);if(ie?.source===G)return ie.ast;let se=Wr(G,{ecmaVersion:"latest",sourceType:"module"});return this.programs.set(B,{source:G,ast:se}),se}invalidate(...B){this.listings.clear();for(let G of B)this.modules.delete(G),this.programs.delete(G)}typeScriptCounterpart(B){let G=Up.exec(B)?.[0];if(G===void 0)return;let ie=B.slice(0,-G.length),se=Wn(ie),de=qr(ie);for(let ke of Hp[G]??[])if(this.listings.has(se,de+ke))return ie+ke;return}}function zp(B){let G;try{G=Bp(B,"utf-8")}catch{return null}try{let ie;if(B.endsWith(".svelte"))ie=gt(mt().parseSvelte(G).module?.content.body);else ie=gt(mt().parseProgram(G,!0,[]).body);return{source:{text:G,filePath:B,dir:Wn(B)},body:ie}}catch(ie){let se=ie instanceof Error?ie.message:String(ie);return fo(`Warning: sveld couldn't parse ${B} to read its exports (${se}); skipping it.`),null}}function qp(B,G,ie,se){let de=B.resolve(G,ie);if(!de)return null;let ke=Jr(de);if(se.has(de))return{dir:ke,exports:{}};se.add(de);try{return{dir:ke,exports:Yr(B,bo(de,"utf-8"),ke,se,de)}}catch{return{dir:ke,exports:{}}}finally{se.delete(de)}}function Eo(B,G,ie=new Nt,se=new Set){return Yr(ie,B,G,se,G)}function Yr(B,G,ie,se,de){let ke=B.parseJavaScript(de,G),Pe={};for(let _e of ke.body)if(_e.type==="ExportDefaultDeclaration"){let Ae=_e.declaration.name;if(Ae in Pe)Pe[Ae].default=!0;else Pe[Ae]={source:bt(""),default:!0}}else if(_e.type==="ExportAllDeclaration"){if(!_e.source)continue;let Ae=_e.source.value,De=B.resolve(Ae,ie);if(!De){let Ie=B.aliases.lookup(Ae,ie);throw new M(Ae,de,Ie.unresolved?Ie.searched:"no matching file or index found")}if(se.has(De))continue;se.add(De);let Re=bo(De,"utf-8"),Oe=Yr(B,Re,Jr(De),se,De);se.delete(De);for(let[Ie,$e]of Object.entries(Oe)){let Me=bt(t($e.source.startsWith(".")?`./${vo(ie,Co(Jr(De),$e.source))}`:`./${Xp(Ae,$e.source)}`));Pe[Ie]={...$e,source:Me}}}else if(_e.type==="ExportNamedDeclaration"){let Ae=_e.source?.value,De=Ae!==void 0&&yt.test(Ae);if(De){let Ie=B.aliases.lookup(Ae,ie);if(Ie.unresolved)throw new M(Ae,de,Ie.searched)}let Oe=Ae!==void 0&&!De?qp(B,Ae,ie,se):void 0;if(Oe===null)console.warn(`sveld: could not resolve re-exported module "${Ae}" from barrel "${ie||"."}"; skipping.`);for(let Ie of _e.specifiers){let $e=Ie.exported.name,Me=Ie.local.name,Le=$e||Me;if(Oe===null)continue;let Ve=Oe?.exports[Me],We=Ve?bt(t(`./${vo(ie,Co(Oe.dir,Ve.source))}`)):bt(B.aliases.relative(Ae??"",ie)),Ue=Ve?Ve.default:Me==="default";if(Le in Pe){if(Pe[Le].mixed=!0,!Pe[Le].source)Pe[Le].source=We}else Pe[Le]={source:We,default:Ue}}}else if(_e.type==="ImportDeclaration"){let Ae=_e.specifiers[0].local.name;if(Ae in Pe){if(!Pe[Ae].source)Pe[Ae].source=bt(B.aliases.relative(_e.source?.value??"",ie))}else Pe[Ae]={source:bt(B.aliases.relative(_e.source?.value??"",ie)),default:Ae==="default"}}return Pe}var ko=/-/g,il=/[^A-Za-z0-9_$]/g,sl=/^[0-9]/;function wo(B,G){let ie=B.replace(il,""),se=sl.test(ie)?`_${ie}`:ie;if(se!==B&&!G?.has(B))G?.add(B),console.warn(`Warning: "${B}" is not a valid identifier; using "${se}" instead.`);return se}function Po(B,G,ie=[],se=new Set,de){let ke;try{ke=de??Qp(G)}catch{return ie}if(se.has(ke))return ie;se.add(ke);let Pe=B.listDirectory(G);if(Pe===null)return ie;for(let _e of Pe){if(_e.name.startsWith("."))continue;let Ae=So(G,_e.name),De=_e.isSymbolicLink(),Re=De?Zp(Ae,{throwIfNoEntry:!1}):_e;if(!Re)continue;if(Re.isDirectory())Po(B,Ae,ie,se,De?void 0:So(ke,_e.name));else if(Re.isFile()&&_e.name.endsWith(".svelte"))ie.push(Ae)}return ie}function ol(B,G){return Po(B,G).map((ie)=>{let se=wo(el(ie,".svelte").replace(ko,"")),de=bt(t(`./${Qr(G,ie)}`));return{moduleName:se,source:de}}).sort((ie,se)=>u(ie.source,se.source))}function al(B){return!Ut(B)}function cl(B,G){let ie=B.endsWith("/")?B:`${B}/`;return G.startsWith(ie)}function Hn(B,G){return{seenPaths:new Set(B.map(([,ie])=>G(ie.source))),seenModuleNamePaths:new Map(B.map(([ie,se])=>[ie,G(se.source)])),warnedModuleNames:new Set}}function Zr(B,G,ie,se,de,ke){for(let{moduleName:Pe,source:_e}of ol(B,G)){let Ae=de(_e),De=ie[Pe];if(De&&al(De.source)&&cl(De.source,_e)){ke.seenPaths.delete(de(De.source)),De.source=_e,ke.seenPaths.add(Ae),ke.seenModuleNamePaths.set(Pe,Ae);continue}if(ke.seenPaths.has(Ae))continue;ke.seenPaths.add(Ae);let Re=ke.seenModuleNamePaths.get(Pe);if(Re===void 0)ke.seenModuleNamePaths.set(Pe,Ae);else if(Re!==Ae&&!ke.warnedModuleNames.has(Pe))ke.warnedModuleNames.add(Pe),console.warn(`Warning: multiple components named "${Pe}" found (${t(Qr(G,Re))} and ${t(Qr(G,Ae))}). Both are included in TypeScript definitions, but only one can be the named export.`);se.push([Pe,{source:_e,default:!1}])}}function ei(B,G,ie,se){let de=Jp(B).isFile(),ke=de?tl(B):B,Pe=Un(ke),_e=new Map,Ae=(Oe)=>{let Ie=_e.get(Oe);if(Ie===void 0)Ie=nl(Oe)?Un(Oe):Un(Pe,Oe),_e.set(Oe,Ie);return Ie},De={};if(de){let Oe=Yp(B,"utf-8");try{De=Eo(Oe,Pe,se,new Set([Un(B)]))}catch(Ie){if(!ie)throw Ie;let $e=Ie instanceof Error?Ie.message:String(Ie);console.warn(`Warning: Failed to parse component exports from ${B}: ${$e}`)}}let Re=Object.entries(De);if(G){let Oe=Hn(Re,Ae);if(Zr(se,Pe,De,Re,Ae,Oe),!de)De=Object.fromEntries(Re.map(([Ie,$e])=>[Ie,{...$e,default:!0}]))}return{exports:De,allComponentEntries:Re,rootDir:Pe,resolveComponentFilePath:Ae}}function ti(B,G,ie,se){if(ie!==1||B!=="default")return B;return wo(rl(G).name.replace(ko,""),se)}import{resolve as Sl}from"node:path";var ni="/**",_o="*",Kn="*/",ul="```",ri=/^\s+/,Ao=/\s/,pl=/^@[^\s/]+(?=\s|$)/,ll=/^@(\S+)\s*/,fl=new Set(["extends","extendProps","generics","template","typedef"]);function J(B){let G=0;while(G<B.length){let ie=B.charCodeAt(G);if(ie!==32&&ie!==9&&ie!==13&&ie!==10&&!Ao.test(B[G]))break;G++}return G}function dl(B,G){let ie=B.slice(J(B)),se=!1;if(G)ie=ie.slice(ni.length),se=!0;else if(ie.startsWith(_o)&&!ie.startsWith(Kn))ie=ie.slice(_o.length),se=!0;let de=ie.slice(0,J(ie));ie=ie.slice(de.length);let ke=ie.trimEnd(),Pe=ke.endsWith(Kn)?ke.slice(0,-Kn.length).trimEnd():ie;return{indent:se?de.slice(1):de,content:Pe}}function hl(B,G,ie){let se=ie>G&&B.charCodeAt(ie-1)===13?ie-1:ie;return B.slice(G,se)}function ml(B){let G=[],ie=0;while(!0){let se=B.indexOf(ni,ie);if(se===-1)break;let de=B.lastIndexOf(`
185
+ `,se-1)+1;if(B.charCodeAt(se+ni.length)===42||B.slice(de,se).trim()!==""){ie=se+1;continue}let ke=[],Pe=de,_e=!1,Ae=0;while(Pe<=B.length){let De=B.indexOf(`
186
+ `,Pe),Re=De===-1?B.length:De,Oe=hl(B,Pe,Re),{indent:Ie,content:$e}=dl(Oe,ke.length===0);ke.push({raw:Oe,start:Pe,number:ke.length,indent:Ie,content:$e});let Me=Oe.trimEnd();if(Me.endsWith(Kn)){_e=!0,Ae=Pe+Me.length,ie=Re;break}if(De===-1)break;Pe=De+1}if(!_e)break;G.push({start:se,end:Ae,lines:ke})}return G}function gl(B){let G=B;if(G.length>0&&G[0].content==="")G=G.slice(1);if(G.length>0&&G[G.length-1].content==="")G=G.slice(0,-1);return G}function xl(B){let G=[[]],ie=!1;for(let se of B){if(pl.test(se.content)&&!ie)G.push([se]);else G[G.length-1].push(se);if(F(se.content))ie=!ie}return G}function F(B){return yl(B,ul)%2===1}function yl(B,G){let ie=0,se=B.indexOf(G);while(se!==-1)ie++,se=B.indexOf(G,se+G.length);return ie}function To(B){return B.map((G)=>G.indent+G.content).join(`
187
+ `)}function vl(B,G){let ie=G;while(ie<B.length-1&&B[ie].content.trim()==="")ie++;if(B[ie].content[0]!=="{")return null;let se=B.slice(ie).map((De)=>De.content).join(`
188
+ `),de=D(se,0);if(de===-1)return null;let ke=[],Pe=de+1;for(let De=ie;Pe>0;De++){let Re=B[De].content.length;ke.push(Math.min(Pe,Re)),Pe-=Re+1}let _e=ie+ke.length-1;return{type:ke.map((De,Re)=>{let Oe=ie+Re,Ie=B[Oe].content.slice(0,De);if(B[Oe].content=B[Oe].content.slice(De).replace(ri,""),Oe>0)B[Oe].continuesType=!0;return Re===0?Ie:B[Oe].indent+Ie}).join(`
189
+ `).slice(1,-1),endIndex:_e}}function Cl(B){let G=B.content.match(ri)?.[0]??"",ie=B.content.slice(G.length),se=0,de=0;for(let De of ie){if(se===0&&Ao.test(De))break;if(De==="[")se++;if(De==="]")se--;de++}let ke=se===0?ie.slice(0,de):"";if(!ke)return null;let Pe=ke,_e=!1,Ae;if(ke.startsWith("[")&&ke.endsWith("]")){_e=!0;let Re=ke.slice(1,-1).split("=");if(Pe=Re[0].trim(),Re.length>1)Ae=Re.slice(1).join("=").trim();if(!Pe)return null}if(Pe.length>1&&(Pe[0]==='"'||Pe[0]==="'")&&Pe[Pe.length-1]===Pe[0])Pe=Pe.slice(1,-1);return B.content=ie.slice(de).replace(ri,""),{name:Pe,optional:_e,default:Ae}}function bl(B){let G=B[0],ie=G.content.match(ll),se=ie?ie[1]:"",de=ie?G.content.slice(ie[0].length):G.content,ke=de.trimEnd(),Pe=B.slice(1).map(($e)=>$e.indent+$e.content),_e=(ke?[ke,...Pe]:Pe).join(`
190
+ `);G.content=de,G.tag=se;let Ae=vl(B,0),De=Ae?.type??"",Re=Ae?.endIndex??0;if(fl.has(se))while(Re<B.length-1&&B[Re].content.trim()==="")Re++;let Oe=Cl(B[Re]),Ie=To(B.slice(Re));return{tag:se,name:Oe?.name??"",type:De,optional:Oe?.optional??!1,default:Oe?.default,description:Ie,text:_e,lines:B}}function El(B,G,ie){let se=gl(B);se.forEach((Pe,_e)=>{Pe.number=_e});let de=xl(se),ke=de.slice(1).map(bl);return{description:To(de[0]),tags:ke,start:G,end:ie,lines:se}}function x(B){return ml(B).map(({start:G,end:ie,lines:se})=>El(se,G,ie))}var kl=/\r?\n/,wl=/^\s*\*+/;function zn(B){return{graph:B,cache:new Map,computing:new Set}}function tt(B){return e(B)?B.name:void 0}function Pl(B){let G=B.trimEnd();for(;;){let ie=G.lastIndexOf(`
191
+ `)+1;if(G.slice(ie).trimStart().startsWith("//")){G=G.slice(0,ie).trimEnd();continue}let se=G.endsWith("*/")?G.lastIndexOf("/*",G.length-3):-1;if(se!==-1&&G[se+2]!=="*"){G=G.slice(0,se).trimEnd();continue}return G}}function _l(B,G){let ie=Pl(B.slice(0,G));if(!ie.endsWith("*/"))return;let se=ie.length-2,de=ie.lastIndexOf("/**",se);if(de===-1)return;return ie.slice(de,se+2)}function Al(B){let G=[];for(let ie of B.slice(3,-2).split(kl)){let se=ie.replace(wl,"").trim();if(se.startsWith("@"))break;if(se)G.push(se)}return G.join(" ")||void 0}function Ft(B,G){if(!G)return;return B.text.slice(G.start,G.end)}function Tl(B,G){let ie=je(G?.typeAnnotation);if(ie?.type!=="TSTypeAnnotation")return;return Ft(B,je(ie.typeAnnotation))}function ii(B,G){let ie=je(G.returnType);return ie?.type==="TSTypeAnnotation"?Ft(B,je(ie.typeAnnotation)):void 0}function si(B,G){let ie=gt(G.params).map((de)=>Ft(B,de)??"").join(", "),se=ii(B,G);return`(${ie})${se?` => ${se}`:""}`}function Ro(B){if(B.type==="Literal"){let G=B.value;if(typeof G==="string")return"string";if(typeof G==="number")return"number";if(typeof G==="boolean")return"boolean"}if(B.type==="TemplateLiteral")return"string";return}function Nl(B,G){let ie=Ft(B,G);if(ie===void 0)return;if(G.type==="Literal"){let de=G.value;if(typeof de==="string"||typeof de==="number"||typeof de==="boolean")return{raw:ie,value:de,type:typeof de};return}if(G.type==="UnaryExpression"&&G.operator==="-"){let de=je(G.argument);if(de?.type==="Literal"&&typeof de.value==="number")return{raw:ie,value:-de.value,type:"number"};return}let se=G.type==="TemplateLiteral"?y(G):null;return se===null?void 0:{raw:ie,value:se,type:"string"}}function Dl(B,G){if(B.type!=="CallExpression"&&B.type!=="NewExpression")return;let ie=je(B.callee);if(!(tt(ie)==="Symbol"||ie?.type==="MemberExpression"&&!ie.computed&&tt(je(ie.object))==="Symbol"&&tt(je(ie.property))==="for"))return;return y(gt(B.arguments)[0])||G}var Rl=new Set(["any","bigint","boolean","false","never","null","number","object","readonly","string","symbol","true","undefined","unknown","void"]),Il=/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/g,$l=/(?<![\w$.])[A-Za-z_$][\w$]*(?![\w$]|\s*\??:)/g;function Ol(B,G){let ie=G?mt().getCommentTags(x(G)).type?.type.trim():void 0,se=B?{type:B,source:"typescript"}:ie?{type:ie,source:"jsdoc"}:void 0;if(!se||se.type.includes("`"))return;return(se.type.replace(Il,'""').match($l)??[]).every((ke)=>Rl.has(ke))?se:void 0}function No(B){if(B.async||B.generator)return;let G=je(B.body);if(!G)return;let ie=[];if(G.type==="BlockStatement"){if(hn(G,ie),ie.length===0)return}else ie.push(G);let se;for(let de of ie){if(!de)return;let ke=Ro(de);if(!ke)return;if(se===void 0)se=ke;else if(se!==ke)return}return se}function hn(B,G){for(let ie of gt(B.body)){if(ie.type==="FunctionDeclaration"||ie.type==="FunctionExpression"||ie.type==="ArrowFunctionExpression")continue;if(ie.type==="ReturnStatement"){G.push(je(ie.argument)??null);continue}if(ie.type==="BlockStatement"){hn(ie,G);continue}let se=je(ie.consequent);if(se?.type==="BlockStatement")hn(se,G);else if(se?.type==="ReturnStatement")G.push(je(se.argument)??null);let de=je(ie.alternate);if(de?.type==="BlockStatement")hn(de,G);else if(de?.type==="ReturnStatement")G.push(je(de.argument)??null);let ke=je(ie.body);if(ke?.type==="BlockStatement")hn(ke,G)}}function Ll(B){let G=je(B.initializer);if(!G)return;if(G.type==="Literal"){let ie=G.value;return typeof ie==="string"||typeof ie==="number"?ie:void 0}if(G.type==="UnaryExpression"){let ie=je(G.argument);if(G.operator==="-"&&ie?.type==="Literal"){let de=ie.value;if(typeof de==="number")return-de}}return}function Ml(B){let G=gt(B.members);if(G.length===0)return;let ie=[],se=0;for(let de of G){if(!je(de.initializer)){ie.push(String(se)),se+=1;continue}let Pe=Ll(de);if(Pe===void 0)return;ie.push(typeof Pe==="string"?JSON.stringify(Pe):String(Pe)),se=typeof Pe==="number"?Pe+1:se}return ie.join(" | ")}function oi(B,G,ie,se){let de=B.filePath,ke=_l(B.text,ie),Pe=ke?Al(ke):void 0,_e=ke?mt().extractJsDocReturnType(ke):void 0,{deprecated:Ae,tags:De,internal:Re}=ke?mt().extractJsDocDeprecatedAndTags(ke):{deprecated:void 0,tags:void 0,internal:!1},Oe=Re?{internal:!0}:{};if(G.type==="VariableDeclaration"){let Ie=G.kind??"const",$e=[];for(let Me of gt(G.declarations)){let Le=je(Me.id),Ve=tt(Le);if(!Ve)continue;let We=Tl(B,Le),Ue=We,Xe,Qe,Je,st,en,tn,rt=je(Me.init);if(rt)if(rt.type==="ArrowFunctionExpression"||rt.type==="FunctionExpression"){if(tn=rt,!Ue)Ue=si(B,rt);Qe=ii(B,rt)??_e??W(Ue)??No(rt)}else{if(Xe=Ft(B,rt),!Ue)Ue=Ro(rt);let Gt=je(m(rt))??rt;if(Je=y(Gt)??Dl(Gt,Ve),Ie==="const")st=Nl(B,Gt),en=Ol(We,ke)}$e.push({name:Ve,kind:Ie,type:Ue,value:Xe,returnType:Qe,literalValue:Je,primitiveLiteral:st,declaredType:en,functionNode:tn,description:Pe,deprecated:Ae,tags:De,...Oe,declFile:de,isTypeOnly:!1})}return $e}if(G.type==="FunctionDeclaration"||G.type==="TSDeclareFunction"){let Ie=tt(je(G.id))??se;if(!Ie)return[];return[{name:Ie,kind:"function",type:si(B,G),returnType:ii(B,G)??_e??No(G),...G.type==="FunctionDeclaration"?{functionNode:G}:{},description:Pe,deprecated:Ae,tags:De,...Oe,declFile:de,isTypeOnly:!1}]}if(G.type==="ClassDeclaration"){let Ie=tt(je(G.id)),$e=Ie??se;if(!$e)return[];return[{name:$e,kind:"class",...Ie?{type:Ie}:{},description:Pe,deprecated:Ae,tags:De,...Oe,declFile:de,isTypeOnly:!1}]}if(G.type==="TSTypeAliasDeclaration"){let Ie=tt(je(G.id));if(!Ie)return[];return[{name:Ie,kind:"type",type:Ft(B,je(G.typeAnnotation)),description:Pe,deprecated:Ae,tags:De,...Oe,declFile:de,isTypeOnly:!0}]}if(G.type==="TSInterfaceDeclaration"){let Ie=tt(je(G.id));if(!Ie)return[];return[{name:Ie,kind:"interface",type:Ft(B,je(G.body)),description:Pe,deprecated:Ae,tags:De,...Oe,declFile:de,isTypeOnly:!0}]}if(G.type==="TSEnumDeclaration"){let Ie=tt(je(G.id));if(!Ie)return[];return[{name:Ie,kind:"enum",type:Ml(G)??Ie,description:Pe,deprecated:Ae,tags:De,...Oe,declFile:de,isTypeOnly:!1}]}return[]}function Fl(B,G,ie){let se=je(G.declaration);if(!se)return;if(se.type==="FunctionDeclaration"||se.type==="TSDeclareFunction"||se.type==="ClassDeclaration"){let[Pe]=oi(B,se,G.start,"default");return Pe?{...Pe,name:"default"}:void 0}if(se.type==="FunctionExpression"||se.type==="ArrowFunctionExpression")return{name:"default",kind:"function",type:si(B,se),functionNode:se,declFile:B.filePath,isTypeOnly:!1};let de=tt(se),ke=de?ie(de):null;return ke?{...ke,name:"default"}:void 0}function Bl(B,G){for(let ie of B){if(ie.type!=="ImportDeclaration")continue;let se=je(ie.source)?.value;if(typeof se!=="string")continue;for(let de of gt(ie.specifiers)){if(tt(je(de.local))!==G)continue;let ke=ie.importKind==="type"||de.importKind==="type";if(de.type==="ImportDefaultSpecifier")return{specifier:se,importedName:"default",isTypeOnly:ke};if(de.type==="ImportNamespaceSpecifier")return{specifier:se,importedName:"*",isTypeOnly:ke};if(de.type==="ImportSpecifier"){let Pe=tt(je(de.imported))??G;return{specifier:se,importedName:Pe,isTypeOnly:ke}}}}return null}function Do(B,G,ie){return{name:B,kind:"const",declFile:G,namespaceFile:G,isTypeOnly:ie}}function Xn(B,G){let ie=G.cache.get(B);if(ie)return ie;if(G.computing.has(B))return[];G.computing.add(B);let se=G.graph.parse(B);if(!se)return G.computing.delete(B),G.cache.set(B,[]),[];let{source:de,body:ke}=se,Pe=[],_e=new Map;for(let Ie of ke){let $e=Ie.type==="ExportNamedDeclaration"?je(Ie.declaration):Ie;if(!$e)continue;for(let Me of oi(de,$e,$e.start))_e.set(Me.name,Me)}let Ae=(Ie,$e)=>({name:Ie,kind:"const",declFile:Sl(de.dir,$e),isTypeOnly:!1}),De=(Ie)=>{let $e=_e.get(Ie);if($e)return $e;let Me=Bl(ke,Ie);if(!Me)return null;if(Me.specifier.endsWith(".svelte"))return Ae(Ie,Me.specifier);let Le=G.graph.resolve(Me.specifier,de.dir);if(!Le)return null;if(Me.importedName==="*")return Do(Ie,Le,Me.isTypeOnly);return Bt(Le,Me.importedName,G)??null},Re=new Map;for(let Ie of ke){if(Ie.type==="ExportAllDeclaration"){let We=je(Ie.source)?.value;if(typeof We!=="string"||We.endsWith(".svelte"))continue;let Ue=G.graph.resolve(We,de.dir);if(!Ue)continue;let Xe=Ie.exportKind==="type",Qe=tt(je(Ie.exported));if(Qe){Pe.push(Do(Qe,Ue,Xe));continue}for(let Je of Xn(Ue,G)){let st=Re.get(Je.name)??[];st.push(Xe?{...Je,isTypeOnly:!0}:Je),Re.set(Je.name,st)}continue}if(Ie.type==="ExportDefaultDeclaration"){let We=Fl(de,Ie,De);if(We)Pe.push(We);continue}if(Ie.type!=="ExportNamedDeclaration")continue;let $e=je(Ie.declaration);if($e){Pe.push(...oi(de,$e,Ie.start));continue}let Me=je(Ie.source)?.value,Le=typeof Me==="string"?Me:void 0;if(Le?.endsWith(".svelte")){for(let We of gt(Ie.specifiers)){let Ue=tt(je(We.exported));if(Ue)Pe.push(Ae(Ue,Le))}continue}let Ve=Ie.exportKind==="type";for(let We of gt(Ie.specifiers)){if(We.type!=="ExportSpecifier")continue;let Ue=tt(je(We.exported)),Xe=tt(je(We.local));if(!Ue||!Xe)continue;let Qe=Ve||We.exportKind==="type",Je=null;if(Le){let st=G.graph.resolve(Le,de.dir);if(st)Je=Bt(st,Xe,G)??null}else Je=De(Xe);if(Je)Pe.push({...Je,name:Ue,isTypeOnly:Je.isTypeOnly||Qe});else if(Xe!=="default")Pe.push({name:Ue,kind:Qe?"type":"const",declFile:B,isTypeOnly:Qe})}}let Oe=new Set(Pe.map((Ie)=>Ie.name));for(let[Ie,$e]of Re){if(Oe.has(Ie)||Ie==="default")continue;if($e.every((Me)=>Me.declFile===$e[0].declFile))Pe.push(...$e);else G.onAmbiguousStarExport?.(B,Ie,$e)}return G.computing.delete(B),G.cache.set(B,Pe),Pe}function Bt(B,G,ie){return Xn(B,ie).findLast((se)=>se.name===G)}function Qt(B,{importedName:G,members:ie=[]},se){let de=Bt(B,G,se);for(let ke of ie){if(de?.namespaceFile===void 0)return;de=Bt(de.namespaceFile,ke,se)}return de}import{dirname as Vl}from"node:path";function Dt(B,G,ie){if(B[G]===void 0)delete B[G];B[G]=ie}function qn(B,G){return(G.location==="props"?B.props:B.moduleExports).find((se)=>se.name===G.propName)}function Jn(B,G){if(G.location!=="props")return;B.diagnostics=(B.diagnostics??[]).filter((ie)=>!(ie.kind==="prop-unknown-type"&&ie.name===G.propName))}var jl=/\.[^./\\]+$/;function Gl(B,G){if(B.endsWith(".d.ts"))return null;let ie=B.replace(jl,".d.ts");return G.exists(ie)?ie:null}function Wl(B,G,ie){let se=Vl(B);return G.map((de)=>{if(!de.importSource||!de.importedName)return{candidate:de};let ke=ie.graph.resolve(de.importSource,se);if(!ke)return{candidate:de,failureReason:"module-not-found"};let Pe=Bt(ke,de.importedName,ie);if(!Pe)return{candidate:de,failureReason:"export-not-found"};if(Pe.returnType)return{candidate:de,type:Pe.returnType};let _e=Gl(ke,ie.graph);if(_e){let Ae=Bt(_e,de.importedName,ie);if(Ae?.returnType)return{candidate:de,type:Ae.returnType}}return{candidate:de,failureReason:"return-type-unresolved"}})}function Ul(B,G){switch(G){case"module-not-found":return`Prop "${B.propName}" default calls "${B.calleeName}()", but "${B.importSource}" could not be resolved; falling back to "any".`;case"export-not-found":return`Prop "${B.propName}" default calls "${B.calleeName}()", but "${B.importedName}" is not exported from "${B.importSource}"; falling back to "any".`;case"return-type-unresolved":return`Prop "${B.propName}" default calls "${B.calleeName}()" imported from "${B.importSource}", but its return type could not be resolved; falling back to "any".`}}function Hl(B,G){for(let{candidate:ie,type:se,failureReason:de}of G){let ke=qn(B,ie);if(ke?.typeSource!=="unknown")continue;if(se){Dt(ke,"type",se),Dt(ke,"typeSource","typescript"),Jn(B,ie);continue}if(ie.location==="props"&&de){let Pe=B.diagnostics?.find((_e)=>_e.kind==="prop-unknown-type"&&_e.name===ie.propName);if(Pe)Pe.message=Ul(ie,de)}}}var Io={collect:(B)=>B.pendingCallDefaultCandidates?.filter((G)=>G.importSource!==void 0)??[],resolve:Wl,apply:Hl};import{dirname as Kl}from"node:path";function zl(B,G,ie){let se=Kl(B);return G.map((de)=>{let ke=ie.graph.resolve(de.importSource,se);if(!ke)return{candidate:de};let Pe=Qt(ke,de,ie);if(!Pe?.primitiveLiteral)return{candidate:de};return{candidate:de,literal:Pe.primitiveLiteral,declaredType:Pe.declaredType}})}function Xl(B,G){for(let{candidate:ie,literal:se,declaredType:de}of G){if(!se)continue;let ke=qn(B,ie);if(!ke)continue;if(Dt(ke,"value",se.raw),Dt(ke,"defaultValue",{raw:se.raw,kind:"literal",value:se.value}),ke.typeSource!=="unknown")continue;Dt(ke,"type",de?.type??se.type),Dt(ke,"typeSource",de?.source??"default"),Jn(B,ie)}}var $o={collect:(B)=>B.pendingConstDefaultCandidates??[],resolve:zl,apply:Xl};import{dirname as Yl}from"node:path";var ql=/(?:_|[^\p{ID_Continue}$])+/u,Jl=/^[\p{ID_Start}$]/u;function _(B){let se=`${B.split(ql).map((de)=>de.charAt(0).toUpperCase()+de.slice(1)).join("")}Context`;return Jl.test(se)?se:`_${se}`}function q(B,G){let ie=G.source.value;if(typeof ie!=="string"||G.importKind==="type")return;for(let se of G.specifiers){if(se.type!=="ImportSpecifier"||se.importKind==="type")continue;let de=se.local.name;if(!de)continue;let{imported:ke}=se,Pe=ke.type==="Identifier"?ke.name:typeof ke.value==="string"?ke.value:de;B.valueImportBindingsByLocalName.set(de,{localName:de,importedName:Pe,source:ie})}}function Y(B){return[B.importedName,...B.members??[]].join(".")}function ae(B,G){let ie=[],se=G;while(se.type==="MemberExpression"){if(se.computed||!e(se.property))return;ie.unshift(se.property.name),se=se.object}if(!e(se))return;let de=se.name,ke=(_e,Ae,De)=>De.length>0?{source:_e,importedName:Ae,members:De}:{source:_e,importedName:Ae},Pe=B.valueImportBindingsByLocalName.get(de);if(Pe)return ke(Pe.source,Pe.importedName,ie);for(let _e of[B.parsed?.instance,B.parsed?.module])for(let Ae of _e?.content.body??[]){if(Ae.type!=="ImportDeclaration")continue;let De=Ae,Re=De.source.value;if(De.importKind==="type"||typeof Re!=="string")continue;let Oe=De.specifiers.find((Ie)=>Ie.local.name===de);if(Oe?.type==="ImportDefaultSpecifier")return ke(Re,"default",ie);if(Oe?.type==="ImportNamespaceSpecifier"&&ie.length>0)return ke(Re,ie[0],ie.slice(1))}return}function Z(B,G){if(!A(G))return;return ae(B,G)}function ye(B){let G=new Map;for(let ie of B.content.body){if(ie.type!=="ImportDeclaration")continue;let se=ie;if(se.importKind==="type")continue;let de=se.source.value;if(typeof de!=="string")continue;for(let ke of se.specifiers){let Pe=ke.local.name;if(!Pe||ke.importKind==="type")continue;let _e;if(ke.type==="ImportDefaultSpecifier")_e="default";else if(ke.type==="ImportNamespaceSpecifier")_e="*";else if(ke.imported.type==="Identifier")_e=ke.imported.name;else _e=String(ke.imported.value??Pe);G.set(Pe,{from:de,imported:_e})}}return G}function ce(B,G){for(let ie of G?.content.body??[]){if(ie.type==="ImportDeclaration"){q(B,ie);continue}let se=ie.type==="ExportNamedDeclaration"&&ie.declaration?ie.declaration:ie;if(se.type==="FunctionDeclaration"&&se.id?.name)B.funcDecls.set(se.id.name,se)}}function Ql(B,G,ie){let se=Yl(B);return G.map((de)=>{let ke=ie.graph.resolve(de.importSource,se);if(!ke)return{candidate:de};let Pe=Qt(ke,de,ie);if(Pe?.kind!=="const"||Pe.literalValue===void 0)return{candidate:de};return{candidate:de,key:Pe.literalValue}})}function Zl(B,G){for(let{candidate:ie,key:se}of G){if(!se){let _e=Y(ie);B.diagnostics=[...B.diagnostics??[],i({component:B.filePath,kind:"context-key-unresolved",name:_e,message:`setContext key \`${_e}\` from "${ie.importSource}" isn't an \`export const\` string or Symbol() sveld can read; the context is skipped.`,...ie.source?{source:ie.source}:{}})];continue}let de=[...B.contexts??[]],ke=de.findIndex((_e)=>_e.key===se);if(ke!==-1){let _e=de[ke],Ae=Oo(_e.source,ie.source),De=Ae?_e.source:ie.source;if(B.diagnostics=[...B.diagnostics??[],i({component:B.filePath,kind:"context-duplicate-key",name:se,message:`setContext("${se}", ...) was called more than once; only the first call's shape is used.`,...De?{source:De}:{}})],!Ae)continue;de.splice(ke,1)}let Pe=de.findIndex((_e)=>Oo(_e.source,ie.source));de.splice(Pe===-1?de.length:Pe,0,{key:se,typeName:_(se),...ie.type===void 0?{}:{type:ie.type},description:ie.description,properties:ie.properties,...ie.hasUnresolvedSpread?{hasUnresolvedSpread:!0}:{},...ie.internal?{internal:!0}:{},source:ie.source}),B.contexts=de}}function Oo(B,G){if(!B||!G)return!1;let{line:ie,column:se}=B.start;return ie>G.start.line||ie===G.start.line&&se>G.start.column}var Lo={collect:(B)=>B.pendingContextKeyCandidates??[],resolve:Ql,apply:Zl};import{dirname as ef}from"node:path";function K(B,G){let ie=u(B.name,G.name);if(ie!==0)return ie;let se=u(B.type,G.type);if(se!==0)return se;if(B.type==="forwarded"&&G.type==="forwarded"){let de=u(B.element,G.element);if(de!==0)return de}return u(B.detail??"",G.detail??"")}function pe(B){return B==="TSTypeAnnotation"||B==="TSTypeAliasDeclaration"||B==="TSInterfaceDeclaration"||B==="TSTypeParameterDeclaration"||B==="TSTypeParameterInstantiation"}function N(B,G,ie,se){ai(B,null,null,G,ie,se?.skipTypeOnlySubtrees===!0)}function ai(B,G,ie,se,de,ke){se(B,G,ie);let Pe=B,_e=B.type;if((_e==="Identifier"||_e==="Literal"||_e==="Text")&&Pe.typeAnnotation===void 0){if(de)de(B);return}if(ke&&_e.charCodeAt(0)===84&&pe(_e)){if(de)de(B);return}for(let Ae in Pe){if(Ae==="leadingComments")continue;let De=Pe[Ae];if(!De||typeof De!=="object")continue;if(Array.isArray(De))for(let Re=0;Re<De.length;Re++){let Oe=De[Re];if(Oe&&typeof Oe==="object"&&typeof Oe.type==="string")ai(Oe,B,Ae,se,de,ke)}else if(typeof De.type==="string")ai(De,B,Ae,se,de,ke)}if(de)de(B)}function tf(B,G,ie){let se=ef(B);return G.map((de)=>{let ke=ie.graph.resolve(de.importSource,se);if(!ke)return{candidate:de,failureReason:"module-not-found"};let Pe=Qt(ke,de,ie)?.functionNode;if(!Pe)return{candidate:de,failureReason:"not-a-function"};let _e=nf(Pe,de);if(!_e)return{candidate:de,failureReason:"parameter-not-found"};return of(Pe,_e,de)})}function Mo(B){return B?.type==="AssignmentPattern"?je(B.left):B}function nf(B,G){let ie=Array.isArray(B.params)?B.params:[],se=Mo(je(ie[G.argumentIndex]));if(G.property===void 0)return e(se)?{name:se.name}:void 0;if(!G.property)return;if(e(se))return{object:se.name,property:G.property};if(se?.type!=="ObjectPattern"||!Array.isArray(se.properties))return;for(let de of se.properties){if(de.type!=="Property"||de.computed)continue;let ke=je(de.key);if(!e(ke)||ke.name!==G.property)continue;let Pe=Mo(je(de.value));return e(Pe)?{name:Pe.name}:void 0}return}function ci(B){if(!B)return null;if(B.type==="ConditionalExpression"){let ie=ci(je(B.consequent)),se=ci(je(B.alternate));return ie&&se?[...ie,...se]:null}let G=y(B);return G?[G]:null}var rf={variableType:()=>{return}};function sf(B){if(!B)return"null";let{deriveLiteralDetailType:G,literalDetailToTypeText:ie}=mt();if(B.type==="Literal")return ie(B.value);return G(rf,B)??"any"}function Fo(B,G){if("name"in G)return B.type==="Identifier"&&B.name===G.name;if(B.type!=="MemberExpression"||B.computed)return!1;let ie=je(B.object),se=je(B.property);return e(ie)&&ie.name===G.object&&e(se)&&se.name===G.property}function of(B,G,ie){let se=je(B.body);if(!se)return{candidate:ie,events:[]};let de=new Map,ke="name"in G?G.name:G.object,Pe;if(N(se,(Ae,De,Re)=>{if(Pe)return;if(Ae.type==="CallExpression"){let Ie=je(Ae.callee);if(!Ie||!Fo(Ie,G))return;let $e=Array.isArray(Ae.arguments)?Ae.arguments:[],Me=ci($e[0]);if(!Me){Pe="dynamic-event-name";return}for(let Le of Me){let Ve=de.get(Le)??new Set;Ve.add(sf($e[1])),de.set(Le,Ve)}return}let Oe=De?.type==="CallExpression"&&Re==="callee";if(Ae.type==="MemberExpression"&&Fo(Ae,G)&&!Oe){Pe="passed-on";return}if(Ae.type!=="Identifier"||Ae.name!==ke)return;if(Oe)return;if(!("name"in G)&&De?.type==="MemberExpression"&&Re==="object")return;if(De?.type==="MemberExpression"&&Re==="property"&&!De.computed)return;if(De?.type==="Property"&&Re==="key"&&!De.computed)return;Pe="passed-on"}),Pe)return{candidate:ie,failureReason:Pe};let _e=Array.from(de,([Ae,De])=>{let Re=Array.from(De);return{name:Ae,detail:Re.includes("any")?"any":Re.join(" | ")}});return{candidate:ie,events:_e}}function af(B,G){let ie=B.members?`"${B.calleeText}"`:B.importedName==="default"?"the default export":`"${B.importedName}"`;switch(G){case"module-not-found":return`"${B.importSource}" isn't a local module sveld can read`;case"not-a-function":return`${ie} isn't a function declared in "${B.importSource}"`;case"parameter-not-found":return`no parameter of ${ie} receives it`;case"dynamic-event-name":return"an event name isn't a string literal";case"passed-on":return`${ie} passes it on`}}function cf(B,G,{deferredEventNoSourceDiagnostics:ie=[],untypedJsDocEventNames:se=[]}){let de=new Map,ke=[...B.diagnostics??[]],Pe=!0;for(let{candidate:$e,events:Me,failureReason:Le}of G){if(Le){Pe=!1,ke.push(i({component:B.filePath,kind:"dispatch-escapes",name:$e.dispatcherName,message:`\`${$e.dispatcherName}\` is passed to \`${$e.calleeText}\`, but sveld couldn't read the events it dispatches: ${af($e,Le)}. Document them with @event tags.`,...$e.source?{source:$e.source}:{},...$e.ignored?{ignored:!0}:{}}));continue}for(let Ve of Me??[]){if(de.has(Ve.name))continue;de.set(Ve.name,{type:"dispatched",name:Ve.name,detail:Ve.detail,...$e.source?{source:$e.source}:{}})}}if(Pe){for(let $e of ie)if(!de.has($e.name))ke.push($e)}if(B.diagnostics=ke,de.size===0)return;let _e=new Map,Ae=new Set;for(let $e of B.events)if($e.type==="dispatched")Ae.add($e.name);else if(!_e.has($e.name))_e.set($e.name,$e);let De=new Set(se),Re=new Map,Oe=[];for(let $e of de.values()){if(Ae.has($e.name)){if(De.has($e.name)&&$e.detail!==void 0)Re.set($e.name,$e.detail);continue}let Me=_e.get($e.name);if(!Me){Oe.push($e);continue}let Le=$e.source??Me.source;Oe.push({type:"dispatched",name:$e.name,detail:Me.detail??$e.detail,...Me.description?{description:Me.description}:{},...Me.deprecated===void 0?{}:{deprecated:Me.deprecated},...Me.tags?{tags:Me.tags}:{},...Me.internal?{internal:!0}:{},...Le?{source:Le}:{}})}if(Oe.length===0&&Re.size===0)return;let Ie=new Set(Oe.map(($e)=>$e.name));B.events=[...B.events.filter(($e)=>$e.type==="dispatched"||!Ie.has($e.name)).map(($e)=>{let Me=$e.type==="dispatched"?Re.get($e.name):void 0;return Me===void 0?$e:{...$e,detail:Me}}),...Oe].sort(K)}var Bo={collect:(B)=>B.pendingDispatchEscapeCandidates??[],resolve:tf,apply:cf};function Yn(B){return(G)=>{let ie=B.collect(G);if(ie.length===0)return;return(se,de,ke)=>B.apply(se,B.resolve(de,ie,ke),G)}}var uf=[Yn(Io),Yn($o),Yn(Lo),Yn(Bo)];async function Vo(B,G,ie,se){let de=[];for(let Pe of B){let _e=ie(Pe);if(_e===void 0)continue;let Ae=uf.flatMap((De)=>De(_e)??[]);if(Ae.length>0)de.push({component:Pe,passes:Ae})}let ke=new Map;if(de.length===0)return ke;await Tt();for(let{component:Pe,passes:_e}of de){let Ae=zn(se),De=G(Pe.filePath);for(let Re of _e)Re(Pe,De,Ae);ke.set(Pe.filePath,Array.from(Ae.cache.keys()))}return ke}class S extends Error{constructor(B){super(`sveld's template parser doesn't support ${B} yet.`);this.name="TemplateParseNotImplementedError"}}var pf=/^```([\w-]*)\r?\n([\s\S]*?)\r?\n?```$/,lf=new Set(["","js","jsx","ts","tsx","javascript","typescript"]),ff=new Set(["svelte","html"]);function df(B){let G=B.trim();if(G==="")return null;let ie=G.match(pf);if(ie){let se=ie[1].toLowerCase(),de=ie[2].trim();if(de==="")return null;if(lf.has(se))return{kind:"compile",code:de};if(ff.has(se))return{kind:"syntax",code:de};return null}if(G.startsWith("<"))return null;return{kind:"compile",code:G}}function jo(B){if(!B.isFunction)return"any";return`(${(B.params??[]).map((ie)=>`${ie.name}${ie.optional?"?":""}: any`).join(", ")}) => any`}function Qn(B,G,ie,se,de){let ke=(B??[]).filter((_e)=>_e.name==="example"),Pe=[];return ke.forEach((_e,Ae)=>{let De=df(_e.body);if(De===null)return;let Re=ke.length>1;Pe.push({id:Re?`${G}#${Ae}`:G,name:Re?`${ie} (example ${Ae+1})`:ie,type:se,code:De.code,kind:De.kind,...de?{source:de}:{}})}),Pe}function Go(B){return B.name??"default"}function hf(B){let G=[];for(let ie of B.props)G.push(...Qn(ie.tags,`prop:${ie.name}`,ie.name,jo(ie),ie.source));for(let ie of B.moduleExports)G.push(...Qn(ie.tags,`export:${ie.name}`,ie.name,jo(ie),ie.source));for(let ie of B.slots)G.push(...Qn(ie.tags,`slot:${Go(ie)}`,Go(ie),"any",ie.source));for(let ie of B.events)G.push(...Qn(ie.tags,`event:${ie.name}`,ie.name,"any",ie.source));return G}function mf(B){let G=[];for(let ie of B){let se=hf(ie);if(se.length===0)continue;G.push({component:ie,sources:se})}return G}function Wo(B,G){let ie=[];for(let{component:se,sources:de}of B){let ke=de.filter((Pe)=>Pe.kind===G);if(ke.length===0)continue;ie.push({component:se,sources:ke})}return ie}async function gf(B){let{parseSvelte:G}=await Tt(),ie=new Map;for(let{component:se,sources:de}of B){let ke=[];for(let Pe of de)try{G(Pe.code)}catch(_e){if(_e instanceof S)continue;ke.push(i({component:se.filePath,kind:"example-syntax-error",name:Pe.name,message:_e instanceof Error?_e.message:String(_e),...Pe.source?{source:Pe.source}:{}}))}ie.set(se,ke)}return ie}async function xf(B,G,ie){let se=await G.checkExamples(B.map(({component:ke,sources:Pe})=>({moduleName:ke.moduleName,filePath:ie(ke.filePath),sources:Pe}))),de=new Map;for(let{component:ke,sources:Pe}of B){let _e=se.get(ie(ke.filePath));if(!_e||_e.length===0)continue;let Ae=new Map(Pe.map((De)=>[De.id,De.source]));de.set(ke,_e.map((De)=>{let Re=Ae.get(De.id);return i({component:ke.filePath,kind:"example-compile-error",name:De.name,message:De.message,...Re?{source:Re}:{}})}))}return de}async function Uo(B,G,ie,se){let de=mf(B),ke=G===!0?Wo(de,"compile"):[],Pe=Wo(de,"syntax"),_e=new Map,Ae=(De)=>{for(let[Re,Oe]of De)_e.set(Re,[..._e.get(Re)??[],...Oe])};if(Pe.length>0)Ae(await gf(Pe));if(ke.length>0){let{TypeResolver:De}=await import("./chunk-4zz6y1q7.js"),Re=await De.create(ie);if(!Re.ok)throw Error(`sveld: \`checkExamples\` ${Re.message}.`);let Oe=Re.resolver;try{Ae(await xf(ke,Oe,se))}finally{await Oe.dispose()}}return _e}import{hash as yf}from"node:crypto";import{existsSync as vf,mkdirSync as Cf,readFileSync as bf,renameSync as Ef,writeFileSync as Ho}from"node:fs";import{dirname as ui,isAbsolute as Sf,join as zo,resolve as Zn}from"node:path";var pi=10,kf=zo("node_modules",".cache","sveld","parse-cache.json"),wf="800f05b97be08e35";function li(){return`${gn}+${wf}+svelte@${rn}`}function Pf(B){for(let G=Zn(B);;G=ui(G)){if(vf(zo(G,"package.json")))return G;if(ui(G)===G)return Zn(B)}}function Xo(B,G){let ie=Pf(B);if(typeof G==="string")return Sf(G)?G:Zn(ie,G);return Zn(ie,kf)}function er(B){return yf("sha256",B,"hex")}function Ko(){return{formatVersion:pi,toolchainVersion:li(),entries:{}}}function _f(B){try{let G=bf(B,"utf-8"),ie=JSON.parse(G);if(ie.formatVersion!==pi||ie.toolchainVersion!==li())return Ko();return ie}catch{return Ko()}}class fi{cacheFilePath;file;next=new Map;dirty=!1;savedEntryCount;constructor(B){this.cacheFilePath=B,this.file=_f(B),this.savedEntryCount=Object.keys(this.file.entries).length}has(B,G){return this.lookup(B,G)!==void 0}lookup(B,G){let ie=this.next.get(B);if(ie?.hash===G)return ie;let se=this.file.entries[B];return se?.hash===G?se:void 0}get(B,G){let ie=this.lookup(B,G);if(ie===void 0)return null;this.next.set(B,ie);let{component:se,typeScriptMetadata:de,pending:ke}=structuredClone({component:ie.component,typeScriptMetadata:ie.typeScriptMetadata,pending:ie.pending});if(de!==void 0)se[h]=de;return ke===void 0?{component:se}:{component:se,pending:ke}}set(B,G,{component:ie,pending:se}){this.dirty=!0,this.next.set(B,{hash:G,...structuredClone({component:ie,typeScriptMetadata:ie[h],pending:se})})}getGeneratedText(B,G){let ie=this.next.get(B);if(ie?.generatedText===void 0||ie.generatedText.key!==G)return;return ie.generatedText.text}setGeneratedText(B,G,ie){let se=this.next.get(B);if(se===void 0)return;if(se.generatedText?.key===G&&se.generatedText.text===ie)return;se.generatedText={key:G,text:ie},this.dirty=!0}save(){if(!this.dirty&&this.next.size===this.savedEntryCount)return;this.dirty=!1,this.savedEntryCount=this.next.size,Cf(ui(this.cacheFilePath),{recursive:!0});let B={formatVersion:pi,toolchainVersion:li(),entries:Object.fromEntries(this.next)},G=JSON.stringify(B),ie=`${this.cacheFilePath}.${process.pid}.tmp`;try{Ho(ie,G),Ef(ie,this.cacheFilePath)}catch{try{Ho(this.cacheFilePath,G)}catch{}}}}import{dirname as Af,relative as Tf,resolve as Nf}from"node:path";async function qo(B,G={}){await Tt();let ie=Nf(B),se=Af(ie),de=(_e)=>t(`./${Tf(se,_e)}`),ke=Xn(ie,{...zn(G.graph??new Nt),onAmbiguousStarExport:(_e,Ae,De)=>{if(_e!==ie||!G.diagnostics)return;if(De.every(($e)=>$e.declFile.endsWith(".svelte")))return;let Re=Array.from(new Set(De.map(($e)=>de($e.declFile)))),Oe=Re.map(($e)=>`"${$e}"`),Ie=`${Oe.slice(0,-1).join(", ")} and ${Oe[Oe.length-1]}`;G.diagnostics.push(i({component:de(ie),kind:"export-ambiguous",name:Ae,message:`"${Ae}" is exported by ${Ie} through \`export *\`, so the barrel doesn't export it and the docs leave it out; export it explicitly from the barrel (e.g. \`export { ${Ae} } from "${Re[0]}"\`).`}))}}),Pe=new Map;for(let _e of ke){if(_e.name==="default"||_e.declFile.endsWith(".svelte"))continue;let{declFile:Ae,returnType:De,literalValue:Re,primitiveLiteral:Oe,declaredType:Ie,functionNode:$e,namespaceFile:Me,...Le}=_e,Ve=de(Ae);if(Me!==void 0)Le.type=`typeof import(${JSON.stringify(de(Me))})`;Pe.set(_e.name,{...Le,source:Ve})}return Array.from(Pe.values()).sort((_e,Ae)=>u(_e.name,Ae.name))}async function Rf(B){let G=await Promise.all(Array.from(B).map(async(ie)=>{try{let se=await Df(ie,"utf-8");return{path:ie,content:se}}catch(se){return console.warn(`Warning: Failed to read file ${ie}:`,se),{path:ie,content:null}}}));return new Map(G.map(({path:ie,content:se})=>[ie,se]))}function Yo(B){if(B.length===0)return;console.error(`sveld: failed to parse ${B.length} component(s):`);for(let{filePath:G,message:ie}of B)console.error(` - ${G}: ${ie}`)}class mn{input;glob;options;graph=new Nt;collected;entryFile=null;globMergeState;cache;entryExports=[];entryDiagnostics=[];records=new Map;parseErrors=new Map;canonicalEntries=new Map;warnedModuleNames=new Set;constructor(B,G,ie={}){this.input=B,this.glob=G,this.options=ie}get documentExports(){return this.options.documentExports===!0}async build(){return this.graph=new Nt,this.collected=ei(this.input,this.glob,this.documentExports,this.graph),this.globMergeState=Hn(this.collected.allComponentEntries,this.collected.resolveComponentFilePath),this.entryFile=Jo(this.input).isFile()?di(this.input):null,this.cache=this.options.cache===!1?void 0:new fi(Xo(this.collected.rootDir,this.options.cache??!0)),await this.readEntryExports(),this.records.clear(),this.parseErrors.clear(),this.indexEntries(),await this.process(this.componentPaths()),Yo(Array.from(this.parseErrors.values())),this.assemble()}async update(B){let G=B.map((De)=>di(De));if(this.graph.invalidate(...G),G.length===0)return{result:this.assemble(),reparsed:[]};let ie=this.entryFile!==null&&G.includes(this.entryFile)?await this.recollect():[];if(this.glob){let{rootDir:De,exports:Re,allComponentEntries:Oe,resolveComponentFilePath:Ie}=this.collected;Zr(this.graph,De,Re,Oe,Ie,this.globMergeState)}this.indexEntries();let se=this.componentPaths();for(let De of this.records.keys())if(!se.has(De))this.records.delete(De);for(let De of this.parseErrors.keys())if(!se.has(De))this.parseErrors.delete(De);let de=Array.from(this.records).flatMap(([De,{crossFileReads:Re}])=>Re?.some((Oe)=>G.includes(Oe))?[De]:[]),ke=new Set([...G.filter((De)=>yt.test(De)),...ie,...de]),Pe=new Set(Array.from(se).filter((De)=>ke.has(De))),_e=await this.process(Pe),Ae=this.assemble();return Yo(Ae.errors),{result:Ae,reparsed:_e}}async recollect(){let B=this.collected,G=ei(this.input,this.glob,this.documentExports,this.graph),ie=[];for(let[se,de]of Object.entries(G.exports)){let ke=G.resolveComponentFilePath(de.source),Pe=Object.hasOwn(B.exports,se)?B.exports[se]:void 0;if(Pe===void 0||B.resolveComponentFilePath(Pe.source)!==ke)ie.push(ke)}return this.collected=G,this.globMergeState=Hn(G.allComponentEntries,G.resolveComponentFilePath),await this.readEntryExports(),ie}async readEntryExports(){this.entryDiagnostics=[],this.entryExports=this.documentExports&&Jo(this.input).isFile()?await qo(di(this.input),{diagnostics:this.entryDiagnostics,graph:this.graph}):[]}componentPaths(){let{exports:B,allComponentEntries:G,resolveComponentFilePath:ie}=this.collected,se=new Set;for(let[,de]of[...Object.entries(B),...G])if(Ut(de.source))se.add(ie(de.source));return se}indexEntries(){let{exports:B,allComponentEntries:G,resolveComponentFilePath:ie}=this.collected;this.canonicalEntries=new Map;for(let se of[Object.entries(B),G])for(let[de,ke]of se){if(!Ut(ke.source))continue;this.canonicalEntries.set(ie(ke.source),{moduleName:ti(de,ke.source,se.length,this.warnedModuleNames),filePath:t(ke.source)})}}canonicalEntry(B){let G=this.canonicalEntries.get(B);if(G===void 0)throw Error(`sveld: no entry lists ${B}.`);return G}async process(B){let G=new Map,ie=await this.parse(B,G);this.cache?.save();let se=await this.settle(ie);for(let de of B)this.records.delete(de),this.parseErrors.delete(de);for(let[de,ke]of se)this.records.set(de,ke);for(let[de,ke]of G)this.parseErrors.set(de,ke);return Array.from(se.keys())}async parse(B,G){let ie=await Rf(B),se=this.cache,de=new Map,ke=new Set;if(se)for(let[_e,Ae]of ie){if(Ae===null)continue;let De=er(Ae);if(de.set(_e,De),!se.has(_e,De))ke.add(_e)}if(B.size>0&&(!se||ke.size>0))await Tt();let Pe=new Map;for(let _e of B){let Ae=ie.get(_e);if(Ae===null||Ae===void 0)continue;let De=this.parseOne(_e,Ae,de.get(_e),G);if(De)Pe.set(_e,De)}return Pe}parseOne(B,G,ie,se){let de=ie===void 0?null:this.cache?.get(B,ie);if(de)return de;let{moduleName:ke,filePath:Pe}=this.canonicalEntry(B),_e;try{_e=new(mt()).ComponentParser().parse(G,{moduleName:ke,filePath:Pe})}catch(Ae){if(this.options.failFast)throw Ae;se.set(B,{filePath:Pe,moduleName:ke,message:Ae instanceof Error?Ae.message:String(Ae),stack:Ae instanceof Error?Ae.stack:void 0});return}if(ie!==void 0)this.cache?.set(B,ie,_e);return _e}async settle(B){let{rootDir:G,resolveComponentFilePath:ie}=this.collected,se=new Map,de=new Map;for(let[Ae,{component:De,pending:Re}]of B){let Oe={...this.canonicalEntry(Ae),...De};se.set(Ae,Oe),de.set(Oe,Re)}let{checkExamples:ke}=this.options;if(ke){let Ae=await Uo(se.values(),ke,G,ie);for(let[De,Re]of Ae)or(De,Re)}let Pe=await Vo(se.values(),ie,(Ae)=>de.get(Ae),this.graph),_e=new Map;for(let[Ae,De]of se){let{moduleName:Re,filePath:Oe,...Ie}=De,$e=Pe.get(Oe);_e.set(Ae,$e===void 0?{component:Ie}:{component:Ie,crossFileReads:$e})}return _e}assemble(){let{exports:B,allComponentEntries:G,resolveComponentFilePath:ie}=this.collected,se=this.cache,de=(Ie,[$e,Me])=>{if(!Ut(Me.source))return;let Le=this.records.get(ie(Me.source));if(Le===void 0)return;return{component:{moduleName:ti($e,Me.source,Ie.length,this.warnedModuleNames),filePath:t(Me.source),...Le.component},record:Le}},ke=new Map,Pe=se?new Map:void 0,_e=se?new Map:void 0,Ae=new Set;for(let Ie of G){let $e=de(G,Ie);if($e===void 0)continue;if(ke.set($e.component.filePath,$e.component),Pe?.set($e.component.filePath,ie(Ie[1].source)),$e.record.crossFileReads!==void 0)Ae.add($e.component.filePath)}if(Pe&&_e)for(let Ie of ke.keys()){let $e=Pe.get(Ie);if(!Ae.has(Ie)||$e===void 0)continue;Pe.delete(Ie),_e.set(Ie,$e)}let De=Ss(ke,ie,this.graph);for(let Ie of ke.values())or(Ie,[...De(Ie),...Es(Ie)]);let Re=new Map,Oe=Object.entries(B);for(let Ie of Oe){let $e=de(Oe,Ie);if($e===void 0)continue;let Me=ke.get($e.component.filePath);if(Me)$e.component.diagnostics=Me.diagnostics;Re.set($e.component.moduleName,$e.component)}return{exports:B,entryExports:this.entryExports,components:Re,allComponentsForTypes:ke,errors:Array.from(this.parseErrors.values()),diagnostics:Vi(ji([...Array.from(ke.values()).flatMap((Ie)=>Ie.diagnostics??[]),...this.entryDiagnostics]),this.options.diagnostics?.ignore),cache:se,resolvedPathByFilePath:Pe,crossFileResolvedPathByFilePath:_e}}}function E(B){return{failFast:B?.failFast,documentExports:B?.documentExports===!0,cache:B?.cache,checkExamples:B?.checkExamples==="syntax"?"syntax":B?.checkExamples===!0,diagnostics:B?.diagnostics}}async function C(B,G,ie={}){return new mn(B,G,ie).build()}import{existsSync as hi,readFileSync as If}from"node:fs";import{isAbsolute as $f,join as Zo}from"node:path";function Qo(B){return $f(B)?B:Zo(process.cwd(),B)}function le(B){if(B){let de=Qo(B);if(hi(de))return{entry:U(B)};return{entry:null,configured:!0,message:`Invalid entry point: ${de}. Pass a valid --entry (or "entry" option), or unset it and set the "svelte" field in your package.json instead.`}}let G=Zo(process.cwd(),"package.json");if(!hi(G))return{entry:null,configured:!1,message:'Could not locate a package.json file. Specify an entry point with --entry (or the "entry" option).'};let ie;try{ie=ho(JSON.parse(If(G,"utf-8")))}catch(de){throw console.error("Error reading package.json:",de),de}let se=ie.svelte?.trim();if(!se)return{entry:null,configured:!1,message:'Could not determine an entry point. Set the "svelte" field in your package.json, or pass --entry (or the "entry" option).'};if(!hi(Qo(se)))return{entry:null,configured:!0,message:`The "svelte" field in package.json points to "${se}", which does not exist.`};return{entry:U(se)}}function tr(B){let G=le(B);if(G.entry===null)console.error(G.message);return G.entry}async function ea(B,G,ie={}){let se=new mn(B,G,{...ie,failFast:!1}),de=await se.build();return{get result(){return Promise.resolve(de)},async update(ke){let Pe=await se.update(ke);return de=Pe.result,Pe}}}import gi from"node:path";function ta(B){let G=new Map;for(let[se,de]of Object.entries(B)){let ke=G.get(de.source)||[];ke.push({id:se,exportee:de}),G.set(de.source,ke)}let ie=[];for(let[se,de]of G){let ke=yt.test(se),Pe=de.some(({id:Ie,exportee:$e})=>Ie!=="default"&&$e.default),_e=de.some(({exportee:Ie})=>!Ie.default),Ae=ke&&Pe&&_e,De=[],Re=[],Oe=[];for(let{id:Ie,exportee:$e}of de){if(Ie==="default"){Re.push(`export { default } from "${se}";`);continue}if($e.default)if($e.mixed)Re.push(`export { default as ${Ie} } from "${se}";`),Re.push(`export { default } from "${se}";`);else Oe.push(`default as ${Ie}`);else if(ke&&!Ae)Oe.push(`default as ${Ie}`);else De.push(Ie)}if(Oe.length>0&&De.length>0)ie.push(`export { ${[...Oe,...De].join(", ")} } from "${se}";`);else{if(De.length>0)ie.push(`export { ${De.join(", ")} } from "${se}";`);if(Oe.length>0)ie.push(`export { ${Oe.join(", ")} } from "${se}";`)}ie.push(...Re)}return ie.join(`
192
+ `)}function na(B){return B.filter((G)=>G.names.length>0).map((G)=>`export type { ${G.names.join(", ")} } from "${G.source}";`).join(`
193
+ `)}function ra(B){return B.replace(yt,"")}function mi(B){return B.replace(yt,".svelte.d.ts")}import{mkdir as Of,readFile as Lf,writeFile as Mf}from"node:fs/promises";import{parse as Ff}from"node:path";class Ct{ensuredDirs=new Set;async write(B,G){try{if(await Lf(B,"utf-8")===G)return!1}catch{}let ie=Ff(B).dir;if(!this.ensuredDirs.has(ie))await Of(ie,{recursive:!0}),this.ensuredDirs.add(ie);return await Mf(B,G),!0}}function Bf(B){return typeof B==="object"&&B!==null&&!Array.isArray(B)&&"start"in B&&"end"in B}function nr(B){if(Array.isArray(B))return B.map((G)=>nr(G));if(B!==null&&typeof B==="object"){let G={};for(let[ie,se]of Object.entries(B)){if((ie==="source"||ie==="componentCommentSource")&&Bf(se))continue;G[ie]=nr(se)}return G}return B}function ia(B,G){return B.map((ie)=>({...ie,filePath:Ui(ie.filePath,G)}))}function Vf(B,G,ie){if(!G)return`${B.moduleName}.api.json`;if(!ie.has(B.moduleName))ie.add(B.moduleName),console.warn(`Warning: multiple components named "${B.moduleName}" found. Their JSON files are keyed by source path instead of name to avoid overwriting each other.`);return`${ra(B.filePath)}.api.json`}async function jf(B,G){let ie=f(B),se=ia(ie.components,G.inputDir);if(G.source===!1)se=nr(se);let de=new Map;for(let Pe of se)de.set(Pe.moduleName,(de.get(Pe.moduleName)??0)+1);let ke=new Set;await Promise.all(se.map(async(Pe)=>{let _e=(de.get(Pe.moduleName)??0)>1,Ae=Vf(Pe,_e,ke),De=gi.resolve(gi.join(G.outDir||"",Ae)),Oe=await new Ct().write(De,nn(Pe));wt(`${Oe?"created":"unchanged"} "${De}".`)}))}function xi(B,G){let ie=f(B,{entryExports:G.entryExports}),se={...ie,components:ia(ie.components,G.inputDir)};return G.source===!1?nr(se):se}function yi(B,G){return nn(xi(B,G))}async function Gf(B,G){let ie=yi(B,G),se=gi.resolve(G.outFile),ke=await new Ct().write(se,ie);wt(`${ke?"created":"unchanged"} "${G.outFile}".`)}async function vi(B,G){if(G.outDir)await jf(B,G);else await Gf(B,G)}import{join as Pa,resolve as Ai}from"node:path";var sa=/`/g,oa=/\s+/g,xt="--",aa=`| Prop name | Required | Kind | Reactive | Binding | Type | Default value | Description |
194
+ | :- | :- | :- | :- | :- | :- | :- | :- |
195
+ `,ca=`| Slot name | Default | Props | Fallback | Description |
196
+ | :- | :- | :- | :- | :- |
197
+ `,ua=`| Event name | Type | Detail | Description |
198
+ | :- | :- | :- | :- |
199
+ `,Ei=`| Name | Kind | Type | Description |
200
+ | :- | :- | :- | :- |
201
+ `,Wf=`| Member | Signature | Description |
202
+ | :- | :- | :- |
203
+ `,pa=`| Part name | Description |
204
+ | :- | :- |
205
+ `,la=`| Property name | Type | Default value | Description |
206
+ | :- | :- | :- | :- |
207
+ `,Si=/\|/g,Uf=/</g,Hf=/>/g,Vt=/\n/g,Kf=/^[A-Za-z_$][\w$]*$/,zf=/\s*\n\s*/g,Xf=/&(?=#?\w+;)|<(?=[A-Za-z/!?])|[|`*]|\\(?=[!-/:-@[-`{-~])|(?<![A-Za-z0-9])_|_(?![A-Za-z0-9])/g,qf=/[&<|`*\\_]/;function ki(B){if(!qf.test(B))return B;return B.replace(Xf,(G)=>G==="&"?"&amp;":G==="<"?"&lt;":G==="_"?"&#95;":`&#${G.charCodeAt(0)};`)}function fa(B){return`<code>${ki(B.includes(`
208
+ `)?B.replace(zf," "):B)}</code>`}var Jf=/\{@link\s+([^{}\s|]+)(?:\|([^{}]+))?\}/g;function Yf(B){if(!B.includes("{@link"))return B;return B.replace(Jf,(G,ie,se)=>`[${se===void 0?ie:se.trim()}](${ie})`)}function Ci(B){return B.includes("```")||B.includes("~~~")}function bi(B){return ga(Yf(B))}var Qf=/^([ \t]*)(`{3,}|~{3,})(.*)$/,Zf=/^\n/,ed=/\n$/;function da(B){let G=(ke)=>({kind:"prose",text:bi(ke.join(`
209
+ `))});if(!Ci(B))return[G([B])];let ie=B.split(`
210
+ `),se=[],de=[];for(let ke=0;ke<ie.length;ke++){let Pe=Qf.exec(ie[ke]),[,_e="",Ae="",De=""]=Pe??[];if(!Pe||Ae[0]==="`"&&De.includes("`")){de.push(ie[ke]);continue}if(de.push(""),de.length>1)se.push(G(de));let Re=[],Oe=new RegExp(`^[ \\t]*${Ae[0]}{${Ae.length},}[ \\t]*$`);for(ke++;ke<ie.length&&!Oe.test(ie[ke]);ke++){let Ie=ie[ke],$e=0;while($e<_e.length&&(Ie[$e]===" "||Ie[$e]==="\t"))$e++;Re.push(Ie.slice($e))}se.push({kind:"code",code:Re.join(`
211
+ `)}),de=[""]}if(de.length>1||se.length===0)se.push(G(de));return se}function ha(B){let G="";for(let ie=0;ie<B.length;ie++){let se=B[ie];if(se.kind==="code"){G+=`<pre><code>${ki(se.code).replace(Vt,"<br />")}</code></pre>`;continue}let de=se.text;if(B[ie-1]?.kind==="code")de=de.replace(Zf,"");if(B[ie+1]?.kind==="code")de=de.replace(ed,"");G+=de.replace(Si,"&#124;").replace(Vt,"<br />")}return G}function dt(B){if(B===void 0)return xt;return fa(B)}function ma(B){if(!B.reExport)return dt(B.type);let{from:G,imported:ie}=B.reExport,se=ie==="*"?"":Kf.test(ie)?`.${ie}`:`[${JSON.stringify(ie)}]`;return dt(`typeof import(${JSON.stringify(G)})${se}`)}function ga(B){if(!B.includes("<")&&!B.includes(">"))return B;return B.replace(Uf,"&lt;").replace(Hf,"&gt;")}function wi(B){if(B===void 0)return xt;return fa(B)}function jt(B,G){if(G===void 0)return B;let ie=typeof G==="string"&&G.trim().length>0?`: ${ga(G).replace(Vt," ").replace(Si,"&#124;")}`:"";return`<s>${B}</s><br />**Deprecated**${ie}`}function rr(B){if(B===void 0||B.trim().length===0)return xt;return ha(da(B))}function xa(B){if(B===void 0||B==="{}")return xt;return dt(_n(B).replace(Vt," "))}function ya(B){if(B===void 0)return xt;return`<code>${ki(B).replace(Vt,"<br />")}</code>`}function Zt(B,G){let ie=B!==void 0&&B.trim().length>0;if(!(ie&&Ci(B))&&!G?.some(({body:Pe})=>Pe&&Ci(Pe))){let Pe=ie?[bi(B)]:[];for(let{name:_e,body:Ae}of G??[]){let De=Ae?.trim();Pe.push(De?`@${_e} ${bi(De)}`:`@${_e}`)}if(Pe.length===0)return xt;return Pe.join(`
212
+ `).replace(Si,"&#124;").replace(Vt,"<br />")}let se=[],de=(Pe)=>{let _e=se.at(-1);if(_e?.kind==="prose")_e.text+=Pe;else se.push({kind:"prose",text:Pe})},ke=(Pe,_e)=>{if(se.length>0)de(`
213
+ `);if(Pe)de(Pe);for(let Ae of da(_e))if(Ae.kind==="prose")de(Ae.text);else se.push(Ae)};if(ie)ke("",B);for(let{name:Pe,body:_e}of G??[]){let Ae=_e?.trim();ke(Ae?`@${Pe} `:`@${Pe}`,Ae??"")}if(se.length===0)return xt;return ha(se)}function va(B){if(B===void 0)return xt;return dt(B.replace(Vt," "))}function td(B){let G=[B.extends?`Extends ${dt(B.extends)}.`:"",B.implements?.length?`Implements ${B.implements.map((ie)=>dt(ie)).join(", ")}.`:""].filter(Boolean);return G.length>0?G.join(" "):void 0}function Ca(B,G){let ie=new Set;for(let se of G){if(se.kind!=="class")continue;let de=td(se);if(!se.members?.length&&!de)continue;let ke=se.localName??se.name;if(ie.has(ke))continue;if(ie.add(ke),B.append("h4",`\`${ke}\` members`),de)B.append("raw",`${de}
214
+
215
+ `);if(!se.members?.length)continue;B.append("raw",Wf);for(let Pe of se.members)B.append("raw",`| ${jt(Pe.name,Pe.deprecated)} | ${dt(_r(Pe))} | ${Zt(Pe.description,Pe.tags)} |
216
+ `);B.append("raw",`
217
+ `)}}var nd=/[^\w\- ]+/g,rd=/\s+/g;function id(B,G){let ie=B.toLowerCase().replace(sa,"").replace(nd,"").replace(rd,"-"),se=G.get(ie)??0;return G.set(ie,se+1),se===0?ie:`${ie}-${se}`}class Pi{sourceParts=[];hasToC=!1;toc=[];onAppend;constructor(B={}){this.onAppend=B.onAppend}get source(){return this.sourceParts.join("")}appendLineBreaks(){return this.sourceParts.push(`
218
+
219
+ `),this}append(B,G){switch(B){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":{let ie=Number(B.slice(-1));if(this.sourceParts.push(`${"#".repeat(ie)} ${G}`),this.hasToC&&B==="h2")this.toc.push({indent:0,raw:G??""});break}case"quote":this.sourceParts.push(`> ${G}`);break;case"p":this.sourceParts.push(G??"");break;case"divider":this.sourceParts.push("---");break;case"raw":this.sourceParts.push(G??"");break}if(B!=="raw")this.appendLineBreaks();return this.onAppend?.call(this,B,this),this}tableOfContents(){return this.sourceParts.push("<!-- __TOC__ -->"),this.hasToC=!0,this.appendLineBreaks(),this}end(){let B=this.sourceParts.join("");if(!this.hasToC)return B;let G="<!-- __TOC__ -->",ie=B.indexOf(G);if(ie===-1)return B;let se=new Map,de=this.toc.map(({indent:ke,raw:Pe})=>`${" ".repeat(ke)}- [${Pe}](#${id(Pe,se)})`).join(`
220
+ `);return B.slice(0,ie)+de+B.slice(ie+G.length)}}function ba(B,G,ie){if(B.append("h1","Component Index"),B.append("h2","Components").tableOfContents(),B.append("divider"),ie&&ie.length>0)Sa(B,ie);let se=f(G);for(let de of se.components)wa(B,de)}function Ea(B,G,ie){B.append("h1","Component Index"),B.append("h2","Components");for(let se of G)B.append("raw",`- [${se.moduleName}](./${se.moduleName}.md)
221
+ `);if(B.append("raw",`
222
+ `),B.append("divider"),ie&&ie.length>0)Sa(B,ie)}function Sa(B,G){B.append("h2","Exports"),B.append("raw",Ei);for(let ie of G){let se=(ie.type??ie.value)?.replace(oa," ").trim();B.append("raw",`| ${jt(ie.name,ie.deprecated)} | ${`<code>${ie.kind}</code>`} | ${dt(se)} | ${rr(ie.description)} |
223
+ `)}B.append("raw",`
224
+ `),B.append("divider")}function sd(B){return B.kind==="const"||B.isFunctionDeclaration}function od(B,G){B.append("h3","Module exports"),B.append("raw",Ei);for(let ie of G)B.append("raw",`| ${jt(ie.name,ie.deprecated)} | ${`<code>${ie.kind}</code>`} | ${ma(ie)} | ${Zt(ie.description,ie.tags)} |
225
+ `);B.append("raw",`
226
+ `),Ca(B,G)}function _i(B,G,ie,se){if(G.length>0)ie(),B.append("raw",`
227
+ `);else B.append("p",se??"None.")}function ka(B,G){wa(B,G)}function wa(B,G){if(B.append("h2",`\`${G.moduleName}\``),G.generics)B.append("p",`**Type parameters:** ${dt(`<${G.generics[1]}>`)}`);if(G.typedefs.length>0)B.append("h3","Types").append("raw",`\`\`\`ts
228
+ ${An({typedefs:G.typedefs})}
229
+ \`\`\`
230
+
231
+ `);if(B.append("h3","Props"),_i(B,G.props,()=>{B.append("raw",aa);let ie=(de)=>de.reactive?0:de.constant?2:1,se=G.props.map((de,ke)=>({prop:de,index:ke})).sort((de,ke)=>ie(de.prop)-ie(ke.prop)||de.index-ke.index).map(({prop:de})=>de);for(let de of se){let ke=sd(de)?"accessor":de.kind;B.append("raw",`| ${jt(de.name,de.deprecated)} | ${de.isRequired?"Yes":"No"} | ${`<code>${ke}</code>`} | ${de.reactive?"Yes":"No"} | ${de.binding??"--"} | ${dt(de.type)} | ${wi(de.value)} | ${Zt(de.description,de.tags)} |
232
+ `)}}),G.moduleExports.length>0)od(B,G.moduleExports);if(B.append("h3","Slots"),_i(B,G.slots,()=>{B.append("raw",ca);for(let ie of G.slots)B.append("raw",`| ${jt(ie.default?xt:ie.name??xt,ie.deprecated)} | ${ie.default?"Yes":"No"} | ${xa(ie.slot_props)} | ${ya(ie.fallback)} | ${Zt(ie.description,ie.tags)} |
233
+ `)}),B.append("h3","Events"),_i(B,G.events,()=>{B.append("raw",ua);for(let ie of G.events)B.append("raw",`| ${jt(ie.name,ie.deprecated)} | ${ie.type} | ${va(ie.detail)} | ${Zt(ie.description,ie.tags)} |
234
+ `)}),G.cssParts&&G.cssParts.length>0){B.append("h3","CSS Parts"),B.append("raw",pa);for(let ie of G.cssParts)B.append("raw",`| ${ie.name} | ${rr(ie.description)} |
235
+ `);B.append("raw",`
236
+ `)}if(G.cssProperties&&G.cssProperties.length>0){B.append("h3","CSS Custom Properties"),B.append("raw",la);for(let ie of G.cssProperties)B.append("raw",`| ${ie.name} | ${dt(ie.type)} | ${wi(ie.default)} | ${rr(ie.description)} |
237
+ `);B.append("raw",`
238
+ `)}}function Ti(B,G){return new Pi({onAppend:(ie,se)=>{B.onAppend?.call(null,ie,se,G)}})}async function ad(B,G){let ie=G.outDir,se=f(B,{entryExports:G.entryExports}),de=new Ct,ke=Ti(G,B);Ea(ke,se.components,G.entryExports);let Pe=Ai(Pa(ie,"README.md")),_e=await de.write(Pe,ke.end());wt(`${_e?"created":"unchanged"} "${Pe}".`),await Promise.all(se.components.map(async(Ae)=>{let De=Ti(G,B);ka(De,Ae);let Re=Ai(Pa(ie,`${Ae.moduleName}.md`)),Oe=await de.write(Re,De.end());wt(`${Oe?"created":"unchanged"} "${Re}".`)}))}function Ni(B,G){let ie=Ti(G,B);return ba(ie,B,G.entryExports),ie.end()}async function Di(B,G){if(G.outDir){await ad(B,G);return}let ie=Ai(G.outFile),se=await new Ct().write(ie,Ni(B,G));wt(`${se?"created":"unchanged"} "${G.outFile}".`)}import{join as cd,resolve as ud}from"node:path";function pd(B,G){if(!G.indexTypes)return[];let ie=G.format==="component",se=new Set,de=[];for(let[,ke]of Object.entries(G.exports)){if(!ke.default||!yt.test(ke.source))continue;let Pe=t(ke.source);if(se.has(Pe))continue;se.add(Pe);let _e=B.components.find((De)=>De.filePath===Pe);if(!_e)continue;let Ae=[Xt(_e.moduleName)];if(ie)Ae.push(on(_e.moduleName));de.push({source:ke.source,names:Ae})}return de}async function _a(B,G,ie){if(!B)return G;try{let se=await B(G,ie);if(typeof se!=="string")throw TypeError(`must return a string, got ${typeof se}`);return se}catch(se){let de=se instanceof Error?se.message:String(se);throw Error(`sveld: typesOptions.transform failed for "${ie.filePath}": ${de}`,{cause:se})}}function ld(B,G){return`${B}
239
+ ${bs(G)}`}async function Ri(B,G){let ie=ud(G.outDir,"index.d.ts"),se=new Ct,de=f(B),ke=na(pd(de,G)),Pe=G.preamble+[ta(G.exports),ke].filter(($e)=>$e!=="").join(`
240
+
241
+ `),_e=Ar(G),Ae=de.components.map(async($e)=>{let Me=mi(cd(G.outDir,$e.filePath)),Le=t(mi($e.filePath)),Ve=G.resolvedPathByFilePath?.get($e.filePath),We=Ve?void 0:G.crossFileResolvedPathByFilePath?.get($e.filePath),Ue=Ve??We,Xe=ld($e.moduleName,_e),Qe=We?`${Xe}
242
+ ${er(JSON.stringify($e))}`:Xe,Je=Ue?G.cache?.getGeneratedText(Ue,Qe):void 0;if(Je===void 0){if(Je=Tr($e,_e),Ue)G.cache?.setGeneratedText(Ue,Qe,Je)}let st=await _a(G.transform,Je,{kind:"component",component:$e,filePath:Le});return se.write(Me,st)}),De=(async()=>{let $e=await _a(G.transform,Pe,{kind:"index",filePath:"index.d.ts"});return se.write(ie,`${$e}
243
+ `)})(),Re=(await Promise.all([...Ae,De])).filter(Boolean).length,Oe=Ae.length+1,Ie=Re===0?`unchanged ${Oe}`:`created ${Re} of ${Oe}`;wt(`${Ie} TypeScript definitions in "${G.outDir}".`)}var Aa='sveld: could not resolve a Svelte entry point. Set package.json#svelte, or pass the "entry" option.',hd=["reportDiagnostics","strict","check","checkLevel","stdout","format"],md=50;function gd(B){let G=Promise.resolve();return()=>{G=G.then(B,B)}}function be(B){let G=B?.watch===!0,ie,se,de=B??{},ke,Pe=null,_e,Ae=new Set,Re=gd(async()=>{if(Pe==null||se==null||Ae.size===0)return;let Ie=Array.from(Ae);Ae.clear();try{let{result:$e}=await Pe.update(Ie);await v($e,de,se),$e.cache?.save()}catch($e){console.error("sveld: failed to regenerate types in watch mode:",$e)}}),Oe=(Ie)=>{if(!G||Pe==null||!Wi.test(Ie))return;Ae.add(Ie),clearTimeout(_e),_e=setTimeout(Re,md)};return{name:"vite-plugin-sveld",apply:G?void 0:"build",enforce:"post",configResolved(Ie){ke=Ie.root},async buildStart(){if(B?.config){let $e=ke??process.cwd(),Me=typeof B.config==="string"?await V(fd(B.config)?B.config:dd($e,B.config)):await L($e);de=w(Me,B)}R(de);let Ie=hd.filter(($e)=>($e in de));if(Ie.length>0)console.warn(`sveld: the Vite plugin ignores ${Ie.map(($e)=>`"${$e}"`).join(", ")}; run the sveld CLI or sveld() for them.`);if(O(de.quiet===!0),se=tr(de.entry),G&&se!=null)try{Pe=await ea(se,de.glob===!0,E(de));let $e=await Pe.result;await v($e,de,se),$e.cache?.save()}catch($e){console.error("sveld: failed to generate initial types in watch mode:",$e)}},async generateBundle(){if(G)return;if(se==null)this.error(Aa);ie=await C(se,de.glob===!0,E(de))},async writeBundle(){if(G)return;if(se==null)this.error(Aa);await v(ie,de,se),ie.cache?.save()},handleHotUpdate(Ie){Oe(Ie.file)},watchChange(Ie){Oe(Ie)}}}async function v(B,G,ie){let se=Ta(ie);if(G?.types!==!1)await Ri(B.allComponentsForTypes,{outDir:"types",preamble:"",...G?.typesOptions,exports:B.exports,inputDir:se,cache:B.cache,resolvedPathByFilePath:B.resolvedPathByFilePath,crossFileResolvedPathByFilePath:B.crossFileResolvedPathByFilePath});if(G?.json)await vi(B.components,{outFile:"COMPONENT_API.json",...G?.jsonOptions,inputDir:se,entryExports:B.entryExports});if(G?.markdown)await Di(B.components,{outFile:"COMPONENT_INDEX.md",...G?.markdownOptions,entryExports:B.entryExports})}async function Se(B,G,ie){let se=Ta(ie);if(G?.json){let de=yi(B.components,{...G?.jsonOptions,inputDir:se,entryExports:B.entryExports});process.stdout.write(de);return}if(G?.markdown){let de=Ni(B.components,{...G?.markdownOptions,entryExports:B.entryExports});process.stdout.write(de)}}import{dirname as xd}from"node:path";function fe(B){if(B.check&&!B.check.snapshotExists&&!B.writesSnapshot)return 1;if(B.check?.changes.some((G)=>G.kind==="schema"))return 1;if(B.errors.length>0)return 2;if(B.check&&Yi(B.check.bump,B.checkLevel??"major"))return 3;if(Bi(B.diagnostics,B.strict).length>0)return 4;return 0}async function ve(B){if(B&&"input"in B)throw Error("sveld: the `input` option was renamed to `entry`.");let{entry:G,...ie}=B??{},se=await L(),de=tr(G??se.entry);if(de===null)throw Error('sveld: could not resolve a Svelte entry point. Set package.json#svelte, or pass the "entry" option.');let ke=w(se,ie,{entry:de});R(ke),O(ke.quiet===!0);let Pe=await C(de,ke.glob===!0,E(ke)),_e;if(ke.check)_e=await I(Pe.components,ee(ke),{entryExports:Pe.entryExports});await v(Pe,ke,de),Pe.cache?.save();let Ae=ke.reportDiagnostics||ke.strict,De=z(Pe.diagnostics,Ae);if(Ae&&De.length>0)if(ke.format==="json")process.stderr.write(Q(De));else console.error(X(De));let Re=fe({errors:Pe.errors,check:_e,writesSnapshot:_e?te(ke,_e.snapshotFile):!1,checkLevel:ke.checkLevel,diagnostics:De,strict:ke.strict}),Oe=xi(Pe.components,{inputDir:xd(de),entryExports:Pe.entryExports,source:ke.jsonOptions?.source});return{diagnostics:De,check:_e,errors:Pe.errors,document:Oe,exitCode:Re}}
244
+ export{we,s,P,h,me,b,e,A,l,d,m,he,oe,y,o,n,H,D,W,j,i,z,X,ge,Q,J,F,x,g,T,p,u,_,q,Y,ae,Z,ye,ce,pe,N,a,c,r,ue,K,S,k,t,xe,f,Te,ee,te,I,re,Ee,ne,Ce,V,L,w,R,U,O,M,E,C,le,be,v,Se,fe,ve};