svelte-typecheck 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/cli.js +1 -74
- package/compile-worker.js +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/shared-08kjv74r.js +2 -0
- package/shared-0rqx0ctr.js +265 -0
- package/shared-cbz6rfgt.js +11 -0
- package/shared-ephganyk.js +83 -0
- package/shared-fn36rk9g.js +1 -0
- package/shared-javac3d2.js +10 -0
- package/{shared-ebbnnbmn.js → shared-kw5z6ysx.js} +1 -1
- package/{shared-xcpj2ac7.js → shared-sm8cekk0.js} +1 -1
- package/{shared-g75sf85w.js → shared-vkye6xwq.js} +5 -5
- package/shared-5mf34cks.js +0 -263
- package/shared-8badht7e.js +0 -4
- package/shared-atsj8zxq.js +0 -4
- package/shared-hyyc56ch.js +0 -1
- package/shared-n6kmzkr0.js +0 -2
- package/shared-ps9sbt7t.js +0 -6
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import{EmitError,typecheck2,watch2,createBaseline2,applyBaseline2}from"./shared-0rqx0ctr.js";import{serveDaemon}from"./shared-cbz6rfgt.js";import{readFileSync as readFileSync2,writeFileSync}from"node:fs";import{resolve}from"node:path";import{parseArgs}from"node:util";import{readFileSync}from"node:fs";import{relative,sep}from"node:path";var OUTPUT_FORMATS=["human","human-verbose","machine","machine-verbose"];function colors(force){let env=process.env,enabled=force??(env.FORCE_COLOR!==void 0?env.FORCE_COLOR!=="0":env.NO_COLOR===void 0&&Boolean(process.stdout.isTTY)&&env.TERM!=="dumb"),paint=(open,close)=>(text)=>enabled?`\x1B[${open}m${text}\x1B[${close}m`:text;return{red:paint(31,39),yellow:paint(33,39),green:paint(32,39),cyan:paint(36,39),magenta:paint(35,39)}}function lineOf(text,line){return text.split(`
|
|
2
|
+
`)[line-1]??""}function codeFrame(d,c){let text;try{text=readFileSync(d.file,"utf-8")}catch{return""}let endLine=d.endLine??d.line,endColumn=d.endColumn??d.column,first=lineOf(text,d.line),last=lineOf(text,endLine),middle=d.line===endLine?first.slice(0,d.column-1)+c.magenta(first.slice(d.column-1,endColumn-1))+first.slice(endColumn-1):first.slice(0,d.column-1)+c.magenta([first.slice(d.column-1),...text.split(`
|
|
3
|
+
`).slice(d.line,endLine-1),last.slice(0,endColumn-1)].join(`
|
|
4
|
+
`))+last.slice(endColumn-1),before=d.line>1?`${lineOf(text,d.line-1)}
|
|
5
|
+
`:"",after=lineOf(text,endLine+1);return`${before}${middle}
|
|
6
|
+
${after}`}function codeOf(d){if(d.code.startsWith("TS"))return Number(d.code.slice(2));return NUMERIC.test(d.code)?Number(d.code):d.code}var NUMERIC=/^-?\d+$/;function sourceOf(d){return d.file.endsWith(".svelte")||d.source==="svelte"?d.source:void 0}var COMPILER_CODE=/^[a-z][\w-]*[-_][\w-]*$/,DASH=/-/g;function codeDescriptionOf(d){if(d.source!=="svelte"||!COMPILER_CODE.test(d.code))return;return{href:`https://svelte.dev/docs/svelte/${d.severity==="warning"?"compiler-warnings":"compiler-errors"}#${d.code.replace(DASH,"_")}`}}function summarize(diagnostics,files){let errors=diagnostics.filter((d)=>d.severity==="error").length;return{files,errors,warnings:diagnostics.length-errors,filesWithProblems:new Set(diagnostics.map((d)=>d.file)).size}}var DRIVE=/^[A-Z]:/;function displayed(workspace){return process.platform==="win32"?workspace.replace(DRIVE,(drive)=>drive.toLowerCase()):workspace}function writer(format,write,c){let machine=format.startsWith("machine"),verbose=format.endsWith("verbose"),log=(message)=>write(`${Date.now()} ${message}
|
|
7
|
+
`);return{start(workspace,clearScreen=!1){if(!machine&&clearScreen&&process.stdout.isTTY)write("\x1B[2J\x1B[3J\x1B[H");if(machine)log(`START ${JSON.stringify(displayed(workspace))}`);else if(verbose)write(`Loading svelte-typecheck in workspace: ${displayed(workspace)}
|
|
8
|
+
Getting Svelte diagnostics...
|
|
9
|
+
|
|
10
|
+
`)},diagnostic(d,workspace){let filename=relative(workspace,d.file),type=d.severity==="error"?"ERROR":"WARNING";if(machine){if(verbose)log(JSON.stringify({type,filename,start:{line:d.line-1,character:d.column-1},end:{line:(d.endLine??d.line)-1,character:(d.endColumn??d.column)-1},message:d.message,code:codeOf(d),codeDescription:codeDescriptionOf(d),source:sourceOf(d)}));else log(`${type} ${JSON.stringify(filename)} ${d.line}:${d.column} ${JSON.stringify(d.message)}`);return}write(`${displayed(workspace)}${sep}${c.green(filename)}:${d.line}:${d.column}
|
|
11
|
+
`);let source=sourceOf(d)?`(${d.source})`:"",message=verbose?`${d.message} ${source}
|
|
12
|
+
${c.cyan(codeFrame(d,c).trimEnd())}`:`${d.message} ${source}`;write(`${d.severity==="error"?c.red("Error"):c.yellow("Warn")}: ${message}
|
|
13
|
+
|
|
14
|
+
`)},note(text){if(!machine)write(`${text}
|
|
15
|
+
`)},completion(summary,watching=!1){let{files,errors,warnings,filesWithProblems}=summary;if(machine){log(`COMPLETED ${files} FILES ${errors} ERRORS ${warnings} WARNINGS ${filesWithProblems} FILES_WITH_PROBLEMS`);return}if(filesWithProblems)write(`====================================
|
|
16
|
+
`);let message=`svelte-typecheck found ${errors} ${errors===1?"error":"errors"} and ${warnings} ${warnings===1?"warning":"warnings"}${filesWithProblems?` in ${filesWithProblems} ${filesWithProblems===1?"file":"files"}`:""}
|
|
17
|
+
`;if(errors)write(c.red(message));else if(warnings)write(c.yellow(message));else write(c.green(message));if(watching)write("Watching for file changes...")},failure(error){if(machine)log(`FAILURE ${JSON.stringify(error.message)}`);else write(`${error.message}
|
|
18
|
+
`)}}}import{spawnSync}from"node:child_process";import{join}from"node:path";var LINE_BREAK=/\r?\n/;function git(args,cwd){let result=spawnSync("git",args,{cwd,encoding:"utf-8"});if(result.status!==0)throw Error(`git ${args.join(" ")} failed: ${(result.stderr||result.error?.message||"").trim()}`);return result.stdout}function changedFiles(cwd,since){let top=git(["rev-parse","--show-toplevel"],cwd).trim(),base=since?git(["merge-base",since,"HEAD"],cwd).trim():"HEAD",lines=[...git(["diff","--name-only",base],cwd).split(LINE_BREAK),...git(["ls-files","--others","--exclude-standard"],top).split(LINE_BREAK)];return[...new Set(lines.filter(Boolean).map((line)=>join(top,line)))]}var HELP=`Usage: svelte-typecheck [options]
|
|
19
|
+
|
|
20
|
+
Type-checks Svelte components, as svelte-check does.
|
|
21
|
+
|
|
22
|
+
svelte-check's options:
|
|
23
|
+
--workspace <dir> Project folder (default: the current one)
|
|
24
|
+
--output <format> human, human-verbose, machine or machine-verbose
|
|
25
|
+
(default: human-verbose)
|
|
26
|
+
--tsconfig <path> tsconfig or jsconfig, relative to the workspace;
|
|
27
|
+
its TS and JS files' errors are reported too
|
|
28
|
+
(default: the nearest from the workspace up)
|
|
29
|
+
--no-tsconfig Check every component under the workspace, and
|
|
30
|
+
no TS or JS files
|
|
31
|
+
--ignore <list> With --no-tsconfig: paths to skip, relative to
|
|
32
|
+
the workspace, comma-separated
|
|
33
|
+
--config <path> vite.config or svelte.config to read preprocessors
|
|
34
|
+
and compilerOptions from (default: the nearest)
|
|
35
|
+
--diagnostic-sources <list>
|
|
36
|
+
js, svelte and css, comma-separated (default: all;
|
|
37
|
+
css reports nothing)
|
|
38
|
+
--threshold <level> error reports errors only (default: warning)
|
|
39
|
+
--compiler-warnings <list>
|
|
40
|
+
code:ignore or code:error, comma-separated
|
|
41
|
+
--fail-on-warnings Exit 1 on a warning too
|
|
42
|
+
--color, --no-color Force color on or off
|
|
43
|
+
--watch Check again when a file changes
|
|
44
|
+
--preserveWatchOutput Don't clear the screen between watch runs
|
|
45
|
+
--incremental Keep generated code between runs, and let the
|
|
46
|
+
checker reuse its last run (the default)
|
|
47
|
+
--no-incremental Start from nothing each run
|
|
48
|
+
--tsgo Check with tsgo (same as --checker tsgo)
|
|
49
|
+
-h, --help Show this help
|
|
50
|
+
-v, --version Show the version
|
|
51
|
+
|
|
52
|
+
svelte-typecheck's own:
|
|
53
|
+
--checker <name> tsc, tsgo, tsrs or bun (default: the project's
|
|
54
|
+
TypeScript, then the first installed)
|
|
55
|
+
--components <glob> Components to check, relative to the workspace,
|
|
56
|
+
instead of the tsconfig's; repeatable
|
|
57
|
+
--out-dir <dir> Where to write the generated code (default:
|
|
58
|
+
node_modules/.cache/svelte-typecheck/<workspace>)
|
|
59
|
+
--no-declarations Resolve component imports to their own
|
|
60
|
+
.svelte.d.ts
|
|
61
|
+
--svelte <dir> Svelte package to check against
|
|
62
|
+
--changed Report only files changed from HEAD (and
|
|
63
|
+
untracked), and the files that import them
|
|
64
|
+
--since <ref> As --changed, from where the branch left <ref>
|
|
65
|
+
--baseline <file> Report only diagnostics the baseline doesn't have
|
|
66
|
+
--update-baseline Write the run's diagnostics to the baseline
|
|
67
|
+
--strict-baseline Exit 1 when the baseline has fixed diagnostics,
|
|
68
|
+
so it only goes down
|
|
69
|
+
--daemon Run on a process kept alive for this folder,
|
|
70
|
+
started if none runs (SVELTE_TYPECHECK_DAEMON=1
|
|
71
|
+
for every run; not on CI or with --watch)
|
|
72
|
+
--no-daemon Run here, whatever SVELTE_TYPECHECK_DAEMON says
|
|
73
|
+
|
|
74
|
+
The daemon:
|
|
75
|
+
svelte-typecheck start Start it for this folder
|
|
76
|
+
svelte-typecheck stop Stop it
|
|
77
|
+
svelte-typecheck status Show whether it runs, and its log
|
|
78
|
+
|
|
79
|
+
Exits 1 on an error, or a warning with --fail-on-warnings.`;async function main(argv){if(argv[0]==="--serve-daemon"&&argv[1])return await serveDaemon(argv[1],main),new Promise(()=>{});let values;try{values=parse(argv).values}catch(error){return console.error(`${error.message}
|
|
80
|
+
|
|
81
|
+
${HELP}`),1}if(values.help)return console.log(HELP),0;if(values.version){let{version}=await import("./shared-fn36rk9g.js");return console.log(version),0}let format=formatOf(values.output),out=writer(format,(text)=>process.stdout.write(text),colors(colorFlag(values.color,values["no-color"]))),options={workspace:values.workspace??".",tsconfig:values["no-tsconfig"]?!1:values.tsconfig,ignore:values.ignore?.split(","),config:values.config,checker:values.checker??(values.tsgo||values["tsgo-experimental-api"]?"tsgo":void 0),components:values.components,outDir:values["out-dir"],declarations:!values["no-declarations"],svelte:values.svelte,diagnosticSources:values["diagnostic-sources"]?.split(",").map((source)=>source.trim()),compilerWarnings:parseCompilerWarnings(values["compiler-warnings"]),incremental:!values["no-incremental"]};if(values.changed||values.since)try{options.only=changedFiles(process.cwd(),values.since)}catch(error){return out.failure(error),1}let baselinePath=values.baseline&&resolve(values.baseline);if(values["update-baseline"]&&!baselinePath)return out.failure(Error("--update-baseline needs --baseline <file>")),1;let strict=values["strict-baseline"];if(strict&&!baselinePath)return out.failure(Error("--strict-baseline needs --baseline <file>")),1;for(let flag of["update-baseline","strict-baseline"])if(values[flag]&&(values.changed||values.since))return out.failure(Error(`--${flag} takes every file's: drop --changed`)),1;let baseline;if(baselinePath&&!values["update-baseline"])try{baseline=JSON.parse(readFileSync2(baselinePath,"utf-8"))}catch{return out.failure(Error(`No baseline at ${baselinePath}: write one with --update-baseline`)),1}let errorsOnly=values.threshold==="error",failOnWarnings=values["fail-on-warnings"],report=(result,watching)=>{if(result instanceof Error)return out.failure(result instanceof EmitError?Error(`${result.message}
|
|
82
|
+
This is a svelte-typecheck bug; please report it.`):result),1;if(baselinePath&&values["update-baseline"]){let written=createBaseline2(result.diagnostics,result.workspace);return writeFileSync(baselinePath,`${JSON.stringify(written,null,2)}
|
|
83
|
+
`),out.note(`Wrote ${result.diagnostics.length} diagnostics to ${baselinePath}`),0}let known=baseline?applyBaseline2(result.diagnostics,baseline,result.workspace):void 0,shown=known?known.diagnostics:result.diagnostics;out.start(result.workspace,watching&&!values.preserveWatchOutput);for(let d of shown)if(!errorsOnly||d.severity==="error")out.diagnostic(d,result.workspace);for(let f of result.failed)out.failure(Error(`${f.file}: failed to parse: ${f.message}`));let summary=summarize(shown,result.components);if(known?.known)out.note(`${known.known} more in the baseline, not shown`);if(known?.fixed)out.note(`${known.fixed} in the baseline are fixed: --update-baseline drops them`);if(result.skipped>0)out.note(`${result.skipped} more in files the changes don't reach, not shown`);return out.completion(summary,watching),summary.errors>0||result.failed.length>0||failOnWarnings&&summary.warnings>0||strict&&(known?.fixed??0)>0?1:0};if(values.watch)return watch2(options,(result)=>report(result,!0)),new Promise(()=>{});try{return report(await typecheck2(options),!1)}catch(error){return report(error,!1)}}function formatOf(output){if(output&&OUTPUT_FORMATS.includes(output))return output;return process.env.CLAUDECODE==="1"?"machine":"human-verbose"}function parse(argv){return parseArgs({args:argv,options:{workspace:{type:"string"},output:{type:"string"},tsconfig:{type:"string"},"no-tsconfig":{type:"boolean",default:!1},ignore:{type:"string"},config:{type:"string"},"diagnostic-sources":{type:"string"},threshold:{type:"string"},"compiler-warnings":{type:"string"},"fail-on-warnings":{type:"boolean",default:!1},color:{type:"boolean",default:!1},"no-color":{type:"boolean",default:!1},tsgo:{type:"boolean",default:!1},incremental:{type:"boolean",default:!1},"no-incremental":{type:"boolean",default:!1},watch:{type:"boolean",default:!1},preserveWatchOutput:{type:"boolean",default:!1},"tsgo-experimental-api":{type:"boolean",default:!1},checker:{type:"string"},components:{type:"string",multiple:!0},"out-dir":{type:"string"},"no-declarations":{type:"boolean",default:!1},svelte:{type:"string"},changed:{type:"boolean",default:!1},baseline:{type:"string"},"update-baseline":{type:"boolean",default:!1},"strict-baseline":{type:"boolean",default:!1},since:{type:"string"},daemon:{type:"boolean",default:!1},"no-daemon":{type:"boolean",default:!1},help:{type:"boolean",short:"h",default:!1},version:{type:"boolean",short:"v",default:!1}}})}function parseCompilerWarnings(list){if(!list)return;let levels={};for(let entry of list.split(",")){let[code,level]=entry.trim().split(":");if(code&&(level==="ignore"||level==="error"))levels[code]=level}return levels}function colorFlag(on,off){if(on)return!0;if(off)return!1;return}export{main};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{version2,package_default}from"./shared-0rqx0ctr.js";export{package_default as default,version2 as version};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{svelteConfigOf,configNeedsChdir}from"./shared-08kjv74r.js";var REGEX_LANG_ATTRIBUTE=/<!--[\s\S]*?-->|<script\s+(?:[^>]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)\s+)*)lang=(["'])?([^"' >]+)\1[^>]*>/y;function withoutByteOrderMark(source){return source.charCodeAt(0)===65279?source.slice(1):source}function isDigit(code){return code>=48&&code<=57}function isWhitespace(code){if(code===32||code<=13&&code>=9)return!0;if(code<160)return!1;return code===160||code===5760||code>=8192&&code<=8202||code===8232||code===8233||code===8239||code===8287||code===12288||code===65279}function skipWhitespace(source,from){let index=from;while(index<source.length&&isWhitespace(source.charCodeAt(index)))index++;return index}function isTypeScript(source){let index=source.indexOf("<");while(index!==-1){let next=source.charCodeAt(index+1);if(next===33||next===115){REGEX_LANG_ATTRIBUTE.lastIndex=index;let match=REGEX_LANG_ATTRIBUTE.exec(source);if(match){if(next===115)return match[2]==="ts";index=source.indexOf("<",REGEX_LANG_ATTRIBUTE.lastIndex);continue}}index=source.indexOf("<",index+1)}return!1}function closingScriptTag(source,from){let close=source.indexOf("</script",from);while(close!==-1){if(source.charCodeAt(skipWhitespace(source,close+8))===GT)return close;close=source.indexOf("</script",close+8)}return-1}function closingScriptTagEnd(source,close){return skipWhitespace(source,close+8)+1}var VOID_ELEMENTS=new Set("area base br col command embed hr img input keygen link meta param source track wbr".split(" "));function isVoid(name){return VOID_ELEMENTS.has(name)||name.charCodeAt(0)===33&&name.toLowerCase()==="!doctype"}function styleContentEnd(source,from){let index=from;while(index<source.length){let code=source.charCodeAt(index);if(code===47&&source.charCodeAt(index+1)===42){let end=source.indexOf("*/",index+2);index=end===-1?source.length:end+2}else if(code===34||code===39){index++;while(index<source.length){let next=source.charCodeAt(index);if(next===code||next===10)break;index+=next===92?2:1}index++}else if(code===60&&source.startsWith("</style",index))break;else index++}return Math.min(index,source.length)}var DOUBLE_QUOTE=34,SINGLE_QUOTE=39,SLASH=47,EQUALS=61,GT=62,isQuote=(code)=>code===DOUBLE_QUOTE||code===SINGLE_QUOTE;function nameEnd(source,from,isAttribute){let i=from;for(;i<source.length;i++){let code=source.charCodeAt(i);if(isWhitespace(code)||code===SLASH||code===GT)break;if(isAttribute&&(isQuote(code)||code===EQUALS))break}return i}function endsUnquotedValue(source,i){let code=source.charCodeAt(i);return isWhitespace(code)||isQuote(code)||code===EQUALS||code===60||code===GT||code===96||code===SLASH&&source.charCodeAt(i+1)===GT}var STATEMENT_START=0,OPERATOR=1,BLOCK_OPENER=2,VALUE=3,PAREN=0,HEAD_PAREN=1,BLOCK=2,OBJECT=3,TEMPLATE=4,HEAD=4,IMPORT=5,EXPORT=6,REQUIRE=7,KEYWORDS={await:OPERATOR,case:OPERATOR,default:OPERATOR,delete:OPERATOR,extends:OPERATOR,in:OPERATOR,instanceof:OPERATOR,new:OPERATOR,of:OPERATOR,return:OPERATOR,throw:OPERATOR,typeof:OPERATOR,void:OPERATOR,yield:OPERATOR,do:BLOCK_OPENER,else:BLOCK_OPENER,finally:BLOCK_OPENER,try:BLOCK_OPENER,for:HEAD,if:HEAD,while:HEAD,with:HEAD,import:IMPORT,export:EXPORT,require:REQUIRE},LONGEST_KEYWORD=10,KEYWORDS_BY_KEY=Array(keywordKey(128,0)).fill(null);for(let entry of Object.entries(KEYWORDS)){let key=keywordKey(entry[0].charCodeAt(0),entry[0].length),entries=KEYWORDS_BY_KEY[key]??[];entries.push(entry),KEYWORDS_BY_KEY[key]=entries}function keywordKey(first,length){return first*(LONGEST_KEYWORD+1)+length}function wordKind(source,start,end){let first=source.charCodeAt(start);if(first>=128||end-start>LONGEST_KEYWORD)return VALUE;let key=keywordKey(first,end-start),entries=KEYWORDS_BY_KEY[key];if(entries===null)return VALUE;for(let i=0;i<entries.length;i++)if(source.startsWith(entries[i][0],start))return entries[i][1];return VALUE}var ASCII_WORD=new Uint8Array(128);for(let range of["az","AZ","09","__","$$","\\\\"])for(let code=range.charCodeAt(0);code<=range.charCodeAt(1);code++)ASCII_WORD[code]=1;function isWordCode(code){return code>=128?!isWhitespace(code):ASCII_WORD[code]===1}function scan(source,localExports,parseAt,exportLists=!1){tokenize(source,lastStatementKeyword(source,localExports,exportLists),localExports,exportLists,parseAt,void 0,void 0)}function tokenize(source,last,localExports,exportLists,parseAt,literal,call){let stack=[],pos=source.startsWith("#!")?lineEnd(source,2):0,prev=STATEMENT_START,afterDot=!1,head=!1,decorators=-1,statementEnd=()=>{if(prev=STATEMENT_START,stack.length===0)decorators=-1};while(pos<=last){let code=source.charCodeAt(pos);if(code===32||code===10||isWhitespace(code)){pos++;continue}if(code===47){let end=commentEnd(source,pos);if(end!==-1){pos=end;continue}}let wasAfterDot=afterDot,wasHead=head;if(afterDot=!1,head=!1,isWordCode(code)||code===35){let start=pos;pos=wordEnd(source,pos+1);let kind=wasAfterDot?VALUE:wordKind(source,start,pos);if(call!==void 0&&(kind===IMPORT||kind===REQUIRE))call(start,prev===STATEMENT_START||prev===VALUE);if(parseAt!==void 0&&stack.length===0&&(kind===EXPORT?localExports||isReexport(source,pos,exportLists):kind===IMPORT&&isImportDeclaration(source,pos)))pos=Math.max(pos,parseAt(decorators!==-1&&kind===EXPORT?decorators:start,start)),statementEnd();else if(kind===EXPORT)prev=BLOCK_OPENER;else if(kind===HEAD)head=!0,prev=VALUE;else prev=kind===OPERATOR||kind===BLOCK_OPENER?kind:VALUE;continue}switch(pos++,code){case 34:case 39:{let start=pos-1;pos=stringEnd(source,pos,code),literal?.(start,pos,!1),prev=VALUE;break}case 96:{let start=pos;pos=templateEnd(source,pos,stack),literal?.(start,quasiEnd(source,pos),!0),prev=source.charCodeAt(pos-1)===123?OPERATOR:VALUE;break}case 47:{let end=prev===VALUE?-1:regexEnd(source,pos);if(end===-1)prev=OPERATOR;else pos=wordCodesEnd(source,end),prev=VALUE;break}case 40:stack.push(wasHead?HEAD_PAREN:PAREN),prev=OPERATOR;break;case 41:prev=stack.pop()===HEAD_PAREN?BLOCK_OPENER:VALUE;break;case 123:stack.push(prev===OPERATOR?OBJECT:BLOCK),prev=STATEMENT_START;break;case 125:{let open=stack.pop();if(open===TEMPLATE){let start=pos;pos=templateEnd(source,pos,stack),literal?.(start,quasiEnd(source,pos),!0),prev=source.charCodeAt(pos-1)===123?OPERATOR:VALUE}else if(open===OBJECT)prev=VALUE;else statementEnd();break}case 59:statementEnd();break;case 44:prev=stack[stack.length-1]===OBJECT?STATEMENT_START:OPERATOR;break;case 93:prev=VALUE;break;case 46:if(isDigit(source.charCodeAt(pos)))pos=wordCodesEnd(source,pos),prev=VALUE;else if(source.startsWith("..",pos))pos+=2,prev=OPERATOR;else afterDot=!0,prev=OPERATOR;break;case 63:if(source.charCodeAt(pos)===46&&!isDigit(source.charCodeAt(pos+1)))pos++,afterDot=!0;prev=OPERATOR;break;case 33:prev=prev===VALUE&&!isWhitespace(source.charCodeAt(pos-2))?VALUE:OPERATOR;break;case 43:case 45:if(source.charCodeAt(pos)===code&&prev===VALUE)pos++;else prev=OPERATOR;break;case 61:if(prev=source.charCodeAt(pos)===62?BLOCK_OPENER:OPERATOR,prev===BLOCK_OPENER)pos++;break;case 64:if(stack.length===0&&decorators===-1)decorators=pos-1;prev=OPERATOR;break;default:prev=OPERATOR}}}function closingBracket(source,from,word){let length=source.length,stack=[],pos=from,prev=OPERATOR,afterDot=!1;while(pos<length){let code=source.charCodeAt(pos);if(code===32||code===10||isWhitespace(code)){pos++;continue}if(code===47){let end=commentEnd(source,pos);if(end!==-1){pos=end;continue}}let wasAfterDot=afterDot;if(afterDot=!1,isWordCode(code)||code===35){let start=pos;if(pos=wordEnd(source,pos+1),!wasAfterDot&&word?.(start,pos))return-1;let kind=wasAfterDot?VALUE:wordKind(source,start,pos);prev=kind===OPERATOR||kind===BLOCK_OPENER||kind===HEAD?OPERATOR:VALUE;continue}switch(pos++,code){case 34:case 39:pos=stringEnd(source,pos,code),prev=VALUE;break;case 96:pos=templateEnd(source,pos,stack),prev=source.charCodeAt(pos-1)===123?OPERATOR:VALUE;break;case 47:{let end=prev===VALUE?-1:regexEnd(source,pos);if(end===-1)prev=OPERATOR;else pos=wordCodesEnd(source,end),prev=VALUE;break}case 40:stack.push(PAREN),prev=OPERATOR;break;case 41:if(stack.length===0)return pos-1;stack.pop(),prev=VALUE;break;case 123:stack.push(prev===OPERATOR?OBJECT:BLOCK),prev=STATEMENT_START;break;case 125:{if(stack.length===0)return pos-1;let open=stack.pop();if(open===TEMPLATE)pos=templateEnd(source,pos,stack),prev=source.charCodeAt(pos-1)===123?OPERATOR:VALUE;else prev=open===OBJECT?VALUE:STATEMENT_START;break}case 93:prev=VALUE;break;case 46:if(isDigit(source.charCodeAt(pos)))pos=wordCodesEnd(source,pos),prev=VALUE;else if(source.startsWith("..",pos))pos+=2,prev=OPERATOR;else afterDot=!0,prev=OPERATOR;break;case 63:if(source.charCodeAt(pos)===46&&!isDigit(source.charCodeAt(pos+1)))pos++,afterDot=!0;prev=OPERATOR;break;case 33:prev=prev===VALUE&&!isWhitespace(source.charCodeAt(pos-2))?VALUE:OPERATOR;break;case 43:case 45:if(source.charCodeAt(pos)===code&&prev===VALUE)pos++;else prev=OPERATOR;break;case 61:if(source.charCodeAt(pos)===62)pos++;prev=OPERATOR;break;default:prev=OPERATOR}}return length}function isLineBreak(code){return code===10||code===13||code===8232||code===8233}function lineEnd(source,pos){for(let i=pos;i<source.length;i++)if(isLineBreak(source.charCodeAt(i)))return i;return source.length}function commentEnd(source,slash){let next=source.charCodeAt(slash+1);if(next===47)return lineEnd(source,slash+2);if(next!==42)return-1;let end=source.indexOf("*/",slash+2);return end===-1?source.length:end+2}function wordEnd(source,pos){let i=pos;while(i<source.length){let code=source.charCodeAt(i);if(code===92)i+=2;else if(isWordCode(code))i++;else break}return i}function wordCodesEnd(source,pos){let i=pos;while(i<source.length&&isWordCode(source.charCodeAt(i)))i++;return i}function stringEnd(source,pos,quote){for(let i=pos;i<source.length;i++){let code=source.charCodeAt(i);if(code===quote)return i+1;if(code===92)i+=source.startsWith(`\r
|
|
2
|
+
`,i+1)?2:1;else if(code===10||code===13)return i}return source.length}function templateEnd(source,pos,stack){for(let i=pos;i<source.length;i++){let code=source.charCodeAt(i);if(code===96)return i+1;if(code===92)i++;else if(code===36&&source.charCodeAt(i+1)===123)return stack.push(TEMPLATE),i+2}return source.length}function quasiEnd(source,pos){let code=source.charCodeAt(pos-1);if(code===96)return pos-1;if(code===123&&source.charCodeAt(pos-2)===36)return pos-2;return pos}function regexEnd(source,pos){let inClass=!1;for(let i=pos;i<source.length;i++){let code=source.charCodeAt(i);if(isLineBreak(code))return-1;if(code===92)i++;else if(code===91)inClass=!0;else if(code===93)inClass=!1;else if(code===47&&!inClass)return i+1}return-1}function skipTrivia(source,pos){let i=pos;while(i<source.length){let code=source.charCodeAt(i);if(isWhitespace(code)){i++;continue}let end=code===47?commentEnd(source,i):-1;if(end===-1)return i;i=end}return source.length}function isWordAt(source,pos,word){return source.charCodeAt(pos)===word.charCodeAt(0)&&source.startsWith(word,pos)&&!isWordCode(source.charCodeAt(pos+word.length))}function isImportDeclaration(source,pos){let code=source.charCodeAt(skipTrivia(source,pos));return code!==40&&code!==46}function isReexport(source,pos,lists){let i=skipTrivia(source,pos);if(isWordAt(source,i,"import"))return!0;if(isWordAt(source,i,"type"))i=skipTrivia(source,i+4);let code=source.charCodeAt(i);if(code===42)return!0;if(code!==123)return!1;if(lists)return!0;for(i++;i<source.length;i++){let inner=source.charCodeAt(i);if(inner===125)break;if(inner===34||inner===39)i=stringEnd(source,i+1,inner)-1;else if(inner===47)i=Math.max(i,skipTrivia(source,i)-1)}return isWordAt(source,skipTrivia(source,i+1),"from")}var STATEMENT_KEYWORD=/import|export/g;function lastStatementKeyword(source,localExports,exportLists){let last=-1;STATEMENT_KEYWORD.lastIndex=0;for(let match=STATEMENT_KEYWORD.exec(source);match!==null;match=STATEMENT_KEYWORD.exec(source)){let start=match.index,end=start+6;if(!isWordCode(source.charCodeAt(start-1))&&!isWordCode(source.charCodeAt(end))&&(source.charCodeAt(start)===105?isImportDeclaration(source,end):localExports||isReexport(source,end,exportLists)))last=start}return last}var AUTOCLOSING_CHILDREN={li:["li"],dt:["dt","dd"],dd:["dt","dd"],p:"address article aside blockquote div dl fieldset footer form h1 h2 h3 h4 h5 h6 header hgroup hr main menu nav ol p pre section table ul".split(" "),rt:["rt","rp"],rp:["rt","rp"],optgroup:["optgroup"],option:["option","optgroup"],thead:["tbody","tfoot"],tbody:["tbody","tfoot"],tfoot:["tbody"],tr:["tr","tbody"],td:["td","th","tr"],th:["td","th","tr"]};function closingTagOmitted(current,next){return Object.hasOwn(AUTOCLOSING_CHILDREN,current)&&AUTOCLOSING_CHILDREN[current].includes(next)}var BLOCK2="{",LT=60,GT2=62,SLASH2=47,EQUALS2=61,BRACE=123,REGEX_CLOSING_STYLE_TAG_END=/\s*>/y,REGEX_CLOSING_TEXTAREA=/<\/textarea(\s[^>]*)?>/iy,SECTION_TAG_NAMES=["cript","tyle","velte:options"],CLOSING_OPTIONS_TAG="</svelte:options";function lexComponent2(input){let source=withoutByteOrderMark(input).trimEnd();return lex(source,isTypeScript(source),null)}function topLevelTags(source){let found={tags:[],comments:[]};return lex(source,!1,found),found}function lex(source,typescript,found){let component={typescript,instance:null,module:null,css:null,options:null},last=lastSectionTag(source),stack=[],i=0;while(i<=last){let code=source.charCodeAt(i);if(code===LT)i=readTag(source,i,stack,component,found);else if(code===BRACE)i=readMustache(source,i,stack);else i++}return component}function lastSectionTag(source){let last=-1,i=source.indexOf("<s");while(i!==-1){let end=sectionTagNameEnd(source,i+2);if(end!==-1){let code=source.charCodeAt(end);if(end===source.length||isWhitespace(code)||code===SLASH2||code===GT2)last=i}i=source.indexOf("<s",i+2)}return last}function sectionTagNameEnd(source,from){for(let name of SECTION_TAG_NAMES)if(source.startsWith(name,from))return from+name.length;return-1}function expressionEnd(source,from){return Math.min(closingBracket(source,from)+1,source.length)}function readMustache(source,start,stack){let i=skipWhitespace(source,start+1),code=source.charCodeAt(i),next=source.charCodeAt(i+1);if(code===35||code===58||code===64||code===SLASH2&&next!==SLASH2&&next!==42){i++;while(i<source.length){let letter=source.charCodeAt(i);if(letter<97||letter>122)break;i++}if(code===35)stack.push(BLOCK2);else if(code===SLASH2){let open=stack.lastIndexOf(BLOCK2);if(open!==-1)stack.length=open}}return expressionEnd(source,i)}function readTag(source,start,stack,component,found){if(source.startsWith("!--",start+1)){let close=source.indexOf("-->",start+4),end=close===-1?source.length:close+3;if(found&&stack.length===0)found.comments.push(start,end);return end}if(source.charCodeAt(start+1)===SLASH2){let nameStart=start+2,name=source.slice(nameStart,nameEnd(source,nameStart,!1)),open=stack.lastIndexOf(name);if(open!==-1)stack.length=open;return eatGreaterThan(source,skipWhitespace(source,nameStart+name.length))}let name=source.slice(start+1,nameEnd(source,start+1,!1)),i=skipWhitespace(source,start+1+name.length),parent=stack[stack.length-1];if(parent!==void 0&&closingTagOmitted(parent,name))stack.pop();let topLevel=stack.length===0;if(found&&topLevel&&(name==="script"||name==="style"||name==="svelte:options"))found.tags.push(start);if(topLevel&&(name==="script"||name==="style")){let attributes=[];if(i=eatGreaterThan(source,readStaticAttributes(source,i,attributes)),name==="script"){let script=readScript(source,start,i,attributes);if(script.context==="module")component.module??=script;else component.instance??=script;return script.end}let css=readStyle(source,start,i,attributes);return component.css??=css,css.end}let attributes=topLevel&&name==="svelte:options"?[]:null;if(i=readAttributes(source,i,attributes),source.charCodeAt(i)===SLASH2||isVoid(name)){if(source.charCodeAt(i)===SLASH2)i++;i=eatGreaterThan(source,i)}else{if(i=eatGreaterThan(source,i),name==="textarea")return textareaEnd(source,i);if(name==="script"||name==="style"){let closer=`</${name}>`,close=source.indexOf(closer,i);return close===-1?source.length:close+closer.length}if(attributes&&source.startsWith(CLOSING_OPTIONS_TAG,i))i=eatGreaterThan(source,skipWhitespace(source,i+CLOSING_OPTIONS_TAG.length));else return stack.push(name),i}if(attributes)component.options??={start,end:i,attributes};return i}function eatGreaterThan(source,i){return source.charCodeAt(i)===GT2?i+1:i}function readScript(source,start,contentStart,attributes){let close=closingScriptTag(source,contentStart),contentEnd=close===-1?source.length:close,module=attributes.some((attribute)=>attribute.name==="module"||attribute.name==="context");return{start,end:close===-1?source.length:closingScriptTagEnd(source,close),context:module?"module":"default",attributes,content:{start:contentStart,end:contentEnd}}}function readStyle(source,start,contentStart,attributes){let contentEnd=styleContentEnd(source,contentStart),end=contentEnd;if(source.startsWith("</style",end)){end+=7,REGEX_CLOSING_STYLE_TAG_END.lastIndex=end;let close=REGEX_CLOSING_STYLE_TAG_END.exec(source);if(close)end+=close[0].length}return{start,end,attributes,content:{start:contentStart,end:contentEnd}}}function readStaticAttributes(source,from,into){let i=from;for(;;){let start=i,end=nameEnd(source,i,!0);if(end===start)return i;i=end;let value=!0;if(source.charCodeAt(i)===EQUALS2){let at=skipWhitespace(source,i+1),quote=source.charCodeAt(at),valueEnd=-1;if(isQuote(quote)){let close=source.indexOf(source[at],at+1);if(close!==-1)valueEnd=close+1}if(valueEnd===-1){valueEnd=at;while(valueEnd<source.length&&source.charCodeAt(valueEnd)!==GT2&&!isWhitespace(source.charCodeAt(valueEnd)))valueEnd++}let quotes=isQuote(quote)?1:0;value=source.slice(at+quotes,valueEnd-quotes),i=valueEnd}into.push({name:source.slice(start,end),value,start,end:i}),i=skipWhitespace(source,i)}}function readAttributes(source,from,into){let i=from;for(;;){for(;;){if(source.startsWith("/*",i)){let end=source.indexOf("*/",i+2);i=end===-1?source.length:end+2}else if(source.startsWith("//",i)){let end=source.indexOf(`
|
|
3
|
+
`,i+2);i=end===-1?source.length:end}else break;i=skipWhitespace(source,i)}let start=i;if(source.charCodeAt(i)===BRACE){i=skipWhitespace(source,expressionEnd(source,i+1));continue}let nameEndAt=nameEnd(source,i,!0);if(nameEndAt===start)return i;let end=nameEndAt,value=!0;if(i=skipWhitespace(source,nameEndAt),source.charCodeAt(i)===EQUALS2){let at=skipWhitespace(source,i+1);end=source.startsWith("/>",at)?at+1:attributeValueEnd(source,at),value=isQuote(source.charCodeAt(at))?source.slice(at+1,Math.max(at+1,end-1)):source.slice(at,end),i=skipWhitespace(source,end)}into?.push({name:source.slice(start,nameEndAt),value,start,end})}}function attributeValueEnd(source,from){let quote=source.charCodeAt(from);if(isQuote(quote)){let i=from+1;while(i<source.length){let code=source.charCodeAt(i);if(code===quote)return i+1;i=code===BRACE?expressionEnd(source,i+1):i+1}return source.length}let i=from;while(i<source.length&&!endsUnquotedValue(source,i))i=source.charCodeAt(i)===BRACE?expressionEnd(source,i+1):i+1;return i}function textareaEnd(source,from){let i=from;while(i<source.length){let code=source.charCodeAt(i);if(code===LT){if(REGEX_CLOSING_TEXTAREA.lastIndex=i,REGEX_CLOSING_TEXTAREA.test(source))return REGEX_CLOSING_TEXTAREA.lastIndex}i=code===BRACE?expressionEnd(source,i+1):i+1}return source.length}function lexImportsExports(source,options={}){let lexer=new Lexer(source);lexer.exportLists=options.exportLists??!1;let statements=[];return scan(source,!1,(_start,keyword)=>{let statement=lexer.statement(keyword);return statements.push(statement),statement.end},lexer.exportLists),statements}class Lexer{source;pos=0;end=0;escapeEnd=0;exportLists=!1;constructor(source){this.source=source}statement(keyword){this.pos=this.end=keyword+6;let statement={kind:this.source.charCodeAt(keyword)===105?"import":"export",start:keyword,end:0,source:null,typeOnly:!1,specifiers:[]};if(!(statement.kind==="import"?this.import(statement):this.export(statement)))statement.source=null,statement.specifiers=[];return statement.end=this.end,statement}import(statement){let module=this.string();if(module!==null)return statement.source=module,this.finish();if(this.isWord("type")){let next=this.peekAfter(4);if(next===123||next===42||isIdentifierStart(next)&&!this.isWordAfter(4,"from"))statement.typeOnly=!0,this.advance(4)}let{specifiers,typeOnly}=statement,next=this.at();if(next!==123&&next!==42){let start=this.pos,local=this.name();if(local===null)return!1;if(this.at()===61)return this.importEquals();if(specifiers.push({kind:"default",imported:"default",local,typeOnly,start,end:this.end}),!this.eat(44))return this.from(statement);next=this.at()}if(next===42){let start=this.pos;if(this.advance(1),!this.eatWord("as"))return!1;let local=this.name();if(local===null)return!1;return specifiers.push({kind:"namespace",imported:"*",local,typeOnly,start,end:this.end}),this.from(statement)}if(!this.eat(123))return!1;while(!this.eat(125)){let start=this.skip(),named=this.typeModifier()||typeOnly,name=this.name(),imported=name??this.string()?.value;if(imported===void 0)return!1;let local=name;if(this.eatWord("as"))local=this.name();if(local===null)return!1;if(specifiers.push({kind:"named",imported,local,typeOnly:named,start,end:this.end}),!this.eat(44)&&this.at()!==125)return!1}return this.from(statement)}export(statement){if(this.eatWord("import")){if(this.isWord("type")&&isIdentifierStart(this.peekAfter(4))&&!this.isWordAfter(4,"from"))statement.typeOnly=!0,this.advance(4);return this.name()!==null&&this.at()===61&&this.importEquals()}if(this.isWord("type")){let next=this.peekAfter(4);if(next===123||next===42)statement.typeOnly=!0,this.advance(4)}let{specifiers,typeOnly}=statement;if(this.at()===42){let start=this.pos;this.advance(1);let exported=null;if(this.eatWord("as")){if(exported=this.moduleExportName(),exported===null)return!1}return specifiers.push({kind:exported===null?"all":"namespace",local:"*",exported,typeOnly,start,end:this.end}),this.from(statement)}if(!this.eat(123))return!1;while(!this.eat(125)){let start=this.skip(),named=this.typeModifier()||typeOnly,local=this.moduleExportName();if(local===null)return!1;let exported=local;if(this.eatWord("as"))exported=this.moduleExportName();if(exported===null)return!1;if(specifiers.push({kind:"named",local,exported,typeOnly:named,start,end:this.end}),!this.eat(44)&&this.at()!==125)return!1}if(this.exportLists&&!this.isWord("from")){for(let specifier of specifiers)specifier.kind="local";return this.eat(59),!0}return this.from(statement)}dynamicImport(start,member){let isImport=this.source.charCodeAt(start)===105;this.pos=this.end=start+(isImport?6:7);let kind=isImport?"import":"require";if(isImport&&this.eat(46)){if(!this.eatWord("meta")||!this.eat(46)||!this.eatWord("glob")||!this.typeArguments())return null;kind="glob"}if(!this.eat(40))return null;let argument=this.skip(),source=this.string()??this.template(),close=this.at()===41?this.pos:-1;if(close===-1){if(this.at()!==44)source=null;close=closingBracket(this.source,argument)}if(member&&kind!=="glob"){let after=this.source.charCodeAt(skipTrivia(this.source,close+1));if(after===123||after===58)return null}return{kind,source,start,end:Math.min(close+1,this.source.length)}}typeArguments(){if(this.at()!==60)return!0;let source=this.source,depth=0;for(let i=this.pos;i<source.length;i=skipTrivia(source,i+1)){let code=source.charCodeAt(i);if(code===34||code===39||code===96){let end=source.indexOf(source[i],i+1);if(end===-1)return!1;i=end}else if(code===60)depth++;else if(code===62&&source.charCodeAt(i-1)!==61){if(--depth===0)return this.advance(i+1-this.pos),!0}}return!1}template(){let source=this.source,start=this.skip();if(source.charCodeAt(start)!==96)return null;for(let i=start+1;i<source.length;i++){let code=source.charCodeAt(i);if(code===96){let value=this.cooked(start+1,i,!0);if(value===null)return null;return this.advance(i+1-start),{value,start,end:i+1}}if(code===92)i++;else if(code===36&&source.charCodeAt(i+1)===123)return null}return null}typeModifier(){if(!this.isWord("type"))return!1;let next=this.peekAfter(4);if(next===34||next===39||isIdentifierStart(next)&&!this.isWordAfter(4,"as"))return this.advance(4),!0;return!1}importEquals(){if(this.advance(1),this.isWord("require")&&this.peekAfter(7)===40){if(this.advance(7),this.eat(40),this.string()===null||!this.eat(41))return!1}else do if(this.name()===null)return!1;while(this.eat(46));return this.eat(59),!0}from(statement){if(!this.eatWord("from"))return!1;return statement.source=this.string(),statement.source!==null&&this.finish()}finish(){let keyword=this.isWord("with")?4:0;if(this.isWord("assert")&&lineEnd(this.source,this.end)>=this.pos)keyword=6;if(keyword!==0&&this.peekAfter(keyword)===123){this.advance(keyword),this.eat(123);while(!this.eat(125))if(this.string()===null&&this.name()===null&&!this.eat(58)&&!this.eat(44))return!1}return this.eat(59),!0}skip(){return this.pos=skipTrivia(this.source,this.pos),this.pos}at(){return this.source.charCodeAt(this.skip())}advance(length){this.pos+=length,this.end=this.pos}peekAfter(length){return this.source.charCodeAt(skipTrivia(this.source,this.pos+length))}isWordAfter(length,word){return isWordAt(this.source,skipTrivia(this.source,this.pos+length),word)}eat(code){if(this.at()!==code)return!1;return this.advance(1),!0}isWord(word){return isWordAt(this.source,this.skip(),word)}eatWord(word){if(!this.isWord(word))return!1;return this.advance(word.length),!0}moduleExportName(){return this.name()??this.string()?.value??null}name(){let source=this.source,start=this.skip();if(!isWordCode(source.charCodeAt(start))||isDigit(source.charCodeAt(start)))return null;let value="",chunk=start,i=start;while(i<source.length){let code=source.charCodeAt(i);if(code===92){if(source.charCodeAt(i+1)!==117)return null;let escaped=this.unicodeEscape(i+2);if(escaped===null)return null;value+=source.slice(chunk,i)+escaped,i=chunk=this.escapeEnd}else if(isWordCode(code))i++;else break}return this.advance(i-start),value+source.slice(chunk,i)}string(){let source=this.source,start=this.skip(),quote=source.charCodeAt(start);if(quote!==34&"e!==39)return null;let value="",chunk=start+1;for(let i=chunk;i<source.length;){let code=source.charCodeAt(i);if(code===quote)return this.advance(i+1-start),{value:value+source.slice(chunk,i),start,end:i+1};if(code===10||code===13)return null;if(code===92){let escaped=this.escape(i+1);if(escaped===null)return null;value+=source.slice(chunk,i)+escaped,i=chunk=this.escapeEnd}else i++}return null}cooked(from,to,template){let source=this.source,value="",chunk=from;for(let i=from;i<to;){let code=source.charCodeAt(i);if(code===92){let escaped=this.escape(i+1);if(escaped===null)return null;value+=source.slice(chunk,i)+escaped,i=chunk=this.escapeEnd}else if(code===13&&template)value+=`${source.slice(chunk,i)}
|
|
4
|
+
`,i+=source.charCodeAt(i+1)===10?2:1,chunk=i;else i++}return value+source.slice(chunk,to)}escape(pos){let code=this.source.charCodeAt(pos);switch(this.escapeEnd=pos+1,code){case 110:return`
|
|
5
|
+
`;case 114:return"\r";case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 48:return isDigit(this.source.charCodeAt(pos+1))?null:"\x00";case 120:return this.hexEscape(pos+1,2);case 117:return this.unicodeEscape(pos+1);case 13:if(this.source.charCodeAt(pos+1)===10)this.escapeEnd++;return"";case 10:case 8232:case 8233:return"";default:return isDigit(code)||pos>=this.source.length?null:String.fromCharCode(code)}}unicodeEscape(pos){if(this.source.charCodeAt(pos)!==123)return this.hexEscape(pos,4);let value=0,i=pos+1;for(;this.source.charCodeAt(i)!==125;i++){let digit=hexValue(this.source.charCodeAt(i));if(digit===-1)return null;if(value=value*16+digit,value>1114111)return null}if(i===pos+1)return null;return this.escapeEnd=i+1,String.fromCodePoint(value)}hexEscape(pos,length){let value=0;for(let i=pos;i<pos+length;i++){let digit=hexValue(this.source.charCodeAt(i));if(digit===-1)return null;value=value*16+digit}return this.escapeEnd=pos+length,String.fromCharCode(value)}}function isIdentifierStart(code){return code!==92&&isWordCode(code)&&!isDigit(code)}function hexValue(code){if(isDigit(code))return code-48;let lower=code|32;return lower>=97&&lower<=102?lower-87:-1}import{createHash}from"node:crypto";import{readFile}from"node:fs/promises";import{createRequire}from"node:module";import{dirname,join,resolve}from"node:path";import{Worker}from"node:worker_threads";class Output{code="";copies=[];spans=[];source;constructor(source){this.source=source}raw(text){return this.code+=text,this}copy(start,end){if(end>start)this.copies.push([this.code.length,start,end-start]),this.code+=this.source.slice(start,end);return this}from(offset,fn){let start=this.code.length;return fn(),this.spans.push([start,this.code.length,offset]),this}toSource(offset){let lo=0,hi=this.copies.length-1;while(lo<=hi){let mid=lo+hi>>1,[gen,src,len]=this.copies[mid];if(offset<gen)hi=mid-1;else if(offset>=gen+len)lo=mid+1;else return src+offset-gen}let best;for(let span of this.spans){if(offset<span[0]||offset>=span[1])continue;if(!best||span[1]-span[0]<best[1]-best[0])best=span}return best?best[2]:null}}function createLocator(text){let starts=[0];for(let i=text.indexOf(`
|
|
6
|
+
`);i!==-1;i=text.indexOf(`
|
|
7
|
+
`,i+1))starts.push(i+1);return{position(offset){let lo=0,hi=starts.length-1;while(lo<hi){let mid=lo+hi+1>>1;if(starts[mid]<=offset)lo=mid;else hi=mid-1}return{line:lo+1,column:offset-starts[lo]+1}},offset(line,column){return(starts[line-1]??text.length)+column-1}}}var DIGITS=new Map([..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].map((char,i)=>[char,i]));function decode(mappings){let lines=[],line=0,originalColumn=0;for(let encoded of mappings.split(";")){let segments=[],column=0;for(let segment of encoded.split(",")){if(!segment)continue;let fields=[],value=0,shift=0;for(let char of segment){let digit=DIGITS.get(char)??0;if(value+=(digit&31)<<shift,digit&32)shift+=5;else fields.push(value&1?-(value>>>1):value>>>1),value=0,shift=0}if(column+=fields[0]??0,fields.length<4)continue;line+=fields[2]??0,originalColumn+=fields[3]??0,segments.push([column,line,originalColumn])}lines.push(segments)}return lines}function originalPosition(map){if(!map)return(line,column)=>({line,column});let lines=decode(map.mappings);return(line,column)=>{let segments=lines[line-1]??[],found;for(let segment of segments){if(segment[0]>column-1)break;found=segment}if(!found)return{line,column};return{line:found[1]+1,column:found[2]+(column-1-found[0])+1}}}function svelteDirOf(cwd,svelte){return svelte?resolve(cwd,svelte):dirname(createRequire(join(cwd,"package.json")).resolve("svelte/package.json"))}var compilers=new Map;function compilerOf(svelteDir){let compiler=compilers.get(svelteDir);if(!compiler)compiler=createRequire(join(svelteDir,"package.json"))("svelte/compiler"),compilers.set(svelteDir,compiler);return compiler}function diagnosticsOf(compiler,source,filename,compilerOptions={}){try{let{warnings}=compiler.compile(source,{...compilerOptions,filename,generate:!1});return warnings.map((w)=>({severity:"warning",code:w.code,message:w.message,...positionsOf(w)}))}catch(error){let e=error;return[{severity:"error",code:e.code??"compile_error",message:e.message,...positionsOf(e)}]}}function positionsOf(w){let line=w.start?.line??1,column=(w.start?.column??0)+1;return{line,column,endLine:w.end?.line??line,endColumn:w.end?w.end.column+1:column}}function compilerDiagnostics2(source,filename,options={}){let compiler=compilerOf(svelteDirOf(resolve(options.cwd??process.cwd()),options.svelte));return diagnosticsOf(compiler,source,filename)}async function preprocessedDiagnostics(source,filename,svelteDir,config,preprocessed=Boolean(config.preprocess)){let compiler=compilerOf(svelteDir),{preprocess,compilerOptions}=config,diagnostics,processed=preprocess?await compiler.preprocess(source,preprocess,{filename}):void 0;if(!processed||processed.code===source)diagnostics=diagnosticsOf(compiler,source,filename,compilerOptions);else{let map=typeof processed.map==="string"?JSON.parse(processed.map):processed.map,toOriginal=originalPosition(map);diagnostics=diagnosticsOf(compiler,processed.code,filename,compilerOptions).map((d)=>{let start=toOriginal(d.line,d.column),end=toOriginal(d.endLine??d.line,d.endColumn??d.column);return{...d,...start,endLine:end.line,endColumn:end.column}})}return asSvelteCheck(diagnostics,source,preprocessed)}var HOOKS=["markup","script","style"],UNCHANGING=new Set(["sveltekit:warnings"]),TAG={script:/<script[\s/>]/i,style:/<style[\s/>]/i};function isJson(value){if(value===null||["string","number","boolean"].includes(typeof value))return!0;if(Array.isArray(value))return value.every(isJson);return typeof value==="object"&&Object.getPrototypeOf(value)===Object.prototype&&Object.values(value).every((v)=>v===void 0||isJson(v))}function readersOf(preprocess=[]){return preprocess.map((p)=>({name:typeof p.name==="string"?p.name:"",hooks:HOOKS.filter((hook)=>typeof p[hook]==="function")}))}function shapeOf(config){if(!isJson(config.compilerOptions))return;return{preprocess:readersOf(config.preprocess),preprocessed:Boolean(config.preprocess),compilerOptions:config.compilerOptions}}function untouched(source,readers){return readers.every((p)=>UNCHANGING.has(p.name)||p.hooks.every((hook)=>hook!=="markup"&&!TAG[hook].test(source)))}async function compileAll(request){let{shape,svelteDir}=request;if(shape&&request.components.every((c)=>untouched(c.source,shape.preprocess)))return{shape,results:await Promise.all(request.components.map(({source,filename})=>preprocessedDiagnostics(source,filename,svelteDir,{compilerOptions:shape.compilerOptions},shape.preprocessed)))};let config=await svelteConfigOf(request.configDir,request.configFile),readers=readersOf(config.preprocess),unprocessed={compilerOptions:config.compilerOptions};return{shape:shapeOf(config),results:await Promise.all(request.components.map(({source,filename})=>untouched(source,readers)?preprocessedDiagnostics(source,filename,svelteDir,unprocessed,Boolean(config.preprocess)):preprocessedDiagnostics(source,filename,svelteDir,config)))}}var worker,pending=new Map,waitedFor=new Set,nextId=0;function startWorker(){let file=import.meta.url.endsWith(".ts")?"compile-worker.ts":"compile-worker.js",started=new Worker(new URL(file,import.meta.url));started.unref(),started.on("message",(reply)=>{let job=pending.get(reply.id);if(!job)return;if(pending.delete(reply.id),waitedFor.delete(reply.id),waitedFor.size===0)started.unref();if(reply.error===void 0)job.done(reply.result);else job.fail(Error(reply.error))});let fallBack=()=>{if(worker!==started)return;worker=void 0;let jobs=[...pending.values()];pending.clear(),waitedFor.clear();for(let job of jobs)job.here().then(job.done,job.fail)};return started.on("error",fallBack),started.on("exit",fallBack),started}function post(message,here){let running=worker??=startWorker(),id=nextId++,result=new Promise((done,fail)=>{pending.set(id,{done,fail,here}),running.postMessage({id,...message})});return result.catch(()=>{}),{result,wait(){if(pending.has(id))waitedFor.add(id),worker?.ref();return result}}}function compileOffThread(request){if(configNeedsChdir(request.configDir,request.configFile))return;try{return post({request},()=>compileAll(request)).wait()}catch{return}}var compileKey=(filename,source)=>createHash("sha1").update(`${filename}\x00${source}`).digest("hex");async function compileFiles(request){let{files,...source}=request,components=await Promise.all(files.map(async({path,filename})=>({source:await readFile(path,"utf-8"),filename})));return{...await compileAll({...source,components}),keys:components.map((c)=>compileKey(c.filename,c.source))}}function compileFilesOffThread(request){if(configNeedsChdir(request.configDir,request.configFile))return;let at=performance.now();try{return{...post({files:request},()=>compileFiles(request)),at}}catch{return}}async function withEdits(early,keys,compileAgain){let edited=keys.flatMap((key,i)=>early.keys[i]===key?[]:[i]);if(edited.length===0)return early;let again=await compileAgain(edited),results=[...early.results];for(let[n,i]of edited.entries())results[i]=again[n]??[];return{...early,results}}var TEXT_TYPE=/^text\//,EXPORTED_TYPE=(name)=>new RegExp(`\\bexport\\s+?(enum|namespace)\\s+?${name}\\b`);function asSvelteCheck(diagnostics,source,preprocessed){let lexed=lexComponent2(source),script=lexed.instance??lexed.module,langOf=(attributes=[])=>{let lang=attributes.find((a)=>a.name==="lang")??attributes.find((a)=>a.name==="type");return typeof lang?.value==="string"?lang.value.replace(TEXT_TYPE,""):""},scriptLang=langOf(script?.attributes),styleLang=langOf(lexed.css?.attributes),ignoreScript=!preprocessed&&scriptLang!==""&&scriptLang!=="ts",ignoreStyle=!preprocessed&&styleLang!=="",offsetOf=createLocator(source).offset,inside=(d,tag)=>{if(!tag)return!1;let at=offsetOf(d.line,d.column);return tag.content.start<=at&&at<=tag.content.end},kept=[];for(let d of diagnostics){if(d.severity==="error"){if(d.message.includes("expected")){if(!preprocessed&&(scriptLang||styleLang))continue;let inScript=inside(d,script);if(inScript||inside(d,lexed.css))d.message+=`
|
|
8
|
+
|
|
9
|
+
If you expect this syntax to work, here are some suggestions: `+(inScript?'\nIf you use typescript with `svelte-preprocess`, did you add `lang="ts"` to your `script` tag? ':'\nIf you use less/SCSS with `svelte-preprocess`, did you add `lang="scss"`/`lang="less"` to your `style` tag? If you use SCSS, it may be necessary to add the path to your NODE runtime to the setting `svelte.language-server.runtime`, or use `sass` instead of `node-sass`. ')+"\nDid you setup a `svelte.config.js` or `vite.config.js`? \nSee https://github.com/sveltejs/language-tools/tree/master/docs#using-with-preprocessors for more info."}kept.push(d);continue}if(ignoreScript&&!d.code.startsWith("a11y"))continue;if(ignoreStyle&&(d.code==="css_unused_selector"||d.code==="css-unused-selector"))continue;if(d.code==="export_let_unused"||d.code==="unused-export-let"){let name=d.message.slice(d.message.indexOf("'")+1,d.message.lastIndexOf("'"));if(EXPORTED_TYPE(name).test(source))continue}kept.push(d)}return kept}
|
|
10
|
+
export{withoutByteOrderMark,isDigit,isWhitespace,skipWhitespace,isTypeScript,closingScriptTag,closingScriptTagEnd,isVoid,styleContentEnd,isQuote,nameEnd,endsUnquotedValue,isWordCode,closingBracket,wordCodesEnd,closingTagOmitted,lexComponent2,topLevelTags,lexImportsExports,Output,createLocator,svelteDirOf,compilerDiagnostics2,compileAll,compileOffThread,compileKey,compileFiles,compileFilesOffThread,withEdits};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Output}from"./shared-
|
|
1
|
+
import{Output}from"./shared-javac3d2.js";var names=Array(2048).fill(void 0);function resetNames(){names.fill(void 0)}function internName(input,start,end,hash){let slot=hash&2047,name=names[slot];if(name!==void 0&&name.length===end-start&&input.startsWith(name,start))return name;let word=input.slice(start,end);return names[slot]=word,word}var source="",lineStarts=[0],scanned=0,lastLine=0,breakEnds;function setSource(value){resetNames(),source=value,lineStarts=[0],scanned=0,lastLine=0,breakEnds=void 0}function scanTo(index){while(scanned<=index){let newline=source.indexOf(`
|
|
2
2
|
`,scanned);if(newline===-1){scanned=Number.POSITIVE_INFINITY;return}scanned=newline+1,lineStarts.push(scanned)}}function lineOf(starts,index,hint){let low=0,high=starts.length-1;if(index>=starts[hint])low=hint;else high=hint-1;if(low<high&&index<starts[low+1])high=low;while(low<high){let mid=low+high+1>>>1;if(starts[mid]<=index)low=mid;else high=mid-1}return low}function locate3(index){return scanTo(index),lastLine=lineOf(lineStarts,index,lastLine),{line:lastLine+1,column:index-lineStarts[lastLine],character:index}}var REGEX_LINE_BREAK=/\r\n?|\n|\u2028|\u2029/g,REGEX_OTHER_LINE_BREAK=/[\r\u2028\u2029]/;function lineBreaksBefore(offset){if(breakEnds===void 0){breakEnds=REGEX_OTHER_LINE_BREAK.test(source)?[]:null,REGEX_LINE_BREAK.lastIndex=0;while(breakEnds!==null&®EX_LINE_BREAK.exec(source)!==null)breakEnds.push(REGEX_LINE_BREAK.lastIndex)}if(breakEnds===null)return scanTo(offset),lineOf(lineStarts,offset,lastLine);let low=0,high=breakEnds.length;while(low<high){let mid=low+high>>>1;if(breakEnds[mid]<=offset)low=mid+1;else high=mid}return low}function position(index){let{line,column}=locate3(index);return{line,column}}function lineText(line){while(lineStarts.length<=line+1&&scanned!==Number.POSITIVE_INFINITY)scanTo(scanned);if(line>=lineStarts.length)return;let end=line+1<lineStarts.length?lineStarts[line+1]-1:source.length;return source.slice(lineStarts[line],end)}function isNode(value){return typeof value==="object"&&value!==null&&typeof fieldsOf(value).type==="string"}function fieldsOf(node){return node}function mapChildren(node,map){let fields=fieldsOf(node);for(let key in fields){let value=fields[key];if(Array.isArray(value)){for(let i=0;i<value.length;i++)if(isNode(value[i]))value[i]=map(value[i])}else if(isNode(value))fields[key]=map(value)}}function assertType(node,...types){if(!types.some((type)=>type===node.type))throw Error(`expected ${types.join(" or ")}, got ${node.type}`)}var reservedWords={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"},ecma5AndLessKeywords="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",keywords$1={5:ecma5AndLessKeywords,"5module":ecma5AndLessKeywords+" export import",6:ecma5AndLessKeywords+" const class extends export import super"},keywordRelationalOperator=/^in(stanceof)?$/,nonASCIIidentifierStart=/\p{ID_Start}/u,nonASCIIidentifier=/[\p{ID_Continue}\u200c\u200d]/u;function isIdentifierStart(code,astral){if(code<65)return code===36;if(code<91)return!0;if(code<97)return code===95;if(code<123)return!0;if(code>65535&&astral===!1)return!1;return code>=170&&nonASCIIidentifierStart.test(String.fromCodePoint(code))}function isIdentifierChar(code,astral){if(code<48)return code===36;if(code<58)return!0;if(code<65)return!1;if(code<91)return!0;if(code<97)return code===95;if(code<123)return!0;if(code>65535&&astral===!1)return!1;return code>=170&&nonASCIIidentifier.test(String.fromCodePoint(code))}var TokenType=function(label,conf){if(conf===void 0)conf={};this.label=label,this.keyword=conf.keyword,this.beforeExpr=!!conf.beforeExpr,this.startsExpr=!!conf.startsExpr,this.isLoop=!!conf.isLoop,this.isAssign=!!conf.isAssign,this.prefix=!!conf.prefix,this.postfix=!!conf.postfix,this.binop=conf.binop||null,this.updateContext=null};function binop(name,prec){return new TokenType(name,{beforeExpr:!0,binop:prec})}var beforeExpr={beforeExpr:!0},startsExpr={startsExpr:!0},keywords={};function kw(name,options){if(options===void 0)options={};return options.keyword=name,keywords[name]=new TokenType(name,options)}var types$1={num:new TokenType("num",startsExpr),regexp:new TokenType("regexp",startsExpr),string:new TokenType("string",startsExpr),name:new TokenType("name",startsExpr),privateId:new TokenType("privateId",startsExpr),eof:new TokenType("eof"),bracketL:new TokenType("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new TokenType("]"),braceL:new TokenType("{",{beforeExpr:!0,startsExpr:!0}),braceR:new TokenType("}"),parenL:new TokenType("(",{beforeExpr:!0,startsExpr:!0}),parenR:new TokenType(")"),comma:new TokenType(",",beforeExpr),semi:new TokenType(";",beforeExpr),colon:new TokenType(":",beforeExpr),dot:new TokenType("."),question:new TokenType("?",beforeExpr),questionDot:new TokenType("?."),arrow:new TokenType("=>",beforeExpr),template:new TokenType("template"),invalidTemplate:new TokenType("invalidTemplate"),ellipsis:new TokenType("...",beforeExpr),backQuote:new TokenType("`",startsExpr),dollarBraceL:new TokenType("${",{beforeExpr:!0,startsExpr:!0}),eq:new TokenType("=",{beforeExpr:!0,isAssign:!0}),assign:new TokenType("_=",{beforeExpr:!0,isAssign:!0}),incDec:new TokenType("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new TokenType("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:binop("||",1),logicalAND:binop("&&",2),bitwiseOR:binop("|",3),bitwiseXOR:binop("^",4),bitwiseAND:binop("&",5),equality:binop("==/!=/===/!==",6),relational:binop("</>/<=/>=",7),bitShift:binop("<</>>/>>>",8),plusMin:new TokenType("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:binop("%",10),star:binop("*",10),slash:binop("/",10),starstar:new TokenType("**",{beforeExpr:!0}),coalesce:binop("??",1),_break:kw("break"),_case:kw("case",beforeExpr),_catch:kw("catch"),_continue:kw("continue"),_debugger:kw("debugger"),_default:kw("default",beforeExpr),_do:kw("do",{isLoop:!0,beforeExpr:!0}),_else:kw("else",beforeExpr),_finally:kw("finally"),_for:kw("for",{isLoop:!0}),_function:kw("function",startsExpr),_if:kw("if"),_return:kw("return",beforeExpr),_switch:kw("switch"),_throw:kw("throw",beforeExpr),_try:kw("try"),_var:kw("var"),_const:kw("const"),_while:kw("while",{isLoop:!0}),_with:kw("with"),_new:kw("new",{beforeExpr:!0,startsExpr:!0}),_this:kw("this",startsExpr),_super:kw("super",startsExpr),_class:kw("class",startsExpr),_extends:kw("extends",beforeExpr),_export:kw("export"),_import:kw("import",startsExpr),_null:kw("null",startsExpr),_true:kw("true",startsExpr),_false:kw("false",startsExpr),_in:kw("in",{beforeExpr:!0,binop:7}),_instanceof:kw("instanceof",{beforeExpr:!0,binop:7}),_typeof:kw("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:kw("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:kw("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},lineBreak=/\r\n?|\n|\u2028|\u2029/,lineBreakG=new RegExp(lineBreak.source,"g");function isNewLine(code){return code===10||code===13||code===8232||code===8233}function nextLineBreak(code,from,end){if(end===void 0)end=code.length;for(var i=from;i<end;i++){var next=code.charCodeAt(i);if(isNewLine(next))return i<end-1&&next===13&&code.charCodeAt(i+1)===10?i+2:i+1}return-1}var nonASCIIwhitespace=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,skipWhiteSpace=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ref=Object.prototype,{hasOwnProperty,toString}=ref,hasOwn=Object.hasOwn||function(obj,propName){return hasOwnProperty.call(obj,propName)},isArray=Array.isArray||function(obj){return toString.call(obj)==="[object Array]"},regexpCache=Object.create(null);function wordsRegexp(words){return regexpCache[words]||(regexpCache[words]=new RegExp("^(?:"+words.replace(/ /g,"|")+")$"))}function codePointToString(code){if(code<=65535)return String.fromCharCode(code);return code-=65536,String.fromCharCode((code>>10)+55296,(code&1023)+56320)}var loneSurrogate=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Position=function(line,col){this.line=line,this.column=col};Position.prototype.offset=function(n){return new Position(this.line,this.column+n)};var SourceLocation=function(p,start,end){if(this.start=start,this.end=end,p.sourceFile!==null)this.source=p.sourceFile};function getLineInfo(input,offset){for(var line=1,cur=0;;){var nextBreak=nextLineBreak(input,cur,offset);if(nextBreak<0)return new Position(line,offset-cur);++line,cur=nextBreak}}var defaultOptions={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},warnedAboutEcmaVersion=!1;function getOptions(opts){var options={};for(var opt in defaultOptions)options[opt]=opts&&hasOwn(opts,opt)?opts[opt]:defaultOptions[opt];if(options.ecmaVersion==="latest")options.ecmaVersion=1e8;else if(options.ecmaVersion==null){if(!warnedAboutEcmaVersion&&typeof console==="object"&&console.warn)warnedAboutEcmaVersion=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
3
3
|
Defaulting to 2020, but this will stop working in the future.`);options.ecmaVersion=11}else if(options.ecmaVersion>=2015)options.ecmaVersion-=2009;if(options.allowReserved==null)options.allowReserved=options.ecmaVersion<5;if(!opts||opts.allowHashBang==null)options.allowHashBang=options.ecmaVersion>=14;if(isArray(options.onToken)){var tokens=options.onToken;options.onToken=function(token){return tokens.push(token)}}if(isArray(options.onComment))options.onComment=pushComment(options,options.onComment);if(options.sourceType==="commonjs"&&options.allowAwaitOutsideFunction)throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return options}function pushComment(options,array){return function(block,text,start,end,startLoc,endLoc){var comment={type:block?"Block":"Line",value:text,start,end};if(options.locations)comment.loc=new SourceLocation(this,startLoc,endLoc);if(options.ranges)comment.range=[start,end];array.push(comment)}}var SCOPE_TOP=1,SCOPE_FUNCTION=2,SCOPE_ASYNC=4,SCOPE_GENERATOR=8,SCOPE_ARROW=16,SCOPE_SIMPLE_CATCH=32,SCOPE_SUPER=64,SCOPE_DIRECT_SUPER=128,SCOPE_CLASS_STATIC_BLOCK=256,SCOPE_CLASS_FIELD_INIT=512,SCOPE_SWITCH=1024,SCOPE_VAR=SCOPE_TOP|SCOPE_FUNCTION|SCOPE_CLASS_STATIC_BLOCK;function functionFlags(async,generator){return SCOPE_FUNCTION|(async?SCOPE_ASYNC:0)|(generator?SCOPE_GENERATOR:0)}var BIND_NONE=0,BIND_VAR=1,BIND_LEXICAL=2,BIND_FUNCTION=3,BIND_SIMPLE_CATCH=4,BIND_OUTSIDE=5,Parser=function(options,input,startPos){this.options=options=getOptions(options),this.sourceFile=options.sourceFile,this.keywords=wordsRegexp(keywords$1[options.ecmaVersion>=6?6:options.sourceType==="module"?"5module":5]);var reserved="";if(options.allowReserved!==!0){if(reserved=reservedWords[options.ecmaVersion>=6?6:options.ecmaVersion===5?5:3],options.sourceType==="module")reserved+=" await"}this.reservedWords=wordsRegexp(reserved);var reservedStrict=(reserved?reserved+" ":"")+reservedWords.strict;if(this.reservedWordsStrict=wordsRegexp(reservedStrict),this.reservedWordsStrictBind=wordsRegexp(reservedStrict+" "+reservedWords.strictBind),this.input=String(input),this.containsEsc=!1,this.pos=startPos||0,this.curLine=1,options.startLocation)this.lineStart=this.pos-options.startLocation.column,this.curLine=options.startLocation.line;else if(startPos){if(this.lineStart=this.input.lastIndexOf(`
|
|
4
4
|
`,startPos-1)+1,this.options.locations)this.curLine=this.input.slice(0,this.lineStart).split(lineBreak).length}else this.lineStart=0;if(this.type=types$1.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=options.sourceType==="module",this.strict=this.inModule||options.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&&options.allowHashBang&&this.input.slice(0,2)==="#!")this.skipLineComment(2);this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?SCOPE_FUNCTION:SCOPE_TOP),this.regexpState=null,this.privateNameStack=[]},prototypeAccessors={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}};Parser.prototype.parse=function(){var this$1$1=this,node=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return this$1$1.parseTopLevel(node)})};prototypeAccessors.inFunction.get=function(){return(this.currentVarScope().flags&SCOPE_FUNCTION)>0};prototypeAccessors.inGenerator.get=function(){return(this.currentVarScope().flags&SCOPE_GENERATOR)>0};prototypeAccessors.inAsync.get=function(){return(this.currentVarScope().flags&SCOPE_ASYNC)>0};prototypeAccessors.canAwait.get=function(){for(var i=this.scopeStack.length-1;i>=0;i--){var ref=this.scopeStack[i],flags=ref.flags;if(flags&(SCOPE_CLASS_STATIC_BLOCK|SCOPE_CLASS_FIELD_INIT))return!1;if(flags&SCOPE_FUNCTION)return(flags&SCOPE_ASYNC)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};prototypeAccessors.allowReturn.get=function(){if(this.inFunction)return!0;if(this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&SCOPE_TOP)return!0;return!1};prototypeAccessors.allowSuper.get=function(){var ref=this.currentThisScope(),flags=ref.flags;return(flags&SCOPE_SUPER)>0||this.options.allowSuperOutsideMethod};prototypeAccessors.allowDirectSuper.get=function(){return(this.currentThisScope().flags&SCOPE_DIRECT_SUPER)>0};prototypeAccessors.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};prototypeAccessors.allowNewDotTarget.get=function(){for(var i=this.scopeStack.length-1;i>=0;i--){var ref=this.scopeStack[i],flags=ref.flags;if(flags&(SCOPE_CLASS_STATIC_BLOCK|SCOPE_CLASS_FIELD_INIT)||flags&SCOPE_FUNCTION&&!(flags&SCOPE_ARROW))return!0}return!1};prototypeAccessors.allowUsing.get=function(){var ref=this.currentScope(),flags=ref.flags;if(flags&SCOPE_SWITCH)return!1;if(!this.inModule&&flags&SCOPE_TOP)return!1;return!0};prototypeAccessors.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&SCOPE_CLASS_STATIC_BLOCK)>0};Parser.extend=function(){var plugins=[],len=arguments.length;while(len--)plugins[len]=arguments[len];var cls=this;for(var i=0;i<plugins.length;i++)cls=plugins[i](cls);return cls};Parser.parse=function(input,options){return new this(options,input).parse()};Parser.parseExpressionAt=function(input,pos,options){var parser=new this(options,input,pos);return parser.nextToken(),parser.parseExpression()};Parser.tokenizer=function(input,options){return new this(options,input)};Object.defineProperties(Parser.prototype,prototypeAccessors);var pp$9=Parser.prototype,literal=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;pp$9.strictDirective=function(start){if(this.options.ecmaVersion<5)return!1;for(;;){skipWhiteSpace.lastIndex=start,start+=skipWhiteSpace.exec(this.input)[0].length;var match=literal.exec(this.input.slice(start));if(!match)return!1;if((match[1]||match[2])==="use strict"){skipWhiteSpace.lastIndex=start+match[0].length;var spaceAfter=skipWhiteSpace.exec(this.input),end=spaceAfter.index+spaceAfter[0].length,next=this.input.charAt(end);return next===";"||next==="}"||lineBreak.test(spaceAfter[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(next)||next==="!"&&this.input.charAt(end+1)==="=")}if(start+=match[0].length,skipWhiteSpace.lastIndex=start,start+=skipWhiteSpace.exec(this.input)[0].length,this.input[start]===";")start++}};pp$9.eat=function(type){if(this.type===type)return this.next(),!0;else return!1};pp$9.isContextual=function(name){return this.type===types$1.name&&this.value===name&&!this.containsEsc};pp$9.eatContextual=function(name){if(!this.isContextual(name))return!1;return this.next(),!0};pp$9.catchStackOverflow=function(f){try{return f()}catch(e){if(e instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message)||/\btoo much recursion\b/i.test(e.message)))this.raise(this.start,"Not enough stack space to parse input");else throw e}};pp$9.expectContextual=function(name){if(!this.eatContextual(name))this.unexpected()};pp$9.canInsertSemicolon=function(){return this.type===types$1.eof||this.type===types$1.braceR||lineBreak.test(this.input.slice(this.lastTokEnd,this.start))};pp$9.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon)this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc);return!0}};pp$9.semicolon=function(){if(!this.eat(types$1.semi)&&!this.insertSemicolon())this.unexpected()};pp$9.afterTrailingComma=function(tokType,notNext){if(this.type===tokType){if(this.options.onTrailingComma)this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc);if(!notNext)this.next();return!0}};pp$9.expect=function(type){this.eat(type)||this.unexpected()};pp$9.unexpected=function(pos){this.raise(pos!=null?pos:this.start,"Unexpected token")};var DestructuringErrors=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};pp$9.checkPatternErrors=function(refDestructuringErrors,isAssign){if(!refDestructuringErrors)return;if(refDestructuringErrors.trailingComma>-1)this.raiseRecoverable(refDestructuringErrors.trailingComma,"Comma is not permitted after the rest element");var parens=isAssign?refDestructuringErrors.parenthesizedAssign:refDestructuringErrors.parenthesizedBind;if(parens>-1)this.raiseRecoverable(parens,isAssign?"Assigning to rvalue":"Parenthesized pattern")};pp$9.checkExpressionErrors=function(refDestructuringErrors,andThrow){if(!refDestructuringErrors)return!1;var{shorthandAssign,doubleProto}=refDestructuringErrors;if(!andThrow)return shorthandAssign>=0||doubleProto>=0;if(shorthandAssign>=0)this.raise(shorthandAssign,"Shorthand property assignments are valid only in destructuring patterns");if(doubleProto>=0)this.raiseRecoverable(doubleProto,"Redefinition of __proto__ property")};pp$9.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")};pp$9.isSimpleAssignTarget=function(expr){if(expr.type==="ParenthesizedExpression")return this.isSimpleAssignTarget(expr.expression);return expr.type==="Identifier"||expr.type==="MemberExpression"};var pp$8=Parser.prototype;pp$8.parseTopLevel=function(node){var exports$1=Object.create(null);if(!node.body)node.body=[];while(this.type!==types$1.eof){var stmt=this.parseStatement(null,!0,exports$1);node.body.push(stmt)}if(this.inModule)for(var i=0,list=Object.keys(this.undefinedExports);i<list.length;i+=1){var name=list[i];this.raiseRecoverable(this.undefinedExports[name].start,"Export '"+name+"' is not defined")}return this.adaptDirectivePrologue(node.body),this.next(),node.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(node,"Program")};var loopLabel={kind:"loop"},switchLabel={kind:"switch"};pp$8.isLet=function(context){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;skipWhiteSpace.lastIndex=this.pos;var skip=skipWhiteSpace.exec(this.input),next=this.pos+skip[0].length,nextCh=this.fullCharCodeAt(next);if(nextCh===91||nextCh===92)return!0;if(context)return!1;if(nextCh===123)return!0;if(isIdentifierStart(nextCh)){var start=next;do next+=nextCh<=65535?1:2;while(isIdentifierChar(nextCh=this.fullCharCodeAt(next)));if(nextCh===92)return!0;var ident=this.input.slice(start,next);if(!keywordRelationalOperator.test(ident))return!0}return!1};pp$8.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;skipWhiteSpace.lastIndex=this.pos;var skip=skipWhiteSpace.exec(this.input),next=this.pos+skip[0].length,after;return!lineBreak.test(this.input.slice(this.pos,next))&&this.input.slice(next,next+8)==="function"&&(next+8===this.input.length||!(isIdentifierChar(after=this.fullCharCodeAt(next+8))||after===92))};pp$8.isUsingKeyword=function(isAwaitUsing,isFor){if(this.options.ecmaVersion<17||!this.isContextual(isAwaitUsing?"await":"using"))return!1;skipWhiteSpace.lastIndex=this.pos;var skip=skipWhiteSpace.exec(this.input),next=this.pos+skip[0].length;if(lineBreak.test(this.input.slice(this.pos,next)))return!1;if(isAwaitUsing){var usingEndPos=next+5,after;if(this.input.slice(next,usingEndPos)!=="using"||usingEndPos===this.input.length||isIdentifierChar(after=this.fullCharCodeAt(usingEndPos))||after===92)return!1;skipWhiteSpace.lastIndex=usingEndPos;var skipAfterUsing=skipWhiteSpace.exec(this.input);if(next=usingEndPos+skipAfterUsing[0].length,skipAfterUsing&&lineBreak.test(this.input.slice(usingEndPos,next)))return!1}var ch=this.fullCharCodeAt(next);if(!isIdentifierStart(ch)&&ch!==92)return!1;var idStart=next;do next+=ch<=65535?1:2;while(isIdentifierChar(ch=this.fullCharCodeAt(next)));if(ch===92)return!0;var id=this.input.slice(idStart,next);if(keywordRelationalOperator.test(id))return!1;if(isFor&&!isAwaitUsing&&id==="of"){skipWhiteSpace.lastIndex=next;var skipAfterOf=skipWhiteSpace.exec(this.input);if(next=next+skipAfterOf[0].length,this.input.charCodeAt(next)!==61||(ch=this.input.charCodeAt(next+1))===61||ch===62)return!1}return!0};pp$8.isAwaitUsing=function(isFor){return this.isUsingKeyword(!0,isFor)};pp$8.isUsing=function(isFor){return this.isUsingKeyword(!1,isFor)};pp$8.parseStatement=function(context,topLevel,exports$1){var starttype=this.type,node=this.startNode(),kind;if(this.isLet(context))starttype=types$1._var,kind="let";switch(starttype){case types$1._break:case types$1._continue:return this.parseBreakContinueStatement(node,starttype.keyword);case types$1._debugger:return this.parseDebuggerStatement(node);case types$1._do:return this.parseDoStatement(node);case types$1._for:return this.parseForStatement(node);case types$1._function:if(context&&(this.strict||context!=="if"&&context!=="label")&&this.options.ecmaVersion>=6)this.unexpected();return this.parseFunctionStatement(node,!1,!context);case types$1._class:if(context)this.unexpected();return this.parseClass(node,!0);case types$1._if:return this.parseIfStatement(node);case types$1._return:return this.parseReturnStatement(node);case types$1._switch:return this.parseSwitchStatement(node);case types$1._throw:return this.parseThrowStatement(node);case types$1._try:return this.parseTryStatement(node);case types$1._const:case types$1._var:if(kind=kind||this.value,context&&kind!=="var")this.unexpected();return this.parseVarStatement(node,kind);case types$1._while:return this.parseWhileStatement(node);case types$1._with:return this.parseWithStatement(node);case types$1.braceL:return this.parseBlock(!0,node);case types$1.semi:return this.parseEmptyStatement(node);case types$1._export:case types$1._import:if(this.options.ecmaVersion>10&&starttype===types$1._import){skipWhiteSpace.lastIndex=this.pos;var skip=skipWhiteSpace.exec(this.input),next=this.pos+skip[0].length,nextCh=this.input.charCodeAt(next);if(nextCh===40||nextCh===46)return this.parseExpressionStatement(node,this.parseExpression())}if(!this.options.allowImportExportEverywhere){if(!topLevel)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 starttype===types$1._import?this.parseImport(node):this.parseExport(node,exports$1);default:if(this.isAsyncFunction()){if(context)this.unexpected();return this.next(),this.parseFunctionStatement(node,!0,!context)}var usingKind=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(usingKind){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(context)this.raise(this.start,"Using declaration is not allowed in single-statement positions");if(usingKind==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.next(),this.parseVar(node,!1,usingKind),this.semicolon(),this.finishNode(node,"VariableDeclaration")}var maybeName=this.value,expr=this.parseExpression();if(starttype===types$1.name&&expr.type==="Identifier"&&this.eat(types$1.colon))return this.parseLabeledStatement(node,maybeName,expr,context);else return this.parseExpressionStatement(node,expr)}};pp$8.parseBreakContinueStatement=function(node,keyword){var isBreak=keyword==="break";if(this.next(),this.eat(types$1.semi)||this.insertSemicolon())node.label=null;else if(this.type!==types$1.name)this.unexpected();else node.label=this.parseIdent(),this.semicolon();var i=0;for(;i<this.labels.length;++i){var lab=this.labels[i];if(node.label==null||lab.name===node.label.name){if(lab.kind!=null&&(isBreak||lab.kind==="loop"))break;if(node.label&&isBreak)break}}if(i===this.labels.length)this.raise(node.start,"Unsyntactic "+keyword);return this.finishNode(node,isBreak?"BreakStatement":"ContinueStatement")};pp$8.parseDebuggerStatement=function(node){return this.next(),this.semicolon(),this.finishNode(node,"DebuggerStatement")};pp$8.parseDoStatement=function(node){if(this.next(),this.labels.push(loopLabel),node.body=this.parseStatement("do"),this.labels.pop(),this.expect(types$1._while),node.test=this.parseParenExpression(),this.options.ecmaVersion>=6)this.eat(types$1.semi);else this.semicolon();return this.finishNode(node,"DoWhileStatement")};pp$8.parseForStatement=function(node){this.next();var awaitAt=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(loopLabel),this.enterScope(0),this.expect(types$1.parenL),this.type===types$1.semi){if(awaitAt>-1)this.unexpected(awaitAt);return this.parseFor(node,null)}var isLet=this.isLet();if(this.type===types$1._var||this.type===types$1._const||isLet){var init$1=this.startNode(),kind=isLet?"let":this.value;return this.next(),this.parseVar(init$1,!0,kind),this.finishNode(init$1,"VariableDeclaration"),this.parseForAfterInit(node,init$1,awaitAt)}var startsWithLet=this.isContextual("let"),isForOf=!1,usingKind=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(usingKind){var init$2=this.startNode();if(this.next(),usingKind==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.parseVar(init$2,!0,usingKind),this.finishNode(init$2,"VariableDeclaration"),this.parseForAfterInit(node,init$2,awaitAt)}var containsEsc=this.containsEsc,refDestructuringErrors=new DestructuringErrors,initPos=this.start,init=awaitAt>-1?this.parseExprSubscripts(refDestructuringErrors,"await"):this.parseExpression(!0,refDestructuringErrors);if(this.type===types$1._in||(isForOf=this.options.ecmaVersion>=6&&this.isContextual("of"))){if(awaitAt>-1){if(this.type===types$1._in)this.unexpected(awaitAt);node.await=!0}else if(isForOf&&this.options.ecmaVersion>=8){if(init.start===initPos&&!containsEsc&&init.type==="Identifier"&&init.name==="async")this.unexpected();else if(this.options.ecmaVersion>=9)node.await=!1}if(startsWithLet&&isForOf)this.raise(init.start,"The left-hand side of a for-of loop may not start with 'let'.");return this.toAssignable(init,!1,refDestructuringErrors),this.checkLValPattern(init),this.parseForIn(node,init)}else this.checkExpressionErrors(refDestructuringErrors,!0);if(awaitAt>-1)this.unexpected(awaitAt);return this.parseFor(node,init)};pp$8.parseForAfterInit=function(node,init,awaitAt){if((this.type===types$1._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&init.declarations.length===1){if(this.type===types$1._in){if((init.kind==="using"||init.kind==="await using")&&!init.declarations[0].init)this.raise(this.start,"Using declaration is not allowed in for-in loops");if(this.options.ecmaVersion>=9&&awaitAt>-1)this.unexpected(awaitAt)}else if(this.options.ecmaVersion>=9)node.await=awaitAt>-1;return this.parseForIn(node,init)}if(awaitAt>-1)this.unexpected(awaitAt);return this.parseFor(node,init)};pp$8.parseFunctionStatement=function(node,isAsync,declarationPosition){return this.next(),this.parseFunction(node,FUNC_STATEMENT|(declarationPosition?0:FUNC_HANGING_STATEMENT),!1,isAsync)};pp$8.parseIfStatement=function(node){return this.next(),node.test=this.parseParenExpression(),node.consequent=this.parseStatement("if"),node.alternate=this.eat(types$1._else)?this.parseStatement("if"):null,this.finishNode(node,"IfStatement")};pp$8.parseReturnStatement=function(node){if(!this.allowReturn)this.raise(this.start,"'return' outside of function");if(this.next(),this.eat(types$1.semi)||this.insertSemicolon())node.argument=null;else node.argument=this.parseExpression(),this.semicolon();return this.finishNode(node,"ReturnStatement")};pp$8.parseSwitchStatement=function(node){this.next(),node.discriminant=this.parseParenExpression(),node.cases=[],this.expect(types$1.braceL),this.labels.push(switchLabel),this.enterScope(SCOPE_SWITCH);var cur;for(var sawDefault=!1;this.type!==types$1.braceR;)if(this.type===types$1._case||this.type===types$1._default){var isCase=this.type===types$1._case;if(cur)this.finishNode(cur,"SwitchCase");if(node.cases.push(cur=this.startNode()),cur.consequent=[],this.next(),isCase)cur.test=this.parseExpression();else{if(sawDefault)this.raiseRecoverable(this.lastTokStart,"Multiple default clauses");sawDefault=!0,cur.test=null}this.expect(types$1.colon)}else{if(!cur)this.unexpected();cur.consequent.push(this.parseStatement(null))}if(this.exitScope(),cur)this.finishNode(cur,"SwitchCase");return this.next(),this.labels.pop(),this.finishNode(node,"SwitchStatement")};pp$8.parseThrowStatement=function(node){if(this.next(),lineBreak.test(this.input.slice(this.lastTokEnd,this.start)))this.raise(this.lastTokEnd,"Illegal newline after throw");return node.argument=this.parseExpression(),this.semicolon(),this.finishNode(node,"ThrowStatement")};var empty$1=[];pp$8.parseCatchClauseParam=function(){var param=this.parseBindingAtom(),simple=param.type==="Identifier";return this.enterScope(simple?SCOPE_SIMPLE_CATCH:0),this.checkLValPattern(param,simple?BIND_SIMPLE_CATCH:BIND_LEXICAL),this.expect(types$1.parenR),param};pp$8.parseTryStatement=function(node){if(this.next(),node.block=this.parseBlock(),node.handler=null,this.type===types$1._catch){var clause=this.startNode();if(this.next(),this.eat(types$1.parenL))clause.param=this.parseCatchClauseParam();else{if(this.options.ecmaVersion<10)this.unexpected();clause.param=null,this.enterScope(0)}clause.body=this.parseBlock(!1),this.exitScope(),node.handler=this.finishNode(clause,"CatchClause")}if(node.finalizer=this.eat(types$1._finally)?this.parseBlock():null,!node.handler&&!node.finalizer)this.raise(node.start,"Missing catch or finally clause");return this.finishNode(node,"TryStatement")};pp$8.parseVarStatement=function(node,kind,allowMissingInitializer){return this.next(),this.parseVar(node,!1,kind,allowMissingInitializer),this.semicolon(),this.finishNode(node,"VariableDeclaration")};pp$8.parseWhileStatement=function(node){return this.next(),node.test=this.parseParenExpression(),this.labels.push(loopLabel),node.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(node,"WhileStatement")};pp$8.parseWithStatement=function(node){if(this.strict)this.raise(this.start,"'with' in strict mode");return this.next(),node.object=this.parseParenExpression(),node.body=this.parseStatement("with"),this.finishNode(node,"WithStatement")};pp$8.parseEmptyStatement=function(node){return this.next(),this.finishNode(node,"EmptyStatement")};pp$8.parseLabeledStatement=function(node,maybeName,expr,context){for(var i$1=0,list=this.labels;i$1<list.length;i$1+=1){var label=list[i$1];if(label.name===maybeName)this.raise(expr.start,"Label '"+maybeName+"' is already declared")}var kind=this.type.isLoop?"loop":this.type===types$1._switch?"switch":null;for(var i=this.labels.length-1;i>=0;i--){var label$1=this.labels[i];if(label$1.statementStart===node.start)label$1.statementStart=this.start,label$1.kind=kind;else break}return this.labels.push({name:maybeName,kind,statementStart:this.start}),node.body=this.parseStatement(context?context.indexOf("label")===-1?context+"label":context:"label"),this.labels.pop(),node.label=expr,this.finishNode(node,"LabeledStatement")};pp$8.parseExpressionStatement=function(node,expr){return node.expression=expr,this.semicolon(),this.finishNode(node,"ExpressionStatement")};pp$8.parseBlock=function(createNewLexicalScope,node,exitStrict){if(createNewLexicalScope===void 0)createNewLexicalScope=!0;if(node===void 0)node=this.startNode();if(node.body=[],this.expect(types$1.braceL),createNewLexicalScope)this.enterScope(0);while(this.type!==types$1.braceR){var stmt=this.parseStatement(null);node.body.push(stmt)}if(exitStrict)this.strict=!1;if(this.next(),createNewLexicalScope)this.exitScope();return this.finishNode(node,"BlockStatement")};pp$8.parseFor=function(node,init){return node.init=init,this.expect(types$1.semi),node.test=this.type===types$1.semi?null:this.parseExpression(),this.expect(types$1.semi),node.update=this.type===types$1.parenR?null:this.parseExpression(),this.expect(types$1.parenR),node.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(node,"ForStatement")};pp$8.parseForIn=function(node,init){var isForIn=this.type===types$1._in;if(this.next(),init.type==="VariableDeclaration"&&init.declarations[0].init!=null&&(!isForIn||this.options.ecmaVersion<8||this.strict||init.kind!=="var"||init.declarations[0].id.type!=="Identifier"))this.raise(init.start,(isForIn?"for-in":"for-of")+" loop variable declaration may not have an initializer");return node.left=init,node.right=isForIn?this.parseExpression():this.parseMaybeAssign(),this.expect(types$1.parenR),node.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(node,isForIn?"ForInStatement":"ForOfStatement")};pp$8.parseVar=function(node,isFor,kind,allowMissingInitializer){node.declarations=[],node.kind=kind;for(;;){var decl=this.startNode();if(this.parseVarId(decl,kind),this.eat(types$1.eq))decl.init=this.parseMaybeAssign(isFor);else if(!allowMissingInitializer&&kind==="const"&&!(this.type===types$1._in||this.options.ecmaVersion>=6&&this.isContextual("of")))this.unexpected();else if(!allowMissingInitializer&&(kind==="using"||kind==="await using")&&this.options.ecmaVersion>=17&&this.type!==types$1._in&&!this.isContextual("of"))this.raise(this.lastTokEnd,"Missing initializer in "+kind+" declaration");else if(!allowMissingInitializer&&decl.id.type!=="Identifier"&&!(isFor&&(this.type===types$1._in||this.isContextual("of"))))this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value");else decl.init=null;if(node.declarations.push(this.finishNode(decl,"VariableDeclarator")),!this.eat(types$1.comma))break}return node};pp$8.parseVarId=function(decl,kind){decl.id=kind==="using"||kind==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(decl.id,kind==="var"?BIND_VAR:BIND_LEXICAL,!1)};var FUNC_STATEMENT=1,FUNC_HANGING_STATEMENT=2,FUNC_NULLABLE_ID=4;pp$8.parseFunction=function(node,statement,allowExpressionBody,isAsync,forInit){if(this.initFunction(node),this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!isAsync){if(this.type===types$1.star&&statement&FUNC_HANGING_STATEMENT)this.unexpected();node.generator=this.eat(types$1.star)}if(this.options.ecmaVersion>=8)node.async=!!isAsync;if(statement&FUNC_STATEMENT){if(node.id=statement&FUNC_NULLABLE_ID&&this.type!==types$1.name?null:this.parseIdent(),node.id&&!(statement&FUNC_HANGING_STATEMENT))this.checkLValSimple(node.id,this.strict||node.generator||node.async?this.treatFunctionsAsVar?BIND_VAR:BIND_LEXICAL:BIND_FUNCTION)}var oldYieldPos=this.yieldPos,oldAwaitPos=this.awaitPos,oldAwaitIdentPos=this.awaitIdentPos;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(functionFlags(node.async,node.generator)),!(statement&FUNC_STATEMENT))node.id=this.type===types$1.name?this.parseIdent():null;return this.parseFunctionParams(node),this.parseFunctionBody(node,allowExpressionBody,!1,forInit),this.yieldPos=oldYieldPos,this.awaitPos=oldAwaitPos,this.awaitIdentPos=oldAwaitIdentPos,this.finishNode(node,statement&FUNC_STATEMENT?"FunctionDeclaration":"FunctionExpression")};pp$8.parseFunctionParams=function(node){this.expect(types$1.parenL),node.params=this.parseBindingList(types$1.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};pp$8.parseClass=function(node,isStatement){this.next();var oldStrict=this.strict;this.strict=!0,this.parseClassId(node,isStatement),this.parseClassSuper(node);var privateNameMap=this.enterClassBody(),classBody=this.startNode(),hadConstructor=!1;classBody.body=[],this.expect(types$1.braceL);while(this.type!==types$1.braceR){var element=this.parseClassElement(node.superClass!==null);if(element){if(classBody.body.push(element),element.type==="MethodDefinition"&&element.kind==="constructor"){if(hadConstructor)this.raiseRecoverable(element.start,"Duplicate constructor in the same class");hadConstructor=!0}else if(element.key&&element.key.type==="PrivateIdentifier"&&isPrivateNameConflicted(privateNameMap,element))this.raiseRecoverable(element.key.start,"Identifier '#"+element.key.name+"' has already been declared")}}return this.strict=oldStrict,this.next(),node.body=this.finishNode(classBody,"ClassBody"),this.exitClassBody(),this.finishNode(node,isStatement?"ClassDeclaration":"ClassExpression")};pp$8.parseClassElement=function(constructorAllowsSuper){if(this.eat(types$1.semi))return null;var ecmaVersion=this.options.ecmaVersion,node=this.startNode(),keyName="",isGenerator=!1,isAsync=!1,kind="method",isStatic=!1;if(this.eatContextual("static")){if(ecmaVersion>=13&&this.eat(types$1.braceL))return this.parseClassStaticBlock(node),node;if(this.isClassElementNameStart()||this.type===types$1.star)isStatic=!0;else keyName="static"}if(node.static=isStatic,!keyName&&ecmaVersion>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===types$1.star)&&!this.canInsertSemicolon())isAsync=!0;else keyName="async";if(!keyName&&(ecmaVersion>=9||!isAsync)&&this.eat(types$1.star))isGenerator=!0;if(!keyName&&!isAsync&&!isGenerator){var lastValue=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())kind=lastValue;else keyName=lastValue}if(keyName)node.computed=!1,node.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),node.key.name=keyName,this.finishNode(node.key,"Identifier");else this.parseClassElementName(node);if(ecmaVersion<13||this.type===types$1.parenL||kind!=="method"||isGenerator||isAsync){var isConstructor=!node.static&&checkKeyName(node,"constructor"),allowsDirectSuper=isConstructor&&constructorAllowsSuper;if(isConstructor&&kind!=="method")this.raise(node.key.start,"Constructor can't have get/set modifier");node.kind=isConstructor?"constructor":kind,this.parseClassMethod(node,isGenerator,isAsync,allowsDirectSuper)}else this.parseClassField(node);return node};pp$8.isClassElementNameStart=function(){return this.type===types$1.name||this.type===types$1.privateId||this.type===types$1.num||this.type===types$1.string||this.type===types$1.bracketL||this.type.keyword};pp$8.parseClassElementName=function(element){if(this.type===types$1.privateId){if(this.value==="constructor")this.raise(this.start,"Classes can't have an element named '#constructor'");element.computed=!1,element.key=this.parsePrivateIdent()}else this.parsePropertyName(element)};pp$8.parseClassMethod=function(method,isGenerator,isAsync,allowsDirectSuper){var key=method.key;if(method.kind==="constructor"){if(isGenerator)this.raise(key.start,"Constructor can't be a generator");if(isAsync)this.raise(key.start,"Constructor can't be an async method")}else if(method.static&&checkKeyName(method,"prototype"))this.raise(key.start,"Classes may not have a static property named prototype");var value=method.value=this.parseMethod(isGenerator,isAsync,allowsDirectSuper);if(method.kind==="get"&&value.params.length!==0)this.raiseRecoverable(value.start,"getter should have no params");if(method.kind==="set"&&value.params.length!==1)this.raiseRecoverable(value.start,"setter should have exactly one param");if(method.kind==="set"&&value.params[0].type==="RestElement")this.raiseRecoverable(value.params[0].start,"Setter cannot use rest params");return this.finishNode(method,"MethodDefinition")};pp$8.parseClassField=function(field){if(checkKeyName(field,"constructor"))this.raise(field.key.start,"Classes can't have a field named 'constructor'");else if(field.static&&checkKeyName(field,"prototype"))this.raise(field.key.start,"Classes can't have a static field named 'prototype'");if(this.eat(types$1.eq))this.enterScope(SCOPE_CLASS_FIELD_INIT|SCOPE_SUPER),field.value=this.parseMaybeAssign(),this.exitScope();else field.value=null;return this.semicolon(),this.finishNode(field,"PropertyDefinition")};pp$8.parseClassStaticBlock=function(node){node.body=[];var oldLabels=this.labels;this.labels=[],this.enterScope(SCOPE_CLASS_STATIC_BLOCK|SCOPE_SUPER);while(this.type!==types$1.braceR){var stmt=this.parseStatement(null);node.body.push(stmt)}return this.next(),this.exitScope(),this.labels=oldLabels,this.finishNode(node,"StaticBlock")};pp$8.parseClassId=function(node,isStatement){if(this.type===types$1.name){if(node.id=this.parseIdent(),isStatement)this.checkLValSimple(node.id,BIND_LEXICAL,!1)}else{if(isStatement===!0)this.unexpected();node.id=null}};pp$8.parseClassSuper=function(node){node.superClass=this.eat(types$1._extends)?this.parseExprSubscripts(null,!1):null};pp$8.enterClassBody=function(){var element={declared:Object.create(null),used:[]};return this.privateNameStack.push(element),element.declared};pp$8.exitClassBody=function(){var ref=this.privateNameStack.pop(),{declared,used}=ref;if(!this.options.checkPrivateFields)return;var len=this.privateNameStack.length,parent=len===0?null:this.privateNameStack[len-1];for(var i=0;i<used.length;++i){var id=used[i];if(!hasOwn(declared,id.name))if(parent)parent.used.push(id);else this.raiseRecoverable(id.start,"Private field '#"+id.name+"' must be declared in an enclosing class")}};function isPrivateNameConflicted(privateNameMap,element){var name=element.key.name,curr=privateNameMap[name],next="true";if(element.type==="MethodDefinition"&&(element.kind==="get"||element.kind==="set"))next=(element.static?"s":"i")+element.kind;if(curr==="iget"&&next==="iset"||curr==="iset"&&next==="iget"||curr==="sget"&&next==="sset"||curr==="sset"&&next==="sget")return privateNameMap[name]="true",!1;else if(!curr)return privateNameMap[name]=next,!1;else return!0}function checkKeyName(node,name){var{computed,key}=node;return!computed&&(key.type==="Identifier"&&key.name===name||key.type==="Literal"&&key.value===name)}pp$8.parseExportAllDeclaration=function(node,exports$1){if(this.options.ecmaVersion>=11)if(this.eatContextual("as"))node.exported=this.parseModuleExportName(),this.checkExport(exports$1,node.exported,this.lastTokStart);else node.exported=null;if(this.expectContextual("from"),this.type!==types$1.string)this.unexpected();if(node.source=this.parseExprAtom(),this.options.ecmaVersion>=16)node.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(node,"ExportAllDeclaration")};pp$8.parseExport=function(node,exports$1){if(this.next(),this.eat(types$1.star))return this.parseExportAllDeclaration(node,exports$1);if(this.eat(types$1._default))return this.checkExport(exports$1,"default",this.lastTokStart),node.declaration=this.parseExportDefaultDeclaration(),this.finishNode(node,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(node.declaration=this.parseExportDeclaration(node),node.declaration.type==="VariableDeclaration")this.checkVariableExport(exports$1,node.declaration.declarations);else this.checkExport(exports$1,node.declaration.id,node.declaration.id.start);if(node.specifiers=[],node.source=null,this.options.ecmaVersion>=16)node.attributes=[]}else{if(node.declaration=null,node.specifiers=this.parseExportSpecifiers(exports$1),this.eatContextual("from")){if(this.type!==types$1.string)this.unexpected();if(node.source=this.parseExprAtom(),this.options.ecmaVersion>=16)node.attributes=this.parseWithClause()}else{for(var i=0,list=node.specifiers;i<list.length;i+=1){var spec=list[i];if(this.checkUnreserved(spec.local),this.checkLocalExport(spec.local),spec.local.type==="Literal")this.raise(spec.local.start,"A string literal cannot be used as an exported binding without `from`.")}if(node.source=null,this.options.ecmaVersion>=16)node.attributes=[]}this.semicolon()}return this.finishNode(node,"ExportNamedDeclaration")};pp$8.parseExportDeclaration=function(node){return this.parseStatement(null)};pp$8.parseExportDefaultDeclaration=function(){var isAsync;if(this.type===types$1._function||(isAsync=this.isAsyncFunction())){var fNode=this.startNode();if(this.next(),isAsync)this.next();return this.parseFunction(fNode,FUNC_STATEMENT|FUNC_NULLABLE_ID,!1,isAsync)}else if(this.type===types$1._class){var cNode=this.startNode();return this.parseClass(cNode,"nullableID")}else{var declaration=this.parseMaybeAssign();return this.semicolon(),declaration}};pp$8.checkExport=function(exports$1,name,pos){if(!exports$1)return;if(typeof name!=="string")name=name.type==="Identifier"?name.name:name.value;if(hasOwn(exports$1,name))this.raiseRecoverable(pos,"Duplicate export '"+name+"'");exports$1[name]=!0};pp$8.checkPatternExport=function(exports$1,pat){var type=pat.type;if(type==="Identifier")this.checkExport(exports$1,pat,pat.start);else if(type==="ObjectPattern")for(var i=0,list=pat.properties;i<list.length;i+=1){var prop=list[i];this.checkPatternExport(exports$1,prop)}else if(type==="ArrayPattern")for(var i$1=0,list$1=pat.elements;i$1<list$1.length;i$1+=1){var elt=list$1[i$1];if(elt)this.checkPatternExport(exports$1,elt)}else if(type==="Property")this.checkPatternExport(exports$1,pat.value);else if(type==="AssignmentPattern")this.checkPatternExport(exports$1,pat.left);else if(type==="RestElement")this.checkPatternExport(exports$1,pat.argument)};pp$8.checkVariableExport=function(exports$1,decls){if(!exports$1)return;for(var i=0,list=decls;i<list.length;i+=1){var decl=list[i];this.checkPatternExport(exports$1,decl.id)}};pp$8.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};pp$8.parseExportSpecifier=function(exports$1){var node=this.startNode();return node.local=this.parseModuleExportName(),node.exported=this.eatContextual("as")?this.parseModuleExportName():node.local,this.checkExport(exports$1,node.exported,node.exported.start),this.finishNode(node,"ExportSpecifier")};pp$8.parseExportSpecifiers=function(exports$1){var nodes=[],first=!0;this.expect(types$1.braceL);while(!this.eat(types$1.braceR)){if(!first){if(this.expect(types$1.comma),this.afterTrailingComma(types$1.braceR))break}else first=!1;nodes.push(this.parseExportSpecifier(exports$1))}return nodes};pp$8.parseImport=function(node){if(this.next(),this.type===types$1.string)node.specifiers=empty$1,node.source=this.parseExprAtom();else node.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),node.source=this.type===types$1.string?this.parseExprAtom():this.unexpected();if(this.options.ecmaVersion>=16)node.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(node,"ImportDeclaration")};pp$8.parseImportSpecifier=function(){var node=this.startNode();if(node.imported=this.parseModuleExportName(),this.eatContextual("as"))node.local=this.parseIdent();else this.checkUnreserved(node.imported),node.local=node.imported;return this.checkLValSimple(node.local,BIND_LEXICAL),this.finishNode(node,"ImportSpecifier")};pp$8.parseImportDefaultSpecifier=function(){var node=this.startNode();return node.local=this.parseIdent(),this.checkLValSimple(node.local,BIND_LEXICAL),this.finishNode(node,"ImportDefaultSpecifier")};pp$8.parseImportNamespaceSpecifier=function(){var node=this.startNode();return this.next(),this.expectContextual("as"),node.local=this.parseIdent(),this.checkLValSimple(node.local,BIND_LEXICAL),this.finishNode(node,"ImportNamespaceSpecifier")};pp$8.parseImportSpecifiers=function(){var nodes=[],first=!0;if(this.type===types$1.name){if(nodes.push(this.parseImportDefaultSpecifier()),!this.eat(types$1.comma))return nodes}if(this.type===types$1.star)return nodes.push(this.parseImportNamespaceSpecifier()),nodes;this.expect(types$1.braceL);while(!this.eat(types$1.braceR)){if(!first){if(this.expect(types$1.comma),this.afterTrailingComma(types$1.braceR))break}else first=!1;nodes.push(this.parseImportSpecifier())}return nodes};pp$8.parseWithClause=function(){var nodes=[];if(!this.eat(types$1._with))return nodes;this.expect(types$1.braceL);var attributeKeys={},first=!0;while(!this.eat(types$1.braceR)){if(!first){if(this.expect(types$1.comma),this.afterTrailingComma(types$1.braceR))break}else first=!1;var attr=this.parseImportAttribute(),keyName=attr.key.type==="Identifier"?attr.key.name:attr.key.value;if(hasOwn(attributeKeys,keyName))this.raiseRecoverable(attr.key.start,"Duplicate attribute key '"+keyName+"'");attributeKeys[keyName]=!0,nodes.push(attr)}return nodes};pp$8.parseImportAttribute=function(){var node=this.startNode();if(node.key=this.type===types$1.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(types$1.colon),this.type!==types$1.string)this.unexpected();return node.value=this.parseExprAtom(),this.finishNode(node,"ImportAttribute")};pp$8.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===types$1.string){var stringLiteral=this.parseLiteral(this.value);if(loneSurrogate.test(stringLiteral.value))this.raise(stringLiteral.start,"An export name cannot include a lone surrogate.");return stringLiteral}return this.parseIdent(!0)};pp$8.adaptDirectivePrologue=function(statements){for(var i=0;i<statements.length&&this.isDirectiveCandidate(statements[i]);++i)statements[i].directive=statements[i].expression.raw.slice(1,-1)};pp$8.isDirectiveCandidate=function(statement){return this.options.ecmaVersion>=5&&statement.type==="ExpressionStatement"&&statement.expression.type==="Literal"&&typeof statement.expression.value==="string"&&(this.input[statement.start]==='"'||this.input[statement.start]==="'")};var pp$7=Parser.prototype;pp$7.toAssignable=function(node,isBinding,refDestructuringErrors){if(this.options.ecmaVersion>=6&&node)switch(node.type){case"Identifier":if(this.inAsync&&node.name==="await")this.raise(node.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":if(node.type="ObjectPattern",refDestructuringErrors)this.checkPatternErrors(refDestructuringErrors,!0);for(var i=0,list=node.properties;i<list.length;i+=1){var prop=list[i];if(this.toAssignable(prop,isBinding),prop.type==="RestElement"&&(prop.argument.type==="ArrayPattern"||prop.argument.type==="ObjectPattern"))this.raise(prop.argument.start,"Unexpected token")}break;case"Property":if(node.kind!=="init")this.raise(node.key.start,"Object pattern can't contain getter or setter");this.toAssignable(node.value,isBinding);break;case"ArrayExpression":if(node.type="ArrayPattern",refDestructuringErrors)this.checkPatternErrors(refDestructuringErrors,!0);this.toAssignableList(node.elements,isBinding);break;case"SpreadElement":if(node.type="RestElement",this.toAssignable(node.argument,isBinding),node.argument.type==="AssignmentPattern")this.raise(node.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":if(node.operator!=="=")this.raise(node.left.end,"Only '=' operator can be used for specifying default value.");node.type="AssignmentPattern",delete node.operator,this.toAssignable(node.left,isBinding);break;case"ParenthesizedExpression":this.toAssignable(node.expression,isBinding,refDestructuringErrors);break;case"ChainExpression":this.raiseRecoverable(node.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!isBinding)break;default:this.raise(node.start,"Assigning to rvalue")}else if(refDestructuringErrors)this.checkPatternErrors(refDestructuringErrors,!0);return node};pp$7.toAssignableList=function(exprList,isBinding){var end=exprList.length;for(var i=0;i<end;i++){var elt=exprList[i];if(elt)this.toAssignable(elt,isBinding)}if(end){var last=exprList[end-1];if(this.options.ecmaVersion===6&&isBinding&&last&&last.type==="RestElement"&&last.argument.type!=="Identifier")this.unexpected(last.argument.start)}return exprList};pp$7.parseSpread=function(refDestructuringErrors){var node=this.startNode();return this.next(),node.argument=this.parseMaybeAssign(!1,refDestructuringErrors),this.finishNode(node,"SpreadElement")};pp$7.parseRestBinding=function(){var node=this.startNode();if(this.next(),this.options.ecmaVersion===6&&this.type!==types$1.name)this.unexpected();return node.argument=this.parseBindingAtom(),this.finishNode(node,"RestElement")};pp$7.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case types$1.bracketL:var node=this.startNode();return this.next(),node.elements=this.parseBindingList(types$1.bracketR,!0,!0),this.finishNode(node,"ArrayPattern");case types$1.braceL:return this.parseObj(!0)}return this.parseIdent()};pp$7.parseBindingList=function(close,allowEmpty,allowTrailingComma,allowModifiers){var elts=[],first=!0;while(!this.eat(close)){if(first)first=!1;else this.expect(types$1.comma);if(allowEmpty&&this.type===types$1.comma)elts.push(null);else if(allowTrailingComma&&this.afterTrailingComma(close))break;else if(this.type===types$1.ellipsis){var rest=this.parseRestBinding();if(this.parseBindingListItem(rest),elts.push(rest),this.type===types$1.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");this.expect(close);break}else elts.push(this.parseAssignableListItem(allowModifiers))}return elts};pp$7.parseAssignableListItem=function(allowModifiers){var elem=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(elem),elem};pp$7.parseBindingListItem=function(param){return param};pp$7.parseMaybeDefault=function(startPos,startLoc,left){if(left=left||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(types$1.eq))return left;var node=this.startNodeAt(startPos,startLoc);return node.left=left,node.right=this.parseMaybeAssign(),this.finishNode(node,"AssignmentPattern")};pp$7.checkLValSimple=function(expr,bindingType,checkClashes){if(bindingType===void 0)bindingType=BIND_NONE;var isBind=bindingType!==BIND_NONE;switch(expr.type){case"Identifier":if(this.strict&&this.reservedWordsStrictBind.test(expr.name))this.raiseRecoverable(expr.start,(isBind?"Binding ":"Assigning to ")+expr.name+" in strict mode");if(isBind){if(bindingType===BIND_LEXICAL&&expr.name==="let")this.raiseRecoverable(expr.start,"let is disallowed as a lexically bound name");if(checkClashes){if(hasOwn(checkClashes,expr.name))this.raiseRecoverable(expr.start,"Argument name clash");checkClashes[expr.name]=!0}if(bindingType!==BIND_OUTSIDE)this.declareName(expr.name,bindingType,expr.start)}break;case"ChainExpression":this.raiseRecoverable(expr.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(isBind)this.raiseRecoverable(expr.start,"Binding member expression");break;case"ParenthesizedExpression":if(isBind)this.raiseRecoverable(expr.start,"Binding parenthesized expression");return this.checkLValSimple(expr.expression,bindingType,checkClashes);default:this.raise(expr.start,(isBind?"Binding":"Assigning to")+" rvalue")}};pp$7.checkLValPattern=function(expr,bindingType,checkClashes){if(bindingType===void 0)bindingType=BIND_NONE;switch(expr.type){case"ObjectPattern":for(var i=0,list=expr.properties;i<list.length;i+=1){var prop=list[i];this.checkLValInnerPattern(prop,bindingType,checkClashes)}break;case"ArrayPattern":for(var i$1=0,list$1=expr.elements;i$1<list$1.length;i$1+=1){var elem=list$1[i$1];if(elem)this.checkLValInnerPattern(elem,bindingType,checkClashes)}break;default:this.checkLValSimple(expr,bindingType,checkClashes)}};pp$7.checkLValInnerPattern=function(expr,bindingType,checkClashes){if(bindingType===void 0)bindingType=BIND_NONE;switch(expr.type){case"Property":this.checkLValInnerPattern(expr.value,bindingType,checkClashes);break;case"AssignmentPattern":this.checkLValPattern(expr.left,bindingType,checkClashes);break;case"RestElement":this.checkLValPattern(expr.argument,bindingType,checkClashes);break;default:this.checkLValPattern(expr,bindingType,checkClashes)}};var TokContext=function(token,isExpr,preserveSpace,override,generator){this.token=token,this.isExpr=!!isExpr,this.preserveSpace=!!preserveSpace,this.override=override,this.generator=!!generator},types={b_stat:new TokContext("{",!1),b_expr:new TokContext("{",!0),b_tmpl:new TokContext("${",!1),p_stat:new TokContext("(",!1),p_expr:new TokContext("(",!0),q_tmpl:new TokContext("`",!0,!0,function(p){return p.tryReadTemplateToken()}),f_stat:new TokContext("function",!1),f_expr:new TokContext("function",!0),f_expr_gen:new TokContext("function",!0,!1,null,!0),f_gen:new TokContext("function",!1,!1,null,!0)},pp$6=Parser.prototype;pp$6.initialContext=function(){return[types.b_stat]};pp$6.curContext=function(){return this.context[this.context.length-1]};pp$6.braceIsBlock=function(prevType){var parent=this.curContext();if(parent===types.f_expr||parent===types.f_stat)return!0;if(prevType===types$1.colon&&(parent===types.b_stat||parent===types.b_expr))return!parent.isExpr;if(prevType===types$1._return||prevType===types$1.name&&this.exprAllowed)return lineBreak.test(this.input.slice(this.lastTokEnd,this.start));if(prevType===types$1._else||prevType===types$1.semi||prevType===types$1.eof||prevType===types$1.parenR||prevType===types$1.arrow)return!0;if(prevType===types$1.braceL)return parent===types.b_stat;if(prevType===types$1._var||prevType===types$1._const||prevType===types$1.name)return!1;return!this.exprAllowed};pp$6.inGeneratorContext=function(){for(var i=this.context.length-1;i>=1;i--){var context=this.context[i];if(context.token==="function")return context.generator}return!1};pp$6.updateContext=function(prevType){var update,type=this.type;if(type.keyword&&prevType===types$1.dot)this.exprAllowed=!1;else if(update=type.updateContext)update.call(this,prevType);else this.exprAllowed=type.beforeExpr};pp$6.overrideContext=function(tokenCtx){if(this.curContext()!==tokenCtx)this.context[this.context.length-1]=tokenCtx};types$1.parenR.updateContext=types$1.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var out=this.context.pop();if(out===types.b_stat&&this.curContext().token==="function")out=this.context.pop();this.exprAllowed=!out.isExpr};types$1.braceL.updateContext=function(prevType){this.context.push(this.braceIsBlock(prevType)?types.b_stat:types.b_expr),this.exprAllowed=!0};types$1.dollarBraceL.updateContext=function(){this.context.push(types.b_tmpl),this.exprAllowed=!0};types$1.parenL.updateContext=function(prevType){var statementParens=prevType===types$1._if||prevType===types$1._for||prevType===types$1._with||prevType===types$1._while;this.context.push(statementParens?types.p_stat:types.p_expr),this.exprAllowed=!0};types$1.incDec.updateContext=function(){};types$1._function.updateContext=types$1._class.updateContext=function(prevType){if(prevType.beforeExpr&&prevType!==types$1._else&&!(prevType===types$1.semi&&this.curContext()!==types.p_stat)&&!(prevType===types$1._return&&lineBreak.test(this.input.slice(this.lastTokEnd,this.start)))&&!((prevType===types$1.colon||prevType===types$1.braceL)&&this.curContext()===types.b_stat))this.context.push(types.f_expr);else this.context.push(types.f_stat);this.exprAllowed=!1};types$1.colon.updateContext=function(){if(this.curContext().token==="function")this.context.pop();this.exprAllowed=!0};types$1.backQuote.updateContext=function(){if(this.curContext()===types.q_tmpl)this.context.pop();else this.context.push(types.q_tmpl);this.exprAllowed=!1};types$1.star.updateContext=function(prevType){if(prevType===types$1._function){var index=this.context.length-1;if(this.context[index]===types.f_expr)this.context[index]=types.f_expr_gen;else this.context[index]=types.f_gen}this.exprAllowed=!0};types$1.name.updateContext=function(prevType){var allowed=!1;if(this.options.ecmaVersion>=6&&prevType!==types$1.dot){if(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())allowed=!0}this.exprAllowed=allowed};var pp$5=Parser.prototype;pp$5.checkPropClash=function(prop,propHash,refDestructuringErrors){if(this.options.ecmaVersion>=9&&prop.type==="SpreadElement")return;if(this.options.ecmaVersion>=6&&(prop.computed||prop.method||prop.shorthand))return;var key=prop.key,name;switch(key.type){case"Identifier":name=key.name;break;case"Literal":name=String(key.value);break;default:return}var kind=prop.kind;if(this.options.ecmaVersion>=6){if(name==="__proto__"&&kind==="init"){if(propHash.proto)if(refDestructuringErrors){if(refDestructuringErrors.doubleProto<0)refDestructuringErrors.doubleProto=key.start}else this.raiseRecoverable(key.start,"Redefinition of __proto__ property");propHash.proto=!0}return}name="$"+name;var other=propHash[name];if(other){var redefinition;if(kind==="init")redefinition=this.strict&&other.init||other.get||other.set;else redefinition=other.init||other[kind];if(redefinition)this.raiseRecoverable(key.start,"Redefinition of property")}else other=propHash[name]={init:!1,get:!1,set:!1};other[kind]=!0};pp$5.parseExpression=function(forInit,refDestructuringErrors){var this$1$1=this;return this.catchStackOverflow(function(){var{start:startPos,startLoc}=this$1$1,expr=this$1$1.parseMaybeAssign(forInit,refDestructuringErrors);if(this$1$1.type===types$1.comma){var node=this$1$1.startNodeAt(startPos,startLoc);node.expressions=[expr];while(this$1$1.eat(types$1.comma))node.expressions.push(this$1$1.parseMaybeAssign(forInit,refDestructuringErrors));return this$1$1.finishNode(node,"SequenceExpression")}return expr})};pp$5.parseMaybeAssign=function(forInit,refDestructuringErrors,afterLeftParse){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(forInit);else this.exprAllowed=!1;var ownDestructuringErrors=!1,oldParenAssign=-1,oldTrailingComma=-1,oldDoubleProto=-1;if(refDestructuringErrors)oldParenAssign=refDestructuringErrors.parenthesizedAssign,oldTrailingComma=refDestructuringErrors.trailingComma,oldDoubleProto=refDestructuringErrors.doubleProto,refDestructuringErrors.parenthesizedAssign=refDestructuringErrors.trailingComma=-1;else refDestructuringErrors=new DestructuringErrors,ownDestructuringErrors=!0;var startPos=this.start,startLoc=this.startLoc;if(this.type===types$1.parenL||this.type===types$1.name)this.potentialArrowAt=this.start,this.potentialArrowInForAwait=forInit==="await";var left=this.parseMaybeConditional(forInit,refDestructuringErrors);if(afterLeftParse)left=afterLeftParse.call(this,left,startPos,startLoc);if(this.type.isAssign){var node=this.startNodeAt(startPos,startLoc);if(node.operator=this.value,this.type===types$1.eq)left=this.toAssignable(left,!1,refDestructuringErrors);if(!ownDestructuringErrors)refDestructuringErrors.parenthesizedAssign=refDestructuringErrors.trailingComma=refDestructuringErrors.doubleProto=-1;if(refDestructuringErrors.shorthandAssign>=left.start)refDestructuringErrors.shorthandAssign=-1;if(this.type===types$1.eq)this.checkLValPattern(left);else this.checkLValSimple(left);if(node.left=left,this.next(),node.right=this.parseMaybeAssign(forInit),oldDoubleProto>-1)refDestructuringErrors.doubleProto=oldDoubleProto;return this.finishNode(node,"AssignmentExpression")}else if(ownDestructuringErrors)this.checkExpressionErrors(refDestructuringErrors,!0);if(oldParenAssign>-1)refDestructuringErrors.parenthesizedAssign=oldParenAssign;if(oldTrailingComma>-1)refDestructuringErrors.trailingComma=oldTrailingComma;return left};pp$5.parseMaybeConditional=function(forInit,refDestructuringErrors){var startPos=this.start,startLoc=this.startLoc,expr=this.parseExprOps(forInit,refDestructuringErrors);if(this.checkExpressionErrors(refDestructuringErrors))return expr;if(!(expr.type==="ArrowFunctionExpression"&&expr.start===startPos)&&this.eat(types$1.question)){var node=this.startNodeAt(startPos,startLoc);return node.test=expr,node.consequent=this.parseMaybeAssign(),this.expect(types$1.colon),node.alternate=this.parseMaybeAssign(forInit),this.finishNode(node,"ConditionalExpression")}return expr};pp$5.parseExprOps=function(forInit,refDestructuringErrors){var startPos=this.start,startLoc=this.startLoc,expr=this.parseMaybeUnary(refDestructuringErrors,!1,!1,forInit);if(this.checkExpressionErrors(refDestructuringErrors))return expr;return expr.start===startPos&&expr.type==="ArrowFunctionExpression"?expr:this.parseExprOp(expr,startPos,startLoc,-1,forInit)};pp$5.parseExprOp=function(left,leftStartPos,leftStartLoc,minPrec,forInit){var prec=this.type.binop;if(prec!=null&&(!forInit||this.type!==types$1._in)){if(prec>minPrec){var logical=this.type===types$1.logicalOR||this.type===types$1.logicalAND,coalesce=this.type===types$1.coalesce;if(coalesce)prec=types$1.logicalAND.binop;var op=this.value;this.next();var startPos=this.start,startLoc=this.startLoc,right=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,forInit),startPos,startLoc,prec,forInit),node=this.buildBinary(leftStartPos,leftStartLoc,left,right,op,logical||coalesce);if(logical&&this.type===types$1.coalesce||coalesce&&(this.type===types$1.logicalOR||this.type===types$1.logicalAND))this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");return this.parseExprOp(node,leftStartPos,leftStartLoc,minPrec,forInit)}}return left};pp$5.buildBinary=function(startPos,startLoc,left,right,op,logical){if(right.type==="PrivateIdentifier")this.raise(right.start,"Private identifier can only be left side of binary expression");var node=this.startNodeAt(startPos,startLoc);return node.left=left,node.operator=op,node.right=right,this.finishNode(node,logical?"LogicalExpression":"BinaryExpression")};pp$5.parseMaybeUnary=function(refDestructuringErrors,sawUnary,incDec,forInit){var startPos=this.start,startLoc=this.startLoc,expr;if(this.isContextual("await")&&this.canAwait)expr=this.parseAwait(forInit),sawUnary=!0;else if(this.type.prefix){var node=this.startNode(),update=this.type===types$1.incDec;if(node.operator=this.value,node.prefix=!0,this.next(),node.argument=this.parseMaybeUnary(null,!0,update,forInit),this.checkExpressionErrors(refDestructuringErrors,!0),update)this.checkLValSimple(node.argument);else if(this.strict&&node.operator==="delete"&&isLocalVariableAccess(node.argument))this.raiseRecoverable(node.start,"Deleting local variable in strict mode");else if(node.operator==="delete"&&isPrivateFieldAccess(node.argument))this.raiseRecoverable(node.start,"Private fields can not be deleted");else sawUnary=!0;expr=this.finishNode(node,update?"UpdateExpression":"UnaryExpression")}else if(!sawUnary&&this.type===types$1.privateId){if((forInit||this.privateNameStack.length===0)&&this.options.checkPrivateFields)this.unexpected();if(expr=this.parsePrivateIdent(),this.type!==types$1._in)this.unexpected()}else{if(expr=this.parseExprSubscripts(refDestructuringErrors,forInit),this.checkExpressionErrors(refDestructuringErrors))return expr;while(this.type.postfix&&!this.canInsertSemicolon()){var node$1=this.startNodeAt(startPos,startLoc);node$1.operator=this.value,node$1.prefix=!1,node$1.argument=expr,this.checkLValSimple(expr),this.next(),expr=this.finishNode(node$1,"UpdateExpression")}}if(!incDec&&!(expr.type==="ArrowFunctionExpression"&&expr.start===startPos)&&this.eat(types$1.starstar))if(sawUnary)this.unexpected(this.lastTokStart);else return this.buildBinary(startPos,startLoc,expr,this.parseMaybeUnary(null,!1,!1,forInit),"**",!1);else return expr};function isLocalVariableAccess(node){return node.type==="Identifier"||node.type==="ParenthesizedExpression"&&isLocalVariableAccess(node.expression)}function isPrivateFieldAccess(node){return node.type==="MemberExpression"&&node.property.type==="PrivateIdentifier"||node.type==="ChainExpression"&&isPrivateFieldAccess(node.expression)||node.type==="ParenthesizedExpression"&&isPrivateFieldAccess(node.expression)}pp$5.parseExprSubscripts=function(refDestructuringErrors,forInit){var startPos=this.start,startLoc=this.startLoc,expr=this.parseExprAtom(refDestructuringErrors,forInit);if(expr.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return expr;var result=this.parseSubscripts(expr,startPos,startLoc,!1,forInit);if(refDestructuringErrors&&result.type==="MemberExpression"){if(refDestructuringErrors.parenthesizedAssign>=result.start)refDestructuringErrors.parenthesizedAssign=-1;if(refDestructuringErrors.parenthesizedBind>=result.start)refDestructuringErrors.parenthesizedBind=-1;if(refDestructuringErrors.trailingComma>=result.start)refDestructuringErrors.trailingComma=-1}return result};pp$5.parseSubscripts=function(base,startPos,startLoc,noCalls,forInit){var maybeAsyncArrow=this.options.ecmaVersion>=8&&base.type==="Identifier"&&base.name==="async"&&this.lastTokEnd===base.end&&!this.canInsertSemicolon()&&base.end-base.start===5&&this.potentialArrowAt===base.start,optionalChained=!1;while(!0){var element=this.parseSubscript(base,startPos,startLoc,noCalls,maybeAsyncArrow,optionalChained,forInit);if(element.optional)optionalChained=!0;if(element===base||element.type==="ArrowFunctionExpression"){if(optionalChained){var chainNode=this.startNodeAt(startPos,startLoc);chainNode.expression=element,element=this.finishNode(chainNode,"ChainExpression")}return element}base=element}};pp$5.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(types$1.arrow)};pp$5.parseSubscriptAsyncArrow=function(startPos,startLoc,exprList,forInit){return this.parseArrowExpression(this.startNodeAt(startPos,startLoc),exprList,!0,forInit)};pp$5.parseSubscript=function(base,startPos,startLoc,noCalls,maybeAsyncArrow,optionalChained,forInit){var optionalSupported=this.options.ecmaVersion>=11,optional=optionalSupported&&this.eat(types$1.questionDot);if(noCalls&&optional)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var computed=this.eat(types$1.bracketL);if(computed||optional&&this.type!==types$1.parenL&&this.type!==types$1.backQuote||this.eat(types$1.dot)){var node=this.startNodeAt(startPos,startLoc);if(node.object=base,computed)node.property=this.parseExpression(),this.expect(types$1.bracketR);else if(this.type===types$1.privateId&&base.type!=="Super")node.property=this.parsePrivateIdent();else node.property=this.parseIdent(this.options.allowReserved!=="never");if(node.computed=!!computed,optionalSupported)node.optional=optional;base=this.finishNode(node,"MemberExpression")}else if(!noCalls&&this.eat(types$1.parenL)){var refDestructuringErrors=new DestructuringErrors,oldYieldPos=this.yieldPos,oldAwaitPos=this.awaitPos,oldAwaitIdentPos=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var exprList=this.parseExprList(types$1.parenR,this.options.ecmaVersion>=8,!1,refDestructuringErrors);if(maybeAsyncArrow&&!optional&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(refDestructuringErrors,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");return this.yieldPos=oldYieldPos,this.awaitPos=oldAwaitPos,this.awaitIdentPos=oldAwaitIdentPos,this.parseSubscriptAsyncArrow(startPos,startLoc,exprList,forInit)}this.checkExpressionErrors(refDestructuringErrors,!0),this.yieldPos=oldYieldPos||this.yieldPos,this.awaitPos=oldAwaitPos||this.awaitPos,this.awaitIdentPos=oldAwaitIdentPos||this.awaitIdentPos;var node$1=this.startNodeAt(startPos,startLoc);if(node$1.callee=base,node$1.arguments=exprList,optionalSupported)node$1.optional=optional;base=this.finishNode(node$1,"CallExpression")}else if(this.type===types$1.backQuote){if(optional||optionalChained)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var node$2=this.startNodeAt(startPos,startLoc);node$2.tag=base,node$2.quasi=this.parseTemplate({isTagged:!0}),base=this.finishNode(node$2,"TaggedTemplateExpression")}return base};pp$5.parseExprAtom=function(refDestructuringErrors,forInit,forNew){if(this.type===types$1.slash)this.readRegexp();var node,canBeArrow=this.potentialArrowAt===this.start;switch(this.type){case types$1._super:if(!this.allowSuper)this.raise(this.start,"'super' keyword outside a method");if(node=this.startNode(),this.next(),this.type===types$1.parenL&&!this.allowDirectSuper)this.raise(node.start,"super() call outside constructor of a subclass");if(this.type!==types$1.dot&&this.type!==types$1.bracketL&&this.type!==types$1.parenL)this.unexpected();return this.finishNode(node,"Super");case types$1._this:return node=this.startNode(),this.next(),this.finishNode(node,"ThisExpression");case types$1.name:var startPos=this.start,startLoc=this.startLoc,containsEsc=this.containsEsc,id=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!containsEsc&&id.name==="async"&&!this.canInsertSemicolon()&&this.eat(types$1._function))return this.overrideContext(types.f_expr),this.parseFunction(this.startNodeAt(startPos,startLoc),0,!1,!0,forInit);if(canBeArrow&&!this.canInsertSemicolon()){if(this.eat(types$1.arrow))return this.parseArrowExpression(this.startNodeAt(startPos,startLoc),[id],!1,forInit);if(this.options.ecmaVersion>=8&&id.name==="async"&&this.type===types$1.name&&!containsEsc&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(id=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(types$1.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(startPos,startLoc),[id],!0,forInit)}}return id;case types$1.regexp:var value=this.value;return node=this.parseLiteral(value.value),node.regex={pattern:value.pattern,flags:value.flags},node;case types$1.num:case types$1.string:return this.parseLiteral(this.value);case types$1._null:case types$1._true:case types$1._false:return node=this.startNode(),node.value=this.type===types$1._null?null:this.type===types$1._true,node.raw=this.type.keyword,this.next(),this.finishNode(node,"Literal");case types$1.parenL:var start=this.start,expr=this.parseParenAndDistinguishExpression(canBeArrow,forInit);if(refDestructuringErrors){if(refDestructuringErrors.parenthesizedAssign<0&&!this.isSimpleAssignTarget(expr))refDestructuringErrors.parenthesizedAssign=start;if(refDestructuringErrors.parenthesizedBind<0)refDestructuringErrors.parenthesizedBind=start}return expr;case types$1.bracketL:return node=this.startNode(),this.next(),node.elements=this.parseExprList(types$1.bracketR,!0,!0,refDestructuringErrors),this.finishNode(node,"ArrayExpression");case types$1.braceL:return this.overrideContext(types.b_expr),this.parseObj(!1,refDestructuringErrors);case types$1._function:return node=this.startNode(),this.next(),this.parseFunction(node,0);case types$1._class:return this.parseClass(this.startNode(),!1);case types$1._new:return this.parseNew();case types$1.backQuote:return this.parseTemplate();case types$1._import:if(this.options.ecmaVersion>=11)return this.parseExprImport(forNew);else return this.unexpected();default:return this.parseExprAtomDefault()}};pp$5.parseExprAtomDefault=function(){this.unexpected()};pp$5.parseExprImport=function(forNew){var node=this.startNode();if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword import");if(this.next(),this.type===types$1.parenL&&!forNew)return this.parseDynamicImport(node);else if(this.type===types$1.dot){var meta=this.startNodeAt(node.start,node.loc&&node.loc.start);return meta.name="import",node.meta=this.finishNode(meta,"Identifier"),this.parseImportMeta(node)}else this.unexpected()};pp$5.parseDynamicImport=function(node){if(this.next(),node.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)if(!this.eat(types$1.parenR))if(this.expect(types$1.comma),!this.afterTrailingComma(types$1.parenR)){if(node.options=this.parseMaybeAssign(),!this.eat(types$1.parenR)){if(this.expect(types$1.comma),!this.afterTrailingComma(types$1.parenR))this.unexpected()}}else node.options=null;else node.options=null;else if(!this.eat(types$1.parenR)){var errorPos=this.start;if(this.eat(types$1.comma)&&this.eat(types$1.parenR))this.raiseRecoverable(errorPos,"Trailing comma is not allowed in import()");else this.unexpected(errorPos)}return this.finishNode(node,"ImportExpression")};pp$5.parseImportMeta=function(node){this.next();var containsEsc=this.containsEsc;if(node.property=this.parseIdent(!0),node.property.name!=="meta")this.raiseRecoverable(node.property.start,"The only valid meta property for import is 'import.meta'");if(containsEsc)this.raiseRecoverable(node.start,"'import.meta' must not contain escaped characters");if(this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere)this.raiseRecoverable(node.start,"Cannot use 'import.meta' outside a module");return this.finishNode(node,"MetaProperty")};pp$5.parseLiteral=function(value){var node=this.startNode();if(node.value=value,node.raw=this.input.slice(this.start,this.end),node.raw.charCodeAt(node.raw.length-1)===110)node.bigint=node.value!=null?node.value.toString():node.raw.slice(0,-1).replace(/_/g,"");return this.next(),this.finishNode(node,"Literal")};pp$5.parseParenExpression=function(){this.expect(types$1.parenL);var val=this.parseExpression();return this.expect(types$1.parenR),val};pp$5.shouldParseArrow=function(exprList){return!this.canInsertSemicolon()};pp$5.parseParenAndDistinguishExpression=function(canBeArrow,forInit){var startPos=this.start,startLoc=this.startLoc,val,allowTrailingComma=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var innerStartPos=this.start,innerStartLoc=this.startLoc,exprList=[],first=!0,lastIsComma=!1,refDestructuringErrors=new DestructuringErrors,oldYieldPos=this.yieldPos,oldAwaitPos=this.awaitPos,spreadStart;this.yieldPos=0,this.awaitPos=0;while(this.type!==types$1.parenR)if(first?first=!1:this.expect(types$1.comma),allowTrailingComma&&this.afterTrailingComma(types$1.parenR,!0)){lastIsComma=!0;break}else if(this.type===types$1.ellipsis){if(spreadStart=this.start,exprList.push(this.parseParenItem(this.parseRestBinding())),this.type===types$1.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else exprList.push(this.parseMaybeAssign(!1,refDestructuringErrors,this.parseParenItem));var innerEndPos=this.lastTokEnd,innerEndLoc=this.lastTokEndLoc;if(this.expect(types$1.parenR),canBeArrow&&this.shouldParseArrow(exprList)&&this.eat(types$1.arrow))return this.checkPatternErrors(refDestructuringErrors,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=oldYieldPos,this.awaitPos=oldAwaitPos,this.parseParenArrowList(startPos,startLoc,exprList,forInit);if(!exprList.length||lastIsComma)this.unexpected(this.lastTokStart);if(spreadStart)this.unexpected(spreadStart);if(this.checkExpressionErrors(refDestructuringErrors,!0),this.yieldPos=oldYieldPos||this.yieldPos,this.awaitPos=oldAwaitPos||this.awaitPos,exprList.length>1)val=this.startNodeAt(innerStartPos,innerStartLoc),val.expressions=exprList,this.finishNodeAt(val,"SequenceExpression",innerEndPos,innerEndLoc);else val=exprList[0]}else val=this.parseParenExpression();if(this.options.preserveParens){var par=this.startNodeAt(startPos,startLoc);return par.expression=val,this.finishNode(par,"ParenthesizedExpression")}else return val};pp$5.parseParenItem=function(item){return item};pp$5.parseParenArrowList=function(startPos,startLoc,exprList,forInit){return this.parseArrowExpression(this.startNodeAt(startPos,startLoc),exprList,!1,forInit)};var empty=[];pp$5.parseNew=function(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");var node=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===types$1.dot){var meta=this.startNodeAt(node.start,node.loc&&node.loc.start);meta.name="new",node.meta=this.finishNode(meta,"Identifier"),this.next();var containsEsc=this.containsEsc;if(node.property=this.parseIdent(!0),node.property.name!=="target")this.raiseRecoverable(node.property.start,"The only valid meta property for new is 'new.target'");if(containsEsc)this.raiseRecoverable(node.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(node.start,"'new.target' can only be used in functions and class static block");return this.finishNode(node,"MetaProperty")}var startPos=this.start,startLoc=this.startLoc;if(node.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),startPos,startLoc,!0,!1),node.callee.type==="Super")this.raiseRecoverable(startPos,"Invalid use of 'super'");if(this.eat(types$1.parenL))node.arguments=this.parseExprList(types$1.parenR,this.options.ecmaVersion>=8,!1);else node.arguments=empty;return this.finishNode(node,"NewExpression")};pp$5.parseTemplateElement=function(ref){var isTagged=ref.isTagged,elem=this.startNode();if(this.type===types$1.invalidTemplate){if(!isTagged)this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal");elem.value={raw:this.value.replace(/\r\n?/g,`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isKitRouteFile2,isKitErrorFile2,isKitFile2,kitFile2,kitPropType2,kitRuneProp2}from"./shared-
|
|
1
|
+
import{isKitRouteFile2,isKitErrorFile2,isKitFile2,kitFile2,kitPropType2,kitRuneProp2}from"./shared-kw5z6ysx.js";export{isKitErrorFile2 as isKitErrorFile,isKitFile2 as isKitFile,isKitRouteFile2 as isKitRouteFile,kitFile2 as kitFile,kitPropType2 as kitPropType,kitRuneProp2 as kitRuneProp};
|