jpegxl 8.4.0 → 8.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/README.md +294 -229
  2. package/dist/animation.browser.mjs +2 -2
  3. package/dist/animation.mjs +2 -2
  4. package/dist/capture-complete.browser.mjs +2 -2
  5. package/dist/capture-complete.mjs +2 -2
  6. package/dist/capture-groups.mjs +2 -2
  7. package/dist/capture.browser.mjs +2 -2
  8. package/dist/capture.mjs +2 -2
  9. package/dist/cli-add.mjs +2 -2
  10. package/dist/cli-astro.mjs +2 -2
  11. package/dist/cli-cloudflare.mjs +2 -2
  12. package/dist/cli-emdash.mjs +2 -2
  13. package/dist/cli-places.mjs +2 -2
  14. package/dist/cli-selftest.mjs +2 -2
  15. package/dist/cli-workers.mjs +2 -2
  16. package/dist/cli.mjs +2 -2
  17. package/dist/decode.browser.mjs +2 -2
  18. package/dist/decode.mjs +2 -2
  19. package/dist/decode.node.mjs +2 -2
  20. package/dist/format.browser.mjs +2 -2
  21. package/dist/format.mjs +2 -2
  22. package/dist/hdr.mjs +2 -2
  23. package/dist/helpers.mjs +2 -2
  24. package/dist/index.browser.mjs +2 -2
  25. package/dist/index.mjs +2 -2
  26. package/dist/jpeg.browser.mjs +2 -2
  27. package/dist/jpeg.mjs +2 -2
  28. package/dist/jpeg.node.mjs +2 -2
  29. package/dist/metadata.mjs +2 -2
  30. package/dist/polyfill.mjs +2 -2
  31. package/dist/resumable.mjs +2 -2
  32. package/dist/resumable.node.mjs +2 -2
  33. package/dist/serve.mjs +2 -2
  34. package/dist/serve.node.mjs +2 -2
  35. package/dist/upload.browser.mjs +2 -2
  36. package/dist/upload.mjs +2 -2
  37. package/dist/verify.mjs +2 -2
  38. package/dist/verify.node.mjs +2 -2
  39. package/dist/wasm-modules.mjs +2 -2
  40. package/examples/agents/jxl-tools.mjs +8 -8
  41. package/examples/android/prepare-assets.mjs +2 -2
  42. package/examples/capacitor/prepare-assets.mjs +2 -2
  43. package/examples/emdash/admin-work.mjs +1 -1
  44. package/examples/emdash/backfill.mjs +4 -4
  45. package/examples/emdash/background.mjs +5 -5
  46. package/examples/emdash/browser-candidate.mjs +1 -1
  47. package/examples/emdash/deliver.mjs +2 -2
  48. package/examples/emdash/host-policy.mjs +6 -6
  49. package/examples/emdash/index.mjs +3 -3
  50. package/examples/emdash/job-runner.mjs +31 -31
  51. package/examples/emdash/job-store.mjs +21 -21
  52. package/examples/emdash/jpeg-source.mjs +2 -2
  53. package/examples/emdash/library-jobs.mjs +21 -21
  54. package/examples/emdash/local-store.mjs +16 -16
  55. package/examples/emdash/media-admin.mjs +9 -9
  56. package/examples/emdash/media-plugin.mjs +62 -62
  57. package/examples/emdash/media-storage.mjs +55 -55
  58. package/examples/emdash/media-words.mjs +89 -89
  59. package/examples/emdash/media-worker.mjs +1 -1
  60. package/examples/emdash/original-envelope.mjs +2 -2
  61. package/examples/emdash/originals.mjs +77 -77
  62. package/examples/emdash/r2-store.mjs +3 -3
  63. package/examples/emdash/read-all.mjs +14 -14
  64. package/examples/emdash/server-only.mjs +1 -1
  65. package/examples/emdash/storage.mjs +1 -1
  66. package/examples/emdash/structural-delivery.mjs +42 -42
  67. package/examples/emdash/thread-driver.mjs +15 -15
  68. package/examples/emdash/thread-worker.mjs +3 -3
  69. package/examples/emdash/work-queue.mjs +11 -11
  70. package/examples/flutter/prepare-assets.mjs +3 -3
  71. package/examples/ios/prepare-assets.mjs +3 -3
  72. package/examples/page-rects.js +14 -14
  73. package/examples/react-native/src/JXLProvider.tsx +19 -9
  74. package/examples/snapdom/jxl.js +3 -2
  75. package/examples/svg-jxl.js +10 -10
  76. package/package.json +1 -1
  77. package/types/animation.d.mts +2 -2
  78. package/types/capture-complete.d.mts +5 -5
  79. package/types/capture.d.mts +1 -1
  80. package/types/format.d.mts +2 -2
  81. package/types/index.d.mts +6 -6
  82. package/types/jpeg.d.mts +1 -1
  83. package/types/result.d.mts +5 -4
  84. package/types/resumable.d.mts +7 -7
  85. package/types/serve.d.mts +1 -1
  86. package/types/types.d.mts +19 -18
  87. package/types/upload.d.mts +1 -1
  88. package/types/verify.d.mts +4 -4
@@ -1,2 +1,2 @@
1
- /*! rapier-jxl 8.4.0 | MIT */
2
- async function k(t,e=0){if(e>40)throw Object.assign(new Error("Symbolic link loop"),{code:"ELOOP"});try{return await n(t)}catch(t){if(!["ENOENT","ENOTDIR"].includes(t.code))throw t}if((await i(t).catch(()=>null))?.isSymbolicLink())return k(g(u(t),await a(t)),e+1);let s=u(t);return s===t?t:f(await k(s,e),c(t))}async function _(t,e,i){let s=await n(t),r=[];for(let a of e){if(typeof a!="string"||a.includes("\0"))throw i("A project file path is invalid","use a plain relative path inside this folder");let e;try{e=await k(g(t,a))}catch(e){throw e?.code==="ELOOP"?i(`${m(t,g(t,a))||a} has a symbolic link loop`,"replace the link with a folder or file"):e}if(!b(s,e))throw i(`${m(t,g(t,a))||a} leads outside this folder, to ${e}`,"replace the link with the file itself, or run it in the folder the file is in");let n=m(s,e);if(process.platform==="win32"&&n.split(/[\\/]/).some(t=>w.test(t)||/[ .]$/.test(t)))throw i(`${n} uses a reserved Windows file name`,"rename the file or folder");r.push(e)}return r}async function S(t,e){let[i]=await _(t,["package.json"],e),s=await r(i,"utf8").catch(t=>{if(t.code==="ENOENT")return null;throw t});if(s===null)return null;let a;try{a=JSON.parse(s)}catch(t){throw e(`package.json is not JSON (${t.message})`,"correct package.json")}if(!a||typeof a!="object"||Array.isArray(a))throw e("package.json is not a JSON object","correct package.json");return{text:s,manifest:a}}async function C(t,e){await s(u(t),{recursive:!0});let i=f(u(t),`.${c(t)}.${p(6).toString("hex")}.tmp`);try{await l(i,e,{flag:"wx"}),await o(i,t)}catch(t){throw await h(i,{force:!0}).catch(()=>{}),t}}function O(t){if(!Array.isArray(t))throw R("JXL_OPTIONS","Command arguments are not an array of text values","pass an array of strings");let e=[];for(let i=0;i<t.length;i++){let s=t[i];if(typeof s!="string")throw R("JXL_OPTIONS","A command argument is not text","pass each argument as a string");e.push(s)}return e}async function H(t){for(let e=t;;e=F(e)){let t=[];for(let[i,s]of W)await $(q(e,i)).catch(()=>null)&&t.push(s);if(t.length)return[...new Set(t)];if(F(e)===e)return[]}}function z(t){let e=String(t);if(/[%\0\r\n]/.test(e))throw R("JXL_SETUP",`${e} has % or a line break, which Windows' shell would run`,"rename or move the file so its path has neither");return`"${e.replace(/"/g,'""')}"`}function K(t,e,{cwd:i,env:s=process.env,platform:r=process.platform,execPath:a=process.execPath,quiet:n=!1}){let o=n?["ignore","ignore","inherit"]:"inherit";return t==="npm"&&s.npm_execpath&&/(?:^|[/\\])npm(?:-cli)?\.(?:c?js|mjs)$/.test(s.npm_execpath)?[a,[s.npm_execpath,...e],{cwd:i,env:s,stdio:o,shell:!1}]:r==="win32"?[[t,...e.map(z)].join(" "),[],{cwd:i,env:s,stdio:o,shell:!0}]:[t,e,{cwd:i,env:s,stdio:o,shell:!1}]}async function ot(t,e){let[i]=await _(t,[Q(e)],X),s=await Y(i);if(s===null)return null;let r;try{r=JSON.parse(s)}catch{throw X("The add record is not JSON")}if(!tt(r)||r.place!==e||r.schema!==1||!tt(r.files)||!Array.isArray(r.dirs)||!r.dirs.every(t=>nt(e,t)))throw X("The add record does not describe this place");for(let[t,i]of Object.entries(r.files))if(!at(e,t)||!tt(i)||!(i.before===null||typeof i.before=="string"&&Buffer.from(i.before,"base64").toString("base64")===i.before)||!(i.after===null||typeof i.after=="string"&&/^[a-f0-9]{64}$/.test(i.after))||!(i.mode===null||Number.isInteger(i.mode)&&i.mode>=0&&i.mode<=511))throw X("The add record names an invalid file");if(r.pending)throw X("An earlier add did not finish installing its dependencies");return await _(t,[...Object.keys(r.files),...r.dirs],X),r}async function ht(t,e,i,s,{dryRun:r=!1,install:a,beforeWrite:n}={}){let o=await ot(t,e),h=[...new Set([...s.keys(),...a?.files??[]])];if(h.some(t=>!at(e,t)))throw X("The setup names a file outside its place");let l=await _(t,[Q(e),...h],X),p=new Map,c={...o?.files},u=new Set(o?.dirs??[]);for(let[e,i]of h.entries()){let r=await Y(l[e+1]);if(p.set(i,r),c[i]&&Z(r)!==c[i].after)throw X(`${i} changed after add wrote it`);c[i]={before:c[i]?c[i].before:r===null?null:r.toString("base64"),mode:c[i]?c[i].mode:r===null?null:(await E(l[e+1])).mode&511,after:s.has(i)?J(s.get(i)):Z(r)};for(let e=N(i);e!==".";e=N(e))try{await E(T(t,e))}catch(t){if(t.code==="ENOENT")u.add(e.split(V).join("/"));else throw t}}if(r)return;if(!h.length){await(n?.());return}let d={schema:1,place:e,version:i,files:c,dirs:[...u]},f=t=>C(l[0],JSON.stringify({...d,...t&&{pending:!0}},null,2)+`\n`);if(await f(!!a),a){await a.run(),await _(t,[Q(e),...h],X);for(let e of a.files)c[e].after=Z(await Y(T(t,e)));await f(!1)}await(n?.());let m=await _(t,[...s.keys()],X);for(let e of s.keys())if(Z(await Y(T(t,e)))!==Z(p.get(e)))throw X(`${e} changed while add ran`);for(let[t,[e,i]]of[...s].entries())await C(m[t],i),c[e].mode!==null&&await P(m[t],c[e].mode)}async function lt(t,e,{cwd:i,stdout:s}){if(e=O(e),e.length===1&&["--help","-h"].includes(e[0])){s(`Usage: ${M} remove ${t} [--dry-run] [--json]`);return}if(e.some(t=>!["--dry-run","--json"].includes(t)))throw R("JXL_OPTIONS","Unknown remove option",`run npx ${M} remove ${t} --help`);let r=e.includes("--dry-run"),a=await ot(i,t);if(!a)throw X(`There is no add record for ${t}`);let n=Object.keys(a.files),o=await _(i,[...n,Q(t),...a.dirs],X),h=[];for(let[t,e]of n.entries()){let i=a.files[e],s=await Y(o[t]),r=i.before===null?null:Buffer.from(i.before,"base64");if(Z(s)!==Z(r)){if(Z(s)!==i.after)throw X(`${e} changed after add wrote it; no files were removed`);h.push({file:e,action:r===null?"removed":"restored",original:r,index:t})}}if(!r){for(let t of h){let e=o[t.index],i=a.files[t.file];t.original===null?await A(e):(await C(e,t.original),i.mode!==null&&await P(e,i.mode))}for(let t of[...a.dirs].sort((t,e)=>e.length-t.length))await I(T(i,t)).catch(t=>{if(!["ENOENT","ENOTEMPTY","EEXIST"].includes(t.code))throw t});await A(o[n.length])}let l=h.map(({file:t,action:e})=>({file:t,action:e}));if(e.includes("--json"))s(JSON.stringify({type:"remove",host:t,dryRun:r,changes:l}));else for(let{file:t,action:e}of l)s(`${t}: ${r?"would be ":""}${e}`)}function It(t,e){let i=65536;for(let s=0;s<e.length;s+=2){if(i+=e[s],i>t)return!1;if(i+=e[s+1],i>=t)return!0}return!1}function Pt(t,e){return t<65?t===36:t<91?!0:t<97?t===95:t<123?!0:t<=65535?t>=170&&Et.test(String.fromCharCode(t)):e===!1?!1:It(t,bt)}function Nt(t,e){return t<48?t===36:t<58?!0:t<65?!1:t<91?!0:t<97?t===95:t<123?!0:t<=65535?t>=170&&At.test(String.fromCharCode(t)):e===!1?!1:It(t,bt)||It(t,yt)}function Vt(t,e){return new Tt(t,{beforeExpr:!0,binop:e})}function jt(t,e={}){return e.keyword=t,Ot[t]=new Tt(t,e)}function Ut(t){return t===10||t===13||t===8232||t===8233}function $t(t,e,i=t.length){for(let s=e;s<i;s++){let e=t.charCodeAt(s);if(Ut(e))return s<i-1&&e===13&&t.charCodeAt(s+1)===10?s+2:s+1}return-1}function Qt(t){return Kt[t]||(Kt[t]=new RegExp("^(?:"+t.replace(/ /g,"|")+")$"))}function Jt(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function te(t,e){for(let i=1,s=0;;){let r=$t(t,s,e);if(r<0)return new Yt(i,e-s);++i,s=r}}function se(t){let e={};for(let i in ee)e[i]=t&&Ht(t,i)?t[i]:ee[i];if(e.ecmaVersion==="latest"?e.ecmaVersion=1e8:e.ecmaVersion==null?(!ie&&typeof console=="object"&&console.warn&&(ie=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.`)),e.ecmaVersion=11):e.ecmaVersion>=2015&&(e.ecmaVersion-=2009),e.allowReserved==null&&(e.allowReserved=e.ecmaVersion<5),(!t||t.allowHashBang==null)&&(e.allowHashBang=e.ecmaVersion>=14),zt(e.onToken)){let t=e.onToken;e.onToken=e=>t.push(e)}if(zt(e.onComment)&&(e.onComment=re(e,e.onComment)),e.sourceType==="commonjs"&&e.allowAwaitOutsideFunction)throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return e}function re(t,e){return function(i,s,r,a,n,o){let h={type:i?"Block":"Line",value:s,start:r,end:a};t.locations&&(h.loc=new Zt(this,n,o)),t.ranges&&(h.range=[r,a]),e.push(h)}}function ae(t,e){return 2|(t?4:0)|(e?8:0)}function me(t,e){let i=e+1,s=Math.min(t.input.length,e+11);for(;i<s;){let e=t.fullCharCodeAt(i);if(!Nt(e,!0))break;i+=e<=65535?1:2}return i===e+2&&t.input.slice(e,i)==="in"||i===e+10&&t.input.slice(e,i)==="instanceof"}function Ce(t,e){let i=e.key.name,s=t[i],r="true";return e.type==="MethodDefinition"&&(e.kind==="get"||e.kind==="set")&&(r=(e.static?"s":"i")+e.kind),s==="iget"&&r==="iset"||s==="iset"&&r==="iget"||s==="sget"&&r==="sset"||s==="sset"&&r==="sget"?(t[i]="true",!1):s?!0:(t[i]=r,!1)}function ve(t,e){let{computed:i,key:s}=t;return!i&&(s.type==="Identifier"&&s.name===e||s.type==="Literal"&&s.value===e)}function Te(t){return t.type==="Identifier"||t.type==="ParenthesizedExpression"&&Te(t.expression)}function Ve(t){return t.type==="MemberExpression"&&t.property.type==="PrivateIdentifier"||t.type==="ChainExpression"&&Ve(t.expression)||t.type==="ParenthesizedExpression"&&Ve(t.expression)}function Be(t,e,i,s){return t.type=e,t.end=i,this.options.locations&&(t.loc.end=s),this.options.ranges&&(t.range[1]=i),t}function ai(t){let e=ri[t]={binary:Qt(ze[t]+" "+Je),binaryOfStrings:Qt(Qe[t]),nonBinary:{General_Category:Qt(Je),Script:Qt(si[t])}};e.nonBinary.Script_Extensions=e.nonBinary.Script,e.nonBinary.gc=e.nonBinary.General_Category,e.nonBinary.sc=e.nonBinary.Script,e.nonBinary.scx=e.nonBinary.Script_Extensions}function pi(t){for(let e in t)return!0;return!1}function ci(t){return t===105||t===109||t===115}function ui(t){return t===36||t>=40&&t<=43||t===46||t===63||t>=91&&t<=94||t>=123&&t<=125}function di(t){return Pt(t,!0)||t===36||t===95}function fi(t){return Nt(t,!0)||t===36||t===95||t===8204||t===8205}function mi(t){return t>=65&&t<=90||t>=97&&t<=122}function gi(t){return t>=0&&t<=1114111}function wi(t){return t===100||t===68||t===115||t===83||t===119||t===87}function ki(t){return mi(t)||t===95}function _i(t){return ki(t)||Ei(t)}function Si(t){return t===33||t>=35&&t<=38||t>=42&&t<=44||t===46||t>=58&&t<=64||t===94||t===96||t===126}function Ci(t){return t===40||t===41||t===45||t===47||t>=91&&t<=93||t>=123&&t<=125}function vi(t){return t===33||t===35||t===37||t===38||t===44||t===45||t>=58&&t<=62||t===64||t===96||t===126}function Ei(t){return t>=48&&t<=57}function Ai(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function Ii(t){return t>=65&&t<=70?10+(t-65):t>=97&&t<=102?10+(t-97):t-48}function Pi(t){return t>=48&&t<=55}function Vi(t,e){return e?parseInt(t,8):parseFloat(t.replace(/_/g,""))}function Li(t){return typeof BigInt!="function"?null:BigInt(t.replace(/_/g,""))}function ji(t,e){return ue.parse(t,e)}function Di(t,e,i){return ue.parseExpressionAt(t,e,i)}function Mi(t,e){return ue.tokenizer(t,e)}function Ui(t){let e={sourceType:"module",ecmaVersion:"latest"},i=t.startsWith("\ufeff#!")?"//!"+t.slice(3):t;try{return Bi.parse(i,e)}catch(t){let{stripTypeScriptTypes:s}=ft;if(typeof s!="function")throw t;let r=process.emitWarning,a;try{process.emitWarning=()=>{},a=s(i,{mode:"strip"})}catch{throw t}finally{process.emitWarning=r}if(a.length!==i.length)throw t;return Bi.parse(a,e)}}function $i(t,e,i){let s=0,r=e,a=-1;for(let n=e;n<i;n++){let e=t[n],o=t[n+1];if(e==="/"&&o==="/"){if(n=t.indexOf(`\n`,n+2),n<0)break;continue}if(e==="/"&&o==="*"){let e=t.indexOf("*/",n+2);if(e<0)break;n=e+1;continue}if(e==="'"||e==='"'||e==="`"){for(n++;n<i&&t[n]!==e;n++)t[n]==="\\"&&n++;r=n+1;continue}if(e==="("||e==="["||e==="{")s++;else if(e===")"||e==="]"||e==="}"){if(s===0)break;s--,r=n+1}else if(e===","&&s===0){a=n;break}else/\s/.test(e)||(r=n+1)}return{end:r,comma:a}}function Fi(t,e){let i=t.startsWith("\ufeff")?1:0;if(t.startsWith("#!",i)){let e=t.indexOf(`\n`,i);i=e<0?t.length:e+1}for(let s of e?.body??[])if(s.type==="ExpressionStatement"&&typeof s.directive=="string"){let e=/^\r?\n/.exec(t.slice(s.end))?.[0].length??0;i=Math.max(i,s.end+e)}else break;return i}async function ts(t,{cwd:e,version:i,name:s,stdout:r,quiet:a=!1}){if(t=O(t),t.length===1&&["--help","-h"].includes(t[0])){r(qi);return}let n=t.includes("--json"),o=t.filter(t=>!["--dry-run","--json"].includes(t));if(o.length)throw Object.assign(Xi(`Unknown option ${o[0]}`,`run npx ${M} add astro --help`),{code:"JXL_OPTIONS"});let h=await rs({cwd:e,version:i,name:s,dryRun:t.includes("--dry-run"),quiet:a||n});if(n)r(JSON.stringify({type:"add",host:"astro",...h}));else if(!h.changes.length&&!h.kept.length)r(`Nothing to change: ${M} is already set up.`);else for(let t of h.changes)r(`${h.dryRun?"Would change":"Changed"}: ${t}`);for(let t of h.kept)r(`Kept ${t}: edited since add astro wrote it. To take the new one, delete it and run add astro again.`)}function es(t){let e;try{e=Ui(t)}catch{throw Xi("The config could not be read as JavaScript or TypeScript")}let i=e.body.filter(t=>t.type==="ImportDeclaration"),s=(t,e="default")=>i.flatMap(i=>i.source.value===t?i.specifiers.filter(t=>e==="default"?t.type==="ImportDefaultSpecifier":(t.imported?.name??t.imported?.value)===e).map(t=>t.local.name):[])[0],r=e.body.find(t=>t.type==="ExportDefaultDeclaration")?.declaration,a=s("astro/config","defineConfig"),n=r?.type==="ObjectExpression"?r:Yi(r,a)&&r.arguments[0]?.type==="ObjectExpression"?r.arguments[0]:null;if(!n)throw Xi("The config does not export an object literal or defineConfig({...})");if(n.properties.some(t=>t.type==="SpreadElement"||t.computed))throw Xi("The config object has a spread or computed key");let o=[],h=[],l=s(zi)??"jxl",p=1;if(!s(zi)){if(i.some(t=>t.specifiers.some(t=>t.local.name==="jxl")))throw Xi("The name jxl is already imported from another module");for(;new RegExp(`\\b${l}\\b`).test(t);)l=p===1?"rapierJxl":`rapierJxl${p}`,p++;let s=Fi(t,e);i.length?o.push({at:i.at(-1).end,text:`\nimport ${l} from '${zi}';`}):o.push({at:s,text:`${s===t.length&&s&&!t.endsWith(`\n`)?`\n`:""}import ${l} from '${zi}';\n`}),h.push(`import ${l} from '${zi}'`)}let c=(e,i)=>t.slice(t.lastIndexOf(`\n`,e.start)+1,e.start).match(/^\s*/)[0]+(i?" ":""),u=(e,i)=>{let s=e.properties.at(-1);if(!s)return{at:e.start+1,text:i};let{end:r,comma:a}=$i(t,s.end,e.end-1),n=t.slice(e.start,e.end).includes(`\n`);return a>=0?{at:a+1,text:n?`\n${c(s)}${i},`:` ${i}`}:{at:r,text:n?`,\n${c(s)}${i}`:`, ${i}`}},d=n.properties.find(t=>Zi(t)==="integrations");if(!d)o.push(u(n,`integrations: [${l}()]`)),h.push(`integrations: [${l}()]`);else{if(d.value.type!=="ArrayExpression"||d.value.elements.some(t=>t?.type==="SpreadElement"))throw Xi("integrations is not a plain list");if(!d.value.elements.some(t=>Yi(t,l))){let e=d.value,i=e.elements.at(-1);if(i){let{end:s,comma:r}=$i(t,i.end,e.end-1);o.push(r>=0?{at:r+1,text:` ${l}(),`}:{at:s,text:`, ${l}()`})}else o.push(e.elements.length?{at:e.end-1,text:` ${l}()`}:{at:e.start+1,text:`${l}()`});h.push(`${l}() in integrations`)}}let f=s("@astrojs/cloudflare"),m=n.properties.find(t=>Zi(t)==="adapter")?.value;if(f&&Yi(m,f)){let t=m.arguments[0];if(!t)o.push({at:m.end-1,text:"{imageService: 'custom'}"}),h.push("imageService: 'custom' on the Cloudflare adapter");else{if(t.type!=="ObjectExpression"||m.arguments.length>1)throw Xi("The Cloudflare adapter takes options this command cannot read","set imageService: 'custom' on it by hand");{let e=t.properties.find(t=>Zi(t)==="imageService");if(!e)o.push(u(t,"imageService: 'custom'")),h.push("imageService: 'custom' on the Cloudflare adapter");else if(!(e.value.type==="Literal"&&e.value.value==="custom"))throw Xi("The Cloudflare adapter's imageService is set to something else",`set imageService: 'custom' to let rapier-jxl make on-demand images, or keep yours and use format="jxl" only on prerendered pages`)}}}for(let e of o.sort((t,e)=>e.at-t.at))t=t.slice(0,e.at)+e.text+t.slice(e.at);try{Ui(t)}catch{throw Xi("The config could not be updated safely")}return{source:t,changes:h}}async function is(t){let e=await H(t);if(e.length>1)throw Xi("More than one lockfile",`keep the one your package manager uses, or install ${M} yourself`);return e[0]??"npm"}function ss(t,e,i,s=!1){let r=e==="npm"?["install","--save-exact","--no-audit","--no-fund",...i]:["add",...e==="pnpm"?["--save-exact"]:["--exact"],...i];return new Promise((a,n)=>{let o=ut(...K(e,r,{cwd:t,quiet:s}));o.once("error",t=>n(Xi(`${e} did not start`,`install ${i.join(" ")} yourself`))),o.once("exit",t=>t===0?a():n(Xi(`${e} stopped with code ${t}`,`install ${i.join(" ")} yourself`)))})}async function rs({cwd:i,version:s,name:r="rapier-jxl",dryRun:a=!1,quiet:n=!1}){let o=(await S(i,Xi))?.manifest;if(!o)throw Xi("No package.json here","run it in the Astro site folder");let h={...o.dependencies,...o.devDependencies};if(!h.astro)throw Xi("This folder is not an Astro site","run it in the Astro site folder");let l=(await Promise.all(Wi.map(async t=>await e(ct(i,t)).catch(()=>null)&&t))).filter(Boolean);if(l.length!==1)throw Xi(l.length?`More than one Astro config (${l.join(", ")})`:"No astro.config here",l.length?"keep one":Ki);let p=ct(i,l[0]),c=await t(p,"utf8"),{source:u,changes:d}=es(c),f=dt(ct(i,"package.json")),m=t=>[t,`${t}/package.json`].some(t=>{try{return f.resolve(t)}catch{return!1}}),g=[...B(o,r)?[]:[`${r}@${s}`],...h.sharp||m("sharp")?[]:["sharp"]],x=g.length?await is(i):null,y=[],b=[];for(let e of Hi){let a=U(await t(new URL(`${import.meta.url.includes("/dist/")?"../":"./"}examples/astro/${e}`,import.meta.url),"utf8"),r),n=`// Written by npx ${M} add astro (rapier-jxl ${s}, ${Qi(a)}). Edit freely: add astro then keeps this file.\n${a}`,o=ct(i,Gi,e),h=await t(o,"utf8").catch(()=>null),l=h?.replace(/\r\n/g,`\n`)??null;if(l===n)continue;let p=l?.match(Ji);if(l!==null&&!(p&&Qi(l.slice(p[0].length))===p[1])){b.push(`${Gi}/${e}`);continue}y.push({target:o,text:n,now:h,change:`${h===null?"write":"update"} ${Gi}/${e}`})}let w={config:l[0],changes:[...g.length?[`install ${g.join(" ")} with ${x}`]:[],...y.map(t=>t.change),...d.map(t=>`${l[0]}: ${t}`)],kept:b,dryRun:a},k=new Map(y.map(({target:t,text:e})=>[t.slice(i.length+1).replaceAll("\\","/"),e]));return u!==c&&k.set(l[0],u),await ht(i,"astro",s,k,{dryRun:a,...g.length&&{install:{files:["package.json","package-lock.json","npm-shrinkwrap.json","pnpm-lock.yaml","yarn.lock"],run:()=>ss(i,x,g,n)}}}),w}import{readFile as t,stat as e}from"node:fs/promises";import{lstat as i,mkdir as s,readFile as r,readlink as a,realpath as n,rename as o,rm as h,writeFile as l}from"node:fs/promises";import{randomBytes as p}from"node:crypto";import{basename as c,dirname as u,isAbsolute as d,join as f,relative as m,resolve as g,sep as x}from"node:path";var y=t=>process.platform==="win32"?t.toLowerCase():t,b=(t,e)=>{let i=m(y(t),y(e));return i===""||i!==".."&&!i.startsWith(".."+x)&&!d(i)},w=/^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\..*)?$/i;import{readFile as v,stat as E,rm as A,rmdir as I,chmod as P}from"node:fs/promises";import{dirname as N,join as T,sep as V}from"node:path";import{createHash as L}from"node:crypto";var R=(t,e,i)=>Object.assign(new Error(`${e}; ${i}.`),{code:t,fix:i});import{readFile as j}from"node:fs/promises";var D=["jpegxl","rapier-jxl"],M=D[0];var B=(t,e)=>!!(t?.dependencies?.[e]||t?.devDependencies?.[e]),U=(t,e)=>t.replace(/\b(from\s*|import\s*\(\s*|import\s+|require(?:\.resolve)?\s*\(\s*|module:\s*)(['"])(?:jpegxl|rapier-jxl)(?=[/'"])/g,`$1$2${e}`);import{stat as $}from"node:fs/promises";import{dirname as F,join as q}from"node:path";var W=[["package-lock.json","npm"],["npm-shrinkwrap.json","npm"],["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["bun.lock","bun"],["bun.lockb","bun"]],G=["package.json",...W.map(([t])=>t)];var Q=t=>t==="emdash"?".rapier-jxl-emdash.json":".rapier-jxl-add.json",J=t=>L("sha256").update(t).digest("hex"),X=t=>R("JXL_SETUP",t,"restore the files recorded by add, then try again"),Y=t=>v(t).catch(t=>{if(t.code==="ENOENT")return null;throw t}),Z=t=>t===null?null:J(t),tt=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),et=(t,e)=>e.map(e=>t+".config."+e),it=["rapier-jxl-files.mjs"],st=[...it,"rapier-jxl-vite.mjs","rapier-jxl-vite.d.mts","rapier-jxl-images.d.ts","src/rapier-jxl-images.d.ts"],rt={vite:[...st,...et("vite",["ts","mts","js","mjs"])],sveltekit:[...st,...et("vite",["ts","mts","js","mjs"])],nuxt:[...st,...et("nuxt",["ts","mts","js","mjs"])],webpack:[...it,"rapier-jxl-webpack.mjs","rapier-jxl-webpack.d.mts",...["webpack","rspack"].flatMap(t=>et(t,["js","mjs","cjs","ts"]))],next:[...it,"rapier-jxl-next.mjs","rapier-jxl-next-proxy.mjs","rapier-jxl-next-loader.mjs","package.json",".gitignore",...["","src/"].flatMap(t=>["proxy","middleware"].flatMap(e=>["js","mjs","ts"].map(i=>t+e+"."+i)))],netlify:["netlify.toml",...["index.mjs","edge.mjs","manifest.yml","package.json","rapier-jxl-files.mjs"].map(t=>"netlify/plugins/rapier-jxl/"+t)],astro:[...et("astro",["mjs","js","ts","mts","cjs","cts"]),"src/jxl/service.mjs","src/jxl/service-workers.mjs","src/jxl/index.mjs","src/jxl/options.mjs","package.json","package-lock.json","npm-shrinkwrap.json","pnpm-lock.yaml","yarn.lock"],workers:["jxl-worker.mjs","wrangler.json","wrangler.jsonc","wrangler.toml","package.json"],emdash:["astro.config.mjs","wrangler.json","wrangler.jsonc",...G]},at=(t,e)=>Object.hasOwn(rt,t)&&rt[t].includes(e),nt=(t,e)=>typeof e=="string"&&rt[t]?.some(t=>t.startsWith(e+"/"));import{createHash as pt}from"node:crypto";import{join as ct}from"node:path";import{spawn as ut}from"node:child_process";import{createRequire as dt}from"node:module";import*as ft from"node:module";var mt=Object.defineProperty,gt=(t,e)=>{for(var i in e)mt(t,i,{get:e[i],enumerable:!0})},xt={};gt(xt,{Node:()=>De,Parser:()=>ue,Position:()=>Yt,SourceLocation:()=>Zt,TokContext:()=>Ae,Token:()=>Ni,TokenType:()=>Tt,defaultOptions:()=>ee,getLineInfo:()=>te,isIdentifierChar:()=>Nt,isIdentifierStart:()=>Pt,isNewLine:()=>Ut,keywordTypes:()=>Ot,lineBreak:()=>Mt,lineBreakG:()=>Bt,nonASCIIwhitespace:()=>Ft,parse:()=>ji,parseExpressionAt:()=>Di,tokContexts:()=>Ie,tokTypes:()=>Dt,tokenizer:()=>Mi,version:()=>Oi});var yt=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,31,4,33,15,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,7,0,259,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,481,1,61,4,4,5,9,7,3,6,31,3,149,2,12,2,9,1,3,0,33,1,1357,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],bt=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,13,65,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,18,21,18,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,18,0,182,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,22,0,239,18,16,0,2,12,2,33,125,0,80,921,103,111,6,206,13,310,2314,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7386,37,33,96,114,14,913,15,50,7710,3,2,6,2,1,2,296,10,0,30,2,3,0,15,4,8,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,340,2,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,129,15,6,55,50,49,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4382,2,5773,3,7472,16,621,2467,541,1507,4938,6,8489,39815,11327],wt="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄ-׉ؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୓-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫰ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",kt="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆ՘ՙՠ-ֈ֋֌א-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿ₏-₟ℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-꟝꟢꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩ꭬꭭ꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",_t={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"},St="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",Ct={5:St,"5module":St+" export import",6:St+" const class extends export import super"},vt=/^in(stanceof)?$/,Et=new RegExp("["+kt+"]"),At=new RegExp("["+kt+wt+"]");var Tt=class{constructor(t,e={}){this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop||null,this.updateContext=null}};var Lt={beforeExpr:!0},Rt={startsExpr:!0},Ot={};var Dt={num:new Tt("num",Rt),regexp:new Tt("regexp",Rt),string:new Tt("string",Rt),name:new Tt("name",Rt),privateId:new Tt("privateId",Rt),eof:new Tt("eof"),bracketL:new Tt("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new Tt("]"),braceL:new Tt("{",{beforeExpr:!0,startsExpr:!0}),braceR:new Tt("}"),parenL:new Tt("(",{beforeExpr:!0,startsExpr:!0}),parenR:new Tt(")"),comma:new Tt(",",Lt),semi:new Tt(";",Lt),colon:new Tt(":",Lt),dot:new Tt("."),question:new Tt("?",Lt),questionDot:new Tt("?."),arrow:new Tt("=>",Lt),template:new Tt("template"),invalidTemplate:new Tt("invalidTemplate"),ellipsis:new Tt("...",Lt),backQuote:new Tt("`",Rt),dollarBraceL:new Tt("${",{beforeExpr:!0,startsExpr:!0}),eq:new Tt("=",{beforeExpr:!0,isAssign:!0}),assign:new Tt("_=",{beforeExpr:!0,isAssign:!0}),incDec:new Tt("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new Tt("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:Vt("||",1),logicalAND:Vt("&&",2),bitwiseOR:Vt("|",3),bitwiseXOR:Vt("^",4),bitwiseAND:Vt("&",5),equality:Vt("==/!=/===/!==",6),relational:Vt("</>/<=/>=",7),bitShift:Vt("<</>>/>>>",8),plusMin:new Tt("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:Vt("%",10),star:Vt("*",10),slash:Vt("/",10),starstar:new Tt("**",{beforeExpr:!0}),coalesce:Vt("??",1),_break:jt("break"),_case:jt("case",Lt),_catch:jt("catch"),_continue:jt("continue"),_debugger:jt("debugger"),_default:jt("default",Lt),_do:jt("do",{isLoop:!0,beforeExpr:!0}),_else:jt("else",Lt),_finally:jt("finally"),_for:jt("for",{isLoop:!0}),_function:jt("function",Rt),_if:jt("if"),_return:jt("return",Lt),_switch:jt("switch"),_throw:jt("throw",Lt),_try:jt("try"),_var:jt("var"),_const:jt("const"),_while:jt("while",{isLoop:!0}),_with:jt("with"),_new:jt("new",{beforeExpr:!0,startsExpr:!0}),_this:jt("this",Rt),_super:jt("super",Rt),_class:jt("class",Rt),_extends:jt("extends",Lt),_export:jt("export"),_import:jt("import",Rt),_null:jt("null",Rt),_true:jt("true",Rt),_false:jt("false",Rt),_in:jt("in",{beforeExpr:!0,binop:7}),_instanceof:jt("instanceof",{beforeExpr:!0,binop:7}),_typeof:jt("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:jt("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:jt("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Mt=/\r\n?|\n|\u2028|\u2029/,Bt=new RegExp(Mt.source,"g");var Ft=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,qt=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,{hasOwnProperty:Wt,toString:Gt}=Object.prototype,Ht=Object.hasOwn,zt=Array.isArray,Kt=Object.create(null);var Xt=/[\uD800-\uDFFF]/u,Yt=class t{constructor(t,e){this.line=t,this.column=e}offset(e){return new t(this.line,this.column+e)}},Zt=class{constructor(t,e,i){this.start=e,this.end=i,t.sourceFile!==null&&(this.source=t.sourceFile)}};var ee={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},ie=!1;var ne=0,oe=1,he=2,le=3,pe=4,ce=5,ue=class{constructor(t,e,i){this.options=t=se(t),this.sourceFile=t.sourceFile,this.keywords=Qt(Ct[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);let s="";t.allowReserved!==!0&&(s=_t[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(s+=" await")),this.reservedWords=Qt(s);let r=(s?s+" ":"")+_t.strict;this.reservedWordsStrict=Qt(r),this.reservedWordsStrictBind=Qt(r+" "+_t.strictBind),this.input=String(e),this.containsEsc=!1,this.pos=i||0,this.curLine=1,t.startLocation?(this.lineStart=this.pos-t.startLocation.column,this.curLine=t.startLocation.line):i?(this.lineStart=this.input.lastIndexOf(`\n`,i-1)+1,this.options.locations&&(this.curLine=this.input.slice(0,this.lineStart).split(Mt).length)):this.lineStart=0,this.type=Dt.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=t.sourceType==="module",this.strict=this.inModule||t.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&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?2:1),this.regexpState=null,this.privateNameStack=[]}parse(){let t=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(()=>this.parseTopLevel(t))}get inFunction(){return(this.currentVarScope().flags&2)>0}get inGenerator(){return(this.currentVarScope().flags&8)>0}get inAsync(){return(this.currentVarScope().flags&4)>0}get canAwait(){for(let t=this.scopeStack.length-1;t>=0;t--){let{flags:e}=this.scopeStack[t];if(e&768)return!1;if(e&2)return(e&4)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction}get allowReturn(){return!!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&1)}get allowSuper(){let{flags:t}=this.currentThisScope();return(t&64)>0||this.options.allowSuperOutsideMethod}get allowDirectSuper(){return(this.currentThisScope().flags&128)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}get allowNewDotTarget(){for(let t=this.scopeStack.length-1;t>=0;t--){let{flags:e}=this.scopeStack[t];if(e&768||e&2&&!(e&16))return!0}return!1}get allowUsing(){let{flags:t}=this.currentScope();return!(t&1024||!this.inModule&&t&1)}get inClassStaticBlock(){return(this.currentVarScope().flags&256)>0}static extend(...t){let e=this;for(let i=0;i<t.length;i++)e=t[i](e);return e}static parse(t,e){return new this(e,t).parse()}static parseExpressionAt(t,e,i){let s=new this(i,t,e);return s.nextToken(),s.parseExpression()}static tokenizer(t,e){return new this(e,t)}},de=ue.prototype,fe=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;de.strictDirective=function(t){if(this.options.ecmaVersion<5)return!1;for(;;){qt.lastIndex=t,t+=qt.exec(this.input)[0].length;let e=fe.exec(this.input.slice(t));if(!e)return!1;if((e[1]||e[2])==="use strict"){qt.lastIndex=t+e[0].length;let i=qt.exec(this.input),s=i.index+i[0].length,r=this.input.charAt(s);return r===";"||r==="}"||Mt.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(r)||r==="!"&&this.input.charAt(s+1)==="="||r==="i"&&me(this,s))}t+=e[0].length,qt.lastIndex=t,t+=qt.exec(this.input)[0].length,this.input[t]===";"&&t++}};de.eat=function(t){return this.type===t?(this.next(),!0):!1};de.isContextual=function(t){return this.type===Dt.name&&this.value===t&&!this.containsEsc};de.eatContextual=function(t){return this.isContextual(t)?(this.next(),!0):!1};de.catchStackOverflow=function(t){try{return t()}catch(t){if(t instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(t.message)||/\btoo much recursion\b/i.test(t.message)))this.raise(this.start,"Not enough stack space to parse input");else throw t}};de.expectContextual=function(t){this.eatContextual(t)||this.unexpected()};de.canInsertSemicolon=function(){return this.type===Dt.eof||this.type===Dt.braceR||Mt.test(this.input.slice(this.lastTokEnd,this.start))};de.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};de.semicolon=function(){!this.eat(Dt.semi)&&!this.insertSemicolon()&&this.unexpected()};de.afterTrailingComma=function(t,e){if(this.type===t)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),e||this.next(),!0};de.expect=function(t){this.eat(t)||this.unexpected()};de.unexpected=function(t){this.raise(t??this.start,"Unexpected token")};var ge=class{constructor(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}};de.checkPatternErrors=function(t,e){if(!t)return;t.trailingComma>-1&&this.raiseRecoverable(t.trailingComma,"Comma is not permitted after the rest element");let i=e?t.parenthesizedAssign:t.parenthesizedBind;i>-1&&this.raiseRecoverable(i,e?"Assigning to rvalue":"Parenthesized pattern")};de.checkExpressionErrors=function(t,e){if(!t)return!1;let{shorthandAssign:i,doubleProto:s}=t;if(!e)return i>=0||s>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),s>=0&&this.raiseRecoverable(s,"Redefinition of __proto__ property")};de.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")};de.isSimpleAssignTarget=function(t){return t.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(t.expression):t.type==="Identifier"||t.type==="MemberExpression"};var xe=ue.prototype;xe.parseTopLevel=function(t){let e=Object.create(null);for(t.body||(t.body=[]);this.type!==Dt.eof;){let i=this.parseStatement(null,!0,e);t.body.push(i)}if(this.inModule)for(let t of Object.keys(this.undefinedExports))this.raiseRecoverable(this.undefinedExports[t].start,`Export '${t}' is not defined`);return this.adaptDirectivePrologue(t.body),this.next(),t.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(t,"Program")};var ye={kind:"loop"},be={kind:"switch"};xe.isLet=function(t){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;qt.lastIndex=this.pos;let e=qt.exec(this.input),i=this.pos+e[0].length,s=this.fullCharCodeAt(i);if(s===91||s===92)return!0;if(t)return!1;if(s===123)return!0;if(Pt(s)){let t=i;do{i+=s<=65535?1:2}while(Nt(s=this.fullCharCodeAt(i)));if(s===92)return!0;let e=this.input.slice(t,i);if(!vt.test(e))return!0}return!1};xe.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;qt.lastIndex=this.pos;let t=qt.exec(this.input),e=this.pos+t[0].length,i;return!Mt.test(this.input.slice(this.pos,e))&&this.input.slice(e,e+8)==="function"&&(e+8===this.input.length||!(Nt(i=this.fullCharCodeAt(e+8))||i===92))};xe.isUsingKeyword=function(t,e){if(this.options.ecmaVersion<17||!this.isContextual(t?"await":"using"))return!1;qt.lastIndex=this.pos;let i=qt.exec(this.input),s=this.pos+i[0].length;if(Mt.test(this.input.slice(this.pos,s)))return!1;if(t){let t=s+5,e;if(this.input.slice(s,t)!=="using"||t===this.input.length||Nt(e=this.fullCharCodeAt(t))||e===92)return!1;qt.lastIndex=t;let i=qt.exec(this.input);if(s=t+i[0].length,i&&Mt.test(this.input.slice(t,s)))return!1}let r=this.fullCharCodeAt(s);if(!Pt(r)&&r!==92)return!1;let a=s;do{s+=r<=65535?1:2}while(Nt(r=this.fullCharCodeAt(s)));if(r===92)return!0;let n=this.input.slice(a,s);if(vt.test(n))return!1;if(e&&!t&&n==="of"){qt.lastIndex=s;let t=qt.exec(this.input);if(s=s+t[0].length,this.input.charCodeAt(s)!==61||(r=this.input.charCodeAt(s+1))===61||r===62)return!1}return!0};xe.isAwaitUsing=function(t){return this.isUsingKeyword(!0,t)};xe.isUsing=function(t){return this.isUsingKeyword(!1,t)};xe.parseStatement=function(t,e,i){let s=this.type,r=this.startNode(),a;switch(this.isLet(t)&&(s=Dt._var,a="let"),s){case Dt._break:case Dt._continue:return this.parseBreakContinueStatement(r,s.keyword);case Dt._debugger:return this.parseDebuggerStatement(r);case Dt._do:return this.parseDoStatement(r);case Dt._for:return this.parseForStatement(r);case Dt._function:return t&&(this.strict||t!=="if"&&t!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(r,!1,!t);case Dt._class:return t&&this.unexpected(),this.parseClass(r,!0);case Dt._if:return this.parseIfStatement(r);case Dt._return:return this.parseReturnStatement(r);case Dt._switch:return this.parseSwitchStatement(r);case Dt._throw:return this.parseThrowStatement(r);case Dt._try:return this.parseTryStatement(r);case Dt._const:case Dt._var:return a=a||this.value,t&&a!=="var"&&this.unexpected(),this.parseVarStatement(r,a);case Dt._while:return this.parseWhileStatement(r);case Dt._with:return this.parseWithStatement(r);case Dt.braceL:return this.parseBlock(!0,r);case Dt.semi:return this.parseEmptyStatement(r);case Dt._export:case Dt._import:if(this.options.ecmaVersion>10&&s===Dt._import){qt.lastIndex=this.pos;let t=qt.exec(this.input),e=this.pos+t[0].length,i=this.input.charCodeAt(e);if(i===40||i===46)return this.parseExpressionStatement(r,this.parseExpression())}return this.options.allowImportExportEverywhere||(e||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),s===Dt._import?this.parseImport(r):this.parseExport(r,i);default:if(this.isAsyncFunction())return t&&this.unexpected(),this.next(),this.parseFunctionStatement(r,!0,!t);let n=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(n)return 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"),t&&this.raise(this.start,"Using declaration is not allowed in single-statement positions"),n==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(r,!1,n),this.semicolon(),this.finishNode(r,"VariableDeclaration");let o=this.value,h=this.parseExpression();return s===Dt.name&&h.type==="Identifier"&&this.eat(Dt.colon)?this.parseLabeledStatement(r,o,h,t):this.parseExpressionStatement(r,h)}};xe.parseBreakContinueStatement=function(t,e){let i=e==="break";this.next(),this.eat(Dt.semi)||this.insertSemicolon()?t.label=null:this.type!==Dt.name?this.unexpected():(t.label=this.parseIdent(),this.semicolon());let s=0;for(;s<this.labels.length;++s){let e=this.labels[s];if((t.label==null||e.name===t.label.name)&&(e.kind!=null&&(i||e.kind==="loop")||t.label&&i))break}return s===this.labels.length&&this.raise(t.start,"Unsyntactic "+e),this.finishNode(t,i?"BreakStatement":"ContinueStatement")};xe.parseDebuggerStatement=function(t){return this.next(),this.semicolon(),this.finishNode(t,"DebuggerStatement")};xe.parseDoStatement=function(t){return this.next(),this.labels.push(ye),t.body=this.parseStatement("do"),this.labels.pop(),this.expect(Dt._while),t.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(Dt.semi):this.semicolon(),this.finishNode(t,"DoWhileStatement")};xe.parseForStatement=function(t){this.next();let e=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(ye),this.enterScope(0),this.expect(Dt.parenL),this.type===Dt.semi)return e>-1&&this.unexpected(e),this.parseFor(t,null);let i=this.isLet();if(this.type===Dt._var||this.type===Dt._const||i){let s=this.startNode(),r=i?"let":this.value;return this.next(),this.parseVar(s,!0,r),this.finishNode(s,"VariableDeclaration"),this.parseForAfterInit(t,s,e)}let s=this.isContextual("let"),r=!1,a=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(a){let i=this.startNode();return this.next(),a==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.parseVar(i,!0,a),this.finishNode(i,"VariableDeclaration"),this.parseForAfterInit(t,i,e)}let n=this.containsEsc,o=new ge,h=this.start,l=e>-1?this.parseExprSubscripts(o,"await"):this.parseExpression(!0,o);return this.type===Dt._in||(r=this.options.ecmaVersion>=6&&this.isContextual("of"))?(e>-1?(this.type===Dt._in&&this.unexpected(e),t.await=!0):r&&this.options.ecmaVersion>=8&&(l.start===h&&!n&&l.type==="Identifier"&&l.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(t.await=!1)),s&&r&&this.raise(l.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(l,!1,o),this.checkLValPattern(l),this.parseForIn(t,l)):(this.checkExpressionErrors(o,!0),e>-1&&this.unexpected(e),this.parseFor(t,l))};xe.parseForAfterInit=function(t,e,i){return(this.type===Dt._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&e.declarations.length===1?(this.type===Dt._in?((e.kind==="using"||e.kind==="await using")&&!e.declarations[0].init&&this.raise(this.start,"Using declaration is not allowed in for-in loops"),this.options.ecmaVersion>=9&&i>-1&&this.unexpected(i)):this.options.ecmaVersion>=9&&(t.await=i>-1),this.parseForIn(t,e)):(i>-1&&this.unexpected(i),this.parseFor(t,e))};xe.parseFunctionStatement=function(t,e,i){return this.next(),this.parseFunction(t,ke|(i?0:_e),!1,e)};xe.parseIfStatement=function(t){return this.next(),t.test=this.parseParenExpression(),t.consequent=this.parseStatement("if"),t.alternate=this.eat(Dt._else)?this.parseStatement("if"):null,this.finishNode(t,"IfStatement")};xe.parseReturnStatement=function(t){return this.allowReturn||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(Dt.semi)||this.insertSemicolon()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")};xe.parseSwitchStatement=function(t){this.next(),t.discriminant=this.parseParenExpression(),t.cases=[],this.expect(Dt.braceL),this.labels.push(be),this.enterScope(1024);let e;for(let i=!1;this.type!==Dt.braceR;)if(this.type===Dt._case||this.type===Dt._default){let s=this.type===Dt._case;e&&this.finishNode(e,"SwitchCase"),t.cases.push(e=this.startNode()),e.consequent=[],this.next(),s?e.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,e.test=null),this.expect(Dt.colon)}else e||this.unexpected(),e.consequent.push(this.parseStatement(null));return this.exitScope(),e&&this.finishNode(e,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(t,"SwitchStatement")};xe.parseThrowStatement=function(t){return this.next(),Mt.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")};var we=[];xe.parseCatchClauseParam=function(){let t=this.parseBindingAtom(),e=t.type==="Identifier";return this.enterScope(e?32:0),this.checkLValPattern(t,e?pe:he),this.expect(Dt.parenR),t};xe.parseTryStatement=function(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.type===Dt._catch){let e=this.startNode();this.next(),this.eat(Dt.parenL)?e.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),e.param=null,this.enterScope(0)),e.body=this.parseBlock(!1),this.exitScope(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(Dt._finally)?this.parseBlock():null,!t.handler&&!t.finalizer&&this.raise(t.start,"Missing catch or finally clause"),this.finishNode(t,"TryStatement")};xe.parseVarStatement=function(t,e,i){return this.next(),this.parseVar(t,!1,e,i),this.semicolon(),this.finishNode(t,"VariableDeclaration")};xe.parseWhileStatement=function(t){return this.next(),t.test=this.parseParenExpression(),this.labels.push(ye),t.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(t,"WhileStatement")};xe.parseWithStatement=function(t){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),t.object=this.parseParenExpression(),t.body=this.parseStatement("with"),this.finishNode(t,"WithStatement")};xe.parseEmptyStatement=function(t){return this.next(),this.finishNode(t,"EmptyStatement")};xe.parseLabeledStatement=function(t,e,i,s){for(let t of this.labels)t.name===e&&this.raise(i.start,"Label '"+e+"' is already declared");let r=this.type.isLoop?"loop":this.type===Dt._switch?"switch":null;for(let e=this.labels.length-1;e>=0;e--){let i=this.labels[e];if(i.statementStart===t.start)i.statementStart=this.start,i.kind=r;else break}return this.labels.push({name:e,kind:r,statementStart:this.start}),t.body=this.parseStatement(s?s.indexOf("label")===-1?s+"label":s:"label"),this.labels.pop(),t.label=i,this.finishNode(t,"LabeledStatement")};xe.parseExpressionStatement=function(t,e){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")};xe.parseBlock=function(t=!0,e=this.startNode(),i){for(e.body=[],this.expect(Dt.braceL),t&&this.enterScope(0);this.type!==Dt.braceR;){let t=this.parseStatement(null);e.body.push(t)}return i&&(this.strict=!1),this.next(),t&&this.exitScope(),this.finishNode(e,"BlockStatement")};xe.parseFor=function(t,e){return t.init=e,this.expect(Dt.semi),t.test=this.type===Dt.semi?null:this.parseExpression(),this.expect(Dt.semi),t.update=this.type===Dt.parenR?null:this.parseExpression(),this.expect(Dt.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,"ForStatement")};xe.parseForIn=function(t,e){let i=this.type===Dt._in;return this.next(),e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(e.start,`${i?"for-in":"for-of"} loop variable declaration may not have an initializer`),t.left=e,t.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(Dt.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,i?"ForInStatement":"ForOfStatement")};xe.parseVar=function(t,e,i,s){for(t.declarations=[],t.kind=i;;){let r=this.startNode();if(this.parseVarId(r,i),this.eat(Dt.eq)?r.init=this.parseMaybeAssign(e):!s&&i==="const"&&!(this.type===Dt._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!s&&(i==="using"||i==="await using")&&this.options.ecmaVersion>=17&&this.type!==Dt._in&&!this.isContextual("of")?this.raise(this.lastTokEnd,`Missing initializer in ${i} declaration`):!s&&r.id.type!=="Identifier"&&!(e&&(this.type===Dt._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):r.init=null,t.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(Dt.comma))break}return t};xe.parseVarId=function(t,e){t.id=e==="using"||e==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(t.id,e==="var"?oe:he,!1)};var ke=1,_e=2,Se=4;xe.parseFunction=function(t,e,i,s,r){this.initFunction(t),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s)&&(this.type===Dt.star&&e&_e&&this.unexpected(),t.generator=this.eat(Dt.star)),this.options.ecmaVersion>=8&&(t.async=!!s),e&ke&&(t.id=e&Se&&this.type!==Dt.name?null:this.parseIdent(),t.id&&!(e&_e)&&this.checkLValSimple(t.id,this.strict||t.generator||t.async?this.treatFunctionsAsVar?oe:he:le));let a=this.yieldPos,n=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ae(t.async,t.generator)),e&ke||(t.id=this.type===Dt.name?this.parseIdent():null),this.parseFunctionParams(t),this.parseFunctionBody(t,i,!1,r),this.yieldPos=a,this.awaitPos=n,this.awaitIdentPos=o,this.finishNode(t,e&ke?"FunctionDeclaration":"FunctionExpression")};xe.parseFunctionParams=function(t){this.expect(Dt.parenL),t.params=this.parseBindingList(Dt.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};xe.parseClass=function(t,e){this.next();let i=this.strict;this.strict=!0,this.parseClassId(t,e),this.parseClassSuper(t);let s=this.enterClassBody(),r=this.startNode(),a=!1;for(r.body=[],this.expect(Dt.braceL);this.type!==Dt.braceR;){let e=this.parseClassElement(t.superClass!==null);e&&(r.body.push(e),e.type==="MethodDefinition"&&e.kind==="constructor"?(a&&this.raiseRecoverable(e.start,"Duplicate constructor in the same class"),a=!0):e.key&&e.key.type==="PrivateIdentifier"&&Ce(s,e)&&this.raiseRecoverable(e.key.start,`Identifier '#${e.key.name}' has already been declared`))}return this.strict=i,this.next(),t.body=this.finishNode(r,"ClassBody"),this.exitClassBody(),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")};xe.parseClassElement=function(t){if(this.eat(Dt.semi))return null;let e=this.options.ecmaVersion,i=this.startNode(),s="",r=!1,a=!1,n="method",o=!1;if(this.eatContextual("static")){if(e>=13&&this.eat(Dt.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===Dt.star?o=!0:s="static"}if(i.static=o,!s&&e>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===Dt.star)&&!this.canInsertSemicolon()?a=!0:s="async"),!s&&(e>=9||!a)&&this.eat(Dt.star)&&(r=!0),!s&&!a&&!r){let t=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?n=t:s=t)}if(s?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=s,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),e<13||this.type===Dt.parenL||n!=="method"||r||a){let e=!i.static&&ve(i,"constructor"),s=e&&t;e&&n!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=e?"constructor":n,this.parseClassMethod(i,r,a,s)}else this.parseClassField(i);return i};xe.isClassElementNameStart=function(){return this.type===Dt.name||this.type===Dt.privateId||this.type===Dt.num||this.type===Dt.string||this.type===Dt.bracketL||this.type.keyword};xe.parseClassElementName=function(t){this.type===Dt.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),t.computed=!1,t.key=this.parsePrivateIdent()):this.parsePropertyName(t)};xe.parseClassMethod=function(t,e,i,s){let r=t.key;t.kind==="constructor"?(e&&this.raise(r.start,"Constructor can't be a generator"),i&&this.raise(r.start,"Constructor can't be an async method")):t.static&&ve(t,"prototype")&&this.raise(r.start,"Classes may not have a static property named prototype");let a=t.value=this.parseMethod(e,i,s);return t.kind==="get"&&a.params.length!==0&&this.raiseRecoverable(a.start,"getter should have no params"),t.kind==="set"&&a.params.length!==1&&this.raiseRecoverable(a.start,"setter should have exactly one param"),t.kind==="set"&&a.params[0].type==="RestElement"&&this.raiseRecoverable(a.params[0].start,"Setter cannot use rest params"),this.finishNode(t,"MethodDefinition")};xe.parseClassField=function(t){return ve(t,"constructor")?this.raise(t.key.start,"Classes can't have a field named 'constructor'"):t.static&&ve(t,"prototype")&&this.raise(t.key.start,"Classes can't have a static field named 'prototype'"),this.eat(Dt.eq)?(this.enterScope(576),t.value=this.parseMaybeAssign(),this.exitScope()):t.value=null,this.semicolon(),this.finishNode(t,"PropertyDefinition")};xe.parseClassStaticBlock=function(t){t.body=[];let e=this.labels;for(this.labels=[],this.enterScope(320);this.type!==Dt.braceR;){let e=this.parseStatement(null);t.body.push(e)}return this.next(),this.exitScope(),this.labels=e,this.finishNode(t,"StaticBlock")};xe.parseClassId=function(t,e){this.type===Dt.name?(t.id=this.parseIdent(),e&&this.checkLValSimple(t.id,he,!1)):(e===!0&&this.unexpected(),t.id=null)};xe.parseClassSuper=function(t){t.superClass=this.eat(Dt._extends)?this.parseExprSubscripts(null,!1):null};xe.enterClassBody=function(){let t={declared:Object.create(null),used:[]};return this.privateNameStack.push(t),t.declared};xe.exitClassBody=function(){let{declared:t,used:e}=this.privateNameStack.pop();if(!this.options.checkPrivateFields)return;let i=this.privateNameStack.length,s=i===0?null:this.privateNameStack[i-1];for(let i=0;i<e.length;++i){let r=e[i];Ht(t,r.name)||(s?s.used.push(r):this.raiseRecoverable(r.start,`Private field '#${r.name}' must be declared in an enclosing class`))}};xe.parseExportAllDeclaration=function(t,e){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(t.exported=this.parseModuleExportName(),this.checkExport(e,t.exported,this.lastTokStart)):t.exported=null),this.expectContextual("from"),this.type!==Dt.string&&this.unexpected(),t.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(t.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(t,"ExportAllDeclaration")};xe.parseExport=function(t,e){if(this.next(),this.eat(Dt.star))return this.parseExportAllDeclaration(t,e);if(this.eat(Dt._default))return this.checkExport(e,"default",this.lastTokStart),t.declaration=this.parseExportDefaultDeclaration(),this.finishNode(t,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())t.declaration=this.parseExportDeclaration(t),t.declaration.type==="VariableDeclaration"?this.checkVariableExport(e,t.declaration.declarations):this.checkExport(e,t.declaration.id,t.declaration.id.start),t.specifiers=[],t.source=null,this.options.ecmaVersion>=16&&(t.attributes=[]);else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))this.type!==Dt.string&&this.unexpected(),t.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(t.attributes=this.parseWithClause());else{for(let e of t.specifiers)this.checkUnreserved(e.local),this.checkLocalExport(e.local),e.local.type==="Literal"&&this.raise(e.local.start,"A string literal cannot be used as an exported binding without `from`.");t.source=null,this.options.ecmaVersion>=16&&(t.attributes=[])}this.semicolon()}return this.finishNode(t,"ExportNamedDeclaration")};xe.parseExportDeclaration=function(t){return this.parseStatement(null)};xe.parseExportDefaultDeclaration=function(){let t;if(this.type===Dt._function||(t=this.isAsyncFunction())){let e=this.startNode();return this.next(),t&&this.next(),this.parseFunction(e,ke|Se,!1,t)}else if(this.type===Dt._class){let t=this.startNode();return this.parseClass(t,"nullableID")}else{let t=this.parseMaybeAssign();return this.semicolon(),t}};xe.checkExport=function(t,e,i){t&&(typeof e!="string"&&(e=e.type==="Identifier"?e.name:e.value),Ht(t,e)&&this.raiseRecoverable(i,"Duplicate export '"+e+"'"),t[e]=!0)};xe.checkPatternExport=function(t,e){let i=e.type;if(i==="Identifier")this.checkExport(t,e,e.start);else if(i==="ObjectPattern")for(let i of e.properties)this.checkPatternExport(t,i);else if(i==="ArrayPattern")for(let i of e.elements)i&&this.checkPatternExport(t,i);else i==="Property"?this.checkPatternExport(t,e.value):i==="AssignmentPattern"?this.checkPatternExport(t,e.left):i==="RestElement"&&this.checkPatternExport(t,e.argument)};xe.checkVariableExport=function(t,e){if(t)for(let i of e)this.checkPatternExport(t,i.id)};xe.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};xe.parseExportSpecifier=function(t){let e=this.startNode();return e.local=this.parseModuleExportName(),e.exported=this.eatContextual("as")?this.parseModuleExportName():e.local,this.checkExport(t,e.exported,e.exported.start),this.finishNode(e,"ExportSpecifier")};xe.parseExportSpecifiers=function(t){let e=[],i=!0;for(this.expect(Dt.braceL);!this.eat(Dt.braceR);){if(i)i=!1;else if(this.expect(Dt.comma),this.afterTrailingComma(Dt.braceR))break;e.push(this.parseExportSpecifier(t))}return e};xe.parseImport=function(t){return this.next(),this.type===Dt.string?(t.specifiers=we,t.source=this.parseExprAtom()):(t.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),t.source=this.type===Dt.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(t.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(t,"ImportDeclaration")};xe.parseImportSpecifier=function(){let t=this.startNode();return t.imported=this.parseModuleExportName(),this.eatContextual("as")?t.local=this.parseIdent():(this.checkUnreserved(t.imported),t.local=t.imported),this.checkLValSimple(t.local,he),this.finishNode(t,"ImportSpecifier")};xe.parseImportDefaultSpecifier=function(){let t=this.startNode();return t.local=this.parseIdent(),this.checkLValSimple(t.local,he),this.finishNode(t,"ImportDefaultSpecifier")};xe.parseImportNamespaceSpecifier=function(){let t=this.startNode();return this.next(),this.expectContextual("as"),t.local=this.parseIdent(),this.checkLValSimple(t.local,he),this.finishNode(t,"ImportNamespaceSpecifier")};xe.parseImportSpecifiers=function(){let t=[],e=!0;if(this.type===Dt.name&&(t.push(this.parseImportDefaultSpecifier()),!this.eat(Dt.comma)))return t;if(this.type===Dt.star)return t.push(this.parseImportNamespaceSpecifier()),t;for(this.expect(Dt.braceL);!this.eat(Dt.braceR);){if(e)e=!1;else if(this.expect(Dt.comma),this.afterTrailingComma(Dt.braceR))break;t.push(this.parseImportSpecifier())}return t};xe.parseWithClause=function(){let t=[];if(!this.eat(Dt._with))return t;this.expect(Dt.braceL);let e={},i=!0;for(;!this.eat(Dt.braceR);){if(i)i=!1;else if(this.expect(Dt.comma),this.afterTrailingComma(Dt.braceR))break;let s=this.parseImportAttribute(),r=s.key.type==="Identifier"?s.key.name:s.key.value;Ht(e,r)&&this.raiseRecoverable(s.key.start,"Duplicate attribute key '"+r+"'"),e[r]=!0,t.push(s)}return t};xe.parseImportAttribute=function(){let t=this.startNode();return t.key=this.type===Dt.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(Dt.colon),this.type!==Dt.string&&this.unexpected(),t.value=this.parseExprAtom(),this.finishNode(t,"ImportAttribute")};xe.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===Dt.string){let t=this.parseLiteral(this.value);return Xt.test(t.value)&&this.raise(t.start,"An export name cannot include a lone surrogate."),t}return this.parseIdent(!0)};xe.adaptDirectivePrologue=function(t){for(let e=0;e<t.length&&this.isDirectiveCandidate(t[e]);++e)t[e].directive=t[e].expression.raw.slice(1,-1)};xe.isDirectiveCandidate=function(t){return this.options.ecmaVersion>=5&&t.type==="ExpressionStatement"&&t.expression.type==="Literal"&&typeof t.expression.value=="string"&&(this.input[t.start]==='"'||this.input[t.start]==="'")};var Ee=ue.prototype;Ee.toAssignable=function(t,e,i){if(this.options.ecmaVersion>=6&&t)switch(t.type){case"Identifier":this.inAsync&&t.name==="await"&&this.raise(t.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(let i of t.properties)this.toAssignable(i,e),i.type==="RestElement"&&(i.argument.type==="ArrayPattern"||i.argument.type==="ObjectPattern")&&this.raise(i.argument.start,"Unexpected token");break;case"Property":t.kind!=="init"&&this.raise(t.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(t.value,e);break;case"ArrayExpression":t.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(t.elements,e);break;case"SpreadElement":t.type="RestElement",this.toAssignable(t.argument,e),t.argument.type==="AssignmentPattern"&&this.raise(t.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":t.operator!=="="&&this.raise(t.left.end,"Only '=' operator can be used for specifying default value."),t.type="AssignmentPattern",delete t.operator,this.toAssignable(t.left,e);break;case"ParenthesizedExpression":this.toAssignable(t.expression,e,i);break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!e)break;default:this.raise(t.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return t};Ee.toAssignableList=function(t,e){let i=t.length;for(let s=0;s<i;s++){let i=t[s];i&&this.toAssignable(i,e)}if(i){let s=t[i-1];this.options.ecmaVersion===6&&e&&s&&s.type==="RestElement"&&s.argument.type!=="Identifier"&&this.unexpected(s.argument.start)}return t};Ee.parseSpread=function(t){let e=this.startNode();return this.next(),e.argument=this.parseMaybeAssign(!1,t),this.finishNode(e,"SpreadElement")};Ee.parseRestBinding=function(){let t=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==Dt.name&&this.unexpected(),t.argument=this.parseBindingAtom(),this.finishNode(t,"RestElement")};Ee.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case Dt.bracketL:let t=this.startNode();return this.next(),t.elements=this.parseBindingList(Dt.bracketR,!0,!0),this.finishNode(t,"ArrayPattern");case Dt.braceL:return this.parseObj(!0)}return this.parseIdent()};Ee.parseBindingList=function(t,e,i,s){let r=[],a=!0;for(;!this.eat(t);)if(a?a=!1:this.expect(Dt.comma),e&&this.type===Dt.comma)r.push(null);else{if(i&&this.afterTrailingComma(t))break;if(this.type===Dt.ellipsis){let e=this.parseRestBinding();this.parseBindingListItem(e),r.push(e),this.type===Dt.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(t);break}else r.push(this.parseAssignableListItem(s))}return r};Ee.parseAssignableListItem=function(t){let e=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(e),e};Ee.parseBindingListItem=function(t){return t};Ee.parseMaybeDefault=function(t,e,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(Dt.eq))return i;let s=this.startNodeAt(t,e);return s.left=i,s.right=this.parseMaybeAssign(),this.finishNode(s,"AssignmentPattern")};Ee.checkLValSimple=function(t,e=ne,i){let s=e!==ne;switch(t.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(t.name)&&this.raiseRecoverable(t.start,(s?"Binding ":"Assigning to ")+t.name+" in strict mode"),s&&(e===he&&t.name==="let"&&this.raiseRecoverable(t.start,"let is disallowed as a lexically bound name"),i&&(Ht(i,t.name)&&this.raiseRecoverable(t.start,"Argument name clash"),i[t.name]=!0),e!==ce&&this.declareName(t.name,e,t.start));break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":s&&this.raiseRecoverable(t.start,"Binding member expression");break;case"ParenthesizedExpression":return s&&this.raiseRecoverable(t.start,"Binding parenthesized expression"),this.checkLValSimple(t.expression,e,i);default:this.raise(t.start,(s?"Binding":"Assigning to")+" rvalue")}};Ee.checkLValPattern=function(t,e=ne,i){switch(t.type){case"ObjectPattern":for(let s of t.properties)this.checkLValInnerPattern(s,e,i);break;case"ArrayPattern":for(let s of t.elements)s&&this.checkLValInnerPattern(s,e,i);break;default:this.checkLValSimple(t,e,i)}};Ee.checkLValInnerPattern=function(t,e=ne,i){switch(t.type){case"Property":this.checkLValInnerPattern(t.value,e,i);break;case"AssignmentPattern":this.checkLValPattern(t.left,e,i);break;case"RestElement":this.checkLValPattern(t.argument,e,i);break;default:this.checkLValPattern(t,e,i)}};var Ae=class{constructor(t,e,i,s,r){this.token=t,this.isExpr=!!e,this.preserveSpace=!!i,this.override=s,this.generator=!!r}},Ie={b_stat:new Ae("{",!1),b_expr:new Ae("{",!0),b_tmpl:new Ae("${",!1),p_stat:new Ae("(",!1),p_expr:new Ae("(",!0),q_tmpl:new Ae("`",!0,!0,t=>t.tryReadTemplateToken()),f_stat:new Ae("function",!1),f_expr:new Ae("function",!0),f_expr_gen:new Ae("function",!0,!1,null,!0),f_gen:new Ae("function",!1,!1,null,!0)},Pe=ue.prototype;Pe.initialContext=function(){return[Ie.b_stat]};Pe.curContext=function(){return this.context[this.context.length-1]};Pe.braceIsBlock=function(t){let e=this.curContext();return e===Ie.f_expr||e===Ie.f_stat?!0:t===Dt.colon&&(e===Ie.b_stat||e===Ie.b_expr)?!e.isExpr:t===Dt._return||t===Dt.name&&this.exprAllowed?Mt.test(this.input.slice(this.lastTokEnd,this.start)):t===Dt._else||t===Dt.semi||t===Dt.eof||t===Dt.parenR||t===Dt.arrow?!0:t===Dt.braceL?e===Ie.b_stat:t===Dt._var||t===Dt._const||t===Dt.name?!1:!this.exprAllowed};Pe.inGeneratorContext=function(){for(let t=this.context.length-1;t>=1;t--){let e=this.context[t];if(e.token==="function")return e.generator}return!1};Pe.updateContext=function(t){let e,i=this.type;i.keyword&&t===Dt.dot?this.exprAllowed=!1:(e=i.updateContext)?e.call(this,t):this.exprAllowed=i.beforeExpr};Pe.overrideContext=function(t){this.curContext()!==t&&(this.context[this.context.length-1]=t)};Dt.parenR.updateContext=Dt.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}let t=this.context.pop();t===Ie.b_stat&&this.curContext().token==="function"&&(t=this.context.pop()),this.exprAllowed=!t.isExpr};Dt.braceL.updateContext=function(t){this.context.push(this.braceIsBlock(t)?Ie.b_stat:Ie.b_expr),this.exprAllowed=!0};Dt.dollarBraceL.updateContext=function(){this.context.push(Ie.b_tmpl),this.exprAllowed=!0};Dt.parenL.updateContext=function(t){let e=t===Dt._if||t===Dt._for||t===Dt._with||t===Dt._while;this.context.push(e?Ie.p_stat:Ie.p_expr),this.exprAllowed=!0};Dt.incDec.updateContext=function(){};Dt._function.updateContext=Dt._class.updateContext=function(t){t.beforeExpr&&t!==Dt._else&&!(t===Dt.semi&&this.curContext()!==Ie.p_stat)&&!(t===Dt._return&&Mt.test(this.input.slice(this.lastTokEnd,this.start)))&&!((t===Dt.colon||t===Dt.braceL)&&this.curContext()===Ie.b_stat)?this.context.push(Ie.f_expr):this.context.push(Ie.f_stat),this.exprAllowed=!1};Dt.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0};Dt.backQuote.updateContext=function(){this.curContext()===Ie.q_tmpl?this.context.pop():this.context.push(Ie.q_tmpl),this.exprAllowed=!1};Dt.star.updateContext=function(t){if(t===Dt._function){let t=this.context.length-1;this.context[t]===Ie.f_expr?this.context[t]=Ie.f_expr_gen:this.context[t]=Ie.f_gen}this.exprAllowed=!0};Dt.name.updateContext=function(t){let e=!1;this.options.ecmaVersion>=6&&t!==Dt.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(e=!0),this.exprAllowed=e};var Ne=ue.prototype;Ne.checkPropClash=function(t,e,i){if(this.options.ecmaVersion>=9&&t.type==="SpreadElement"||this.options.ecmaVersion>=6&&(t.computed||t.method||t.shorthand))return;let{key:s}=t,r;switch(s.type){case"Identifier":r=s.name;break;case"Literal":r=String(s.value);break;default:return}let{kind:a}=t;if(this.options.ecmaVersion>=6){r==="__proto__"&&a==="init"&&(e.proto&&(i?i.doubleProto<0&&(i.doubleProto=s.start):this.raiseRecoverable(s.start,"Redefinition of __proto__ property")),e.proto=!0);return}r="$"+r;let n=e[r];if(n){let t;a==="init"?t=this.strict&&n.init||n.get||n.set:t=n.init||n[a],t&&this.raiseRecoverable(s.start,"Redefinition of property")}else n=e[r]={init:!1,get:!1,set:!1};n[a]=!0};Ne.parseExpression=function(t,e){return this.catchStackOverflow(()=>{let i=this.start,s=this.startLoc,r=this.parseMaybeAssign(t,e);if(this.type===Dt.comma){let a=this.startNodeAt(i,s);for(a.expressions=[r];this.eat(Dt.comma);)a.expressions.push(this.parseMaybeAssign(t,e));return this.finishNode(a,"SequenceExpression")}return r})};Ne.parseMaybeAssign=function(t,e,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(t);this.exprAllowed=!1}let s=!1,r=-1,a=-1,n=-1;e?(r=e.parenthesizedAssign,a=e.trailingComma,n=e.doubleProto,e.parenthesizedAssign=e.trailingComma=-1):(e=new ge,s=!0);let o=this.start,h=this.startLoc;(this.type===Dt.parenL||this.type===Dt.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=t==="await");let l=this.parseMaybeConditional(t,e);if(i&&(l=i.call(this,l,o,h)),this.type.isAssign){let i=this.startNodeAt(o,h);return i.operator=this.value,this.type===Dt.eq&&(l=this.toAssignable(l,!1,e)),s||(e.parenthesizedAssign=e.trailingComma=-1,e.shorthandAssign>=l.start&&(e.shorthandAssign=-1),e.doubleProto>=l.start&&(e.doubleProto=-1)),this.type===Dt.eq?this.checkLValPattern(l):this.checkLValSimple(l),i.left=l,this.next(),i.right=this.parseMaybeAssign(t),n>-1&&(e.doubleProto=n),this.finishNode(i,"AssignmentExpression")}else s&&this.checkExpressionErrors(e,!0);return r>-1&&(e.parenthesizedAssign=r),a>-1&&(e.trailingComma=a),l};Ne.parseMaybeConditional=function(t,e){let i=this.start,s=this.startLoc,r=this.parseExprOps(t,e);if(this.checkExpressionErrors(e))return r;if(!(r.type==="ArrowFunctionExpression"&&r.start===i)&&this.eat(Dt.question)){let e=this.startNodeAt(i,s);return e.test=r,e.consequent=this.parseMaybeAssign(),this.expect(Dt.colon),e.alternate=this.parseMaybeAssign(t),this.finishNode(e,"ConditionalExpression")}return r};Ne.parseExprOps=function(t,e){let i=this.start,s=this.startLoc,r=this.parseMaybeUnary(e,!1,!1,t);return this.checkExpressionErrors(e)||r.start===i&&r.type==="ArrowFunctionExpression"?r:this.parseExprOp(r,i,s,-1,t)};Ne.parseExprOp=function(t,e,i,s,r){let a=this.type.binop;if(a!=null&&(!r||this.type!==Dt._in)&&a>s){let n=this.type===Dt.logicalOR||this.type===Dt.logicalAND,o=this.type===Dt.coalesce;o&&(a=Dt.logicalAND.binop);let h=this.value;this.next();let l=this.start,p=this.startLoc,c=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,r),l,p,a,r),u=this.buildBinary(e,i,t,c,h,n||o);return(n&&this.type===Dt.coalesce||o&&(this.type===Dt.logicalOR||this.type===Dt.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(u,e,i,s,r)}return t};Ne.buildBinary=function(t,e,i,s,r,a){s.type==="PrivateIdentifier"&&this.raise(s.start,"Private identifier can only be left side of binary expression");let n=this.startNodeAt(t,e);return n.left=i,n.operator=r,n.right=s,this.finishNode(n,a?"LogicalExpression":"BinaryExpression")};Ne.parseMaybeUnary=function(t,e,i,s){let r=this.start,a=this.startLoc,n;if(this.isContextual("await")&&this.canAwait)n=this.parseAwait(s),e=!0;else if(this.type.prefix){let i=this.startNode(),r=this.type===Dt.incDec;i.operator=this.value,i.prefix=!0,this.next(),i.argument=this.parseMaybeUnary(null,!0,r,s),this.checkExpressionErrors(t,!0),r?this.checkLValSimple(i.argument):this.strict&&i.operator==="delete"&&Te(i.argument)?this.raiseRecoverable(i.start,"Deleting local variable in strict mode"):i.operator==="delete"&&Ve(i.argument)?this.raiseRecoverable(i.start,"Private fields can not be deleted"):e=!0,n=this.finishNode(i,r?"UpdateExpression":"UnaryExpression")}else if(!e&&this.type===Dt.privateId)(s||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),n=this.parsePrivateIdent(),this.type!==Dt._in&&this.unexpected();else{if(n=this.parseExprSubscripts(t,s),this.checkExpressionErrors(t))return n;for(;this.type.postfix&&!this.canInsertSemicolon();){let t=this.startNodeAt(r,a);t.operator=this.value,t.prefix=!1,t.argument=n,this.checkLValSimple(n),this.next(),n=this.finishNode(t,"UpdateExpression")}}if(!i&&!(n.type==="ArrowFunctionExpression"&&n.start===r)&&this.eat(Dt.starstar))if(e)this.unexpected(this.lastTokStart);else return this.buildBinary(r,a,n,this.parseMaybeUnary(null,!1,!1,s),"**",!1);else return n};Ne.parseExprSubscripts=function(t,e){let i=this.start,s=this.startLoc,r=-1,a=-1;t&&(r=t.doubleProto,a=t.shorthandAssign,t.doubleProto=t.shorthandAssign=-1);let n=this.parseExprAtom(t,e);if(n.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return n;let o=this.parseSubscripts(n,i,s,!1,e);return t&&(o.end>n.end&&(this.checkExpressionErrors(t,!0),t.parenthesizedAssign>=o.start&&(t.parenthesizedAssign=-1),t.parenthesizedBind>=o.start&&(t.parenthesizedBind=-1),t.trailingComma>=o.start&&(t.trailingComma=-1)),r>-1&&(t.doubleProto=r),a>-1&&(t.shorthandAssign=a)),o};Ne.parseSubscripts=function(t,e,i,s,r){let a=this.options.ecmaVersion>=8&&t.type==="Identifier"&&t.name==="async"&&this.lastTokEnd===t.end&&!this.canInsertSemicolon()&&t.end-t.start===5&&this.potentialArrowAt===t.start,n=!1;for(;;){let o=this.parseSubscript(t,e,i,s,a,n,r);if(o.optional&&(n=!0),o.end===t.end||o.type==="ArrowFunctionExpression"){if(n){let t=this.startNodeAt(e,i);t.expression=o,o=this.finishNode(t,"ChainExpression")}return o}t=o,a=!1}};Ne.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(Dt.arrow)};Ne.parseSubscriptAsyncArrow=function(t,e,i,s){return this.parseArrowExpression(this.startNodeAt(t,e),i,!0,s)};Ne.parseSubscript=function(t,e,i,s,r,a,n){let o=this.options.ecmaVersion>=11,h=o&&this.eat(Dt.questionDot);s&&h&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");let l=this.eat(Dt.bracketL);if(l||h&&this.type!==Dt.parenL&&this.type!==Dt.backQuote||this.eat(Dt.dot)){let s=this.startNodeAt(e,i);s.object=t,l?(s.property=this.parseExpression(),this.expect(Dt.bracketR)):this.type===Dt.privateId&&t.type!=="Super"?s.property=this.parsePrivateIdent():s.property=this.parseIdent(this.options.allowReserved!=="never"),s.computed=!!l,o&&(s.optional=h),t=this.finishNode(s,"MemberExpression")}else if(!s&&this.eat(Dt.parenL)){let s=new ge,a=this.yieldPos,l=this.awaitPos,p=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;let c=this.parseExprList(Dt.parenR,this.options.ecmaVersion>=8,!1,s);if(r&&!h&&this.shouldParseAsyncArrow())return this.checkPatternErrors(s,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=a,this.awaitPos=l,this.awaitIdentPos=p,this.parseSubscriptAsyncArrow(e,i,c,n);this.checkExpressionErrors(s,!0),this.yieldPos=a||this.yieldPos,this.awaitPos=l||this.awaitPos,this.awaitIdentPos=p||this.awaitIdentPos;let u=this.startNodeAt(e,i);u.callee=t,u.arguments=c,o&&(u.optional=h),t=this.finishNode(u,"CallExpression")}else if(this.type===Dt.backQuote){(h||a)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");let s=this.startNodeAt(e,i);s.tag=t,s.quasi=this.parseTemplate({isTagged:!0}),t=this.finishNode(s,"TaggedTemplateExpression")}return t};Ne.parseExprAtom=function(t,e,i){this.type===Dt.slash&&this.readRegexp();let s,r=this.potentialArrowAt===this.start;switch(this.type){case Dt._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),s=this.startNode(),this.next(),this.type===Dt.parenL&&!this.allowDirectSuper&&this.raise(s.start,"super() call outside constructor of a subclass"),this.type!==Dt.dot&&this.type!==Dt.bracketL&&this.type!==Dt.parenL&&this.unexpected(),this.finishNode(s,"Super");case Dt._this:return s=this.startNode(),this.next(),this.finishNode(s,"ThisExpression");case Dt.name:let a=this.start,n=this.startLoc,o=this.containsEsc,h=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&h.name==="async"&&!this.canInsertSemicolon()&&this.eat(Dt._function))return this.overrideContext(Ie.f_expr),this.parseFunction(this.startNodeAt(a,n),0,!1,!0,e);if(r&&!this.canInsertSemicolon()){if(this.eat(Dt.arrow))return this.parseArrowExpression(this.startNodeAt(a,n),[h],!1,e);if(this.options.ecmaVersion>=8&&h.name==="async"&&this.type===Dt.name&&!o&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return h=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(Dt.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,n),[h],!0,e)}return h;case Dt.regexp:let l=this.value;return s=this.parseLiteral(l.value),s.regex={pattern:l.pattern,flags:l.flags},s;case Dt.num:case Dt.string:return this.parseLiteral(this.value);case Dt._null:case Dt._true:case Dt._false:return s=this.startNode(),s.value=this.type===Dt._null?null:this.type===Dt._true,s.raw=this.type.keyword,this.next(),this.finishNode(s,"Literal");case Dt.parenL:let p=this.start,c=this.parseParenAndDistinguishExpression(r,e);return t&&(t.parenthesizedAssign<0&&!this.isSimpleAssignTarget(c)&&(t.parenthesizedAssign=p),t.parenthesizedBind<0&&(t.parenthesizedBind=p)),c;case Dt.bracketL:return s=this.startNode(),this.next(),s.elements=this.parseExprList(Dt.bracketR,!0,!0,t),this.finishNode(s,"ArrayExpression");case Dt.braceL:return this.overrideContext(Ie.b_expr),this.parseObj(!1,t);case Dt._function:return s=this.startNode(),this.next(),this.parseFunction(s,0);case Dt._class:return this.parseClass(this.startNode(),!1);case Dt._new:return this.parseNew();case Dt.backQuote:return this.parseTemplate();case Dt._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}};Ne.parseExprAtomDefault=function(){this.unexpected()};Ne.parseExprImport=function(t){let e=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===Dt.parenL&&!t)return this.parseDynamicImport(e);if(this.type===Dt.dot){let t=this.startNodeAt(e.start,e.loc&&e.loc.start);return t.name="import",e.meta=this.finishNode(t,"Identifier"),this.parseImportMeta(e)}else this.unexpected()};Ne.parseDynamicImport=function(t){if(this.next(),t.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(Dt.parenR)?t.options=null:(this.expect(Dt.comma),this.afterTrailingComma(Dt.parenR)?t.options=null:(t.options=this.parseMaybeAssign(),this.eat(Dt.parenR)||(this.expect(Dt.comma),this.afterTrailingComma(Dt.parenR)||this.unexpected())));else if(!this.eat(Dt.parenR)){let t=this.start;this.eat(Dt.comma)&&this.eat(Dt.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(t,"ImportExpression")};Ne.parseImportMeta=function(t){this.next();let e=this.containsEsc;return t.property=this.parseIdent(!0),t.property.name!=="meta"&&this.raiseRecoverable(t.property.start,"The only valid meta property for import is 'import.meta'"),e&&this.raiseRecoverable(t.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(t.start,"Cannot use 'import.meta' outside a module"),this.finishNode(t,"MetaProperty")};Ne.parseLiteral=function(t){let e=this.startNode();return e.value=t,e.raw=this.input.slice(this.start,this.end),e.raw.charCodeAt(e.raw.length-1)===110&&(e.bigint=e.value!=null?e.value.toString():e.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(e,"Literal")};Ne.parseParenExpression=function(){this.expect(Dt.parenL);let t=this.parseExpression();return this.expect(Dt.parenR),t};Ne.shouldParseArrow=function(t){return!this.canInsertSemicolon()};Ne.parseParenAndDistinguishExpression=function(t,e){let i=this.start,s=this.startLoc,r,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();let n=this.start,o=this.startLoc,h=[],l=!0,p=!1,c=new ge,u=this.yieldPos,d=this.awaitPos,f;for(this.yieldPos=0,this.awaitPos=0;this.type!==Dt.parenR;)if(l?l=!1:this.expect(Dt.comma),a&&this.afterTrailingComma(Dt.parenR,!0)){p=!0;break}else if(this.type===Dt.ellipsis){f=this.start,h.push(this.parseParenItem(this.parseRestBinding())),this.type===Dt.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else h.push(this.parseMaybeAssign(!1,c,this.parseParenItem));let m=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(Dt.parenR),t&&this.shouldParseArrow(h)&&this.eat(Dt.arrow))return this.checkPatternErrors(c,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=u,this.awaitPos=d,this.parseParenArrowList(i,s,h,e);(!h.length||p)&&this.unexpected(this.lastTokStart),f&&this.unexpected(f),this.checkExpressionErrors(c,!0),this.yieldPos=u||this.yieldPos,this.awaitPos=d||this.awaitPos,h.length>1?(r=this.startNodeAt(n,o),r.expressions=h,this.finishNodeAt(r,"SequenceExpression",m,g)):r=h[0]}else r=this.parseParenExpression();if(this.options.preserveParens){let t=this.startNodeAt(i,s);return t.expression=r,this.finishNode(t,"ParenthesizedExpression")}else return r};Ne.parseParenItem=function(t){return t};Ne.parseParenArrowList=function(t,e,i,s){return this.parseArrowExpression(this.startNodeAt(t,e),i,!1,s)};var Le=[];Ne.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");let t=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===Dt.dot){let e=this.startNodeAt(t.start,t.loc&&t.loc.start);e.name="new",t.meta=this.finishNode(e,"Identifier"),this.next();let i=this.containsEsc;return t.property=this.parseIdent(!0),t.property.name!=="target"&&this.raiseRecoverable(t.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(t.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(t.start,"'new.target' can only be used in functions and class static block"),this.finishNode(t,"MetaProperty")}let e=this.start,i=this.startLoc;return t.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),e,i,!0,!1),t.callee.type==="Super"&&this.raiseRecoverable(e,"Invalid use of 'super'"),this.eat(Dt.parenL)?t.arguments=this.parseExprList(Dt.parenR,this.options.ecmaVersion>=8,!1):t.arguments=Le,this.finishNode(t,"NewExpression")};Ne.parseTemplateElement=function({isTagged:t}){let e=this.startNode();return this.type===Dt.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),e.value={raw:this.value.replace(/\r\n?/g,`\n`),cooked:null}):e.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`\n`),cooked:this.value},this.next(),e.tail=this.type===Dt.backQuote,this.finishNode(e,"TemplateElement")};Ne.parseTemplate=function({isTagged:t=!1}={}){let e=this.startNode();this.next(),e.expressions=[];let i=this.parseTemplateElement({isTagged:t});for(e.quasis=[i];!i.tail;)this.type===Dt.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(Dt.dollarBraceL),e.expressions.push(this.parseExpression()),this.expect(Dt.braceR),e.quasis.push(i=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(e,"TemplateLiteral")};Ne.isAsyncProp=function(t){return!t.computed&&t.key.type==="Identifier"&&t.key.name==="async"&&(this.type===Dt.name||this.type===Dt.num||this.type===Dt.string||this.type===Dt.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===Dt.star)&&!Mt.test(this.input.slice(this.lastTokEnd,this.start))};Ne.parseObj=function(t,e){let i=this.startNode(),s=!0,r={};for(i.properties=[],this.next();!this.eat(Dt.braceR);){if(s)s=!1;else if(this.expect(Dt.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(Dt.braceR))break;let a=this.parseProperty(t,e);t||this.checkPropClash(a,r,e),i.properties.push(a)}return this.finishNode(i,t?"ObjectPattern":"ObjectExpression")};Ne.parseProperty=function(t,e){let i=this.startNode(),s,r,a,n;if(this.options.ecmaVersion>=9&&this.eat(Dt.ellipsis))return t?(i.argument=this.parseIdent(!1),this.type===Dt.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,e),this.type===Dt.comma&&e&&e.trailingComma<0&&(e.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(t||e)&&(a=this.start,n=this.startLoc),t||(s=this.eat(Dt.star)));let o=this.containsEsc;return this.parsePropertyName(i),!t&&!o&&this.options.ecmaVersion>=8&&!s&&this.isAsyncProp(i)?(r=!0,s=this.options.ecmaVersion>=9&&this.eat(Dt.star),this.parsePropertyName(i)):r=!1,this.parsePropertyValue(i,t,s,r,a,n,e,o),this.finishNode(i,"Property")};Ne.parseGetterSetter=function(t){let e=t.key.name;this.parsePropertyName(t),t.value=this.parseMethod(!1),t.kind=e;let i=t.kind==="get"?0:1;if(t.value.params.length!==i){let e=t.value.start;t.kind==="get"?this.raiseRecoverable(e,"getter should have no params"):this.raiseRecoverable(e,"setter should have exactly one param")}else t.kind==="set"&&t.value.params[0].type==="RestElement"&&this.raiseRecoverable(t.value.params[0].start,"Setter cannot use rest params")};Ne.parsePropertyValue=function(t,e,i,s,r,a,n,o){(i||s)&&this.type===Dt.colon&&this.unexpected(),this.eat(Dt.colon)?(t.value=e?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,n),t.kind="init"):this.options.ecmaVersion>=6&&this.type===Dt.parenL?(e&&this.unexpected(),t.method=!0,t.value=this.parseMethod(i,s),t.kind="init"):!e&&!o&&this.options.ecmaVersion>=5&&!t.computed&&t.key.type==="Identifier"&&(t.key.name==="get"||t.key.name==="set")&&this.type!==Dt.comma&&this.type!==Dt.braceR&&this.type!==Dt.eq?((i||s)&&this.unexpected(),this.parseGetterSetter(t)):this.options.ecmaVersion>=6&&!t.computed&&t.key.type==="Identifier"?((i||s)&&this.unexpected(),this.checkUnreserved(t.key),t.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=r),e?t.value=this.parseMaybeDefault(r,a,this.copyNode(t.key)):this.type===Dt.eq&&n?(n.shorthandAssign<0&&(n.shorthandAssign=this.start),t.value=this.parseMaybeDefault(r,a,this.copyNode(t.key))):t.value=this.copyNode(t.key),t.kind="init",t.shorthand=!0):this.unexpected()};Ne.parsePropertyName=function(t){if(this.options.ecmaVersion>=6){if(this.eat(Dt.bracketL))return t.computed=!0,t.key=this.parseMaybeAssign(),this.expect(Dt.bracketR),t.key;t.computed=!1}return t.key=this.type===Dt.num||this.type===Dt.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};Ne.initFunction=function(t){t.id=null,this.options.ecmaVersion>=6&&(t.generator=t.expression=!1),this.options.ecmaVersion>=8&&(t.async=!1)};Ne.parseMethod=function(t,e,i){let s=this.startNode(),r=this.yieldPos,a=this.awaitPos,n=this.awaitIdentPos;return this.initFunction(s),this.options.ecmaVersion>=6&&(s.generator=t),this.options.ecmaVersion>=8&&(s.async=!!e),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ae(e,s.generator)|64|(i?128:0)),this.expect(Dt.parenL),s.params=this.parseBindingList(Dt.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(s,!1,!0,!1),this.yieldPos=r,this.awaitPos=a,this.awaitIdentPos=n,this.finishNode(s,"FunctionExpression")};Ne.parseArrowExpression=function(t,e,i,s){let r=this.yieldPos,a=this.awaitPos,n=this.awaitIdentPos;return this.enterScope(ae(i,!1)|16),this.initFunction(t),this.options.ecmaVersion>=8&&(t.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,t.params=this.toAssignableList(e,!0),this.parseFunctionBody(t,!0,!1,s),this.yieldPos=r,this.awaitPos=a,this.awaitIdentPos=n,this.finishNode(t,"ArrowFunctionExpression")};Ne.parseFunctionBody=function(t,e,i,s){let r=e&&this.type!==Dt.braceL,a=this.strict,n=!1;if(r)t.body=this.parseMaybeAssign(s),t.expression=!0,this.checkParams(t,!1);else{let s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(t.params);(!a||s)&&(n=this.strictDirective(this.end),n&&s&&this.raiseRecoverable(t.start,"Illegal 'use strict' directive in function with non-simple parameter list"));let r=this.labels;this.labels=[],n&&(this.strict=!0),this.checkParams(t,!a&&!n&&!e&&!i&&this.isSimpleParamList(t.params)),this.strict&&t.id&&this.checkLValSimple(t.id,ce),t.body=this.parseBlock(!1,void 0,n&&!a),t.expression=!1,this.adaptDirectivePrologue(t.body.body),this.labels=r}this.exitScope()};Ne.isSimpleParamList=function(t){for(let e of t)if(e.type!=="Identifier")return!1;return!0};Ne.checkParams=function(t,e){let i=Object.create(null);for(let s of t.params)this.checkLValInnerPattern(s,oe,e?null:i)};Ne.parseExprList=function(t,e,i,s){let r=[],a=!0;for(;!this.eat(t);){if(a)a=!1;else if(this.expect(Dt.comma),e&&this.afterTrailingComma(t))break;let n;i&&this.type===Dt.comma?n=null:this.type===Dt.ellipsis?(n=this.parseSpread(s),s&&this.type===Dt.comma&&s.trailingComma<0&&(s.trailingComma=this.start)):n=this.parseMaybeAssign(!1,s),r.push(n)}return r};Ne.checkUnreserved=function({start:t,end:e,name:i}){this.inGenerator&&i==="yield"&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&i==="await"&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),!(this.currentThisScope().flags&259)&&i==="arguments"&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(i==="arguments"||i==="await")&&this.raise(t,`Cannot use ${i} in class static initialization block`),this.keywords.test(i)&&this.raise(t,`Unexpected keyword '${i}'`),!(this.options.ecmaVersion<6&&this.input.slice(t,e).indexOf("\\")!==-1)&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(i)&&(!this.inAsync&&i==="await"&&this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,`The keyword '${i}' is reserved`))};Ne.parseIdent=function(t){let e=this.parseIdentNode();return this.next(!!t),this.finishNode(e,"Identifier"),t||(this.checkUnreserved(e),e.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=e.start)),e};Ne.parseIdentNode=function(){let t=this.startNode();return this.type===Dt.name?t.name=this.value:this.type.keyword?(t.name=this.type.keyword,(t.name==="class"||t.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=Dt.name):this.unexpected(),t};Ne.parsePrivateIdent=function(){let t=this.startNode();return this.type===Dt.privateId?t.name=this.value:this.unexpected(),this.next(),this.finishNode(t,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(t.start,`Private field '#${t.name}' must be declared in an enclosing class`):this.privateNameStack[this.privateNameStack.length-1].used.push(t)),t};Ne.parseYield=function(t){this.yieldPos||(this.yieldPos=this.start);let e=this.startNode();return this.next(),this.type===Dt.semi||this.canInsertSemicolon()||this.type!==Dt.star&&!this.type.startsExpr?(e.delegate=!1,e.argument=null):(e.delegate=this.eat(Dt.star),e.argument=this.parseMaybeAssign(t)),this.finishNode(e,"YieldExpression")};Ne.parseAwait=function(t){this.awaitPos||(this.awaitPos=this.start);let e=this.startNode();return this.next(),e.argument=this.parseMaybeUnary(null,!0,!1,t),this.finishNode(e,"AwaitExpression")};var Re=ue.prototype;Re.raise=function(t,e){let i=te(this.input,t);e+=" ("+i.line+":"+i.column+")",this.sourceFile&&(e+=" in "+this.sourceFile);let s=new SyntaxError(e);throw s.pos=t,s.loc=i,s.raisedAt=this.pos,s};Re.raiseRecoverable=Re.raise;Re.curPosition=function(){if(this.options.locations)return new Yt(this.curLine,this.pos-this.lineStart)};var Oe=ue.prototype,je=class{constructor(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[]}};Oe.enterScope=function(t){this.scopeStack.push(new je(t))};Oe.exitScope=function(){this.scopeStack.pop()};Oe.treatFunctionsAsVarInScope=function(t){return t.flags&2||!this.inModule&&t.flags&1};Oe.declareName=function(t,e,i){let s=!1;if(e===he){let e=this.currentScope();s=e.lexical.indexOf(t)>-1||e.functions.indexOf(t)>-1||e.var.indexOf(t)>-1,e.lexical.push(t),this.inModule&&e.flags&1&&delete this.undefinedExports[t]}else if(e===pe)this.currentScope().lexical.push(t);else if(e===le){let e=this.currentScope();this.treatFunctionsAsVar?s=e.lexical.indexOf(t)>-1:s=e.lexical.indexOf(t)>-1||e.var.indexOf(t)>-1,e.functions.push(t)}else for(let e=this.scopeStack.length-1;e>=0;--e){let i=this.scopeStack[e];if(i.lexical.indexOf(t)>-1&&!(i.flags&32&&i.lexical[0]===t)||!this.treatFunctionsAsVarInScope(i)&&i.functions.indexOf(t)>-1){s=!0;break}if(i.var.push(t),this.inModule&&i.flags&1&&delete this.undefinedExports[t],i.flags&259)break}s&&this.raiseRecoverable(i,`Identifier '${t}' has already been declared`)};Oe.checkLocalExport=function(t){this.scopeStack[0].lexical.indexOf(t.name)===-1&&this.scopeStack[0].var.indexOf(t.name)===-1&&(this.undefinedExports[t.name]=t)};Oe.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Oe.currentVarScope=function(){for(let t=this.scopeStack.length-1;;t--){let e=this.scopeStack[t];if(e.flags&771)return e}};Oe.currentThisScope=function(){for(let t=this.scopeStack.length-1;;t--){let e=this.scopeStack[t];if(e.flags&771&&!(e.flags&16))return e}};var De=class{constructor(t,e,i){this.type="",this.start=e,this.end=0,t.options.locations&&(this.loc=new Zt(t,i)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[e,0])}},Me=ue.prototype;Me.startNode=function(){return new De(this,this.start,this.startLoc)};Me.startNodeAt=function(t,e){return new De(this,t,e)};Me.finishNode=function(t,e){return Be.call(this,t,e,this.lastTokEnd,this.lastTokEndLoc)};Me.finishNodeAt=function(t,e,i,s){return Be.call(this,t,e,i,s)};Me.copyNode=function(t){let e=new De(this,t.start,this.startLoc);for(let i in t)e[i]=t[i];return e};var Ue="Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz",$e="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Fe=$e+" Extended_Pictographic",qe=Fe,We=qe+" EBase EComp EMod EPres ExtPict",Ge=We,He=Ge,ze={9:$e,10:Fe,11:qe,12:We,13:Ge,14:He},Ke="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",Qe={9:"",10:"",11:"",12:"",13:"",14:Ke},Je="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Xe="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Ye=Xe+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Ze=Ye+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",ti=Ze+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",ei=ti+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",ii=ei+" "+Ue,si={9:Xe,10:Ye,11:Ze,12:ti,13:ei,14:ii},ri={};for(let t of[9,10,11,12,13,14])ai(t);var ni=ri,oi=ue.prototype,hi=class t{constructor(t,e){this.parent=t,this.base=e||this}separatedFrom(t){for(let e=this;e;e=e.parent)for(let i=t;i;i=i.parent)if(e.base===i.base&&e!==i)return!0;return!1}sibling(){return new t(this.parent,this.base)}},li=class{constructor(t){this.parser=t,this.validFlags=`gim${t.options.ecmaVersion>=6?"uy":""}${t.options.ecmaVersion>=9?"s":""}${t.options.ecmaVersion>=13?"d":""}${t.options.ecmaVersion>=15?"v":""}`,this.unicodeProperties=ni[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null}reset(t,e,i){let s=i.indexOf("v")!==-1,r=i.indexOf("u")!==-1;this.start=t|0,this.source=e+"",this.flags=i,s&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=r&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=r&&this.parser.options.ecmaVersion>=9)}raise(t){this.parser.raiseRecoverable(this.start,`Invalid regular expression: /${this.source}/: ${t}`)}at(t,e=!1){let i=this.source,s=i.length;if(t>=s)return-1;let r=i.charCodeAt(t);if(!(e||this.switchU)||r<=55295||r>=57344||t+1>=s)return r;let a=i.charCodeAt(t+1);return a>=56320&&a<=57343?(r<<10)+a-56613888:r}nextIndex(t,e=!1){let i=this.source,s=i.length;if(t>=s)return s;let r=i.charCodeAt(t),a;return!(e||this.switchU)||r<=55295||r>=57344||t+1>=s||(a=i.charCodeAt(t+1))<56320||a>57343?t+1:t+2}current(t=!1){return this.at(this.pos,t)}lookahead(t=!1){return this.at(this.nextIndex(this.pos,t),t)}advance(t=!1){this.pos=this.nextIndex(this.pos,t)}eat(t,e=!1){return this.current(e)===t?(this.advance(e),!0):!1}eatChars(t,e=!1){let i=this.pos;for(let s of t){let t=this.at(i,e);if(t===-1||t!==s)return!1;i=this.nextIndex(i,e)}return this.pos=i,!0}};oi.validateRegExpFlags=function(t){let e=t.validFlags,i=t.flags,s=!1,r=!1;for(let a=0;a<i.length;a++){let n=i.charAt(a);e.indexOf(n)===-1&&this.raise(t.start,"Invalid regular expression flag"),i.indexOf(n,a+1)>-1&&this.raise(t.start,"Duplicate regular expression flag"),n==="u"&&(s=!0),n==="v"&&(r=!0)}this.options.ecmaVersion>=15&&s&&r&&this.raise(t.start,"Invalid regular expression flag")};oi.validateRegExpPattern=function(t){this.regexp_pattern(t),!t.switchN&&this.options.ecmaVersion>=9&&pi(t.groupNames)&&(t.switchN=!0,this.regexp_pattern(t))};oi.regexp_pattern=function(t){t.pos=0,t.lastIntValue=0,t.lastStringValue="",t.lastAssertionIsQuantifiable=!1,t.numCapturingParens=0,t.maxBackReference=0,t.groupNames=Object.create(null),t.backReferenceNames.length=0,t.branchID=null,this.regexp_disjunction(t),t.pos!==t.source.length&&(t.eat(41)&&t.raise("Unmatched ')'"),(t.eat(93)||t.eat(125))&&t.raise("Lone quantifier brackets")),t.maxBackReference>t.numCapturingParens&&t.raise("Invalid escape");for(let e of t.backReferenceNames)t.groupNames[e]||t.raise("Invalid named capture referenced")};oi.regexp_disjunction=function(t){let e=this.options.ecmaVersion>=16;for(e&&(t.branchID=new hi(t.branchID,null)),this.regexp_alternative(t);t.eat(124);)e&&(t.branchID=t.branchID.sibling()),this.regexp_alternative(t);e&&(t.branchID=t.branchID.parent),this.regexp_eatQuantifier(t,!0)&&t.raise("Nothing to repeat"),t.eat(123)&&t.raise("Lone quantifier brackets")};oi.regexp_alternative=function(t){for(;t.pos<t.source.length&&this.regexp_eatTerm(t););};oi.regexp_eatTerm=function(t){return this.regexp_eatAssertion(t)?(t.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(t)&&t.switchU&&t.raise("Invalid quantifier"),!0):(t.switchU?this.regexp_eatAtom(t):this.regexp_eatExtendedAtom(t))?(this.regexp_eatQuantifier(t),!0):!1};oi.regexp_eatAssertion=function(t){let e=t.pos;if(t.lastAssertionIsQuantifiable=!1,t.eat(94)||t.eat(36))return!0;if(t.eat(92)){if(t.eat(66)||t.eat(98))return!0;t.pos=e}if(t.eat(40)&&t.eat(63)){let e=!1;if(this.options.ecmaVersion>=9&&(e=t.eat(60)),t.eat(61)||t.eat(33))return this.regexp_disjunction(t),t.eat(41)||t.raise("Unterminated group"),t.lastAssertionIsQuantifiable=!e,!0}return t.pos=e,!1};oi.regexp_eatQuantifier=function(t,e=!1){return this.regexp_eatQuantifierPrefix(t,e)?(t.eat(63),!0):!1};oi.regexp_eatQuantifierPrefix=function(t,e){return t.eat(42)||t.eat(43)||t.eat(63)||this.regexp_eatBracedQuantifier(t,e)};oi.regexp_eatBracedQuantifier=function(t,e){let i=t.pos;if(t.eat(123)){let s=0,r=-1;if(this.regexp_eatDecimalDigits(t)&&(s=t.lastIntValue,t.eat(44)&&this.regexp_eatDecimalDigits(t)&&(r=t.lastIntValue),t.eat(125)))return r!==-1&&r<s&&!e&&t.raise("numbers out of order in {} quantifier"),!0;t.switchU&&!e&&t.raise("Incomplete quantifier"),t.pos=i}return!1};oi.regexp_eatAtom=function(t){return this.regexp_eatPatternCharacters(t)||t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)};oi.regexp_eatReverseSolidusAtomEscape=function(t){let e=t.pos;if(t.eat(92)){if(this.regexp_eatAtomEscape(t))return!0;t.pos=e}return!1};oi.regexp_eatUncapturingGroup=function(t){let e=t.pos;if(t.eat(40)){if(t.eat(63)){if(this.options.ecmaVersion>=16){let e=this.regexp_eatModifiers(t),i=t.eat(45);if(e||i){for(let i=0;i<e.length;i++){let s=e.charAt(i);e.indexOf(s,i+1)>-1&&t.raise("Duplicate regular expression modifiers")}if(i){let i=this.regexp_eatModifiers(t);!e&&!i&&t.current()===58&&t.raise("Invalid regular expression modifiers");for(let s=0;s<i.length;s++){let r=i.charAt(s);(i.indexOf(r,s+1)>-1||e.indexOf(r)>-1)&&t.raise("Duplicate regular expression modifiers")}}}}if(t.eat(58)){if(this.regexp_disjunction(t),t.eat(41))return!0;t.raise("Unterminated group")}}t.pos=e}return!1};oi.regexp_eatCapturingGroup=function(t){if(t.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(t):t.current()===63&&t.raise("Invalid group"),this.regexp_disjunction(t),t.eat(41))return t.numCapturingParens+=1,!0;t.raise("Unterminated group")}return!1};oi.regexp_eatModifiers=function(t){let e="",i=0;for(;(i=t.current())!==-1&&ci(i);)e+=Jt(i),t.advance();return e};oi.regexp_eatExtendedAtom=function(t){return t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)||this.regexp_eatInvalidBracedQuantifier(t)||this.regexp_eatExtendedPatternCharacter(t)};oi.regexp_eatInvalidBracedQuantifier=function(t){return this.regexp_eatBracedQuantifier(t,!0)&&t.raise("Nothing to repeat"),!1};oi.regexp_eatSyntaxCharacter=function(t){let e=t.current();return ui(e)?(t.lastIntValue=e,t.advance(),!0):!1};oi.regexp_eatPatternCharacters=function(t){let e=t.pos,i=0;for(;(i=t.current())!==-1&&!ui(i);)t.advance();return t.pos!==e};oi.regexp_eatExtendedPatternCharacter=function(t){let e=t.current();return e!==-1&&e!==36&&!(e>=40&&e<=43)&&e!==46&&e!==63&&e!==91&&e!==94&&e!==124?(t.advance(),!0):!1};oi.regexp_groupSpecifier=function(t){if(t.eat(63)){this.regexp_eatGroupName(t)||t.raise("Invalid group");let e=this.options.ecmaVersion>=16,i=t.groupNames[t.lastStringValue];if(i)if(e)for(let e of i)e.separatedFrom(t.branchID)||t.raise("Duplicate capture group name");else t.raise("Duplicate capture group name");e?(i||(t.groupNames[t.lastStringValue]=[])).push(t.branchID):t.groupNames[t.lastStringValue]=!0}};oi.regexp_eatGroupName=function(t){if(t.lastStringValue="",t.eat(60)){if(this.regexp_eatRegExpIdentifierName(t)&&t.eat(62))return!0;t.raise("Invalid capture group name")}return!1};oi.regexp_eatRegExpIdentifierName=function(t){if(t.lastStringValue="",this.regexp_eatRegExpIdentifierStart(t)){for(t.lastStringValue+=Jt(t.lastIntValue);this.regexp_eatRegExpIdentifierPart(t);)t.lastStringValue+=Jt(t.lastIntValue);return!0}return!1};oi.regexp_eatRegExpIdentifierStart=function(t){let e=t.pos,i=this.options.ecmaVersion>=11,s=t.current(i);return t.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(t,i)&&(s=t.lastIntValue),di(s)?(t.lastIntValue=s,!0):(t.pos=e,!1)};oi.regexp_eatRegExpIdentifierPart=function(t){let e=t.pos,i=this.options.ecmaVersion>=11,s=t.current(i);return t.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(t,i)&&(s=t.lastIntValue),fi(s)?(t.lastIntValue=s,!0):(t.pos=e,!1)};oi.regexp_eatAtomEscape=function(t){return this.regexp_eatBackReference(t)||this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)||t.switchN&&this.regexp_eatKGroupName(t)?!0:(t.switchU&&(t.current()===99&&t.raise("Invalid unicode escape"),t.raise("Invalid escape")),!1)};oi.regexp_eatBackReference=function(t){let e=t.pos;if(this.regexp_eatDecimalEscape(t)){let i=t.lastIntValue;if(t.switchU)return i>t.maxBackReference&&(t.maxBackReference=i),!0;if(i<=t.numCapturingParens)return!0;t.pos=e}return!1};oi.regexp_eatKGroupName=function(t){if(t.eat(107)){if(this.regexp_eatGroupName(t))return t.backReferenceNames.push(t.lastStringValue),!0;t.raise("Invalid named reference")}return!1};oi.regexp_eatCharacterEscape=function(t){return this.regexp_eatControlEscape(t)||this.regexp_eatCControlLetter(t)||this.regexp_eatZero(t)||this.regexp_eatHexEscapeSequence(t)||this.regexp_eatRegExpUnicodeEscapeSequence(t,!1)||!t.switchU&&this.regexp_eatLegacyOctalEscapeSequence(t)||this.regexp_eatIdentityEscape(t)};oi.regexp_eatCControlLetter=function(t){let e=t.pos;if(t.eat(99)){if(this.regexp_eatControlLetter(t))return!0;t.pos=e}return!1};oi.regexp_eatZero=function(t){return t.current()===48&&!Ei(t.lookahead())?(t.lastIntValue=0,t.advance(),!0):!1};oi.regexp_eatControlEscape=function(t){let e=t.current();return e===116?(t.lastIntValue=9,t.advance(),!0):e===110?(t.lastIntValue=10,t.advance(),!0):e===118?(t.lastIntValue=11,t.advance(),!0):e===102?(t.lastIntValue=12,t.advance(),!0):e===114?(t.lastIntValue=13,t.advance(),!0):!1};oi.regexp_eatControlLetter=function(t){let e=t.current();return mi(e)?(t.lastIntValue=e%32,t.advance(),!0):!1};oi.regexp_eatRegExpUnicodeEscapeSequence=function(t,e=!1){let i=t.pos,s=e||t.switchU;if(t.eat(117)){if(this.regexp_eatFixedHexDigits(t,4)){let e=t.lastIntValue;if(s&&e>=55296&&e<=56319){let i=t.pos;if(t.eat(92)&&t.eat(117)&&this.regexp_eatFixedHexDigits(t,4)){let i=t.lastIntValue;if(i>=56320&&i<=57343)return t.lastIntValue=(e-55296)*1024+(i-56320)+65536,!0}t.pos=i,t.lastIntValue=e}return!0}if(s&&t.eat(123)&&this.regexp_eatHexDigits(t)&&t.eat(125)&&gi(t.lastIntValue))return!0;s&&t.raise("Invalid unicode escape"),t.pos=i}return!1};oi.regexp_eatIdentityEscape=function(t){if(t.switchU)return this.regexp_eatSyntaxCharacter(t)?!0:t.eat(47)?(t.lastIntValue=47,!0):!1;let e=t.current();return e!==99&&(!t.switchN||e!==107)?(t.lastIntValue=e,t.advance(),!0):!1};oi.regexp_eatDecimalEscape=function(t){t.lastIntValue=0;let e=t.current();if(e>=49&&e<=57){do{t.lastIntValue=10*t.lastIntValue+(e-48),t.advance()}while((e=t.current())>=48&&e<=57);return!0}return!1};var xi=0,yi=1,bi=2;oi.regexp_eatCharacterClassEscape=function(t){let e=t.current();if(wi(e))return t.lastIntValue=-1,t.advance(),yi;let i=!1;if(t.switchU&&this.options.ecmaVersion>=9&&((i=e===80)||e===112)){t.lastIntValue=-1,t.advance();let e;if(t.eat(123)&&(e=this.regexp_eatUnicodePropertyValueExpression(t))&&t.eat(125))return i&&e===bi&&t.raise("Invalid property name"),e;t.raise("Invalid property name")}return xi};oi.regexp_eatUnicodePropertyValueExpression=function(t){let e=t.pos;if(this.regexp_eatUnicodePropertyName(t)&&t.eat(61)){let e=t.lastStringValue;if(this.regexp_eatUnicodePropertyValue(t)){let i=t.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(t,e,i),yi}}if(t.pos=e,this.regexp_eatLoneUnicodePropertyNameOrValue(t)){let e=t.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(t,e)}return xi};oi.regexp_validateUnicodePropertyNameAndValue=function(t,e,i){Ht(t.unicodeProperties.nonBinary,e)||t.raise("Invalid property name"),t.unicodeProperties.nonBinary[e].test(i)||t.raise("Invalid property value")};oi.regexp_validateUnicodePropertyNameOrValue=function(t,e){if(t.unicodeProperties.binary.test(e))return yi;if(t.switchV&&t.unicodeProperties.binaryOfStrings.test(e))return bi;t.raise("Invalid property name")};oi.regexp_eatUnicodePropertyName=function(t){let e=0;for(t.lastStringValue="";ki(e=t.current());)t.lastStringValue+=Jt(e),t.advance();return t.lastStringValue!==""};oi.regexp_eatUnicodePropertyValue=function(t){let e=0;for(t.lastStringValue="";_i(e=t.current());)t.lastStringValue+=Jt(e),t.advance();return t.lastStringValue!==""};oi.regexp_eatLoneUnicodePropertyNameOrValue=function(t){return this.regexp_eatUnicodePropertyValue(t)};oi.regexp_eatCharacterClass=function(t){if(t.eat(91)){let e=t.eat(94),i=this.regexp_classContents(t);return t.eat(93)||t.raise("Unterminated character class"),e&&i===bi&&t.raise("Negated character class may contain strings"),!0}return!1};oi.regexp_classContents=function(t){return t.current()===93?yi:t.switchV?this.regexp_classSetExpression(t):(this.regexp_nonEmptyClassRanges(t),yi)};oi.regexp_nonEmptyClassRanges=function(t){for(;this.regexp_eatClassAtom(t);){let e=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassAtom(t)){let i=t.lastIntValue;t.switchU&&(e===-1||i===-1)&&t.raise("Invalid character class"),e!==-1&&i!==-1&&e>i&&t.raise("Range out of order in character class")}}};oi.regexp_eatClassAtom=function(t){let e=t.pos;if(t.eat(92)){if(this.regexp_eatClassEscape(t))return!0;if(t.switchU){let e=t.current();(e===99||Pi(e))&&t.raise("Invalid class escape"),t.raise("Invalid escape")}t.pos=e}let i=t.current();return i!==93?(t.lastIntValue=i,t.advance(),!0):!1};oi.regexp_eatClassEscape=function(t){let e=t.pos;if(t.eat(98))return t.lastIntValue=8,!0;if(t.switchU&&t.eat(45))return t.lastIntValue=45,!0;if(!t.switchU&&t.eat(99)){if(this.regexp_eatClassControlLetter(t))return!0;t.pos=e}return this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)};oi.regexp_classSetExpression=function(t){let e=yi,i;if(!this.regexp_eatClassSetRange(t))if(i=this.regexp_eatClassSetOperand(t)){i===bi&&(e=bi);let s=t.pos;for(;t.eatChars([38,38]);){if(t.current()!==38&&(i=this.regexp_eatClassSetOperand(t))){i!==bi&&(e=yi);continue}t.raise("Invalid character in character class")}if(s!==t.pos)return e;for(;t.eatChars([45,45]);)this.regexp_eatClassSetOperand(t)||t.raise("Invalid character in character class");if(s!==t.pos)return e}else t.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(t)){if(i=this.regexp_eatClassSetOperand(t),!i)return e;i===bi&&(e=bi)}};oi.regexp_eatClassSetRange=function(t){let e=t.pos;if(this.regexp_eatClassSetCharacter(t)){let i=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassSetCharacter(t)){let e=t.lastIntValue;return i!==-1&&e!==-1&&i>e&&t.raise("Range out of order in character class"),!0}t.pos=e}return!1};oi.regexp_eatClassSetOperand=function(t){return this.regexp_eatClassSetCharacter(t)?yi:this.regexp_eatClassStringDisjunction(t)||this.regexp_eatNestedClass(t)};oi.regexp_eatNestedClass=function(t){let e=t.pos;if(t.eat(91)){let i=t.eat(94),s=this.regexp_classContents(t);if(t.eat(93))return i&&s===bi&&t.raise("Negated character class may contain strings"),s;t.pos=e}if(t.eat(92)){let i=this.regexp_eatCharacterClassEscape(t);if(i)return i;t.pos=e}return null};oi.regexp_eatClassStringDisjunction=function(t){let e=t.pos;if(t.eatChars([92,113])){if(t.eat(123)){let e=this.regexp_classStringDisjunctionContents(t);if(t.eat(125))return e}else t.raise("Invalid escape");t.pos=e}return null};oi.regexp_classStringDisjunctionContents=function(t){let e=this.regexp_classString(t);for(;t.eat(124);)this.regexp_classString(t)===bi&&(e=bi);return e};oi.regexp_classString=function(t){let e=0;for(;this.regexp_eatClassSetCharacter(t);)e++;return e===1?yi:bi};oi.regexp_eatClassSetCharacter=function(t){let e=t.pos;if(t.eat(92))return this.regexp_eatCharacterEscape(t)||this.regexp_eatClassSetReservedPunctuator(t)?!0:t.eat(98)?(t.lastIntValue=8,!0):(t.pos=e,!1);let i=t.current();return i<0||i===t.lookahead()&&Si(i)||Ci(i)?!1:(t.advance(),t.lastIntValue=i,!0)};oi.regexp_eatClassSetReservedPunctuator=function(t){let e=t.current();return vi(e)?(t.lastIntValue=e,t.advance(),!0):!1};oi.regexp_eatClassControlLetter=function(t){let e=t.current();return Ei(e)||e===95?(t.lastIntValue=e%32,t.advance(),!0):!1};oi.regexp_eatHexEscapeSequence=function(t){let e=t.pos;if(t.eat(120)){if(this.regexp_eatFixedHexDigits(t,2))return!0;t.switchU&&t.raise("Invalid escape"),t.pos=e}return!1};oi.regexp_eatDecimalDigits=function(t){let e=t.pos,i=0;for(t.lastIntValue=0;Ei(i=t.current());)t.lastIntValue=10*t.lastIntValue+(i-48),t.advance();return t.pos!==e};oi.regexp_eatHexDigits=function(t){let e=t.pos,i=0;for(t.lastIntValue=0;Ai(i=t.current());)t.lastIntValue=16*t.lastIntValue+Ii(i),t.advance();return t.pos!==e};oi.regexp_eatLegacyOctalEscapeSequence=function(t){if(this.regexp_eatOctalDigit(t)){let e=t.lastIntValue;if(this.regexp_eatOctalDigit(t)){let i=t.lastIntValue;e<=3&&this.regexp_eatOctalDigit(t)?t.lastIntValue=e*64+i*8+t.lastIntValue:t.lastIntValue=e*8+i}else t.lastIntValue=e;return!0}return!1};oi.regexp_eatOctalDigit=function(t){let e=t.current();return Pi(e)?(t.lastIntValue=e-48,t.advance(),!0):(t.lastIntValue=0,!1)};oi.regexp_eatFixedHexDigits=function(t,e){let i=t.pos;t.lastIntValue=0;for(let s=0;s<e;++s){let e=t.current();if(!Ai(e))return t.pos=i,!1;t.lastIntValue=16*t.lastIntValue+Ii(e),t.advance()}return!0};var Ni=class{constructor(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new Zt(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])}},Ti=ue.prototype;Ti.next=function(t){!t&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new Ni(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};Ti.getToken=function(){return this.next(),new Ni(this)};typeof Symbol<"u"&&(Ti[Symbol.iterator]=function(){return{next:()=>{let t=this.getToken();return{done:t.type===Dt.eof,value:t}}}});Ti.nextToken=function(){let t=this.curContext();if((!t||!t.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(Dt.eof);if(t.override)return t.override(this);this.readToken(this.fullCharCodeAtPos())};Ti.readToken=function(t){return Pt(t,this.options.ecmaVersion>=6)||t===92?this.readWord():this.getTokenFromCode(t)};Ti.fullCharCodeAt=function(t){let e=this.input.charCodeAt(t);if(e<=55295||e>=56320)return e;let i=this.input.charCodeAt(t+1);return i<=56319||i>=57344?e:(e<<10)+i-56613888};Ti.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};Ti.skipBlockComment=function(){let t=this.options.onComment&&this.curPosition(),e=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(let t,i=e;(t=$t(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=t;this.options.onComment&&this.options.onComment(!0,this.input.slice(e+2,i),e,this.pos,t,this.curPosition())};Ti.skipLineComment=function(t){let e=this.pos,i=this.options.onComment&&this.curPosition(),s=this.input.charCodeAt(this.pos+=t);for(;this.pos<this.input.length&&!Ut(s);)s=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(e+t,this.pos),e,this.pos,i,this.curPosition())};Ti.skipSpace=function(){t:for(;this.pos<this.input.length;){let t=this.input.charCodeAt(this.pos);switch(t){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break t}break;default:if(t>8&&t<14||t>=5760&&Ft.test(String.fromCharCode(t)))++this.pos;else break t}}};Ti.finishToken=function(t,e){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());let i=this.type;this.type=t,this.value=e,this.updateContext(i)};Ti.readToken_dot=function(){let t=this.input.charCodeAt(this.pos+1);if(t>=48&&t<=57)return this.readNumber(!0);let e=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&t===46&&e===46?(this.pos+=3,this.finishToken(Dt.ellipsis)):(++this.pos,this.finishToken(Dt.dot))};Ti.readToken_slash=function(){let t=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):t===61?this.finishOp(Dt.assign,2):this.finishOp(Dt.slash,1)};Ti.readToken_mult_modulo_exp=function(t){let e=this.input.charCodeAt(this.pos+1),i=1,s=t===42?Dt.star:Dt.modulo;return this.options.ecmaVersion>=7&&t===42&&e===42&&(++i,s=Dt.starstar,e=this.input.charCodeAt(this.pos+2)),e===61?this.finishOp(Dt.assign,i+1):this.finishOp(s,i)};Ti.readToken_pipe_amp=function(t){let e=this.input.charCodeAt(this.pos+1);return e===t?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(Dt.assign,3):this.finishOp(t===124?Dt.logicalOR:Dt.logicalAND,2):e===61?this.finishOp(Dt.assign,2):this.finishOp(t===124?Dt.bitwiseOR:Dt.bitwiseAND,1)};Ti.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(Dt.assign,2):this.finishOp(Dt.bitwiseXOR,1)};Ti.readToken_plus_min=function(t){let e=this.input.charCodeAt(this.pos+1);return e===t?e===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||Mt.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(Dt.incDec,2):e===61?this.finishOp(Dt.assign,2):this.finishOp(Dt.plusMin,1)};Ti.readToken_lt_gt=function(t){let e=this.input.charCodeAt(this.pos+1),i=1;return e===t?(i=t===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(Dt.assign,i+1):this.finishOp(Dt.bitShift,i)):e===33&&t===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(e===61&&(i=2),this.finishOp(Dt.relational,i))};Ti.readToken_eq_excl=function(t){let e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(Dt.equality,this.input.charCodeAt(this.pos+2)===61?3:2):t===61&&e===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(Dt.arrow)):this.finishOp(t===61?Dt.eq:Dt.prefix,1)};Ti.readToken_question=function(){let t=this.options.ecmaVersion;if(t>=11){let e=this.input.charCodeAt(this.pos+1);if(e===46){let t=this.input.charCodeAt(this.pos+2);if(t<48||t>57)return this.finishOp(Dt.questionDot,2)}if(e===63)return t>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(Dt.assign,3):this.finishOp(Dt.coalesce,2)}return this.finishOp(Dt.question,1)};Ti.readToken_numberSign=function(){let t=this.options.ecmaVersion,e=35;if(t>=13&&(++this.pos,e=this.fullCharCodeAtPos(),Pt(e,!0)||e===92))return this.finishToken(Dt.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Jt(e)+"'")};Ti.getTokenFromCode=function(t){switch(t){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(Dt.parenL);case 41:return++this.pos,this.finishToken(Dt.parenR);case 59:return++this.pos,this.finishToken(Dt.semi);case 44:return++this.pos,this.finishToken(Dt.comma);case 91:return++this.pos,this.finishToken(Dt.bracketL);case 93:return++this.pos,this.finishToken(Dt.bracketR);case 123:return++this.pos,this.finishToken(Dt.braceL);case 125:return++this.pos,this.finishToken(Dt.braceR);case 58:return++this.pos,this.finishToken(Dt.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(Dt.backQuote);case 48:let e=this.input.charCodeAt(this.pos+1);if(e===120||e===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(e===111||e===79)return this.readRadixNumber(8);if(e===98||e===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(t);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(t);case 124:case 38:return this.readToken_pipe_amp(t);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(t);case 60:case 62:return this.readToken_lt_gt(t);case 61:case 33:return this.readToken_eq_excl(t);case 63:return this.readToken_question();case 126:return this.finishOp(Dt.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Jt(t)+"'")};Ti.finishOp=function(t,e){let i=this.input.slice(this.pos,this.pos+e);return this.pos+=e,this.finishToken(t,i)};Ti.readRegexp=function(){let t,e,i=this.pos;for(;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");let s=this.input.charAt(this.pos);if(Mt.test(s)&&this.raise(i,"Unterminated regular expression"),t)t=!1;else{if(s==="[")e=!0;else if(s==="]"&&e)e=!1;else if(s==="/"&&!e)break;t=s==="\\"}++this.pos}let s=this.input.slice(i,this.pos);++this.pos;let r=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(r);let n=this.regexpState||(this.regexpState=new li(this));n.reset(i,s,a),this.validateRegExpFlags(n),this.validateRegExpPattern(n);let o=null;try{o=new RegExp(s,a)}catch{}return this.finishToken(Dt.regexp,{pattern:s,flags:a,value:o})};Ti.readInt=function(t,e,i){let s=this.options.ecmaVersion>=12&&e===void 0,r=i&&this.input.charCodeAt(this.pos)===48,a=this.pos,n=0,o=0;for(let i=0,a=e??1/0;i<a;++i,++this.pos){let e=this.input.charCodeAt(this.pos),a;if(s&&e===95){r&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),o===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),i===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=e;continue}if(e>=97?a=e-97+10:e>=65?a=e-65+10:e>=48&&e<=57?a=e-48:a=1/0,a>=t)break;o=e,n=n*t+a}return s&&o===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===a||e!=null&&this.pos-a!==e?null:n};Ti.readRadixNumber=function(t){let e=this.pos;this.pos+=2;let i=this.readInt(t);return i==null&&this.raise(this.start+2,"Expected number in radix "+t),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=Li(this.input.slice(e,this.pos)),++this.pos):Pt(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(Dt.num,i)};Ti.readNumber=function(t){let e=this.pos;!t&&this.readInt(10,void 0,!0)===null&&this.raise(e,"Invalid number");let i=this.pos-e>=2&&this.input.charCodeAt(e)===48;i&&this.strict&&this.raise(e,"Invalid number");let s=this.input.charCodeAt(this.pos);if(!i&&!t&&this.options.ecmaVersion>=11&&s===110){let t=Li(this.input.slice(e,this.pos));return++this.pos,Pt(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(Dt.num,t)}i&&/[89]/.test(this.input.slice(e,this.pos))&&(i=!1),s===46&&!i&&(++this.pos,this.readInt(10),s=this.input.charCodeAt(this.pos)),(s===69||s===101)&&!i&&(s=this.input.charCodeAt(++this.pos),(s===43||s===45)&&++this.pos,this.readInt(10)===null&&this.raise(e,"Invalid number")),Pt(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");let r=Vi(this.input.slice(e,this.pos),i);return this.finishToken(Dt.num,r)};Ti.readCodePoint=function(){let t=this.input.charCodeAt(this.pos),e;if(t===123){this.options.ecmaVersion<6&&this.unexpected();let t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e};Ti.readString=function(t){let e="",i=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");let s=this.input.charCodeAt(this.pos);if(s===t)break;s===92?(e+=this.input.slice(i,this.pos),e+=this.readEscapedChar(!1),i=this.pos):s===8232||s===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Ut(s)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return e+=this.input.slice(i,this.pos++),this.finishToken(Dt.string,e)};var Ri={};Ti.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(t){if(t===Ri)this.readInvalidTemplateToken();else throw t}this.inTemplateElement=!1};Ti.invalidStringToken=function(t,e){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Ri;this.raise(t,e)};Ti.readTmplToken=function(){let t="",e=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");let i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===Dt.template||this.type===Dt.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(Dt.dollarBraceL)):(++this.pos,this.finishToken(Dt.backQuote)):(t+=this.input.slice(e,this.pos),this.finishToken(Dt.template,t));if(i===92)t+=this.input.slice(e,this.pos),t+=this.readEscapedChar(!0),e=this.pos;else if(Ut(i)){switch(t+=this.input.slice(e,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:t+=`\n`;break;default:t+=String.fromCharCode(i);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),e=this.pos}else++this.pos}};Ti.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(Dt.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":this.input[this.pos+1]===`\n`&&++this.pos;case`\n`:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};Ti.readEscapedChar=function(t){let e=this.input.charCodeAt(++this.pos);switch(++this.pos,e){case 110:return`\n`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Jt(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),t){let t=this.pos-1;this.invalidStringToken(t,"Invalid escape sequence in template string")}default:if(e>=48&&e<=55){let i=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],s=parseInt(i,8);return s>255&&(i=i.slice(0,-1),s=parseInt(i,8)),this.pos+=i.length-1,e=this.input.charCodeAt(this.pos),(i!=="0"||e===56||e===57)&&(this.strict||t)&&this.invalidStringToken(this.pos-1-i.length,t?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(s)}return Ut(e)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(e)}};Ti.readHexChar=function(t){let e=this.pos,i=this.readInt(16,t);return i===null&&this.invalidStringToken(e,"Bad character escape sequence"),i};Ti.readWord1=function(){this.containsEsc=!1;let t="",e=!0,i=this.pos,s=this.options.ecmaVersion>=6;for(;this.pos<this.input.length;){let r=this.fullCharCodeAtPos();if(Nt(r,s))this.pos+=r<=65535?1:2;else if(r===92){this.containsEsc=!0,t+=this.input.slice(i,this.pos);let r=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;let a=this.readCodePoint();(e?Pt:Nt)(a,s)||this.invalidStringToken(r,"Invalid Unicode escape"),t+=Jt(a),i=this.pos}else break;e=!1}return t+this.input.slice(i,this.pos)};Ti.readWord=function(){let t=this.readWord1(),e=Dt.name;return this.keywords.test(t)&&(e=Ot[t]),this.finishToken(e,t)};var Oi="8.19.0";ue.acorn={Parser:ue,version:Oi,defaultOptions:ee,Position:Yt,SourceLocation:Zt,getLineInfo:te,Node:De,TokenType:Tt,tokTypes:Dt,keywordTypes:Ot,TokContext:Ae,tokContexts:Ie,isIdentifierChar:Nt,isIdentifierStart:Pt,Token:Ni,isNewLine:Ut,lineBreak:Mt,lineBreakG:Bt,nonASCIIwhitespace:Ft};var Bi={...xt};var qi=`npx ${M} add astro [--dry-run] [--json]\n\nAdds format="jxl" to Astro's <Image> and <Picture>, in the Astro site in this folder:\n installs ${M} (and sharp, where Astro has none), writes the image service into src/jxl/,\n imports it in astro.config, adds jxl() to integrations and, on @astrojs/cloudflare, imageService: 'custom'.\nSafe to run again: it updates only files it wrote and nobody edited since.\n --dry-run say what would change, change nothing\n --json one JSON object on stdout`,Wi=["astro.config.mjs","astro.config.js","astro.config.ts","astro.config.mts","astro.config.cjs","astro.config.cts"],Gi="src/jxl",Hi=["index.mjs","options.mjs","service.mjs","service-workers.mjs"],zi=`./${Gi}/index.mjs`,Ki=`add it by hand: import jxl from '${zi}'; and integrations: [jxl()] in astro.config`,Qi=t=>pt("sha256").update(t).digest("hex").slice(0,16),Ji=/^\/\/ Written by npx jpegxl add astro \(rapier-jxl [^,]+, ([0-9a-f]{16})\)\. [^\r\n]*\r?\n/,Xi=(t,e=Ki)=>R("JXL_SETUP",t,e),Yi=(t,e)=>t?.type==="CallExpression"&&t.callee.type==="Identifier"&&t.callee.name===e,Zi=t=>t.type==="Property"&&!t.computed?t.key.name??t.key.value:null;var as=(t,e)=>lt("astro",t,e);export{qi as ADD_ASTRO_HELP,Ji as HEADER,rs as addAstro,es as planAstroConfig,ts as runAddAstro,as as runRemoveAstro};
1
+ /*! rapier-jxl 8.4.1 | MIT */
2
+ async function k(t,e=0){if(e>40)throw Object.assign(new Error("Symbolic link loop"),{code:"ELOOP"});try{return await a(t)}catch(t){if(!["ENOENT","ENOTDIR"].includes(t.code))throw t}if((await i(t).catch(()=>null))?.isSymbolicLink())return k(g(u(t),await n(t)),e+1);let s=u(t);return s===t?t:f(await k(s,e),c(t))}async function _(t,e,i){let s=await a(t),r=[];for(let n of e){if(typeof n!="string"||n.includes("\0"))throw i("A project file path is invalid","use a plain relative path inside this folder");let e;try{e=await k(g(t,n))}catch(e){throw e?.code==="ELOOP"?i(`${m(t,g(t,n))||n} has a symbolic link loop`,"replace the link with a folder or file"):e}if(!b(s,e))throw i(`${m(t,g(t,n))||n}: outside folder (${e})`,"replace symlink or run in target folder");let a=m(s,e);if(process.platform==="win32"&&a.split(/[\\/]/).some(t=>w.test(t)||/[ .]$/.test(t)))throw i(`${a} uses a reserved Windows file name`,"rename the file or folder");r.push(e)}return r}async function S(t,e){let[i]=await _(t,["package.json"],e),s=await r(i,"utf8").catch(t=>{if(t.code==="ENOENT")return null;throw t});if(s===null)return null;let n;try{n=JSON.parse(s)}catch(t){throw e(`package.json: invalid JSON (${t.message})`,"fix package.json")}if(!n||typeof n!="object"||Array.isArray(n))throw e("package.json is not a JSON object","correct package.json");return{text:s,manifest:n}}async function C(t,e){await s(u(t),{recursive:!0});let i=f(u(t),`.${c(t)}.${p(6).toString("hex")}.tmp`);try{await l(i,e,{flag:"wx"}),await o(i,t)}catch(t){throw await h(i,{force:!0}).catch(()=>{}),t}}function O(t){if(!Array.isArray(t))throw R("JXL_OPTIONS","args: array of strings","use: string[]");let e=[];for(let i=0;i<t.length;i++){let s=t[i];if(typeof s!="string")throw R("JXL_OPTIONS","arg: string","each: string");e.push(s)}return e}async function H(t){for(let e=t;;e=F(e)){let t=[];for(let[i,s]of W)await $(q(e,i)).catch(()=>null)&&t.push(s);if(t.length)return[...new Set(t)];if(F(e)===e)return[]}}function z(t){let e=String(t);if(/[%\0\r\n]/.test(e))throw R("JXL_SETUP",`${e} has % or a line break, which Windows' shell would run`,"rename or move the file so its path has neither");return`"${e.replace(/"/g,'""')}"`}function K(t,e,{cwd:i,env:s=process.env,platform:r=process.platform,execPath:n=process.execPath,quiet:a=!1}){let o=a?["ignore","ignore","inherit"]:"inherit";return t==="npm"&&s.npm_execpath&&/(?:^|[/\\])npm(?:-cli)?\.(?:c?js|mjs)$/.test(s.npm_execpath)?[n,[s.npm_execpath,...e],{cwd:i,env:s,stdio:o,shell:!1}]:r==="win32"?[[t,...e.map(z)].join(" "),[],{cwd:i,env:s,stdio:o,shell:!0}]:[t,e,{cwd:i,env:s,stdio:o,shell:!1}]}async function ht(t,e){let[i]=await _(t,[Q(e)],X),s=await Y(i);if(s===null)return null;let r;try{r=JSON.parse(s)}catch{throw X("The add record is not JSON")}if(!et(r)||r.place!==e||r.schema!==1||!et(r.files)||!Array.isArray(r.dirs)||!r.dirs.every(t=>ot(e,t)))throw X("The add record does not describe this place");for(let[t,i]of Object.entries(r.files))if(!at(e,t)||!et(i)||!(i.before===null||typeof i.before=="string"&&Buffer.from(i.before,"base64").toString("base64")===i.before)||!(i.after===null||typeof i.after=="string"&&/^[a-f0-9]{64}$/.test(i.after))||!(i.mode===null||Number.isInteger(i.mode)&&i.mode>=0&&i.mode<=511))throw X("The add record names an invalid file");if(r.pending)throw X("An earlier add did not finish installing its dependencies");return await _(t,[...Object.keys(r.files),...r.dirs],X),r}async function lt(t,e,i,s,{dryRun:r=!1,install:n,beforeWrite:a}={}){let o=await ht(t,e),h=[...new Set([...s.keys(),...n?.files??[]])];if(h.some(t=>!at(e,t)))throw X("The setup names a file outside its place");let l=await _(t,[Q(e),...h],X),p=new Map,c={...o?.files},u=new Set(o?.dirs??[]);for(let[e,i]of h.entries()){let r=await Y(l[e+1]);if(p.set(i,r),c[i]&&!tt(r,c[i].after))throw X(`${i} changed after add wrote it`);c[i]={before:c[i]?c[i].before:r===null?null:r.toString("base64"),mode:c[i]?c[i].mode:r===null?null:(await E(l[e+1])).mode&511,after:s.has(i)?J(s.get(i)):Z(r)};for(let e=N(i);e!==".";e=N(e))try{await E(T(t,e))}catch(t){if(t.code==="ENOENT")u.add(e.split(V).join("/"));else throw t}}if(r)return;if(!h.length){await(a?.());return}let d={schema:1,place:e,version:i,files:c,dirs:[...u]},f=t=>C(l[0],JSON.stringify({...d,...t&&{pending:!0}},null,2)+`\n`);if(await f(!!n),n){await n.run(),await _(t,[Q(e),...h],X);for(let e of n.files)c[e].after=Z(await Y(T(t,e)));await f(!1)}await(a?.());let m=await _(t,[...s.keys()],X);for(let e of s.keys())if(Z(await Y(T(t,e)))!==Z(p.get(e)))throw X(`${e} changed while add ran`);for(let[t,[e,i]]of[...s].entries())await C(m[t],i),c[e].mode!==null&&await P(m[t],c[e].mode)}async function pt(t,e,{cwd:i,stdout:s}){if(e=O(e),e.length===1&&["--help","-h"].includes(e[0])){s(`Usage: ${M} remove ${t} [--dry-run] [--json]`);return}if(e.some(t=>!["--dry-run","--json"].includes(t)))throw R("JXL_OPTIONS","Unknown remove option",`run npx ${M} remove ${t} --help`);let r=e.includes("--dry-run"),n=await ht(i,t);if(!n)throw X(`There is no add record for ${t}`);let a=Object.keys(n.files),o=await _(i,[...a,Q(t),...n.dirs],X),h=[];for(let[t,e]of a.entries()){let i=n.files[e],s=await Y(o[t]),r=i.before===null?null:Buffer.from(i.before,"base64");if(Z(s)!==Z(r)){if(!tt(s,i.after))throw X(`${e} changed after add wrote it; no files were removed`);h.push({file:e,action:r===null?"removed":"restored",original:r,index:t})}}if(!r){for(let t of h){let e=o[t.index],i=n.files[t.file];t.original===null?await A(e):(await C(e,t.original),i.mode!==null&&await P(e,i.mode))}for(let t of[...n.dirs].sort((t,e)=>e.length-t.length))await I(T(i,t)).catch(t=>{if(!["ENOENT","ENOTEMPTY","EEXIST"].includes(t.code))throw t});await A(o[a.length])}let l=h.map(({file:t,action:e})=>({file:t,action:e}));if(e.includes("--json"))s(JSON.stringify({type:"remove",host:t,dryRun:r,changes:l}));else for(let{file:t,action:e}of l)s(`${t}: ${r?"would be ":""}${e}`)}function Pt(t,e){let i=65536;for(let s=0;s<e.length;s+=2){if(i+=e[s],i>t)return!1;if(i+=e[s+1],i>=t)return!0}return!1}function Nt(t,e){return t<65?t===36:t<91?!0:t<97?t===95:t<123?!0:t<=65535?t>=170&&At.test(String.fromCharCode(t)):e===!1?!1:Pt(t,wt)}function Tt(t,e){return t<48?t===36:t<58?!0:t<65?!1:t<91?!0:t<97?t===95:t<123?!0:t<=65535?t>=170&&It.test(String.fromCharCode(t)):e===!1?!1:Pt(t,wt)||Pt(t,bt)}function Lt(t,e){return new Vt(t,{beforeExpr:!0,binop:e})}function Dt(t,e={}){return e.keyword=t,jt[t]=new Vt(t,e)}function $t(t){return t===10||t===13||t===8232||t===8233}function Ft(t,e,i=t.length){for(let s=e;s<i;s++){let e=t.charCodeAt(s);if($t(e))return s<i-1&&e===13&&t.charCodeAt(s+1)===10?s+2:s+1}return-1}function Jt(t){return Qt[t]||(Qt[t]=new RegExp("^(?:"+t.replace(/ /g,"|")+")$"))}function Xt(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function ee(t,e){for(let i=1,s=0;;){let r=Ft(t,s,e);if(r<0)return new Zt(i,e-s);++i,s=r}}function re(t){let e={};for(let i in ie)e[i]=t&&zt(t,i)?t[i]:ie[i];if(e.ecmaVersion==="latest"?e.ecmaVersion=1e8:e.ecmaVersion==null?(!se&&typeof console=="object"&&console.warn&&(se=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.`)),e.ecmaVersion=11):e.ecmaVersion>=2015&&(e.ecmaVersion-=2009),e.allowReserved==null&&(e.allowReserved=e.ecmaVersion<5),(!t||t.allowHashBang==null)&&(e.allowHashBang=e.ecmaVersion>=14),Kt(e.onToken)){let t=e.onToken;e.onToken=e=>t.push(e)}if(Kt(e.onComment)&&(e.onComment=ne(e,e.onComment)),e.sourceType==="commonjs"&&e.allowAwaitOutsideFunction)throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return e}function ne(t,e){return function(i,s,r,n,a,o){let h={type:i?"Block":"Line",value:s,start:r,end:n};t.locations&&(h.loc=new te(this,a,o)),t.ranges&&(h.range=[r,n]),e.push(h)}}function ae(t,e){return 2|(t?4:0)|(e?8:0)}function ge(t,e){let i=e+1,s=Math.min(t.input.length,e+11);for(;i<s;){let e=t.fullCharCodeAt(i);if(!Tt(e,!0))break;i+=e<=65535?1:2}return i===e+2&&t.input.slice(e,i)==="in"||i===e+10&&t.input.slice(e,i)==="instanceof"}function ve(t,e){let i=e.key.name,s=t[i],r="true";return e.type==="MethodDefinition"&&(e.kind==="get"||e.kind==="set")&&(r=(e.static?"s":"i")+e.kind),s==="iget"&&r==="iset"||s==="iset"&&r==="iget"||s==="sget"&&r==="sset"||s==="sset"&&r==="sget"?(t[i]="true",!1):s?!0:(t[i]=r,!1)}function Ee(t,e){let{computed:i,key:s}=t;return!i&&(s.type==="Identifier"&&s.name===e||s.type==="Literal"&&s.value===e)}function Ve(t){return t.type==="Identifier"||t.type==="ParenthesizedExpression"&&Ve(t.expression)}function Le(t){return t.type==="MemberExpression"&&t.property.type==="PrivateIdentifier"||t.type==="ChainExpression"&&Le(t.expression)||t.type==="ParenthesizedExpression"&&Le(t.expression)}function Ue(t,e,i,s){return t.type=e,t.end=i,this.options.locations&&(t.loc.end=s),this.options.ranges&&(t.range[1]=i),t}function ai(t){let e=ni[t]={binary:Jt(Ke[t]+" "+Xe),binaryOfStrings:Jt(Je[t]),nonBinary:{General_Category:Jt(Xe),Script:Jt(ri[t])}};e.nonBinary.Script_Extensions=e.nonBinary.Script,e.nonBinary.gc=e.nonBinary.General_Category,e.nonBinary.sc=e.nonBinary.Script,e.nonBinary.scx=e.nonBinary.Script_Extensions}function ci(t){for(let e in t)return!0;return!1}function ui(t){return t===105||t===109||t===115}function di(t){return t===36||t>=40&&t<=43||t===46||t===63||t>=91&&t<=94||t>=123&&t<=125}function fi(t){return Nt(t,!0)||t===36||t===95}function mi(t){return Tt(t,!0)||t===36||t===95||t===8204||t===8205}function gi(t){return t>=65&&t<=90||t>=97&&t<=122}function xi(t){return t>=0&&t<=1114111}function ki(t){return t===100||t===68||t===115||t===83||t===119||t===87}function _i(t){return gi(t)||t===95}function Si(t){return _i(t)||Ai(t)}function Ci(t){return t===33||t>=35&&t<=38||t>=42&&t<=44||t===46||t>=58&&t<=64||t===94||t===96||t===126}function vi(t){return t===40||t===41||t===45||t===47||t>=91&&t<=93||t>=123&&t<=125}function Ei(t){return t===33||t===35||t===37||t===38||t===44||t===45||t>=58&&t<=62||t===64||t===96||t===126}function Ai(t){return t>=48&&t<=57}function Ii(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function Pi(t){return t>=65&&t<=70?10+(t-65):t>=97&&t<=102?10+(t-97):t-48}function Ni(t){return t>=48&&t<=55}function Li(t,e){return e?parseInt(t,8):parseFloat(t.replace(/_/g,""))}function Ri(t){return typeof BigInt!="function"?null:BigInt(t.replace(/_/g,""))}function Di(t,e){return de.parse(t,e)}function Mi(t,e,i){return de.parseExpressionAt(t,e,i)}function Bi(t,e){return de.tokenizer(t,e)}function $i(t){let e={sourceType:"module",ecmaVersion:"latest"},i=t.startsWith("\ufeff#!")?"//!"+t.slice(3):t;try{return Ui.parse(i,e)}catch(t){let{stripTypeScriptTypes:s}=mt;if(typeof s!="function")throw t;let r=process.emitWarning,n;try{process.emitWarning=()=>{},n=s(i,{mode:"strip"})}catch{throw t}finally{process.emitWarning=r}if(n.length!==i.length)throw t;return Ui.parse(n,e)}}function Fi(t,e,i){let s=0,r=e,n=-1;for(let a=e;a<i;a++){let e=t[a],o=t[a+1];if(e==="/"&&o==="/"){if(a=t.indexOf(`\n`,a+2),a<0)break;continue}if(e==="/"&&o==="*"){let e=t.indexOf("*/",a+2);if(e<0)break;a=e+1;continue}if(e==="'"||e==='"'||e==="`"){for(a++;a<i&&t[a]!==e;a++)t[a]==="\\"&&a++;r=a+1;continue}if(e==="("||e==="["||e==="{")s++;else if(e===")"||e==="]"||e==="}"){if(s===0)break;s--,r=a+1}else if(e===","&&s===0){n=a;break}else/\s/.test(e)||(r=a+1)}return{end:r,comma:n}}function qi(t,e){let i=t.startsWith("\ufeff")?1:0;if(t.startsWith("#!",i)){let e=t.indexOf(`\n`,i);i=e<0?t.length:e+1}for(let s of e?.body??[])if(s.type==="ExpressionStatement"&&typeof s.directive=="string"){let e=/^\r?\n/.exec(t.slice(s.end))?.[0].length??0;i=Math.max(i,s.end+e)}else break;return i}async function es(t,{cwd:e,version:i,name:s,stdout:r,quiet:n=!1}){if(t=O(t),t.length===1&&["--help","-h"].includes(t[0])){r(Wi);return}let a=t.includes("--json"),o=t.filter(t=>!["--dry-run","--json"].includes(t));if(o.length)throw Object.assign(Yi(`unknown option: ${o[0]}`,`run: npx ${M} add astro --help`),{code:"JXL_OPTIONS"});let h=await ns({cwd:e,version:i,name:s,dryRun:t.includes("--dry-run"),quiet:n||a});if(a)r(JSON.stringify({type:"add",host:"astro",...h}));else if(!h.changes.length&&!h.kept.length)r(`Nothing to change: ${M} is already set up.`);else for(let t of h.changes)r(`${h.dryRun?"Would change":"Changed"}: ${t}`);for(let t of h.kept)r(`Kept ${t}: edited since add astro wrote it. To take the new one, delete it and run add astro again.`)}function is(t){let e;try{e=$i(t)}catch{throw Yi("astro.config: JS/TS parse failed")}let i=e.body.filter(t=>t.type==="ImportDeclaration"),s=(t,e="default")=>i.flatMap(i=>i.source.value===t?i.specifiers.filter(t=>e==="default"?t.type==="ImportDefaultSpecifier":(t.imported?.name??t.imported?.value)===e).map(t=>t.local.name):[])[0],r=e.body.find(t=>t.type==="ExportDefaultDeclaration")?.declaration,n=s("astro/config","defineConfig"),a=r?.type==="ObjectExpression"?r:Zi(r,n)&&r.arguments[0]?.type==="ObjectExpression"?r.arguments[0]:null;if(!a)throw Yi("astro.config: object or defineConfig({...})");if(a.properties.some(t=>t.type==="SpreadElement"||t.computed))throw Yi("astro.config: no spread/computed keys");let o=[],h=[],l=s(Ki)??"jxl",p=1;if(!s(Ki)){if(i.some(t=>t.specifiers.some(t=>t.local.name==="jxl")))throw Yi("jxl: already imported");for(;new RegExp(`\\b${l}\\b`).test(t);)l=p===1?"rapierJxl":`rapierJxl${p}`,p++;let s=qi(t,e);i.length?o.push({at:i.at(-1).end,text:`\nimport ${l} from '${Ki}';`}):o.push({at:s,text:`${s===t.length&&s&&!t.endsWith(`\n`)?`\n`:""}import ${l} from '${Ki}';\n`}),h.push(`import ${l} from '${Ki}'`)}let c=(e,i)=>t.slice(t.lastIndexOf(`\n`,e.start)+1,e.start).match(/^\s*/)[0]+(i?" ":""),u=(e,i)=>{let s=e.properties.at(-1);if(!s)return{at:e.start+1,text:i};let{end:r,comma:n}=Fi(t,s.end,e.end-1),a=t.slice(e.start,e.end).includes(`\n`);return n>=0?{at:n+1,text:a?`\n${c(s)}${i},`:` ${i}`}:{at:r,text:a?`,\n${c(s)}${i}`:`, ${i}`}},d=a.properties.find(t=>ts(t)==="integrations");if(!d)o.push(u(a,`integrations: [${l}()]`)),h.push(`integrations: [${l}()]`);else{if(d.value.type!=="ArrayExpression"||d.value.elements.some(t=>t?.type==="SpreadElement"))throw Yi("integrations: array");if(!d.value.elements.some(t=>Zi(t,l))){let e=d.value,i=e.elements.at(-1);if(i){let{end:s,comma:r}=Fi(t,i.end,e.end-1);o.push(r>=0?{at:r+1,text:` ${l}(),`}:{at:s,text:`, ${l}()`})}else o.push(e.elements.length?{at:e.end-1,text:` ${l}()`}:{at:e.start+1,text:`${l}()`});h.push(`${l}() in integrations`)}}let f=s("@astrojs/cloudflare"),m=a.properties.find(t=>ts(t)==="adapter")?.value;if(f&&Zi(m,f)){let t=m.arguments[0];if(!t)o.push({at:m.end-1,text:"{imageService: 'custom'}"}),h.push("imageService: 'custom' on the Cloudflare adapter");else{if(t.type!=="ObjectExpression"||m.arguments.length>1)throw Yi("Cloudflare adapter: options object","set: imageService: 'custom' manually");{let e=t.properties.find(t=>ts(t)==="imageService");if(!e)o.push(u(t,"imageService: 'custom'")),h.push("imageService: 'custom' on the Cloudflare adapter");else if(!(e.value.type==="Literal"&&e.value.value==="custom"))throw Yi("imageService: 'custom' required",`set: imageService: 'custom' or format="jxl" on prerendered pages`)}}}let g=t.includes(`\r\n`)?`\r\n`:`\n`;for(let e of o.sort((t,e)=>e.at-t.at))t=t.slice(0,e.at)+e.text.replace(/\r?\n/g,g)+t.slice(e.at);try{$i(t)}catch{throw Yi("The config could not be updated safely")}return{source:t,changes:h}}async function ss(t){let e=await H(t);if(e.length>1)throw Yi("lockfiles: keep one",`keep: active lockfile or install ${M}`);return e[0]??"npm"}function rs(t,e,i,s=!1){let r=e==="npm"?["install","--save-exact","--no-audit","--no-fund",...i]:["add",...e==="pnpm"?["--save-exact"]:["--exact"],...i];return new Promise((n,a)=>{let o=dt(...K(e,r,{cwd:t,quiet:s}));o.once("error",t=>a(Yi(`${e}: startup failed`,`install: ${i.join(" ")}`))),o.once("exit",t=>t===0?n():a(Yi(`${e}: exit ${t}`,`install: ${i.join(" ")}`)))})}async function ns({cwd:i,version:s,name:r="rapier-jxl",dryRun:n=!1,quiet:a=!1}){let o=(await S(i,Yi))?.manifest;if(!o)throw Yi("package.json: missing","run: Astro site folder");let h={...o.dependencies,...o.devDependencies};if(!h.astro)throw Yi("astro: dependency missing","run: Astro site folder");let l=(await Promise.all(Gi.map(async t=>await e(ut(i,t)).catch(()=>null)&&t))).filter(Boolean);if(l.length!==1)throw Yi(l.length?`astro.config: multiple (${l.join(", ")})`:"astro.config: missing",l.length?"keep: one":Qi);let p=ut(i,l[0]),c=await t(p,"utf8"),{source:u,changes:d}=is(c),f=ft(ut(i,"package.json")),m=t=>[t,`${t}/package.json`].some(t=>{try{return f.resolve(t)}catch{return!1}}),g=[...B(o,r)?[]:[`${r}@${s}`],...h.sharp||m("sharp")?[]:["sharp"]],x=g.length?await ss(i):null,y=[],b=[];for(let e of zi){let n=U(await t(new URL(`${import.meta.url.includes("/dist/")?"../":"./"}examples/astro/${e}`,import.meta.url),"utf8"),r),a=`// Written by npx ${M} add astro (rapier-jxl ${s}, ${Ji(n)}). Edit freely: add astro then keeps this file.\n${n}`,o=ut(i,Hi,e),h=await t(o,"utf8").catch(()=>null),l=h?.replace(/\r\n/g,`\n`)??null;if(l===a)continue;let p=l?.match(Xi);if(l!==null&&!(p&&Ji(l.slice(p[0].length))===p[1])){b.push(`${Hi}/${e}`);continue}y.push({target:o,text:a,now:h,change:`${h===null?"write":"update"} ${Hi}/${e}`})}let w={config:l[0],changes:[...g.length?[`install ${g.join(" ")} with ${x}`]:[],...y.map(t=>t.change),...d.map(t=>`${l[0]}: ${t}`)],kept:b,dryRun:n},k=new Map(y.map(({target:t,text:e})=>[t.slice(i.length+1).replaceAll("\\","/"),e]));return u!==c&&k.set(l[0],u),await lt(i,"astro",s,k,{dryRun:n,...g.length&&{install:{files:["package.json","package-lock.json","npm-shrinkwrap.json","pnpm-lock.yaml","yarn.lock"],run:()=>rs(i,x,g,a)}}}),w}import{readFile as t,stat as e}from"node:fs/promises";import{lstat as i,mkdir as s,readFile as r,readlink as n,realpath as a,rename as o,rm as h,writeFile as l}from"node:fs/promises";import{randomBytes as p}from"node:crypto";import{basename as c,dirname as u,isAbsolute as d,join as f,relative as m,resolve as g,sep as x}from"node:path";var y=t=>process.platform==="win32"?t.toLowerCase():t,b=(t,e)=>{let i=m(y(t),y(e));return i===""||i!==".."&&!i.startsWith(".."+x)&&!d(i)},w=/^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\..*)?$/i;import{readFile as v,stat as E,rm as A,rmdir as I,chmod as P}from"node:fs/promises";import{dirname as N,join as T,sep as V}from"node:path";import{createHash as L}from"node:crypto";var R=(t,e,i)=>Object.assign(new Error(`${e}; ${i}`),{code:t,fix:i});import{readFile as j}from"node:fs/promises";var D=["jpegxl","rapier-jxl"],M=D[0];var B=(t,e)=>!!(t?.dependencies?.[e]||t?.devDependencies?.[e]),U=(t,e)=>t.replace(/\b(from\s*|import\s*\(\s*|import\s+|require(?:\.resolve)?\s*\(\s*|module:\s*)(['"])(?:jpegxl|rapier-jxl)(?=[/'"])/g,`$1$2${e}`);import{stat as $}from"node:fs/promises";import{dirname as F,join as q}from"node:path";var W=[["package-lock.json","npm"],["npm-shrinkwrap.json","npm"],["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["bun.lock","bun"],["bun.lockb","bun"]],G=["package.json",...W.map(([t])=>t)];var Q=t=>t==="emdash"?".rapier-jxl-emdash.json":".rapier-jxl-add.json",J=t=>L("sha256").update(t).digest("hex"),X=t=>R("JXL_SETUP",t,"restore the files recorded by add, then try again"),Y=t=>v(t).catch(t=>{if(t.code==="ENOENT")return null;throw t}),Z=t=>t===null?null:J(t),tt=(t,e)=>Z(t)===e||t!==null&&J(Buffer.from(t.toString("latin1").replace(/\r\n/g,`\n`),"latin1"))===e,et=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),it=(t,e)=>e.map(e=>t+".config."+e),st=["rapier-jxl-files.mjs"],rt=[...st,"rapier-jxl-vite.mjs","rapier-jxl-vite.d.mts","rapier-jxl-images.d.ts","src/rapier-jxl-images.d.ts"],nt={vite:[...rt,...it("vite",["ts","mts","js","mjs"])],sveltekit:[...rt,...it("vite",["ts","mts","js","mjs"])],nuxt:[...rt,...it("nuxt",["ts","mts","js","mjs"])],webpack:[...st,"rapier-jxl-webpack.mjs","rapier-jxl-webpack.d.mts",...["webpack","rspack"].flatMap(t=>it(t,["js","mjs","cjs","ts"]))],next:[...st,"rapier-jxl-next.mjs","rapier-jxl-next-proxy.mjs","rapier-jxl-next-loader.mjs","package.json",".gitignore",...["","src/"].flatMap(t=>["proxy","middleware"].flatMap(e=>["js","mjs","ts"].map(i=>t+e+"."+i)))],netlify:["netlify.toml",...["index.mjs","edge.mjs","manifest.yml","package.json","rapier-jxl-files.mjs"].map(t=>"netlify/plugins/rapier-jxl/"+t)],astro:[...it("astro",["mjs","js","ts","mts","cjs","cts"]),"src/jxl/service.mjs","src/jxl/service-workers.mjs","src/jxl/index.mjs","src/jxl/options.mjs","package.json","package-lock.json","npm-shrinkwrap.json","pnpm-lock.yaml","yarn.lock"],workers:["jxl-worker.mjs","wrangler.json","wrangler.jsonc","wrangler.toml","package.json"],emdash:["astro.config.mjs","wrangler.json","wrangler.jsonc",...G]},at=(t,e)=>Object.hasOwn(nt,t)&&nt[t].includes(e),ot=(t,e)=>typeof e=="string"&&nt[t]?.some(t=>t.startsWith(e+"/"));import{createHash as ct}from"node:crypto";import{join as ut}from"node:path";import{spawn as dt}from"node:child_process";import{createRequire as ft}from"node:module";import*as mt from"node:module";var gt=Object.defineProperty,xt=(t,e)=>{for(var i in e)gt(t,i,{get:e[i],enumerable:!0})},yt={};xt(yt,{Node:()=>Me,Parser:()=>de,Position:()=>Zt,SourceLocation:()=>te,TokContext:()=>Ie,Token:()=>Ti,TokenType:()=>Vt,defaultOptions:()=>ie,getLineInfo:()=>ee,isIdentifierChar:()=>Tt,isIdentifierStart:()=>Nt,isNewLine:()=>$t,keywordTypes:()=>jt,lineBreak:()=>Bt,lineBreakG:()=>Ut,nonASCIIwhitespace:()=>qt,parse:()=>Di,parseExpressionAt:()=>Mi,tokContexts:()=>Pe,tokTypes:()=>Mt,tokenizer:()=>Bi,version:()=>ji});var bt=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,31,4,33,15,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,7,0,259,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,481,1,61,4,4,5,9,7,3,6,31,3,149,2,12,2,9,1,3,0,33,1,1357,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],wt=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,13,65,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,18,21,18,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,18,0,182,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,22,0,239,18,16,0,2,12,2,33,125,0,80,921,103,111,6,206,13,310,2314,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7386,37,33,96,114,14,913,15,50,7710,3,2,6,2,1,2,296,10,0,30,2,3,0,15,4,8,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,340,2,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,129,15,6,55,50,49,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4382,2,5773,3,7472,16,621,2467,541,1507,4938,6,8489,39815,11327],kt="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄ-׉ؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୓-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫰ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",_t="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆ՘ՙՠ-ֈ֋֌א-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿ₏-₟ℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-꟝꟢꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩ꭬꭭ꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",St={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"},Ct="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",vt={5:Ct,"5module":Ct+" export import",6:Ct+" const class extends export import super"},Et=/^in(stanceof)?$/,At=new RegExp("["+_t+"]"),It=new RegExp("["+_t+kt+"]");var Vt=class{constructor(t,e={}){this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop||null,this.updateContext=null}};var Rt={beforeExpr:!0},Ot={startsExpr:!0},jt={};var Mt={num:new Vt("num",Ot),regexp:new Vt("regexp",Ot),string:new Vt("string",Ot),name:new Vt("name",Ot),privateId:new Vt("privateId",Ot),eof:new Vt("eof"),bracketL:new Vt("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new Vt("]"),braceL:new Vt("{",{beforeExpr:!0,startsExpr:!0}),braceR:new Vt("}"),parenL:new Vt("(",{beforeExpr:!0,startsExpr:!0}),parenR:new Vt(")"),comma:new Vt(",",Rt),semi:new Vt(";",Rt),colon:new Vt(":",Rt),dot:new Vt("."),question:new Vt("?",Rt),questionDot:new Vt("?."),arrow:new Vt("=>",Rt),template:new Vt("template"),invalidTemplate:new Vt("invalidTemplate"),ellipsis:new Vt("...",Rt),backQuote:new Vt("`",Ot),dollarBraceL:new Vt("${",{beforeExpr:!0,startsExpr:!0}),eq:new Vt("=",{beforeExpr:!0,isAssign:!0}),assign:new Vt("_=",{beforeExpr:!0,isAssign:!0}),incDec:new Vt("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new Vt("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:Lt("||",1),logicalAND:Lt("&&",2),bitwiseOR:Lt("|",3),bitwiseXOR:Lt("^",4),bitwiseAND:Lt("&",5),equality:Lt("==/!=/===/!==",6),relational:Lt("</>/<=/>=",7),bitShift:Lt("<</>>/>>>",8),plusMin:new Vt("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:Lt("%",10),star:Lt("*",10),slash:Lt("/",10),starstar:new Vt("**",{beforeExpr:!0}),coalesce:Lt("??",1),_break:Dt("break"),_case:Dt("case",Rt),_catch:Dt("catch"),_continue:Dt("continue"),_debugger:Dt("debugger"),_default:Dt("default",Rt),_do:Dt("do",{isLoop:!0,beforeExpr:!0}),_else:Dt("else",Rt),_finally:Dt("finally"),_for:Dt("for",{isLoop:!0}),_function:Dt("function",Ot),_if:Dt("if"),_return:Dt("return",Rt),_switch:Dt("switch"),_throw:Dt("throw",Rt),_try:Dt("try"),_var:Dt("var"),_const:Dt("const"),_while:Dt("while",{isLoop:!0}),_with:Dt("with"),_new:Dt("new",{beforeExpr:!0,startsExpr:!0}),_this:Dt("this",Ot),_super:Dt("super",Ot),_class:Dt("class",Ot),_extends:Dt("extends",Rt),_export:Dt("export"),_import:Dt("import",Ot),_null:Dt("null",Ot),_true:Dt("true",Ot),_false:Dt("false",Ot),_in:Dt("in",{beforeExpr:!0,binop:7}),_instanceof:Dt("instanceof",{beforeExpr:!0,binop:7}),_typeof:Dt("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:Dt("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:Dt("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Bt=/\r\n?|\n|\u2028|\u2029/,Ut=new RegExp(Bt.source,"g");var qt=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Wt=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,{hasOwnProperty:Gt,toString:Ht}=Object.prototype,zt=Object.hasOwn,Kt=Array.isArray,Qt=Object.create(null);var Yt=/[\uD800-\uDFFF]/u,Zt=class t{constructor(t,e){this.line=t,this.column=e}offset(e){return new t(this.line,this.column+e)}},te=class{constructor(t,e,i){this.start=e,this.end=i,t.sourceFile!==null&&(this.source=t.sourceFile)}};var ie={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},se=!1;var oe=0,he=1,le=2,pe=3,ce=4,ue=5,de=class{constructor(t,e,i){this.options=t=re(t),this.sourceFile=t.sourceFile,this.keywords=Jt(vt[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);let s="";t.allowReserved!==!0&&(s=St[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(s+=" await")),this.reservedWords=Jt(s);let r=(s?s+" ":"")+St.strict;this.reservedWordsStrict=Jt(r),this.reservedWordsStrictBind=Jt(r+" "+St.strictBind),this.input=String(e),this.containsEsc=!1,this.pos=i||0,this.curLine=1,t.startLocation?(this.lineStart=this.pos-t.startLocation.column,this.curLine=t.startLocation.line):i?(this.lineStart=this.input.lastIndexOf(`\n`,i-1)+1,this.options.locations&&(this.curLine=this.input.slice(0,this.lineStart).split(Bt).length)):this.lineStart=0,this.type=Mt.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=t.sourceType==="module",this.strict=this.inModule||t.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&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?2:1),this.regexpState=null,this.privateNameStack=[]}parse(){let t=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(()=>this.parseTopLevel(t))}get inFunction(){return(this.currentVarScope().flags&2)>0}get inGenerator(){return(this.currentVarScope().flags&8)>0}get inAsync(){return(this.currentVarScope().flags&4)>0}get canAwait(){for(let t=this.scopeStack.length-1;t>=0;t--){let{flags:e}=this.scopeStack[t];if(e&768)return!1;if(e&2)return(e&4)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction}get allowReturn(){return!!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&1)}get allowSuper(){let{flags:t}=this.currentThisScope();return(t&64)>0||this.options.allowSuperOutsideMethod}get allowDirectSuper(){return(this.currentThisScope().flags&128)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}get allowNewDotTarget(){for(let t=this.scopeStack.length-1;t>=0;t--){let{flags:e}=this.scopeStack[t];if(e&768||e&2&&!(e&16))return!0}return!1}get allowUsing(){let{flags:t}=this.currentScope();return!(t&1024||!this.inModule&&t&1)}get inClassStaticBlock(){return(this.currentVarScope().flags&256)>0}static extend(...t){let e=this;for(let i=0;i<t.length;i++)e=t[i](e);return e}static parse(t,e){return new this(e,t).parse()}static parseExpressionAt(t,e,i){let s=new this(i,t,e);return s.nextToken(),s.parseExpression()}static tokenizer(t,e){return new this(e,t)}},fe=de.prototype,me=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;fe.strictDirective=function(t){if(this.options.ecmaVersion<5)return!1;for(;;){Wt.lastIndex=t,t+=Wt.exec(this.input)[0].length;let e=me.exec(this.input.slice(t));if(!e)return!1;if((e[1]||e[2])==="use strict"){Wt.lastIndex=t+e[0].length;let i=Wt.exec(this.input),s=i.index+i[0].length,r=this.input.charAt(s);return r===";"||r==="}"||Bt.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(r)||r==="!"&&this.input.charAt(s+1)==="="||r==="i"&&ge(this,s))}t+=e[0].length,Wt.lastIndex=t,t+=Wt.exec(this.input)[0].length,this.input[t]===";"&&t++}};fe.eat=function(t){return this.type===t?(this.next(),!0):!1};fe.isContextual=function(t){return this.type===Mt.name&&this.value===t&&!this.containsEsc};fe.eatContextual=function(t){return this.isContextual(t)?(this.next(),!0):!1};fe.catchStackOverflow=function(t){try{return t()}catch(t){if(t instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(t.message)||/\btoo much recursion\b/i.test(t.message)))this.raise(this.start,"Not enough stack space to parse input");else throw t}};fe.expectContextual=function(t){this.eatContextual(t)||this.unexpected()};fe.canInsertSemicolon=function(){return this.type===Mt.eof||this.type===Mt.braceR||Bt.test(this.input.slice(this.lastTokEnd,this.start))};fe.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};fe.semicolon=function(){!this.eat(Mt.semi)&&!this.insertSemicolon()&&this.unexpected()};fe.afterTrailingComma=function(t,e){if(this.type===t)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),e||this.next(),!0};fe.expect=function(t){this.eat(t)||this.unexpected()};fe.unexpected=function(t){this.raise(t??this.start,"Unexpected token")};var xe=class{constructor(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}};fe.checkPatternErrors=function(t,e){if(!t)return;t.trailingComma>-1&&this.raiseRecoverable(t.trailingComma,"Comma is not permitted after the rest element");let i=e?t.parenthesizedAssign:t.parenthesizedBind;i>-1&&this.raiseRecoverable(i,e?"Assigning to rvalue":"Parenthesized pattern")};fe.checkExpressionErrors=function(t,e){if(!t)return!1;let{shorthandAssign:i,doubleProto:s}=t;if(!e)return i>=0||s>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),s>=0&&this.raiseRecoverable(s,"Redefinition of __proto__ property")};fe.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")};fe.isSimpleAssignTarget=function(t){return t.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(t.expression):t.type==="Identifier"||t.type==="MemberExpression"};var ye=de.prototype;ye.parseTopLevel=function(t){let e=Object.create(null);for(t.body||(t.body=[]);this.type!==Mt.eof;){let i=this.parseStatement(null,!0,e);t.body.push(i)}if(this.inModule)for(let t of Object.keys(this.undefinedExports))this.raiseRecoverable(this.undefinedExports[t].start,`Export '${t}' is not defined`);return this.adaptDirectivePrologue(t.body),this.next(),t.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(t,"Program")};var be={kind:"loop"},we={kind:"switch"};ye.isLet=function(t){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;Wt.lastIndex=this.pos;let e=Wt.exec(this.input),i=this.pos+e[0].length,s=this.fullCharCodeAt(i);if(s===91||s===92)return!0;if(t)return!1;if(s===123)return!0;if(Nt(s)){let t=i;do{i+=s<=65535?1:2}while(Tt(s=this.fullCharCodeAt(i)));if(s===92)return!0;let e=this.input.slice(t,i);if(!Et.test(e))return!0}return!1};ye.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;Wt.lastIndex=this.pos;let t=Wt.exec(this.input),e=this.pos+t[0].length,i;return!Bt.test(this.input.slice(this.pos,e))&&this.input.slice(e,e+8)==="function"&&(e+8===this.input.length||!(Tt(i=this.fullCharCodeAt(e+8))||i===92))};ye.isUsingKeyword=function(t,e){if(this.options.ecmaVersion<17||!this.isContextual(t?"await":"using"))return!1;Wt.lastIndex=this.pos;let i=Wt.exec(this.input),s=this.pos+i[0].length;if(Bt.test(this.input.slice(this.pos,s)))return!1;if(t){let t=s+5,e;if(this.input.slice(s,t)!=="using"||t===this.input.length||Tt(e=this.fullCharCodeAt(t))||e===92)return!1;Wt.lastIndex=t;let i=Wt.exec(this.input);if(s=t+i[0].length,i&&Bt.test(this.input.slice(t,s)))return!1}let r=this.fullCharCodeAt(s);if(!Nt(r)&&r!==92)return!1;let n=s;do{s+=r<=65535?1:2}while(Tt(r=this.fullCharCodeAt(s)));if(r===92)return!0;let a=this.input.slice(n,s);if(Et.test(a))return!1;if(e&&!t&&a==="of"){Wt.lastIndex=s;let t=Wt.exec(this.input);if(s=s+t[0].length,this.input.charCodeAt(s)!==61||(r=this.input.charCodeAt(s+1))===61||r===62)return!1}return!0};ye.isAwaitUsing=function(t){return this.isUsingKeyword(!0,t)};ye.isUsing=function(t){return this.isUsingKeyword(!1,t)};ye.parseStatement=function(t,e,i){let s=this.type,r=this.startNode(),n;switch(this.isLet(t)&&(s=Mt._var,n="let"),s){case Mt._break:case Mt._continue:return this.parseBreakContinueStatement(r,s.keyword);case Mt._debugger:return this.parseDebuggerStatement(r);case Mt._do:return this.parseDoStatement(r);case Mt._for:return this.parseForStatement(r);case Mt._function:return t&&(this.strict||t!=="if"&&t!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(r,!1,!t);case Mt._class:return t&&this.unexpected(),this.parseClass(r,!0);case Mt._if:return this.parseIfStatement(r);case Mt._return:return this.parseReturnStatement(r);case Mt._switch:return this.parseSwitchStatement(r);case Mt._throw:return this.parseThrowStatement(r);case Mt._try:return this.parseTryStatement(r);case Mt._const:case Mt._var:return n=n||this.value,t&&n!=="var"&&this.unexpected(),this.parseVarStatement(r,n);case Mt._while:return this.parseWhileStatement(r);case Mt._with:return this.parseWithStatement(r);case Mt.braceL:return this.parseBlock(!0,r);case Mt.semi:return this.parseEmptyStatement(r);case Mt._export:case Mt._import:if(this.options.ecmaVersion>10&&s===Mt._import){Wt.lastIndex=this.pos;let t=Wt.exec(this.input),e=this.pos+t[0].length,i=this.input.charCodeAt(e);if(i===40||i===46)return this.parseExpressionStatement(r,this.parseExpression())}return this.options.allowImportExportEverywhere||(e||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),s===Mt._import?this.parseImport(r):this.parseExport(r,i);default:if(this.isAsyncFunction())return t&&this.unexpected(),this.next(),this.parseFunctionStatement(r,!0,!t);let a=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(a)return 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"),t&&this.raise(this.start,"Using declaration is not allowed in single-statement positions"),a==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(r,!1,a),this.semicolon(),this.finishNode(r,"VariableDeclaration");let o=this.value,h=this.parseExpression();return s===Mt.name&&h.type==="Identifier"&&this.eat(Mt.colon)?this.parseLabeledStatement(r,o,h,t):this.parseExpressionStatement(r,h)}};ye.parseBreakContinueStatement=function(t,e){let i=e==="break";this.next(),this.eat(Mt.semi)||this.insertSemicolon()?t.label=null:this.type!==Mt.name?this.unexpected():(t.label=this.parseIdent(),this.semicolon());let s=0;for(;s<this.labels.length;++s){let e=this.labels[s];if((t.label==null||e.name===t.label.name)&&(e.kind!=null&&(i||e.kind==="loop")||t.label&&i))break}return s===this.labels.length&&this.raise(t.start,"Unsyntactic "+e),this.finishNode(t,i?"BreakStatement":"ContinueStatement")};ye.parseDebuggerStatement=function(t){return this.next(),this.semicolon(),this.finishNode(t,"DebuggerStatement")};ye.parseDoStatement=function(t){return this.next(),this.labels.push(be),t.body=this.parseStatement("do"),this.labels.pop(),this.expect(Mt._while),t.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(Mt.semi):this.semicolon(),this.finishNode(t,"DoWhileStatement")};ye.parseForStatement=function(t){this.next();let e=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(be),this.enterScope(0),this.expect(Mt.parenL),this.type===Mt.semi)return e>-1&&this.unexpected(e),this.parseFor(t,null);let i=this.isLet();if(this.type===Mt._var||this.type===Mt._const||i){let s=this.startNode(),r=i?"let":this.value;return this.next(),this.parseVar(s,!0,r),this.finishNode(s,"VariableDeclaration"),this.parseForAfterInit(t,s,e)}let s=this.isContextual("let"),r=!1,n=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(n){let i=this.startNode();return this.next(),n==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.parseVar(i,!0,n),this.finishNode(i,"VariableDeclaration"),this.parseForAfterInit(t,i,e)}let a=this.containsEsc,o=new xe,h=this.start,l=e>-1?this.parseExprSubscripts(o,"await"):this.parseExpression(!0,o);return this.type===Mt._in||(r=this.options.ecmaVersion>=6&&this.isContextual("of"))?(e>-1?(this.type===Mt._in&&this.unexpected(e),t.await=!0):r&&this.options.ecmaVersion>=8&&(l.start===h&&!a&&l.type==="Identifier"&&l.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(t.await=!1)),s&&r&&this.raise(l.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(l,!1,o),this.checkLValPattern(l),this.parseForIn(t,l)):(this.checkExpressionErrors(o,!0),e>-1&&this.unexpected(e),this.parseFor(t,l))};ye.parseForAfterInit=function(t,e,i){return(this.type===Mt._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&e.declarations.length===1?(this.type===Mt._in?((e.kind==="using"||e.kind==="await using")&&!e.declarations[0].init&&this.raise(this.start,"Using declaration is not allowed in for-in loops"),this.options.ecmaVersion>=9&&i>-1&&this.unexpected(i)):this.options.ecmaVersion>=9&&(t.await=i>-1),this.parseForIn(t,e)):(i>-1&&this.unexpected(i),this.parseFor(t,e))};ye.parseFunctionStatement=function(t,e,i){return this.next(),this.parseFunction(t,_e|(i?0:Se),!1,e)};ye.parseIfStatement=function(t){return this.next(),t.test=this.parseParenExpression(),t.consequent=this.parseStatement("if"),t.alternate=this.eat(Mt._else)?this.parseStatement("if"):null,this.finishNode(t,"IfStatement")};ye.parseReturnStatement=function(t){return this.allowReturn||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(Mt.semi)||this.insertSemicolon()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")};ye.parseSwitchStatement=function(t){this.next(),t.discriminant=this.parseParenExpression(),t.cases=[],this.expect(Mt.braceL),this.labels.push(we),this.enterScope(1024);let e;for(let i=!1;this.type!==Mt.braceR;)if(this.type===Mt._case||this.type===Mt._default){let s=this.type===Mt._case;e&&this.finishNode(e,"SwitchCase"),t.cases.push(e=this.startNode()),e.consequent=[],this.next(),s?e.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,e.test=null),this.expect(Mt.colon)}else e||this.unexpected(),e.consequent.push(this.parseStatement(null));return this.exitScope(),e&&this.finishNode(e,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(t,"SwitchStatement")};ye.parseThrowStatement=function(t){return this.next(),Bt.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")};var ke=[];ye.parseCatchClauseParam=function(){let t=this.parseBindingAtom(),e=t.type==="Identifier";return this.enterScope(e?32:0),this.checkLValPattern(t,e?ce:le),this.expect(Mt.parenR),t};ye.parseTryStatement=function(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.type===Mt._catch){let e=this.startNode();this.next(),this.eat(Mt.parenL)?e.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),e.param=null,this.enterScope(0)),e.body=this.parseBlock(!1),this.exitScope(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(Mt._finally)?this.parseBlock():null,!t.handler&&!t.finalizer&&this.raise(t.start,"Missing catch or finally clause"),this.finishNode(t,"TryStatement")};ye.parseVarStatement=function(t,e,i){return this.next(),this.parseVar(t,!1,e,i),this.semicolon(),this.finishNode(t,"VariableDeclaration")};ye.parseWhileStatement=function(t){return this.next(),t.test=this.parseParenExpression(),this.labels.push(be),t.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(t,"WhileStatement")};ye.parseWithStatement=function(t){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),t.object=this.parseParenExpression(),t.body=this.parseStatement("with"),this.finishNode(t,"WithStatement")};ye.parseEmptyStatement=function(t){return this.next(),this.finishNode(t,"EmptyStatement")};ye.parseLabeledStatement=function(t,e,i,s){for(let t of this.labels)t.name===e&&this.raise(i.start,"Label '"+e+"' is already declared");let r=this.type.isLoop?"loop":this.type===Mt._switch?"switch":null;for(let e=this.labels.length-1;e>=0;e--){let i=this.labels[e];if(i.statementStart===t.start)i.statementStart=this.start,i.kind=r;else break}return this.labels.push({name:e,kind:r,statementStart:this.start}),t.body=this.parseStatement(s?s.indexOf("label")===-1?s+"label":s:"label"),this.labels.pop(),t.label=i,this.finishNode(t,"LabeledStatement")};ye.parseExpressionStatement=function(t,e){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")};ye.parseBlock=function(t=!0,e=this.startNode(),i){for(e.body=[],this.expect(Mt.braceL),t&&this.enterScope(0);this.type!==Mt.braceR;){let t=this.parseStatement(null);e.body.push(t)}return i&&(this.strict=!1),this.next(),t&&this.exitScope(),this.finishNode(e,"BlockStatement")};ye.parseFor=function(t,e){return t.init=e,this.expect(Mt.semi),t.test=this.type===Mt.semi?null:this.parseExpression(),this.expect(Mt.semi),t.update=this.type===Mt.parenR?null:this.parseExpression(),this.expect(Mt.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,"ForStatement")};ye.parseForIn=function(t,e){let i=this.type===Mt._in;return this.next(),e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(e.start,`${i?"for-in":"for-of"} loop variable declaration may not have an initializer`),t.left=e,t.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(Mt.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,i?"ForInStatement":"ForOfStatement")};ye.parseVar=function(t,e,i,s){for(t.declarations=[],t.kind=i;;){let r=this.startNode();if(this.parseVarId(r,i),this.eat(Mt.eq)?r.init=this.parseMaybeAssign(e):!s&&i==="const"&&!(this.type===Mt._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!s&&(i==="using"||i==="await using")&&this.options.ecmaVersion>=17&&this.type!==Mt._in&&!this.isContextual("of")?this.raise(this.lastTokEnd,`Missing initializer in ${i} declaration`):!s&&r.id.type!=="Identifier"&&!(e&&(this.type===Mt._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):r.init=null,t.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(Mt.comma))break}return t};ye.parseVarId=function(t,e){t.id=e==="using"||e==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(t.id,e==="var"?he:le,!1)};var _e=1,Se=2,Ce=4;ye.parseFunction=function(t,e,i,s,r){this.initFunction(t),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s)&&(this.type===Mt.star&&e&Se&&this.unexpected(),t.generator=this.eat(Mt.star)),this.options.ecmaVersion>=8&&(t.async=!!s),e&_e&&(t.id=e&Ce&&this.type!==Mt.name?null:this.parseIdent(),t.id&&!(e&Se)&&this.checkLValSimple(t.id,this.strict||t.generator||t.async?this.treatFunctionsAsVar?he:le:pe));let n=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ae(t.async,t.generator)),e&_e||(t.id=this.type===Mt.name?this.parseIdent():null),this.parseFunctionParams(t),this.parseFunctionBody(t,i,!1,r),this.yieldPos=n,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(t,e&_e?"FunctionDeclaration":"FunctionExpression")};ye.parseFunctionParams=function(t){this.expect(Mt.parenL),t.params=this.parseBindingList(Mt.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};ye.parseClass=function(t,e){this.next();let i=this.strict;this.strict=!0,this.parseClassId(t,e),this.parseClassSuper(t);let s=this.enterClassBody(),r=this.startNode(),n=!1;for(r.body=[],this.expect(Mt.braceL);this.type!==Mt.braceR;){let e=this.parseClassElement(t.superClass!==null);e&&(r.body.push(e),e.type==="MethodDefinition"&&e.kind==="constructor"?(n&&this.raiseRecoverable(e.start,"Duplicate constructor in the same class"),n=!0):e.key&&e.key.type==="PrivateIdentifier"&&ve(s,e)&&this.raiseRecoverable(e.key.start,`Identifier '#${e.key.name}' has already been declared`))}return this.strict=i,this.next(),t.body=this.finishNode(r,"ClassBody"),this.exitClassBody(),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")};ye.parseClassElement=function(t){if(this.eat(Mt.semi))return null;let e=this.options.ecmaVersion,i=this.startNode(),s="",r=!1,n=!1,a="method",o=!1;if(this.eatContextual("static")){if(e>=13&&this.eat(Mt.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===Mt.star?o=!0:s="static"}if(i.static=o,!s&&e>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===Mt.star)&&!this.canInsertSemicolon()?n=!0:s="async"),!s&&(e>=9||!n)&&this.eat(Mt.star)&&(r=!0),!s&&!n&&!r){let t=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?a=t:s=t)}if(s?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=s,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),e<13||this.type===Mt.parenL||a!=="method"||r||n){let e=!i.static&&Ee(i,"constructor"),s=e&&t;e&&a!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=e?"constructor":a,this.parseClassMethod(i,r,n,s)}else this.parseClassField(i);return i};ye.isClassElementNameStart=function(){return this.type===Mt.name||this.type===Mt.privateId||this.type===Mt.num||this.type===Mt.string||this.type===Mt.bracketL||this.type.keyword};ye.parseClassElementName=function(t){this.type===Mt.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),t.computed=!1,t.key=this.parsePrivateIdent()):this.parsePropertyName(t)};ye.parseClassMethod=function(t,e,i,s){let r=t.key;t.kind==="constructor"?(e&&this.raise(r.start,"Constructor can't be a generator"),i&&this.raise(r.start,"Constructor can't be an async method")):t.static&&Ee(t,"prototype")&&this.raise(r.start,"Classes may not have a static property named prototype");let n=t.value=this.parseMethod(e,i,s);return t.kind==="get"&&n.params.length!==0&&this.raiseRecoverable(n.start,"getter should have no params"),t.kind==="set"&&n.params.length!==1&&this.raiseRecoverable(n.start,"setter should have exactly one param"),t.kind==="set"&&n.params[0].type==="RestElement"&&this.raiseRecoverable(n.params[0].start,"Setter cannot use rest params"),this.finishNode(t,"MethodDefinition")};ye.parseClassField=function(t){return Ee(t,"constructor")?this.raise(t.key.start,"Classes can't have a field named 'constructor'"):t.static&&Ee(t,"prototype")&&this.raise(t.key.start,"Classes can't have a static field named 'prototype'"),this.eat(Mt.eq)?(this.enterScope(576),t.value=this.parseMaybeAssign(),this.exitScope()):t.value=null,this.semicolon(),this.finishNode(t,"PropertyDefinition")};ye.parseClassStaticBlock=function(t){t.body=[];let e=this.labels;for(this.labels=[],this.enterScope(320);this.type!==Mt.braceR;){let e=this.parseStatement(null);t.body.push(e)}return this.next(),this.exitScope(),this.labels=e,this.finishNode(t,"StaticBlock")};ye.parseClassId=function(t,e){this.type===Mt.name?(t.id=this.parseIdent(),e&&this.checkLValSimple(t.id,le,!1)):(e===!0&&this.unexpected(),t.id=null)};ye.parseClassSuper=function(t){t.superClass=this.eat(Mt._extends)?this.parseExprSubscripts(null,!1):null};ye.enterClassBody=function(){let t={declared:Object.create(null),used:[]};return this.privateNameStack.push(t),t.declared};ye.exitClassBody=function(){let{declared:t,used:e}=this.privateNameStack.pop();if(!this.options.checkPrivateFields)return;let i=this.privateNameStack.length,s=i===0?null:this.privateNameStack[i-1];for(let i=0;i<e.length;++i){let r=e[i];zt(t,r.name)||(s?s.used.push(r):this.raiseRecoverable(r.start,`Private field '#${r.name}' must be declared in an enclosing class`))}};ye.parseExportAllDeclaration=function(t,e){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(t.exported=this.parseModuleExportName(),this.checkExport(e,t.exported,this.lastTokStart)):t.exported=null),this.expectContextual("from"),this.type!==Mt.string&&this.unexpected(),t.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(t.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(t,"ExportAllDeclaration")};ye.parseExport=function(t,e){if(this.next(),this.eat(Mt.star))return this.parseExportAllDeclaration(t,e);if(this.eat(Mt._default))return this.checkExport(e,"default",this.lastTokStart),t.declaration=this.parseExportDefaultDeclaration(),this.finishNode(t,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())t.declaration=this.parseExportDeclaration(t),t.declaration.type==="VariableDeclaration"?this.checkVariableExport(e,t.declaration.declarations):this.checkExport(e,t.declaration.id,t.declaration.id.start),t.specifiers=[],t.source=null,this.options.ecmaVersion>=16&&(t.attributes=[]);else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))this.type!==Mt.string&&this.unexpected(),t.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(t.attributes=this.parseWithClause());else{for(let e of t.specifiers)this.checkUnreserved(e.local),this.checkLocalExport(e.local),e.local.type==="Literal"&&this.raise(e.local.start,"A string literal cannot be used as an exported binding without `from`.");t.source=null,this.options.ecmaVersion>=16&&(t.attributes=[])}this.semicolon()}return this.finishNode(t,"ExportNamedDeclaration")};ye.parseExportDeclaration=function(t){return this.parseStatement(null)};ye.parseExportDefaultDeclaration=function(){let t;if(this.type===Mt._function||(t=this.isAsyncFunction())){let e=this.startNode();return this.next(),t&&this.next(),this.parseFunction(e,_e|Ce,!1,t)}else if(this.type===Mt._class){let t=this.startNode();return this.parseClass(t,"nullableID")}else{let t=this.parseMaybeAssign();return this.semicolon(),t}};ye.checkExport=function(t,e,i){t&&(typeof e!="string"&&(e=e.type==="Identifier"?e.name:e.value),zt(t,e)&&this.raiseRecoverable(i,"Duplicate export '"+e+"'"),t[e]=!0)};ye.checkPatternExport=function(t,e){let i=e.type;if(i==="Identifier")this.checkExport(t,e,e.start);else if(i==="ObjectPattern")for(let i of e.properties)this.checkPatternExport(t,i);else if(i==="ArrayPattern")for(let i of e.elements)i&&this.checkPatternExport(t,i);else i==="Property"?this.checkPatternExport(t,e.value):i==="AssignmentPattern"?this.checkPatternExport(t,e.left):i==="RestElement"&&this.checkPatternExport(t,e.argument)};ye.checkVariableExport=function(t,e){if(t)for(let i of e)this.checkPatternExport(t,i.id)};ye.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};ye.parseExportSpecifier=function(t){let e=this.startNode();return e.local=this.parseModuleExportName(),e.exported=this.eatContextual("as")?this.parseModuleExportName():e.local,this.checkExport(t,e.exported,e.exported.start),this.finishNode(e,"ExportSpecifier")};ye.parseExportSpecifiers=function(t){let e=[],i=!0;for(this.expect(Mt.braceL);!this.eat(Mt.braceR);){if(i)i=!1;else if(this.expect(Mt.comma),this.afterTrailingComma(Mt.braceR))break;e.push(this.parseExportSpecifier(t))}return e};ye.parseImport=function(t){return this.next(),this.type===Mt.string?(t.specifiers=ke,t.source=this.parseExprAtom()):(t.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),t.source=this.type===Mt.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(t.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(t,"ImportDeclaration")};ye.parseImportSpecifier=function(){let t=this.startNode();return t.imported=this.parseModuleExportName(),this.eatContextual("as")?t.local=this.parseIdent():(this.checkUnreserved(t.imported),t.local=t.imported),this.checkLValSimple(t.local,le),this.finishNode(t,"ImportSpecifier")};ye.parseImportDefaultSpecifier=function(){let t=this.startNode();return t.local=this.parseIdent(),this.checkLValSimple(t.local,le),this.finishNode(t,"ImportDefaultSpecifier")};ye.parseImportNamespaceSpecifier=function(){let t=this.startNode();return this.next(),this.expectContextual("as"),t.local=this.parseIdent(),this.checkLValSimple(t.local,le),this.finishNode(t,"ImportNamespaceSpecifier")};ye.parseImportSpecifiers=function(){let t=[],e=!0;if(this.type===Mt.name&&(t.push(this.parseImportDefaultSpecifier()),!this.eat(Mt.comma)))return t;if(this.type===Mt.star)return t.push(this.parseImportNamespaceSpecifier()),t;for(this.expect(Mt.braceL);!this.eat(Mt.braceR);){if(e)e=!1;else if(this.expect(Mt.comma),this.afterTrailingComma(Mt.braceR))break;t.push(this.parseImportSpecifier())}return t};ye.parseWithClause=function(){let t=[];if(!this.eat(Mt._with))return t;this.expect(Mt.braceL);let e={},i=!0;for(;!this.eat(Mt.braceR);){if(i)i=!1;else if(this.expect(Mt.comma),this.afterTrailingComma(Mt.braceR))break;let s=this.parseImportAttribute(),r=s.key.type==="Identifier"?s.key.name:s.key.value;zt(e,r)&&this.raiseRecoverable(s.key.start,"Duplicate attribute key '"+r+"'"),e[r]=!0,t.push(s)}return t};ye.parseImportAttribute=function(){let t=this.startNode();return t.key=this.type===Mt.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(Mt.colon),this.type!==Mt.string&&this.unexpected(),t.value=this.parseExprAtom(),this.finishNode(t,"ImportAttribute")};ye.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===Mt.string){let t=this.parseLiteral(this.value);return Yt.test(t.value)&&this.raise(t.start,"An export name cannot include a lone surrogate."),t}return this.parseIdent(!0)};ye.adaptDirectivePrologue=function(t){for(let e=0;e<t.length&&this.isDirectiveCandidate(t[e]);++e)t[e].directive=t[e].expression.raw.slice(1,-1)};ye.isDirectiveCandidate=function(t){return this.options.ecmaVersion>=5&&t.type==="ExpressionStatement"&&t.expression.type==="Literal"&&typeof t.expression.value=="string"&&(this.input[t.start]==='"'||this.input[t.start]==="'")};var Ae=de.prototype;Ae.toAssignable=function(t,e,i){if(this.options.ecmaVersion>=6&&t)switch(t.type){case"Identifier":this.inAsync&&t.name==="await"&&this.raise(t.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(let i of t.properties)this.toAssignable(i,e),i.type==="RestElement"&&(i.argument.type==="ArrayPattern"||i.argument.type==="ObjectPattern")&&this.raise(i.argument.start,"Unexpected token");break;case"Property":t.kind!=="init"&&this.raise(t.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(t.value,e);break;case"ArrayExpression":t.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(t.elements,e);break;case"SpreadElement":t.type="RestElement",this.toAssignable(t.argument,e),t.argument.type==="AssignmentPattern"&&this.raise(t.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":t.operator!=="="&&this.raise(t.left.end,"Only '=' operator can be used for specifying default value."),t.type="AssignmentPattern",delete t.operator,this.toAssignable(t.left,e);break;case"ParenthesizedExpression":this.toAssignable(t.expression,e,i);break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!e)break;default:this.raise(t.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return t};Ae.toAssignableList=function(t,e){let i=t.length;for(let s=0;s<i;s++){let i=t[s];i&&this.toAssignable(i,e)}if(i){let s=t[i-1];this.options.ecmaVersion===6&&e&&s&&s.type==="RestElement"&&s.argument.type!=="Identifier"&&this.unexpected(s.argument.start)}return t};Ae.parseSpread=function(t){let e=this.startNode();return this.next(),e.argument=this.parseMaybeAssign(!1,t),this.finishNode(e,"SpreadElement")};Ae.parseRestBinding=function(){let t=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==Mt.name&&this.unexpected(),t.argument=this.parseBindingAtom(),this.finishNode(t,"RestElement")};Ae.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case Mt.bracketL:let t=this.startNode();return this.next(),t.elements=this.parseBindingList(Mt.bracketR,!0,!0),this.finishNode(t,"ArrayPattern");case Mt.braceL:return this.parseObj(!0)}return this.parseIdent()};Ae.parseBindingList=function(t,e,i,s){let r=[],n=!0;for(;!this.eat(t);)if(n?n=!1:this.expect(Mt.comma),e&&this.type===Mt.comma)r.push(null);else{if(i&&this.afterTrailingComma(t))break;if(this.type===Mt.ellipsis){let e=this.parseRestBinding();this.parseBindingListItem(e),r.push(e),this.type===Mt.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(t);break}else r.push(this.parseAssignableListItem(s))}return r};Ae.parseAssignableListItem=function(t){let e=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(e),e};Ae.parseBindingListItem=function(t){return t};Ae.parseMaybeDefault=function(t,e,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(Mt.eq))return i;let s=this.startNodeAt(t,e);return s.left=i,s.right=this.parseMaybeAssign(),this.finishNode(s,"AssignmentPattern")};Ae.checkLValSimple=function(t,e=oe,i){let s=e!==oe;switch(t.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(t.name)&&this.raiseRecoverable(t.start,(s?"Binding ":"Assigning to ")+t.name+" in strict mode"),s&&(e===le&&t.name==="let"&&this.raiseRecoverable(t.start,"let is disallowed as a lexically bound name"),i&&(zt(i,t.name)&&this.raiseRecoverable(t.start,"Argument name clash"),i[t.name]=!0),e!==ue&&this.declareName(t.name,e,t.start));break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":s&&this.raiseRecoverable(t.start,"Binding member expression");break;case"ParenthesizedExpression":return s&&this.raiseRecoverable(t.start,"Binding parenthesized expression"),this.checkLValSimple(t.expression,e,i);default:this.raise(t.start,(s?"Binding":"Assigning to")+" rvalue")}};Ae.checkLValPattern=function(t,e=oe,i){switch(t.type){case"ObjectPattern":for(let s of t.properties)this.checkLValInnerPattern(s,e,i);break;case"ArrayPattern":for(let s of t.elements)s&&this.checkLValInnerPattern(s,e,i);break;default:this.checkLValSimple(t,e,i)}};Ae.checkLValInnerPattern=function(t,e=oe,i){switch(t.type){case"Property":this.checkLValInnerPattern(t.value,e,i);break;case"AssignmentPattern":this.checkLValPattern(t.left,e,i);break;case"RestElement":this.checkLValPattern(t.argument,e,i);break;default:this.checkLValPattern(t,e,i)}};var Ie=class{constructor(t,e,i,s,r){this.token=t,this.isExpr=!!e,this.preserveSpace=!!i,this.override=s,this.generator=!!r}},Pe={b_stat:new Ie("{",!1),b_expr:new Ie("{",!0),b_tmpl:new Ie("${",!1),p_stat:new Ie("(",!1),p_expr:new Ie("(",!0),q_tmpl:new Ie("`",!0,!0,t=>t.tryReadTemplateToken()),f_stat:new Ie("function",!1),f_expr:new Ie("function",!0),f_expr_gen:new Ie("function",!0,!1,null,!0),f_gen:new Ie("function",!1,!1,null,!0)},Ne=de.prototype;Ne.initialContext=function(){return[Pe.b_stat]};Ne.curContext=function(){return this.context[this.context.length-1]};Ne.braceIsBlock=function(t){let e=this.curContext();return e===Pe.f_expr||e===Pe.f_stat?!0:t===Mt.colon&&(e===Pe.b_stat||e===Pe.b_expr)?!e.isExpr:t===Mt._return||t===Mt.name&&this.exprAllowed?Bt.test(this.input.slice(this.lastTokEnd,this.start)):t===Mt._else||t===Mt.semi||t===Mt.eof||t===Mt.parenR||t===Mt.arrow?!0:t===Mt.braceL?e===Pe.b_stat:t===Mt._var||t===Mt._const||t===Mt.name?!1:!this.exprAllowed};Ne.inGeneratorContext=function(){for(let t=this.context.length-1;t>=1;t--){let e=this.context[t];if(e.token==="function")return e.generator}return!1};Ne.updateContext=function(t){let e,i=this.type;i.keyword&&t===Mt.dot?this.exprAllowed=!1:(e=i.updateContext)?e.call(this,t):this.exprAllowed=i.beforeExpr};Ne.overrideContext=function(t){this.curContext()!==t&&(this.context[this.context.length-1]=t)};Mt.parenR.updateContext=Mt.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}let t=this.context.pop();t===Pe.b_stat&&this.curContext().token==="function"&&(t=this.context.pop()),this.exprAllowed=!t.isExpr};Mt.braceL.updateContext=function(t){this.context.push(this.braceIsBlock(t)?Pe.b_stat:Pe.b_expr),this.exprAllowed=!0};Mt.dollarBraceL.updateContext=function(){this.context.push(Pe.b_tmpl),this.exprAllowed=!0};Mt.parenL.updateContext=function(t){let e=t===Mt._if||t===Mt._for||t===Mt._with||t===Mt._while;this.context.push(e?Pe.p_stat:Pe.p_expr),this.exprAllowed=!0};Mt.incDec.updateContext=function(){};Mt._function.updateContext=Mt._class.updateContext=function(t){t.beforeExpr&&t!==Mt._else&&!(t===Mt.semi&&this.curContext()!==Pe.p_stat)&&!(t===Mt._return&&Bt.test(this.input.slice(this.lastTokEnd,this.start)))&&!((t===Mt.colon||t===Mt.braceL)&&this.curContext()===Pe.b_stat)?this.context.push(Pe.f_expr):this.context.push(Pe.f_stat),this.exprAllowed=!1};Mt.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0};Mt.backQuote.updateContext=function(){this.curContext()===Pe.q_tmpl?this.context.pop():this.context.push(Pe.q_tmpl),this.exprAllowed=!1};Mt.star.updateContext=function(t){if(t===Mt._function){let t=this.context.length-1;this.context[t]===Pe.f_expr?this.context[t]=Pe.f_expr_gen:this.context[t]=Pe.f_gen}this.exprAllowed=!0};Mt.name.updateContext=function(t){let e=!1;this.options.ecmaVersion>=6&&t!==Mt.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(e=!0),this.exprAllowed=e};var Te=de.prototype;Te.checkPropClash=function(t,e,i){if(this.options.ecmaVersion>=9&&t.type==="SpreadElement"||this.options.ecmaVersion>=6&&(t.computed||t.method||t.shorthand))return;let{key:s}=t,r;switch(s.type){case"Identifier":r=s.name;break;case"Literal":r=String(s.value);break;default:return}let{kind:n}=t;if(this.options.ecmaVersion>=6){r==="__proto__"&&n==="init"&&(e.proto&&(i?i.doubleProto<0&&(i.doubleProto=s.start):this.raiseRecoverable(s.start,"Redefinition of __proto__ property")),e.proto=!0);return}r="$"+r;let a=e[r];if(a){let t;n==="init"?t=this.strict&&a.init||a.get||a.set:t=a.init||a[n],t&&this.raiseRecoverable(s.start,"Redefinition of property")}else a=e[r]={init:!1,get:!1,set:!1};a[n]=!0};Te.parseExpression=function(t,e){return this.catchStackOverflow(()=>{let i=this.start,s=this.startLoc,r=this.parseMaybeAssign(t,e);if(this.type===Mt.comma){let n=this.startNodeAt(i,s);for(n.expressions=[r];this.eat(Mt.comma);)n.expressions.push(this.parseMaybeAssign(t,e));return this.finishNode(n,"SequenceExpression")}return r})};Te.parseMaybeAssign=function(t,e,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(t);this.exprAllowed=!1}let s=!1,r=-1,n=-1,a=-1;e?(r=e.parenthesizedAssign,n=e.trailingComma,a=e.doubleProto,e.parenthesizedAssign=e.trailingComma=-1):(e=new xe,s=!0);let o=this.start,h=this.startLoc;(this.type===Mt.parenL||this.type===Mt.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=t==="await");let l=this.parseMaybeConditional(t,e);if(i&&(l=i.call(this,l,o,h)),this.type.isAssign){let i=this.startNodeAt(o,h);return i.operator=this.value,this.type===Mt.eq&&(l=this.toAssignable(l,!1,e)),s||(e.parenthesizedAssign=e.trailingComma=-1,e.shorthandAssign>=l.start&&(e.shorthandAssign=-1),e.doubleProto>=l.start&&(e.doubleProto=-1)),this.type===Mt.eq?this.checkLValPattern(l):this.checkLValSimple(l),i.left=l,this.next(),i.right=this.parseMaybeAssign(t),a>-1&&(e.doubleProto=a),this.finishNode(i,"AssignmentExpression")}else s&&this.checkExpressionErrors(e,!0);return r>-1&&(e.parenthesizedAssign=r),n>-1&&(e.trailingComma=n),l};Te.parseMaybeConditional=function(t,e){let i=this.start,s=this.startLoc,r=this.parseExprOps(t,e);if(this.checkExpressionErrors(e))return r;if(!(r.type==="ArrowFunctionExpression"&&r.start===i)&&this.eat(Mt.question)){let e=this.startNodeAt(i,s);return e.test=r,e.consequent=this.parseMaybeAssign(),this.expect(Mt.colon),e.alternate=this.parseMaybeAssign(t),this.finishNode(e,"ConditionalExpression")}return r};Te.parseExprOps=function(t,e){let i=this.start,s=this.startLoc,r=this.parseMaybeUnary(e,!1,!1,t);return this.checkExpressionErrors(e)||r.start===i&&r.type==="ArrowFunctionExpression"?r:this.parseExprOp(r,i,s,-1,t)};Te.parseExprOp=function(t,e,i,s,r){let n=this.type.binop;if(n!=null&&(!r||this.type!==Mt._in)&&n>s){let a=this.type===Mt.logicalOR||this.type===Mt.logicalAND,o=this.type===Mt.coalesce;o&&(n=Mt.logicalAND.binop);let h=this.value;this.next();let l=this.start,p=this.startLoc,c=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,r),l,p,n,r),u=this.buildBinary(e,i,t,c,h,a||o);return(a&&this.type===Mt.coalesce||o&&(this.type===Mt.logicalOR||this.type===Mt.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(u,e,i,s,r)}return t};Te.buildBinary=function(t,e,i,s,r,n){s.type==="PrivateIdentifier"&&this.raise(s.start,"Private identifier can only be left side of binary expression");let a=this.startNodeAt(t,e);return a.left=i,a.operator=r,a.right=s,this.finishNode(a,n?"LogicalExpression":"BinaryExpression")};Te.parseMaybeUnary=function(t,e,i,s){let r=this.start,n=this.startLoc,a;if(this.isContextual("await")&&this.canAwait)a=this.parseAwait(s),e=!0;else if(this.type.prefix){let i=this.startNode(),r=this.type===Mt.incDec;i.operator=this.value,i.prefix=!0,this.next(),i.argument=this.parseMaybeUnary(null,!0,r,s),this.checkExpressionErrors(t,!0),r?this.checkLValSimple(i.argument):this.strict&&i.operator==="delete"&&Ve(i.argument)?this.raiseRecoverable(i.start,"Deleting local variable in strict mode"):i.operator==="delete"&&Le(i.argument)?this.raiseRecoverable(i.start,"Private fields can not be deleted"):e=!0,a=this.finishNode(i,r?"UpdateExpression":"UnaryExpression")}else if(!e&&this.type===Mt.privateId)(s||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),a=this.parsePrivateIdent(),this.type!==Mt._in&&this.unexpected();else{if(a=this.parseExprSubscripts(t,s),this.checkExpressionErrors(t))return a;for(;this.type.postfix&&!this.canInsertSemicolon();){let t=this.startNodeAt(r,n);t.operator=this.value,t.prefix=!1,t.argument=a,this.checkLValSimple(a),this.next(),a=this.finishNode(t,"UpdateExpression")}}if(!i&&!(a.type==="ArrowFunctionExpression"&&a.start===r)&&this.eat(Mt.starstar))if(e)this.unexpected(this.lastTokStart);else return this.buildBinary(r,n,a,this.parseMaybeUnary(null,!1,!1,s),"**",!1);else return a};Te.parseExprSubscripts=function(t,e){let i=this.start,s=this.startLoc,r=-1,n=-1;t&&(r=t.doubleProto,n=t.shorthandAssign,t.doubleProto=t.shorthandAssign=-1);let a=this.parseExprAtom(t,e);if(a.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return a;let o=this.parseSubscripts(a,i,s,!1,e);return t&&(o.end>a.end&&(this.checkExpressionErrors(t,!0),t.parenthesizedAssign>=o.start&&(t.parenthesizedAssign=-1),t.parenthesizedBind>=o.start&&(t.parenthesizedBind=-1),t.trailingComma>=o.start&&(t.trailingComma=-1)),r>-1&&(t.doubleProto=r),n>-1&&(t.shorthandAssign=n)),o};Te.parseSubscripts=function(t,e,i,s,r){let n=this.options.ecmaVersion>=8&&t.type==="Identifier"&&t.name==="async"&&this.lastTokEnd===t.end&&!this.canInsertSemicolon()&&t.end-t.start===5&&this.potentialArrowAt===t.start,a=!1;for(;;){let o=this.parseSubscript(t,e,i,s,n,a,r);if(o.optional&&(a=!0),o.end===t.end||o.type==="ArrowFunctionExpression"){if(a){let t=this.startNodeAt(e,i);t.expression=o,o=this.finishNode(t,"ChainExpression")}return o}t=o,n=!1}};Te.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(Mt.arrow)};Te.parseSubscriptAsyncArrow=function(t,e,i,s){return this.parseArrowExpression(this.startNodeAt(t,e),i,!0,s)};Te.parseSubscript=function(t,e,i,s,r,n,a){let o=this.options.ecmaVersion>=11,h=o&&this.eat(Mt.questionDot);s&&h&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");let l=this.eat(Mt.bracketL);if(l||h&&this.type!==Mt.parenL&&this.type!==Mt.backQuote||this.eat(Mt.dot)){let s=this.startNodeAt(e,i);s.object=t,l?(s.property=this.parseExpression(),this.expect(Mt.bracketR)):this.type===Mt.privateId&&t.type!=="Super"?s.property=this.parsePrivateIdent():s.property=this.parseIdent(this.options.allowReserved!=="never"),s.computed=!!l,o&&(s.optional=h),t=this.finishNode(s,"MemberExpression")}else if(!s&&this.eat(Mt.parenL)){let s=new xe,n=this.yieldPos,l=this.awaitPos,p=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;let c=this.parseExprList(Mt.parenR,this.options.ecmaVersion>=8,!1,s);if(r&&!h&&this.shouldParseAsyncArrow())return this.checkPatternErrors(s,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=n,this.awaitPos=l,this.awaitIdentPos=p,this.parseSubscriptAsyncArrow(e,i,c,a);this.checkExpressionErrors(s,!0),this.yieldPos=n||this.yieldPos,this.awaitPos=l||this.awaitPos,this.awaitIdentPos=p||this.awaitIdentPos;let u=this.startNodeAt(e,i);u.callee=t,u.arguments=c,o&&(u.optional=h),t=this.finishNode(u,"CallExpression")}else if(this.type===Mt.backQuote){(h||n)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");let s=this.startNodeAt(e,i);s.tag=t,s.quasi=this.parseTemplate({isTagged:!0}),t=this.finishNode(s,"TaggedTemplateExpression")}return t};Te.parseExprAtom=function(t,e,i){this.type===Mt.slash&&this.readRegexp();let s,r=this.potentialArrowAt===this.start;switch(this.type){case Mt._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),s=this.startNode(),this.next(),this.type===Mt.parenL&&!this.allowDirectSuper&&this.raise(s.start,"super() call outside constructor of a subclass"),this.type!==Mt.dot&&this.type!==Mt.bracketL&&this.type!==Mt.parenL&&this.unexpected(),this.finishNode(s,"Super");case Mt._this:return s=this.startNode(),this.next(),this.finishNode(s,"ThisExpression");case Mt.name:let n=this.start,a=this.startLoc,o=this.containsEsc,h=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&h.name==="async"&&!this.canInsertSemicolon()&&this.eat(Mt._function))return this.overrideContext(Pe.f_expr),this.parseFunction(this.startNodeAt(n,a),0,!1,!0,e);if(r&&!this.canInsertSemicolon()){if(this.eat(Mt.arrow))return this.parseArrowExpression(this.startNodeAt(n,a),[h],!1,e);if(this.options.ecmaVersion>=8&&h.name==="async"&&this.type===Mt.name&&!o&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return h=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(Mt.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,a),[h],!0,e)}return h;case Mt.regexp:let l=this.value;return s=this.parseLiteral(l.value),s.regex={pattern:l.pattern,flags:l.flags},s;case Mt.num:case Mt.string:return this.parseLiteral(this.value);case Mt._null:case Mt._true:case Mt._false:return s=this.startNode(),s.value=this.type===Mt._null?null:this.type===Mt._true,s.raw=this.type.keyword,this.next(),this.finishNode(s,"Literal");case Mt.parenL:let p=this.start,c=this.parseParenAndDistinguishExpression(r,e);return t&&(t.parenthesizedAssign<0&&!this.isSimpleAssignTarget(c)&&(t.parenthesizedAssign=p),t.parenthesizedBind<0&&(t.parenthesizedBind=p)),c;case Mt.bracketL:return s=this.startNode(),this.next(),s.elements=this.parseExprList(Mt.bracketR,!0,!0,t),this.finishNode(s,"ArrayExpression");case Mt.braceL:return this.overrideContext(Pe.b_expr),this.parseObj(!1,t);case Mt._function:return s=this.startNode(),this.next(),this.parseFunction(s,0);case Mt._class:return this.parseClass(this.startNode(),!1);case Mt._new:return this.parseNew();case Mt.backQuote:return this.parseTemplate();case Mt._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}};Te.parseExprAtomDefault=function(){this.unexpected()};Te.parseExprImport=function(t){let e=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===Mt.parenL&&!t)return this.parseDynamicImport(e);if(this.type===Mt.dot){let t=this.startNodeAt(e.start,e.loc&&e.loc.start);return t.name="import",e.meta=this.finishNode(t,"Identifier"),this.parseImportMeta(e)}else this.unexpected()};Te.parseDynamicImport=function(t){if(this.next(),t.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(Mt.parenR)?t.options=null:(this.expect(Mt.comma),this.afterTrailingComma(Mt.parenR)?t.options=null:(t.options=this.parseMaybeAssign(),this.eat(Mt.parenR)||(this.expect(Mt.comma),this.afterTrailingComma(Mt.parenR)||this.unexpected())));else if(!this.eat(Mt.parenR)){let t=this.start;this.eat(Mt.comma)&&this.eat(Mt.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(t,"ImportExpression")};Te.parseImportMeta=function(t){this.next();let e=this.containsEsc;return t.property=this.parseIdent(!0),t.property.name!=="meta"&&this.raiseRecoverable(t.property.start,"The only valid meta property for import is 'import.meta'"),e&&this.raiseRecoverable(t.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(t.start,"Cannot use 'import.meta' outside a module"),this.finishNode(t,"MetaProperty")};Te.parseLiteral=function(t){let e=this.startNode();return e.value=t,e.raw=this.input.slice(this.start,this.end),e.raw.charCodeAt(e.raw.length-1)===110&&(e.bigint=e.value!=null?e.value.toString():e.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(e,"Literal")};Te.parseParenExpression=function(){this.expect(Mt.parenL);let t=this.parseExpression();return this.expect(Mt.parenR),t};Te.shouldParseArrow=function(t){return!this.canInsertSemicolon()};Te.parseParenAndDistinguishExpression=function(t,e){let i=this.start,s=this.startLoc,r,n=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();let a=this.start,o=this.startLoc,h=[],l=!0,p=!1,c=new xe,u=this.yieldPos,d=this.awaitPos,f;for(this.yieldPos=0,this.awaitPos=0;this.type!==Mt.parenR;)if(l?l=!1:this.expect(Mt.comma),n&&this.afterTrailingComma(Mt.parenR,!0)){p=!0;break}else if(this.type===Mt.ellipsis){f=this.start,h.push(this.parseParenItem(this.parseRestBinding())),this.type===Mt.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else h.push(this.parseMaybeAssign(!1,c,this.parseParenItem));let m=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(Mt.parenR),t&&this.shouldParseArrow(h)&&this.eat(Mt.arrow))return this.checkPatternErrors(c,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=u,this.awaitPos=d,this.parseParenArrowList(i,s,h,e);(!h.length||p)&&this.unexpected(this.lastTokStart),f&&this.unexpected(f),this.checkExpressionErrors(c,!0),this.yieldPos=u||this.yieldPos,this.awaitPos=d||this.awaitPos,h.length>1?(r=this.startNodeAt(a,o),r.expressions=h,this.finishNodeAt(r,"SequenceExpression",m,g)):r=h[0]}else r=this.parseParenExpression();if(this.options.preserveParens){let t=this.startNodeAt(i,s);return t.expression=r,this.finishNode(t,"ParenthesizedExpression")}else return r};Te.parseParenItem=function(t){return t};Te.parseParenArrowList=function(t,e,i,s){return this.parseArrowExpression(this.startNodeAt(t,e),i,!1,s)};var Re=[];Te.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");let t=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===Mt.dot){let e=this.startNodeAt(t.start,t.loc&&t.loc.start);e.name="new",t.meta=this.finishNode(e,"Identifier"),this.next();let i=this.containsEsc;return t.property=this.parseIdent(!0),t.property.name!=="target"&&this.raiseRecoverable(t.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(t.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(t.start,"'new.target' can only be used in functions and class static block"),this.finishNode(t,"MetaProperty")}let e=this.start,i=this.startLoc;return t.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),e,i,!0,!1),t.callee.type==="Super"&&this.raiseRecoverable(e,"Invalid use of 'super'"),this.eat(Mt.parenL)?t.arguments=this.parseExprList(Mt.parenR,this.options.ecmaVersion>=8,!1):t.arguments=Re,this.finishNode(t,"NewExpression")};Te.parseTemplateElement=function({isTagged:t}){let e=this.startNode();return this.type===Mt.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),e.value={raw:this.value.replace(/\r\n?/g,`\n`),cooked:null}):e.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`\n`),cooked:this.value},this.next(),e.tail=this.type===Mt.backQuote,this.finishNode(e,"TemplateElement")};Te.parseTemplate=function({isTagged:t=!1}={}){let e=this.startNode();this.next(),e.expressions=[];let i=this.parseTemplateElement({isTagged:t});for(e.quasis=[i];!i.tail;)this.type===Mt.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(Mt.dollarBraceL),e.expressions.push(this.parseExpression()),this.expect(Mt.braceR),e.quasis.push(i=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(e,"TemplateLiteral")};Te.isAsyncProp=function(t){return!t.computed&&t.key.type==="Identifier"&&t.key.name==="async"&&(this.type===Mt.name||this.type===Mt.num||this.type===Mt.string||this.type===Mt.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===Mt.star)&&!Bt.test(this.input.slice(this.lastTokEnd,this.start))};Te.parseObj=function(t,e){let i=this.startNode(),s=!0,r={};for(i.properties=[],this.next();!this.eat(Mt.braceR);){if(s)s=!1;else if(this.expect(Mt.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(Mt.braceR))break;let n=this.parseProperty(t,e);t||this.checkPropClash(n,r,e),i.properties.push(n)}return this.finishNode(i,t?"ObjectPattern":"ObjectExpression")};Te.parseProperty=function(t,e){let i=this.startNode(),s,r,n,a;if(this.options.ecmaVersion>=9&&this.eat(Mt.ellipsis))return t?(i.argument=this.parseIdent(!1),this.type===Mt.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,e),this.type===Mt.comma&&e&&e.trailingComma<0&&(e.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(t||e)&&(n=this.start,a=this.startLoc),t||(s=this.eat(Mt.star)));let o=this.containsEsc;return this.parsePropertyName(i),!t&&!o&&this.options.ecmaVersion>=8&&!s&&this.isAsyncProp(i)?(r=!0,s=this.options.ecmaVersion>=9&&this.eat(Mt.star),this.parsePropertyName(i)):r=!1,this.parsePropertyValue(i,t,s,r,n,a,e,o),this.finishNode(i,"Property")};Te.parseGetterSetter=function(t){let e=t.key.name;this.parsePropertyName(t),t.value=this.parseMethod(!1),t.kind=e;let i=t.kind==="get"?0:1;if(t.value.params.length!==i){let e=t.value.start;t.kind==="get"?this.raiseRecoverable(e,"getter should have no params"):this.raiseRecoverable(e,"setter should have exactly one param")}else t.kind==="set"&&t.value.params[0].type==="RestElement"&&this.raiseRecoverable(t.value.params[0].start,"Setter cannot use rest params")};Te.parsePropertyValue=function(t,e,i,s,r,n,a,o){(i||s)&&this.type===Mt.colon&&this.unexpected(),this.eat(Mt.colon)?(t.value=e?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),t.kind="init"):this.options.ecmaVersion>=6&&this.type===Mt.parenL?(e&&this.unexpected(),t.method=!0,t.value=this.parseMethod(i,s),t.kind="init"):!e&&!o&&this.options.ecmaVersion>=5&&!t.computed&&t.key.type==="Identifier"&&(t.key.name==="get"||t.key.name==="set")&&this.type!==Mt.comma&&this.type!==Mt.braceR&&this.type!==Mt.eq?((i||s)&&this.unexpected(),this.parseGetterSetter(t)):this.options.ecmaVersion>=6&&!t.computed&&t.key.type==="Identifier"?((i||s)&&this.unexpected(),this.checkUnreserved(t.key),t.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=r),e?t.value=this.parseMaybeDefault(r,n,this.copyNode(t.key)):this.type===Mt.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),t.value=this.parseMaybeDefault(r,n,this.copyNode(t.key))):t.value=this.copyNode(t.key),t.kind="init",t.shorthand=!0):this.unexpected()};Te.parsePropertyName=function(t){if(this.options.ecmaVersion>=6){if(this.eat(Mt.bracketL))return t.computed=!0,t.key=this.parseMaybeAssign(),this.expect(Mt.bracketR),t.key;t.computed=!1}return t.key=this.type===Mt.num||this.type===Mt.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};Te.initFunction=function(t){t.id=null,this.options.ecmaVersion>=6&&(t.generator=t.expression=!1),this.options.ecmaVersion>=8&&(t.async=!1)};Te.parseMethod=function(t,e,i){let s=this.startNode(),r=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(s),this.options.ecmaVersion>=6&&(s.generator=t),this.options.ecmaVersion>=8&&(s.async=!!e),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ae(e,s.generator)|64|(i?128:0)),this.expect(Mt.parenL),s.params=this.parseBindingList(Mt.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(s,!1,!0,!1),this.yieldPos=r,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(s,"FunctionExpression")};Te.parseArrowExpression=function(t,e,i,s){let r=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.enterScope(ae(i,!1)|16),this.initFunction(t),this.options.ecmaVersion>=8&&(t.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,t.params=this.toAssignableList(e,!0),this.parseFunctionBody(t,!0,!1,s),this.yieldPos=r,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(t,"ArrowFunctionExpression")};Te.parseFunctionBody=function(t,e,i,s){let r=e&&this.type!==Mt.braceL,n=this.strict,a=!1;if(r)t.body=this.parseMaybeAssign(s),t.expression=!0,this.checkParams(t,!1);else{let s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(t.params);(!n||s)&&(a=this.strictDirective(this.end),a&&s&&this.raiseRecoverable(t.start,"Illegal 'use strict' directive in function with non-simple parameter list"));let r=this.labels;this.labels=[],a&&(this.strict=!0),this.checkParams(t,!n&&!a&&!e&&!i&&this.isSimpleParamList(t.params)),this.strict&&t.id&&this.checkLValSimple(t.id,ue),t.body=this.parseBlock(!1,void 0,a&&!n),t.expression=!1,this.adaptDirectivePrologue(t.body.body),this.labels=r}this.exitScope()};Te.isSimpleParamList=function(t){for(let e of t)if(e.type!=="Identifier")return!1;return!0};Te.checkParams=function(t,e){let i=Object.create(null);for(let s of t.params)this.checkLValInnerPattern(s,he,e?null:i)};Te.parseExprList=function(t,e,i,s){let r=[],n=!0;for(;!this.eat(t);){if(n)n=!1;else if(this.expect(Mt.comma),e&&this.afterTrailingComma(t))break;let a;i&&this.type===Mt.comma?a=null:this.type===Mt.ellipsis?(a=this.parseSpread(s),s&&this.type===Mt.comma&&s.trailingComma<0&&(s.trailingComma=this.start)):a=this.parseMaybeAssign(!1,s),r.push(a)}return r};Te.checkUnreserved=function({start:t,end:e,name:i}){this.inGenerator&&i==="yield"&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&i==="await"&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),!(this.currentThisScope().flags&259)&&i==="arguments"&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(i==="arguments"||i==="await")&&this.raise(t,`Cannot use ${i} in class static initialization block`),this.keywords.test(i)&&this.raise(t,`Unexpected keyword '${i}'`),!(this.options.ecmaVersion<6&&this.input.slice(t,e).indexOf("\\")!==-1)&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(i)&&(!this.inAsync&&i==="await"&&this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,`The keyword '${i}' is reserved`))};Te.parseIdent=function(t){let e=this.parseIdentNode();return this.next(!!t),this.finishNode(e,"Identifier"),t||(this.checkUnreserved(e),e.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=e.start)),e};Te.parseIdentNode=function(){let t=this.startNode();return this.type===Mt.name?t.name=this.value:this.type.keyword?(t.name=this.type.keyword,(t.name==="class"||t.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=Mt.name):this.unexpected(),t};Te.parsePrivateIdent=function(){let t=this.startNode();return this.type===Mt.privateId?t.name=this.value:this.unexpected(),this.next(),this.finishNode(t,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(t.start,`Private field '#${t.name}' must be declared in an enclosing class`):this.privateNameStack[this.privateNameStack.length-1].used.push(t)),t};Te.parseYield=function(t){this.yieldPos||(this.yieldPos=this.start);let e=this.startNode();return this.next(),this.type===Mt.semi||this.canInsertSemicolon()||this.type!==Mt.star&&!this.type.startsExpr?(e.delegate=!1,e.argument=null):(e.delegate=this.eat(Mt.star),e.argument=this.parseMaybeAssign(t)),this.finishNode(e,"YieldExpression")};Te.parseAwait=function(t){this.awaitPos||(this.awaitPos=this.start);let e=this.startNode();return this.next(),e.argument=this.parseMaybeUnary(null,!0,!1,t),this.finishNode(e,"AwaitExpression")};var Oe=de.prototype;Oe.raise=function(t,e){let i=ee(this.input,t);e+=" ("+i.line+":"+i.column+")",this.sourceFile&&(e+=" in "+this.sourceFile);let s=new SyntaxError(e);throw s.pos=t,s.loc=i,s.raisedAt=this.pos,s};Oe.raiseRecoverable=Oe.raise;Oe.curPosition=function(){if(this.options.locations)return new Zt(this.curLine,this.pos-this.lineStart)};var je=de.prototype,De=class{constructor(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[]}};je.enterScope=function(t){this.scopeStack.push(new De(t))};je.exitScope=function(){this.scopeStack.pop()};je.treatFunctionsAsVarInScope=function(t){return t.flags&2||!this.inModule&&t.flags&1};je.declareName=function(t,e,i){let s=!1;if(e===le){let e=this.currentScope();s=e.lexical.indexOf(t)>-1||e.functions.indexOf(t)>-1||e.var.indexOf(t)>-1,e.lexical.push(t),this.inModule&&e.flags&1&&delete this.undefinedExports[t]}else if(e===ce)this.currentScope().lexical.push(t);else if(e===pe){let e=this.currentScope();this.treatFunctionsAsVar?s=e.lexical.indexOf(t)>-1:s=e.lexical.indexOf(t)>-1||e.var.indexOf(t)>-1,e.functions.push(t)}else for(let e=this.scopeStack.length-1;e>=0;--e){let i=this.scopeStack[e];if(i.lexical.indexOf(t)>-1&&!(i.flags&32&&i.lexical[0]===t)||!this.treatFunctionsAsVarInScope(i)&&i.functions.indexOf(t)>-1){s=!0;break}if(i.var.push(t),this.inModule&&i.flags&1&&delete this.undefinedExports[t],i.flags&259)break}s&&this.raiseRecoverable(i,`Identifier '${t}' has already been declared`)};je.checkLocalExport=function(t){this.scopeStack[0].lexical.indexOf(t.name)===-1&&this.scopeStack[0].var.indexOf(t.name)===-1&&(this.undefinedExports[t.name]=t)};je.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};je.currentVarScope=function(){for(let t=this.scopeStack.length-1;;t--){let e=this.scopeStack[t];if(e.flags&771)return e}};je.currentThisScope=function(){for(let t=this.scopeStack.length-1;;t--){let e=this.scopeStack[t];if(e.flags&771&&!(e.flags&16))return e}};var Me=class{constructor(t,e,i){this.type="",this.start=e,this.end=0,t.options.locations&&(this.loc=new te(t,i)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[e,0])}},Be=de.prototype;Be.startNode=function(){return new Me(this,this.start,this.startLoc)};Be.startNodeAt=function(t,e){return new Me(this,t,e)};Be.finishNode=function(t,e){return Ue.call(this,t,e,this.lastTokEnd,this.lastTokEndLoc)};Be.finishNodeAt=function(t,e,i,s){return Ue.call(this,t,e,i,s)};Be.copyNode=function(t){let e=new Me(this,t.start,this.startLoc);for(let i in t)e[i]=t[i];return e};var $e="Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz",Fe="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",qe=Fe+" Extended_Pictographic",We=qe,Ge=We+" EBase EComp EMod EPres ExtPict",He=Ge,ze=He,Ke={9:Fe,10:qe,11:We,12:Ge,13:He,14:ze},Qe="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",Je={9:"",10:"",11:"",12:"",13:"",14:Qe},Xe="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Ye="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Ze=Ye+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",ti=Ze+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",ei=ti+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",ii=ei+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",si=ii+" "+$e,ri={9:Ye,10:Ze,11:ti,12:ei,13:ii,14:si},ni={};for(let t of[9,10,11,12,13,14])ai(t);var oi=ni,hi=de.prototype,li=class t{constructor(t,e){this.parent=t,this.base=e||this}separatedFrom(t){for(let e=this;e;e=e.parent)for(let i=t;i;i=i.parent)if(e.base===i.base&&e!==i)return!0;return!1}sibling(){return new t(this.parent,this.base)}},pi=class{constructor(t){this.parser=t,this.validFlags=`gim${t.options.ecmaVersion>=6?"uy":""}${t.options.ecmaVersion>=9?"s":""}${t.options.ecmaVersion>=13?"d":""}${t.options.ecmaVersion>=15?"v":""}`,this.unicodeProperties=oi[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null}reset(t,e,i){let s=i.indexOf("v")!==-1,r=i.indexOf("u")!==-1;this.start=t|0,this.source=e+"",this.flags=i,s&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=r&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=r&&this.parser.options.ecmaVersion>=9)}raise(t){this.parser.raiseRecoverable(this.start,`Invalid regular expression: /${this.source}/: ${t}`)}at(t,e=!1){let i=this.source,s=i.length;if(t>=s)return-1;let r=i.charCodeAt(t);if(!(e||this.switchU)||r<=55295||r>=57344||t+1>=s)return r;let n=i.charCodeAt(t+1);return n>=56320&&n<=57343?(r<<10)+n-56613888:r}nextIndex(t,e=!1){let i=this.source,s=i.length;if(t>=s)return s;let r=i.charCodeAt(t),n;return!(e||this.switchU)||r<=55295||r>=57344||t+1>=s||(n=i.charCodeAt(t+1))<56320||n>57343?t+1:t+2}current(t=!1){return this.at(this.pos,t)}lookahead(t=!1){return this.at(this.nextIndex(this.pos,t),t)}advance(t=!1){this.pos=this.nextIndex(this.pos,t)}eat(t,e=!1){return this.current(e)===t?(this.advance(e),!0):!1}eatChars(t,e=!1){let i=this.pos;for(let s of t){let t=this.at(i,e);if(t===-1||t!==s)return!1;i=this.nextIndex(i,e)}return this.pos=i,!0}};hi.validateRegExpFlags=function(t){let e=t.validFlags,i=t.flags,s=!1,r=!1;for(let n=0;n<i.length;n++){let a=i.charAt(n);e.indexOf(a)===-1&&this.raise(t.start,"Invalid regular expression flag"),i.indexOf(a,n+1)>-1&&this.raise(t.start,"Duplicate regular expression flag"),a==="u"&&(s=!0),a==="v"&&(r=!0)}this.options.ecmaVersion>=15&&s&&r&&this.raise(t.start,"Invalid regular expression flag")};hi.validateRegExpPattern=function(t){this.regexp_pattern(t),!t.switchN&&this.options.ecmaVersion>=9&&ci(t.groupNames)&&(t.switchN=!0,this.regexp_pattern(t))};hi.regexp_pattern=function(t){t.pos=0,t.lastIntValue=0,t.lastStringValue="",t.lastAssertionIsQuantifiable=!1,t.numCapturingParens=0,t.maxBackReference=0,t.groupNames=Object.create(null),t.backReferenceNames.length=0,t.branchID=null,this.regexp_disjunction(t),t.pos!==t.source.length&&(t.eat(41)&&t.raise("Unmatched ')'"),(t.eat(93)||t.eat(125))&&t.raise("Lone quantifier brackets")),t.maxBackReference>t.numCapturingParens&&t.raise("Invalid escape");for(let e of t.backReferenceNames)t.groupNames[e]||t.raise("Invalid named capture referenced")};hi.regexp_disjunction=function(t){let e=this.options.ecmaVersion>=16;for(e&&(t.branchID=new li(t.branchID,null)),this.regexp_alternative(t);t.eat(124);)e&&(t.branchID=t.branchID.sibling()),this.regexp_alternative(t);e&&(t.branchID=t.branchID.parent),this.regexp_eatQuantifier(t,!0)&&t.raise("Nothing to repeat"),t.eat(123)&&t.raise("Lone quantifier brackets")};hi.regexp_alternative=function(t){for(;t.pos<t.source.length&&this.regexp_eatTerm(t););};hi.regexp_eatTerm=function(t){return this.regexp_eatAssertion(t)?(t.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(t)&&t.switchU&&t.raise("Invalid quantifier"),!0):(t.switchU?this.regexp_eatAtom(t):this.regexp_eatExtendedAtom(t))?(this.regexp_eatQuantifier(t),!0):!1};hi.regexp_eatAssertion=function(t){let e=t.pos;if(t.lastAssertionIsQuantifiable=!1,t.eat(94)||t.eat(36))return!0;if(t.eat(92)){if(t.eat(66)||t.eat(98))return!0;t.pos=e}if(t.eat(40)&&t.eat(63)){let e=!1;if(this.options.ecmaVersion>=9&&(e=t.eat(60)),t.eat(61)||t.eat(33))return this.regexp_disjunction(t),t.eat(41)||t.raise("Unterminated group"),t.lastAssertionIsQuantifiable=!e,!0}return t.pos=e,!1};hi.regexp_eatQuantifier=function(t,e=!1){return this.regexp_eatQuantifierPrefix(t,e)?(t.eat(63),!0):!1};hi.regexp_eatQuantifierPrefix=function(t,e){return t.eat(42)||t.eat(43)||t.eat(63)||this.regexp_eatBracedQuantifier(t,e)};hi.regexp_eatBracedQuantifier=function(t,e){let i=t.pos;if(t.eat(123)){let s=0,r=-1;if(this.regexp_eatDecimalDigits(t)&&(s=t.lastIntValue,t.eat(44)&&this.regexp_eatDecimalDigits(t)&&(r=t.lastIntValue),t.eat(125)))return r!==-1&&r<s&&!e&&t.raise("numbers out of order in {} quantifier"),!0;t.switchU&&!e&&t.raise("Incomplete quantifier"),t.pos=i}return!1};hi.regexp_eatAtom=function(t){return this.regexp_eatPatternCharacters(t)||t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)};hi.regexp_eatReverseSolidusAtomEscape=function(t){let e=t.pos;if(t.eat(92)){if(this.regexp_eatAtomEscape(t))return!0;t.pos=e}return!1};hi.regexp_eatUncapturingGroup=function(t){let e=t.pos;if(t.eat(40)){if(t.eat(63)){if(this.options.ecmaVersion>=16){let e=this.regexp_eatModifiers(t),i=t.eat(45);if(e||i){for(let i=0;i<e.length;i++){let s=e.charAt(i);e.indexOf(s,i+1)>-1&&t.raise("Duplicate regular expression modifiers")}if(i){let i=this.regexp_eatModifiers(t);!e&&!i&&t.current()===58&&t.raise("Invalid regular expression modifiers");for(let s=0;s<i.length;s++){let r=i.charAt(s);(i.indexOf(r,s+1)>-1||e.indexOf(r)>-1)&&t.raise("Duplicate regular expression modifiers")}}}}if(t.eat(58)){if(this.regexp_disjunction(t),t.eat(41))return!0;t.raise("Unterminated group")}}t.pos=e}return!1};hi.regexp_eatCapturingGroup=function(t){if(t.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(t):t.current()===63&&t.raise("Invalid group"),this.regexp_disjunction(t),t.eat(41))return t.numCapturingParens+=1,!0;t.raise("Unterminated group")}return!1};hi.regexp_eatModifiers=function(t){let e="",i=0;for(;(i=t.current())!==-1&&ui(i);)e+=Xt(i),t.advance();return e};hi.regexp_eatExtendedAtom=function(t){return t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)||this.regexp_eatInvalidBracedQuantifier(t)||this.regexp_eatExtendedPatternCharacter(t)};hi.regexp_eatInvalidBracedQuantifier=function(t){return this.regexp_eatBracedQuantifier(t,!0)&&t.raise("Nothing to repeat"),!1};hi.regexp_eatSyntaxCharacter=function(t){let e=t.current();return di(e)?(t.lastIntValue=e,t.advance(),!0):!1};hi.regexp_eatPatternCharacters=function(t){let e=t.pos,i=0;for(;(i=t.current())!==-1&&!di(i);)t.advance();return t.pos!==e};hi.regexp_eatExtendedPatternCharacter=function(t){let e=t.current();return e!==-1&&e!==36&&!(e>=40&&e<=43)&&e!==46&&e!==63&&e!==91&&e!==94&&e!==124?(t.advance(),!0):!1};hi.regexp_groupSpecifier=function(t){if(t.eat(63)){this.regexp_eatGroupName(t)||t.raise("Invalid group");let e=this.options.ecmaVersion>=16,i=t.groupNames[t.lastStringValue];if(i)if(e)for(let e of i)e.separatedFrom(t.branchID)||t.raise("Duplicate capture group name");else t.raise("Duplicate capture group name");e?(i||(t.groupNames[t.lastStringValue]=[])).push(t.branchID):t.groupNames[t.lastStringValue]=!0}};hi.regexp_eatGroupName=function(t){if(t.lastStringValue="",t.eat(60)){if(this.regexp_eatRegExpIdentifierName(t)&&t.eat(62))return!0;t.raise("Invalid capture group name")}return!1};hi.regexp_eatRegExpIdentifierName=function(t){if(t.lastStringValue="",this.regexp_eatRegExpIdentifierStart(t)){for(t.lastStringValue+=Xt(t.lastIntValue);this.regexp_eatRegExpIdentifierPart(t);)t.lastStringValue+=Xt(t.lastIntValue);return!0}return!1};hi.regexp_eatRegExpIdentifierStart=function(t){let e=t.pos,i=this.options.ecmaVersion>=11,s=t.current(i);return t.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(t,i)&&(s=t.lastIntValue),fi(s)?(t.lastIntValue=s,!0):(t.pos=e,!1)};hi.regexp_eatRegExpIdentifierPart=function(t){let e=t.pos,i=this.options.ecmaVersion>=11,s=t.current(i);return t.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(t,i)&&(s=t.lastIntValue),mi(s)?(t.lastIntValue=s,!0):(t.pos=e,!1)};hi.regexp_eatAtomEscape=function(t){return this.regexp_eatBackReference(t)||this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)||t.switchN&&this.regexp_eatKGroupName(t)?!0:(t.switchU&&(t.current()===99&&t.raise("Invalid unicode escape"),t.raise("Invalid escape")),!1)};hi.regexp_eatBackReference=function(t){let e=t.pos;if(this.regexp_eatDecimalEscape(t)){let i=t.lastIntValue;if(t.switchU)return i>t.maxBackReference&&(t.maxBackReference=i),!0;if(i<=t.numCapturingParens)return!0;t.pos=e}return!1};hi.regexp_eatKGroupName=function(t){if(t.eat(107)){if(this.regexp_eatGroupName(t))return t.backReferenceNames.push(t.lastStringValue),!0;t.raise("Invalid named reference")}return!1};hi.regexp_eatCharacterEscape=function(t){return this.regexp_eatControlEscape(t)||this.regexp_eatCControlLetter(t)||this.regexp_eatZero(t)||this.regexp_eatHexEscapeSequence(t)||this.regexp_eatRegExpUnicodeEscapeSequence(t,!1)||!t.switchU&&this.regexp_eatLegacyOctalEscapeSequence(t)||this.regexp_eatIdentityEscape(t)};hi.regexp_eatCControlLetter=function(t){let e=t.pos;if(t.eat(99)){if(this.regexp_eatControlLetter(t))return!0;t.pos=e}return!1};hi.regexp_eatZero=function(t){return t.current()===48&&!Ai(t.lookahead())?(t.lastIntValue=0,t.advance(),!0):!1};hi.regexp_eatControlEscape=function(t){let e=t.current();return e===116?(t.lastIntValue=9,t.advance(),!0):e===110?(t.lastIntValue=10,t.advance(),!0):e===118?(t.lastIntValue=11,t.advance(),!0):e===102?(t.lastIntValue=12,t.advance(),!0):e===114?(t.lastIntValue=13,t.advance(),!0):!1};hi.regexp_eatControlLetter=function(t){let e=t.current();return gi(e)?(t.lastIntValue=e%32,t.advance(),!0):!1};hi.regexp_eatRegExpUnicodeEscapeSequence=function(t,e=!1){let i=t.pos,s=e||t.switchU;if(t.eat(117)){if(this.regexp_eatFixedHexDigits(t,4)){let e=t.lastIntValue;if(s&&e>=55296&&e<=56319){let i=t.pos;if(t.eat(92)&&t.eat(117)&&this.regexp_eatFixedHexDigits(t,4)){let i=t.lastIntValue;if(i>=56320&&i<=57343)return t.lastIntValue=(e-55296)*1024+(i-56320)+65536,!0}t.pos=i,t.lastIntValue=e}return!0}if(s&&t.eat(123)&&this.regexp_eatHexDigits(t)&&t.eat(125)&&xi(t.lastIntValue))return!0;s&&t.raise("Invalid unicode escape"),t.pos=i}return!1};hi.regexp_eatIdentityEscape=function(t){if(t.switchU)return this.regexp_eatSyntaxCharacter(t)?!0:t.eat(47)?(t.lastIntValue=47,!0):!1;let e=t.current();return e!==99&&(!t.switchN||e!==107)?(t.lastIntValue=e,t.advance(),!0):!1};hi.regexp_eatDecimalEscape=function(t){t.lastIntValue=0;let e=t.current();if(e>=49&&e<=57){do{t.lastIntValue=10*t.lastIntValue+(e-48),t.advance()}while((e=t.current())>=48&&e<=57);return!0}return!1};var yi=0,bi=1,wi=2;hi.regexp_eatCharacterClassEscape=function(t){let e=t.current();if(ki(e))return t.lastIntValue=-1,t.advance(),bi;let i=!1;if(t.switchU&&this.options.ecmaVersion>=9&&((i=e===80)||e===112)){t.lastIntValue=-1,t.advance();let e;if(t.eat(123)&&(e=this.regexp_eatUnicodePropertyValueExpression(t))&&t.eat(125))return i&&e===wi&&t.raise("Invalid property name"),e;t.raise("Invalid property name")}return yi};hi.regexp_eatUnicodePropertyValueExpression=function(t){let e=t.pos;if(this.regexp_eatUnicodePropertyName(t)&&t.eat(61)){let e=t.lastStringValue;if(this.regexp_eatUnicodePropertyValue(t)){let i=t.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(t,e,i),bi}}if(t.pos=e,this.regexp_eatLoneUnicodePropertyNameOrValue(t)){let e=t.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(t,e)}return yi};hi.regexp_validateUnicodePropertyNameAndValue=function(t,e,i){zt(t.unicodeProperties.nonBinary,e)||t.raise("Invalid property name"),t.unicodeProperties.nonBinary[e].test(i)||t.raise("Invalid property value")};hi.regexp_validateUnicodePropertyNameOrValue=function(t,e){if(t.unicodeProperties.binary.test(e))return bi;if(t.switchV&&t.unicodeProperties.binaryOfStrings.test(e))return wi;t.raise("Invalid property name")};hi.regexp_eatUnicodePropertyName=function(t){let e=0;for(t.lastStringValue="";_i(e=t.current());)t.lastStringValue+=Xt(e),t.advance();return t.lastStringValue!==""};hi.regexp_eatUnicodePropertyValue=function(t){let e=0;for(t.lastStringValue="";Si(e=t.current());)t.lastStringValue+=Xt(e),t.advance();return t.lastStringValue!==""};hi.regexp_eatLoneUnicodePropertyNameOrValue=function(t){return this.regexp_eatUnicodePropertyValue(t)};hi.regexp_eatCharacterClass=function(t){if(t.eat(91)){let e=t.eat(94),i=this.regexp_classContents(t);return t.eat(93)||t.raise("Unterminated character class"),e&&i===wi&&t.raise("Negated character class may contain strings"),!0}return!1};hi.regexp_classContents=function(t){return t.current()===93?bi:t.switchV?this.regexp_classSetExpression(t):(this.regexp_nonEmptyClassRanges(t),bi)};hi.regexp_nonEmptyClassRanges=function(t){for(;this.regexp_eatClassAtom(t);){let e=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassAtom(t)){let i=t.lastIntValue;t.switchU&&(e===-1||i===-1)&&t.raise("Invalid character class"),e!==-1&&i!==-1&&e>i&&t.raise("Range out of order in character class")}}};hi.regexp_eatClassAtom=function(t){let e=t.pos;if(t.eat(92)){if(this.regexp_eatClassEscape(t))return!0;if(t.switchU){let e=t.current();(e===99||Ni(e))&&t.raise("Invalid class escape"),t.raise("Invalid escape")}t.pos=e}let i=t.current();return i!==93?(t.lastIntValue=i,t.advance(),!0):!1};hi.regexp_eatClassEscape=function(t){let e=t.pos;if(t.eat(98))return t.lastIntValue=8,!0;if(t.switchU&&t.eat(45))return t.lastIntValue=45,!0;if(!t.switchU&&t.eat(99)){if(this.regexp_eatClassControlLetter(t))return!0;t.pos=e}return this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)};hi.regexp_classSetExpression=function(t){let e=bi,i;if(!this.regexp_eatClassSetRange(t))if(i=this.regexp_eatClassSetOperand(t)){i===wi&&(e=wi);let s=t.pos;for(;t.eatChars([38,38]);){if(t.current()!==38&&(i=this.regexp_eatClassSetOperand(t))){i!==wi&&(e=bi);continue}t.raise("Invalid character in character class")}if(s!==t.pos)return e;for(;t.eatChars([45,45]);)this.regexp_eatClassSetOperand(t)||t.raise("Invalid character in character class");if(s!==t.pos)return e}else t.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(t)){if(i=this.regexp_eatClassSetOperand(t),!i)return e;i===wi&&(e=wi)}};hi.regexp_eatClassSetRange=function(t){let e=t.pos;if(this.regexp_eatClassSetCharacter(t)){let i=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassSetCharacter(t)){let e=t.lastIntValue;return i!==-1&&e!==-1&&i>e&&t.raise("Range out of order in character class"),!0}t.pos=e}return!1};hi.regexp_eatClassSetOperand=function(t){return this.regexp_eatClassSetCharacter(t)?bi:this.regexp_eatClassStringDisjunction(t)||this.regexp_eatNestedClass(t)};hi.regexp_eatNestedClass=function(t){let e=t.pos;if(t.eat(91)){let i=t.eat(94),s=this.regexp_classContents(t);if(t.eat(93))return i&&s===wi&&t.raise("Negated character class may contain strings"),s;t.pos=e}if(t.eat(92)){let i=this.regexp_eatCharacterClassEscape(t);if(i)return i;t.pos=e}return null};hi.regexp_eatClassStringDisjunction=function(t){let e=t.pos;if(t.eatChars([92,113])){if(t.eat(123)){let e=this.regexp_classStringDisjunctionContents(t);if(t.eat(125))return e}else t.raise("Invalid escape");t.pos=e}return null};hi.regexp_classStringDisjunctionContents=function(t){let e=this.regexp_classString(t);for(;t.eat(124);)this.regexp_classString(t)===wi&&(e=wi);return e};hi.regexp_classString=function(t){let e=0;for(;this.regexp_eatClassSetCharacter(t);)e++;return e===1?bi:wi};hi.regexp_eatClassSetCharacter=function(t){let e=t.pos;if(t.eat(92))return this.regexp_eatCharacterEscape(t)||this.regexp_eatClassSetReservedPunctuator(t)?!0:t.eat(98)?(t.lastIntValue=8,!0):(t.pos=e,!1);let i=t.current();return i<0||i===t.lookahead()&&Ci(i)||vi(i)?!1:(t.advance(),t.lastIntValue=i,!0)};hi.regexp_eatClassSetReservedPunctuator=function(t){let e=t.current();return Ei(e)?(t.lastIntValue=e,t.advance(),!0):!1};hi.regexp_eatClassControlLetter=function(t){let e=t.current();return Ai(e)||e===95?(t.lastIntValue=e%32,t.advance(),!0):!1};hi.regexp_eatHexEscapeSequence=function(t){let e=t.pos;if(t.eat(120)){if(this.regexp_eatFixedHexDigits(t,2))return!0;t.switchU&&t.raise("Invalid escape"),t.pos=e}return!1};hi.regexp_eatDecimalDigits=function(t){let e=t.pos,i=0;for(t.lastIntValue=0;Ai(i=t.current());)t.lastIntValue=10*t.lastIntValue+(i-48),t.advance();return t.pos!==e};hi.regexp_eatHexDigits=function(t){let e=t.pos,i=0;for(t.lastIntValue=0;Ii(i=t.current());)t.lastIntValue=16*t.lastIntValue+Pi(i),t.advance();return t.pos!==e};hi.regexp_eatLegacyOctalEscapeSequence=function(t){if(this.regexp_eatOctalDigit(t)){let e=t.lastIntValue;if(this.regexp_eatOctalDigit(t)){let i=t.lastIntValue;e<=3&&this.regexp_eatOctalDigit(t)?t.lastIntValue=e*64+i*8+t.lastIntValue:t.lastIntValue=e*8+i}else t.lastIntValue=e;return!0}return!1};hi.regexp_eatOctalDigit=function(t){let e=t.current();return Ni(e)?(t.lastIntValue=e-48,t.advance(),!0):(t.lastIntValue=0,!1)};hi.regexp_eatFixedHexDigits=function(t,e){let i=t.pos;t.lastIntValue=0;for(let s=0;s<e;++s){let e=t.current();if(!Ii(e))return t.pos=i,!1;t.lastIntValue=16*t.lastIntValue+Pi(e),t.advance()}return!0};var Ti=class{constructor(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new te(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])}},Vi=de.prototype;Vi.next=function(t){!t&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new Ti(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};Vi.getToken=function(){return this.next(),new Ti(this)};typeof Symbol<"u"&&(Vi[Symbol.iterator]=function(){return{next:()=>{let t=this.getToken();return{done:t.type===Mt.eof,value:t}}}});Vi.nextToken=function(){let t=this.curContext();if((!t||!t.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(Mt.eof);if(t.override)return t.override(this);this.readToken(this.fullCharCodeAtPos())};Vi.readToken=function(t){return Nt(t,this.options.ecmaVersion>=6)||t===92?this.readWord():this.getTokenFromCode(t)};Vi.fullCharCodeAt=function(t){let e=this.input.charCodeAt(t);if(e<=55295||e>=56320)return e;let i=this.input.charCodeAt(t+1);return i<=56319||i>=57344?e:(e<<10)+i-56613888};Vi.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};Vi.skipBlockComment=function(){let t=this.options.onComment&&this.curPosition(),e=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(let t,i=e;(t=Ft(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=t;this.options.onComment&&this.options.onComment(!0,this.input.slice(e+2,i),e,this.pos,t,this.curPosition())};Vi.skipLineComment=function(t){let e=this.pos,i=this.options.onComment&&this.curPosition(),s=this.input.charCodeAt(this.pos+=t);for(;this.pos<this.input.length&&!$t(s);)s=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(e+t,this.pos),e,this.pos,i,this.curPosition())};Vi.skipSpace=function(){t:for(;this.pos<this.input.length;){let t=this.input.charCodeAt(this.pos);switch(t){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break t}break;default:if(t>8&&t<14||t>=5760&&qt.test(String.fromCharCode(t)))++this.pos;else break t}}};Vi.finishToken=function(t,e){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());let i=this.type;this.type=t,this.value=e,this.updateContext(i)};Vi.readToken_dot=function(){let t=this.input.charCodeAt(this.pos+1);if(t>=48&&t<=57)return this.readNumber(!0);let e=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&t===46&&e===46?(this.pos+=3,this.finishToken(Mt.ellipsis)):(++this.pos,this.finishToken(Mt.dot))};Vi.readToken_slash=function(){let t=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):t===61?this.finishOp(Mt.assign,2):this.finishOp(Mt.slash,1)};Vi.readToken_mult_modulo_exp=function(t){let e=this.input.charCodeAt(this.pos+1),i=1,s=t===42?Mt.star:Mt.modulo;return this.options.ecmaVersion>=7&&t===42&&e===42&&(++i,s=Mt.starstar,e=this.input.charCodeAt(this.pos+2)),e===61?this.finishOp(Mt.assign,i+1):this.finishOp(s,i)};Vi.readToken_pipe_amp=function(t){let e=this.input.charCodeAt(this.pos+1);return e===t?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(Mt.assign,3):this.finishOp(t===124?Mt.logicalOR:Mt.logicalAND,2):e===61?this.finishOp(Mt.assign,2):this.finishOp(t===124?Mt.bitwiseOR:Mt.bitwiseAND,1)};Vi.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(Mt.assign,2):this.finishOp(Mt.bitwiseXOR,1)};Vi.readToken_plus_min=function(t){let e=this.input.charCodeAt(this.pos+1);return e===t?e===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||Bt.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(Mt.incDec,2):e===61?this.finishOp(Mt.assign,2):this.finishOp(Mt.plusMin,1)};Vi.readToken_lt_gt=function(t){let e=this.input.charCodeAt(this.pos+1),i=1;return e===t?(i=t===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(Mt.assign,i+1):this.finishOp(Mt.bitShift,i)):e===33&&t===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(e===61&&(i=2),this.finishOp(Mt.relational,i))};Vi.readToken_eq_excl=function(t){let e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(Mt.equality,this.input.charCodeAt(this.pos+2)===61?3:2):t===61&&e===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(Mt.arrow)):this.finishOp(t===61?Mt.eq:Mt.prefix,1)};Vi.readToken_question=function(){let t=this.options.ecmaVersion;if(t>=11){let e=this.input.charCodeAt(this.pos+1);if(e===46){let t=this.input.charCodeAt(this.pos+2);if(t<48||t>57)return this.finishOp(Mt.questionDot,2)}if(e===63)return t>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(Mt.assign,3):this.finishOp(Mt.coalesce,2)}return this.finishOp(Mt.question,1)};Vi.readToken_numberSign=function(){let t=this.options.ecmaVersion,e=35;if(t>=13&&(++this.pos,e=this.fullCharCodeAtPos(),Nt(e,!0)||e===92))return this.finishToken(Mt.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Xt(e)+"'")};Vi.getTokenFromCode=function(t){switch(t){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(Mt.parenL);case 41:return++this.pos,this.finishToken(Mt.parenR);case 59:return++this.pos,this.finishToken(Mt.semi);case 44:return++this.pos,this.finishToken(Mt.comma);case 91:return++this.pos,this.finishToken(Mt.bracketL);case 93:return++this.pos,this.finishToken(Mt.bracketR);case 123:return++this.pos,this.finishToken(Mt.braceL);case 125:return++this.pos,this.finishToken(Mt.braceR);case 58:return++this.pos,this.finishToken(Mt.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(Mt.backQuote);case 48:let e=this.input.charCodeAt(this.pos+1);if(e===120||e===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(e===111||e===79)return this.readRadixNumber(8);if(e===98||e===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(t);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(t);case 124:case 38:return this.readToken_pipe_amp(t);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(t);case 60:case 62:return this.readToken_lt_gt(t);case 61:case 33:return this.readToken_eq_excl(t);case 63:return this.readToken_question();case 126:return this.finishOp(Mt.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Xt(t)+"'")};Vi.finishOp=function(t,e){let i=this.input.slice(this.pos,this.pos+e);return this.pos+=e,this.finishToken(t,i)};Vi.readRegexp=function(){let t,e,i=this.pos;for(;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");let s=this.input.charAt(this.pos);if(Bt.test(s)&&this.raise(i,"Unterminated regular expression"),t)t=!1;else{if(s==="[")e=!0;else if(s==="]"&&e)e=!1;else if(s==="/"&&!e)break;t=s==="\\"}++this.pos}let s=this.input.slice(i,this.pos);++this.pos;let r=this.pos,n=this.readWord1();this.containsEsc&&this.unexpected(r);let a=this.regexpState||(this.regexpState=new pi(this));a.reset(i,s,n),this.validateRegExpFlags(a),this.validateRegExpPattern(a);let o=null;try{o=new RegExp(s,n)}catch{}return this.finishToken(Mt.regexp,{pattern:s,flags:n,value:o})};Vi.readInt=function(t,e,i){let s=this.options.ecmaVersion>=12&&e===void 0,r=i&&this.input.charCodeAt(this.pos)===48,n=this.pos,a=0,o=0;for(let i=0,n=e??1/0;i<n;++i,++this.pos){let e=this.input.charCodeAt(this.pos),n;if(s&&e===95){r&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),o===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),i===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=e;continue}if(e>=97?n=e-97+10:e>=65?n=e-65+10:e>=48&&e<=57?n=e-48:n=1/0,n>=t)break;o=e,a=a*t+n}return s&&o===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===n||e!=null&&this.pos-n!==e?null:a};Vi.readRadixNumber=function(t){let e=this.pos;this.pos+=2;let i=this.readInt(t);return i==null&&this.raise(this.start+2,"Expected number in radix "+t),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=Ri(this.input.slice(e,this.pos)),++this.pos):Nt(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(Mt.num,i)};Vi.readNumber=function(t){let e=this.pos;!t&&this.readInt(10,void 0,!0)===null&&this.raise(e,"Invalid number");let i=this.pos-e>=2&&this.input.charCodeAt(e)===48;i&&this.strict&&this.raise(e,"Invalid number");let s=this.input.charCodeAt(this.pos);if(!i&&!t&&this.options.ecmaVersion>=11&&s===110){let t=Ri(this.input.slice(e,this.pos));return++this.pos,Nt(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(Mt.num,t)}i&&/[89]/.test(this.input.slice(e,this.pos))&&(i=!1),s===46&&!i&&(++this.pos,this.readInt(10),s=this.input.charCodeAt(this.pos)),(s===69||s===101)&&!i&&(s=this.input.charCodeAt(++this.pos),(s===43||s===45)&&++this.pos,this.readInt(10)===null&&this.raise(e,"Invalid number")),Nt(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");let r=Li(this.input.slice(e,this.pos),i);return this.finishToken(Mt.num,r)};Vi.readCodePoint=function(){let t=this.input.charCodeAt(this.pos),e;if(t===123){this.options.ecmaVersion<6&&this.unexpected();let t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e};Vi.readString=function(t){let e="",i=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");let s=this.input.charCodeAt(this.pos);if(s===t)break;s===92?(e+=this.input.slice(i,this.pos),e+=this.readEscapedChar(!1),i=this.pos):s===8232||s===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):($t(s)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return e+=this.input.slice(i,this.pos++),this.finishToken(Mt.string,e)};var Oi={};Vi.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(t){if(t===Oi)this.readInvalidTemplateToken();else throw t}this.inTemplateElement=!1};Vi.invalidStringToken=function(t,e){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Oi;this.raise(t,e)};Vi.readTmplToken=function(){let t="",e=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");let i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===Mt.template||this.type===Mt.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(Mt.dollarBraceL)):(++this.pos,this.finishToken(Mt.backQuote)):(t+=this.input.slice(e,this.pos),this.finishToken(Mt.template,t));if(i===92)t+=this.input.slice(e,this.pos),t+=this.readEscapedChar(!0),e=this.pos;else if($t(i)){switch(t+=this.input.slice(e,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:t+=`\n`;break;default:t+=String.fromCharCode(i);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),e=this.pos}else++this.pos}};Vi.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(Mt.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":this.input[this.pos+1]===`\n`&&++this.pos;case`\n`:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};Vi.readEscapedChar=function(t){let e=this.input.charCodeAt(++this.pos);switch(++this.pos,e){case 110:return`\n`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Xt(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),t){let t=this.pos-1;this.invalidStringToken(t,"Invalid escape sequence in template string")}default:if(e>=48&&e<=55){let i=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],s=parseInt(i,8);return s>255&&(i=i.slice(0,-1),s=parseInt(i,8)),this.pos+=i.length-1,e=this.input.charCodeAt(this.pos),(i!=="0"||e===56||e===57)&&(this.strict||t)&&this.invalidStringToken(this.pos-1-i.length,t?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(s)}return $t(e)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(e)}};Vi.readHexChar=function(t){let e=this.pos,i=this.readInt(16,t);return i===null&&this.invalidStringToken(e,"Bad character escape sequence"),i};Vi.readWord1=function(){this.containsEsc=!1;let t="",e=!0,i=this.pos,s=this.options.ecmaVersion>=6;for(;this.pos<this.input.length;){let r=this.fullCharCodeAtPos();if(Tt(r,s))this.pos+=r<=65535?1:2;else if(r===92){this.containsEsc=!0,t+=this.input.slice(i,this.pos);let r=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;let n=this.readCodePoint();(e?Nt:Tt)(n,s)||this.invalidStringToken(r,"Invalid Unicode escape"),t+=Xt(n),i=this.pos}else break;e=!1}return t+this.input.slice(i,this.pos)};Vi.readWord=function(){let t=this.readWord1(),e=Mt.name;return this.keywords.test(t)&&(e=jt[t]),this.finishToken(e,t)};var ji="8.19.0";de.acorn={Parser:de,version:ji,defaultOptions:ie,Position:Zt,SourceLocation:te,getLineInfo:ee,Node:Me,TokenType:Vt,tokTypes:Mt,keywordTypes:jt,TokContext:Ie,tokContexts:Pe,isIdentifierChar:Tt,isIdentifierStart:Nt,Token:Ti,isNewLine:$t,lineBreak:Bt,lineBreakG:Ut,nonASCIIwhitespace:qt};var Ui={...yt};var Wi=`npx ${M} add astro [--dry-run] [--json]\n\nAdds format="jxl" to Astro's <Image> and <Picture>, in the Astro site in this folder:\n installs ${M} (and sharp, where Astro has none), writes the image service into src/jxl/,\n imports it in astro.config, adds jxl() to integrations and, on @astrojs/cloudflare, imageService: 'custom'.\nSafe to run again: it updates only files it wrote and nobody edited since.\n --dry-run say what would change, change nothing\n --json one JSON object on stdout`,Gi=["astro.config.mjs","astro.config.js","astro.config.ts","astro.config.mts","astro.config.cjs","astro.config.cts"],Hi="src/jxl",zi=["index.mjs","options.mjs","service.mjs","service-workers.mjs"],Ki=`./${Hi}/index.mjs`,Qi=`add: import jxl from '${Ki}'; integrations: [jxl()] in astro.config`,Ji=t=>ct("sha256").update(t).digest("hex").slice(0,16),Xi=/^\/\/ Written by npx jpegxl add astro \(rapier-jxl [^,]+, ([0-9a-f]{16})\)\. [^\r\n]*\r?\n/,Yi=(t,e=Qi)=>R("JXL_SETUP",t,e),Zi=(t,e)=>t?.type==="CallExpression"&&t.callee.type==="Identifier"&&t.callee.name===e,ts=t=>t.type==="Property"&&!t.computed?t.key.name??t.key.value:null;var as=(t,e)=>pt("astro",t,e);export{Wi as ADD_ASTRO_HELP,Xi as HEADER,ns as addAstro,is as planAstroConfig,es as runAddAstro,as as runRemoveAstro};