@jayadityavetsa/patchproof 0.1.0-alpha.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 (4) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +13 -0
  3. package/dist/cli.cjs +198 -0
  4. package/package.json +52 -0
package/dist/cli.cjs ADDED
@@ -0,0 +1,198 @@
1
+ #!/usr/bin/env node
2
+ "use strict";var lf=Object.create;var Wr=Object.defineProperty;var uf=Object.getOwnPropertyDescriptor;var hf=Object.getOwnPropertyNames;var pf=Object.getPrototypeOf,ff=Object.prototype.hasOwnProperty;var T=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),df=(r,t)=>{for(var e in t)Wr(r,e,{get:t[e],enumerable:!0})},mf=(r,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of hf(t))!ff.call(r,i)&&i!==e&&Wr(r,i,{get:()=>t[i],enumerable:!(s=uf(t,i))||s.enumerable});return r};var Ts=(r,t,e)=>(e=r!=null?lf(pf(r)):{},mf(t||!r||!r.__esModule?Wr(e,"default",{value:r,enumerable:!0}):e,r));var Ss=T(Gr=>{"use strict";var Pi=class extends Error{constructor(t,e,s){super(s),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=e,this.exitCode=t,this.nestedError=void 0}},zr=class extends Pi{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Gr.CommanderError=Pi;Gr.InvalidArgumentError=zr});var Ti=T(Yr=>{"use strict";var{InvalidArgumentError:yf}=Ss(),Jr=class{constructor(t,e){switch(this.description=e||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(t,e){return e===this.defaultValue||!Array.isArray(e)?[t]:(e.push(t),e)}default(t,e){return this.defaultValue=t,this.defaultValueDescription=e,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(e,s)=>{if(!this.argChoices.includes(e))throw new yf(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(e,s):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function gf(r){let t=r.name()+(r.variadic===!0?"...":"");return r.required?"<"+t+">":"["+t+"]"}Yr.Argument=Jr;Yr.humanReadableArgName=gf});var Qr=T(Xr=>{"use strict";var{humanReadableArgName:xf}=Ti(),Zr=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let e=t.commands.filter(i=>!i._hidden),s=t._getHelpCommand();return s&&!s._hidden&&e.push(s),this.sortSubcommands&&e.sort((i,n)=>i.name().localeCompare(n.name())),e}compareOptions(t,e){let s=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return s(t).localeCompare(s(e))}visibleOptions(t){let e=t.options.filter(i=>!i.hidden),s=t._getHelpOption();if(s&&!s.hidden){let i=s.short&&t._findOption(s.short),n=s.long&&t._findOption(s.long);!i&&!n?e.push(s):s.long&&!n?e.push(t.createOption(s.long,s.description)):s.short&&!i&&e.push(t.createOption(s.short,s.description))}return this.sortOptions&&e.sort(this.compareOptions),e}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let e=[];for(let s=t.parent;s;s=s.parent){let i=s.options.filter(n=>!n.hidden);e.push(...i)}return this.sortOptions&&e.sort(this.compareOptions),e}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(e=>{e.description=e.description||t._argsDescription[e.name()]||""}),t.registeredArguments.find(e=>e.description)?t.registeredArguments:[]}subcommandTerm(t){let e=t.registeredArguments.map(s=>xf(s)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(e?" "+e:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,e){return e.visibleCommands(t).reduce((s,i)=>Math.max(s,this.displayWidth(e.styleSubcommandTerm(e.subcommandTerm(i)))),0)}longestOptionTermLength(t,e){return e.visibleOptions(t).reduce((s,i)=>Math.max(s,this.displayWidth(e.styleOptionTerm(e.optionTerm(i)))),0)}longestGlobalOptionTermLength(t,e){return e.visibleGlobalOptions(t).reduce((s,i)=>Math.max(s,this.displayWidth(e.styleOptionTerm(e.optionTerm(i)))),0)}longestArgumentTermLength(t,e){return e.visibleArguments(t).reduce((s,i)=>Math.max(s,this.displayWidth(e.styleArgumentTerm(e.argumentTerm(i)))),0)}commandUsage(t){let e=t._name;t._aliases[0]&&(e=e+"|"+t._aliases[0]);let s="";for(let i=t.parent;i;i=i.parent)s=i.name()+" "+s;return s+e+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let e=[];if(t.argChoices&&e.push(`choices: ${t.argChoices.map(s=>JSON.stringify(s)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&e.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&e.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&e.push(`env: ${t.envVar}`),e.length>0){let s=`(${e.join(", ")})`;return t.description?`${t.description} ${s}`:s}return t.description}argumentDescription(t){let e=[];if(t.argChoices&&e.push(`choices: ${t.argChoices.map(s=>JSON.stringify(s)).join(", ")}`),t.defaultValue!==void 0&&e.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),e.length>0){let s=`(${e.join(", ")})`;return t.description?`${t.description} ${s}`:s}return t.description}formatItemList(t,e,s){return e.length===0?[]:[s.styleTitle(t),...e,""]}groupItems(t,e,s){let i=new Map;return t.forEach(n=>{let a=s(n);i.has(a)||i.set(a,[])}),e.forEach(n=>{let a=s(n);i.has(a)||i.set(a,[]),i.get(a).push(n)}),i}formatHelp(t,e){let s=e.padWidth(t,e),i=e.helpWidth??80;function n(h,p){return e.formatItem(h,s,p,e)}let a=[`${e.styleTitle("Usage:")} ${e.styleUsage(e.commandUsage(t))}`,""],o=e.commandDescription(t);o.length>0&&(a=a.concat([e.boxWrap(e.styleCommandDescription(o),i),""]));let c=e.visibleArguments(t).map(h=>n(e.styleArgumentTerm(e.argumentTerm(h)),e.styleArgumentDescription(e.argumentDescription(h))));if(a=a.concat(this.formatItemList("Arguments:",c,e)),this.groupItems(t.options,e.visibleOptions(t),h=>h.helpGroupHeading??"Options:").forEach((h,p)=>{let f=h.map(y=>n(e.styleOptionTerm(e.optionTerm(y)),e.styleOptionDescription(e.optionDescription(y))));a=a.concat(this.formatItemList(p,f,e))}),e.showGlobalOptions){let h=e.visibleGlobalOptions(t).map(p=>n(e.styleOptionTerm(e.optionTerm(p)),e.styleOptionDescription(e.optionDescription(p))));a=a.concat(this.formatItemList("Global Options:",h,e))}return this.groupItems(t.commands,e.visibleCommands(t),h=>h.helpGroup()||"Commands:").forEach((h,p)=>{let f=h.map(y=>n(e.styleSubcommandTerm(e.subcommandTerm(y)),e.styleSubcommandDescription(e.subcommandDescription(y))));a=a.concat(this.formatItemList(p,f,e))}),a.join(`
3
+ `)}displayWidth(t){return yc(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(e=>e==="[options]"?this.styleOptionText(e):e==="[command]"?this.styleSubcommandText(e):e[0]==="["||e[0]==="<"?this.styleArgumentText(e):this.styleCommandText(e)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(e=>e==="[options]"?this.styleOptionText(e):e[0]==="["||e[0]==="<"?this.styleArgumentText(e):this.styleSubcommandText(e)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,e){return Math.max(e.longestOptionTermLength(t,e),e.longestGlobalOptionTermLength(t,e),e.longestSubcommandTermLength(t,e),e.longestArgumentTermLength(t,e))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,e,s,i){let a=" ".repeat(2);if(!s)return a+t;let o=t.padEnd(e+t.length-i.displayWidth(t)),c=2,u=(this.helpWidth??80)-e-c-2,h;return u<this.minWidthToWrap||i.preformatted(s)?h=s:h=i.boxWrap(s,u).replace(/\n/g,`
4
+ `+" ".repeat(e+c)),a+o+" ".repeat(c)+h.replace(/\n/g,`
5
+ ${a}`)}boxWrap(t,e){if(e<this.minWidthToWrap)return t;let s=t.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,n=[];return s.forEach(a=>{let o=a.match(i);if(o===null){n.push("");return}let c=[o.shift()],l=this.displayWidth(c[0]);o.forEach(u=>{let h=this.displayWidth(u);if(l+h<=e){c.push(u),l+=h;return}n.push(c.join(""));let p=u.trimStart();c=[p],l=this.displayWidth(p)}),n.push(c.join(""))}),n.join(`
6
+ `)}};function yc(r){let t=/\x1b\[\d*(;\d*)*m/g;return r.replace(t,"")}Xr.Help=Zr;Xr.stripColor=yc});var rn=T(sn=>{"use strict";var{InvalidArgumentError:bf}=Ss(),en=class{constructor(t,e){this.flags=t,this.description=e||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let s=wf(t);this.short=s.shortFlag,this.long=s.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(t,e){return this.defaultValue=t,this.defaultValueDescription=e,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let e=t;return typeof t=="string"&&(e={[t]:!0}),this.implied=Object.assign(this.implied||{},e),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_collectValue(t,e){return e===this.defaultValue||!Array.isArray(e)?[t]:(e.push(t),e)}choices(t){return this.argChoices=t.slice(),this.parseArg=(e,s)=>{if(!this.argChoices.includes(e))throw new bf(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(e,s):e},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?gc(this.name().replace(/^no-/,"")):gc(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},tn=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,s)=>{this.positiveOptions.has(s)&&this.dualOptions.add(s)})}valueFromOption(t,e){let s=e.attributeName();if(!this.dualOptions.has(s))return!0;let i=this.negativeOptions.get(s).presetArg,n=i!==void 0?i:!1;return e.negate===(n===t)}};function gc(r){return r.split("-").reduce((t,e)=>t+e[0].toUpperCase()+e.slice(1))}function wf(r){let t,e,s=/^-[^-]$/,i=/^--[^-]/,n=r.split(/[ |,]+/).concat("guard");if(s.test(n[0])&&(t=n.shift()),i.test(n[0])&&(e=n.shift()),!t&&s.test(n[0])&&(t=n.shift()),!t&&i.test(n[0])&&(t=e,e=n.shift()),n[0].startsWith("-")){let a=n[0],o=`option creation failed due to '${a}' in option flags '${r}'`;throw/^-[^-][^-]/.test(a)?new Error(`${o}
7
+ - a short flag is a single dash and a single character
8
+ - either use a single dash and a single character (for a short flag)
9
+ - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):s.test(a)?new Error(`${o}
10
+ - too many short flags`):i.test(a)?new Error(`${o}
11
+ - too many long flags`):new Error(`${o}
12
+ - unrecognised flag format`)}if(t===void 0&&e===void 0)throw new Error(`option creation failed due to no flags found in '${r}'.`);return{shortFlag:t,longFlag:e}}sn.Option=en;sn.DualOptions=tn});var bc=T(xc=>{"use strict";function Pf(r,t){if(Math.abs(r.length-t.length)>3)return Math.max(r.length,t.length);let e=[];for(let s=0;s<=r.length;s++)e[s]=[s];for(let s=0;s<=t.length;s++)e[0][s]=s;for(let s=1;s<=t.length;s++)for(let i=1;i<=r.length;i++){let n=1;r[i-1]===t[s-1]?n=0:n=1,e[i][s]=Math.min(e[i-1][s]+1,e[i][s-1]+1,e[i-1][s-1]+n),i>1&&s>1&&r[i-1]===t[s-2]&&r[i-2]===t[s-1]&&(e[i][s]=Math.min(e[i][s],e[i-2][s-2]+1))}return e[r.length][t.length]}function Tf(r,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let e=r.startsWith("--");e&&(r=r.slice(2),t=t.map(a=>a.slice(2)));let s=[],i=3,n=.4;return t.forEach(a=>{if(a.length<=1)return;let o=Pf(r,a),c=Math.max(r.length,a.length);(c-o)/c>n&&(o<i?(i=o,s=[a]):o===i&&s.push(a))}),s.sort((a,o)=>a.localeCompare(o)),e&&(s=s.map(a=>`--${a}`)),s.length>1?`
13
+ (Did you mean one of ${s.join(", ")}?)`:s.length===1?`
14
+ (Did you mean ${s[0]}?)`:""}xc.suggestSimilar=Tf});var Sc=T(ln=>{"use strict";var Sf=require("events").EventEmitter,nn=require("child_process"),Ve=require("path"),Si=require("fs"),K=require("process"),{Argument:Af,humanReadableArgName:vf}=Ti(),{CommanderError:an}=Ss(),{Help:Cf,stripColor:kf}=Qr(),{Option:wc,DualOptions:Ef}=rn(),{suggestSimilar:Pc}=bc(),on=class r extends Sf{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:e=>K.stdout.write(e),writeErr:e=>K.stderr.write(e),outputError:(e,s)=>s(e),getOutHelpWidth:()=>K.stdout.isTTY?K.stdout.columns:void 0,getErrHelpWidth:()=>K.stderr.isTTY?K.stderr.columns:void 0,getOutHasColors:()=>cn()??(K.stdout.isTTY&&K.stdout.hasColors?.()),getErrHasColors:()=>cn()??(K.stderr.isTTY&&K.stderr.hasColors?.()),stripColor:e=>kf(e)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let e=this;e;e=e.parent)t.push(e);return t}command(t,e,s){let i=e,n=s;typeof i=="object"&&i!==null&&(n=i,i=null),n=n||{};let[,a,o]=t.match(/([^ ]+) *(.*)/),c=this.createCommand(a);return i&&(c.description(i),c._executableHandler=!0),n.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(n.noHelp||n.hidden),c._executableFile=n.executableFile||null,o&&c.arguments(o),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),i?this:c}createCommand(t){return new r(t)}createHelp(){return Object.assign(new Cf,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...t},this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,e){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
15
+ - specify the name in Command constructor or using .name()`);return e=e||{},e.isDefault&&(this._defaultCommandName=t._name),(e.noHelp||e.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,e){return new Af(t,e)}argument(t,e,s,i){let n=this.createArgument(t,e);return typeof s=="function"?n.default(i).argParser(s):n.default(s),this.addArgument(n),this}arguments(t){return t.trim().split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(t){let e=this.registeredArguments.slice(-1)[0];if(e?.variadic)throw new Error(`only the last argument can be variadic '${e.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,e){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let s=t??"help [command]",[,i,n]=s.match(/([^ ]+) *(.*)/),a=e??"display help for command",o=this.createCommand(i);return o.helpOption(!1),n&&o.arguments(n),a&&o.description(a),this._addImplicitHelpCommand=!0,this._helpCommand=o,(t||e)&&this._initCommandGroup(o),this}addHelpCommand(t,e){return typeof t!="object"?(this.helpCommand(t,e),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this._initCommandGroup(t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,e){let s=["preSubcommand","preAction","postAction"];if(!s.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
16
+ Expecting one of '${s.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(e):this._lifeCycleHooks[t]=[e],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=e=>{if(e.code!=="commander.executeSubCommandAsync")throw e},this}_exit(t,e,s){this._exitCallback&&this._exitCallback(new an(t,e,s)),K.exit(t)}action(t){let e=s=>{let i=this.registeredArguments.length,n=s.slice(0,i);return this._storeOptionsAsProperties?n[i]=this:n[i]=this.opts(),n.push(this),t.apply(this,n)};return this._actionHandler=e,this}createOption(t,e){return new wc(t,e)}_callParseArg(t,e,s,i){try{return t.parseArg(e,s)}catch(n){if(n.code==="commander.invalidArgument"){let a=`${i} ${n.message}`;this.error(a,{exitCode:n.exitCode,code:n.code})}throw n}}_registerOption(t){let e=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(e){let s=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${s}'
17
+ - already used by option '${e.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let e=i=>[i.name()].concat(i.aliases()),s=e(t).find(i=>this._findCommand(i));if(s){let i=e(this._findCommand(s)).join("|"),n=e(t).join("|");throw new Error(`cannot add command '${n}' as already have command '${i}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let e=t.name(),s=t.attributeName();if(t.negate){let n=t.long.replace(/^--no-/,"--");this._findOption(n)||this.setOptionValueWithSource(s,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(s,t.defaultValue,"default");let i=(n,a,o)=>{n==null&&t.presetArg!==void 0&&(n=t.presetArg);let c=this.getOptionValue(s);n!==null&&t.parseArg?n=this._callParseArg(t,n,c,a):n!==null&&t.variadic&&(n=t._collectValue(n,c)),n==null&&(t.negate?n=!1:t.isBoolean()||t.optional?n=!0:n=""),this.setOptionValueWithSource(s,n,o)};return this.on("option:"+e,n=>{let a=`error: option '${t.flags}' argument '${n}' is invalid.`;i(n,a,"cli")}),t.envVar&&this.on("optionEnv:"+e,n=>{let a=`error: option '${t.flags}' value '${n}' from env '${t.envVar}' is invalid.`;i(n,a,"env")}),this}_optionEx(t,e,s,i,n){if(typeof e=="object"&&e instanceof wc)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let a=this.createOption(e,s);if(a.makeOptionMandatory(!!t.mandatory),typeof i=="function")a.default(n).argParser(i);else if(i instanceof RegExp){let o=i;i=(c,l)=>{let u=o.exec(c);return u?u[0]:l},a.default(n).argParser(i)}else a.default(i);return this.addOption(a)}option(t,e,s,i){return this._optionEx({},t,e,s,i)}requiredOption(t,e,s,i){return this._optionEx({mandatory:!0},t,e,s,i)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,e){return this.setOptionValueWithSource(t,e,void 0)}setOptionValueWithSource(t,e,s){return this._storeOptionsAsProperties?this[t]=e:this._optionValues[t]=e,this._optionValueSources[t]=s,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let e;return this._getCommandAndAncestors().forEach(s=>{s.getOptionValueSource(t)!==void 0&&(e=s.getOptionValueSource(t))}),e}_prepareUserArgs(t,e){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(e=e||{},t===void 0&&e.from===void 0){K.versions?.electron&&(e.from="electron");let i=K.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(e.from="eval")}t===void 0&&(t=K.argv),this.rawArgs=t.slice();let s;switch(e.from){case void 0:case"node":this._scriptPath=t[1],s=t.slice(2);break;case"electron":K.defaultApp?(this._scriptPath=t[1],s=t.slice(2)):s=t.slice(1);break;case"user":s=t.slice(0);break;case"eval":s=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${e.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",s}parse(t,e){this._prepareForParse();let s=this._prepareUserArgs(t,e);return this._parseCommand([],s),this}async parseAsync(t,e){this._prepareForParse();let s=this._prepareUserArgs(t,e);return await this._parseCommand([],s),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
18
+ - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,e,s){if(Si.existsSync(t))return;let i=e?`searched for local subcommand relative to directory '${e}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",n=`'${t}' does not exist
19
+ - if '${s}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
20
+ - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
21
+ - ${i}`;throw new Error(n)}_executeSubCommand(t,e){e=e.slice();let s=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function n(u,h){let p=Ve.resolve(u,h);if(Si.existsSync(p))return p;if(i.includes(Ve.extname(h)))return;let f=i.find(y=>Si.existsSync(`${p}${y}`));if(f)return`${p}${f}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let a=t._executableFile||`${this._name}-${t._name}`,o=this._executableDir||"";if(this._scriptPath){let u;try{u=Si.realpathSync(this._scriptPath)}catch{u=this._scriptPath}o=Ve.resolve(Ve.dirname(u),o)}if(o){let u=n(o,a);if(!u&&!t._executableFile&&this._scriptPath){let h=Ve.basename(this._scriptPath,Ve.extname(this._scriptPath));h!==this._name&&(u=n(o,`${h}-${t._name}`))}a=u||a}s=i.includes(Ve.extname(a));let c;K.platform!=="win32"?s?(e.unshift(a),e=Tc(K.execArgv).concat(e),c=nn.spawn(K.argv[0],e,{stdio:"inherit"})):c=nn.spawn(a,e,{stdio:"inherit"}):(this._checkForMissingExecutable(a,o,t._name),e.unshift(a),e=Tc(K.execArgv).concat(e),c=nn.spawn(K.execPath,e,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(h=>{K.on(h,()=>{c.killed===!1&&c.exitCode===null&&c.kill(h)})});let l=this._exitCallback;c.on("close",u=>{u=u??1,l?l(new an(u,"commander.executeSubCommandAsync","(close)")):K.exit(u)}),c.on("error",u=>{if(u.code==="ENOENT")this._checkForMissingExecutable(a,o,t._name);else if(u.code==="EACCES")throw new Error(`'${a}' not executable`);if(!l)K.exit(1);else{let h=new an(1,"commander.executeSubCommandAsync","(error)");h.nestedError=u,l(h)}}),this.runningCommand=c}_dispatchSubcommand(t,e,s){let i=this._findCommand(t);i||this.help({error:!0}),i._prepareForParse();let n;return n=this._chainOrCallSubCommandHook(n,i,"preSubcommand"),n=this._chainOrCall(n,()=>{if(i._executableHandler)this._executeSubCommand(i,e.concat(s));else return i._parseCommand(e,s)}),n}_dispatchHelpCommand(t){t||this.help();let e=this._findCommand(t);return e&&!e._executableHandler&&e.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,e)=>{t.required&&this.args[e]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(s,i,n)=>{let a=i;if(i!==null&&s.parseArg){let o=`error: command-argument value '${i}' is invalid for argument '${s.name()}'.`;a=this._callParseArg(s,i,n,o)}return a};this._checkNumberOfArguments();let e=[];this.registeredArguments.forEach((s,i)=>{let n=s.defaultValue;s.variadic?i<this.args.length?(n=this.args.slice(i),s.parseArg&&(n=n.reduce((a,o)=>t(s,o,a),s.defaultValue))):n===void 0&&(n=[]):i<this.args.length&&(n=this.args[i],s.parseArg&&(n=t(s,n,s.defaultValue))),e[i]=n}),this.processedArgs=e}_chainOrCall(t,e){return t?.then&&typeof t.then=="function"?t.then(()=>e()):e()}_chainOrCallHooks(t,e){let s=t,i=[];return this._getCommandAndAncestors().reverse().filter(n=>n._lifeCycleHooks[e]!==void 0).forEach(n=>{n._lifeCycleHooks[e].forEach(a=>{i.push({hookedCommand:n,callback:a})})}),e==="postAction"&&i.reverse(),i.forEach(n=>{s=this._chainOrCall(s,()=>n.callback(n.hookedCommand,this))}),s}_chainOrCallSubCommandHook(t,e,s){let i=t;return this._lifeCycleHooks[s]!==void 0&&this._lifeCycleHooks[s].forEach(n=>{i=this._chainOrCall(i,()=>n(this,e))}),i}_parseCommand(t,e){let s=this.parseOptions(e);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(s.operands),e=s.unknown,this.args=t.concat(e),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),e);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(e),this._dispatchSubcommand(this._defaultCommandName,t,e);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(s.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{s.unknown.length>0&&this.unknownOption(s.unknown[0])},n=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let a;return a=this._chainOrCallHooks(a,"preAction"),a=this._chainOrCall(a,()=>this._actionHandler(this.processedArgs)),this.parent&&(a=this._chainOrCall(a,()=>{this.parent.emit(n,t,e)})),a=this._chainOrCallHooks(a,"postAction"),a}if(this.parent?.listenerCount(n))i(),this._processArguments(),this.parent.emit(n,t,e);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,e);this.listenerCount("command:*")?this.emit("command:*",t,e):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(e=>e._name===t||e._aliases.includes(t))}_findOption(t){return this.options.find(e=>e.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(e=>{e.mandatory&&t.getOptionValue(e.attributeName())===void 0&&t.missingMandatoryOptionValue(e)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(s=>{let i=s.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});t.filter(s=>s.conflictsWith.length>0).forEach(s=>{let i=t.find(n=>s.conflictsWith.includes(n.attributeName()));i&&this._conflictingOption(s,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let e=[],s=[],i=e;function n(u){return u.length>1&&u[0]==="-"}let a=u=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(u)?!this._getCommandAndAncestors().some(h=>h.options.map(p=>p.short).some(p=>/^-\d$/.test(p))):!1,o=null,c=null,l=0;for(;l<t.length||c;){let u=c??t[l++];if(c=null,u==="--"){i===s&&i.push(u),i.push(...t.slice(l));break}if(o&&(!n(u)||a(u))){this.emit(`option:${o.name()}`,u);continue}if(o=null,n(u)){let h=this._findOption(u);if(h){if(h.required){let p=t[l++];p===void 0&&this.optionMissingArgument(h),this.emit(`option:${h.name()}`,p)}else if(h.optional){let p=null;l<t.length&&(!n(t[l])||a(t[l]))&&(p=t[l++]),this.emit(`option:${h.name()}`,p)}else this.emit(`option:${h.name()}`);o=h.variadic?h:null;continue}}if(u.length>2&&u[0]==="-"&&u[1]!=="-"){let h=this._findOption(`-${u[1]}`);if(h){h.required||h.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${h.name()}`,u.slice(2)):(this.emit(`option:${h.name()}`),c=`-${u.slice(2)}`);continue}}if(/^--[^=]+=/.test(u)){let h=u.indexOf("="),p=this._findOption(u.slice(0,h));if(p&&(p.required||p.optional)){this.emit(`option:${p.name()}`,u.slice(h+1));continue}}if(i===e&&n(u)&&!(this.commands.length===0&&a(u))&&(i=s),(this._enablePositionalOptions||this._passThroughOptions)&&e.length===0&&s.length===0){if(this._findCommand(u)){e.push(u),s.push(...t.slice(l));break}else if(this._getHelpCommand()&&u===this._getHelpCommand().name()){e.push(u,...t.slice(l));break}else if(this._defaultCommandName){s.push(u,...t.slice(l));break}}if(this._passThroughOptions){i.push(u,...t.slice(l));break}i.push(u)}return{operands:e,unknown:s}}opts(){if(this._storeOptionsAsProperties){let t={},e=this.options.length;for(let s=0;s<e;s++){let i=this.options[s].attributeName();t[i]=i===this._versionOptionName?this._version:this[i]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,e)=>Object.assign(t,e.opts()),{})}error(t,e){this._outputConfiguration.outputError(`${t}
22
+ `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
23
+ `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
24
+ `),this.outputHelp({error:!0}));let s=e||{},i=s.exitCode||1,n=s.code||"commander.error";this._exit(i,n,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in K.env){let e=t.attributeName();(this.getOptionValue(e)===void 0||["default","config","env"].includes(this.getOptionValueSource(e)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,K.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new Ef(this.options),e=s=>this.getOptionValue(s)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(s));this.options.filter(s=>s.implied!==void 0&&e(s.attributeName())&&t.valueFromOption(this.getOptionValue(s.attributeName()),s)).forEach(s=>{Object.keys(s.implied).filter(i=>!e(i)).forEach(i=>{this.setOptionValueWithSource(i,s.implied[i],"implied")})})}missingArgument(t){let e=`error: missing required argument '${t}'`;this.error(e,{code:"commander.missingArgument"})}optionMissingArgument(t){let e=`error: option '${t.flags}' argument missing`;this.error(e,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let e=`error: required option '${t.flags}' not specified`;this.error(e,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,e){let s=a=>{let o=a.attributeName(),c=this.getOptionValue(o),l=this.options.find(h=>h.negate&&o===h.attributeName()),u=this.options.find(h=>!h.negate&&o===h.attributeName());return l&&(l.presetArg===void 0&&c===!1||l.presetArg!==void 0&&c===l.presetArg)?l:u||a},i=a=>{let o=s(a),c=o.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${o.envVar}'`:`option '${o.flags}'`},n=`error: ${i(t)} cannot be used with ${i(e)}`;this.error(n,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let e="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[],n=this;do{let a=n.createHelp().visibleOptions(n).filter(o=>o.long).map(o=>o.long);i=i.concat(a),n=n.parent}while(n&&!n._enablePositionalOptions);e=Pc(t,i)}let s=`error: unknown option '${t}'${e}`;this.error(s,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let e=this.registeredArguments.length,s=e===1?"":"s",n=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${e} argument${s} but got ${t.length}.`;this.error(n,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],e="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(n=>{i.push(n.name()),n.alias()&&i.push(n.alias())}),e=Pc(t,i)}let s=`error: unknown command '${t}'${e}`;this.error(s,{code:"commander.unknownCommand"})}version(t,e,s){if(t===void 0)return this._version;this._version=t,e=e||"-V, --version",s=s||"output the version number";let i=this.createOption(e,s);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${t}
25
+ `),this._exit(0,"commander.version",t)}),this}description(t,e){return t===void 0&&e===void 0?this._description:(this._description=t,e&&(this._argsDescription=e),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let e=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(e=this.commands[this.commands.length-1]),t===e._name)throw new Error("Command alias can't be the same as its name");let s=this.parent?._findCommand(t);if(s){let i=[s.name()].concat(s.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${i}'`)}return e._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(e=>this.alias(e)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let e=this.registeredArguments.map(s=>vf(s));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?e:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=Ve.basename(t,Ve.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let e=this.createHelp(),s=this._getOutputContext(t);e.prepareContext({error:s.error,helpWidth:s.helpWidth,outputHasColors:s.hasColors});let i=e.formatHelp(this,e);return s.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(t){t=t||{};let e=!!t.error,s,i,n;return e?(s=o=>this._outputConfiguration.writeErr(o),i=this._outputConfiguration.getErrHasColors(),n=this._outputConfiguration.getErrHelpWidth()):(s=o=>this._outputConfiguration.writeOut(o),i=this._outputConfiguration.getOutHasColors(),n=this._outputConfiguration.getOutHelpWidth()),{error:e,write:o=>(i||(o=this._outputConfiguration.stripColor(o)),s(o)),hasColors:i,helpWidth:n}}outputHelp(t){let e;typeof t=="function"&&(e=t,t=void 0);let s=this._getOutputContext(t),i={error:s.error,write:s.write,command:this};this._getCommandAndAncestors().reverse().forEach(a=>a.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let n=this.helpInformation({error:s.error});if(e&&(n=e(n),typeof n!="string"&&!Buffer.isBuffer(n)))throw new Error("outputHelp callback must return a string or a Buffer");s.write(n),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(a=>a.emit("afterAllHelp",i))}helpOption(t,e){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",e??"display help for command"),(t||e)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let e=Number(K.exitCode??0);e===0&&t&&typeof t!="function"&&t.error&&(e=1),this._exit(e,"commander.help","(outputHelp)")}addHelpText(t,e){let s=["beforeAll","before","after","afterAll"];if(!s.includes(t))throw new Error(`Unexpected value for position to addHelpText.
26
+ Expecting one of '${s.join("', '")}'`);let i=`${t}Help`;return this.on(i,n=>{let a;typeof e=="function"?a=e({error:n.error,command:n.command}):a=e,a&&n.write(`${a}
27
+ `)}),this}_outputHelpIfRequested(t){let e=this._getHelpOption();e&&t.find(i=>e.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Tc(r){return r.map(t=>{if(!t.startsWith("--inspect"))return t;let e,s="127.0.0.1",i="9229",n;return(n=t.match(/^(--inspect(-brk)?)$/))!==null?e=n[1]:(n=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(e=n[1],/^\d+$/.test(n[3])?i=n[3]:s=n[3]):(n=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(e=n[1],s=n[3],i=n[4]),e&&i!=="0"?`${e}=${s}:${parseInt(i)+1}`:t})}function cn(){if(K.env.NO_COLOR||K.env.FORCE_COLOR==="0"||K.env.FORCE_COLOR==="false")return!1;if(K.env.FORCE_COLOR||K.env.CLICOLOR_FORCE!==void 0)return!0}ln.Command=on;ln.useColor=cn});var kc=T(we=>{"use strict";var{Argument:Ac}=Ti(),{Command:un}=Sc(),{CommanderError:Nf,InvalidArgumentError:vc}=Ss(),{Help:If}=Qr(),{Option:Cc}=rn();we.program=new un;we.createCommand=r=>new un(r);we.createOption=(r,t)=>new Cc(r,t);we.createArgument=(r,t)=>new Ac(r,t);we.Command=un;we.Option=Cc;we.Argument=Ac;we.Help=If;we.CommanderError=Nf;we.InvalidArgumentError=vc;we.InvalidOptionArgumentError=vc});var V=T(se=>{"use strict";var pn=Symbol.for("yaml.alias"),Dc=Symbol.for("yaml.document"),Ai=Symbol.for("yaml.map"),Rc=Symbol.for("yaml.pair"),fn=Symbol.for("yaml.scalar"),vi=Symbol.for("yaml.seq"),He=Symbol.for("yaml.node.type"),_f=r=>!!r&&typeof r=="object"&&r[He]===pn,Of=r=>!!r&&typeof r=="object"&&r[He]===Dc,Lf=r=>!!r&&typeof r=="object"&&r[He]===Ai,Mf=r=>!!r&&typeof r=="object"&&r[He]===Rc,Fc=r=>!!r&&typeof r=="object"&&r[He]===fn,Df=r=>!!r&&typeof r=="object"&&r[He]===vi;function $c(r){if(r&&typeof r=="object")switch(r[He]){case Ai:case vi:return!0}return!1}function Rf(r){if(r&&typeof r=="object")switch(r[He]){case pn:case Ai:case fn:case vi:return!0}return!1}var Ff=r=>(Fc(r)||$c(r))&&!!r.anchor;se.ALIAS=pn;se.DOC=Dc;se.MAP=Ai;se.NODE_TYPE=He;se.PAIR=Rc;se.SCALAR=fn;se.SEQ=vi;se.hasAnchor=Ff;se.isAlias=_f;se.isCollection=$c;se.isDocument=Of;se.isMap=Lf;se.isNode=Rf;se.isPair=Mf;se.isScalar=Fc;se.isSeq=Df});var As=T(dn=>{"use strict";var te=V(),ue=Symbol("break visit"),jc=Symbol("skip children"),Oe=Symbol("remove node");function Ci(r,t){let e=Bc(t);te.isDocument(r)?Wt(null,r.contents,e,Object.freeze([r]))===Oe&&(r.contents=null):Wt(null,r,e,Object.freeze([]))}Ci.BREAK=ue;Ci.SKIP=jc;Ci.REMOVE=Oe;function Wt(r,t,e,s){let i=qc(r,t,e,s);if(te.isNode(i)||te.isPair(i))return Uc(r,s,i),Wt(r,i,e,s);if(typeof i!="symbol"){if(te.isCollection(t)){s=Object.freeze(s.concat(t));for(let n=0;n<t.items.length;++n){let a=Wt(n,t.items[n],e,s);if(typeof a=="number")n=a-1;else{if(a===ue)return ue;a===Oe&&(t.items.splice(n,1),n-=1)}}}else if(te.isPair(t)){s=Object.freeze(s.concat(t));let n=Wt("key",t.key,e,s);if(n===ue)return ue;n===Oe&&(t.key=null);let a=Wt("value",t.value,e,s);if(a===ue)return ue;a===Oe&&(t.value=null)}}return i}async function ki(r,t){let e=Bc(t);te.isDocument(r)?await zt(null,r.contents,e,Object.freeze([r]))===Oe&&(r.contents=null):await zt(null,r,e,Object.freeze([]))}ki.BREAK=ue;ki.SKIP=jc;ki.REMOVE=Oe;async function zt(r,t,e,s){let i=await qc(r,t,e,s);if(te.isNode(i)||te.isPair(i))return Uc(r,s,i),zt(r,i,e,s);if(typeof i!="symbol"){if(te.isCollection(t)){s=Object.freeze(s.concat(t));for(let n=0;n<t.items.length;++n){let a=await zt(n,t.items[n],e,s);if(typeof a=="number")n=a-1;else{if(a===ue)return ue;a===Oe&&(t.items.splice(n,1),n-=1)}}}else if(te.isPair(t)){s=Object.freeze(s.concat(t));let n=await zt("key",t.key,e,s);if(n===ue)return ue;n===Oe&&(t.key=null);let a=await zt("value",t.value,e,s);if(a===ue)return ue;a===Oe&&(t.value=null)}}return i}function Bc(r){return typeof r=="object"&&(r.Collection||r.Node||r.Value)?Object.assign({Alias:r.Node,Map:r.Node,Scalar:r.Node,Seq:r.Node},r.Value&&{Map:r.Value,Scalar:r.Value,Seq:r.Value},r.Collection&&{Map:r.Collection,Seq:r.Collection},r):r}function qc(r,t,e,s){if(typeof e=="function")return e(r,t,s);if(te.isMap(t))return e.Map?.(r,t,s);if(te.isSeq(t))return e.Seq?.(r,t,s);if(te.isPair(t))return e.Pair?.(r,t,s);if(te.isScalar(t))return e.Scalar?.(r,t,s);if(te.isAlias(t))return e.Alias?.(r,t,s)}function Uc(r,t,e){let s=t[t.length-1];if(te.isCollection(s))s.items[r]=e;else if(te.isPair(s))r==="key"?s.key=e:s.value=e;else if(te.isDocument(s))s.contents=e;else{let i=te.isAlias(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}dn.visit=Ci;dn.visitAsync=ki});var mn=T(Hc=>{"use strict";var Vc=V(),$f=As(),jf={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Bf=r=>r.replace(/[!,[\]{}]/g,t=>jf[t]),vs=class r{constructor(t,e){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},r.defaultYaml,t),this.tags=Object.assign({},r.defaultTags,e)}clone(){let t=new r(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new r(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:r.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},r.defaultTags);break}return t}add(t,e){this.atNextDocument&&(this.yaml={explicit:r.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},r.defaultTags),this.atNextDocument=!1);let s=t.trim().split(/[ \t]+/),i=s.shift();switch(i){case"%TAG":{if(s.length!==2&&(e(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;let[n,a]=s;return this.tags[n]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return e(0,"%YAML directive should contain exactly one part"),!1;let[n]=s;if(n==="1.1"||n==="1.2")return this.yaml.version=n,!0;{let a=/^\d+\.\d+$/.test(n);return e(6,`Unsupported YAML version ${n}`,a),!1}}default:return e(0,`Unknown directive ${i}`,!0),!1}}tagName(t,e){if(t==="!")return"!";if(t[0]!=="!")return e(`Not a valid tag: ${t}`),null;if(t[1]==="<"){let a=t.slice(2,-1);return a==="!"||a==="!!"?(e(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&e("Verbatim tags must end with a >"),a)}let[,s,i]=t.match(/^(.*!)([^!]*)$/s);i||e(`The ${t} tag has no suffix`);let n=this.tags[s];if(n)try{return n+decodeURIComponent(i)}catch(a){return e(String(a)),null}return s==="!"?t:(e(`Could not resolve tag: ${t}`),null)}tagString(t){for(let[e,s]of Object.entries(this.tags))if(t.startsWith(s))return e+Bf(t.substring(s.length));return t[0]==="!"?t:`!<${t}>`}toString(t){let e=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags),i;if(t&&s.length>0&&Vc.isNode(t.contents)){let n={};$f.visit(t.contents,(a,o)=>{Vc.isNode(o)&&o.tag&&(n[o.tag]=!0)}),i=Object.keys(n)}else i=[];for(let[n,a]of s)n==="!!"&&a==="tag:yaml.org,2002:"||(!t||i.some(o=>o.startsWith(a)))&&e.push(`%TAG ${n} ${a}`);return e.join(`
28
+ `)}};vs.defaultYaml={explicit:!1,version:"1.2"};vs.defaultTags={"!!":"tag:yaml.org,2002:"};Hc.Directives=vs});var Ei=T(Cs=>{"use strict";var Kc=V(),qf=As();function Uf(r){if(/[\x00-\x19\s,[\]{}]/.test(r)){let e=`Anchor must not contain whitespace or control characters: ${JSON.stringify(r)}`;throw new Error(e)}return!0}function Wc(r){let t=new Set;return qf.visit(r,{Value(e,s){s.anchor&&t.add(s.anchor)}}),t}function zc(r,t){for(let e=1;;++e){let s=`${r}${e}`;if(!t.has(s))return s}}function Vf(r,t){let e=[],s=new Map,i=null;return{onAnchor:n=>{e.push(n),i??(i=Wc(r));let a=zc(t,i);return i.add(a),a},setAnchors:()=>{for(let n of e){let a=s.get(n);if(typeof a=="object"&&a.anchor&&(Kc.isScalar(a.node)||Kc.isCollection(a.node)))a.node.anchor=a.anchor;else{let o=new Error("Failed to resolve repeated object (this should not happen)");throw o.source=n,o}}},sourceObjects:s}}Cs.anchorIsValid=Uf;Cs.anchorNames=Wc;Cs.createNodeAnchors=Vf;Cs.findNewAnchor=zc});var yn=T(Gc=>{"use strict";function ks(r,t,e,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let i=0,n=s.length;i<n;++i){let a=s[i],o=ks(r,s,String(i),a);o===void 0?delete s[i]:o!==a&&(s[i]=o)}else if(s instanceof Map)for(let i of Array.from(s.keys())){let n=s.get(i),a=ks(r,s,i,n);a===void 0?s.delete(i):a!==n&&s.set(i,a)}else if(s instanceof Set)for(let i of Array.from(s)){let n=ks(r,s,i,i);n===void 0?s.delete(i):n!==i&&(s.delete(i),s.add(n))}else for(let[i,n]of Object.entries(s)){let a=ks(r,s,i,n);a===void 0?delete s[i]:a!==n&&(s[i]=a)}return r.call(t,e,s)}Gc.applyReviver=ks});var Xe=T(Yc=>{"use strict";var Hf=V();function Jc(r,t,e){if(Array.isArray(r))return r.map((s,i)=>Jc(s,String(i),e));if(r&&typeof r.toJSON=="function"){if(!e||!Hf.hasAnchor(r))return r.toJSON(t,e);let s={aliasCount:0,count:1,res:void 0};e.anchors.set(r,s),e.onCreate=n=>{s.res=n,delete e.onCreate};let i=r.toJSON(t,e);return e.onCreate&&e.onCreate(i),i}return typeof r=="bigint"&&!e?.keep?Number(r):r}Yc.toJS=Jc});var Ni=T(Xc=>{"use strict";var Kf=yn(),Zc=V(),Wf=Xe(),gn=class{constructor(t){Object.defineProperty(this,Zc.NODE_TYPE,{value:t})}clone(){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:e,maxAliasCount:s,onAnchor:i,reviver:n}={}){if(!Zc.isDocument(t))throw new TypeError("A document argument is required");let a={anchors:new Map,doc:t,keep:!0,mapAsMap:e===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},o=Wf.toJS(this,"",a);if(typeof i=="function")for(let{count:c,res:l}of a.anchors.values())i(l,c);return typeof n=="function"?Kf.applyReviver(n,{"":o},"",o):o}};Xc.NodeBase=gn});var Es=T(Qc=>{"use strict";var zf=Ei(),Gf=As(),Gt=V(),Jf=Ni(),Yf=Xe(),xn=class extends Jf.NodeBase{constructor(t){super(Gt.ALIAS),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,e){if(e?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let s;e?.aliasResolveCache?s=e.aliasResolveCache:(s=[],Gf.visit(t,{Node:(n,a)=>{(Gt.isAlias(a)||Gt.hasAnchor(a))&&s.push(a)}}),e&&(e.aliasResolveCache=s));let i;for(let n of s){if(n===this)break;n.anchor===this.source&&(i=n)}return i}toJSON(t,e){if(!e)return{source:this.source};let{anchors:s,doc:i,maxAliasCount:n}=e,a=this.resolve(i,e);if(!a){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let o=s.get(a);if(o||(Yf.toJS(a,null,e),o=s.get(a)),o?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(n>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=Ii(i,a,s)),o.count*o.aliasCount>n)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return o.res}toString(t,e,s){let i=`*${this.source}`;if(t){if(zf.anchorIsValid(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){let n=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(n)}if(t.implicitKey)return`${i} `}return i}};function Ii(r,t,e){if(Gt.isAlias(t)){let s=t.resolve(r),i=e&&s&&e.get(s);return i?i.count*i.aliasCount:0}else if(Gt.isCollection(t)){let s=0;for(let i of t.items){let n=Ii(r,i,e);n>s&&(s=n)}return s}else if(Gt.isPair(t)){let s=Ii(r,t.key,e),i=Ii(r,t.value,e);return Math.max(s,i)}return 1}Qc.Alias=xn});var ee=T(bn=>{"use strict";var Zf=V(),Xf=Ni(),Qf=Xe(),ed=r=>!r||typeof r!="function"&&typeof r!="object",Qe=class extends Xf.NodeBase{constructor(t){super(Zf.SCALAR),this.value=t}toJSON(t,e){return e?.keep?this.value:Qf.toJS(this.value,t,e)}toString(){return String(this.value)}};Qe.BLOCK_FOLDED="BLOCK_FOLDED";Qe.BLOCK_LITERAL="BLOCK_LITERAL";Qe.PLAIN="PLAIN";Qe.QUOTE_DOUBLE="QUOTE_DOUBLE";Qe.QUOTE_SINGLE="QUOTE_SINGLE";bn.Scalar=Qe;bn.isScalarValue=ed});var Ns=T(tl=>{"use strict";var td=Es(),xt=V(),el=ee(),sd="tag:yaml.org,2002:";function id(r,t,e){if(t){let s=e.filter(n=>n.tag===t),i=s.find(n=>!n.format)??s[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return e.find(s=>s.identify?.(r)&&!s.format)}function rd(r,t,e){if(xt.isDocument(r)&&(r=r.contents),xt.isNode(r))return r;if(xt.isPair(r)){let h=e.schema[xt.MAP].createNode?.(e.schema,null,e);return h.items.push(r),h}(r instanceof String||r instanceof Number||r instanceof Boolean||typeof BigInt<"u"&&r instanceof BigInt)&&(r=r.valueOf());let{aliasDuplicateObjects:s,onAnchor:i,onTagObj:n,schema:a,sourceObjects:o}=e,c;if(s&&r&&typeof r=="object"){if(c=o.get(r),c)return c.anchor??(c.anchor=i(r)),new td.Alias(c.anchor);c={anchor:null,node:null},o.set(r,c)}t?.startsWith("!!")&&(t=sd+t.slice(2));let l=id(r,t,a.tags);if(!l){if(r&&typeof r.toJSON=="function"&&(r=r.toJSON()),!r||typeof r!="object"){let h=new el.Scalar(r);return c&&(c.node=h),h}l=r instanceof Map?a[xt.MAP]:Symbol.iterator in Object(r)?a[xt.SEQ]:a[xt.MAP]}n&&(n(l),delete e.onTagObj);let u=l?.createNode?l.createNode(e.schema,r,e):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(e.schema,r,e):new el.Scalar(r);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}tl.createNode=rd});var Oi=T(_i=>{"use strict";var nd=Ns(),Le=V(),ad=Ni();function wn(r,t,e){let s=e;for(let i=t.length-1;i>=0;--i){let n=t[i];if(typeof n=="number"&&Number.isInteger(n)&&n>=0){let a=[];a[n]=s,s=a}else s=new Map([[n,s]])}return nd.createNode(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:r,sourceObjects:new Map})}var sl=r=>r==null||typeof r=="object"&&!!r[Symbol.iterator]().next().done,Pn=class extends ad.NodeBase{constructor(t,e){super(t),Object.defineProperty(this,"schema",{value:e,configurable:!0,enumerable:!1,writable:!0})}clone(t){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(e.schema=t),e.items=e.items.map(s=>Le.isNode(s)||Le.isPair(s)?s.clone(t):s),this.range&&(e.range=this.range.slice()),e}addIn(t,e){if(sl(t))this.add(e);else{let[s,...i]=t,n=this.get(s,!0);if(Le.isCollection(n))n.addIn(i,e);else if(n===void 0&&this.schema)this.set(s,wn(this.schema,i,e));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}deleteIn(t){let[e,...s]=t;if(s.length===0)return this.delete(e);let i=this.get(e,!0);if(Le.isCollection(i))return i.deleteIn(s);throw new Error(`Expected YAML collection at ${e}. Remaining path: ${s}`)}getIn(t,e){let[s,...i]=t,n=this.get(s,!0);return i.length===0?!e&&Le.isScalar(n)?n.value:n:Le.isCollection(n)?n.getIn(i,e):void 0}hasAllNullValues(t){return this.items.every(e=>{if(!Le.isPair(e))return!1;let s=e.value;return s==null||t&&Le.isScalar(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(t){let[e,...s]=t;if(s.length===0)return this.has(e);let i=this.get(e,!0);return Le.isCollection(i)?i.hasIn(s):!1}setIn(t,e){let[s,...i]=t;if(i.length===0)this.set(s,e);else{let n=this.get(s,!0);if(Le.isCollection(n))n.setIn(i,e);else if(n===void 0&&this.schema)this.set(s,wn(this.schema,i,e));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}};_i.Collection=Pn;_i.collectionFromPath=wn;_i.isEmptyPath=sl});var Is=T(Li=>{"use strict";var od=r=>r.replace(/^(?!$)(?: $)?/gm,"#");function Tn(r,t){return/^\n+$/.test(r)?r.substring(1):t?r.replace(/^(?! *$)/gm,t):r}var cd=(r,t,e)=>r.endsWith(`
29
+ `)?Tn(e,t):e.includes(`
30
+ `)?`
31
+ `+Tn(e,t):(r.endsWith(" ")?"":" ")+e;Li.indentComment=Tn;Li.lineComment=cd;Li.stringifyComment=od});var rl=T(_s=>{"use strict";var ld="flow",Sn="block",Mi="quoted";function ud(r,t,e="flow",{indentAtStart:s,lineWidth:i=80,minContentWidth:n=20,onFold:a,onOverflow:o}={}){if(!i||i<0)return r;i<n&&(n=0);let c=Math.max(1+n,1+i-t.length);if(r.length<=c)return r;let l=[],u={},h=i-t.length;typeof s=="number"&&(s>i-Math.max(2,n)?l.push(0):h=i-s);let p,f,y=!1,d=-1,g=-1,x=-1;e===Sn&&(d=il(r,d,t.length),d!==-1&&(h=d+c));for(let P;P=r[d+=1];){if(e===Mi&&P==="\\"){switch(g=d,r[d+1]){case"x":d+=3;break;case"u":d+=5;break;case"U":d+=9;break;default:d+=1}x=d}if(P===`
32
+ `)e===Sn&&(d=il(r,d,t.length)),h=d+t.length+c,p=void 0;else{if(P===" "&&f&&f!==" "&&f!==`
33
+ `&&f!==" "){let v=r[d+1];v&&v!==" "&&v!==`
34
+ `&&v!==" "&&(p=d)}if(d>=h)if(p)l.push(p),h=p+c,p=void 0;else if(e===Mi){for(;f===" "||f===" ";)f=P,P=r[d+=1],y=!0;let v=d>x+1?d-2:g-1;if(u[v])return r;l.push(v),u[v]=!0,h=v+c,p=void 0}else y=!0}f=P}if(y&&o&&o(),l.length===0)return r;a&&a();let b=r.slice(0,l[0]);for(let P=0;P<l.length;++P){let v=l[P],E=l[P+1]||r.length;v===0?b=`
35
+ ${t}${r.slice(0,E)}`:(e===Mi&&u[v]&&(b+=`${r[v]}\\`),b+=`
36
+ ${t}${r.slice(v+1,E)}`)}return b}function il(r,t,e){let s=t,i=t+1,n=r[i];for(;n===" "||n===" ";)if(t<i+e)n=r[++t];else{do n=r[++t];while(n&&n!==`
37
+ `);s=t,i=t+1,n=r[i]}return s}_s.FOLD_BLOCK=Sn;_s.FOLD_FLOW=ld;_s.FOLD_QUOTED=Mi;_s.foldFlowLines=ud});var Ls=T(nl=>{"use strict";var Ce=ee(),et=rl(),Ri=(r,t)=>({indentAtStart:t?r.indent.length:r.indentAtStart,lineWidth:r.options.lineWidth,minContentWidth:r.options.minContentWidth}),Fi=r=>/^(%|---|\.\.\.)/m.test(r);function hd(r,t,e){if(!t||t<0)return!1;let s=t-e,i=r.length;if(i<=s)return!1;for(let n=0,a=0;n<i;++n)if(r[n]===`
38
+ `){if(n-a>s)return!0;if(a=n+1,i-a<=s)return!1}return!0}function Os(r,t){let e=JSON.stringify(r);if(t.options.doubleQuotedAsJSON)return e;let{implicitKey:s}=t,i=t.options.doubleQuotedMinMultiLineLength,n=t.indent||(Fi(r)?" ":""),a="",o=0;for(let c=0,l=e[c];l;l=e[++c])if(l===" "&&e[c+1]==="\\"&&e[c+2]==="n"&&(a+=e.slice(o,c)+"\\ ",c+=1,o=c,l="\\"),l==="\\")switch(e[c+1]){case"u":{a+=e.slice(o,c);let u=e.substr(c+2,4);switch(u){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:u.substr(0,2)==="00"?a+="\\x"+u.substr(2):a+=e.substr(c,6)}c+=5,o=c+1}break;case"n":if(s||e[c+2]==='"'||e.length<i)c+=1;else{for(a+=e.slice(o,c)+`
39
+
40
+ `;e[c+2]==="\\"&&e[c+3]==="n"&&e[c+4]!=='"';)a+=`
41
+ `,c+=2;a+=n,e[c+2]===" "&&(a+="\\"),c+=1,o=c+1}break;default:c+=1}return a=o?a+e.slice(o):e,s?a:et.foldFlowLines(a,n,et.FOLD_QUOTED,Ri(t,!1))}function An(r,t){if(t.options.singleQuote===!1||t.implicitKey&&r.includes(`
42
+ `)||/[ \t]\n|\n[ \t]/.test(r))return Os(r,t);let e=t.indent||(Fi(r)?" ":""),s="'"+r.replace(/'/g,"''").replace(/\n+/g,`$&
43
+ ${e}`)+"'";return t.implicitKey?s:et.foldFlowLines(s,e,et.FOLD_FLOW,Ri(t,!1))}function Jt(r,t){let{singleQuote:e}=t.options,s;if(e===!1)s=Os;else{let i=r.includes('"'),n=r.includes("'");i&&!n?s=An:n&&!i?s=Os:s=e?An:Os}return s(r,t)}var vn;try{vn=new RegExp(`(^|(?<!
44
+ ))
45
+ +(?!
46
+ |$)`,"g")}catch{vn=/\n+(?!\n|$)/g}function Di({comment:r,type:t,value:e},s,i,n){let{blockQuote:a,commentString:o,lineWidth:c}=s.options;if(!a||/\n[\t ]+$/.test(e))return Jt(e,s);let l=s.indent||(s.forceBlockIndent||Fi(e)?" ":""),u=a==="literal"?!0:a==="folded"||t===Ce.Scalar.BLOCK_FOLDED?!1:t===Ce.Scalar.BLOCK_LITERAL?!0:!hd(e,c,l.length);if(!e)return u?`|
47
+ `:`>
48
+ `;let h,p;for(p=e.length;p>0;--p){let E=e[p-1];if(E!==`
49
+ `&&E!==" "&&E!==" ")break}let f=e.substring(p),y=f.indexOf(`
50
+ `);y===-1?h="-":e===f||y!==f.length-1?(h="+",n&&n()):h="",f&&(e=e.slice(0,-f.length),f[f.length-1]===`
51
+ `&&(f=f.slice(0,-1)),f=f.replace(vn,`$&${l}`));let d=!1,g,x=-1;for(g=0;g<e.length;++g){let E=e[g];if(E===" ")d=!0;else if(E===`
52
+ `)x=g;else break}let b=e.substring(0,x<g?x+1:g);b&&(e=e.substring(b.length),b=b.replace(/\n+/g,`$&${l}`));let v=(d?l?"2":"1":"")+h;if(r&&(v+=" "+o(r.replace(/ ?[\r\n]+/g," ")),i&&i()),!u){let E=e.replace(/\n+/g,`
53
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),L=!1,U=Ri(s,!0);a!=="folded"&&t!==Ce.Scalar.BLOCK_FOLDED&&(U.onOverflow=()=>{L=!0});let N=et.foldFlowLines(`${b}${E}${f}`,l,et.FOLD_BLOCK,U);if(!L)return`>${v}
54
+ ${l}${N}`}return e=e.replace(/\n+/g,`$&${l}`),`|${v}
55
+ ${l}${b}${e}${f}`}function pd(r,t,e,s){let{type:i,value:n}=r,{actualString:a,implicitKey:o,indent:c,indentStep:l,inFlow:u}=t;if(o&&n.includes(`
56
+ `)||u&&/[[\]{},]/.test(n))return Jt(n,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(n))return o||u||!n.includes(`
57
+ `)?Jt(n,t):Di(r,t,e,s);if(!o&&!u&&i!==Ce.Scalar.PLAIN&&n.includes(`
58
+ `))return Di(r,t,e,s);if(Fi(n)){if(c==="")return t.forceBlockIndent=!0,Di(r,t,e,s);if(o&&c===l)return Jt(n,t)}let h=n.replace(/\n+/g,`$&
59
+ ${c}`);if(a){let p=d=>d.default&&d.tag!=="tag:yaml.org,2002:str"&&d.test?.test(h),{compat:f,tags:y}=t.doc.schema;if(y.some(p)||f?.some(p))return Jt(n,t)}return o?h:et.foldFlowLines(h,c,et.FOLD_FLOW,Ri(t,!1))}function fd(r,t,e,s){let{implicitKey:i,inFlow:n}=t,a=typeof r.value=="string"?r:Object.assign({},r,{value:String(r.value)}),{type:o}=r;o!==Ce.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(o=Ce.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Ce.Scalar.BLOCK_FOLDED:case Ce.Scalar.BLOCK_LITERAL:return i||n?Jt(a.value,t):Di(a,t,e,s);case Ce.Scalar.QUOTE_DOUBLE:return Os(a.value,t);case Ce.Scalar.QUOTE_SINGLE:return An(a.value,t);case Ce.Scalar.PLAIN:return pd(a,t,e,s);default:return null}},l=c(o);if(l===null){let{defaultKeyType:u,defaultStringType:h}=t.options,p=i&&u||h;if(l=c(p),l===null)throw new Error(`Unsupported default string type ${p}`)}return l}nl.stringifyString=fd});var Ms=T(Cn=>{"use strict";var dd=Ei(),tt=V(),md=Is(),yd=Ls();function gd(r,t){let e=Object.assign({blockQuote:!0,commentString:md.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},r.schema.toStringOptions,t),s;switch(e.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:r,flowCollectionPadding:e.flowCollectionPadding?" ":"",indent:"",indentStep:typeof e.indent=="number"?" ".repeat(e.indent):" ",inFlow:s,options:e}}function xd(r,t){if(t.tag){let i=r.filter(n=>n.tag===t.tag);if(i.length>0)return i.find(n=>n.format===t.format)??i[0]}let e,s;if(tt.isScalar(t)){s=t.value;let i=r.filter(n=>n.identify?.(s));if(i.length>1){let n=i.filter(a=>a.test);n.length>0&&(i=n)}e=i.find(n=>n.format===t.format)??i.find(n=>!n.format)}else s=t,e=r.find(i=>i.nodeClass&&s instanceof i.nodeClass);if(!e){let i=s?.constructor?.name??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${i} value`)}return e}function bd(r,t,{anchors:e,doc:s}){if(!s.directives)return"";let i=[],n=(tt.isScalar(r)||tt.isCollection(r))&&r.anchor;n&&dd.anchorIsValid(n)&&(e.add(n),i.push(`&${n}`));let a=r.tag??(t.default?null:t.tag);return a&&i.push(s.directives.tagString(a)),i.join(" ")}function wd(r,t,e,s){if(tt.isPair(r))return r.toString(t,e,s);if(tt.isAlias(r)){if(t.doc.directives)return r.toString(t);if(t.resolvedAliases?.has(r))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(r):t.resolvedAliases=new Set([r]),r=r.resolve(t.doc)}let i,n=tt.isNode(r)?r:t.doc.createNode(r,{onTagObj:c=>i=c});i??(i=xd(t.doc.schema.tags,n));let a=bd(n,i,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);let o=typeof i.stringify=="function"?i.stringify(n,t,e,s):tt.isScalar(n)?yd.stringifyString(n,t,e,s):n.toString(t,e,s);return a?tt.isScalar(n)||o[0]==="{"||o[0]==="["?`${a} ${o}`:`${a}
60
+ ${t.indent}${o}`:o}Cn.createStringifyContext=gd;Cn.stringify=wd});var ll=T(cl=>{"use strict";var Ke=V(),al=ee(),ol=Ms(),Ds=Is();function Pd({key:r,value:t},e,s,i){let{allNullValues:n,doc:a,indent:o,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:h}}=e,p=Ke.isNode(r)&&r.comment||null;if(h){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(Ke.isCollection(r)||!Ke.isNode(r)&&typeof r=="object"){let U="With simple keys, collection cannot be used as a key value";throw new Error(U)}}let f=!h&&(!r||p&&t==null&&!e.inFlow||Ke.isCollection(r)||(Ke.isScalar(r)?r.type===al.Scalar.BLOCK_FOLDED||r.type===al.Scalar.BLOCK_LITERAL:typeof r=="object"));e=Object.assign({},e,{allNullValues:!1,implicitKey:!f&&(h||!n),indent:o+c});let y=!1,d=!1,g=ol.stringify(r,e,()=>y=!0,()=>d=!0);if(!f&&!e.inFlow&&g.length>1024){if(h)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");f=!0}if(e.inFlow){if(n||t==null)return y&&s&&s(),g===""?"?":f?`? ${g}`:g}else if(n&&!h||t==null&&f)return g=`? ${g}`,p&&!y?g+=Ds.lineComment(g,e.indent,l(p)):d&&i&&i(),g;y&&(p=null),f?(p&&(g+=Ds.lineComment(g,e.indent,l(p))),g=`? ${g}
61
+ ${o}:`):(g=`${g}:`,p&&(g+=Ds.lineComment(g,e.indent,l(p))));let x,b,P;Ke.isNode(t)?(x=!!t.spaceBefore,b=t.commentBefore,P=t.comment):(x=!1,b=null,P=null,t&&typeof t=="object"&&(t=a.createNode(t))),e.implicitKey=!1,!f&&!p&&Ke.isScalar(t)&&(e.indentAtStart=g.length+1),d=!1,!u&&c.length>=2&&!e.inFlow&&!f&&Ke.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor&&(e.indent=e.indent.substring(2));let v=!1,E=ol.stringify(t,e,()=>v=!0,()=>d=!0),L=" ";if(p||x||b){if(L=x?`
62
+ `:"",b){let U=l(b);L+=`
63
+ ${Ds.indentComment(U,e.indent)}`}E===""&&!e.inFlow?L===`
64
+ `&&P&&(L=`
65
+
66
+ `):L+=`
67
+ ${e.indent}`}else if(!f&&Ke.isCollection(t)){let U=E[0],N=E.indexOf(`
68
+ `),Y=N!==-1,le=e.inFlow??t.flow??t.items.length===0;if(Y||!le){let ye=!1;if(Y&&(U==="&"||U==="!")){let Z=E.indexOf(" ");U==="&"&&Z!==-1&&Z<N&&E[Z+1]==="!"&&(Z=E.indexOf(" ",Z+1)),(Z===-1||N<Z)&&(ye=!0)}ye||(L=`
69
+ ${e.indent}`)}}else(E===""||E[0]===`
70
+ `)&&(L="");return g+=L+E,e.inFlow?v&&s&&s():P&&!v?g+=Ds.lineComment(g,e.indent,l(P)):d&&i&&i(),g}cl.stringifyPair=Pd});var En=T(kn=>{"use strict";var ul=require("process");function Td(r,...t){r==="debug"&&console.log(...t)}function Sd(r,t){(r==="debug"||r==="warn")&&(typeof ul.emitWarning=="function"?ul.emitWarning(t):console.warn(t))}kn.debug=Td;kn.warn=Sd});var Ui=T(qi=>{"use strict";var Bi=V(),hl=ee(),$i="<<",ji={identify:r=>r===$i||typeof r=="symbol"&&r.description===$i,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new hl.Scalar(Symbol($i)),{addToJSMap:pl}),stringify:()=>$i},Ad=(r,t)=>(ji.identify(t)||Bi.isScalar(t)&&(!t.type||t.type===hl.Scalar.PLAIN)&&ji.identify(t.value))&&r?.doc.schema.tags.some(e=>e.tag===ji.tag&&e.default);function pl(r,t,e){let s=fl(r,e);if(Bi.isSeq(s))for(let i of s.items)Nn(r,t,i);else if(Array.isArray(s))for(let i of s)Nn(r,t,i);else Nn(r,t,s)}function Nn(r,t,e){let s=fl(r,e);if(!Bi.isMap(s))throw new Error("Merge sources must be maps or map aliases");let i=s.toJSON(null,r,Map);for(let[n,a]of i)t instanceof Map?t.has(n)||t.set(n,a):t instanceof Set?t.add(n):Object.prototype.hasOwnProperty.call(t,n)||Object.defineProperty(t,n,{value:a,writable:!0,enumerable:!0,configurable:!0});return t}function fl(r,t){return r&&Bi.isAlias(t)?t.resolve(r.doc,r):t}qi.addMergeToJSMap=pl;qi.isMergeKey=Ad;qi.merge=ji});var _n=T(yl=>{"use strict";var vd=En(),dl=Ui(),Cd=Ms(),ml=V(),In=Xe();function kd(r,t,{key:e,value:s}){if(ml.isNode(e)&&e.addToJSMap)e.addToJSMap(r,t,s);else if(dl.isMergeKey(r,e))dl.addMergeToJSMap(r,t,s);else{let i=In.toJS(e,"",r);if(t instanceof Map)t.set(i,In.toJS(s,i,r));else if(t instanceof Set)t.add(i);else{let n=Ed(e,i,r),a=In.toJS(s,n,r);n in t?Object.defineProperty(t,n,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[n]=a}}return t}function Ed(r,t,e){if(t===null)return"";if(typeof t!="object")return String(t);if(ml.isNode(r)&&e?.doc){let s=Cd.createStringifyContext(e.doc,{});s.anchors=new Set;for(let n of e.anchors.keys())s.anchors.add(n.anchor);s.inFlow=!0,s.inStringifyKey=!0;let i=r.toString(s);if(!e.mapKeyWarned){let n=JSON.stringify(i);n.length>40&&(n=n.substring(0,36)+'..."'),vd.warn(e.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${n}. Set mapAsMap: true to use object keys.`),e.mapKeyWarned=!0}return i}return JSON.stringify(t)}yl.addPairToJSMap=kd});var st=T(On=>{"use strict";var gl=Ns(),Nd=ll(),Id=_n(),Vi=V();function _d(r,t,e){let s=gl.createNode(r,void 0,e),i=gl.createNode(t,void 0,e);return new Hi(s,i)}var Hi=class r{constructor(t,e=null){Object.defineProperty(this,Vi.NODE_TYPE,{value:Vi.PAIR}),this.key=t,this.value=e}clone(t){let{key:e,value:s}=this;return Vi.isNode(e)&&(e=e.clone(t)),Vi.isNode(s)&&(s=s.clone(t)),new r(e,s)}toJSON(t,e){let s=e?.mapAsMap?new Map:{};return Id.addPairToJSMap(e,s,this)}toString(t,e,s){return t?.doc?Nd.stringifyPair(this,t,e,s):JSON.stringify(this)}};On.Pair=Hi;On.createPair=_d});var Ln=T(bl=>{"use strict";var bt=V(),xl=Ms(),Ki=Is();function Od(r,t,e){return(t.inFlow??r.flow?Md:Ld)(r,t,e)}function Ld({comment:r,items:t},e,{blockItemPrefix:s,flowChars:i,itemIndent:n,onChompKeep:a,onComment:o}){let{indent:c,options:{commentString:l}}=e,u=Object.assign({},e,{indent:n,type:null}),h=!1,p=[];for(let y=0;y<t.length;++y){let d=t[y],g=null;if(bt.isNode(d))!h&&d.spaceBefore&&p.push(""),Wi(e,p,d.commentBefore,h),d.comment&&(g=d.comment);else if(bt.isPair(d)){let b=bt.isNode(d.key)?d.key:null;b&&(!h&&b.spaceBefore&&p.push(""),Wi(e,p,b.commentBefore,h))}h=!1;let x=xl.stringify(d,u,()=>g=null,()=>h=!0);g&&(x+=Ki.lineComment(x,n,l(g))),h&&g&&(h=!1),p.push(s+x)}let f;if(p.length===0)f=i.start+i.end;else{f=p[0];for(let y=1;y<p.length;++y){let d=p[y];f+=d?`
71
+ ${c}${d}`:`
72
+ `}}return r?(f+=`
73
+ `+Ki.indentComment(l(r),c),o&&o()):h&&a&&a(),f}function Md({items:r},t,{flowChars:e,itemIndent:s}){let{indent:i,indentStep:n,flowCollectionPadding:a,options:{commentString:o}}=t;s+=n;let c=Object.assign({},t,{indent:s,inFlow:!0,type:null}),l=!1,u=0,h=[];for(let y=0;y<r.length;++y){let d=r[y],g=null;if(bt.isNode(d))d.spaceBefore&&h.push(""),Wi(t,h,d.commentBefore,!1),d.comment&&(g=d.comment);else if(bt.isPair(d)){let b=bt.isNode(d.key)?d.key:null;b&&(b.spaceBefore&&h.push(""),Wi(t,h,b.commentBefore,!1),b.comment&&(l=!0));let P=bt.isNode(d.value)?d.value:null;P?(P.comment&&(g=P.comment),P.commentBefore&&(l=!0)):d.value==null&&b?.comment&&(g=b.comment)}g&&(l=!0);let x=xl.stringify(d,c,()=>g=null);l||(l=h.length>u||x.includes(`
74
+ `)),y<r.length-1?x+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(l||(l=h.reduce((b,P)=>b+P.length+2,2)+(x.length+2)>t.options.lineWidth)),l&&(x+=",")),g&&(x+=Ki.lineComment(x,s,o(g))),h.push(x),u=h.length}let{start:p,end:f}=e;if(h.length===0)return p+f;if(!l){let y=h.reduce((d,g)=>d+g.length+2,2);l=t.options.lineWidth>0&&y>t.options.lineWidth}if(l){let y=p;for(let d of h)y+=d?`
75
+ ${n}${i}${d}`:`
76
+ `;return`${y}
77
+ ${i}${f}`}else return`${p}${a}${h.join(" ")}${a}${f}`}function Wi({indent:r,options:{commentString:t}},e,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){let n=Ki.indentComment(t(s),r);e.push(n.trimStart())}}bl.stringifyCollection=Od});var rt=T(Dn=>{"use strict";var Dd=Ln(),Rd=_n(),Fd=Oi(),it=V(),zi=st(),$d=ee();function Rs(r,t){let e=it.isScalar(t)?t.value:t;for(let s of r)if(it.isPair(s)&&(s.key===t||s.key===e||it.isScalar(s.key)&&s.key.value===e))return s}var Mn=class extends Fd.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(it.MAP,t),this.items=[]}static from(t,e,s){let{keepUndefined:i,replacer:n}=s,a=new this(t),o=(c,l)=>{if(typeof n=="function")l=n.call(e,c,l);else if(Array.isArray(n)&&!n.includes(c))return;(l!==void 0||i)&&a.items.push(zi.createPair(c,l,s))};if(e instanceof Map)for(let[c,l]of e)o(c,l);else if(e&&typeof e=="object")for(let c of Object.keys(e))o(c,e[c]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,e){let s;it.isPair(t)?s=t:!t||typeof t!="object"||!("key"in t)?s=new zi.Pair(t,t?.value):s=new zi.Pair(t.key,t.value);let i=Rs(this.items,s.key),n=this.schema?.sortMapEntries;if(i){if(!e)throw new Error(`Key ${s.key} already set`);it.isScalar(i.value)&&$d.isScalarValue(s.value)?i.value.value=s.value:i.value=s.value}else if(n){let a=this.items.findIndex(o=>n(s,o)<0);a===-1?this.items.push(s):this.items.splice(a,0,s)}else this.items.push(s)}delete(t){let e=Rs(this.items,t);return e?this.items.splice(this.items.indexOf(e),1).length>0:!1}get(t,e){let i=Rs(this.items,t)?.value;return(!e&&it.isScalar(i)?i.value:i)??void 0}has(t){return!!Rs(this.items,t)}set(t,e){this.add(new zi.Pair(t,e),!0)}toJSON(t,e,s){let i=s?new s:e?.mapAsMap?new Map:{};e?.onCreate&&e.onCreate(i);for(let n of this.items)Rd.addPairToJSMap(e,i,n);return i}toString(t,e,s){if(!t)return JSON.stringify(this);for(let i of this.items)if(!it.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),Dd.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:s,onComment:e})}};Dn.YAMLMap=Mn;Dn.findPair=Rs});var Yt=T(Pl=>{"use strict";var jd=V(),wl=rt(),Bd={collection:"map",default:!0,nodeClass:wl.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(r,t){return jd.isMap(r)||t("Expected a mapping for this tag"),r},createNode:(r,t,e)=>wl.YAMLMap.from(r,t,e)};Pl.map=Bd});var nt=T(Tl=>{"use strict";var qd=Ns(),Ud=Ln(),Vd=Oi(),Ji=V(),Hd=ee(),Kd=Xe(),Rn=class extends Vd.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Ji.SEQ,t),this.items=[]}add(t){this.items.push(t)}delete(t){let e=Gi(t);return typeof e!="number"?!1:this.items.splice(e,1).length>0}get(t,e){let s=Gi(t);if(typeof s!="number")return;let i=this.items[s];return!e&&Ji.isScalar(i)?i.value:i}has(t){let e=Gi(t);return typeof e=="number"&&e<this.items.length}set(t,e){let s=Gi(t);if(typeof s!="number")throw new Error(`Expected a valid index, not ${t}.`);let i=this.items[s];Ji.isScalar(i)&&Hd.isScalarValue(e)?i.value=e:this.items[s]=e}toJSON(t,e){let s=[];e?.onCreate&&e.onCreate(s);let i=0;for(let n of this.items)s.push(Kd.toJS(n,String(i++),e));return s}toString(t,e,s){return t?Ud.stringifyCollection(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:s,onComment:e}):JSON.stringify(this)}static from(t,e,s){let{replacer:i}=s,n=new this(t);if(e&&Symbol.iterator in Object(e)){let a=0;for(let o of e){if(typeof i=="function"){let c=e instanceof Set?o:String(a++);o=i.call(e,c,o)}n.items.push(qd.createNode(o,void 0,s))}}return n}};function Gi(r){let t=Ji.isScalar(r)?r.value:r;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}Tl.YAMLSeq=Rn});var Zt=T(Al=>{"use strict";var Wd=V(),Sl=nt(),zd={collection:"seq",default:!0,nodeClass:Sl.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(r,t){return Wd.isSeq(r)||t("Expected a sequence for this tag"),r},createNode:(r,t,e)=>Sl.YAMLSeq.from(r,t,e)};Al.seq=zd});var Fs=T(vl=>{"use strict";var Gd=Ls(),Jd={identify:r=>typeof r=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:r=>r,stringify(r,t,e,s){return t=Object.assign({actualString:!0},t),Gd.stringifyString(r,t,e,s)}};vl.string=Jd});var Yi=T(El=>{"use strict";var Cl=ee(),kl={identify:r=>r==null,createNode:()=>new Cl.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Cl.Scalar(null),stringify:({source:r},t)=>typeof r=="string"&&kl.test.test(r)?r:t.options.nullStr};El.nullTag=kl});var Fn=T(Il=>{"use strict";var Yd=ee(),Nl={identify:r=>typeof r=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:r=>new Yd.Scalar(r[0]==="t"||r[0]==="T"),stringify({source:r,value:t},e){if(r&&Nl.test.test(r)){let s=r[0]==="t"||r[0]==="T";if(t===s)return r}return t?e.options.trueStr:e.options.falseStr}};Il.boolTag=Nl});var Xt=T(_l=>{"use strict";function Zd({format:r,minFractionDigits:t,tag:e,value:s}){if(typeof s=="bigint")return String(s);let i=typeof s=="number"?s:Number(s);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let n=Object.is(s,-0)?"-0":JSON.stringify(s);if(!r&&t&&(!e||e==="tag:yaml.org,2002:float")&&/^-?\d/.test(n)&&!n.includes("e")){let a=n.indexOf(".");a<0&&(a=n.length,n+=".");let o=t-(n.length-a-1);for(;o-- >0;)n+="0"}return n}_l.stringifyNumber=Zd});var jn=T(Zi=>{"use strict";var Xd=ee(),$n=Xt(),Qd={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:r=>r.slice(-3).toLowerCase()==="nan"?NaN:r[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:$n.stringifyNumber},em={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:r=>parseFloat(r),stringify(r){let t=Number(r.value);return isFinite(t)?t.toExponential():$n.stringifyNumber(r)}},tm={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(r){let t=new Xd.Scalar(parseFloat(r)),e=r.indexOf(".");return e!==-1&&r[r.length-1]==="0"&&(t.minFractionDigits=r.length-e-1),t},stringify:$n.stringifyNumber};Zi.float=tm;Zi.floatExp=em;Zi.floatNaN=Qd});var qn=T(Qi=>{"use strict";var Ol=Xt(),Xi=r=>typeof r=="bigint"||Number.isInteger(r),Bn=(r,t,e,{intAsBigInt:s})=>s?BigInt(r):parseInt(r.substring(t),e);function Ll(r,t,e){let{value:s}=r;return Xi(s)&&s>=0?e+s.toString(t):Ol.stringifyNumber(r)}var sm={identify:r=>Xi(r)&&r>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(r,t,e)=>Bn(r,2,8,e),stringify:r=>Ll(r,8,"0o")},im={identify:Xi,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(r,t,e)=>Bn(r,0,10,e),stringify:Ol.stringifyNumber},rm={identify:r=>Xi(r)&&r>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(r,t,e)=>Bn(r,2,16,e),stringify:r=>Ll(r,16,"0x")};Qi.int=im;Qi.intHex=rm;Qi.intOct=sm});var Dl=T(Ml=>{"use strict";var nm=Yt(),am=Yi(),om=Zt(),cm=Fs(),lm=Fn(),Un=jn(),Vn=qn(),um=[nm.map,om.seq,cm.string,am.nullTag,lm.boolTag,Vn.intOct,Vn.int,Vn.intHex,Un.floatNaN,Un.floatExp,Un.float];Ml.schema=um});var $l=T(Fl=>{"use strict";var hm=ee(),pm=Yt(),fm=Zt();function Rl(r){return typeof r=="bigint"||Number.isInteger(r)}var er=({value:r})=>JSON.stringify(r),dm=[{identify:r=>typeof r=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:r=>r,stringify:er},{identify:r=>r==null,createNode:()=>new hm.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:er},{identify:r=>typeof r=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:r=>r==="true",stringify:er},{identify:Rl,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(r,t,{intAsBigInt:e})=>e?BigInt(r):parseInt(r,10),stringify:({value:r})=>Rl(r)?r.toString():JSON.stringify(r)},{identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:r=>parseFloat(r),stringify:er}],mm={default:!0,tag:"",test:/^/,resolve(r,t){return t(`Unresolved plain scalar ${JSON.stringify(r)}`),r}},ym=[pm.map,fm.seq].concat(dm,mm);Fl.schema=ym});var Kn=T(jl=>{"use strict";var $s=require("buffer"),Hn=ee(),gm=Ls(),xm={identify:r=>r instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(r,t){if(typeof $s.Buffer=="function")return $s.Buffer.from(r,"base64");if(typeof atob=="function"){let e=atob(r.replace(/[\n\r]/g,"")),s=new Uint8Array(e.length);for(let i=0;i<e.length;++i)s[i]=e.charCodeAt(i);return s}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),r},stringify({comment:r,type:t,value:e},s,i,n){if(!e)return"";let a=e,o;if(typeof $s.Buffer=="function")o=a instanceof $s.Buffer?a.toString("base64"):$s.Buffer.from(a.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<a.length;++l)c+=String.fromCharCode(a[l]);o=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Hn.Scalar.BLOCK_LITERAL),t!==Hn.Scalar.QUOTE_DOUBLE){let c=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),l=Math.ceil(o.length/c),u=new Array(l);for(let h=0,p=0;h<l;++h,p+=c)u[h]=o.substr(p,c);o=u.join(t===Hn.Scalar.BLOCK_LITERAL?`
78
+ `:" ")}return gm.stringifyString({comment:r,type:t,value:o},s,i,n)}};jl.binary=xm});var ir=T(sr=>{"use strict";var tr=V(),Wn=st(),bm=ee(),wm=nt();function Bl(r,t){if(tr.isSeq(r))for(let e=0;e<r.items.length;++e){let s=r.items[e];if(!tr.isPair(s)){if(tr.isMap(s)){s.items.length>1&&t("Each pair must have its own sequence indicator");let i=s.items[0]||new Wn.Pair(new bm.Scalar(null));if(s.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${s.commentBefore}
79
+ ${i.key.commentBefore}`:s.commentBefore),s.comment){let n=i.value??i.key;n.comment=n.comment?`${s.comment}
80
+ ${n.comment}`:s.comment}s=i}r.items[e]=tr.isPair(s)?s:new Wn.Pair(s)}}else t("Expected a sequence for this tag");return r}function ql(r,t,e){let{replacer:s}=e,i=new wm.YAMLSeq(r);i.tag="tag:yaml.org,2002:pairs";let n=0;if(t&&Symbol.iterator in Object(t))for(let a of t){typeof s=="function"&&(a=s.call(t,String(n++),a));let o,c;if(Array.isArray(a))if(a.length===2)o=a[0],c=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){let l=Object.keys(a);if(l.length===1)o=l[0],c=a[o];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else o=a;i.items.push(Wn.createPair(o,c,e))}return i}var Pm={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Bl,createNode:ql};sr.createPairs=ql;sr.pairs=Pm;sr.resolvePairs=Bl});var Jn=T(Gn=>{"use strict";var Ul=V(),zn=Xe(),js=rt(),Tm=nt(),Vl=ir(),wt=class r extends Tm.YAMLSeq{constructor(){super(),this.add=js.YAMLMap.prototype.add.bind(this),this.delete=js.YAMLMap.prototype.delete.bind(this),this.get=js.YAMLMap.prototype.get.bind(this),this.has=js.YAMLMap.prototype.has.bind(this),this.set=js.YAMLMap.prototype.set.bind(this),this.tag=r.tag}toJSON(t,e){if(!e)return super.toJSON(t);let s=new Map;e?.onCreate&&e.onCreate(s);for(let i of this.items){let n,a;if(Ul.isPair(i)?(n=zn.toJS(i.key,"",e),a=zn.toJS(i.value,n,e)):n=zn.toJS(i,"",e),s.has(n))throw new Error("Ordered maps must not include duplicate keys");s.set(n,a)}return s}static from(t,e,s){let i=Vl.createPairs(t,e,s),n=new this;return n.items=i.items,n}};wt.tag="tag:yaml.org,2002:omap";var Sm={collection:"seq",identify:r=>r instanceof Map,nodeClass:wt,default:!1,tag:"tag:yaml.org,2002:omap",resolve(r,t){let e=Vl.resolvePairs(r,t),s=[];for(let{key:i}of e.items)Ul.isScalar(i)&&(s.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):s.push(i.value));return Object.assign(new wt,e)},createNode:(r,t,e)=>wt.from(r,t,e)};Gn.YAMLOMap=wt;Gn.omap=Sm});var Gl=T(Yn=>{"use strict";var Hl=ee();function Kl({value:r,source:t},e){return t&&(r?Wl:zl).test.test(t)?t:r?e.options.trueStr:e.options.falseStr}var Wl={identify:r=>r===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Hl.Scalar(!0),stringify:Kl},zl={identify:r=>r===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Hl.Scalar(!1),stringify:Kl};Yn.falseTag=zl;Yn.trueTag=Wl});var Jl=T(rr=>{"use strict";var Am=ee(),Zn=Xt(),vm={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:r=>r.slice(-3).toLowerCase()==="nan"?NaN:r[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Zn.stringifyNumber},Cm={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:r=>parseFloat(r.replace(/_/g,"")),stringify(r){let t=Number(r.value);return isFinite(t)?t.toExponential():Zn.stringifyNumber(r)}},km={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(r){let t=new Am.Scalar(parseFloat(r.replace(/_/g,""))),e=r.indexOf(".");if(e!==-1){let s=r.substring(e+1).replace(/_/g,"");s[s.length-1]==="0"&&(t.minFractionDigits=s.length)}return t},stringify:Zn.stringifyNumber};rr.float=km;rr.floatExp=Cm;rr.floatNaN=vm});var Zl=T(qs=>{"use strict";var Yl=Xt(),Bs=r=>typeof r=="bigint"||Number.isInteger(r);function nr(r,t,e,{intAsBigInt:s}){let i=r[0];if((i==="-"||i==="+")&&(t+=1),r=r.substring(t).replace(/_/g,""),s){switch(e){case 2:r=`0b${r}`;break;case 8:r=`0o${r}`;break;case 16:r=`0x${r}`;break}let a=BigInt(r);return i==="-"?BigInt(-1)*a:a}let n=parseInt(r,e);return i==="-"?-1*n:n}function Xn(r,t,e){let{value:s}=r;if(Bs(s)){let i=s.toString(t);return s<0?"-"+e+i.substr(1):e+i}return Yl.stringifyNumber(r)}var Em={identify:Bs,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(r,t,e)=>nr(r,2,2,e),stringify:r=>Xn(r,2,"0b")},Nm={identify:Bs,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(r,t,e)=>nr(r,1,8,e),stringify:r=>Xn(r,8,"0")},Im={identify:Bs,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(r,t,e)=>nr(r,0,10,e),stringify:Yl.stringifyNumber},_m={identify:Bs,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(r,t,e)=>nr(r,2,16,e),stringify:r=>Xn(r,16,"0x")};qs.int=Im;qs.intBin=Em;qs.intHex=_m;qs.intOct=Nm});var ea=T(Qn=>{"use strict";var cr=V(),ar=st(),or=rt(),Pt=class r extends or.YAMLMap{constructor(t){super(t),this.tag=r.tag}add(t){let e;cr.isPair(t)?e=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?e=new ar.Pair(t.key,null):e=new ar.Pair(t,null),or.findPair(this.items,e.key)||this.items.push(e)}get(t,e){let s=or.findPair(this.items,t);return!e&&cr.isPair(s)?cr.isScalar(s.key)?s.key.value:s.key:s}set(t,e){if(typeof e!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof e}`);let s=or.findPair(this.items,t);s&&!e?this.items.splice(this.items.indexOf(s),1):!s&&e&&this.items.push(new ar.Pair(t))}toJSON(t,e){return super.toJSON(t,e,Set)}toString(t,e,s){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),e,s);throw new Error("Set items must all have null values")}static from(t,e,s){let{replacer:i}=s,n=new this(t);if(e&&Symbol.iterator in Object(e))for(let a of e)typeof i=="function"&&(a=i.call(e,a,a)),n.items.push(ar.createPair(a,null,s));return n}};Pt.tag="tag:yaml.org,2002:set";var Om={collection:"map",identify:r=>r instanceof Set,nodeClass:Pt,default:!1,tag:"tag:yaml.org,2002:set",createNode:(r,t,e)=>Pt.from(r,t,e),resolve(r,t){if(cr.isMap(r)){if(r.hasAllNullValues(!0))return Object.assign(new Pt,r);t("Set items must all have null values")}else t("Expected a mapping for this tag");return r}};Qn.YAMLSet=Pt;Qn.set=Om});var sa=T(lr=>{"use strict";var Lm=Xt();function ta(r,t){let e=r[0],s=e==="-"||e==="+"?r.substring(1):r,i=a=>t?BigInt(a):Number(a),n=s.replace(/_/g,"").split(":").reduce((a,o)=>a*i(60)+i(o),i(0));return e==="-"?i(-1)*n:n}function Xl(r){let{value:t}=r,e=a=>a;if(typeof t=="bigint")e=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return Lm.stringifyNumber(r);let s="";t<0&&(s="-",t*=e(-1));let i=e(60),n=[t%i];return t<60?n.unshift(0):(t=(t-n[0])/i,n.unshift(t%i),t>=60&&(t=(t-n[0])/i,n.unshift(t))),s+n.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Mm={identify:r=>typeof r=="bigint"||Number.isInteger(r),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(r,t,{intAsBigInt:e})=>ta(r,e),stringify:Xl},Dm={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:r=>ta(r,!1),stringify:Xl},Ql={identify:r=>r instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(r){let t=r.match(Ql.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,e,s,i,n,a,o]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0,l=Date.UTC(e,s-1,i,n||0,a||0,o||0,c),u=t[8];if(u&&u!=="Z"){let h=ta(u,!1);Math.abs(h)<30&&(h*=60),l-=6e4*h}return new Date(l)},stringify:({value:r})=>r?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};lr.floatTime=Dm;lr.intTime=Mm;lr.timestamp=Ql});var su=T(tu=>{"use strict";var Rm=Yt(),Fm=Yi(),$m=Zt(),jm=Fs(),Bm=Kn(),eu=Gl(),ia=Jl(),ur=Zl(),qm=Ui(),Um=Jn(),Vm=ir(),Hm=ea(),ra=sa(),Km=[Rm.map,$m.seq,jm.string,Fm.nullTag,eu.trueTag,eu.falseTag,ur.intBin,ur.intOct,ur.int,ur.intHex,ia.floatNaN,ia.floatExp,ia.float,Bm.binary,qm.merge,Um.omap,Vm.pairs,Hm.set,ra.intTime,ra.floatTime,ra.timestamp];tu.schema=Km});var pu=T(oa=>{"use strict";var au=Yt(),Wm=Yi(),ou=Zt(),zm=Fs(),Gm=Fn(),na=jn(),aa=qn(),Jm=Dl(),Ym=$l(),cu=Kn(),Us=Ui(),lu=Jn(),uu=ir(),iu=su(),hu=ea(),hr=sa(),ru=new Map([["core",Jm.schema],["failsafe",[au.map,ou.seq,zm.string]],["json",Ym.schema],["yaml11",iu.schema],["yaml-1.1",iu.schema]]),nu={binary:cu.binary,bool:Gm.boolTag,float:na.float,floatExp:na.floatExp,floatNaN:na.floatNaN,floatTime:hr.floatTime,int:aa.int,intHex:aa.intHex,intOct:aa.intOct,intTime:hr.intTime,map:au.map,merge:Us.merge,null:Wm.nullTag,omap:lu.omap,pairs:uu.pairs,seq:ou.seq,set:hu.set,timestamp:hr.timestamp},Zm={"tag:yaml.org,2002:binary":cu.binary,"tag:yaml.org,2002:merge":Us.merge,"tag:yaml.org,2002:omap":lu.omap,"tag:yaml.org,2002:pairs":uu.pairs,"tag:yaml.org,2002:set":hu.set,"tag:yaml.org,2002:timestamp":hr.timestamp};function Xm(r,t,e){let s=ru.get(t);if(s&&!r)return e&&!s.includes(Us.merge)?s.concat(Us.merge):s.slice();let i=s;if(!i)if(Array.isArray(r))i=[];else{let n=Array.from(ru.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${n} or define customTags array`)}if(Array.isArray(r))for(let n of r)i=i.concat(n);else typeof r=="function"&&(i=r(i.slice()));return e&&(i=i.concat(Us.merge)),i.reduce((n,a)=>{let o=typeof a=="string"?nu[a]:a;if(!o){let c=JSON.stringify(a),l=Object.keys(nu).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return n.includes(o)||n.push(o),n},[])}oa.coreKnownTags=Zm;oa.getTags=Xm});var ua=T(fu=>{"use strict";var ca=V(),Qm=Yt(),ey=Zt(),ty=Fs(),pr=pu(),sy=(r,t)=>r.key<t.key?-1:r.key>t.key?1:0,la=class r{constructor({compat:t,customTags:e,merge:s,resolveKnownTags:i,schema:n,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(t)?pr.getTags(t,"compat"):t?pr.getTags(null,t):null,this.name=typeof n=="string"&&n||"core",this.knownTags=i?pr.coreKnownTags:{},this.tags=pr.getTags(e,this.name,s),this.toStringOptions=o??null,Object.defineProperty(this,ca.MAP,{value:Qm.map}),Object.defineProperty(this,ca.SCALAR,{value:ty.string}),Object.defineProperty(this,ca.SEQ,{value:ey.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?sy:null}clone(){let t=Object.create(r.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};fu.Schema=la});var mu=T(du=>{"use strict";var iy=V(),ha=Ms(),Vs=Is();function ry(r,t){let e=[],s=t.directives===!0;if(t.directives!==!1&&r.directives){let c=r.directives.toString(r);c?(e.push(c),s=!0):r.directives.docStart&&(s=!0)}s&&e.push("---");let i=ha.createStringifyContext(r,t),{commentString:n}=i.options;if(r.commentBefore){e.length!==1&&e.unshift("");let c=n(r.commentBefore);e.unshift(Vs.indentComment(c,""))}let a=!1,o=null;if(r.contents){if(iy.isNode(r.contents)){if(r.contents.spaceBefore&&s&&e.push(""),r.contents.commentBefore){let u=n(r.contents.commentBefore);e.push(Vs.indentComment(u,""))}i.forceBlockIndent=!!r.comment,o=r.contents.comment}let c=o?void 0:()=>a=!0,l=ha.stringify(r.contents,i,()=>o=null,c);o&&(l+=Vs.lineComment(l,"",n(o))),(l[0]==="|"||l[0]===">")&&e[e.length-1]==="---"?e[e.length-1]=`--- ${l}`:e.push(l)}else e.push(ha.stringify(r.contents,i));if(r.directives?.docEnd)if(r.comment){let c=n(r.comment);c.includes(`
81
+ `)?(e.push("..."),e.push(Vs.indentComment(c,""))):e.push(`... ${c}`)}else e.push("...");else{let c=r.comment;c&&a&&(c=c.replace(/^\n+/,"")),c&&((!a||o)&&e[e.length-1]!==""&&e.push(""),e.push(Vs.indentComment(n(c),"")))}return e.join(`
82
+ `)+`
83
+ `}du.stringifyDocument=ry});var Hs=T(yu=>{"use strict";var ny=Es(),Qt=Oi(),Pe=V(),ay=st(),oy=Xe(),cy=ua(),ly=mu(),pa=Ei(),uy=yn(),hy=Ns(),fa=mn(),da=class r{constructor(t,e,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Pe.NODE_TYPE,{value:Pe.DOC});let i=null;typeof e=="function"||Array.isArray(e)?i=e:s===void 0&&e&&(s=e,e=void 0);let n=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=n;let{version:a}=n;s?._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new fa.Directives({version:a}),this.setSchema(a,s),this.contents=t===void 0?null:this.createNode(t,i,s)}clone(){let t=Object.create(r.prototype,{[Pe.NODE_TYPE]:{value:Pe.DOC}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Pe.isNode(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){es(this.contents)&&this.contents.add(t)}addIn(t,e){es(this.contents)&&this.contents.addIn(t,e)}createAlias(t,e){if(!t.anchor){let s=pa.anchorNames(this);t.anchor=!e||s.has(e)?pa.findNewAnchor(e||"a",s):e}return new ny.Alias(t.anchor)}createNode(t,e,s){let i;if(typeof e=="function")t=e.call({"":t},"",t),i=e;else if(Array.isArray(e)){let g=b=>typeof b=="number"||b instanceof String||b instanceof Number,x=e.filter(g).map(String);x.length>0&&(e=e.concat(x)),i=e}else s===void 0&&e&&(s=e,e=void 0);let{aliasDuplicateObjects:n,anchorPrefix:a,flow:o,keepUndefined:c,onTagObj:l,tag:u}=s??{},{onAnchor:h,setAnchors:p,sourceObjects:f}=pa.createNodeAnchors(this,a||"a"),y={aliasDuplicateObjects:n??!0,keepUndefined:c??!1,onAnchor:h,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:f},d=hy.createNode(t,u,y);return o&&Pe.isCollection(d)&&(d.flow=!0),p(),d}createPair(t,e,s={}){let i=this.createNode(t,null,s),n=this.createNode(e,null,s);return new ay.Pair(i,n)}delete(t){return es(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Qt.isEmptyPath(t)?this.contents==null?!1:(this.contents=null,!0):es(this.contents)?this.contents.deleteIn(t):!1}get(t,e){return Pe.isCollection(this.contents)?this.contents.get(t,e):void 0}getIn(t,e){return Qt.isEmptyPath(t)?!e&&Pe.isScalar(this.contents)?this.contents.value:this.contents:Pe.isCollection(this.contents)?this.contents.getIn(t,e):void 0}has(t){return Pe.isCollection(this.contents)?this.contents.has(t):!1}hasIn(t){return Qt.isEmptyPath(t)?this.contents!==void 0:Pe.isCollection(this.contents)?this.contents.hasIn(t):!1}set(t,e){this.contents==null?this.contents=Qt.collectionFromPath(this.schema,[t],e):es(this.contents)&&this.contents.set(t,e)}setIn(t,e){Qt.isEmptyPath(t)?this.contents=e:this.contents==null?this.contents=Qt.collectionFromPath(this.schema,Array.from(t),e):es(this.contents)&&this.contents.setIn(t,e)}setSchema(t,e={}){typeof t=="number"&&(t=String(t));let s;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new fa.Directives({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new fa.Directives({version:t}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{let i=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(e.schema instanceof Object)this.schema=e.schema;else if(s)this.schema=new cy.Schema(Object.assign(s,e));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:e,mapAsMap:s,maxAliasCount:i,onAnchor:n,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!t,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=oy.toJS(this.contents,e??"",o);if(typeof n=="function")for(let{count:l,res:u}of o.anchors.values())n(u,l);return typeof a=="function"?uy.applyReviver(a,{"":c},"",c):c}toJSON(t,e){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:e})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){let e=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${e}`)}return ly.stringifyDocument(this,t)}};function es(r){if(Pe.isCollection(r))return!0;throw new Error("Expected a YAML collection as document contents")}yu.Document=da});var zs=T(Ws=>{"use strict";var Ks=class extends Error{constructor(t,e,s,i){super(),this.name=t,this.code=s,this.message=i,this.pos=e}},ma=class extends Ks{constructor(t,e,s){super("YAMLParseError",t,e,s)}},ya=class extends Ks{constructor(t,e,s){super("YAMLWarning",t,e,s)}},py=(r,t)=>e=>{if(e.pos[0]===-1)return;e.linePos=e.pos.map(o=>t.linePos(o));let{line:s,col:i}=e.linePos[0];e.message+=` at line ${s}, column ${i}`;let n=i-1,a=r.substring(t.lineStarts[s-1],t.lineStarts[s]).replace(/[\n\r]+$/,"");if(n>=60&&a.length>80){let o=Math.min(n-39,a.length-79);a="\u2026"+a.substring(o),n-=o-1}if(a.length>80&&(a=a.substring(0,79)+"\u2026"),s>1&&/^ *$/.test(a.substring(0,n))){let o=r.substring(t.lineStarts[s-2],t.lineStarts[s-1]);o.length>80&&(o=o.substring(0,79)+`\u2026
84
+ `),a=o+a}if(/[^ ]/.test(a)){let o=1,c=e.linePos[1];c?.line===s&&c.col>i&&(o=Math.max(1,Math.min(c.col-i,80-n)));let l=" ".repeat(n)+"^".repeat(o);e.message+=`:
85
+
86
+ ${a}
87
+ ${l}
88
+ `}};Ws.YAMLError=Ks;Ws.YAMLParseError=ma;Ws.YAMLWarning=ya;Ws.prettifyError=py});var Gs=T(gu=>{"use strict";function fy(r,{flow:t,indicator:e,next:s,offset:i,onError:n,parentIndent:a,startOnNewline:o}){let c=!1,l=o,u=o,h="",p="",f=!1,y=!1,d=null,g=null,x=null,b=null,P=null,v=null,E=null;for(let N of r)switch(y&&(N.type!=="space"&&N.type!=="newline"&&N.type!=="comma"&&n(N.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),d&&(l&&N.type!=="comment"&&N.type!=="newline"&&n(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),d=null),N.type){case"space":!t&&(e!=="doc-start"||s?.type!=="flow-collection")&&N.source.includes(" ")&&(d=N),u=!0;break;case"comment":{u||n(N,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let Y=N.source.substring(1)||" ";h?h+=p+Y:h=Y,p="",l=!1;break}case"newline":l?h?h+=N.source:(!v||e!=="seq-item-ind")&&(c=!0):p+=N.source,l=!0,f=!0,(g||x)&&(b=N),u=!0;break;case"anchor":g&&n(N,"MULTIPLE_ANCHORS","A node can have at most one anchor"),N.source.endsWith(":")&&n(N.offset+N.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=N,E??(E=N.offset),l=!1,u=!1,y=!0;break;case"tag":{x&&n(N,"MULTIPLE_TAGS","A node can have at most one tag"),x=N,E??(E=N.offset),l=!1,u=!1,y=!0;break}case e:(g||x)&&n(N,"BAD_PROP_ORDER",`Anchors and tags must be after the ${N.source} indicator`),v&&n(N,"UNEXPECTED_TOKEN",`Unexpected ${N.source} in ${t??"collection"}`),v=N,l=e==="seq-item-ind"||e==="explicit-key-ind",u=!1;break;case"comma":if(t){P&&n(N,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),P=N,l=!1,u=!1;break}default:n(N,"UNEXPECTED_TOKEN",`Unexpected ${N.type} token`),l=!1,u=!1}let L=r[r.length-1],U=L?L.offset+L.source.length:i;return y&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&n(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d&&(l&&d.indent<=a||s?.type==="block-map"||s?.type==="block-seq")&&n(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:P,found:v,spaceBefore:c,comment:h,hasNewline:f,anchor:g,tag:x,newlineAfterProp:b,end:U,start:E??U}}gu.resolveProps=fy});var fr=T(xu=>{"use strict";function ga(r){if(!r)return null;switch(r.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(r.source.includes(`
89
+ `))return!0;if(r.end){for(let t of r.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of r.items){for(let e of t.start)if(e.type==="newline")return!0;if(t.sep){for(let e of t.sep)if(e.type==="newline")return!0}if(ga(t.key)||ga(t.value))return!0}return!1;default:return!0}}xu.containsNewline=ga});var xa=T(bu=>{"use strict";var dy=fr();function my(r,t,e){if(t?.type==="flow-collection"){let s=t.end[0];s.indent===r&&(s.source==="]"||s.source==="}")&&dy.containsNewline(t)&&e(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}bu.flowIndentCheck=my});var ba=T(Pu=>{"use strict";var wu=V();function yy(r,t,e){let{uniqueKeys:s}=r.options;if(s===!1)return!1;let i=typeof s=="function"?s:(n,a)=>n===a||wu.isScalar(n)&&wu.isScalar(a)&&n.value===a.value;return t.some(n=>i(n.key,e))}Pu.mapIncludes=yy});var ku=T(Cu=>{"use strict";var Tu=st(),gy=rt(),Su=Gs(),xy=fr(),Au=xa(),by=ba(),vu="All mapping items must start at the same column";function wy({composeNode:r,composeEmptyNode:t},e,s,i,n){let a=n?.nodeClass??gy.YAMLMap,o=new a(e.schema);e.atRoot&&(e.atRoot=!1);let c=s.offset,l=null;for(let u of s.items){let{start:h,key:p,sep:f,value:y}=u,d=Su.resolveProps(h,{indicator:"explicit-key-ind",next:p??f?.[0],offset:c,onError:i,parentIndent:s.indent,startOnNewline:!0}),g=!d.found;if(g){if(p&&(p.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==s.indent&&i(c,"BAD_INDENT",vu)),!d.anchor&&!d.tag&&!f){l=d.end,d.comment&&(o.comment?o.comment+=`
90
+ `+d.comment:o.comment=d.comment);continue}(d.newlineAfterProp||xy.containsNewline(p))&&i(p??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else d.found?.indent!==s.indent&&i(c,"BAD_INDENT",vu);e.atKey=!0;let x=d.end,b=p?r(e,p,d,i):t(e,x,h,null,d,i);e.schema.compat&&Au.flowIndentCheck(s.indent,p,i),e.atKey=!1,by.mapIncludes(e,o.items,b)&&i(x,"DUPLICATE_KEY","Map keys must be unique");let P=Su.resolveProps(f??[],{indicator:"map-value-ind",next:y,offset:b.range[2],onError:i,parentIndent:s.indent,startOnNewline:!p||p.type==="block-scalar"});if(c=P.end,P.found){g&&(y?.type==="block-map"&&!P.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),e.options.strict&&d.start<P.found.offset-1024&&i(b.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let v=y?r(e,y,P,i):t(e,c,f,null,P,i);e.schema.compat&&Au.flowIndentCheck(s.indent,y,i),c=v.range[2];let E=new Tu.Pair(b,v);e.options.keepSourceTokens&&(E.srcToken=u),o.items.push(E)}else{g&&i(b.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),P.comment&&(b.comment?b.comment+=`
91
+ `+P.comment:b.comment=P.comment);let v=new Tu.Pair(b);e.options.keepSourceTokens&&(v.srcToken=u),o.items.push(v)}}return l&&l<c&&i(l,"IMPOSSIBLE","Map comment with trailing content"),o.range=[s.offset,c,l??c],o}Cu.resolveBlockMap=wy});var Nu=T(Eu=>{"use strict";var Py=nt(),Ty=Gs(),Sy=xa();function Ay({composeNode:r,composeEmptyNode:t},e,s,i,n){let a=n?.nodeClass??Py.YAMLSeq,o=new a(e.schema);e.atRoot&&(e.atRoot=!1),e.atKey&&(e.atKey=!1);let c=s.offset,l=null;for(let{start:u,value:h}of s.items){let p=Ty.resolveProps(u,{indicator:"seq-item-ind",next:h,offset:c,onError:i,parentIndent:s.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||h)h?.type==="block-seq"?i(p.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=p.end,p.comment&&(o.comment=p.comment);continue}let f=h?r(e,h,p,i):t(e,p.end,u,null,p,i);e.schema.compat&&Sy.flowIndentCheck(s.indent,h,i),c=f.range[2],o.items.push(f)}return o.range=[s.offset,c,l??c],o}Eu.resolveBlockSeq=Ay});var ts=T(Iu=>{"use strict";function vy(r,t,e,s){let i="";if(r){let n=!1,a="";for(let o of r){let{source:c,type:l}=o;switch(l){case"space":n=!0;break;case"comment":{e&&!n&&s(o,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=a+u:i=u,a="";break}case"newline":i&&(a+=c),n=!0;break;default:s(o,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=c.length}}return{comment:i,offset:t}}Iu.resolveEnd=vy});var Mu=T(Lu=>{"use strict";var Cy=V(),ky=st(),_u=rt(),Ey=nt(),Ny=ts(),Ou=Gs(),Iy=fr(),_y=ba(),wa="Block collections are not allowed within flow collections",Pa=r=>r&&(r.type==="block-map"||r.type==="block-seq");function Oy({composeNode:r,composeEmptyNode:t},e,s,i,n){let a=s.start.source==="{",o=a?"flow map":"flow sequence",c=n?.nodeClass??(a?_u.YAMLMap:Ey.YAMLSeq),l=new c(e.schema);l.flow=!0;let u=e.atRoot;u&&(e.atRoot=!1),e.atKey&&(e.atKey=!1);let h=s.offset+s.start.source.length;for(let g=0;g<s.items.length;++g){let x=s.items[g],{start:b,key:P,sep:v,value:E}=x,L=Ou.resolveProps(b,{flow:o,indicator:"explicit-key-ind",next:P??v?.[0],offset:h,onError:i,parentIndent:s.indent,startOnNewline:!1});if(!L.found){if(!L.anchor&&!L.tag&&!v&&!E){g===0&&L.comma?i(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`):g<s.items.length-1&&i(L.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${o}`),L.comment&&(l.comment?l.comment+=`
92
+ `+L.comment:l.comment=L.comment),h=L.end;continue}!a&&e.options.strict&&Iy.containsNewline(P)&&i(P,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)L.comma&&i(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`);else if(L.comma||i(L.start,"MISSING_CHAR",`Missing , between ${o} items`),L.comment){let U="";e:for(let N of b)switch(N.type){case"comma":case"space":break;case"comment":U=N.source.substring(1);break e;default:break e}if(U){let N=l.items[l.items.length-1];Cy.isPair(N)&&(N=N.value??N.key),N.comment?N.comment+=`
93
+ `+U:N.comment=U,L.comment=L.comment.substring(U.length+1)}}if(!a&&!v&&!L.found){let U=E?r(e,E,L,i):t(e,L.end,v,null,L,i);l.items.push(U),h=U.range[2],Pa(E)&&i(U.range,"BLOCK_IN_FLOW",wa)}else{e.atKey=!0;let U=L.end,N=P?r(e,P,L,i):t(e,U,b,null,L,i);Pa(P)&&i(N.range,"BLOCK_IN_FLOW",wa),e.atKey=!1;let Y=Ou.resolveProps(v??[],{flow:o,indicator:"map-value-ind",next:E,offset:N.range[2],onError:i,parentIndent:s.indent,startOnNewline:!1});if(Y.found){if(!a&&!L.found&&e.options.strict){if(v)for(let Z of v){if(Z===Y.found)break;if(Z.type==="newline"){i(Z,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}L.start<Y.found.offset-1024&&i(Y.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else E&&("source"in E&&E.source?.[0]===":"?i(E,"MISSING_CHAR",`Missing space after : in ${o}`):i(Y.start,"MISSING_CHAR",`Missing , or : between ${o} items`));let le=E?r(e,E,Y,i):Y.found?t(e,Y.end,v,null,Y,i):null;le?Pa(E)&&i(le.range,"BLOCK_IN_FLOW",wa):Y.comment&&(N.comment?N.comment+=`
94
+ `+Y.comment:N.comment=Y.comment);let ye=new ky.Pair(N,le);if(e.options.keepSourceTokens&&(ye.srcToken=x),a){let Z=l;_y.mapIncludes(e,Z.items,N)&&i(U,"DUPLICATE_KEY","Map keys must be unique"),Z.items.push(ye)}else{let Z=new _u.YAMLMap(e.schema);Z.flow=!0,Z.items.push(ye);let gt=(le??N).range;Z.range=[N.range[0],gt[1],gt[2]],l.items.push(Z)}h=le?le.range[2]:Y.end}}let p=a?"}":"]",[f,...y]=s.end,d=h;if(f?.source===p)d=f.offset+f.source.length;else{let g=o[0].toUpperCase()+o.substring(1),x=u?`${g} must end with a ${p}`:`${g} in block collection must be sufficiently indented and end with a ${p}`;i(h,u?"MISSING_CHAR":"BAD_INDENT",x),f&&f.source.length!==1&&y.unshift(f)}if(y.length>0){let g=Ny.resolveEnd(y,d,e.options.strict,i);g.comment&&(l.comment?l.comment+=`
95
+ `+g.comment:l.comment=g.comment),l.range=[s.offset,d,g.offset]}else l.range=[s.offset,d,d];return l}Lu.resolveFlowCollection=Oy});var Ru=T(Du=>{"use strict";var Ly=V(),My=ee(),Dy=rt(),Ry=nt(),Fy=ku(),$y=Nu(),jy=Mu();function Ta(r,t,e,s,i,n){let a=e.type==="block-map"?Fy.resolveBlockMap(r,t,e,s,n):e.type==="block-seq"?$y.resolveBlockSeq(r,t,e,s,n):jy.resolveFlowCollection(r,t,e,s,n),o=a.constructor;return i==="!"||i===o.tagName?(a.tag=o.tagName,a):(i&&(a.tag=i),a)}function By(r,t,e,s,i){let n=s.tag,a=n?t.directives.tagName(n.source,p=>i(n,"TAG_RESOLVE_FAILED",p)):null;if(e.type==="block-seq"){let{anchor:p,newlineAfterProp:f}=s,y=p&&n?p.offset>n.offset?p:n:p??n;y&&(!f||f.offset<y.offset)&&i(y,"MISSING_CHAR","Missing newline after block sequence props")}let o=e.type==="block-map"?"map":e.type==="block-seq"?"seq":e.start.source==="{"?"map":"seq";if(!n||!a||a==="!"||a===Dy.YAMLMap.tagName&&o==="map"||a===Ry.YAMLSeq.tagName&&o==="seq")return Ta(r,t,e,i,a);let c=t.schema.tags.find(p=>p.tag===a&&p.collection===o);if(!c){let p=t.schema.knownTags[a];if(p?.collection===o)t.schema.tags.push(Object.assign({},p,{default:!1})),c=p;else return p?i(n,"BAD_COLLECTION_TYPE",`${p.tag} used for ${o} collection, but expects ${p.collection??"scalar"}`,!0):i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Ta(r,t,e,i,a)}let l=Ta(r,t,e,i,a,c),u=c.resolve?.(l,p=>i(n,"TAG_RESOLVE_FAILED",p),t.options)??l,h=Ly.isNode(u)?u:new My.Scalar(u);return h.range=l.range,h.tag=a,c?.format&&(h.format=c.format),h}Du.composeCollection=By});var Aa=T(Fu=>{"use strict";var Sa=ee();function qy(r,t,e){let s=t.offset,i=Uy(t,r.options.strict,e);if(!i)return{value:"",type:null,comment:"",range:[s,s,s]};let n=i.mode===">"?Sa.Scalar.BLOCK_FOLDED:Sa.Scalar.BLOCK_LITERAL,a=t.source?Vy(t.source):[],o=a.length;for(let d=a.length-1;d>=0;--d){let g=a[d][1];if(g===""||g==="\r")o=d;else break}if(o===0){let d=i.chomp==="+"&&a.length>0?`
96
+ `.repeat(Math.max(1,a.length-1)):"",g=s+i.length;return t.source&&(g+=t.source.length),{value:d,type:n,comment:i.comment,range:[s,g,g]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let d=0;d<o;++d){let[g,x]=a[d];if(x===""||x==="\r")i.indent===0&&g.length>c&&(c=g.length);else{g.length<c&&e(l+g.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(c=g.length),u=d,c===0&&!r.atRoot&&e(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=g.length+x.length+1}for(let d=a.length-1;d>=o;--d)a[d][0].length>c&&(o=d+1);let h="",p="",f=!1;for(let d=0;d<u;++d)h+=a[d][0].slice(c)+`
97
+ `;for(let d=u;d<o;++d){let[g,x]=a[d];l+=g.length+x.length+1;let b=x[x.length-1]==="\r";if(b&&(x=x.slice(0,-1)),x&&g.length<c){let v=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;e(l-x.length-(b?2:1),"BAD_INDENT",v),g=""}n===Sa.Scalar.BLOCK_LITERAL?(h+=p+g.slice(c)+x,p=`
98
+ `):g.length>c||x[0]===" "?(p===" "?p=`
99
+ `:!f&&p===`
100
+ `&&(p=`
101
+
102
+ `),h+=p+g.slice(c)+x,p=`
103
+ `,f=!0):x===""?p===`
104
+ `?h+=`
105
+ `:p=`
106
+ `:(h+=p+x,p=" ",f=!1)}switch(i.chomp){case"-":break;case"+":for(let d=o;d<a.length;++d)h+=`
107
+ `+a[d][0].slice(c);h[h.length-1]!==`
108
+ `&&(h+=`
109
+ `);break;default:h+=`
110
+ `}let y=s+i.length+t.source.length;return{value:h,type:n,comment:i.comment,range:[s,y,y]}}function Uy({offset:r,props:t},e,s){if(t[0].type!=="block-scalar-header")return s(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=t[0],n=i[0],a=0,o="",c=-1;for(let p=1;p<i.length;++p){let f=i[p];if(!o&&(f==="-"||f==="+"))o=f;else{let y=Number(f);!a&&y?a=y:c===-1&&(c=r+p)}}c!==-1&&s(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let l=!1,u="",h=i.length;for(let p=1;p<t.length;++p){let f=t[p];switch(f.type){case"space":l=!0;case"newline":h+=f.source.length;break;case"comment":e&&!l&&s(f,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),h+=f.source.length,u=f.source.substring(1);break;case"error":s(f,"UNEXPECTED_TOKEN",f.message),h+=f.source.length;break;default:{let y=`Unexpected token in block scalar header: ${f.type}`;s(f,"UNEXPECTED_TOKEN",y);let d=f.source;d&&typeof d=="string"&&(h+=d.length)}}}return{mode:n,indent:a,chomp:o,comment:u,length:h}}function Vy(r){let t=r.split(/\n( *)/),e=t[0],s=e.match(/^( *)/),n=[s?.[1]?[s[1],e.slice(s[1].length)]:["",e]];for(let a=1;a<t.length;a+=2)n.push([t[a],t[a+1]]);return n}Fu.resolveBlockScalar=qy});var Ca=T(ju=>{"use strict";var va=ee(),Hy=ts();function Ky(r,t,e){let{offset:s,type:i,source:n,end:a}=r,o,c,l=(p,f,y)=>e(s+p,f,y);switch(i){case"scalar":o=va.Scalar.PLAIN,c=Wy(n,l);break;case"single-quoted-scalar":o=va.Scalar.QUOTE_SINGLE,c=zy(n,l);break;case"double-quoted-scalar":o=va.Scalar.QUOTE_DOUBLE,c=Gy(n,l);break;default:return e(r,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[s,s+n.length,s+n.length]}}let u=s+n.length,h=Hy.resolveEnd(a,u,t,e);return{value:c,type:o,comment:h.comment,range:[s,u,h.offset]}}function Wy(r,t){let e="";switch(r[0]){case" ":e="a tab character";break;case",":e="flow indicator character ,";break;case"%":e="directive indicator character %";break;case"|":case">":{e=`block scalar indicator ${r[0]}`;break}case"@":case"`":{e=`reserved character ${r[0]}`;break}}return e&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${e}`),$u(r)}function zy(r,t){return(r[r.length-1]!=="'"||r.length===1)&&t(r.length,"MISSING_CHAR","Missing closing 'quote"),$u(r.slice(1,-1)).replace(/''/g,"'")}function $u(r){let t,e;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
111
+ `,"sy"),e=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
112
+ `,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,e=/[ \t]*(.*?)[ \t]*\r?\n/sy}let s=t.exec(r);if(!s)return r;let i=s[1],n=" ",a=t.lastIndex;for(e.lastIndex=a;s=e.exec(r);)s[1]===""?n===`
113
+ `?i+=n:n=`
114
+ `:(i+=n+s[1],n=" "),a=e.lastIndex;let o=/[ \t]*(.*)/sy;return o.lastIndex=a,s=o.exec(r),i+n+(s?.[1]??"")}function Gy(r,t){let e="";for(let s=1;s<r.length-1;++s){let i=r[s];if(!(i==="\r"&&r[s+1]===`
115
+ `))if(i===`
116
+ `){let{fold:n,offset:a}=Jy(r,s);e+=n,s=a}else if(i==="\\"){let n=r[++s],a=Yy[n];if(a)e+=a;else if(n===`
117
+ `)for(n=r[s+1];n===" "||n===" ";)n=r[++s+1];else if(n==="\r"&&r[s+1]===`
118
+ `)for(n=r[++s+1];n===" "||n===" ";)n=r[++s+1];else if(n==="x"||n==="u"||n==="U"){let o=n==="x"?2:n==="u"?4:8;e+=Zy(r,s+1,o,t),s+=o}else{let o=r.substr(s-1,2);t(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),e+=o}}else if(i===" "||i===" "){let n=s,a=r[s+1];for(;a===" "||a===" ";)a=r[++s+1];a!==`
119
+ `&&!(a==="\r"&&r[s+2]===`
120
+ `)&&(e+=s>n?r.slice(n,s+1):i)}else e+=i}return(r[r.length-1]!=='"'||r.length===1)&&t(r.length,"MISSING_CHAR",'Missing closing "quote'),e}function Jy(r,t){let e="",s=r[t+1];for(;(s===" "||s===" "||s===`
121
+ `||s==="\r")&&!(s==="\r"&&r[t+2]!==`
122
+ `);)s===`
123
+ `&&(e+=`
124
+ `),t+=1,s=r[t+1];return e||(e=" "),{fold:e,offset:t}}var Yy={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
125
+ `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Zy(r,t,e,s){let i=r.substr(t,e),a=i.length===e&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let o=r.substr(t-2,e+2);return s(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),o}}ju.resolveFlowScalar=Ky});var Uu=T(qu=>{"use strict";var Tt=V(),Bu=ee(),Xy=Aa(),Qy=Ca();function eg(r,t,e,s){let{value:i,type:n,comment:a,range:o}=t.type==="block-scalar"?Xy.resolveBlockScalar(r,t,s):Qy.resolveFlowScalar(t,r.options.strict,s),c=e?r.directives.tagName(e.source,h=>s(e,"TAG_RESOLVE_FAILED",h)):null,l;r.options.stringKeys&&r.atKey?l=r.schema[Tt.SCALAR]:c?l=tg(r.schema,i,c,e,s):t.type==="scalar"?l=sg(r,i,t,s):l=r.schema[Tt.SCALAR];let u;try{let h=l.resolve(i,p=>s(e??t,"TAG_RESOLVE_FAILED",p),r.options);u=Tt.isScalar(h)?h:new Bu.Scalar(h)}catch(h){let p=h instanceof Error?h.message:String(h);s(e??t,"TAG_RESOLVE_FAILED",p),u=new Bu.Scalar(i)}return u.range=o,u.source=i,n&&(u.type=n),c&&(u.tag=c),l.format&&(u.format=l.format),a&&(u.comment=a),u}function tg(r,t,e,s,i){if(e==="!")return r[Tt.SCALAR];let n=[];for(let o of r.tags)if(!o.collection&&o.tag===e)if(o.default&&o.test)n.push(o);else return o;for(let o of n)if(o.test?.test(t))return o;let a=r.knownTags[e];return a&&!a.collection?(r.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${e}`,e!=="tag:yaml.org,2002:str"),r[Tt.SCALAR])}function sg({atKey:r,directives:t,schema:e},s,i,n){let a=e.tags.find(o=>(o.default===!0||r&&o.default==="key")&&o.test?.test(s))||e[Tt.SCALAR];if(e.compat){let o=e.compat.find(c=>c.default&&c.test?.test(s))??e[Tt.SCALAR];if(a.tag!==o.tag){let c=t.tagString(a.tag),l=t.tagString(o.tag),u=`Value may be parsed as either ${c} or ${l}`;n(i,"TAG_RESOLVE_FAILED",u,!0)}}return a}qu.composeScalar=eg});var Hu=T(Vu=>{"use strict";function ig(r,t,e){if(t){e??(e=t.length);for(let s=e-1;s>=0;--s){let i=t[s];switch(i.type){case"space":case"comment":case"newline":r-=i.source.length;continue}for(i=t[++s];i?.type==="space";)r+=i.source.length,i=t[++s];break}}return r}Vu.emptyScalarPosition=ig});var zu=T(Ea=>{"use strict";var rg=Es(),ng=V(),ag=Ru(),Ku=Uu(),og=ts(),cg=Hu(),lg={composeNode:Wu,composeEmptyNode:ka};function Wu(r,t,e,s){let i=r.atKey,{spaceBefore:n,comment:a,anchor:o,tag:c}=e,l,u=!0;switch(t.type){case"alias":l=ug(r,t,s),(o||c)&&s(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=Ku.composeScalar(r,t,c,s),o&&(l.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=ag.composeCollection(lg,r,t,e,s),o&&(l.anchor=o.source.substring(1))}catch(h){let p=h instanceof Error?h.message:String(h);s(t,"RESOURCE_EXHAUSTION",p)}break;default:{let h=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;s(t,"UNEXPECTED_TOKEN",h),u=!1}}return l??(l=ka(r,t.offset,void 0,null,e,s)),o&&l.anchor===""&&s(o,"BAD_ALIAS","Anchor cannot be an empty string"),i&&r.options.stringKeys&&(!ng.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&s(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),n&&(l.spaceBefore=!0),a&&(t.type==="scalar"&&t.source===""?l.comment=a:l.commentBefore=a),r.options.keepSourceTokens&&u&&(l.srcToken=t),l}function ka(r,t,e,s,{spaceBefore:i,comment:n,anchor:a,tag:o,end:c},l){let u={type:"scalar",offset:cg.emptyScalarPosition(t,e,s),indent:-1,source:""},h=Ku.composeScalar(r,u,o,l);return a&&(h.anchor=a.source.substring(1),h.anchor===""&&l(a,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(h.spaceBefore=!0),n&&(h.comment=n,h.range[2]=c),h}function ug({options:r},{offset:t,source:e,end:s},i){let n=new rg.Alias(e.substring(1));n.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),n.source.endsWith(":")&&i(t+e.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let a=t+e.length,o=og.resolveEnd(s,a,r.strict,i);return n.range=[t,a,o.offset],o.comment&&(n.comment=o.comment),n}Ea.composeEmptyNode=ka;Ea.composeNode=Wu});var Yu=T(Ju=>{"use strict";var hg=Hs(),Gu=zu(),pg=ts(),fg=Gs();function dg(r,t,{offset:e,start:s,value:i,end:n},a){let o=Object.assign({_directives:t},r),c=new hg.Document(void 0,o),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=fg.resolveProps(s,{indicator:"doc-start",next:i??n?.[0],offset:e,onError:a,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&a(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?Gu.composeNode(l,i,u,a):Gu.composeEmptyNode(l,u.end,s,null,u,a);let h=c.contents.range[2],p=pg.resolveEnd(n,h,!1,a);return p.comment&&(c.comment=p.comment),c.range=[e,h,p.offset],c}Ju.composeDoc=dg});var Ia=T(Qu=>{"use strict";var mg=require("process"),yg=mn(),gg=Hs(),Js=zs(),Zu=V(),xg=Yu(),bg=ts();function Ys(r){if(typeof r=="number")return[r,r+1];if(Array.isArray(r))return r.length===2?r:[r[0],r[1]];let{offset:t,source:e}=r;return[t,t+(typeof e=="string"?e.length:1)]}function Xu(r){let t="",e=!1,s=!1;for(let i=0;i<r.length;++i){let n=r[i];switch(n[0]){case"#":t+=(t===""?"":s?`
126
+
127
+ `:`
128
+ `)+(n.substring(1)||" "),e=!0,s=!1;break;case"%":r[i+1]?.[0]!=="#"&&(i+=1),e=!1;break;default:e||(s=!0),e=!1}}return{comment:t,afterEmptyLine:s}}var Na=class{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,s,i,n)=>{let a=Ys(e);n?this.warnings.push(new Js.YAMLWarning(a,s,i)):this.errors.push(new Js.YAMLParseError(a,s,i))},this.directives=new yg.Directives({version:t.version||"1.2"}),this.options=t}decorate(t,e){let{comment:s,afterEmptyLine:i}=Xu(this.prelude);if(s){let n=t.contents;if(e)t.comment=t.comment?`${t.comment}
129
+ ${s}`:s;else if(i||t.directives.docStart||!n)t.commentBefore=s;else if(Zu.isCollection(n)&&!n.flow&&n.items.length>0){let a=n.items[0];Zu.isPair(a)&&(a=a.key);let o=a.commentBefore;a.commentBefore=o?`${s}
130
+ ${o}`:s}else{let a=n.commentBefore;n.commentBefore=a?`${s}
131
+ ${a}`:s}}if(e){for(let n=0;n<this.errors.length;++n)t.errors.push(this.errors[n]);for(let n=0;n<this.warnings.length;++n)t.warnings.push(this.warnings[n])}else t.errors=this.errors,t.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Xu(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,e=!1,s=-1){for(let i of t)yield*this.next(i);yield*this.end(e,s)}*next(t){switch(mg.env.LOG_STREAM&&console.dir(t,{depth:null}),t.type){case"directive":this.directives.add(t.source,(e,s,i)=>{let n=Ys(t);n[0]+=e,this.onError(n,"BAD_DIRECTIVE",s,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{let e=xg.composeDoc(this.options,this.directives,t,this.onError);this.atDirectives&&!e.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(e,!1),this.doc&&(yield this.doc),this.doc=e,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{let e=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,s=new Js.YAMLParseError(Ys(t),"UNEXPECTED_TOKEN",e);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){let s="Unexpected doc-end without preceding document";this.errors.push(new Js.YAMLParseError(Ys(t),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;let e=bg.resolveEnd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),e.comment){let s=this.doc.comment;this.doc.comment=s?`${s}
132
+ ${e.comment}`:e.comment}this.doc.range[2]=e.offset;break}default:this.errors.push(new Js.YAMLParseError(Ys(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,e=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){let s=Object.assign({_directives:this.directives},this.options),i=new gg.Document(void 0,s);this.atDirectives&&this.onError(e,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,e,e],this.decorate(i,!1),yield i}}};Qu.Composer=Na});var sh=T(dr=>{"use strict";var wg=Aa(),Pg=Ca(),Tg=zs(),eh=Ls();function Sg(r,t=!0,e){if(r){let s=(i,n,a)=>{let o=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(e)e(o,n,a);else throw new Tg.YAMLParseError([o,o+1],n,a)};switch(r.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Pg.resolveFlowScalar(r,t,s);case"block-scalar":return wg.resolveBlockScalar({options:{strict:t}},r,s)}}return null}function Ag(r,t){let{implicitKey:e=!1,indent:s,inFlow:i=!1,offset:n=-1,type:a="PLAIN"}=t,o=eh.stringifyString({type:a,value:r},{implicitKey:e,indent:s>0?" ".repeat(s):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:"newline",offset:-1,indent:s,source:`
133
+ `}];switch(o[0]){case"|":case">":{let l=o.indexOf(`
134
+ `),u=o.substring(0,l),h=o.substring(l+1)+`
135
+ `,p=[{type:"block-scalar-header",offset:n,indent:s,source:u}];return th(p,c)||p.push({type:"newline",offset:-1,indent:s,source:`
136
+ `}),{type:"block-scalar",offset:n,indent:s,props:p,source:h}}case'"':return{type:"double-quoted-scalar",offset:n,indent:s,source:o,end:c};case"'":return{type:"single-quoted-scalar",offset:n,indent:s,source:o,end:c};default:return{type:"scalar",offset:n,indent:s,source:o,end:c}}}function vg(r,t,e={}){let{afterKey:s=!1,implicitKey:i=!1,inFlow:n=!1,type:a}=e,o="indent"in r?r.indent:null;if(s&&typeof o=="number"&&(o+=2),!a)switch(r.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{let l=r.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}let c=eh.stringifyString({type:a,value:t},{implicitKey:i||o===null,indent:o!==null&&o>0?" ".repeat(o):"",inFlow:n,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Cg(r,c);break;case'"':_a(r,c,"double-quoted-scalar");break;case"'":_a(r,c,"single-quoted-scalar");break;default:_a(r,c,"scalar")}}function Cg(r,t){let e=t.indexOf(`
137
+ `),s=t.substring(0,e),i=t.substring(e+1)+`
138
+ `;if(r.type==="block-scalar"){let n=r.props[0];if(n.type!=="block-scalar-header")throw new Error("Invalid block scalar header");n.source=s,r.source=i}else{let{offset:n}=r,a="indent"in r?r.indent:-1,o=[{type:"block-scalar-header",offset:n,indent:a,source:s}];th(o,"end"in r?r.end:void 0)||o.push({type:"newline",offset:-1,indent:a,source:`
139
+ `});for(let c of Object.keys(r))c!=="type"&&c!=="offset"&&delete r[c];Object.assign(r,{type:"block-scalar",indent:a,props:o,source:i})}}function th(r,t){if(t)for(let e of t)switch(e.type){case"space":case"comment":r.push(e);break;case"newline":return r.push(e),!0}return!1}function _a(r,t,e){switch(r.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":r.type=e,r.source=t;break;case"block-scalar":{let s=r.props.slice(1),i=t.length;r.props[0].type==="block-scalar-header"&&(i-=r.props[0].source.length);for(let n of s)n.offset+=i;delete r.props,Object.assign(r,{type:e,source:t,end:s});break}case"block-map":case"block-seq":{let i={type:"newline",offset:r.offset+t.length,indent:r.indent,source:`
140
+ `};delete r.items,Object.assign(r,{type:e,source:t,end:[i]});break}default:{let s="indent"in r?r.indent:-1,i="end"in r&&Array.isArray(r.end)?r.end.filter(n=>n.type==="space"||n.type==="comment"||n.type==="newline"):[];for(let n of Object.keys(r))n!=="type"&&n!=="offset"&&delete r[n];Object.assign(r,{type:e,indent:s,source:t,end:i})}}}dr.createScalarToken=Ag;dr.resolveAsScalar=Sg;dr.setScalarValue=vg});var rh=T(ih=>{"use strict";var kg=r=>"type"in r?yr(r):mr(r);function yr(r){switch(r.type){case"block-scalar":{let t="";for(let e of r.props)t+=yr(e);return t+r.source}case"block-map":case"block-seq":{let t="";for(let e of r.items)t+=mr(e);return t}case"flow-collection":{let t=r.start.source;for(let e of r.items)t+=mr(e);for(let e of r.end)t+=e.source;return t}case"document":{let t=mr(r);if(r.end)for(let e of r.end)t+=e.source;return t}default:{let t=r.source;if("end"in r&&r.end)for(let e of r.end)t+=e.source;return t}}}function mr({start:r,key:t,sep:e,value:s}){let i="";for(let n of r)i+=n.source;if(t&&(i+=yr(t)),e)for(let n of e)i+=n.source;return s&&(i+=yr(s)),i}ih.stringify=kg});var ch=T(oh=>{"use strict";var Oa=Symbol("break visit"),Eg=Symbol("skip children"),nh=Symbol("remove item");function St(r,t){"type"in r&&r.type==="document"&&(r={start:r.start,value:r.value}),ah(Object.freeze([]),r,t)}St.BREAK=Oa;St.SKIP=Eg;St.REMOVE=nh;St.itemAtPath=(r,t)=>{let e=r;for(let[s,i]of t){let n=e?.[s];if(n&&"items"in n)e=n.items[i];else return}return e};St.parentCollection=(r,t)=>{let e=St.itemAtPath(r,t.slice(0,-1)),s=t[t.length-1][0],i=e?.[s];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function ah(r,t,e){let s=e(t,r);if(typeof s=="symbol")return s;for(let i of["key","value"]){let n=t[i];if(n&&"items"in n){for(let a=0;a<n.items.length;++a){let o=ah(Object.freeze(r.concat([[i,a]])),n.items[a],e);if(typeof o=="number")a=o-1;else{if(o===Oa)return Oa;o===nh&&(n.items.splice(a,1),a-=1)}}typeof s=="function"&&i==="key"&&(s=s(t,r))}}return typeof s=="function"?s(t,r):s}oh.visit=St});var gr=T(he=>{"use strict";var La=sh(),Ng=rh(),Ig=ch(),Ma="\uFEFF",Da="",Ra="",Fa="",_g=r=>!!r&&"items"in r,Og=r=>!!r&&(r.type==="scalar"||r.type==="single-quoted-scalar"||r.type==="double-quoted-scalar"||r.type==="block-scalar");function Lg(r){switch(r){case Ma:return"<BOM>";case Da:return"<DOC>";case Ra:return"<FLOW_END>";case Fa:return"<SCALAR>";default:return JSON.stringify(r)}}function Mg(r){switch(r){case Ma:return"byte-order-mark";case Da:return"doc-mode";case Ra:return"flow-error-end";case Fa:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
141
+ `:case`\r
142
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(r[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}he.createScalarToken=La.createScalarToken;he.resolveAsScalar=La.resolveAsScalar;he.setScalarValue=La.setScalarValue;he.stringify=Ng.stringify;he.visit=Ig.visit;he.BOM=Ma;he.DOCUMENT=Da;he.FLOW_END=Ra;he.SCALAR=Fa;he.isCollection=_g;he.isScalar=Og;he.prettyToken=Lg;he.tokenType=Mg});var Ba=T(uh=>{"use strict";var Zs=gr();function ke(r){switch(r){case void 0:case" ":case`
143
+ `:case"\r":case" ":return!0;default:return!1}}var lh=new Set("0123456789ABCDEFabcdef"),Dg=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),xr=new Set(",[]{}"),Rg=new Set(` ,[]{}
144
+ \r `),$a=r=>!r||Rg.has(r),ja=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,e=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!e;let s=this.next??"stream";for(;s&&(e||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let t=this.pos,e=this.buffer[t];for(;e===" "||e===" ";)e=this.buffer[++t];return!e||e==="#"||e===`
145
+ `?!0:e==="\r"?this.buffer[t+1]===`
146
+ `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let e=this.buffer[t];if(this.indentNext>0){let s=0;for(;e===" ";)e=this.buffer[++s+t];if(e==="\r"){let i=this.buffer[s+t+1];if(i===`
147
+ `||!i&&!this.atEnd)return t+s+1}return e===`
148
+ `||s>=this.indentNext||!e&&!this.atEnd?t+s:-1}if(e==="-"||e==="."){let s=this.buffer.substr(t,3);if((s==="---"||s==="...")&&ke(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
149
+ `,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===Zs.BOM&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let e=t.length,s=t.indexOf("#");for(;s!==-1;){let n=t[s-1];if(n===" "||n===" "){e=s-1;break}else s=t.indexOf("#",s+1)}for(;;){let n=t[e-1];if(n===" "||n===" ")e-=1;else break}let i=(yield*this.pushCount(e))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let e=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-e),yield*this.pushNewline(),"stream"}return yield Zs.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let e=this.peek(3);if((e==="---"||e==="...")&&ke(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!ke(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[t,e]=this.peek(2);if(!e&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&ke(e)){let s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let t=this.getLine();if(t===null)return this.setNext("doc");let e=yield*this.pushIndicators();switch(t[e]){case"#":yield*this.pushCount(t.length-e);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil($a),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return e+=yield*this.parseBlockScalarHeader(),e+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-e),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,e,s=-1;do t=yield*this.pushNewline(),t>0?(e=yield*this.pushSpaces(!1),this.indentValue=s=e):e=0,e+=yield*this.pushSpaces(!0);while(t+e>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((s!==-1&&s<this.indentNext&&i[0]!=="#"||s===0&&(i.startsWith("---")||i.startsWith("..."))&&ke(i[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield Zs.FLOW_END,yield*this.parseLineStart();let n=0;for(;i[n]===",";)n+=yield*this.pushCount(1),n+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(n+=yield*this.pushIndicators(),i[n]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-n),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil($a),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let a=this.charAt(1);if(this.flowKey||ke(a)||a===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let t=this.charAt(0),e=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;e!==-1&&this.buffer[e+1]==="'";)e=this.buffer.indexOf("'",e+2);else for(;e!==-1;){let n=0;for(;this.buffer[e-1-n]==="\\";)n+=1;if(n%2===0)break;e=this.buffer.indexOf('"',e+1)}let s=this.buffer.substring(0,e),i=s.indexOf(`
150
+ `,this.pos);if(i!==-1){for(;i!==-1;){let n=this.continueScalar(i+1);if(n===-1)break;i=s.indexOf(`
151
+ `,n)}i!==-1&&(e=i-(s[i-1]==="\r"?2:1))}if(e===-1){if(!this.atEnd)return this.setNext("quoted-scalar");e=this.buffer.length}return yield*this.pushToIndex(e+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){let e=this.buffer[++t];if(e==="+")this.blockScalarKeep=!0;else if(e>"0"&&e<="9")this.blockScalarIndent=Number(e)-1;else if(e!=="-")break}return yield*this.pushUntil(e=>ke(e)||e==="#")}*parseBlockScalar(){let t=this.pos-1,e=0,s;e:for(let n=this.pos;s=this.buffer[n];++n)switch(s){case" ":e+=1;break;case`
152
+ `:t=n,e=0;break;case"\r":{let a=this.buffer[n+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
153
+ `)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(e>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=e:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let n=this.continueScalar(t+1);if(n===-1)break;t=this.buffer.indexOf(`
154
+ `,n)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let i=t+1;for(s=this.buffer[i];s===" ";)s=this.buffer[++i];if(s===" "){for(;s===" "||s===" "||s==="\r"||s===`
155
+ `;)s=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)do{let n=t-1,a=this.buffer[n];a==="\r"&&(a=this.buffer[--n]);let o=n;for(;a===" ";)a=this.buffer[--n];if(a===`
156
+ `&&n>=this.pos&&n+1+e>o)t=n;else break}while(!0);return yield Zs.SCALAR,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let t=this.flowLevel>0,e=this.pos-1,s=this.pos-1,i;for(;i=this.buffer[++s];)if(i===":"){let n=this.buffer[s+1];if(ke(n)||t&&xr.has(n))break;e=s}else if(ke(i)){let n=this.buffer[s+1];if(i==="\r"&&(n===`
157
+ `?(s+=1,i=`
158
+ `,n=this.buffer[s+1]):e=s),n==="#"||t&&xr.has(n))break;if(i===`
159
+ `){let a=this.continueScalar(s+1);if(a===-1)break;s=Math.max(s,a-2)}}else{if(t&&xr.has(i))break;e=s}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Zs.SCALAR,yield*this.pushToIndex(e+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,e){let s=this.buffer.slice(this.pos,t);return s?(yield s,this.pos+=s.length,s.length):(e&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil($a),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let e=this.flowLevel>0,s=this.charAt(1);if(ke(s)||e&&xr.has(s)){e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,e=this.buffer[t];for(;!ke(e)&&e!==">";)e=this.buffer[++t];return yield*this.pushToIndex(e===">"?t+1:t,!1)}else{let t=this.pos+1,e=this.buffer[t];for(;e;)if(Dg.has(e))e=this.buffer[++t];else if(e==="%"&&lh.has(this.buffer[t+1])&&lh.has(this.buffer[t+2]))e=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){let t=this.buffer[this.pos];return t===`
160
+ `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
161
+ `?yield*this.pushCount(2):0}*pushSpaces(t){let e=this.pos-1,s;do s=this.buffer[++e];while(s===" "||t&&s===" ");let i=e-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=e),i}*pushUntil(t){let e=this.pos,s=this.buffer[e];for(;!t(s);)s=this.buffer[++e];return yield*this.pushToIndex(e,!1)}};uh.Lexer=ja});var Ua=T(hh=>{"use strict";var qa=class{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let e=0,s=this.lineStarts.length;for(;e<s;){let n=e+s>>1;this.lineStarts[n]<t?e=n+1:s=n}if(this.lineStarts[e]===t)return{line:e+1,col:1};if(e===0)return{line:0,col:t};let i=this.lineStarts[e-1];return{line:e,col:t-i+1}}}};hh.LineCounter=qa});var Ha=T(yh=>{"use strict";var Fg=require("process"),ph=gr(),$g=Ba();function at(r,t){for(let e=0;e<r.length;++e)if(r[e].type===t)return!0;return!1}function fh(r){for(let t=0;t<r.length;++t)switch(r[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function mh(r){switch(r?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function br(r){switch(r.type){case"document":return r.start;case"block-map":{let t=r.items[r.items.length-1];return t.sep??t.start}case"block-seq":return r.items[r.items.length-1].start;default:return[]}}function ss(r){if(r.length===0)return[];let t=r.length;e:for(;--t>=0;)switch(r[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;r[++t]?.type==="space";);return r.splice(t,r.length)}function wr(r,t){if(t.length<1e5)Array.prototype.push.apply(r,t);else for(let e=0;e<t.length;++e)r.push(t[e])}function dh(r){if(r.start.type==="flow-seq-start")for(let t of r.items)t.sep&&!t.value&&!at(t.start,"explicit-key-ind")&&!at(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,mh(t.value)?t.value.end?wr(t.value.end,t.sep):t.value.end=t.sep:wr(t.start,t.sep),delete t.sep)}var Va=class{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new $g.Lexer,this.onNewLine=t}*parse(t,e=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let s of this.lexer.lex(t,e))yield*this.next(s);e||(yield*this.end())}*next(t){if(this.source=t,Fg.env.LOG_TOKENS&&console.log("|",ph.prettyToken(t)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}let e=ph.tokenType(t);if(e)if(e==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=e,yield*this.step(),e){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{let s=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let t=this.peek(1);if(this.type==="doc-end"&&t?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){let e=t??this.stack.pop();if(!e)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield e;else{let s=this.peek(1);switch(e.type==="block-scalar"?e.indent="indent"in s?s.indent:0:e.type==="flow-collection"&&s.type==="document"&&(e.indent=0),e.type==="flow-collection"&&dh(e),s.type){case"document":s.value=e;break;case"block-scalar":s.props.push(e);break;case"block-map":{let i=s.items[s.items.length-1];if(i.value){s.items.push({start:[],key:e,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=e;else{Object.assign(i,{key:e,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=s.items[s.items.length-1];i.value?s.items.push({start:[],value:e}):i.value=e;break}case"flow-collection":{let i=s.items[s.items.length-1];!i||i.value?s.items.push({start:[],key:e,sep:[]}):i.sep?i.value=e:Object.assign(i,{key:e,sep:[]});return}default:yield*this.pop(),yield*this.pop(e)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(e.type==="block-map"||e.type==="block-seq")){let i=e.items[e.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&fh(i.start)===-1&&(e.indent===0||i.start.every(n=>n.type!=="comment"||n.indent<e.indent))&&(s.type==="document"?s.end=i.start:s.items.push({start:i.start}),e.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{fh(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}let e=this.startBlockValue(t);e?this.stack.push(e):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){let e=br(this.peek(2)),s=ss(e),i;t.end?(i=t.end,i.push(this.sourceToken),delete t.end):i=[this.sourceToken];let n={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=n}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf(`
162
+ `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
163
+ `,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){let e=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,e.value){let s="end"in e.value?e.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else e.sep?e.sep.push(this.sourceToken):e.start.push(this.sourceToken);return;case"space":case"comment":if(e.value)t.items.push({start:[this.sourceToken]});else if(e.sep)e.sep.push(this.sourceToken);else{if(this.atIndentedComment(e.start,t.indent)){let i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){wr(i,e.start),i.push(this.sourceToken),t.items.pop();return}}e.start.push(this.sourceToken)}return}if(this.indent>=t.indent){let s=!this.onKeyLine&&this.indent===t.indent,i=s&&(e.sep||e.explicitKey)&&this.type!=="seq-item-ind",n=[];if(i&&e.sep&&!e.value){let a=[];for(let o=0;o<e.sep.length;++o){let c=e.sep[o];switch(c.type){case"newline":a.push(o);break;case"space":break;case"comment":c.indent>t.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(n=e.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":i||e.value?(n.push(this.sourceToken),t.items.push({start:n}),this.onKeyLine=!0):e.sep?e.sep.push(this.sourceToken):e.start.push(this.sourceToken);return;case"explicit-key-ind":!e.sep&&!e.explicitKey?(e.start.push(this.sourceToken),e.explicitKey=!0):i||e.value?(n.push(this.sourceToken),t.items.push({start:n,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(e.explicitKey)if(e.sep)if(e.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(at(e.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]});else if(mh(e.key)&&!at(e.sep,"newline")){let a=ss(e.start),o=e.key,c=e.sep;c.push(this.sourceToken),delete e.key,delete e.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:o,sep:c}]})}else n.length>0?e.sep=e.sep.concat(n,this.sourceToken):e.sep.push(this.sourceToken);else if(at(e.start,"newline"))Object.assign(e,{key:null,sep:[this.sourceToken]});else{let a=ss(e.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else e.sep?e.value||i?t.items.push({start:n,key:null,sep:[this.sourceToken]}):at(e.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):e.sep.push(this.sourceToken):Object.assign(e,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let a=this.flowScalar(this.type);i||e.value?(t.items.push({start:n,key:a,sep:[]}),this.onKeyLine=!0):e.sep?this.stack.push(a):(Object.assign(e,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{let a=this.startBlockValue(t);if(a){if(a.type==="block-seq"){if(!e.explicitKey&&e.sep&&!at(e.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else s&&t.items.push({start:n});this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){let e=t.items[t.items.length-1];switch(this.type){case"newline":if(e.value){let s="end"in e.value?e.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else e.start.push(this.sourceToken);return;case"space":case"comment":if(e.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(e.start,t.indent)){let i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){wr(i,e.start),i.push(this.sourceToken),t.items.pop();return}}e.start.push(this.sourceToken)}return;case"anchor":case"tag":if(e.value||this.indent<=t.indent)break;e.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;e.value||at(e.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):e.start.push(this.sourceToken);return}if(this.indent>t.indent){let s=this.startBlockValue(t);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){let e=t.items[t.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while(s?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!e||e.sep?t.items.push({start:[this.sourceToken]}):e.start.push(this.sourceToken);return;case"map-value-ind":!e||e.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):e.sep?e.sep.push(this.sourceToken):Object.assign(e,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!e||e.value?t.items.push({start:[this.sourceToken]}):e.sep?e.sep.push(this.sourceToken):e.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!e||e.value?t.items.push({start:[],key:i,sep:[]}):e.sep?this.stack.push(i):Object.assign(e,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}let s=this.startBlockValue(t);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{let s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===t.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){let i=br(s),n=ss(i);dh(t);let a=t.end.splice(1,t.end.length);a.push(this.sourceToken);let o={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:n,key:t,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let e=this.source.indexOf(`
164
+ `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
165
+ `,e)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let e=br(t),s=ss(e);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let e=br(t),s=ss(e);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,e){return this.type!=="comment"||this.indent<=e?!1:t.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};yh.Parser=Va});var Ph=T(Qs=>{"use strict";var gh=Ia(),jg=Hs(),Xs=zs(),Bg=En(),qg=V(),Ug=Ua(),xh=Ha();function bh(r){let t=r.prettyErrors!==!1;return{lineCounter:r.lineCounter||t&&new Ug.LineCounter||null,prettyErrors:t}}function Vg(r,t={}){let{lineCounter:e,prettyErrors:s}=bh(t),i=new xh.Parser(e?.addNewLine),n=new gh.Composer(t),a=Array.from(n.compose(i.parse(r)));if(s&&e)for(let o of a)o.errors.forEach(Xs.prettifyError(r,e)),o.warnings.forEach(Xs.prettifyError(r,e));return a.length>0?a:Object.assign([],{empty:!0},n.streamInfo())}function wh(r,t={}){let{lineCounter:e,prettyErrors:s}=bh(t),i=new xh.Parser(e?.addNewLine),n=new gh.Composer(t),a=null;for(let o of n.compose(i.parse(r),!0,r.length))if(!a)a=o;else if(a.options.logLevel!=="silent"){a.errors.push(new Xs.YAMLParseError(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&e&&(a.errors.forEach(Xs.prettifyError(r,e)),a.warnings.forEach(Xs.prettifyError(r,e))),a}function Hg(r,t,e){let s;typeof t=="function"?s=t:e===void 0&&t&&typeof t=="object"&&(e=t);let i=wh(r,e);if(!i)return null;if(i.warnings.forEach(n=>Bg.warn(i.options.logLevel,n)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:s},e))}function Kg(r,t,e){let s=null;if(typeof t=="function"||Array.isArray(t)?s=t:e===void 0&&t&&(e=t),typeof e=="string"&&(e=e.length),typeof e=="number"){let i=Math.round(e);e=i<1?void 0:i>8?{indent:8}:{indent:i}}if(r===void 0){let{keepUndefined:i}=e??t??{};if(!i)return}return qg.isDocument(r)&&!s?r.toString(e):new jg.Document(r,s,e).toString(e)}Qs.parse=Hg;Qs.parseAllDocuments=Vg;Qs.parseDocument=wh;Qs.stringify=Kg});var Sh=T(z=>{"use strict";var Wg=Ia(),zg=Hs(),Gg=ua(),Ka=zs(),Jg=Es(),ot=V(),Yg=st(),Zg=ee(),Xg=rt(),Qg=nt(),ex=gr(),tx=Ba(),sx=Ua(),ix=Ha(),Pr=Ph(),Th=As();z.Composer=Wg.Composer;z.Document=zg.Document;z.Schema=Gg.Schema;z.YAMLError=Ka.YAMLError;z.YAMLParseError=Ka.YAMLParseError;z.YAMLWarning=Ka.YAMLWarning;z.Alias=Jg.Alias;z.isAlias=ot.isAlias;z.isCollection=ot.isCollection;z.isDocument=ot.isDocument;z.isMap=ot.isMap;z.isNode=ot.isNode;z.isPair=ot.isPair;z.isScalar=ot.isScalar;z.isSeq=ot.isSeq;z.Pair=Yg.Pair;z.Scalar=Zg.Scalar;z.YAMLMap=Xg.YAMLMap;z.YAMLSeq=Qg.YAMLSeq;z.CST=ex;z.Lexer=tx.Lexer;z.LineCounter=sx.LineCounter;z.Parser=ix.Parser;z.parse=Pr.parse;z.parseAllDocuments=Pr.parseAllDocuments;z.parseDocument=Pr.parseDocument;z.stringify=Pr.stringify;z.visit=Th.visit;z.visitAsync=Th.visitAsync});var pp=T(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});function gb(r,t){if(r==null)return{};var e={};for(var s in r)if({}.hasOwnProperty.call(r,s)){if(t.indexOf(s)!==-1)continue;e[s]=r[s]}return e}var Be=class{constructor(t,e,s){this.line=void 0,this.column=void 0,this.index=void 0,this.line=t,this.column=e,this.index=s}},ds=class{constructor(t,e){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=t,this.end=e}};function ce(r,t){let{line:e,column:s,index:i}=r;return new Be(e,s+t,i+t)}var Fh="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",xb={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:Fh},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:Fh}},$h={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},_r=r=>r.type==="UpdateExpression"?$h.UpdateExpression[`${r.prefix}`]:$h[r.type],bb={AccessorIsGenerator:({kind:r})=>`A ${r}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:r})=>`Missing initializer in ${r} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:r})=>`\`${r}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:r,exportName:t})=>`A string literal cannot be used as an exported binding without \`from\`.
166
+ - Did you mean \`export { '${r}' as '${t}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:r})=>`'${r==="ForInStatement"?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:r})=>`Unsyntactic ${r==="BreakStatement"?"break":"continue"}.`,IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list.",IllegalReturn:"'return' outside of function.",ImportAttributesUseAssert:"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.",ImportBindingIsString:({importName:r})=>`A string literal cannot be used as an imported binding.
167
+ - Did you mean \`import { "${r}" as foo }\`?`,ImportCallArity:"`import()` requires exactly one or two arguments.",ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverDiscardElement:"'void' must be followed by an expression when not used in a binding position.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:r})=>`Expected number in radix ${r}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:r})=>`Escape sequence in keyword ${r}.`,InvalidIdentifier:({identifierName:r})=>`Invalid identifier ${r}.`,InvalidLhs:({ancestor:r})=>`Invalid left-hand side in ${_r(r)}.`,InvalidLhsBinding:({ancestor:r})=>`Binding invalid left-hand side in ${_r(r)}.`,InvalidLhsOptionalChaining:({ancestor:r})=>`Invalid optional chaining in the left-hand side of ${_r(r)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:r})=>`Unexpected character '${r}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:r})=>`Private name #${r} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:r})=>`Label '${r}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:r})=>`This experimental syntax requires enabling the parser plugin: ${r.map(t=>JSON.stringify(t)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:r})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${r.map(t=>JSON.stringify(t)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:r})=>`Duplicate key "${r}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:r})=>`An export name cannot include a lone surrogate, found '\\u${r.toString(16)}'.`,ModuleExportUndefined:({localName:r})=>`Export '${r}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:r})=>`Private names are only allowed in property accesses (\`obj.#${r}\`) or in \`in\` expressions (\`#${r} in obj\`).`,PrivateNameRedeclaration:({identifierName:r})=>`Duplicate private name #${r}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:r})=>`Unexpected keyword '${r}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:r})=>`Unexpected reserved word '${r}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:r,unexpected:t})=>`Unexpected token${t?` '${t}'.`:""}${r?`, expected "${r}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.",UnexpectedVoidPattern:"Unexpected void binding.",UnsupportedBind:"Binding should be performed on object property.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:r,onlyValidPropertyName:t})=>`The only valid meta property for ${r} is ${r}.${t}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:r})=>`Identifier '${r}' has already been declared.`,VoidPatternCatchClauseParam:"A void binding can not be the catch clause parameter. Use `try { ... } catch { ... }` if you want to discard the caught error.",VoidPatternInitializer:"A void binding may not have an initializer.",YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",YieldNotInGeneratorFunction:"'yield' is only allowed within generator functions.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},wb={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:r})=>`Assigning to '${r}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:r})=>`Binding '${r}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},Pb={ParseExpressionEmptyInput:"Unexpected parseExpression() input: The input is empty or contains only comments.",ParseExpressionExpectsEOF:({unexpected:r})=>`Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(r)}\`.`},Tb=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),Sb=Object.assign({PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:r})=>`Invalid topic token ${r}. In order to use ${r} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${r}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:r})=>`Hack-style pipe body cannot be an unparenthesized ${_r({type:r})}; please wrap it in parentheses.`},{PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",PrimaryTopicNotAllowed:"Topic reference was used in a lexical context without topic binding.",PrimaryTopicRequiresSmartPipeline:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'}),Ab=["message"];function jh(r,t,e){Object.defineProperty(r,t,{enumerable:!1,configurable:!0,value:e})}function vb({toMessage:r,code:t,reasonCode:e,syntaxPlugin:s}){let i=e==="MissingPlugin"||e==="MissingOneOfPlugins",n={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};return n[e]&&(e=n[e]),function a(o,c){let l=new SyntaxError;return l.code=t,l.reasonCode=e,l.loc=o,l.pos=o.index,l.syntaxPlugin=s,i&&(l.missingPlugin=c.missingPlugin),jh(l,"clone",function(h={}){var p;let{line:f,column:y,index:d}=(p=h.loc)!=null?p:o;return a(new Be(f,y,d),Object.assign({},c,h.details))}),jh(l,"details",c),Object.defineProperty(l,"message",{configurable:!0,get(){let u=`${r(c)} (${o.line}:${o.column})`;return this.message=u,u},set(u){Object.defineProperty(this,"message",{value:u,writable:!0})}}),l}}function $e(r,t){if(Array.isArray(r))return s=>$e(s,r[0]);let e={};for(let s of Object.keys(r)){let i=r[s],n=typeof i=="string"?{message:()=>i}:typeof i=="function"?{message:i}:i,{message:a}=n,o=gb(n,Ab),c=typeof a=="string"?()=>a:a;e[s]=vb(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:s,toMessage:c},t?{syntaxPlugin:t}:{},o))}return e}var m=Object.assign({},$e(xb),$e(bb),$e(wb),$e(Pb),$e`pipelineOperator`(Sb));function Cb(){return{sourceType:"script",sourceFilename:void 0,startIndex:0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,allowYieldOutsideFunction:!1,plugins:[],strictMode:void 0,ranges:!1,tokens:!1,createImportExpressions:!1,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0}}function kb(r){let t=Cb();if(r==null)return t;if(r.annexB!=null&&r.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");for(let e of Object.keys(t))r[e]!=null&&(t[e]=r[e]);if(t.startLine===1)r.startIndex==null&&t.startColumn>0?t.startIndex=t.startColumn:r.startColumn==null&&t.startIndex>0&&(t.startColumn=t.startIndex);else if((r.startColumn==null||r.startIndex==null)&&r.startIndex!=null)throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");if(t.sourceType==="commonjs"){if(r.allowAwaitOutsideFunction!=null)throw new Error("The `allowAwaitOutsideFunction` option cannot be used with `sourceType: 'commonjs'`.");if(r.allowReturnOutsideFunction!=null)throw new Error("`sourceType: 'commonjs'` implies `allowReturnOutsideFunction: true`, please remove the `allowReturnOutsideFunction` option or use `sourceType: 'script'`.");if(r.allowNewTargetOutsideFunction!=null)throw new Error("`sourceType: 'commonjs'` implies `allowNewTargetOutsideFunction: true`, please remove the `allowNewTargetOutsideFunction` option or use `sourceType: 'script'`.")}return t}var{defineProperty:Eb}=Object,Bh=(r,t)=>{r&&Eb(r,t,{enumerable:!1,value:r[t]})};function ii(r){return Bh(r.loc.start,"index"),Bh(r.loc.end,"index"),r}var Nb=r=>class extends r{parse(){let e=ii(super.parse());return this.optionFlags&256&&(e.tokens=e.tokens.map(ii)),e}parseRegExpLiteral({pattern:e,flags:s}){let i=null;try{i=new RegExp(e,s)}catch{}let n=this.estreeParseLiteral(i);return n.regex={pattern:e,flags:s},n}parseBigIntLiteral(e){let s;try{s=BigInt(e)}catch{s=null}let i=this.estreeParseLiteral(s);return i.bigint=String(i.value||e),i}parseDecimalLiteral(e){let i=this.estreeParseLiteral(null);return i.decimal=String(i.value||e),i}estreeParseLiteral(e){return this.parseLiteral(e,"Literal")}parseStringLiteral(e){return this.estreeParseLiteral(e)}parseNumericLiteral(e){return this.estreeParseLiteral(e)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(e){return this.estreeParseLiteral(e)}estreeParseChainExpression(e,s){let i=this.startNodeAtNode(e);return i.expression=e,this.finishNodeAt(i,"ChainExpression",s)}directiveToStmt(e){let s=e.value;delete e.value,this.castNodeTo(s,"Literal"),s.raw=s.extra.raw,s.value=s.extra.expressionValue;let i=this.castNodeTo(e,"ExpressionStatement");return i.expression=s,i.directive=s.extra.rawValue,delete s.extra,i}fillOptionalPropertiesForTSESLint(e){}cloneEstreeStringLiteral(e){let{start:s,end:i,loc:n,range:a,raw:o,value:c}=e,l=Object.create(e.constructor.prototype);return l.type="Literal",l.start=s,l.end=i,l.loc=n,l.range=a,l.raw=o,l.value=c,l}initFunction(e,s){super.initFunction(e,s),e.expression=!1}checkDeclaration(e){e!=null&&this.isObjectProperty(e)?this.checkDeclaration(e.value):super.checkDeclaration(e)}getObjectOrClassMethodParams(e){return e.value.params}isValidDirective(e){var s;return e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&!((s=e.expression.extra)!=null&&s.parenthesized)}parseBlockBody(e,s,i,n,a){super.parseBlockBody(e,s,i,n,a);let o=e.directives.map(c=>this.directiveToStmt(c));e.body=o.concat(e.body),delete e.directives}parsePrivateName(){let e=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(e):e}convertPrivateNameToPrivateIdentifier(e){let s=super.getPrivateNameSV(e);return delete e.id,e.name=s,this.castNodeTo(e,"PrivateIdentifier")}isPrivateName(e){return this.getPluginOption("estree","classFeatures")?e.type==="PrivateIdentifier":super.isPrivateName(e)}getPrivateNameSV(e){return this.getPluginOption("estree","classFeatures")?e.name:super.getPrivateNameSV(e)}parseLiteral(e,s){let i=super.parseLiteral(e,s);return i.raw=i.extra.raw,delete i.extra,i}parseFunctionBody(e,s,i=!1){super.parseFunctionBody(e,s,i),e.expression=e.body.type!=="BlockStatement"}parseMethod(e,s,i,n,a,o,c=!1){let l=this.startNode();l.kind=e.kind,l=super.parseMethod(l,s,i,n,a,o,c),delete l.kind;let{typeParameters:u}=e;u&&(delete e.typeParameters,l.typeParameters=u,this.resetStartLocationFromNode(l,u));let h=this.castNodeTo(l,"FunctionExpression");return e.value=h,o==="ClassPrivateMethod"&&(e.computed=!1),o==="ObjectMethod"?(e.kind==="method"&&(e.kind="init"),e.shorthand=!1,this.finishNode(e,"Property")):this.finishNode(e,"MethodDefinition")}nameIsConstructor(e){return e.type==="Literal"?e.value==="constructor":super.nameIsConstructor(e)}parseClassProperty(...e){let s=super.parseClassProperty(...e);return this.getPluginOption("estree","classFeatures")&&this.castNodeTo(s,"PropertyDefinition"),s}parseClassPrivateProperty(...e){let s=super.parseClassPrivateProperty(...e);return this.getPluginOption("estree","classFeatures")&&(this.castNodeTo(s,"PropertyDefinition"),s.computed=!1),s}parseClassAccessorProperty(e){let s=super.parseClassAccessorProperty(e);return this.getPluginOption("estree","classFeatures")&&(s.abstract&&this.hasPlugin("typescript")?(delete s.abstract,this.castNodeTo(s,"TSAbstractAccessorProperty")):this.castNodeTo(s,"AccessorProperty")),s}parseObjectProperty(e,s,i,n){let a=super.parseObjectProperty(e,s,i,n);return a&&(a.kind="init",this.castNodeTo(a,"Property")),a}finishObjectProperty(e){return e.kind="init",this.finishNode(e,"Property")}isValidLVal(e,s,i,n){return e==="Property"?"value":super.isValidLVal(e,s,i,n)}isAssignable(e,s){return e!=null&&this.isObjectProperty(e)?this.isAssignable(e.value,s):super.isAssignable(e,s)}toAssignable(e,s=!1){if(e!=null&&this.isObjectProperty(e)){let{key:i,value:n}=e;this.isPrivateName(i)&&this.classScope.usePrivateName(this.getPrivateNameSV(i),i.loc.start),this.toAssignable(n,s)}else super.toAssignable(e,s)}toAssignableObjectExpressionProp(e,s,i){e.type==="Property"&&(e.kind==="get"||e.kind==="set")?this.raise(m.PatternHasAccessor,e.key):e.type==="Property"&&e.method?this.raise(m.PatternHasMethod,e.key):super.toAssignableObjectExpressionProp(e,s,i)}finishCallExpression(e,s){let i=super.finishCallExpression(e,s);if(i.callee.type==="Import"){var n,a;this.castNodeTo(i,"ImportExpression"),i.source=i.arguments[0],i.options=(n=i.arguments[1])!=null?n:null,i.attributes=(a=i.arguments[1])!=null?a:null,delete i.arguments,delete i.callee}else i.type==="OptionalCallExpression"?this.castNodeTo(i,"CallExpression"):i.optional=!1;return i}toReferencedArguments(e){e.type!=="ImportExpression"&&super.toReferencedArguments(e)}parseExport(e,s){let i=this.state.lastTokStartLoc,n=super.parseExport(e,s);switch(n.type){case"ExportAllDeclaration":n.exported=null;break;case"ExportNamedDeclaration":n.specifiers.length===1&&n.specifiers[0].type==="ExportNamespaceSpecifier"&&(this.castNodeTo(n,"ExportAllDeclaration"),n.exported=n.specifiers[0].exported,delete n.specifiers);case"ExportDefaultDeclaration":{var a;let{declaration:o}=n;o?.type==="ClassDeclaration"&&((a=o.decorators)==null?void 0:a.length)>0&&o.start===n.start&&this.resetStartLocation(n,i)}break}return n}stopParseSubscript(e,s){let i=super.stopParseSubscript(e,s);return s.optionalChainMember?this.estreeParseChainExpression(i,e.loc.end):i}parseMember(e,s,i,n,a){let o=super.parseMember(e,s,i,n,a);return o.type==="OptionalMemberExpression"?this.castNodeTo(o,"MemberExpression"):o.optional=!1,o}isOptionalMemberExpression(e){return e.type==="ChainExpression"?e.expression.type==="MemberExpression":super.isOptionalMemberExpression(e)}hasPropertyAsPrivateName(e){return e.type==="ChainExpression"&&(e=e.expression),super.hasPropertyAsPrivateName(e)}isObjectProperty(e){return e.type==="Property"&&e.kind==="init"&&!e.method}isObjectMethod(e){return e.type==="Property"&&(e.method||e.kind==="get"||e.kind==="set")}castNodeTo(e,s){let i=super.castNodeTo(e,s);return this.fillOptionalPropertiesForTSESLint(i),i}cloneIdentifier(e){let s=super.cloneIdentifier(e);return this.fillOptionalPropertiesForTSESLint(s),s}cloneStringLiteral(e){return e.type==="Literal"?this.cloneEstreeStringLiteral(e):super.cloneStringLiteral(e)}finishNodeAt(e,s,i){return ii(super.finishNodeAt(e,s,i))}finishNode(e,s){let i=super.finishNode(e,s);return this.fillOptionalPropertiesForTSESLint(i),i}resetStartLocation(e,s){super.resetStartLocation(e,s),ii(e)}resetEndLocation(e,s=this.state.lastTokEndLoc){super.resetEndLocation(e,s),ii(e)}},Ut=class{constructor(t,e){this.token=void 0,this.preserveSpace=void 0,this.token=t,this.preserveSpace=!!e}},H={brace:new Ut("{"),j_oTag:new Ut("<tag"),j_cTag:new Ut("</tag"),j_expr:new Ut("<tag>...</tag>",!0)};H.template=new Ut("`",!0);var $=!0,S=!0,Xa=!0,ri=!0,ft=!0,Ib=!0,Mr=class{constructor(t,e={}){this.label=void 0,this.keyword=void 0,this.beforeExpr=void 0,this.startsExpr=void 0,this.rightAssociative=void 0,this.isLoop=void 0,this.isAssign=void 0,this.prefix=void 0,this.postfix=void 0,this.binop=void 0,this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.rightAssociative=!!e.rightAssociative,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop!=null?e.binop:null,this.updateContext=null}},Co=new Map;function q(r,t={}){t.keyword=r;let e=_(r,t);return Co.set(r,e),e}function oe(r,t){return _(r,{beforeExpr:$,binop:t})}var ci=-1,Ze=[],ko=[],Eo=[],No=[],Io=[],_o=[];function _(r,t={}){var e,s,i,n;return++ci,ko.push(r),Eo.push((e=t.binop)!=null?e:-1),No.push((s=t.beforeExpr)!=null?s:!1),Io.push((i=t.startsExpr)!=null?i:!1),_o.push((n=t.prefix)!=null?n:!1),Ze.push(new Mr(r,t)),ci}function j(r,t={}){var e,s,i,n;return++ci,Co.set(r,ci),ko.push(r),Eo.push((e=t.binop)!=null?e:-1),No.push((s=t.beforeExpr)!=null?s:!1),Io.push((i=t.startsExpr)!=null?i:!1),_o.push((n=t.prefix)!=null?n:!1),Ze.push(new Mr("name",t)),ci}var _b={bracketL:_("[",{beforeExpr:$,startsExpr:S}),bracketHashL:_("#[",{beforeExpr:$,startsExpr:S}),bracketBarL:_("[|",{beforeExpr:$,startsExpr:S}),bracketR:_("]"),bracketBarR:_("|]"),braceL:_("{",{beforeExpr:$,startsExpr:S}),braceBarL:_("{|",{beforeExpr:$,startsExpr:S}),braceHashL:_("#{",{beforeExpr:$,startsExpr:S}),braceR:_("}"),braceBarR:_("|}"),parenL:_("(",{beforeExpr:$,startsExpr:S}),parenR:_(")"),comma:_(",",{beforeExpr:$}),semi:_(";",{beforeExpr:$}),colon:_(":",{beforeExpr:$}),doubleColon:_("::",{beforeExpr:$}),dot:_("."),question:_("?",{beforeExpr:$}),questionDot:_("?."),arrow:_("=>",{beforeExpr:$}),template:_("template"),ellipsis:_("...",{beforeExpr:$}),backQuote:_("`",{startsExpr:S}),dollarBraceL:_("${",{beforeExpr:$,startsExpr:S}),templateTail:_("...`",{startsExpr:S}),templateNonTail:_("...${",{beforeExpr:$,startsExpr:S}),at:_("@"),hash:_("#",{startsExpr:S}),interpreterDirective:_("#!..."),eq:_("=",{beforeExpr:$,isAssign:ri}),assign:_("_=",{beforeExpr:$,isAssign:ri}),slashAssign:_("_=",{beforeExpr:$,isAssign:ri}),xorAssign:_("_=",{beforeExpr:$,isAssign:ri}),moduloAssign:_("_=",{beforeExpr:$,isAssign:ri}),incDec:_("++/--",{prefix:ft,postfix:Ib,startsExpr:S}),bang:_("!",{beforeExpr:$,prefix:ft,startsExpr:S}),tilde:_("~",{beforeExpr:$,prefix:ft,startsExpr:S}),doubleCaret:_("^^",{startsExpr:S}),doubleAt:_("@@",{startsExpr:S}),pipeline:oe("|>",0),nullishCoalescing:oe("??",1),logicalOR:oe("||",1),logicalAND:oe("&&",2),bitwiseOR:oe("|",3),bitwiseXOR:oe("^",4),bitwiseAND:oe("&",5),equality:oe("==/!=/===/!==",6),lt:oe("</>/<=/>=",7),gt:oe("</>/<=/>=",7),relational:oe("</>/<=/>=",7),bitShift:oe("<</>>/>>>",8),bitShiftL:oe("<</>>/>>>",8),bitShiftR:oe("<</>>/>>>",8),plusMin:_("+/-",{beforeExpr:$,binop:9,prefix:ft,startsExpr:S}),modulo:_("%",{binop:10,startsExpr:S}),star:_("*",{binop:10}),slash:oe("/",10),exponent:_("**",{beforeExpr:$,binop:11,rightAssociative:!0}),_in:q("in",{beforeExpr:$,binop:7}),_instanceof:q("instanceof",{beforeExpr:$,binop:7}),_break:q("break"),_case:q("case",{beforeExpr:$}),_catch:q("catch"),_continue:q("continue"),_debugger:q("debugger"),_default:q("default",{beforeExpr:$}),_else:q("else",{beforeExpr:$}),_finally:q("finally"),_function:q("function",{startsExpr:S}),_if:q("if"),_return:q("return",{beforeExpr:$}),_switch:q("switch"),_throw:q("throw",{beforeExpr:$,prefix:ft,startsExpr:S}),_try:q("try"),_var:q("var"),_const:q("const"),_with:q("with"),_new:q("new",{beforeExpr:$,startsExpr:S}),_this:q("this",{startsExpr:S}),_super:q("super",{startsExpr:S}),_class:q("class",{startsExpr:S}),_extends:q("extends",{beforeExpr:$}),_export:q("export"),_import:q("import",{startsExpr:S}),_null:q("null",{startsExpr:S}),_true:q("true",{startsExpr:S}),_false:q("false",{startsExpr:S}),_typeof:q("typeof",{beforeExpr:$,prefix:ft,startsExpr:S}),_void:q("void",{beforeExpr:$,prefix:ft,startsExpr:S}),_delete:q("delete",{beforeExpr:$,prefix:ft,startsExpr:S}),_do:q("do",{isLoop:Xa,beforeExpr:$}),_for:q("for",{isLoop:Xa}),_while:q("while",{isLoop:Xa}),_as:j("as",{startsExpr:S}),_assert:j("assert",{startsExpr:S}),_async:j("async",{startsExpr:S}),_await:j("await",{startsExpr:S}),_defer:j("defer",{startsExpr:S}),_from:j("from",{startsExpr:S}),_get:j("get",{startsExpr:S}),_let:j("let",{startsExpr:S}),_meta:j("meta",{startsExpr:S}),_of:j("of",{startsExpr:S}),_sent:j("sent",{startsExpr:S}),_set:j("set",{startsExpr:S}),_source:j("source",{startsExpr:S}),_static:j("static",{startsExpr:S}),_using:j("using",{startsExpr:S}),_yield:j("yield",{startsExpr:S}),_asserts:j("asserts",{startsExpr:S}),_checks:j("checks",{startsExpr:S}),_exports:j("exports",{startsExpr:S}),_global:j("global",{startsExpr:S}),_implements:j("implements",{startsExpr:S}),_intrinsic:j("intrinsic",{startsExpr:S}),_infer:j("infer",{startsExpr:S}),_is:j("is",{startsExpr:S}),_mixins:j("mixins",{startsExpr:S}),_proto:j("proto",{startsExpr:S}),_require:j("require",{startsExpr:S}),_satisfies:j("satisfies",{startsExpr:S}),_keyof:j("keyof",{startsExpr:S}),_readonly:j("readonly",{startsExpr:S}),_unique:j("unique",{startsExpr:S}),_abstract:j("abstract",{startsExpr:S}),_declare:j("declare",{startsExpr:S}),_enum:j("enum",{startsExpr:S}),_module:j("module",{startsExpr:S}),_namespace:j("namespace",{startsExpr:S}),_interface:j("interface",{startsExpr:S}),_type:j("type",{startsExpr:S}),_opaque:j("opaque",{startsExpr:S}),name:_("name",{startsExpr:S}),placeholder:_("%%",{startsExpr:S}),string:_("string",{startsExpr:S}),num:_("num",{startsExpr:S}),bigint:_("bigint",{startsExpr:S}),decimal:_("decimal",{startsExpr:S}),regexp:_("regexp",{startsExpr:S}),privateName:_("#name",{startsExpr:S}),eof:_("eof"),jsxName:_("jsxName"),jsxText:_("jsxText",{beforeExpr:$}),jsxTagStart:_("jsxTagStart",{startsExpr:S}),jsxTagEnd:_("jsxTagEnd")};function W(r){return r>=93&&r<=133}function Ob(r){return r<=92}function Ie(r){return r>=58&&r<=133}function Xh(r){return r>=58&&r<=137}function Lb(r){return No[r]}function ai(r){return Io[r]}function Mb(r){return r>=29&&r<=33}function qh(r){return r>=129&&r<=131}function Db(r){return r>=90&&r<=92}function Oo(r){return r>=58&&r<=92}function Rb(r){return r>=39&&r<=59}function Fb(r){return r===34}function $b(r){return _o[r]}function jb(r){return r>=121&&r<=123}function Bb(r){return r>=124&&r<=130}function mt(r){return ko[r]}function Or(r){return Eo[r]}function qb(r){return r===57}function Dr(r){return r>=24&&r<=25}function Ye(r){return Ze[r]}Ze[8].updateContext=r=>{r.pop()};Ze[5].updateContext=Ze[7].updateContext=Ze[23].updateContext=r=>{r.push(H.brace)};Ze[22].updateContext=r=>{r[r.length-1]===H.template?r.pop():r.push(H.template)};Ze[143].updateContext=r=>{r.push(H.j_expr,H.j_oTag)};var Lo="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",Qh="\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",Ub=new RegExp("["+Lo+"]"),Vb=new RegExp("["+Lo+Qh+"]");Lo=Qh=null;var ep=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],Hb=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239];function ro(r,t){let e=65536;for(let s=0,i=t.length;s<i;s+=2){if(e+=t[s],e>r)return!1;if(e+=t[s+1],e>=r)return!0}return!1}function je(r){return r<65?r===36:r<=90?!0:r<97?r===95:r<=122?!0:r<=65535?r>=170&&Ub.test(String.fromCharCode(r)):ro(r,ep)}function Vt(r){return r<48?r===36:r<58?!0:r<65?!1:r<=90?!0:r<97?r===95:r<=122?!0:r<=65535?r>=170&&Vb.test(String.fromCharCode(r)):ro(r,ep)||ro(r,Hb)}var Mo={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},Kb=new Set(Mo.keyword),Wb=new Set(Mo.strict),zb=new Set(Mo.strictBind);function tp(r,t){return t&&r==="await"||r==="enum"}function sp(r,t){return tp(r,t)||Wb.has(r)}function ip(r){return zb.has(r)}function rp(r,t){return sp(r,t)||ip(r)}function Gb(r){return Kb.has(r)}function Jb(r,t,e){return r===64&&t===64&&je(e)}var Yb=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function Zb(r){return Yb.has(r)}var li=class{constructor(t){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=t}},ui=class{constructor(t,e){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=t,this.inModule=e}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get allowNewTarget(){return(this.currentThisScopeFlags()&512)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let t=this.currentThisScopeFlags();return(t&64)>0&&(t&2)===0}get inStaticBlock(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&128)return!0;if(e&1731)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get inBareCaseStatement(){return(this.currentScope().flags&256)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(t){return new li(t)}enter(t){this.scopeStack.push(this.createScope(t))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(t){return!!(t.flags&130||!this.parser.inModule&&t.flags&1)}declareName(t,e,s){let i=this.currentScope();if(e&8||e&16){this.checkRedeclarationInScope(i,t,e,s);let n=i.names.get(t)||0;e&16?n=n|4:(i.firstLexicalName||(i.firstLexicalName=t),n=n|2),i.names.set(t,n),e&8&&this.maybeExportDefined(i,t)}else if(e&4)for(let n=this.scopeStack.length-1;n>=0&&(i=this.scopeStack[n],this.checkRedeclarationInScope(i,t,e,s),i.names.set(t,(i.names.get(t)||0)|1),this.maybeExportDefined(i,t),!(i.flags&1667));--n);this.parser.inModule&&i.flags&1&&this.undefinedExports.delete(t)}maybeExportDefined(t,e){this.parser.inModule&&t.flags&1&&this.undefinedExports.delete(e)}checkRedeclarationInScope(t,e,s,i){this.isRedeclaredInScope(t,e,s)&&this.parser.raise(m.VarRedeclaration,i,{identifierName:e})}isRedeclaredInScope(t,e,s){if(!(s&1))return!1;if(s&8)return t.names.has(e);let i=t.names.get(e)||0;return s&16?(i&2)>0||!this.treatFunctionsAsVarInScope(t)&&(i&1)>0:(i&2)>0&&!(t.flags&8&&t.firstLexicalName===e)||!this.treatFunctionsAsVarInScope(t)&&(i&4)>0}checkLocalExport(t){let{name:e}=t;this.scopeStack[0].names.has(e)||this.undefinedExports.set(e,t.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&1667)return e}}currentThisScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&1731&&!(e&4))return e}}},no=class extends li{constructor(...t){super(...t),this.declareFunctions=new Set}},ao=class extends ui{createScope(t){return new no(t)}declareName(t,e,s){let i=this.currentScope();if(e&2048){this.checkRedeclarationInScope(i,t,e,s),this.maybeExportDefined(i,t),i.declareFunctions.add(t);return}super.declareName(t,e,s)}isRedeclaredInScope(t,e,s){if(super.isRedeclaredInScope(t,e,s))return!0;if(s&2048&&!t.declareFunctions.has(e)){let i=t.names.get(e);return(i&4)>0||(i&2)>0}return!1}checkLocalExport(t){this.scopeStack[0].declareFunctions.has(t.name)||super.checkLocalExport(t)}},Xb=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),O=$e`flow`({AmbiguousConditionalArrow:"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:r})=>`Cannot overwrite reserved type ${r}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:r,enumName:t})=>`Boolean enum members need to be initialized. Use either \`${r} = true,\` or \`${r} = false,\` in enum \`${t}\`.`,EnumDuplicateMemberName:({memberName:r,enumName:t})=>`Enum member names need to be unique, but the name \`${r}\` has already been used before in enum \`${t}\`.`,EnumInconsistentMemberValues:({enumName:r})=>`Enum \`${r}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:r,enumName:t})=>`Enum type \`${r}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:r})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${r}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:r,memberName:t,explicitType:e})=>`Enum \`${r}\` has type \`${e}\`, so the initializer of \`${t}\` needs to be a ${e} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:r,memberName:t})=>`Symbol enum members cannot be initialized. Use \`${t},\` in enum \`${r}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:r,memberName:t})=>`The enum member initializer for \`${t}\` needs to be a literal (either a boolean, number, or string) in enum \`${r}\`.`,EnumInvalidMemberName:({enumName:r,memberName:t,suggestion:e})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${t}\`, consider using \`${e}\`, in enum \`${r}\`.`,EnumNumberMemberNotInitialized:({enumName:r,memberName:t})=>`Number enum members need to be initialized, e.g. \`${t} = 1\` in enum \`${r}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:r})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${r}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` or `typeof` keyword.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:Object.assign({message:"A binding pattern parameter cannot be optional in an implementation signature."},{reasonCode:"OptionalBindingPattern"}),SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:r})=>`Unexpected reserved type ${r}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:r,suggestion:t})=>`\`declare export ${r}\` is not supported. Use \`${t}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function Qb(r){return r.type==="DeclareExportAllDeclaration"||r.type==="DeclareExportDeclaration"&&(!r.declaration||r.declaration.type!=="TypeAlias"&&r.declaration.type!=="InterfaceDeclaration")}function Uh(r){return r.importKind==="type"||r.importKind==="typeof"}var e0={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function t0(r,t){let e=[],s=[];for(let i=0;i<r.length;i++)(t(r[i],i,r)?e:s).push(r[i]);return[e,s]}var s0=/\*?\s*@((?:no)?flow)\b/,i0=r=>class extends r{constructor(...e){super(...e),this.flowPragma=void 0}getScopeHandler(){return ao}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(e,s){e!==134&&e!==13&&e!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,s)}addComment(e){if(this.flowPragma===void 0){let s=s0.exec(e.value);if(s)if(s[1]==="flow")this.flowPragma="flow";else if(s[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(e)}flowParseTypeInitialiser(e){let s=this.state.inType;this.state.inType=!0,this.expect(e||14);let i=this.flowParseType();return this.state.inType=s,i}flowParsePredicate(){let e=this.startNode(),s=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>s.index+1&&this.raise(O.UnexpectedSpaceBetweenModuloChecks,s),this.eat(10)?(e.value=super.parseExpression(),this.expect(11),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){let e=this.state.inType;this.state.inType=!0,this.expect(14);let s=null,i=null;return this.match(54)?(this.state.inType=e,i=this.flowParsePredicate()):(s=this.flowParseType(),this.state.inType=e,this.match(54)&&(i=this.flowParsePredicate())),[s,i]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")}flowParseDeclareFunction(e){this.next();let s=e.id=this.parseIdentifier(),i=this.startNode(),n=this.startNode();this.match(47)?i.typeParameters=this.flowParseTypeParameterDeclaration():i.typeParameters=null,this.expect(10);let a=this.flowParseFunctionTypeParams();return i.params=a.params,i.rest=a.rest,i.this=a._this,this.expect(11),[i.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),n.typeAnnotation=this.finishNode(i,"FunctionTypeAnnotation"),s.typeAnnotation=this.finishNode(n,"TypeAnnotation"),this.resetEndLocation(s),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.loc.start),this.finishNode(e,"DeclareFunction")}flowParseDeclare(e,s){if(this.match(80))return this.flowParseDeclareClass(e);if(this.match(68))return this.flowParseDeclareFunction(e);if(this.match(74))return this.flowParseDeclareVariable(e);if(this.eatContextual(127))return this.match(16)?this.flowParseDeclareModuleExports(e):(s&&this.raise(O.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(e));if(this.isContextual(130))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(131))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(129))return this.flowParseDeclareInterface(e);if(this.match(82))return this.flowParseDeclareExportDeclaration(e,s);throw this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(),this.scope.declareName(e.id.name,5,e.id.loc.start),this.semicolon(),this.finishNode(e,"DeclareVariable")}flowParseDeclareModule(e){this.scope.enter(0),this.match(134)?e.id=super.parseExprAtom():e.id=this.parseIdentifier();let s=e.body=this.startNode(),i=s.body=[];for(this.expect(5);!this.match(8);){let o=this.startNode();this.match(83)?(this.next(),!this.isContextual(130)&&!this.match(87)&&this.raise(O.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),i.push(super.parseImport(o))):(this.expectContextual(125,O.UnsupportedStatementInDeclareModule),i.push(this.flowParseDeclare(o,!0)))}this.scope.exit(),this.expect(8),this.finishNode(s,"BlockStatement");let n=null,a=!1;return i.forEach(o=>{Qb(o)?(n==="CommonJS"&&this.raise(O.AmbiguousDeclareModuleKind,o),n="ES"):o.type==="DeclareModuleExports"&&(a&&this.raise(O.DuplicateDeclareModuleExports,o),n==="ES"&&this.raise(O.AmbiguousDeclareModuleKind,o),n="CommonJS",a=!0)}),e.kind=n||"CommonJS",this.finishNode(e,"DeclareModule")}flowParseDeclareExportDeclaration(e,s){if(this.expect(82),this.eat(65))return this.match(68)||this.match(80)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,"DeclareExportDeclaration");if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!s){let i=this.state.value;throw this.raise(O.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:i,suggestion:e0[i]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(131))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration");if(this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131))return e=this.parseExport(e,null),e.type==="ExportNamedDeclaration"?(e.default=!1,delete e.exportKind,this.castNodeTo(e,"DeclareExportDeclaration")):this.castNodeTo(e,"DeclareExportAllDeclaration");throw this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual(111),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")}flowParseDeclareTypeAlias(e){this.next();let s=this.flowParseTypeAlias(e);return this.castNodeTo(s,"DeclareTypeAlias"),s}flowParseDeclareOpaqueType(e){this.next();let s=this.flowParseOpaqueType(e,!0);return this.castNodeTo(s,"DeclareOpaqueType"),s}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,"DeclareInterface")}flowParseInterfaceish(e,s){if(e.id=this.flowParseRestrictedIdentifier(!s,!0),this.scope.declareName(e.id.name,s?17:8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(!s&&this.eat(12));if(s){if(e.implements=[],e.mixins=[],this.eatContextual(117))do e.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(113))do e.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}e.body=this.flowParseObjectType({allowStatic:s,allowExact:!1,allowSpread:!1,allowProto:s,allowInexact:!1})}flowParseInterfaceExtends(){let e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.match(47)?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"InterfaceExtends")}flowParseInterface(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,"InterfaceDeclaration")}checkNotUnderscore(e){e==="_"&&this.raise(O.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,s,i){Xb.has(e)&&this.raise(i?O.AssignReservedType:O.UnexpectedReservedType,s,{reservedType:e})}flowParseRestrictedIdentifierName(e,s){return this.checkReservedType(this.state.value,this.state.startLoc,s),this.parseIdentifierName(e)}flowParseRestrictedIdentifier(e,s){let i=this.startNode(),n=this.flowParseRestrictedIdentifierName(e,s);return this.createIdentifier(i,n)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(e,"TypeAlias")}flowParseOpaqueType(e,s){return this.expectContextual(130),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.supertype=null,this.match(14)&&(e.supertype=this.flowParseTypeInitialiser(14)),e.impltype=null,s||(e.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(e,"OpaqueType")}flowParseTypeParameterBound(){if(this.match(14)||this.isContextual(81)){let e=this.startNode();return this.next(),e.typeAnnotation=this.flowParseType(),this.finishNode(e,"TypeAnnotation")}}flowParseTypeParameter(e=!1){let s=this.state.startLoc,i=this.startNode(),n=this.flowParseVariance();return i.name=this.flowParseRestrictedIdentifierName(),i.variance=n,i.bound=this.flowParseTypeParameterBound(),this.match(29)?(this.eat(29),i.default=this.flowParseType()):e&&this.raise(O.MissingTypeParamDefault,s),this.finishNode(i,"TypeParameter")}flowParseTypeParameterDeclaration(){let e=this.state.inType,s=this.startNode();s.params=[],this.state.inType=!0,this.match(47)||this.match(143)?this.next():this.unexpected();let i=!1;do{let n=this.flowParseTypeParameter(i);s.params.push(n),n.default&&(i=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=e,this.finishNode(s,"TypeParameterDeclaration")}flowInTopLevelContext(e){if(this.curContext()!==H.brace){let s=this.state.context;this.state.context=[s[0]];try{return e()}finally{this.state.context=s}}else return e()}flowParseTypeParameterInstantiationInExpression(){if(this.reScan_lt()===47)return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){let e=this.startNode(),s=this.state.inType;return this.state.inType=!0,e.params=[],this.flowInTopLevelContext(()=>{this.expect(47);let i=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(48);)e.params.push(this.flowParseType()),this.match(48)||this.expect(12);this.state.noAnonFunctionType=i}),this.state.inType=s,!this.state.inType&&this.curContext()===H.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){if(this.reScan_lt()!==47)return null;let e=this.startNode(),s=this.state.inType;for(e.params=[],this.state.inType=!0,this.expect(47);!this.match(48);)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(48)||this.expect(12);return this.expect(48),this.state.inType=s,this.finishNode(e,"TypeParameterInstantiation")}flowParseInterfaceType(){let e=this.startNode();if(this.expectContextual(129),e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(this.eat(12));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(135)||this.match(134)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,s,i){return e.static=s,this.lookahead().type===14?(e.id=this.flowParseObjectPropertyKey(),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(3),e.value=this.flowParseTypeInitialiser(),e.variance=i,this.finishNode(e,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(e,s){return e.static=s,e.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start))):(e.method=!1,this.eat(17)&&(e.optional=!0),e.value=this.flowParseTypeInitialiser()),this.finishNode(e,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(e){for(e.params=[],e.rest=null,e.typeParameters=null,e.this=null,this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(10),this.match(78)&&(e.this=this.flowParseFunctionTypeParam(!0),e.this.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.params.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(e.rest=this.flowParseFunctionTypeParam(!1)),this.expect(11),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(e,s){let i=this.startNode();return e.static=s,e.value=this.flowParseObjectTypeMethodish(i),this.finishNode(e,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:e,allowExact:s,allowSpread:i,allowProto:n,allowInexact:a}){let o=this.state.inType;this.state.inType=!0;let c=this.startNode();c.callProperties=[],c.properties=[],c.indexers=[],c.internalSlots=[];let l,u,h=!1;for(s&&this.match(6)?(this.expect(6),l=9,u=!0):(this.expect(5),l=8,u=!1),c.exact=u;!this.match(l);){let f=!1,y=null,d=null,g=this.startNode();if(n&&this.isContextual(118)){let b=this.lookahead();b.type!==14&&b.type!==17&&(this.next(),y=this.state.startLoc,e=!1)}if(e&&this.isContextual(106)){let b=this.lookahead();b.type!==14&&b.type!==17&&(this.next(),f=!0)}let x=this.flowParseVariance();if(this.eat(0))y!=null&&this.unexpected(y),this.eat(0)?(x&&this.unexpected(x.loc.start),c.internalSlots.push(this.flowParseObjectTypeInternalSlot(g,f))):c.indexers.push(this.flowParseObjectTypeIndexer(g,f,x));else if(this.match(10)||this.match(47))y!=null&&this.unexpected(y),x&&this.unexpected(x.loc.start),c.callProperties.push(this.flowParseObjectTypeCallProperty(g,f));else{let b="init";if(this.isContextual(99)||this.isContextual(104)){let v=this.lookahead();Xh(v.type)&&(b=this.state.value,this.next())}let P=this.flowParseObjectTypeProperty(g,f,y,x,b,i,a??!u);P===null?(h=!0,d=this.state.lastTokStartLoc):c.properties.push(P)}this.flowObjectTypeSemicolon(),d&&!this.match(8)&&!this.match(9)&&this.raise(O.UnexpectedExplicitInexactInObject,d)}this.expect(l),i&&(c.inexact=h);let p=this.finishNode(c,"ObjectTypeAnnotation");return this.state.inType=o,p}flowParseObjectTypeProperty(e,s,i,n,a,o,c){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(o?c||this.raise(O.InexactInsideExact,this.state.lastTokStartLoc):this.raise(O.InexactInsideNonObject,this.state.lastTokStartLoc),n&&this.raise(O.InexactVariance,n),null):(o||this.raise(O.UnexpectedSpreadType,this.state.lastTokStartLoc),i!=null&&this.unexpected(i),n&&this.raise(O.SpreadVariance,n),e.argument=this.flowParseType(),this.finishNode(e,"ObjectTypeSpreadProperty"));{e.key=this.flowParseObjectPropertyKey(),e.static=s,e.proto=i!=null,e.kind=a;let l=!1;return this.match(47)||this.match(10)?(e.method=!0,i!=null&&this.unexpected(i),n&&this.unexpected(n.loc.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start)),(a==="get"||a==="set")&&this.flowCheckGetterSetterParams(e),!o&&e.key.name==="constructor"&&e.value.this&&this.raise(O.ThisParamBannedInConstructor,e.value.this)):(a!=="init"&&this.unexpected(),e.method=!1,this.eat(17)&&(l=!0),e.value=this.flowParseTypeInitialiser(),e.variance=n),e.optional=l,this.finishNode(e,"ObjectTypeProperty")}}flowCheckGetterSetterParams(e){let s=e.kind==="get"?0:1,i=e.value.params.length+(e.value.rest?1:0);e.value.this&&this.raise(e.kind==="get"?O.GetterMayNotHaveThisParam:O.SetterMayNotHaveThisParam,e.value.this),i!==s&&this.raise(e.kind==="get"?m.BadGetterArity:m.BadSetterArity,e),e.kind==="set"&&e.value.rest&&this.raise(m.BadSetterRestParameter,e)}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,s){e??(e=this.state.startLoc);let i=s||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){let n=this.startNodeAt(e);n.qualification=i,n.id=this.flowParseRestrictedIdentifier(!0),i=this.finishNode(n,"QualifiedTypeIdentifier")}return i}flowParseGenericType(e,s){let i=this.startNodeAt(e);return i.typeParameters=null,i.id=this.flowParseQualifiedTypeIdentifier(e,s),this.match(47)&&(i.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(i,"GenericTypeAnnotation")}flowParseTypeofType(){let e=this.startNode();return this.expect(87),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")}flowParseTupleType(){let e=this.startNode();for(e.types=[],this.expect(0);this.state.pos<this.length&&!this.match(3)&&(e.types.push(this.flowParseType()),!this.match(3));)this.expect(12);return this.expect(3),this.finishNode(e,"TupleTypeAnnotation")}flowParseFunctionTypeParam(e){let s=null,i=!1,n=null,a=this.startNode(),o=this.lookahead(),c=this.state.type===78;return o.type===14||o.type===17?(c&&!e&&this.raise(O.ThisParamMustBeFirst,a),s=this.parseIdentifier(c),this.eat(17)&&(i=!0,c&&this.raise(O.ThisParamMayNotBeOptional,a)),n=this.flowParseTypeInitialiser()):n=this.flowParseType(),a.name=s,a.optional=i,a.typeAnnotation=n,this.finishNode(a,"FunctionTypeParam")}reinterpretTypeAsFunctionTypeParam(e){let s=this.startNodeAt(e.loc.start);return s.name=null,s.optional=!1,s.typeAnnotation=e,this.finishNode(s,"FunctionTypeParam")}flowParseFunctionTypeParams(e=[]){let s=null,i=null;for(this.match(78)&&(i=this.flowParseFunctionTypeParam(!0),i.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(s=this.flowParseFunctionTypeParam(!1)),{params:e,rest:s,_this:i}}flowIdentToTypeAnnotation(e,s,i){switch(i.name){case"any":return this.finishNode(s,"AnyTypeAnnotation");case"bool":case"boolean":return this.finishNode(s,"BooleanTypeAnnotation");case"mixed":return this.finishNode(s,"MixedTypeAnnotation");case"empty":return this.finishNode(s,"EmptyTypeAnnotation");case"number":return this.finishNode(s,"NumberTypeAnnotation");case"string":return this.finishNode(s,"StringTypeAnnotation");case"symbol":return this.finishNode(s,"SymbolTypeAnnotation");default:return this.checkNotUnderscore(i.name),this.flowParseGenericType(e,i)}}flowParsePrimaryType(){let e=this.state.startLoc,s=this.startNode(),i,n,a=!1,o=this.state.noAnonFunctionType;switch(this.state.type){case 5:return this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!0,allowProto:!1,allowInexact:!0});case 6:return this.flowParseObjectType({allowStatic:!1,allowExact:!0,allowSpread:!0,allowProto:!1,allowInexact:!1});case 0:return this.state.noAnonFunctionType=!1,n=this.flowParseTupleType(),this.state.noAnonFunctionType=o,n;case 47:{let c=this.startNode();return c.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(10),i=this.flowParseFunctionTypeParams(),c.params=i.params,c.rest=i.rest,c.this=i._this,this.expect(11),this.expect(19),c.returnType=this.flowParseType(),this.finishNode(c,"FunctionTypeAnnotation")}case 10:{let c=this.startNode();if(this.next(),!this.match(11)&&!this.match(21))if(W(this.state.type)||this.match(78)){let l=this.lookahead().type;a=l!==17&&l!==14}else a=!0;if(a){if(this.state.noAnonFunctionType=!1,n=this.flowParseType(),this.state.noAnonFunctionType=o,this.state.noAnonFunctionType||!(this.match(12)||this.match(11)&&this.lookahead().type===19))return this.expect(11),n;this.eat(12)}return n?i=this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(n)]):i=this.flowParseFunctionTypeParams(),c.params=i.params,c.rest=i.rest,c.this=i._this,this.expect(11),this.expect(19),c.returnType=this.flowParseType(),c.typeParameters=null,this.finishNode(c,"FunctionTypeAnnotation")}case 134:return this.parseLiteral(this.state.value,"StringLiteralTypeAnnotation");case 85:case 86:return s.value=this.match(85),this.next(),this.finishNode(s,"BooleanLiteralTypeAnnotation");case 53:if(this.state.value==="-"){if(this.next(),this.match(135))return this.parseLiteralAtNode(-this.state.value,"NumberLiteralTypeAnnotation",s);if(this.match(136))return this.parseLiteralAtNode(-this.state.value,"BigIntLiteralTypeAnnotation",s);throw this.raise(O.UnexpectedSubtractionOperand,this.state.startLoc)}throw this.unexpected();case 135:return this.parseLiteral(this.state.value,"NumberLiteralTypeAnnotation");case 136:return this.parseLiteral(this.state.value,"BigIntLiteralTypeAnnotation");case 88:return this.next(),this.finishNode(s,"VoidTypeAnnotation");case 84:return this.next(),this.finishNode(s,"NullLiteralTypeAnnotation");case 78:return this.next(),this.finishNode(s,"ThisTypeAnnotation");case 55:return this.next(),this.finishNode(s,"ExistsTypeAnnotation");case 87:return this.flowParseTypeofType();default:if(Oo(this.state.type)){let c=mt(this.state.type);return this.next(),super.createIdentifier(s,c)}else if(W(this.state.type))return this.isContextual(129)?this.flowParseInterfaceType():this.flowIdentToTypeAnnotation(e,s,this.parseIdentifier())}throw this.unexpected()}flowParsePostfixType(){let e=this.state.startLoc,s=this.flowParsePrimaryType(),i=!1;for(;(this.match(0)||this.match(18))&&!this.canInsertSemicolon();){let n=this.startNodeAt(e),a=this.eat(18);i=i||a,this.expect(0),!a&&this.match(3)?(n.elementType=s,this.next(),s=this.finishNode(n,"ArrayTypeAnnotation")):(n.objectType=s,n.indexType=this.flowParseType(),this.expect(3),i?(n.optional=a,s=this.finishNode(n,"OptionalIndexedAccessType")):s=this.finishNode(n,"IndexedAccessType"))}return s}flowParsePrefixType(){let e=this.startNode();return this.eat(17)?(e.typeAnnotation=this.flowParsePrefixType(),this.finishNode(e,"NullableTypeAnnotation")):this.flowParsePostfixType()}flowParseAnonFunctionWithoutParens(){let e=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(19)){let s=this.startNodeAt(e.loc.start);return s.params=[this.reinterpretTypeAsFunctionTypeParam(e)],s.rest=null,s.this=null,s.returnType=this.flowParseType(),s.typeParameters=null,this.finishNode(s,"FunctionTypeAnnotation")}return e}flowParseIntersectionType(){let e=this.startNode();this.eat(45);let s=this.flowParseAnonFunctionWithoutParens();for(e.types=[s];this.eat(45);)e.types.push(this.flowParseAnonFunctionWithoutParens());return e.types.length===1?s:this.finishNode(e,"IntersectionTypeAnnotation")}flowParseUnionType(){let e=this.startNode();this.eat(43);let s=this.flowParseIntersectionType();for(e.types=[s];this.eat(43);)e.types.push(this.flowParseIntersectionType());return e.types.length===1?s:this.finishNode(e,"UnionTypeAnnotation")}flowParseType(){let e=this.state.inType;this.state.inType=!0;let s=this.flowParseUnionType();return this.state.inType=e,s}flowParseTypeOrImplicitInstantiation(){if(this.state.type===132&&this.state.value==="_"){let e=this.state.startLoc,s=this.parseIdentifier();return this.flowParseGenericType(e,s)}else return this.flowParseType()}flowParseTypeAnnotation(){let e=this.startNode();return e.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(e,"TypeAnnotation")}flowParseTypeAnnotatableIdentifier(){let e=this.startNode(),s=this.parseIdentifierName();return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),this.createIdentifier(e,s)}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocation(e.expression,e.typeAnnotation.loc.end),e.expression}flowParseVariance(){let e=null;return this.match(53)?(e=this.startNode(),this.state.value==="+"?e.kind="plus":e.kind="minus",this.next(),this.finishNode(e,"Variance")):e}parseFunctionBody(e,s,i=!1){if(s){this.forwardNoArrowParamsConversionAt(e,()=>super.parseFunctionBody(e,!0,i));return}super.parseFunctionBody(e,!1,i)}parseFunctionBodyAndFinish(e,s,i=!1){if(this.match(14)){let n=this.startNode();[n.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),e.returnType=n.typeAnnotation?this.finishNode(n,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(e,s,i)}parseStatementLike(e){if(this.state.strict&&this.isContextual(129)){let i=this.lookahead();if(Ie(i.type)){let n=this.startNode();return this.next(),this.flowParseInterface(n)}}else if(this.isContextual(126)){let i=this.startNode();return this.next(),this.flowParseEnumDeclaration(i)}let s=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(s)&&(this.flowPragma=null),s}parseExpressionStatement(e,s,i){if(s.type==="Identifier"){if(s.name==="declare"){if(this.match(80)||W(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(e)}else if(W(this.state.type)){if(s.name==="interface")return this.flowParseInterface(e);if(s.name==="type")return this.flowParseTypeAlias(e);if(s.name==="opaque")return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,s,i)}shouldParseExportDeclaration(){let{type:e}=this.state;return e===126||qh(e)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return e===126||qh(e)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(126)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,s,i){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){let p=this.lookaheadCharCode();if(p===44||p===61||p===58||p===41)return this.setOptionalParametersError(i),e}this.expect(17);let n=this.state.clone(),a=this.state.noArrowAt,o=this.startNodeAt(s),{consequent:c,failed:l}=this.tryParseConditionalConsequent(),[u,h]=this.getArrowLikeExpressions(c);if(l||h.length>0){let p=[...a];if(h.length>0){this.state=n,this.state.noArrowAt=p;for(let f=0;f<h.length;f++)p.push(h[f].start);({consequent:c,failed:l}=this.tryParseConditionalConsequent()),[u,h]=this.getArrowLikeExpressions(c)}l&&u.length>1&&this.raise(O.AmbiguousConditionalArrow,n.startLoc),l&&u.length===1&&(this.state=n,p.push(u[0].start),this.state.noArrowAt=p,{consequent:c,failed:l}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(c,!0),this.state.noArrowAt=a,this.expect(14),o.test=e,o.consequent=c,o.alternate=this.forwardNoArrowParamsConversionAt(o,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(o,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let e=this.parseMaybeAssignAllowIn(),s=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:s}}getArrowLikeExpressions(e,s){let i=[e],n=[];for(;i.length!==0;){let a=i.pop();a.type==="ArrowFunctionExpression"&&a.body.type!=="BlockStatement"?(a.typeParameters||!a.returnType?this.finishArrowValidation(a):n.push(a),i.push(a.body)):a.type==="ConditionalExpression"&&(i.push(a.consequent),i.push(a.alternate))}return s?(n.forEach(a=>this.finishArrowValidation(a)),[n,[]]):t0(n,a=>a.params.every(o=>this.isAssignable(o,!0)))}finishArrowValidation(e){var s;this.toAssignableList(e.params,(s=e.extra)==null?void 0:s.trailingCommaLoc,!1),this.scope.enter(518),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,s){let i;return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?(this.state.noArrowParamsConversionAt.push(this.state.start),i=s(),this.state.noArrowParamsConversionAt.pop()):i=s(),i}parseParenItem(e,s){let i=super.parseParenItem(e,s);if(this.eat(17)&&(i.optional=!0,this.resetEndLocation(e)),this.match(14)){let n=this.startNodeAt(s);return n.expression=i,n.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(n,"TypeCastExpression")}return i}assertModuleNodeAllowed(e){e.type==="ImportDeclaration"&&(e.importKind==="type"||e.importKind==="typeof")||e.type==="ExportNamedDeclaration"&&e.exportKind==="type"||e.type==="ExportAllDeclaration"&&e.exportKind==="type"||super.assertModuleNodeAllowed(e)}parseExportDeclaration(e){if(this.isContextual(130)){e.exportKind="type";let s=this.startNode();return this.next(),this.match(5)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(s)}else if(this.isContextual(131)){e.exportKind="type";let s=this.startNode();return this.next(),this.flowParseOpaqueType(s,!1)}else if(this.isContextual(129)){e.exportKind="type";let s=this.startNode();return this.next(),this.flowParseInterface(s)}else if(this.isContextual(126)){e.exportKind="value";let s=this.startNode();return this.next(),this.flowParseEnumDeclaration(s)}else return super.parseExportDeclaration(e)}eatExportStar(e){return super.eatExportStar(e)?!0:this.isContextual(130)&&this.lookahead().type===55?(e.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(e){let{startLoc:s}=this.state,i=super.maybeParseExportNamespaceSpecifier(e);return i&&e.exportKind==="type"&&this.unexpected(s),i}parseClassId(e,s,i){super.parseClassId(e,s,i),this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,s,i){let{startLoc:n}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(e,s))return;s.declare=!0}super.parseClassMember(e,s,i),s.declare&&(s.type!=="ClassProperty"&&s.type!=="ClassPrivateProperty"&&s.type!=="PropertyDefinition"?this.raise(O.DeclareClassElement,n):s.value&&this.raise(O.DeclareClassFieldInitializer,s.value))}isIterator(e){return e==="iterator"||e==="asyncIterator"}readIterator(){let e=super.readWord1(),s="@@"+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(m.InvalidIdentifier,this.state.curPosition(),{identifierName:s}),this.finishToken(132,s)}getTokenFromCode(e){let s=this.input.charCodeAt(this.state.pos+1);e===123&&s===124?this.finishOp(6,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?48:47,1):this.state.inType&&e===63?s===46?this.finishOp(18,2):this.finishOp(17,1):Jb(e,s,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,s){return e.type==="TypeCastExpression"?this.isAssignable(e.expression,s):super.isAssignable(e,s)}toAssignable(e,s=!1){!s&&e.type==="AssignmentExpression"&&e.left.type==="TypeCastExpression"&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,s)}toAssignableList(e,s,i){for(let n=0;n<e.length;n++){let a=e[n];a?.type==="TypeCastExpression"&&(e[n]=this.typeCastToParameter(a))}super.toAssignableList(e,s,i)}toReferencedList(e,s){for(let n=0;n<e.length;n++){var i;let a=e[n];a&&a.type==="TypeCastExpression"&&!((i=a.extra)!=null&&i.parenthesized)&&(e.length>1||!s)&&this.raise(O.TypeCastInPattern,a.typeAnnotation)}return e}parseArrayLike(e,s,i){let n=super.parseArrayLike(e,s,i);return i!=null&&!this.state.maybeInArrowParameters&&this.toReferencedList(n.elements),n}isValidLVal(e,s,i,n){return e==="TypeCastExpression"||super.isValidLVal(e,s,i,n)}parseClassProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(14)&&super.isNonstaticConstructor(e)}pushClassMethod(e,s,i,n,a,o){if(s.variance&&this.unexpected(s.variance.loc.start),delete s.variance,this.match(47)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,s,i,n,a,o),s.params&&a){let c=s.params;c.length>0&&this.isThisParam(c[0])&&this.raise(O.ThisParamBannedInConstructor,s)}else if(s.type==="MethodDefinition"&&a&&s.value.params){let c=s.value.params;c.length>0&&this.isThisParam(c[0])&&this.raise(O.ThisParamBannedInConstructor,s)}}pushClassPrivateMethod(e,s,i,n){s.variance&&this.unexpected(s.variance.loc.start),delete s.variance,this.match(47)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,s,i,n)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeParameters=this.flowParseTypeParameterInstantiationInExpression()),this.isContextual(113)){this.next();let s=e.implements=[];do{let i=this.startNode();i.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?i.typeParameters=this.flowParseTypeParameterInstantiation():i.typeParameters=null,s.push(this.finishNode(i,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);let s=this.getObjectOrClassMethodParams(e);if(s.length>0){let i=s[0];this.isThisParam(i)&&e.kind==="get"?this.raise(O.GetterMayNotHaveThisParam,i):this.isThisParam(i)&&this.raise(O.SetterMayNotHaveThisParam,i)}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,s,i,n,a,o,c){e.variance&&this.unexpected(e.variance.loc.start),delete e.variance;let l;this.match(47)&&!o&&(l=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());let u=super.parseObjPropValue(e,s,i,n,a,o,c);return l&&((u.value||u).typeParameters=l),u}parseFunctionParamType(e){return this.eat(17)&&(e.type!=="Identifier"&&this.raise(O.PatternIsOptional,e),this.isThisParam(e)&&this.raise(O.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(14)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(O.ThisParamAnnotationRequired,e),this.match(29)&&this.isThisParam(e)&&this.raise(O.ThisParamNoDefault,e),this.resetEndLocation(e),e}parseMaybeDefault(e,s){let i=super.parseMaybeDefault(e,s);return i.type==="AssignmentPattern"&&i.typeAnnotation&&i.right.start<i.typeAnnotation.start&&this.raise(O.TypeBeforeInitializer,i.typeAnnotation),i}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(O.ImportReflectionHasImportType,e.specifiers[0].loc.start)}parseImportSpecifierLocal(e,s,i){s.local=Uh(e)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(s,i))}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){if(!e)return!0;let s=this.lookaheadCharCode();return s===123||s===42}return!e&&this.isContextual(87)}applyImportPhase(e,s,i,n){if(super.applyImportPhase(e,s,i,n),s){if(!i&&this.match(65))return;e.exportKind=i==="type"?i:"value"}else i==="type"&&this.match(55)&&this.unexpected(),e.importKind=i==="type"||i==="typeof"?i:"value"}parseImportSpecifier(e,s,i,n,a){let o=e.imported,c=null;o.type==="Identifier"&&(o.name==="type"?c="type":o.name==="typeof"&&(c="typeof"));let l=!1;if(this.isContextual(93)&&!this.isLookaheadContextual("as")){let h=this.parseIdentifier(!0);c!==null&&!Ie(this.state.type)?(e.imported=h,e.importKind=c,e.local=this.cloneIdentifier(h)):(e.imported=o,e.importKind=null,e.local=this.parseIdentifier())}else{if(c!==null&&Ie(this.state.type))e.imported=this.parseIdentifier(!0),e.importKind=c;else{if(s)throw this.raise(m.ImportBindingIsString,e,{importName:o.value});e.imported=o,e.importKind=null}this.eatContextual(93)?e.local=this.parseIdentifier():(l=!0,e.local=this.cloneIdentifier(e.imported))}let u=Uh(e);return i&&u&&this.raise(O.ImportTypeShorthandOnlyInPureImport,e),(i||u)&&this.checkReservedType(e.local.name,e.local.loc.start,!0),l&&!i&&!u&&this.checkReservedWord(e.local.name,e.loc.start,!0,!0),this.finishImportSpecifier(e,"ImportSpecifier")}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseFunctionParams(e,s){let i=e.kind;i!=="get"&&i!=="set"&&this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),super.parseFunctionParams(e,s)}parseVarId(e,s){super.parseVarId(e,s),this.match(14)&&(e.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,s){if(this.match(14)){let i=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,e.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=i}return super.parseAsyncArrowFromCallExpression(e,s)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}parseMaybeAssign(e,s){var i;let n=null,a;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(n=this.state.clone(),a=this.tryParse(()=>super.parseMaybeAssign(e,s),n),!a.error)return a.node;let{context:l}=this.state,u=l[l.length-1];(u===H.j_oTag||u===H.j_expr)&&l.pop()}if((i=a)!=null&&i.error||this.match(47)){var o,c;n=n||this.state.clone();let l,u=this.tryParse(p=>{var f;l=this.flowParseTypeParameterDeclaration();let y=this.forwardNoArrowParamsConversionAt(l,()=>{let g=super.parseMaybeAssign(e,s);return this.resetStartLocationFromNode(g,l),g});(f=y.extra)!=null&&f.parenthesized&&p();let d=this.maybeUnwrapTypeCastExpression(y);return d.type!=="ArrowFunctionExpression"&&p(),d.typeParameters=l,this.resetStartLocationFromNode(d,l),y},n),h=null;if(u.node&&this.maybeUnwrapTypeCastExpression(u.node).type==="ArrowFunctionExpression"){if(!u.error&&!u.aborted)return u.node.async&&this.raise(O.UnexpectedTypeParameterBeforeAsyncArrowFunction,l),u.node;h=u.node}if((o=a)!=null&&o.node)return this.state=a.failState,a.node;if(h)return this.state=u.failState,h;throw(c=a)!=null&&c.thrown?a.error:u.thrown?u.error:this.raise(O.UnexpectedTokenAfterTypeParameter,l)}return super.parseMaybeAssign(e,s)}parseArrow(e){if(this.match(14)){let s=this.tryParse(()=>{let i=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let n=this.startNode();return[n.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=i,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),n});if(s.thrown)return null;s.error&&(this.state=s.failState),e.returnType=s.node.typeAnnotation?this.finishNode(s.node,"TypeAnnotation"):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(14)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,s){this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?e.params=s:super.setArrowFunctionParameters(e,s)}checkParams(e,s,i,n=!0){if(!(i&&this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start)))){for(let a=0;a<e.params.length;a++)this.isThisParam(e.params[a])&&a>0&&this.raise(O.ThisParamMustBeFirst,e.params[a]);super.checkParams(e,s,i,n)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)))}parseSubscripts(e,s,i){if(e.type==="Identifier"&&e.name==="async"&&this.state.noArrowAt.includes(s.index)){this.next();let n=this.startNodeAt(s);n.callee=e,n.arguments=super.parseCallExpressionArguments(),e=this.finishNode(n,"CallExpression")}else if(e.type==="Identifier"&&e.name==="async"&&this.match(47)){let n=this.state.clone(),a=this.tryParse(c=>this.parseAsyncArrowWithTypeParameters(s)||c(),n);if(!a.error&&!a.aborted)return a.node;let o=this.tryParse(()=>super.parseSubscripts(e,s,i),n);if(o.node&&!o.error)return o.node;if(a.node)return this.state=a.failState,a.node;if(o.node)return this.state=o.failState,o.node;throw a.error||o.error}return super.parseSubscripts(e,s,i)}parseSubscript(e,s,i,n){if(this.match(18)&&this.isLookaheadToken_lt()){if(n.optionalChainMember=!0,i)return n.stop=!0,e;this.next();let a=this.startNodeAt(s);return a.callee=e,a.typeArguments=this.flowParseTypeParameterInstantiationInExpression(),this.expect(10),a.arguments=this.parseCallExpressionArguments(),a.optional=!0,this.finishCallExpression(a,!0)}else if(!i&&this.shouldParseTypes()&&(this.match(47)||this.match(51))){let a=this.startNodeAt(s);a.callee=e;let o=this.tryParse(()=>(a.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),a.arguments=super.parseCallExpressionArguments(),n.optionalChainMember&&(a.optional=!1),this.finishCallExpression(a,n.optionalChainMember)));if(o.node)return o.error&&(this.state=o.failState),o.node}return super.parseSubscript(e,s,i,n)}parseNewCallee(e){super.parseNewCallee(e);let s=null;this.shouldParseTypes()&&this.match(47)&&(s=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=s}parseAsyncArrowWithTypeParameters(e){let s=this.startNodeAt(e);if(this.parseFunctionParams(s,!1),!!this.parseArrow(s))return super.parseArrowExpression(s,void 0,!0)}readToken_mult_modulo(e){let s=this.input.charCodeAt(this.state.pos+1);if(e===42&&s===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(e)}readToken_pipe_amp(e){let s=this.input.charCodeAt(this.state.pos+1);if(e===124&&s===125){this.finishOp(9,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,s){let i=super.parseTopLevel(e,s);return this.state.hasFlowComment&&this.raise(O.UnterminatedFlowComment,this.state.curPosition()),i}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(O.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();let e=this.skipFlowComment();e&&(this.state.pos+=e,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:e}=this.state,s=2;for(;[32,9].includes(this.input.charCodeAt(e+s));)s++;let i=this.input.charCodeAt(s+e),n=this.input.charCodeAt(s+e+1);return i===58&&n===58?s+2:this.input.slice(s+e,s+e+12)==="flow-include"?s+12:i===58&&n!==58?s:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(m.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,{enumName:s,memberName:i}){this.raise(O.EnumBooleanMemberNotInitialized,e,{memberName:i,enumName:s})}flowEnumErrorInvalidMemberInitializer(e,s){return this.raise(s.explicitType?s.explicitType==="symbol"?O.EnumInvalidMemberInitializerSymbolType:O.EnumInvalidMemberInitializerPrimaryType:O.EnumInvalidMemberInitializerUnknownType,e,s)}flowEnumErrorNumberMemberNotInitialized(e,s){this.raise(O.EnumNumberMemberNotInitialized,e,s)}flowEnumErrorStringMemberInconsistentlyInitialized(e,s){this.raise(O.EnumStringMemberInconsistentlyInitialized,e,s)}flowEnumMemberInit(){let e=this.state.startLoc,s=()=>this.match(12)||this.match(8);switch(this.state.type){case 135:{let i=this.parseNumericLiteral(this.state.value);return s()?{type:"number",loc:i.loc.start,value:i}:{type:"invalid",loc:e}}case 134:{let i=this.parseStringLiteral(this.state.value);return s()?{type:"string",loc:i.loc.start,value:i}:{type:"invalid",loc:e}}case 85:case 86:{let i=this.parseBooleanLiteral(this.match(85));return s()?{type:"boolean",loc:i.loc.start,value:i}:{type:"invalid",loc:e}}default:return{type:"invalid",loc:e}}}flowEnumMemberRaw(){let e=this.state.startLoc,s=this.parseIdentifier(!0),i=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:e};return{id:s,init:i}}flowEnumCheckExplicitTypeMismatch(e,s,i){let{explicitType:n}=s;n!==null&&n!==i&&this.flowEnumErrorInvalidMemberInitializer(e,s)}flowEnumMembers({enumName:e,explicitType:s}){let i=new Set,n={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},a=!1;for(;!this.match(8);){if(this.eat(21)){a=!0;break}let o=this.startNode(),{id:c,init:l}=this.flowEnumMemberRaw(),u=c.name;if(u==="")continue;/^[a-z]/.test(u)&&this.raise(O.EnumInvalidMemberName,c,{memberName:u,suggestion:u[0].toUpperCase()+u.slice(1),enumName:e}),i.has(u)&&this.raise(O.EnumDuplicateMemberName,c,{memberName:u,enumName:e}),i.add(u);let h={enumName:e,explicitType:s,memberName:u};switch(o.id=c,l.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(l.loc,h,"boolean"),o.init=l.value,n.booleanMembers.push(this.finishNode(o,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(l.loc,h,"number"),o.init=l.value,n.numberMembers.push(this.finishNode(o,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(l.loc,h,"string"),o.init=l.value,n.stringMembers.push(this.finishNode(o,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(l.loc,h);case"none":switch(s){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(l.loc,h);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(l.loc,h);break;default:n.defaultedMembers.push(this.finishNode(o,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:n,hasUnknownMembers:a}}flowEnumStringMembers(e,s,{enumName:i}){if(e.length===0)return s;if(s.length===0)return e;if(s.length>e.length){for(let n of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(n,{enumName:i});return s}else{for(let n of s)this.flowEnumErrorStringMemberInconsistentlyInitialized(n,{enumName:i});return e}}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(102))return null;if(!W(this.state.type))throw this.raise(O.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});let{value:s}=this.state;return this.next(),s!=="boolean"&&s!=="number"&&s!=="string"&&s!=="symbol"&&this.raise(O.EnumInvalidExplicitType,this.state.startLoc,{enumName:e,invalidEnumType:s}),s}flowEnumBody(e,s){let i=s.name,n=s.loc.start,a=this.flowEnumParseExplicitType({enumName:i});this.expect(5);let{members:o,hasUnknownMembers:c}=this.flowEnumMembers({enumName:i,explicitType:a});switch(e.hasUnknownMembers=c,a){case"boolean":return e.explicitType=!0,e.members=o.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody");case"number":return e.explicitType=!0,e.members=o.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody");case"string":return e.explicitType=!0,e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:i}),this.expect(8),this.finishNode(e,"EnumStringBody");case"symbol":return e.members=o.defaultedMembers,this.expect(8),this.finishNode(e,"EnumSymbolBody");default:{let l=()=>(e.members=[],this.expect(8),this.finishNode(e,"EnumStringBody"));e.explicitType=!1;let u=o.booleanMembers.length,h=o.numberMembers.length,p=o.stringMembers.length,f=o.defaultedMembers.length;if(!u&&!h&&!p&&!f)return l();if(!u&&!h)return e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:i}),this.expect(8),this.finishNode(e,"EnumStringBody");if(!h&&!p&&u>=f){for(let y of o.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(y.loc.start,{enumName:i,memberName:y.id.name});return e.members=o.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody")}else if(!u&&!p&&h>=f){for(let y of o.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(y.loc.start,{enumName:i,memberName:y.id.name});return e.members=o.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody")}else return this.raise(O.EnumInconsistentMemberValues,n,{enumName:i}),l()}}}flowParseEnumDeclaration(e){let s=this.parseIdentifier();return e.id=s,e.body=this.flowEnumBody(this.startNode(),s),this.finishNode(e,"EnumDeclaration")}jsxParseOpeningElementAfterName(e){return this.shouldParseTypes()&&(this.match(47)||this.match(51))&&(e.typeArguments=this.flowParseTypeParameterInstantiationInExpression()),super.jsxParseOpeningElementAfterName(e)}isLookaheadToken_lt(){let e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){let s=this.input.charCodeAt(e+1);return s!==60&&s!==61}return!1}reScan_lt_gt(){let{type:e}=this.state;e===47?(this.state.pos-=1,this.readToken_lt()):e===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===51?(this.state.pos-=2,this.finishOp(47,1),47):e}maybeUnwrapTypeCastExpression(e){return e.type==="TypeCastExpression"?e.expression:e}},r0={__proto__:null,quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"},n0=/\r\n|[\r\n\u2028\u2029]/,Nr=new RegExp(n0.source,"g");function ps(r){switch(r){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function Vh(r,t,e){for(let s=t;s<e;s++)if(ps(r.charCodeAt(s)))return!0;return!1}var Qa=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,eo=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function a0(r){switch(r){case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}var qt=$e`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:r})=>`Expected corresponding JSX closing tag for <${r}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:r,HTMLEntity:t})=>`Unexpected token \`${r}\`. Did you mean \`${t}\` or \`{'${r}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"});function dt(r){return r?r.type==="JSXOpeningFragment"||r.type==="JSXClosingFragment":!1}function hs(r){if(r.type==="JSXIdentifier")return r.name;if(r.type==="JSXNamespacedName")return r.namespace.name+":"+r.name.name;if(r.type==="JSXMemberExpression")return hs(r.object)+"."+hs(r.property);throw new Error("Node had unexpected type: "+r.type)}var o0=r=>class extends r{jsxReadToken(){let e="",s=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(qt.UnterminatedJsxContent,this.state.startLoc);let i=this.input.charCodeAt(this.state.pos);switch(i){case 60:case 123:if(this.state.pos===this.state.start){i===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(143)):super.getTokenFromCode(i);return}e+=this.input.slice(s,this.state.pos),this.finishToken(142,e);return;case 38:e+=this.input.slice(s,this.state.pos),e+=this.jsxReadEntity(),s=this.state.pos;break;default:ps(i)?(e+=this.input.slice(s,this.state.pos),e+=this.jsxReadNewLine(!0),s=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){let s=this.input.charCodeAt(this.state.pos),i;return++this.state.pos,s===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,i=e?`
168
+ `:`\r
169
+ `):i=String.fromCharCode(s),++this.state.curLine,this.state.lineStart=this.state.pos,i}jsxReadString(e){let s="",i=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(m.UnterminatedString,this.state.startLoc);let n=this.input.charCodeAt(this.state.pos);if(n===e)break;n===38?(s+=this.input.slice(i,this.state.pos),s+=this.jsxReadEntity(),i=this.state.pos):ps(n)?(s+=this.input.slice(i,this.state.pos),s+=this.jsxReadNewLine(!1),i=this.state.pos):++this.state.pos}s+=this.input.slice(i,this.state.pos++),this.finishToken(134,s)}jsxReadEntity(){let e=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let s=10;this.codePointAtPos(this.state.pos)===120&&(s=16,++this.state.pos);let i=this.readInt(s,void 0,!1,"bail");if(i!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(i)}else{let s=0,i=!1;for(;s++<10&&this.state.pos<this.length&&!(i=this.codePointAtPos(this.state.pos)===59);)++this.state.pos;if(i){let n=this.input.slice(e,this.state.pos),a=r0[n];if(++this.state.pos,a)return a}}return this.state.pos=e,"&"}jsxReadWord(){let e,s=this.state.pos;do e=this.input.charCodeAt(++this.state.pos);while(Vt(e)||e===45);this.finishToken(141,this.input.slice(s,this.state.pos))}jsxParseIdentifier(){let e=this.startNode();return this.match(141)?e.name=this.state.value:Oo(this.state.type)?e.name=mt(this.state.type):this.unexpected(),this.next(),this.finishNode(e,"JSXIdentifier")}jsxParseNamespacedName(){let e=this.state.startLoc,s=this.jsxParseIdentifier();if(!this.eat(14))return s;let i=this.startNodeAt(e);return i.namespace=s,i.name=this.jsxParseIdentifier(),this.finishNode(i,"JSXNamespacedName")}jsxParseElementName(){let e=this.state.startLoc,s=this.jsxParseNamespacedName();if(s.type==="JSXNamespacedName")return s;for(;this.eat(16);){let i=this.startNodeAt(e);i.object=s,i.property=this.jsxParseIdentifier(),s=this.finishNode(i,"JSXMemberExpression")}return s}jsxParseAttributeValue(){let e;switch(this.state.type){case 5:return e=this.startNode(),this.setContext(H.brace),this.next(),e=this.jsxParseExpressionContainer(e,H.j_oTag),e.expression.type==="JSXEmptyExpression"&&this.raise(qt.AttributeIsEmpty,e),e;case 143:case 134:return this.parseExprAtom();default:throw this.raise(qt.UnsupportedJsxValue,this.state.startLoc)}}jsxParseEmptyExpression(){let e=this.startNodeAt(this.state.lastTokEndLoc);return this.finishNodeAt(e,"JSXEmptyExpression",this.state.startLoc)}jsxParseSpreadChild(e){return this.next(),e.expression=this.parseExpression(),this.setContext(H.j_expr),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXSpreadChild")}jsxParseExpressionContainer(e,s){if(this.match(8))e.expression=this.jsxParseEmptyExpression();else{let i=this.parseExpression();e.expression=i}return this.setContext(s),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXExpressionContainer")}jsxParseAttribute(){let e=this.startNode();return this.match(5)?(this.setContext(H.brace),this.next(),this.expect(21),e.argument=this.parseMaybeAssignAllowIn(),this.setContext(H.j_oTag),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXSpreadAttribute")):(e.name=this.jsxParseNamespacedName(),e.value=this.eat(29)?this.jsxParseAttributeValue():null,this.finishNode(e,"JSXAttribute"))}jsxParseOpeningElementAt(e){let s=this.startNodeAt(e);return this.eat(144)?this.finishNode(s,"JSXOpeningFragment"):(s.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(s))}jsxParseOpeningElementAfterName(e){let s=[];for(;!this.match(56)&&!this.match(144);)s.push(this.jsxParseAttribute());return e.attributes=s,e.selfClosing=this.eat(56),this.expect(144),this.finishNode(e,"JSXOpeningElement")}jsxParseClosingElementAt(e){let s=this.startNodeAt(e);return this.eat(144)?this.finishNode(s,"JSXClosingFragment"):(s.name=this.jsxParseElementName(),this.expect(144),this.finishNode(s,"JSXClosingElement"))}jsxParseElementAt(e){let s=this.startNodeAt(e),i=[],n=this.jsxParseOpeningElementAt(e),a=null;if(!n.selfClosing){e:for(;;)switch(this.state.type){case 143:if(e=this.state.startLoc,this.next(),this.eat(56)){a=this.jsxParseClosingElementAt(e);break e}i.push(this.jsxParseElementAt(e));break;case 142:i.push(this.parseLiteral(this.state.value,"JSXText"));break;case 5:{let o=this.startNode();this.setContext(H.brace),this.next(),this.match(21)?i.push(this.jsxParseSpreadChild(o)):i.push(this.jsxParseExpressionContainer(o,H.j_expr));break}default:this.unexpected()}dt(n)&&!dt(a)&&a!==null?this.raise(qt.MissingClosingTagFragment,a):!dt(n)&&dt(a)?this.raise(qt.MissingClosingTagElement,a,{openingTagName:hs(n.name)}):!dt(n)&&!dt(a)&&hs(a.name)!==hs(n.name)&&this.raise(qt.MissingClosingTagElement,a,{openingTagName:hs(n.name)})}if(dt(n)?(s.openingFragment=n,s.closingFragment=a):(s.openingElement=n,s.closingElement=a),s.children=i,this.match(47))throw this.raise(qt.UnwrappedAdjacentJSXElements,this.state.startLoc);return dt(n)?this.finishNode(s,"JSXFragment"):this.finishNode(s,"JSXElement")}jsxParseElement(){let e=this.state.startLoc;return this.next(),this.jsxParseElementAt(e)}setContext(e){let{context:s}=this.state;s[s.length-1]=e}parseExprAtom(e){return this.match(143)?this.jsxParseElement():this.match(47)&&this.input.charCodeAt(this.state.pos)!==33?(this.replaceToken(143),this.jsxParseElement()):super.parseExprAtom(e)}skipSpace(){this.curContext().preserveSpace||super.skipSpace()}getTokenFromCode(e){let s=this.curContext();if(s===H.j_expr){this.jsxReadToken();return}if(s===H.j_oTag||s===H.j_cTag){if(je(e)){this.jsxReadWord();return}if(e===62){++this.state.pos,this.finishToken(144);return}if((e===34||e===39)&&s===H.j_oTag){this.jsxReadString(e);return}}if(e===60&&this.state.canStartJSXElement&&this.input.charCodeAt(this.state.pos+1)!==33){++this.state.pos,this.finishToken(143);return}super.getTokenFromCode(e)}updateContext(e){let{context:s,type:i}=this.state;if(i===56&&e===143)s.splice(-2,2,H.j_cTag),this.state.canStartJSXElement=!1;else if(i===143)s.push(H.j_oTag);else if(i===144){let n=s[s.length-1];n===H.j_oTag&&e===56||n===H.j_cTag?(s.pop(),this.state.canStartJSXElement=s[s.length-1]===H.j_expr):(this.setContext(H.j_expr),this.state.canStartJSXElement=!0)}else this.state.canStartJSXElement=Lb(i)}},oo=class extends li{constructor(...t){super(...t),this.tsNames=new Map}},co=class extends ui{constructor(...t){super(...t),this.importsStack=[]}createScope(t){return this.importsStack.push(new Set),new oo(t)}enter(t){t===1024&&this.importsStack.push(new Set),super.enter(t)}exit(){let t=super.exit();return t===1024&&this.importsStack.pop(),t}hasImport(t,e){let s=this.importsStack.length;if(this.importsStack[s-1].has(t))return!0;if(!e&&s>1){for(let i=0;i<s-1;i++)if(this.importsStack[i].has(t))return!0}return!1}declareName(t,e,s){if(e&4096){this.hasImport(t,!0)&&this.parser.raise(m.VarRedeclaration,s,{identifierName:t}),this.importsStack[this.importsStack.length-1].add(t);return}let i=this.currentScope(),n=i.tsNames.get(t)||0;if(e&1024){this.maybeExportDefined(i,t),i.tsNames.set(t,n|16);return}super.declareName(t,e,s),e&2&&(e&1||(this.checkRedeclarationInScope(i,t,e,s),this.maybeExportDefined(i,t)),n=n|1),e&256&&(n=n|2),e&512&&(n=n|4),e&128&&(n=n|8),n&&i.tsNames.set(t,n)}isRedeclaredInScope(t,e,s){let i=t.tsNames.get(e);if((i&2)>0){if(s&256){let n=!!(s&512),a=(i&4)>0;return n!==a}return!0}return s&128&&(i&8)>0?t.names.get(e)&2?!!(s&1):!1:s&2&&(i&1)>0?!0:super.isRedeclaredInScope(t,e,s)}checkLocalExport(t){let{name:e}=t;if(this.hasImport(e))return;let s=this.scopeStack.length;for(let i=s-1;i>=0;i--){let a=this.scopeStack[i].tsNames.get(e);if((a&1)>0||(a&16)>0)return}super.checkLocalExport(t)}},lo=class{constructor(){this.stacks=[]}enter(t){this.stacks.push(t)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(this.currentFlags()&2)>0}get hasYield(){return(this.currentFlags()&1)>0}get hasReturn(){return(this.currentFlags()&4)>0}get hasIn(){return(this.currentFlags()&8)>0}};function Lr(r,t){return(r?2:0)|(t?1:0)}var uo=class{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}sourceToOffsetPos(t){return t+this.startIndex}offsetToSourcePos(t){return t-this.startIndex}hasPlugin(t){if(typeof t=="string")return this.plugins.has(t);{let[e,s]=t;if(!this.hasPlugin(e))return!1;let i=this.plugins.get(e);for(let n of Object.keys(s))if(i?.[n]!==s[n])return!1;return!0}}getPluginOption(t,e){var s;return(s=this.plugins.get(t))==null?void 0:s[e]}};function np(r,t){r.trailingComments===void 0?r.trailingComments=t:r.trailingComments.unshift(...t)}function c0(r,t){r.leadingComments===void 0?r.leadingComments=t:r.leadingComments.unshift(...t)}function hi(r,t){r.innerComments===void 0?r.innerComments=t:r.innerComments.unshift(...t)}function Ne(r,t,e){let s=null,i=t.length;for(;s===null&&i>0;)s=t[--i];s===null||s.start>e.start?hi(r,e.comments):np(s,e.comments)}var ho=class extends uo{addComment(t){this.filename&&(t.loc.filename=this.filename);let{commentsLen:e}=this.state;this.comments.length!==e&&(this.comments.length=e),this.comments.push(t),this.state.commentsLen++}processComment(t){let{commentStack:e}=this.state,s=e.length;if(s===0)return;let i=s-1,n=e[i];n.start===t.end&&(n.leadingNode=t,i--);let{start:a}=t;for(;i>=0;i--){let o=e[i],c=o.end;if(c>a)o.containingNode=t,this.finalizeComment(o),e.splice(i,1);else{c===a&&(o.trailingNode=t);break}}}finalizeComment(t){var e;let{comments:s}=t;if(t.leadingNode!==null||t.trailingNode!==null)t.leadingNode!==null&&np(t.leadingNode,s),t.trailingNode!==null&&c0(t.trailingNode,s);else{let i=t.containingNode,n=t.start;if(this.input.charCodeAt(this.offsetToSourcePos(n)-1)===44)switch(i.type){case"ObjectExpression":case"ObjectPattern":Ne(i,i.properties,t);break;case"CallExpression":case"NewExpression":case"OptionalCallExpression":Ne(i,i.arguments,t);break;case"ImportExpression":Ne(i,[i.source,(e=i.options)!=null?e:null],t);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":case"TSTypeParameterDeclaration":Ne(i,i.params,t);break;case"ArrayExpression":case"ArrayPattern":Ne(i,i.elements,t);break;case"ExportNamedDeclaration":case"ImportDeclaration":Ne(i,i.specifiers,t);break;case"TSEnumDeclaration":Ne(i,i.members,t);break;case"TSEnumBody":Ne(i,i.members,t);break;case"TSInterfaceBody":Ne(i,i.body,t);break;default:{if(i.type==="RecordExpression"){Ne(i,i.properties,t);break}if(i.type==="TupleExpression"){Ne(i,i.elements,t);break}hi(i,s)}}else hi(i,s)}}finalizeRemainingComments(){let{commentStack:t}=this.state;for(let e=t.length-1;e>=0;e--)this.finalizeComment(t[e]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(t){let{commentStack:e}=this.state,{length:s}=e;if(s===0)return;let i=e[s-1];i.leadingNode===t&&(i.leadingNode=null)}takeSurroundingComments(t,e,s){let{commentStack:i}=this.state,n=i.length;if(n===0)return;let a=n-1;for(;a>=0;a--){let o=i[a],c=o.end;if(o.start===s)o.leadingNode=t;else if(c===e)o.trailingNode=t;else if(c<e)break}}},po=class r{constructor(){this.flags=1024,this.startIndex=void 0,this.curLine=void 0,this.lineStart=void 0,this.startLoc=void 0,this.endLoc=void 0,this.errors=[],this.potentialArrowAt=-1,this.noArrowAt=[],this.noArrowParamsConversionAt=[],this.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null},this.labels=[],this.commentsLen=0,this.commentStack=[],this.pos=0,this.type=140,this.value=null,this.start=0,this.end=0,this.lastTokEndLoc=null,this.lastTokStartLoc=null,this.context=[H.brace],this.firstInvalidTemplateEscapePos=null,this.strictErrors=new Map,this.tokensLength=0}get strict(){return(this.flags&1)>0}set strict(t){t?this.flags|=1:this.flags&=-2}init({strictMode:t,sourceType:e,startIndex:s,startLine:i,startColumn:n}){this.strict=t===!1?!1:t===!0?!0:e==="module",this.startIndex=s,this.curLine=i,this.lineStart=-n,this.startLoc=this.endLoc=new Be(i,n,s)}get maybeInArrowParameters(){return(this.flags&2)>0}set maybeInArrowParameters(t){t?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(t){t?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(t){t?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(t){t?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(t){t?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(t){t?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(t){t?this.flags|=128:this.flags&=-129}get soloAwait(){return(this.flags&256)>0}set soloAwait(t){t?this.flags|=256:this.flags&=-257}get inFSharpPipelineDirectBody(){return(this.flags&512)>0}set inFSharpPipelineDirectBody(t){t?this.flags|=512:this.flags&=-513}get canStartJSXElement(){return(this.flags&1024)>0}set canStartJSXElement(t){t?this.flags|=1024:this.flags&=-1025}get containsEsc(){return(this.flags&2048)>0}set containsEsc(t){t?this.flags|=2048:this.flags&=-2049}get hasTopLevelAwait(){return(this.flags&4096)>0}set hasTopLevelAwait(t){t?this.flags|=4096:this.flags&=-4097}curPosition(){return new Be(this.curLine,this.pos-this.lineStart,this.pos+this.startIndex)}clone(){let t=new r;return t.flags=this.flags,t.startIndex=this.startIndex,t.curLine=this.curLine,t.lineStart=this.lineStart,t.startLoc=this.startLoc,t.endLoc=this.endLoc,t.errors=this.errors.slice(),t.potentialArrowAt=this.potentialArrowAt,t.noArrowAt=this.noArrowAt.slice(),t.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),t.topicContext=this.topicContext,t.labels=this.labels.slice(),t.commentsLen=this.commentsLen,t.commentStack=this.commentStack.slice(),t.pos=this.pos,t.type=this.type,t.value=this.value,t.start=this.start,t.end=this.end,t.lastTokEndLoc=this.lastTokEndLoc,t.lastTokStartLoc=this.lastTokStartLoc,t.context=this.context.slice(),t.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,t.strictErrors=this.strictErrors,t.tokensLength=this.tokensLength,t}},l0=function(t){return t>=48&&t<=57},Hh={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},Ir={bin:r=>r===48||r===49,oct:r=>r>=48&&r<=55,dec:r=>r>=48&&r<=57,hex:r=>r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102};function Kh(r,t,e,s,i,n){let a=e,o=s,c=i,l="",u=null,h=e,{length:p}=t;for(;;){if(e>=p){n.unterminated(a,o,c),l+=t.slice(h,e);break}let f=t.charCodeAt(e);if(u0(r,f,t,e)){l+=t.slice(h,e);break}if(f===92){l+=t.slice(h,e);let y=h0(t,e,s,i,r==="template",n);y.ch===null&&!u?u={pos:e,lineStart:s,curLine:i}:l+=y.ch,{pos:e,lineStart:s,curLine:i}=y,h=e}else f===8232||f===8233?(++e,++i,s=e):f===10||f===13?r==="template"?(l+=t.slice(h,e)+`
170
+ `,++e,f===13&&t.charCodeAt(e)===10&&++e,++i,h=s=e):n.unterminated(a,o,c):++e}return{pos:e,str:l,firstInvalidLoc:u,lineStart:s,curLine:i,containsInvalid:!!u}}function u0(r,t,e,s){return r==="template"?t===96||t===36&&e.charCodeAt(s+1)===123:t===(r==="double"?34:39)}function h0(r,t,e,s,i,n){let a=!i;t++;let o=l=>({pos:t,ch:l,lineStart:e,curLine:s}),c=r.charCodeAt(t++);switch(c){case 110:return o(`
171
+ `);case 114:return o("\r");case 120:{let l;return{code:l,pos:t}=fo(r,t,e,s,2,!1,a,n),o(l===null?null:String.fromCharCode(l))}case 117:{let l;return{code:l,pos:t}=op(r,t,e,s,a,n),o(l===null?null:String.fromCodePoint(l))}case 116:return o(" ");case 98:return o("\b");case 118:return o("\v");case 102:return o("\f");case 13:r.charCodeAt(t)===10&&++t;case 10:e=t,++s;case 8232:case 8233:return o("");case 56:case 57:if(i)return o(null);n.strictNumericEscape(t-1,e,s);default:if(c>=48&&c<=55){let l=t-1,h=/^[0-7]+/.exec(r.slice(l,t+2))[0],p=parseInt(h,8);p>255&&(h=h.slice(0,-1),p=parseInt(h,8)),t+=h.length-1;let f=r.charCodeAt(t);if(h!=="0"||f===56||f===57){if(i)return o(null);n.strictNumericEscape(l,e,s)}return o(String.fromCharCode(p))}return o(String.fromCharCode(c))}}function fo(r,t,e,s,i,n,a,o){let c=t,l;return{n:l,pos:t}=ap(r,t,e,s,16,i,n,!1,o,!a),l===null&&(a?o.invalidEscapeSequence(c,e,s):t=c-1),{code:l,pos:t}}function ap(r,t,e,s,i,n,a,o,c,l){let u=t,h=i===16?Hh.hex:Hh.decBinOct,p=i===16?Ir.hex:i===10?Ir.dec:i===8?Ir.oct:Ir.bin,f=!1,y=0;for(let d=0,g=n??1/0;d<g;++d){let x=r.charCodeAt(t),b;if(x===95&&o!=="bail"){let P=r.charCodeAt(t-1),v=r.charCodeAt(t+1);if(o){if(Number.isNaN(v)||!p(v)||h.has(P)||h.has(v)){if(l)return{n:null,pos:t};c.unexpectedNumericSeparator(t,e,s)}}else{if(l)return{n:null,pos:t};c.numericSeparatorInEscapeSequence(t,e,s)}++t;continue}if(x>=97?b=x-97+10:x>=65?b=x-65+10:l0(x)?b=x-48:b=1/0,b>=i){if(b<=9&&l)return{n:null,pos:t};if(b<=9&&c.invalidDigit(t,e,s,i))b=0;else if(a)b=0,f=!0;else break}++t,y=y*i+b}return t===u||n!=null&&t-u!==n||f?{n:null,pos:t}:{n:y,pos:t}}function op(r,t,e,s,i,n){let a=r.charCodeAt(t),o;if(a===123){if(++t,{code:o,pos:t}=fo(r,t,e,s,r.indexOf("}",t)-t,!0,i,n),++t,o!==null&&o>1114111)if(i)n.invalidCodePoint(t,e,s);else return{code:null,pos:t}}else({code:o,pos:t}=fo(r,t,e,s,4,!1,i,n));return{code:o,pos:t}}function ni(r,t,e){return new Be(e,r-t,r)}var p0=new Set([103,109,115,105,121,117,100,118]),Fe=class{constructor(t){let e=t.startIndex||0;this.type=t.type,this.value=t.value,this.start=e+t.start,this.end=e+t.end,this.loc=new ds(t.startLoc,t.endLoc)}},mo=class extends ho{constructor(t,e){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(s,i,n,a)=>this.optionFlags&2048?(this.raise(m.InvalidDigit,ni(s,i,n),{radix:a}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(m.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(m.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(m.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(m.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(s,i,n)=>{this.recordStrictModeErrors(m.StrictNumericEscape,ni(s,i,n))},unterminated:(s,i,n)=>{throw this.raise(m.UnterminatedString,ni(s-1,i,n))}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(m.StrictNumericEscape),unterminated:(s,i,n)=>{throw this.raise(m.UnterminatedTemplate,ni(s,i,n))}}),this.state=new po,this.state.init(t),this.input=e,this.length=e.length,this.comments=[],this.isLookahead=!1}pushToken(t){this.tokens.length=this.state.tokensLength,this.tokens.push(t),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.optionFlags&256&&this.pushToken(new Fe(this.state)),this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(t){return this.match(t)?(this.next(),!0):!1}match(t){return this.state.type===t}createLookaheadState(t){return{pos:t.pos,value:null,type:t.type,start:t.start,end:t.end,context:[this.curContext()],inType:t.inType,startLoc:t.startLoc,lastTokEndLoc:t.lastTokEndLoc,curLine:t.curLine,lineStart:t.lineStart,curPosition:t.curPosition}}lookahead(){let t=this.state;this.state=this.createLookaheadState(t),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let e=this.state;return this.state=t,e}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(t){return Qa.lastIndex=t,Qa.test(this.input)?Qa.lastIndex:t}lookaheadCharCode(){return this.lookaheadCharCodeSince(this.state.pos)}lookaheadCharCodeSince(t){return this.input.charCodeAt(this.nextTokenStartSince(t))}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(t){return eo.lastIndex=t,eo.test(this.input)?eo.lastIndex:t}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(t){let e=this.input.charCodeAt(t);if((e&64512)===55296&&++t<this.input.length){let s=this.input.charCodeAt(t);(s&64512)===56320&&(e=65536+((e&1023)<<10)+(s&1023))}return e}setStrict(t){this.state.strict=t,t&&(this.state.strictErrors.forEach(([e,s])=>this.raise(e,s)),this.state.strictErrors.clear())}curContext(){return this.state.context[this.state.context.length-1]}nextToken(){if(this.skipSpace(),this.state.start=this.state.pos,this.isLookahead||(this.state.startLoc=this.state.curPosition()),this.state.pos>=this.length){this.finishToken(140);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(t){let e;this.isLookahead||(e=this.state.curPosition());let s=this.state.pos,i=this.input.indexOf(t,s+2);if(i===-1)throw this.raise(m.UnterminatedComment,this.state.curPosition());for(this.state.pos=i+t.length,Nr.lastIndex=s+2;Nr.test(this.input)&&Nr.lastIndex<=i;)++this.state.curLine,this.state.lineStart=Nr.lastIndex;if(this.isLookahead)return;let n={type:"CommentBlock",value:this.input.slice(s+2,i),start:this.sourceToOffsetPos(s),end:this.sourceToOffsetPos(i+t.length),loc:new ds(e,this.state.curPosition())};return this.optionFlags&256&&this.pushToken(n),n}skipLineComment(t){let e=this.state.pos,s;this.isLookahead||(s=this.state.curPosition());let i=this.input.charCodeAt(this.state.pos+=t);if(this.state.pos<this.length)for(;!ps(i)&&++this.state.pos<this.length;)i=this.input.charCodeAt(this.state.pos);if(this.isLookahead)return;let n=this.state.pos,o={type:"CommentLine",value:this.input.slice(e+t,n),start:this.sourceToOffsetPos(e),end:this.sourceToOffsetPos(n),loc:new ds(s,this.state.curPosition())};return this.optionFlags&256&&this.pushToken(o),o}skipSpace(){let t=this.state.pos,e=this.optionFlags&4096?[]:null;e:for(;this.state.pos<this.length;){let s=this.input.charCodeAt(this.state.pos);switch(s){case 32:case 160:case 9:++this.state.pos;break;case 13:this.input.charCodeAt(this.state.pos+1)===10&&++this.state.pos;case 10:case 8232:case 8233:++this.state.pos,++this.state.curLine,this.state.lineStart=this.state.pos;break;case 47:switch(this.input.charCodeAt(this.state.pos+1)){case 42:{let i=this.skipBlockComment("*/");i!==void 0&&(this.addComment(i),e?.push(i));break}case 47:{let i=this.skipLineComment(2);i!==void 0&&(this.addComment(i),e?.push(i));break}default:break e}break;default:if(a0(s))++this.state.pos;else if(s===45&&!this.inModule&&this.optionFlags&8192){let i=this.state.pos;if(this.input.charCodeAt(i+1)===45&&this.input.charCodeAt(i+2)===62&&(t===0||this.state.lineStart>t)){let n=this.skipLineComment(3);n!==void 0&&(this.addComment(n),e?.push(n))}else break e}else if(s===60&&!this.inModule&&this.optionFlags&8192){let i=this.state.pos;if(this.input.charCodeAt(i+1)===33&&this.input.charCodeAt(i+2)===45&&this.input.charCodeAt(i+3)===45){let n=this.skipLineComment(4);n!==void 0&&(this.addComment(n),e?.push(n))}else break e}else break e}}if(e?.length>0){let s=this.state.pos,i={start:this.sourceToOffsetPos(t),end:this.sourceToOffsetPos(s),comments:e,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(i)}}finishToken(t,e){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let s=this.state.type;this.state.type=t,this.state.value=e,this.isLookahead||this.updateContext(s)}replaceToken(t){this.state.type=t,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let t=this.state.pos+1,e=this.codePointAtPos(t);if(e>=48&&e<=57)throw this.raise(m.UnexpectedDigitAfterHash,this.state.curPosition());if(e===123||e===91&&this.hasPlugin("recordAndTuple")){if(this.expectPlugin("recordAndTuple"),this.getPluginOption("recordAndTuple","syntaxType")==="bar")throw this.raise(e===123?m.RecordExpressionHashIncorrectStartSyntaxType:m.TupleExpressionHashIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,e===123?this.finishToken(7):this.finishToken(1)}else je(e)?(++this.state.pos,this.finishToken(139,this.readWord1(e))):e===92?(++this.state.pos,this.finishToken(139,this.readWord1())):this.finishOp(27,1)}readToken_dot(){let t=this.input.charCodeAt(this.state.pos+1);if(t>=48&&t<=57){this.readNumber(!0);return}t===46&&this.input.charCodeAt(this.state.pos+2)===46?(this.state.pos+=3,this.finishToken(21)):(++this.state.pos,this.finishToken(16))}readToken_slash(){this.input.charCodeAt(this.state.pos+1)===61?this.finishOp(31,2):this.finishOp(56,1)}readToken_interpreter(){if(this.state.pos!==0||this.length<2)return!1;let t=this.input.charCodeAt(this.state.pos+1);if(t!==33)return!1;let e=this.state.pos;for(this.state.pos+=1;!ps(t)&&++this.state.pos<this.length;)t=this.input.charCodeAt(this.state.pos);let s=this.input.slice(e+2,this.state.pos);return this.finishToken(28,s),!0}readToken_mult_modulo(t){let e=t===42?55:54,s=1,i=this.input.charCodeAt(this.state.pos+1);t===42&&i===42&&(s++,i=this.input.charCodeAt(this.state.pos+2),e=57),i===61&&!this.state.inType&&(s++,e=t===37?33:30),this.finishOp(e,s)}readToken_pipe_amp(t){let e=this.input.charCodeAt(this.state.pos+1);if(e===t){this.input.charCodeAt(this.state.pos+2)===61?this.finishOp(30,3):this.finishOp(t===124?41:42,2);return}if(t===124){if(e===62){this.finishOp(39,2);return}if(this.hasPlugin("recordAndTuple")&&e===125){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(m.RecordExpressionBarIncorrectEndSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(9);return}if(this.hasPlugin("recordAndTuple")&&e===93){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(m.TupleExpressionBarIncorrectEndSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(4);return}}if(e===61){this.finishOp(30,2);return}this.finishOp(t===124?43:45,1)}readToken_caret(){let t=this.input.charCodeAt(this.state.pos+1);t===61&&!this.state.inType?this.finishOp(32,2):t===94&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"^^"}])?(this.finishOp(37,2),this.input.codePointAt(this.state.pos)===94&&this.unexpected()):this.finishOp(44,1)}readToken_atSign(){this.input.charCodeAt(this.state.pos+1)===64&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"@@"}])?this.finishOp(38,2):this.finishOp(26,1)}readToken_plus_min(t){let e=this.input.charCodeAt(this.state.pos+1);if(e===t){this.finishOp(34,2);return}e===61?this.finishOp(30,2):this.finishOp(53,1)}readToken_lt(){let{pos:t}=this.state,e=this.input.charCodeAt(t+1);if(e===60){if(this.input.charCodeAt(t+2)===61){this.finishOp(30,3);return}this.finishOp(51,2);return}if(e===61){this.finishOp(49,2);return}this.finishOp(47,1)}readToken_gt(){let{pos:t}=this.state,e=this.input.charCodeAt(t+1);if(e===62){let s=this.input.charCodeAt(t+2)===62?3:2;if(this.input.charCodeAt(t+s)===61){this.finishOp(30,s+1);return}this.finishOp(52,s);return}if(e===61){this.finishOp(49,2);return}this.finishOp(48,1)}readToken_eq_excl(t){let e=this.input.charCodeAt(this.state.pos+1);if(e===61){this.finishOp(46,this.input.charCodeAt(this.state.pos+2)===61?3:2);return}if(t===61&&e===62){this.state.pos+=2,this.finishToken(19);return}this.finishOp(t===61?29:35,1)}readToken_question(){let t=this.input.charCodeAt(this.state.pos+1),e=this.input.charCodeAt(this.state.pos+2);t===63?e===61?this.finishOp(30,3):this.finishOp(40,2):t===46&&!(e>=48&&e<=57)?(this.state.pos+=2,this.finishToken(18)):(++this.state.pos,this.finishToken(17))}getTokenFromCode(t){switch(t){case 46:this.readToken_dot();return;case 40:++this.state.pos,this.finishToken(10);return;case 41:++this.state.pos,this.finishToken(11);return;case 59:++this.state.pos,this.finishToken(13);return;case 44:++this.state.pos,this.finishToken(12);return;case 91:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(m.TupleExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(2)}else++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(3);return;case 123:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(m.RecordExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(6)}else++this.state.pos,this.finishToken(5);return;case 125:++this.state.pos,this.finishToken(8);return;case 58:this.hasPlugin("functionBind")&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(15,2):(++this.state.pos,this.finishToken(14));return;case 63:this.readToken_question();return;case 96:this.readTemplateToken();return;case 48:{let e=this.input.charCodeAt(this.state.pos+1);if(e===120||e===88){this.readRadixNumber(16);return}if(e===111||e===79){this.readRadixNumber(8);return}if(e===98||e===66){this.readRadixNumber(2);return}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:this.readNumber(!1);return;case 34:case 39:this.readString(t);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(t);return;case 124:case 38:this.readToken_pipe_amp(t);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(t);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(t);return;case 126:this.finishOp(36,1);return;case 64:this.readToken_atSign();return;case 35:this.readToken_numberSign();return;case 92:this.readWord();return;default:if(je(t)){this.readWord(t);return}}throw this.raise(m.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(t)})}finishOp(t,e){let s=this.input.slice(this.state.pos,this.state.pos+e);this.state.pos+=e,this.finishToken(t,s)}readRegexp(){let t=this.state.startLoc,e=this.state.start+1,s,i,{pos:n}=this.state;for(;;++n){if(n>=this.length)throw this.raise(m.UnterminatedRegExp,ce(t,1));let l=this.input.charCodeAt(n);if(ps(l))throw this.raise(m.UnterminatedRegExp,ce(t,1));if(s)s=!1;else{if(l===91)i=!0;else if(l===93&&i)i=!1;else if(l===47&&!i)break;s=l===92}}let a=this.input.slice(e,n);++n;let o="",c=()=>ce(t,n+2-e);for(;n<this.length;){let l=this.codePointAtPos(n),u=String.fromCharCode(l);if(p0.has(l))l===118?o.includes("u")&&this.raise(m.IncompatibleRegExpUVFlags,c()):l===117&&o.includes("v")&&this.raise(m.IncompatibleRegExpUVFlags,c()),o.includes(u)&&this.raise(m.DuplicateRegExpFlags,c());else if(Vt(l)||l===92)this.raise(m.MalformedRegExpFlags,c());else break;++n,o+=u}this.state.pos=n,this.finishToken(138,{pattern:a,flags:o})}readInt(t,e,s=!1,i=!0){let{n,pos:a}=ap(this.input,this.state.pos,this.state.lineStart,this.state.curLine,t,e,s,i,this.errorHandlers_readInt,!1);return this.state.pos=a,n}readRadixNumber(t){let e=this.state.pos,s=this.state.curPosition(),i=!1;this.state.pos+=2;let n=this.readInt(t);n==null&&this.raise(m.InvalidDigit,ce(s,2),{radix:t});let a=this.input.charCodeAt(this.state.pos);if(a===110)++this.state.pos,i=!0;else if(a===109)throw this.raise(m.InvalidDecimal,s);if(je(this.codePointAtPos(this.state.pos)))throw this.raise(m.NumberIdentifier,this.state.curPosition());if(i){let o=this.input.slice(e,this.state.pos).replace(/[_n]/g,"");this.finishToken(136,o);return}this.finishToken(135,n)}readNumber(t){let e=this.state.pos,s=this.state.curPosition(),i=!1,n=!1,a=!1,o=!1;!t&&this.readInt(10)===null&&this.raise(m.InvalidNumber,this.state.curPosition());let c=this.state.pos-e>=2&&this.input.charCodeAt(e)===48;if(c){let f=this.input.slice(e,this.state.pos);if(this.recordStrictModeErrors(m.StrictOctalLiteral,s),!this.state.strict){let y=f.indexOf("_");y>0&&this.raise(m.ZeroDigitNumericSeparator,ce(s,y))}o=c&&!/[89]/.test(f)}let l=this.input.charCodeAt(this.state.pos);if(l===46&&!o&&(++this.state.pos,this.readInt(10),i=!0,l=this.input.charCodeAt(this.state.pos)),(l===69||l===101)&&!o&&(l=this.input.charCodeAt(++this.state.pos),(l===43||l===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(m.InvalidOrMissingExponent,s),i=!0,a=!0,l=this.input.charCodeAt(this.state.pos)),l===110&&((i||c)&&this.raise(m.InvalidBigIntLiteral,s),++this.state.pos,n=!0),l===109){this.expectPlugin("decimal",this.state.curPosition()),(a||c)&&this.raise(m.InvalidDecimal,s),++this.state.pos;var u=!0}if(je(this.codePointAtPos(this.state.pos)))throw this.raise(m.NumberIdentifier,this.state.curPosition());let h=this.input.slice(e,this.state.pos).replace(/[_mn]/g,"");if(n){this.finishToken(136,h);return}if(u){this.finishToken(137,h);return}let p=o?parseInt(h,8):parseFloat(h);this.finishToken(135,p)}readCodePoint(t){let{code:e,pos:s}=op(this.input,this.state.pos,this.state.lineStart,this.state.curLine,t,this.errorHandlers_readCodePoint);return this.state.pos=s,e}readString(t){let{str:e,pos:s,curLine:i,lineStart:n}=Kh(t===34?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=s+1,this.state.lineStart=n,this.state.curLine=i,this.finishToken(134,e)}readTemplateContinuation(){this.match(8)||this.unexpected(null,8),this.state.pos--,this.readTemplateToken()}readTemplateToken(){let t=this.input[this.state.pos],{str:e,firstInvalidLoc:s,pos:i,curLine:n,lineStart:a}=Kh("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=i+1,this.state.lineStart=a,this.state.curLine=n,s&&(this.state.firstInvalidTemplateEscapePos=new Be(s.curLine,s.pos-s.lineStart,this.sourceToOffsetPos(s.pos))),this.input.codePointAt(i)===96?this.finishToken(24,s?null:t+e+"`"):(this.state.pos++,this.finishToken(25,s?null:t+e+"${"))}recordStrictModeErrors(t,e){let s=e.index;this.state.strict&&!this.state.strictErrors.has(s)?this.raise(t,e):this.state.strictErrors.set(s,[t,e])}readWord1(t){this.state.containsEsc=!1;let e="",s=this.state.pos,i=this.state.pos;for(t!==void 0&&(this.state.pos+=t<=65535?1:2);this.state.pos<this.length;){let n=this.codePointAtPos(this.state.pos);if(Vt(n))this.state.pos+=n<=65535?1:2;else if(n===92){this.state.containsEsc=!0,e+=this.input.slice(i,this.state.pos);let a=this.state.curPosition(),o=this.state.pos===s?je:Vt;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(m.MissingUnicodeEscape,this.state.curPosition()),i=this.state.pos-1;continue}++this.state.pos;let c=this.readCodePoint(!0);c!==null&&(o(c)||this.raise(m.EscapedCharNotAnIdentifier,a),e+=String.fromCodePoint(c)),i=this.state.pos}else break}return e+this.input.slice(i,this.state.pos)}readWord(t){let e=this.readWord1(t),s=Co.get(e);s!==void 0?this.finishToken(s,mt(s)):this.finishToken(132,e)}checkKeywordEscapes(){let{type:t}=this.state;Oo(t)&&this.state.containsEsc&&this.raise(m.InvalidEscapedReservedWord,this.state.startLoc,{reservedWord:mt(t)})}raise(t,e,s={}){let i=e instanceof Be?e:e.loc.start,n=t(i,s);if(!(this.optionFlags&2048))throw n;return this.isLookahead||this.state.errors.push(n),n}raiseOverwrite(t,e,s={}){let i=e instanceof Be?e:e.loc.start,n=i.index,a=this.state.errors;for(let o=a.length-1;o>=0;o--){let c=a[o];if(c.loc.index===n)return a[o]=t(i,s);if(c.loc.index<n)break}return this.raise(t,e,s)}updateContext(t){}unexpected(t,e){throw this.raise(m.UnexpectedToken,t??this.state.startLoc,{expected:e?mt(e):null})}expectPlugin(t,e){if(this.hasPlugin(t))return!0;throw this.raise(m.MissingPlugin,e??this.state.startLoc,{missingPlugin:[t]})}expectOnePlugin(t){if(!t.some(e=>this.hasPlugin(e)))throw this.raise(m.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:t})}errorBuilder(t){return(e,s,i)=>{this.raise(t,ni(e,s,i))}}},yo=class{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}},go=class{constructor(t){this.parser=void 0,this.stack=[],this.undefinedPrivateNames=new Map,this.parser=t}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new yo)}exit(){let t=this.stack.pop(),e=this.current();for(let[s,i]of Array.from(t.undefinedPrivateNames))e?e.undefinedPrivateNames.has(s)||e.undefinedPrivateNames.set(s,i):this.parser.raise(m.InvalidPrivateFieldResolution,i,{identifierName:s})}declarePrivateName(t,e,s){let{privateNames:i,loneAccessors:n,undefinedPrivateNames:a}=this.current(),o=i.has(t);if(e&3){let c=o&&n.get(t);if(c){let l=c&4,u=e&4,h=c&3,p=e&3;o=h===p||l!==u,o||n.delete(t)}else o||n.set(t,e)}o&&this.parser.raise(m.PrivateNameRedeclaration,s,{identifierName:t}),i.add(t),a.delete(t)}usePrivateName(t,e){let s;for(s of this.stack)if(s.privateNames.has(t))return;s?s.undefinedPrivateNames.set(t,e):this.parser.raise(m.InvalidPrivateFieldResolution,e,{identifierName:t})}},ms=class{constructor(t=0){this.type=t}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},Rr=class extends ms{constructor(t){super(t),this.declarationErrors=new Map}recordDeclarationError(t,e){let s=e.index;this.declarationErrors.set(s,[t,e])}clearDeclarationError(t){this.declarationErrors.delete(t)}iterateErrors(t){this.declarationErrors.forEach(t)}},xo=class{constructor(t){this.parser=void 0,this.stack=[new ms],this.parser=t}enter(t){this.stack.push(t)}exit(){this.stack.pop()}recordParameterInitializerError(t,e){let s=e.loc.start,{stack:i}=this,n=i.length-1,a=i[n];for(;!a.isCertainlyParameterDeclaration();){if(a.canBeArrowParameterDeclaration())a.recordDeclarationError(t,s);else return;a=i[--n]}this.parser.raise(t,s)}recordArrowParameterBindingError(t,e){let{stack:s}=this,i=s[s.length-1],n=e.loc.start;if(i.isCertainlyParameterDeclaration())this.parser.raise(t,n);else if(i.canBeArrowParameterDeclaration())i.recordDeclarationError(t,n);else return}recordAsyncArrowParametersError(t){let{stack:e}=this,s=e.length-1,i=e[s];for(;i.canBeArrowParameterDeclaration();)i.type===2&&i.recordDeclarationError(m.AwaitBindingIdentifier,t),i=e[--s]}validateAsPattern(){let{stack:t}=this,e=t[t.length-1];e.canBeArrowParameterDeclaration()&&e.iterateErrors(([s,i])=>{this.parser.raise(s,i);let n=t.length-2,a=t[n];for(;a.canBeArrowParameterDeclaration();)a.clearDeclarationError(i.index),a=t[--n]})}};function f0(){return new ms(3)}function d0(){return new Rr(1)}function m0(){return new Rr(2)}function cp(){return new ms}var bo=class extends mo{addExtra(t,e,s,i=!0){if(!t)return;let{extra:n}=t;n==null&&(n={},t.extra=n),i?n[e]=s:Object.defineProperty(n,e,{enumerable:i,value:s})}isContextual(t){return this.state.type===t&&!this.state.containsEsc}isUnparsedContextual(t,e){if(this.input.startsWith(e,t)){let s=this.input.charCodeAt(t+e.length);return!(Vt(s)||(s&64512)===55296)}return!1}isLookaheadContextual(t){let e=this.nextTokenStart();return this.isUnparsedContextual(e,t)}eatContextual(t){return this.isContextual(t)?(this.next(),!0):!1}expectContextual(t,e){if(!this.eatContextual(t)){if(e!=null)throw this.raise(e,this.state.startLoc);this.unexpected(null,t)}}canInsertSemicolon(){return this.match(140)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return Vh(this.input,this.offsetToSourcePos(this.state.lastTokEndLoc.index),this.state.start)}hasFollowingLineBreak(){return Vh(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(t=!0){(t?this.isLineTerminator():this.eat(13))||this.raise(m.MissingSemicolon,this.state.lastTokEndLoc)}expect(t,e){this.eat(t)||this.unexpected(e,t)}tryParse(t,e=this.state.clone()){let s={node:null};try{let i=t((n=null)=>{throw s.node=n,s});if(this.state.errors.length>e.errors.length){let n=this.state;return this.state=e,this.state.tokensLength=n.tokensLength,{node:i,error:n.errors[e.errors.length],thrown:!1,aborted:!1,failState:n}}return{node:i,error:null,thrown:!1,aborted:!1,failState:null}}catch(i){let n=this.state;if(this.state=e,i instanceof SyntaxError)return{node:null,error:i,thrown:!0,aborted:!1,failState:n};if(i===s)return{node:s.node,error:null,thrown:!1,aborted:!0,failState:n};throw i}}checkExpressionErrors(t,e){if(!t)return!1;let{shorthandAssignLoc:s,doubleProtoLoc:i,privateKeyLoc:n,optionalParametersLoc:a,voidPatternLoc:o}=t,c=!!s||!!i||!!a||!!n||!!o;if(!e)return c;s!=null&&this.raise(m.InvalidCoverInitializedName,s),i!=null&&this.raise(m.DuplicateProto,i),n!=null&&this.raise(m.UnexpectedPrivateField,n),a!=null&&this.unexpected(a),o!=null&&this.raise(m.InvalidCoverDiscardElement,o)}isLiteralPropertyName(){return Xh(this.state.type)}isPrivateName(t){return t.type==="PrivateName"}getPrivateNameSV(t){return t.id.name}hasPropertyAsPrivateName(t){return(t.type==="MemberExpression"||t.type==="OptionalMemberExpression")&&this.isPrivateName(t.property)}isObjectProperty(t){return t.type==="ObjectProperty"}isObjectMethod(t){return t.type==="ObjectMethod"}initializeScopes(t=this.options.sourceType==="module"){let e=this.state.labels;this.state.labels=[];let s=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let i=this.inModule;this.inModule=t;let n=this.scope,a=this.getScopeHandler();this.scope=new a(this,t);let o=this.prodParam;this.prodParam=new lo;let c=this.classScope;this.classScope=new go(this);let l=this.expressionScope;return this.expressionScope=new xo(this),()=>{this.state.labels=e,this.exportedIdentifiers=s,this.inModule=i,this.scope=n,this.prodParam=o,this.classScope=c,this.expressionScope=l}}enterInitialScopes(){let t=0;(this.inModule||this.optionFlags&1)&&(t|=2),this.optionFlags&32&&(t|=1);let e=!this.inModule&&this.options.sourceType==="commonjs";(e||this.optionFlags&2)&&(t|=4),this.prodParam.enter(t);let s=e?514:1;this.optionFlags&4&&(s|=512),this.scope.enter(s)}checkDestructuringPrivate(t){let{privateKeyLoc:e}=t;e!==null&&this.expectPlugin("destructuringPrivate",e)}},fs=class{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null,this.voidPatternLoc=null}},ys=class{constructor(t,e,s){this.type="",this.start=e,this.end=0,this.loc=new ds(s),t?.optionFlags&128&&(this.range=[e,0]),t!=null&&t.filename&&(this.loc.filename=t.filename)}},wo=ys.prototype;wo.__clone=function(){let r=new ys(void 0,this.start,this.loc.start),t=Object.keys(this);for(let e=0,s=t.length;e<s;e++){let i=t[e];i!=="leadingComments"&&i!=="trailingComments"&&i!=="innerComments"&&(r[i]=this[i])}return r};var Po=class extends bo{startNode(){let t=this.state.startLoc;return new ys(this,t.index,t)}startNodeAt(t){return new ys(this,t.index,t)}startNodeAtNode(t){return this.startNodeAt(t.loc.start)}finishNode(t,e){return this.finishNodeAt(t,e,this.state.lastTokEndLoc)}finishNodeAt(t,e,s){return t.type=e,t.end=s.index,t.loc.end=s,this.optionFlags&128&&(t.range[1]=s.index),this.optionFlags&4096&&this.processComment(t),t}resetStartLocation(t,e){t.start=e.index,t.loc.start=e,this.optionFlags&128&&(t.range[0]=e.index)}resetEndLocation(t,e=this.state.lastTokEndLoc){t.end=e.index,t.loc.end=e,this.optionFlags&128&&(t.range[1]=e.index)}resetStartLocationFromNode(t,e){this.resetStartLocation(t,e.loc.start)}castNodeTo(t,e){return t.type=e,t}cloneIdentifier(t){let{type:e,start:s,end:i,loc:n,range:a,name:o}=t,c=Object.create(wo);return c.type=e,c.start=s,c.end=i,c.loc=n,c.range=a,c.name=o,t.extra&&(c.extra=t.extra),c}cloneStringLiteral(t){let{type:e,start:s,end:i,loc:n,range:a,extra:o}=t,c=Object.create(wo);return c.type=e,c.start=s,c.end=i,c.loc=n,c.range=a,c.extra=o,c.value=t.value,c}},To=r=>r.type==="ParenthesizedExpression"?To(r.expression):r,So=class extends Po{toAssignable(t,e=!1){var s,i;let n;switch((t.type==="ParenthesizedExpression"||(s=t.extra)!=null&&s.parenthesized)&&(n=To(t),e?n.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(m.InvalidParenthesizedAssignment,t):n.type!=="CallExpression"&&n.type!=="MemberExpression"&&!this.isOptionalMemberExpression(n)&&this.raise(m.InvalidParenthesizedAssignment,t):this.raise(m.InvalidParenthesizedAssignment,t)),t.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":case"VoidPattern":break;case"ObjectExpression":this.castNodeTo(t,"ObjectPattern");for(let o=0,c=t.properties.length,l=c-1;o<c;o++){var a;let u=t.properties[o],h=o===l;this.toAssignableObjectExpressionProp(u,h,e),h&&u.type==="RestElement"&&(a=t.extra)!=null&&a.trailingCommaLoc&&this.raise(m.RestTrailingComma,t.extra.trailingCommaLoc)}break;case"ObjectProperty":{let{key:o,value:c}=t;this.isPrivateName(o)&&this.classScope.usePrivateName(this.getPrivateNameSV(o),o.loc.start),this.toAssignable(c,e);break}case"SpreadElement":throw new Error("Internal @babel/parser error (this is a bug, please report it). SpreadElement should be converted by .toAssignable's caller.");case"ArrayExpression":this.castNodeTo(t,"ArrayPattern"),this.toAssignableList(t.elements,(i=t.extra)==null?void 0:i.trailingCommaLoc,e);break;case"AssignmentExpression":t.operator!=="="&&this.raise(m.MissingEqInAssignment,t.left.loc.end),this.castNodeTo(t,"AssignmentPattern"),delete t.operator,t.left.type==="VoidPattern"&&this.raise(m.VoidPatternInitializer,t.left),this.toAssignable(t.left,e);break;case"ParenthesizedExpression":this.toAssignable(n,e);break}}toAssignableObjectExpressionProp(t,e,s){if(t.type==="ObjectMethod")this.raise(t.kind==="get"||t.kind==="set"?m.PatternHasAccessor:m.PatternHasMethod,t.key);else if(t.type==="SpreadElement"){this.castNodeTo(t,"RestElement");let i=t.argument;this.checkToRestConversion(i,!1),this.toAssignable(i,s),e||this.raise(m.RestTrailingComma,t)}else this.toAssignable(t,s)}toAssignableList(t,e,s){let i=t.length-1;for(let n=0;n<=i;n++){let a=t[n];a&&(this.toAssignableListItem(t,n,s),a.type==="RestElement"&&(n<i?this.raise(m.RestTrailingComma,a):e&&this.raise(m.RestTrailingComma,e)))}}toAssignableListItem(t,e,s){let i=t[e];if(i.type==="SpreadElement"){this.castNodeTo(i,"RestElement");let n=i.argument;this.checkToRestConversion(n,!0),this.toAssignable(n,s)}else this.toAssignable(i,s)}isAssignable(t,e){switch(t.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":case"VoidPattern":return!0;case"ObjectExpression":{let s=t.properties.length-1;return t.properties.every((i,n)=>i.type!=="ObjectMethod"&&(n===s||i.type!=="SpreadElement")&&this.isAssignable(i))}case"ObjectProperty":return this.isAssignable(t.value);case"SpreadElement":return this.isAssignable(t.argument);case"ArrayExpression":return t.elements.every(s=>s===null||this.isAssignable(s));case"AssignmentExpression":return t.operator==="=";case"ParenthesizedExpression":return this.isAssignable(t.expression);case"MemberExpression":case"OptionalMemberExpression":return!e;default:return!1}}toReferencedList(t,e){return t}toReferencedListDeep(t,e){this.toReferencedList(t,e);for(let s of t)s?.type==="ArrayExpression"&&this.toReferencedListDeep(s.elements)}parseSpread(t){let e=this.startNode();return this.next(),e.argument=this.parseMaybeAssignAllowIn(t,void 0),this.finishNode(e,"SpreadElement")}parseRestBinding(){let t=this.startNode();this.next();let e=this.parseBindingAtom();return e.type==="VoidPattern"&&this.raise(m.UnexpectedVoidPattern,e),t.argument=e,this.finishNode(t,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{let t=this.startNode();return this.next(),t.elements=this.parseBindingList(3,93,1),this.finishNode(t,"ArrayPattern")}case 5:return this.parseObjectLike(8,!0);case 88:return this.parseVoidPattern(null)}return this.parseIdentifier()}parseBindingList(t,e,s){let i=s&1,n=[],a=!0;for(;!this.eat(t);)if(a?a=!1:this.expect(12),i&&this.match(12))n.push(null);else{if(this.eat(t))break;if(this.match(21)){let o=this.parseRestBinding();if((this.hasPlugin("flow")||s&2)&&(o=this.parseFunctionParamType(o)),n.push(o),!this.checkCommaAfterRest(e)){this.expect(t);break}}else{let o=[];if(s&2)for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(m.UnsupportedParameterDecorator,this.state.startLoc);this.match(26);)o.push(this.parseDecorator());n.push(this.parseBindingElement(s,o))}}return n}parseBindingRestProperty(t){return this.next(),this.hasPlugin("discardBinding")&&this.match(88)?(t.argument=this.parseVoidPattern(null),this.raise(m.UnexpectedVoidPattern,t.argument)):t.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(t,"RestElement")}parseBindingProperty(){let{type:t,startLoc:e}=this.state;if(t===21)return this.parseBindingRestProperty(this.startNode());let s=this.startNode();return t===139?(this.expectPlugin("destructuringPrivate",e),this.classScope.usePrivateName(this.state.value,e),s.key=this.parsePrivateName()):this.parsePropertyName(s),s.method=!1,this.parseObjPropValue(s,e,!1,!1,!0,!1)}parseBindingElement(t,e){let s=this.parseMaybeDefault();return(this.hasPlugin("flow")||t&2)&&this.parseFunctionParamType(s),e.length&&(s.decorators=e,this.resetStartLocationFromNode(s,e[0])),this.parseMaybeDefault(s.loc.start,s)}parseFunctionParamType(t){return t}parseMaybeDefault(t,e){if(t??(t=this.state.startLoc),e=e??this.parseBindingAtom(),!this.eat(29))return e;let s=this.startNodeAt(t);return e.type==="VoidPattern"&&this.raise(m.VoidPatternInitializer,e),s.left=e,s.right=this.parseMaybeAssignAllowIn(),this.finishNode(s,"AssignmentPattern")}isValidLVal(t,e,s,i){switch(t){case"AssignmentPattern":return"left";case"RestElement":return"argument";case"ObjectProperty":return"value";case"ParenthesizedExpression":return"expression";case"ArrayPattern":return"elements";case"ObjectPattern":return"properties";case"VoidPattern":return!0;case"CallExpression":if(!e&&!this.state.strict&&this.optionFlags&8192)return!0}return!1}isOptionalMemberExpression(t){return t.type==="OptionalMemberExpression"}checkLVal(t,e,s=64,i=!1,n=!1,a=!1,o=!1){var c;let l=t.type;if(this.isObjectMethod(t))return;let u=this.isOptionalMemberExpression(t);if(u||l==="MemberExpression"){u&&(this.expectPlugin("optionalChainingAssign",t.loc.start),e.type!=="AssignmentExpression"&&this.raise(m.InvalidLhsOptionalChaining,t,{ancestor:e})),s!==64&&this.raise(m.InvalidPropertyBindingPattern,t);return}if(l==="Identifier"){this.checkIdentifier(t,s,n);let{name:x}=t;i&&(i.has(x)?this.raise(m.ParamDupe,t):i.add(x));return}else l==="VoidPattern"&&e.type==="CatchClause"&&this.raise(m.VoidPatternCatchClauseParam,t);let h=To(t);o||(o=h.type==="CallExpression"&&(h.callee.type==="Import"||h.callee.type==="Super"));let p=this.isValidLVal(l,o,!(a||(c=t.extra)!=null&&c.parenthesized)&&e.type==="AssignmentExpression",s);if(p===!0)return;if(p===!1){let x=s===64?m.InvalidLhs:m.InvalidLhsBinding;this.raise(x,t,{ancestor:e});return}let f,y;typeof p=="string"?(f=p,y=l==="ParenthesizedExpression"):[f,y]=p;let d=l==="ArrayPattern"||l==="ObjectPattern"?{type:l}:e,g=t[f];if(Array.isArray(g))for(let x of g)x&&this.checkLVal(x,d,s,i,n,y,!0);else g&&this.checkLVal(g,d,s,i,n,y,o)}checkIdentifier(t,e,s=!1){this.state.strict&&(s?rp(t.name,this.inModule):ip(t.name))&&(e===64?this.raise(m.StrictEvalArguments,t,{referenceName:t.name}):this.raise(m.StrictEvalArgumentsBinding,t,{bindingName:t.name})),e&8192&&t.name==="let"&&this.raise(m.LetInLexicalBinding,t),e&64||this.declareNameFromIdentifier(t,e)}declareNameFromIdentifier(t,e){this.scope.declareName(t.name,e,t.loc.start)}checkToRestConversion(t,e){switch(t.type){case"ParenthesizedExpression":this.checkToRestConversion(t.expression,e);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(e)break;default:this.raise(m.InvalidRestAssignmentPattern,t)}}checkCommaAfterRest(t){return this.match(12)?(this.raise(this.lookaheadCharCode()===t?m.RestTrailingComma:m.ElementAfterRest,this.state.startLoc),!0):!1}},to=/in(?:stanceof)?|as|satisfies/y;function y0(r){if(r==null)throw new Error(`Unexpected ${r} value.`);return r}function Wh(r){if(!r)throw new Error("Assert fail")}var k=$e`typescript`({AbstractMethodHasImplementation:({methodName:r})=>`Method '${r}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:r})=>`Property '${r}' cannot have an initializer because it is marked abstract.`,AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",AccessorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccessorCannotHaveTypeParameters:"An accessor cannot have type parameters.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:r})=>`'declare' is not allowed in ${r}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:({modifier:r})=>`Accessibility modifier already seen: '${r}'.`,DuplicateModifier:({modifier:r})=>`Duplicate modifier: '${r}'.`,EmptyHeritageClauseType:({token:r})=>`'${r}' list cannot be empty.`,EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` modifier",IncompatibleModifiers:({modifiers:r})=>`'${r[0]}' modifier cannot be used with '${r[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:r})=>`Index signatures cannot have an accessibility modifier ('${r}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidHeritageClauseType:({token:r})=>`'${r}' list can only include identifiers or qualified-names with optional type arguments.`,InvalidModifierOnAwaitUsingDeclaration:r=>`'${r}' modifier cannot appear on an await using declaration.`,InvalidModifierOnTypeMember:({modifier:r})=>`'${r}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:r})=>`'${r}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:r})=>`'${r}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifierOnUsingDeclaration:r=>`'${r}' modifier cannot appear on a using declaration.`,InvalidModifiersOrder:({orderedModifiers:r})=>`'${r[0]}' modifier must precede '${r[1]}' modifier.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifier:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:r})=>`Private elements cannot have an accessibility modifier ('${r}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccessorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccessorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccessorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:r})=>`Single type parameter ${r} should have a trailing comma. Example usage: <${r},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:r})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${r}.`,UsingDeclarationInAmbientContext:r=>`'${r}' declarations are not allowed in ambient contexts.`});function g0(r){switch(r){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}function zh(r){return r==="private"||r==="public"||r==="protected"}function x0(r){return r==="in"||r==="out"}var b0=r=>class extends r{constructor(...e){super(...e),this.tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:k.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:k.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:k.InvalidModifierOnTypeParameter})}getScopeHandler(){return co}tsIsIdentifier(){return W(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(5)||this.match(55)||this.match(21)||this.match(139)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){return this.next(),this.hasPrecedingLineBreak()?!1:this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){return this.match(106)?(this.next(),this.tsTokenCanFollowModifier()):this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(e,s,i){if(!W(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;let n=this.state.value;if(e.includes(n)){if(i&&this.match(106)||s&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return n}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:s,stopOnStartOfClassStaticBlock:i,errorTemplate:n=k.InvalidModifierOnTypeMember},a){let o=(l,u,h,p)=>{u===h&&a[p]&&this.raise(k.InvalidModifiersOrder,l,{orderedModifiers:[h,p]})},c=(l,u,h,p)=>{(a[h]&&u===p||a[p]&&u===h)&&this.raise(k.IncompatibleModifiers,l,{modifiers:[h,p]})};for(;;){let{startLoc:l}=this.state,u=this.tsParseModifier(e.concat(s??[]),i,a.static);if(!u)break;zh(u)?a.accessibility?this.raise(k.DuplicateAccessibilityModifier,l,{modifier:u}):(o(l,u,u,"override"),o(l,u,u,"static"),o(l,u,u,"readonly"),a.accessibility=u):x0(u)?(a[u]&&this.raise(k.DuplicateModifier,l,{modifier:u}),a[u]=!0,o(l,u,"in","out")):(hasOwnProperty.call(a,u)?this.raise(k.DuplicateModifier,l,{modifier:u}):(o(l,u,"static","readonly"),o(l,u,"static","override"),o(l,u,"override","readonly"),o(l,u,"abstract","override"),c(l,u,"declare","override"),c(l,u,"static","abstract")),a[u]=!0),s!=null&&s.includes(u)&&this.raise(n,l,{modifier:u})}}tsIsListTerminator(e){switch(e){case"EnumMembers":case"TypeMembers":return this.match(8);case"HeritageClauseElement":return this.match(5);case"TupleElementTypes":return this.match(3);case"TypeParametersOrArguments":return this.match(48)}}tsParseList(e,s){let i=[];for(;!this.tsIsListTerminator(e);)i.push(s());return i}tsParseDelimitedList(e,s,i){return y0(this.tsParseDelimitedListWorker(e,s,!0,i))}tsParseDelimitedListWorker(e,s,i,n){let a=[],o=-1;for(;!this.tsIsListTerminator(e);){o=-1;let c=s();if(c==null)return;if(a.push(c),this.eat(12)){o=this.state.lastTokStartLoc.index;continue}if(this.tsIsListTerminator(e))break;i&&this.expect(12);return}return n&&(n.value=o),a}tsParseBracketedList(e,s,i,n,a){n||(i?this.expect(0):this.expect(47));let o=this.tsParseDelimitedList(e,s,a);return i?this.expect(3):this.expect(48),o}tsParseImportType(){let e=this.startNode();return this.expect(83),this.expect(10),this.match(134)?e.argument=this.parseStringLiteral(this.state.value):(this.raise(k.UnsupportedImportTypeArgument,this.state.startLoc),e.argument=super.parseExprAtom()),this.eat(12)?e.options=this.tsParseImportTypeOptions():e.options=null,this.expect(11),this.eat(16)&&(e.qualifier=this.tsParseEntityName(3)),this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSImportType")}tsParseImportTypeOptions(){let e=this.startNode();this.expect(5);let s=this.startNode();return this.isContextual(76)?(s.method=!1,s.key=this.parseIdentifier(!0),s.computed=!1,s.shorthand=!1):this.unexpected(null,76),this.expect(14),s.value=this.tsParseImportTypeWithPropertyValue(),e.properties=[this.finishObjectProperty(s)],this.eat(12),this.expect(8),this.finishNode(e,"ObjectExpression")}tsParseImportTypeWithPropertyValue(){let e=this.startNode(),s=[];for(this.expect(5);!this.match(8);){let i=this.state.type;W(i)||i===134?s.push(super.parsePropertyDefinition(null)):this.unexpected(),this.eat(12)}return e.properties=s,this.next(),this.finishNode(e,"ObjectExpression")}tsParseEntityName(e){let s;if(e&1&&this.match(78))if(e&2)s=this.parseIdentifier(!0);else{let i=this.startNode();this.next(),s=this.finishNode(i,"ThisExpression")}else s=this.parseIdentifier(!!(e&1));for(;this.eat(16);){let i=this.startNodeAtNode(s);i.left=s,i.right=this.parseIdentifier(!!(e&1)),s=this.finishNode(i,"TSQualifiedName")}return s}tsParseTypeReference(){let e=this.startNode();return e.typeName=this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeReference")}tsParseThisTypePredicate(e){this.next();let s=this.startNodeAtNode(e);return s.parameterName=e,s.typeAnnotation=this.tsParseTypeAnnotation(!1),s.asserts=!1,this.finishNode(s,"TSTypePredicate")}tsParseThisTypeNode(){let e=this.startNode();return this.next(),this.finishNode(e,"TSThisType")}tsParseTypeQuery(){let e=this.startNode();return this.expect(87),this.match(83)?e.exprName=this.tsParseImportType():e.exprName=this.tsParseEntityName(3),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeQuery")}tsParseTypeParameter(e){let s=this.startNode();return e(s),s.name=this.tsParseTypeParameterName(),s.constraint=this.tsEatThenParseType(81),s.default=this.tsEatThenParseType(29),this.finishNode(s,"TSTypeParameter")}tsTryParseTypeParameters(e){if(this.match(47))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){let s=this.startNode();this.match(47)||this.match(143)?this.next():this.unexpected();let i={value:-1};return s.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,e),!1,!0,i),s.params.length===0&&this.raise(k.EmptyTypeParameters,s),i.value!==-1&&this.addExtra(s,"trailingComma",i.value),this.finishNode(s,"TSTypeParameterDeclaration")}tsFillSignature(e,s){let i=e===19,n="parameters",a="typeAnnotation";s.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),s[n]=this.tsParseBindingListForSignature(),i?s[a]=this.tsParseTypeOrTypePredicateAnnotation(e):this.match(e)&&(s[a]=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){let e=super.parseBindingList(11,41,2);for(let s of e){let{type:i}=s;(i==="AssignmentPattern"||i==="TSParameterProperty")&&this.raise(k.UnsupportedSignatureParameterKind,s,{type:i})}return e}tsParseTypeMemberSemicolon(){!this.eat(12)&&!this.isLineTerminator()&&this.expect(13)}tsParseSignatureMember(e,s){return this.tsFillSignature(14,s),this.tsParseTypeMemberSemicolon(),this.finishNode(s,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),W(this.state.type)?(this.next(),this.match(14)):!1}tsTryParseIndexSignature(e){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);let s=this.parseIdentifier();s.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(s),this.expect(3),e.parameters=[s];let i=this.tsTryParseTypeAnnotation();return i&&(e.typeAnnotation=i),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSIndexSignature")}tsParsePropertyOrMethodSignature(e,s){if(this.eat(17)&&(e.optional=!0),this.match(10)||this.match(47)){s&&this.raise(k.ReadonlyForMethodSignature,e);let i=e;i.kind&&this.match(47)&&this.raise(k.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(14,i),this.tsParseTypeMemberSemicolon();let n="parameters",a="typeAnnotation";if(i.kind==="get")i[n].length>0&&(this.raise(m.BadGetterArity,this.state.curPosition()),this.isThisParam(i[n][0])&&this.raise(k.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(i.kind==="set"){if(i[n].length!==1)this.raise(m.BadSetterArity,this.state.curPosition());else{let o=i[n][0];this.isThisParam(o)&&this.raise(k.AccessorCannotDeclareThisParameter,this.state.curPosition()),o.type==="Identifier"&&o.optional&&this.raise(k.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),o.type==="RestElement"&&this.raise(k.SetAccessorCannotHaveRestParameter,this.state.curPosition())}i[a]&&this.raise(k.SetAccessorCannotHaveReturnType,i[a])}else i.kind="method";return this.finishNode(i,"TSMethodSignature")}else{let i=e;s&&(i.readonly=!0);let n=this.tsTryParseTypeAnnotation();return n&&(i.typeAnnotation=n),this.tsParseTypeMemberSemicolon(),this.finishNode(i,"TSPropertySignature")}}tsParseTypeMember(){let e=this.startNode();if(this.match(10)||this.match(47))return this.tsParseSignatureMember("TSCallSignatureDeclaration",e);if(this.match(77)){let i=this.startNode();return this.next(),this.match(10)||this.match(47)?this.tsParseSignatureMember("TSConstructSignatureDeclaration",e):(e.key=this.createIdentifier(i,"new"),this.tsParsePropertyOrMethodSignature(e,!1))}this.tsParseModifiers({allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]},e);let s=this.tsTryParseIndexSignature(e);return s||(super.parsePropertyName(e),!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.tsTokenCanFollowModifier()&&(e.kind=e.key.name,super.parsePropertyName(e),!this.match(10)&&!this.match(47)&&this.unexpected(null,10)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))}tsParseTypeLiteral(){let e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(5);let e=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(8),e}tsIsStartOfMappedType(){return this.next(),this.eat(53)?this.isContextual(122):(this.isContextual(122)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(58)))}tsParseMappedType(){let e=this.startNode();this.expect(5),this.match(53)?(e.readonly=this.state.value,this.next(),this.expectContextual(122)):this.eatContextual(122)&&(e.readonly=!0),this.expect(0);let s=this.startNode();return s.name=this.tsParseTypeParameterName(),s.constraint=this.tsExpectThenParseType(58),e.typeParameter=this.finishNode(s,"TSTypeParameter"),e.nameType=this.eatContextual(93)?this.tsParseType():null,this.expect(3),this.match(53)?(e.optional=this.state.value,this.next(),this.expect(17)):this.eat(17)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(8),this.finishNode(e,"TSMappedType")}tsParseTupleType(){let e=this.startNode();e.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let s=!1;return e.elementTypes.forEach(i=>{let{type:n}=i;s&&n!=="TSRestType"&&n!=="TSOptionalType"&&!(n==="TSNamedTupleMember"&&i.optional)&&this.raise(k.OptionalTypeBeforeRequired,i),s||(s=n==="TSNamedTupleMember"&&i.optional||n==="TSOptionalType")}),this.finishNode(e,"TSTupleType")}tsParseTupleElementType(){let e=this.state.startLoc,s=this.eat(21),{startLoc:i}=this.state,n,a,o,c,u=Ie(this.state.type)?this.lookaheadCharCode():null;if(u===58)n=!0,o=!1,a=this.parseIdentifier(!0),this.expect(14),c=this.tsParseType();else if(u===63){o=!0;let h=this.state.value,p=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(n=!0,a=this.createIdentifier(this.startNodeAt(i),h),this.expect(17),this.expect(14),c=this.tsParseType()):(n=!1,c=p,this.expect(17))}else c=this.tsParseType(),o=this.eat(17),n=this.eat(14);if(n){let h;a?(h=this.startNodeAt(i),h.optional=o,h.label=a,h.elementType=c,this.eat(17)&&(h.optional=!0,this.raise(k.TupleOptionalAfterType,this.state.lastTokStartLoc))):(h=this.startNodeAt(i),h.optional=o,this.raise(k.InvalidTupleMemberLabel,c),h.label=c,h.elementType=this.tsParseType()),c=this.finishNode(h,"TSNamedTupleMember")}else if(o){let h=this.startNodeAt(i);h.typeAnnotation=c,c=this.finishNode(h,"TSOptionalType")}if(s){let h=this.startNodeAt(e);h.typeAnnotation=c,c=this.finishNode(h,"TSRestType")}return c}tsParseParenthesizedType(){let e=this.startNode();return this.expect(10),e.typeAnnotation=this.tsParseType(),this.expect(11),this.finishNode(e,"TSParenthesizedType")}tsParseFunctionOrConstructorType(e,s){let i=this.startNode();return e==="TSConstructorType"&&(i.abstract=!!s,s&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,i)),this.finishNode(i,e)}tsParseLiteralTypeNode(){let e=this.startNode();switch(this.state.type){case 135:case 136:case 134:case 85:case 86:e.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(e,"TSLiteralType")}tsParseTemplateLiteralType(){let e=this.startNode();return e.literal=super.parseTemplate(!1),this.finishNode(e,"TSLiteralType")}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let e=this.tsParseThisTypeNode();return this.isContextual(116)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseNonArrayType(){switch(this.state.type){case 134:case 135:case 136:case 85:case 86:return this.tsParseLiteralTypeNode();case 53:if(this.state.value==="-"){let e=this.startNode(),s=this.lookahead();return s.type!==135&&s.type!==136&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,"TSLiteralType")}break;case 78:return this.tsParseThisTypeOrThisTypePredicate();case 87:return this.tsParseTypeQuery();case 83:return this.tsParseImportType();case 5:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 10:return this.tsParseParenthesizedType();case 25:case 24:return this.tsParseTemplateLiteralType();default:{let{type:e}=this.state;if(W(e)||e===88||e===84){let s=e===88?"TSVoidKeyword":e===84?"TSNullKeyword":g0(this.state.value);if(s!==void 0&&this.lookaheadCharCode()!==46){let i=this.startNode();return this.next(),this.finishNode(i,s)}return this.tsParseTypeReference()}}}throw this.unexpected()}tsParseArrayTypeOrHigher(){let{startLoc:e}=this.state,s=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(3)){let i=this.startNodeAt(e);i.elementType=s,this.expect(3),s=this.finishNode(i,"TSArrayType")}else{let i=this.startNodeAt(e);i.objectType=s,i.indexType=this.tsParseType(),this.expect(3),s=this.finishNode(i,"TSIndexedAccessType")}return s}tsParseTypeOperator(){let e=this.startNode(),s=this.state.value;return this.next(),e.operator=s,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),s==="readonly"&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(k.UnexpectedReadonly,e)}}tsParseInferType(){let e=this.startNode();this.expectContextual(115);let s=this.startNode();return s.name=this.tsParseTypeParameterName(),s.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(s,"TSTypeParameter"),this.finishNode(e,"TSInferType")}tsParseConstraintForInferType(){if(this.eat(81)){let e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(17))return e}}tsParseTypeOperatorOrHigher(){return jb(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(115)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,s,i){let n=this.startNode(),a=this.eat(i),o=[];do o.push(s());while(this.eat(i));return o.length===1&&!a?o[0]:(n.types=o,this.finishNode(n,e))}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),45)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),43)}tsIsStartOfFunctionType(){return this.match(47)?!0:this.match(10)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(W(this.state.type)||this.match(78))return this.next(),!0;if(this.match(5)){let{errors:e}=this.state,s=e.length;try{return this.parseObjectLike(8,!0),e.length===s}catch{return!1}}if(this.match(0)){this.next();let{errors:e}=this.state,s=e.length;try{return super.parseBindingList(3,93,1),e.length===s}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(11)||this.match(21)||this.tsSkipParameterStart()&&(this.match(14)||this.match(12)||this.match(17)||this.match(29)||this.match(11)&&(this.next(),this.match(19))))}tsParseTypeOrTypePredicateAnnotation(e){return this.tsInType(()=>{let s=this.startNode();this.expect(e);let i=this.startNode(),n=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(n&&this.match(78)){let c=this.tsParseThisTypeOrThisTypePredicate();return c.type==="TSThisType"?(i.parameterName=c,i.asserts=!0,i.typeAnnotation=null,c=this.finishNode(i,"TSTypePredicate")):(this.resetStartLocationFromNode(c,i),c.asserts=!0),s.typeAnnotation=c,this.finishNode(s,"TSTypeAnnotation")}let a=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!a)return n?(i.parameterName=this.parseIdentifier(),i.asserts=n,i.typeAnnotation=null,s.typeAnnotation=this.finishNode(i,"TSTypePredicate"),this.finishNode(s,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,s);let o=this.tsParseTypeAnnotation(!1);return i.parameterName=a,i.typeAnnotation=o,i.asserts=n,s.typeAnnotation=this.finishNode(i,"TSTypePredicate"),this.finishNode(s,"TSTypeAnnotation")})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(14))return this.tsParseTypeOrTypePredicateAnnotation(14)}tsTryParseTypeAnnotation(){if(this.match(14))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(14)}tsParseTypePredicatePrefix(){let e=this.parseIdentifier();if(this.isContextual(116)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(this.state.type!==109)return!1;let e=this.state.containsEsc;return this.next(),!W(this.state.type)&&!this.match(78)?!1:(e&&this.raise(m.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:"asserts"}),!0)}tsParseTypeAnnotation(e=!0,s=this.startNode()){return this.tsInType(()=>{e&&this.expect(14),s.typeAnnotation=this.tsParseType()}),this.finishNode(s,"TSTypeAnnotation")}tsParseType(){Wh(this.state.inType);let e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(81))return e;let s=this.startNodeAtNode(e);return s.checkType=e,s.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(17),s.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(14),s.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(s,"TSConditionalType")}isAbstractConstructorSignature(){return this.isContextual(124)&&this.isLookaheadContextual("new")}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(77)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(k.ReservedTypeAssertion,this.state.startLoc);let e=this.startNode();return e.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?this.tsParseTypeReference():this.tsParseType())),this.expect(48),e.expression=this.parseMaybeUnary(),this.finishNode(e,"TSTypeAssertion")}tsParseHeritageClause(e){let s=this.state.startLoc,i=this.tsParseDelimitedList("HeritageClauseElement",()=>{let n=this.startNode();return n.expression=this.tsParseEntityName(3),this.match(47)&&(n.typeParameters=this.tsParseTypeArguments()),this.finishNode(n,"TSExpressionWithTypeArguments")});return i.length||this.raise(k.EmptyHeritageClauseType,s,{token:e}),i}tsParseInterfaceDeclaration(e,s={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(129),s.declare&&(e.declare=!0),W(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(k.MissingInterfaceName,this.state.startLoc)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81)&&(e.extends=this.tsParseHeritageClause("extends"));let i=this.startNode();return i.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(i,"TSInterfaceBody"),this.finishNode(e,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(e){return e.id=this.parseIdentifier(),this.checkIdentifier(e.id,2),e.typeAnnotation=this.tsInType(()=>{if(e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(29),this.isContextual(114)&&this.lookaheadCharCode()!==46){let s=this.startNode();return this.next(),this.finishNode(s,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(e,"TSTypeAliasDeclaration")}tsInTopLevelContext(e){if(this.curContext()!==H.brace){let s=this.state.context;this.state.context=[s[0]];try{return e()}finally{this.state.context=s}}else return e()}tsInType(e){let s=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=s}}tsInDisallowConditionalTypesContext(e){let s=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.state.inDisallowConditionalTypesContext=s}}tsInAllowConditionalTypesContext(e){let s=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.state.inDisallowConditionalTypesContext=s}}tsEatThenParseType(e){if(this.match(e))return this.tsNextThenParseType()}tsExpectThenParseType(e){return this.tsInType(()=>(this.expect(e),this.tsParseType()))}tsNextThenParseType(){return this.tsInType(()=>(this.next(),this.tsParseType()))}tsParseEnumMember(){let e=this.startNode();return e.id=this.match(134)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(29)&&(e.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(e,"TSEnumMember")}tsParseEnumDeclaration(e,s={}){return s.const&&(e.const=!0),s.declare&&(e.declare=!0),this.expectContextual(126),e.id=this.parseIdentifier(),this.checkIdentifier(e.id,e.const?8971:8459),this.expect(5),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(e,"TSEnumDeclaration")}tsParseEnumBody(){let e=this.startNode();return this.expect(5),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(e,"TSEnumBody")}tsParseModuleBlock(){let e=this.startNode();return this.scope.enter(0),this.expect(5),super.parseBlockOrModuleBlockBody(e.body=[],void 0,!0,8),this.scope.exit(),this.finishNode(e,"TSModuleBlock")}tsParseModuleOrNamespaceDeclaration(e,s=!1){if(e.id=this.parseIdentifier(),s||this.checkIdentifier(e.id,1024),this.eat(16)){let i=this.startNode();this.tsParseModuleOrNamespaceDeclaration(i,!0),e.body=i}else this.scope.enter(1024),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit();return this.finishNode(e,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(e){return this.isContextual(112)?(e.kind="global",e.global=!0,e.id=this.parseIdentifier()):this.match(134)?(e.kind="module",e.id=super.parseStringLiteral(this.state.value)):this.unexpected(),this.match(5)?(this.scope.enter(1024),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit()):this.semicolon(),this.finishNode(e,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(e,s,i){e.isExport=i||!1,e.id=s||this.parseIdentifier(),this.checkIdentifier(e.id,4096),this.expect(29);let n=this.tsParseModuleReference();return e.importKind==="type"&&n.type!=="TSExternalModuleReference"&&this.raise(k.ImportAliasHasImportType,n),e.moduleReference=n,this.semicolon(),this.finishNode(e,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(119)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(0)}tsParseExternalModuleReference(){let e=this.startNode();return this.expectContextual(119),this.expect(10),this.match(134)||this.unexpected(),e.expression=super.parseExprAtom(),this.expect(11),this.sawUnambiguousESM=!0,this.finishNode(e,"TSExternalModuleReference")}tsLookAhead(e){let s=this.state.clone(),i=e();return this.state=s,i}tsTryParseAndCatch(e){let s=this.tryParse(i=>e()||i());if(!(s.aborted||!s.node))return s.error&&(this.state=s.failState),s.node}tsTryParse(e){let s=this.state.clone(),i=e();if(i!==void 0&&i!==!1)return i;this.state=s}tsTryParseDeclare(e){if(this.isLineTerminator())return;let s=this.state.type;return this.tsInAmbientContext(()=>{switch(s){case 68:return e.declare=!0,super.parseFunctionStatement(e,!1,!1);case 80:return e.declare=!0,this.parseClass(e,!0,!1);case 126:return this.tsParseEnumDeclaration(e,{declare:!0});case 112:return this.tsParseAmbientExternalModuleDeclaration(e);case 100:if(this.state.containsEsc)return;case 75:case 74:return!this.match(75)||!this.isLookaheadContextual("enum")?(e.declare=!0,this.parseVarStatement(e,this.state.value,!0)):(this.expect(75),this.tsParseEnumDeclaration(e,{const:!0,declare:!0}));case 107:if(this.isUsing())return this.raise(k.InvalidModifierOnUsingDeclaration,this.state.startLoc,"declare"),e.declare=!0,this.parseVarStatement(e,"using",!0);break;case 96:if(this.isAwaitUsing())return this.raise(k.InvalidModifierOnAwaitUsingDeclaration,this.state.startLoc,"declare"),e.declare=!0,this.next(),this.parseVarStatement(e,"await using",!0);break;case 129:{let i=this.tsParseInterfaceDeclaration(e,{declare:!0});if(i)return i}default:if(W(s))return this.tsParseDeclaration(e,this.state.type,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.type,!0,null)}tsParseDeclaration(e,s,i,n){switch(s){case 124:if(this.tsCheckLineTerminator(i)&&(this.match(80)||W(this.state.type)))return this.tsParseAbstractDeclaration(e,n);break;case 127:if(this.tsCheckLineTerminator(i)){if(this.match(134))return this.tsParseAmbientExternalModuleDeclaration(e);if(W(this.state.type))return e.kind="module",this.tsParseModuleOrNamespaceDeclaration(e)}break;case 128:if(this.tsCheckLineTerminator(i)&&W(this.state.type))return e.kind="namespace",this.tsParseModuleOrNamespaceDeclaration(e);break;case 130:if(this.tsCheckLineTerminator(i)&&W(this.state.type))return this.tsParseTypeAliasDeclaration(e);break}}tsCheckLineTerminator(e){return e?this.hasFollowingLineBreak()?!1:(this.next(),!0):!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(e){if(!this.match(47))return;let s=this.state.maybeInArrowParameters;this.state.maybeInArrowParameters=!0;let i=this.tsTryParseAndCatch(()=>{let n=this.startNodeAt(e);return n.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(n),n.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(19),n});if(this.state.maybeInArrowParameters=s,!!i)return super.parseArrowExpression(i,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===47)return this.tsParseTypeArguments()}tsParseTypeArguments(){let e=this.startNode();return e.params=this.tsInType(()=>this.tsInTopLevelContext(()=>(this.expect(47),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),e.params.length===0?this.raise(k.EmptyTypeArguments,e):!this.state.inType&&this.curContext()===H.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return Bb(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseBindingElement(e,s){let i=s.length?s[0].loc.start:this.state.startLoc,n={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},n);let a=n.accessibility,o=n.override,c=n.readonly;!(e&4)&&(a||c||o)&&this.raise(k.UnexpectedParameterModifier,i);let l=this.parseMaybeDefault();e&2&&this.parseFunctionParamType(l);let u=this.parseMaybeDefault(l.loc.start,l);if(a||c||o){let h=this.startNodeAt(i);return s.length&&(h.decorators=s),a&&(h.accessibility=a),c&&(h.readonly=c),o&&(h.override=o),u.type!=="Identifier"&&u.type!=="AssignmentPattern"&&this.raise(k.UnsupportedParameterPropertyKind,h),h.parameter=u,this.finishNode(h,"TSParameterProperty")}return s.length&&(l.decorators=s),u}isSimpleParameter(e){return e.type==="TSParameterProperty"&&super.isSimpleParameter(e.parameter)||super.isSimpleParameter(e)}tsDisallowOptionalPattern(e){for(let s of e.params)s.type!=="Identifier"&&s.optional&&!this.state.isAmbientContext&&this.raise(k.PatternIsOptional,s)}setArrowFunctionParameters(e,s,i){super.setArrowFunctionParameters(e,s,i),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,s,i=!1){this.match(14)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(14));let n=s==="FunctionDeclaration"?"TSDeclareFunction":s==="ClassMethod"||s==="ClassPrivateMethod"?"TSDeclareMethod":void 0;return n&&!this.match(5)&&this.isLineTerminator()?this.finishNode(e,n):n==="TSDeclareFunction"&&this.state.isAmbientContext&&(this.raise(k.DeclareFunctionHasImplementation,e),e.declare)?super.parseFunctionBodyAndFinish(e,n,i):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,s,i))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,1024):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(s=>{s?.type==="TSTypeCastExpression"&&this.raise(k.UnexpectedTypeAnnotation,s.typeAnnotation)})}toReferencedList(e,s){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,s,i){let n=super.parseArrayLike(e,s,i);return n.type==="ArrayExpression"&&this.tsCheckForInvalidTypeCasts(n.elements),n}parseSubscript(e,s,i,n){if(!this.hasPrecedingLineBreak()&&this.match(35)){this.state.canStartJSXElement=!1,this.next();let o=this.startNodeAt(s);return o.expression=e,this.finishNode(o,"TSNonNullExpression")}let a=!1;if(this.match(18)&&this.lookaheadCharCode()===60){if(i)return n.stop=!0,e;n.optionalChainMember=a=!0,this.next()}if(this.match(47)||this.match(51)){let o,c=this.tsTryParseAndCatch(()=>{if(!i&&this.atPossibleAsyncArrow(e)){let p=this.tsTryParseGenericAsyncArrowFunction(s);if(p)return n.stop=!0,p}let l=this.tsParseTypeArgumentsInExpression();if(!l)return;if(a&&!this.match(10)){o=this.state.curPosition();return}if(Dr(this.state.type)){let p=super.parseTaggedTemplateExpression(e,s,n);return p.typeParameters=l,p}if(!i&&this.eat(10)){let p=this.startNodeAt(s);return p.callee=e,p.arguments=this.parseCallExpressionArguments(),this.tsCheckForInvalidTypeCasts(p.arguments),p.typeParameters=l,n.optionalChainMember&&(p.optional=a),this.finishCallExpression(p,n.optionalChainMember)}let u=this.state.type;if(u===48||u===52||u!==10&&u!==93&&u!==120&&ai(u)&&!this.hasPrecedingLineBreak())return;let h=this.startNodeAt(s);return h.expression=e,h.typeParameters=l,this.finishNode(h,"TSInstantiationExpression")});if(o&&this.unexpected(o,10),c)return c.type==="TSInstantiationExpression"&&((this.match(16)||this.match(18)&&this.lookaheadCharCode()!==40)&&this.raise(k.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),!this.match(16)&&!this.match(18)&&(c.expression=super.stopParseSubscript(e,n))),c}return super.parseSubscript(e,s,i,n)}parseNewCallee(e){var s;super.parseNewCallee(e);let{callee:i}=e;i.type==="TSInstantiationExpression"&&!((s=i.extra)!=null&&s.parenthesized)&&(e.typeParameters=i.typeParameters,e.callee=i.expression)}parseExprOp(e,s,i){let n;if(Or(58)>i&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(n=this.isContextual(120)))){let a=this.startNodeAt(s);return a.expression=e,a.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?(n&&this.raise(m.UnexpectedKeyword,this.state.startLoc,{keyword:"const"}),this.tsParseTypeReference()):this.tsParseType())),this.finishNode(a,n?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(a,s,i)}return super.parseExprOp(e,s,i)}checkReservedWord(e,s,i,n){this.state.isAmbientContext||super.checkReservedWord(e,s,i,n)}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(k.ImportReflectionHasImportType,e.specifiers[0].loc.start)}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){let s=this.lookaheadCharCode();return e?s===123||s===42:s!==61}return!e&&this.isContextual(87)}applyImportPhase(e,s,i,n){super.applyImportPhase(e,s,i,n),s?e.exportKind=i==="type"?"type":"value":e.importKind=i==="type"||i==="typeof"?i:"value"}parseImport(e){if(this.match(134))return e.importKind="value",super.parseImport(e);let s;if(W(this.state.type)&&this.lookaheadCharCode()===61)return e.importKind="value",this.tsParseImportEqualsDeclaration(e);if(this.isContextual(130)){let i=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.tsParseImportEqualsDeclaration(e,i);s=super.parseImportSpecifiersAndAfter(e,i)}else s=super.parseImport(e);return s.importKind==="type"&&s.specifiers.length>1&&s.specifiers[0].type==="ImportDefaultSpecifier"&&this.raise(k.TypeImportCannotSpecifyDefaultAndNamed,s),s}parseExport(e,s){if(this.match(83)){let i=e;this.next();let n=null;return this.isContextual(130)&&this.isPotentialImportPhase(!1)?n=this.parseMaybeImportPhase(i,!1):i.importKind="value",this.tsParseImportEqualsDeclaration(i,n,!0)}else if(this.eat(29)){let i=e;return i.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(i,"TSExportAssignment")}else if(this.eatContextual(93)){let i=e;return this.expectContextual(128),i.id=this.parseIdentifier(),this.semicolon(),this.finishNode(i,"TSNamespaceExportDeclaration")}else return super.parseExport(e,s)}isAbstractClass(){return this.isContextual(124)&&this.isLookaheadContextual("class")}parseExportDefaultExpression(){if(this.isAbstractClass()){let e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0,!0)}if(this.match(129)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultExpression()}parseVarStatement(e,s,i=!1){let{isAmbientContext:n}=this.state,a=super.parseVarStatement(e,s,i||n);if(!n)return a;if(!e.declare&&(s==="using"||s==="await using"))return this.raiseOverwrite(k.UsingDeclarationInAmbientContext,e,s),a;for(let{id:o,init:c}of a.declarations)c&&(s==="var"||s==="let"||o.typeAnnotation?this.raise(k.InitializerNotAllowedInAmbientContext,c):P0(c,this.hasPlugin("estree"))||this.raise(k.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,c));return a}parseStatementContent(e,s){if(!this.state.containsEsc)switch(this.state.type){case 75:{if(this.isLookaheadContextual("enum")){let i=this.startNode();return this.expect(75),this.tsParseEnumDeclaration(i,{const:!0})}break}case 124:case 125:{if(this.nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine()){let i=this.state.type,n=this.startNode();this.next();let a=i===125?this.tsTryParseDeclare(n):this.tsParseAbstractDeclaration(n,s);return a?(i===125&&(a.declare=!0),a):(n.expression=this.createIdentifier(this.startNodeAt(n.loc.start),i===125?"declare":"abstract"),this.semicolon(!1),this.finishNode(n,"ExpressionStatement"))}break}case 126:return this.tsParseEnumDeclaration(this.startNode());case 112:{if(this.lookaheadCharCode()===123){let n=this.startNode();return this.tsParseAmbientExternalModuleDeclaration(n)}break}case 129:{let i=this.tsParseInterfaceDeclaration(this.startNode());if(i)return i;break}case 127:{if(this.nextTokenIsIdentifierOrStringLiteralOnSameLine()){let i=this.startNode();return this.next(),this.tsParseDeclaration(i,127,!1,s)}break}case 128:{if(this.nextTokenIsIdentifierOnSameLine()){let i=this.startNode();return this.next(),this.tsParseDeclaration(i,128,!1,s)}break}case 130:{if(this.nextTokenIsIdentifierOnSameLine()){let i=this.startNode();return this.next(),this.tsParseTypeAliasDeclaration(i)}break}}return super.parseStatementContent(e,s)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(e,s){return s.some(i=>zh(i)?e.accessibility===i:!!e[i])}tsIsStartOfStaticBlocks(){return this.isContextual(106)&&this.lookaheadCharCode()===123}parseClassMember(e,s,i){let n=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:n,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:k.InvalidModifierOnTypeParameterPositions},s);let a=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(s,n)&&this.raise(k.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(e,s)):this.parseClassMemberWithIsStatic(e,s,i,!!s.static)};s.declare?this.tsInAmbientContext(a):a()}parseClassMemberWithIsStatic(e,s,i,n){let a=this.tsTryParseIndexSignature(s);if(a){e.body.push(a),s.abstract&&this.raise(k.IndexSignatureHasAbstract,s),s.accessibility&&this.raise(k.IndexSignatureHasAccessibility,s,{modifier:s.accessibility}),s.declare&&this.raise(k.IndexSignatureHasDeclare,s),s.override&&this.raise(k.IndexSignatureHasOverride,s);return}!this.state.inAbstractClass&&s.abstract&&this.raise(k.NonAbstractClassHasAbstractMethod,s),s.override&&(i.hadSuperClass||this.raise(k.OverrideNotInSubClass,s)),super.parseClassMemberWithIsStatic(e,s,i,n)}parsePostMemberNameModifiers(e){this.eat(17)&&(e.optional=!0),e.readonly&&this.match(10)&&this.raise(k.ClassMethodHasReadonly,e),e.declare&&this.match(10)&&this.raise(k.ClassMethodHasDeclare,e)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(e,s,i){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){let n=this.lookaheadCharCode();if(n===44||n===61||n===58||n===41)return this.setOptionalParametersError(i),e}return super.parseConditional(e,s,i)}parseParenItem(e,s){let i=super.parseParenItem(e,s);if(this.eat(17)&&(i.optional=!0,this.resetEndLocation(e)),this.match(14)){let n=this.startNodeAt(s);return n.expression=e,n.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(n,"TSTypeCastExpression")}return e}parseExportDeclaration(e){if(!this.state.isAmbientContext&&this.isContextual(125))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));let s=this.state.startLoc,i=this.eatContextual(125);if(i&&(this.isContextual(125)||!this.shouldParseExportDeclaration()))throw this.raise(k.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let a=W(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return a?((a.type==="TSInterfaceDeclaration"||a.type==="TSTypeAliasDeclaration"||i)&&(e.exportKind="type"),i&&a.type!=="TSImportEqualsDeclaration"&&(this.resetStartLocation(a,s),a.declare=!0),a):null}parseClassId(e,s,i,n){if((!s||i)&&this.isContextual(113))return;super.parseClassId(e,s,i,e.declare?1024:8331);let a=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);a&&(e.typeParameters=a)}parseClassPropertyAnnotation(e){e.optional||(this.eat(35)?e.definite=!0:this.eat(17)&&(e.optional=!0));let s=this.tsTryParseTypeAnnotation();s&&(e.typeAnnotation=s)}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&!(e.readonly&&!e.typeAnnotation)&&this.match(29)&&this.raise(k.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(29)){let{key:s}=e;this.raise(k.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:s.type==="Identifier"&&!e.computed?s.name:`[${this.input.slice(this.offsetToSourcePos(s.start),this.offsetToSourcePos(s.end))}]`})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(k.PrivateElementHasAbstract,e),e.accessibility&&this.raise(k.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(k.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,s,i,n,a,o){let c=this.tsTryParseTypeParameters(this.tsParseConstModifier);c&&a&&this.raise(k.ConstructorHasTypeParameters,c);let{declare:l=!1,kind:u}=s;l&&(u==="get"||u==="set")&&this.raise(k.DeclareAccessor,s,{kind:u}),c&&(s.typeParameters=c),super.pushClassMethod(e,s,i,n,a,o)}pushClassPrivateMethod(e,s,i,n){let a=this.tsTryParseTypeParameters(this.tsParseConstModifier);a&&(s.typeParameters=a),super.pushClassPrivateMethod(e,s,i,n)}declareClassPrivateMethodInScope(e,s){e.type!=="TSDeclareMethod"&&(e.type==="MethodDefinition"&&e.value.body==null||super.declareClassPrivateMethodInScope(e,s))}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass)if(e.superClass.type==="TSInstantiationExpression"){let s=e.superClass,i=s.expression;this.takeSurroundingComments(i,i.start,i.end);let n=s.typeParameters;this.takeSurroundingComments(n,n.start,n.end),e.superClass=i,e.superTypeParameters=n}else(this.match(47)||this.match(51))&&(e.superTypeParameters=this.tsParseTypeArgumentsInExpression());this.eatContextual(113)&&(e.implements=this.tsParseHeritageClause("implements"))}parseObjPropValue(e,s,i,n,a,o,c){let l=this.tsTryParseTypeParameters(this.tsParseConstModifier);return l&&(e.typeParameters=l),super.parseObjPropValue(e,s,i,n,a,o,c)}parseFunctionParams(e,s){let i=this.tsTryParseTypeParameters(this.tsParseConstModifier);i&&(e.typeParameters=i),super.parseFunctionParams(e,s)}parseVarId(e,s){super.parseVarId(e,s),e.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(35)&&(e.definite=!0);let i=this.tsTryParseTypeAnnotation();i&&(e.id.typeAnnotation=i,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,s){return this.match(14)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,s)}parseMaybeAssign(e,s){var i,n,a,o,c;let l,u,h;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(l=this.state.clone(),u=this.tryParse(()=>super.parseMaybeAssign(e,s),l),!u.error)return u.node;let{context:y}=this.state,d=y[y.length-1];(d===H.j_oTag||d===H.j_expr)&&y.pop()}if(!((i=u)!=null&&i.error)&&!this.match(47))return super.parseMaybeAssign(e,s);(!l||l===this.state)&&(l=this.state.clone());let p,f=this.tryParse(y=>{var d,g;p=this.tsParseTypeParameters(this.tsParseConstModifier);let x=super.parseMaybeAssign(e,s);return(x.type!=="ArrowFunctionExpression"||(d=x.extra)!=null&&d.parenthesized)&&y(),((g=p)==null?void 0:g.params.length)!==0&&this.resetStartLocationFromNode(x,p),x.typeParameters=p,x},l);if(!f.error&&!f.aborted)return p&&this.reportReservedArrowTypeParam(p),f.node;if(!u&&(Wh(!this.hasPlugin("jsx")),h=this.tryParse(()=>super.parseMaybeAssign(e,s),l),!h.error))return h.node;if((n=u)!=null&&n.node)return this.state=u.failState,u.node;if(f.node)return this.state=f.failState,p&&this.reportReservedArrowTypeParam(p),f.node;if((a=h)!=null&&a.node)return this.state=h.failState,h.node;throw((o=u)==null?void 0:o.error)||f.error||((c=h)==null?void 0:c.error)}reportReservedArrowTypeParam(e){var s;e.params.length===1&&!e.params[0].constraint&&!((s=e.extra)!=null&&s.trailingComma)&&this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(k.ReservedArrowTypeParam,e)}parseMaybeUnary(e,s){return!this.hasPlugin("jsx")&&this.match(47)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,s)}parseArrow(e){if(this.match(14)){let s=this.tryParse(i=>{let n=this.tsParseTypeOrTypePredicateAnnotation(14);return(this.canInsertSemicolon()||!this.match(19))&&i(),n});if(s.aborted)return;s.thrown||(s.error&&(this.state=s.failState),e.returnType=s.node)}return super.parseArrow(e)}parseFunctionParamType(e){this.eat(17)&&(e.optional=!0);let s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s),this.resetEndLocation(e),e}isAssignable(e,s){switch(e.type){case"TSTypeCastExpression":return this.isAssignable(e.expression,s);case"TSParameterProperty":return!0;default:return super.isAssignable(e,s)}}toAssignable(e,s=!1){switch(e.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(e,s);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":s?this.expressionScope.recordArrowParameterBindingError(k.UnexpectedTypeCastInParameter,e):this.raise(k.UnexpectedTypeCastInParameter,e),this.toAssignable(e.expression,s);break;case"AssignmentExpression":!s&&e.left.type==="TSTypeCastExpression"&&(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,s)}}toAssignableParenthesizedExpression(e,s){switch(e.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(e.expression,s);break;default:super.toAssignable(e,s)}}checkToRestConversion(e,s){switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(e.expression,!1);break;default:super.checkToRestConversion(e,s)}}isValidLVal(e,s,i,n){switch(e){case"TSTypeCastExpression":return!0;case"TSParameterProperty":return"parameter";case"TSNonNullExpression":return"expression";case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return(n!==64||!i)&&["expression",!0];default:return super.isValidLVal(e,s,i,n)}}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e,s){if(this.match(47)||this.match(51)){let i=this.tsParseTypeArgumentsInExpression();if(this.match(10)){let n=super.parseMaybeDecoratorArguments(e,s);return n.typeParameters=i,n}this.unexpected(null,10)}return super.parseMaybeDecoratorArguments(e,s)}checkCommaAfterRest(e){return this.state.isAmbientContext&&this.match(12)&&this.lookaheadCharCode()===e?(this.next(),!1):super.checkCommaAfterRest(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(35)||this.match(14)||super.isClassProperty()}parseMaybeDefault(e,s){let i=super.parseMaybeDefault(e,s);return i.type==="AssignmentPattern"&&i.typeAnnotation&&i.right.start<i.typeAnnotation.start&&this.raise(k.TypeAnnotationAfterAssign,i.typeAnnotation),i}getTokenFromCode(e){if(this.state.inType){if(e===62){this.finishOp(48,1);return}if(e===60){this.finishOp(47,1);return}}super.getTokenFromCode(e)}reScan_lt_gt(){let{type:e}=this.state;e===47?(this.state.pos-=1,this.readToken_lt()):e===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===51?(this.state.pos-=2,this.finishOp(47,1),47):e}toAssignableListItem(e,s,i){let n=e[s];n.type==="TSTypeCastExpression"&&(e[s]=this.typeCastToParameter(n)),super.toAssignableListItem(e,s,i)}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocation(e.expression,e.typeAnnotation.loc.end),e.expression}shouldParseArrow(e){return this.match(14)?e.every(s=>this.isAssignable(s,!0)):super.shouldParseArrow(e)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(e){if(this.match(47)||this.match(51)){let s=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());s&&(e.typeParameters=s)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){let s=super.getGetterSetterExpectedParamCount(e),n=this.getObjectOrClassMethodParams(e)[0];return n&&this.isThisParam(n)?s+1:s}parseCatchClauseParam(){let e=super.parseCatchClauseParam(),s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s,this.resetEndLocation(e)),e}tsInAmbientContext(e){let{isAmbientContext:s,strict:i}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return e()}finally{this.state.isAmbientContext=s,this.state.strict=i}}parseClass(e,s,i){let n=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,s,i)}finally{this.state.inAbstractClass=n}}tsParseAbstractDeclaration(e,s){if(this.match(80))return e.abstract=!0,this.maybeTakeDecorators(s,this.parseClass(e,!0,!1));if(this.isContextual(129))return this.hasFollowingLineBreak()?null:(e.abstract=!0,this.raise(k.NonClassMethodPropertyHasAbstractModifier,e),this.tsParseInterfaceDeclaration(e));throw this.unexpected(null,80)}parseMethod(e,s,i,n,a,o,c){let l=super.parseMethod(e,s,i,n,a,o,c);if((l.abstract||l.type==="TSAbstractMethodDefinition")&&(this.hasPlugin("estree")?l.value:l).body){let{key:p}=l;this.raise(k.AbstractMethodHasImplementation,l,{methodName:p.type==="Identifier"&&!l.computed?p.name:`[${this.input.slice(this.offsetToSourcePos(p.start),this.offsetToSourcePos(p.end))}]`})}return l}tsParseTypeParameterName(){return this.parseIdentifier().name}shouldParseAsAmbientContext(){return!!this.getPluginOption("typescript","dts")}parse(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.parse()}getExpression(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.getExpression()}parseExportSpecifier(e,s,i,n){return!s&&n?(this.parseTypeOnlyImportExportSpecifier(e,!1,i),this.finishNode(e,"ExportSpecifier")):(e.exportKind="value",super.parseExportSpecifier(e,s,i,n))}parseImportSpecifier(e,s,i,n,a){return!s&&n?(this.parseTypeOnlyImportExportSpecifier(e,!0,i),this.finishNode(e,"ImportSpecifier")):(e.importKind="value",super.parseImportSpecifier(e,s,i,n,i?4098:4096))}parseTypeOnlyImportExportSpecifier(e,s,i){let n=s?"imported":"local",a=s?"local":"exported",o=e[n],c,l=!1,u=!0,h=o.loc.start;if(this.isContextual(93)){let f=this.parseIdentifier();if(this.isContextual(93)){let y=this.parseIdentifier();Ie(this.state.type)?(l=!0,o=f,c=s?this.parseIdentifier():this.parseModuleExportName(),u=!1):(c=y,u=!1)}else Ie(this.state.type)?(u=!1,c=s?this.parseIdentifier():this.parseModuleExportName()):(l=!0,o=f)}else Ie(this.state.type)&&(l=!0,s?(o=this.parseIdentifier(!0),this.isContextual(93)||this.checkReservedWord(o.name,o.loc.start,!0,!0)):o=this.parseModuleExportName());l&&i&&this.raise(s?k.TypeModifierIsUsedInTypeImports:k.TypeModifierIsUsedInTypeExports,h),e[n]=o,e[a]=c;let p=s?"importKind":"exportKind";e[p]=l?"type":"value",u&&this.eatContextual(93)&&(e[a]=s?this.parseIdentifier():this.parseModuleExportName()),e[a]||(e[a]=this.cloneIdentifier(e[n])),s&&this.checkIdentifier(e[a],l?4098:4096)}fillOptionalPropertiesForTSESLint(e){var s,i,n,a,o,c,l,u,h,p,f,y,d,g,x,b,P,v,E,L,U,N,Y,le,ye,Z,gt,Ps,xi,Kt,bi,wi,Q,tc,sc,ic,rc,nc,ac,oc,cc,lc,uc,hc,pc,fc,dc,mc;switch(e.type){case"ExpressionStatement":(s=e.directive)!=null||(e.directive=void 0);return;case"RestElement":e.value=void 0;case"Identifier":case"ArrayPattern":case"AssignmentPattern":case"ObjectPattern":(i=e.decorators)!=null||(e.decorators=[]),(n=e.optional)!=null||(e.optional=!1),(a=e.typeAnnotation)!=null||(e.typeAnnotation=void 0);return;case"TSParameterProperty":(o=e.accessibility)!=null||(e.accessibility=void 0),(c=e.decorators)!=null||(e.decorators=[]),(l=e.override)!=null||(e.override=!1),(u=e.readonly)!=null||(e.readonly=!1),(h=e.static)!=null||(e.static=!1);return;case"TSEmptyBodyFunctionExpression":e.body=null;case"TSDeclareFunction":case"FunctionDeclaration":case"FunctionExpression":case"ClassMethod":case"ClassPrivateMethod":(p=e.declare)!=null||(e.declare=!1),(f=e.returnType)!=null||(e.returnType=void 0),(y=e.typeParameters)!=null||(e.typeParameters=void 0);return;case"Property":(d=e.optional)!=null||(e.optional=!1);return;case"TSMethodSignature":case"TSPropertySignature":(g=e.optional)!=null||(e.optional=!1);case"TSIndexSignature":(x=e.accessibility)!=null||(e.accessibility=void 0),(b=e.readonly)!=null||(e.readonly=!1),(P=e.static)!=null||(e.static=!1);return;case"TSAbstractPropertyDefinition":case"PropertyDefinition":case"TSAbstractAccessorProperty":case"AccessorProperty":(v=e.declare)!=null||(e.declare=!1),(E=e.definite)!=null||(e.definite=!1),(L=e.readonly)!=null||(e.readonly=!1),(U=e.typeAnnotation)!=null||(e.typeAnnotation=void 0);case"TSAbstractMethodDefinition":case"MethodDefinition":(N=e.accessibility)!=null||(e.accessibility=void 0),(Y=e.decorators)!=null||(e.decorators=[]),(le=e.override)!=null||(e.override=!1),(ye=e.optional)!=null||(e.optional=!1);return;case"ClassExpression":(Z=e.id)!=null||(e.id=null);case"ClassDeclaration":(gt=e.abstract)!=null||(e.abstract=!1),(Ps=e.declare)!=null||(e.declare=!1),(xi=e.decorators)!=null||(e.decorators=[]),(Kt=e.implements)!=null||(e.implements=[]),(bi=e.superTypeArguments)!=null||(e.superTypeArguments=void 0),(wi=e.typeParameters)!=null||(e.typeParameters=void 0);return;case"TSTypeAliasDeclaration":case"VariableDeclaration":(Q=e.declare)!=null||(e.declare=!1);return;case"VariableDeclarator":(tc=e.definite)!=null||(e.definite=!1);return;case"TSEnumDeclaration":(sc=e.const)!=null||(e.const=!1),(ic=e.declare)!=null||(e.declare=!1);return;case"TSEnumMember":(rc=e.computed)!=null||(e.computed=!1);return;case"TSImportType":(nc=e.qualifier)!=null||(e.qualifier=null),(ac=e.options)!=null||(e.options=null);return;case"TSInterfaceDeclaration":(oc=e.declare)!=null||(e.declare=!1),(cc=e.extends)!=null||(e.extends=[]);return;case"TSMappedType":(lc=e.optional)!=null||(e.optional=!1),(uc=e.readonly)!=null||(e.readonly=void 0);return;case"TSModuleDeclaration":(hc=e.declare)!=null||(e.declare=!1),(pc=e.global)!=null||(e.global=e.kind==="global");return;case"TSTypeParameter":(fc=e.const)!=null||(e.const=!1),(dc=e.in)!=null||(e.in=!1),(mc=e.out)!=null||(e.out=!1);return}}chStartsBindingIdentifierAndNotRelationalOperator(e,s){if(je(e)){if(to.lastIndex=s,to.test(this.input)){let i=this.codePointAtPos(to.lastIndex);if(!Vt(i)&&i!==92)return!1}return!0}else return e===92}nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine(){let e=this.nextTokenInLineStart(),s=this.codePointAtPos(e);return this.chStartsBindingIdentifierAndNotRelationalOperator(s,e)}nextTokenIsIdentifierOrStringLiteralOnSameLine(){let e=this.nextTokenInLineStart(),s=this.codePointAtPos(e);return this.chStartsBindingIdentifier(s,e)||s===34||s===39}};function w0(r){if(r.type!=="MemberExpression")return!1;let{computed:t,property:e}=r;return t&&e.type!=="StringLiteral"&&(e.type!=="TemplateLiteral"||e.expressions.length>0)?!1:up(r.object)}function P0(r,t){var e;let{type:s}=r;if((e=r.extra)!=null&&e.parenthesized)return!1;if(t){if(s==="Literal"){let{value:i}=r;if(typeof i=="string"||typeof i=="boolean")return!0}}else if(s==="StringLiteral"||s==="BooleanLiteral")return!0;return!!(lp(r,t)||T0(r,t)||s==="TemplateLiteral"&&r.expressions.length===0||w0(r))}function lp(r,t){return t?r.type==="Literal"&&(typeof r.value=="number"||"bigint"in r):r.type==="NumericLiteral"||r.type==="BigIntLiteral"}function T0(r,t){if(r.type==="UnaryExpression"){let{operator:e,argument:s}=r;if(e==="-"&&lp(s,t))return!0}return!1}function up(r){return r.type==="Identifier"?!0:r.type!=="MemberExpression"||r.computed?!1:up(r.object)}var Gh=$e`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."}),S0=r=>class extends r{parsePlaceholder(e){if(this.match(133)){let s=this.startNode();return this.next(),this.assertNoSpace(),s.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(133),this.finishPlaceholder(s,e)}}finishPlaceholder(e,s){let i=e;return(!i.expectedNode||!i.type)&&(i=this.finishNode(i,"Placeholder")),i.expectedNode=s,i}getTokenFromCode(e){e===37&&this.input.charCodeAt(this.state.pos+1)===37?this.finishOp(133,2):super.getTokenFromCode(e)}parseExprAtom(e){return this.parsePlaceholder("Expression")||super.parseExprAtom(e)}parseIdentifier(e){return this.parsePlaceholder("Identifier")||super.parseIdentifier(e)}checkReservedWord(e,s,i,n){e!==void 0&&super.checkReservedWord(e,s,i,n)}cloneIdentifier(e){let s=super.cloneIdentifier(e);return s.type==="Placeholder"&&(s.expectedNode=e.expectedNode),s}cloneStringLiteral(e){return e.type==="Placeholder"?this.cloneIdentifier(e):super.cloneStringLiteral(e)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(e,s,i,n){return e==="Placeholder"||super.isValidLVal(e,s,i,n)}toAssignable(e,s){e&&e.type==="Placeholder"&&e.expectedNode==="Expression"?e.expectedNode="Pattern":super.toAssignable(e,s)}chStartsBindingIdentifier(e,s){if(super.chStartsBindingIdentifier(e,s))return!0;let i=this.nextTokenStart();return this.input.charCodeAt(i)===37&&this.input.charCodeAt(i+1)===37}verifyBreakContinue(e,s){var i;((i=e.label)==null?void 0:i.type)!=="Placeholder"&&super.verifyBreakContinue(e,s)}parseExpressionStatement(e,s){var i;if(s.type!=="Placeholder"||(i=s.extra)!=null&&i.parenthesized)return super.parseExpressionStatement(e,s);if(this.match(14)){let a=e;return a.label=this.finishPlaceholder(s,"Identifier"),this.next(),a.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(a,"LabeledStatement")}this.semicolon();let n=e;return n.name=s.name,this.finishPlaceholder(n,"Statement")}parseBlock(e,s,i){return this.parsePlaceholder("BlockStatement")||super.parseBlock(e,s,i)}parseFunctionId(e){return this.parsePlaceholder("Identifier")||super.parseFunctionId(e)}parseClass(e,s,i){let n=s?"ClassDeclaration":"ClassExpression";this.next();let a=this.state.strict,o=this.parsePlaceholder("Identifier");if(o)if(this.match(81)||this.match(133)||this.match(5))e.id=o;else{if(i||!s)return e.id=null,e.body=this.finishPlaceholder(o,"ClassBody"),this.finishNode(e,n);throw this.raise(Gh.ClassNameIsRequired,this.state.startLoc)}else this.parseClassId(e,s,i);return super.parseClassSuper(e),e.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!e.superClass,a),this.finishNode(e,n)}parseExport(e,s){let i=this.parsePlaceholder("Identifier");if(!i)return super.parseExport(e,s);let n=e;if(!this.isContextual(98)&&!this.match(12))return n.specifiers=[],n.source=null,n.declaration=this.finishPlaceholder(i,"Declaration"),this.finishNode(n,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");let a=this.startNode();return a.exported=i,n.specifiers=[this.finishNode(a,"ExportDefaultSpecifier")],super.parseExport(n,s)}isExportDefaultSpecifier(){if(this.match(65)){let e=this.nextTokenStart();if(this.isUnparsedContextual(e,"from")&&this.input.startsWith(mt(133),this.nextTokenStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,s){var i;return(i=e.specifiers)!=null&&i.length?!0:super.maybeParseExportDefaultSpecifier(e,s)}checkExport(e){let{specifiers:s}=e;s!=null&&s.length&&(e.specifiers=s.filter(i=>i.exported.type==="Placeholder")),super.checkExport(e),e.specifiers=s}parseImport(e){let s=this.parsePlaceholder("Identifier");if(!s)return super.parseImport(e);if(e.specifiers=[],!this.isContextual(98)&&!this.match(12))return e.source=this.finishPlaceholder(s,"StringLiteral"),this.semicolon(),this.finishNode(e,"ImportDeclaration");let i=this.startNodeAtNode(s);return i.local=s,e.specifiers.push(this.finishNode(i,"ImportDefaultSpecifier")),this.eat(12)&&(this.maybeParseStarImportSpecifier(e)||this.parseNamedImportSpecifiers(e)),this.expectContextual(98),e.source=this.parseImportSource(),this.semicolon(),this.finishNode(e,"ImportDeclaration")}parseImportSource(){return this.parsePlaceholder("StringLiteral")||super.parseImportSource()}assertNoSpace(){this.state.start>this.offsetToSourcePos(this.state.lastTokEndLoc.index)&&this.raise(Gh.UnexpectedSpace,this.state.lastTokEndLoc)}},A0=r=>class extends r{parseV8Intrinsic(){if(this.match(54)){let e=this.state.startLoc,s=this.startNode();if(this.next(),W(this.state.type)){let i=this.parseIdentifierName(),n=this.createIdentifier(s,i);if(this.castNodeTo(n,"V8IntrinsicIdentifier"),this.match(10))return n}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}},Jh=["minimal","fsharp","hack","smart"],Yh=["^^","@@","^","%","#"];function v0(r){if(r.has("decorators")){if(r.has("decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");let s=r.get("decorators").decoratorsBeforeExport;if(s!=null&&typeof s!="boolean")throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");let i=r.get("decorators").allowCallParenthesized;if(i!=null&&typeof i!="boolean")throw new Error("'allowCallParenthesized' must be a boolean.")}if(r.has("flow")&&r.has("typescript"))throw new Error("Cannot combine flow and typescript plugins.");if(r.has("placeholders")&&r.has("v8intrinsic"))throw new Error("Cannot combine placeholders and v8intrinsic plugins.");if(r.has("pipelineOperator")){var t;let s=r.get("pipelineOperator").proposal;if(!Jh.includes(s)){let i=Jh.map(n=>`"${n}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${i}.`)}if(s==="hack"){var e;if(r.has("placeholders"))throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");if(r.has("v8intrinsic"))throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");let i=r.get("pipelineOperator").topicToken;if(!Yh.includes(i)){let n=Yh.map(a=>`"${a}"`).join(", ");throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${n}.`)}if(i==="#"&&((e=r.get("recordAndTuple"))==null?void 0:e.syntaxType)==="hash")throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple",r.get("recordAndTuple")])}\`.`)}else if(s==="smart"&&((t=r.get("recordAndTuple"))==null?void 0:t.syntaxType)==="hash")throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple",r.get("recordAndTuple")])}\`.`)}if(r.has("moduleAttributes")){if(r.has("deprecatedImportAssert")||r.has("importAssertions"))throw new Error("Cannot combine importAssertions, deprecatedImportAssert and moduleAttributes plugins.");if(r.get("moduleAttributes").version!=="may-2020")throw new Error("The 'moduleAttributes' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is 'may-2020'.")}if(r.has("importAssertions")&&r.has("deprecatedImportAssert"))throw new Error("Cannot combine importAssertions and deprecatedImportAssert plugins.");if(r.has("deprecatedImportAssert")||r.has("importAttributes")&&r.get("importAttributes").deprecatedAssertSyntax&&r.set("deprecatedImportAssert",{}),r.has("recordAndTuple")){let s=r.get("recordAndTuple").syntaxType;if(s!=null){let i=["hash","bar"];if(!i.includes(s))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+i.map(n=>`'${n}'`).join(", "))}}if(r.has("asyncDoExpressions")&&!r.has("doExpressions")){let s=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw s.missingPlugins="doExpressions",s}if(r.has("optionalChainingAssign")&&r.get("optionalChainingAssign").version!=="2023-07")throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.");if(r.has("discardBinding")&&r.get("discardBinding").syntaxType!=="void")throw new Error("The 'discardBinding' plugin requires a 'syntaxType' option. Currently the only supported value is 'void'.")}var hp={estree:Nb,jsx:o0,flow:i0,typescript:b0,v8intrinsic:A0,placeholders:S0},C0=Object.keys(hp),Ao=class extends So{checkProto(t,e,s,i){if(t.type==="SpreadElement"||this.isObjectMethod(t)||t.computed||t.shorthand)return s;let n=t.key;return(n.type==="Identifier"?n.name:n.value)==="__proto__"?e?(this.raise(m.RecordNoProto,n),!0):(s&&(i?i.doubleProtoLoc===null&&(i.doubleProtoLoc=n.loc.start):this.raise(m.DuplicateProto,n)),!0):s}shouldExitDescending(t,e){return t.type==="ArrowFunctionExpression"&&this.offsetToSourcePos(t.start)===e}getExpression(){if(this.enterInitialScopes(),this.nextToken(),this.match(140))throw this.raise(m.ParseExpressionEmptyInput,this.state.startLoc);let t=this.parseExpression();if(!this.match(140))throw this.raise(m.ParseExpressionExpectsEOF,this.state.startLoc,{unexpected:this.input.codePointAt(this.state.start)});return this.finalizeRemainingComments(),t.comments=this.comments,t.errors=this.state.errors,this.optionFlags&256&&(t.tokens=this.tokens),t}parseExpression(t,e){return t?this.disallowInAnd(()=>this.parseExpressionBase(e)):this.allowInAnd(()=>this.parseExpressionBase(e))}parseExpressionBase(t){let e=this.state.startLoc,s=this.parseMaybeAssign(t);if(this.match(12)){let i=this.startNodeAt(e);for(i.expressions=[s];this.eat(12);)i.expressions.push(this.parseMaybeAssign(t));return this.toReferencedList(i.expressions),this.finishNode(i,"SequenceExpression")}return s}parseMaybeAssignDisallowIn(t,e){return this.disallowInAnd(()=>this.parseMaybeAssign(t,e))}parseMaybeAssignAllowIn(t,e){return this.allowInAnd(()=>this.parseMaybeAssign(t,e))}setOptionalParametersError(t){t.optionalParametersLoc=this.state.startLoc}parseMaybeAssign(t,e){let s=this.state.startLoc,i=this.isContextual(108);if(i&&this.prodParam.hasYield){this.next();let c=this.parseYield(s);return e&&(c=e.call(this,c,s)),c}let n;t?n=!1:(t=new fs,n=!0);let{type:a}=this.state;(a===10||W(a))&&(this.state.potentialArrowAt=this.state.start);let o=this.parseMaybeConditional(t);if(e&&(o=e.call(this,o,s)),Mb(this.state.type)){let c=this.startNodeAt(s),l=this.state.value;if(c.operator=l,this.match(29)){this.toAssignable(o,!0),c.left=o;let u=s.index;t.doubleProtoLoc!=null&&t.doubleProtoLoc.index>=u&&(t.doubleProtoLoc=null),t.shorthandAssignLoc!=null&&t.shorthandAssignLoc.index>=u&&(t.shorthandAssignLoc=null),t.privateKeyLoc!=null&&t.privateKeyLoc.index>=u&&(this.checkDestructuringPrivate(t),t.privateKeyLoc=null),t.voidPatternLoc!=null&&t.voidPatternLoc.index>=u&&(t.voidPatternLoc=null)}else c.left=o;return this.next(),c.right=this.parseMaybeAssign(),this.checkLVal(o,this.finishNode(c,"AssignmentExpression"),void 0,void 0,void 0,void 0,l==="||="||l==="&&="||l==="??="),c}else n&&this.checkExpressionErrors(t,!0);if(i){let{type:c}=this.state;if((this.hasPlugin("v8intrinsic")?ai(c):ai(c)&&!this.match(54))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(m.YieldNotInGeneratorFunction,s),this.parseYield(s)}return o}parseMaybeConditional(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,i=this.parseExprOps(t);return this.shouldExitDescending(i,s)?i:this.parseConditional(i,e,t)}parseConditional(t,e,s){if(this.eat(17)){let i=this.startNodeAt(e);return i.test=t,i.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),i.alternate=this.parseMaybeAssign(),this.finishNode(i,"ConditionalExpression")}return t}parseMaybeUnaryOrPrivate(t){return this.match(139)?this.parsePrivateName():this.parseMaybeUnary(t)}parseExprOps(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,i=this.parseMaybeUnaryOrPrivate(t);return this.shouldExitDescending(i,s)?i:this.parseExprOp(i,e,-1)}parseExprOp(t,e,s){if(this.isPrivateName(t)){let n=this.getPrivateNameSV(t);(s>=Or(58)||!this.prodParam.hasIn||!this.match(58))&&this.raise(m.PrivateInExpectedIn,t,{identifierName:n}),this.classScope.usePrivateName(n,t.loc.start)}let i=this.state.type;if(Rb(i)&&(this.prodParam.hasIn||!this.match(58))){let n=Or(i);if(n>s){if(i===39){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return t;this.checkPipelineAtInfixOperator(t,e)}let a=this.startNodeAt(e);a.left=t,a.operator=this.state.value;let o=i===41||i===42,c=i===40;if(c&&(n=Or(42)),this.next(),i===39&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])&&this.state.type===96&&this.prodParam.hasAwait)throw this.raise(m.UnexpectedAwaitAfterPipelineBody,this.state.startLoc);a.right=this.parseExprOpRightExpr(i,n);let l=this.finishNode(a,o||c?"LogicalExpression":"BinaryExpression"),u=this.state.type;if(c&&(u===41||u===42)||o&&u===40)throw this.raise(m.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(l,e,s)}}return t}parseExprOpRightExpr(t,e){let s=this.state.startLoc;switch(t){case 39:switch(this.getPluginOption("pipelineOperator","proposal")){case"hack":return this.withTopicBindingContext(()=>this.parseHackPipeBody());case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(e))}if(this.getPluginOption("pipelineOperator","proposal")==="smart")return this.withTopicBindingContext(()=>{if(this.prodParam.hasYield&&this.isContextual(108))throw this.raise(m.PipeBodyIsTighter,this.state.startLoc);return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(t,e),s)});default:return this.parseExprOpBaseRightExpr(t,e)}}parseExprOpBaseRightExpr(t,e){let s=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),s,qb(t)?e-1:e)}parseHackPipeBody(){var t;let{startLoc:e}=this.state,s=this.parseMaybeAssign();return Tb.has(s.type)&&!((t=s.extra)!=null&&t.parenthesized)&&this.raise(m.PipeUnparenthesizedBody,e,{type:s.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(m.PipeTopicUnused,e),s}checkExponentialAfterUnary(t){this.match(57)&&this.raise(m.UnexpectedTokenUnaryExponentiation,t.argument)}parseMaybeUnary(t,e){let s=this.state.startLoc,i=this.isContextual(96);if(i&&this.recordAwaitIfAllowed()){this.next();let c=this.parseAwait(s);return e||this.checkExponentialAfterUnary(c),c}let n=this.match(34),a=this.startNode();if($b(this.state.type)){a.operator=this.state.value,a.prefix=!0,this.match(72)&&this.expectPlugin("throwExpressions");let c=this.match(89);if(this.next(),a.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),this.state.strict&&c){let l=a.argument;l.type==="Identifier"?this.raise(m.StrictDelete,a):this.hasPropertyAsPrivateName(l)&&this.raise(m.DeletePrivateField,a)}if(!n)return e||this.checkExponentialAfterUnary(a),this.finishNode(a,"UnaryExpression")}let o=this.parseUpdate(a,n,t);if(i){let{type:c}=this.state;if((this.hasPlugin("v8intrinsic")?ai(c):ai(c)&&!this.match(54))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(m.AwaitNotInAsyncContext,s),this.parseAwait(s)}return o}parseUpdate(t,e,s){if(e){let a=t;return this.checkLVal(a.argument,this.finishNode(a,"UpdateExpression")),t}let i=this.state.startLoc,n=this.parseExprSubscripts(s);if(this.checkExpressionErrors(s,!1))return n;for(;Fb(this.state.type)&&!this.canInsertSemicolon();){let a=this.startNodeAt(i);a.operator=this.state.value,a.prefix=!1,a.argument=n,this.next(),this.checkLVal(n,n=this.finishNode(a,"UpdateExpression"))}return n}parseExprSubscripts(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,i=this.parseExprAtom(t);return this.shouldExitDescending(i,s)?i:this.parseSubscripts(i,e)}parseSubscripts(t,e,s){let i={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(t),stop:!1};do t=this.parseSubscript(t,e,s,i),i.maybeAsyncArrow=!1;while(!i.stop);return t}parseSubscript(t,e,s,i){let{type:n}=this.state;if(!s&&n===15)return this.parseBind(t,e,s,i);if(Dr(n))return this.parseTaggedTemplateExpression(t,e,i);let a=!1;if(n===18){if(s&&(this.raise(m.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40))return this.stopParseSubscript(t,i);i.optionalChainMember=a=!0,this.next()}if(!s&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(t,e,i,a);{let o=this.eat(0);return o||a||this.eat(16)?this.parseMember(t,e,i,o,a):this.stopParseSubscript(t,i)}}stopParseSubscript(t,e){return e.stop=!0,t}parseMember(t,e,s,i,n){let a=this.startNodeAt(e);return a.object=t,a.computed=i,i?(a.property=this.parseExpression(),this.expect(3)):this.match(139)?(t.type==="Super"&&this.raise(m.SuperPrivateField,e),this.classScope.usePrivateName(this.state.value,this.state.startLoc),a.property=this.parsePrivateName()):a.property=this.parseIdentifier(!0),s.optionalChainMember?(a.optional=n,this.finishNode(a,"OptionalMemberExpression")):this.finishNode(a,"MemberExpression")}parseBind(t,e,s,i){let n=this.startNodeAt(e);return n.object=t,this.next(),n.callee=this.parseNoCallExpr(),i.stop=!0,this.parseSubscripts(this.finishNode(n,"BindExpression"),e,s)}parseCoverCallAndAsyncArrowHead(t,e,s,i){let n=this.state.maybeInArrowParameters,a=null;this.state.maybeInArrowParameters=!0,this.next();let o=this.startNodeAt(e);o.callee=t;let{maybeAsyncArrow:c,optionalChainMember:l}=s;c&&(this.expressionScope.enter(m0()),a=new fs),l&&(o.optional=i),i?o.arguments=this.parseCallExpressionArguments():o.arguments=this.parseCallExpressionArguments(t.type!=="Super",o,a);let u=this.finishCallExpression(o,l);return c&&this.shouldParseAsyncArrow()&&!i?(s.stop=!0,this.checkDestructuringPrivate(a),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),u=this.parseAsyncArrowFromCallExpression(this.startNodeAt(e),u)):(c&&(this.checkExpressionErrors(a,!0),this.expressionScope.exit()),this.toReferencedArguments(u)),this.state.maybeInArrowParameters=n,u}toReferencedArguments(t,e){this.toReferencedListDeep(t.arguments,e)}parseTaggedTemplateExpression(t,e,s){let i=this.startNodeAt(e);return i.tag=t,i.quasi=this.parseTemplate(!0),s.optionalChainMember&&this.raise(m.OptionalChainingNoTemplate,e),this.finishNode(i,"TaggedTemplateExpression")}atPossibleAsyncArrow(t){return t.type==="Identifier"&&t.name==="async"&&this.state.lastTokEndLoc.index===t.end&&!this.canInsertSemicolon()&&t.end-t.start===5&&this.offsetToSourcePos(t.start)===this.state.potentialArrowAt}finishCallExpression(t,e){if(t.callee.type==="Import")if(t.arguments.length===0||t.arguments.length>2)this.raise(m.ImportCallArity,t);else for(let s of t.arguments)s.type==="SpreadElement"&&this.raise(m.ImportCallSpreadArgument,s);return this.finishNode(t,e?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(t,e,s){let i=[],n=!0,a=this.state.inFSharpPipelineDirectBody;for(this.state.inFSharpPipelineDirectBody=!1;!this.eat(11);){if(n)n=!1;else if(this.expect(12),this.match(11)){e&&this.addTrailingCommaExtraToNode(e),this.next();break}i.push(this.parseExprListItem(11,!1,s,t))}return this.state.inFSharpPipelineDirectBody=a,i}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(t,e){var s;return this.resetPreviousNodeTrailingComments(e),this.expect(19),this.parseArrowExpression(t,e.arguments,!0,(s=e.extra)==null?void 0:s.trailingCommaLoc),e.innerComments&&hi(t,e.innerComments),e.callee.trailingComments&&hi(t,e.callee.trailingComments),t}parseNoCallExpr(){let t=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),t,!0)}parseExprAtom(t){let e,s=null,{type:i}=this.state;switch(i){case 79:return this.parseSuper();case 83:return e=this.startNode(),this.next(),this.match(16)?this.parseImportMetaPropertyOrPhaseCall(e):this.match(10)?this.optionFlags&512?this.parseImportCall(e):this.finishNode(e,"Import"):(this.raise(m.UnsupportedImport,this.state.lastTokStartLoc),this.finishNode(e,"Import"));case 78:return e=this.startNode(),this.next(),this.finishNode(e,"ThisExpression");case 90:return this.parseDo(this.startNode(),!1);case 56:case 31:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 135:return this.parseNumericLiteral(this.state.value);case 136:return this.parseBigIntLiteral(this.state.value);case 134:return this.parseStringLiteral(this.state.value);case 84:return this.parseNullLiteral();case 85:return this.parseBooleanLiteral(!0);case 86:return this.parseBooleanLiteral(!1);case 10:{let n=this.state.potentialArrowAt===this.state.start;return this.parseParenAndDistinguishExpression(n)}case 0:return this.parseArrayLike(3,!1,t);case 5:return this.parseObjectLike(8,!1,!1,t);case 68:return this.parseFunctionOrFunctionSent();case 26:s=this.parseDecorators();case 80:return this.parseClass(this.maybeTakeDecorators(s,this.startNode()),!1);case 77:return this.parseNewOrNewTarget();case 25:case 24:return this.parseTemplate(!1);case 15:{e=this.startNode(),this.next(),e.object=null;let n=e.callee=this.parseNoCallExpr();if(n.type==="MemberExpression")return this.finishNode(e,"BindExpression");throw this.raise(m.UnsupportedBind,n)}case 139:return this.raise(m.PrivateInExpectedIn,this.state.startLoc,{identifierName:this.state.value}),this.parsePrivateName();case 33:return this.parseTopicReferenceThenEqualsSign(54,"%");case 32:return this.parseTopicReferenceThenEqualsSign(44,"^");case 37:case 38:return this.parseTopicReference("hack");case 44:case 54:case 27:{let n=this.getPluginOption("pipelineOperator","proposal");if(n)return this.parseTopicReference(n);throw this.unexpected()}case 47:{let n=this.input.codePointAt(this.nextTokenStart());throw je(n)||n===62?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected()}default:if(i===137)return this.parseDecimalLiteral(this.state.value);if(i===2||i===1)return this.parseArrayLike(this.state.type===2?4:3,!0);if(i===6||i===7)return this.parseObjectLike(this.state.type===6?9:8,!1,!0);if(W(i)){if(this.isContextual(127)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let n=this.state.potentialArrowAt===this.state.start,a=this.state.containsEsc,o=this.parseIdentifier();if(!a&&o.name==="async"&&!this.canInsertSemicolon()){let{type:c}=this.state;if(c===68)return this.resetPreviousNodeTrailingComments(o),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(o));if(W(c))return n&&this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(o)):o;if(c===90)return this.resetPreviousNodeTrailingComments(o),this.parseDo(this.startNodeAtNode(o),!0)}return n&&this.match(19)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(o),[o],!1)):o}else throw this.unexpected()}}parseTopicReferenceThenEqualsSign(t,e){let s=this.getPluginOption("pipelineOperator","proposal");if(s)return this.state.type=t,this.state.value=e,this.state.pos--,this.state.end--,this.state.endLoc=ce(this.state.endLoc,-1),this.parseTopicReference(s);throw this.unexpected()}parseTopicReference(t){let e=this.startNode(),s=this.state.startLoc,i=this.state.type;return this.next(),this.finishTopicReference(e,s,t,i)}finishTopicReference(t,e,s,i){if(this.testTopicReferenceConfiguration(s,e,i))return s==="hack"?(this.topicReferenceIsAllowedInCurrentContext()||this.raise(m.PipeTopicUnbound,e),this.registerTopicReference(),this.finishNode(t,"TopicReference")):(this.topicReferenceIsAllowedInCurrentContext()||this.raise(m.PrimaryTopicNotAllowed,e),this.registerTopicReference(),this.finishNode(t,"PipelinePrimaryTopicReference"));throw this.raise(m.PipeTopicUnconfiguredToken,e,{token:mt(i)})}testTopicReferenceConfiguration(t,e,s){switch(t){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:mt(s)}]);case"smart":return s===27;default:throw this.raise(m.PipeTopicRequiresHackPipes,e)}}parseAsyncArrowUnaryFunction(t){this.prodParam.enter(Lr(!0,this.prodParam.hasYield));let e=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(m.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(19),this.parseArrowExpression(t,e,!0)}parseDo(t,e){this.expectPlugin("doExpressions"),e&&this.expectPlugin("asyncDoExpressions"),t.async=e,this.next();let s=this.state.labels;return this.state.labels=[],e?(this.prodParam.enter(2),t.body=this.parseBlock(),this.prodParam.exit()):t.body=this.parseBlock(),this.state.labels=s,this.finishNode(t,"DoExpression")}parseSuper(){let t=this.startNode();return this.next(),this.match(10)&&!this.scope.allowDirectSuper?this.optionFlags&16||this.raise(m.SuperNotAllowed,t):this.scope.allowSuper||this.optionFlags&16||this.raise(m.UnexpectedSuper,t),!this.match(10)&&!this.match(0)&&!this.match(16)&&this.raise(m.UnsupportedSuper,t),this.finishNode(t,"Super")}parsePrivateName(){let t=this.startNode(),e=this.startNodeAt(ce(this.state.startLoc,1)),s=this.state.value;return this.next(),t.id=this.createIdentifier(e,s),this.finishNode(t,"PrivateName")}parseFunctionOrFunctionSent(){let t=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(t),"function");return this.next(),this.match(103)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected(),this.parseMetaProperty(t,e,"sent")}return this.parseFunction(t)}parseMetaProperty(t,e,s){t.meta=e;let i=this.state.containsEsc;return t.property=this.parseIdentifier(!0),(t.property.name!==s||i)&&this.raise(m.UnsupportedMetaProperty,t.property,{target:e.name,onlyValidPropertyName:s}),this.finishNode(t,"MetaProperty")}parseImportMetaPropertyOrPhaseCall(t){if(this.next(),this.isContextual(105)||this.isContextual(97)){let e=this.isContextual(105);return this.expectPlugin(e?"sourcePhaseImports":"deferredImportEvaluation"),this.next(),t.phase=e?"source":"defer",this.parseImportCall(t)}else{let e=this.createIdentifierAt(this.startNodeAtNode(t),"import",this.state.lastTokStartLoc);return this.isContextual(101)&&(this.inModule||this.raise(m.ImportMetaOutsideModule,e),this.sawUnambiguousESM=!0),this.parseMetaProperty(t,e,"meta")}}parseLiteralAtNode(t,e,s){return this.addExtra(s,"rawValue",t),this.addExtra(s,"raw",this.input.slice(this.offsetToSourcePos(s.start),this.state.end)),s.value=t,this.next(),this.finishNode(s,e)}parseLiteral(t,e){let s=this.startNode();return this.parseLiteralAtNode(t,e,s)}parseStringLiteral(t){return this.parseLiteral(t,"StringLiteral")}parseNumericLiteral(t){return this.parseLiteral(t,"NumericLiteral")}parseBigIntLiteral(t){return this.parseLiteral(t,"BigIntLiteral")}parseDecimalLiteral(t){return this.parseLiteral(t,"DecimalLiteral")}parseRegExpLiteral(t){let e=this.startNode();return this.addExtra(e,"raw",this.input.slice(this.offsetToSourcePos(e.start),this.state.end)),e.pattern=t.pattern,e.flags=t.flags,this.next(),this.finishNode(e,"RegExpLiteral")}parseBooleanLiteral(t){let e=this.startNode();return e.value=t,this.next(),this.finishNode(e,"BooleanLiteral")}parseNullLiteral(){let t=this.startNode();return this.next(),this.finishNode(t,"NullLiteral")}parseParenAndDistinguishExpression(t){let e=this.state.startLoc,s;this.next(),this.expressionScope.enter(d0());let i=this.state.maybeInArrowParameters,n=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;let a=this.state.startLoc,o=[],c=new fs,l=!0,u,h;for(;!this.match(11);){if(l)l=!1;else if(this.expect(12,c.optionalParametersLoc===null?null:c.optionalParametersLoc),this.match(11)){h=this.state.startLoc;break}if(this.match(21)){let y=this.state.startLoc;if(u=this.state.startLoc,o.push(this.parseParenItem(this.parseRestBinding(),y)),!this.checkCommaAfterRest(41))break}else o.push(this.parseMaybeAssignAllowInOrVoidPattern(11,c,this.parseParenItem))}let p=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=i,this.state.inFSharpPipelineDirectBody=n;let f=this.startNodeAt(e);return t&&this.shouldParseArrow(o)&&(f=this.parseArrow(f))?(this.checkDestructuringPrivate(c),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(f,o,!1),f):(this.expressionScope.exit(),o.length||this.unexpected(this.state.lastTokStartLoc),h&&this.unexpected(h),u&&this.unexpected(u),this.checkExpressionErrors(c,!0),this.toReferencedListDeep(o,!0),o.length>1?(s=this.startNodeAt(a),s.expressions=o,this.finishNode(s,"SequenceExpression"),this.resetEndLocation(s,p)):s=o[0],this.wrapParenthesis(e,s))}wrapParenthesis(t,e){if(!(this.optionFlags&1024))return this.addExtra(e,"parenthesized",!0),this.addExtra(e,"parenStart",t.index),this.takeSurroundingComments(e,t.index,this.state.lastTokEndLoc.index),e;let s=this.startNodeAt(t);return s.expression=e,this.finishNode(s,"ParenthesizedExpression")}shouldParseArrow(t){return!this.canInsertSemicolon()}parseArrow(t){if(this.eat(19))return t}parseParenItem(t,e){return t}parseNewOrNewTarget(){let t=this.startNode();if(this.next(),this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(t),"new");this.next();let s=this.parseMetaProperty(t,e,"target");return this.scope.allowNewTarget||this.raise(m.UnexpectedNewTarget,s),s}return this.parseNew(t)}parseNew(t){if(this.parseNewCallee(t),this.eat(10)){let e=this.parseExprList(11);this.toReferencedList(e),t.arguments=e}else t.arguments=[];return this.finishNode(t,"NewExpression")}parseNewCallee(t){let e=this.match(83),s=this.parseNoCallExpr();t.callee=s,e&&(s.type==="Import"||s.type==="ImportExpression")&&this.raise(m.ImportCallNotNewExpression,s)}parseTemplateElement(t){let{start:e,startLoc:s,end:i,value:n}=this.state,a=e+1,o=this.startNodeAt(ce(s,1));n===null&&(t||this.raise(m.InvalidEscapeSequenceTemplate,ce(this.state.firstInvalidTemplateEscapePos,1)));let c=this.match(24),l=c?-1:-2,u=i+l;o.value={raw:this.input.slice(a,u).replace(/\r\n?/g,`
172
+ `),cooked:n===null?null:n.slice(1,l)},o.tail=c,this.next();let h=this.finishNode(o,"TemplateElement");return this.resetEndLocation(h,ce(this.state.lastTokEndLoc,l)),h}parseTemplate(t){let e=this.startNode(),s=this.parseTemplateElement(t),i=[s],n=[];for(;!s.tail;)n.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),i.push(s=this.parseTemplateElement(t));return e.expressions=n,e.quasis=i,this.finishNode(e,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(t,e,s,i){s&&this.expectPlugin("recordAndTuple");let n=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let a=!1,o=!0,c=this.startNode();for(c.properties=[],this.next();!this.match(t);){if(o)o=!1;else if(this.expect(12),this.match(t)){this.addTrailingCommaExtraToNode(c);break}let u;e?u=this.parseBindingProperty():(u=this.parsePropertyDefinition(i),a=this.checkProto(u,s,a,i)),s&&!this.isObjectProperty(u)&&u.type!=="SpreadElement"&&this.raise(m.InvalidRecordProperty,u),u.shorthand&&this.addExtra(u,"shorthand",!0),c.properties.push(u)}this.next(),this.state.inFSharpPipelineDirectBody=n;let l="ObjectExpression";return e?l="ObjectPattern":s&&(l="RecordExpression"),this.finishNode(c,l)}addTrailingCommaExtraToNode(t){this.addExtra(t,"trailingComma",this.state.lastTokStartLoc.index),this.addExtra(t,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(t){return!t.computed&&t.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(t){let e=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(m.UnsupportedPropertyDecorator,this.state.startLoc);this.match(26);)e.push(this.parseDecorator());let s=this.startNode(),i=!1,n=!1,a;if(this.match(21))return e.length&&this.unexpected(),this.parseSpread();e.length&&(s.decorators=e,e=[]),s.method=!1,t&&(a=this.state.startLoc);let o=this.eat(55);this.parsePropertyNamePrefixOperator(s);let c=this.state.containsEsc;if(this.parsePropertyName(s,t),!o&&!c&&this.maybeAsyncOrAccessorProp(s)){let{key:l}=s,u=l.name;u==="async"&&!this.hasPrecedingLineBreak()&&(i=!0,this.resetPreviousNodeTrailingComments(l),o=this.eat(55),this.parsePropertyName(s)),(u==="get"||u==="set")&&(n=!0,this.resetPreviousNodeTrailingComments(l),s.kind=u,this.match(55)&&(o=!0,this.raise(m.AccessorIsGenerator,this.state.curPosition(),{kind:u}),this.next()),this.parsePropertyName(s))}return this.parseObjPropValue(s,a,o,i,!1,n,t)}getGetterSetterExpectedParamCount(t){return t.kind==="get"?0:1}getObjectOrClassMethodParams(t){return t.params}checkGetterSetterParams(t){var e;let s=this.getGetterSetterExpectedParamCount(t),i=this.getObjectOrClassMethodParams(t);i.length!==s&&this.raise(t.kind==="get"?m.BadGetterArity:m.BadSetterArity,t),t.kind==="set"&&((e=i[i.length-1])==null?void 0:e.type)==="RestElement"&&this.raise(m.BadSetterRestParameter,t)}parseObjectMethod(t,e,s,i,n){if(n){let a=this.parseMethod(t,e,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(a),a}if(s||e||this.match(10))return i&&this.unexpected(),t.kind="method",t.method=!0,this.parseMethod(t,e,s,!1,!1,"ObjectMethod")}parseObjectProperty(t,e,s,i){if(t.shorthand=!1,this.eat(14))return t.value=s?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowInOrVoidPattern(8,i),this.finishObjectProperty(t);if(!t.computed&&t.key.type==="Identifier"){if(this.checkReservedWord(t.key.name,t.key.loc.start,!0,!1),s)t.value=this.parseMaybeDefault(e,this.cloneIdentifier(t.key));else if(this.match(29)){let n=this.state.startLoc;i!=null?i.shorthandAssignLoc===null&&(i.shorthandAssignLoc=n):this.raise(m.InvalidCoverInitializedName,n),t.value=this.parseMaybeDefault(e,this.cloneIdentifier(t.key))}else t.value=this.cloneIdentifier(t.key);return t.shorthand=!0,this.finishObjectProperty(t)}}finishObjectProperty(t){return this.finishNode(t,"ObjectProperty")}parseObjPropValue(t,e,s,i,n,a,o){let c=this.parseObjectMethod(t,s,i,n,a)||this.parseObjectProperty(t,e,n,o);return c||this.unexpected(),c}parsePropertyName(t,e){if(this.eat(0))t.computed=!0,t.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let{type:s,value:i}=this.state,n;if(Ie(s))n=this.parseIdentifier(!0);else switch(s){case 135:n=this.parseNumericLiteral(i);break;case 134:n=this.parseStringLiteral(i);break;case 136:n=this.parseBigIntLiteral(i);break;case 139:{let a=this.state.startLoc;e!=null?e.privateKeyLoc===null&&(e.privateKeyLoc=a):this.raise(m.UnexpectedPrivateField,a),n=this.parsePrivateName();break}default:if(s===137){n=this.parseDecimalLiteral(i);break}this.unexpected()}t.key=n,s!==139&&(t.computed=!1)}}initFunction(t,e){t.id=null,t.generator=!1,t.async=e}parseMethod(t,e,s,i,n,a,o=!1){this.initFunction(t,s),t.generator=e,this.scope.enter(530|(o?576:0)|(n?32:0)),this.prodParam.enter(Lr(s,t.generator)),this.parseFunctionParams(t,i);let c=this.parseFunctionBodyAndFinish(t,a,!0);return this.prodParam.exit(),this.scope.exit(),c}parseArrayLike(t,e,s){e&&this.expectPlugin("recordAndTuple");let i=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let n=this.startNode();return this.next(),n.elements=this.parseExprList(t,!e,s,n),this.state.inFSharpPipelineDirectBody=i,this.finishNode(n,e?"TupleExpression":"ArrayExpression")}parseArrowExpression(t,e,s,i){this.scope.enter(518);let n=Lr(s,!1);!this.match(5)&&this.prodParam.hasIn&&(n|=8),this.prodParam.enter(n),this.initFunction(t,s);let a=this.state.maybeInArrowParameters;return e&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(t,e,i)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(t,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=a,this.finishNode(t,"ArrowFunctionExpression")}setArrowFunctionParameters(t,e,s){this.toAssignableList(e,s,!1),t.params=e}parseFunctionBodyAndFinish(t,e,s=!1){return this.parseFunctionBody(t,!1,s),this.finishNode(t,e)}parseFunctionBody(t,e,s=!1){let i=e&&!this.match(5);if(this.expressionScope.enter(cp()),i)t.body=this.parseMaybeAssign(),this.checkParams(t,!1,e,!1);else{let n=this.state.strict,a=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),t.body=this.parseBlock(!0,!1,o=>{let c=!this.isSimpleParamList(t.params);o&&c&&this.raise(m.IllegalLanguageModeDirective,(t.kind==="method"||t.kind==="constructor")&&t.key?t.key.loc.end:t);let l=!n&&this.state.strict;this.checkParams(t,!this.state.strict&&!e&&!s&&!c,e,l),this.state.strict&&t.id&&this.checkIdentifier(t.id,65,l)}),this.prodParam.exit(),this.state.labels=a}this.expressionScope.exit()}isSimpleParameter(t){return t.type==="Identifier"}isSimpleParamList(t){for(let e=0,s=t.length;e<s;e++)if(!this.isSimpleParameter(t[e]))return!1;return!0}checkParams(t,e,s,i=!0){let n=!e&&new Set,a={type:"FormalParameters"};for(let o of t.params)this.checkLVal(o,a,5,n,i)}parseExprList(t,e,s,i){let n=[],a=!0;for(;!this.eat(t);){if(a)a=!1;else if(this.expect(12),this.match(t)){i&&this.addTrailingCommaExtraToNode(i),this.next();break}n.push(this.parseExprListItem(t,e,s))}return n}parseExprListItem(t,e,s,i){let n;if(this.match(12))e||this.raise(m.UnexpectedToken,this.state.curPosition(),{unexpected:","}),n=null;else if(this.match(21)){let a=this.state.startLoc;n=this.parseParenItem(this.parseSpread(s),a)}else if(this.match(17)){this.expectPlugin("partialApplication"),i||this.raise(m.UnexpectedArgumentPlaceholder,this.state.startLoc);let a=this.startNode();this.next(),n=this.finishNode(a,"ArgumentPlaceholder")}else n=this.parseMaybeAssignAllowInOrVoidPattern(t,s,this.parseParenItem);return n}parseIdentifier(t){let e=this.startNode(),s=this.parseIdentifierName(t);return this.createIdentifier(e,s)}createIdentifier(t,e){return t.name=e,t.loc.identifierName=e,this.finishNode(t,"Identifier")}createIdentifierAt(t,e,s){return t.name=e,t.loc.identifierName=e,this.finishNodeAt(t,"Identifier",s)}parseIdentifierName(t){let e,{startLoc:s,type:i}=this.state;Ie(i)?e=this.state.value:this.unexpected();let n=Ob(i);return t?n&&this.replaceToken(132):this.checkReservedWord(e,s,n,!1),this.next(),e}checkReservedWord(t,e,s,i){if(t.length>10||!Zb(t))return;if(s&&Gb(t)){this.raise(m.UnexpectedKeyword,e,{keyword:t});return}if((this.state.strict?i?rp:sp:tp)(t,this.inModule)){this.raise(m.UnexpectedReservedWord,e,{reservedWord:t});return}else if(t==="yield"){if(this.prodParam.hasYield){this.raise(m.YieldBindingIdentifier,e);return}}else if(t==="await"){if(this.prodParam.hasAwait){this.raise(m.AwaitBindingIdentifier,e);return}if(this.scope.inStaticBlock){this.raise(m.AwaitBindingIdentifierInStaticBlock,e);return}this.expressionScope.recordAsyncArrowParametersError(e)}else if(t==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(m.ArgumentsInClass,e);return}}recordAwaitIfAllowed(){let t=this.prodParam.hasAwait;return t&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),t}parseAwait(t){let e=this.startNodeAt(t);return this.expressionScope.recordParameterInitializerError(m.AwaitExpressionFormalParameter,e),this.eat(55)&&this.raise(m.ObsoleteAwaitStar,e),!this.scope.inFunction&&!(this.optionFlags&1)&&(this.isAmbiguousPrefixOrIdentifier()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),this.state.soloAwait||(e.argument=this.parseMaybeUnary(null,!0)),this.finishNode(e,"AwaitExpression")}isAmbiguousPrefixOrIdentifier(){if(this.hasPrecedingLineBreak())return!0;let{type:t}=this.state;return t===53||t===10||t===0||Dr(t)||t===102&&!this.state.containsEsc||t===138||t===56||this.hasPlugin("v8intrinsic")&&t===54}parseYield(t){let e=this.startNodeAt(t);this.expressionScope.recordParameterInitializerError(m.YieldInParameter,e);let s=!1,i=null;if(!this.hasPrecedingLineBreak())switch(s=this.eat(55),this.state.type){case 13:case 140:case 8:case 11:case 3:case 9:case 14:case 12:if(!s)break;default:i=this.parseMaybeAssign()}return e.delegate=s,e.argument=i,this.finishNode(e,"YieldExpression")}parseImportCall(t){if(this.next(),t.source=this.parseMaybeAssignAllowIn(),t.options=null,this.eat(12)){if(this.match(11))this.addTrailingCommaExtraToNode(t.source);else if(t.options=this.parseMaybeAssignAllowIn(),this.eat(12)&&(this.addTrailingCommaExtraToNode(t.options),!this.match(11))){do this.parseMaybeAssignAllowIn();while(this.eat(12)&&!this.match(11));this.raise(m.ImportCallArity,t)}}return this.expect(11),this.finishNode(t,"ImportExpression")}checkPipelineAtInfixOperator(t,e){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&t.type==="SequenceExpression"&&this.raise(m.PipelineHeadSequenceExpression,e)}parseSmartPipelineBodyInStyle(t,e){if(this.isSimpleReference(t)){let s=this.startNodeAt(e);return s.callee=t,this.finishNode(s,"PipelineBareFunction")}else{let s=this.startNodeAt(e);return this.checkSmartPipeTopicBodyEarlyErrors(e),s.expression=t,this.finishNode(s,"PipelineTopicExpression")}}isSimpleReference(t){switch(t.type){case"MemberExpression":return!t.computed&&this.isSimpleReference(t.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(t){if(this.match(19))throw this.raise(m.PipelineBodyNoArrow,this.state.startLoc);this.topicReferenceWasUsedInCurrentContext()||this.raise(m.PipelineTopicUnused,t)}withTopicBindingContext(t){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return t()}finally{this.state.topicContext=e}}withSmartMixTopicForbiddingContext(t){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return t()}finally{this.state.topicContext=e}}else return t()}withSoloAwaitPermittingContext(t){let e=this.state.soloAwait;this.state.soloAwait=!0;try{return t()}finally{this.state.soloAwait=e}}allowInAnd(t){let e=this.prodParam.currentFlags();if(8&~e){this.prodParam.enter(e|8);try{return t()}finally{this.prodParam.exit()}}return t()}disallowInAnd(t){let e=this.prodParam.currentFlags();if(8&e){this.prodParam.enter(e&-9);try{return t()}finally{this.prodParam.exit()}}return t()}registerTopicReference(){this.state.topicContext.maxTopicIndex=0}topicReferenceIsAllowedInCurrentContext(){return this.state.topicContext.maxNumOfResolvableTopics>=1}topicReferenceWasUsedInCurrentContext(){return this.state.topicContext.maxTopicIndex!=null&&this.state.topicContext.maxTopicIndex>=0}parseFSharpPipelineBody(t){let e=this.state.startLoc;this.state.potentialArrowAt=this.state.start;let s=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;let i=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),e,t);return this.state.inFSharpPipelineDirectBody=s,i}parseModuleExpression(){this.expectPlugin("moduleBlocks");let t=this.startNode();this.next(),this.match(5)||this.unexpected(null,5);let e=this.startNodeAt(this.state.endLoc);this.next();let s=this.initializeScopes(!0);this.enterInitialScopes();try{t.body=this.parseProgram(e,8,"module")}finally{s()}return this.finishNode(t,"ModuleExpression")}parseVoidPattern(t){this.expectPlugin("discardBinding");let e=this.startNode();return t!=null&&(t.voidPatternLoc=this.state.startLoc),this.next(),this.finishNode(e,"VoidPattern")}parseMaybeAssignAllowInOrVoidPattern(t,e,s){if(e!=null&&this.match(88)){let i=this.lookaheadCharCode();if(i===44||i===(t===3?93:t===8?125:41)||i===61)return this.parseMaybeDefault(this.state.startLoc,this.parseVoidPattern(e))}return this.parseMaybeAssignAllowIn(e,s)}parsePropertyNamePrefixOperator(t){}},so={kind:1},k0={kind:2},E0=/[\uD800-\uDFFF]/u,io=/in(?:stanceof)?/y;function N0(r,t,e){for(let s=0;s<r.length;s++){let i=r[s],{type:n}=i;if(typeof n=="number"){if(n===139){let{loc:a,start:o,value:c,end:l}=i,u=o+1,h=ce(a.start,1);r.splice(s,1,new Fe({type:Ye(27),value:"#",start:o,end:u,startLoc:a.start,endLoc:h}),new Fe({type:Ye(132),value:c,start:u,end:l,startLoc:h,endLoc:a.end})),s++;continue}if(Dr(n)){let{loc:a,start:o,value:c,end:l}=i,u=o+1,h=ce(a.start,1),p;t.charCodeAt(o-e)===96?p=new Fe({type:Ye(22),value:"`",start:o,end:u,startLoc:a.start,endLoc:h}):p=new Fe({type:Ye(8),value:"}",start:o,end:u,startLoc:a.start,endLoc:h});let f,y,d,g;n===24?(y=l-1,d=ce(a.end,-1),f=c===null?null:c.slice(1,-1),g=new Fe({type:Ye(22),value:"`",start:y,end:l,startLoc:d,endLoc:a.end})):(y=l-2,d=ce(a.end,-2),f=c===null?null:c.slice(1,-2),g=new Fe({type:Ye(23),value:"${",start:y,end:l,startLoc:d,endLoc:a.end})),r.splice(s,1,p,new Fe({type:Ye(20),value:f,start:u,end:y,startLoc:h,endLoc:d}),g),s+=2;continue}i.type=Ye(n)}}return r}var vo=class extends Ao{parseTopLevel(t,e){return t.program=this.parseProgram(e,140,this.options.sourceType==="module"?"module":"script"),t.comments=this.comments,this.optionFlags&256&&(t.tokens=N0(this.tokens,this.input,this.startIndex)),this.finishNode(t,"File")}parseProgram(t,e,s){if(t.sourceType=s,t.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(t,!0,!0,e),this.inModule){if(!(this.optionFlags&64)&&this.scope.undefinedExports.size>0)for(let[n,a]of Array.from(this.scope.undefinedExports))this.raise(m.ModuleExportUndefined,a,{localName:n});this.addExtra(t,"topLevelAwait",this.state.hasTopLevelAwait)}let i;return e===140?i=this.finishNode(t,"Program"):i=this.finishNodeAt(t,"Program",ce(this.state.startLoc,-1)),i}stmtToDirective(t){let e=this.castNodeTo(t,"Directive"),s=this.castNodeTo(t.expression,"DirectiveLiteral"),i=s.value,n=this.input.slice(this.offsetToSourcePos(s.start),this.offsetToSourcePos(s.end)),a=s.value=n.slice(1,-1);return this.addExtra(s,"raw",n),this.addExtra(s,"rawValue",a),this.addExtra(s,"expressionValue",i),e.value=s,delete t.expression,e}parseInterpreterDirective(){if(!this.match(28))return null;let t=this.startNode();return t.value=this.state.value,this.next(),this.finishNode(t,"InterpreterDirective")}isLet(){return this.isContextual(100)?this.hasFollowingBindingAtom():!1}isUsing(){return this.isContextual(107)?this.nextTokenIsIdentifierOnSameLine():!1}isForUsing(){if(!this.isContextual(107))return!1;let t=this.nextTokenInLineStart(),e=this.codePointAtPos(t);if(this.isUnparsedContextual(t,"of")){let s=this.lookaheadCharCodeSince(t+2);if(s!==61&&s!==58&&s!==59)return!1}return!!(this.chStartsBindingIdentifier(e,t)||this.isUnparsedContextual(t,"void"))}nextTokenIsIdentifierOnSameLine(){let t=this.nextTokenInLineStart(),e=this.codePointAtPos(t);return this.chStartsBindingIdentifier(e,t)}isAwaitUsing(){if(!this.isContextual(96))return!1;let t=this.nextTokenInLineStart();if(this.isUnparsedContextual(t,"using")){t=this.nextTokenInLineStartSince(t+5);let e=this.codePointAtPos(t);if(this.chStartsBindingIdentifier(e,t))return!0}return!1}chStartsBindingIdentifier(t,e){if(je(t)){if(io.lastIndex=e,io.test(this.input)){let s=this.codePointAtPos(io.lastIndex);if(!Vt(s)&&s!==92)return!1}return!0}else return t===92}chStartsBindingPattern(t){return t===91||t===123}hasFollowingBindingAtom(){let t=this.nextTokenStart(),e=this.codePointAtPos(t);return this.chStartsBindingPattern(e)||this.chStartsBindingIdentifier(e,t)}hasInLineFollowingBindingIdentifierOrBrace(){let t=this.nextTokenInLineStart(),e=this.codePointAtPos(t);return e===123||this.chStartsBindingIdentifier(e,t)}allowsUsing(){return(this.scope.inModule||!this.scope.inTopLevel)&&!this.scope.inBareCaseStatement}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(t=!1){let e=0;return this.options.annexB&&!this.state.strict&&(e|=4,t&&(e|=8)),this.parseStatementLike(e)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(t){let e=null;return this.match(26)&&(e=this.parseDecorators(!0)),this.parseStatementContent(t,e)}parseStatementContent(t,e){let s=this.state.type,i=this.startNode(),n=!!(t&2),a=!!(t&4),o=t&1;switch(s){case 60:return this.parseBreakContinueStatement(i,!0);case 63:return this.parseBreakContinueStatement(i,!1);case 64:return this.parseDebuggerStatement(i);case 90:return this.parseDoWhileStatement(i);case 91:return this.parseForStatement(i);case 68:if(this.lookaheadCharCode()===46)break;return a||this.raise(this.state.strict?m.StrictFunction:this.options.annexB?m.SloppyFunctionAnnexB:m.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(i,!1,!n&&a);case 80:return n||this.unexpected(),this.parseClass(this.maybeTakeDecorators(e,i),!0);case 69:return this.parseIfStatement(i);case 70:return this.parseReturnStatement(i);case 71:return this.parseSwitchStatement(i);case 72:return this.parseThrowStatement(i);case 73:return this.parseTryStatement(i);case 96:if(this.isAwaitUsing())return this.allowsUsing()?n?this.recordAwaitIfAllowed()||this.raise(m.AwaitUsingNotInAsyncContext,i):this.raise(m.UnexpectedLexicalDeclaration,i):this.raise(m.UnexpectedUsingDeclaration,i),this.next(),this.parseVarStatement(i,"await using");break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.allowsUsing()?n||this.raise(m.UnexpectedLexicalDeclaration,this.state.startLoc):this.raise(m.UnexpectedUsingDeclaration,this.state.startLoc),this.parseVarStatement(i,"using");case 100:{if(this.state.containsEsc)break;let u=this.nextTokenStart(),h=this.codePointAtPos(u);if(h!==91&&(!n&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(h,u)&&h!==123))break}case 75:n||this.raise(m.UnexpectedLexicalDeclaration,this.state.startLoc);case 74:{let u=this.state.value;return this.parseVarStatement(i,u)}case 92:return this.parseWhileStatement(i);case 76:return this.parseWithStatement(i);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(i);case 83:{let u=this.lookaheadCharCode();if(u===40||u===46)break}case 82:{!(this.optionFlags&8)&&!o&&this.raise(m.UnexpectedImportExport,this.state.startLoc),this.next();let u;return s===83?u=this.parseImport(i):u=this.parseExport(i,e),this.assertModuleNodeAllowed(u),u}default:if(this.isAsyncFunction())return n||this.raise(m.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(i,!0,!n&&a)}let c=this.state.value,l=this.parseExpression();return W(s)&&l.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(i,c,l,t):this.parseExpressionStatement(i,l,e)}assertModuleNodeAllowed(t){!(this.optionFlags&8)&&!this.inModule&&this.raise(m.ImportOutsideModule,t)}decoratorsEnabledBeforeExport(){return this.hasPlugin("decorators-legacy")?!0:this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(t,e,s){if(t){var i;(i=e.decorators)!=null&&i.length?(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!="boolean"&&this.raise(m.DecoratorsBeforeAfterExport,e.decorators[0]),e.decorators.unshift(...t)):e.decorators=t,this.resetStartLocationFromNode(e,t[0]),s&&this.resetStartLocationFromNode(s,e)}return e}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(t){let e=[];do e.push(this.parseDecorator());while(this.match(26));if(this.match(82))t||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(m.DecoratorExportClass,this.state.startLoc);else if(!this.canHaveLeadingDecorator())throw this.raise(m.UnexpectedLeadingDecorator,this.state.startLoc);return e}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let t=this.startNode();if(this.next(),this.hasPlugin("decorators")){let e=this.state.startLoc,s;if(this.match(10)){let i=this.state.startLoc;this.next(),s=this.parseExpression(),this.expect(11),s=this.wrapParenthesis(i,s);let n=this.state.startLoc;t.expression=this.parseMaybeDecoratorArguments(s,i),this.getPluginOption("decorators","allowCallParenthesized")===!1&&t.expression!==s&&this.raise(m.DecoratorArgumentsOutsideParentheses,n)}else{for(s=this.parseIdentifier(!1);this.eat(16);){let i=this.startNodeAt(e);i.object=s,this.match(139)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),i.property=this.parsePrivateName()):i.property=this.parseIdentifier(!0),i.computed=!1,s=this.finishNode(i,"MemberExpression")}t.expression=this.parseMaybeDecoratorArguments(s,e)}}else t.expression=this.parseExprSubscripts();return this.finishNode(t,"Decorator")}parseMaybeDecoratorArguments(t,e){if(this.eat(10)){let s=this.startNodeAt(e);return s.callee=t,s.arguments=this.parseCallExpressionArguments(),this.toReferencedList(s.arguments),this.finishNode(s,"CallExpression")}return t}parseBreakContinueStatement(t,e){return this.next(),this.isLineTerminator()?t.label=null:(t.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(t,e),this.finishNode(t,e?"BreakStatement":"ContinueStatement")}verifyBreakContinue(t,e){let s;for(s=0;s<this.state.labels.length;++s){let i=this.state.labels[s];if((t.label==null||i.name===t.label.name)&&(i.kind!=null&&(e||i.kind===1)||t.label&&e))break}if(s===this.state.labels.length){let i=e?"BreakStatement":"ContinueStatement";this.raise(m.IllegalBreakContinue,t,{type:i})}}parseDebuggerStatement(t){return this.next(),this.semicolon(),this.finishNode(t,"DebuggerStatement")}parseHeaderExpression(){this.expect(10);let t=this.parseExpression();return this.expect(11),t}parseDoWhileStatement(t){return this.next(),this.state.labels.push(so),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.expect(92),t.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(t,"DoWhileStatement")}parseForStatement(t){this.next(),this.state.labels.push(so);let e=null;if(this.isContextual(96)&&this.recordAwaitIfAllowed()&&(e=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(10),this.match(13))return e!==null&&this.unexpected(e),this.parseFor(t,null);let s=this.isContextual(100);{let c=this.isAwaitUsing(),l=c||this.isForUsing(),u=s&&this.hasFollowingBindingAtom()||l;if(this.match(74)||this.match(75)||u){let h=this.startNode(),p;c?(p="await using",this.recordAwaitIfAllowed()||this.raise(m.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):p=this.state.value,this.next(),this.parseVar(h,!0,p);let f=this.finishNode(h,"VariableDeclaration"),y=this.match(58);return y&&l&&this.raise(m.ForInUsing,f),(y||this.isContextual(102))&&f.declarations.length===1?this.parseForIn(t,f,e):(e!==null&&this.unexpected(e),this.parseFor(t,f))}}let i=this.isContextual(95),n=new fs,a=this.parseExpression(!0,n),o=this.isContextual(102);if(o&&(s&&this.raise(m.ForOfLet,a),e===null&&i&&a.type==="Identifier"&&this.raise(m.ForOfAsync,a)),o||this.match(58)){this.checkDestructuringPrivate(n),this.toAssignable(a,!0);let c=o?"ForOfStatement":"ForInStatement";return this.checkLVal(a,{type:c}),this.parseForIn(t,a,e)}else this.checkExpressionErrors(n,!0);return e!==null&&this.unexpected(e),this.parseFor(t,a)}parseFunctionStatement(t,e,s){return this.next(),this.parseFunction(t,1|(s?2:0)|(e?8:0))}parseIfStatement(t){return this.next(),t.test=this.parseHeaderExpression(),t.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),t.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(t,"IfStatement")}parseReturnStatement(t){return this.prodParam.hasReturn||this.raise(m.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")}parseSwitchStatement(t){this.next(),t.discriminant=this.parseHeaderExpression();let e=t.cases=[];this.expect(5),this.state.labels.push(k0),this.scope.enter(256);let s;for(let i;!this.match(8);)if(this.match(61)||this.match(65)){let n=this.match(61);s&&this.finishNode(s,"SwitchCase"),e.push(s=this.startNode()),s.consequent=[],this.next(),n?s.test=this.parseExpression():(i&&this.raise(m.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),i=!0,s.test=null),this.expect(14)}else s?s.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),s&&this.finishNode(s,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(t,"SwitchStatement")}parseThrowStatement(t){return this.next(),this.hasPrecedingLineBreak()&&this.raise(m.NewlineAfterThrow,this.state.lastTokEndLoc),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")}parseCatchClauseParam(){let t=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&t.type==="Identifier"?8:0),this.checkLVal(t,{type:"CatchClause"},9),t}parseTryStatement(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.match(62)){let e=this.startNode();this.next(),this.match(10)?(this.expect(10),e.param=this.parseCatchClauseParam(),this.expect(11)):(e.param=null,this.scope.enter(0)),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(67)?this.parseBlock():null,!t.handler&&!t.finalizer&&this.raise(m.NoCatchOrFinally,t),this.finishNode(t,"TryStatement")}parseVarStatement(t,e,s=!1){return this.next(),this.parseVar(t,!1,e,s),this.semicolon(),this.finishNode(t,"VariableDeclaration")}parseWhileStatement(t){return this.next(),t.test=this.parseHeaderExpression(),this.state.labels.push(so),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(t,"WhileStatement")}parseWithStatement(t){return this.state.strict&&this.raise(m.StrictWith,this.state.startLoc),this.next(),t.object=this.parseHeaderExpression(),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(t,"WithStatement")}parseEmptyStatement(t){return this.next(),this.finishNode(t,"EmptyStatement")}parseLabeledStatement(t,e,s,i){for(let a of this.state.labels)a.name===e&&this.raise(m.LabelRedeclaration,s,{labelName:e});let n=Db(this.state.type)?1:this.match(71)?2:null;for(let a=this.state.labels.length-1;a>=0;a--){let o=this.state.labels[a];if(o.statementStart===t.start)o.statementStart=this.sourceToOffsetPos(this.state.start),o.kind=n;else break}return this.state.labels.push({name:e,kind:n,statementStart:this.sourceToOffsetPos(this.state.start)}),t.body=i&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),t.label=s,this.finishNode(t,"LabeledStatement")}parseExpressionStatement(t,e,s){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")}parseBlock(t=!1,e=!0,s){let i=this.startNode();return t&&this.state.strictErrors.clear(),this.expect(5),e&&this.scope.enter(0),this.parseBlockBody(i,t,!1,8,s),e&&this.scope.exit(),this.finishNode(i,"BlockStatement")}isValidDirective(t){return t.type==="ExpressionStatement"&&t.expression.type==="StringLiteral"&&!t.expression.extra.parenthesized}parseBlockBody(t,e,s,i,n){let a=t.body=[],o=t.directives=[];this.parseBlockOrModuleBlockBody(a,e?o:void 0,s,i,n)}parseBlockOrModuleBlockBody(t,e,s,i,n){let a=this.state.strict,o=!1,c=!1;for(;!this.match(i);){let l=s?this.parseModuleItem():this.parseStatementListItem();if(e&&!c){if(this.isValidDirective(l)){let u=this.stmtToDirective(l);e.push(u),!o&&u.value.value==="use strict"&&(o=!0,this.setStrict(!0));continue}c=!0,this.state.strictErrors.clear()}t.push(l)}n?.call(this,o),a||this.setStrict(!1),this.next()}parseFor(t,e){return t.init=e,this.semicolon(!1),t.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),t.update=this.match(11)?null:this.parseExpression(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,"ForStatement")}parseForIn(t,e,s){let i=this.match(58);return this.next(),i?s!==null&&this.unexpected(s):t.await=s!==null,e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!i||!this.options.annexB||this.state.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(m.ForInOfLoopInitializer,e,{type:i?"ForInStatement":"ForOfStatement"}),e.type==="AssignmentPattern"&&this.raise(m.InvalidLhs,e,{ancestor:{type:"ForStatement"}}),t.left=e,t.right=i?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,i?"ForInStatement":"ForOfStatement")}parseVar(t,e,s,i=!1){let n=t.declarations=[];for(t.kind=s;;){let a=this.startNode();if(this.parseVarId(a,s),a.init=this.eat(29)?e?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,a.init===null&&!i&&(a.id.type!=="Identifier"&&!(e&&(this.match(58)||this.isContextual(102)))?this.raise(m.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"}):(s==="const"||s==="using"||s==="await using")&&!(this.match(58)||this.isContextual(102))&&this.raise(m.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:s})),n.push(this.finishNode(a,"VariableDeclarator")),!this.eat(12))break}return t}parseVarId(t,e){let s=this.parseBindingAtom();e==="using"||e==="await using"?(s.type==="ArrayPattern"||s.type==="ObjectPattern")&&this.raise(m.UsingDeclarationHasBindingPattern,s.loc.start):s.type==="VoidPattern"&&this.raise(m.UnexpectedVoidPattern,s.loc.start),this.checkLVal(s,{type:"VariableDeclarator"},e==="var"?5:8201),t.id=s}parseAsyncFunctionExpression(t){return this.parseFunction(t,8)}parseFunction(t,e=0){let s=e&2,i=!!(e&1),n=i&&!(e&4),a=!!(e&8);this.initFunction(t,a),this.match(55)&&(s&&this.raise(m.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),t.generator=!0),i&&(t.id=this.parseFunctionId(n));let o=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(514),this.prodParam.enter(Lr(a,t.generator)),i||(t.id=this.parseFunctionId()),this.parseFunctionParams(t,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(t,i?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),i&&!s&&this.registerFunctionStatementId(t),this.state.maybeInArrowParameters=o,t}parseFunctionId(t){return t||W(this.state.type)?this.parseIdentifier():null}parseFunctionParams(t,e){this.expect(10),this.expressionScope.enter(f0()),t.params=this.parseBindingList(11,41,2|(e?4:0)),this.expressionScope.exit()}registerFunctionStatementId(t){t.id&&this.scope.declareName(t.id.name,!this.options.annexB||this.state.strict||t.generator||t.async?this.scope.treatFunctionsAsVar?5:8201:17,t.id.loc.start)}parseClass(t,e,s){this.next();let i=this.state.strict;return this.state.strict=!0,this.parseClassId(t,e,s),this.parseClassSuper(t),t.body=this.parseClassBody(!!t.superClass,i),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}nameIsConstructor(t){return t.type==="Identifier"&&t.name==="constructor"||t.type==="StringLiteral"&&t.value==="constructor"}isNonstaticConstructor(t){return!t.computed&&!t.static&&this.nameIsConstructor(t.key)}parseClassBody(t,e){this.classScope.enter();let s={hadConstructor:!1,hadSuperClass:t},i=[],n=this.startNode();if(n.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(i.length>0)throw this.raise(m.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(26)){i.push(this.parseDecorator());continue}let a=this.startNode();i.length&&(a.decorators=i,this.resetStartLocationFromNode(a,i[0]),i=[]),this.parseClassMember(n,a,s),a.kind==="constructor"&&a.decorators&&a.decorators.length>0&&this.raise(m.DecoratorConstructor,a)}}),this.state.strict=e,this.next(),i.length)throw this.raise(m.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(n,"ClassBody")}parseClassMemberFromModifier(t,e){let s=this.parseIdentifier(!0);if(this.isClassMethod()){let i=e;return i.kind="method",i.computed=!1,i.key=s,i.static=!1,this.pushClassMethod(t,i,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let i=e;return i.computed=!1,i.key=s,i.static=!1,t.body.push(this.parseClassProperty(i)),!0}return this.resetPreviousNodeTrailingComments(s),!1}parseClassMember(t,e,s){let i=this.isContextual(106);if(i){if(this.parseClassMemberFromModifier(t,e))return;if(this.eat(5)){this.parseClassStaticBlock(t,e);return}}this.parseClassMemberWithIsStatic(t,e,s,i)}parseClassMemberWithIsStatic(t,e,s,i){let n=e,a=e,o=e,c=e,l=e,u=n,h=n;if(e.static=i,this.parsePropertyNamePrefixOperator(e),this.eat(55)){u.kind="method";let x=this.match(139);if(this.parseClassElementName(u),this.parsePostMemberNameModifiers(u),x){this.pushClassPrivateMethod(t,a,!0,!1);return}this.isNonstaticConstructor(n)&&this.raise(m.ConstructorIsGenerator,n.key),this.pushClassMethod(t,n,!0,!1,!1,!1);return}let p=!this.state.containsEsc&&W(this.state.type),f=this.parseClassElementName(e),y=p?f.name:null,d=this.isPrivateName(f),g=this.state.startLoc;if(this.parsePostMemberNameModifiers(h),this.isClassMethod()){if(u.kind="method",d){this.pushClassPrivateMethod(t,a,!1,!1);return}let x=this.isNonstaticConstructor(n),b=!1;x&&(n.kind="constructor",s.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(m.DuplicateConstructor,f),x&&this.hasPlugin("typescript")&&e.override&&this.raise(m.OverrideOnConstructor,f),s.hadConstructor=!0,b=s.hadSuperClass),this.pushClassMethod(t,n,!1,!1,x,b)}else if(this.isClassProperty())d?this.pushClassPrivateProperty(t,c):this.pushClassProperty(t,o);else if(y==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(f);let x=this.eat(55);h.optional&&this.unexpected(g),u.kind="method";let b=this.match(139);this.parseClassElementName(u),this.parsePostMemberNameModifiers(h),b?this.pushClassPrivateMethod(t,a,x,!0):(this.isNonstaticConstructor(n)&&this.raise(m.ConstructorIsAsync,n.key),this.pushClassMethod(t,n,x,!0,!1,!1))}else if((y==="get"||y==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(f),u.kind=y;let x=this.match(139);this.parseClassElementName(n),x?this.pushClassPrivateMethod(t,a,!1,!1):(this.isNonstaticConstructor(n)&&this.raise(m.ConstructorIsAccessor,n.key),this.pushClassMethod(t,n,!1,!1,!1,!1)),this.checkGetterSetterParams(n)}else if(y==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(f);let x=this.match(139);this.parseClassElementName(o),this.pushClassAccessorProperty(t,l,x)}else this.isLineTerminator()?d?this.pushClassPrivateProperty(t,c):this.pushClassProperty(t,o):this.unexpected()}parseClassElementName(t){let{type:e,value:s}=this.state;if((e===132||e===134)&&t.static&&s==="prototype"&&this.raise(m.StaticPrototype,this.state.startLoc),e===139){s==="constructor"&&this.raise(m.ConstructorClassPrivateField,this.state.startLoc);let i=this.parsePrivateName();return t.key=i,i}return this.parsePropertyName(t),t.key}parseClassStaticBlock(t,e){var s;this.scope.enter(720);let i=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let n=e.body=[];this.parseBlockOrModuleBlockBody(n,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=i,t.body.push(this.finishNode(e,"StaticBlock")),(s=e.decorators)!=null&&s.length&&this.raise(m.DecoratorStaticBlock,e)}pushClassProperty(t,e){!e.computed&&this.nameIsConstructor(e.key)&&this.raise(m.ConstructorClassField,e.key),t.body.push(this.parseClassProperty(e))}pushClassPrivateProperty(t,e){let s=this.parseClassPrivateProperty(e);t.body.push(s),this.classScope.declarePrivateName(this.getPrivateNameSV(s.key),0,s.key.loc.start)}pushClassAccessorProperty(t,e,s){!s&&!e.computed&&this.nameIsConstructor(e.key)&&this.raise(m.ConstructorClassField,e.key);let i=this.parseClassAccessorProperty(e);t.body.push(i),s&&this.classScope.declarePrivateName(this.getPrivateNameSV(i.key),0,i.key.loc.start)}pushClassMethod(t,e,s,i,n,a){t.body.push(this.parseMethod(e,s,i,n,a,"ClassMethod",!0))}pushClassPrivateMethod(t,e,s,i){let n=this.parseMethod(e,s,i,!1,!1,"ClassPrivateMethod",!0);t.body.push(n);let a=n.kind==="get"?n.static?6:2:n.kind==="set"?n.static?5:1:0;this.declareClassPrivateMethodInScope(n,a)}declareClassPrivateMethodInScope(t,e){this.classScope.declarePrivateName(this.getPrivateNameSV(t.key),e,t.key.loc.start)}parsePostMemberNameModifiers(t){}parseClassPrivateProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassPrivateProperty")}parseClassProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassProperty")}parseClassAccessorProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassAccessorProperty")}parseInitializer(t){this.scope.enter(592),this.expressionScope.enter(cp()),this.prodParam.enter(0),t.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(t,e,s,i=8331){if(W(this.state.type))t.id=this.parseIdentifier(),e&&this.declareNameFromIdentifier(t.id,i);else if(s||!e)t.id=null;else throw this.raise(m.MissingClassName,this.state.startLoc)}parseClassSuper(t){t.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(t,e){let s=this.parseMaybeImportPhase(t,!0),i=this.maybeParseExportDefaultSpecifier(t,s),n=!i||this.eat(12),a=n&&this.eatExportStar(t),o=a&&this.maybeParseExportNamespaceSpecifier(t),c=n&&(!o||this.eat(12)),l=i||a;if(a&&!o){if(i&&this.unexpected(),e)throw this.raise(m.UnsupportedDecoratorExport,t);return this.parseExportFrom(t,!0),this.sawUnambiguousESM=!0,this.finishNode(t,"ExportAllDeclaration")}let u=this.maybeParseExportNamedSpecifiers(t);i&&n&&!a&&!u&&this.unexpected(null,5),o&&c&&this.unexpected(null,98);let h;if(l||u){if(h=!1,e)throw this.raise(m.UnsupportedDecoratorExport,t);this.parseExportFrom(t,l)}else h=this.maybeParseExportDeclaration(t);if(l||u||h){var p;let f=t;if(this.checkExport(f,!0,!1,!!f.source),((p=f.declaration)==null?void 0:p.type)==="ClassDeclaration")this.maybeTakeDecorators(e,f.declaration,f);else if(e)throw this.raise(m.UnsupportedDecoratorExport,t);return this.sawUnambiguousESM=!0,this.finishNode(f,"ExportNamedDeclaration")}if(this.eat(65)){let f=t,y=this.parseExportDefaultExpression();if(f.declaration=y,y.type==="ClassDeclaration")this.maybeTakeDecorators(e,y,f);else if(e)throw this.raise(m.UnsupportedDecoratorExport,t);return this.checkExport(f,!0,!0),this.sawUnambiguousESM=!0,this.finishNode(f,"ExportDefaultDeclaration")}throw this.unexpected(null,5)}eatExportStar(t){return this.eat(55)}maybeParseExportDefaultSpecifier(t,e){if(e||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",e?.loc.start);let s=e||this.parseIdentifier(!0),i=this.startNodeAtNode(s);return i.exported=s,t.specifiers=[this.finishNode(i,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(t){if(this.isContextual(93)){var e,s;(s=(e=t).specifiers)!=null||(e.specifiers=[]);let i=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),i.exported=this.parseModuleExportName(),t.specifiers.push(this.finishNode(i,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(t){if(this.match(5)){let e=t;e.specifiers||(e.specifiers=[]);let s=e.exportKind==="type";return e.specifiers.push(...this.parseExportSpecifiers(s)),e.source=null,this.hasPlugin("importAssertions")?e.assertions=[]:e.attributes=[],e.declaration=null,!0}return!1}maybeParseExportDeclaration(t){return this.shouldParseExportDeclaration()?(t.specifiers=[],t.source=null,this.hasPlugin("importAssertions")?t.assertions=[]:t.attributes=[],t.declaration=this.parseExportDeclaration(t),!0):!1}isAsyncFunction(){if(!this.isContextual(95))return!1;let t=this.nextTokenInLineStart();return this.isUnparsedContextual(t,"function")}parseExportDefaultExpression(){let t=this.startNode();if(this.match(68))return this.next(),this.parseFunction(t,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(t,13);if(this.match(80))return this.parseClass(t,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(m.DecoratorBeforeExport,this.state.startLoc),this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(75)||this.match(74)||this.isLet()||this.isUsing()||this.isAwaitUsing())throw this.raise(m.UnsupportedDefaultExport,this.state.startLoc);let e=this.parseMaybeAssignAllowIn();return this.semicolon(),e}parseExportDeclaration(t){return this.match(80)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:t}=this.state;if(W(t)){if(t===95&&!this.state.containsEsc||t===100)return!1;if((t===130||t===129)&&!this.state.containsEsc){let i=this.nextTokenStart(),n=this.input.charCodeAt(i);if(n===123||this.chStartsBindingIdentifier(n,i)&&!this.input.startsWith("from",i))return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;let e=this.nextTokenStart(),s=this.isUnparsedContextual(e,"from");if(this.input.charCodeAt(e)===44||W(this.state.type)&&s)return!0;if(this.match(65)&&s){let i=this.input.charCodeAt(this.nextTokenStartSince(e+4));return i===34||i===39}return!1}parseExportFrom(t,e){this.eatContextual(98)?(t.source=this.parseImportSource(),this.checkExport(t),this.maybeParseImportAttributes(t),this.checkJSONModuleImport(t)):e&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:t}=this.state;return t===26&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?(this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(m.DecoratorBeforeExport,this.state.startLoc),!0):this.isUsing()?(this.raise(m.UsingDeclarationExport,this.state.startLoc),!0):this.isAwaitUsing()?(this.raise(m.UsingDeclarationExport,this.state.startLoc),!0):t===74||t===75||t===68||t===80||this.isLet()||this.isAsyncFunction()}checkExport(t,e,s,i){if(e){var n;if(s){if(this.checkDuplicateExports(t,"default"),this.hasPlugin("exportDefaultFrom")){var a;let o=t.declaration;o.type==="Identifier"&&o.name==="from"&&o.end-o.start===4&&!((a=o.extra)!=null&&a.parenthesized)&&this.raise(m.ExportDefaultFromAsIdentifier,o)}}else if((n=t.specifiers)!=null&&n.length)for(let o of t.specifiers){let{exported:c}=o,l=c.type==="Identifier"?c.name:c.value;if(this.checkDuplicateExports(o,l),!i&&o.local){let{local:u}=o;u.type!=="Identifier"?this.raise(m.ExportBindingIsString,o,{localName:u.value,exportName:l}):(this.checkReservedWord(u.name,u.loc.start,!0,!1),this.scope.checkLocalExport(u))}}else if(t.declaration){let o=t.declaration;if(o.type==="FunctionDeclaration"||o.type==="ClassDeclaration"){let{id:c}=o;if(!c)throw new Error("Assertion failure");this.checkDuplicateExports(t,c.name)}else if(o.type==="VariableDeclaration")for(let c of o.declarations)this.checkDeclaration(c.id)}}}checkDeclaration(t){if(t.type==="Identifier")this.checkDuplicateExports(t,t.name);else if(t.type==="ObjectPattern")for(let e of t.properties)this.checkDeclaration(e);else if(t.type==="ArrayPattern")for(let e of t.elements)e&&this.checkDeclaration(e);else t.type==="ObjectProperty"?this.checkDeclaration(t.value):t.type==="RestElement"?this.checkDeclaration(t.argument):t.type==="AssignmentPattern"&&this.checkDeclaration(t.left)}checkDuplicateExports(t,e){this.exportedIdentifiers.has(e)&&(e==="default"?this.raise(m.DuplicateDefaultExport,t):this.raise(m.DuplicateExport,t,{exportName:e})),this.exportedIdentifiers.add(e)}parseExportSpecifiers(t){let e=[],s=!0;for(this.expect(5);!this.eat(8);){if(s)s=!1;else if(this.expect(12),this.eat(8))break;let i=this.isContextual(130),n=this.match(134),a=this.startNode();a.local=this.parseModuleExportName(),e.push(this.parseExportSpecifier(a,n,t,i))}return e}parseExportSpecifier(t,e,s,i){return this.eatContextual(93)?t.exported=this.parseModuleExportName():e?t.exported=this.cloneStringLiteral(t.local):t.exported||(t.exported=this.cloneIdentifier(t.local)),this.finishNode(t,"ExportSpecifier")}parseModuleExportName(){if(this.match(134)){let t=this.parseStringLiteral(this.state.value),e=E0.exec(t.value);return e&&this.raise(m.ModuleExportNameHasLoneSurrogate,t,{surrogateCharCode:e[0].charCodeAt(0)}),t}return this.parseIdentifier(!0)}isJSONModuleImport(t){return t.assertions!=null?t.assertions.some(({key:e,value:s})=>s.value==="json"&&(e.type==="Identifier"?e.name==="type":e.value==="type")):!1}checkImportReflection(t){let{specifiers:e}=t,s=e.length===1?e[0].type:null;if(t.phase==="source")s!=="ImportDefaultSpecifier"&&this.raise(m.SourcePhaseImportRequiresDefault,e[0].loc.start);else if(t.phase==="defer")s!=="ImportNamespaceSpecifier"&&this.raise(m.DeferImportRequiresNamespace,e[0].loc.start);else if(t.module){var i;s!=="ImportDefaultSpecifier"&&this.raise(m.ImportReflectionNotBinding,e[0].loc.start),((i=t.assertions)==null?void 0:i.length)>0&&this.raise(m.ImportReflectionHasAssertion,e[0].loc.start)}}checkJSONModuleImport(t){if(this.isJSONModuleImport(t)&&t.type!=="ExportAllDeclaration"){let{specifiers:e}=t;if(e!=null){let s=e.find(i=>{let n;if(i.type==="ExportSpecifier"?n=i.local:i.type==="ImportSpecifier"&&(n=i.imported),n!==void 0)return n.type==="Identifier"?n.name!=="default":n.value!=="default"});s!==void 0&&this.raise(m.ImportJSONBindingNotDefault,s.loc.start)}}}isPotentialImportPhase(t){return t?!1:this.isContextual(105)||this.isContextual(97)||this.isContextual(127)}applyImportPhase(t,e,s,i){e||(s==="module"?(this.expectPlugin("importReflection",i),t.module=!0):this.hasPlugin("importReflection")&&(t.module=!1),s==="source"?(this.expectPlugin("sourcePhaseImports",i),t.phase="source"):s==="defer"?(this.expectPlugin("deferredImportEvaluation",i),t.phase="defer"):this.hasPlugin("sourcePhaseImports")&&(t.phase=null))}parseMaybeImportPhase(t,e){if(!this.isPotentialImportPhase(e))return this.applyImportPhase(t,e,null),null;let s=this.startNode(),i=this.parseIdentifierName(!0),{type:n}=this.state;return(Ie(n)?n!==98||this.lookaheadCharCode()===102:n!==12)?(this.applyImportPhase(t,e,i,s.loc.start),null):(this.applyImportPhase(t,e,null),this.createIdentifier(s,i))}isPrecedingIdImportPhase(t){let{type:e}=this.state;return W(e)?e!==98||this.lookaheadCharCode()===102:e!==12}parseImport(t){return this.match(134)?this.parseImportSourceAndAttributes(t):this.parseImportSpecifiersAndAfter(t,this.parseMaybeImportPhase(t,!1))}parseImportSpecifiersAndAfter(t,e){t.specifiers=[];let i=!this.maybeParseDefaultImportSpecifier(t,e)||this.eat(12),n=i&&this.maybeParseStarImportSpecifier(t);return i&&!n&&this.parseNamedImportSpecifiers(t),this.expectContextual(98),this.parseImportSourceAndAttributes(t)}parseImportSourceAndAttributes(t){var e;return(e=t.specifiers)!=null||(t.specifiers=[]),t.source=this.parseImportSource(),this.maybeParseImportAttributes(t),this.checkImportReflection(t),this.checkJSONModuleImport(t),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(t,"ImportDeclaration")}parseImportSource(){return this.match(134)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(t,e,s){e.local=this.parseIdentifier(),t.specifiers.push(this.finishImportSpecifier(e,s))}finishImportSpecifier(t,e,s=8201){return this.checkLVal(t.local,{type:e},s),this.finishNode(t,e)}parseImportAttributes(){this.expect(5);let t=[],e=new Set;do{if(this.match(8))break;let s=this.startNode(),i=this.state.value;if(e.has(i)&&this.raise(m.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:i}),e.add(i),this.match(134)?s.key=this.parseStringLiteral(i):s.key=this.parseIdentifier(!0),this.expect(14),!this.match(134))throw this.raise(m.ModuleAttributeInvalidValue,this.state.startLoc);s.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return this.expect(8),t}parseModuleAttributes(){let t=[],e=new Set;do{let s=this.startNode();if(s.key=this.parseIdentifier(!0),s.key.name!=="type"&&this.raise(m.ModuleAttributeDifferentFromType,s.key),e.has(s.key.name)&&this.raise(m.ModuleAttributesWithDuplicateKeys,s.key,{key:s.key.name}),e.add(s.key.name),this.expect(14),!this.match(134))throw this.raise(m.ModuleAttributeInvalidValue,this.state.startLoc);s.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return t}maybeParseImportAttributes(t){let e;var s=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),this.hasPlugin("moduleAttributes")?(e=this.parseModuleAttributes(),this.addExtra(t,"deprecatedWithLegacySyntax",!0)):e=this.parseImportAttributes(),s=!0}else this.isContextual(94)&&!this.hasPrecedingLineBreak()?(!this.hasPlugin("deprecatedImportAssert")&&!this.hasPlugin("importAssertions")&&this.raise(m.ImportAttributesUseAssert,this.state.startLoc),this.hasPlugin("importAssertions")||this.addExtra(t,"deprecatedAssertSyntax",!0),this.next(),e=this.parseImportAttributes()):e=[];!s&&this.hasPlugin("importAssertions")?t.assertions=e:t.attributes=e}maybeParseDefaultImportSpecifier(t,e){if(e){let s=this.startNodeAtNode(e);return s.local=e,t.specifiers.push(this.finishImportSpecifier(s,"ImportDefaultSpecifier")),!0}else if(Ie(this.state.type))return this.parseImportSpecifierLocal(t,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(t){if(this.match(55)){let e=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(t,e,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(t){let e=!0;for(this.expect(5);!this.eat(8);){if(e)e=!1;else{if(this.eat(14))throw this.raise(m.DestructureNamedImport,this.state.startLoc);if(this.expect(12),this.eat(8))break}let s=this.startNode(),i=this.match(134),n=this.isContextual(130);s.imported=this.parseModuleExportName();let a=this.parseImportSpecifier(s,i,t.importKind==="type"||t.importKind==="typeof",n,void 0);t.specifiers.push(a)}}parseImportSpecifier(t,e,s,i,n){if(this.eatContextual(93))t.local=this.parseIdentifier();else{let{imported:a}=t;if(e)throw this.raise(m.ImportBindingIsString,t,{importName:a.value});this.checkReservedWord(a.name,t.loc.start,!0,!0),t.local||(t.local=this.cloneIdentifier(a))}return this.finishImportSpecifier(t,"ImportSpecifier",n)}isThisParam(t){return t.type==="Identifier"&&t.name==="this"}},Fr=class extends vo{constructor(t,e,s){let i=kb(t);super(i,e),this.options=i,this.initializeScopes(),this.plugins=s,this.filename=i.sourceFilename,this.startIndex=i.startIndex;let n=0;i.allowAwaitOutsideFunction&&(n|=1),i.allowReturnOutsideFunction&&(n|=2),i.allowImportExportEverywhere&&(n|=8),i.allowSuperOutsideMethod&&(n|=16),i.allowUndeclaredExports&&(n|=64),i.allowNewTargetOutsideFunction&&(n|=4),i.allowYieldOutsideFunction&&(n|=32),i.ranges&&(n|=128),i.tokens&&(n|=256),i.createImportExpressions&&(n|=512),i.createParenthesizedExpressions&&(n|=1024),i.errorRecovery&&(n|=2048),i.attachComment&&(n|=4096),i.annexB&&(n|=8192),this.optionFlags=n}getScopeHandler(){return ui}parse(){this.enterInitialScopes();let t=this.startNode(),e=this.startNode();this.nextToken(),t.errors=null;let s=this.parseTopLevel(t,e);return s.errors=this.state.errors,s.comments.length=this.state.commentsLen,s}};function I0(r,t){var e;if(((e=t)==null?void 0:e.sourceType)==="unambiguous"){t=Object.assign({},t);try{t.sourceType="module";let s=oi(t,r),i=s.parse();if(s.sawUnambiguousESM)return i;if(s.ambiguousScriptDifferentAst)try{return t.sourceType="script",oi(t,r).parse()}catch{}else i.program.sourceType="script";return i}catch(s){try{return t.sourceType="script",oi(t,r).parse()}catch{}throw s}}else return oi(t,r).parse()}function _0(r,t){let e=oi(t,r);return e.options.strictMode&&(e.state.strict=!0),e.getExpression()}function O0(r){let t={};for(let e of Object.keys(r))t[e]=Ye(r[e]);return t}var L0=O0(_b);function oi(r,t){let e=Fr,s=new Map;if(r!=null&&r.plugins){for(let i of r.plugins){let n,a;typeof i=="string"?n=i:[n,a]=i,s.has(n)||s.set(n,a||{})}v0(s),e=M0(s)}return new e(r,t,s)}var Zh=new Map;function M0(r){let t=[];for(let i of C0)r.has(i)&&t.push(i);let e=t.join("|"),s=Zh.get(e);if(!s){s=Fr;for(let i of t)s=hp[i](s);Zh.set(e,s)}return s}pi.parse=I0;pi.parseExpression=_0;pi.tokTypes=L0});var ec=require("fs/promises"),G=Ts(require("process"),1),cf=require("readline/promises");var Ec=Ts(kc(),1),{program:y1,createCommand:g1,createArgument:x1,createOption:b1,CommanderError:w1,InvalidArgumentError:hn,InvalidOptionArgumentError:P1,Command:Nc,Argument:T1,Option:S1,Help:A1}=Ec.default;function _c(r,t){return r==="assertion_failure"&&t==="pass"?"proven":r==="pass"&&t==="pass"?"not_proven":r==="assertion_failure"&&t==="assertion_failure"?"still_failing":"inconclusive"}var Ic={proven:0,not_proven:1,still_failing:2,inconclusive:3};function Oc(r,t){return t==="regression"?"regression":t==="inconclusive"?"inconclusive":r.length?r.reduce((e,s)=>Ic[s]>Ic[e]?s:e):"no_tests"}function Lc(r){return r==="proven"?0:["not_proven","still_failing","no_tests","regression"].includes(r)?1:r==="error"?2:3}function Mc(r,t){return r==="pass"&&t==="pass"?"healthy":r==="pass"&&t==="assertion_failure"?"regression":r==="assertion_failure"&&t==="pass"?"improved":r==="assertion_failure"&&t==="assertion_failure"?"pre_existing_failure":"inconclusive"}var kr=require("fs/promises"),pt=require("path"),Rh=Ts(Sh(),1);var J={};df(J,{BRAND:()=>Nx,DIRTY:()=>At,EMPTY_PATH:()=>ox,INVALID:()=>M,NEVER:()=>fb,OK:()=>ne,ParseStatus:()=>ie,Schema:()=>F,ZodAny:()=>ut,ZodArray:()=>Je,ZodBigInt:()=>Ct,ZodBoolean:()=>kt,ZodBranded:()=>ti,ZodCatch:()=>$t,ZodDate:()=>Et,ZodDefault:()=>Ft,ZodDiscriminatedUnion:()=>Ar,ZodEffects:()=>Ae,ZodEnum:()=>Dt,ZodError:()=>pe,ZodFirstPartyTypeKind:()=>D,ZodFunction:()=>Cr,ZodIntersection:()=>Ot,ZodIssueCode:()=>w,ZodLazy:()=>Lt,ZodLiteral:()=>Mt,ZodMap:()=>cs,ZodNaN:()=>us,ZodNativeEnum:()=>Rt,ZodNever:()=>Ee,ZodNull:()=>It,ZodNullable:()=>Re,ZodNumber:()=>vt,ZodObject:()=>fe,ZodOptional:()=>Te,ZodParsedType:()=>C,ZodPipeline:()=>si,ZodPromise:()=>ht,ZodReadonly:()=>jt,ZodRecord:()=>vr,ZodSchema:()=>F,ZodSet:()=>ls,ZodString:()=>lt,ZodSymbol:()=>as,ZodTransformer:()=>Ae,ZodTuple:()=>De,ZodType:()=>F,ZodUndefined:()=>Nt,ZodUnion:()=>_t,ZodUnknown:()=>Ge,ZodVoid:()=>os,addIssueToContext:()=>A,any:()=>$x,array:()=>Ux,bigint:()=>Lx,boolean:()=>Mh,coerce:()=>pb,custom:()=>_h,date:()=>Mx,datetimeRegex:()=>Nh,defaultErrorMap:()=>We,discriminatedUnion:()=>Wx,effect:()=>rb,enum:()=>tb,function:()=>Xx,getErrorMap:()=>is,getParsedType:()=>Me,instanceof:()=>_x,intersection:()=>zx,isAborted:()=>Tr,isAsync:()=>rs,isDirty:()=>Sr,isValid:()=>ct,late:()=>Ix,lazy:()=>Qx,literal:()=>eb,makeIssue:()=>ei,map:()=>Yx,nan:()=>Ox,nativeEnum:()=>sb,never:()=>Bx,null:()=>Fx,nullable:()=>ab,number:()=>Lh,object:()=>Vx,objectUtil:()=>Wa,oboolean:()=>hb,onumber:()=>ub,optional:()=>nb,ostring:()=>lb,pipeline:()=>cb,preprocess:()=>ob,promise:()=>ib,quotelessJson:()=>rx,record:()=>Jx,set:()=>Zx,setErrorMap:()=>ax,strictObject:()=>Hx,string:()=>Oh,symbol:()=>Dx,transformer:()=>rb,tuple:()=>Gx,undefined:()=>Rx,union:()=>Kx,unknown:()=>jx,util:()=>B,void:()=>qx});var B;(function(r){r.assertEqual=i=>{};function t(i){}r.assertIs=t;function e(i){throw new Error}r.assertNever=e,r.arrayToEnum=i=>{let n={};for(let a of i)n[a]=a;return n},r.getValidEnumValues=i=>{let n=r.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),a={};for(let o of n)a[o]=i[o];return r.objectValues(a)},r.objectValues=i=>r.objectKeys(i).map(function(n){return i[n]}),r.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let n=[];for(let a in i)Object.prototype.hasOwnProperty.call(i,a)&&n.push(a);return n},r.find=(i,n)=>{for(let a of i)if(n(a))return a},r.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function s(i,n=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(n)}r.joinValues=s,r.jsonStringifyReplacer=(i,n)=>typeof n=="bigint"?n.toString():n})(B||(B={}));var Wa;(function(r){r.mergeShapes=(t,e)=>({...t,...e})})(Wa||(Wa={}));var C=B.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Me=r=>{switch(typeof r){case"undefined":return C.undefined;case"string":return C.string;case"number":return Number.isNaN(r)?C.nan:C.number;case"boolean":return C.boolean;case"function":return C.function;case"bigint":return C.bigint;case"symbol":return C.symbol;case"object":return Array.isArray(r)?C.array:r===null?C.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?C.promise:typeof Map<"u"&&r instanceof Map?C.map:typeof Set<"u"&&r instanceof Set?C.set:typeof Date<"u"&&r instanceof Date?C.date:C.object;default:return C.unknown}};var w=B.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),rx=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),pe=class r extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};let e=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,e):this.__proto__=e,this.name="ZodError",this.issues=t}format(t){let e=t||function(n){return n.message},s={_errors:[]},i=n=>{for(let a of n.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)s._errors.push(e(a));else{let o=s,c=0;for(;c<a.path.length;){let l=a.path[c];c===a.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(e(a))):o[l]=o[l]||{_errors:[]},o=o[l],c++}}};return i(this),s}static assert(t){if(!(t instanceof r))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,B.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=e=>e.message){let e={},s=[];for(let i of this.issues)if(i.path.length>0){let n=i.path[0];e[n]=e[n]||[],e[n].push(t(i))}else s.push(t(i));return{formErrors:s,fieldErrors:e}}get formErrors(){return this.flatten()}};pe.create=r=>new pe(r);var nx=(r,t)=>{let e;switch(r.code){case w.invalid_type:r.received===C.undefined?e="Required":e=`Expected ${r.expected}, received ${r.received}`;break;case w.invalid_literal:e=`Invalid literal value, expected ${JSON.stringify(r.expected,B.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:e=`Unrecognized key(s) in object: ${B.joinValues(r.keys,", ")}`;break;case w.invalid_union:e="Invalid input";break;case w.invalid_union_discriminator:e=`Invalid discriminator value. Expected ${B.joinValues(r.options)}`;break;case w.invalid_enum_value:e=`Invalid enum value. Expected ${B.joinValues(r.options)}, received '${r.received}'`;break;case w.invalid_arguments:e="Invalid function arguments";break;case w.invalid_return_type:e="Invalid function return type";break;case w.invalid_date:e="Invalid date";break;case w.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(e=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(e=`${e} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?e=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?e=`Invalid input: must end with "${r.validation.endsWith}"`:B.assertNever(r.validation):r.validation!=="regex"?e=`Invalid ${r.validation}`:e="Invalid";break;case w.too_small:r.type==="array"?e=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?e=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?e=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="bigint"?e=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?e=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:e="Invalid input";break;case w.too_big:r.type==="array"?e=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?e=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?e=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?e=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?e=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:e="Invalid input";break;case w.custom:e="Invalid input";break;case w.invalid_intersection_types:e="Intersection results could not be merged";break;case w.not_multiple_of:e=`Number must be a multiple of ${r.multipleOf}`;break;case w.not_finite:e="Number must be finite";break;default:e=t.defaultError,B.assertNever(r)}return{message:e}},We=nx;var Ah=We;function ax(r){Ah=r}function is(){return Ah}var ei=r=>{let{data:t,path:e,errorMaps:s,issueData:i}=r,n=[...e,...i.path||[]],a={...i,path:n};if(i.message!==void 0)return{...i,path:n,message:i.message};let o="",c=s.filter(l=>!!l).slice().reverse();for(let l of c)o=l(a,{data:t,defaultError:o}).message;return{...i,path:n,message:o}},ox=[];function A(r,t){let e=is(),s=ei({issueData:t,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,e,e===We?void 0:We].filter(i=>!!i)});r.common.issues.push(s)}var ie=class r{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,e){let s=[];for(let i of e){if(i.status==="aborted")return M;i.status==="dirty"&&t.dirty(),s.push(i.value)}return{status:t.value,value:s}}static async mergeObjectAsync(t,e){let s=[];for(let i of e){let n=await i.key,a=await i.value;s.push({key:n,value:a})}return r.mergeObjectSync(t,s)}static mergeObjectSync(t,e){let s={};for(let i of e){let{key:n,value:a}=i;if(n.status==="aborted"||a.status==="aborted")return M;n.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),n.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(s[n.value]=a.value)}return{status:t.value,value:s}}},M=Object.freeze({status:"aborted"}),At=r=>({status:"dirty",value:r}),ne=r=>({status:"valid",value:r}),Tr=r=>r.status==="aborted",Sr=r=>r.status==="dirty",ct=r=>r.status==="valid",rs=r=>typeof Promise<"u"&&r instanceof Promise;var I;(function(r){r.errToObj=t=>typeof t=="string"?{message:t}:t||{},r.toString=t=>typeof t=="string"?t:t?.message})(I||(I={}));var Se=class{constructor(t,e,s,i){this._cachedPath=[],this.parent=t,this.data=e,this._path=s,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},vh=(r,t)=>{if(ct(t))return{success:!0,data:t.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let e=new pe(r.common.issues);return this._error=e,this._error}}};function R(r){if(!r)return{};let{errorMap:t,invalid_type_error:e,required_error:s,description:i}=r;if(t&&(e||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,o)=>{let{message:c}=r;return a.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:c??s??o.defaultError}:a.code!=="invalid_type"?{message:o.defaultError}:{message:c??e??o.defaultError}},description:i}}var F=class{get description(){return this._def.description}_getType(t){return Me(t.data)}_getOrReturnCtx(t,e){return e||{common:t.parent.common,data:t.data,parsedType:Me(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ie,ctx:{common:t.parent.common,data:t.data,parsedType:Me(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let e=this._parse(t);if(rs(e))throw new Error("Synchronous parse encountered promise.");return e}_parseAsync(t){let e=this._parse(t);return Promise.resolve(e)}parse(t,e){let s=this.safeParse(t,e);if(s.success)return s.data;throw s.error}safeParse(t,e){let s={common:{issues:[],async:e?.async??!1,contextualErrorMap:e?.errorMap},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Me(t)},i=this._parseSync({data:t,path:s.path,parent:s});return vh(s,i)}"~validate"(t){let e={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Me(t)};if(!this["~standard"].async)try{let s=this._parseSync({data:t,path:[],parent:e});return ct(s)?{value:s.value}:{issues:e.common.issues}}catch(s){s?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),e.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:e}).then(s=>ct(s)?{value:s.value}:{issues:e.common.issues})}async parseAsync(t,e){let s=await this.safeParseAsync(t,e);if(s.success)return s.data;throw s.error}async safeParseAsync(t,e){let s={common:{issues:[],contextualErrorMap:e?.errorMap,async:!0},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Me(t)},i=this._parse({data:t,path:s.path,parent:s}),n=await(rs(i)?i:Promise.resolve(i));return vh(s,n)}refine(t,e){let s=i=>typeof e=="string"||typeof e>"u"?{message:e}:typeof e=="function"?e(i):e;return this._refinement((i,n)=>{let a=t(i),o=()=>n.addIssue({code:w.custom,...s(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(t,e){return this._refinement((s,i)=>t(s)?!0:(i.addIssue(typeof e=="function"?e(s,i):e),!1))}_refinement(t){return new Ae({schema:this,typeName:D.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return Te.create(this,this._def)}nullable(){return Re.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Je.create(this)}promise(){return ht.create(this,this._def)}or(t){return _t.create([this,t],this._def)}and(t){return Ot.create(this,t,this._def)}transform(t){return new Ae({...R(this._def),schema:this,typeName:D.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let e=typeof t=="function"?t:()=>t;return new Ft({...R(this._def),innerType:this,defaultValue:e,typeName:D.ZodDefault})}brand(){return new ti({typeName:D.ZodBranded,type:this,...R(this._def)})}catch(t){let e=typeof t=="function"?t:()=>t;return new $t({...R(this._def),innerType:this,catchValue:e,typeName:D.ZodCatch})}describe(t){let e=this.constructor;return new e({...this._def,description:t})}pipe(t){return si.create(this,t)}readonly(){return jt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},cx=/^c[^\s-]{8,}$/i,lx=/^[0-9a-z]+$/,ux=/^[0-9A-HJKMNP-TV-Z]{26}$/i,hx=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,px=/^[a-z0-9_-]{21}$/i,fx=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,dx=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,mx=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,yx="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",za,gx=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,xx=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,bx=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,wx=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Px=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Tx=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,kh="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Sx=new RegExp(`^${kh}$`);function Eh(r){let t="[0-5]\\d";r.precision?t=`${t}\\.\\d{${r.precision}}`:r.precision==null&&(t=`${t}(\\.\\d+)?`);let e=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e}`}function Ax(r){return new RegExp(`^${Eh(r)}$`)}function Nh(r){let t=`${kh}T${Eh(r)}`,e=[];return e.push(r.local?"Z?":"Z"),r.offset&&e.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${e.join("|")})`,new RegExp(`^${t}$`)}function vx(r,t){return!!((t==="v4"||!t)&&gx.test(r)||(t==="v6"||!t)&&bx.test(r))}function Cx(r,t){if(!fx.test(r))return!1;try{let[e]=r.split(".");if(!e)return!1;let s=e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(4-e.length%4)%4,"="),i=JSON.parse(atob(s));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function kx(r,t){return!!((t==="v4"||!t)&&xx.test(r)||(t==="v6"||!t)&&wx.test(r))}var lt=class r extends F{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==C.string){let n=this._getOrReturnCtx(t);return A(n,{code:w.invalid_type,expected:C.string,received:n.parsedType}),M}let s=new ie,i;for(let n of this._def.checks)if(n.kind==="min")t.data.length<n.value&&(i=this._getOrReturnCtx(t,i),A(i,{code:w.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),s.dirty());else if(n.kind==="max")t.data.length>n.value&&(i=this._getOrReturnCtx(t,i),A(i,{code:w.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),s.dirty());else if(n.kind==="length"){let a=t.data.length>n.value,o=t.data.length<n.value;(a||o)&&(i=this._getOrReturnCtx(t,i),a?A(i,{code:w.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):o&&A(i,{code:w.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),s.dirty())}else if(n.kind==="email")mx.test(t.data)||(i=this._getOrReturnCtx(t,i),A(i,{validation:"email",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="emoji")za||(za=new RegExp(yx,"u")),za.test(t.data)||(i=this._getOrReturnCtx(t,i),A(i,{validation:"emoji",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="uuid")hx.test(t.data)||(i=this._getOrReturnCtx(t,i),A(i,{validation:"uuid",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="nanoid")px.test(t.data)||(i=this._getOrReturnCtx(t,i),A(i,{validation:"nanoid",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid")cx.test(t.data)||(i=this._getOrReturnCtx(t,i),A(i,{validation:"cuid",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid2")lx.test(t.data)||(i=this._getOrReturnCtx(t,i),A(i,{validation:"cuid2",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="ulid")ux.test(t.data)||(i=this._getOrReturnCtx(t,i),A(i,{validation:"ulid",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),A(i,{validation:"url",code:w.invalid_string,message:n.message}),s.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),A(i,{validation:"regex",code:w.invalid_string,message:n.message}),s.dirty())):n.kind==="trim"?t.data=t.data.trim():n.kind==="includes"?t.data.includes(n.value,n.position)||(i=this._getOrReturnCtx(t,i),A(i,{code:w.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),s.dirty()):n.kind==="toLowerCase"?t.data=t.data.toLowerCase():n.kind==="toUpperCase"?t.data=t.data.toUpperCase():n.kind==="startsWith"?t.data.startsWith(n.value)||(i=this._getOrReturnCtx(t,i),A(i,{code:w.invalid_string,validation:{startsWith:n.value},message:n.message}),s.dirty()):n.kind==="endsWith"?t.data.endsWith(n.value)||(i=this._getOrReturnCtx(t,i),A(i,{code:w.invalid_string,validation:{endsWith:n.value},message:n.message}),s.dirty()):n.kind==="datetime"?Nh(n).test(t.data)||(i=this._getOrReturnCtx(t,i),A(i,{code:w.invalid_string,validation:"datetime",message:n.message}),s.dirty()):n.kind==="date"?Sx.test(t.data)||(i=this._getOrReturnCtx(t,i),A(i,{code:w.invalid_string,validation:"date",message:n.message}),s.dirty()):n.kind==="time"?Ax(n).test(t.data)||(i=this._getOrReturnCtx(t,i),A(i,{code:w.invalid_string,validation:"time",message:n.message}),s.dirty()):n.kind==="duration"?dx.test(t.data)||(i=this._getOrReturnCtx(t,i),A(i,{validation:"duration",code:w.invalid_string,message:n.message}),s.dirty()):n.kind==="ip"?vx(t.data,n.version)||(i=this._getOrReturnCtx(t,i),A(i,{validation:"ip",code:w.invalid_string,message:n.message}),s.dirty()):n.kind==="jwt"?Cx(t.data,n.alg)||(i=this._getOrReturnCtx(t,i),A(i,{validation:"jwt",code:w.invalid_string,message:n.message}),s.dirty()):n.kind==="cidr"?kx(t.data,n.version)||(i=this._getOrReturnCtx(t,i),A(i,{validation:"cidr",code:w.invalid_string,message:n.message}),s.dirty()):n.kind==="base64"?Px.test(t.data)||(i=this._getOrReturnCtx(t,i),A(i,{validation:"base64",code:w.invalid_string,message:n.message}),s.dirty()):n.kind==="base64url"?Tx.test(t.data)||(i=this._getOrReturnCtx(t,i),A(i,{validation:"base64url",code:w.invalid_string,message:n.message}),s.dirty()):B.assertNever(n);return{status:s.value,value:t.data}}_regex(t,e,s){return this.refinement(i=>t.test(i),{validation:e,code:w.invalid_string,...I.errToObj(s)})}_addCheck(t){return new r({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...I.errToObj(t)})}url(t){return this._addCheck({kind:"url",...I.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...I.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...I.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...I.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...I.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...I.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...I.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...I.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...I.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...I.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...I.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...I.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...I.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...I.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...I.errToObj(t)})}regex(t,e){return this._addCheck({kind:"regex",regex:t,...I.errToObj(e)})}includes(t,e){return this._addCheck({kind:"includes",value:t,position:e?.position,...I.errToObj(e?.message)})}startsWith(t,e){return this._addCheck({kind:"startsWith",value:t,...I.errToObj(e)})}endsWith(t,e){return this._addCheck({kind:"endsWith",value:t,...I.errToObj(e)})}min(t,e){return this._addCheck({kind:"min",value:t,...I.errToObj(e)})}max(t,e){return this._addCheck({kind:"max",value:t,...I.errToObj(e)})}length(t,e){return this._addCheck({kind:"length",value:t,...I.errToObj(e)})}nonempty(t){return this.min(1,I.errToObj(t))}trim(){return new r({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxLength(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}};lt.create=r=>new lt({checks:[],typeName:D.ZodString,coerce:r?.coerce??!1,...R(r)});function Ex(r,t){let e=(r.toString().split(".")[1]||"").length,s=(t.toString().split(".")[1]||"").length,i=e>s?e:s,n=Number.parseInt(r.toFixed(i).replace(".","")),a=Number.parseInt(t.toFixed(i).replace(".",""));return n%a/10**i}var vt=class r extends F{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==C.number){let n=this._getOrReturnCtx(t);return A(n,{code:w.invalid_type,expected:C.number,received:n.parsedType}),M}let s,i=new ie;for(let n of this._def.checks)n.kind==="int"?B.isInteger(t.data)||(s=this._getOrReturnCtx(t,s),A(s,{code:w.invalid_type,expected:"integer",received:"float",message:n.message}),i.dirty()):n.kind==="min"?(n.inclusive?t.data<n.value:t.data<=n.value)&&(s=this._getOrReturnCtx(t,s),A(s,{code:w.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):n.kind==="max"?(n.inclusive?t.data>n.value:t.data>=n.value)&&(s=this._getOrReturnCtx(t,s),A(s,{code:w.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):n.kind==="multipleOf"?Ex(t.data,n.value)!==0&&(s=this._getOrReturnCtx(t,s),A(s,{code:w.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):n.kind==="finite"?Number.isFinite(t.data)||(s=this._getOrReturnCtx(t,s),A(s,{code:w.not_finite,message:n.message}),i.dirty()):B.assertNever(n);return{status:i.value,value:t.data}}gte(t,e){return this.setLimit("min",t,!0,I.toString(e))}gt(t,e){return this.setLimit("min",t,!1,I.toString(e))}lte(t,e){return this.setLimit("max",t,!0,I.toString(e))}lt(t,e){return this.setLimit("max",t,!1,I.toString(e))}setLimit(t,e,s,i){return new r({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:s,message:I.toString(i)}]})}_addCheck(t){return new r({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:I.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:I.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:I.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:I.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:I.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:I.toString(e)})}finite(t){return this._addCheck({kind:"finite",message:I.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:I.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:I.toString(t)})}get minValue(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxValue(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&B.isInteger(t.value))}get isFinite(){let t=null,e=null;for(let s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(e===null||s.value>e)&&(e=s.value):s.kind==="max"&&(t===null||s.value<t)&&(t=s.value)}return Number.isFinite(e)&&Number.isFinite(t)}};vt.create=r=>new vt({checks:[],typeName:D.ZodNumber,coerce:r?.coerce||!1,...R(r)});var Ct=class r extends F{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==C.bigint)return this._getInvalidInput(t);let s,i=new ie;for(let n of this._def.checks)n.kind==="min"?(n.inclusive?t.data<n.value:t.data<=n.value)&&(s=this._getOrReturnCtx(t,s),A(s,{code:w.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):n.kind==="max"?(n.inclusive?t.data>n.value:t.data>=n.value)&&(s=this._getOrReturnCtx(t,s),A(s,{code:w.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):n.kind==="multipleOf"?t.data%n.value!==BigInt(0)&&(s=this._getOrReturnCtx(t,s),A(s,{code:w.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):B.assertNever(n);return{status:i.value,value:t.data}}_getInvalidInput(t){let e=this._getOrReturnCtx(t);return A(e,{code:w.invalid_type,expected:C.bigint,received:e.parsedType}),M}gte(t,e){return this.setLimit("min",t,!0,I.toString(e))}gt(t,e){return this.setLimit("min",t,!1,I.toString(e))}lte(t,e){return this.setLimit("max",t,!0,I.toString(e))}lt(t,e){return this.setLimit("max",t,!1,I.toString(e))}setLimit(t,e,s,i){return new r({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:s,message:I.toString(i)}]})}_addCheck(t){return new r({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:I.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:I.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:I.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:I.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:I.toString(e)})}get minValue(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxValue(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}};Ct.create=r=>new Ct({checks:[],typeName:D.ZodBigInt,coerce:r?.coerce??!1,...R(r)});var kt=class extends F{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==C.boolean){let s=this._getOrReturnCtx(t);return A(s,{code:w.invalid_type,expected:C.boolean,received:s.parsedType}),M}return ne(t.data)}};kt.create=r=>new kt({typeName:D.ZodBoolean,coerce:r?.coerce||!1,...R(r)});var Et=class r extends F{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==C.date){let n=this._getOrReturnCtx(t);return A(n,{code:w.invalid_type,expected:C.date,received:n.parsedType}),M}if(Number.isNaN(t.data.getTime())){let n=this._getOrReturnCtx(t);return A(n,{code:w.invalid_date}),M}let s=new ie,i;for(let n of this._def.checks)n.kind==="min"?t.data.getTime()<n.value&&(i=this._getOrReturnCtx(t,i),A(i,{code:w.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),s.dirty()):n.kind==="max"?t.data.getTime()>n.value&&(i=this._getOrReturnCtx(t,i),A(i,{code:w.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),s.dirty()):B.assertNever(n);return{status:s.value,value:new Date(t.data.getTime())}}_addCheck(t){return new r({...this._def,checks:[...this._def.checks,t]})}min(t,e){return this._addCheck({kind:"min",value:t.getTime(),message:I.toString(e)})}max(t,e){return this._addCheck({kind:"max",value:t.getTime(),message:I.toString(e)})}get minDate(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t!=null?new Date(t):null}};Et.create=r=>new Et({checks:[],coerce:r?.coerce||!1,typeName:D.ZodDate,...R(r)});var as=class extends F{_parse(t){if(this._getType(t)!==C.symbol){let s=this._getOrReturnCtx(t);return A(s,{code:w.invalid_type,expected:C.symbol,received:s.parsedType}),M}return ne(t.data)}};as.create=r=>new as({typeName:D.ZodSymbol,...R(r)});var Nt=class extends F{_parse(t){if(this._getType(t)!==C.undefined){let s=this._getOrReturnCtx(t);return A(s,{code:w.invalid_type,expected:C.undefined,received:s.parsedType}),M}return ne(t.data)}};Nt.create=r=>new Nt({typeName:D.ZodUndefined,...R(r)});var It=class extends F{_parse(t){if(this._getType(t)!==C.null){let s=this._getOrReturnCtx(t);return A(s,{code:w.invalid_type,expected:C.null,received:s.parsedType}),M}return ne(t.data)}};It.create=r=>new It({typeName:D.ZodNull,...R(r)});var ut=class extends F{constructor(){super(...arguments),this._any=!0}_parse(t){return ne(t.data)}};ut.create=r=>new ut({typeName:D.ZodAny,...R(r)});var Ge=class extends F{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ne(t.data)}};Ge.create=r=>new Ge({typeName:D.ZodUnknown,...R(r)});var Ee=class extends F{_parse(t){let e=this._getOrReturnCtx(t);return A(e,{code:w.invalid_type,expected:C.never,received:e.parsedType}),M}};Ee.create=r=>new Ee({typeName:D.ZodNever,...R(r)});var os=class extends F{_parse(t){if(this._getType(t)!==C.undefined){let s=this._getOrReturnCtx(t);return A(s,{code:w.invalid_type,expected:C.void,received:s.parsedType}),M}return ne(t.data)}};os.create=r=>new os({typeName:D.ZodVoid,...R(r)});var Je=class r extends F{_parse(t){let{ctx:e,status:s}=this._processInputParams(t),i=this._def;if(e.parsedType!==C.array)return A(e,{code:w.invalid_type,expected:C.array,received:e.parsedType}),M;if(i.exactLength!==null){let a=e.data.length>i.exactLength.value,o=e.data.length<i.exactLength.value;(a||o)&&(A(e,{code:a?w.too_big:w.too_small,minimum:o?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),s.dirty())}if(i.minLength!==null&&e.data.length<i.minLength.value&&(A(e,{code:w.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),s.dirty()),i.maxLength!==null&&e.data.length>i.maxLength.value&&(A(e,{code:w.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),s.dirty()),e.common.async)return Promise.all([...e.data].map((a,o)=>i.type._parseAsync(new Se(e,a,e.path,o)))).then(a=>ie.mergeArray(s,a));let n=[...e.data].map((a,o)=>i.type._parseSync(new Se(e,a,e.path,o)));return ie.mergeArray(s,n)}get element(){return this._def.type}min(t,e){return new r({...this._def,minLength:{value:t,message:I.toString(e)}})}max(t,e){return new r({...this._def,maxLength:{value:t,message:I.toString(e)}})}length(t,e){return new r({...this._def,exactLength:{value:t,message:I.toString(e)}})}nonempty(t){return this.min(1,t)}};Je.create=(r,t)=>new Je({type:r,minLength:null,maxLength:null,exactLength:null,typeName:D.ZodArray,...R(t)});function ns(r){if(r instanceof fe){let t={};for(let e in r.shape){let s=r.shape[e];t[e]=Te.create(ns(s))}return new fe({...r._def,shape:()=>t})}else return r instanceof Je?new Je({...r._def,type:ns(r.element)}):r instanceof Te?Te.create(ns(r.unwrap())):r instanceof Re?Re.create(ns(r.unwrap())):r instanceof De?De.create(r.items.map(t=>ns(t))):r}var fe=class r extends F{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),e=B.objectKeys(t);return this._cached={shape:t,keys:e},this._cached}_parse(t){if(this._getType(t)!==C.object){let l=this._getOrReturnCtx(t);return A(l,{code:w.invalid_type,expected:C.object,received:l.parsedType}),M}let{status:s,ctx:i}=this._processInputParams(t),{shape:n,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof Ee&&this._def.unknownKeys==="strip"))for(let l in i.data)a.includes(l)||o.push(l);let c=[];for(let l of a){let u=n[l],h=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Se(i,h,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof Ee){let l=this._def.unknownKeys;if(l==="passthrough")for(let u of o)c.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(l==="strict")o.length>0&&(A(i,{code:w.unrecognized_keys,keys:o}),s.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let u of o){let h=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Se(i,h,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let l=[];for(let u of c){let h=await u.key,p=await u.value;l.push({key:h,value:p,alwaysSet:u.alwaysSet})}return l}).then(l=>ie.mergeObjectSync(s,l)):ie.mergeObjectSync(s,c)}get shape(){return this._def.shape()}strict(t){return I.errToObj,new r({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(e,s)=>{let i=this._def.errorMap?.(e,s).message??s.defaultError;return e.code==="unrecognized_keys"?{message:I.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new r({...this._def,unknownKeys:"strip"})}passthrough(){return new r({...this._def,unknownKeys:"passthrough"})}extend(t){return new r({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new r({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:D.ZodObject})}setKey(t,e){return this.augment({[t]:e})}catchall(t){return new r({...this._def,catchall:t})}pick(t){let e={};for(let s of B.objectKeys(t))t[s]&&this.shape[s]&&(e[s]=this.shape[s]);return new r({...this._def,shape:()=>e})}omit(t){let e={};for(let s of B.objectKeys(this.shape))t[s]||(e[s]=this.shape[s]);return new r({...this._def,shape:()=>e})}deepPartial(){return ns(this)}partial(t){let e={};for(let s of B.objectKeys(this.shape)){let i=this.shape[s];t&&!t[s]?e[s]=i:e[s]=i.optional()}return new r({...this._def,shape:()=>e})}required(t){let e={};for(let s of B.objectKeys(this.shape))if(t&&!t[s])e[s]=this.shape[s];else{let n=this.shape[s];for(;n instanceof Te;)n=n._def.innerType;e[s]=n}return new r({...this._def,shape:()=>e})}keyof(){return Ih(B.objectKeys(this.shape))}};fe.create=(r,t)=>new fe({shape:()=>r,unknownKeys:"strip",catchall:Ee.create(),typeName:D.ZodObject,...R(t)});fe.strictCreate=(r,t)=>new fe({shape:()=>r,unknownKeys:"strict",catchall:Ee.create(),typeName:D.ZodObject,...R(t)});fe.lazycreate=(r,t)=>new fe({shape:r,unknownKeys:"strip",catchall:Ee.create(),typeName:D.ZodObject,...R(t)});var _t=class extends F{_parse(t){let{ctx:e}=this._processInputParams(t),s=this._def.options;function i(n){for(let o of n)if(o.result.status==="valid")return o.result;for(let o of n)if(o.result.status==="dirty")return e.common.issues.push(...o.ctx.common.issues),o.result;let a=n.map(o=>new pe(o.ctx.common.issues));return A(e,{code:w.invalid_union,unionErrors:a}),M}if(e.common.async)return Promise.all(s.map(async n=>{let a={...e,common:{...e.common,issues:[]},parent:null};return{result:await n._parseAsync({data:e.data,path:e.path,parent:a}),ctx:a}})).then(i);{let n,a=[];for(let c of s){let l={...e,common:{...e.common,issues:[]},parent:null},u=c._parseSync({data:e.data,path:e.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!n&&(n={result:u,ctx:l}),l.common.issues.length&&a.push(l.common.issues)}if(n)return e.common.issues.push(...n.ctx.common.issues),n.result;let o=a.map(c=>new pe(c));return A(e,{code:w.invalid_union,unionErrors:o}),M}}get options(){return this._def.options}};_t.create=(r,t)=>new _t({options:r,typeName:D.ZodUnion,...R(t)});var ze=r=>r instanceof Lt?ze(r.schema):r instanceof Ae?ze(r.innerType()):r instanceof Mt?[r.value]:r instanceof Dt?r.options:r instanceof Rt?B.objectValues(r.enum):r instanceof Ft?ze(r._def.innerType):r instanceof Nt?[void 0]:r instanceof It?[null]:r instanceof Te?[void 0,...ze(r.unwrap())]:r instanceof Re?[null,...ze(r.unwrap())]:r instanceof ti||r instanceof jt?ze(r.unwrap()):r instanceof $t?ze(r._def.innerType):[],Ar=class r extends F{_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==C.object)return A(e,{code:w.invalid_type,expected:C.object,received:e.parsedType}),M;let s=this.discriminator,i=e.data[s],n=this.optionsMap.get(i);return n?e.common.async?n._parseAsync({data:e.data,path:e.path,parent:e}):n._parseSync({data:e.data,path:e.path,parent:e}):(A(e,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),M)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,e,s){let i=new Map;for(let n of e){let a=ze(n.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let o of a){if(i.has(o))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(o)}`);i.set(o,n)}}return new r({typeName:D.ZodDiscriminatedUnion,discriminator:t,options:e,optionsMap:i,...R(s)})}};function Ga(r,t){let e=Me(r),s=Me(t);if(r===t)return{valid:!0,data:r};if(e===C.object&&s===C.object){let i=B.objectKeys(t),n=B.objectKeys(r).filter(o=>i.indexOf(o)!==-1),a={...r,...t};for(let o of n){let c=Ga(r[o],t[o]);if(!c.valid)return{valid:!1};a[o]=c.data}return{valid:!0,data:a}}else if(e===C.array&&s===C.array){if(r.length!==t.length)return{valid:!1};let i=[];for(let n=0;n<r.length;n++){let a=r[n],o=t[n],c=Ga(a,o);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return e===C.date&&s===C.date&&+r==+t?{valid:!0,data:r}:{valid:!1}}var Ot=class extends F{_parse(t){let{status:e,ctx:s}=this._processInputParams(t),i=(n,a)=>{if(Tr(n)||Tr(a))return M;let o=Ga(n.value,a.value);return o.valid?((Sr(n)||Sr(a))&&e.dirty(),{status:e.value,value:o.data}):(A(s,{code:w.invalid_intersection_types}),M)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([n,a])=>i(n,a)):i(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}};Ot.create=(r,t,e)=>new Ot({left:r,right:t,typeName:D.ZodIntersection,...R(e)});var De=class r extends F{_parse(t){let{status:e,ctx:s}=this._processInputParams(t);if(s.parsedType!==C.array)return A(s,{code:w.invalid_type,expected:C.array,received:s.parsedType}),M;if(s.data.length<this._def.items.length)return A(s,{code:w.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),M;!this._def.rest&&s.data.length>this._def.items.length&&(A(s,{code:w.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),e.dirty());let n=[...s.data].map((a,o)=>{let c=this._def.items[o]||this._def.rest;return c?c._parse(new Se(s,a,s.path,o)):null}).filter(a=>!!a);return s.common.async?Promise.all(n).then(a=>ie.mergeArray(e,a)):ie.mergeArray(e,n)}get items(){return this._def.items}rest(t){return new r({...this._def,rest:t})}};De.create=(r,t)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new De({items:r,typeName:D.ZodTuple,rest:null,...R(t)})};var vr=class r extends F{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:s}=this._processInputParams(t);if(s.parsedType!==C.object)return A(s,{code:w.invalid_type,expected:C.object,received:s.parsedType}),M;let i=[],n=this._def.keyType,a=this._def.valueType;for(let o in s.data)i.push({key:n._parse(new Se(s,o,s.path,o)),value:a._parse(new Se(s,s.data[o],s.path,o)),alwaysSet:o in s.data});return s.common.async?ie.mergeObjectAsync(e,i):ie.mergeObjectSync(e,i)}get element(){return this._def.valueType}static create(t,e,s){return e instanceof F?new r({keyType:t,valueType:e,typeName:D.ZodRecord,...R(s)}):new r({keyType:lt.create(),valueType:t,typeName:D.ZodRecord,...R(e)})}},cs=class extends F{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:s}=this._processInputParams(t);if(s.parsedType!==C.map)return A(s,{code:w.invalid_type,expected:C.map,received:s.parsedType}),M;let i=this._def.keyType,n=this._def.valueType,a=[...s.data.entries()].map(([o,c],l)=>({key:i._parse(new Se(s,o,s.path,[l,"key"])),value:n._parse(new Se(s,c,s.path,[l,"value"]))}));if(s.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let c of a){let l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return M;(l.status==="dirty"||u.status==="dirty")&&e.dirty(),o.set(l.value,u.value)}return{status:e.value,value:o}})}else{let o=new Map;for(let c of a){let l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return M;(l.status==="dirty"||u.status==="dirty")&&e.dirty(),o.set(l.value,u.value)}return{status:e.value,value:o}}}};cs.create=(r,t,e)=>new cs({valueType:t,keyType:r,typeName:D.ZodMap,...R(e)});var ls=class r extends F{_parse(t){let{status:e,ctx:s}=this._processInputParams(t);if(s.parsedType!==C.set)return A(s,{code:w.invalid_type,expected:C.set,received:s.parsedType}),M;let i=this._def;i.minSize!==null&&s.data.size<i.minSize.value&&(A(s,{code:w.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),e.dirty()),i.maxSize!==null&&s.data.size>i.maxSize.value&&(A(s,{code:w.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),e.dirty());let n=this._def.valueType;function a(c){let l=new Set;for(let u of c){if(u.status==="aborted")return M;u.status==="dirty"&&e.dirty(),l.add(u.value)}return{status:e.value,value:l}}let o=[...s.data.values()].map((c,l)=>n._parse(new Se(s,c,s.path,l)));return s.common.async?Promise.all(o).then(c=>a(c)):a(o)}min(t,e){return new r({...this._def,minSize:{value:t,message:I.toString(e)}})}max(t,e){return new r({...this._def,maxSize:{value:t,message:I.toString(e)}})}size(t,e){return this.min(t,e).max(t,e)}nonempty(t){return this.min(1,t)}};ls.create=(r,t)=>new ls({valueType:r,minSize:null,maxSize:null,typeName:D.ZodSet,...R(t)});var Cr=class r extends F{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==C.function)return A(e,{code:w.invalid_type,expected:C.function,received:e.parsedType}),M;function s(o,c){return ei({data:o,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,is(),We].filter(l=>!!l),issueData:{code:w.invalid_arguments,argumentsError:c}})}function i(o,c){return ei({data:o,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,is(),We].filter(l=>!!l),issueData:{code:w.invalid_return_type,returnTypeError:c}})}let n={errorMap:e.common.contextualErrorMap},a=e.data;if(this._def.returns instanceof ht){let o=this;return ne(async function(...c){let l=new pe([]),u=await o._def.args.parseAsync(c,n).catch(f=>{throw l.addIssue(s(c,f)),l}),h=await Reflect.apply(a,this,u);return await o._def.returns._def.type.parseAsync(h,n).catch(f=>{throw l.addIssue(i(h,f)),l})})}else{let o=this;return ne(function(...c){let l=o._def.args.safeParse(c,n);if(!l.success)throw new pe([s(c,l.error)]);let u=Reflect.apply(a,this,l.data),h=o._def.returns.safeParse(u,n);if(!h.success)throw new pe([i(u,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new r({...this._def,args:De.create(t).rest(Ge.create())})}returns(t){return new r({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,e,s){return new r({args:t||De.create([]).rest(Ge.create()),returns:e||Ge.create(),typeName:D.ZodFunction,...R(s)})}},Lt=class extends F{get schema(){return this._def.getter()}_parse(t){let{ctx:e}=this._processInputParams(t);return this._def.getter()._parse({data:e.data,path:e.path,parent:e})}};Lt.create=(r,t)=>new Lt({getter:r,typeName:D.ZodLazy,...R(t)});var Mt=class extends F{_parse(t){if(t.data!==this._def.value){let e=this._getOrReturnCtx(t);return A(e,{received:e.data,code:w.invalid_literal,expected:this._def.value}),M}return{status:"valid",value:t.data}}get value(){return this._def.value}};Mt.create=(r,t)=>new Mt({value:r,typeName:D.ZodLiteral,...R(t)});function Ih(r,t){return new Dt({values:r,typeName:D.ZodEnum,...R(t)})}var Dt=class r extends F{_parse(t){if(typeof t.data!="string"){let e=this._getOrReturnCtx(t),s=this._def.values;return A(e,{expected:B.joinValues(s),received:e.parsedType,code:w.invalid_type}),M}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let e=this._getOrReturnCtx(t),s=this._def.values;return A(e,{received:e.data,code:w.invalid_enum_value,options:s}),M}return ne(t.data)}get options(){return this._def.values}get enum(){let t={};for(let e of this._def.values)t[e]=e;return t}get Values(){let t={};for(let e of this._def.values)t[e]=e;return t}get Enum(){let t={};for(let e of this._def.values)t[e]=e;return t}extract(t,e=this._def){return r.create(t,{...this._def,...e})}exclude(t,e=this._def){return r.create(this.options.filter(s=>!t.includes(s)),{...this._def,...e})}};Dt.create=Ih;var Rt=class extends F{_parse(t){let e=B.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(t);if(s.parsedType!==C.string&&s.parsedType!==C.number){let i=B.objectValues(e);return A(s,{expected:B.joinValues(i),received:s.parsedType,code:w.invalid_type}),M}if(this._cache||(this._cache=new Set(B.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let i=B.objectValues(e);return A(s,{received:s.data,code:w.invalid_enum_value,options:i}),M}return ne(t.data)}get enum(){return this._def.values}};Rt.create=(r,t)=>new Rt({values:r,typeName:D.ZodNativeEnum,...R(t)});var ht=class extends F{unwrap(){return this._def.type}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==C.promise&&e.common.async===!1)return A(e,{code:w.invalid_type,expected:C.promise,received:e.parsedType}),M;let s=e.parsedType===C.promise?e.data:Promise.resolve(e.data);return ne(s.then(i=>this._def.type.parseAsync(i,{path:e.path,errorMap:e.common.contextualErrorMap})))}};ht.create=(r,t)=>new ht({type:r,typeName:D.ZodPromise,...R(t)});var Ae=class extends F{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===D.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:e,ctx:s}=this._processInputParams(t),i=this._def.effect||null,n={addIssue:a=>{A(s,a),a.fatal?e.abort():e.dirty()},get path(){return s.path}};if(n.addIssue=n.addIssue.bind(n),i.type==="preprocess"){let a=i.transform(s.data,n);if(s.common.async)return Promise.resolve(a).then(async o=>{if(e.value==="aborted")return M;let c=await this._def.schema._parseAsync({data:o,path:s.path,parent:s});return c.status==="aborted"?M:c.status==="dirty"?At(c.value):e.value==="dirty"?At(c.value):c});{if(e.value==="aborted")return M;let o=this._def.schema._parseSync({data:a,path:s.path,parent:s});return o.status==="aborted"?M:o.status==="dirty"?At(o.value):e.value==="dirty"?At(o.value):o}}if(i.type==="refinement"){let a=o=>{let c=i.refinement(o,n);if(s.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(s.common.async===!1){let o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?M:(o.status==="dirty"&&e.dirty(),a(o.value),{status:e.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?M:(o.status==="dirty"&&e.dirty(),a(o.value).then(()=>({status:e.value,value:o.value}))))}if(i.type==="transform")if(s.common.async===!1){let a=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!ct(a))return M;let o=i.transform(a.value,n);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:e.value,value:o}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(a=>ct(a)?Promise.resolve(i.transform(a.value,n)).then(o=>({status:e.value,value:o})):M);B.assertNever(i)}};Ae.create=(r,t,e)=>new Ae({schema:r,typeName:D.ZodEffects,effect:t,...R(e)});Ae.createWithPreprocess=(r,t,e)=>new Ae({schema:t,effect:{type:"preprocess",transform:r},typeName:D.ZodEffects,...R(e)});var Te=class extends F{_parse(t){return this._getType(t)===C.undefined?ne(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Te.create=(r,t)=>new Te({innerType:r,typeName:D.ZodOptional,...R(t)});var Re=class extends F{_parse(t){return this._getType(t)===C.null?ne(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Re.create=(r,t)=>new Re({innerType:r,typeName:D.ZodNullable,...R(t)});var Ft=class extends F{_parse(t){let{ctx:e}=this._processInputParams(t),s=e.data;return e.parsedType===C.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:e.path,parent:e})}removeDefault(){return this._def.innerType}};Ft.create=(r,t)=>new Ft({innerType:r,typeName:D.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...R(t)});var $t=class extends F{_parse(t){let{ctx:e}=this._processInputParams(t),s={...e,common:{...e.common,issues:[]}},i=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return rs(i)?i.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new pe(s.common.issues)},input:s.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new pe(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}};$t.create=(r,t)=>new $t({innerType:r,typeName:D.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...R(t)});var us=class extends F{_parse(t){if(this._getType(t)!==C.nan){let s=this._getOrReturnCtx(t);return A(s,{code:w.invalid_type,expected:C.nan,received:s.parsedType}),M}return{status:"valid",value:t.data}}};us.create=r=>new us({typeName:D.ZodNaN,...R(r)});var Nx=Symbol("zod_brand"),ti=class extends F{_parse(t){let{ctx:e}=this._processInputParams(t),s=e.data;return this._def.type._parse({data:s,path:e.path,parent:e})}unwrap(){return this._def.type}},si=class r extends F{_parse(t){let{status:e,ctx:s}=this._processInputParams(t);if(s.common.async)return(async()=>{let n=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?M:n.status==="dirty"?(e.dirty(),At(n.value)):this._def.out._parseAsync({data:n.value,path:s.path,parent:s})})();{let i=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?M:i.status==="dirty"?(e.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:s.path,parent:s})}}static create(t,e){return new r({in:t,out:e,typeName:D.ZodPipeline})}},jt=class extends F{_parse(t){let e=this._def.innerType._parse(t),s=i=>(ct(i)&&(i.value=Object.freeze(i.value)),i);return rs(e)?e.then(i=>s(i)):s(e)}unwrap(){return this._def.innerType}};jt.create=(r,t)=>new jt({innerType:r,typeName:D.ZodReadonly,...R(t)});function Ch(r,t){let e=typeof r=="function"?r(t):typeof r=="string"?{message:r}:r;return typeof e=="string"?{message:e}:e}function _h(r,t={},e){return r?ut.create().superRefine((s,i)=>{let n=r(s);if(n instanceof Promise)return n.then(a=>{if(!a){let o=Ch(t,s),c=o.fatal??e??!0;i.addIssue({code:"custom",...o,fatal:c})}});if(!n){let a=Ch(t,s),o=a.fatal??e??!0;i.addIssue({code:"custom",...a,fatal:o})}}):ut.create()}var Ix={object:fe.lazycreate},D;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(D||(D={}));var _x=(r,t={message:`Input not instance of ${r.name}`})=>_h(e=>e instanceof r,t),Oh=lt.create,Lh=vt.create,Ox=us.create,Lx=Ct.create,Mh=kt.create,Mx=Et.create,Dx=as.create,Rx=Nt.create,Fx=It.create,$x=ut.create,jx=Ge.create,Bx=Ee.create,qx=os.create,Ux=Je.create,Vx=fe.create,Hx=fe.strictCreate,Kx=_t.create,Wx=Ar.create,zx=Ot.create,Gx=De.create,Jx=vr.create,Yx=cs.create,Zx=ls.create,Xx=Cr.create,Qx=Lt.create,eb=Mt.create,tb=Dt.create,sb=Rt.create,ib=ht.create,rb=Ae.create,nb=Te.create,ab=Re.create,ob=Ae.createWithPreprocess,cb=si.create,lb=()=>Oh().optional(),ub=()=>Lh().optional(),hb=()=>Mh().optional(),pb={string:(r=>lt.create({...r,coerce:!0})),number:(r=>vt.create({...r,coerce:!0})),boolean:(r=>kt.create({...r,coerce:!0})),bigint:(r=>Ct.create({...r,coerce:!0})),date:(r=>Et.create({...r,coerce:!0}))};var fb=M;var Ja=J.union([J.string().trim().min(1),J.array(J.string()).min(1).refine(r=>r[0]?.trim(),"Command executable must be non-empty.").readonly()]),Dh=J.number().int().positive().max(86400),Ya=J.object({version:J.literal(1),base:J.string().min(1).optional(),head:J.string().min(1).optional(),adapter:J.enum(["javascript","python"]).optional(),projectRoot:J.string().min(1).default("."),execution:J.object({approved:J.boolean().default(!1),setup:Ja.optional(),targetedTest:Ja.optional(),suite:Ja.optional(),timeoutSeconds:Dh.default(120),suiteTimeoutSeconds:Dh.default(900),keepWorktrees:J.boolean().default(!1)}).strict().default({}),tests:J.object({include:J.array(J.string()).default([]),exclude:J.array(J.string()).default([]),support:J.array(J.string()).default([])}).strict().default({}),report:J.object({format:J.enum(["text","markdown","json"]).default("text"),output:J.string().nullable().default(null)}).strict().default({})}).strict();async function db(r){try{return await(0,kr.access)(r),!0}catch{return!1}}async function mb(r){let t=(0,pt.resolve)(r);for(;;){let e=(0,pt.resolve)(t,".patchproof.yml");if(await db(e))return e;let s=(0,pt.dirname)(t);if(s===t)return null;t=s}}function yb(r){let t=r.replaceAll("\\","/").replace(/^\.\//,"")||".";if((0,pt.isAbsolute)(r)||t===".."||t.startsWith("../")||t.includes("/../"))throw new Error("projectRoot must remain inside the repository.");return t}async function Za(r,t,e){let s=t?(0,pt.resolve)(r,t):await mb(r),i=s?Ya.parse((0,Rh.parse)(await(0,kr.readFile)(s,"utf8"))):Ya.parse({version:1}),n=process.env.PATCHPROOF_TIMEOUT?Number(process.env.PATCHPROOF_TIMEOUT):void 0,a={...i,base:e.base??process.env.PATCHPROOF_BASE??i.base,head:e.head??process.env.PATCHPROOF_HEAD??i.head,adapter:e.adapter??i.adapter,projectRoot:yb(e.projectRoot??i.projectRoot),execution:{...i.execution,approved:e.approved??(process.env.PATCHPROOF_APPROVED==="true"?!0:i.execution.approved),...(e.setup??i.execution.setup)!==void 0?{setup:e.setup??i.execution.setup}:{},...(e.targetedTest??i.execution.targetedTest)!==void 0?{targetedTest:e.targetedTest??i.execution.targetedTest}:{},...(e.suite??i.execution.suite)!==void 0?{suite:e.suite??i.execution.suite}:{},timeoutSeconds:e.timeoutSeconds??n??i.execution.timeoutSeconds,keepWorktrees:e.keepWorktrees??i.execution.keepWorktrees},report:{...i.report,format:e.format??i.report.format,output:e.output??i.report.output}};return Ya.parse(a),{config:a,path:s}}var gi=require("perf_hooks"),Qp=require("path");var Bt="0.1.0-alpha.1";var Er="patchproof";function ge(r,t){let e=n=>n.replace(/\{(test_id|test_file|worktree)\}/g,(a,o)=>t[o]??"");if(typeof r=="string"){let n=e(r);return{shell:n,display:n}}let[s,...i]=r.map(e);if(!s)throw new Error("Command array must contain an executable.");return{executable:s,args:i,display:[s,...i].join(" ")}}var xs=require("fs/promises"),xe=require("path"),Lp=Ts(pp(),1);var Do=(r,t,e)=>{let s=r instanceof RegExp?fp(r,e):r,i=t instanceof RegExp?fp(t,e):t,n=s!==null&&i!=null&&D0(s,i,e);return n&&{start:n[0],end:n[1],pre:e.slice(0,n[0]),body:e.slice(n[0]+s.length,n[1]),post:e.slice(n[1]+i.length)}},fp=(r,t)=>{let e=t.match(r);return e?e[0]:null},D0=(r,t,e)=>{let s,i,n,a,o,c=e.indexOf(r),l=e.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(r===t)return[c,l];for(s=[],n=e.length;u>=0&&!o;){if(u===c)s.push(u),c=e.indexOf(r,u+1);else if(s.length===1){let h=s.pop();h!==void 0&&(o=[h,l])}else i=s.pop(),i!==void 0&&i<n&&(n=i,a=l),l=e.indexOf(t,u+1);u=c<l&&c>=0?c:l}s.length&&a!==void 0&&(o=[n,a])}return o};var dp="\0SLASH"+Math.random()+"\0",mp="\0OPEN"+Math.random()+"\0",Fo="\0CLOSE"+Math.random()+"\0",yp="\0COMMA"+Math.random()+"\0",gp="\0PERIOD"+Math.random()+"\0",R0=new RegExp(dp,"g"),F0=new RegExp(mp,"g"),$0=new RegExp(Fo,"g"),j0=new RegExp(yp,"g"),B0=new RegExp(gp,"g"),q0=/\\\\/g,U0=/\\{/g,V0=/\\}/g,H0=/\\,/g,K0=/\\\./g,W0=1e5;function Ro(r){return isNaN(r)?r.charCodeAt(0):parseInt(r,10)}function z0(r){return r.replace(q0,dp).replace(U0,mp).replace(V0,Fo).replace(H0,yp).replace(K0,gp)}function G0(r){return r.replace(R0,"\\").replace(F0,"{").replace($0,"}").replace(j0,",").replace(B0,".")}function xp(r){if(!r)return[""];let t=[],e=Do("{","}",r);if(!e)return r.split(",");let{pre:s,body:i,post:n}=e,a=s.split(",");a[a.length-1]+="{"+i+"}";let o=xp(n);return n.length&&(a[a.length-1]+=o.shift(),a.push.apply(a,o)),t.push.apply(t,a),t}function bp(r,t={}){if(!r)return[];let{max:e=W0}=t;return r.slice(0,2)==="{}"&&(r="\\{\\}"+r.slice(2)),fi(z0(r),e,!0).map(G0)}function J0(r){return"{"+r+"}"}function Y0(r){return/^-?0\d/.test(r)}function Z0(r,t){return r<=t}function X0(r,t){return r>=t}function fi(r,t,e){let s=[],i=Do("{","}",r);if(!i)return[r];let n=i.pre,a=i.post.length?fi(i.post,t,!1):[""];if(/\$$/.test(i.pre))for(let o=0;o<a.length&&o<t;o++){let c=n+"{"+i.body+"}"+a[o];s.push(c)}else{let o=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),l=o||c,u=i.body.indexOf(",")>=0;if(!l&&!u)return i.post.match(/,(?!,).*\}/)?(r=i.pre+"{"+i.body+Fo+i.post,fi(r,t,!0)):[r];let h;if(l)h=i.body.split(/\.\./);else if(h=xp(i.body),h.length===1&&h[0]!==void 0&&(h=fi(h[0],t,!1).map(J0),h.length===1))return a.map(f=>i.pre+h[0]+f);let p;if(l&&h[0]!==void 0&&h[1]!==void 0){let f=Ro(h[0]),y=Ro(h[1]),d=Math.max(h[0].length,h[1].length),g=h.length===3&&h[2]!==void 0?Math.max(Math.abs(Ro(h[2])),1):1,x=Z0;y<f&&(g*=-1,x=X0);let P=h.some(Y0);p=[];for(let v=f;x(v,y)&&p.length<t;v+=g){let E;if(c)E=String.fromCharCode(v),E==="\\"&&(E="");else if(E=String(v),P){let L=d-E.length;if(L>0){let U=new Array(L+1).join("0");v<0?E="-"+U+E.slice(1):E=U+E}}p.push(E)}}else{p=[];for(let f=0;f<h.length;f++)p.push.apply(p,fi(h[f],t,!1))}for(let f=0;f<p.length;f++)for(let y=0;y<a.length&&s.length<t;y++){let d=n+p[f]+a[y];(!e||l||d)&&s.push(d)}}return s}var di=r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>65536)throw new TypeError("pattern is too long")};var Q0={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},mi=r=>r.replace(/[[\]\\-]/g,"\\$&"),ew=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),wp=r=>r.join(""),Pp=(r,t)=>{let e=t;if(r.charAt(e)!=="[")throw new Error("not in a brace expression");let s=[],i=[],n=e+1,a=!1,o=!1,c=!1,l=!1,u=e,h="";e:for(;n<r.length;){let d=r.charAt(n);if((d==="!"||d==="^")&&n===e+1){l=!0,n++;continue}if(d==="]"&&a&&!c){u=n+1;break}if(a=!0,d==="\\"&&!c){c=!0,n++;continue}if(d==="["&&!c){for(let[g,[x,b,P]]of Object.entries(Q0))if(r.startsWith(g,n)){if(h)return["$.",!1,r.length-e,!0];n+=g.length,P?i.push(x):s.push(x),o=o||b;continue e}}if(c=!1,h){d>h?s.push(mi(h)+"-"+mi(d)):d===h&&s.push(mi(d)),h="",n++;continue}if(r.startsWith("-]",n+1)){s.push(mi(d+"-")),n+=2;continue}if(r.startsWith("-",n+1)){h=d,n+=2;continue}s.push(mi(d)),n++}if(u<n)return["",!1,0,!1];if(!s.length&&!i.length)return["$.",!1,r.length-e,!0];if(i.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!l){let d=s[0].length===2?s[0].slice(-1):s[0];return[ew(d),!1,u-e,!1]}let p="["+(l?"^":"")+wp(s)+"]",f="["+(l?"":"^")+wp(i)+"]";return[s.length&&i.length?"("+p+"|"+f+")":s.length?p:f,o,u-e,!0]};var yt=(r,{windowsPathsNoEscape:t=!1,magicalBraces:e=!0}={})=>e?t?r.replace(/\[([^/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?r.replace(/\[([^/\\{}])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1");var de,tw=new Set(["!","?","+","*","@"]),$o=r=>tw.has(r),Tp=r=>$o(r.type),sw=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),iw=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),rw=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),Sp=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),nw="(?!(?:^|/)\\.\\.?(?:$|/))",$r="(?!\\.)",aw=new Set(["[","."]),ow=new Set(["..","."]),cw=new Set("().*{}+?[]^$\\!"),lw=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),jo="[^/]",Ap=jo+"*?",vp=jo+"+?",uw=0,Ht=class{type;#s;#i;#r=!1;#e=[];#t;#o;#l;#c=!1;#n;#a;#u=!1;id=++uw;get depth(){return(this.#t?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#s.id,parent:this.#t?.id,depth:this.depth,partsLength:this.#e.length,parts:this.#e}}constructor(t,e,s={}){this.type=t,t&&(this.#i=!0),this.#t=e,this.#s=this.#t?this.#t.#s:this,this.#n=this.#s===this?s:this.#s.#n,this.#l=this.#s===this?[]:this.#s.#l,t==="!"&&!this.#s.#c&&this.#l.push(this),this.#o=this.#t?this.#t.#e.length:0}get hasMagic(){if(this.#i!==void 0)return this.#i;for(let t of this.#e)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#i=!0;return this.#i}toString(){return this.#a!==void 0?this.#a:this.type?this.#a=this.type+"("+this.#e.map(t=>String(t)).join("|")+")":this.#a=this.#e.map(t=>String(t)).join("")}#g(){if(this!==this.#s)throw new Error("should only call on root");if(this.#c)return this;this.toString(),this.#c=!0;let t;for(;t=this.#l.pop();){if(t.type!=="!")continue;let e=t,s=e.#t;for(;s;){for(let i=e.#o+1;!s.type&&i<s.#e.length;i++)for(let n of t.#e){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(s.#e[i])}e=s,s=e.#t}}return this}push(...t){for(let e of t)if(e!==""){if(typeof e!="string"&&!(e instanceof de&&e.#t===this))throw new Error("invalid part: "+e);this.#e.push(e)}}toJSON(){let t=this.type===null?this.#e.slice().map(e=>typeof e=="string"?e:e.toJSON()):[this.type,...this.#e.map(e=>e.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#s||this.#s.#c&&this.#t?.type==="!")&&t.push({}),t}isStart(){if(this.#s===this)return!0;if(!this.#t?.isStart())return!1;if(this.#o===0)return!0;let t=this.#t;for(let e=0;e<this.#o;e++){let s=t.#e[e];if(!(s instanceof de&&s.type==="!"))return!1}return!0}isEnd(){if(this.#s===this||this.#t?.type==="!")return!0;if(!this.#t?.isEnd())return!1;if(!this.type)return this.#t?.isEnd();let t=this.#t?this.#t.#e.length:0;return this.#o===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let e=new de(this.type,t);for(let s of this.#e)e.copyIn(s);return e}static#h(t,e,s,i,n){let a=i.maxExtglobRecursion??2,o=!1,c=!1,l=-1,u=!1;if(e.type===null){let d=s,g="";for(;d<t.length;){let x=t.charAt(d++);if(o||x==="\\"){o=!o,g+=x;continue}if(c){d===l+1?(x==="^"||x==="!")&&(u=!0):x==="]"&&!(d===l+2&&u)&&(c=!1),g+=x;continue}else if(x==="["){c=!0,l=d,u=!1,g+=x;continue}if(!i.noext&&$o(x)&&t.charAt(d)==="("&&n<=a){e.push(g),g="";let P=new de(x,e);d=de.#h(t,P,d,i,n+1),e.push(P);continue}g+=x}return e.push(g),d}let h=s+1,p=new de(null,e),f=[],y="";for(;h<t.length;){let d=t.charAt(h++);if(o||d==="\\"){o=!o,y+=d;continue}if(c){h===l+1?(d==="^"||d==="!")&&(u=!0):d==="]"&&!(h===l+2&&u)&&(c=!1),y+=d;continue}else if(d==="["){c=!0,l=h,u=!1,y+=d;continue}if(!i.noext&&$o(d)&&t.charAt(h)==="("&&(n<=a||e&&e.#p(d))){let x=e&&e.#p(d)?0:1;p.push(y),y="";let b=new de(d,p);p.push(b),h=de.#h(t,b,h,i,n+x);continue}if(d==="|"){p.push(y),y="",f.push(p),p=new de(null,e);continue}if(d===")")return y===""&&e.#e.length===0&&(e.#u=!0),p.push(y),y="",e.push(...f,p),h;y+=d}return e.type=null,e.#i=void 0,e.#e=[t.substring(s-1)],h}#x(t){return this.#d(t,iw)}#d(t,e=sw){if(!t||typeof t!="object"||t.type!==null||t.#e.length!==1||this.type===null)return!1;let s=t.#e[0];return!s||typeof s!="object"||s.type===null?!1:this.#p(s.type,e)}#p(t,e=rw){return!!e.get(this.type)?.includes(t)}#b(t,e){let s=t.#e[0],i=new de(null,s,this.options);i.#e.push(""),s.push(i),this.#m(t,e)}#m(t,e){let s=t.#e[0];this.#e.splice(e,1,...s.#e);for(let i of s.#e)typeof i=="object"&&(i.#t=this);this.#a=void 0}#w(t){return!!Sp.get(this.type)?.has(t)}#P(t){if(!t||typeof t!="object"||t.type!==null||t.#e.length!==1||this.type===null||this.#e.length!==1)return!1;let e=t.#e[0];return!e||typeof e!="object"||e.type===null?!1:this.#w(e.type)}#T(t){let e=Sp.get(this.type),s=t.#e[0],i=e?.get(s.type);if(!i)return!1;this.#e=s.#e;for(let n of this.#e)typeof n=="object"&&(n.#t=this);this.type=i,this.#a=void 0,this.#u=!1}static fromGlob(t,e={}){let s=new de(null,void 0,e);return de.#h(t,s,0,e,0),s}toMMPattern(){if(this!==this.#s)return this.#s.toMMPattern();let t=this.toString(),[e,s,i,n]=this.toRegExpSource();if(!(i||this.#i||this.#n.nocase&&!this.#n.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return s;let o=(this.#n.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${e}$`,o),{_src:e,_glob:t})}get options(){return this.#n}toRegExpSource(t){let e=t??!!this.#n.dot;if(this.#s===this&&(this.#f(),this.#g()),!Tp(this)){let c=this.isStart()&&this.isEnd()&&!this.#e.some(f=>typeof f!="string"),l=this.#e.map(f=>{let[y,d,g,x]=typeof f=="string"?de.#S(f,this.#i,c):f.toRegExpSource(t);return this.#i=this.#i||g,this.#r=this.#r||x,y}).join(""),u="";if(this.isStart()&&typeof this.#e[0]=="string"&&!(this.#e.length===1&&ow.has(this.#e[0]))){let y=aw,d=e&&y.has(l.charAt(0))||l.startsWith("\\.")&&y.has(l.charAt(2))||l.startsWith("\\.\\.")&&y.has(l.charAt(4)),g=!e&&!t&&y.has(l.charAt(0));u=d?nw:g?$r:""}let h="";return this.isEnd()&&this.#s.#c&&this.#t?.type==="!"&&(h="(?:$|\\/)"),[u+l+h,yt(l),this.#i=!!this.#i,this.#r]}let s=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#y(e);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let c=this.toString(),l=this;return l.#e=[c],l.type=null,l.#i=void 0,[c,yt(this.toString()),!1,!1]}let a=!s||t||e||!$r?"":this.#y(!0);a===n&&(a=""),a&&(n=`(?:${n})(?:${a})*?`);let o="";if(this.type==="!"&&this.#u)o=(this.isStart()&&!e?$r:"")+vp;else{let c=this.type==="!"?"))"+(this.isStart()&&!e&&!t?$r:"")+Ap+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;o=i+n+c}return[o,yt(n),this.#i=!!this.#i,this.#r]}#f(){if(Tp(this)){let t=0,e=!1;do{e=!0;for(let s=0;s<this.#e.length;s++){let i=this.#e[s];typeof i=="object"&&(i.#f(),this.#d(i)?(e=!1,this.#m(i,s)):this.#x(i)?(e=!1,this.#b(i,s)):this.#P(i)&&(e=!1,this.#T(i)))}}while(!e&&++t<10)}else for(let t of this.#e)typeof t=="object"&&t.#f();this.#a=void 0}#y(t){return this.#e.map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");let[s,i,n,a]=e.toRegExpSource(t);return this.#r=this.#r||a,s}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")}static#S(t,e,s=!1){let i=!1,n="",a=!1,o=!1;for(let c=0;c<t.length;c++){let l=t.charAt(c);if(i){i=!1,n+=(cw.has(l)?"\\":"")+l;continue}if(l==="*"){if(o)continue;o=!0,n+=s&&/^[*]+$/.test(t)?vp:Ap,e=!0;continue}else o=!1;if(l==="\\"){c===t.length-1?n+="\\\\":i=!0;continue}if(l==="["){let[u,h,p,f]=Pp(t,c);if(p){n+=u,a=a||h,c+=p-1,e=e||f;continue}}if(l==="?"){n+=jo,e=!0;continue}n+=lw(l)}return[n,yt(t),!!e,a]}};de=Ht;var Bo=(r,{windowsPathsNoEscape:t=!1,magicalBraces:e=!1}={})=>e?t?r.replace(/[?*()[\]{}]/g,"[$&]"):r.replace(/[?*()[\]\\{}]/g,"\\$&"):t?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&");var X=(r,t,e={})=>(di(t),!e.nocomment&&t.charAt(0)==="#"?!1:new gs(t,e).match(r)),hw=/^\*+([^+@!?*[(]*)$/,pw=r=>t=>!t.startsWith(".")&&t.endsWith(r),fw=r=>t=>t.endsWith(r),dw=r=>(r=r.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(r)),mw=r=>(r=r.toLowerCase(),t=>t.toLowerCase().endsWith(r)),yw=/^\*+\.\*+$/,gw=r=>!r.startsWith(".")&&r.includes("."),xw=r=>r!=="."&&r!==".."&&r.includes("."),bw=/^\.\*+$/,ww=r=>r!=="."&&r!==".."&&r.startsWith("."),Pw=/^\*+$/,Tw=r=>r.length!==0&&!r.startsWith("."),Sw=r=>r.length!==0&&r!=="."&&r!=="..",Aw=/^\?+([^+@!?*[(]*)?$/,vw=([r,t=""])=>{let e=Ep([r]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},Cw=([r,t=""])=>{let e=Np([r]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},kw=([r,t=""])=>{let e=Np([r]);return t?s=>e(s)&&s.endsWith(t):e},Ew=([r,t=""])=>{let e=Ep([r]);return t?s=>e(s)&&s.endsWith(t):e},Ep=([r])=>{let t=r.length;return e=>e.length===t&&!e.startsWith(".")},Np=([r])=>{let t=r.length;return e=>e.length===t&&e!=="."&&e!==".."},Ip=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Cp={win32:{sep:"\\"},posix:{sep:"/"}},Nw=Ip==="win32"?Cp.win32.sep:Cp.posix.sep;X.sep=Nw;var ae=Symbol("globstar **");X.GLOBSTAR=ae;var Iw="[^/]",_w=Iw+"*?",Ow="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Lw="(?:(?!(?:\\/|^)\\.).)*?",Mw=(r,t={})=>e=>X(e,r,t);X.filter=Mw;var ve=(r,t={})=>Object.assign({},r,t),Dw=r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return X;let t=X;return Object.assign((s,i,n={})=>t(s,i,ve(r,n)),{Minimatch:class extends t.Minimatch{constructor(i,n={}){super(i,ve(r,n))}static defaults(i){return t.defaults(ve(r,i)).Minimatch}},AST:class extends t.AST{constructor(i,n,a={}){super(i,n,ve(r,a))}static fromGlob(i,n={}){return t.AST.fromGlob(i,ve(r,n))}},unescape:(s,i={})=>t.unescape(s,ve(r,i)),escape:(s,i={})=>t.escape(s,ve(r,i)),filter:(s,i={})=>t.filter(s,ve(r,i)),defaults:s=>t.defaults(ve(r,s)),makeRe:(s,i={})=>t.makeRe(s,ve(r,i)),braceExpand:(s,i={})=>t.braceExpand(s,ve(r,i)),match:(s,i,n={})=>t.match(s,i,ve(r,n)),sep:t.sep,GLOBSTAR:ae})};X.defaults=Dw;var _p=(r,t={})=>(di(r),t.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:bp(r,{max:t.braceExpandMax}));X.braceExpand=_p;var Rw=(r,t={})=>new gs(r,t).makeRe();X.makeRe=Rw;var Fw=(r,t,e={})=>{let s=new gs(t,e);return r=r.filter(i=>s.match(i)),s.options.nonull&&!r.length&&r.push(t),r};X.match=Fw;var kp=/[?*]|[+@!]\(.*?\)|\[|\]/,$w=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),gs=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,e={}){di(t),e=e||{},this.options=e,this.maxGlobstarRecursion=e.maxGlobstarRecursion??200,this.pattern=t,this.platform=e.platform||Ip,this.isWindows=this.platform==="win32";let s="allowWindowsEscape";this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e[s]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...n)=>console.error(...n)),this.debug(this.pattern,this.globSet);let s=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let i=this.globParts.map((n,a,o)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=n[0]===""&&n[1]===""&&(n[2]==="?"||!kp.test(n[2]))&&!kp.test(n[3]),l=/^[a-z]:/i.test(n[0]);if(c)return[...n.slice(0,4),...n.slice(4).map(u=>this.parse(u))];if(l)return[n[0],...n.slice(1).map(u=>this.parse(u))]}return n.map(c=>this.parse(c))});if(this.debug(this.pattern,i),this.set=i.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let a=this.set[n];a[0]===""&&a[1]===""&&this.globParts[n][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let s of t)for(let i=0;i<s.length;i++)s[i]==="**"&&(s[i]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let s=-1;for(;(s=e.indexOf("**",s+1))!==-1;){let i=s;for(;e[i+1]==="**";)i++;i!==s&&e.splice(s,i-s)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((s,i)=>{let n=s[s.length-1];return i==="**"&&n==="**"?s:i===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(s.pop(),s):(s.push(i),s)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){let n=t[i];i===1&&n===""&&t[0]===""||(n==="."||n==="")&&(e=!0,t.splice(i,1),i--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let s=0;for(;(s=t.indexOf("..",s+1))!==-1;){let i=t[s-1];i&&i!=="."&&i!==".."&&i!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(i))&&(e=!0,t.splice(s-1,2),s-=2)}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let s of t){let i=-1;for(;(i=s.indexOf("**",i+1))!==-1;){let a=i;for(;s[a+1]==="**";)a++;a>i&&s.splice(i+1,a-i);let o=s[i+1],c=s[i+2],l=s[i+3];if(o!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;e=!0,s.splice(i,1);let u=s.slice(0);u[i]="**",t.push(u),i--}if(!this.preserveMultipleSlashes){for(let a=1;a<s.length-1;a++){let o=s[a];a===1&&o===""&&s[0]===""||(o==="."||o==="")&&(e=!0,s.splice(a,1),a--)}s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")&&(e=!0,s.pop())}let n=0;for(;(n=s.indexOf("..",n+1))!==-1;){let a=s[n-1];if(a&&a!=="."&&a!==".."&&a!=="**"){e=!0;let c=n===1&&s[n+1]==="**"?["."]:[];s.splice(n-1,2,...c),s.length===0&&s.push(""),n-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let s=e+1;s<t.length;s++){let i=this.partsMatch(t[e],t[s],!this.preserveMultipleSlashes);if(i){t[e]=[],t[s]=i;break}}return t.filter(e=>e.length)}partsMatch(t,e,s=!1){let i=0,n=0,a=[],o="";for(;i<t.length&&n<e.length;)if(t[i]===e[n])a.push(o==="b"?e[n]:t[i]),i++,n++;else if(s&&t[i]==="**"&&e[n]===t[i+1])a.push(t[i]),i++;else if(s&&e[n]==="**"&&t[i]===e[n+1])a.push(e[n]),n++;else if(t[i]==="*"&&e[n]&&(this.options.dot||!e[n].startsWith("."))&&e[n]!=="**"){if(o==="b")return!1;o="a",a.push(t[i]),i++,n++}else if(e[n]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(o==="a")return!1;o="b",a.push(e[n]),i++,n++}else return!1;return t.length===e.length&&a}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,s=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)e=!e,s++;s&&(this.pattern=t.slice(s)),this.negate=e}matchOne(t,e,s=!1){let i=0,n=0;if(this.isWindows){let o=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),c=!o&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),l=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),u=!l&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),h=c?3:o?0:void 0,p=u?3:l?0:void 0;if(typeof h=="number"&&typeof p=="number"){let[f,y]=[t[h],e[p]];f.toLowerCase()===y.toLowerCase()&&(e[p]=f,n=p,i=h)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(t=this.levelTwoFileOptimize(t)),e.includes(ae)?this.#s(t,e,s,i,n):this.#r(t,e,s,i,n)}#s(t,e,s,i,n){let a=e.indexOf(ae,n),o=e.lastIndexOf(ae),[c,l,u]=s?[e.slice(n,a),e.slice(a+1),[]]:[e.slice(n,a),e.slice(a+1,o),e.slice(o+1)];if(c.length){let b=t.slice(i,i+c.length);if(!this.#r(b,c,s,0,0))return!1;i+=c.length,n+=c.length}let h=0;if(u.length){if(u.length+i>t.length)return!1;let b=t.length-u.length;if(this.#r(t,u,s,b,0))h=u.length;else{if(t[t.length-1]!==""||i+u.length===t.length||(b--,!this.#r(t,u,s,b,0)))return!1;h=u.length+1}}if(!l.length){let b=!!h;for(let P=i;P<t.length-h;P++){let v=String(t[P]);if(b=!0,v==="."||v===".."||!this.options.dot&&v.startsWith("."))return!1}return s||b}let p=[[[],0]],f=p[0],y=0,d=[0];for(let b of l)b===ae?(d.push(y),f=[[],0],p.push(f)):(f[0].push(b),y++);let g=p.length-1,x=t.length-h;for(let b of p)b[1]=x-(d[g--]+b[0].length);return!!this.#i(t,p,i,0,s,0,!!h)}#i(t,e,s,i,n,a,o){let c=e[i];if(!c){for(let h=s;h<t.length;h++){o=!0;let p=t[h];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return o}let[l,u]=c;for(;s<=u;){if(this.#r(t.slice(0,s+l.length),l,n,s,0)&&a<this.maxGlobstarRecursion){let f=this.#i(t,e,s+l.length,i+1,n,a+1,o);if(f!==!1)return f}let p=t[s];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1;s++}return n||null}#r(t,e,s,i,n){let a,o,c,l;for(a=i,o=n,l=t.length,c=e.length;a<l&&o<c;a++,o++){this.debug("matchOne loop");let u=e[o],h=t[a];if(this.debug(e,u,h),u===!1||u===ae)return!1;let p;if(typeof u=="string"?(p=h===u,this.debug("string match",u,h,p)):(p=u.test(h),this.debug("pattern match",u,h,p)),!p)return!1}if(a===l&&o===c)return!0;if(a===l)return s;if(o===c)return a===l-1&&t[a]==="";throw new Error("wtf?")}braceExpand(){return _p(this.pattern,this.options)}parse(t){di(t);let e=this.options;if(t==="**")return ae;if(t==="")return"";let s,i=null;(s=t.match(Pw))?i=e.dot?Sw:Tw:(s=t.match(hw))?i=(e.nocase?e.dot?mw:dw:e.dot?fw:pw)(s[1]):(s=t.match(Aw))?i=(e.nocase?e.dot?Cw:vw:e.dot?kw:Ew)(s):(s=t.match(yw))?i=e.dot?xw:gw:(s=t.match(bw))&&(i=ww);let n=Ht.fromGlob(t,this.options).toMMPattern();return i&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:i}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let e=this.options,s=e.noglobstar?_w:e.dot?Ow:Lw,i=new Set(e.nocase?["i"]:[]),n=t.map(c=>{let l=c.map(h=>{if(h instanceof RegExp)for(let p of h.flags.split(""))i.add(p);return typeof h=="string"?$w(h):h===ae?ae:h._src});l.forEach((h,p)=>{let f=l[p+1],y=l[p-1];h!==ae||y===ae||(y===void 0?f!==void 0&&f!==ae?l[p+1]="(?:\\/|"+s+"\\/)?"+f:l[p]=s:f===void 0?l[p-1]=y+"(?:\\/|\\/"+s+")?":f!==ae&&(l[p-1]=y+"(?:\\/|\\/"+s+"\\/)"+f,l[p+1]=ae))});let u=l.filter(h=>h!==ae);if(this.partial&&u.length>=1){let h=[];for(let p=1;p<=u.length;p++)h.push(u.slice(0,p).join("/"));return"(?:"+h.join("|")+")"}return u.join("/")}).join("|"),[a,o]=t.length>1?["(?:",")"]:["",""];n="^"+a+n+o+"$",this.partial&&(n="^(?:\\/|"+a+n.slice(1,-1)+o+")$"),this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;let s=this.options;this.isWindows&&(t=t.split("\\").join("/"));let i=this.slashSplit(t);this.debug(this.pattern,"split",i);let n=this.set;this.debug(this.pattern,"set",n);let a=i[i.length-1];if(!a)for(let o=i.length-2;!a&&o>=0;o--)a=i[o];for(let o of n){let c=i;if(s.matchBase&&o.length===1&&(c=[a]),this.matchOne(c,o,e))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(t){return X.defaults(t).Minimatch}};X.AST=Ht;X.Minimatch=gs;X.escape=Bo;X.unescape=yt;var jw=["**/*.test.{js,jsx,ts,tsx,mjs,cjs}","**/*.spec.{js,jsx,ts,tsx,mjs,cjs}"],Bw=new Set([".git","node_modules","dist","build","coverage",".next"]);async function Mp(r,t=0){if(t>4)return[];let e=[],s;try{s=await(0,xs.readdir)(r,{withFileTypes:!0})}catch{return e}s.some(i=>i.isFile()&&i.name==="package.json")&&e.push(r);for(let i of s)i.isDirectory()&&!Bw.has(i.name)&&e.push(...await Mp((0,xe.join)(r,i.name),t+1));return e}async function qo(r){return JSON.parse(await(0,xs.readFile)((0,xe.join)(r,"package.json"),"utf8"))}function Uo(r){let t={...r.dependencies??{},...r.devDependencies??{},...r.peerDependencies??{}};if(t.vitest)return"vitest";if(t.jest||t["@jest/core"])return"jest";let e=String(r.scripts?.test??"");return/\bvitest\b/.test(e)?"vitest":/\bjest\b/.test(e)?"jest":null}function qw(r,t){return(t.configuration.include.length?t.configuration.include:jw).some(s=>X(r,s,{dot:!0}))&&!t.configuration.exclude.some(s=>X(r,s,{dot:!0}))}function Op(r){return r?.type==="StringLiteral"?r.value:r?.type==="TemplateLiteral"&&r.expressions.length===0?r.quasis[0]?.value?.cooked??null:null}function Ho(r){return r?r.type==="Identifier"?r.name:r.type==="MemberExpression"?Ho(r.object):r.type==="CallExpression"?Ho(r.callee):"":""}function Uw(r){let t=(0,Lp.parse)(r,{sourceType:"unambiguous",plugins:["typescript","jsx","decorators-legacy"],errorRecovery:!0}),e=[],s=(i,n)=>{if(!(!i||typeof i!="object")){if(i.type==="CallExpression"){let a=Ho(i.callee);if(["test","it"].includes(a)){let o=Op(i.arguments?.[0]),c=i.loc?.start?.line,l=i.loc?.end?.line;o&&c&&l&&e.push({name:[...n,o].join(" > "),line:c,endLine:l})}if(["describe","suite"].includes(a)){let o=Op(i.arguments?.[0]),c=i.arguments?.[1];if(o&&c){s(c.body,[...n,o]);return}}}for(let a of Object.values(i))Array.isArray(a)?a.forEach(o=>s(o,n)):a&&typeof a=="object"&&a!==i.loc&&s(a,n)}};return s(t.program,[]),e}function Vo(r){return(0,xs.readdir)(r).then(t=>t.includes("pnpm-lock.yaml")?"pnpm":t.includes("yarn.lock")?"yarn":t.includes("bun.lock")||t.includes("bun.lockb")?"bun":"npm")}function Vw(r){if(r.interrupted)return"interrupted";if(r.timedOut)return"timeout";if(r.exitCode===0)return"pass";let t=`${r.stdout}
173
+ ${r.stderr}`,e=[/\bAssertionError\b/i,/\bexpected\b[\s\S]{0,120}\b(received|to be|to equal|but got)\b/i,/\bTests?:\s+\d+\s+failed\b/i,/●\s+.+/];return[/\bSyntaxError\b/i,/\bCannot find module\b/i,/\bMODULE_NOT_FOUND\b/i,/\bfailed to (load|resolve) config\b/i,/\bNo test files found\b/i,/\bTest suite failed to run\b/i].some(i=>i.test(t))?"infrastructure_failure":e.some(i=>i.test(t))?"assertion_failure":"infrastructure_failure"}var jr=class{name="javascript";async detect(t){let e=await Mp(t),s=[],i=[];for(let n of e)try{let a=await qo(n),o=Uo(a);o&&(s.push((0,xe.relative)(t,n).replaceAll("\\","/")||"."),i.push(`${(0,xe.relative)(t,n)||"."}/package.json (${o})`))}catch{}return{adapter:this.name,confidence:s.length?"high":e.length?"low":"none",projectRoots:s.length?s:e.map(n=>(0,xe.relative)(t,n)||"."),evidence:i}}async validate(t){try{return Uo(await qo((0,xe.resolve)(t.repositoryRoot,t.projectRoot)))||t.configuration.targetedTest?[]:[{code:"PP_ADAPTER_UNSUPPORTED_FRAMEWORK",severity:"error",summary:"No Vitest or Jest configuration was detected.",remediation:"Configure execution.targetedTest and execution.suite explicitly."}]}catch(e){return[{code:"PP_ADAPTER_INVALID_MANIFEST",severity:"error",summary:"Unable to read package.json.",detail:String(e)}]}}async discoverTests(t,e){let s=[];for(let i of e.entries){let n=t.projectRoot==="."?i.path:i.path.startsWith(`${t.projectRoot}/`)?i.path.slice(t.projectRoot.length+1):"";if(!(!n||!qw(n,t))){if(i.status==="deleted"){s.push({id:n,file:i.path,displayName:n,changeKind:"deleted",granularity:"file",changedRanges:i.changedRanges,selectionReason:"The test file was deleted and cannot be evaluated.",diagnostics:[]});continue}try{let a=await(0,xs.readFile)((0,xe.resolve)(t.repositoryRoot,i.path),"utf8"),o=Uw(a).filter(c=>i.status==="added"||i.addedLines.some(l=>l>=c.line&&l<=c.endLine));o.length?s.push(...o.map(c=>({id:`${n}::${c.name}`,file:i.path,displayName:c.name,changeKind:i.status==="added"?"added":"modified",granularity:"case",line:c.line,sourceRange:{startLine:c.line,endLine:c.endLine},changedRanges:i.changedRanges,selectionReason:i.status==="added"?"The test was added in the head revision.":"Changed lines overlap the test's source span.",diagnostics:[]}))):s.push({id:n,file:i.path,displayName:n,changeKind:i.status==="added"?"added":"modified",granularity:"file",changedRanges:i.changedRanges,selectionReason:"The changed test file could not be targeted reliably by case.",fallbackReason:"No statically targetable changed test declaration was found.",diagnostics:[{code:"PP_DISCOVERY_FILE_FALLBACK",severity:"warning",summary:"Dynamic or ambiguous test syntax required file-level targeting."}]})}catch(a){s.push({id:n,file:i.path,displayName:n,changeKind:i.status==="added"?"added":"modified",granularity:"file",changedRanges:i.changedRanges,selectionReason:"The changed test file could not be parsed reliably.",fallbackReason:String(a),diagnostics:[{code:"PP_DISCOVERY_FILE_FALLBACK",severity:"warning",summary:"Test parsing failed; using file-level targeting.",detail:String(a)}]})}}}return s}async supportFiles(t,e){return e.entries.filter(s=>s.status!=="deleted"&&t.configuration.support.some(i=>X(s.path,i,{dot:!0}))).map(s=>s.path)}async setupPlan(t){if(t.configuration.setup)return ge(t.configuration.setup,{worktree:t.worktreeRoot});let e=(0,xe.resolve)(t.worktreeRoot,t.projectRoot),s=await Vo(e);return ge({pnpm:["pnpm","install","--frozen-lockfile"],npm:["npm","ci"],yarn:["yarn","install","--immutable"],bun:["bun","install","--frozen-lockfile"]}[s],{worktree:t.worktreeRoot})}async targetedTestPlan(t,e){if(e.configuration.targetedTest)return ge(e.configuration.targetedTest,{test_id:t.id,test_file:t.file,worktree:e.worktreeRoot});let s=(0,xe.resolve)(e.worktreeRoot,e.projectRoot),i=await qo(s),n=Uo(i),a=await Vo(s),o=a==="npm"?["npx","--no-install"]:[a,"exec"],c=e.projectRoot==="."?t.file:t.file.slice(e.projectRoot.length+1),l=n==="vitest"?[...o,"vitest","run",c,...t.granularity==="case"?["-t",t.displayName]:[]]:[...o,"jest","--runInBand",c,...t.granularity==="case"?["-t",t.displayName]:[]];return ge(l,{})}async suitePlan(t){if(t.configuration.suite)return ge(t.configuration.suite,{worktree:t.worktreeRoot});let e=await Vo((0,xe.resolve)(t.worktreeRoot,t.projectRoot));return ge(e==="npm"?["npm","test","--","--runInBand"]:[e,"test"],{})}normalize(t){return Vw(t)}};var Dp=require("child_process"),bs=require("fs/promises"),be=require("path"),Rp=require("util");var Fp=(0,Rp.promisify)(Dp.execFile),Hw=["**/test_*.py","**/*_test.py"],$p=["pyproject.toml","pytest.ini","setup.cfg","setup.py"],Kw=new Set([".git",".venv","venv","__pycache__","dist","build"]);async function jp(r,t=0){if(t>4)return[];let e=[],s;try{s=await(0,bs.readdir)(r,{withFileTypes:!0})}catch{return e}s.some(i=>i.isFile()&&$p.includes(i.name))&&e.push(r);for(let i of s)i.isDirectory()&&!Kw.has(i.name)&&e.push(...await jp((0,be.join)(r,i.name),t+1));return e}function Ww(r,t){return(t.configuration.include.length?t.configuration.include:Hw).some(s=>X(r,s,{dot:!0}))&&!t.configuration.exclude.some(s=>X(r,s,{dot:!0}))}async function Bp(){for(let r of process.platform==="win32"?["python","py"]:["python3","python"])try{return await Fp(r,["--version"],{windowsHide:!0}),r}catch{}return"python"}async function zw(r){try{let t=await Bp(),e=["import ast,json,sys","tree=ast.parse(open(sys.argv[1],encoding='utf-8').read())","out=[]","def walk(body,prefix=[]):"," for n in body:"," if isinstance(n,(ast.FunctionDef,ast.AsyncFunctionDef)) and n.name.startswith('test_'): out.append({'name':'::'.join(prefix+[n.name]),'line':min([n.lineno]+[d.lineno for d in n.decorator_list]),'endLine':getattr(n,'end_lineno',n.lineno)})"," elif isinstance(n,ast.ClassDef) and n.name.startswith('Test'): walk(n.body,prefix+[n.name])","walk(tree.body)","print(json.dumps(out))"].join(`
174
+ `),s=t==="py"?["-3","-c",e,r]:["-c",e,r],{stdout:i}=await Fp(t,s,{encoding:"utf8",windowsHide:!0});return JSON.parse(i)}catch{let t=await(0,bs.readFile)(r,"utf8"),e=[],s=null,i=t.split(/\r?\n/),n=null;return i.forEach((a,o)=>{let c=a.match(/^\s*/)?.[0].replaceAll(" "," ").length??0,l=/^\s*class\s+(Test\w*)\b/.exec(a);l?.[1]?s={name:l[1],indent:c}:s&&a.trim()&&c<=s.indent&&(s=null);let u=/^\s*(?:async\s+)?def\s+(test_\w*)\s*\(/.exec(a);if(u?.[1]){let h=o+1;for(let p=o+1;p<i.length;p+=1){let f=i[p]??"";if(!f.trim())continue;if((f.match(/^\s*/)?.[0].replaceAll(" "," ").length??0)<=c)break;h=p+1}e.push({name:s?`${s.name}::${u[1]}`:u[1],line:n??o+1,endLine:h}),n=null}else/^\s*@/.test(a)?n??=o+1:a.trim()&&!l&&(n=null)}),e}}function Gw(r){if(r.interrupted)return"interrupted";if(r.timedOut)return"timeout";if(r.exitCode===0)return"pass";let t=`${r.stdout}
175
+ ${r.stderr}`;return r.exitCode===1&&(/=+ FAILURES =+/.test(t)||/\bAssertionError\b/.test(t)||/\bassert .+/.test(t))?"assertion_failure":"infrastructure_failure"}function Br(r,t){let e=(0,be.resolve)(r,t,".patchproof-venv");return process.platform==="win32"?(0,be.join)(e,"Scripts","python.exe"):(0,be.join)(e,"bin","python")}var qr=class{name="python";async detect(t){let e=await jp(t),s=e.map(i=>(0,be.relative)(t,i).replaceAll("\\","/")||".");return{adapter:this.name,confidence:e.length?"high":"none",projectRoots:s,evidence:s.map(i=>`${i} (Python project marker)`)}}async validate(t){let e=(0,be.resolve)(t.repositoryRoot,t.projectRoot);return(await(0,bs.readdir)(e)).some(i=>$p.includes(i))||t.configuration.targetedTest?[]:[{code:"PP_ADAPTER_UNSUPPORTED_PROJECT",severity:"error",summary:"No supported Python project marker was found."}]}async discoverTests(t,e){let s=[];for(let i of e.entries){let n=t.projectRoot==="."?i.path:i.path.startsWith(`${t.projectRoot}/`)?i.path.slice(t.projectRoot.length+1):"";if(!(!n||!Ww(n,t))){if(i.status==="deleted"){s.push({id:n,file:i.path,displayName:n,changeKind:"deleted",granularity:"file",changedRanges:i.changedRanges,selectionReason:"The test file was deleted and cannot be evaluated.",diagnostics:[]});continue}try{let a=(await zw((0,be.resolve)(t.repositoryRoot,i.path))).filter(o=>i.status==="added"||i.addedLines.some(c=>c>=o.line&&c<=o.endLine));if(!a.length)throw new Error("No statically changed pytest case found.");s.push(...a.map(o=>({id:`${n}::${o.name}`,file:i.path,displayName:o.name,changeKind:i.status==="added"?"added":"modified",granularity:"case",line:o.line,sourceRange:{startLine:o.line,endLine:o.endLine},changedRanges:i.changedRanges,selectionReason:i.status==="added"?"The test was added in the head revision.":"Changed lines overlap the test's source span.",diagnostics:[]})))}catch(a){s.push({id:n,file:i.path,displayName:n,changeKind:i.status==="added"?"added":"modified",granularity:"file",changedRanges:i.changedRanges,selectionReason:"The changed test file could not be targeted reliably by case.",fallbackReason:String(a),diagnostics:[{code:"PP_DISCOVERY_FILE_FALLBACK",severity:"warning",summary:"Dynamic or ambiguous pytest syntax required file-level targeting.",detail:String(a)}]})}}}return s}async supportFiles(t,e){return e.entries.filter(s=>s.status!=="deleted"&&t.configuration.support.some(i=>X(s.path,i,{dot:!0}))).map(s=>s.path)}async setupPlan(t){if(t.configuration.setup)return ge(t.configuration.setup,{worktree:t.worktreeRoot});let e=await Bp(),s=(0,be.resolve)(t.worktreeRoot,t.projectRoot),i=(0,be.resolve)(s,".patchproof-venv"),n=".";try{let o=await(0,bs.readFile)((0,be.resolve)(s,"pyproject.toml"),"utf8");(/\[project\.optional-dependencies\][\s\S]*?(?:^|\n)test\s*=/m.test(o)||/\[project\.optional-dependencies\][\s\S]*?(?:^|\n)tests\s*=/m.test(o))&&(n=".[test]")}catch{}let a=process.platform==="win32"?`${e} -m venv "${i}" && "${Br(t.worktreeRoot,t.projectRoot)}" -m pip install -e "${n}"`:`${e} -m venv '${i}' && '${Br(t.worktreeRoot,t.projectRoot)}' -m pip install -e '${n}'`;return{shell:a,display:a}}async targetedTestPlan(t,e){if(e.configuration.targetedTest)return ge(e.configuration.targetedTest,{test_id:t.id,test_file:t.file,worktree:e.worktreeRoot});let s=e.projectRoot==="."?t.file:t.file.slice(e.projectRoot.length+1),i=t.granularity==="case"?`${s}::${t.displayName.replaceAll(" > ","::")}`:s;return ge([Br(e.worktreeRoot,e.projectRoot),"-m","pytest","-q",i],{})}async suitePlan(t){return t.configuration.suite?ge(t.configuration.suite,{worktree:t.worktreeRoot}):ge([Br(t.worktreeRoot,t.projectRoot),"-m","pytest","-q"],{})}normalize(t){return Gw(t)}};var Up=require("child_process"),qe=require("fs/promises"),Vp=require("os"),re=require("path"),Hp=require("util");var Kp=(0,Hp.promisify)(Up.execFile);async function _e(r,t){let{stdout:e}=await Kp("git",["-C",r,...t],{encoding:"utf8",windowsHide:!0,maxBuffer:10485760});return e.trim()}async function Ko(r){return(0,re.resolve)(await _e(r,["rev-parse","--show-toplevel"]))}async function yi(r,t){try{return await _e(r,["rev-parse","--verify",`${t}^{commit}`])}catch{throw new Error(`Git revision '${t}' is unavailable. Fetch full history and retry.`)}}async function Wo(r,t="HEAD"){let e=["origin/main","main","origin/master","master"];for(let s of e)try{return await _e(r,["merge-base",s,t])}catch{}throw new Error("Unable to infer a base revision. Pass --base explicitly.")}async function zo(r,t,e){try{return await _e(r,["merge-base","--is-ancestor",t,e]),!0}catch{return!1}}async function Go(r){return await _e(r,["status","--porcelain=v1","--untracked-files=normal"])!==""}function Jw(r){let t=new Map,e="",s=0;for(let i of r.split(/\r?\n/))if(i.startsWith("+++ b/"))e=i.slice(6),t.has(e)||t.set(e,[]);else if(i.startsWith("@@")){let n=/\+(\d+)(?:,(\d+))?/.exec(i);s=n?Number(n[1]):0}else e&&i.startsWith("+")&&!i.startsWith("+++")?(t.get(e)?.push(s),s+=1):e&&!i.startsWith("-")&&(s+=1);return t}function qp(r){let t=[...new Set(r)].sort((s,i)=>s-i),e=[];for(let s of t){let i=e.at(-1);i&&s<=i.endLine+1?i.endLine=s:e.push({startLine:s,endLine:s})}return e}async function Jo(r,t,e){let s=await _e(r,["diff","--find-renames","--name-status","--no-ext-diff",t,e,"--"]),i=await _e(r,["diff","--unified=0","--no-ext-diff",t,e,"--"]),n=Jw(i),a=[];for(let o of s.split(/\r?\n/).filter(Boolean)){let[c,l,u]=o.split(" ");if(!c||!l)continue;let h=c[0];h==="R"&&u?a.push({status:"renamed",oldPath:l,path:u,addedLines:n.get(u)??[],changedRanges:qp(n.get(u)??[])}):a.push({status:h==="A"?"added":h==="D"?"deleted":"modified",path:l,addedLines:n.get(l)??[],changedRanges:qp(n.get(l)??[])})}return{baseSha:t,headSha:e,entries:a}}function Yw(r){let t=r.replaceAll("\\","/");if((0,re.isAbsolute)(r)||t===".."||t.startsWith("../")||t.includes("/../"))throw new Error(`Unsafe repository path: ${r}`);return t}async function Wp(r,t,e){let s=await(0,qe.mkdtemp)((0,re.join)((0,Vp.tmpdir)(),"patchproof-")),i=(0,re.join)(s,"base"),n=(0,re.join)(s,"head"),a=(0,re.join)(s,"cleanup.json");await(0,qe.writeFile)(a,JSON.stringify({repositoryRoot:r,paths:[i,n]}),"utf8");let o=[];try{await _e(r,["worktree","add","--detach",i,t]),o.push(i),await _e(r,["worktree","add","--detach",n,e]),o.push(n)}catch(c){for(let l of o.reverse())try{await _e(r,["worktree","remove","--force",l])}catch{}throw await(0,qe.rm)(s,{recursive:!0,force:!0}),c}return{root:s,base:i,head:n,async cleanup(){let c=[];for(let l of[i,n])try{await _e(r,["worktree","remove","--force",l])}catch(u){c.push(`${l}: ${String(u)}`)}return c.length||await(0,qe.rm)(s,{recursive:!0,force:!0}),c}}}async function zp(r,t,e,s,i){for(let n of s){let a=Yw(n);if(!i.some(u=>X(a,u,{dot:!0})))throw new Error(`Refusing to transplant non-test path '${a}'.`);let o;try{let{stdout:u}=await Kp("git",["-C",r,"show",`${t}:${a}`],{encoding:"buffer",windowsHide:!0,maxBuffer:20971520});o=u}catch{throw new Error(`Unable to read '${a}' from head revision.`)}let c=(0,re.resolve)(e,...a.split("/")),l=(0,re.relative)((0,re.resolve)(e),c);if(l.startsWith(`..${re.sep}`)||l==="..")throw new Error(`Path escapes worktree: ${a}`);await(0,qe.mkdir)((0,re.dirname)(c),{recursive:!0}),await(0,qe.writeFile)(c,o)}}var Yo=require("child_process"),Ue=Ts(require("process"),1);function Zw(r){return r.split(/\r?\n/).map(t=>t.startsWith("::")?`\u200B${t}`:t).join(`
176
+ `)}function Gp(r,t){let e=r;for(let s of t)s&&(e=e.split(s).join("[REDACTED]"));return Zw(e)}async function Xw(r){if(Ue.default.platform==="win32"){await new Promise(t=>{let e=(0,Yo.spawn)("taskkill",["/pid",String(r),"/T","/F"],{stdio:"ignore"});e.once("close",()=>t()),e.once("error",()=>t())});return}try{Ue.default.kill(-r,"SIGTERM"),await new Promise(t=>setTimeout(t,750)),Ue.default.kill(-r,"SIGKILL")}catch{}}async function Jp(r,t){let e=t.maxOutputBytes??256e3,s=r.shell!==void 0,i=s?Ue.default.platform==="win32"?Ue.default.env.ComSpec??"cmd.exe":Ue.default.env.SHELL??"/bin/sh":r.executable,n=s?Ue.default.platform==="win32"?["/d","/s","/c",r.shell]:["-c",r.shell]:[...r.args??[]];if(!i)throw new Error("Command has no executable.");return await new Promise((a,o)=>{let c=Buffer.alloc(0),l=Buffer.alloc(0),u=!1,h=!1,p=!1,f=!1,y=(0,Yo.spawn)(i,n,{cwd:t.cwd,env:{...Ue.default.env,...t.env},windowsHide:!0,detached:Ue.default.platform!=="win32",stdio:["ignore","pipe","pipe"]}),d=(P,v)=>{if(P.length>=e)return u=!0,P;let E=e-P.length;return v.length>E&&(u=!0),Buffer.concat([P,v.subarray(0,E)])};y.stdout.on("data",P=>{c=d(c,P)}),y.stderr.on("data",P=>{l=d(l,P)});let g=P=>{P==="timeout"?h=!0:p=!0,y.kill("SIGKILL"),y.pid&&Xw(y.pid)},x=setTimeout(()=>g("timeout"),t.timeoutMs),b=()=>g("interrupted");t.signal?.addEventListener("abort",b,{once:!0}),y.once("error",P=>{clearTimeout(x),t.signal?.removeEventListener("abort",b),f||(f=!0,o(P))}),y.once("close",(P,v)=>{if(clearTimeout(x),t.signal?.removeEventListener("abort",b),f)return;f=!0;let E=t.redactions??[];a({exitCode:P,signal:v,stdout:Gp(c.toString("utf8"),E),stderr:Gp(l.toString("utf8"),E),timedOut:h,interrupted:p,truncated:u})})})}var Hr=require("os"),Qw=/(token|secret|password|passwd|api[_-]?key|credential|authorization|cookie)/i;function Ur(r){return r?[...new Set([r,r.replaceAll("\\","/"),r.replaceAll("/","\\")])]:[]}function Xo(r=process.env){return Object.entries(r).filter(([t,e])=>Qw.test(t)&&!!e).map(([,t])=>t).filter(t=>t.length>=4)}function me(r,t){let e=r,s=[...Ur(t.repositoryRoot).map(i=>[i,"<repository>"]),...Ur(t.worktreeRoot??"").map(i=>[i,"<worktrees>"]),...Ur((0,Hr.homedir)()).map(i=>[i,"<home>"]),...Ur((0,Hr.tmpdir)()).map(i=>[i,"<temp>"]),...Xo().map(i=>[i,"[REDACTED]"])];for(let[i,n]of s)i&&(e=e.split(i).join(n));return e=e.replace(/((?:token|secret|password|passwd|api[_-]?key|credential|authorization|cookie)\s*[=:]\s*)([^\s,;]+)/gi,"$1[REDACTED]"),e.split(/\r?\n/).map(i=>i.startsWith("::")?`\u200B${i}`:i).join(`
177
+ `)}function e1(r,t){return{...r.executable?{executable:me(r.executable,t)}:{},...r.args?{args:r.args.map(e=>me(e,t))}:{},...r.shell?{shell:me(r.shell,t)}:{},display:me(r.display,t)}}function Vr(r,t){if(r)return{...r,command:e1(r.command,t),stdout:me(r.stdout,t),stderr:me(r.stderr,t)}}function Zo(r,t){return{...r,summary:me(r.summary,t),...r.detail?{detail:me(r.detail,t)}:{},...r.remediation?{remediation:me(r.remediation,t)}:{}}}function Yp(r,t){return{...r,repository:{...r.repository,root:"<repository>"},tests:r.tests.map(e=>({...e,...e.base?{base:Vr(e.base,t)}:{},...e.head?{head:Vr(e.head,t)}:{},diagnostics:e.diagnostics.map(s=>Zo(s,t))})),suite:{...r.suite,...r.suite.base?{base:Vr(r.suite.base,t)}:{},...r.suite.head?{head:Vr(r.suite.head,t)}:{},diagnostics:r.suite.diagnostics.map(e=>Zo(e,t))},diagnostics:r.diagnostics.map(e=>Zo(e,t)),limitations:r.limitations.map(e=>me(e,t))}}var Zp=[new jr,new qr];async function ef(r,t,e){if(t){let a=Zp.find(c=>c.name===t),o=await a.detect(r);if(e==="."&&o.projectRoots.length>1)throw new Error(`Multiple ${t} projects were detected (${o.projectRoots.join(", ")}). Configure projectRoot.`);return{adapter:a,projectRoot:e==="."&&o.projectRoots.length===1?o.projectRoots[0]:e}}let i=(await Promise.all(Zp.map(async a=>({adapter:a,result:await a.detect(r)})))).filter(a=>a.result.confidence==="high");if(i.length!==1)throw new Error(i.length?`Multiple adapters match (${i.map(a=>a.adapter.name).join(", ")}). Pass --adapter.`:"No supported Vitest, Jest, or pytest project was detected. Pass --adapter and explicit commands.");let n=i[0];if(e==="."&&n.result.projectRoots.length>1)throw new Error(`Multiple projects were detected (${n.result.projectRoots.join(", ")}). Configure projectRoot.`);return{adapter:n.adapter,projectRoot:e==="."&&n.result.projectRoots.length===1?n.result.projectRoots[0]:e}}function tf(r,t,e){return{repositoryRoot:r,projectRoot:t,configuration:{...e.execution.setup?{setup:e.execution.setup}:{},...e.execution.targetedTest?{targetedTest:e.execution.targetedTest}:{},...e.execution.suite?{suite:e.execution.suite}:{},include:e.tests.include,exclude:e.tests.exclude,support:e.tests.support}}}function Qo(r,t,e){return{...r,worktreeRoot:t,role:e}}function t1(r,t,e,s,i,n){return{command:r,cwdRole:t,startedAt:e,durationMs:Math.round(gi.performance.now()-s),exitCode:i.exitCode,signal:i.signal,outcome:n,stdout:i.stdout,stderr:i.stderr,truncated:i.truncated}}function Xp(r){let t=[r.stderr.trim(),r.stdout.trim()].filter(Boolean).join(`
178
+ `),e=t.length>4e3?`${t.slice(-4e3)}
179
+ [earlier output omitted]`:t;return[`Command: ${r.command.display}`,`Exit code: ${r.exitCode??"none"}`,e?`Output:
180
+ ${e}`:"The command produced no output."].join(`
181
+ `)}async function ws(r,t,e,s,i){let n=new Date().toISOString(),a=gi.performance.now(),o=await Jp(t,{cwd:(0,Qp.resolve)(e.worktreeRoot,e.projectRoot),timeoutMs:s,signal:i,redactions:[e.repositoryRoot,e.worktreeRoot,...Xo()]});return t1(t,e.role,n,a,o,r.normalize(o,"test"))}async function sf(r){let t=new Date().toISOString(),e=gi.performance.now(),s=r.repositoryRoot,i=r.config.base??await Wo(s,r.config.head??"HEAD"),n=r.config.head??"HEAD",[a,o,c]=await Promise.all([yi(s,i),yi(s,n),Go(s)]);if(c&&!r.allowDirty)throw new Error("The active worktree is dirty. Commit/stash changes or pass --allow-dirty.");if(a===o)throw new Error("Base and head resolve to the same commit, so there is no patch to prove. Check out a feature/demo branch or pass --base origin/main --head <branch-or-commit>.");if(!await zo(s,a,o))throw new Error("Base is not an ancestor of head. Choose a valid comparison base.");let l=await ef(s,r.config.adapter,r.config.projectRoot),u=tf(s,l.projectRoot,r.config),h=await l.adapter.validate(u);if(h.some(f=>f.severity==="error"))throw new Error(h.map(f=>f.summary).join(" "));return{preview:{repositoryRoot:s,baseSha:a,headSha:o,adapter:l.adapter.name,projectRoot:l.projectRoot,commands:[r.config.execution.setup?String(r.config.execution.setup):"adapter-inferred setup",r.config.execution.targetedTest?String(r.config.execution.targetedTest):"adapter-inferred targeted test",r.config.execution.suite?String(r.config.execution.suite):"adapter-inferred suite"]},async execute(){let f=[...h],y;try{r.onProgress?.("Computing changed tests");let d=await Jo(s,a,o),g=await l.adapter.discoverTests(u,d),x=g.filter(Q=>Q.changeKind!=="deleted"),b=g.filter(Q=>Q.changeKind==="deleted");for(let Q of b)f.push({code:"PP_TEST_DELETED",severity:"warning",summary:`Deleted test '${Q.id}' cannot be proven.`});r.onProgress?.("Creating isolated Git worktrees"),y=await Wp(s,a,o);let P=Qo(u,y.base,"base"),v=Qo(u,y.head,"head"),E=await l.adapter.setupPlan(P),L=await l.adapter.setupPlan(v);if(E){r.onProgress?.("Preparing base dependencies");let Q=await ws(l.adapter,E,P,r.config.execution.suiteTimeoutSeconds*1e3,r.signal);if(Q.outcome!=="pass")throw new Error(`Base setup failed (${Q.outcome}).
182
+ ${Xp(Q)}`)}if(L){r.onProgress?.("Preparing head dependencies");let Q=await ws(l.adapter,L,v,r.config.execution.suiteTimeoutSeconds*1e3,r.signal);if(Q.outcome!=="pass")throw new Error(`Head setup failed (${Q.outcome}).
183
+ ${Xp(Q)}`)}r.onProgress?.("Comparing base and head suites");let[U,N]=await Promise.all([l.adapter.suitePlan(P),l.adapter.suitePlan(v)]),[Y,le]=await Promise.all([ws(l.adapter,U,P,r.config.execution.suiteTimeoutSeconds*1e3,r.signal),ws(l.adapter,N,v,r.config.execution.suiteTimeoutSeconds*1e3,r.signal)]),ye=Mc(Y.outcome,le.outcome),Z={status:ye,base:Y,head:le,diagnostics:ye==="regression"?[{code:"PP_HEAD_SUITE_REGRESSION",severity:"error",summary:"The suite passes on base and fails on head."}]:ye==="pre_existing_failure"?[{code:"PP_SUITE_PRE_EXISTING_FAILURE",severity:"warning",summary:"The suite fails on both revisions; this is not attributed to the patch."}]:[]},gt=await l.adapter.supportFiles(u,d),Ps=[...new Set([...x.map(Q=>Q.file),...gt])],xi=[...r.config.tests.include,...r.config.tests.support,"**/*.test.{js,jsx,ts,tsx,mjs,cjs}","**/*.spec.{js,jsx,ts,tsx,mjs,cjs}","**/test_*.py","**/*_test.py"];Ps.length&&(r.onProgress?.("Transplanting changed tests onto base"),await zp(s,o,y.base,Ps,xi));let Kt=[];for(let Q of x)r.onProgress?.(`Evaluating ${Q.id}`),Kt.push(await s1(l.adapter,Q,P,v,r.config.execution.timeoutSeconds*1e3,r.signal));let bi=Oc(Kt.map(Q=>Q.status),Z.status),wi={schemaVersion:1,tool:{name:Er,version:Bt},repository:{root:"<repository>",projectRoot:l.projectRoot,baseSha:a,headSha:o,dirtyOverride:c&&r.allowDirty},execution:{adapter:l.adapter.name,consent:r.consent,startedAt:t,durationMs:Math.round(gi.performance.now()-e)},tests:Kt,suite:Z,aggregate:bi,diagnostics:f,limitations:["PatchProof selects changed tests; it does not infer the production bug or prove the entire patch.","Proof applies only to the reported tests and revisions.","Commands run on the host with the current user's permissions.",...c&&r.allowDirty?["Uncommitted active-worktree changes were excluded from the comparison."]:[]]};return Yp(wi,{repositoryRoot:s,worktreeRoot:y.root})}finally{if(y&&!r.config.execution.keepWorktrees){let d=await y.cleanup();d.length&&r.onProgress?.(`Cleanup incomplete: ${d.join("; ")}`)}else y&&r.onProgress?.(`Retained worktrees at ${y.root}`)}}}}async function s1(r,t,e,s,i,n){try{let[a,o]=await Promise.all([r.targetedTestPlan(t,e),r.targetedTestPlan(t,s)]),[c,l]=await Promise.all([ws(r,a,e,i,n),ws(r,o,s,i,n)]);return{id:t.id,file:t.file,displayName:t.displayName,granularity:t.granularity,selection:{changedRanges:t.changedRanges,...t.sourceRange?{sourceRange:t.sourceRange}:{},reason:t.selectionReason,...t.fallbackReason?{fallbackReason:t.fallbackReason}:{}},status:_c(c.outcome,l.outcome),base:c,head:l,diagnostics:t.diagnostics}}catch(a){return{id:t.id,file:t.file,displayName:t.displayName,granularity:t.granularity,selection:{changedRanges:t.changedRanges,...t.sourceRange?{sourceRange:t.sourceRange}:{},reason:t.selectionReason,...t.fallbackReason?{fallbackReason:t.fallbackReason}:{}},status:"inconclusive",diagnostics:[...t.diagnostics,{code:"PP_TEST_EXECUTION_FAILED",severity:"error",summary:"The test could not be evaluated reliably.",detail:String(a)}]}}}async function rf(r){let t=r.repositoryRoot,e=r.config.base??await Wo(t,r.config.head??"HEAD"),s=r.config.head??"HEAD",[i,n,a]=await Promise.all([yi(t,e),yi(t,s),Go(t)]);if(a&&!r.allowDirty)throw new Error("The active worktree is dirty. Commit/stash changes or pass --allow-dirty.");if(!await zo(t,i,n))throw new Error("Base is not an ancestor of head. Choose a valid comparison base.");let o=await ef(t,r.config.adapter,r.config.projectRoot),c=tf(t,o.projectRoot,r.config),l=await o.adapter.validate(c);if(l.some(b=>b.severity==="error"))throw new Error(l.map(b=>b.summary).join(" "));let u=await Jo(t,i,n),h=await o.adapter.discoverTests(c,u),p=await o.adapter.supportFiles(c,u),f=Qo(c,t,"head"),[y,d]=await Promise.all([o.adapter.setupPlan(f),o.adapter.suitePlan(f)]),g=await Promise.all(h.filter(b=>b.changeKind!=="deleted").map(async b=>({testId:b.id,command:(await o.adapter.targetedTestPlan(b,f)).display}))),x={repositoryRoot:t};return{schemaVersion:1,tool:{name:Er,version:Bt},repository:{root:"<repository>",projectRoot:o.projectRoot,baseSha:i,headSha:n,dirtyOverride:a&&r.allowDirty},adapter:o.adapter.name,tests:h,supportFiles:p,commands:{setup:y?me(y.display,x):"none",targeted:g.map(b=>({...b,command:me(b.command,x)})),suite:me(d.display,x)},diagnostics:l,limitations:["Inspection identifies changed tests; it does not infer the production bug or execute repository code.","Dynamic test definitions may require visible file-level fallback."]}}function nf(r){return{proven:r.tests.filter(t=>t.status==="proven").length,not_proven:r.tests.filter(t=>t.status==="not_proven").length,still_failing:r.tests.filter(t=>t.status==="still_failing").length,inconclusive:r.tests.filter(t=>t.status==="inconclusive").length}}function i1(r){return`${JSON.stringify(r,null,2)}
184
+ `}function r1(r,t=!1){let e=nf(r),s=[`PatchProof ${r.tool.version}`,`Base: ${r.repository.baseSha.slice(0,12)}`,`Head: ${r.repository.headSha.slice(0,12)}`,`Adapter: ${r.execution.adapter}`,"",`Aggregate: ${r.aggregate.toUpperCase()}`,`Suite: ${r.suite.status}`];for(let i of r.tests){s.push(`${i.status.toUpperCase().padEnd(14)} ${i.id}`),s.push(` selected: ${i.selection.reason}`),i.selection.fallbackReason&&s.push(` fallback: ${i.selection.fallbackReason}`);for(let n of i.diagnostics)s.push(` ${n.code}: ${n.summary}`);t&&(i.base&&s.push(` base: ${i.base.command.display} (${i.base.outcome})`),i.head&&s.push(` head: ${i.head.command.display} (${i.head.outcome})`))}s.push("",`${e.proven} proven, ${e.not_proven} not proven, ${e.still_failing} still failing, ${e.inconclusive} inconclusive`);for(let i of[...r.diagnostics,...r.suite.diagnostics])s.push(`${i.severity.toUpperCase()} ${i.code}: ${i.summary}`),t&&i.detail&&s.push(` ${i.detail}`);return s.push("",...r.limitations.map(i=>`Limitation: ${i}`)),s.push("Reproduce with the same --base and --head revisions; use `patchproof inspect` to review selection first."),`${s.join(`
185
+ `)}
186
+ `}function n1(r){let t=nf(r),e=[`# PatchProof: ${r.aggregate.toUpperCase()}`,"",`- Base: \`${r.repository.baseSha}\``,`- Head: \`${r.repository.headSha}\``,`- Adapter: \`${r.execution.adapter}\``,`- Suite: **${r.suite.status}**`,"","| Status | Test | Selection | Base | Head |","|---|---|---|---|---|"];for(let s of r.tests)e.push(`| ${s.status} | \`${s.id}\` | ${s.selection.reason} | ${s.base?.outcome??"not run"} | ${s.head?.outcome??"not run"} |`);return e.push("",`${t.proven} proven \xB7 ${t.not_proven} not proven \xB7 ${t.still_failing} still failing \xB7 ${t.inconclusive} inconclusive`,"","## Limitations","",...r.limitations.map(s=>`- ${s}`)),`${e.join(`
187
+ `)}
188
+ `}function af(r,t,e=!1){return t==="json"?i1(r):t==="markdown"?n1(r):r1(r,e)}function of(r,t){if(t==="json")return`${JSON.stringify(r,null,2)}
189
+ `;let e=t==="markdown",s=e?["# PatchProof inspection","",`- Base: \`${r.repository.baseSha}\``,`- Head: \`${r.repository.headSha}\``,`- Adapter: \`${r.adapter}\``,"","## Selected tests",""]:[`PatchProof ${r.tool.version} inspection`,`Base: ${r.repository.baseSha}`,`Head: ${r.repository.headSha}`,`Adapter: ${r.adapter}`,"","Selected tests:"];r.tests.length||s.push(e?"- None":" None");for(let i of r.tests){let n=i.sourceRange?` lines ${i.sourceRange.startLine}-${i.sourceRange.endLine}`:"";s.push(e?`- \`${i.id}\` (${i.granularity}${n})`:` ${i.id} (${i.granularity}${n})`),s.push(e?` - ${i.selectionReason}`:` ${i.selectionReason}`),i.fallbackReason&&s.push(e?` - Fallback: ${i.fallbackReason}`:` Fallback: ${i.fallbackReason}`)}s.push("",e?"## Commands":"Commands:"),s.push(e?`- Setup: \`${r.commands.setup}\``:` Setup: ${r.commands.setup}`);for(let i of r.commands.targeted)s.push(e?`- \`${i.testId}\`: \`${i.command}\``:` ${i.testId}: ${i.command}`);return s.push(e?`- Suite: \`${r.commands.suite}\``:` Suite: ${r.commands.suite}`),s.push("",...r.limitations.map(i=>e?`- ${i}`:`Limitation: ${i}`)),`${s.join(`
190
+ `)}
191
+ `}function a1(r){let t=/^(\d+)(ms|s|m)?$/.exec(r);if(!t)throw new hn("Use a duration such as 120s or 2m.");let e=Number(t[1]),s=t[2]??"s",i=s==="m"?e*60:s==="ms"?Math.ceil(e/1e3):e;if(i<=0||i>86400)throw new hn("Duration is out of range.");return i}async function o1(r){if(G.default.stderr.write(["PatchProof will execute repository commands with your user permissions.",`Repository: ${r.repositoryRoot}`,`Base: ${r.baseSha}`,`Head: ${r.headSha}`,`Adapter: ${r.adapter}`,`Project: ${r.projectRoot}`,"Commands:",...r.commands.map(e=>` - ${e}`),""].join(`
192
+ `)),!G.default.stdin.isTTY)return!1;let t=(0,cf.createInterface)({input:G.default.stdin,output:G.default.stderr});try{return/^(y|yes)$/i.test((await t.question("Continue? [y/N] ")).trim())}finally{t.close()}}var Kr=new Nc().name("patchproof").description("Prove that changed regression tests distinguish head from base.").version(Bt);Kr.command("inspect").description("Show selected changed tests without executing repository code.").option("--base <ref>","base Git revision").option("--head <ref>","head Git revision").option("--config <path>","configuration file").option("--adapter <name>","javascript or python").option("--project-root <path>","project root inside the repository").option("--format <format>","text, markdown, or json","text").option("--output <path>","write inspection to a file").option("--allow-dirty","inspect committed revisions despite active changes").action(async r=>{try{let t=await Ko(G.default.cwd()),e=r.adapter===void 0?void 0:r.adapter==="javascript"||r.adapter==="python"?r.adapter:(()=>{throw new Error("--adapter must be javascript or python.")})(),s=r.format==="text"||r.format==="markdown"||r.format==="json"?r.format:(()=>{throw new Error("--format must be text, markdown, or json.")})(),{config:i}=await Za(t,r.config,{base:r.base,head:r.head,adapter:e,projectRoot:r.projectRoot}),n=await rf({repositoryRoot:t,config:i,allowDirty:!!r.allowDirty}),a=of(n,s);r.output?await(0,ec.writeFile)(String(r.output),a,"utf8"):G.default.stdout.write(a)}catch(t){G.default.stderr.write(`PatchProof error: ${t instanceof Error?t.message:String(t)}
193
+ `),G.default.exitCode=2}});Kr.command("check").description("Evaluate changed tests against base and head revisions.").option("--base <ref>","base Git revision").option("--head <ref>","head Git revision").option("--config <path>","configuration file").option("--adapter <name>","javascript or python").option("--project-root <path>","project root inside the repository").option("--test-command <command>","trusted targeted test shell command").option("--suite-command <command>","trusted suite shell command").option("--setup-command <command>","trusted setup shell command").option("--timeout <duration>","per-test timeout",a1).option("--format <format>","text, markdown, or json").option("--output <path>","write report to a file").option("--yes","approve host execution").option("--allow-dirty","compare committed revisions despite active changes").option("--keep-worktrees","retain temporary worktrees").option("--no-color","disable color").option("--quiet","suppress progress").option("--debug","include detailed evidence").action(async r=>{let t=new AbortController,e=!1,s=!1,i=()=>{e=!0,t.abort()};G.default.once("SIGINT",i),G.default.once("SIGTERM",i);try{let n=await Ko(G.default.cwd()),a=r.adapter===void 0?void 0:r.adapter==="javascript"||r.adapter==="python"?r.adapter:(()=>{throw new Error("--adapter must be javascript or python.")})(),o=r.format===void 0?void 0:r.format==="text"||r.format==="markdown"||r.format==="json"?r.format:(()=>{throw new Error("--format must be text, markdown, or json.")})(),c={base:r.base,head:r.head,adapter:a,projectRoot:r.projectRoot,setup:r.setupCommand,targetedTest:r.testCommand,suite:r.suiteCommand,timeoutSeconds:r.timeout,format:o,output:r.output,approved:r.yes,keepWorktrees:r.keepWorktrees},{config:l}=await Za(n,r.config,c),h=G.default.env.CI==="true"||G.default.env.GITHUB_ACTIONS==="true"?"ci":r.yes?"flag":l.execution.approved?"configuration":"interactive",p=await sf({repositoryRoot:n,config:l,allowDirty:!!r.allowDirty,consent:h,signal:t.signal,onProgress:r.quiet?void 0:d=>G.default.stderr.write(`${d}
194
+ `)});if(h==="interactive"&&!await o1(p.preview)){G.default.stderr.write(`Execution declined. No repository commands were run.
195
+ `),G.default.exitCode=4;return}s=!0;let f=await p.execute(),y=af(f,l.report.format,!!r.debug);l.report.output?await(0,ec.writeFile)(l.report.output,y,"utf8"):G.default.stdout.write(y),G.default.exitCode=Lc(f.aggregate)}catch(n){e?(G.default.stderr.write(`PatchProof was interrupted.
196
+ `),G.default.exitCode=4):(G.default.stderr.write(`PatchProof error: ${n instanceof Error?n.message:String(n)}
197
+ `),G.default.exitCode=s?3:2)}finally{G.default.removeListener("SIGINT",i),G.default.removeListener("SIGTERM",i)}});G.default.argv.length<=2&&Kr.help();Kr.parseAsync(G.default.argv).catch(r=>{G.default.stderr.write(`PatchProof error: ${r instanceof Error?r.message:String(r)}
198
+ `),G.default.exitCode=5});