@godaddy/cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js ADDED
@@ -0,0 +1,516 @@
1
+ #!/usr/bin/env node
2
+ var kC=Object.create;var Mv=Object.defineProperty;var DC=Object.getOwnPropertyDescriptor;var $C=Object.getOwnPropertyNames;var PC=Object.getPrototypeOf,jC=Object.prototype.hasOwnProperty;var _e=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Uv=(e,t)=>()=>(e&&(t=e(e=0)),t);var T=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var qC=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of $C(t))!jC.call(e,i)&&i!==r&&Mv(e,i,{get:()=>t[i],enumerable:!(n=DC(t,i))||n.enumerable});return e};var Fn=(e,t,r)=>(r=e!=null?kC(PC(e)):{},qC(t||!e||!e.__esModule?Mv(r,"default",{value:e,enumerable:!0}):r,e));import{createRequire as FC}from"node:module";var u=Uv(()=>{"use strict";globalThis.require=FC(import.meta.url)});var Eo=T(jp=>{"use strict";u();var vc=class extends Error{constructor(t,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},Pp=class extends vc{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};jp.CommanderError=vc;jp.InvalidArgumentError=Pp});var Tc=T(Fp=>{"use strict";u();var{InvalidArgumentError:MC}=Eo(),qp=class{constructor(t,r){switch(this.description=r||"",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.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:r.concat(t)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new MC(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function UC(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}Fp.Argument=qp;Fp.humanReadableArgName=UC});var Bp=T(Up=>{"use strict";u();var{humanReadableArgName:BC}=Tc(),Mp=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 r=t.commands.filter(i=>!i._hidden),n=t._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,s)=>i.name().localeCompare(s.name())),r}compareOptions(t,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(t).localeCompare(n(r))}visibleOptions(t){let r=t.options.filter(i=>!i.hidden),n=t._getHelpOption();if(n&&!n.hidden){let i=n.short&&t._findOption(n.short),s=n.long&&t._findOption(n.long);!i&&!s?r.push(n):n.long&&!s?r.push(t.createOption(n.long,n.description)):n.short&&!i&&r.push(t.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let n=t.parent;n;n=n.parent){let i=n.options.filter(s=>!s.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(n=>BC(n)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let n="";for(let i=t.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];return t.argChoices&&r.push(`choices: ${t.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0?`${t.description} (${r.join(", ")})`:t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return t.description?`${t.description} ${n}`:n}return t.description}formatHelp(t,r){let n=r.padWidth(t,r),i=r.helpWidth??80;function s(d,f){return r.formatItem(d,n,f,r)}let o=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],a=r.commandDescription(t);a.length>0&&(o=o.concat([r.boxWrap(r.styleCommandDescription(a),i),""]));let c=r.visibleArguments(t).map(d=>s(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));c.length>0&&(o=o.concat([r.styleTitle("Arguments:"),...c,""]));let l=r.visibleOptions(t).map(d=>s(r.styleOptionTerm(r.optionTerm(d)),r.styleOptionDescription(r.optionDescription(d))));if(l.length>0&&(o=o.concat([r.styleTitle("Options:"),...l,""])),r.showGlobalOptions){let d=r.visibleGlobalOptions(t).map(f=>s(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));d.length>0&&(o=o.concat([r.styleTitle("Global Options:"),...d,""]))}let p=r.visibleCommands(t).map(d=>s(r.styleSubcommandTerm(r.subcommandTerm(d)),r.styleSubcommandDescription(r.subcommandDescription(d))));return p.length>0&&(o=o.concat([r.styleTitle("Commands:"),...p,""])),o.join(`
3
+ `)}displayWidth(t){return Bv(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).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(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).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,r){return Math.max(r.longestOptionTermLength(t,r),r.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,r,n,i){let o=" ".repeat(2);if(!n)return o+t;let a=t.padEnd(r+t.length-i.displayWidth(t)),c=2,p=(this.helpWidth??80)-r-c-2,d;return p<this.minWidthToWrap||i.preformatted(n)?d=n:d=i.boxWrap(n,p).replace(/\n/g,`
4
+ `+" ".repeat(r+c)),o+a+" ".repeat(c)+d.replace(/\n/g,`
5
+ ${o}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let n=t.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,s=[];return n.forEach(o=>{let a=o.match(i);if(a===null){s.push("");return}let c=[a.shift()],l=this.displayWidth(c[0]);a.forEach(p=>{let d=this.displayWidth(p);if(l+d<=r){c.push(p),l+=d;return}s.push(c.join(""));let f=p.trimStart();c=[f],l=this.displayWidth(f)}),s.push(c.join(""))}),s.join(`
6
+ `)}};function Bv(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}Up.Help=Mp;Up.stripColor=Bv});var Hp=T(Gp=>{"use strict";u();var{InvalidArgumentError:VC}=Eo(),Vp=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let n=KC(t);this.short=n.shortFlag,this.long=n.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}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),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}_concatValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:r.concat(t)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new VC(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Vv(this.name().replace(/^no-/,"")):Vv(this.name())}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Kp=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(t,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,s=i!==void 0?i:!1;return r.negate===(s===t)}};function Vv(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function KC(e){let t,r,n=/^-[^-]$/,i=/^--[^-]/,s=e.split(/[ |,]+/).concat("guard");if(n.test(s[0])&&(t=s.shift()),i.test(s[0])&&(r=s.shift()),!t&&n.test(s[0])&&(t=s.shift()),!t&&i.test(s[0])&&(t=r,r=s.shift()),s[0].startsWith("-")){let o=s[0],a=`option creation failed due to '${o}' in option flags '${e}'`;throw/^-[^-][^-]/.test(o)?new Error(`${a}
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')`):n.test(o)?new Error(`${a}
10
+ - too many short flags`):i.test(o)?new Error(`${a}
11
+ - too many long flags`):new Error(`${a}
12
+ - unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}Gp.Option=Vp;Gp.DualOptions=Kp});var Gv=T(Kv=>{"use strict";u();function GC(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let n=0;n<=e.length;n++)r[n]=[n];for(let n=0;n<=t.length;n++)r[0][n]=n;for(let n=1;n<=t.length;n++)for(let i=1;i<=e.length;i++){let s=1;e[i-1]===t[n-1]?s=0:s=1,r[i][n]=Math.min(r[i-1][n]+1,r[i][n-1]+1,r[i-1][n-1]+s),i>1&&n>1&&e[i-1]===t[n-2]&&e[i-2]===t[n-1]&&(r[i][n]=Math.min(r[i][n],r[i-2][n-2]+1))}return r[e.length][t.length]}function HC(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(o=>o.slice(2)));let n=[],i=3,s=.4;return t.forEach(o=>{if(o.length<=1)return;let a=GC(e,o),c=Math.max(e.length,o.length);(c-a)/c>s&&(a<i?(i=a,n=[o]):a===i&&n.push(o))}),n.sort((o,a)=>o.localeCompare(a)),r&&(n=n.map(o=>`--${o}`)),n.length>1?`
13
+ (Did you mean one of ${n.join(", ")}?)`:n.length===1?`
14
+ (Did you mean ${n[0]}?)`:""}Kv.suggestSimilar=HC});var Wv=T(Yp=>{"use strict";u();var QC=_e("node:events").EventEmitter,Qp=_e("node:child_process"),En=_e("node:path"),Ec=_e("node:fs"),Me=_e("node:process"),{Argument:zC,humanReadableArgName:WC}=Tc(),{CommanderError:zp}=Eo(),{Help:JC,stripColor:YC}=Bp(),{Option:Hv,DualOptions:XC}=Hp(),{suggestSimilar:Qv}=Gv(),Wp=class e extends QC{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:r=>Me.stdout.write(r),writeErr:r=>Me.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>Me.stdout.isTTY?Me.stdout.columns:void 0,getErrHelpWidth:()=>Me.stderr.isTTY?Me.stderr.columns:void 0,getOutHasColors:()=>Jp()??(Me.stdout.isTTY&&Me.stdout.hasColors?.()),getErrHasColors:()=>Jp()??(Me.stderr.isTTY&&Me.stderr.hasColors?.()),stripColor:r=>YC(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}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 r=this;r;r=r.parent)t.push(r);return t}command(t,r,n){let i=r,s=n;typeof i=="object"&&i!==null&&(s=i,i=null),s=s||{};let[,o,a]=t.match(/([^ ]+) *(.*)/),c=this.createCommand(o);return i&&(c.description(i),c._executableHandler=!0),s.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(s.noHelp||s.hidden),c._executableFile=s.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),i?this:c}createCommand(t){return new e(t)}createHelp(){return Object.assign(new JC,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(Object.assign(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,r){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 r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new zC(t,r)}argument(t,r,n,i){let s=this.createArgument(t,r);return typeof n=="function"?s.default(i).argParser(n):s.default(n),this.addArgument(s),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.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,r){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,this;t=t??"help [command]";let[,n,i]=t.match(/([^ ]+) *(.*)/),s=r??"display help for command",o=this.createCommand(n);return o.helpOption(!1),i&&o.arguments(i),s&&o.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=o,this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=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,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
16
+ Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,n){this._exitCallback&&this._exitCallback(new zp(t,r,n)),Me.exit(t)}action(t){let r=n=>{let i=this.registeredArguments.length,s=n.slice(0,i);return this._storeOptionsAsProperties?s[i]=this:s[i]=this.opts(),s.push(this),t.apply(this,s)};return this._actionHandler=r,this}createOption(t,r){return new Hv(t,r)}_callParseArg(t,r,n,i){try{return t.parseArg(r,n)}catch(s){if(s.code==="commander.invalidArgument"){let o=`${i} ${s.message}`;this.error(o,{exitCode:s.exitCode,code:s.code})}throw s}}_registerOption(t){let r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){let n=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 '${n}'
17
+ - already used by option '${r.flags}'`)}this.options.push(t)}_registerCommand(t){let r=i=>[i.name()].concat(i.aliases()),n=r(t).find(i=>this._findCommand(i));if(n){let i=r(this._findCommand(n)).join("|"),s=r(t).join("|");throw new Error(`cannot add command '${s}' as already have command '${i}'`)}this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),n=t.attributeName();if(t.negate){let s=t.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(n,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(n,t.defaultValue,"default");let i=(s,o,a)=>{s==null&&t.presetArg!==void 0&&(s=t.presetArg);let c=this.getOptionValue(n);s!==null&&t.parseArg?s=this._callParseArg(t,s,c,o):s!==null&&t.variadic&&(s=t._concatValue(s,c)),s==null&&(t.negate?s=!1:t.isBoolean()||t.optional?s=!0:s=""),this.setOptionValueWithSource(n,s,a)};return this.on("option:"+r,s=>{let o=`error: option '${t.flags}' argument '${s}' is invalid.`;i(s,o,"cli")}),t.envVar&&this.on("optionEnv:"+r,s=>{let o=`error: option '${t.flags}' value '${s}' from env '${t.envVar}' is invalid.`;i(s,o,"env")}),this}_optionEx(t,r,n,i,s){if(typeof r=="object"&&r instanceof Hv)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let o=this.createOption(r,n);if(o.makeOptionMandatory(!!t.mandatory),typeof i=="function")o.default(s).argParser(i);else if(i instanceof RegExp){let a=i;i=(c,l)=>{let p=a.exec(c);return p?p[0]:l},o.default(s).argParser(i)}else o.default(i);return this.addOption(o)}option(t,r,n,i){return this._optionEx({},t,r,n,i)}requiredOption(t,r,n,i){return this._optionEx({mandatory:!0},t,r,n,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,r){return this.setOptionValueWithSource(t,r,void 0)}setOptionValueWithSource(t,r,n){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=n,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(t)!==void 0&&(r=n.getOptionValueSource(t))}),r}_prepareUserArgs(t,r){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},t===void 0&&r.from===void 0){Me.versions?.electron&&(r.from="electron");let i=Me.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}t===void 0&&(t=Me.argv),this.rawArgs=t.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=t[1],n=t.slice(2);break;case"electron":Me.defaultApp?(this._scriptPath=t[1],n=t.slice(2)):n=t.slice(1);break;case"user":n=t.slice(0);break;case"eval":n=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(t,r){this._prepareForParse();let n=this._prepareUserArgs(t,r);return this._parseCommand([],n),this}async parseAsync(t,r){this._prepareForParse();let n=this._prepareUserArgs(t,r);return await this._parseCommand([],n),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,r,n){if(Ec.existsSync(t))return;let i=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",s=`'${t}' does not exist
19
+ - if '${n}' 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(s)}_executeSubCommand(t,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function s(p,d){let f=En.resolve(p,d);if(Ec.existsSync(f))return f;if(i.includes(En.extname(d)))return;let m=i.find(h=>Ec.existsSync(`${f}${h}`));if(m)return`${f}${m}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let p;try{p=Ec.realpathSync(this._scriptPath)}catch{p=this._scriptPath}a=En.resolve(En.dirname(p),a)}if(a){let p=s(a,o);if(!p&&!t._executableFile&&this._scriptPath){let d=En.basename(this._scriptPath,En.extname(this._scriptPath));d!==this._name&&(p=s(a,`${d}-${t._name}`))}o=p||o}n=i.includes(En.extname(o));let c;Me.platform!=="win32"?n?(r.unshift(o),r=zv(Me.execArgv).concat(r),c=Qp.spawn(Me.argv[0],r,{stdio:"inherit"})):c=Qp.spawn(o,r,{stdio:"inherit"}):(this._checkForMissingExecutable(o,a,t._name),r.unshift(o),r=zv(Me.execArgv).concat(r),c=Qp.spawn(Me.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{Me.on(d,()=>{c.killed===!1&&c.exitCode===null&&c.kill(d)})});let l=this._exitCallback;c.on("close",p=>{p=p??1,l?l(new zp(p,"commander.executeSubCommandAsync","(close)")):Me.exit(p)}),c.on("error",p=>{if(p.code==="ENOENT")this._checkForMissingExecutable(o,a,t._name);else if(p.code==="EACCES")throw new Error(`'${o}' not executable`);if(!l)Me.exit(1);else{let d=new zp(1,"commander.executeSubCommandAsync","(error)");d.nestedError=p,l(d)}}),this.runningCommand=c}_dispatchSubcommand(t,r,n){let i=this._findCommand(t);i||this.help({error:!0}),i._prepareForParse();let s;return s=this._chainOrCallSubCommandHook(s,i,"preSubcommand"),s=this._chainOrCall(s,()=>{if(i._executableHandler)this._executeSubCommand(i,r.concat(n));else return i._parseCommand(r,n)}),s}_dispatchHelpCommand(t){t||this.help();let r=this._findCommand(t);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,r)=>{t.required&&this.args[r]==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=(n,i,s)=>{let o=i;if(i!==null&&n.parseArg){let a=`error: command-argument value '${i}' is invalid for argument '${n.name()}'.`;o=this._callParseArg(n,i,s,a)}return o};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,i)=>{let s=n.defaultValue;n.variadic?i<this.args.length?(s=this.args.slice(i),n.parseArg&&(s=s.reduce((o,a)=>t(n,a,o),n.defaultValue))):s===void 0&&(s=[]):i<this.args.length&&(s=this.args[i],n.parseArg&&(s=t(n,s,n.defaultValue))),r[i]=s}),this.processedArgs=r}_chainOrCall(t,r){return t&&t.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let n=t,i=[];return this._getCommandAndAncestors().reverse().filter(s=>s._lifeCycleHooks[r]!==void 0).forEach(s=>{s._lifeCycleHooks[r].forEach(o=>{i.push({hookedCommand:s,callback:o})})}),r==="postAction"&&i.reverse(),i.forEach(s=>{n=this._chainOrCall(n,()=>s.callback(s.hookedCommand,this))}),n}_chainOrCallSubCommandHook(t,r,n){let i=t;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(s=>{i=this._chainOrCall(i,()=>s(this,r))}),i}_parseCommand(t,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(n.operands),r=n.unknown,this.args=t.concat(r),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),r);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,t,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let o;return o=this._chainOrCallHooks(o,"preAction"),o=this._chainOrCall(o,()=>this._actionHandler(this.processedArgs)),this.parent&&(o=this._chainOrCall(o,()=>{this.parent.emit(s,t,r)})),o=this._chainOrCallHooks(o,"postAction"),o}if(this.parent&&this.parent.listenerCount(s))i(),this._processArguments(),this.parent.emit(s,t,r);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,r);this.listenerCount("command:*")?this.emit("command:*",t,r):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(r=>r._name===t||r._aliases.includes(t))}_findOption(t){return this.options.find(r=>r.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(r=>{r.mandatory&&t.getOptionValue(r.attributeName())===void 0&&t.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(n=>{let i=n.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});t.filter(n=>n.conflictsWith.length>0).forEach(n=>{let i=t.find(s=>n.conflictsWith.includes(s.attributeName()));i&&this._conflictingOption(n,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],n=[],i=r,s=t.slice();function o(c){return c.length>1&&c[0]==="-"}let a=null;for(;s.length;){let c=s.shift();if(c==="--"){i===n&&i.push(c),i.push(...s);break}if(a&&!o(c)){this.emit(`option:${a.name()}`,c);continue}if(a=null,o(c)){let l=this._findOption(c);if(l){if(l.required){let p=s.shift();p===void 0&&this.optionMissingArgument(l),this.emit(`option:${l.name()}`,p)}else if(l.optional){let p=null;s.length>0&&!o(s[0])&&(p=s.shift()),this.emit(`option:${l.name()}`,p)}else this.emit(`option:${l.name()}`);a=l.variadic?l:null;continue}}if(c.length>2&&c[0]==="-"&&c[1]!=="-"){let l=this._findOption(`-${c[1]}`);if(l){l.required||l.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${l.name()}`,c.slice(2)):(this.emit(`option:${l.name()}`),s.unshift(`-${c.slice(2)}`));continue}}if(/^--[^=]+=/.test(c)){let l=c.indexOf("="),p=this._findOption(c.slice(0,l));if(p&&(p.required||p.optional)){this.emit(`option:${p.name()}`,c.slice(l+1));continue}}if(o(c)&&(i=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(c)){r.push(c),s.length>0&&n.push(...s);break}else if(this._getHelpCommand()&&c===this._getHelpCommand().name()){r.push(c),s.length>0&&r.push(...s);break}else if(this._defaultCommandName){n.push(c),s.length>0&&n.push(...s);break}}if(this._passThroughOptions){i.push(c),s.length>0&&i.push(...s);break}i.push(c)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let t={},r=this.options.length;for(let n=0;n<r;n++){let i=this.options[n].attributeName();t[i]=i===this._versionOptionName?this._version:this[i]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,r)=>Object.assign(t,r.opts()),{})}error(t,r){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 n=r||{},i=n.exitCode||1,s=n.code||"commander.error";this._exit(i,s,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in Me.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,Me.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new XC(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&t.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let n=o=>{let a=o.attributeName(),c=this.getOptionValue(a),l=this.options.find(d=>d.negate&&a===d.attributeName()),p=this.options.find(d=>!d.negate&&a===d.attributeName());return l&&(l.presetArg===void 0&&c===!1||l.presetArg!==void 0&&c===l.presetArg)?l:p||o},i=o=>{let a=n(o),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},s=`error: ${i(t)} cannot be used with ${i(r)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[],s=this;do{let o=s.createHelp().visibleOptions(s).filter(a=>a.long).map(a=>a.long);i=i.concat(o),s=s.parent}while(s&&!s._enablePositionalOptions);r=Qv(t,i)}let n=`error: unknown option '${t}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${t.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(s=>{i.push(s.name()),s.alias()&&i.push(s.alias())}),r=Qv(t,i)}let n=`error: unknown command '${t}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(t,r,n){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",n=n||"output the version number";let i=this.createOption(r,n);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,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(t);if(n){let i=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>WC(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}nameFromFilename(t){return this._name=En.basename(t,En.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),n=this._getOutputContext(t);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let i=r.formatHelp(this,r);return n.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(t){t=t||{};let r=!!t.error,n,i,s;return r?(n=a=>this._outputConfiguration.writeErr(a),i=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),i=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(i||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:i,helpWidth:s}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let n=this._getOutputContext(t),i={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(o=>o.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let s=this.helpInformation({error:n.error});if(r&&(s=r(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(o=>o.emit("afterAllHelp",i))}helpOption(t,r){return typeof t=="boolean"?(t?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(t=t??"-h, --help",r=r??"display help for command",this._helpOption=this.createOption(t,r),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this}help(t){this.outputHelp(t);let r=Number(Me.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(t))throw new Error(`Unexpected value for position to addHelpText.
26
+ Expecting one of '${n.join("', '")}'`);let i=`${t}Help`;return this.on(i,s=>{let o;typeof r=="function"?o=r({error:s.error,command:s.command}):o=r,o&&s.write(`${o}
27
+ `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function zv(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,n="127.0.0.1",i="9229",s;return(s=t.match(/^(--inspect(-brk)?)$/))!==null?r=s[1]:(s=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=s[1],/^\d+$/.test(s[3])?i=s[3]:n=s[3]):(s=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=s[1],n=s[3],i=s[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:t})}function Jp(){if(Me.env.NO_COLOR||Me.env.FORCE_COLOR==="0"||Me.env.FORCE_COLOR==="false")return!1;if(Me.env.FORCE_COLOR||Me.env.CLICOLOR_FORCE!==void 0)return!0}Yp.Command=Wp;Yp.useColor=Jp});var Zv=T(hr=>{"use strict";u();var{Argument:Jv}=Tc(),{Command:Xp}=Wv(),{CommanderError:ZC,InvalidArgumentError:Yv}=Eo(),{Help:eL}=Bp(),{Option:Xv}=Hp();hr.program=new Xp;hr.createCommand=e=>new Xp(e);hr.createOption=(e,t)=>new Xv(e,t);hr.createArgument=(e,t)=>new Jv(e,t);hr.Command=Xp;hr.Option=Xv;hr.Argument=Jv;hr.Help=eL;hr.CommanderError=ZC;hr.InvalidArgumentError=Yv;hr.InvalidOptionArgumentError=Yv});var nT=T((i6,rT)=>{"use strict";u();var yi=class e extends Error{constructor(t,r,n){super("[ParserError] "+t,r,n),this.name="ParserError",this.code="ParserError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}},xc=class{constructor(t){this.parser=t,this.buf="",this.returned=null,this.result=null,this.resultTable=null,this.resultArr=null}},xo=class{constructor(){this.pos=0,this.col=0,this.line=0,this.obj={},this.ctx=this.obj,this.stack=[],this._buf="",this.char=null,this.ii=0,this.state=new xc(this.parseStart)}parse(t){if(t.length===0||t.length==null)return;this._buf=String(t),this.ii=-1,this.char=-1;let r;for(;r===!1||this.nextChar();)r=this.runOne();this._buf=null}nextChar(){return this.char===10&&(++this.line,this.col=-1),++this.ii,this.char=this._buf.codePointAt(this.ii),++this.pos,++this.col,this.haveBuffer()}haveBuffer(){return this.ii<this._buf.length}runOne(){return this.state.parser.call(this,this.state.returned)}finish(){this.char=1114112;let t;do t=this.state.parser,this.runOne();while(this.state.parser!==t);return this.ctx=null,this.state=null,this._buf=null,this.obj}next(t){if(typeof t!="function")throw new yi("Tried to set state to non-existent state: "+JSON.stringify(t));this.state.parser=t}goto(t){return this.next(t),this.runOne()}call(t,r){r&&this.next(r),this.stack.push(this.state),this.state=new xc(t)}callNow(t,r){return this.call(t,r),this.runOne()}return(t){if(this.stack.length===0)throw this.error(new yi("Stack underflow"));t===void 0&&(t=this.state.buf),this.state=this.stack.pop(),this.state.returned=t}returnNow(t){return this.return(t),this.runOne()}consume(){if(this.char===1114112)throw this.error(new yi("Unexpected end-of-buffer"));this.state.buf+=this._buf[this.ii]}error(t){return t.line=this.line,t.col=this.col,t.pos=this.pos,t}parseStart(){throw new yi("Must declare a parseStart method")}};xo.END=1114112;xo.Error=yi;rT.exports=xo});var sT=T((o6,iT)=>{"use strict";u();iT.exports=e=>{let t=new Date(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var wc=T((c6,oT)=>{"use strict";u();oT.exports=(e,t)=>{for(t=String(t);t.length<e;)t="0"+t;return t}});var cT=T((l6,aT)=>{"use strict";u();var ls=wc(),Zp=class extends Date{constructor(t){super(t+"Z"),this.isFloating=!0}toISOString(){let t=`${this.getUTCFullYear()}-${ls(2,this.getUTCMonth()+1)}-${ls(2,this.getUTCDate())}`,r=`${ls(2,this.getUTCHours())}:${ls(2,this.getUTCMinutes())}:${ls(2,this.getUTCSeconds())}.${ls(3,this.getUTCMilliseconds())}`;return`${t}T${r}`}};aT.exports=e=>{let t=new Zp(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var pT=T((d6,lT)=>{"use strict";u();var uT=wc(),rL=global.Date,ed=class extends rL{constructor(t){super(t),this.isDate=!0}toISOString(){return`${this.getUTCFullYear()}-${uT(2,this.getUTCMonth()+1)}-${uT(2,this.getUTCDate())}`}};lT.exports=e=>{let t=new ed(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var fT=T((h6,dT)=>{"use strict";u();var Sc=wc(),td=class extends Date{constructor(t){super(`0000-01-01T${t}Z`),this.isTime=!0}toISOString(){return`${Sc(2,this.getUTCHours())}:${Sc(2,this.getUTCMinutes())}:${Sc(2,this.getUTCSeconds())}.${Sc(3,this.getUTCMilliseconds())}`}};dT.exports=e=>{let t=new td(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}});var Oc=T((exports,module)=>{"use strict";u();module.exports=makeParserClass(nT());module.exports.makeParserClass=makeParserClass;var TomlError=class e extends Error{constructor(t){super(t),this.name="TomlError",Error.captureStackTrace&&Error.captureStackTrace(this,e),this.fromTOML=!0,this.wrapped=null}};TomlError.wrap=e=>{let t=new TomlError(e.message);return t.code=e.code,t.wrapped=e,t};module.exports.TomlError=TomlError;var createDateTime=sT(),createDateTimeFloat=cT(),createDate=pT(),createTime=fT(),CTRL_I=9,CTRL_J=10,CTRL_M=13,CTRL_CHAR_BOUNDARY=31,CHAR_SP=32,CHAR_QUOT=34,CHAR_NUM=35,CHAR_APOS=39,CHAR_PLUS=43,CHAR_COMMA=44,CHAR_HYPHEN=45,CHAR_PERIOD=46,CHAR_0=48,CHAR_1=49,CHAR_7=55,CHAR_9=57,CHAR_COLON=58,CHAR_EQUALS=61,CHAR_A=65,CHAR_E=69,CHAR_F=70,CHAR_T=84,CHAR_U=85,CHAR_Z=90,CHAR_LOWBAR=95,CHAR_a=97,CHAR_b=98,CHAR_e=101,CHAR_f=102,CHAR_i=105,CHAR_l=108,CHAR_n=110,CHAR_o=111,CHAR_r=114,CHAR_s=115,CHAR_t=116,CHAR_u=117,CHAR_x=120,CHAR_z=122,CHAR_LCUB=123,CHAR_RCUB=125,CHAR_LSQB=91,CHAR_BSOL=92,CHAR_RSQB=93,CHAR_DEL=127,SURROGATE_FIRST=55296,SURROGATE_LAST=57343,escapes={[CHAR_b]:"\b",[CHAR_t]:" ",[CHAR_n]:`
28
+ `,[CHAR_f]:"\f",[CHAR_r]:"\r",[CHAR_QUOT]:'"',[CHAR_BSOL]:"\\"};function isDigit(e){return e>=CHAR_0&&e<=CHAR_9}function isHexit(e){return e>=CHAR_A&&e<=CHAR_F||e>=CHAR_a&&e<=CHAR_f||e>=CHAR_0&&e<=CHAR_9}function isBit(e){return e===CHAR_1||e===CHAR_0}function isOctit(e){return e>=CHAR_0&&e<=CHAR_7}function isAlphaNumQuoteHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_APOS||e===CHAR_QUOT||e===CHAR_LOWBAR||e===CHAR_HYPHEN}function isAlphaNumHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_LOWBAR||e===CHAR_HYPHEN}var _type=Symbol("type"),_declared=Symbol("declared"),hasOwnProperty=Object.prototype.hasOwnProperty,defineProperty=Object.defineProperty,descriptor={configurable:!0,enumerable:!0,writable:!0,value:void 0};function hasKey(e,t){return hasOwnProperty.call(e,t)?!0:(t==="__proto__"&&defineProperty(e,"__proto__",descriptor),!1)}var INLINE_TABLE=Symbol("inline-table");function InlineTable(){return Object.defineProperties({},{[_type]:{value:INLINE_TABLE}})}function isInlineTable(e){return e===null||typeof e!="object"?!1:e[_type]===INLINE_TABLE}var TABLE=Symbol("table");function Table(){return Object.defineProperties({},{[_type]:{value:TABLE},[_declared]:{value:!1,writable:!0}})}function isTable(e){return e===null||typeof e!="object"?!1:e[_type]===TABLE}var _contentType=Symbol("content-type"),INLINE_LIST=Symbol("inline-list");function InlineList(e){return Object.defineProperties([],{[_type]:{value:INLINE_LIST},[_contentType]:{value:e}})}function isInlineList(e){return e===null||typeof e!="object"?!1:e[_type]===INLINE_LIST}var LIST=Symbol("list");function List(){return Object.defineProperties([],{[_type]:{value:LIST}})}function isList(e){return e===null||typeof e!="object"?!1:e[_type]===LIST}var _custom;try{let utilInspect=eval("require('util').inspect");_custom=utilInspect.custom}catch(e){}var _inspect=_custom||"inspect",BoxedBigInt=class{constructor(t){try{this.value=global.BigInt.asIntN(64,t)}catch{this.value=null}Object.defineProperty(this,_type,{value:INTEGER})}isNaN(){return this.value===null}toString(){return String(this.value)}[_inspect](){return`[BigInt: ${this.toString()}]}`}valueOf(){return this.value}},INTEGER=Symbol("integer");function Integer(e){let t=Number(e);return Object.is(t,-0)&&(t=0),global.BigInt&&!Number.isSafeInteger(t)?new BoxedBigInt(e):Object.defineProperties(new Number(t),{isNaN:{value:function(){return isNaN(this)}},[_type]:{value:INTEGER},[_inspect]:{value:()=>`[Integer: ${e}]`}})}function isInteger(e){return e===null||typeof e!="object"?!1:e[_type]===INTEGER}var FLOAT=Symbol("float");function Float(e){return Object.defineProperties(new Number(e),{[_type]:{value:FLOAT},[_inspect]:{value:()=>`[Float: ${e}]`}})}function isFloat(e){return e===null||typeof e!="object"?!1:e[_type]===FLOAT}function tomlType(e){let t=typeof e;if(t==="object"){if(e===null)return"null";if(e instanceof Date)return"datetime";if(_type in e)switch(e[_type]){case INLINE_TABLE:return"inline-table";case INLINE_LIST:return"inline-list";case TABLE:return"table";case LIST:return"list";case FLOAT:return"float";case INTEGER:return"integer"}}return t}function makeParserClass(e){class t extends e{constructor(){super(),this.ctx=this.obj=Table()}atEndOfWord(){return this.char===CHAR_NUM||this.char===CTRL_I||this.char===CHAR_SP||this.atEndOfLine()}atEndOfLine(){return this.char===e.END||this.char===CTRL_J||this.char===CTRL_M}parseStart(){if(this.char===e.END)return null;if(this.char===CHAR_LSQB)return this.call(this.parseTableOrList);if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(isAlphaNumQuoteHyphen(this.char))return this.callNow(this.parseAssignStatement);throw this.error(new TomlError(`Unknown character "${this.char}"`))}parseWhitespaceToEOL(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(this.char===CHAR_NUM)return this.goto(this.parseComment);if(this.char===e.END||this.char===CTRL_J)return this.return();throw this.error(new TomlError("Unexpected character, expected only whitespace or comments till end of line"))}parseAssignStatement(){return this.callNow(this.parseAssign,this.recordAssignStatement)}recordAssignStatement(n){let i=this.ctx,s=n.key.pop();for(let o of n.key){if(hasKey(i,o)&&(!isTable(i[o])||i[o][_declared]))throw this.error(new TomlError("Can't redefine existing key"));i=i[o]=i[o]||Table()}if(hasKey(i,s))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(n.value)||isFloat(n.value)?i[s]=n.value.valueOf():i[s]=n.value,this.goto(this.parseWhitespaceToEOL)}parseAssign(){return this.callNow(this.parseKeyword,this.recordAssignKeyword)}recordAssignKeyword(n){return this.state.resultTable?this.state.resultTable.push(n):this.state.resultTable=[n],this.goto(this.parseAssignKeywordPreDot)}parseAssignKeywordPreDot(){if(this.char===CHAR_PERIOD)return this.next(this.parseAssignKeywordPostDot);if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.goto(this.parseAssignEqual)}parseAssignKeywordPostDot(){if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.callNow(this.parseKeyword,this.recordAssignKeyword)}parseAssignEqual(){if(this.char===CHAR_EQUALS)return this.next(this.parseAssignPreValue);throw this.error(new TomlError('Invalid character, expected "="'))}parseAssignPreValue(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseValue,this.recordAssignValue)}recordAssignValue(n){return this.returnNow({key:this.state.resultTable,value:n})}parseComment(){do if(this.char===e.END||this.char===CTRL_J)return this.return();while(this.nextChar())}parseTableOrList(){if(this.char===CHAR_LSQB)this.next(this.parseList);else return this.goto(this.parseTable)}parseTable(){return this.ctx=this.obj,this.goto(this.parseTableNext)}parseTableNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseTableMore)}parseTableMore(n){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,n)&&(!isTable(this.ctx[n])||this.ctx[n][_declared]))throw this.error(new TomlError("Can't redefine existing key"));return this.ctx=this.ctx[n]=this.ctx[n]||Table(),this.ctx[_declared]=!0,this.next(this.parseWhitespaceToEOL)}else if(this.char===CHAR_PERIOD){if(!hasKey(this.ctx,n))this.ctx=this.ctx[n]=Table();else if(isTable(this.ctx[n]))this.ctx=this.ctx[n];else if(isList(this.ctx[n]))this.ctx=this.ctx[n][this.ctx[n].length-1];else throw this.error(new TomlError("Can't redefine existing key"));return this.next(this.parseTableNext)}else throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseList(){return this.ctx=this.obj,this.goto(this.parseListNext)}parseListNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseListMore)}parseListMore(n){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,n)||(this.ctx[n]=List()),isInlineList(this.ctx[n]))throw this.error(new TomlError("Can't extend an inline array"));if(isList(this.ctx[n])){let i=Table();this.ctx[n].push(i),this.ctx=i}else throw this.error(new TomlError("Can't redefine an existing key"));return this.next(this.parseListEnd)}else if(this.char===CHAR_PERIOD){if(!hasKey(this.ctx,n))this.ctx=this.ctx[n]=Table();else{if(isInlineList(this.ctx[n]))throw this.error(new TomlError("Can't extend an inline array"));if(isInlineTable(this.ctx[n]))throw this.error(new TomlError("Can't extend an inline table"));if(isList(this.ctx[n]))this.ctx=this.ctx[n][this.ctx[n].length-1];else if(isTable(this.ctx[n]))this.ctx=this.ctx[n];else throw this.error(new TomlError("Can't redefine an existing key"))}return this.next(this.parseListNext)}else throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseListEnd(n){if(this.char===CHAR_RSQB)return this.next(this.parseWhitespaceToEOL);throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseValue(){if(this.char===e.END)throw this.error(new TomlError("Key without value"));if(this.char===CHAR_QUOT)return this.next(this.parseDoubleString);if(this.char===CHAR_APOS)return this.next(this.parseSingleString);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)return this.goto(this.parseNumberSign);if(this.char===CHAR_i)return this.next(this.parseInf);if(this.char===CHAR_n)return this.next(this.parseNan);if(isDigit(this.char))return this.goto(this.parseNumberOrDateTime);if(this.char===CHAR_t||this.char===CHAR_f)return this.goto(this.parseBoolean);if(this.char===CHAR_LSQB)return this.call(this.parseInlineList,this.recordValue);if(this.char===CHAR_LCUB)return this.call(this.parseInlineTable,this.recordValue);throw this.error(new TomlError("Unexpected character, expecting string, number, datetime, boolean, inline array or inline table"))}recordValue(n){return this.returnNow(n)}parseInf(){if(this.char===CHAR_n)return this.next(this.parseInf2);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseInf2(){if(this.char===CHAR_f)return this.state.buf==="-"?this.return(-1/0):this.return(1/0);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseNan(){if(this.char===CHAR_a)return this.next(this.parseNan2);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseNan2(){if(this.char===CHAR_n)return this.return(NaN);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseKeyword(){return this.char===CHAR_QUOT?this.next(this.parseBasicString):this.char===CHAR_APOS?this.next(this.parseLiteralString):this.goto(this.parseBareKey)}parseBareKey(){do{if(this.char===e.END)throw this.error(new TomlError("Key ended without value"));if(isAlphaNumHyphen(this.char))this.consume();else{if(this.state.buf.length===0)throw this.error(new TomlError("Empty bare keys are not allowed"));return this.returnNow()}}while(this.nextChar())}parseSingleString(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiStringMaybe):this.goto(this.parseLiteralString)}parseLiteralString(){do{if(this.char===CHAR_APOS)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}parseLiteralMultiStringMaybe(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiString):this.returnNow()}parseLiteralMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseLiteralMultiStringContent):this.goto(this.parseLiteralMultiStringContent)}parseLiteralMultiStringContent(){do{if(this.char===CHAR_APOS)return this.next(this.parseLiteralMultiEnd);if(this.char===e.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}parseLiteralMultiEnd(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiEnd2):(this.state.buf+="'",this.goto(this.parseLiteralMultiStringContent))}parseLiteralMultiEnd2(){return this.char===CHAR_APOS?this.return():(this.state.buf+="''",this.goto(this.parseLiteralMultiStringContent))}parseDoubleString(){return this.char===CHAR_QUOT?this.next(this.parseMultiStringMaybe):this.goto(this.parseBasicString)}parseBasicString(){do{if(this.char===CHAR_BSOL)return this.call(this.parseEscape,this.recordEscapeReplacement);if(this.char===CHAR_QUOT)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}recordEscapeReplacement(n){return this.state.buf+=n,this.goto(this.parseBasicString)}parseMultiStringMaybe(){return this.char===CHAR_QUOT?this.next(this.parseMultiString):this.returnNow()}parseMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseMultiStringContent):this.goto(this.parseMultiStringContent)}parseMultiStringContent(){do{if(this.char===CHAR_BSOL)return this.call(this.parseMultiEscape,this.recordMultiEscapeReplacement);if(this.char===CHAR_QUOT)return this.next(this.parseMultiEnd);if(this.char===e.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}errorControlCharInString(){let n="\\u00";return this.char<16&&(n+="0"),n+=this.char.toString(16),this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in strings, use ${n} instead`))}recordMultiEscapeReplacement(n){return this.state.buf+=n,this.goto(this.parseMultiStringContent)}parseMultiEnd(){return this.char===CHAR_QUOT?this.next(this.parseMultiEnd2):(this.state.buf+='"',this.goto(this.parseMultiStringContent))}parseMultiEnd2(){return this.char===CHAR_QUOT?this.return():(this.state.buf+='""',this.goto(this.parseMultiStringContent))}parseMultiEscape(){return this.char===CTRL_M||this.char===CTRL_J?this.next(this.parseMultiTrim):this.char===CHAR_SP||this.char===CTRL_I?this.next(this.parsePreMultiTrim):this.goto(this.parseEscape)}parsePreMultiTrim(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CTRL_M||this.char===CTRL_J)return this.next(this.parseMultiTrim);throw this.error(new TomlError("Can't escape whitespace"))}parseMultiTrim(){return this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M?null:this.returnNow()}parseEscape(){if(this.char in escapes)return this.return(escapes[this.char]);if(this.char===CHAR_u)return this.call(this.parseSmallUnicode,this.parseUnicodeReturn);if(this.char===CHAR_U)return this.call(this.parseLargeUnicode,this.parseUnicodeReturn);throw this.error(new TomlError("Unknown escape character: "+this.char))}parseUnicodeReturn(n){try{let i=parseInt(n,16);if(i>=SURROGATE_FIRST&&i<=SURROGATE_LAST)throw this.error(new TomlError("Invalid unicode, character in range 0xD800 - 0xDFFF is reserved"));return this.returnNow(String.fromCodePoint(i))}catch(i){throw this.error(TomlError.wrap(i))}}parseSmallUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=4)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseLargeUnicode(){if(isHexit(this.char)){if(this.consume(),this.state.buf.length>=8)return this.return()}else throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"))}parseNumberSign(){return this.consume(),this.next(this.parseMaybeSignedInfOrNan)}parseMaybeSignedInfOrNan(){return this.char===CHAR_i?this.next(this.parseInf):this.char===CHAR_n?this.next(this.parseNan):this.callNow(this.parseNoUnder,this.parseNumberIntegerStart)}parseNumberIntegerStart(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberIntegerExponentOrDecimal)):this.goto(this.parseNumberInteger)}parseNumberIntegerExponentOrDecimal(){return this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Integer(this.state.buf))}parseNumberInteger(){if(isDigit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder);if(this.char===CHAR_E||this.char===CHAR_e)return this.consume(),this.next(this.parseNumberExponentSign);if(this.char===CHAR_PERIOD)return this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat);{let n=Integer(this.state.buf);if(n.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(n)}}}parseNoUnder(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD||this.char===CHAR_E||this.char===CHAR_e)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNoUnderHexOctBinLiteral(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNumberFloat(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberFloat);if(isDigit(this.char))this.consume();else return this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Float(this.state.buf))}parseNumberExponentSign(){if(isDigit(this.char))return this.goto(this.parseNumberExponent);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.call(this.parseNoUnder,this.parseNumberExponent);else throw this.error(new TomlError("Unexpected character, expected -, + or digit"))}parseNumberExponent(){if(isDigit(this.char))this.consume();else return this.char===CHAR_LOWBAR?this.call(this.parseNoUnder):this.returnNow(Float(this.state.buf))}parseNumberOrDateTime(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberBaseOrDateTime)):this.goto(this.parseNumberOrDateTimeOnly)}parseNumberOrDateTimeOnly(){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder,this.parseNumberInteger);if(isDigit(this.char))this.consume(),this.state.buf.length>4&&this.next(this.parseNumberInteger);else return this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_HYPHEN?this.goto(this.parseDateTime):this.char===CHAR_COLON?this.goto(this.parseOnlyTimeHour):this.returnNow(Integer(this.state.buf))}parseDateTimeOnly(){if(this.state.buf.length<4){if(isDigit(this.char))return this.consume();if(this.char===CHAR_COLON)return this.goto(this.parseOnlyTimeHour);throw this.error(new TomlError("Expected digit while parsing year part of a date"))}else{if(this.char===CHAR_HYPHEN)return this.goto(this.parseDateTime);throw this.error(new TomlError("Expected hyphen (-) while parsing year part of date"))}}parseNumberBaseOrDateTime(){return this.char===CHAR_b?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerBin)):this.char===CHAR_o?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerOct)):this.char===CHAR_x?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerHex)):this.char===CHAR_PERIOD?this.goto(this.parseNumberInteger):isDigit(this.char)?this.goto(this.parseDateTimeOnly):this.returnNow(Integer(this.state.buf))}parseIntegerHex(){if(isHexit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let n=Integer(this.state.buf);if(n.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(n)}}}parseIntegerOct(){if(isOctit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let n=Integer(this.state.buf);if(n.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(n)}}}parseIntegerBin(){if(isBit(this.char))this.consume();else{if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{let n=Integer(this.state.buf);if(n.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(n)}}}parseDateTime(){if(this.state.buf.length<4)throw this.error(new TomlError("Years less than 1000 must be zero padded to four characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseDateMonth)}parseDateMonth(){if(this.char===CHAR_HYPHEN){if(this.state.buf.length<2)throw this.error(new TomlError("Months less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseDateDay)}else if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseDateDay(){if(this.char===CHAR_T||this.char===CHAR_SP){if(this.state.buf.length<2)throw this.error(new TomlError("Days less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseStartTimeHour)}else{if(this.atEndOfWord())return this.returnNow(createDate(this.state.result+"-"+this.state.buf));if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}}parseStartTimeHour(){return this.atEndOfWord()?this.returnNow(createDate(this.state.result)):this.goto(this.parseTimeHour)}parseTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result+="T"+this.state.buf,this.state.buf="",this.next(this.parseTimeMin)}else if(isDigit(this.char))this.consume();else throw this.error(new TomlError("Incomplete datetime"))}parseTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else{if(this.state.buf.length===2&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeSec);throw this.error(new TomlError("Incomplete datetime"))}}parseTimeSec(){if(isDigit(this.char)){if(this.consume(),this.state.buf.length===2)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeZoneOrFraction)}else throw this.error(new TomlError("Incomplete datetime"))}parseOnlyTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeMin)}else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeMin(){if(this.state.buf.length<2&&isDigit(this.char))this.consume();else{if(this.state.buf.length===2&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeSec);throw this.error(new TomlError("Incomplete time"))}}parseOnlyTimeSec(){if(isDigit(this.char)){if(this.consume(),this.state.buf.length===2)return this.next(this.parseOnlyTimeFractionMaybe)}else throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeFractionMaybe(){if(this.state.result+=":"+this.state.buf,this.char===CHAR_PERIOD)this.state.buf="",this.next(this.parseOnlyTimeFraction);else return this.return(createTime(this.state.result))}parseOnlyTimeFraction(){if(isDigit(this.char))this.consume();else if(this.atEndOfWord()){if(this.state.buf.length===0)throw this.error(new TomlError("Expected digit in milliseconds"));return this.returnNow(createTime(this.state.result+"."+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}parseTimeZoneOrFraction(){if(this.char===CHAR_PERIOD)this.consume(),this.next(this.parseDateTimeFraction);else if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else{if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}}parseDateTimeFraction(){if(isDigit(this.char))this.consume();else{if(this.state.buf.length===1)throw this.error(new TomlError("Expected digit in milliseconds"));if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)this.consume(),this.next(this.parseTimeZoneHour);else{if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}}}parseTimeZoneHour(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.next(this.parseTimeZoneSep)}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseTimeZoneSep(){if(this.char===CHAR_COLON)this.consume(),this.next(this.parseTimeZoneMin);else throw this.error(new TomlError("Unexpected character in datetime, expected colon"))}parseTimeZoneMin(){if(isDigit(this.char)){if(this.consume(),/\d\d$/.test(this.state.buf))return this.return(createDateTime(this.state.result+this.state.buf))}else throw this.error(new TomlError("Unexpected character in datetime, expected digit"))}parseBoolean(){if(this.char===CHAR_t)return this.consume(),this.next(this.parseTrue_r);if(this.char===CHAR_f)return this.consume(),this.next(this.parseFalse_a)}parseTrue_r(){if(this.char===CHAR_r)return this.consume(),this.next(this.parseTrue_u);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_u(){if(this.char===CHAR_u)return this.consume(),this.next(this.parseTrue_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_e(){if(this.char===CHAR_e)return this.return(!0);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_a(){if(this.char===CHAR_a)return this.consume(),this.next(this.parseFalse_l);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_l(){if(this.char===CHAR_l)return this.consume(),this.next(this.parseFalse_s);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_s(){if(this.char===CHAR_s)return this.consume(),this.next(this.parseFalse_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_e(){if(this.char===CHAR_e)return this.return(!1);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseInlineList(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===e.END)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_NUM?this.call(this.parseComment):this.char===CHAR_RSQB?this.return(this.state.resultArr||InlineList()):this.callNow(this.parseValue,this.recordInlineListValue)}recordInlineListValue(n){if(this.state.resultArr){let i=this.state.resultArr[_contentType],s=tomlType(n);if(i!==s)throw this.error(new TomlError(`Inline lists must be a single type, not a mix of ${i} and ${s}`))}else this.state.resultArr=InlineList(tomlType(n));return isFloat(n)||isInteger(n)?this.state.resultArr.push(n.valueOf()):this.state.resultArr.push(n),this.goto(this.parseInlineListNext)}parseInlineListNext(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CHAR_COMMA)return this.next(this.parseInlineList);if(this.char===CHAR_RSQB)return this.goto(this.parseInlineList);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}parseInlineTable(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_RCUB?this.return(this.state.resultTable||InlineTable()):(this.state.resultTable||(this.state.resultTable=InlineTable()),this.callNow(this.parseAssign,this.recordInlineTableValue))}recordInlineTableValue(n){let i=this.state.resultTable,s=n.key.pop();for(let o of n.key){if(hasKey(i,o)&&(!isTable(i[o])||i[o][_declared]))throw this.error(new TomlError("Can't redefine existing key"));i=i[o]=i[o]||Table()}if(hasKey(i,s))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(n.value)||isFloat(n.value)?i[s]=n.value.valueOf():i[s]=n.value,this.goto(this.parseInlineTableNext)}parseInlineTableNext(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));if(this.char===CHAR_COMMA)return this.next(this.parseInlineTable);if(this.char===CHAR_RCUB)return this.goto(this.parseInlineTable);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}}return t}});var _c=T((y6,hT)=>{"use strict";u();hT.exports=nL;function nL(e,t){if(e.pos==null||e.line==null)return e;let r=e.message;if(r+=` at row ${e.line+1}, col ${e.col+1}, pos ${e.pos}:
29
+ `,t&&t.split){let n=t.split(/\n/),i=String(Math.min(n.length,e.line+3)).length,s=" ";for(;s.length<i;)s+=" ";for(let o=Math.max(0,e.line-1);o<Math.min(n.length,e.line+2);++o){let a=String(o+1);if(a.length<i&&(a=" "+a),e.line===o){r+=a+"> "+n[o]+`
30
+ `,r+=s+" ";for(let c=0;c<e.col;++c)r+=" ";r+=`^
31
+ `}else r+=a+": "+n[o]+`
32
+ `}}return e.message=r+`
33
+ `,e}});var gT=T((v6,mT)=>{"use strict";u();mT.exports=oL;var iL=Oc(),sL=_c();function oL(e){global.Buffer&&global.Buffer.isBuffer(e)&&(e=e.toString("utf8"));let t=new iL;try{return t.parse(e),t.finish()}catch(r){throw sL(r,e)}}});var vT=T((E6,bT)=>{"use strict";u();bT.exports=cL;var aL=Oc(),yT=_c();function cL(e,t){t||(t={});let r=0,n=t.blocksize||40960,i=new aL;return new Promise((o,a)=>{setImmediate(s,r,n,o,a)});function s(o,a,c,l){if(o>=e.length)try{return c(i.finish())}catch(p){return l(yT(p,e))}try{i.parse(e.slice(o,o+a)),setImmediate(s,o+a,a,c,l)}catch(p){l(yT(p,e))}}}});var xT=T((w6,ET)=>{"use strict";u();ET.exports=lL;var uL=_e("stream"),TT=Oc();function lL(e){return e?pL(e):dL(e)}function pL(e){let t=new TT;return e.setEncoding("utf8"),new Promise((r,n)=>{let i,s=!1,o=!1;function a(){if(s=!0,!i)try{r(t.finish())}catch(p){n(p)}}function c(p){o=!0,n(p)}e.once("end",a),e.once("error",c),l();function l(){i=!0;let p;for(;(p=e.read())!==null;)try{t.parse(p)}catch(d){return c(d)}if(i=!1,s)return a();o||e.once("readable",l)}})}function dL(){let e=new TT;return new uL.Transform({objectMode:!0,transform(t,r,n){try{e.parse(t.toString(r))}catch(i){this.emit("error",i)}n()},flush(t){try{this.push(e.finish())}catch(r){this.emit("error",r)}t()}})}});var wT=T((O6,wo)=>{"use strict";u();wo.exports=gT();wo.exports.async=vT();wo.exports.stream=xT();wo.exports.prettyError=_c()});var CT=T((A6,id)=>{"use strict";u();id.exports=fL;id.exports.value=nd;function fL(e){if(e===null)throw bi("null");if(e===void 0)throw bi("undefined");if(typeof e!="object")throw bi(typeof e);if(typeof e.toJSON=="function"&&(e=e.toJSON()),e==null)return null;let t=Bt(e);if(t!=="table")throw bi(t);return rd("","",e)}function bi(e){return new Error("Can only stringify objects, not "+e)}function hL(){return new Error("Array values can't have mixed types")}function ST(e){return Object.keys(e).filter(t=>OT(e[t]))}function mL(e){return Object.keys(e).filter(t=>!OT(e[t]))}function Ac(e){let t=Array.isArray(e)?[]:Object.prototype.hasOwnProperty.call(e,"__proto__")?{["__proto__"]:void 0}:{};for(let r of Object.keys(e))e[r]&&typeof e[r].toJSON=="function"&&!("toISOString"in e[r])?t[r]=e[r].toJSON():t[r]=e[r];return t}function rd(e,t,r){r=Ac(r);var n,i;n=ST(r),i=mL(r);var s=[],o=t||"";n.forEach(c=>{var l=Bt(r[c]);l!=="undefined"&&l!=="null"&&s.push(o+Nc(c)+" = "+NT(r[c],!0))}),s.length>0&&s.push("");var a=e&&n.length>0?t+" ":"";return i.forEach(c=>{s.push(_L(e,a,c,r[c]))}),s.join(`
34
+ `)}function OT(e){switch(Bt(e)){case"undefined":case"null":case"integer":case"nan":case"float":case"boolean":case"string":case"datetime":return!0;case"array":return e.length===0||Bt(e[0])!=="table";case"table":return Object.keys(e).length===0;default:return!1}}function Bt(e){return e===void 0?"undefined":e===null?"null":typeof e=="bigint"||Number.isInteger(e)&&!Object.is(e,-0)?"integer":typeof e=="number"?"float":typeof e=="boolean"?"boolean":typeof e=="string"?"string":"toISOString"in e?isNaN(e)?"undefined":"datetime":Array.isArray(e)?"array":"table"}function Nc(e){var t=String(e);return/^[-A-Za-z0-9_]+$/.test(t)?t:_T(t)}function _T(e){return'"'+AT(e).replace(/"/g,'\\"')+'"'}function gL(e){return"'"+e+"'"}function yL(e,t){for(;t.length<e;)t="0"+t;return t}function AT(e){return e.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/([\u0000-\u001f\u007f])/,t=>"\\u"+yL(4,t.codePointAt(0).toString(16)))}function bL(e){let t=e.split(/\n/).map(r=>AT(r).replace(/"(?="")/g,'\\"')).join(`
35
+ `);return t.slice(-1)==='"'&&(t+=`\\
36
+ `),`"""
37
+ `+t+'"""'}function NT(e,t){let r=Bt(e);return r==="string"&&(t&&/\n/.test(e)?r="string-multiline":!/[\b\t\n\f\r']/.test(e)&&/"/.test(e)&&(r="string-literal")),nd(e,r)}function nd(e,t){switch(t||(t=Bt(e)),t){case"string-multiline":return bL(e);case"string":return _T(e);case"string-literal":return gL(e);case"integer":return IT(e);case"float":return vL(e);case"boolean":return TL(e);case"datetime":return EL(e);case"array":return SL(e.filter(r=>Bt(r)!=="null"&&Bt(r)!=="undefined"&&Bt(r)!=="nan"));case"table":return OL(e);default:throw bi(t)}}function IT(e){return String(e).replace(/\B(?=(\d{3})+(?!\d))/g,"_")}function vL(e){if(e===1/0)return"inf";if(e===-1/0)return"-inf";if(Object.is(e,NaN))return"nan";if(Object.is(e,-0))return"-0.0";var t=String(e).split("."),r=t[0],n=t[1]||0;return IT(r)+"."+n}function TL(e){return String(e)}function EL(e){return e.toISOString()}function xL(e){return e==="float"||e==="integer"}function wL(e){var t=Bt(e[0]);return e.every(r=>Bt(r)===t)?t:e.every(r=>xL(Bt(r)))?"float":"mixed"}function RT(e){let t=wL(e);if(t==="mixed")throw hL();return t}function SL(e){e=Ac(e);let t=RT(e);var r="[",n=e.map(i=>nd(i,t));return n.join(", ").length>60||/\n/.test(n)?r+=`
38
+ `+n.join(`,
39
+ `)+`
40
+ `:r+=" "+n.join(", ")+(n.length>0?" ":""),r+"]"}function OL(e){e=Ac(e);var t=[];return Object.keys(e).forEach(r=>{t.push(Nc(r)+" = "+NT(e[r],!1))}),"{ "+t.join(", ")+(t.length>0?" ":"")+"}"}function _L(e,t,r,n){var i=Bt(n);if(i==="array")return AL(e,t,r,n);if(i==="table")return NL(e,t,r,n);throw bi(i)}function AL(e,t,r,n){n=Ac(n),RT(n);var i=Bt(n[0]);if(i!=="table")throw bi(i);var s=e+Nc(r),o="";return n.forEach(a=>{o.length>0&&(o+=`
41
+ `),o+=t+"[["+s+`]]
42
+ `,o+=rd(s+".",t,a)}),o}function NL(e,t,r,n){var i=e+Nc(r),s="";return ST(n).length>0&&(s+=t+"["+i+`]
43
+ `),s+rd(i+".",t,n)}});var LT=T(sd=>{"use strict";u();sd.parse=wT();sd.stringify=CT()});var tS=T(Bs=>{"use strict";u();Object.defineProperty(Bs,"__esModule",{value:!0});Bs.versionInfo=Bs.version=void 0;var Dj="16.12.0";Bs.version=Dj;var $j=Object.freeze({major:16,minor:12,patch:0,preReleaseTag:null});Bs.versionInfo=$j});var qt=T(Th=>{"use strict";u();Object.defineProperty(Th,"__esModule",{value:!0});Th.devAssert=Pj;function Pj(e,t){if(!!!e)throw new Error(t)}});var xu=T(Eh=>{"use strict";u();Object.defineProperty(Eh,"__esModule",{value:!0});Eh.isPromise=jj;function jj(e){return typeof e?.then=="function"}});var cn=T(xh=>{"use strict";u();Object.defineProperty(xh,"__esModule",{value:!0});xh.isObjectLike=qj;function qj(e){return typeof e=="object"&&e!==null}});var Ct=T(wh=>{"use strict";u();Object.defineProperty(wh,"__esModule",{value:!0});wh.invariant=Fj;function Fj(e,t){if(!!!e)throw new Error(t??"Unexpected invariant triggered.")}});var wu=T(Sh=>{"use strict";u();Object.defineProperty(Sh,"__esModule",{value:!0});Sh.getLocation=Bj;var Mj=Ct(),Uj=/\r\n|[\n\r]/g;function Bj(e,t){let r=0,n=1;for(let i of e.body.matchAll(Uj)){if(typeof i.index=="number"||(0,Mj.invariant)(!1),i.index>=t)break;r=i.index+i[0].length,n+=1}return{line:n,column:t+1-r}}});var Oh=T(Su=>{"use strict";u();Object.defineProperty(Su,"__esModule",{value:!0});Su.printLocation=Kj;Su.printSourceLocation=nS;var Vj=wu();function Kj(e){return nS(e.source,(0,Vj.getLocation)(e.source,e.start))}function nS(e,t){let r=e.locationOffset.column-1,n="".padStart(r)+e.body,i=t.line-1,s=e.locationOffset.line-1,o=t.line+s,a=t.line===1?r:0,c=t.column+a,l=`${e.name}:${o}:${c}
44
+ `,p=n.split(/\r\n|[\n\r]/g),d=p[i];if(d.length>120){let f=Math.floor(c/80),m=c%80,h=[];for(let v=0;v<d.length;v+=80)h.push(d.slice(v,v+80));return l+rS([[`${o} |`,h[0]],...h.slice(1,f+1).map(v=>["|",v]),["|","^".padStart(m)],["|",h[f+1]]])}return l+rS([[`${o-1} |`,p[i-1]],[`${o} |`,d],["|","^".padStart(c)],[`${o+1} |`,p[i+1]]])}function rS(e){let t=e.filter(([n,i])=>i!==void 0),r=Math.max(...t.map(([n])=>n.length));return t.map(([n,i])=>n.padStart(r)+(i?" "+i:"")).join(`
45
+ `)}});var ue=T(Vs=>{"use strict";u();Object.defineProperty(Vs,"__esModule",{value:!0});Vs.GraphQLError=void 0;Vs.formatError=zj;Vs.printError=Qj;var Gj=cn(),iS=wu(),sS=Oh();function Hj(e){let t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}var _h=class e extends Error{constructor(t,...r){var n,i,s;let{nodes:o,source:a,positions:c,path:l,originalError:p,extensions:d}=Hj(r);super(t),this.name="GraphQLError",this.path=l??void 0,this.originalError=p??void 0,this.nodes=oS(Array.isArray(o)?o:o?[o]:void 0);let f=oS((n=this.nodes)===null||n===void 0?void 0:n.map(h=>h.loc).filter(h=>h!=null));this.source=a??(f==null||(i=f[0])===null||i===void 0?void 0:i.source),this.positions=c??f?.map(h=>h.start),this.locations=c&&a?c.map(h=>(0,iS.getLocation)(a,h)):f?.map(h=>(0,iS.getLocation)(h.source,h.start));let m=(0,Gj.isObjectLike)(p?.extensions)?p?.extensions:void 0;this.extensions=(s=d??m)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),p!=null&&p.stack?Object.defineProperty(this,"stack",{value:p.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let r of this.nodes)r.loc&&(t+=`
46
+
47
+ `+(0,sS.printLocation)(r.loc));else if(this.source&&this.locations)for(let r of this.locations)t+=`
48
+
49
+ `+(0,sS.printSourceLocation)(this.source,r);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}};Vs.GraphQLError=_h;function oS(e){return e===void 0||e.length===0?void 0:e}function Qj(e){return e.toString()}function zj(e){return e.toJSON()}});var Zo=T(Ah=>{"use strict";u();Object.defineProperty(Ah,"__esModule",{value:!0});Ah.syntaxError=Jj;var Wj=ue();function Jj(e,t,r){return new Wj.GraphQLError(`Syntax Error: ${r}`,{source:e,positions:[t]})}});var qr=T(Er=>{"use strict";u();Object.defineProperty(Er,"__esModule",{value:!0});Er.Token=Er.QueryDocumentKeys=Er.OperationTypeNode=Er.Location=void 0;Er.isNode=Xj;var Nh=class{constructor(t,r,n){this.start=t.start,this.end=r.end,this.startToken=t,this.endToken=r,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}};Er.Location=Nh;var Ih=class{constructor(t,r,n,i,s,o){this.kind=t,this.start=r,this.end=n,this.line=i,this.column=s,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}};Er.Token=Ih;var aS={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]};Er.QueryDocumentKeys=aS;var Yj=new Set(Object.keys(aS));function Xj(e){let t=e?.kind;return typeof t=="string"&&Yj.has(t)}var Rh;Er.OperationTypeNode=Rh;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(Rh||(Er.OperationTypeNode=Rh={}))});var Ks=T(ea=>{"use strict";u();Object.defineProperty(ea,"__esModule",{value:!0});ea.DirectiveLocation=void 0;var Ch;ea.DirectiveLocation=Ch;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(Ch||(ea.DirectiveLocation=Ch={}))});var Ie=T(ta=>{"use strict";u();Object.defineProperty(ta,"__esModule",{value:!0});ta.Kind=void 0;var Lh;ta.Kind=Lh;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension",e.TYPE_COORDINATE="TypeCoordinate",e.MEMBER_COORDINATE="MemberCoordinate",e.ARGUMENT_COORDINATE="ArgumentCoordinate",e.DIRECTIVE_COORDINATE="DirectiveCoordinate",e.DIRECTIVE_ARGUMENT_COORDINATE="DirectiveArgumentCoordinate"})(Lh||(ta.Kind=Lh={}))});var ra=T(ki=>{"use strict";u();Object.defineProperty(ki,"__esModule",{value:!0});ki.isDigit=cS;ki.isLetter=kh;ki.isNameContinue=tq;ki.isNameStart=eq;ki.isWhiteSpace=Zj;function Zj(e){return e===9||e===32}function cS(e){return e>=48&&e<=57}function kh(e){return e>=97&&e<=122||e>=65&&e<=90}function eq(e){return kh(e)||e===95}function tq(e){return kh(e)||cS(e)||e===95}});var ia=T(na=>{"use strict";u();Object.defineProperty(na,"__esModule",{value:!0});na.dedentBlockStringLines=rq;na.isPrintableAsBlockString=iq;na.printBlockString=sq;var Dh=ra();function rq(e){var t;let r=Number.MAX_SAFE_INTEGER,n=null,i=-1;for(let o=0;o<e.length;++o){var s;let a=e[o],c=nq(a);c!==a.length&&(n=(s=n)!==null&&s!==void 0?s:o,i=o,o!==0&&c<r&&(r=c))}return e.map((o,a)=>a===0?o:o.slice(r)).slice((t=n)!==null&&t!==void 0?t:0,i+1)}function nq(e){let t=0;for(;t<e.length&&(0,Dh.isWhiteSpace)(e.charCodeAt(t));)++t;return t}function iq(e){if(e==="")return!0;let t=!0,r=!1,n=!0,i=!1;for(let s=0;s<e.length;++s)switch(e.codePointAt(s)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:return!1;case 13:return!1;case 10:if(t&&!i)return!1;i=!0,t=!0,r=!1;break;case 9:case 32:r||(r=t);break;default:n&&(n=r),t=!1}return!(t||n&&i)}function sq(e,t){let r=e.replace(/"""/g,'\\"""'),n=r.split(/\r\n|[\n\r]/g),i=n.length===1,s=n.length>1&&n.slice(1).every(m=>m.length===0||(0,Dh.isWhiteSpace)(m.charCodeAt(0))),o=r.endsWith('\\"""'),a=e.endsWith('"')&&!o,c=e.endsWith("\\"),l=a||c,p=!(t!=null&&t.minimize)&&(!i||e.length>70||l||s||o),d="",f=i&&(0,Dh.isWhiteSpace)(e.charCodeAt(0));return(p&&!f||s)&&(d+=`
50
+ `),d+=r,(p||l)&&(d+=`
51
+ `),'"""'+d+'"""'}});var Gs=T(sa=>{"use strict";u();Object.defineProperty(sa,"__esModule",{value:!0});sa.TokenKind=void 0;var $h;sa.TokenKind=$h;(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.DOT=".",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})($h||(sa.TokenKind=$h={}))});var aa=T(Zn=>{"use strict";u();Object.defineProperty(Zn,"__esModule",{value:!0});Zn.Lexer=void 0;Zn.createToken=ut;Zn.isPunctuatorTokenKind=aq;Zn.printCodePointAt=Xn;Zn.readName=fS;var Fr=Zo(),lS=qr(),oq=ia(),Di=ra(),Se=Gs(),jh=class{constructor(t){let r=new lS.Token(Se.TokenKind.SOF,0,0,0,0);this.source=t,this.lastToken=r,this.token=r,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==Se.TokenKind.EOF)do if(t.next)t=t.next;else{let r=cq(this,t.end);t.next=r,r.prev=t,t=r}while(t.kind===Se.TokenKind.COMMENT);return t}};Zn.Lexer=jh;function aq(e){return e===Se.TokenKind.BANG||e===Se.TokenKind.DOLLAR||e===Se.TokenKind.AMP||e===Se.TokenKind.PAREN_L||e===Se.TokenKind.PAREN_R||e===Se.TokenKind.DOT||e===Se.TokenKind.SPREAD||e===Se.TokenKind.COLON||e===Se.TokenKind.EQUALS||e===Se.TokenKind.AT||e===Se.TokenKind.BRACKET_L||e===Se.TokenKind.BRACKET_R||e===Se.TokenKind.BRACE_L||e===Se.TokenKind.PIPE||e===Se.TokenKind.BRACE_R}function Hs(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function Ou(e,t){return pS(e.charCodeAt(t))&&dS(e.charCodeAt(t+1))}function pS(e){return e>=55296&&e<=56319}function dS(e){return e>=56320&&e<=57343}function Xn(e,t){let r=e.source.body.codePointAt(t);if(r===void 0)return Se.TokenKind.EOF;if(r>=32&&r<=126){let n=String.fromCodePoint(r);return n==='"'?`'"'`:`"${n}"`}return"U+"+r.toString(16).toUpperCase().padStart(4,"0")}function ut(e,t,r,n,i){let s=e.line,o=1+r-e.lineStart;return new lS.Token(t,r,n,s,o,i)}function cq(e,t){let r=e.source.body,n=r.length,i=t;for(;i<n;){let s=r.charCodeAt(i);switch(s){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:r.charCodeAt(i+1)===10?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return uq(e,i);case 33:return ut(e,Se.TokenKind.BANG,i,i+1);case 36:return ut(e,Se.TokenKind.DOLLAR,i,i+1);case 38:return ut(e,Se.TokenKind.AMP,i,i+1);case 40:return ut(e,Se.TokenKind.PAREN_L,i,i+1);case 41:return ut(e,Se.TokenKind.PAREN_R,i,i+1);case 46:if(r.charCodeAt(i+1)===46&&r.charCodeAt(i+2)===46)return ut(e,Se.TokenKind.SPREAD,i,i+3);break;case 58:return ut(e,Se.TokenKind.COLON,i,i+1);case 61:return ut(e,Se.TokenKind.EQUALS,i,i+1);case 64:return ut(e,Se.TokenKind.AT,i,i+1);case 91:return ut(e,Se.TokenKind.BRACKET_L,i,i+1);case 93:return ut(e,Se.TokenKind.BRACKET_R,i,i+1);case 123:return ut(e,Se.TokenKind.BRACE_L,i,i+1);case 124:return ut(e,Se.TokenKind.PIPE,i,i+1);case 125:return ut(e,Se.TokenKind.BRACE_R,i,i+1);case 34:return r.charCodeAt(i+1)===34&&r.charCodeAt(i+2)===34?mq(e,i):pq(e,i)}if((0,Di.isDigit)(s)||s===45)return lq(e,i,s);if((0,Di.isNameStart)(s))return fS(e,i);throw(0,Fr.syntaxError)(e.source,i,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:Hs(s)||Ou(r,i)?`Unexpected character: ${Xn(e,i)}.`:`Invalid character: ${Xn(e,i)}.`)}return ut(e,Se.TokenKind.EOF,n,n)}function uq(e,t){let r=e.source.body,n=r.length,i=t+1;for(;i<n;){let s=r.charCodeAt(i);if(s===10||s===13)break;if(Hs(s))++i;else if(Ou(r,i))i+=2;else break}return ut(e,Se.TokenKind.COMMENT,t,i,r.slice(t+1,i))}function lq(e,t,r){let n=e.source.body,i=t,s=r,o=!1;if(s===45&&(s=n.charCodeAt(++i)),s===48){if(s=n.charCodeAt(++i),(0,Di.isDigit)(s))throw(0,Fr.syntaxError)(e.source,i,`Invalid number, unexpected digit after 0: ${Xn(e,i)}.`)}else i=Ph(e,i,s),s=n.charCodeAt(i);if(s===46&&(o=!0,s=n.charCodeAt(++i),i=Ph(e,i,s),s=n.charCodeAt(i)),(s===69||s===101)&&(o=!0,s=n.charCodeAt(++i),(s===43||s===45)&&(s=n.charCodeAt(++i)),i=Ph(e,i,s),s=n.charCodeAt(i)),s===46||(0,Di.isNameStart)(s))throw(0,Fr.syntaxError)(e.source,i,`Invalid number, expected digit but got: ${Xn(e,i)}.`);return ut(e,o?Se.TokenKind.FLOAT:Se.TokenKind.INT,t,i,n.slice(t,i))}function Ph(e,t,r){if(!(0,Di.isDigit)(r))throw(0,Fr.syntaxError)(e.source,t,`Invalid number, expected digit but got: ${Xn(e,t)}.`);let n=e.source.body,i=t+1;for(;(0,Di.isDigit)(n.charCodeAt(i));)++i;return i}function pq(e,t){let r=e.source.body,n=r.length,i=t+1,s=i,o="";for(;i<n;){let a=r.charCodeAt(i);if(a===34)return o+=r.slice(s,i),ut(e,Se.TokenKind.STRING,t,i+1,o);if(a===92){o+=r.slice(s,i);let c=r.charCodeAt(i+1)===117?r.charCodeAt(i+2)===123?dq(e,i):fq(e,i):hq(e,i);o+=c.value,i+=c.size,s=i;continue}if(a===10||a===13)break;if(Hs(a))++i;else if(Ou(r,i))i+=2;else throw(0,Fr.syntaxError)(e.source,i,`Invalid character within String: ${Xn(e,i)}.`)}throw(0,Fr.syntaxError)(e.source,i,"Unterminated string.")}function dq(e,t){let r=e.source.body,n=0,i=3;for(;i<12;){let s=r.charCodeAt(t+i++);if(s===125){if(i<5||!Hs(n))break;return{value:String.fromCodePoint(n),size:i}}if(n=n<<4|oa(s),n<0)break}throw(0,Fr.syntaxError)(e.source,t,`Invalid Unicode escape sequence: "${r.slice(t,t+i)}".`)}function fq(e,t){let r=e.source.body,n=uS(r,t+2);if(Hs(n))return{value:String.fromCodePoint(n),size:6};if(pS(n)&&r.charCodeAt(t+6)===92&&r.charCodeAt(t+7)===117){let i=uS(r,t+8);if(dS(i))return{value:String.fromCodePoint(n,i),size:12}}throw(0,Fr.syntaxError)(e.source,t,`Invalid Unicode escape sequence: "${r.slice(t,t+6)}".`)}function uS(e,t){return oa(e.charCodeAt(t))<<12|oa(e.charCodeAt(t+1))<<8|oa(e.charCodeAt(t+2))<<4|oa(e.charCodeAt(t+3))}function oa(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function hq(e,t){let r=e.source.body;switch(r.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
52
+ `,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw(0,Fr.syntaxError)(e.source,t,`Invalid character escape sequence: "${r.slice(t,t+2)}".`)}function mq(e,t){let r=e.source.body,n=r.length,i=e.lineStart,s=t+3,o=s,a="",c=[];for(;s<n;){let l=r.charCodeAt(s);if(l===34&&r.charCodeAt(s+1)===34&&r.charCodeAt(s+2)===34){a+=r.slice(o,s),c.push(a);let p=ut(e,Se.TokenKind.BLOCK_STRING,t,s+3,(0,oq.dedentBlockStringLines)(c).join(`
53
+ `));return e.line+=c.length-1,e.lineStart=i,p}if(l===92&&r.charCodeAt(s+1)===34&&r.charCodeAt(s+2)===34&&r.charCodeAt(s+3)===34){a+=r.slice(o,s),o=s+1,s+=4;continue}if(l===10||l===13){a+=r.slice(o,s),c.push(a),l===13&&r.charCodeAt(s+1)===10?s+=2:++s,a="",o=s,i=s;continue}if(Hs(l))++s;else if(Ou(r,s))s+=2;else throw(0,Fr.syntaxError)(e.source,s,`Invalid character within String: ${Xn(e,s)}.`)}throw(0,Fr.syntaxError)(e.source,s,"Unterminated string.")}function fS(e,t){let r=e.source.body,n=r.length,i=t+1;for(;i<n;){let s=r.charCodeAt(i);if((0,Di.isNameContinue)(s))++i;else break}return ut(e,Se.TokenKind.NAME,t,i,r.slice(t,i))}});var hS=T(_u=>{"use strict";u();Object.defineProperty(_u,"__esModule",{value:!0});_u.SchemaCoordinateLexer=void 0;var gq=Zo(),yq=qr(),bq=ra(),ei=aa(),ti=Gs(),qh=class{line=1;lineStart=0;constructor(t){let r=new yq.Token(ti.TokenKind.SOF,0,0,0,0);this.source=t,this.lastToken=r,this.token=r}get[Symbol.toStringTag](){return"SchemaCoordinateLexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==ti.TokenKind.EOF){let r=vq(this,t.end);t.next=r,r.prev=t,t=r}return t}};_u.SchemaCoordinateLexer=qh;function vq(e,t){let r=e.source.body,n=r.length,i=t;if(i<n){let s=r.charCodeAt(i);switch(s){case 46:return(0,ei.createToken)(e,ti.TokenKind.DOT,i,i+1);case 40:return(0,ei.createToken)(e,ti.TokenKind.PAREN_L,i,i+1);case 41:return(0,ei.createToken)(e,ti.TokenKind.PAREN_R,i,i+1);case 58:return(0,ei.createToken)(e,ti.TokenKind.COLON,i,i+1);case 64:return(0,ei.createToken)(e,ti.TokenKind.AT,i,i+1)}if((0,bq.isNameStart)(s))return(0,ei.readName)(e,i);throw(0,gq.syntaxError)(e.source,i,`Invalid character: ${(0,ei.printCodePointAt)(e,i)}.`)}return(0,ei.createToken)(e,ti.TokenKind.EOF,n,n)}});var Be=T(Fh=>{"use strict";u();Object.defineProperty(Fh,"__esModule",{value:!0});Fh.inspect=Eq;var Tq=10,mS=2;function Eq(e){return Au(e,[])}function Au(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return xq(e,t);default:return String(e)}}function xq(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let r=[...t,e];if(wq(e)){let n=e.toJSON();if(n!==e)return typeof n=="string"?n:Au(n,r)}else if(Array.isArray(e))return Oq(e,r);return Sq(e,r)}function wq(e){return typeof e.toJSON=="function"}function Sq(e,t){let r=Object.entries(e);return r.length===0?"{}":t.length>mS?"["+_q(e)+"]":"{ "+r.map(([i,s])=>i+": "+Au(s,t)).join(", ")+" }"}function Oq(e,t){if(e.length===0)return"[]";if(t.length>mS)return"[Array]";let r=Math.min(Tq,e.length),n=e.length-r,i=[];for(let s=0;s<r;++s)i.push(Au(e[s],t));return n===1?i.push("... 1 more item"):n>1&&i.push(`... ${n} more items`),"["+i.join(", ")+"]"}function _q(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let r=e.constructor.name;if(typeof r=="string"&&r!=="")return r}return t}});var ca=T(Nu=>{"use strict";u();Object.defineProperty(Nu,"__esModule",{value:!0});Nu.instanceOf=void 0;var Aq=Be(),Nq=globalThis.process&&process.env.NODE_ENV==="production",Iq=Nq?function(t,r){return t instanceof r}:function(t,r){if(t instanceof r)return!0;if(typeof t=="object"&&t!==null){var n;let i=r.prototype[Symbol.toStringTag],s=Symbol.toStringTag in t?t[Symbol.toStringTag]:(n=t.constructor)===null||n===void 0?void 0:n.name;if(i===s){let o=(0,Aq.inspect)(t);throw new Error(`Cannot use ${i} "${o}" from another module or realm.
54
+
55
+ Ensure that there is only one instance of "graphql" in the node_modules
56
+ directory. If different versions of "graphql" are the dependencies of other
57
+ relied on modules, use "resolutions" to ensure only one version is installed.
58
+
59
+ https://yarnpkg.com/en/docs/selective-version-resolutions
60
+
61
+ Duplicate "graphql" modules cannot be used at the same time since different
62
+ versions may have different capabilities and behavior. The data from one
63
+ version used in the function from another could produce confusing and
64
+ spurious results.`)}}return!1};Nu.instanceOf=Iq});var Ru=T(ua=>{"use strict";u();Object.defineProperty(ua,"__esModule",{value:!0});ua.Source=void 0;ua.isSource=Lq;var Mh=qt(),Rq=Be(),Cq=ca(),Iu=class{constructor(t,r="GraphQL request",n={line:1,column:1}){typeof t=="string"||(0,Mh.devAssert)(!1,`Body must be a string. Received: ${(0,Rq.inspect)(t)}.`),this.body=t,this.name=r,this.locationOffset=n,this.locationOffset.line>0||(0,Mh.devAssert)(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,Mh.devAssert)(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};ua.Source=Iu;function Lq(e){return(0,Cq.instanceOf)(e,Iu)}});var $i=T(Nn=>{"use strict";u();Object.defineProperty(Nn,"__esModule",{value:!0});Nn.Parser=void 0;Nn.parse=$q;Nn.parseConstValue=jq;Nn.parseSchemaCoordinate=Fq;Nn.parseType=qq;Nn.parseValue=Pq;var ri=Zo(),la=qr(),kq=Ks(),pe=Ie(),gS=aa(),Dq=hS(),Lu=Ru(),W=Gs();function $q(e,t){let r=new ni(e,t),n=r.parseDocument();return Object.defineProperty(n,"tokenCount",{enumerable:!1,value:r.tokenCount}),n}function Pq(e,t){let r=new ni(e,t);r.expectToken(W.TokenKind.SOF);let n=r.parseValueLiteral(!1);return r.expectToken(W.TokenKind.EOF),n}function jq(e,t){let r=new ni(e,t);r.expectToken(W.TokenKind.SOF);let n=r.parseConstValueLiteral();return r.expectToken(W.TokenKind.EOF),n}function qq(e,t){let r=new ni(e,t);r.expectToken(W.TokenKind.SOF);let n=r.parseTypeReference();return r.expectToken(W.TokenKind.EOF),n}function Fq(e){let t=(0,Lu.isSource)(e)?e:new Lu.Source(e),r=new Dq.SchemaCoordinateLexer(t),n=new ni(e,{lexer:r});n.expectToken(W.TokenKind.SOF);let i=n.parseSchemaCoordinate();return n.expectToken(W.TokenKind.EOF),i}var ni=class{constructor(t,r={}){let{lexer:n,...i}=r;if(n)this._lexer=n;else{let s=(0,Lu.isSource)(t)?t:new Lu.Source(t);this._lexer=new gS.Lexer(s)}this._options=i,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let t=this.expectToken(W.TokenKind.NAME);return this.node(t,{kind:pe.Kind.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:pe.Kind.DOCUMENT,definitions:this.many(W.TokenKind.SOF,this.parseDefinition,W.TokenKind.EOF)})}parseDefinition(){if(this.peek(W.TokenKind.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),r=t?this._lexer.lookahead():this._lexer.token;if(t&&r.kind===W.TokenKind.BRACE_L)throw(0,ri.syntaxError)(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(r.kind===W.TokenKind.NAME){switch(r.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}switch(r.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(t)throw(0,ri.syntaxError)(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");switch(r.value){case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(r)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(W.TokenKind.BRACE_L))return this.node(t,{kind:pe.Kind.OPERATION_DEFINITION,operation:la.OperationTypeNode.QUERY,description:void 0,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let r=this.parseDescription(),n=this.parseOperationType(),i;return this.peek(W.TokenKind.NAME)&&(i=this.parseName()),this.node(t,{kind:pe.Kind.OPERATION_DEFINITION,operation:n,description:r,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(W.TokenKind.NAME);switch(t.value){case"query":return la.OperationTypeNode.QUERY;case"mutation":return la.OperationTypeNode.MUTATION;case"subscription":return la.OperationTypeNode.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(W.TokenKind.PAREN_L,this.parseVariableDefinition,W.TokenKind.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:pe.Kind.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(W.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(W.TokenKind.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(W.TokenKind.DOLLAR),this.node(t,{kind:pe.Kind.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:pe.Kind.SELECTION_SET,selections:this.many(W.TokenKind.BRACE_L,this.parseSelection,W.TokenKind.BRACE_R)})}parseSelection(){return this.peek(W.TokenKind.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,r=this.parseName(),n,i;return this.expectOptionalToken(W.TokenKind.COLON)?(n=r,i=this.parseName()):i=r,this.node(t,{kind:pe.Kind.FIELD,alias:n,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(W.TokenKind.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let r=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(W.TokenKind.PAREN_L,r,W.TokenKind.PAREN_R)}parseArgument(t=!1){let r=this._lexer.token,n=this.parseName();return this.expectToken(W.TokenKind.COLON),this.node(r,{kind:pe.Kind.ARGUMENT,name:n,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let t=this._lexer.token;this.expectToken(W.TokenKind.SPREAD);let r=this.expectOptionalKeyword("on");return!r&&this.peek(W.TokenKind.NAME)?this.node(t,{kind:pe.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:pe.Kind.INLINE_FRAGMENT,typeCondition:r?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let t=this._lexer.token,r=this.parseDescription();return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:pe.Kind.FRAGMENT_DEFINITION,description:r,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:pe.Kind.FRAGMENT_DEFINITION,description:r,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){let r=this._lexer.token;switch(r.kind){case W.TokenKind.BRACKET_L:return this.parseList(t);case W.TokenKind.BRACE_L:return this.parseObject(t);case W.TokenKind.INT:return this.advanceLexer(),this.node(r,{kind:pe.Kind.INT,value:r.value});case W.TokenKind.FLOAT:return this.advanceLexer(),this.node(r,{kind:pe.Kind.FLOAT,value:r.value});case W.TokenKind.STRING:case W.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case W.TokenKind.NAME:switch(this.advanceLexer(),r.value){case"true":return this.node(r,{kind:pe.Kind.BOOLEAN,value:!0});case"false":return this.node(r,{kind:pe.Kind.BOOLEAN,value:!1});case"null":return this.node(r,{kind:pe.Kind.NULL});default:return this.node(r,{kind:pe.Kind.ENUM,value:r.value})}case W.TokenKind.DOLLAR:if(t)if(this.expectToken(W.TokenKind.DOLLAR),this._lexer.token.kind===W.TokenKind.NAME){let n=this._lexer.token.value;throw(0,ri.syntaxError)(this._lexer.source,r.start,`Unexpected variable "$${n}" in constant value.`)}else throw this.unexpected(r);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:pe.Kind.STRING,value:t.value,block:t.kind===W.TokenKind.BLOCK_STRING})}parseList(t){let r=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:pe.Kind.LIST,values:this.any(W.TokenKind.BRACKET_L,r,W.TokenKind.BRACKET_R)})}parseObject(t){let r=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:pe.Kind.OBJECT,fields:this.any(W.TokenKind.BRACE_L,r,W.TokenKind.BRACE_R)})}parseObjectField(t){let r=this._lexer.token,n=this.parseName();return this.expectToken(W.TokenKind.COLON),this.node(r,{kind:pe.Kind.OBJECT_FIELD,name:n,value:this.parseValueLiteral(t)})}parseDirectives(t){let r=[];for(;this.peek(W.TokenKind.AT);)r.push(this.parseDirective(t));return r}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){let r=this._lexer.token;return this.expectToken(W.TokenKind.AT),this.node(r,{kind:pe.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,r;if(this.expectOptionalToken(W.TokenKind.BRACKET_L)){let n=this.parseTypeReference();this.expectToken(W.TokenKind.BRACKET_R),r=this.node(t,{kind:pe.Kind.LIST_TYPE,type:n})}else r=this.parseNamedType();return this.expectOptionalToken(W.TokenKind.BANG)?this.node(t,{kind:pe.Kind.NON_NULL_TYPE,type:r}):r}parseNamedType(){return this.node(this._lexer.token,{kind:pe.Kind.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(W.TokenKind.STRING)||this.peek(W.TokenKind.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,r=this.parseDescription();this.expectKeyword("schema");let n=this.parseConstDirectives(),i=this.many(W.TokenKind.BRACE_L,this.parseOperationTypeDefinition,W.TokenKind.BRACE_R);return this.node(t,{kind:pe.Kind.SCHEMA_DEFINITION,description:r,directives:n,operationTypes:i})}parseOperationTypeDefinition(){let t=this._lexer.token,r=this.parseOperationType();this.expectToken(W.TokenKind.COLON);let n=this.parseNamedType();return this.node(t,{kind:pe.Kind.OPERATION_TYPE_DEFINITION,operation:r,type:n})}parseScalarTypeDefinition(){let t=this._lexer.token,r=this.parseDescription();this.expectKeyword("scalar");let n=this.parseName(),i=this.parseConstDirectives();return this.node(t,{kind:pe.Kind.SCALAR_TYPE_DEFINITION,description:r,name:n,directives:i})}parseObjectTypeDefinition(){let t=this._lexer.token,r=this.parseDescription();this.expectKeyword("type");let n=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:pe.Kind.OBJECT_TYPE_DEFINITION,description:r,name:n,interfaces:i,directives:s,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(W.TokenKind.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(W.TokenKind.BRACE_L,this.parseFieldDefinition,W.TokenKind.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,r=this.parseDescription(),n=this.parseName(),i=this.parseArgumentDefs();this.expectToken(W.TokenKind.COLON);let s=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(t,{kind:pe.Kind.FIELD_DEFINITION,description:r,name:n,arguments:i,type:s,directives:o})}parseArgumentDefs(){return this.optionalMany(W.TokenKind.PAREN_L,this.parseInputValueDef,W.TokenKind.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,r=this.parseDescription(),n=this.parseName();this.expectToken(W.TokenKind.COLON);let i=this.parseTypeReference(),s;this.expectOptionalToken(W.TokenKind.EQUALS)&&(s=this.parseConstValueLiteral());let o=this.parseConstDirectives();return this.node(t,{kind:pe.Kind.INPUT_VALUE_DEFINITION,description:r,name:n,type:i,defaultValue:s,directives:o})}parseInterfaceTypeDefinition(){let t=this._lexer.token,r=this.parseDescription();this.expectKeyword("interface");let n=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:pe.Kind.INTERFACE_TYPE_DEFINITION,description:r,name:n,interfaces:i,directives:s,fields:o})}parseUnionTypeDefinition(){let t=this._lexer.token,r=this.parseDescription();this.expectKeyword("union");let n=this.parseName(),i=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(t,{kind:pe.Kind.UNION_TYPE_DEFINITION,description:r,name:n,directives:i,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(W.TokenKind.EQUALS)?this.delimitedMany(W.TokenKind.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let t=this._lexer.token,r=this.parseDescription();this.expectKeyword("enum");let n=this.parseName(),i=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(t,{kind:pe.Kind.ENUM_TYPE_DEFINITION,description:r,name:n,directives:i,values:s})}parseEnumValuesDefinition(){return this.optionalMany(W.TokenKind.BRACE_L,this.parseEnumValueDefinition,W.TokenKind.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,r=this.parseDescription(),n=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(t,{kind:pe.Kind.ENUM_VALUE_DEFINITION,description:r,name:n,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw(0,ri.syntaxError)(this._lexer.source,this._lexer.token.start,`${Cu(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let t=this._lexer.token,r=this.parseDescription();this.expectKeyword("input");let n=this.parseName(),i=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(t,{kind:pe.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:r,name:n,directives:i,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(W.TokenKind.BRACE_L,this.parseInputValueDef,W.TokenKind.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===W.TokenKind.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let r=this.parseConstDirectives(),n=this.optionalMany(W.TokenKind.BRACE_L,this.parseOperationTypeDefinition,W.TokenKind.BRACE_R);if(r.length===0&&n.length===0)throw this.unexpected();return this.node(t,{kind:pe.Kind.SCHEMA_EXTENSION,directives:r,operationTypes:n})}parseScalarTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let r=this.parseName(),n=this.parseConstDirectives();if(n.length===0)throw this.unexpected();return this.node(t,{kind:pe.Kind.SCALAR_TYPE_EXTENSION,name:r,directives:n})}parseObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(n.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:pe.Kind.OBJECT_TYPE_EXTENSION,name:r,interfaces:n,directives:i,fields:s})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(n.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:pe.Kind.INTERFACE_TYPE_EXTENSION,name:r,interfaces:n,directives:i,fields:s})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let r=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:pe.Kind.UNION_TYPE_EXTENSION,name:r,directives:n,types:i})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let r=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:pe.Kind.ENUM_TYPE_EXTENSION,name:r,directives:n,values:i})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let r=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:pe.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:r,directives:n,fields:i})}parseDirectiveDefinition(){let t=this._lexer.token,r=this.parseDescription();this.expectKeyword("directive"),this.expectToken(W.TokenKind.AT);let n=this.parseName(),i=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let o=this.parseDirectiveLocations();return this.node(t,{kind:pe.Kind.DIRECTIVE_DEFINITION,description:r,name:n,arguments:i,repeatable:s,locations:o})}parseDirectiveLocations(){return this.delimitedMany(W.TokenKind.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,r=this.parseName();if(Object.prototype.hasOwnProperty.call(kq.DirectiveLocation,r.value))return r;throw this.unexpected(t)}parseSchemaCoordinate(){let t=this._lexer.token,r=this.expectOptionalToken(W.TokenKind.AT),n=this.parseName(),i;!r&&this.expectOptionalToken(W.TokenKind.DOT)&&(i=this.parseName());let s;return(r||i)&&this.expectOptionalToken(W.TokenKind.PAREN_L)&&(s=this.parseName(),this.expectToken(W.TokenKind.COLON),this.expectToken(W.TokenKind.PAREN_R)),r?s?this.node(t,{kind:pe.Kind.DIRECTIVE_ARGUMENT_COORDINATE,name:n,argumentName:s}):this.node(t,{kind:pe.Kind.DIRECTIVE_COORDINATE,name:n}):i?s?this.node(t,{kind:pe.Kind.ARGUMENT_COORDINATE,name:n,fieldName:i,argumentName:s}):this.node(t,{kind:pe.Kind.MEMBER_COORDINATE,name:n,memberName:i}):this.node(t,{kind:pe.Kind.TYPE_COORDINATE,name:n})}node(t,r){return this._options.noLocation!==!0&&(r.loc=new la.Location(t,this._lexer.lastToken,this._lexer.source)),r}peek(t){return this._lexer.token.kind===t}expectToken(t){let r=this._lexer.token;if(r.kind===t)return this.advanceLexer(),r;throw(0,ri.syntaxError)(this._lexer.source,r.start,`Expected ${yS(t)}, found ${Cu(r)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){let r=this._lexer.token;if(r.kind===W.TokenKind.NAME&&r.value===t)this.advanceLexer();else throw(0,ri.syntaxError)(this._lexer.source,r.start,`Expected "${t}", found ${Cu(r)}.`)}expectOptionalKeyword(t){let r=this._lexer.token;return r.kind===W.TokenKind.NAME&&r.value===t?(this.advanceLexer(),!0):!1}unexpected(t){let r=t??this._lexer.token;return(0,ri.syntaxError)(this._lexer.source,r.start,`Unexpected ${Cu(r)}.`)}any(t,r,n){this.expectToken(t);let i=[];for(;!this.expectOptionalToken(n);)i.push(r.call(this));return i}optionalMany(t,r,n){if(this.expectOptionalToken(t)){let i=[];do i.push(r.call(this));while(!this.expectOptionalToken(n));return i}return[]}many(t,r,n){this.expectToken(t);let i=[];do i.push(r.call(this));while(!this.expectOptionalToken(n));return i}delimitedMany(t,r){this.expectOptionalToken(t);let n=[];do n.push(r.call(this));while(this.expectOptionalToken(t));return n}advanceLexer(){let{maxTokens:t}=this._options,r=this._lexer.advance();if(r.kind!==W.TokenKind.EOF&&(++this._tokenCounter,t!==void 0&&this._tokenCounter>t))throw(0,ri.syntaxError)(this._lexer.source,r.start,`Document contains more that ${t} tokens. Parsing aborted.`)}};Nn.Parser=ni;function Cu(e){let t=e.value;return yS(e.kind)+(t!=null?` "${t}"`:"")}function yS(e){return(0,gS.isPunctuatorTokenKind)(e)?`"${e}"`:e}});var ii=T(Uh=>{"use strict";u();Object.defineProperty(Uh,"__esModule",{value:!0});Uh.didYouMean=Uq;var Mq=5;function Uq(e,t){let[r,n]=t?[e,t]:[void 0,e],i=" Did you mean ";r&&(i+=r+" ");let s=n.map(c=>`"${c}"`);switch(s.length){case 0:return"";case 1:return i+s[0]+"?";case 2:return i+s[0]+" or "+s[1]+"?"}let o=s.slice(0,Mq),a=o.pop();return i+o.join(", ")+", or "+a+"?"}});var bS=T(Bh=>{"use strict";u();Object.defineProperty(Bh,"__esModule",{value:!0});Bh.identityFunc=Bq;function Bq(e){return e}});var si=T(Vh=>{"use strict";u();Object.defineProperty(Vh,"__esModule",{value:!0});Vh.keyMap=Vq;function Vq(e,t){let r=Object.create(null);for(let n of e)r[t(n)]=n;return r}});var pa=T(Kh=>{"use strict";u();Object.defineProperty(Kh,"__esModule",{value:!0});Kh.keyValMap=Kq;function Kq(e,t,r){let n=Object.create(null);for(let i of e)n[t(i)]=r(i);return n}});var Hh=T(Gh=>{"use strict";u();Object.defineProperty(Gh,"__esModule",{value:!0});Gh.mapValue=Gq;function Gq(e,t){let r=Object.create(null);for(let n of Object.keys(e))r[n]=t(e[n],n);return r}});var da=T(zh=>{"use strict";u();Object.defineProperty(zh,"__esModule",{value:!0});zh.naturalCompare=Hq;function Hq(e,t){let r=0,n=0;for(;r<e.length&&n<t.length;){let i=e.charCodeAt(r),s=t.charCodeAt(n);if(ku(i)&&ku(s)){let o=0;do++r,o=o*10+i-Qh,i=e.charCodeAt(r);while(ku(i)&&o>0);let a=0;do++n,a=a*10+s-Qh,s=t.charCodeAt(n);while(ku(s)&&a>0);if(o<a)return-1;if(o>a)return 1}else{if(i<s)return-1;if(i>s)return 1;++r,++n}}return e.length-t.length}var Qh=48,Qq=57;function ku(e){return!isNaN(e)&&Qh<=e&&e<=Qq}});var oi=T(Jh=>{"use strict";u();Object.defineProperty(Jh,"__esModule",{value:!0});Jh.suggestionList=Wq;var zq=da();function Wq(e,t){let r=Object.create(null),n=new Wh(e),i=Math.floor(e.length*.4)+1;for(let s of t){let o=n.measure(s,i);o!==void 0&&(r[s]=o)}return Object.keys(r).sort((s,o)=>{let a=r[s]-r[o];return a!==0?a:(0,zq.naturalCompare)(s,o)})}var Wh=class{constructor(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=vS(this._inputLowerCase),this._rows=[new Array(t.length+1).fill(0),new Array(t.length+1).fill(0),new Array(t.length+1).fill(0)]}measure(t,r){if(this._input===t)return 0;let n=t.toLowerCase();if(this._inputLowerCase===n)return 1;let i=vS(n),s=this._inputArray;if(i.length<s.length){let p=i;i=s,s=p}let o=i.length,a=s.length;if(o-a>r)return;let c=this._rows;for(let p=0;p<=a;p++)c[0][p]=p;for(let p=1;p<=o;p++){let d=c[(p-1)%3],f=c[p%3],m=f[0]=p;for(let h=1;h<=a;h++){let v=i[p-1]===s[h-1]?0:1,E=Math.min(d[h]+1,f[h-1]+1,d[h-1]+v);if(p>1&&h>1&&i[p-1]===s[h-2]&&i[p-2]===s[h-1]){let A=c[(p-2)%3][h-2];E=Math.min(E,A+1)}E<m&&(m=E),f[h]=E}if(m>r)return}let l=c[o%3][a];return l<=r?l:void 0}};function vS(e){let t=e.length,r=new Array(t);for(let n=0;n<t;++n)r[n]=e.charCodeAt(n);return r}});var Du=T(Yh=>{"use strict";u();Object.defineProperty(Yh,"__esModule",{value:!0});Yh.toObjMap=Jq;function Jq(e){if(e==null)return Object.create(null);if(Object.getPrototypeOf(e)===null)return e;let t=Object.create(null);for(let[r,n]of Object.entries(e))t[r]=n;return t}});var TS=T(Xh=>{"use strict";u();Object.defineProperty(Xh,"__esModule",{value:!0});Xh.printString=Yq;function Yq(e){return`"${e.replace(Xq,Zq)}"`}var Xq=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Zq(e){return eF[e.charCodeAt(0)]}var eF=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"]});var Pi=T(ai=>{"use strict";u();Object.defineProperty(ai,"__esModule",{value:!0});ai.BREAK=void 0;ai.getEnterLeaveForKind=$u;ai.getVisitFn=sF;ai.visit=nF;ai.visitInParallel=iF;var tF=qt(),rF=Be(),Zh=qr(),ES=Ie(),Qs=Object.freeze({});ai.BREAK=Qs;function nF(e,t,r=Zh.QueryDocumentKeys){let n=new Map;for(let A of Object.values(ES.Kind))n.set(A,$u(t,A));let i,s=Array.isArray(e),o=[e],a=-1,c=[],l=e,p,d,f=[],m=[];do{a++;let A=a===o.length,w=A&&c.length!==0;if(A){if(p=m.length===0?void 0:f[f.length-1],l=d,d=m.pop(),w)if(s){l=l.slice();let I=0;for(let[C,R]of c){let q=C-I;R===null?(l.splice(q,1),I++):l[q]=R}}else{l={...l};for(let[I,C]of c)l[I]=C}a=i.index,o=i.keys,c=i.edits,s=i.inArray,i=i.prev}else if(d){if(p=s?a:o[a],l=d[p],l==null)continue;f.push(p)}let _;if(!Array.isArray(l)){var h,v;(0,Zh.isNode)(l)||(0,tF.devAssert)(!1,`Invalid AST Node: ${(0,rF.inspect)(l)}.`);let I=A?(h=n.get(l.kind))===null||h===void 0?void 0:h.leave:(v=n.get(l.kind))===null||v===void 0?void 0:v.enter;if(_=I?.call(t,l,p,d,f,m),_===Qs)break;if(_===!1){if(!A){f.pop();continue}}else if(_!==void 0&&(c.push([p,_]),!A))if((0,Zh.isNode)(_))l=_;else{f.pop();continue}}if(_===void 0&&w&&c.push([p,l]),A)f.pop();else{var E;i={inArray:s,index:a,keys:o,edits:c,prev:i},s=Array.isArray(l),o=s?l:(E=r[l.kind])!==null&&E!==void 0?E:[],a=-1,c=[],d&&m.push(d),d=l}}while(i!==void 0);return c.length!==0?c[c.length-1][1]:e}function iF(e){let t=new Array(e.length).fill(null),r=Object.create(null);for(let n of Object.values(ES.Kind)){let i=!1,s=new Array(e.length).fill(void 0),o=new Array(e.length).fill(void 0);for(let c=0;c<e.length;++c){let{enter:l,leave:p}=$u(e[c],n);i||(i=l!=null||p!=null),s[c]=l,o[c]=p}if(!i)continue;let a={enter(...c){let l=c[0];for(let d=0;d<e.length;d++)if(t[d]===null){var p;let f=(p=s[d])===null||p===void 0?void 0:p.apply(e[d],c);if(f===!1)t[d]=l;else if(f===Qs)t[d]=Qs;else if(f!==void 0)return f}},leave(...c){let l=c[0];for(let d=0;d<e.length;d++)if(t[d]===null){var p;let f=(p=o[d])===null||p===void 0?void 0:p.apply(e[d],c);if(f===Qs)t[d]=Qs;else if(f!==void 0&&f!==!1)return f}else t[d]===l&&(t[d]=null)}};r[n]=a}return r}function $u(e,t){let r=e[t];return typeof r=="object"?r:typeof r=="function"?{enter:r,leave:void 0}:{enter:e.enter,leave:e.leave}}function sF(e,t,r){let{enter:n,leave:i}=$u(e,t);return r?i:n}});var ur=T(tm=>{"use strict";u();Object.defineProperty(tm,"__esModule",{value:!0});tm.print=uF;var oF=ia(),aF=TS(),cF=Pi();function uF(e){return(0,cF.visit)(e,pF)}var lF=80,pF={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>ee(e.definitions,`
65
+
66
+ `)},OperationDefinition:{leave(e){let t=em(e.variableDefinitions)?ve(`(
67
+ `,ee(e.variableDefinitions,`
68
+ `),`
69
+ )`):ve("(",ee(e.variableDefinitions,", "),")"),r=ve("",e.description,`
70
+ `)+ee([e.operation,ee([e.name,t]),ee(e.directives," ")]," ");return(r==="query"?"":r+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:r,directives:n,description:i})=>ve("",i,`
71
+ `)+e+": "+t+ve(" = ",r)+ve(" ",ee(n," "))},SelectionSet:{leave:({selections:e})=>Mr(e)},Field:{leave({alias:e,name:t,arguments:r,directives:n,selectionSet:i}){let s=ve("",e,": ")+t,o=s+ve("(",ee(r,", "),")");return o.length>lF&&(o=s+ve(`(
72
+ `,Pu(ee(r,`
73
+ `)),`
74
+ )`)),ee([o,ee(n," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+ve(" ",ee(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:r})=>ee(["...",ve("on ",e),ee(t," "),r]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:r,directives:n,selectionSet:i,description:s})=>ve("",s,`
75
+ `)+`fragment ${e}${ve("(",ee(r,", "),")")} on ${t} ${ve("",ee(n," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?(0,oF.printBlockString)(e):(0,aF.printString)(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+ee(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+ee(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+ve("(",ee(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:r})=>ve("",e,`
76
+ `)+ee(["schema",ee(t," "),Mr(r)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:r})=>ve("",e,`
77
+ `)+ee(["scalar",t,ee(r," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>ve("",e,`
78
+ `)+ee(["type",t,ve("implements ",ee(r," & ")),ee(n," "),Mr(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:r,type:n,directives:i})=>ve("",e,`
79
+ `)+t+(em(r)?ve(`(
80
+ `,Pu(ee(r,`
81
+ `)),`
82
+ )`):ve("(",ee(r,", "),")"))+": "+n+ve(" ",ee(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:r,defaultValue:n,directives:i})=>ve("",e,`
83
+ `)+ee([t+": "+r,ve("= ",n),ee(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>ve("",e,`
84
+ `)+ee(["interface",t,ve("implements ",ee(r," & ")),ee(n," "),Mr(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:r,types:n})=>ve("",e,`
85
+ `)+ee(["union",t,ee(r," "),ve("= ",ee(n," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:r,values:n})=>ve("",e,`
86
+ `)+ee(["enum",t,ee(r," "),Mr(n)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:r})=>ve("",e,`
87
+ `)+ee([t,ee(r," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:r,fields:n})=>ve("",e,`
88
+ `)+ee(["input",t,ee(r," "),Mr(n)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:r,repeatable:n,locations:i})=>ve("",e,`
89
+ `)+"directive @"+t+(em(r)?ve(`(
90
+ `,Pu(ee(r,`
91
+ `)),`
92
+ )`):ve("(",ee(r,", "),")"))+(n?" repeatable":"")+" on "+ee(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>ee(["extend schema",ee(e," "),Mr(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>ee(["extend scalar",e,ee(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>ee(["extend type",e,ve("implements ",ee(t," & ")),ee(r," "),Mr(n)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>ee(["extend interface",e,ve("implements ",ee(t," & ")),ee(r," "),Mr(n)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:r})=>ee(["extend union",e,ee(t," "),ve("= ",ee(r," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:r})=>ee(["extend enum",e,ee(t," "),Mr(r)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:r})=>ee(["extend input",e,ee(t," "),Mr(r)]," ")},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>ee([e,ve(".",t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:r})=>ee([e,ve(".",t),ve("(",r,":)")])},DirectiveCoordinate:{leave:({name:e})=>ee(["@",e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>ee(["@",e,ve("(",t,":)")])}};function ee(e,t=""){var r;return(r=e?.filter(n=>n).join(t))!==null&&r!==void 0?r:""}function Mr(e){return ve(`{
93
+ `,Pu(ee(e,`
94
+ `)),`
95
+ }`)}function ve(e,t,r=""){return t!=null&&t!==""?e+t+r:""}function Pu(e){return ve(" ",e.replace(/\n/g,`
96
+ `))}function em(e){var t;return(t=e?.some(r=>r.includes(`
97
+ `)))!==null&&t!==void 0?t:!1}});var im=T(nm=>{"use strict";u();Object.defineProperty(nm,"__esModule",{value:!0});nm.valueFromASTUntyped=rm;var dF=pa(),In=Ie();function rm(e,t){switch(e.kind){case In.Kind.NULL:return null;case In.Kind.INT:return parseInt(e.value,10);case In.Kind.FLOAT:return parseFloat(e.value);case In.Kind.STRING:case In.Kind.ENUM:case In.Kind.BOOLEAN:return e.value;case In.Kind.LIST:return e.values.map(r=>rm(r,t));case In.Kind.OBJECT:return(0,dF.keyValMap)(e.fields,r=>r.name.value,r=>rm(r.value,t));case In.Kind.VARIABLE:return t?.[e.name.value]}}});var fa=T(qu=>{"use strict";u();Object.defineProperty(qu,"__esModule",{value:!0});qu.assertEnumValueName=fF;qu.assertName=SS;var xS=qt(),ju=ue(),wS=ra();function SS(e){if(e!=null||(0,xS.devAssert)(!1,"Must provide name."),typeof e=="string"||(0,xS.devAssert)(!1,"Expected name to be a string."),e.length===0)throw new ju.GraphQLError("Expected name to be a non-empty string.");for(let t=1;t<e.length;++t)if(!(0,wS.isNameContinue)(e.charCodeAt(t)))throw new ju.GraphQLError(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!(0,wS.isNameStart)(e.charCodeAt(0)))throw new ju.GraphQLError(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}function fF(e){if(e==="true"||e==="false"||e==="null")throw new ju.GraphQLError(`Enum values cannot be named: ${e}`);return SS(e)}});var Re=T(se=>{"use strict";u();Object.defineProperty(se,"__esModule",{value:!0});se.GraphQLUnionType=se.GraphQLScalarType=se.GraphQLObjectType=se.GraphQLNonNull=se.GraphQLList=se.GraphQLInterfaceType=se.GraphQLInputObjectType=se.GraphQLEnumType=void 0;se.argsToArgsConfig=jS;se.assertAbstractType=kF;se.assertCompositeType=LF;se.assertEnumType=OF;se.assertInputObjectType=_F;se.assertInputType=IF;se.assertInterfaceType=wF;se.assertLeafType=CF;se.assertListType=AF;se.assertNamedType=jF;se.assertNonNullType=NF;se.assertNullableType=$F;se.assertObjectType=xF;se.assertOutputType=RF;se.assertScalarType=EF;se.assertType=TF;se.assertUnionType=SF;se.assertWrappingType=DF;se.defineArguments=$S;se.getNamedType=qF;se.getNullableType=PF;se.isAbstractType=CS;se.isCompositeType=RS;se.isEnumType=Mi;se.isInputObjectType=ma;se.isInputType=sm;se.isInterfaceType=qi;se.isLeafType=IS;se.isListType=Ju;se.isNamedType=LS;se.isNonNullType=ui;se.isNullableType=am;se.isObjectType=Ws;se.isOutputType=om;se.isRequiredArgument=FF;se.isRequiredInputField=BF;se.isScalarType=ji;se.isType=Wu;se.isUnionType=Fi;se.isWrappingType=ga;se.resolveObjMapThunk=um;se.resolveReadonlyArrayThunk=cm;var St=qt(),hF=ii(),OS=bS(),Qe=Be(),ci=ca(),mF=cn(),gF=si(),NS=pa(),zu=Hh(),yF=oi(),un=Du(),ha=ue(),bF=Ie(),_S=ur(),vF=im(),ln=fa();function Wu(e){return ji(e)||Ws(e)||qi(e)||Fi(e)||Mi(e)||ma(e)||Ju(e)||ui(e)}function TF(e){if(!Wu(e))throw new Error(`Expected ${(0,Qe.inspect)(e)} to be a GraphQL type.`);return e}function ji(e){return(0,ci.instanceOf)(e,Bu)}function EF(e){if(!ji(e))throw new Error(`Expected ${(0,Qe.inspect)(e)} to be a GraphQL Scalar type.`);return e}function Ws(e){return(0,ci.instanceOf)(e,Vu)}function xF(e){if(!Ws(e))throw new Error(`Expected ${(0,Qe.inspect)(e)} to be a GraphQL Object type.`);return e}function qi(e){return(0,ci.instanceOf)(e,Ku)}function wF(e){if(!qi(e))throw new Error(`Expected ${(0,Qe.inspect)(e)} to be a GraphQL Interface type.`);return e}function Fi(e){return(0,ci.instanceOf)(e,Gu)}function SF(e){if(!Fi(e))throw new Error(`Expected ${(0,Qe.inspect)(e)} to be a GraphQL Union type.`);return e}function Mi(e){return(0,ci.instanceOf)(e,Hu)}function OF(e){if(!Mi(e))throw new Error(`Expected ${(0,Qe.inspect)(e)} to be a GraphQL Enum type.`);return e}function ma(e){return(0,ci.instanceOf)(e,Qu)}function _F(e){if(!ma(e))throw new Error(`Expected ${(0,Qe.inspect)(e)} to be a GraphQL Input Object type.`);return e}function Ju(e){return(0,ci.instanceOf)(e,Mu)}function AF(e){if(!Ju(e))throw new Error(`Expected ${(0,Qe.inspect)(e)} to be a GraphQL List type.`);return e}function ui(e){return(0,ci.instanceOf)(e,Uu)}function NF(e){if(!ui(e))throw new Error(`Expected ${(0,Qe.inspect)(e)} to be a GraphQL Non-Null type.`);return e}function sm(e){return ji(e)||Mi(e)||ma(e)||ga(e)&&sm(e.ofType)}function IF(e){if(!sm(e))throw new Error(`Expected ${(0,Qe.inspect)(e)} to be a GraphQL input type.`);return e}function om(e){return ji(e)||Ws(e)||qi(e)||Fi(e)||Mi(e)||ga(e)&&om(e.ofType)}function RF(e){if(!om(e))throw new Error(`Expected ${(0,Qe.inspect)(e)} to be a GraphQL output type.`);return e}function IS(e){return ji(e)||Mi(e)}function CF(e){if(!IS(e))throw new Error(`Expected ${(0,Qe.inspect)(e)} to be a GraphQL leaf type.`);return e}function RS(e){return Ws(e)||qi(e)||Fi(e)}function LF(e){if(!RS(e))throw new Error(`Expected ${(0,Qe.inspect)(e)} to be a GraphQL composite type.`);return e}function CS(e){return qi(e)||Fi(e)}function kF(e){if(!CS(e))throw new Error(`Expected ${(0,Qe.inspect)(e)} to be a GraphQL abstract type.`);return e}var Mu=class{constructor(t){Wu(t)||(0,St.devAssert)(!1,`Expected ${(0,Qe.inspect)(t)} to be a GraphQL type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}};se.GraphQLList=Mu;var Uu=class{constructor(t){am(t)||(0,St.devAssert)(!1,`Expected ${(0,Qe.inspect)(t)} to be a GraphQL nullable type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}};se.GraphQLNonNull=Uu;function ga(e){return Ju(e)||ui(e)}function DF(e){if(!ga(e))throw new Error(`Expected ${(0,Qe.inspect)(e)} to be a GraphQL wrapping type.`);return e}function am(e){return Wu(e)&&!ui(e)}function $F(e){if(!am(e))throw new Error(`Expected ${(0,Qe.inspect)(e)} to be a GraphQL nullable type.`);return e}function PF(e){if(e)return ui(e)?e.ofType:e}function LS(e){return ji(e)||Ws(e)||qi(e)||Fi(e)||Mi(e)||ma(e)}function jF(e){if(!LS(e))throw new Error(`Expected ${(0,Qe.inspect)(e)} to be a GraphQL named type.`);return e}function qF(e){if(e){let t=e;for(;ga(t);)t=t.ofType;return t}}function cm(e){return typeof e=="function"?e():e}function um(e){return typeof e=="function"?e():e}var Bu=class{constructor(t){var r,n,i,s;let o=(r=t.parseValue)!==null&&r!==void 0?r:OS.identityFunc;this.name=(0,ln.assertName)(t.name),this.description=t.description,this.specifiedByURL=t.specifiedByURL,this.serialize=(n=t.serialize)!==null&&n!==void 0?n:OS.identityFunc,this.parseValue=o,this.parseLiteral=(i=t.parseLiteral)!==null&&i!==void 0?i:(a,c)=>o((0,vF.valueFromASTUntyped)(a,c)),this.extensions=(0,un.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(s=t.extensionASTNodes)!==null&&s!==void 0?s:[],t.specifiedByURL==null||typeof t.specifiedByURL=="string"||(0,St.devAssert)(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${(0,Qe.inspect)(t.specifiedByURL)}.`),t.serialize==null||typeof t.serialize=="function"||(0,St.devAssert)(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),t.parseLiteral&&(typeof t.parseValue=="function"&&typeof t.parseLiteral=="function"||(0,St.devAssert)(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};se.GraphQLScalarType=Bu;var Vu=class{constructor(t){var r;this.name=(0,ln.assertName)(t.name),this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=(0,un.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(r=t.extensionASTNodes)!==null&&r!==void 0?r:[],this._fields=()=>DS(t),this._interfaces=()=>kS(t),t.isTypeOf==null||typeof t.isTypeOf=="function"||(0,St.devAssert)(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${(0,Qe.inspect)(t.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:PS(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};se.GraphQLObjectType=Vu;function kS(e){var t;let r=cm((t=e.interfaces)!==null&&t!==void 0?t:[]);return Array.isArray(r)||(0,St.devAssert)(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),r}function DS(e){let t=um(e.fields);return zs(t)||(0,St.devAssert)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,zu.mapValue)(t,(r,n)=>{var i;zs(r)||(0,St.devAssert)(!1,`${e.name}.${n} field config must be an object.`),r.resolve==null||typeof r.resolve=="function"||(0,St.devAssert)(!1,`${e.name}.${n} field resolver must be a function if provided, but got: ${(0,Qe.inspect)(r.resolve)}.`);let s=(i=r.args)!==null&&i!==void 0?i:{};return zs(s)||(0,St.devAssert)(!1,`${e.name}.${n} args must be an object with argument names as keys.`),{name:(0,ln.assertName)(n),description:r.description,type:r.type,args:$S(s),resolve:r.resolve,subscribe:r.subscribe,deprecationReason:r.deprecationReason,extensions:(0,un.toObjMap)(r.extensions),astNode:r.astNode}})}function $S(e){return Object.entries(e).map(([t,r])=>({name:(0,ln.assertName)(t),description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:(0,un.toObjMap)(r.extensions),astNode:r.astNode}))}function zs(e){return(0,mF.isObjectLike)(e)&&!Array.isArray(e)}function PS(e){return(0,zu.mapValue)(e,t=>({description:t.description,type:t.type,args:jS(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function jS(e){return(0,NS.keyValMap)(e,t=>t.name,t=>({description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function FF(e){return ui(e.type)&&e.defaultValue===void 0}var Ku=class{constructor(t){var r;this.name=(0,ln.assertName)(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=(0,un.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(r=t.extensionASTNodes)!==null&&r!==void 0?r:[],this._fields=DS.bind(void 0,t),this._interfaces=kS.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||(0,St.devAssert)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,Qe.inspect)(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:PS(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};se.GraphQLInterfaceType=Ku;var Gu=class{constructor(t){var r;this.name=(0,ln.assertName)(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=(0,un.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(r=t.extensionASTNodes)!==null&&r!==void 0?r:[],this._types=MF.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||(0,St.devAssert)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,Qe.inspect)(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};se.GraphQLUnionType=Gu;function MF(e){let t=cm(e.types);return Array.isArray(t)||(0,St.devAssert)(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}var Hu=class{constructor(t){var r;this.name=(0,ln.assertName)(t.name),this.description=t.description,this.extensions=(0,un.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(r=t.extensionASTNodes)!==null&&r!==void 0?r:[],this._values=typeof t.values=="function"?t.values:AS(this.name,t.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return typeof this._values=="function"&&(this._values=AS(this.name,this._values())),this._values}getValue(t){return this._nameLookup===null&&(this._nameLookup=(0,gF.keyMap)(this.getValues(),r=>r.name)),this._nameLookup[t]}serialize(t){this._valueLookup===null&&(this._valueLookup=new Map(this.getValues().map(n=>[n.value,n])));let r=this._valueLookup.get(t);if(r===void 0)throw new ha.GraphQLError(`Enum "${this.name}" cannot represent value: ${(0,Qe.inspect)(t)}`);return r.name}parseValue(t){if(typeof t!="string"){let n=(0,Qe.inspect)(t);throw new ha.GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${n}.`+Fu(this,n))}let r=this.getValue(t);if(r==null)throw new ha.GraphQLError(`Value "${t}" does not exist in "${this.name}" enum.`+Fu(this,t));return r.value}parseLiteral(t,r){if(t.kind!==bF.Kind.ENUM){let i=(0,_S.print)(t);throw new ha.GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${i}.`+Fu(this,i),{nodes:t})}let n=this.getValue(t.value);if(n==null){let i=(0,_S.print)(t);throw new ha.GraphQLError(`Value "${i}" does not exist in "${this.name}" enum.`+Fu(this,i),{nodes:t})}return n.value}toConfig(){let t=(0,NS.keyValMap)(this.getValues(),r=>r.name,r=>({description:r.description,value:r.value,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}));return{name:this.name,description:this.description,values:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};se.GraphQLEnumType=Hu;function Fu(e,t){let r=e.getValues().map(i=>i.name),n=(0,yF.suggestionList)(t,r);return(0,hF.didYouMean)("the enum value",n)}function AS(e,t){return zs(t)||(0,St.devAssert)(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([r,n])=>(zs(n)||(0,St.devAssert)(!1,`${e}.${r} must refer to an object with a "value" key representing an internal value but got: ${(0,Qe.inspect)(n)}.`),{name:(0,ln.assertEnumValueName)(r),description:n.description,value:n.value!==void 0?n.value:r,deprecationReason:n.deprecationReason,extensions:(0,un.toObjMap)(n.extensions),astNode:n.astNode}))}var Qu=class{constructor(t){var r,n;this.name=(0,ln.assertName)(t.name),this.description=t.description,this.extensions=(0,un.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(r=t.extensionASTNodes)!==null&&r!==void 0?r:[],this.isOneOf=(n=t.isOneOf)!==null&&n!==void 0?n:!1,this._fields=UF.bind(void 0,t)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){let t=(0,zu.mapValue)(this.getFields(),r=>({description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}));return{name:this.name,description:this.description,fields:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}};se.GraphQLInputObjectType=Qu;function UF(e){let t=um(e.fields);return zs(t)||(0,St.devAssert)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,zu.mapValue)(t,(r,n)=>(!("resolve"in r)||(0,St.devAssert)(!1,`${e.name}.${n} field has a resolve property, but Input Types cannot define resolvers.`),{name:(0,ln.assertName)(n),description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:(0,un.toObjMap)(r.extensions),astNode:r.astNode}))}function BF(e){return ui(e.type)&&e.defaultValue===void 0}});var ba=T(ya=>{"use strict";u();Object.defineProperty(ya,"__esModule",{value:!0});ya.doTypesOverlap=VF;ya.isEqualType=lm;ya.isTypeSubTypeOf=Yu;var Lt=Re();function lm(e,t){return e===t?!0:(0,Lt.isNonNullType)(e)&&(0,Lt.isNonNullType)(t)||(0,Lt.isListType)(e)&&(0,Lt.isListType)(t)?lm(e.ofType,t.ofType):!1}function Yu(e,t,r){return t===r?!0:(0,Lt.isNonNullType)(r)?(0,Lt.isNonNullType)(t)?Yu(e,t.ofType,r.ofType):!1:(0,Lt.isNonNullType)(t)?Yu(e,t.ofType,r):(0,Lt.isListType)(r)?(0,Lt.isListType)(t)?Yu(e,t.ofType,r.ofType):!1:(0,Lt.isListType)(t)?!1:(0,Lt.isAbstractType)(r)&&((0,Lt.isInterfaceType)(t)||(0,Lt.isObjectType)(t))&&e.isSubType(r,t)}function VF(e,t,r){return t===r?!0:(0,Lt.isAbstractType)(t)?(0,Lt.isAbstractType)(r)?e.getPossibleTypes(t).some(n=>e.isSubType(r,n)):e.isSubType(t,r):(0,Lt.isAbstractType)(r)?e.isSubType(r,t):!1}});var pn=T(vt=>{"use strict";u();Object.defineProperty(vt,"__esModule",{value:!0});vt.GraphQLString=vt.GraphQLInt=vt.GraphQLID=vt.GraphQLFloat=vt.GraphQLBoolean=vt.GRAPHQL_MIN_INT=vt.GRAPHQL_MAX_INT=void 0;vt.isSpecifiedScalarType=KF;vt.specifiedScalarTypes=void 0;var Ur=Be(),qS=cn(),Ot=ue(),Ui=Ie(),va=ur(),Ta=Re(),Xu=2147483647;vt.GRAPHQL_MAX_INT=Xu;var Zu=-2147483648;vt.GRAPHQL_MIN_INT=Zu;var FS=new Ta.GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){let t=Ea(e);if(typeof t=="boolean")return t?1:0;let r=t;if(typeof t=="string"&&t!==""&&(r=Number(t)),typeof r!="number"||!Number.isInteger(r))throw new Ot.GraphQLError(`Int cannot represent non-integer value: ${(0,Ur.inspect)(t)}`);if(r>Xu||r<Zu)throw new Ot.GraphQLError("Int cannot represent non 32-bit signed integer value: "+(0,Ur.inspect)(t));return r},parseValue(e){if(typeof e!="number"||!Number.isInteger(e))throw new Ot.GraphQLError(`Int cannot represent non-integer value: ${(0,Ur.inspect)(e)}`);if(e>Xu||e<Zu)throw new Ot.GraphQLError(`Int cannot represent non 32-bit signed integer value: ${e}`);return e},parseLiteral(e){if(e.kind!==Ui.Kind.INT)throw new Ot.GraphQLError(`Int cannot represent non-integer value: ${(0,va.print)(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>Xu||t<Zu)throw new Ot.GraphQLError(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t}});vt.GraphQLInt=FS;var MS=new Ta.GraphQLScalarType({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(e){let t=Ea(e);if(typeof t=="boolean")return t?1:0;let r=t;if(typeof t=="string"&&t!==""&&(r=Number(t)),typeof r!="number"||!Number.isFinite(r))throw new Ot.GraphQLError(`Float cannot represent non numeric value: ${(0,Ur.inspect)(t)}`);return r},parseValue(e){if(typeof e!="number"||!Number.isFinite(e))throw new Ot.GraphQLError(`Float cannot represent non numeric value: ${(0,Ur.inspect)(e)}`);return e},parseLiteral(e){if(e.kind!==Ui.Kind.FLOAT&&e.kind!==Ui.Kind.INT)throw new Ot.GraphQLError(`Float cannot represent non numeric value: ${(0,va.print)(e)}`,e);return parseFloat(e.value)}});vt.GraphQLFloat=MS;var US=new Ta.GraphQLScalarType({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(e){let t=Ea(e);if(typeof t=="string")return t;if(typeof t=="boolean")return t?"true":"false";if(typeof t=="number"&&Number.isFinite(t))return t.toString();throw new Ot.GraphQLError(`String cannot represent value: ${(0,Ur.inspect)(e)}`)},parseValue(e){if(typeof e!="string")throw new Ot.GraphQLError(`String cannot represent a non string value: ${(0,Ur.inspect)(e)}`);return e},parseLiteral(e){if(e.kind!==Ui.Kind.STRING)throw new Ot.GraphQLError(`String cannot represent a non string value: ${(0,va.print)(e)}`,{nodes:e});return e.value}});vt.GraphQLString=US;var BS=new Ta.GraphQLScalarType({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(e){let t=Ea(e);if(typeof t=="boolean")return t;if(Number.isFinite(t))return t!==0;throw new Ot.GraphQLError(`Boolean cannot represent a non boolean value: ${(0,Ur.inspect)(t)}`)},parseValue(e){if(typeof e!="boolean")throw new Ot.GraphQLError(`Boolean cannot represent a non boolean value: ${(0,Ur.inspect)(e)}`);return e},parseLiteral(e){if(e.kind!==Ui.Kind.BOOLEAN)throw new Ot.GraphQLError(`Boolean cannot represent a non boolean value: ${(0,va.print)(e)}`,{nodes:e});return e.value}});vt.GraphQLBoolean=BS;var VS=new Ta.GraphQLScalarType({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(e){let t=Ea(e);if(typeof t=="string")return t;if(Number.isInteger(t))return String(t);throw new Ot.GraphQLError(`ID cannot represent value: ${(0,Ur.inspect)(e)}`)},parseValue(e){if(typeof e=="string")return e;if(typeof e=="number"&&Number.isInteger(e))return e.toString();throw new Ot.GraphQLError(`ID cannot represent value: ${(0,Ur.inspect)(e)}`)},parseLiteral(e){if(e.kind!==Ui.Kind.STRING&&e.kind!==Ui.Kind.INT)throw new Ot.GraphQLError("ID cannot represent a non-string and non-integer value: "+(0,va.print)(e),{nodes:e});return e.value}});vt.GraphQLID=VS;var KS=Object.freeze([US,FS,MS,BS,VS]);vt.specifiedScalarTypes=KS;function KF(e){return KS.some(({name:t})=>e.name===t)}function Ea(e){if((0,qS.isObjectLike)(e)){if(typeof e.valueOf=="function"){let t=e.valueOf();if(!(0,qS.isObjectLike)(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}});var Xt=T(lt=>{"use strict";u();Object.defineProperty(lt,"__esModule",{value:!0});lt.GraphQLSpecifiedByDirective=lt.GraphQLSkipDirective=lt.GraphQLOneOfDirective=lt.GraphQLIncludeDirective=lt.GraphQLDirective=lt.GraphQLDeprecatedDirective=lt.DEFAULT_DEPRECATION_REASON=void 0;lt.assertDirective=JF;lt.isDirective=HS;lt.isSpecifiedDirective=YF;lt.specifiedDirectives=void 0;var GS=qt(),GF=Be(),HF=ca(),QF=cn(),zF=Du(),xr=Ks(),WF=fa(),xa=Re(),el=pn();function HS(e){return(0,HF.instanceOf)(e,Rn)}function JF(e){if(!HS(e))throw new Error(`Expected ${(0,GF.inspect)(e)} to be a GraphQL directive.`);return e}var Rn=class{constructor(t){var r,n;this.name=(0,WF.assertName)(t.name),this.description=t.description,this.locations=t.locations,this.isRepeatable=(r=t.isRepeatable)!==null&&r!==void 0?r:!1,this.extensions=(0,zF.toObjMap)(t.extensions),this.astNode=t.astNode,Array.isArray(t.locations)||(0,GS.devAssert)(!1,`@${t.name} locations must be an Array.`);let i=(n=t.args)!==null&&n!==void 0?n:{};(0,QF.isObjectLike)(i)&&!Array.isArray(i)||(0,GS.devAssert)(!1,`@${t.name} args must be an object with argument names as keys.`),this.args=(0,xa.defineArguments)(i)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:(0,xa.argsToArgsConfig)(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}};lt.GraphQLDirective=Rn;var QS=new Rn({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[xr.DirectiveLocation.FIELD,xr.DirectiveLocation.FRAGMENT_SPREAD,xr.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new xa.GraphQLNonNull(el.GraphQLBoolean),description:"Included when true."}}});lt.GraphQLIncludeDirective=QS;var zS=new Rn({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[xr.DirectiveLocation.FIELD,xr.DirectiveLocation.FRAGMENT_SPREAD,xr.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new xa.GraphQLNonNull(el.GraphQLBoolean),description:"Skipped when true."}}});lt.GraphQLSkipDirective=zS;var WS="No longer supported";lt.DEFAULT_DEPRECATION_REASON=WS;var JS=new Rn({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[xr.DirectiveLocation.FIELD_DEFINITION,xr.DirectiveLocation.ARGUMENT_DEFINITION,xr.DirectiveLocation.INPUT_FIELD_DEFINITION,xr.DirectiveLocation.ENUM_VALUE],args:{reason:{type:el.GraphQLString,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:WS}}});lt.GraphQLDeprecatedDirective=JS;var YS=new Rn({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[xr.DirectiveLocation.SCALAR],args:{url:{type:new xa.GraphQLNonNull(el.GraphQLString),description:"The URL that specifies the behavior of this scalar."}}});lt.GraphQLSpecifiedByDirective=YS;var XS=new Rn({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[xr.DirectiveLocation.INPUT_OBJECT],args:{}});lt.GraphQLOneOfDirective=XS;var ZS=Object.freeze([QS,zS,JS,YS,XS]);lt.specifiedDirectives=ZS;function YF(e){return ZS.some(({name:t})=>t===e.name)}});var tl=T(pm=>{"use strict";u();Object.defineProperty(pm,"__esModule",{value:!0});pm.isIterableObject=XF;function XF(e){return typeof e=="object"&&typeof e?.[Symbol.iterator]=="function"}});var Oa=T(dm=>{"use strict";u();Object.defineProperty(dm,"__esModule",{value:!0});dm.astFromValue=Sa;var eO=Be(),ZF=Ct(),eM=tl(),tM=cn(),wr=Ie(),wa=Re(),rM=pn();function Sa(e,t){if((0,wa.isNonNullType)(t)){let r=Sa(e,t.ofType);return r?.kind===wr.Kind.NULL?null:r}if(e===null)return{kind:wr.Kind.NULL};if(e===void 0)return null;if((0,wa.isListType)(t)){let r=t.ofType;if((0,eM.isIterableObject)(e)){let n=[];for(let i of e){let s=Sa(i,r);s!=null&&n.push(s)}return{kind:wr.Kind.LIST,values:n}}return Sa(e,r)}if((0,wa.isInputObjectType)(t)){if(!(0,tM.isObjectLike)(e))return null;let r=[];for(let n of Object.values(t.getFields())){let i=Sa(e[n.name],n.type);i&&r.push({kind:wr.Kind.OBJECT_FIELD,name:{kind:wr.Kind.NAME,value:n.name},value:i})}return{kind:wr.Kind.OBJECT,fields:r}}if((0,wa.isLeafType)(t)){let r=t.serialize(e);if(r==null)return null;if(typeof r=="boolean")return{kind:wr.Kind.BOOLEAN,value:r};if(typeof r=="number"&&Number.isFinite(r)){let n=String(r);return tO.test(n)?{kind:wr.Kind.INT,value:n}:{kind:wr.Kind.FLOAT,value:n}}if(typeof r=="string")return(0,wa.isEnumType)(t)?{kind:wr.Kind.ENUM,value:r}:t===rM.GraphQLID&&tO.test(r)?{kind:wr.Kind.INT,value:r}:{kind:wr.Kind.STRING,value:r};throw new TypeError(`Cannot convert value to AST: ${(0,eO.inspect)(r)}.`)}(0,ZF.invariant)(!1,"Unexpected input type: "+(0,eO.inspect)(t))}var tO=/^-?(?:0|[1-9][0-9]*)$/});var Or=T(Ve=>{"use strict";u();Object.defineProperty(Ve,"__esModule",{value:!0});Ve.introspectionTypes=Ve.__TypeKind=Ve.__Type=Ve.__Schema=Ve.__InputValue=Ve.__Field=Ve.__EnumValue=Ve.__DirectiveLocation=Ve.__Directive=Ve.TypeNameMetaFieldDef=Ve.TypeMetaFieldDef=Ve.TypeKind=Ve.SchemaMetaFieldDef=void 0;Ve.isIntrospectionType=lM;var nM=Be(),iM=Ct(),Tt=Ks(),sM=ur(),oM=Oa(),te=Re(),Ge=pn(),fm=new te.GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:Ge.GraphQLString,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new te.GraphQLNonNull(new te.GraphQLList(new te.GraphQLNonNull(Sr))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new te.GraphQLNonNull(Sr),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Sr,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Sr,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new te.GraphQLNonNull(new te.GraphQLList(new te.GraphQLNonNull(hm))),resolve:e=>e.getDirectives()}})});Ve.__Schema=fm;var hm=new te.GraphQLObjectType({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
98
+
99
+ In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new te.GraphQLNonNull(Ge.GraphQLString),resolve:e=>e.name},description:{type:Ge.GraphQLString,resolve:e=>e.description},isRepeatable:{type:new te.GraphQLNonNull(Ge.GraphQLBoolean),resolve:e=>e.isRepeatable},locations:{type:new te.GraphQLNonNull(new te.GraphQLList(new te.GraphQLNonNull(mm))),resolve:e=>e.locations},args:{type:new te.GraphQLNonNull(new te.GraphQLList(new te.GraphQLNonNull(_a))),args:{includeDeprecated:{type:Ge.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(r=>r.deprecationReason==null)}}})});Ve.__Directive=hm;var mm=new te.GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:Tt.DirectiveLocation.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:Tt.DirectiveLocation.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:Tt.DirectiveLocation.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:Tt.DirectiveLocation.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:Tt.DirectiveLocation.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:Tt.DirectiveLocation.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:Tt.DirectiveLocation.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:Tt.DirectiveLocation.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:Tt.DirectiveLocation.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:Tt.DirectiveLocation.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:Tt.DirectiveLocation.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:Tt.DirectiveLocation.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:Tt.DirectiveLocation.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:Tt.DirectiveLocation.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:Tt.DirectiveLocation.UNION,description:"Location adjacent to a union definition."},ENUM:{value:Tt.DirectiveLocation.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:Tt.DirectiveLocation.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:Tt.DirectiveLocation.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:Tt.DirectiveLocation.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}});Ve.__DirectiveLocation=mm;var Sr=new te.GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new te.GraphQLNonNull(bm),resolve(e){if((0,te.isScalarType)(e))return Et.SCALAR;if((0,te.isObjectType)(e))return Et.OBJECT;if((0,te.isInterfaceType)(e))return Et.INTERFACE;if((0,te.isUnionType)(e))return Et.UNION;if((0,te.isEnumType)(e))return Et.ENUM;if((0,te.isInputObjectType)(e))return Et.INPUT_OBJECT;if((0,te.isListType)(e))return Et.LIST;if((0,te.isNonNullType)(e))return Et.NON_NULL;(0,iM.invariant)(!1,`Unexpected type: "${(0,nM.inspect)(e)}".`)}},name:{type:Ge.GraphQLString,resolve:e=>"name"in e?e.name:void 0},description:{type:Ge.GraphQLString,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:Ge.GraphQLString,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new te.GraphQLList(new te.GraphQLNonNull(gm)),args:{includeDeprecated:{type:Ge.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,te.isObjectType)(e)||(0,te.isInterfaceType)(e)){let r=Object.values(e.getFields());return t?r:r.filter(n=>n.deprecationReason==null)}}},interfaces:{type:new te.GraphQLList(new te.GraphQLNonNull(Sr)),resolve(e){if((0,te.isObjectType)(e)||(0,te.isInterfaceType)(e))return e.getInterfaces()}},possibleTypes:{type:new te.GraphQLList(new te.GraphQLNonNull(Sr)),resolve(e,t,r,{schema:n}){if((0,te.isAbstractType)(e))return n.getPossibleTypes(e)}},enumValues:{type:new te.GraphQLList(new te.GraphQLNonNull(ym)),args:{includeDeprecated:{type:Ge.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,te.isEnumType)(e)){let r=e.getValues();return t?r:r.filter(n=>n.deprecationReason==null)}}},inputFields:{type:new te.GraphQLList(new te.GraphQLNonNull(_a)),args:{includeDeprecated:{type:Ge.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,te.isInputObjectType)(e)){let r=Object.values(e.getFields());return t?r:r.filter(n=>n.deprecationReason==null)}}},ofType:{type:Sr,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:Ge.GraphQLBoolean,resolve:e=>{if((0,te.isInputObjectType)(e))return e.isOneOf}}})});Ve.__Type=Sr;var gm=new te.GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new te.GraphQLNonNull(Ge.GraphQLString),resolve:e=>e.name},description:{type:Ge.GraphQLString,resolve:e=>e.description},args:{type:new te.GraphQLNonNull(new te.GraphQLList(new te.GraphQLNonNull(_a))),args:{includeDeprecated:{type:Ge.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(r=>r.deprecationReason==null)}},type:{type:new te.GraphQLNonNull(Sr),resolve:e=>e.type},isDeprecated:{type:new te.GraphQLNonNull(Ge.GraphQLBoolean),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:Ge.GraphQLString,resolve:e=>e.deprecationReason}})});Ve.__Field=gm;var _a=new te.GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new te.GraphQLNonNull(Ge.GraphQLString),resolve:e=>e.name},description:{type:Ge.GraphQLString,resolve:e=>e.description},type:{type:new te.GraphQLNonNull(Sr),resolve:e=>e.type},defaultValue:{type:Ge.GraphQLString,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let{type:t,defaultValue:r}=e,n=(0,oM.astFromValue)(r,t);return n?(0,sM.print)(n):null}},isDeprecated:{type:new te.GraphQLNonNull(Ge.GraphQLBoolean),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:Ge.GraphQLString,resolve:e=>e.deprecationReason}})});Ve.__InputValue=_a;var ym=new te.GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new te.GraphQLNonNull(Ge.GraphQLString),resolve:e=>e.name},description:{type:Ge.GraphQLString,resolve:e=>e.description},isDeprecated:{type:new te.GraphQLNonNull(Ge.GraphQLBoolean),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:Ge.GraphQLString,resolve:e=>e.deprecationReason}})});Ve.__EnumValue=ym;var Et;Ve.TypeKind=Et;(function(e){e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.INPUT_OBJECT="INPUT_OBJECT",e.LIST="LIST",e.NON_NULL="NON_NULL"})(Et||(Ve.TypeKind=Et={}));var bm=new te.GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:Et.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:Et.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:Et.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:Et.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:Et.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:Et.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:Et.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:Et.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});Ve.__TypeKind=bm;var aM={name:"__schema",type:new te.GraphQLNonNull(fm),description:"Access the current type schema of this server.",args:[],resolve:(e,t,r,{schema:n})=>n,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};Ve.SchemaMetaFieldDef=aM;var cM={name:"__type",type:Sr,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new te.GraphQLNonNull(Ge.GraphQLString),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},r,{schema:n})=>n.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};Ve.TypeMetaFieldDef=cM;var uM={name:"__typename",type:new te.GraphQLNonNull(Ge.GraphQLString),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,r,{parentType:n})=>n.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};Ve.TypeNameMetaFieldDef=uM;var rO=Object.freeze([fm,hm,mm,Sr,gm,_a,ym,bm]);Ve.introspectionTypes=rO;function lM(e){return rO.some(({name:t})=>e.name===t)}});var Bi=T(Js=>{"use strict";u();Object.defineProperty(Js,"__esModule",{value:!0});Js.GraphQLSchema=void 0;Js.assertSchema=mM;Js.isSchema=iO;var rl=qt(),Tm=Be(),pM=ca(),dM=cn(),fM=Du(),vm=qr(),Br=Re(),nO=Xt(),hM=Or();function iO(e){return(0,pM.instanceOf)(e,nl)}function mM(e){if(!iO(e))throw new Error(`Expected ${(0,Tm.inspect)(e)} to be a GraphQL schema.`);return e}var nl=class{constructor(t){var r,n;this.__validationErrors=t.assumeValid===!0?[]:void 0,(0,dM.isObjectLike)(t)||(0,rl.devAssert)(!1,"Must provide configuration object."),!t.types||Array.isArray(t.types)||(0,rl.devAssert)(!1,`"types" must be Array if provided but got: ${(0,Tm.inspect)(t.types)}.`),!t.directives||Array.isArray(t.directives)||(0,rl.devAssert)(!1,`"directives" must be Array if provided but got: ${(0,Tm.inspect)(t.directives)}.`),this.description=t.description,this.extensions=(0,fM.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(r=t.extensionASTNodes)!==null&&r!==void 0?r:[],this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=(n=t.directives)!==null&&n!==void 0?n:nO.specifiedDirectives;let i=new Set(t.types);if(t.types!=null)for(let s of t.types)i.delete(s),Vr(s,i);this._queryType!=null&&Vr(this._queryType,i),this._mutationType!=null&&Vr(this._mutationType,i),this._subscriptionType!=null&&Vr(this._subscriptionType,i);for(let s of this._directives)if((0,nO.isDirective)(s))for(let o of s.args)Vr(o.type,i);Vr(hM.__Schema,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(let s of i){if(s==null)continue;let o=s.name;if(o||(0,rl.devAssert)(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[o]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${o}".`);if(this._typeMap[o]=s,(0,Br.isInterfaceType)(s)){for(let a of s.getInterfaces())if((0,Br.isInterfaceType)(a)){let c=this._implementationsMap[a.name];c===void 0&&(c=this._implementationsMap[a.name]={objects:[],interfaces:[]}),c.interfaces.push(s)}}else if((0,Br.isObjectType)(s)){for(let a of s.getInterfaces())if((0,Br.isInterfaceType)(a)){let c=this._implementationsMap[a.name];c===void 0&&(c=this._implementationsMap[a.name]={objects:[],interfaces:[]}),c.objects.push(s)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(t){switch(t){case vm.OperationTypeNode.QUERY:return this.getQueryType();case vm.OperationTypeNode.MUTATION:return this.getMutationType();case vm.OperationTypeNode.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(t){return this.getTypeMap()[t]}getPossibleTypes(t){return(0,Br.isUnionType)(t)?t.getTypes():this.getImplementations(t).objects}getImplementations(t){let r=this._implementationsMap[t.name];return r??{objects:[],interfaces:[]}}isSubType(t,r){let n=this._subTypeMap[t.name];if(n===void 0){if(n=Object.create(null),(0,Br.isUnionType)(t))for(let i of t.getTypes())n[i.name]=!0;else{let i=this.getImplementations(t);for(let s of i.objects)n[s.name]=!0;for(let s of i.interfaces)n[s.name]=!0}this._subTypeMap[t.name]=n}return n[r.name]!==void 0}getDirectives(){return this._directives}getDirective(t){return this.getDirectives().find(r=>r.name===t)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}};Js.GraphQLSchema=nl;function Vr(e,t){let r=(0,Br.getNamedType)(e);if(!t.has(r)){if(t.add(r),(0,Br.isUnionType)(r))for(let n of r.getTypes())Vr(n,t);else if((0,Br.isObjectType)(r)||(0,Br.isInterfaceType)(r)){for(let n of r.getInterfaces())Vr(n,t);for(let n of Object.values(r.getFields())){Vr(n.type,t);for(let i of n.args)Vr(i.type,t)}}else if((0,Br.isInputObjectType)(r))for(let n of Object.values(r.getFields()))Vr(n.type,t)}return t}});var Na=T(il=>{"use strict";u();Object.defineProperty(il,"__esModule",{value:!0});il.assertValidSchema=vM;il.validateSchema=lO;var kt=Be(),gM=ue(),Em=qr(),sO=ba(),it=Re(),uO=Xt(),yM=Or(),bM=Bi();function lO(e){if((0,bM.assertSchema)(e),e.__validationErrors)return e.__validationErrors;let t=new wm(e);TM(t),EM(t),xM(t);let r=t.getErrors();return e.__validationErrors=r,r}function vM(e){let t=lO(e);if(t.length!==0)throw new Error(t.map(r=>r.message).join(`
100
+
101
+ `))}var wm=class{constructor(t){this._errors=[],this.schema=t}reportError(t,r){let n=Array.isArray(r)?r.filter(Boolean):r;this._errors.push(new gM.GraphQLError(t,{nodes:n}))}getErrors(){return this._errors}};function TM(e){let t=e.schema,r=t.getQueryType();if(!r)e.reportError("Query root type must be provided.",t.astNode);else if(!(0,it.isObjectType)(r)){var n;e.reportError(`Query root type must be Object type, it cannot be ${(0,kt.inspect)(r)}.`,(n=xm(t,Em.OperationTypeNode.QUERY))!==null&&n!==void 0?n:r.astNode)}let i=t.getMutationType();if(i&&!(0,it.isObjectType)(i)){var s;e.reportError(`Mutation root type must be Object type if provided, it cannot be ${(0,kt.inspect)(i)}.`,(s=xm(t,Em.OperationTypeNode.MUTATION))!==null&&s!==void 0?s:i.astNode)}let o=t.getSubscriptionType();if(o&&!(0,it.isObjectType)(o)){var a;e.reportError(`Subscription root type must be Object type if provided, it cannot be ${(0,kt.inspect)(o)}.`,(a=xm(t,Em.OperationTypeNode.SUBSCRIPTION))!==null&&a!==void 0?a:o.astNode)}}function xm(e,t){var r;return(r=[e.astNode,...e.extensionASTNodes].flatMap(n=>{var i;return(i=n?.operationTypes)!==null&&i!==void 0?i:[]}).find(n=>n.operation===t))===null||r===void 0?void 0:r.type}function EM(e){for(let r of e.schema.getDirectives()){if(!(0,uO.isDirective)(r)){e.reportError(`Expected directive but got: ${(0,kt.inspect)(r)}.`,r?.astNode);continue}Vi(e,r),r.locations.length===0&&e.reportError(`Directive @${r.name} must include 1 or more locations.`,r.astNode);for(let n of r.args)if(Vi(e,n),(0,it.isInputType)(n.type)||e.reportError(`The type of @${r.name}(${n.name}:) must be Input Type but got: ${(0,kt.inspect)(n.type)}.`,n.astNode),(0,it.isRequiredArgument)(n)&&n.deprecationReason!=null){var t;e.reportError(`Required argument @${r.name}(${n.name}:) cannot be deprecated.`,[Sm(n.astNode),(t=n.astNode)===null||t===void 0?void 0:t.type])}}}function Vi(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function xM(e){let t=IM(e),r=e.schema.getTypeMap();for(let n of Object.values(r)){if(!(0,it.isNamedType)(n)){e.reportError(`Expected GraphQL named type but got: ${(0,kt.inspect)(n)}.`,n.astNode);continue}(0,yM.isIntrospectionType)(n)||Vi(e,n),(0,it.isObjectType)(n)||(0,it.isInterfaceType)(n)?(oO(e,n),aO(e,n)):(0,it.isUnionType)(n)?OM(e,n):(0,it.isEnumType)(n)?_M(e,n):(0,it.isInputObjectType)(n)&&(AM(e,n),t(n))}}function oO(e,t){let r=Object.values(t.getFields());r.length===0&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let o of r){if(Vi(e,o),!(0,it.isOutputType)(o.type)){var n;e.reportError(`The type of ${t.name}.${o.name} must be Output Type but got: ${(0,kt.inspect)(o.type)}.`,(n=o.astNode)===null||n===void 0?void 0:n.type)}for(let a of o.args){let c=a.name;if(Vi(e,a),!(0,it.isInputType)(a.type)){var i;e.reportError(`The type of ${t.name}.${o.name}(${c}:) must be Input Type but got: ${(0,kt.inspect)(a.type)}.`,(i=a.astNode)===null||i===void 0?void 0:i.type)}if((0,it.isRequiredArgument)(a)&&a.deprecationReason!=null){var s;e.reportError(`Required argument ${t.name}.${o.name}(${c}:) cannot be deprecated.`,[Sm(a.astNode),(s=a.astNode)===null||s===void 0?void 0:s.type])}}}}function aO(e,t){let r=Object.create(null);for(let n of t.getInterfaces()){if(!(0,it.isInterfaceType)(n)){e.reportError(`Type ${(0,kt.inspect)(t)} must only implement Interface types, it cannot implement ${(0,kt.inspect)(n)}.`,Aa(t,n));continue}if(t===n){e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,Aa(t,n));continue}if(r[n.name]){e.reportError(`Type ${t.name} can only implement ${n.name} once.`,Aa(t,n));continue}r[n.name]=!0,SM(e,t,n),wM(e,t,n)}}function wM(e,t,r){let n=t.getFields();for(let c of Object.values(r.getFields())){let l=c.name,p=n[l];if(!p){e.reportError(`Interface field ${r.name}.${l} expected but ${t.name} does not provide it.`,[c.astNode,t.astNode,...t.extensionASTNodes]);continue}if(!(0,sO.isTypeSubTypeOf)(e.schema,p.type,c.type)){var i,s;e.reportError(`Interface field ${r.name}.${l} expects type ${(0,kt.inspect)(c.type)} but ${t.name}.${l} is type ${(0,kt.inspect)(p.type)}.`,[(i=c.astNode)===null||i===void 0?void 0:i.type,(s=p.astNode)===null||s===void 0?void 0:s.type])}for(let d of c.args){let f=d.name,m=p.args.find(h=>h.name===f);if(!m){e.reportError(`Interface field argument ${r.name}.${l}(${f}:) expected but ${t.name}.${l} does not provide it.`,[d.astNode,p.astNode]);continue}if(!(0,sO.isEqualType)(d.type,m.type)){var o,a;e.reportError(`Interface field argument ${r.name}.${l}(${f}:) expects type ${(0,kt.inspect)(d.type)} but ${t.name}.${l}(${f}:) is type ${(0,kt.inspect)(m.type)}.`,[(o=d.astNode)===null||o===void 0?void 0:o.type,(a=m.astNode)===null||a===void 0?void 0:a.type])}}for(let d of p.args){let f=d.name;!c.args.find(h=>h.name===f)&&(0,it.isRequiredArgument)(d)&&e.reportError(`Object field ${t.name}.${l} includes required argument ${f} that is missing from the Interface field ${r.name}.${l}.`,[d.astNode,c.astNode])}}}function SM(e,t,r){let n=t.getInterfaces();for(let i of r.getInterfaces())n.includes(i)||e.reportError(i===t?`Type ${t.name} cannot implement ${r.name} because it would create a circular reference.`:`Type ${t.name} must implement ${i.name} because it is implemented by ${r.name}.`,[...Aa(r,i),...Aa(t,r)])}function OM(e,t){let r=t.getTypes();r.length===0&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);let n=Object.create(null);for(let i of r){if(n[i.name]){e.reportError(`Union type ${t.name} can only include type ${i.name} once.`,cO(t,i.name));continue}n[i.name]=!0,(0,it.isObjectType)(i)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${(0,kt.inspect)(i)}.`,cO(t,String(i)))}}function _M(e,t){let r=t.getValues();r.length===0&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(let n of r)Vi(e,n)}function AM(e,t){let r=Object.values(t.getFields());r.length===0&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let s of r){if(Vi(e,s),!(0,it.isInputType)(s.type)){var n;e.reportError(`The type of ${t.name}.${s.name} must be Input Type but got: ${(0,kt.inspect)(s.type)}.`,(n=s.astNode)===null||n===void 0?void 0:n.type)}if((0,it.isRequiredInputField)(s)&&s.deprecationReason!=null){var i;e.reportError(`Required input field ${t.name}.${s.name} cannot be deprecated.`,[Sm(s.astNode),(i=s.astNode)===null||i===void 0?void 0:i.type])}t.isOneOf&&NM(t,s,e)}}function NM(e,t,r){if((0,it.isNonNullType)(t.type)){var n;r.reportError(`OneOf input field ${e.name}.${t.name} must be nullable.`,(n=t.astNode)===null||n===void 0?void 0:n.type)}t.defaultValue!==void 0&&r.reportError(`OneOf input field ${e.name}.${t.name} cannot have a default value.`,t.astNode)}function IM(e){let t=Object.create(null),r=[],n=Object.create(null);return i;function i(s){if(t[s.name])return;t[s.name]=!0,n[s.name]=r.length;let o=Object.values(s.getFields());for(let a of o)if((0,it.isNonNullType)(a.type)&&(0,it.isInputObjectType)(a.type.ofType)){let c=a.type.ofType,l=n[c.name];if(r.push(a),l===void 0)i(c);else{let p=r.slice(l),d=p.map(f=>f.name).join(".");e.reportError(`Cannot reference Input Object "${c.name}" within itself through a series of non-null fields: "${d}".`,p.map(f=>f.astNode))}r.pop()}n[s.name]=void 0}}function Aa(e,t){let{astNode:r,extensionASTNodes:n}=e;return(r!=null?[r,...n]:n).flatMap(s=>{var o;return(o=s.interfaces)!==null&&o!==void 0?o:[]}).filter(s=>s.name.value===t.name)}function cO(e,t){let{astNode:r,extensionASTNodes:n}=e;return(r!=null?[r,...n]:n).flatMap(s=>{var o;return(o=s.types)!==null&&o!==void 0?o:[]}).filter(s=>s.name.value===t)}function Sm(e){var t;return e==null||(t=e.directives)===null||t===void 0?void 0:t.find(r=>r.name.value===uO.GraphQLDeprecatedDirective.name)}});var dn=T(Am=>{"use strict";u();Object.defineProperty(Am,"__esModule",{value:!0});Am.typeFromAST=_m;var Om=Ie(),pO=Re();function _m(e,t){switch(t.kind){case Om.Kind.LIST_TYPE:{let r=_m(e,t.type);return r&&new pO.GraphQLList(r)}case Om.Kind.NON_NULL_TYPE:{let r=_m(e,t.type);return r&&new pO.GraphQLNonNull(r)}case Om.Kind.NAMED_TYPE:return e.getType(t.name.value)}}});var sl=T(Ia=>{"use strict";u();Object.defineProperty(Ia,"__esModule",{value:!0});Ia.TypeInfo=void 0;Ia.visitWithTypeInfo=LM;var RM=qr(),st=Ie(),dO=Pi(),ot=Re(),Ys=Or(),fO=dn(),Nm=class{constructor(t,r,n){this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=n??CM,r&&((0,ot.isInputType)(r)&&this._inputTypeStack.push(r),(0,ot.isCompositeType)(r)&&this._parentTypeStack.push(r),(0,ot.isOutputType)(r)&&this._typeStack.push(r))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(t){let r=this._schema;switch(t.kind){case st.Kind.SELECTION_SET:{let i=(0,ot.getNamedType)(this.getType());this._parentTypeStack.push((0,ot.isCompositeType)(i)?i:void 0);break}case st.Kind.FIELD:{let i=this.getParentType(),s,o;i&&(s=this._getFieldDef(r,i,t),s&&(o=s.type)),this._fieldDefStack.push(s),this._typeStack.push((0,ot.isOutputType)(o)?o:void 0);break}case st.Kind.DIRECTIVE:this._directive=r.getDirective(t.name.value);break;case st.Kind.OPERATION_DEFINITION:{let i=r.getRootType(t.operation);this._typeStack.push((0,ot.isObjectType)(i)?i:void 0);break}case st.Kind.INLINE_FRAGMENT:case st.Kind.FRAGMENT_DEFINITION:{let i=t.typeCondition,s=i?(0,fO.typeFromAST)(r,i):(0,ot.getNamedType)(this.getType());this._typeStack.push((0,ot.isOutputType)(s)?s:void 0);break}case st.Kind.VARIABLE_DEFINITION:{let i=(0,fO.typeFromAST)(r,t.type);this._inputTypeStack.push((0,ot.isInputType)(i)?i:void 0);break}case st.Kind.ARGUMENT:{var n;let i,s,o=(n=this.getDirective())!==null&&n!==void 0?n:this.getFieldDef();o&&(i=o.args.find(a=>a.name===t.name.value),i&&(s=i.type)),this._argument=i,this._defaultValueStack.push(i?i.defaultValue:void 0),this._inputTypeStack.push((0,ot.isInputType)(s)?s:void 0);break}case st.Kind.LIST:{let i=(0,ot.getNullableType)(this.getInputType()),s=(0,ot.isListType)(i)?i.ofType:i;this._defaultValueStack.push(void 0),this._inputTypeStack.push((0,ot.isInputType)(s)?s:void 0);break}case st.Kind.OBJECT_FIELD:{let i=(0,ot.getNamedType)(this.getInputType()),s,o;(0,ot.isInputObjectType)(i)&&(o=i.getFields()[t.name.value],o&&(s=o.type)),this._defaultValueStack.push(o?o.defaultValue:void 0),this._inputTypeStack.push((0,ot.isInputType)(s)?s:void 0);break}case st.Kind.ENUM:{let i=(0,ot.getNamedType)(this.getInputType()),s;(0,ot.isEnumType)(i)&&(s=i.getValue(t.value)),this._enumValue=s;break}default:}}leave(t){switch(t.kind){case st.Kind.SELECTION_SET:this._parentTypeStack.pop();break;case st.Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case st.Kind.DIRECTIVE:this._directive=null;break;case st.Kind.OPERATION_DEFINITION:case st.Kind.INLINE_FRAGMENT:case st.Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case st.Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case st.Kind.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case st.Kind.LIST:case st.Kind.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case st.Kind.ENUM:this._enumValue=null;break;default:}}};Ia.TypeInfo=Nm;function CM(e,t,r){let n=r.name.value;if(n===Ys.SchemaMetaFieldDef.name&&e.getQueryType()===t)return Ys.SchemaMetaFieldDef;if(n===Ys.TypeMetaFieldDef.name&&e.getQueryType()===t)return Ys.TypeMetaFieldDef;if(n===Ys.TypeNameMetaFieldDef.name&&(0,ot.isCompositeType)(t))return Ys.TypeNameMetaFieldDef;if((0,ot.isObjectType)(t)||(0,ot.isInterfaceType)(t))return t.getFields()[n]}function LM(e,t){return{enter(...r){let n=r[0];e.enter(n);let i=(0,dO.getEnterLeaveForKind)(t,n.kind).enter;if(i){let s=i.apply(t,r);return s!==void 0&&(e.leave(n),(0,RM.isNode)(s)&&e.enter(s)),s}},leave(...r){let n=r[0],i=(0,dO.getEnterLeaveForKind)(t,n.kind).leave,s;return i&&(s=i.apply(t,r)),e.leave(n),s}}}});var Ki=T(lr=>{"use strict";u();Object.defineProperty(lr,"__esModule",{value:!0});lr.isConstValueNode=Im;lr.isDefinitionNode=kM;lr.isExecutableDefinitionNode=hO;lr.isSchemaCoordinateNode=PM;lr.isSelectionNode=DM;lr.isTypeDefinitionNode=yO;lr.isTypeExtensionNode=vO;lr.isTypeNode=$M;lr.isTypeSystemDefinitionNode=gO;lr.isTypeSystemExtensionNode=bO;lr.isValueNode=mO;var Oe=Ie();function kM(e){return hO(e)||gO(e)||bO(e)}function hO(e){return e.kind===Oe.Kind.OPERATION_DEFINITION||e.kind===Oe.Kind.FRAGMENT_DEFINITION}function DM(e){return e.kind===Oe.Kind.FIELD||e.kind===Oe.Kind.FRAGMENT_SPREAD||e.kind===Oe.Kind.INLINE_FRAGMENT}function mO(e){return e.kind===Oe.Kind.VARIABLE||e.kind===Oe.Kind.INT||e.kind===Oe.Kind.FLOAT||e.kind===Oe.Kind.STRING||e.kind===Oe.Kind.BOOLEAN||e.kind===Oe.Kind.NULL||e.kind===Oe.Kind.ENUM||e.kind===Oe.Kind.LIST||e.kind===Oe.Kind.OBJECT}function Im(e){return mO(e)&&(e.kind===Oe.Kind.LIST?e.values.some(Im):e.kind===Oe.Kind.OBJECT?e.fields.some(t=>Im(t.value)):e.kind!==Oe.Kind.VARIABLE)}function $M(e){return e.kind===Oe.Kind.NAMED_TYPE||e.kind===Oe.Kind.LIST_TYPE||e.kind===Oe.Kind.NON_NULL_TYPE}function gO(e){return e.kind===Oe.Kind.SCHEMA_DEFINITION||yO(e)||e.kind===Oe.Kind.DIRECTIVE_DEFINITION}function yO(e){return e.kind===Oe.Kind.SCALAR_TYPE_DEFINITION||e.kind===Oe.Kind.OBJECT_TYPE_DEFINITION||e.kind===Oe.Kind.INTERFACE_TYPE_DEFINITION||e.kind===Oe.Kind.UNION_TYPE_DEFINITION||e.kind===Oe.Kind.ENUM_TYPE_DEFINITION||e.kind===Oe.Kind.INPUT_OBJECT_TYPE_DEFINITION}function bO(e){return e.kind===Oe.Kind.SCHEMA_EXTENSION||vO(e)}function vO(e){return e.kind===Oe.Kind.SCALAR_TYPE_EXTENSION||e.kind===Oe.Kind.OBJECT_TYPE_EXTENSION||e.kind===Oe.Kind.INTERFACE_TYPE_EXTENSION||e.kind===Oe.Kind.UNION_TYPE_EXTENSION||e.kind===Oe.Kind.ENUM_TYPE_EXTENSION||e.kind===Oe.Kind.INPUT_OBJECT_TYPE_EXTENSION}function PM(e){return e.kind===Oe.Kind.TYPE_COORDINATE||e.kind===Oe.Kind.MEMBER_COORDINATE||e.kind===Oe.Kind.ARGUMENT_COORDINATE||e.kind===Oe.Kind.DIRECTIVE_COORDINATE||e.kind===Oe.Kind.DIRECTIVE_ARGUMENT_COORDINATE}});var Cm=T(Rm=>{"use strict";u();Object.defineProperty(Rm,"__esModule",{value:!0});Rm.ExecutableDefinitionsRule=FM;var jM=ue(),TO=Ie(),qM=Ki();function FM(e){return{Document(t){for(let r of t.definitions)if(!(0,qM.isExecutableDefinitionNode)(r)){let n=r.kind===TO.Kind.SCHEMA_DEFINITION||r.kind===TO.Kind.SCHEMA_EXTENSION?"schema":'"'+r.name.value+'"';e.reportError(new jM.GraphQLError(`The ${n} definition is not executable.`,{nodes:r}))}return!1}}}});var km=T(Lm=>{"use strict";u();Object.defineProperty(Lm,"__esModule",{value:!0});Lm.FieldsOnCorrectTypeRule=VM;var EO=ii(),MM=da(),UM=oi(),BM=ue(),Ra=Re();function VM(e){return{Field(t){let r=e.getParentType();if(r&&!e.getFieldDef()){let i=e.getSchema(),s=t.name.value,o=(0,EO.didYouMean)("to use an inline fragment on",KM(i,r,s));o===""&&(o=(0,EO.didYouMean)(GM(r,s))),e.reportError(new BM.GraphQLError(`Cannot query field "${s}" on type "${r.name}".`+o,{nodes:t}))}}}}function KM(e,t,r){if(!(0,Ra.isAbstractType)(t))return[];let n=new Set,i=Object.create(null);for(let o of e.getPossibleTypes(t))if(o.getFields()[r]){n.add(o),i[o.name]=1;for(let a of o.getInterfaces()){var s;a.getFields()[r]&&(n.add(a),i[a.name]=((s=i[a.name])!==null&&s!==void 0?s:0)+1)}}return[...n].sort((o,a)=>{let c=i[a.name]-i[o.name];return c!==0?c:(0,Ra.isInterfaceType)(o)&&e.isSubType(o,a)?-1:(0,Ra.isInterfaceType)(a)&&e.isSubType(a,o)?1:(0,MM.naturalCompare)(o.name,a.name)}).map(o=>o.name)}function GM(e,t){if((0,Ra.isObjectType)(e)||(0,Ra.isInterfaceType)(e)){let r=Object.keys(e.getFields());return(0,UM.suggestionList)(t,r)}return[]}});var $m=T(Dm=>{"use strict";u();Object.defineProperty(Dm,"__esModule",{value:!0});Dm.FragmentsOnCompositeTypesRule=HM;var xO=ue(),wO=ur(),SO=Re(),OO=dn();function HM(e){return{InlineFragment(t){let r=t.typeCondition;if(r){let n=(0,OO.typeFromAST)(e.getSchema(),r);if(n&&!(0,SO.isCompositeType)(n)){let i=(0,wO.print)(r);e.reportError(new xO.GraphQLError(`Fragment cannot condition on non composite type "${i}".`,{nodes:r}))}}},FragmentDefinition(t){let r=(0,OO.typeFromAST)(e.getSchema(),t.typeCondition);if(r&&!(0,SO.isCompositeType)(r)){let n=(0,wO.print)(t.typeCondition);e.reportError(new xO.GraphQLError(`Fragment "${t.name.value}" cannot condition on non composite type "${n}".`,{nodes:t.typeCondition}))}}}}});var Pm=T(ol=>{"use strict";u();Object.defineProperty(ol,"__esModule",{value:!0});ol.KnownArgumentNamesOnDirectivesRule=IO;ol.KnownArgumentNamesRule=WM;var _O=ii(),AO=oi(),NO=ue(),QM=Ie(),zM=Xt();function WM(e){return{...IO(e),Argument(t){let r=e.getArgument(),n=e.getFieldDef(),i=e.getParentType();if(!r&&n&&i){let s=t.name.value,o=n.args.map(c=>c.name),a=(0,AO.suggestionList)(s,o);e.reportError(new NO.GraphQLError(`Unknown argument "${s}" on field "${i.name}.${n.name}".`+(0,_O.didYouMean)(a),{nodes:t}))}}}}function IO(e){let t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():zM.specifiedDirectives;for(let o of n)t[o.name]=o.args.map(a=>a.name);let i=e.getDocument().definitions;for(let o of i)if(o.kind===QM.Kind.DIRECTIVE_DEFINITION){var s;let a=(s=o.arguments)!==null&&s!==void 0?s:[];t[o.name.value]=a.map(c=>c.name.value)}return{Directive(o){let a=o.name.value,c=t[a];if(o.arguments&&c)for(let l of o.arguments){let p=l.name.value;if(!c.includes(p)){let d=(0,AO.suggestionList)(p,c);e.reportError(new NO.GraphQLError(`Unknown argument "${p}" on directive "@${a}".`+(0,_O.didYouMean)(d),{nodes:l}))}}return!1}}}});var Mm=T(Fm=>{"use strict";u();Object.defineProperty(Fm,"__esModule",{value:!0});Fm.KnownDirectivesRule=XM;var JM=Be(),jm=Ct(),RO=ue(),qm=qr(),xt=Ks(),Ze=Ie(),YM=Xt();function XM(e){let t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():YM.specifiedDirectives;for(let s of n)t[s.name]=s.locations;let i=e.getDocument().definitions;for(let s of i)s.kind===Ze.Kind.DIRECTIVE_DEFINITION&&(t[s.name.value]=s.locations.map(o=>o.value));return{Directive(s,o,a,c,l){let p=s.name.value,d=t[p];if(!d){e.reportError(new RO.GraphQLError(`Unknown directive "@${p}".`,{nodes:s}));return}let f=ZM(l);f&&!d.includes(f)&&e.reportError(new RO.GraphQLError(`Directive "@${p}" may not be used on ${f}.`,{nodes:s}))}}}function ZM(e){let t=e[e.length-1];switch("kind"in t||(0,jm.invariant)(!1),t.kind){case Ze.Kind.OPERATION_DEFINITION:return e1(t.operation);case Ze.Kind.FIELD:return xt.DirectiveLocation.FIELD;case Ze.Kind.FRAGMENT_SPREAD:return xt.DirectiveLocation.FRAGMENT_SPREAD;case Ze.Kind.INLINE_FRAGMENT:return xt.DirectiveLocation.INLINE_FRAGMENT;case Ze.Kind.FRAGMENT_DEFINITION:return xt.DirectiveLocation.FRAGMENT_DEFINITION;case Ze.Kind.VARIABLE_DEFINITION:return xt.DirectiveLocation.VARIABLE_DEFINITION;case Ze.Kind.SCHEMA_DEFINITION:case Ze.Kind.SCHEMA_EXTENSION:return xt.DirectiveLocation.SCHEMA;case Ze.Kind.SCALAR_TYPE_DEFINITION:case Ze.Kind.SCALAR_TYPE_EXTENSION:return xt.DirectiveLocation.SCALAR;case Ze.Kind.OBJECT_TYPE_DEFINITION:case Ze.Kind.OBJECT_TYPE_EXTENSION:return xt.DirectiveLocation.OBJECT;case Ze.Kind.FIELD_DEFINITION:return xt.DirectiveLocation.FIELD_DEFINITION;case Ze.Kind.INTERFACE_TYPE_DEFINITION:case Ze.Kind.INTERFACE_TYPE_EXTENSION:return xt.DirectiveLocation.INTERFACE;case Ze.Kind.UNION_TYPE_DEFINITION:case Ze.Kind.UNION_TYPE_EXTENSION:return xt.DirectiveLocation.UNION;case Ze.Kind.ENUM_TYPE_DEFINITION:case Ze.Kind.ENUM_TYPE_EXTENSION:return xt.DirectiveLocation.ENUM;case Ze.Kind.ENUM_VALUE_DEFINITION:return xt.DirectiveLocation.ENUM_VALUE;case Ze.Kind.INPUT_OBJECT_TYPE_DEFINITION:case Ze.Kind.INPUT_OBJECT_TYPE_EXTENSION:return xt.DirectiveLocation.INPUT_OBJECT;case Ze.Kind.INPUT_VALUE_DEFINITION:{let r=e[e.length-3];return"kind"in r||(0,jm.invariant)(!1),r.kind===Ze.Kind.INPUT_OBJECT_TYPE_DEFINITION?xt.DirectiveLocation.INPUT_FIELD_DEFINITION:xt.DirectiveLocation.ARGUMENT_DEFINITION}default:(0,jm.invariant)(!1,"Unexpected kind: "+(0,JM.inspect)(t.kind))}}function e1(e){switch(e){case qm.OperationTypeNode.QUERY:return xt.DirectiveLocation.QUERY;case qm.OperationTypeNode.MUTATION:return xt.DirectiveLocation.MUTATION;case qm.OperationTypeNode.SUBSCRIPTION:return xt.DirectiveLocation.SUBSCRIPTION}}});var Bm=T(Um=>{"use strict";u();Object.defineProperty(Um,"__esModule",{value:!0});Um.KnownFragmentNamesRule=r1;var t1=ue();function r1(e){return{FragmentSpread(t){let r=t.name.value;e.getFragment(r)||e.reportError(new t1.GraphQLError(`Unknown fragment "${r}".`,{nodes:t.name}))}}}});var Gm=T(Km=>{"use strict";u();Object.defineProperty(Km,"__esModule",{value:!0});Km.KnownTypeNamesRule=c1;var n1=ii(),i1=oi(),s1=ue(),Vm=Ki(),o1=Or(),a1=pn();function c1(e){let t=e.getSchema(),r=t?t.getTypeMap():Object.create(null),n=Object.create(null);for(let s of e.getDocument().definitions)(0,Vm.isTypeDefinitionNode)(s)&&(n[s.name.value]=!0);let i=[...Object.keys(r),...Object.keys(n)];return{NamedType(s,o,a,c,l){let p=s.name.value;if(!r[p]&&!n[p]){var d;let f=(d=l[2])!==null&&d!==void 0?d:a,m=f!=null&&u1(f);if(m&&CO.includes(p))return;let h=(0,i1.suggestionList)(p,m?CO.concat(i):i);e.reportError(new s1.GraphQLError(`Unknown type "${p}".`+(0,n1.didYouMean)(h),{nodes:s}))}}}}var CO=[...a1.specifiedScalarTypes,...o1.introspectionTypes].map(e=>e.name);function u1(e){return"kind"in e&&((0,Vm.isTypeSystemDefinitionNode)(e)||(0,Vm.isTypeSystemExtensionNode)(e))}});var Qm=T(Hm=>{"use strict";u();Object.defineProperty(Hm,"__esModule",{value:!0});Hm.LoneAnonymousOperationRule=d1;var l1=ue(),p1=Ie();function d1(e){let t=0;return{Document(r){t=r.definitions.filter(n=>n.kind===p1.Kind.OPERATION_DEFINITION).length},OperationDefinition(r){!r.name&&t>1&&e.reportError(new l1.GraphQLError("This anonymous operation must be the only defined operation.",{nodes:r}))}}}});var Wm=T(zm=>{"use strict";u();Object.defineProperty(zm,"__esModule",{value:!0});zm.LoneSchemaDefinitionRule=f1;var LO=ue();function f1(e){var t,r,n;let i=e.getSchema(),s=(t=(r=(n=i?.astNode)!==null&&n!==void 0?n:i?.getQueryType())!==null&&r!==void 0?r:i?.getMutationType())!==null&&t!==void 0?t:i?.getSubscriptionType(),o=0;return{SchemaDefinition(a){if(s){e.reportError(new LO.GraphQLError("Cannot define a new schema within a schema extension.",{nodes:a}));return}o>0&&e.reportError(new LO.GraphQLError("Must provide only one schema definition.",{nodes:a})),++o}}}});var Ym=T(Jm=>{"use strict";u();Object.defineProperty(Jm,"__esModule",{value:!0});Jm.MaxIntrospectionDepthRule=g1;var h1=ue(),kO=Ie(),m1=3;function g1(e){function t(r,n=Object.create(null),i=0){if(r.kind===kO.Kind.FRAGMENT_SPREAD){let s=r.name.value;if(n[s]===!0)return!1;let o=e.getFragment(s);if(!o)return!1;try{return n[s]=!0,t(o,n,i)}finally{n[s]=void 0}}if(r.kind===kO.Kind.FIELD&&(r.name.value==="fields"||r.name.value==="interfaces"||r.name.value==="possibleTypes"||r.name.value==="inputFields")&&(i++,i>=m1))return!0;if("selectionSet"in r&&r.selectionSet){for(let s of r.selectionSet.selections)if(t(s,n,i))return!0}return!1}return{Field(r){if((r.name.value==="__schema"||r.name.value==="__type")&&t(r))return e.reportError(new h1.GraphQLError("Maximum introspection depth exceeded",{nodes:[r]})),!1}}}});var Zm=T(Xm=>{"use strict";u();Object.defineProperty(Xm,"__esModule",{value:!0});Xm.NoFragmentCyclesRule=b1;var y1=ue();function b1(e){let t=Object.create(null),r=[],n=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(s){return i(s),!1}};function i(s){if(t[s.name.value])return;let o=s.name.value;t[o]=!0;let a=e.getFragmentSpreads(s.selectionSet);if(a.length!==0){n[o]=r.length;for(let c of a){let l=c.name.value,p=n[l];if(r.push(c),p===void 0){let d=e.getFragment(l);d&&i(d)}else{let d=r.slice(p),f=d.slice(0,-1).map(m=>'"'+m.name.value+'"').join(", ");e.reportError(new y1.GraphQLError(`Cannot spread fragment "${l}" within itself`+(f!==""?` via ${f}.`:"."),{nodes:d}))}r.pop()}n[o]=void 0}}}});var tg=T(eg=>{"use strict";u();Object.defineProperty(eg,"__esModule",{value:!0});eg.NoUndefinedVariablesRule=T1;var v1=ue();function T1(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(r){let n=e.getRecursiveVariableUsages(r);for(let{node:i}of n){let s=i.name.value;t[s]!==!0&&e.reportError(new v1.GraphQLError(r.name?`Variable "$${s}" is not defined by operation "${r.name.value}".`:`Variable "$${s}" is not defined.`,{nodes:[i,r]}))}}},VariableDefinition(r){t[r.variable.name.value]=!0}}}});var ng=T(rg=>{"use strict";u();Object.defineProperty(rg,"__esModule",{value:!0});rg.NoUnusedFragmentsRule=x1;var E1=ue();function x1(e){let t=[],r=[];return{OperationDefinition(n){return t.push(n),!1},FragmentDefinition(n){return r.push(n),!1},Document:{leave(){let n=Object.create(null);for(let i of t)for(let s of e.getRecursivelyReferencedFragments(i))n[s.name.value]=!0;for(let i of r){let s=i.name.value;n[s]!==!0&&e.reportError(new E1.GraphQLError(`Fragment "${s}" is never used.`,{nodes:i}))}}}}}});var sg=T(ig=>{"use strict";u();Object.defineProperty(ig,"__esModule",{value:!0});ig.NoUnusedVariablesRule=S1;var w1=ue();function S1(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(r){let n=Object.create(null),i=e.getRecursiveVariableUsages(r);for(let{node:s}of i)n[s.name.value]=!0;for(let s of t){let o=s.variable.name.value;n[o]!==!0&&e.reportError(new w1.GraphQLError(r.name?`Variable "$${o}" is never used in operation "${r.name.value}".`:`Variable "$${o}" is never used.`,{nodes:s}))}}},VariableDefinition(r){t.push(r)}}}});var cg=T(ag=>{"use strict";u();Object.defineProperty(ag,"__esModule",{value:!0});ag.sortValueNode=og;var O1=da(),Cn=Ie();function og(e){switch(e.kind){case Cn.Kind.OBJECT:return{...e,fields:_1(e.fields)};case Cn.Kind.LIST:return{...e,values:e.values.map(og)};case Cn.Kind.INT:case Cn.Kind.FLOAT:case Cn.Kind.STRING:case Cn.Kind.BOOLEAN:case Cn.Kind.NULL:case Cn.Kind.ENUM:case Cn.Kind.VARIABLE:return e}}function _1(e){return e.map(t=>({...t,value:og(t.value)})).sort((t,r)=>(0,O1.naturalCompare)(t.name.value,r.name.value))}});var mg=T(hg=>{"use strict";u();Object.defineProperty(hg,"__esModule",{value:!0});hg.OverlappingFieldsCanBeMergedRule=R1;var DO=Be(),A1=ue(),ug=Ie(),N1=ur(),Zt=Re(),I1=cg(),PO=dn();function jO(e){return Array.isArray(e)?e.map(([t,r])=>`subfields "${t}" conflict because `+jO(r)).join(" and "):e}function R1(e){let t=new ll,r=new dg,n=new Map;return{SelectionSet(i){let s=C1(e,n,t,r,e.getParentType(),i);for(let[[o,a],c,l]of s){let p=jO(a);e.reportError(new A1.GraphQLError(`Fields "${o}" conflict because ${p}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:c.concat(l)}))}}}}function C1(e,t,r,n,i,s){let o=[],[a,c]=ul(e,t,i,s);if(k1(e,o,t,r,n,a),c.length!==0)for(let l=0;l<c.length;l++){al(e,o,t,r,n,!1,a,c[l]);for(let p=l+1;p<c.length;p++)cl(e,o,t,r,n,!1,c[l],c[p])}return o}function al(e,t,r,n,i,s,o,a){if(n.has(o,a,s))return;n.add(o,a,s);let c=e.getFragment(a);if(!c)return;let[l,p]=pg(e,r,c);if(o!==l){fg(e,t,r,n,i,s,o,l);for(let d of p)al(e,t,r,n,i,s,o,d)}}function cl(e,t,r,n,i,s,o,a){if(o===a||i.has(o,a,s))return;i.add(o,a,s);let c=e.getFragment(o),l=e.getFragment(a);if(!c||!l)return;let[p,d]=pg(e,r,c),[f,m]=pg(e,r,l);fg(e,t,r,n,i,s,p,f);for(let h of m)cl(e,t,r,n,i,s,o,h);for(let h of d)cl(e,t,r,n,i,s,h,a)}function L1(e,t,r,n,i,s,o,a,c){let l=[],[p,d]=ul(e,t,s,o),[f,m]=ul(e,t,a,c);fg(e,l,t,r,n,i,p,f);for(let h of m)al(e,l,t,r,n,i,p,h);for(let h of d)al(e,l,t,r,n,i,f,h);for(let h of d)for(let v of m)cl(e,l,t,r,n,i,h,v);return l}function k1(e,t,r,n,i,s){for(let[o,a]of Object.entries(s))if(a.length>1)for(let c=0;c<a.length;c++)for(let l=c+1;l<a.length;l++){let p=qO(e,r,n,i,!1,o,a[c],a[l]);p&&t.push(p)}}function fg(e,t,r,n,i,s,o,a){for(let[c,l]of Object.entries(o)){let p=a[c];if(p)for(let d of l)for(let f of p){let m=qO(e,r,n,i,s,c,d,f);m&&t.push(m)}}}function qO(e,t,r,n,i,s,o,a){let[c,l,p]=o,[d,f,m]=a,h=i||c!==d&&(0,Zt.isObjectType)(c)&&(0,Zt.isObjectType)(d);if(!h){let _=l.name.value,I=f.name.value;if(_!==I)return[[s,`"${_}" and "${I}" are different fields`],[l],[f]];if(!D1(l,f))return[[s,"they have differing arguments"],[l],[f]]}let v=p?.type,E=m?.type;if(v&&E&&lg(v,E))return[[s,`they return conflicting types "${(0,DO.inspect)(v)}" and "${(0,DO.inspect)(E)}"`],[l],[f]];let A=l.selectionSet,w=f.selectionSet;if(A&&w){let _=L1(e,t,r,n,h,(0,Zt.getNamedType)(v),A,(0,Zt.getNamedType)(E),w);return $1(_,s,l,f)}}function D1(e,t){let r=e.arguments,n=t.arguments;if(r===void 0||r.length===0)return n===void 0||n.length===0;if(n===void 0||n.length===0||r.length!==n.length)return!1;let i=new Map(n.map(({name:s,value:o})=>[s.value,o]));return r.every(s=>{let o=s.value,a=i.get(s.name.value);return a===void 0?!1:$O(o)===$O(a)})}function $O(e){return(0,N1.print)((0,I1.sortValueNode)(e))}function lg(e,t){return(0,Zt.isListType)(e)?(0,Zt.isListType)(t)?lg(e.ofType,t.ofType):!0:(0,Zt.isListType)(t)?!0:(0,Zt.isNonNullType)(e)?(0,Zt.isNonNullType)(t)?lg(e.ofType,t.ofType):!0:(0,Zt.isNonNullType)(t)?!0:(0,Zt.isLeafType)(e)||(0,Zt.isLeafType)(t)?e!==t:!1}function ul(e,t,r,n){let i=t.get(n);if(i)return i;let s=Object.create(null),o=Object.create(null);FO(e,r,n,s,o);let a=[s,Object.keys(o)];return t.set(n,a),a}function pg(e,t,r){let n=t.get(r.selectionSet);if(n)return n;let i=(0,PO.typeFromAST)(e.getSchema(),r.typeCondition);return ul(e,t,i,r.selectionSet)}function FO(e,t,r,n,i){for(let s of r.selections)switch(s.kind){case ug.Kind.FIELD:{let o=s.name.value,a;((0,Zt.isObjectType)(t)||(0,Zt.isInterfaceType)(t))&&(a=t.getFields()[o]);let c=s.alias?s.alias.value:o;n[c]||(n[c]=[]),n[c].push([t,s,a]);break}case ug.Kind.FRAGMENT_SPREAD:i[s.name.value]=!0;break;case ug.Kind.INLINE_FRAGMENT:{let o=s.typeCondition,a=o?(0,PO.typeFromAST)(e.getSchema(),o):t;FO(e,a,s.selectionSet,n,i);break}}}function $1(e,t,r,n){if(e.length>0)return[[t,e.map(([i])=>i)],[r,...e.map(([,i])=>i).flat()],[n,...e.map(([,,i])=>i).flat()]]}var ll=class{constructor(){this._data=new Map}has(t,r,n){var i;let s=(i=this._data.get(t))===null||i===void 0?void 0:i.get(r);return s===void 0?!1:n?!0:n===s}add(t,r,n){let i=this._data.get(t);i===void 0?this._data.set(t,new Map([[r,n]])):i.set(r,n)}},dg=class{constructor(){this._orderedPairSet=new ll}has(t,r,n){return t<r?this._orderedPairSet.has(t,r,n):this._orderedPairSet.has(r,t,n)}add(t,r,n){t<r?this._orderedPairSet.add(t,r,n):this._orderedPairSet.add(r,t,n)}}});var bg=T(yg=>{"use strict";u();Object.defineProperty(yg,"__esModule",{value:!0});yg.PossibleFragmentSpreadsRule=j1;var pl=Be(),MO=ue(),gg=Re(),UO=ba(),P1=dn();function j1(e){return{InlineFragment(t){let r=e.getType(),n=e.getParentType();if((0,gg.isCompositeType)(r)&&(0,gg.isCompositeType)(n)&&!(0,UO.doTypesOverlap)(e.getSchema(),r,n)){let i=(0,pl.inspect)(n),s=(0,pl.inspect)(r);e.reportError(new MO.GraphQLError(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${s}".`,{nodes:t}))}},FragmentSpread(t){let r=t.name.value,n=q1(e,r),i=e.getParentType();if(n&&i&&!(0,UO.doTypesOverlap)(e.getSchema(),n,i)){let s=(0,pl.inspect)(i),o=(0,pl.inspect)(n);e.reportError(new MO.GraphQLError(`Fragment "${r}" cannot be spread here as objects of type "${s}" can never be of type "${o}".`,{nodes:t}))}}}}function q1(e,t){let r=e.getFragment(t);if(r){let n=(0,P1.typeFromAST)(e.getSchema(),r.typeCondition);if((0,gg.isCompositeType)(n))return n}}});var Tg=T(vg=>{"use strict";u();Object.defineProperty(vg,"__esModule",{value:!0});vg.PossibleTypeExtensionsRule=B1;var F1=ii(),VO=Be(),KO=Ct(),M1=oi(),BO=ue(),et=Ie(),U1=Ki(),Xs=Re();function B1(e){let t=e.getSchema(),r=Object.create(null);for(let i of e.getDocument().definitions)(0,U1.isTypeDefinitionNode)(i)&&(r[i.name.value]=i);return{ScalarTypeExtension:n,ObjectTypeExtension:n,InterfaceTypeExtension:n,UnionTypeExtension:n,EnumTypeExtension:n,InputObjectTypeExtension:n};function n(i){let s=i.name.value,o=r[s],a=t?.getType(s),c;if(o?c=V1[o.kind]:a&&(c=K1(a)),c){if(c!==i.kind){let l=G1(i.kind);e.reportError(new BO.GraphQLError(`Cannot extend non-${l} type "${s}".`,{nodes:o?[o,i]:i}))}}else{let l=Object.keys({...r,...t?.getTypeMap()}),p=(0,M1.suggestionList)(s,l);e.reportError(new BO.GraphQLError(`Cannot extend type "${s}" because it is not defined.`+(0,F1.didYouMean)(p),{nodes:i.name}))}}}var V1={[et.Kind.SCALAR_TYPE_DEFINITION]:et.Kind.SCALAR_TYPE_EXTENSION,[et.Kind.OBJECT_TYPE_DEFINITION]:et.Kind.OBJECT_TYPE_EXTENSION,[et.Kind.INTERFACE_TYPE_DEFINITION]:et.Kind.INTERFACE_TYPE_EXTENSION,[et.Kind.UNION_TYPE_DEFINITION]:et.Kind.UNION_TYPE_EXTENSION,[et.Kind.ENUM_TYPE_DEFINITION]:et.Kind.ENUM_TYPE_EXTENSION,[et.Kind.INPUT_OBJECT_TYPE_DEFINITION]:et.Kind.INPUT_OBJECT_TYPE_EXTENSION};function K1(e){if((0,Xs.isScalarType)(e))return et.Kind.SCALAR_TYPE_EXTENSION;if((0,Xs.isObjectType)(e))return et.Kind.OBJECT_TYPE_EXTENSION;if((0,Xs.isInterfaceType)(e))return et.Kind.INTERFACE_TYPE_EXTENSION;if((0,Xs.isUnionType)(e))return et.Kind.UNION_TYPE_EXTENSION;if((0,Xs.isEnumType)(e))return et.Kind.ENUM_TYPE_EXTENSION;if((0,Xs.isInputObjectType)(e))return et.Kind.INPUT_OBJECT_TYPE_EXTENSION;(0,KO.invariant)(!1,"Unexpected type: "+(0,VO.inspect)(e))}function G1(e){switch(e){case et.Kind.SCALAR_TYPE_EXTENSION:return"scalar";case et.Kind.OBJECT_TYPE_EXTENSION:return"object";case et.Kind.INTERFACE_TYPE_EXTENSION:return"interface";case et.Kind.UNION_TYPE_EXTENSION:return"union";case et.Kind.ENUM_TYPE_EXTENSION:return"enum";case et.Kind.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:(0,KO.invariant)(!1,"Unexpected kind: "+(0,VO.inspect)(e))}}});var xg=T(dl=>{"use strict";u();Object.defineProperty(dl,"__esModule",{value:!0});dl.ProvidedRequiredArgumentsOnDirectivesRule=WO;dl.ProvidedRequiredArgumentsRule=z1;var HO=Be(),GO=si(),QO=ue(),zO=Ie(),H1=ur(),Eg=Re(),Q1=Xt();function z1(e){return{...WO(e),Field:{leave(t){var r;let n=e.getFieldDef();if(!n)return!1;let i=new Set((r=t.arguments)===null||r===void 0?void 0:r.map(s=>s.name.value));for(let s of n.args)if(!i.has(s.name)&&(0,Eg.isRequiredArgument)(s)){let o=(0,HO.inspect)(s.type);e.reportError(new QO.GraphQLError(`Field "${n.name}" argument "${s.name}" of type "${o}" is required, but it was not provided.`,{nodes:t}))}}}}}function WO(e){var t;let r=Object.create(null),n=e.getSchema(),i=(t=n?.getDirectives())!==null&&t!==void 0?t:Q1.specifiedDirectives;for(let a of i)r[a.name]=(0,GO.keyMap)(a.args.filter(Eg.isRequiredArgument),c=>c.name);let s=e.getDocument().definitions;for(let a of s)if(a.kind===zO.Kind.DIRECTIVE_DEFINITION){var o;let c=(o=a.arguments)!==null&&o!==void 0?o:[];r[a.name.value]=(0,GO.keyMap)(c.filter(W1),l=>l.name.value)}return{Directive:{leave(a){let c=a.name.value,l=r[c];if(l){var p;let d=(p=a.arguments)!==null&&p!==void 0?p:[],f=new Set(d.map(m=>m.name.value));for(let[m,h]of Object.entries(l))if(!f.has(m)){let v=(0,Eg.isType)(h.type)?(0,HO.inspect)(h.type):(0,H1.print)(h.type);e.reportError(new QO.GraphQLError(`Directive "@${c}" argument "${m}" of type "${v}" is required, but it was not provided.`,{nodes:a}))}}}}}}function W1(e){return e.type.kind===zO.Kind.NON_NULL_TYPE&&e.defaultValue==null}});var _g=T(Og=>{"use strict";u();Object.defineProperty(Og,"__esModule",{value:!0});Og.ScalarLeafsRule=J1;var wg=Be(),Sg=ue(),JO=Re();function J1(e){return{Field(t){let r=e.getType(),n=t.selectionSet;if(r)if((0,JO.isLeafType)((0,JO.getNamedType)(r))){if(n){let i=t.name.value,s=(0,wg.inspect)(r);e.reportError(new Sg.GraphQLError(`Field "${i}" must not have a selection since type "${s}" has no subfields.`,{nodes:n}))}}else if(n){if(n.selections.length===0){let i=t.name.value,s=(0,wg.inspect)(r);e.reportError(new Sg.GraphQLError(`Field "${i}" of type "${s}" must have at least one field selected.`,{nodes:t}))}}else{let i=t.name.value,s=(0,wg.inspect)(r);e.reportError(new Sg.GraphQLError(`Field "${i}" of type "${s}" must have a selection of subfields. Did you mean "${i} { ... }"?`,{nodes:t}))}}}}});var Ng=T(Ag=>{"use strict";u();Object.defineProperty(Ag,"__esModule",{value:!0});Ag.printPathArray=Y1;function Y1(e){return e.map(t=>typeof t=="number"?"["+t.toString()+"]":"."+t).join("")}});var Ca=T(fl=>{"use strict";u();Object.defineProperty(fl,"__esModule",{value:!0});fl.addPath=X1;fl.pathToArray=Z1;function X1(e,t,r){return{prev:e,key:t,typename:r}}function Z1(e){let t=[],r=e;for(;r;)t.push(r.key),r=r.prev;return t.reverse()}});var Rg=T(Ig=>{"use strict";u();Object.defineProperty(Ig,"__esModule",{value:!0});Ig.coerceInputValue=oU;var eU=ii(),hl=Be(),tU=Ct(),rU=tl(),nU=cn(),Kr=Ca(),iU=Ng(),sU=oi(),Ln=ue(),La=Re();function oU(e,t,r=aU){return ka(e,t,r,void 0)}function aU(e,t,r){let n="Invalid value "+(0,hl.inspect)(t);throw e.length>0&&(n+=` at "value${(0,iU.printPathArray)(e)}"`),r.message=n+": "+r.message,r}function ka(e,t,r,n){if((0,La.isNonNullType)(t)){if(e!=null)return ka(e,t.ofType,r,n);r((0,Kr.pathToArray)(n),e,new Ln.GraphQLError(`Expected non-nullable type "${(0,hl.inspect)(t)}" not to be null.`));return}if(e==null)return null;if((0,La.isListType)(t)){let i=t.ofType;return(0,rU.isIterableObject)(e)?Array.from(e,(s,o)=>{let a=(0,Kr.addPath)(n,o,void 0);return ka(s,i,r,a)}):[ka(e,i,r,n)]}if((0,La.isInputObjectType)(t)){if(!(0,nU.isObjectLike)(e)||Array.isArray(e)){r((0,Kr.pathToArray)(n),e,new Ln.GraphQLError(`Expected type "${t.name}" to be an object.`));return}let i={},s=t.getFields();for(let o of Object.values(s)){let a=e[o.name];if(a===void 0){if(o.defaultValue!==void 0)i[o.name]=o.defaultValue;else if((0,La.isNonNullType)(o.type)){let c=(0,hl.inspect)(o.type);r((0,Kr.pathToArray)(n),e,new Ln.GraphQLError(`Field "${o.name}" of required type "${c}" was not provided.`))}continue}i[o.name]=ka(a,o.type,r,(0,Kr.addPath)(n,o.name,t.name))}for(let o of Object.keys(e))if(!s[o]){let a=(0,sU.suggestionList)(o,Object.keys(t.getFields()));r((0,Kr.pathToArray)(n),e,new Ln.GraphQLError(`Field "${o}" is not defined by type "${t.name}".`+(0,eU.didYouMean)(a)))}if(t.isOneOf){let o=Object.keys(i);o.length!==1&&r((0,Kr.pathToArray)(n),e,new Ln.GraphQLError(`Exactly one key must be specified for OneOf type "${t.name}".`));let a=o[0],c=i[a];c===null&&r((0,Kr.pathToArray)(n).concat(a),c,new Ln.GraphQLError(`Field "${a}" must be non-null.`))}return i}if((0,La.isLeafType)(t)){let i;try{i=t.parseValue(e)}catch(s){s instanceof Ln.GraphQLError?r((0,Kr.pathToArray)(n),e,s):r((0,Kr.pathToArray)(n),e,new Ln.GraphQLError(`Expected type "${t.name}". `+s.message,{originalError:s}));return}return i===void 0&&r((0,Kr.pathToArray)(n),e,new Ln.GraphQLError(`Expected type "${t.name}".`)),i}(0,tU.invariant)(!1,"Unexpected input type: "+(0,hl.inspect)(t))}});var $a=T(Cg=>{"use strict";u();Object.defineProperty(Cg,"__esModule",{value:!0});Cg.valueFromAST=Da;var cU=Be(),uU=Ct(),lU=si(),Zs=Ie(),Gi=Re();function Da(e,t,r){if(e){if(e.kind===Zs.Kind.VARIABLE){let n=e.name.value;if(r==null||r[n]===void 0)return;let i=r[n];return i===null&&(0,Gi.isNonNullType)(t)?void 0:i}if((0,Gi.isNonNullType)(t))return e.kind===Zs.Kind.NULL?void 0:Da(e,t.ofType,r);if(e.kind===Zs.Kind.NULL)return null;if((0,Gi.isListType)(t)){let n=t.ofType;if(e.kind===Zs.Kind.LIST){let s=[];for(let o of e.values)if(YO(o,r)){if((0,Gi.isNonNullType)(n))return;s.push(null)}else{let a=Da(o,n,r);if(a===void 0)return;s.push(a)}return s}let i=Da(e,n,r);return i===void 0?void 0:[i]}if((0,Gi.isInputObjectType)(t)){if(e.kind!==Zs.Kind.OBJECT)return;let n=Object.create(null),i=(0,lU.keyMap)(e.fields,s=>s.name.value);for(let s of Object.values(t.getFields())){let o=i[s.name];if(!o||YO(o.value,r)){if(s.defaultValue!==void 0)n[s.name]=s.defaultValue;else if((0,Gi.isNonNullType)(s.type))return;continue}let a=Da(o.value,s.type,r);if(a===void 0)return;n[s.name]=a}if(t.isOneOf){let s=Object.keys(n);if(s.length!==1||n[s[0]]===null)return}return n}if((0,Gi.isLeafType)(t)){let n;try{n=t.parseLiteral(e,r)}catch{return}return n===void 0?void 0:n}(0,uU.invariant)(!1,"Unexpected input type: "+(0,cU.inspect)(t))}}function YO(e,t){return e.kind===Zs.Kind.VARIABLE&&(t==null||t[e.name.value]===void 0)}});var ro=T(Pa=>{"use strict";u();Object.defineProperty(Pa,"__esModule",{value:!0});Pa.getArgumentValues=t_;Pa.getDirectiveValues=yU;Pa.getVariableValues=mU;var eo=Be(),pU=si(),dU=Ng(),kn=ue(),XO=Ie(),ZO=ur(),to=Re(),fU=Rg(),hU=dn(),e_=$a();function mU(e,t,r,n){let i=[],s=n?.maxErrors;try{let o=gU(e,t,r,a=>{if(s!=null&&i.length>=s)throw new kn.GraphQLError("Too many errors processing variables, error limit reached. Execution aborted.");i.push(a)});if(i.length===0)return{coerced:o}}catch(o){i.push(o)}return{errors:i}}function gU(e,t,r,n){let i={};for(let s of t){let o=s.variable.name.value,a=(0,hU.typeFromAST)(e,s.type);if(!(0,to.isInputType)(a)){let l=(0,ZO.print)(s.type);n(new kn.GraphQLError(`Variable "$${o}" expected value of type "${l}" which cannot be used as an input type.`,{nodes:s.type}));continue}if(!r_(r,o)){if(s.defaultValue)i[o]=(0,e_.valueFromAST)(s.defaultValue,a);else if((0,to.isNonNullType)(a)){let l=(0,eo.inspect)(a);n(new kn.GraphQLError(`Variable "$${o}" of required type "${l}" was not provided.`,{nodes:s}))}continue}let c=r[o];if(c===null&&(0,to.isNonNullType)(a)){let l=(0,eo.inspect)(a);n(new kn.GraphQLError(`Variable "$${o}" of non-null type "${l}" must not be null.`,{nodes:s}));continue}i[o]=(0,fU.coerceInputValue)(c,a,(l,p,d)=>{let f=`Variable "$${o}" got invalid value `+(0,eo.inspect)(p);l.length>0&&(f+=` at "${o}${(0,dU.printPathArray)(l)}"`),n(new kn.GraphQLError(f+"; "+d.message,{nodes:s,originalError:d}))})}return i}function t_(e,t,r){var n;let i={},s=(n=t.arguments)!==null&&n!==void 0?n:[],o=(0,pU.keyMap)(s,a=>a.name.value);for(let a of e.args){let c=a.name,l=a.type,p=o[c];if(!p){if(a.defaultValue!==void 0)i[c]=a.defaultValue;else if((0,to.isNonNullType)(l))throw new kn.GraphQLError(`Argument "${c}" of required type "${(0,eo.inspect)(l)}" was not provided.`,{nodes:t});continue}let d=p.value,f=d.kind===XO.Kind.NULL;if(d.kind===XO.Kind.VARIABLE){let h=d.name.value;if(r==null||!r_(r,h)){if(a.defaultValue!==void 0)i[c]=a.defaultValue;else if((0,to.isNonNullType)(l))throw new kn.GraphQLError(`Argument "${c}" of required type "${(0,eo.inspect)(l)}" was provided the variable "$${h}" which was not provided a runtime value.`,{nodes:d});continue}f=r[h]==null}if(f&&(0,to.isNonNullType)(l))throw new kn.GraphQLError(`Argument "${c}" of non-null type "${(0,eo.inspect)(l)}" must not be null.`,{nodes:d});let m=(0,e_.valueFromAST)(d,l,r);if(m===void 0)throw new kn.GraphQLError(`Argument "${c}" has invalid value ${(0,ZO.print)(d)}.`,{nodes:d});i[c]=m}return i}function yU(e,t,r){var n;let i=(n=t.directives)===null||n===void 0?void 0:n.find(s=>s.name.value===e.name);if(i)return t_(e,i,r)}function r_(e,t){return Object.prototype.hasOwnProperty.call(e,t)}});var yl=T(gl=>{"use strict";u();Object.defineProperty(gl,"__esModule",{value:!0});gl.collectFields=TU;gl.collectSubfields=EU;var Lg=Ie(),bU=Re(),n_=Xt(),vU=dn(),i_=ro();function TU(e,t,r,n,i){let s=new Map;return ml(e,t,r,n,i,s,new Set),s}function EU(e,t,r,n,i){let s=new Map,o=new Set;for(let a of i)a.selectionSet&&ml(e,t,r,n,a.selectionSet,s,o);return s}function ml(e,t,r,n,i,s,o){for(let a of i.selections)switch(a.kind){case Lg.Kind.FIELD:{if(!kg(r,a))continue;let c=xU(a),l=s.get(c);l!==void 0?l.push(a):s.set(c,[a]);break}case Lg.Kind.INLINE_FRAGMENT:{if(!kg(r,a)||!s_(e,a,n))continue;ml(e,t,r,n,a.selectionSet,s,o);break}case Lg.Kind.FRAGMENT_SPREAD:{let c=a.name.value;if(o.has(c)||!kg(r,a))continue;o.add(c);let l=t[c];if(!l||!s_(e,l,n))continue;ml(e,t,r,n,l.selectionSet,s,o);break}}}function kg(e,t){let r=(0,i_.getDirectiveValues)(n_.GraphQLSkipDirective,t,e);if(r?.if===!0)return!1;let n=(0,i_.getDirectiveValues)(n_.GraphQLIncludeDirective,t,e);return n?.if!==!1}function s_(e,t,r){let n=t.typeCondition;if(!n)return!0;let i=(0,vU.typeFromAST)(e,n);return i===r?!0:(0,bU.isAbstractType)(i)?e.isSubType(i,r):!1}function xU(e){return e.alias?e.alias.value:e.name.value}});var $g=T(Dg=>{"use strict";u();Object.defineProperty(Dg,"__esModule",{value:!0});Dg.SingleFieldSubscriptionsRule=OU;var o_=ue(),wU=Ie(),SU=yl();function OU(e){return{OperationDefinition(t){if(t.operation==="subscription"){let r=e.getSchema(),n=r.getSubscriptionType();if(n){let i=t.name?t.name.value:null,s=Object.create(null),o=e.getDocument(),a=Object.create(null);for(let l of o.definitions)l.kind===wU.Kind.FRAGMENT_DEFINITION&&(a[l.name.value]=l);let c=(0,SU.collectFields)(r,a,s,n,t.selectionSet);if(c.size>1){let d=[...c.values()].slice(1).flat();e.reportError(new o_.GraphQLError(i!=null?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:d}))}for(let l of c.values())l[0].name.value.startsWith("__")&&e.reportError(new o_.GraphQLError(i!=null?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:l}))}}}}}});var bl=T(Pg=>{"use strict";u();Object.defineProperty(Pg,"__esModule",{value:!0});Pg.groupBy=_U;function _U(e,t){let r=new Map;for(let n of e){let i=t(n),s=r.get(i);s===void 0?r.set(i,[n]):s.push(n)}return r}});var qg=T(jg=>{"use strict";u();Object.defineProperty(jg,"__esModule",{value:!0});jg.UniqueArgumentDefinitionNamesRule=IU;var AU=bl(),NU=ue();function IU(e){return{DirectiveDefinition(n){var i;let s=(i=n.arguments)!==null&&i!==void 0?i:[];return r(`@${n.name.value}`,s)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(n){var i;let s=n.name.value,o=(i=n.fields)!==null&&i!==void 0?i:[];for(let c of o){var a;let l=c.name.value,p=(a=c.arguments)!==null&&a!==void 0?a:[];r(`${s}.${l}`,p)}return!1}function r(n,i){let s=(0,AU.groupBy)(i,o=>o.name.value);for(let[o,a]of s)a.length>1&&e.reportError(new NU.GraphQLError(`Argument "${n}(${o}:)" can only be defined once.`,{nodes:a.map(c=>c.name)}));return!1}}});var Mg=T(Fg=>{"use strict";u();Object.defineProperty(Fg,"__esModule",{value:!0});Fg.UniqueArgumentNamesRule=LU;var RU=bl(),CU=ue();function LU(e){return{Field:t,Directive:t};function t(r){var n;let i=(n=r.arguments)!==null&&n!==void 0?n:[],s=(0,RU.groupBy)(i,o=>o.name.value);for(let[o,a]of s)a.length>1&&e.reportError(new CU.GraphQLError(`There can be only one argument named "${o}".`,{nodes:a.map(c=>c.name)}))}}});var Bg=T(Ug=>{"use strict";u();Object.defineProperty(Ug,"__esModule",{value:!0});Ug.UniqueDirectiveNamesRule=kU;var a_=ue();function kU(e){let t=Object.create(null),r=e.getSchema();return{DirectiveDefinition(n){let i=n.name.value;if(r!=null&&r.getDirective(i)){e.reportError(new a_.GraphQLError(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:n.name}));return}return t[i]?e.reportError(new a_.GraphQLError(`There can be only one directive named "@${i}".`,{nodes:[t[i],n.name]})):t[i]=n.name,!1}}}});var Gg=T(Kg=>{"use strict";u();Object.defineProperty(Kg,"__esModule",{value:!0});Kg.UniqueDirectivesPerLocationRule=PU;var DU=ue(),Vg=Ie(),c_=Ki(),$U=Xt();function PU(e){let t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():$U.specifiedDirectives;for(let a of n)t[a.name]=!a.isRepeatable;let i=e.getDocument().definitions;for(let a of i)a.kind===Vg.Kind.DIRECTIVE_DEFINITION&&(t[a.name.value]=!a.repeatable);let s=Object.create(null),o=Object.create(null);return{enter(a){if(!("directives"in a)||!a.directives)return;let c;if(a.kind===Vg.Kind.SCHEMA_DEFINITION||a.kind===Vg.Kind.SCHEMA_EXTENSION)c=s;else if((0,c_.isTypeDefinitionNode)(a)||(0,c_.isTypeExtensionNode)(a)){let l=a.name.value;c=o[l],c===void 0&&(o[l]=c=Object.create(null))}else c=Object.create(null);for(let l of a.directives){let p=l.name.value;t[p]&&(c[p]?e.reportError(new DU.GraphQLError(`The directive "@${p}" can only be used once at this location.`,{nodes:[c[p],l]})):c[p]=l)}}}}});var Qg=T(Hg=>{"use strict";u();Object.defineProperty(Hg,"__esModule",{value:!0});Hg.UniqueEnumValueNamesRule=qU;var u_=ue(),jU=Re();function qU(e){let t=e.getSchema(),r=t?t.getTypeMap():Object.create(null),n=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(s){var o;let a=s.name.value;n[a]||(n[a]=Object.create(null));let c=(o=s.values)!==null&&o!==void 0?o:[],l=n[a];for(let p of c){let d=p.name.value,f=r[a];(0,jU.isEnumType)(f)&&f.getValue(d)?e.reportError(new u_.GraphQLError(`Enum value "${a}.${d}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:p.name})):l[d]?e.reportError(new u_.GraphQLError(`Enum value "${a}.${d}" can only be defined once.`,{nodes:[l[d],p.name]})):l[d]=p.name}return!1}}});var Jg=T(Wg=>{"use strict";u();Object.defineProperty(Wg,"__esModule",{value:!0});Wg.UniqueFieldDefinitionNamesRule=FU;var l_=ue(),zg=Re();function FU(e){let t=e.getSchema(),r=t?t.getTypeMap():Object.create(null),n=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(s){var o;let a=s.name.value;n[a]||(n[a]=Object.create(null));let c=(o=s.fields)!==null&&o!==void 0?o:[],l=n[a];for(let p of c){let d=p.name.value;MU(r[a],d)?e.reportError(new l_.GraphQLError(`Field "${a}.${d}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:p.name})):l[d]?e.reportError(new l_.GraphQLError(`Field "${a}.${d}" can only be defined once.`,{nodes:[l[d],p.name]})):l[d]=p.name}return!1}}function MU(e,t){return(0,zg.isObjectType)(e)||(0,zg.isInterfaceType)(e)||(0,zg.isInputObjectType)(e)?e.getFields()[t]!=null:!1}});var Xg=T(Yg=>{"use strict";u();Object.defineProperty(Yg,"__esModule",{value:!0});Yg.UniqueFragmentNamesRule=BU;var UU=ue();function BU(e){let t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(r){let n=r.name.value;return t[n]?e.reportError(new UU.GraphQLError(`There can be only one fragment named "${n}".`,{nodes:[t[n],r.name]})):t[n]=r.name,!1}}}});var ey=T(Zg=>{"use strict";u();Object.defineProperty(Zg,"__esModule",{value:!0});Zg.UniqueInputFieldNamesRule=GU;var VU=Ct(),KU=ue();function GU(e){let t=[],r=Object.create(null);return{ObjectValue:{enter(){t.push(r),r=Object.create(null)},leave(){let n=t.pop();n||(0,VU.invariant)(!1),r=n}},ObjectField(n){let i=n.name.value;r[i]?e.reportError(new KU.GraphQLError(`There can be only one input field named "${i}".`,{nodes:[r[i],n.name]})):r[i]=n.name}}}});var ry=T(ty=>{"use strict";u();Object.defineProperty(ty,"__esModule",{value:!0});ty.UniqueOperationNamesRule=QU;var HU=ue();function QU(e){let t=Object.create(null);return{OperationDefinition(r){let n=r.name;return n&&(t[n.value]?e.reportError(new HU.GraphQLError(`There can be only one operation named "${n.value}".`,{nodes:[t[n.value],n]})):t[n.value]=n),!1},FragmentDefinition:()=>!1}}});var iy=T(ny=>{"use strict";u();Object.defineProperty(ny,"__esModule",{value:!0});ny.UniqueOperationTypesRule=zU;var p_=ue();function zU(e){let t=e.getSchema(),r=Object.create(null),n=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(s){var o;let a=(o=s.operationTypes)!==null&&o!==void 0?o:[];for(let c of a){let l=c.operation,p=r[l];n[l]?e.reportError(new p_.GraphQLError(`Type for ${l} already defined in the schema. It cannot be redefined.`,{nodes:c})):p?e.reportError(new p_.GraphQLError(`There can be only one ${l} type in schema.`,{nodes:[p,c]})):r[l]=c}return!1}}});var oy=T(sy=>{"use strict";u();Object.defineProperty(sy,"__esModule",{value:!0});sy.UniqueTypeNamesRule=WU;var d_=ue();function WU(e){let t=Object.create(null),r=e.getSchema();return{ScalarTypeDefinition:n,ObjectTypeDefinition:n,InterfaceTypeDefinition:n,UnionTypeDefinition:n,EnumTypeDefinition:n,InputObjectTypeDefinition:n};function n(i){let s=i.name.value;if(r!=null&&r.getType(s)){e.reportError(new d_.GraphQLError(`Type "${s}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name}));return}return t[s]?e.reportError(new d_.GraphQLError(`There can be only one type named "${s}".`,{nodes:[t[s],i.name]})):t[s]=i.name,!1}}});var cy=T(ay=>{"use strict";u();Object.defineProperty(ay,"__esModule",{value:!0});ay.UniqueVariableNamesRule=XU;var JU=bl(),YU=ue();function XU(e){return{OperationDefinition(t){var r;let n=(r=t.variableDefinitions)!==null&&r!==void 0?r:[],i=(0,JU.groupBy)(n,s=>s.variable.name.value);for(let[s,o]of i)o.length>1&&e.reportError(new YU.GraphQLError(`There can be only one variable named "$${s}".`,{nodes:o.map(a=>a.variable.name)}))}}}});var ly=T(uy=>{"use strict";u();Object.defineProperty(uy,"__esModule",{value:!0});uy.ValuesOfCorrectTypeRule=nB;var ZU=ii(),ja=Be(),eB=si(),tB=oi(),Dn=ue(),rB=Ie(),vl=ur(),fn=Re();function nB(e){let t={};return{OperationDefinition:{enter(){t={}}},VariableDefinition(r){t[r.variable.name.value]=r},ListValue(r){let n=(0,fn.getNullableType)(e.getParentInputType());if(!(0,fn.isListType)(n))return Hi(e,r),!1},ObjectValue(r){let n=(0,fn.getNamedType)(e.getInputType());if(!(0,fn.isInputObjectType)(n))return Hi(e,r),!1;let i=(0,eB.keyMap)(r.fields,s=>s.name.value);for(let s of Object.values(n.getFields()))if(!i[s.name]&&(0,fn.isRequiredInputField)(s)){let a=(0,ja.inspect)(s.type);e.reportError(new Dn.GraphQLError(`Field "${n.name}.${s.name}" of required type "${a}" was not provided.`,{nodes:r}))}n.isOneOf&&iB(e,r,n,i)},ObjectField(r){let n=(0,fn.getNamedType)(e.getParentInputType());if(!e.getInputType()&&(0,fn.isInputObjectType)(n)){let s=(0,tB.suggestionList)(r.name.value,Object.keys(n.getFields()));e.reportError(new Dn.GraphQLError(`Field "${r.name.value}" is not defined by type "${n.name}".`+(0,ZU.didYouMean)(s),{nodes:r}))}},NullValue(r){let n=e.getInputType();(0,fn.isNonNullType)(n)&&e.reportError(new Dn.GraphQLError(`Expected value of type "${(0,ja.inspect)(n)}", found ${(0,vl.print)(r)}.`,{nodes:r}))},EnumValue:r=>Hi(e,r),IntValue:r=>Hi(e,r),FloatValue:r=>Hi(e,r),StringValue:r=>Hi(e,r),BooleanValue:r=>Hi(e,r)}}function Hi(e,t){let r=e.getInputType();if(!r)return;let n=(0,fn.getNamedType)(r);if(!(0,fn.isLeafType)(n)){let i=(0,ja.inspect)(r);e.reportError(new Dn.GraphQLError(`Expected value of type "${i}", found ${(0,vl.print)(t)}.`,{nodes:t}));return}try{if(n.parseLiteral(t,void 0)===void 0){let s=(0,ja.inspect)(r);e.reportError(new Dn.GraphQLError(`Expected value of type "${s}", found ${(0,vl.print)(t)}.`,{nodes:t}))}}catch(i){let s=(0,ja.inspect)(r);i instanceof Dn.GraphQLError?e.reportError(i):e.reportError(new Dn.GraphQLError(`Expected value of type "${s}", found ${(0,vl.print)(t)}; `+i.message,{nodes:t,originalError:i}))}}function iB(e,t,r,n){var i;let s=Object.keys(n);if(s.length!==1){e.reportError(new Dn.GraphQLError(`OneOf Input Object "${r.name}" must specify exactly one key.`,{nodes:[t]}));return}let a=(i=n[s[0]])===null||i===void 0?void 0:i.value;(!a||a.kind===rB.Kind.NULL)&&e.reportError(new Dn.GraphQLError(`Field "${r.name}.${s[0]}" must be non-null.`,{nodes:[t]}))}});var dy=T(py=>{"use strict";u();Object.defineProperty(py,"__esModule",{value:!0});py.VariablesAreInputTypesRule=uB;var sB=ue(),oB=ur(),aB=Re(),cB=dn();function uB(e){return{VariableDefinition(t){let r=(0,cB.typeFromAST)(e.getSchema(),t.type);if(r!==void 0&&!(0,aB.isInputType)(r)){let n=t.variable.name.value,i=(0,oB.print)(t.type);e.reportError(new sB.GraphQLError(`Variable "$${n}" cannot be non-input type "${i}".`,{nodes:t.type}))}}}}});var hy=T(fy=>{"use strict";u();Object.defineProperty(fy,"__esModule",{value:!0});fy.VariablesInAllowedPositionRule=dB;var f_=Be(),h_=ue(),lB=Ie(),Tl=Re(),m_=ba(),pB=dn();function dB(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(r){let n=e.getRecursiveVariableUsages(r);for(let{node:i,type:s,defaultValue:o,parentType:a}of n){let c=i.name.value,l=t[c];if(l&&s){let p=e.getSchema(),d=(0,pB.typeFromAST)(p,l.type);if(d&&!fB(p,d,l.defaultValue,s,o)){let f=(0,f_.inspect)(d),m=(0,f_.inspect)(s);e.reportError(new h_.GraphQLError(`Variable "$${c}" of type "${f}" used in position expecting type "${m}".`,{nodes:[l,i]}))}(0,Tl.isInputObjectType)(a)&&a.isOneOf&&(0,Tl.isNullableType)(d)&&e.reportError(new h_.GraphQLError(`Variable "$${c}" is of type "${d}" but must be non-nullable to be used for OneOf Input Object "${a}".`,{nodes:[l,i]}))}}}},VariableDefinition(r){t[r.variable.name.value]=r}}}function fB(e,t,r,n,i){if((0,Tl.isNonNullType)(n)&&!(0,Tl.isNonNullType)(t)){if(!(r!=null&&r.kind!==lB.Kind.NULL)&&!(i!==void 0))return!1;let a=n.ofType;return(0,m_.isTypeSubTypeOf)(e,t,a)}return(0,m_.isTypeSubTypeOf)(e,t,n)}});var my=T(li=>{"use strict";u();Object.defineProperty(li,"__esModule",{value:!0});li.specifiedSDLRules=li.specifiedRules=li.recommendedRules=void 0;var hB=Cm(),mB=km(),gB=$m(),g_=Pm(),y_=Mm(),yB=Bm(),b_=Gm(),bB=Qm(),vB=Wm(),TB=Ym(),EB=Zm(),xB=tg(),wB=ng(),SB=sg(),OB=mg(),_B=bg(),AB=Tg(),v_=xg(),NB=_g(),IB=$g(),RB=qg(),T_=Mg(),CB=Bg(),E_=Gg(),LB=Qg(),kB=Jg(),DB=Xg(),x_=ey(),$B=ry(),PB=iy(),jB=oy(),qB=cy(),FB=ly(),MB=dy(),UB=hy(),w_=Object.freeze([TB.MaxIntrospectionDepthRule]);li.recommendedRules=w_;var BB=Object.freeze([hB.ExecutableDefinitionsRule,$B.UniqueOperationNamesRule,bB.LoneAnonymousOperationRule,IB.SingleFieldSubscriptionsRule,b_.KnownTypeNamesRule,gB.FragmentsOnCompositeTypesRule,MB.VariablesAreInputTypesRule,NB.ScalarLeafsRule,mB.FieldsOnCorrectTypeRule,DB.UniqueFragmentNamesRule,yB.KnownFragmentNamesRule,wB.NoUnusedFragmentsRule,_B.PossibleFragmentSpreadsRule,EB.NoFragmentCyclesRule,qB.UniqueVariableNamesRule,xB.NoUndefinedVariablesRule,SB.NoUnusedVariablesRule,y_.KnownDirectivesRule,E_.UniqueDirectivesPerLocationRule,g_.KnownArgumentNamesRule,T_.UniqueArgumentNamesRule,FB.ValuesOfCorrectTypeRule,v_.ProvidedRequiredArgumentsRule,UB.VariablesInAllowedPositionRule,OB.OverlappingFieldsCanBeMergedRule,x_.UniqueInputFieldNamesRule,...w_]);li.specifiedRules=BB;var VB=Object.freeze([vB.LoneSchemaDefinitionRule,PB.UniqueOperationTypesRule,jB.UniqueTypeNamesRule,LB.UniqueEnumValueNamesRule,kB.UniqueFieldDefinitionNamesRule,RB.UniqueArgumentDefinitionNamesRule,CB.UniqueDirectiveNamesRule,b_.KnownTypeNamesRule,y_.KnownDirectivesRule,E_.UniqueDirectivesPerLocationRule,AB.PossibleTypeExtensionsRule,g_.KnownArgumentNamesOnDirectivesRule,T_.UniqueArgumentNamesRule,x_.UniqueInputFieldNamesRule,v_.ProvidedRequiredArgumentsOnDirectivesRule]);li.specifiedSDLRules=VB});var by=T(pi=>{"use strict";u();Object.defineProperty(pi,"__esModule",{value:!0});pi.ValidationContext=pi.SDLValidationContext=pi.ASTValidationContext=void 0;var S_=Ie(),KB=Pi(),O_=sl(),qa=class{constructor(t,r){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=r}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(t){this._onError(t)}getDocument(){return this._ast}getFragment(t){let r;if(this._fragments)r=this._fragments;else{r=Object.create(null);for(let n of this.getDocument().definitions)n.kind===S_.Kind.FRAGMENT_DEFINITION&&(r[n.name.value]=n);this._fragments=r}return r[t]}getFragmentSpreads(t){let r=this._fragmentSpreads.get(t);if(!r){r=[];let n=[t],i;for(;i=n.pop();)for(let s of i.selections)s.kind===S_.Kind.FRAGMENT_SPREAD?r.push(s):s.selectionSet&&n.push(s.selectionSet);this._fragmentSpreads.set(t,r)}return r}getRecursivelyReferencedFragments(t){let r=this._recursivelyReferencedFragments.get(t);if(!r){r=[];let n=Object.create(null),i=[t.selectionSet],s;for(;s=i.pop();)for(let o of this.getFragmentSpreads(s)){let a=o.name.value;if(n[a]!==!0){n[a]=!0;let c=this.getFragment(a);c&&(r.push(c),i.push(c.selectionSet))}}this._recursivelyReferencedFragments.set(t,r)}return r}};pi.ASTValidationContext=qa;var gy=class extends qa{constructor(t,r,n){super(t,n),this._schema=r}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}};pi.SDLValidationContext=gy;var yy=class extends qa{constructor(t,r,n,i){super(r,i),this._schema=t,this._typeInfo=n,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(t){let r=this._variableUsages.get(t);if(!r){let n=[],i=new O_.TypeInfo(this._schema);(0,KB.visit)(t,(0,O_.visitWithTypeInfo)(i,{VariableDefinition:()=>!1,Variable(s){n.push({node:s,type:i.getInputType(),defaultValue:i.getDefaultValue(),parentType:i.getParentInputType()})}})),r=n,this._variableUsages.set(t,r)}return r}getRecursiveVariableUsages(t){let r=this._recursiveVariableUsages.get(t);if(!r){r=this.getVariableUsages(t);for(let n of this.getRecursivelyReferencedFragments(t))r=r.concat(this.getVariableUsages(n));this._recursiveVariableUsages.set(t,r)}return r}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}};pi.ValidationContext=yy});var Fa=T(no=>{"use strict";u();Object.defineProperty(no,"__esModule",{value:!0});no.assertValidSDL=WB;no.assertValidSDLExtension=JB;no.validate=zB;no.validateSDL=vy;var GB=qt(),HB=ue(),El=Pi(),QB=Na(),__=sl(),A_=my(),N_=by();function zB(e,t,r=A_.specifiedRules,n,i=new __.TypeInfo(e)){var s;let o=(s=n?.maxErrors)!==null&&s!==void 0?s:100;t||(0,GB.devAssert)(!1,"Must provide document."),(0,QB.assertValidSchema)(e);let a=Object.freeze({}),c=[],l=new N_.ValidationContext(e,t,i,d=>{if(c.length>=o)throw c.push(new HB.GraphQLError("Too many validation errors, error limit reached. Validation aborted.")),a;c.push(d)}),p=(0,El.visitInParallel)(r.map(d=>d(l)));try{(0,El.visit)(t,(0,__.visitWithTypeInfo)(i,p))}catch(d){if(d!==a)throw d}return c}function vy(e,t,r=A_.specifiedSDLRules){let n=[],i=new N_.SDLValidationContext(e,t,o=>{n.push(o)}),s=r.map(o=>o(i));return(0,El.visit)(e,(0,El.visitInParallel)(s)),n}function WB(e){let t=vy(e);if(t.length!==0)throw new Error(t.map(r=>r.message).join(`
102
+
103
+ `))}function JB(e,t){let r=vy(e,t);if(r.length!==0)throw new Error(r.map(n=>n.message).join(`
104
+
105
+ `))}});var I_=T(Ty=>{"use strict";u();Object.defineProperty(Ty,"__esModule",{value:!0});Ty.memoize3=YB;function YB(e){let t;return function(n,i,s){t===void 0&&(t=new WeakMap);let o=t.get(n);o===void 0&&(o=new WeakMap,t.set(n,o));let a=o.get(i);a===void 0&&(a=new WeakMap,o.set(i,a));let c=a.get(s);return c===void 0&&(c=e(n,i,s),a.set(s,c)),c}}});var R_=T(Ey=>{"use strict";u();Object.defineProperty(Ey,"__esModule",{value:!0});Ey.promiseForObject=XB;function XB(e){return Promise.all(Object.values(e)).then(t=>{let r=Object.create(null);for(let[n,i]of Object.keys(e).entries())r[i]=t[n];return r})}});var C_=T(xy=>{"use strict";u();Object.defineProperty(xy,"__esModule",{value:!0});xy.promiseReduce=eV;var ZB=xu();function eV(e,t,r){let n=r;for(let i of e)n=(0,ZB.isPromise)(n)?n.then(s=>t(s,i)):t(n,i);return n}});var L_=T(Sy=>{"use strict";u();Object.defineProperty(Sy,"__esModule",{value:!0});Sy.toError=rV;var tV=Be();function rV(e){return e instanceof Error?e:new wy(e)}var wy=class extends Error{constructor(t){super("Unexpected error value: "+(0,tV.inspect)(t)),this.name="NonErrorThrown",this.thrownValue=t}}});var xl=T(Oy=>{"use strict";u();Object.defineProperty(Oy,"__esModule",{value:!0});Oy.locatedError=sV;var nV=L_(),iV=ue();function sV(e,t,r){var n;let i=(0,nV.toError)(e);return oV(i)?i:new iV.GraphQLError(i.message,{nodes:(n=i.nodes)!==null&&n!==void 0?n:t,source:i.source,positions:i.positions,path:r,originalError:i})}function oV(e){return Array.isArray(e.path)}});var Ua=T(Ar=>{"use strict";u();Object.defineProperty(Ar,"__esModule",{value:!0});Ar.assertValidExecutionArguments=M_;Ar.buildExecutionContext=U_;Ar.buildResolveInfo=V_;Ar.defaultTypeResolver=Ar.defaultFieldResolver=void 0;Ar.execute=F_;Ar.executeSync=fV;Ar.getFieldDef=G_;var Ay=qt(),Qi=Be(),aV=Ct(),cV=tl(),Ry=cn(),Gr=xu(),uV=I_(),zi=Ca(),k_=R_(),lV=C_(),_r=ue(),Sl=xl(),_y=qr(),D_=Ie(),di=Re(),io=Or(),pV=Na(),j_=yl(),q_=ro(),dV=(0,uV.memoize3)((e,t,r)=>(0,j_.collectSubfields)(e.schema,e.fragments,e.variableValues,t,r));function F_(e){arguments.length<2||(0,Ay.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let{schema:t,document:r,variableValues:n,rootValue:i}=e;M_(t,r,n);let s=U_(e);if(!("schema"in s))return{errors:s};try{let{operation:o}=s,a=hV(s,o,i);return(0,Gr.isPromise)(a)?a.then(c=>wl(c,s.errors),c=>(s.errors.push(c),wl(null,s.errors))):wl(a,s.errors)}catch(o){return s.errors.push(o),wl(null,s.errors)}}function fV(e){let t=F_(e);if((0,Gr.isPromise)(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function wl(e,t){return t.length===0?{data:e}:{errors:t,data:e}}function M_(e,t,r){t||(0,Ay.devAssert)(!1,"Must provide document."),(0,pV.assertValidSchema)(e),r==null||(0,Ry.isObjectLike)(r)||(0,Ay.devAssert)(!1,"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.")}function U_(e){var t,r,n;let{schema:i,document:s,rootValue:o,contextValue:a,variableValues:c,operationName:l,fieldResolver:p,typeResolver:d,subscribeFieldResolver:f,options:m}=e,h,v=Object.create(null);for(let w of s.definitions)switch(w.kind){case D_.Kind.OPERATION_DEFINITION:if(l==null){if(h!==void 0)return[new _r.GraphQLError("Must provide operation name if query contains multiple operations.")];h=w}else((t=w.name)===null||t===void 0?void 0:t.value)===l&&(h=w);break;case D_.Kind.FRAGMENT_DEFINITION:v[w.name.value]=w;break;default:}if(!h)return l!=null?[new _r.GraphQLError(`Unknown operation named "${l}".`)]:[new _r.GraphQLError("Must provide an operation.")];let E=(r=h.variableDefinitions)!==null&&r!==void 0?r:[],A=(0,q_.getVariableValues)(i,E,c??{},{maxErrors:(n=m?.maxCoercionErrors)!==null&&n!==void 0?n:50});return A.errors?A.errors:{schema:i,fragments:v,rootValue:o,contextValue:a,operation:h,variableValues:A.coerced,fieldResolver:p??Iy,typeResolver:d??K_,subscribeFieldResolver:f??Iy,errors:[]}}function hV(e,t,r){let n=e.schema.getRootType(t.operation);if(n==null)throw new _r.GraphQLError(`Schema is not configured to execute ${t.operation} operation.`,{nodes:t});let i=(0,j_.collectFields)(e.schema,e.fragments,e.variableValues,n,t.selectionSet),s=void 0;switch(t.operation){case _y.OperationTypeNode.QUERY:return Ol(e,n,r,s,i);case _y.OperationTypeNode.MUTATION:return mV(e,n,r,s,i);case _y.OperationTypeNode.SUBSCRIPTION:return Ol(e,n,r,s,i)}}function mV(e,t,r,n,i){return(0,lV.promiseReduce)(i.entries(),(s,[o,a])=>{let c=(0,zi.addPath)(n,o,t.name),l=B_(e,t,r,a,c);return l===void 0?s:(0,Gr.isPromise)(l)?l.then(p=>(s[o]=p,s)):(s[o]=l,s)},Object.create(null))}function Ol(e,t,r,n,i){let s=Object.create(null),o=!1;try{for(let[a,c]of i.entries()){let l=(0,zi.addPath)(n,a,t.name),p=B_(e,t,r,c,l);p!==void 0&&(s[a]=p,(0,Gr.isPromise)(p)&&(o=!0))}}catch(a){if(o)return(0,k_.promiseForObject)(s).finally(()=>{throw a});throw a}return o?(0,k_.promiseForObject)(s):s}function B_(e,t,r,n,i){var s;let o=G_(e.schema,t,n[0]);if(!o)return;let a=o.type,c=(s=o.resolve)!==null&&s!==void 0?s:e.fieldResolver,l=V_(e,o,n,t,i);try{let p=(0,q_.getArgumentValues)(o,n[0],e.variableValues),d=e.contextValue,f=c(r,p,d,l),m;return(0,Gr.isPromise)(f)?m=f.then(h=>Ma(e,a,n,l,i,h)):m=Ma(e,a,n,l,i,f),(0,Gr.isPromise)(m)?m.then(void 0,h=>{let v=(0,Sl.locatedError)(h,n,(0,zi.pathToArray)(i));return _l(v,a,e)}):m}catch(p){let d=(0,Sl.locatedError)(p,n,(0,zi.pathToArray)(i));return _l(d,a,e)}}function V_(e,t,r,n,i){return{fieldName:t.name,fieldNodes:r,returnType:t.type,parentType:n,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function _l(e,t,r){if((0,di.isNonNullType)(t))throw e;return r.errors.push(e),null}function Ma(e,t,r,n,i,s){if(s instanceof Error)throw s;if((0,di.isNonNullType)(t)){let o=Ma(e,t.ofType,r,n,i,s);if(o===null)throw new Error(`Cannot return null for non-nullable field ${n.parentType.name}.${n.fieldName}.`);return o}if(s==null)return null;if((0,di.isListType)(t))return gV(e,t,r,n,i,s);if((0,di.isLeafType)(t))return yV(t,s);if((0,di.isAbstractType)(t))return bV(e,t,r,n,i,s);if((0,di.isObjectType)(t))return Ny(e,t,r,n,i,s);(0,aV.invariant)(!1,"Cannot complete value of unexpected output type: "+(0,Qi.inspect)(t))}function gV(e,t,r,n,i,s){if(!(0,cV.isIterableObject)(s))throw new _r.GraphQLError(`Expected Iterable, but did not find one for field "${n.parentType.name}.${n.fieldName}".`);let o=t.ofType,a=!1,c=Array.from(s,(l,p)=>{let d=(0,zi.addPath)(i,p,void 0);try{let f;return(0,Gr.isPromise)(l)?f=l.then(m=>Ma(e,o,r,n,d,m)):f=Ma(e,o,r,n,d,l),(0,Gr.isPromise)(f)?(a=!0,f.then(void 0,m=>{let h=(0,Sl.locatedError)(m,r,(0,zi.pathToArray)(d));return _l(h,o,e)})):f}catch(f){let m=(0,Sl.locatedError)(f,r,(0,zi.pathToArray)(d));return _l(m,o,e)}});return a?Promise.all(c):c}function yV(e,t){let r=e.serialize(t);if(r==null)throw new Error(`Expected \`${(0,Qi.inspect)(e)}.serialize(${(0,Qi.inspect)(t)})\` to return non-nullable value, returned: ${(0,Qi.inspect)(r)}`);return r}function bV(e,t,r,n,i,s){var o;let a=(o=t.resolveType)!==null&&o!==void 0?o:e.typeResolver,c=e.contextValue,l=a(s,c,n,t);return(0,Gr.isPromise)(l)?l.then(p=>Ny(e,$_(p,e,t,r,n,s),r,n,i,s)):Ny(e,$_(l,e,t,r,n,s),r,n,i,s)}function $_(e,t,r,n,i,s){if(e==null)throw new _r.GraphQLError(`Abstract type "${r.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}". Either the "${r.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,n);if((0,di.isObjectType)(e))throw new _r.GraphQLError("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");if(typeof e!="string")throw new _r.GraphQLError(`Abstract type "${r.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}" with value ${(0,Qi.inspect)(s)}, received "${(0,Qi.inspect)(e)}".`);let o=t.schema.getType(e);if(o==null)throw new _r.GraphQLError(`Abstract type "${r.name}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:n});if(!(0,di.isObjectType)(o))throw new _r.GraphQLError(`Abstract type "${r.name}" was resolved to a non-object type "${e}".`,{nodes:n});if(!t.schema.isSubType(r,o))throw new _r.GraphQLError(`Runtime Object type "${o.name}" is not a possible type for "${r.name}".`,{nodes:n});return o}function Ny(e,t,r,n,i,s){let o=dV(e,t,r);if(t.isTypeOf){let a=t.isTypeOf(s,e.contextValue,n);if((0,Gr.isPromise)(a))return a.then(c=>{if(!c)throw P_(t,s,r);return Ol(e,t,s,i,o)});if(!a)throw P_(t,s,r)}return Ol(e,t,s,i,o)}function P_(e,t,r){return new _r.GraphQLError(`Expected value of type "${e.name}" but got: ${(0,Qi.inspect)(t)}.`,{nodes:r})}var K_=function(e,t,r,n){if((0,Ry.isObjectLike)(e)&&typeof e.__typename=="string")return e.__typename;let i=r.schema.getPossibleTypes(n),s=[];for(let o=0;o<i.length;o++){let a=i[o];if(a.isTypeOf){let c=a.isTypeOf(e,t,r);if((0,Gr.isPromise)(c))s[o]=c;else if(c)return s.length&&Promise.allSettled(s).catch(()=>{}),a.name}}if(s.length)return Promise.all(s).then(o=>{for(let a=0;a<o.length;a++)if(o[a])return i[a].name})};Ar.defaultTypeResolver=K_;var Iy=function(e,t,r,n){if((0,Ry.isObjectLike)(e)||typeof e=="function"){let i=e[n.fieldName];return typeof i=="function"?e[n.fieldName](t,r,n):i}};Ar.defaultFieldResolver=Iy;function G_(e,t,r){let n=r.name.value;return n===io.SchemaMetaFieldDef.name&&e.getQueryType()===t?io.SchemaMetaFieldDef:n===io.TypeMetaFieldDef.name&&e.getQueryType()===t?io.TypeMetaFieldDef:n===io.TypeNameMetaFieldDef.name?io.TypeNameMetaFieldDef:t.getFields()[n]}});var Q_=T(Al=>{"use strict";u();Object.defineProperty(Al,"__esModule",{value:!0});Al.graphql=OV;Al.graphqlSync=_V;var vV=qt(),TV=xu(),EV=$i(),xV=Na(),wV=Fa(),SV=Ua();function OV(e){return new Promise(t=>t(H_(e)))}function _V(e){let t=H_(e);if((0,TV.isPromise)(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function H_(e){arguments.length<2||(0,vV.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let{schema:t,source:r,rootValue:n,contextValue:i,variableValues:s,operationName:o,fieldResolver:a,typeResolver:c}=e,l=(0,xV.validateSchema)(t);if(l.length>0)return{errors:l};let p;try{p=(0,EV.parse)(r)}catch(f){return{errors:[f]}}let d=(0,wV.validate)(t,p);return d.length>0?{errors:d}:(0,SV.execute)({schema:t,document:p,rootValue:n,contextValue:i,variableValues:s,operationName:o,fieldResolver:a,typeResolver:c})}});var J_=T(H=>{"use strict";u();Object.defineProperty(H,"__esModule",{value:!0});Object.defineProperty(H,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return Hr.DEFAULT_DEPRECATION_REASON}});Object.defineProperty(H,"GRAPHQL_MAX_INT",{enumerable:!0,get:function(){return $n.GRAPHQL_MAX_INT}});Object.defineProperty(H,"GRAPHQL_MIN_INT",{enumerable:!0,get:function(){return $n.GRAPHQL_MIN_INT}});Object.defineProperty(H,"GraphQLBoolean",{enumerable:!0,get:function(){return $n.GraphQLBoolean}});Object.defineProperty(H,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return Hr.GraphQLDeprecatedDirective}});Object.defineProperty(H,"GraphQLDirective",{enumerable:!0,get:function(){return Hr.GraphQLDirective}});Object.defineProperty(H,"GraphQLEnumType",{enumerable:!0,get:function(){return fe.GraphQLEnumType}});Object.defineProperty(H,"GraphQLFloat",{enumerable:!0,get:function(){return $n.GraphQLFloat}});Object.defineProperty(H,"GraphQLID",{enumerable:!0,get:function(){return $n.GraphQLID}});Object.defineProperty(H,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return Hr.GraphQLIncludeDirective}});Object.defineProperty(H,"GraphQLInputObjectType",{enumerable:!0,get:function(){return fe.GraphQLInputObjectType}});Object.defineProperty(H,"GraphQLInt",{enumerable:!0,get:function(){return $n.GraphQLInt}});Object.defineProperty(H,"GraphQLInterfaceType",{enumerable:!0,get:function(){return fe.GraphQLInterfaceType}});Object.defineProperty(H,"GraphQLList",{enumerable:!0,get:function(){return fe.GraphQLList}});Object.defineProperty(H,"GraphQLNonNull",{enumerable:!0,get:function(){return fe.GraphQLNonNull}});Object.defineProperty(H,"GraphQLObjectType",{enumerable:!0,get:function(){return fe.GraphQLObjectType}});Object.defineProperty(H,"GraphQLOneOfDirective",{enumerable:!0,get:function(){return Hr.GraphQLOneOfDirective}});Object.defineProperty(H,"GraphQLScalarType",{enumerable:!0,get:function(){return fe.GraphQLScalarType}});Object.defineProperty(H,"GraphQLSchema",{enumerable:!0,get:function(){return Cy.GraphQLSchema}});Object.defineProperty(H,"GraphQLSkipDirective",{enumerable:!0,get:function(){return Hr.GraphQLSkipDirective}});Object.defineProperty(H,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return Hr.GraphQLSpecifiedByDirective}});Object.defineProperty(H,"GraphQLString",{enumerable:!0,get:function(){return $n.GraphQLString}});Object.defineProperty(H,"GraphQLUnionType",{enumerable:!0,get:function(){return fe.GraphQLUnionType}});Object.defineProperty(H,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return er.SchemaMetaFieldDef}});Object.defineProperty(H,"TypeKind",{enumerable:!0,get:function(){return er.TypeKind}});Object.defineProperty(H,"TypeMetaFieldDef",{enumerable:!0,get:function(){return er.TypeMetaFieldDef}});Object.defineProperty(H,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return er.TypeNameMetaFieldDef}});Object.defineProperty(H,"__Directive",{enumerable:!0,get:function(){return er.__Directive}});Object.defineProperty(H,"__DirectiveLocation",{enumerable:!0,get:function(){return er.__DirectiveLocation}});Object.defineProperty(H,"__EnumValue",{enumerable:!0,get:function(){return er.__EnumValue}});Object.defineProperty(H,"__Field",{enumerable:!0,get:function(){return er.__Field}});Object.defineProperty(H,"__InputValue",{enumerable:!0,get:function(){return er.__InputValue}});Object.defineProperty(H,"__Schema",{enumerable:!0,get:function(){return er.__Schema}});Object.defineProperty(H,"__Type",{enumerable:!0,get:function(){return er.__Type}});Object.defineProperty(H,"__TypeKind",{enumerable:!0,get:function(){return er.__TypeKind}});Object.defineProperty(H,"assertAbstractType",{enumerable:!0,get:function(){return fe.assertAbstractType}});Object.defineProperty(H,"assertCompositeType",{enumerable:!0,get:function(){return fe.assertCompositeType}});Object.defineProperty(H,"assertDirective",{enumerable:!0,get:function(){return Hr.assertDirective}});Object.defineProperty(H,"assertEnumType",{enumerable:!0,get:function(){return fe.assertEnumType}});Object.defineProperty(H,"assertEnumValueName",{enumerable:!0,get:function(){return W_.assertEnumValueName}});Object.defineProperty(H,"assertInputObjectType",{enumerable:!0,get:function(){return fe.assertInputObjectType}});Object.defineProperty(H,"assertInputType",{enumerable:!0,get:function(){return fe.assertInputType}});Object.defineProperty(H,"assertInterfaceType",{enumerable:!0,get:function(){return fe.assertInterfaceType}});Object.defineProperty(H,"assertLeafType",{enumerable:!0,get:function(){return fe.assertLeafType}});Object.defineProperty(H,"assertListType",{enumerable:!0,get:function(){return fe.assertListType}});Object.defineProperty(H,"assertName",{enumerable:!0,get:function(){return W_.assertName}});Object.defineProperty(H,"assertNamedType",{enumerable:!0,get:function(){return fe.assertNamedType}});Object.defineProperty(H,"assertNonNullType",{enumerable:!0,get:function(){return fe.assertNonNullType}});Object.defineProperty(H,"assertNullableType",{enumerable:!0,get:function(){return fe.assertNullableType}});Object.defineProperty(H,"assertObjectType",{enumerable:!0,get:function(){return fe.assertObjectType}});Object.defineProperty(H,"assertOutputType",{enumerable:!0,get:function(){return fe.assertOutputType}});Object.defineProperty(H,"assertScalarType",{enumerable:!0,get:function(){return fe.assertScalarType}});Object.defineProperty(H,"assertSchema",{enumerable:!0,get:function(){return Cy.assertSchema}});Object.defineProperty(H,"assertType",{enumerable:!0,get:function(){return fe.assertType}});Object.defineProperty(H,"assertUnionType",{enumerable:!0,get:function(){return fe.assertUnionType}});Object.defineProperty(H,"assertValidSchema",{enumerable:!0,get:function(){return z_.assertValidSchema}});Object.defineProperty(H,"assertWrappingType",{enumerable:!0,get:function(){return fe.assertWrappingType}});Object.defineProperty(H,"getNamedType",{enumerable:!0,get:function(){return fe.getNamedType}});Object.defineProperty(H,"getNullableType",{enumerable:!0,get:function(){return fe.getNullableType}});Object.defineProperty(H,"introspectionTypes",{enumerable:!0,get:function(){return er.introspectionTypes}});Object.defineProperty(H,"isAbstractType",{enumerable:!0,get:function(){return fe.isAbstractType}});Object.defineProperty(H,"isCompositeType",{enumerable:!0,get:function(){return fe.isCompositeType}});Object.defineProperty(H,"isDirective",{enumerable:!0,get:function(){return Hr.isDirective}});Object.defineProperty(H,"isEnumType",{enumerable:!0,get:function(){return fe.isEnumType}});Object.defineProperty(H,"isInputObjectType",{enumerable:!0,get:function(){return fe.isInputObjectType}});Object.defineProperty(H,"isInputType",{enumerable:!0,get:function(){return fe.isInputType}});Object.defineProperty(H,"isInterfaceType",{enumerable:!0,get:function(){return fe.isInterfaceType}});Object.defineProperty(H,"isIntrospectionType",{enumerable:!0,get:function(){return er.isIntrospectionType}});Object.defineProperty(H,"isLeafType",{enumerable:!0,get:function(){return fe.isLeafType}});Object.defineProperty(H,"isListType",{enumerable:!0,get:function(){return fe.isListType}});Object.defineProperty(H,"isNamedType",{enumerable:!0,get:function(){return fe.isNamedType}});Object.defineProperty(H,"isNonNullType",{enumerable:!0,get:function(){return fe.isNonNullType}});Object.defineProperty(H,"isNullableType",{enumerable:!0,get:function(){return fe.isNullableType}});Object.defineProperty(H,"isObjectType",{enumerable:!0,get:function(){return fe.isObjectType}});Object.defineProperty(H,"isOutputType",{enumerable:!0,get:function(){return fe.isOutputType}});Object.defineProperty(H,"isRequiredArgument",{enumerable:!0,get:function(){return fe.isRequiredArgument}});Object.defineProperty(H,"isRequiredInputField",{enumerable:!0,get:function(){return fe.isRequiredInputField}});Object.defineProperty(H,"isScalarType",{enumerable:!0,get:function(){return fe.isScalarType}});Object.defineProperty(H,"isSchema",{enumerable:!0,get:function(){return Cy.isSchema}});Object.defineProperty(H,"isSpecifiedDirective",{enumerable:!0,get:function(){return Hr.isSpecifiedDirective}});Object.defineProperty(H,"isSpecifiedScalarType",{enumerable:!0,get:function(){return $n.isSpecifiedScalarType}});Object.defineProperty(H,"isType",{enumerable:!0,get:function(){return fe.isType}});Object.defineProperty(H,"isUnionType",{enumerable:!0,get:function(){return fe.isUnionType}});Object.defineProperty(H,"isWrappingType",{enumerable:!0,get:function(){return fe.isWrappingType}});Object.defineProperty(H,"resolveObjMapThunk",{enumerable:!0,get:function(){return fe.resolveObjMapThunk}});Object.defineProperty(H,"resolveReadonlyArrayThunk",{enumerable:!0,get:function(){return fe.resolveReadonlyArrayThunk}});Object.defineProperty(H,"specifiedDirectives",{enumerable:!0,get:function(){return Hr.specifiedDirectives}});Object.defineProperty(H,"specifiedScalarTypes",{enumerable:!0,get:function(){return $n.specifiedScalarTypes}});Object.defineProperty(H,"validateSchema",{enumerable:!0,get:function(){return z_.validateSchema}});var Cy=Bi(),fe=Re(),Hr=Xt(),$n=pn(),er=Or(),z_=Na(),W_=fa()});var X_=T(ke=>{"use strict";u();Object.defineProperty(ke,"__esModule",{value:!0});Object.defineProperty(ke,"BREAK",{enumerable:!0,get:function(){return Va.BREAK}});Object.defineProperty(ke,"DirectiveLocation",{enumerable:!0,get:function(){return kV.DirectiveLocation}});Object.defineProperty(ke,"Kind",{enumerable:!0,get:function(){return IV.Kind}});Object.defineProperty(ke,"Lexer",{enumerable:!0,get:function(){return CV.Lexer}});Object.defineProperty(ke,"Location",{enumerable:!0,get:function(){return Ly.Location}});Object.defineProperty(ke,"OperationTypeNode",{enumerable:!0,get:function(){return Ly.OperationTypeNode}});Object.defineProperty(ke,"Source",{enumerable:!0,get:function(){return AV.Source}});Object.defineProperty(ke,"Token",{enumerable:!0,get:function(){return Ly.Token}});Object.defineProperty(ke,"TokenKind",{enumerable:!0,get:function(){return RV.TokenKind}});Object.defineProperty(ke,"getEnterLeaveForKind",{enumerable:!0,get:function(){return Va.getEnterLeaveForKind}});Object.defineProperty(ke,"getLocation",{enumerable:!0,get:function(){return NV.getLocation}});Object.defineProperty(ke,"getVisitFn",{enumerable:!0,get:function(){return Va.getVisitFn}});Object.defineProperty(ke,"isConstValueNode",{enumerable:!0,get:function(){return Qr.isConstValueNode}});Object.defineProperty(ke,"isDefinitionNode",{enumerable:!0,get:function(){return Qr.isDefinitionNode}});Object.defineProperty(ke,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return Qr.isExecutableDefinitionNode}});Object.defineProperty(ke,"isSchemaCoordinateNode",{enumerable:!0,get:function(){return Qr.isSchemaCoordinateNode}});Object.defineProperty(ke,"isSelectionNode",{enumerable:!0,get:function(){return Qr.isSelectionNode}});Object.defineProperty(ke,"isTypeDefinitionNode",{enumerable:!0,get:function(){return Qr.isTypeDefinitionNode}});Object.defineProperty(ke,"isTypeExtensionNode",{enumerable:!0,get:function(){return Qr.isTypeExtensionNode}});Object.defineProperty(ke,"isTypeNode",{enumerable:!0,get:function(){return Qr.isTypeNode}});Object.defineProperty(ke,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return Qr.isTypeSystemDefinitionNode}});Object.defineProperty(ke,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return Qr.isTypeSystemExtensionNode}});Object.defineProperty(ke,"isValueNode",{enumerable:!0,get:function(){return Qr.isValueNode}});Object.defineProperty(ke,"parse",{enumerable:!0,get:function(){return Ba.parse}});Object.defineProperty(ke,"parseConstValue",{enumerable:!0,get:function(){return Ba.parseConstValue}});Object.defineProperty(ke,"parseSchemaCoordinate",{enumerable:!0,get:function(){return Ba.parseSchemaCoordinate}});Object.defineProperty(ke,"parseType",{enumerable:!0,get:function(){return Ba.parseType}});Object.defineProperty(ke,"parseValue",{enumerable:!0,get:function(){return Ba.parseValue}});Object.defineProperty(ke,"print",{enumerable:!0,get:function(){return LV.print}});Object.defineProperty(ke,"printLocation",{enumerable:!0,get:function(){return Y_.printLocation}});Object.defineProperty(ke,"printSourceLocation",{enumerable:!0,get:function(){return Y_.printSourceLocation}});Object.defineProperty(ke,"visit",{enumerable:!0,get:function(){return Va.visit}});Object.defineProperty(ke,"visitInParallel",{enumerable:!0,get:function(){return Va.visitInParallel}});var AV=Ru(),NV=wu(),Y_=Oh(),IV=Ie(),RV=Gs(),CV=aa(),Ba=$i(),LV=ur(),Va=Pi(),Ly=qr(),Qr=Ki(),kV=Ks()});var Z_=T(ky=>{"use strict";u();Object.defineProperty(ky,"__esModule",{value:!0});ky.isAsyncIterable=DV;function DV(e){return typeof e?.[Symbol.asyncIterator]=="function"}});var e0=T(Dy=>{"use strict";u();Object.defineProperty(Dy,"__esModule",{value:!0});Dy.mapAsyncIterator=$V;function $V(e,t){let r=e[Symbol.asyncIterator]();async function n(i){if(i.done)return i;try{return{value:await t(i.value),done:!1}}catch(s){if(typeof r.return=="function")try{await r.return()}catch{}throw s}}return{async next(){return n(await r.next())},async return(){return typeof r.return=="function"?n(await r.return()):{value:void 0,done:!0}},async throw(i){if(typeof r.throw=="function")return n(await r.throw(i));throw i},[Symbol.asyncIterator](){return this}}}});var i0=T(Nl=>{"use strict";u();Object.defineProperty(Nl,"__esModule",{value:!0});Nl.createSourceEventStream=n0;Nl.subscribe=BV;var PV=qt(),jV=Be(),r0=Z_(),t0=Ca(),$y=ue(),qV=xl(),FV=yl(),Ka=Ua(),MV=e0(),UV=ro();async function BV(e){arguments.length<2||(0,PV.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let t=await n0(e);if(!(0,r0.isAsyncIterable)(t))return t;let r=n=>(0,Ka.execute)({...e,rootValue:n});return(0,MV.mapAsyncIterator)(t,r)}function VV(e){let t=e[0];return t&&"document"in t?t:{schema:t,document:e[1],rootValue:e[2],contextValue:e[3],variableValues:e[4],operationName:e[5],subscribeFieldResolver:e[6]}}async function n0(...e){let t=VV(e),{schema:r,document:n,variableValues:i}=t;(0,Ka.assertValidExecutionArguments)(r,n,i);let s=(0,Ka.buildExecutionContext)(t);if(!("schema"in s))return{errors:s};try{let o=await KV(s);if(!(0,r0.isAsyncIterable)(o))throw new Error(`Subscription field must return Async Iterable. Received: ${(0,jV.inspect)(o)}.`);return o}catch(o){if(o instanceof $y.GraphQLError)return{errors:[o]};throw o}}async function KV(e){let{schema:t,fragments:r,operation:n,variableValues:i,rootValue:s}=e,o=t.getSubscriptionType();if(o==null)throw new $y.GraphQLError("Schema is not configured to execute subscription operation.",{nodes:n});let a=(0,FV.collectFields)(t,r,i,o,n.selectionSet),[c,l]=[...a.entries()][0],p=(0,Ka.getFieldDef)(t,o,l[0]);if(!p){let h=l[0].name.value;throw new $y.GraphQLError(`The subscription field "${h}" is not defined.`,{nodes:l})}let d=(0,t0.addPath)(void 0,c,o.name),f=(0,Ka.buildResolveInfo)(e,p,l,o,d);try{var m;let h=(0,UV.getArgumentValues)(p,l[0],i),v=e.contextValue,A=await((m=p.subscribe)!==null&&m!==void 0?m:e.subscribeFieldResolver)(s,h,v,f);if(A instanceof Error)throw A;return A}catch(h){throw(0,qV.locatedError)(h,l,(0,t0.pathToArray)(d))}}});var o0=T(Nr=>{"use strict";u();Object.defineProperty(Nr,"__esModule",{value:!0});Object.defineProperty(Nr,"createSourceEventStream",{enumerable:!0,get:function(){return s0.createSourceEventStream}});Object.defineProperty(Nr,"defaultFieldResolver",{enumerable:!0,get:function(){return Il.defaultFieldResolver}});Object.defineProperty(Nr,"defaultTypeResolver",{enumerable:!0,get:function(){return Il.defaultTypeResolver}});Object.defineProperty(Nr,"execute",{enumerable:!0,get:function(){return Il.execute}});Object.defineProperty(Nr,"executeSync",{enumerable:!0,get:function(){return Il.executeSync}});Object.defineProperty(Nr,"getArgumentValues",{enumerable:!0,get:function(){return Py.getArgumentValues}});Object.defineProperty(Nr,"getDirectiveValues",{enumerable:!0,get:function(){return Py.getDirectiveValues}});Object.defineProperty(Nr,"getVariableValues",{enumerable:!0,get:function(){return Py.getVariableValues}});Object.defineProperty(Nr,"responsePathAsArray",{enumerable:!0,get:function(){return GV.pathToArray}});Object.defineProperty(Nr,"subscribe",{enumerable:!0,get:function(){return s0.subscribe}});var GV=Ca(),Il=Ua(),s0=i0(),Py=ro()});var a0=T(Fy=>{"use strict";u();Object.defineProperty(Fy,"__esModule",{value:!0});Fy.NoDeprecatedCustomRule=HV;var jy=Ct(),Ga=ue(),qy=Re();function HV(e){return{Field(t){let r=e.getFieldDef(),n=r?.deprecationReason;if(r&&n!=null){let i=e.getParentType();i!=null||(0,jy.invariant)(!1),e.reportError(new Ga.GraphQLError(`The field ${i.name}.${r.name} is deprecated. ${n}`,{nodes:t}))}},Argument(t){let r=e.getArgument(),n=r?.deprecationReason;if(r&&n!=null){let i=e.getDirective();if(i!=null)e.reportError(new Ga.GraphQLError(`Directive "@${i.name}" argument "${r.name}" is deprecated. ${n}`,{nodes:t}));else{let s=e.getParentType(),o=e.getFieldDef();s!=null&&o!=null||(0,jy.invariant)(!1),e.reportError(new Ga.GraphQLError(`Field "${s.name}.${o.name}" argument "${r.name}" is deprecated. ${n}`,{nodes:t}))}}},ObjectField(t){let r=(0,qy.getNamedType)(e.getParentInputType());if((0,qy.isInputObjectType)(r)){let n=r.getFields()[t.name.value],i=n?.deprecationReason;i!=null&&e.reportError(new Ga.GraphQLError(`The input field ${r.name}.${n.name} is deprecated. ${i}`,{nodes:t}))}},EnumValue(t){let r=e.getEnumValue(),n=r?.deprecationReason;if(r&&n!=null){let i=(0,qy.getNamedType)(e.getInputType());i!=null||(0,jy.invariant)(!1),e.reportError(new Ga.GraphQLError(`The enum value "${i.name}.${r.name}" is deprecated. ${n}`,{nodes:t}))}}}}});var c0=T(My=>{"use strict";u();Object.defineProperty(My,"__esModule",{value:!0});My.NoSchemaIntrospectionCustomRule=JV;var QV=ue(),zV=Re(),WV=Or();function JV(e){return{Field(t){let r=(0,zV.getNamedType)(e.getType());r&&(0,WV.isIntrospectionType)(r)&&e.reportError(new QV.GraphQLError(`GraphQL introspection has been disabled, but the requested query contained the field "${t.name.value}".`,{nodes:t}))}}}});var l0=T(Ee=>{"use strict";u();Object.defineProperty(Ee,"__esModule",{value:!0});Object.defineProperty(Ee,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return ZV.ExecutableDefinitionsRule}});Object.defineProperty(Ee,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return eK.FieldsOnCorrectTypeRule}});Object.defineProperty(Ee,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return tK.FragmentsOnCompositeTypesRule}});Object.defineProperty(Ee,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return rK.KnownArgumentNamesRule}});Object.defineProperty(Ee,"KnownDirectivesRule",{enumerable:!0,get:function(){return nK.KnownDirectivesRule}});Object.defineProperty(Ee,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return iK.KnownFragmentNamesRule}});Object.defineProperty(Ee,"KnownTypeNamesRule",{enumerable:!0,get:function(){return sK.KnownTypeNamesRule}});Object.defineProperty(Ee,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return oK.LoneAnonymousOperationRule}});Object.defineProperty(Ee,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return _K.LoneSchemaDefinitionRule}});Object.defineProperty(Ee,"MaxIntrospectionDepthRule",{enumerable:!0,get:function(){return OK.MaxIntrospectionDepthRule}});Object.defineProperty(Ee,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return DK.NoDeprecatedCustomRule}});Object.defineProperty(Ee,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return aK.NoFragmentCyclesRule}});Object.defineProperty(Ee,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return $K.NoSchemaIntrospectionCustomRule}});Object.defineProperty(Ee,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return cK.NoUndefinedVariablesRule}});Object.defineProperty(Ee,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return uK.NoUnusedFragmentsRule}});Object.defineProperty(Ee,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return lK.NoUnusedVariablesRule}});Object.defineProperty(Ee,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return pK.OverlappingFieldsCanBeMergedRule}});Object.defineProperty(Ee,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return dK.PossibleFragmentSpreadsRule}});Object.defineProperty(Ee,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return kK.PossibleTypeExtensionsRule}});Object.defineProperty(Ee,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return fK.ProvidedRequiredArgumentsRule}});Object.defineProperty(Ee,"ScalarLeafsRule",{enumerable:!0,get:function(){return hK.ScalarLeafsRule}});Object.defineProperty(Ee,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return mK.SingleFieldSubscriptionsRule}});Object.defineProperty(Ee,"UniqueArgumentDefinitionNamesRule",{enumerable:!0,get:function(){return CK.UniqueArgumentDefinitionNamesRule}});Object.defineProperty(Ee,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return gK.UniqueArgumentNamesRule}});Object.defineProperty(Ee,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return LK.UniqueDirectiveNamesRule}});Object.defineProperty(Ee,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return yK.UniqueDirectivesPerLocationRule}});Object.defineProperty(Ee,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return IK.UniqueEnumValueNamesRule}});Object.defineProperty(Ee,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return RK.UniqueFieldDefinitionNamesRule}});Object.defineProperty(Ee,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return bK.UniqueFragmentNamesRule}});Object.defineProperty(Ee,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return vK.UniqueInputFieldNamesRule}});Object.defineProperty(Ee,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return TK.UniqueOperationNamesRule}});Object.defineProperty(Ee,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return AK.UniqueOperationTypesRule}});Object.defineProperty(Ee,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return NK.UniqueTypeNamesRule}});Object.defineProperty(Ee,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return EK.UniqueVariableNamesRule}});Object.defineProperty(Ee,"ValidationContext",{enumerable:!0,get:function(){return XV.ValidationContext}});Object.defineProperty(Ee,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return xK.ValuesOfCorrectTypeRule}});Object.defineProperty(Ee,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return wK.VariablesAreInputTypesRule}});Object.defineProperty(Ee,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return SK.VariablesInAllowedPositionRule}});Object.defineProperty(Ee,"recommendedRules",{enumerable:!0,get:function(){return u0.recommendedRules}});Object.defineProperty(Ee,"specifiedRules",{enumerable:!0,get:function(){return u0.specifiedRules}});Object.defineProperty(Ee,"validate",{enumerable:!0,get:function(){return YV.validate}});var YV=Fa(),XV=by(),u0=my(),ZV=Cm(),eK=km(),tK=$m(),rK=Pm(),nK=Mm(),iK=Bm(),sK=Gm(),oK=Qm(),aK=Zm(),cK=tg(),uK=ng(),lK=sg(),pK=mg(),dK=bg(),fK=xg(),hK=_g(),mK=$g(),gK=Mg(),yK=Gg(),bK=Xg(),vK=ey(),TK=ry(),EK=cy(),xK=ly(),wK=dy(),SK=hy(),OK=Ym(),_K=Wm(),AK=iy(),NK=oy(),IK=Qg(),RK=Jg(),CK=qg(),LK=Bg(),kK=Tg(),DK=a0(),$K=c0()});var p0=T(Wi=>{"use strict";u();Object.defineProperty(Wi,"__esModule",{value:!0});Object.defineProperty(Wi,"GraphQLError",{enumerable:!0,get:function(){return Uy.GraphQLError}});Object.defineProperty(Wi,"formatError",{enumerable:!0,get:function(){return Uy.formatError}});Object.defineProperty(Wi,"locatedError",{enumerable:!0,get:function(){return jK.locatedError}});Object.defineProperty(Wi,"printError",{enumerable:!0,get:function(){return Uy.printError}});Object.defineProperty(Wi,"syntaxError",{enumerable:!0,get:function(){return PK.syntaxError}});var Uy=ue(),PK=Zo(),jK=xl()});var Vy=T(By=>{"use strict";u();Object.defineProperty(By,"__esModule",{value:!0});By.getIntrospectionQuery=qK;function qK(e){let t={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,oneOf:!1,...e},r=t.descriptions?"description":"",n=t.specifiedByUrl?"specifiedByURL":"",i=t.directiveIsRepeatable?"isRepeatable":"",s=t.schemaDescription?r:"";function o(c){return t.inputValueDeprecation?c:""}let a=t.oneOf?"isOneOf":"";return`
106
+ query IntrospectionQuery {
107
+ __schema {
108
+ ${s}
109
+ queryType { name kind }
110
+ mutationType { name kind }
111
+ subscriptionType { name kind }
112
+ types {
113
+ ...FullType
114
+ }
115
+ directives {
116
+ name
117
+ ${r}
118
+ ${i}
119
+ locations
120
+ args${o("(includeDeprecated: true)")} {
121
+ ...InputValue
122
+ }
123
+ }
124
+ }
125
+ }
126
+
127
+ fragment FullType on __Type {
128
+ kind
129
+ name
130
+ ${r}
131
+ ${n}
132
+ ${a}
133
+ fields(includeDeprecated: true) {
134
+ name
135
+ ${r}
136
+ args${o("(includeDeprecated: true)")} {
137
+ ...InputValue
138
+ }
139
+ type {
140
+ ...TypeRef
141
+ }
142
+ isDeprecated
143
+ deprecationReason
144
+ }
145
+ inputFields${o("(includeDeprecated: true)")} {
146
+ ...InputValue
147
+ }
148
+ interfaces {
149
+ ...TypeRef
150
+ }
151
+ enumValues(includeDeprecated: true) {
152
+ name
153
+ ${r}
154
+ isDeprecated
155
+ deprecationReason
156
+ }
157
+ possibleTypes {
158
+ ...TypeRef
159
+ }
160
+ }
161
+
162
+ fragment InputValue on __InputValue {
163
+ name
164
+ ${r}
165
+ type { ...TypeRef }
166
+ defaultValue
167
+ ${o("isDeprecated")}
168
+ ${o("deprecationReason")}
169
+ }
170
+
171
+ fragment TypeRef on __Type {
172
+ kind
173
+ name
174
+ ofType {
175
+ kind
176
+ name
177
+ ofType {
178
+ kind
179
+ name
180
+ ofType {
181
+ kind
182
+ name
183
+ ofType {
184
+ kind
185
+ name
186
+ ofType {
187
+ kind
188
+ name
189
+ ofType {
190
+ kind
191
+ name
192
+ ofType {
193
+ kind
194
+ name
195
+ ofType {
196
+ kind
197
+ name
198
+ ofType {
199
+ kind
200
+ name
201
+ }
202
+ }
203
+ }
204
+ }
205
+ }
206
+ }
207
+ }
208
+ }
209
+ }
210
+ }
211
+ `}});var d0=T(Ky=>{"use strict";u();Object.defineProperty(Ky,"__esModule",{value:!0});Ky.getOperationAST=MK;var FK=Ie();function MK(e,t){let r=null;for(let i of e.definitions)if(i.kind===FK.Kind.OPERATION_DEFINITION){var n;if(t==null){if(r)return null;r=i}else if(((n=i.name)===null||n===void 0?void 0:n.value)===t)return i}return r}});var f0=T(Gy=>{"use strict";u();Object.defineProperty(Gy,"__esModule",{value:!0});Gy.getOperationRootType=UK;var Rl=ue();function UK(e,t){if(t.operation==="query"){let r=e.getQueryType();if(!r)throw new Rl.GraphQLError("Schema does not define the required query root type.",{nodes:t});return r}if(t.operation==="mutation"){let r=e.getMutationType();if(!r)throw new Rl.GraphQLError("Schema is not configured for mutations.",{nodes:t});return r}if(t.operation==="subscription"){let r=e.getSubscriptionType();if(!r)throw new Rl.GraphQLError("Schema is not configured for subscriptions.",{nodes:t});return r}throw new Rl.GraphQLError("Can only have query, mutation and subscription operations.",{nodes:t})}});var h0=T(Hy=>{"use strict";u();Object.defineProperty(Hy,"__esModule",{value:!0});Hy.introspectionFromSchema=HK;var BK=Ct(),VK=$i(),KK=Ua(),GK=Vy();function HK(e,t){let r={specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0,oneOf:!0,...t},n=(0,VK.parse)((0,GK.getIntrospectionQuery)(r)),i=(0,KK.executeSync)({schema:e,document:n});return!i.errors&&i.data||(0,BK.invariant)(!1),i.data}});var g0=T(Qy=>{"use strict";u();Object.defineProperty(Qy,"__esModule",{value:!0});Qy.buildClientSchema=ZK;var QK=qt(),pr=Be(),m0=cn(),Cl=pa(),zK=$i(),dr=Re(),WK=Xt(),hn=Or(),JK=pn(),YK=Bi(),XK=$a();function ZK(e,t){(0,m0.isObjectLike)(e)&&(0,m0.isObjectLike)(e.__schema)||(0,QK.devAssert)(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${(0,pr.inspect)(e)}.`);let r=e.__schema,n=(0,Cl.keyValMap)(r.types,b=>b.name,b=>f(b));for(let b of[...JK.specifiedScalarTypes,...hn.introspectionTypes])n[b.name]&&(n[b.name]=b);let i=r.queryType?p(r.queryType):null,s=r.mutationType?p(r.mutationType):null,o=r.subscriptionType?p(r.subscriptionType):null,a=r.directives?r.directives.map(k):[];return new YK.GraphQLSchema({description:r.description,query:i,mutation:s,subscription:o,types:Object.values(n),directives:a,assumeValid:t?.assumeValid});function c(b){if(b.kind===hn.TypeKind.LIST){let g=b.ofType;if(!g)throw new Error("Decorated type deeper than introspection query.");return new dr.GraphQLList(c(g))}if(b.kind===hn.TypeKind.NON_NULL){let g=b.ofType;if(!g)throw new Error("Decorated type deeper than introspection query.");let D=c(g);return new dr.GraphQLNonNull((0,dr.assertNullableType)(D))}return l(b)}function l(b){let g=b.name;if(!g)throw new Error(`Unknown type reference: ${(0,pr.inspect)(b)}.`);let D=n[g];if(!D)throw new Error(`Invalid or incomplete schema, unknown type: ${g}. Ensure that a full introspection query is used in order to build a client schema.`);return D}function p(b){return(0,dr.assertObjectType)(l(b))}function d(b){return(0,dr.assertInterfaceType)(l(b))}function f(b){if(b!=null&&b.name!=null&&b.kind!=null)switch(b.kind){case hn.TypeKind.SCALAR:return m(b);case hn.TypeKind.OBJECT:return v(b);case hn.TypeKind.INTERFACE:return E(b);case hn.TypeKind.UNION:return A(b);case hn.TypeKind.ENUM:return w(b);case hn.TypeKind.INPUT_OBJECT:return _(b)}let g=(0,pr.inspect)(b);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${g}.`)}function m(b){return new dr.GraphQLScalarType({name:b.name,description:b.description,specifiedByURL:b.specifiedByURL})}function h(b){if(b.interfaces===null&&b.kind===hn.TypeKind.INTERFACE)return[];if(!b.interfaces){let g=(0,pr.inspect)(b);throw new Error(`Introspection result missing interfaces: ${g}.`)}return b.interfaces.map(d)}function v(b){return new dr.GraphQLObjectType({name:b.name,description:b.description,interfaces:()=>h(b),fields:()=>I(b)})}function E(b){return new dr.GraphQLInterfaceType({name:b.name,description:b.description,interfaces:()=>h(b),fields:()=>I(b)})}function A(b){if(!b.possibleTypes){let g=(0,pr.inspect)(b);throw new Error(`Introspection result missing possibleTypes: ${g}.`)}return new dr.GraphQLUnionType({name:b.name,description:b.description,types:()=>b.possibleTypes.map(p)})}function w(b){if(!b.enumValues){let g=(0,pr.inspect)(b);throw new Error(`Introspection result missing enumValues: ${g}.`)}return new dr.GraphQLEnumType({name:b.name,description:b.description,values:(0,Cl.keyValMap)(b.enumValues,g=>g.name,g=>({description:g.description,deprecationReason:g.deprecationReason}))})}function _(b){if(!b.inputFields){let g=(0,pr.inspect)(b);throw new Error(`Introspection result missing inputFields: ${g}.`)}return new dr.GraphQLInputObjectType({name:b.name,description:b.description,fields:()=>R(b.inputFields),isOneOf:b.isOneOf})}function I(b){if(!b.fields)throw new Error(`Introspection result missing fields: ${(0,pr.inspect)(b)}.`);return(0,Cl.keyValMap)(b.fields,g=>g.name,C)}function C(b){let g=c(b.type);if(!(0,dr.isOutputType)(g)){let D=(0,pr.inspect)(g);throw new Error(`Introspection must provide output type for fields, but received: ${D}.`)}if(!b.args){let D=(0,pr.inspect)(b);throw new Error(`Introspection result missing field args: ${D}.`)}return{description:b.description,deprecationReason:b.deprecationReason,type:g,args:R(b.args)}}function R(b){return(0,Cl.keyValMap)(b,g=>g.name,q)}function q(b){let g=c(b.type);if(!(0,dr.isInputType)(g)){let $=(0,pr.inspect)(g);throw new Error(`Introspection must provide input type for arguments, but received: ${$}.`)}let D=b.defaultValue!=null?(0,XK.valueFromAST)((0,zK.parseValue)(b.defaultValue),g):void 0;return{description:b.description,type:g,defaultValue:D,deprecationReason:b.deprecationReason}}function k(b){if(!b.args){let g=(0,pr.inspect)(b);throw new Error(`Introspection result missing directive args: ${g}.`)}if(!b.locations){let g=(0,pr.inspect)(b);throw new Error(`Introspection result missing directive locations: ${g}.`)}return new WK.GraphQLDirective({name:b.name,description:b.description,isRepeatable:b.isRepeatable,locations:b.locations.slice(),args:R(b.args)})}}});var Wy=T(kl=>{"use strict";u();Object.defineProperty(kl,"__esModule",{value:!0});kl.extendSchema=sG;kl.extendSchemaImpl=S0;var eG=qt(),tG=Be(),rG=Ct(),nG=si(),Ha=Hh(),Ir=Ie(),y0=Ki(),tt=Re(),Qa=Xt(),x0=Or(),w0=pn(),b0=Bi(),iG=Fa(),zy=ro(),v0=$a();function sG(e,t,r){(0,b0.assertSchema)(e),t!=null&&t.kind===Ir.Kind.DOCUMENT||(0,eG.devAssert)(!1,"Must provide valid Document AST."),r?.assumeValid!==!0&&r?.assumeValidSDL!==!0&&(0,iG.assertValidSDLExtension)(t,e);let n=e.toConfig(),i=S0(n,t,r);return n===i?e:new b0.GraphQLSchema(i)}function S0(e,t,r){var n,i,s,o;let a=[],c=Object.create(null),l=[],p,d=[];for(let O of t.definitions)if(O.kind===Ir.Kind.SCHEMA_DEFINITION)p=O;else if(O.kind===Ir.Kind.SCHEMA_EXTENSION)d.push(O);else if((0,y0.isTypeDefinitionNode)(O))a.push(O);else if((0,y0.isTypeExtensionNode)(O)){let F=O.name.value,V=c[F];c[F]=V?V.concat([O]):[O]}else O.kind===Ir.Kind.DIRECTIVE_DEFINITION&&l.push(O);if(Object.keys(c).length===0&&a.length===0&&l.length===0&&d.length===0&&p==null)return e;let f=Object.create(null);for(let O of e.types)f[O.name]=w(O);for(let O of a){var m;let F=O.name.value;f[F]=(m=T0[F])!==null&&m!==void 0?m:he(O)}let h={query:e.query&&E(e.query),mutation:e.mutation&&E(e.mutation),subscription:e.subscription&&E(e.subscription),...p&&D([p]),...D(d)};return{description:(n=p)===null||n===void 0||(i=n.description)===null||i===void 0?void 0:i.value,...h,types:Object.values(f),directives:[...e.directives.map(A),...l.map(x)],extensions:Object.create(null),astNode:(s=p)!==null&&s!==void 0?s:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(d),assumeValid:(o=r?.assumeValid)!==null&&o!==void 0?o:!1};function v(O){return(0,tt.isListType)(O)?new tt.GraphQLList(v(O.ofType)):(0,tt.isNonNullType)(O)?new tt.GraphQLNonNull(v(O.ofType)):E(O)}function E(O){return f[O.name]}function A(O){let F=O.toConfig();return new Qa.GraphQLDirective({...F,args:(0,Ha.mapValue)(F.args,g)})}function w(O){if((0,x0.isIntrospectionType)(O)||(0,w0.isSpecifiedScalarType)(O))return O;if((0,tt.isScalarType)(O))return C(O);if((0,tt.isObjectType)(O))return R(O);if((0,tt.isInterfaceType)(O))return q(O);if((0,tt.isUnionType)(O))return k(O);if((0,tt.isEnumType)(O))return I(O);if((0,tt.isInputObjectType)(O))return _(O);(0,rG.invariant)(!1,"Unexpected type: "+(0,tG.inspect)(O))}function _(O){var F;let V=O.toConfig(),P=(F=c[V.name])!==null&&F!==void 0?F:[];return new tt.GraphQLInputObjectType({...V,fields:()=>({...(0,Ha.mapValue)(V.fields,we=>({...we,type:v(we.type)})),...J(P)}),extensionASTNodes:V.extensionASTNodes.concat(P)})}function I(O){var F;let V=O.toConfig(),P=(F=c[O.name])!==null&&F!==void 0?F:[];return new tt.GraphQLEnumType({...V,values:{...V.values,...Z(P)},extensionASTNodes:V.extensionASTNodes.concat(P)})}function C(O){var F;let V=O.toConfig(),P=(F=c[V.name])!==null&&F!==void 0?F:[],we=V.specifiedByURL;for(let U of P){var Y;we=(Y=E0(U))!==null&&Y!==void 0?Y:we}return new tt.GraphQLScalarType({...V,specifiedByURL:we,extensionASTNodes:V.extensionASTNodes.concat(P)})}function R(O){var F;let V=O.toConfig(),P=(F=c[V.name])!==null&&F!==void 0?F:[];return new tt.GraphQLObjectType({...V,interfaces:()=>[...O.getInterfaces().map(E),...Te(P)],fields:()=>({...(0,Ha.mapValue)(V.fields,b),...S(P)}),extensionASTNodes:V.extensionASTNodes.concat(P)})}function q(O){var F;let V=O.toConfig(),P=(F=c[V.name])!==null&&F!==void 0?F:[];return new tt.GraphQLInterfaceType({...V,interfaces:()=>[...O.getInterfaces().map(E),...Te(P)],fields:()=>({...(0,Ha.mapValue)(V.fields,b),...S(P)}),extensionASTNodes:V.extensionASTNodes.concat(P)})}function k(O){var F;let V=O.toConfig(),P=(F=c[V.name])!==null&&F!==void 0?F:[];return new tt.GraphQLUnionType({...V,types:()=>[...O.getTypes().map(E),...z(P)],extensionASTNodes:V.extensionASTNodes.concat(P)})}function b(O){return{...O,type:v(O.type),args:O.args&&(0,Ha.mapValue)(O.args,g)}}function g(O){return{...O,type:v(O.type)}}function D(O){let F={};for(let P of O){var V;let we=(V=P.operationTypes)!==null&&V!==void 0?V:[];for(let Y of we)F[Y.operation]=$(Y.type)}return F}function $(O){var F;let V=O.name.value,P=(F=T0[V])!==null&&F!==void 0?F:f[V];if(P===void 0)throw new Error(`Unknown type: "${V}".`);return P}function B(O){return O.kind===Ir.Kind.LIST_TYPE?new tt.GraphQLList(B(O.type)):O.kind===Ir.Kind.NON_NULL_TYPE?new tt.GraphQLNonNull(B(O.type)):$(O)}function x(O){var F;return new Qa.GraphQLDirective({name:O.name.value,description:(F=O.description)===null||F===void 0?void 0:F.value,locations:O.locations.map(({value:V})=>V),isRepeatable:O.repeatable,args:ie(O.arguments),astNode:O})}function S(O){let F=Object.create(null);for(let we of O){var V;let Y=(V=we.fields)!==null&&V!==void 0?V:[];for(let U of Y){var P;F[U.name.value]={type:B(U.type),description:(P=U.description)===null||P===void 0?void 0:P.value,args:ie(U.arguments),deprecationReason:Ll(U),astNode:U}}}return F}function ie(O){let F=O??[],V=Object.create(null);for(let we of F){var P;let Y=B(we.type);V[we.name.value]={type:Y,description:(P=we.description)===null||P===void 0?void 0:P.value,defaultValue:(0,v0.valueFromAST)(we.defaultValue,Y),deprecationReason:Ll(we),astNode:we}}return V}function J(O){let F=Object.create(null);for(let we of O){var V;let Y=(V=we.fields)!==null&&V!==void 0?V:[];for(let U of Y){var P;let me=B(U.type);F[U.name.value]={type:me,description:(P=U.description)===null||P===void 0?void 0:P.value,defaultValue:(0,v0.valueFromAST)(U.defaultValue,me),deprecationReason:Ll(U),astNode:U}}}return F}function Z(O){let F=Object.create(null);for(let we of O){var V;let Y=(V=we.values)!==null&&V!==void 0?V:[];for(let U of Y){var P;F[U.name.value]={description:(P=U.description)===null||P===void 0?void 0:P.value,deprecationReason:Ll(U),astNode:U}}}return F}function Te(O){return O.flatMap(F=>{var V,P;return(V=(P=F.interfaces)===null||P===void 0?void 0:P.map($))!==null&&V!==void 0?V:[]})}function z(O){return O.flatMap(F=>{var V,P;return(V=(P=F.types)===null||P===void 0?void 0:P.map($))!==null&&V!==void 0?V:[]})}function he(O){var F;let V=O.name.value,P=(F=c[V])!==null&&F!==void 0?F:[];switch(O.kind){case Ir.Kind.OBJECT_TYPE_DEFINITION:{var we;let de=[O,...P];return new tt.GraphQLObjectType({name:V,description:(we=O.description)===null||we===void 0?void 0:we.value,interfaces:()=>Te(de),fields:()=>S(de),astNode:O,extensionASTNodes:P})}case Ir.Kind.INTERFACE_TYPE_DEFINITION:{var Y;let de=[O,...P];return new tt.GraphQLInterfaceType({name:V,description:(Y=O.description)===null||Y===void 0?void 0:Y.value,interfaces:()=>Te(de),fields:()=>S(de),astNode:O,extensionASTNodes:P})}case Ir.Kind.ENUM_TYPE_DEFINITION:{var U;let de=[O,...P];return new tt.GraphQLEnumType({name:V,description:(U=O.description)===null||U===void 0?void 0:U.value,values:Z(de),astNode:O,extensionASTNodes:P})}case Ir.Kind.UNION_TYPE_DEFINITION:{var me;let de=[O,...P];return new tt.GraphQLUnionType({name:V,description:(me=O.description)===null||me===void 0?void 0:me.value,types:()=>z(de),astNode:O,extensionASTNodes:P})}case Ir.Kind.SCALAR_TYPE_DEFINITION:{var K;return new tt.GraphQLScalarType({name:V,description:(K=O.description)===null||K===void 0?void 0:K.value,specifiedByURL:E0(O),astNode:O,extensionASTNodes:P})}case Ir.Kind.INPUT_OBJECT_TYPE_DEFINITION:{var le;let de=[O,...P];return new tt.GraphQLInputObjectType({name:V,description:(le=O.description)===null||le===void 0?void 0:le.value,fields:()=>J(de),astNode:O,extensionASTNodes:P,isOneOf:oG(O)})}}}}var T0=(0,nG.keyMap)([...w0.specifiedScalarTypes,...x0.introspectionTypes],e=>e.name);function Ll(e){let t=(0,zy.getDirectiveValues)(Qa.GraphQLDeprecatedDirective,e);return t?.reason}function E0(e){let t=(0,zy.getDirectiveValues)(Qa.GraphQLSpecifiedByDirective,e);return t?.url}function oG(e){return!!(0,zy.getDirectiveValues)(Qa.GraphQLOneOfDirective,e)}});var _0=T(Dl=>{"use strict";u();Object.defineProperty(Dl,"__esModule",{value:!0});Dl.buildASTSchema=O0;Dl.buildSchema=hG;var aG=qt(),cG=Ie(),uG=$i(),lG=Xt(),pG=Bi(),dG=Fa(),fG=Wy();function O0(e,t){e!=null&&e.kind===cG.Kind.DOCUMENT||(0,aG.devAssert)(!1,"Must provide valid Document AST."),t?.assumeValid!==!0&&t?.assumeValidSDL!==!0&&(0,dG.assertValidSDL)(e);let r={description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},n=(0,fG.extendSchemaImpl)(r,e,t);if(n.astNode==null)for(let s of n.types)switch(s.name){case"Query":n.query=s;break;case"Mutation":n.mutation=s;break;case"Subscription":n.subscription=s;break}let i=[...n.directives,...lG.specifiedDirectives.filter(s=>n.directives.every(o=>o.name!==s.name))];return new pG.GraphQLSchema({...n,directives:i})}function hG(e,t){let r=(0,uG.parse)(e,{noLocation:t?.noLocation,allowLegacyFragmentVariables:t?.allowLegacyFragmentVariables});return O0(r,{assumeValidSDL:t?.assumeValidSDL,assumeValid:t?.assumeValid})}});var I0=T(Yy=>{"use strict";u();Object.defineProperty(Yy,"__esModule",{value:!0});Yy.lexicographicSortSchema=EG;var mG=Be(),gG=Ct(),yG=pa(),A0=da(),Ft=Re(),bG=Xt(),vG=Or(),TG=Bi();function EG(e){let t=e.toConfig(),r=(0,yG.keyValMap)(Jy(t.types),f=>f.name,d);return new TG.GraphQLSchema({...t,types:Object.values(r),directives:Jy(t.directives).map(o),query:s(t.query),mutation:s(t.mutation),subscription:s(t.subscription)});function n(f){return(0,Ft.isListType)(f)?new Ft.GraphQLList(n(f.ofType)):(0,Ft.isNonNullType)(f)?new Ft.GraphQLNonNull(n(f.ofType)):i(f)}function i(f){return r[f.name]}function s(f){return f&&i(f)}function o(f){let m=f.toConfig();return new bG.GraphQLDirective({...m,locations:N0(m.locations,h=>h),args:a(m.args)})}function a(f){return $l(f,m=>({...m,type:n(m.type)}))}function c(f){return $l(f,m=>({...m,type:n(m.type),args:m.args&&a(m.args)}))}function l(f){return $l(f,m=>({...m,type:n(m.type)}))}function p(f){return Jy(f).map(i)}function d(f){if((0,Ft.isScalarType)(f)||(0,vG.isIntrospectionType)(f))return f;if((0,Ft.isObjectType)(f)){let m=f.toConfig();return new Ft.GraphQLObjectType({...m,interfaces:()=>p(m.interfaces),fields:()=>c(m.fields)})}if((0,Ft.isInterfaceType)(f)){let m=f.toConfig();return new Ft.GraphQLInterfaceType({...m,interfaces:()=>p(m.interfaces),fields:()=>c(m.fields)})}if((0,Ft.isUnionType)(f)){let m=f.toConfig();return new Ft.GraphQLUnionType({...m,types:()=>p(m.types)})}if((0,Ft.isEnumType)(f)){let m=f.toConfig();return new Ft.GraphQLEnumType({...m,values:$l(m.values,h=>h)})}if((0,Ft.isInputObjectType)(f)){let m=f.toConfig();return new Ft.GraphQLInputObjectType({...m,fields:()=>l(m.fields)})}(0,gG.invariant)(!1,"Unexpected type: "+(0,mG.inspect)(f))}}function $l(e,t){let r=Object.create(null);for(let n of Object.keys(e).sort(A0.naturalCompare))r[n]=t(e[n]);return r}function Jy(e){return N0(e,t=>t.name)}function N0(e,t){return e.slice().sort((r,n)=>{let i=t(r),s=t(n);return(0,A0.naturalCompare)(i,s)})}});var P0=T(za=>{"use strict";u();Object.defineProperty(za,"__esModule",{value:!0});za.printIntrospectionSchema=NG;za.printSchema=AG;za.printType=L0;var xG=Be(),wG=Ct(),SG=ia(),Zy=Ie(),Pl=ur(),so=Re(),eb=Xt(),R0=Or(),OG=pn(),_G=Oa();function AG(e){return C0(e,t=>!(0,eb.isSpecifiedDirective)(t),IG)}function NG(e){return C0(e,eb.isSpecifiedDirective,R0.isIntrospectionType)}function IG(e){return!(0,OG.isSpecifiedScalarType)(e)&&!(0,R0.isIntrospectionType)(e)}function C0(e,t,r){let n=e.getDirectives().filter(t),i=Object.values(e.getTypeMap()).filter(r);return[RG(e),...n.map(s=>qG(s)),...i.map(s=>L0(s))].filter(Boolean).join(`
212
+
213
+ `)}function RG(e){if(e.description==null&&CG(e))return;let t=[],r=e.getQueryType();r&&t.push(` query: ${r.name}`);let n=e.getMutationType();n&&t.push(` mutation: ${n.name}`);let i=e.getSubscriptionType();return i&&t.push(` subscription: ${i.name}`),Rr(e)+`schema {
214
+ ${t.join(`
215
+ `)}
216
+ }`}function CG(e){let t=e.getQueryType();if(t&&t.name!=="Query")return!1;let r=e.getMutationType();if(r&&r.name!=="Mutation")return!1;let n=e.getSubscriptionType();return!(n&&n.name!=="Subscription")}function L0(e){if((0,so.isScalarType)(e))return LG(e);if((0,so.isObjectType)(e))return kG(e);if((0,so.isInterfaceType)(e))return DG(e);if((0,so.isUnionType)(e))return $G(e);if((0,so.isEnumType)(e))return PG(e);if((0,so.isInputObjectType)(e))return jG(e);(0,wG.invariant)(!1,"Unexpected type: "+(0,xG.inspect)(e))}function LG(e){return Rr(e)+`scalar ${e.name}`+FG(e)}function k0(e){let t=e.getInterfaces();return t.length?" implements "+t.map(r=>r.name).join(" & "):""}function kG(e){return Rr(e)+`type ${e.name}`+k0(e)+D0(e)}function DG(e){return Rr(e)+`interface ${e.name}`+k0(e)+D0(e)}function $G(e){let t=e.getTypes(),r=t.length?" = "+t.join(" | "):"";return Rr(e)+"union "+e.name+r}function PG(e){let t=e.getValues().map((r,n)=>Rr(r," ",!n)+" "+r.name+rb(r.deprecationReason));return Rr(e)+`enum ${e.name}`+tb(t)}function jG(e){let t=Object.values(e.getFields()).map((r,n)=>Rr(r," ",!n)+" "+Xy(r));return Rr(e)+`input ${e.name}`+(e.isOneOf?" @oneOf":"")+tb(t)}function D0(e){let t=Object.values(e.getFields()).map((r,n)=>Rr(r," ",!n)+" "+r.name+$0(r.args," ")+": "+String(r.type)+rb(r.deprecationReason));return tb(t)}function tb(e){return e.length!==0?` {
217
+ `+e.join(`
218
+ `)+`
219
+ }`:""}function $0(e,t=""){return e.length===0?"":e.every(r=>!r.description)?"("+e.map(Xy).join(", ")+")":`(
220
+ `+e.map((r,n)=>Rr(r," "+t,!n)+" "+t+Xy(r)).join(`
221
+ `)+`
222
+ `+t+")"}function Xy(e){let t=(0,_G.astFromValue)(e.defaultValue,e.type),r=e.name+": "+String(e.type);return t&&(r+=` = ${(0,Pl.print)(t)}`),r+rb(e.deprecationReason)}function qG(e){return Rr(e)+"directive @"+e.name+$0(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}function rb(e){return e==null?"":e!==eb.DEFAULT_DEPRECATION_REASON?` @deprecated(reason: ${(0,Pl.print)({kind:Zy.Kind.STRING,value:e})})`:" @deprecated"}function FG(e){return e.specifiedByURL==null?"":` @specifiedBy(url: ${(0,Pl.print)({kind:Zy.Kind.STRING,value:e.specifiedByURL})})`}function Rr(e,t="",r=!0){let{description:n}=e;if(n==null)return"";let i=(0,Pl.print)({kind:Zy.Kind.STRING,value:n,block:(0,SG.isPrintableAsBlockString)(n)});return(t&&!r?`
223
+ `+t:t)+i.replace(/\n/g,`
224
+ `+t)+`
225
+ `}});var j0=T(nb=>{"use strict";u();Object.defineProperty(nb,"__esModule",{value:!0});nb.concatAST=UG;var MG=Ie();function UG(e){let t=[];for(let r of e)t.push(...r.definitions);return{kind:MG.Kind.DOCUMENT,definitions:t}}});var M0=T(ib=>{"use strict";u();Object.defineProperty(ib,"__esModule",{value:!0});ib.separateOperations=VG;var jl=Ie(),BG=Pi();function VG(e){let t=[],r=Object.create(null);for(let i of e.definitions)switch(i.kind){case jl.Kind.OPERATION_DEFINITION:t.push(i);break;case jl.Kind.FRAGMENT_DEFINITION:r[i.name.value]=q0(i.selectionSet);break;default:}let n=Object.create(null);for(let i of t){let s=new Set;for(let a of q0(i.selectionSet))F0(s,r,a);let o=i.name?i.name.value:"";n[o]={kind:jl.Kind.DOCUMENT,definitions:e.definitions.filter(a=>a===i||a.kind===jl.Kind.FRAGMENT_DEFINITION&&s.has(a.name.value))}}return n}function F0(e,t,r){if(!e.has(r)){e.add(r);let n=t[r];if(n!==void 0)for(let i of n)F0(e,t,i)}}function q0(e){let t=[];return(0,BG.visit)(e,{FragmentSpread(r){t.push(r.name.value)}}),t}});var V0=T(ob=>{"use strict";u();Object.defineProperty(ob,"__esModule",{value:!0});ob.stripIgnoredCharacters=GG;var KG=ia(),U0=aa(),B0=Ru(),sb=Gs();function GG(e){let t=(0,B0.isSource)(e)?e:new B0.Source(e),r=t.body,n=new U0.Lexer(t),i="",s=!1;for(;n.advance().kind!==sb.TokenKind.EOF;){let o=n.token,a=o.kind,c=!(0,U0.isPunctuatorTokenKind)(o.kind);s&&(c||o.kind===sb.TokenKind.SPREAD)&&(i+=" ");let l=r.slice(o.start,o.end);a===sb.TokenKind.BLOCK_STRING?i+=(0,KG.printBlockString)(o.value,{minimize:!0}):i+=l,s=c}return i}});var G0=T(ql=>{"use strict";u();Object.defineProperty(ql,"__esModule",{value:!0});ql.assertValidName=WG;ql.isValidNameError=K0;var HG=qt(),QG=ue(),zG=fa();function WG(e){let t=K0(e);if(t)throw t;return e}function K0(e){if(typeof e=="string"||(0,HG.devAssert)(!1,"Expected name to be a string."),e.startsWith("__"))return new QG.GraphQLError(`Name "${e}" must not begin with "__", which is reserved by GraphQL introspection.`);try{(0,zG.assertName)(e)}catch(t){return t}}});var Z0=T(mn=>{"use strict";u();Object.defineProperty(mn,"__esModule",{value:!0});mn.DangerousChangeType=mn.BreakingChangeType=void 0;mn.findBreakingChanges=tH;mn.findDangerousChanges=rH;var JG=Be(),Y0=Ct(),H0=si(),YG=ur(),Fe=Re(),XG=pn(),ZG=Oa(),eH=cg(),at;mn.BreakingChangeType=at;(function(e){e.TYPE_REMOVED="TYPE_REMOVED",e.TYPE_CHANGED_KIND="TYPE_CHANGED_KIND",e.TYPE_REMOVED_FROM_UNION="TYPE_REMOVED_FROM_UNION",e.VALUE_REMOVED_FROM_ENUM="VALUE_REMOVED_FROM_ENUM",e.REQUIRED_INPUT_FIELD_ADDED="REQUIRED_INPUT_FIELD_ADDED",e.IMPLEMENTED_INTERFACE_REMOVED="IMPLEMENTED_INTERFACE_REMOVED",e.FIELD_REMOVED="FIELD_REMOVED",e.FIELD_CHANGED_KIND="FIELD_CHANGED_KIND",e.REQUIRED_ARG_ADDED="REQUIRED_ARG_ADDED",e.ARG_REMOVED="ARG_REMOVED",e.ARG_CHANGED_KIND="ARG_CHANGED_KIND",e.DIRECTIVE_REMOVED="DIRECTIVE_REMOVED",e.DIRECTIVE_ARG_REMOVED="DIRECTIVE_ARG_REMOVED",e.REQUIRED_DIRECTIVE_ARG_ADDED="REQUIRED_DIRECTIVE_ARG_ADDED",e.DIRECTIVE_REPEATABLE_REMOVED="DIRECTIVE_REPEATABLE_REMOVED",e.DIRECTIVE_LOCATION_REMOVED="DIRECTIVE_LOCATION_REMOVED"})(at||(mn.BreakingChangeType=at={}));var zr;mn.DangerousChangeType=zr;(function(e){e.VALUE_ADDED_TO_ENUM="VALUE_ADDED_TO_ENUM",e.TYPE_ADDED_TO_UNION="TYPE_ADDED_TO_UNION",e.OPTIONAL_INPUT_FIELD_ADDED="OPTIONAL_INPUT_FIELD_ADDED",e.OPTIONAL_ARG_ADDED="OPTIONAL_ARG_ADDED",e.IMPLEMENTED_INTERFACE_ADDED="IMPLEMENTED_INTERFACE_ADDED",e.ARG_DEFAULT_VALUE_CHANGE="ARG_DEFAULT_VALUE_CHANGE"})(zr||(mn.DangerousChangeType=zr={}));function tH(e,t){return X0(e,t).filter(r=>r.type in at)}function rH(e,t){return X0(e,t).filter(r=>r.type in zr)}function X0(e,t){return[...iH(e,t),...nH(e,t)]}function nH(e,t){let r=[],n=Pn(e.getDirectives(),t.getDirectives());for(let i of n.removed)r.push({type:at.DIRECTIVE_REMOVED,description:`${i.name} was removed.`});for(let[i,s]of n.persisted){let o=Pn(i.args,s.args);for(let a of o.added)(0,Fe.isRequiredArgument)(a)&&r.push({type:at.REQUIRED_DIRECTIVE_ARG_ADDED,description:`A required arg ${a.name} on directive ${i.name} was added.`});for(let a of o.removed)r.push({type:at.DIRECTIVE_ARG_REMOVED,description:`${a.name} was removed from ${i.name}.`});i.isRepeatable&&!s.isRepeatable&&r.push({type:at.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${i.name}.`});for(let a of i.locations)s.locations.includes(a)||r.push({type:at.DIRECTIVE_LOCATION_REMOVED,description:`${a} was removed from ${i.name}.`})}return r}function iH(e,t){let r=[],n=Pn(Object.values(e.getTypeMap()),Object.values(t.getTypeMap()));for(let i of n.removed)r.push({type:at.TYPE_REMOVED,description:(0,XG.isSpecifiedScalarType)(i)?`Standard scalar ${i.name} was removed because it is not referenced anymore.`:`${i.name} was removed.`});for(let[i,s]of n.persisted)(0,Fe.isEnumType)(i)&&(0,Fe.isEnumType)(s)?r.push(...aH(i,s)):(0,Fe.isUnionType)(i)&&(0,Fe.isUnionType)(s)?r.push(...oH(i,s)):(0,Fe.isInputObjectType)(i)&&(0,Fe.isInputObjectType)(s)?r.push(...sH(i,s)):(0,Fe.isObjectType)(i)&&(0,Fe.isObjectType)(s)?r.push(...z0(i,s),...Q0(i,s)):(0,Fe.isInterfaceType)(i)&&(0,Fe.isInterfaceType)(s)?r.push(...z0(i,s),...Q0(i,s)):i.constructor!==s.constructor&&r.push({type:at.TYPE_CHANGED_KIND,description:`${i.name} changed from ${W0(i)} to ${W0(s)}.`});return r}function sH(e,t){let r=[],n=Pn(Object.values(e.getFields()),Object.values(t.getFields()));for(let i of n.added)(0,Fe.isRequiredInputField)(i)?r.push({type:at.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${i.name} on input type ${e.name} was added.`}):r.push({type:zr.OPTIONAL_INPUT_FIELD_ADDED,description:`An optional field ${i.name} on input type ${e.name} was added.`});for(let i of n.removed)r.push({type:at.FIELD_REMOVED,description:`${e.name}.${i.name} was removed.`});for(let[i,s]of n.persisted)Ja(i.type,s.type)||r.push({type:at.FIELD_CHANGED_KIND,description:`${e.name}.${i.name} changed type from ${String(i.type)} to ${String(s.type)}.`});return r}function oH(e,t){let r=[],n=Pn(e.getTypes(),t.getTypes());for(let i of n.added)r.push({type:zr.TYPE_ADDED_TO_UNION,description:`${i.name} was added to union type ${e.name}.`});for(let i of n.removed)r.push({type:at.TYPE_REMOVED_FROM_UNION,description:`${i.name} was removed from union type ${e.name}.`});return r}function aH(e,t){let r=[],n=Pn(e.getValues(),t.getValues());for(let i of n.added)r.push({type:zr.VALUE_ADDED_TO_ENUM,description:`${i.name} was added to enum type ${e.name}.`});for(let i of n.removed)r.push({type:at.VALUE_REMOVED_FROM_ENUM,description:`${i.name} was removed from enum type ${e.name}.`});return r}function Q0(e,t){let r=[],n=Pn(e.getInterfaces(),t.getInterfaces());for(let i of n.added)r.push({type:zr.IMPLEMENTED_INTERFACE_ADDED,description:`${i.name} added to interfaces implemented by ${e.name}.`});for(let i of n.removed)r.push({type:at.IMPLEMENTED_INTERFACE_REMOVED,description:`${e.name} no longer implements interface ${i.name}.`});return r}function z0(e,t){let r=[],n=Pn(Object.values(e.getFields()),Object.values(t.getFields()));for(let i of n.removed)r.push({type:at.FIELD_REMOVED,description:`${e.name}.${i.name} was removed.`});for(let[i,s]of n.persisted)r.push(...cH(e,i,s)),Wa(i.type,s.type)||r.push({type:at.FIELD_CHANGED_KIND,description:`${e.name}.${i.name} changed type from ${String(i.type)} to ${String(s.type)}.`});return r}function cH(e,t,r){let n=[],i=Pn(t.args,r.args);for(let s of i.removed)n.push({type:at.ARG_REMOVED,description:`${e.name}.${t.name} arg ${s.name} was removed.`});for(let[s,o]of i.persisted)if(!Ja(s.type,o.type))n.push({type:at.ARG_CHANGED_KIND,description:`${e.name}.${t.name} arg ${s.name} has changed type from ${String(s.type)} to ${String(o.type)}.`});else if(s.defaultValue!==void 0)if(o.defaultValue===void 0)n.push({type:zr.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${s.name} defaultValue was removed.`});else{let c=J0(s.defaultValue,s.type),l=J0(o.defaultValue,o.type);c!==l&&n.push({type:zr.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${s.name} has changed defaultValue from ${c} to ${l}.`})}for(let s of i.added)(0,Fe.isRequiredArgument)(s)?n.push({type:at.REQUIRED_ARG_ADDED,description:`A required arg ${s.name} on ${e.name}.${t.name} was added.`}):n.push({type:zr.OPTIONAL_ARG_ADDED,description:`An optional arg ${s.name} on ${e.name}.${t.name} was added.`});return n}function Wa(e,t){return(0,Fe.isListType)(e)?(0,Fe.isListType)(t)&&Wa(e.ofType,t.ofType)||(0,Fe.isNonNullType)(t)&&Wa(e,t.ofType):(0,Fe.isNonNullType)(e)?(0,Fe.isNonNullType)(t)&&Wa(e.ofType,t.ofType):(0,Fe.isNamedType)(t)&&e.name===t.name||(0,Fe.isNonNullType)(t)&&Wa(e,t.ofType)}function Ja(e,t){return(0,Fe.isListType)(e)?(0,Fe.isListType)(t)&&Ja(e.ofType,t.ofType):(0,Fe.isNonNullType)(e)?(0,Fe.isNonNullType)(t)&&Ja(e.ofType,t.ofType)||!(0,Fe.isNonNullType)(t)&&Ja(e.ofType,t):(0,Fe.isNamedType)(t)&&e.name===t.name}function W0(e){if((0,Fe.isScalarType)(e))return"a Scalar type";if((0,Fe.isObjectType)(e))return"an Object type";if((0,Fe.isInterfaceType)(e))return"an Interface type";if((0,Fe.isUnionType)(e))return"a Union type";if((0,Fe.isEnumType)(e))return"an Enum type";if((0,Fe.isInputObjectType)(e))return"an Input type";(0,Y0.invariant)(!1,"Unexpected type: "+(0,JG.inspect)(e))}function J0(e,t){let r=(0,ZG.astFromValue)(e,t);return r!=null||(0,Y0.invariant)(!1),(0,YG.print)((0,eH.sortValueNode)(r))}function Pn(e,t){let r=[],n=[],i=[],s=(0,H0.keyMap)(e,({name:a})=>a),o=(0,H0.keyMap)(t,({name:a})=>a);for(let a of e){let c=o[a.name];c===void 0?n.push(a):i.push([a,c])}for(let a of t)s[a.name]===void 0&&r.push(a);return{added:r,persisted:i,removed:n}}});var tA=T(Fl=>{"use strict";u();Object.defineProperty(Fl,"__esModule",{value:!0});Fl.resolveASTSchemaCoordinate=eA;Fl.resolveSchemaCoordinate=lH;var Ji=Be(),Ya=Ie(),uH=$i(),fi=Re();function lH(e,t){return eA(e,(0,uH.parseSchemaCoordinate)(t))}function pH(e,t){let r=t.name.value,n=e.getType(r);if(n!=null)return{kind:"NamedType",type:n}}function dH(e,t){let r=t.name.value,n=e.getType(r);if(!n)throw new Error(`Expected ${(0,Ji.inspect)(r)} to be defined as a type in the schema.`);if(!(0,fi.isEnumType)(n)&&!(0,fi.isInputObjectType)(n)&&!(0,fi.isObjectType)(n)&&!(0,fi.isInterfaceType)(n))throw new Error(`Expected ${(0,Ji.inspect)(r)} to be an Enum, Input Object, Object or Interface type.`);if((0,fi.isEnumType)(n)){let o=t.memberName.value,a=n.getValue(o);return a==null?void 0:{kind:"EnumValue",type:n,enumValue:a}}if((0,fi.isInputObjectType)(n)){let o=t.memberName.value,a=n.getFields()[o];return a==null?void 0:{kind:"InputField",type:n,inputField:a}}let i=t.memberName.value,s=n.getFields()[i];if(s!=null)return{kind:"Field",type:n,field:s}}function fH(e,t){let r=t.name.value,n=e.getType(r);if(n==null)throw new Error(`Expected ${(0,Ji.inspect)(r)} to be defined as a type in the schema.`);if(!(0,fi.isObjectType)(n)&&!(0,fi.isInterfaceType)(n))throw new Error(`Expected ${(0,Ji.inspect)(r)} to be an object type or interface type.`);let i=t.fieldName.value,s=n.getFields()[i];if(s==null)throw new Error(`Expected ${(0,Ji.inspect)(i)} to exist as a field of type ${(0,Ji.inspect)(r)} in the schema.`);let o=t.argumentName.value,a=s.args.find(c=>c.name===o);if(a!=null)return{kind:"FieldArgument",type:n,field:s,fieldArgument:a}}function hH(e,t){let r=t.name.value,n=e.getDirective(r);if(n)return{kind:"Directive",directive:n}}function mH(e,t){let r=t.name.value,n=e.getDirective(r);if(!n)throw new Error(`Expected ${(0,Ji.inspect)(r)} to be defined as a directive in the schema.`);let{argumentName:{value:i}}=t,s=n.args.find(o=>o.name===i);if(s)return{kind:"DirectiveArgument",directive:n,directiveArgument:s}}function eA(e,t){switch(t.kind){case Ya.Kind.TYPE_COORDINATE:return pH(e,t);case Ya.Kind.MEMBER_COORDINATE:return dH(e,t);case Ya.Kind.ARGUMENT_COORDINATE:return fH(e,t);case Ya.Kind.DIRECTIVE_COORDINATE:return hH(e,t);case Ya.Kind.DIRECTIVE_ARGUMENT_COORDINATE:return mH(e,t)}}});var oA=T(De=>{"use strict";u();Object.defineProperty(De,"__esModule",{value:!0});Object.defineProperty(De,"BreakingChangeType",{enumerable:!0,get:function(){return Ml.BreakingChangeType}});Object.defineProperty(De,"DangerousChangeType",{enumerable:!0,get:function(){return Ml.DangerousChangeType}});Object.defineProperty(De,"TypeInfo",{enumerable:!0,get:function(){return nA.TypeInfo}});Object.defineProperty(De,"assertValidName",{enumerable:!0,get:function(){return iA.assertValidName}});Object.defineProperty(De,"astFromValue",{enumerable:!0,get:function(){return _H.astFromValue}});Object.defineProperty(De,"buildASTSchema",{enumerable:!0,get:function(){return rA.buildASTSchema}});Object.defineProperty(De,"buildClientSchema",{enumerable:!0,get:function(){return TH.buildClientSchema}});Object.defineProperty(De,"buildSchema",{enumerable:!0,get:function(){return rA.buildSchema}});Object.defineProperty(De,"coerceInputValue",{enumerable:!0,get:function(){return AH.coerceInputValue}});Object.defineProperty(De,"concatAST",{enumerable:!0,get:function(){return NH.concatAST}});Object.defineProperty(De,"doTypesOverlap",{enumerable:!0,get:function(){return cb.doTypesOverlap}});Object.defineProperty(De,"extendSchema",{enumerable:!0,get:function(){return EH.extendSchema}});Object.defineProperty(De,"findBreakingChanges",{enumerable:!0,get:function(){return Ml.findBreakingChanges}});Object.defineProperty(De,"findDangerousChanges",{enumerable:!0,get:function(){return Ml.findDangerousChanges}});Object.defineProperty(De,"getIntrospectionQuery",{enumerable:!0,get:function(){return gH.getIntrospectionQuery}});Object.defineProperty(De,"getOperationAST",{enumerable:!0,get:function(){return yH.getOperationAST}});Object.defineProperty(De,"getOperationRootType",{enumerable:!0,get:function(){return bH.getOperationRootType}});Object.defineProperty(De,"introspectionFromSchema",{enumerable:!0,get:function(){return vH.introspectionFromSchema}});Object.defineProperty(De,"isEqualType",{enumerable:!0,get:function(){return cb.isEqualType}});Object.defineProperty(De,"isTypeSubTypeOf",{enumerable:!0,get:function(){return cb.isTypeSubTypeOf}});Object.defineProperty(De,"isValidNameError",{enumerable:!0,get:function(){return iA.isValidNameError}});Object.defineProperty(De,"lexicographicSortSchema",{enumerable:!0,get:function(){return xH.lexicographicSortSchema}});Object.defineProperty(De,"printIntrospectionSchema",{enumerable:!0,get:function(){return ab.printIntrospectionSchema}});Object.defineProperty(De,"printSchema",{enumerable:!0,get:function(){return ab.printSchema}});Object.defineProperty(De,"printType",{enumerable:!0,get:function(){return ab.printType}});Object.defineProperty(De,"resolveASTSchemaCoordinate",{enumerable:!0,get:function(){return sA.resolveASTSchemaCoordinate}});Object.defineProperty(De,"resolveSchemaCoordinate",{enumerable:!0,get:function(){return sA.resolveSchemaCoordinate}});Object.defineProperty(De,"separateOperations",{enumerable:!0,get:function(){return IH.separateOperations}});Object.defineProperty(De,"stripIgnoredCharacters",{enumerable:!0,get:function(){return RH.stripIgnoredCharacters}});Object.defineProperty(De,"typeFromAST",{enumerable:!0,get:function(){return wH.typeFromAST}});Object.defineProperty(De,"valueFromAST",{enumerable:!0,get:function(){return SH.valueFromAST}});Object.defineProperty(De,"valueFromASTUntyped",{enumerable:!0,get:function(){return OH.valueFromASTUntyped}});Object.defineProperty(De,"visitWithTypeInfo",{enumerable:!0,get:function(){return nA.visitWithTypeInfo}});var gH=Vy(),yH=d0(),bH=f0(),vH=h0(),TH=g0(),rA=_0(),EH=Wy(),xH=I0(),ab=P0(),wH=dn(),SH=$a(),OH=im(),_H=Oa(),nA=sl(),AH=Rg(),NH=j0(),IH=M0(),RH=V0(),cb=ba(),iA=G0(),Ml=Z0(),sA=tA()});var Ul=T(y=>{"use strict";u();Object.defineProperty(y,"__esModule",{value:!0});Object.defineProperty(y,"BREAK",{enumerable:!0,get:function(){return Pe.BREAK}});Object.defineProperty(y,"BreakingChangeType",{enumerable:!0,get:function(){return je.BreakingChangeType}});Object.defineProperty(y,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return Q.DEFAULT_DEPRECATION_REASON}});Object.defineProperty(y,"DangerousChangeType",{enumerable:!0,get:function(){return je.DangerousChangeType}});Object.defineProperty(y,"DirectiveLocation",{enumerable:!0,get:function(){return Pe.DirectiveLocation}});Object.defineProperty(y,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return xe.ExecutableDefinitionsRule}});Object.defineProperty(y,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return xe.FieldsOnCorrectTypeRule}});Object.defineProperty(y,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return xe.FragmentsOnCompositeTypesRule}});Object.defineProperty(y,"GRAPHQL_MAX_INT",{enumerable:!0,get:function(){return Q.GRAPHQL_MAX_INT}});Object.defineProperty(y,"GRAPHQL_MIN_INT",{enumerable:!0,get:function(){return Q.GRAPHQL_MIN_INT}});Object.defineProperty(y,"GraphQLBoolean",{enumerable:!0,get:function(){return Q.GraphQLBoolean}});Object.defineProperty(y,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return Q.GraphQLDeprecatedDirective}});Object.defineProperty(y,"GraphQLDirective",{enumerable:!0,get:function(){return Q.GraphQLDirective}});Object.defineProperty(y,"GraphQLEnumType",{enumerable:!0,get:function(){return Q.GraphQLEnumType}});Object.defineProperty(y,"GraphQLError",{enumerable:!0,get:function(){return Xa.GraphQLError}});Object.defineProperty(y,"GraphQLFloat",{enumerable:!0,get:function(){return Q.GraphQLFloat}});Object.defineProperty(y,"GraphQLID",{enumerable:!0,get:function(){return Q.GraphQLID}});Object.defineProperty(y,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return Q.GraphQLIncludeDirective}});Object.defineProperty(y,"GraphQLInputObjectType",{enumerable:!0,get:function(){return Q.GraphQLInputObjectType}});Object.defineProperty(y,"GraphQLInt",{enumerable:!0,get:function(){return Q.GraphQLInt}});Object.defineProperty(y,"GraphQLInterfaceType",{enumerable:!0,get:function(){return Q.GraphQLInterfaceType}});Object.defineProperty(y,"GraphQLList",{enumerable:!0,get:function(){return Q.GraphQLList}});Object.defineProperty(y,"GraphQLNonNull",{enumerable:!0,get:function(){return Q.GraphQLNonNull}});Object.defineProperty(y,"GraphQLObjectType",{enumerable:!0,get:function(){return Q.GraphQLObjectType}});Object.defineProperty(y,"GraphQLOneOfDirective",{enumerable:!0,get:function(){return Q.GraphQLOneOfDirective}});Object.defineProperty(y,"GraphQLScalarType",{enumerable:!0,get:function(){return Q.GraphQLScalarType}});Object.defineProperty(y,"GraphQLSchema",{enumerable:!0,get:function(){return Q.GraphQLSchema}});Object.defineProperty(y,"GraphQLSkipDirective",{enumerable:!0,get:function(){return Q.GraphQLSkipDirective}});Object.defineProperty(y,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return Q.GraphQLSpecifiedByDirective}});Object.defineProperty(y,"GraphQLString",{enumerable:!0,get:function(){return Q.GraphQLString}});Object.defineProperty(y,"GraphQLUnionType",{enumerable:!0,get:function(){return Q.GraphQLUnionType}});Object.defineProperty(y,"Kind",{enumerable:!0,get:function(){return Pe.Kind}});Object.defineProperty(y,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return xe.KnownArgumentNamesRule}});Object.defineProperty(y,"KnownDirectivesRule",{enumerable:!0,get:function(){return xe.KnownDirectivesRule}});Object.defineProperty(y,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return xe.KnownFragmentNamesRule}});Object.defineProperty(y,"KnownTypeNamesRule",{enumerable:!0,get:function(){return xe.KnownTypeNamesRule}});Object.defineProperty(y,"Lexer",{enumerable:!0,get:function(){return Pe.Lexer}});Object.defineProperty(y,"Location",{enumerable:!0,get:function(){return Pe.Location}});Object.defineProperty(y,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return xe.LoneAnonymousOperationRule}});Object.defineProperty(y,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return xe.LoneSchemaDefinitionRule}});Object.defineProperty(y,"MaxIntrospectionDepthRule",{enumerable:!0,get:function(){return xe.MaxIntrospectionDepthRule}});Object.defineProperty(y,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return xe.NoDeprecatedCustomRule}});Object.defineProperty(y,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return xe.NoFragmentCyclesRule}});Object.defineProperty(y,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return xe.NoSchemaIntrospectionCustomRule}});Object.defineProperty(y,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return xe.NoUndefinedVariablesRule}});Object.defineProperty(y,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return xe.NoUnusedFragmentsRule}});Object.defineProperty(y,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return xe.NoUnusedVariablesRule}});Object.defineProperty(y,"OperationTypeNode",{enumerable:!0,get:function(){return Pe.OperationTypeNode}});Object.defineProperty(y,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return xe.OverlappingFieldsCanBeMergedRule}});Object.defineProperty(y,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return xe.PossibleFragmentSpreadsRule}});Object.defineProperty(y,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return xe.PossibleTypeExtensionsRule}});Object.defineProperty(y,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return xe.ProvidedRequiredArgumentsRule}});Object.defineProperty(y,"ScalarLeafsRule",{enumerable:!0,get:function(){return xe.ScalarLeafsRule}});Object.defineProperty(y,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return Q.SchemaMetaFieldDef}});Object.defineProperty(y,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return xe.SingleFieldSubscriptionsRule}});Object.defineProperty(y,"Source",{enumerable:!0,get:function(){return Pe.Source}});Object.defineProperty(y,"Token",{enumerable:!0,get:function(){return Pe.Token}});Object.defineProperty(y,"TokenKind",{enumerable:!0,get:function(){return Pe.TokenKind}});Object.defineProperty(y,"TypeInfo",{enumerable:!0,get:function(){return je.TypeInfo}});Object.defineProperty(y,"TypeKind",{enumerable:!0,get:function(){return Q.TypeKind}});Object.defineProperty(y,"TypeMetaFieldDef",{enumerable:!0,get:function(){return Q.TypeMetaFieldDef}});Object.defineProperty(y,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return Q.TypeNameMetaFieldDef}});Object.defineProperty(y,"UniqueArgumentDefinitionNamesRule",{enumerable:!0,get:function(){return xe.UniqueArgumentDefinitionNamesRule}});Object.defineProperty(y,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return xe.UniqueArgumentNamesRule}});Object.defineProperty(y,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return xe.UniqueDirectiveNamesRule}});Object.defineProperty(y,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return xe.UniqueDirectivesPerLocationRule}});Object.defineProperty(y,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return xe.UniqueEnumValueNamesRule}});Object.defineProperty(y,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return xe.UniqueFieldDefinitionNamesRule}});Object.defineProperty(y,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return xe.UniqueFragmentNamesRule}});Object.defineProperty(y,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return xe.UniqueInputFieldNamesRule}});Object.defineProperty(y,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return xe.UniqueOperationNamesRule}});Object.defineProperty(y,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return xe.UniqueOperationTypesRule}});Object.defineProperty(y,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return xe.UniqueTypeNamesRule}});Object.defineProperty(y,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return xe.UniqueVariableNamesRule}});Object.defineProperty(y,"ValidationContext",{enumerable:!0,get:function(){return xe.ValidationContext}});Object.defineProperty(y,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return xe.ValuesOfCorrectTypeRule}});Object.defineProperty(y,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return xe.VariablesAreInputTypesRule}});Object.defineProperty(y,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return xe.VariablesInAllowedPositionRule}});Object.defineProperty(y,"__Directive",{enumerable:!0,get:function(){return Q.__Directive}});Object.defineProperty(y,"__DirectiveLocation",{enumerable:!0,get:function(){return Q.__DirectiveLocation}});Object.defineProperty(y,"__EnumValue",{enumerable:!0,get:function(){return Q.__EnumValue}});Object.defineProperty(y,"__Field",{enumerable:!0,get:function(){return Q.__Field}});Object.defineProperty(y,"__InputValue",{enumerable:!0,get:function(){return Q.__InputValue}});Object.defineProperty(y,"__Schema",{enumerable:!0,get:function(){return Q.__Schema}});Object.defineProperty(y,"__Type",{enumerable:!0,get:function(){return Q.__Type}});Object.defineProperty(y,"__TypeKind",{enumerable:!0,get:function(){return Q.__TypeKind}});Object.defineProperty(y,"assertAbstractType",{enumerable:!0,get:function(){return Q.assertAbstractType}});Object.defineProperty(y,"assertCompositeType",{enumerable:!0,get:function(){return Q.assertCompositeType}});Object.defineProperty(y,"assertDirective",{enumerable:!0,get:function(){return Q.assertDirective}});Object.defineProperty(y,"assertEnumType",{enumerable:!0,get:function(){return Q.assertEnumType}});Object.defineProperty(y,"assertEnumValueName",{enumerable:!0,get:function(){return Q.assertEnumValueName}});Object.defineProperty(y,"assertInputObjectType",{enumerable:!0,get:function(){return Q.assertInputObjectType}});Object.defineProperty(y,"assertInputType",{enumerable:!0,get:function(){return Q.assertInputType}});Object.defineProperty(y,"assertInterfaceType",{enumerable:!0,get:function(){return Q.assertInterfaceType}});Object.defineProperty(y,"assertLeafType",{enumerable:!0,get:function(){return Q.assertLeafType}});Object.defineProperty(y,"assertListType",{enumerable:!0,get:function(){return Q.assertListType}});Object.defineProperty(y,"assertName",{enumerable:!0,get:function(){return Q.assertName}});Object.defineProperty(y,"assertNamedType",{enumerable:!0,get:function(){return Q.assertNamedType}});Object.defineProperty(y,"assertNonNullType",{enumerable:!0,get:function(){return Q.assertNonNullType}});Object.defineProperty(y,"assertNullableType",{enumerable:!0,get:function(){return Q.assertNullableType}});Object.defineProperty(y,"assertObjectType",{enumerable:!0,get:function(){return Q.assertObjectType}});Object.defineProperty(y,"assertOutputType",{enumerable:!0,get:function(){return Q.assertOutputType}});Object.defineProperty(y,"assertScalarType",{enumerable:!0,get:function(){return Q.assertScalarType}});Object.defineProperty(y,"assertSchema",{enumerable:!0,get:function(){return Q.assertSchema}});Object.defineProperty(y,"assertType",{enumerable:!0,get:function(){return Q.assertType}});Object.defineProperty(y,"assertUnionType",{enumerable:!0,get:function(){return Q.assertUnionType}});Object.defineProperty(y,"assertValidName",{enumerable:!0,get:function(){return je.assertValidName}});Object.defineProperty(y,"assertValidSchema",{enumerable:!0,get:function(){return Q.assertValidSchema}});Object.defineProperty(y,"assertWrappingType",{enumerable:!0,get:function(){return Q.assertWrappingType}});Object.defineProperty(y,"astFromValue",{enumerable:!0,get:function(){return je.astFromValue}});Object.defineProperty(y,"buildASTSchema",{enumerable:!0,get:function(){return je.buildASTSchema}});Object.defineProperty(y,"buildClientSchema",{enumerable:!0,get:function(){return je.buildClientSchema}});Object.defineProperty(y,"buildSchema",{enumerable:!0,get:function(){return je.buildSchema}});Object.defineProperty(y,"coerceInputValue",{enumerable:!0,get:function(){return je.coerceInputValue}});Object.defineProperty(y,"concatAST",{enumerable:!0,get:function(){return je.concatAST}});Object.defineProperty(y,"createSourceEventStream",{enumerable:!0,get:function(){return gn.createSourceEventStream}});Object.defineProperty(y,"defaultFieldResolver",{enumerable:!0,get:function(){return gn.defaultFieldResolver}});Object.defineProperty(y,"defaultTypeResolver",{enumerable:!0,get:function(){return gn.defaultTypeResolver}});Object.defineProperty(y,"doTypesOverlap",{enumerable:!0,get:function(){return je.doTypesOverlap}});Object.defineProperty(y,"execute",{enumerable:!0,get:function(){return gn.execute}});Object.defineProperty(y,"executeSync",{enumerable:!0,get:function(){return gn.executeSync}});Object.defineProperty(y,"extendSchema",{enumerable:!0,get:function(){return je.extendSchema}});Object.defineProperty(y,"findBreakingChanges",{enumerable:!0,get:function(){return je.findBreakingChanges}});Object.defineProperty(y,"findDangerousChanges",{enumerable:!0,get:function(){return je.findDangerousChanges}});Object.defineProperty(y,"formatError",{enumerable:!0,get:function(){return Xa.formatError}});Object.defineProperty(y,"getArgumentValues",{enumerable:!0,get:function(){return gn.getArgumentValues}});Object.defineProperty(y,"getDirectiveValues",{enumerable:!0,get:function(){return gn.getDirectiveValues}});Object.defineProperty(y,"getEnterLeaveForKind",{enumerable:!0,get:function(){return Pe.getEnterLeaveForKind}});Object.defineProperty(y,"getIntrospectionQuery",{enumerable:!0,get:function(){return je.getIntrospectionQuery}});Object.defineProperty(y,"getLocation",{enumerable:!0,get:function(){return Pe.getLocation}});Object.defineProperty(y,"getNamedType",{enumerable:!0,get:function(){return Q.getNamedType}});Object.defineProperty(y,"getNullableType",{enumerable:!0,get:function(){return Q.getNullableType}});Object.defineProperty(y,"getOperationAST",{enumerable:!0,get:function(){return je.getOperationAST}});Object.defineProperty(y,"getOperationRootType",{enumerable:!0,get:function(){return je.getOperationRootType}});Object.defineProperty(y,"getVariableValues",{enumerable:!0,get:function(){return gn.getVariableValues}});Object.defineProperty(y,"getVisitFn",{enumerable:!0,get:function(){return Pe.getVisitFn}});Object.defineProperty(y,"graphql",{enumerable:!0,get:function(){return cA.graphql}});Object.defineProperty(y,"graphqlSync",{enumerable:!0,get:function(){return cA.graphqlSync}});Object.defineProperty(y,"introspectionFromSchema",{enumerable:!0,get:function(){return je.introspectionFromSchema}});Object.defineProperty(y,"introspectionTypes",{enumerable:!0,get:function(){return Q.introspectionTypes}});Object.defineProperty(y,"isAbstractType",{enumerable:!0,get:function(){return Q.isAbstractType}});Object.defineProperty(y,"isCompositeType",{enumerable:!0,get:function(){return Q.isCompositeType}});Object.defineProperty(y,"isConstValueNode",{enumerable:!0,get:function(){return Pe.isConstValueNode}});Object.defineProperty(y,"isDefinitionNode",{enumerable:!0,get:function(){return Pe.isDefinitionNode}});Object.defineProperty(y,"isDirective",{enumerable:!0,get:function(){return Q.isDirective}});Object.defineProperty(y,"isEnumType",{enumerable:!0,get:function(){return Q.isEnumType}});Object.defineProperty(y,"isEqualType",{enumerable:!0,get:function(){return je.isEqualType}});Object.defineProperty(y,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return Pe.isExecutableDefinitionNode}});Object.defineProperty(y,"isInputObjectType",{enumerable:!0,get:function(){return Q.isInputObjectType}});Object.defineProperty(y,"isInputType",{enumerable:!0,get:function(){return Q.isInputType}});Object.defineProperty(y,"isInterfaceType",{enumerable:!0,get:function(){return Q.isInterfaceType}});Object.defineProperty(y,"isIntrospectionType",{enumerable:!0,get:function(){return Q.isIntrospectionType}});Object.defineProperty(y,"isLeafType",{enumerable:!0,get:function(){return Q.isLeafType}});Object.defineProperty(y,"isListType",{enumerable:!0,get:function(){return Q.isListType}});Object.defineProperty(y,"isNamedType",{enumerable:!0,get:function(){return Q.isNamedType}});Object.defineProperty(y,"isNonNullType",{enumerable:!0,get:function(){return Q.isNonNullType}});Object.defineProperty(y,"isNullableType",{enumerable:!0,get:function(){return Q.isNullableType}});Object.defineProperty(y,"isObjectType",{enumerable:!0,get:function(){return Q.isObjectType}});Object.defineProperty(y,"isOutputType",{enumerable:!0,get:function(){return Q.isOutputType}});Object.defineProperty(y,"isRequiredArgument",{enumerable:!0,get:function(){return Q.isRequiredArgument}});Object.defineProperty(y,"isRequiredInputField",{enumerable:!0,get:function(){return Q.isRequiredInputField}});Object.defineProperty(y,"isScalarType",{enumerable:!0,get:function(){return Q.isScalarType}});Object.defineProperty(y,"isSchema",{enumerable:!0,get:function(){return Q.isSchema}});Object.defineProperty(y,"isSchemaCoordinateNode",{enumerable:!0,get:function(){return Pe.isSchemaCoordinateNode}});Object.defineProperty(y,"isSelectionNode",{enumerable:!0,get:function(){return Pe.isSelectionNode}});Object.defineProperty(y,"isSpecifiedDirective",{enumerable:!0,get:function(){return Q.isSpecifiedDirective}});Object.defineProperty(y,"isSpecifiedScalarType",{enumerable:!0,get:function(){return Q.isSpecifiedScalarType}});Object.defineProperty(y,"isType",{enumerable:!0,get:function(){return Q.isType}});Object.defineProperty(y,"isTypeDefinitionNode",{enumerable:!0,get:function(){return Pe.isTypeDefinitionNode}});Object.defineProperty(y,"isTypeExtensionNode",{enumerable:!0,get:function(){return Pe.isTypeExtensionNode}});Object.defineProperty(y,"isTypeNode",{enumerable:!0,get:function(){return Pe.isTypeNode}});Object.defineProperty(y,"isTypeSubTypeOf",{enumerable:!0,get:function(){return je.isTypeSubTypeOf}});Object.defineProperty(y,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return Pe.isTypeSystemDefinitionNode}});Object.defineProperty(y,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return Pe.isTypeSystemExtensionNode}});Object.defineProperty(y,"isUnionType",{enumerable:!0,get:function(){return Q.isUnionType}});Object.defineProperty(y,"isValidNameError",{enumerable:!0,get:function(){return je.isValidNameError}});Object.defineProperty(y,"isValueNode",{enumerable:!0,get:function(){return Pe.isValueNode}});Object.defineProperty(y,"isWrappingType",{enumerable:!0,get:function(){return Q.isWrappingType}});Object.defineProperty(y,"lexicographicSortSchema",{enumerable:!0,get:function(){return je.lexicographicSortSchema}});Object.defineProperty(y,"locatedError",{enumerable:!0,get:function(){return Xa.locatedError}});Object.defineProperty(y,"parse",{enumerable:!0,get:function(){return Pe.parse}});Object.defineProperty(y,"parseConstValue",{enumerable:!0,get:function(){return Pe.parseConstValue}});Object.defineProperty(y,"parseSchemaCoordinate",{enumerable:!0,get:function(){return Pe.parseSchemaCoordinate}});Object.defineProperty(y,"parseType",{enumerable:!0,get:function(){return Pe.parseType}});Object.defineProperty(y,"parseValue",{enumerable:!0,get:function(){return Pe.parseValue}});Object.defineProperty(y,"print",{enumerable:!0,get:function(){return Pe.print}});Object.defineProperty(y,"printError",{enumerable:!0,get:function(){return Xa.printError}});Object.defineProperty(y,"printIntrospectionSchema",{enumerable:!0,get:function(){return je.printIntrospectionSchema}});Object.defineProperty(y,"printLocation",{enumerable:!0,get:function(){return Pe.printLocation}});Object.defineProperty(y,"printSchema",{enumerable:!0,get:function(){return je.printSchema}});Object.defineProperty(y,"printSourceLocation",{enumerable:!0,get:function(){return Pe.printSourceLocation}});Object.defineProperty(y,"printType",{enumerable:!0,get:function(){return je.printType}});Object.defineProperty(y,"recommendedRules",{enumerable:!0,get:function(){return xe.recommendedRules}});Object.defineProperty(y,"resolveASTSchemaCoordinate",{enumerable:!0,get:function(){return je.resolveASTSchemaCoordinate}});Object.defineProperty(y,"resolveObjMapThunk",{enumerable:!0,get:function(){return Q.resolveObjMapThunk}});Object.defineProperty(y,"resolveReadonlyArrayThunk",{enumerable:!0,get:function(){return Q.resolveReadonlyArrayThunk}});Object.defineProperty(y,"resolveSchemaCoordinate",{enumerable:!0,get:function(){return je.resolveSchemaCoordinate}});Object.defineProperty(y,"responsePathAsArray",{enumerable:!0,get:function(){return gn.responsePathAsArray}});Object.defineProperty(y,"separateOperations",{enumerable:!0,get:function(){return je.separateOperations}});Object.defineProperty(y,"specifiedDirectives",{enumerable:!0,get:function(){return Q.specifiedDirectives}});Object.defineProperty(y,"specifiedRules",{enumerable:!0,get:function(){return xe.specifiedRules}});Object.defineProperty(y,"specifiedScalarTypes",{enumerable:!0,get:function(){return Q.specifiedScalarTypes}});Object.defineProperty(y,"stripIgnoredCharacters",{enumerable:!0,get:function(){return je.stripIgnoredCharacters}});Object.defineProperty(y,"subscribe",{enumerable:!0,get:function(){return gn.subscribe}});Object.defineProperty(y,"syntaxError",{enumerable:!0,get:function(){return Xa.syntaxError}});Object.defineProperty(y,"typeFromAST",{enumerable:!0,get:function(){return je.typeFromAST}});Object.defineProperty(y,"validate",{enumerable:!0,get:function(){return xe.validate}});Object.defineProperty(y,"validateSchema",{enumerable:!0,get:function(){return Q.validateSchema}});Object.defineProperty(y,"valueFromAST",{enumerable:!0,get:function(){return je.valueFromAST}});Object.defineProperty(y,"valueFromASTUntyped",{enumerable:!0,get:function(){return je.valueFromASTUntyped}});Object.defineProperty(y,"version",{enumerable:!0,get:function(){return aA.version}});Object.defineProperty(y,"versionInfo",{enumerable:!0,get:function(){return aA.versionInfo}});Object.defineProperty(y,"visit",{enumerable:!0,get:function(){return Pe.visit}});Object.defineProperty(y,"visitInParallel",{enumerable:!0,get:function(){return Pe.visitInParallel}});Object.defineProperty(y,"visitWithTypeInfo",{enumerable:!0,get:function(){return je.visitWithTypeInfo}});var aA=tS(),cA=Q_(),Q=J_(),Pe=X_(),gn=o0(),xe=l0(),Xa=p0(),je=oA()});var tN=T((Lfe,eN)=>{"use strict";u();var Tb=Object.defineProperty,i2=Object.getOwnPropertyDescriptor,s2=Object.getOwnPropertyNames,o2=Object.prototype.hasOwnProperty,a2=(e,t)=>{for(var r in t)Tb(e,r,{get:t[r],enumerable:!0})},c2=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of s2(t))!o2.call(e,i)&&i!==r&&Tb(e,i,{get:()=>t[i],enumerable:!(n=i2(t,i))||n.enumerable});return e},u2=e=>c2(Tb({},"__esModule",{value:!0}),e),oc={};a2(oc,{analyzeMetafile:()=>q2,analyzeMetafileSync:()=>B2,build:()=>D2,buildSync:()=>F2,context:()=>$2,default:()=>H2,formatMessages:()=>j2,formatMessagesSync:()=>U2,initialize:()=>K2,stop:()=>V2,transform:()=>P2,transformSync:()=>M2,version:()=>k2});eN.exports=u2(oc);function RA(e){let t=n=>{if(n===null)r.write8(0);else if(typeof n=="boolean")r.write8(1),r.write8(+n);else if(typeof n=="number")r.write8(2),r.write32(n|0);else if(typeof n=="string")r.write8(3),r.write(Yr(n));else if(n instanceof Uint8Array)r.write8(4),r.write(n);else if(n instanceof Array){r.write8(5),r.write32(n.length);for(let i of n)t(i)}else{let i=Object.keys(n);r.write8(6),r.write32(i.length);for(let s of i)r.write(Yr(s)),t(n[s])}},r=new MA;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),yb(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function l2(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return co(r.read());case 4:return r.read();case 5:{let o=r.read32(),a=[];for(let c=0;c<o;c++)a.push(t());return a}case 6:{let o=r.read32(),a={};for(let c=0;c<o;c++)a[co(r.read())]=t();return a}default:throw new Error("Invalid packet")}},r=new MA(e),n=r.read32(),i=(n&1)===0;n>>>=1;let s=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return{id:n,isRequest:i,value:s}}var MA=class{constructor(e=new Uint8Array(1024)){this.buf=e,this.len=0,this.ptr=0}_write(e){if(this.len+e>this.buf.length){let t=new Uint8Array((this.len+e)*2);t.set(this.buf),this.buf=t}return this.len+=e,this.len-e}write8(e){let t=this._write(1);this.buf[t]=e}write32(e){let t=this._write(4);yb(this.buf,e,t)}write(e){let t=this._write(4+e.length);yb(this.buf,e.length,t),this.buf.set(e,t+4)}_read(e){if(this.ptr+e>this.buf.length)throw new Error("Invalid packet");return this.ptr+=e,this.ptr-e}read8(){return this.buf[this._read(1)]}read32(){return UA(this.buf,this._read(4))}read(){let e=this.read32(),t=new Uint8Array(e),r=this._read(t.length);return t.set(this.buf.subarray(r,r+e)),t}},Yr,co,gb;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let e=new TextEncoder,t=new TextDecoder;Yr=r=>e.encode(r),co=r=>t.decode(r),gb='new TextEncoder().encode("")'}else if(typeof Buffer<"u")Yr=e=>Buffer.from(e),co=e=>{let{buffer:t,byteOffset:r,byteLength:n}=e;return Buffer.from(t,r,n).toString()},gb='Buffer.from("")';else throw new Error("No UTF-8 codec found");if(!(Yr("")instanceof Uint8Array))throw new Error(`Invariant violation: "${gb} instanceof Uint8Array" is incorrectly false
226
+
227
+ This indicates that your JavaScript environment is broken. You cannot use
228
+ esbuild in this environment because esbuild relies on this invariant. This
229
+ is not a problem with esbuild. You need to fix your environment instead.
230
+ `);function UA(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function yb(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24}var mt=JSON.stringify,CA="warning",LA="silent";function ao(e,t){let r=[];for(let n of e){if(tr(n,t),n.indexOf(",")>=0)throw new Error(`Invalid ${t}: ${n}`);r.push(n)}return r.join(",")}var Xl=()=>null,rt=e=>typeof e=="boolean"?null:"a boolean",oe=e=>typeof e=="string"?null:"a string",Zl=e=>e instanceof RegExp?null:"a RegExp object",Xi=e=>typeof e=="number"&&e===(e|0)?null:"an integer",p2=e=>typeof e=="number"&&e===(e|0)&&e>=0&&e<=65535?null:"a valid port number",BA=e=>typeof e=="function"?null:"a function",jn=e=>Array.isArray(e)?null:"an array",rr=e=>Array.isArray(e)&&e.every(t=>typeof t=="string")?null:"an array of strings",fr=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",d2=e=>typeof e=="object"&&e!==null?null:"an array or an object",f2=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",kA=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",VA=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",h2=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",KA=e=>typeof e=="string"||Array.isArray(e)&&e.every(t=>typeof t=="string")?null:"a string or an array of strings",GA=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array",m2=e=>typeof e=="string"||e instanceof URL?null:"a string or a URL";function N(e,t,r,n){let i=e[r];if(t[r+""]=!0,i===void 0)return;let s=n(i);if(s!==null)throw new Error(`${mt(r)} must be ${s}`);return i}function pt(e,t,r){for(let n in e)if(!(n in t))throw new Error(`Invalid option ${r}: ${mt(n)}`)}function g2(e){let t=Object.create(null),r=N(e,t,"wasmURL",m2),n=N(e,t,"wasmModule",f2),i=N(e,t,"worker",rt);return pt(e,t,"in initialize() call"),{wasmURL:r,wasmModule:n,worker:i}}function HA(e){let t;if(e!==void 0){t=Object.create(null);for(let r in e){let n=e[r];if(typeof n=="string"||n===!1)t[r]=n;else throw new Error(`Expected ${mt(r)} in mangle cache to map to either a string or false`)}}return t}function ip(e,t,r,n,i){let s=N(t,r,"color",rt),o=N(t,r,"logLevel",oe),a=N(t,r,"logLimit",Xi);s!==void 0?e.push(`--color=${s}`):n&&e.push("--color=true"),e.push(`--log-level=${o||i}`),e.push(`--log-limit=${a||0}`)}function tr(e,t,r){if(typeof e!="string")throw new Error(`Expected value for ${t}${r!==void 0?" "+mt(r):""} to be a string, got ${typeof e} instead`);return e}function QA(e,t,r){let n=N(t,r,"legalComments",oe),i=N(t,r,"sourceRoot",oe),s=N(t,r,"sourcesContent",rt),o=N(t,r,"target",KA),a=N(t,r,"format",oe),c=N(t,r,"globalName",oe),l=N(t,r,"mangleProps",Zl),p=N(t,r,"reserveProps",Zl),d=N(t,r,"mangleQuoted",rt),f=N(t,r,"minify",rt),m=N(t,r,"minifySyntax",rt),h=N(t,r,"minifyWhitespace",rt),v=N(t,r,"minifyIdentifiers",rt),E=N(t,r,"lineLimit",Xi),A=N(t,r,"drop",rr),w=N(t,r,"dropLabels",rr),_=N(t,r,"charset",oe),I=N(t,r,"treeShaking",rt),C=N(t,r,"ignoreAnnotations",rt),R=N(t,r,"jsx",oe),q=N(t,r,"jsxFactory",oe),k=N(t,r,"jsxFragment",oe),b=N(t,r,"jsxImportSource",oe),g=N(t,r,"jsxDev",rt),D=N(t,r,"jsxSideEffects",rt),$=N(t,r,"define",fr),B=N(t,r,"logOverride",fr),x=N(t,r,"supported",fr),S=N(t,r,"pure",rr),ie=N(t,r,"keepNames",rt),J=N(t,r,"platform",oe),Z=N(t,r,"tsconfigRaw",h2),Te=N(t,r,"absPaths",rr);if(n&&e.push(`--legal-comments=${n}`),i!==void 0&&e.push(`--source-root=${i}`),s!==void 0&&e.push(`--sources-content=${s}`),o&&e.push(`--target=${ao(Array.isArray(o)?o:[o],"target")}`),a&&e.push(`--format=${a}`),c&&e.push(`--global-name=${c}`),J&&e.push(`--platform=${J}`),Z&&e.push(`--tsconfig-raw=${typeof Z=="string"?Z:JSON.stringify(Z)}`),f&&e.push("--minify"),m&&e.push("--minify-syntax"),h&&e.push("--minify-whitespace"),v&&e.push("--minify-identifiers"),E&&e.push(`--line-limit=${E}`),_&&e.push(`--charset=${_}`),I!==void 0&&e.push(`--tree-shaking=${I}`),C&&e.push("--ignore-annotations"),A)for(let z of A)e.push(`--drop:${tr(z,"drop")}`);if(w&&e.push(`--drop-labels=${ao(w,"drop label")}`),Te&&e.push(`--abs-paths=${ao(Te,"abs paths")}`),l&&e.push(`--mangle-props=${ep(l)}`),p&&e.push(`--reserve-props=${ep(p)}`),d!==void 0&&e.push(`--mangle-quoted=${d}`),R&&e.push(`--jsx=${R}`),q&&e.push(`--jsx-factory=${q}`),k&&e.push(`--jsx-fragment=${k}`),b&&e.push(`--jsx-import-source=${b}`),g&&e.push("--jsx-dev"),D&&e.push("--jsx-side-effects"),$)for(let z in $){if(z.indexOf("=")>=0)throw new Error(`Invalid define: ${z}`);e.push(`--define:${z}=${tr($[z],"define",z)}`)}if(B)for(let z in B){if(z.indexOf("=")>=0)throw new Error(`Invalid log override: ${z}`);e.push(`--log-override:${z}=${tr(B[z],"log override",z)}`)}if(x)for(let z in x){if(z.indexOf("=")>=0)throw new Error(`Invalid supported: ${z}`);let he=x[z];if(typeof he!="boolean")throw new Error(`Expected value for supported ${mt(z)} to be a boolean, got ${typeof he} instead`);e.push(`--supported:${z}=${he}`)}if(S)for(let z of S)e.push(`--pure:${tr(z,"pure")}`);ie&&e.push("--keep-names")}function y2(e,t,r,n,i){var s;let o=[],a=[],c=Object.create(null),l=null,p=null;ip(o,t,c,r,n),QA(o,t,c);let d=N(t,c,"sourcemap",VA),f=N(t,c,"bundle",rt),m=N(t,c,"splitting",rt),h=N(t,c,"preserveSymlinks",rt),v=N(t,c,"metafile",rt),E=N(t,c,"outfile",oe),A=N(t,c,"outdir",oe),w=N(t,c,"outbase",oe),_=N(t,c,"tsconfig",oe),I=N(t,c,"resolveExtensions",rr),C=N(t,c,"nodePaths",rr),R=N(t,c,"mainFields",rr),q=N(t,c,"conditions",rr),k=N(t,c,"external",rr),b=N(t,c,"packages",oe),g=N(t,c,"alias",fr),D=N(t,c,"loader",fr),$=N(t,c,"outExtension",fr),B=N(t,c,"publicPath",oe),x=N(t,c,"entryNames",oe),S=N(t,c,"chunkNames",oe),ie=N(t,c,"assetNames",oe),J=N(t,c,"inject",rr),Z=N(t,c,"banner",fr),Te=N(t,c,"footer",fr),z=N(t,c,"entryPoints",d2),he=N(t,c,"absWorkingDir",oe),O=N(t,c,"stdin",fr),F=(s=N(t,c,"write",rt))!=null?s:i,V=N(t,c,"allowOverwrite",rt),P=N(t,c,"mangleCache",fr);if(c.plugins=!0,pt(t,c,`in ${e}() call`),d&&o.push(`--sourcemap${d===!0?"":`=${d}`}`),f&&o.push("--bundle"),V&&o.push("--allow-overwrite"),m&&o.push("--splitting"),h&&o.push("--preserve-symlinks"),v&&o.push("--metafile"),E&&o.push(`--outfile=${E}`),A&&o.push(`--outdir=${A}`),w&&o.push(`--outbase=${w}`),_&&o.push(`--tsconfig=${_}`),b&&o.push(`--packages=${b}`),I&&o.push(`--resolve-extensions=${ao(I,"resolve extension")}`),B&&o.push(`--public-path=${B}`),x&&o.push(`--entry-names=${x}`),S&&o.push(`--chunk-names=${S}`),ie&&o.push(`--asset-names=${ie}`),R&&o.push(`--main-fields=${ao(R,"main field")}`),q&&o.push(`--conditions=${ao(q,"condition")}`),k)for(let Y of k)o.push(`--external:${tr(Y,"external")}`);if(g)for(let Y in g){if(Y.indexOf("=")>=0)throw new Error(`Invalid package name in alias: ${Y}`);o.push(`--alias:${Y}=${tr(g[Y],"alias",Y)}`)}if(Z)for(let Y in Z){if(Y.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${Y}`);o.push(`--banner:${Y}=${tr(Z[Y],"banner",Y)}`)}if(Te)for(let Y in Te){if(Y.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${Y}`);o.push(`--footer:${Y}=${tr(Te[Y],"footer",Y)}`)}if(J)for(let Y of J)o.push(`--inject:${tr(Y,"inject")}`);if(D)for(let Y in D){if(Y.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${Y}`);o.push(`--loader:${Y}=${tr(D[Y],"loader",Y)}`)}if($)for(let Y in $){if(Y.indexOf("=")>=0)throw new Error(`Invalid out extension: ${Y}`);o.push(`--out-extension:${Y}=${tr($[Y],"out extension",Y)}`)}if(z)if(Array.isArray(z))for(let Y=0,U=z.length;Y<U;Y++){let me=z[Y];if(typeof me=="object"&&me!==null){let K=Object.create(null),le=N(me,K,"in",oe),de=N(me,K,"out",oe);if(pt(me,K,"in entry point at index "+Y),le===void 0)throw new Error('Missing property "in" for entry point at index '+Y);if(de===void 0)throw new Error('Missing property "out" for entry point at index '+Y);a.push([de,le])}else a.push(["",tr(me,"entry point at index "+Y)])}else for(let Y in z)a.push([Y,tr(z[Y],"entry point",Y)]);if(O){let Y=Object.create(null),U=N(O,Y,"contents",GA),me=N(O,Y,"resolveDir",oe),K=N(O,Y,"sourcefile",oe),le=N(O,Y,"loader",oe);pt(O,Y,'in "stdin" object'),K&&o.push(`--sourcefile=${K}`),le&&o.push(`--loader=${le}`),me&&(p=me),typeof U=="string"?l=Yr(U):U instanceof Uint8Array&&(l=U)}let we=[];if(C)for(let Y of C)Y+="",we.push(Y);return{entries:a,flags:o,write:F,stdinContents:l,stdinResolveDir:p,absWorkingDir:he,nodePaths:we,mangleCache:HA(P)}}function b2(e,t,r,n){let i=[],s=Object.create(null);ip(i,t,s,r,n),QA(i,t,s);let o=N(t,s,"sourcemap",VA),a=N(t,s,"sourcefile",oe),c=N(t,s,"loader",oe),l=N(t,s,"banner",oe),p=N(t,s,"footer",oe),d=N(t,s,"mangleCache",fr);return pt(t,s,`in ${e}() call`),o&&i.push(`--sourcemap=${o===!0?"external":o}`),a&&i.push(`--sourcefile=${a}`),c&&i.push(`--loader=${c}`),l&&i.push(`--banner=${l}`),p&&i.push(`--footer=${p}`),{flags:i,mangleCache:HA(d)}}function zA(e){let t={},r={didClose:!1,reason:""},n={},i=0,s=0,o=new Uint8Array(16*1024),a=0,c=_=>{let I=a+_.length;if(I>o.length){let R=new Uint8Array(I*2);R.set(o),o=R}o.set(_,a),a+=_.length;let C=0;for(;C+4<=a;){let R=UA(o,C);if(C+4+R>a)break;C+=4,h(o.subarray(C,C+R)),C+=R}C>0&&(o.copyWithin(0,C,a),a-=C)},l=_=>{r.didClose=!0,_&&(r.reason=": "+(_.message||_));let I="The service was stopped"+r.reason;for(let C in n)n[C](I,null);n={}},p=(_,I,C)=>{if(r.didClose)return C("The service is no longer running"+r.reason,null);let R=i++;n[R]=(q,k)=>{try{C(q,k)}finally{_&&_.unref()}},_&&_.ref(),e.writeToStdin(RA({id:R,isRequest:!0,value:I}))},d=(_,I)=>{if(r.didClose)throw new Error("The service is no longer running"+r.reason);e.writeToStdin(RA({id:_,isRequest:!1,value:I}))},f=async(_,I)=>{try{if(I.command==="ping"){d(_,{});return}if(typeof I.key=="number"){let C=t[I.key];if(!C)return;let R=C[I.command];if(R){await R(_,I);return}}throw new Error("Invalid command: "+I.command)}catch(C){let R=[Yi(C,e,null,void 0,"")];try{d(_,{errors:R})}catch{}}},m=!0,h=_=>{if(m){m=!1;let C=String.fromCharCode(..._);if(C!=="0.25.12")throw new Error(`Cannot start service: Host version "0.25.12" does not match binary version ${mt(C)}`);return}let I=l2(_);if(I.isRequest)f(I.id,I.value);else{let C=n[I.id];delete n[I.id],I.value.error?C(I.value.error,{}):C(null,I.value)}};return{readFromStdout:c,afterClose:l,service:{buildOrContext:({callName:_,refs:I,options:C,isTTY:R,defaultWD:q,callback:k})=>{let b=0,g=s++,D={},$={ref(){++b===1&&I&&I.ref()},unref(){--b===0&&(delete t[g],I&&I.unref())}};t[g]=D,$.ref(),v2(_,g,p,d,$,e,D,C,R,q,(B,x)=>{try{k(B,x)}finally{$.unref()}})},transform:({callName:_,refs:I,input:C,options:R,isTTY:q,fs:k,callback:b})=>{let g=WA(),D=$=>{try{if(typeof C!="string"&&!(C instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:B,mangleCache:x}=b2(_,R,q,LA),S={command:"transform",flags:B,inputFS:$!==null,input:$!==null?Yr($):typeof C=="string"?Yr(C):C};x&&(S.mangleCache=x),p(I,S,(ie,J)=>{if(ie)return b(new Error(ie),null);let Z=uo(J.errors,g),Te=uo(J.warnings,g),z=1,he=()=>{if(--z===0){let O={warnings:Te,code:J.code,map:J.map,mangleCache:void 0,legalComments:void 0};"legalComments"in J&&(O.legalComments=J?.legalComments),J.mangleCache&&(O.mangleCache=J?.mangleCache),b(null,O)}};if(Z.length>0)return b(ic("Transform failed",Z,Te),null);J.codeFS&&(z++,k.readFile(J.code,(O,F)=>{O!==null?b(O,null):(J.code=F,he())})),J.mapFS&&(z++,k.readFile(J.map,(O,F)=>{O!==null?b(O,null):(J.map=F,he())})),he()})}catch(B){let x=[];try{ip(x,R,{},q,LA)}catch{}let S=Yi(B,e,g,void 0,"");p(I,{command:"error",flags:x,error:S},()=>{S.detail=g.load(S.detail),b(ic("Transform failed",[S],[]),null)})}};if((typeof C=="string"||C instanceof Uint8Array)&&C.length>1024*1024){let $=D;D=()=>k.writeFile(C,$)}D(null)},formatMessages:({callName:_,refs:I,messages:C,options:R,callback:q})=>{if(!R)throw new Error(`Missing second argument in ${_}() call`);let k={},b=N(R,k,"kind",oe),g=N(R,k,"color",rt),D=N(R,k,"terminalWidth",Xi);if(pt(R,k,`in ${_}() call`),b===void 0)throw new Error(`Missing "kind" in ${_}() call`);if(b!=="error"&&b!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${_}() call`);let $={command:"format-msgs",messages:qn(C,"messages",null,"",D),isWarning:b==="warning"};g!==void 0&&($.color=g),D!==void 0&&($.terminalWidth=D),p(I,$,(B,x)=>{if(B)return q(new Error(B),null);q(null,x.messages)})},analyzeMetafile:({callName:_,refs:I,metafile:C,options:R,callback:q})=>{R===void 0&&(R={});let k={},b=N(R,k,"color",rt),g=N(R,k,"verbose",rt);pt(R,k,`in ${_}() call`);let D={command:"analyze-metafile",metafile:C};b!==void 0&&(D.color=b),g!==void 0&&(D.verbose=g),p(I,D,($,B)=>{if($)return q(new Error($),null);q(null,B.result)})}}}}function v2(e,t,r,n,i,s,o,a,c,l,p){let d=WA(),f=e==="context",m=(E,A)=>{let w=[];try{ip(w,a,{},c,CA)}catch{}let _=Yi(E,s,d,void 0,A);r(i,{command:"error",flags:w,error:_},()=>{_.detail=d.load(_.detail),p(ic(f?"Context failed":"Build failed",[_],[]),null)})},h;if(typeof a=="object"){let E=a.plugins;if(E!==void 0){if(!Array.isArray(E))return m(new Error('"plugins" must be an array'),"");h=E}}if(h&&h.length>0){if(s.isSync)return m(new Error("Cannot use plugins in synchronous API calls"),"");T2(t,r,n,i,s,o,a,h,d).then(E=>{if(!E.ok)return m(E.error,E.pluginName);try{v(E.requestPlugins,E.runOnEndCallbacks,E.scheduleOnDisposeCallbacks)}catch(A){m(A,"")}},E=>m(E,""));return}try{v(null,(E,A)=>A([],[]),()=>{})}catch(E){m(E,"")}function v(E,A,w){let _=s.hasFS,{entries:I,flags:C,write:R,stdinContents:q,stdinResolveDir:k,absWorkingDir:b,nodePaths:g,mangleCache:D}=y2(e,a,c,CA,_);if(R&&!s.hasFS)throw new Error('The "write" option is unavailable in this environment');let $={command:"build",key:t,entries:I,flags:C,write:R,stdinContents:q,stdinResolveDir:k,absWorkingDir:b||l,nodePaths:g,context:f};E&&($.plugins=E),D&&($.mangleCache=D);let B=(ie,J)=>{let Z={errors:uo(ie.errors,d),warnings:uo(ie.warnings,d),outputFiles:void 0,metafile:void 0,mangleCache:void 0},Te=Z.errors.slice(),z=Z.warnings.slice();ie.outputFiles&&(Z.outputFiles=ie.outputFiles.map(x2)),ie.metafile&&(Z.metafile=JSON.parse(ie.metafile)),ie.mangleCache&&(Z.mangleCache=ie.mangleCache),ie.writeToStdout!==void 0&&console.log(co(ie.writeToStdout).replace(/\n$/,"")),A(Z,(he,O)=>{if(Te.length>0||he.length>0){let F=ic("Build failed",Te.concat(he),z.concat(O));return J(F,null,he,O)}J(null,Z,he,O)})},x,S;f&&(o["on-end"]=(ie,J)=>new Promise(Z=>{B(J,(Te,z,he,O)=>{let F={errors:he,warnings:O};S&&S(Te,z),x=void 0,S=void 0,n(ie,F),Z()})})),r(i,$,(ie,J)=>{if(ie)return p(new Error(ie),null);if(!f)return B(J,(z,he)=>(w(),p(z,he)));if(J.errors.length>0)return p(ic("Context failed",J.errors,J.warnings),null);let Z=!1,Te={rebuild:()=>(x||(x=new Promise((z,he)=>{let O;S=(V,P)=>{O||(O=()=>V?he(V):z(P))};let F=()=>{r(i,{command:"rebuild",key:t},(P,we)=>{P?he(new Error(P)):O?O():F()})};F()})),x),watch:(z={})=>new Promise((he,O)=>{if(!s.hasFS)throw new Error('Cannot use the "watch" API in this environment');let F={},V=N(z,F,"delay",Xi);pt(z,F,"in watch() call");let P={command:"watch",key:t};V&&(P.delay=V),r(i,P,we=>{we?O(new Error(we)):he(void 0)})}),serve:(z={})=>new Promise((he,O)=>{if(!s.hasFS)throw new Error('Cannot use the "serve" API in this environment');let F={},V=N(z,F,"port",p2),P=N(z,F,"host",oe),we=N(z,F,"servedir",oe),Y=N(z,F,"keyfile",oe),U=N(z,F,"certfile",oe),me=N(z,F,"fallback",oe),K=N(z,F,"cors",fr),le=N(z,F,"onRequest",BA);pt(z,F,"in serve() call");let de={command:"serve",key:t,onRequest:!!le};if(V!==void 0&&(de.port=V),P!==void 0&&(de.host=P),we!==void 0&&(de.servedir=we),Y!==void 0&&(de.keyfile=Y),U!==void 0&&(de.certfile=U),me!==void 0&&(de.fallback=me),K){let ct={},ze=N(K,ct,"origin",KA);pt(K,ct,'on "cors" object'),Array.isArray(ze)?de.corsOrigin=ze:ze!==void 0&&(de.corsOrigin=[ze])}r(i,de,(ct,ze)=>{if(ct)return O(new Error(ct));le&&(o["serve-request"]=(To,cs)=>{le(cs.args),n(To,{})}),he(ze)})}),cancel:()=>new Promise(z=>{if(Z)return z();r(i,{command:"cancel",key:t},()=>{z()})}),dispose:()=>new Promise(z=>{if(Z)return z();Z=!0,r(i,{command:"dispose",key:t},()=>{z(),w(),i.unref()})})};i.ref(),p(null,Te)})}}var T2=async(e,t,r,n,i,s,o,a,c)=>{let l=[],p=[],d={},f={},m=[],h=0,v=0,E=[],A=!1;a=[...a];for(let I of a){let C={};if(typeof I!="object")throw new Error(`Plugin at index ${v} must be an object`);let R=N(I,C,"name",oe);if(typeof R!="string"||R==="")throw new Error(`Plugin at index ${v} is missing a name`);try{let q=N(I,C,"setup",BA);if(typeof q!="function")throw new Error("Plugin is missing a setup function");pt(I,C,`on plugin ${mt(R)}`);let k={name:R,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};v++;let g=q({initialOptions:o,resolve:(D,$={})=>{if(!A)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof D!="string")throw new Error("The path to resolve must be a string");let B=Object.create(null),x=N($,B,"pluginName",oe),S=N($,B,"importer",oe),ie=N($,B,"namespace",oe),J=N($,B,"resolveDir",oe),Z=N($,B,"kind",oe),Te=N($,B,"pluginData",Xl),z=N($,B,"with",fr);return pt($,B,"in resolve() call"),new Promise((he,O)=>{let F={command:"resolve",path:D,key:e,pluginName:R};if(x!=null&&(F.pluginName=x),S!=null&&(F.importer=S),ie!=null&&(F.namespace=ie),J!=null&&(F.resolveDir=J),Z!=null)F.kind=Z;else throw new Error('Must specify "kind" when calling "resolve"');Te!=null&&(F.pluginData=c.store(Te)),z!=null&&(F.with=E2(z,"with")),t(n,F,(V,P)=>{V!==null?O(new Error(V)):he({errors:uo(P.errors,c),warnings:uo(P.warnings,c),path:P.path,external:P.external,sideEffects:P.sideEffects,namespace:P.namespace,suffix:P.suffix,pluginData:c.load(P.pluginData)})})})},onStart(D){let $='This error came from the "onStart" callback registered here:',B=Jl(new Error($),i,"onStart");l.push({name:R,callback:D,note:B}),k.onStart=!0},onEnd(D){let $='This error came from the "onEnd" callback registered here:',B=Jl(new Error($),i,"onEnd");p.push({name:R,callback:D,note:B}),k.onEnd=!0},onResolve(D,$){let B='This error came from the "onResolve" callback registered here:',x=Jl(new Error(B),i,"onResolve"),S={},ie=N(D,S,"filter",Zl),J=N(D,S,"namespace",oe);if(pt(D,S,`in onResolve() call for plugin ${mt(R)}`),ie==null)throw new Error("onResolve() call is missing a filter");let Z=h++;d[Z]={name:R,callback:$,note:x},k.onResolve.push({id:Z,filter:ep(ie),namespace:J||""})},onLoad(D,$){let B='This error came from the "onLoad" callback registered here:',x=Jl(new Error(B),i,"onLoad"),S={},ie=N(D,S,"filter",Zl),J=N(D,S,"namespace",oe);if(pt(D,S,`in onLoad() call for plugin ${mt(R)}`),ie==null)throw new Error("onLoad() call is missing a filter");let Z=h++;f[Z]={name:R,callback:$,note:x},k.onLoad.push({id:Z,filter:ep(ie),namespace:J||""})},onDispose(D){m.push(D)},esbuild:i.esbuild});g&&await g,E.push(k)}catch(q){return{ok:!1,error:q,pluginName:R}}}s["on-start"]=async(I,C)=>{c.clear();let R={errors:[],warnings:[]};await Promise.all(l.map(async({name:q,callback:k,note:b})=>{try{let g=await k();if(g!=null){if(typeof g!="object")throw new Error(`Expected onStart() callback in plugin ${mt(q)} to return an object`);let D={},$=N(g,D,"errors",jn),B=N(g,D,"warnings",jn);pt(g,D,`from onStart() callback in plugin ${mt(q)}`),$!=null&&R.errors.push(...qn($,"errors",c,q,void 0)),B!=null&&R.warnings.push(...qn(B,"warnings",c,q,void 0))}}catch(g){R.errors.push(Yi(g,i,c,b&&b(),q))}})),r(I,R)},s["on-resolve"]=async(I,C)=>{let R={},q="",k,b;for(let g of C.ids)try{({name:q,callback:k,note:b}=d[g]);let D=await k({path:C.path,importer:C.importer,namespace:C.namespace,resolveDir:C.resolveDir,kind:C.kind,pluginData:c.load(C.pluginData),with:C.with});if(D!=null){if(typeof D!="object")throw new Error(`Expected onResolve() callback in plugin ${mt(q)} to return an object`);let $={},B=N(D,$,"pluginName",oe),x=N(D,$,"path",oe),S=N(D,$,"namespace",oe),ie=N(D,$,"suffix",oe),J=N(D,$,"external",rt),Z=N(D,$,"sideEffects",rt),Te=N(D,$,"pluginData",Xl),z=N(D,$,"errors",jn),he=N(D,$,"warnings",jn),O=N(D,$,"watchFiles",rr),F=N(D,$,"watchDirs",rr);pt(D,$,`from onResolve() callback in plugin ${mt(q)}`),R.id=g,B!=null&&(R.pluginName=B),x!=null&&(R.path=x),S!=null&&(R.namespace=S),ie!=null&&(R.suffix=ie),J!=null&&(R.external=J),Z!=null&&(R.sideEffects=Z),Te!=null&&(R.pluginData=c.store(Te)),z!=null&&(R.errors=qn(z,"errors",c,q,void 0)),he!=null&&(R.warnings=qn(he,"warnings",c,q,void 0)),O!=null&&(R.watchFiles=Yl(O,"watchFiles")),F!=null&&(R.watchDirs=Yl(F,"watchDirs"));break}}catch(D){R={id:g,errors:[Yi(D,i,c,b&&b(),q)]};break}r(I,R)},s["on-load"]=async(I,C)=>{let R={},q="",k,b;for(let g of C.ids)try{({name:q,callback:k,note:b}=f[g]);let D=await k({path:C.path,namespace:C.namespace,suffix:C.suffix,pluginData:c.load(C.pluginData),with:C.with});if(D!=null){if(typeof D!="object")throw new Error(`Expected onLoad() callback in plugin ${mt(q)} to return an object`);let $={},B=N(D,$,"pluginName",oe),x=N(D,$,"contents",GA),S=N(D,$,"resolveDir",oe),ie=N(D,$,"pluginData",Xl),J=N(D,$,"loader",oe),Z=N(D,$,"errors",jn),Te=N(D,$,"warnings",jn),z=N(D,$,"watchFiles",rr),he=N(D,$,"watchDirs",rr);pt(D,$,`from onLoad() callback in plugin ${mt(q)}`),R.id=g,B!=null&&(R.pluginName=B),x instanceof Uint8Array?R.contents=x:x!=null&&(R.contents=Yr(x)),S!=null&&(R.resolveDir=S),ie!=null&&(R.pluginData=c.store(ie)),J!=null&&(R.loader=J),Z!=null&&(R.errors=qn(Z,"errors",c,q,void 0)),Te!=null&&(R.warnings=qn(Te,"warnings",c,q,void 0)),z!=null&&(R.watchFiles=Yl(z,"watchFiles")),he!=null&&(R.watchDirs=Yl(he,"watchDirs"));break}}catch(D){R={id:g,errors:[Yi(D,i,c,b&&b(),q)]};break}r(I,R)};let w=(I,C)=>C([],[]);p.length>0&&(w=(I,C)=>{(async()=>{let R=[],q=[];for(let{name:k,callback:b,note:g}of p){let D,$;try{let B=await b(I);if(B!=null){if(typeof B!="object")throw new Error(`Expected onEnd() callback in plugin ${mt(k)} to return an object`);let x={},S=N(B,x,"errors",jn),ie=N(B,x,"warnings",jn);pt(B,x,`from onEnd() callback in plugin ${mt(k)}`),S!=null&&(D=qn(S,"errors",c,k,void 0)),ie!=null&&($=qn(ie,"warnings",c,k,void 0))}}catch(B){D=[Yi(B,i,c,g&&g(),k)]}if(D){R.push(...D);try{I.errors.push(...D)}catch{}}if($){q.push(...$);try{I.warnings.push(...$)}catch{}}}C(R,q)})()});let _=()=>{for(let I of m)setTimeout(()=>I(),0)};return A=!0,{ok:!0,requestPlugins:E,runOnEndCallbacks:w,scheduleOnDisposeCallbacks:_}};function WA(){let e=new Map,t=0;return{clear(){e.clear()},load(r){return e.get(r)},store(r){if(r===void 0)return-1;let n=t++;return e.set(n,r),n}}}function Jl(e,t,r){let n,i=!1;return()=>{if(i)return n;i=!0;try{let s=(e.stack+"").split(`
231
+ `);s.splice(1,1);let o=JA(t,s,r);if(o)return n={text:e.message,location:o},n}catch{}}}function Yi(e,t,r,n,i){let s="Internal error",o=null;try{s=(e&&e.message||e)+""}catch{}try{o=JA(t,(e.stack+"").split(`
232
+ `),"")}catch{}return{id:"",pluginName:i,text:s,location:o,notes:n?[n]:[],detail:r?r.store(e):-1}}function JA(e,t,r){let n=" at ";if(e.readFileSync&&!t[0].startsWith(n)&&t[1].startsWith(n))for(let i=1;i<t.length;i++){let s=t[i];if(s.startsWith(n))for(s=s.slice(n.length);;){let o=/^(?:new |async )?\S+ \((.*)\)$/.exec(s);if(o){s=o[1];continue}if(o=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(s),o){s=o[1];continue}if(o=/^(\S+):(\d+):(\d+)$/.exec(s),o){let a;try{a=e.readFileSync(o[1],"utf8")}catch{break}let c=a.split(/\r\n|\r|\n|\u2028|\u2029/)[+o[2]-1]||"",l=+o[3]-1,p=c.slice(l,l+r.length)===r?r.length:0;return{file:o[1],namespace:"file",line:+o[2],column:Yr(c.slice(0,l)).length,length:Yr(c.slice(l,l+p)).length,lineText:c+`
233
+ `+t.slice(1).join(`
234
+ `),suggestion:""}}break}}return null}function ic(e,t,r){let n=5;e+=t.length<1?"":` with ${t.length} error${t.length<2?"":"s"}:`+t.slice(0,n+1).map((s,o)=>{if(o===n)return`
235
+ ...`;if(!s.location)return`
236
+ error: ${s.text}`;let{file:a,line:c,column:l}=s.location,p=s.pluginName?`[plugin: ${s.pluginName}] `:"";return`
237
+ ${a}:${c}:${l}: ERROR: ${p}${s.text}`}).join("");let i=new Error(e);for(let[s,o]of[["errors",t],["warnings",r]])Object.defineProperty(i,s,{configurable:!0,enumerable:!0,get:()=>o,set:a=>Object.defineProperty(i,s,{configurable:!0,enumerable:!0,value:a})});return i}function uo(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function DA(e,t,r){if(e==null)return null;let n={},i=N(e,n,"file",oe),s=N(e,n,"namespace",oe),o=N(e,n,"line",Xi),a=N(e,n,"column",Xi),c=N(e,n,"length",Xi),l=N(e,n,"lineText",oe),p=N(e,n,"suggestion",oe);if(pt(e,n,t),l){let d=l.slice(0,(a&&a>0?a:0)+(c&&c>0?c:0)+(r&&r>0?r:80));!/[\x7F-\uFFFF]/.test(d)&&!/\n/.test(l)&&(l=d)}return{file:i||"",namespace:s||"",line:o||0,column:a||0,length:c||0,lineText:l||"",suggestion:p||""}}function qn(e,t,r,n,i){let s=[],o=0;for(let a of e){let c={},l=N(a,c,"id",oe),p=N(a,c,"pluginName",oe),d=N(a,c,"text",oe),f=N(a,c,"location",kA),m=N(a,c,"notes",jn),h=N(a,c,"detail",Xl),v=`in element ${o} of "${t}"`;pt(a,c,v);let E=[];if(m)for(let A of m){let w={},_=N(A,w,"text",oe),I=N(A,w,"location",kA);pt(A,w,v),E.push({text:_||"",location:DA(I,v,i)})}s.push({id:l||"",pluginName:p||n,text:d||"",location:DA(f,v,i),notes:E,detail:r?r.store(h):-1}),o++}return s}function Yl(e,t){let r=[];for(let n of e){if(typeof n!="string")throw new Error(`${mt(t)} must be an array of strings`);r.push(n)}return r}function E2(e,t){let r=Object.create(null);for(let n in e){let i=e[n];if(typeof i!="string")throw new Error(`key ${mt(n)} in object ${mt(t)} must be a string`);r[n]=i}return r}function x2({path:e,contents:t,hash:r}){let n=null;return{path:e,contents:t,hash:r,get text(){let i=this.contents;return(n===null||i!==t)&&(t=i,n=co(i)),n}}}function ep(e){let t=e.source;return e.flags&&(t=`(?${e.flags})${t}`),t}var hi=_e("fs"),$A=_e("os"),Lr=_e("path"),oo=process.env.ESBUILD_BINARY_PATH||oo,w2=e=>!!e&&e!=="/usr/bin/esbuild",PA="@esbuild/darwin-arm64",jA="@esbuild/darwin-x64",tp={"win32 arm64 LE":"@esbuild/win32-arm64","win32 ia32 LE":"@esbuild/win32-ia32","win32 x64 LE":"@esbuild/win32-x64"},rp={"aix ppc64 BE":"@esbuild/aix-ppc64","android arm64 LE":"@esbuild/android-arm64","darwin arm64 LE":"@esbuild/darwin-arm64","darwin x64 LE":"@esbuild/darwin-x64","freebsd arm64 LE":"@esbuild/freebsd-arm64","freebsd x64 LE":"@esbuild/freebsd-x64","linux arm LE":"@esbuild/linux-arm","linux arm64 LE":"@esbuild/linux-arm64","linux ia32 LE":"@esbuild/linux-ia32","linux mips64el LE":"@esbuild/linux-mips64el","linux ppc64 LE":"@esbuild/linux-ppc64","linux riscv64 LE":"@esbuild/linux-riscv64","linux s390x BE":"@esbuild/linux-s390x","linux x64 LE":"@esbuild/linux-x64","linux loong64 LE":"@esbuild/linux-loong64","netbsd arm64 LE":"@esbuild/netbsd-arm64","netbsd x64 LE":"@esbuild/netbsd-x64","openbsd arm64 LE":"@esbuild/openbsd-arm64","openbsd x64 LE":"@esbuild/openbsd-x64","sunos x64 LE":"@esbuild/sunos-x64"},qA={"android arm LE":"@esbuild/android-arm","android x64 LE":"@esbuild/android-x64","openharmony arm64 LE":"@esbuild/openharmony-arm64"};function S2(){let e,t,r=!1,n=`${process.platform} ${$A.arch()} ${$A.endianness()}`;if(n in tp)e=tp[n],t="esbuild.exe";else if(n in rp)e=rp[n],t="bin/esbuild";else if(n in qA)e=qA[n],t="bin/esbuild",r=!0;else throw new Error(`Unsupported platform: ${n}`);return{pkg:e,subpath:t,isWASM:r}}function O2(){let e=_e.resolve("esbuild"),t=Lr.dirname(Lr.dirname(Lr.dirname(e)));if(Lr.basename(t)==="node_modules"){for(let r in rp)try{let n=rp[r];if(hi.existsSync(Lr.join(t,n)))return n}catch{}for(let r in tp)try{let n=tp[r];if(hi.existsSync(Lr.join(t,n)))return n}catch{}}return null}function _2(e,t){let r=Lr.dirname(_e.resolve("esbuild"));return Lr.join(r,`downloaded-${e.replace("/","-")}-${Lr.basename(t)}`)}function A2(){if(w2(oo))if(!hi.existsSync(oo))console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${oo}`);else return{binPath:oo,isWASM:!1};let{pkg:e,subpath:t,isWASM:r}=S2(),n;try{n=_e.resolve(`${e}/${t}`)}catch(i){if(n=_2(e,t),!hi.existsSync(n)){try{_e.resolve(e)}catch{let s=O2();if(s){let o=`
238
+ Specifically the "${s}" package is present but this platform
239
+ needs the "${e}" package instead. People often get into this
240
+ situation by installing esbuild on Windows or macOS and copying "node_modules"
241
+ into a Docker image that runs Linux, or by copying "node_modules" between
242
+ Windows and WSL environments.
243
+
244
+ If you are installing with npm, you can try not copying the "node_modules"
245
+ directory when you copy the files over, and running "npm ci" or "npm install"
246
+ on the destination platform after the copy. Or you could consider using yarn
247
+ instead of npm which has built-in support for installing a package on multiple
248
+ platforms simultaneously.
249
+
250
+ If you are installing with yarn, you can try listing both this platform and the
251
+ other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
252
+ feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
253
+ Keep in mind that this means multiple copies of esbuild will be present.
254
+ `;throw(e===jA&&s===PA||e===PA&&s===jA)&&(o=`
255
+ Specifically the "${s}" package is present but this platform
256
+ needs the "${e}" package instead. People often get into this
257
+ situation by installing esbuild with npm running inside of Rosetta 2 and then
258
+ trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta
259
+ 2 is Apple's on-the-fly x86_64-to-arm64 translation service).
260
+
261
+ If you are installing with npm, you can try ensuring that both npm and node are
262
+ not running under Rosetta 2 and then reinstalling esbuild. This likely involves
263
+ changing how you installed npm and/or node. For example, installing node with
264
+ the universal installer here should work: https://nodejs.org/en/download/. Or
265
+ you could consider using yarn instead of npm which has built-in support for
266
+ installing a package on multiple platforms simultaneously.
267
+
268
+ If you are installing with yarn, you can try listing both "arm64" and "x64"
269
+ in your ".yarnrc.yml" file using the "supportedArchitectures" feature:
270
+ https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
271
+ Keep in mind that this means multiple copies of esbuild will be present.
272
+ `),new Error(`
273
+ You installed esbuild for another platform than the one you're currently using.
274
+ This won't work because esbuild is written with native code and needs to
275
+ install a platform-specific binary executable.
276
+ ${o}
277
+ Another alternative is to use the "esbuild-wasm" package instead, which works
278
+ the same way on all platforms. But it comes with a heavy performance cost and
279
+ can sometimes be 10x slower than the "esbuild" package, so you may also not
280
+ want to do that.
281
+ `)}throw new Error(`The package "${e}" could not be found, and is needed by esbuild.
282
+
283
+ If you are installing esbuild with npm, make sure that you don't specify the
284
+ "--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature
285
+ of "package.json" is used by esbuild to install the correct binary executable
286
+ for your current platform.`)}throw i}}if(/\.zip\//.test(n)){let i;try{i=_e("pnpapi")}catch{}if(i){let s=i.getPackageInformation(i.topLevel).packageLocation,o=Lr.join(s,"node_modules",".cache","esbuild",`pnpapi-${e.replace("/","-")}-0.25.12-${Lr.basename(t)}`);return hi.existsSync(o)||(hi.mkdirSync(Lr.dirname(o),{recursive:!0}),hi.copyFileSync(n,o),hi.chmodSync(o,493)),{binPath:o,isWASM:r}}}return{binPath:n,isWASM:r}}var YA=_e("child_process"),N2=_e("crypto"),bb=_e("path"),Zi=_e("fs"),I2=_e("os"),R2=_e("tty"),Mt;if(process.env.ESBUILD_WORKER_THREADS!=="0"){try{Mt=_e("worker_threads")}catch{}let[e,t]=process.versions.node.split(".");(+e<12||+e==12&&+t<17||+e==13&&+t<13)&&(Mt=void 0)}var FA,ac=((FA=Mt?.workerData)==null?void 0:FA.esbuildVersion)==="0.25.12",XA=()=>{if(!oo&&(bb.basename(__filename)!=="main.js"||bb.basename(__dirname)!=="lib"))throw new Error(`The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle.
287
+
288
+ More information: The file containing the code for esbuild's JavaScript API (${__filename}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.`);{let{binPath:e,isWASM:t}=A2();return t?["node",[e]]:[e,[]]}},sc=()=>R2.isatty(2),C2={readFile(e,t){try{let r=Zi.readFileSync(e,"utf8");try{Zi.unlinkSync(e)}catch{}t(null,r)}catch(r){t(r,null)}},writeFile(e,t){try{let r=ZA();Zi.writeFileSync(r,e),t(r)}catch{t(null)}}},L2={readFile(e,t){try{Zi.readFile(e,"utf8",(r,n)=>{try{Zi.unlink(e,()=>t(r,n))}catch{t(r,n)}})}catch(r){t(r,null)}},writeFile(e,t){try{let r=ZA();Zi.writeFile(r,e,n=>t(n!==null?null:r))}catch{t(null)}}},k2="0.25.12",D2=e=>ts().build(e),$2=e=>ts().context(e),P2=(e,t)=>ts().transform(e,t),j2=(e,t)=>ts().formatMessages(e,t),q2=(e,t)=>ts().analyzeMetafile(e,t),F2=e=>{if(Mt&&!ac)return Ut||(Ut=op(Mt)),Ut.buildSync(e);let t;return sp(r=>r.buildOrContext({callName:"buildSync",refs:null,options:e,isTTY:sc(),defaultWD:es,callback:(n,i)=>{if(n)throw n;t=i}})),t},M2=(e,t)=>{if(Mt&&!ac)return Ut||(Ut=op(Mt)),Ut.transformSync(e,t);let r;return sp(n=>n.transform({callName:"transformSync",refs:null,input:e,options:t||{},isTTY:sc(),fs:C2,callback:(i,s)=>{if(i)throw i;r=s}})),r},U2=(e,t)=>{if(Mt&&!ac)return Ut||(Ut=op(Mt)),Ut.formatMessagesSync(e,t);let r;return sp(n=>n.formatMessages({callName:"formatMessagesSync",refs:null,messages:e,options:t,callback:(i,s)=>{if(i)throw i;r=s}})),r},B2=(e,t)=>{if(Mt&&!ac)return Ut||(Ut=op(Mt)),Ut.analyzeMetafileSync(e,t);let r;return sp(n=>n.analyzeMetafile({callName:"analyzeMetafileSync",refs:null,metafile:typeof e=="string"?e:JSON.stringify(e),options:t,callback:(i,s)=>{if(i)throw i;r=s}})),r},V2=()=>(np&&np(),Ut&&Ut.stop(),Promise.resolve()),vb=!1,K2=e=>{if(e=g2(e||{}),e.wasmURL)throw new Error('The "wasmURL" option only works in the browser');if(e.wasmModule)throw new Error('The "wasmModule" option only works in the browser');if(e.worker)throw new Error('The "worker" option only works in the browser');if(vb)throw new Error('Cannot call "initialize" more than once');return ts(),vb=!0,Promise.resolve()},es=process.cwd(),nc,np,ts=()=>{if(nc)return nc;let[e,t]=XA(),r=YA.spawn(e,t.concat("--service=0.25.12","--ping"),{windowsHide:!0,stdio:["pipe","pipe","inherit"],cwd:es}),{readFromStdout:n,afterClose:i,service:s}=zA({writeToStdin(p){r.stdin.write(p,d=>{d&&i(d)})},readFileSync:Zi.readFileSync,isSync:!1,hasFS:!0,esbuild:oc});r.stdin.on("error",i),r.on("error",i);let o=r.stdin,a=r.stdout;a.on("data",n),a.on("end",i),np=()=>{o.destroy(),a.destroy(),r.kill(),vb=!1,nc=void 0,np=void 0};let c=0;r.unref(),o.unref&&o.unref(),a.unref&&a.unref();let l={ref(){++c===1&&r.ref()},unref(){--c===0&&r.unref()}};return nc={build:p=>new Promise((d,f)=>{s.buildOrContext({callName:"build",refs:l,options:p,isTTY:sc(),defaultWD:es,callback:(m,h)=>m?f(m):d(h)})}),context:p=>new Promise((d,f)=>s.buildOrContext({callName:"context",refs:l,options:p,isTTY:sc(),defaultWD:es,callback:(m,h)=>m?f(m):d(h)})),transform:(p,d)=>new Promise((f,m)=>s.transform({callName:"transform",refs:l,input:p,options:d||{},isTTY:sc(),fs:L2,callback:(h,v)=>h?m(h):f(v)})),formatMessages:(p,d)=>new Promise((f,m)=>s.formatMessages({callName:"formatMessages",refs:l,messages:p,options:d,callback:(h,v)=>h?m(h):f(v)})),analyzeMetafile:(p,d)=>new Promise((f,m)=>s.analyzeMetafile({callName:"analyzeMetafile",refs:l,metafile:typeof p=="string"?p:JSON.stringify(p),options:d,callback:(h,v)=>h?m(h):f(v)}))},nc},sp=e=>{let[t,r]=XA(),n=new Uint8Array,{readFromStdout:i,afterClose:s,service:o}=zA({writeToStdin(c){if(n.length!==0)throw new Error("Must run at most one command");n=c},isSync:!0,hasFS:!0,esbuild:oc});e(o);let a=YA.execFileSync(t,r.concat("--service=0.25.12"),{cwd:es,windowsHide:!0,input:n,maxBuffer:+process.env.ESBUILD_MAX_BUFFER||16*1024*1024});i(a),s(null)},ZA=()=>bb.join(I2.tmpdir(),`esbuild-${N2.randomBytes(32).toString("hex")}`),Ut=null,op=e=>{let{port1:t,port2:r}=new e.MessageChannel,n=new e.Worker(__filename,{workerData:{workerPort:r,defaultWD:es,esbuildVersion:"0.25.12"},transferList:[r],execArgv:[]}),i=0,s=l=>{let p=new Error(`Build failed with 1 error:
289
+ error: ${l}`),d=[{id:"",pluginName:"",text:l,location:null,notes:[],detail:void 0}];return p.errors=d,p.warnings=[],p},o=l=>{if(!l)return;let p=l.plugins;if(p&&p.length>0)throw s("Cannot use plugins in synchronous API calls")},a=(l,p)=>{for(let d in p)l[d]=p[d]},c=(l,p)=>{let d=i++,f=new SharedArrayBuffer(8),m=new Int32Array(f),h={sharedBuffer:f,id:d,command:l,args:p};n.postMessage(h);let v=Atomics.wait(m,0,0);if(v!=="ok"&&v!=="not-equal")throw new Error("Internal error: Atomics.wait() failed: "+v);let{message:{id:E,resolve:A,reject:w,properties:_}}=e.receiveMessageOnPort(t);if(d!==E)throw new Error(`Internal error: Expected id ${d} but got id ${E}`);if(w)throw a(w,_),w;return A};return n.unref(),{buildSync(l){return o(l),c("build",[l])},transformSync(l,p){return c("transform",[l,p])},formatMessagesSync(l,p){return c("formatMessages",[l,p])},analyzeMetafileSync(l,p){return c("analyzeMetafile",[l,p])},stop(){n.terminate(),Ut=null}}},G2=()=>{let e=Mt.workerData.workerPort,t=Mt.parentPort,r=n=>{let i={};if(n&&typeof n=="object")for(let s in n)i[s]=n[s];return i};try{let n=ts();es=Mt.workerData.defaultWD,t.on("message",i=>{(async()=>{let{sharedBuffer:s,id:o,command:a,args:c}=i,l=new Int32Array(s);try{switch(a){case"build":e.postMessage({id:o,resolve:await n.build(c[0])});break;case"transform":e.postMessage({id:o,resolve:await n.transform(c[0],c[1])});break;case"formatMessages":e.postMessage({id:o,resolve:await n.formatMessages(c[0],c[1])});break;case"analyzeMetafile":e.postMessage({id:o,resolve:await n.analyzeMetafile(c[0],c[1])});break;default:throw new Error(`Invalid command: ${a}`)}}catch(p){e.postMessage({id:o,reject:p,properties:r(p)})}Atomics.add(l,0,1),Atomics.notify(l,0,1/0)})()})}catch(n){t.on("message",i=>{let{sharedBuffer:s,id:o}=i,a=new Int32Array(s);e.postMessage({id:o,reject:n,properties:r(n)}),Atomics.add(a,0,1),Atomics.notify(a,0,1/0)})}};ac&&G2();var H2=oc});var xb=T((Pfe,iN)=>{"use strict";u();var cc=e=>e&&typeof e.message=="string",Eb=e=>{if(!e)return;let t=e.cause;if(typeof t=="function"){let r=e.cause();return cc(r)?r:void 0}else return cc(t)?t:void 0},rN=(e,t)=>{if(!cc(e))return"";let r=e.stack||"";if(t.has(e))return r+`
290
+ causes have become circular...`;let n=Eb(e);return n?(t.add(e),r+`
291
+ caused by: `+rN(n,t)):r},Q2=e=>rN(e,new Set),nN=(e,t,r)=>{if(!cc(e))return"";let n=r?"":e.message||"";if(t.has(e))return n+": ...";let i=Eb(e);if(i){t.add(e);let s=typeof e.cause=="function";return n+(s?"":": ")+nN(i,t,s)}else return n},z2=e=>nN(e,new Set);iN.exports={isErrorLike:cc,getErrorCause:Eb,stackWithCauses:Q2,messageWithCauses:z2}});var wb=T((qfe,oN)=>{"use strict";u();var W2=Symbol("circular-ref-tag"),ap=Symbol("pino-raw-err-ref"),sN=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[ap]},set:function(e){this[ap]=e}}});Object.defineProperty(sN,ap,{writable:!0,value:{}});oN.exports={pinoErrProto:sN,pinoErrorSymbols:{seen:W2,rawSymbol:ap}}});var uN=T((Mfe,cN)=>{"use strict";u();cN.exports=Ob;var{messageWithCauses:J2,stackWithCauses:Y2,isErrorLike:aN}=xb(),{pinoErrProto:X2,pinoErrorSymbols:Z2}=wb(),{seen:Sb}=Z2,{toString:eQ}=Object.prototype;function Ob(e){if(!aN(e))return e;e[Sb]=void 0;let t=Object.create(X2);t.type=eQ.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,t.message=J2(e),t.stack=Y2(e),Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(r=>Ob(r)));for(let r in e)if(t[r]===void 0){let n=e[r];aN(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,Sb)&&(t[r]=Ob(n)):t[r]=n}return delete e[Sb],t.raw=e,t}});var pN=T((Bfe,lN)=>{"use strict";u();lN.exports=up;var{isErrorLike:_b}=xb(),{pinoErrProto:tQ,pinoErrorSymbols:rQ}=wb(),{seen:cp}=rQ,{toString:nQ}=Object.prototype;function up(e){if(!_b(e))return e;e[cp]=void 0;let t=Object.create(tQ);t.type=nQ.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,t.message=e.message,t.stack=e.stack,Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(r=>up(r))),_b(e.cause)&&!Object.prototype.hasOwnProperty.call(e.cause,cp)&&(t.cause=up(e.cause));for(let r in e)if(t[r]===void 0){let n=e[r];_b(n)?Object.prototype.hasOwnProperty.call(n,cp)||(t[r]=up(n)):t[r]=n}return delete e[cp],t.raw=e,t}});var mN=T((Kfe,hN)=>{"use strict";u();hN.exports={mapHttpRequest:iQ,reqSerializer:fN};var Ab=Symbol("pino-raw-req-ref"),dN=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Ab]},set:function(e){this[Ab]=e}}});Object.defineProperty(dN,Ab,{writable:!0,value:{}});function fN(e){let t=e.info||e.socket,r=Object.create(dN);if(r.id=typeof e.id=="function"?e.id():e.id||(e.info?e.info.id:void 0),r.method=e.method,e.originalUrl)r.url=e.originalUrl;else{let n=e.path;r.url=typeof n=="string"?n:e.url?e.url.path||e.url:void 0}return e.query&&(r.query=e.query),e.params&&(r.params=e.params),r.headers=e.headers,r.remoteAddress=t&&t.remoteAddress,r.remotePort=t&&t.remotePort,r.raw=e.raw||e,r}function iQ(e){return{req:fN(e)}}});var vN=T((Hfe,bN)=>{"use strict";u();bN.exports={mapHttpResponse:sQ,resSerializer:yN};var Nb=Symbol("pino-raw-res-ref"),gN=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Nb]},set:function(e){this[Nb]=e}}});Object.defineProperty(gN,Nb,{writable:!0,value:{}});function yN(e){let t=Object.create(gN);return t.statusCode=e.headersSent?e.statusCode:null,t.headers=e.getHeaders?e.getHeaders():e._headers,t.raw=e,t}function sQ(e){return{res:yN(e)}}});var Rb=T((zfe,TN)=>{"use strict";u();var Ib=uN(),oQ=pN(),lp=mN(),pp=vN();TN.exports={err:Ib,errWithCause:oQ,mapHttpRequest:lp.mapHttpRequest,mapHttpResponse:pp.mapHttpResponse,req:lp.reqSerializer,res:pp.resSerializer,wrapErrorSerializer:function(t){return t===Ib?t:function(n){return t(Ib(n))}},wrapRequestSerializer:function(t){return t===lp.reqSerializer?t:function(n){return t(lp.reqSerializer(n))}},wrapResponseSerializer:function(t){return t===pp.resSerializer?t:function(n){return t(pp.resSerializer(n))}}}});var Cb=T((Jfe,EN)=>{"use strict";u();function aQ(e,t){return t}EN.exports=function(){let t=Error.prepareStackTrace;Error.prepareStackTrace=aQ;let r=new Error().stack;if(Error.prepareStackTrace=t,!Array.isArray(r))return;let n=r.slice(2),i=[];for(let s of n)s&&i.push(s.getFileName());return i}});var AN=T((Xfe,_N)=>{"use strict";u();function Lb(e){if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array){let t=[];for(let r=0;r<e.length;r++)t[r]=Lb(e[r]);return t}if(typeof e=="object"){let t=Object.create(Object.getPrototypeOf(e));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=Lb(e[r]));return t}return e}function xN(e){let t=[],r="",n=!1,i=!1,s="";for(let o=0;o<e.length;o++){let a=e[o];!n&&a==="."?r&&(t.push(r),r=""):a==="["?(r&&(t.push(r),r=""),n=!0):a==="]"&&n?(t.push(r),r="",n=!1,i=!1):(a==='"'||a==="'")&&n?i?a===s?(i=!1,s=""):r+=a:(i=!0,s=a):r+=a}return r&&t.push(r),t}function wN(e,t,r){let n=e;for(let s=0;s<t.length-1;s++){let o=t[s];if(typeof n!="object"||n===null||!(o in n)||typeof n[o]!="object"||n[o]===null)return!1;n=n[o]}let i=t[t.length-1];if(i==="*"){if(Array.isArray(n))for(let s=0;s<n.length;s++)n[s]=r;else if(typeof n=="object"&&n!==null)for(let s in n)Object.prototype.hasOwnProperty.call(n,s)&&(n[s]=r)}else typeof n=="object"&&n!==null&&i in n&&Object.prototype.hasOwnProperty.call(n,i)&&(n[i]=r);return!0}function SN(e,t){let r=e;for(let i=0;i<t.length-1;i++){let s=t[i];if(typeof r!="object"||r===null||!(s in r)||typeof r[s]!="object"||r[s]===null)return!1;r=r[s]}let n=t[t.length-1];if(n==="*"){if(Array.isArray(r))for(let i=0;i<r.length;i++)r[i]=void 0;else if(typeof r=="object"&&r!==null)for(let i in r)Object.prototype.hasOwnProperty.call(r,i)&&delete r[i]}else typeof r=="object"&&r!==null&&n in r&&Object.prototype.hasOwnProperty.call(r,n)&&delete r[n];return!0}var dp=Symbol("PATH_NOT_FOUND");function cQ(e,t){let r=e;for(let n of t){if(r==null||typeof r!="object"||r===null||!(n in r))return dp;r=r[n]}return r}function uQ(e,t){let r=e;for(let n of t){if(r==null||typeof r!="object"||r===null)return;r=r[n]}return r}function lQ(e,t,r,n=!1){for(let i of t){let s=xN(i);if(s.includes("*"))ON(e,s,r,i,n);else if(n)SN(e,s);else{let o=cQ(e,s);if(o===dp)continue;let a=typeof r=="function"?r(o,s):r;wN(e,s,a)}}}function ON(e,t,r,n,i=!1){let s=t.indexOf("*");if(s===t.length-1){let o=t.slice(0,-1),a=e;for(let c of o){if(a==null||typeof a!="object"||a===null)return;a=a[c]}if(Array.isArray(a))if(i)for(let c=0;c<a.length;c++)a[c]=void 0;else for(let c=0;c<a.length;c++){let l=[...o,c.toString()],p=typeof r=="function"?r(a[c],l):r;a[c]=p}else if(typeof a=="object"&&a!==null)if(i){let c=[];for(let l in a)Object.prototype.hasOwnProperty.call(a,l)&&c.push(l);for(let l of c)delete a[l]}else for(let c in a){let l=[...o,c],p=typeof r=="function"?r(a[c],l):r;a[c]=p}}else pQ(e,t,r,s,n,i)}function pQ(e,t,r,n,i,s=!1){let o=t.slice(0,n),a=t.slice(n+1),c=[];function l(p,d){if(d===o.length){if(Array.isArray(p))for(let f=0;f<p.length;f++)c[d]=f.toString(),l(p[f],d+1);else if(typeof p=="object"&&p!==null)for(let f in p)c[d]=f,l(p[f],d+1)}else if(d<o.length){let f=o[d];p&&typeof p=="object"&&p!==null&&f in p&&(c[d]=f,l(p[f],d+1))}else if(a.includes("*"))ON(p,a,typeof r=="function"?(m,h)=>{let v=[...c.slice(0,d),...h];return r(m,v)}:r,i,s);else if(s)SN(p,a);else{let f=typeof r=="function"?r(uQ(p,a),[...c.slice(0,d),...a]):r;wN(p,a,f)}}if(o.length===0)l(e,0);else{let p=e;for(let d=0;d<o.length;d++){let f=o[d];if(p==null||typeof p!="object"||p===null)return;p=p[f],c[d]=f}p!=null&&l(p,o.length)}}function dQ(e){if(e.length===0)return null;let t=new Map;for(let r of e){let n=xN(r),i=t;for(let s=0;s<n.length;s++){let o=n[s];i.has(o)||i.set(o,new Map),i=i.get(o)}}return t}function fQ(e,t){if(!t)return e;function r(n,i,s=0){if(!i||i.size===0||n===null||typeof n!="object")return n;if(n instanceof Date)return new Date(n.getTime());if(Array.isArray(n)){let a=[];for(let c=0;c<n.length;c++){let l=c.toString();i.has(l)||i.has("*")?a[c]=r(n[c],i.get(l)||i.get("*")):a[c]=n[c]}return a}let o=Object.create(Object.getPrototypeOf(n));for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&(i.has(a)||i.has("*")?o[a]=r(n[a],i.get(a)||i.get("*")):o[a]=n[a]);return o}return r(e,t)}function hQ(e){if(typeof e!="string")throw new Error("Paths must be (non-empty) strings");if(e==="")throw new Error("Invalid redaction path ()");if(e.includes(".."))throw new Error(`Invalid redaction path (${e})`);if(e.includes(","))throw new Error(`Invalid redaction path (${e})`);let t=0,r=!1,n="";for(let i=0;i<e.length;i++){let s=e[i];if((s==='"'||s==="'")&&t>0)r?s===n&&(r=!1,n=""):(r=!0,n=s);else if(s==="["&&!r)t++;else if(s==="]"&&!r&&(t--,t<0))throw new Error(`Invalid redaction path (${e})`)}if(t!==0)throw new Error(`Invalid redaction path (${e})`)}function mQ(e){if(!Array.isArray(e))throw new TypeError("paths must be an array");for(let t of e)hQ(t)}function gQ(e={}){let{paths:t=[],censor:r="[REDACTED]",serialize:n=JSON.stringify,strict:i=!0,remove:s=!1}=e;mQ(t);let o=dQ(t);return function(c){if(i&&(c===null||typeof c!="object")&&(c==null||typeof c!="object"))return n?n(c):c;let l=fQ(c,o),p=c,d=r;return typeof r=="function"&&(d=r),lQ(l,t,d,s),n===!1?(l.restore=function(){return Lb(p)},l):typeof n=="function"?n(l):JSON.stringify(l)}}_N.exports=gQ});var lo=T((ehe,NN)=>{"use strict";u();var yQ=Symbol("pino.setLevel"),bQ=Symbol("pino.getLevel"),vQ=Symbol("pino.levelVal"),TQ=Symbol("pino.levelComp"),EQ=Symbol("pino.useLevelLabels"),xQ=Symbol("pino.useOnlyCustomLevels"),wQ=Symbol("pino.mixin"),SQ=Symbol("pino.lsCache"),OQ=Symbol("pino.chindings"),_Q=Symbol("pino.asJson"),AQ=Symbol("pino.write"),NQ=Symbol("pino.redactFmt"),IQ=Symbol("pino.time"),RQ=Symbol("pino.timeSliceIndex"),CQ=Symbol("pino.stream"),LQ=Symbol("pino.stringify"),kQ=Symbol("pino.stringifySafe"),DQ=Symbol("pino.stringifiers"),$Q=Symbol("pino.end"),PQ=Symbol("pino.formatOpts"),jQ=Symbol("pino.messageKey"),qQ=Symbol("pino.errorKey"),FQ=Symbol("pino.nestedKey"),MQ=Symbol("pino.nestedKeyStr"),UQ=Symbol("pino.mixinMergeStrategy"),BQ=Symbol("pino.msgPrefix"),VQ=Symbol("pino.wildcardFirst"),KQ=Symbol.for("pino.serializers"),GQ=Symbol.for("pino.formatters"),HQ=Symbol.for("pino.hooks"),QQ=Symbol.for("pino.metadata");NN.exports={setLevelSym:yQ,getLevelSym:bQ,levelValSym:vQ,levelCompSym:TQ,useLevelLabelsSym:EQ,mixinSym:wQ,lsCacheSym:SQ,chindingsSym:OQ,asJsonSym:_Q,writeSym:AQ,serializersSym:KQ,redactFmtSym:NQ,timeSym:IQ,timeSliceIndexSym:RQ,streamSym:CQ,stringifySym:LQ,stringifySafeSym:kQ,stringifiersSym:DQ,endSym:$Q,formatOptsSym:PQ,messageKeySym:jQ,errorKeySym:qQ,nestedKeySym:FQ,wildcardFirstSym:VQ,needsMetadataGsym:QQ,useOnlyCustomLevelsSym:xQ,formattersSym:GQ,hooksSym:HQ,nestedKeyStrSym:MQ,mixinMergeStrategySym:UQ,msgPrefixSym:BQ}});var Db=T((rhe,LN)=>{"use strict";u();var IN=AN(),{redactFmtSym:zQ,wildcardFirstSym:fp}=lo(),kb=/[^.[\]]+|\[([^[\]]*?)\]/g,RN="[Redacted]",CN=!1;function WQ(e,t){let{paths:r,censor:n,remove:i}=JQ(e),s=r.reduce((c,l)=>{kb.lastIndex=0;let p=kb.exec(l),d=kb.exec(l),f=p[1]!==void 0?p[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):p[0];if(f==="*"&&(f=fp),d===null)return c[f]=null,c;if(c[f]===null)return c;let{index:m}=d,h=`${l.substr(m,l.length-1)}`;return c[f]=c[f]||[],f!==fp&&c[f].length===0&&c[f].push(...c[fp]||[]),f===fp&&Object.keys(c).forEach(function(v){c[v]&&c[v].push(h)}),c[f].push(h),c},{}),o={[zQ]:IN({paths:r,censor:n,serialize:t,strict:CN,remove:i})},a=(...c)=>t(typeof n=="function"?n(...c):n);return[...Object.keys(s),...Object.getOwnPropertySymbols(s)].reduce((c,l)=>{if(s[l]===null)c[l]=p=>a(p,[l]);else{let p=typeof n=="function"?(d,f)=>n(d,[l,...f]):n;c[l]=IN({paths:s[l],censor:p,serialize:t,strict:CN,remove:i})}return c},o)}function JQ(e){if(Array.isArray(e))return e={paths:e,censor:RN},e;let{paths:t,censor:r=RN,remove:n}=e;if(Array.isArray(t)===!1)throw Error("pino \u2013 redact must contain an array of strings");return n===!0&&(r=void 0),{paths:t,censor:r,remove:n}}LN.exports=WQ});var $N=T((ihe,DN)=>{"use strict";u();var YQ=()=>"",XQ=()=>`,"time":${Date.now()}`,ZQ=()=>`,"time":${Math.round(Date.now()/1e3)}`,ez=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,tz=1000000n,kN=1000000000n,rz=BigInt(Date.now())*tz,nz=process.hrtime.bigint(),iz=()=>{let e=process.hrtime.bigint()-nz,t=rz+e,r=t/kN,n=t%kN,i=Number(r*1000n+n/1000000n),s=new Date(i),o=s.getUTCFullYear(),a=(s.getUTCMonth()+1).toString().padStart(2,"0"),c=s.getUTCDate().toString().padStart(2,"0"),l=s.getUTCHours().toString().padStart(2,"0"),p=s.getUTCMinutes().toString().padStart(2,"0"),d=s.getUTCSeconds().toString().padStart(2,"0");return`,"time":"${o}-${a}-${c}T${l}:${p}:${d}.${n.toString().padStart(9,"0")}Z"`};DN.exports={nullTime:YQ,epochTime:XQ,unixTime:ZQ,isoTime:ez,isoTimeNano:iz}});var jN=T((ohe,PN)=>{"use strict";u();function sz(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}PN.exports=oz;function oz(e,t,r){var n=r&&r.stringify||sz,i=1;if(typeof e=="object"&&e!==null){var s=t.length+i;if(s===1)return e;var o=new Array(s);o[0]=n(e);for(var a=1;a<s;a++)o[a]=n(t[a]);return o.join(" ")}if(typeof e!="string")return e;var c=t.length;if(c===0)return e;for(var l="",p=1-i,d=-1,f=e&&e.length||0,m=0;m<f;){if(e.charCodeAt(m)===37&&m+1<f){switch(d=d>-1?d:0,e.charCodeAt(m+1)){case 100:case 102:if(p>=c||t[p]==null)break;d<m&&(l+=e.slice(d,m)),l+=Number(t[p]),d=m+2,m++;break;case 105:if(p>=c||t[p]==null)break;d<m&&(l+=e.slice(d,m)),l+=Math.floor(Number(t[p])),d=m+2,m++;break;case 79:case 111:case 106:if(p>=c||t[p]===void 0)break;d<m&&(l+=e.slice(d,m));var h=typeof t[p];if(h==="string"){l+="'"+t[p]+"'",d=m+2,m++;break}if(h==="function"){l+=t[p].name||"<anonymous>",d=m+2,m++;break}l+=n(t[p]),d=m+2,m++;break;case 115:if(p>=c)break;d<m&&(l+=e.slice(d,m)),l+=String(t[p]),d=m+2,m++;break;case 37:d<m&&(l+=e.slice(d,m)),l+="%",d=m+2,m++,p--;break}++p}++m}return d===-1?e:(d<f&&(l+=e.slice(d)),l)}});var Pb=T((che,$b)=>{"use strict";u();if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let t=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(e,0,0,Number(r))},e=new Int32Array(new SharedArrayBuffer(4));$b.exports=t}else{let e=function(t){if((t>0&&t<1/0)===!1)throw typeof t!="number"&&typeof t!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");let n=Date.now()+Number(t);for(;n>Date.now(););};$b.exports=e}});var GN=T((lhe,KN)=>{"use strict";u();var dt=_e("fs"),az=_e("events"),cz=_e("util").inherits,qN=_e("path"),qb=Pb(),uz=_e("assert"),hp=100,mp=Buffer.allocUnsafe(0),lz=16*1024,FN="buffer",MN="utf8",[pz,dz]=(process.versions.node||"0.0").split(".").map(Number),fz=pz>=22&&dz>=7;function UN(e,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function r(s,o){if(s){t._reopening=!1,t._writing=!1,t._opening=!1,t.sync?process.nextTick(()=>{t.listenerCount("error")>0&&t.emit("error",s)}):t.emit("error",s);return}let a=t._reopening;t.fd=o,t.file=e,t._reopening=!1,t._opening=!1,t._writing=!1,t.sync?process.nextTick(()=>t.emit("ready")):t.emit("ready"),!t.destroyed&&(!t._writing&&t._len>t.minLength||t._flushPending?t._actualWrite():a&&process.nextTick(()=>t.emit("drain")))}let n=t.append?"a":"w",i=t.mode;if(t.sync)try{t.mkdir&&dt.mkdirSync(qN.dirname(e),{recursive:!0});let s=dt.openSync(e,n,i);r(null,s)}catch(s){throw r(s),s}else t.mkdir?dt.mkdir(qN.dirname(e),{recursive:!0},s=>{if(s)return r(s);dt.open(e,n,i,r)}):dt.open(e,n,i,r)}function Xr(e){if(!(this instanceof Xr))return new Xr(e);let{fd:t,dest:r,minLength:n,maxLength:i,maxWrite:s,periodicFlush:o,sync:a,append:c=!0,mkdir:l,retryEAGAIN:p,fsync:d,contentMode:f,mode:m}=e||{};t=t||r,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!1,this._hwm=Math.max(n||0,16387),this.file=null,this.destroyed=!1,this.minLength=n||0,this.maxLength=i||0,this.maxWrite=s||lz,this._periodicFlush=o||0,this._periodicFlushTimer=void 0,this.sync=a||!1,this.writable=!0,this._fsync=d||!1,this.append=c||!1,this.mode=m,this.retryEAGAIN=p||(()=>!0),this.mkdir=l||!1;let h,v;if(f===FN)this._writingBuf=mp,this.write=gz,this.flush=bz,this.flushSync=Tz,this._actualWrite=xz,h=()=>dt.writeSync(this.fd,this._writingBuf),v=()=>dt.write(this.fd,this._writingBuf,this.release);else if(f===void 0||f===MN)this._writingBuf="",this.write=mz,this.flush=yz,this.flushSync=vz,this._actualWrite=Ez,h=()=>dt.writeSync(this.fd,this._writingBuf,"utf8"),v=()=>dt.write(this.fd,this._writingBuf,"utf8",this.release);else throw new Error(`SonicBoom supports "${MN}" and "${FN}", but passed ${f}`);if(typeof t=="number")this.fd=t,process.nextTick(()=>this.emit("ready"));else if(typeof t=="string")UN(t,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(E,A)=>{if(E){if((E.code==="EAGAIN"||E.code==="EBUSY")&&this.retryEAGAIN(E,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{qb(hp),this.release(void 0,0)}catch(I){this.release(I)}else setTimeout(v,hp);else this._writing=!1,this.emit("error",E);return}this.emit("write",A);let w=jb(this._writingBuf,this._len,A);if(this._len=w.len,this._writingBuf=w.writingBuf,this._writingBuf.length){if(!this.sync){v();return}try{do{let I=h(),C=jb(this._writingBuf,this._len,I);this._len=C.len,this._writingBuf=C.writingBuf}while(this._writingBuf.length)}catch(I){this.release(I);return}}this._fsync&&dt.fsyncSync(this.fd);let _=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):_>this.minLength?this._actualWrite():this._ending?_>0?this._actualWrite():(this._writing=!1,gp(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(hz,this)):this.emit("drain"))},this.on("newListener",function(E){E==="drain"&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function jb(e,t,r){return typeof e=="string"&&Buffer.byteLength(e)!==r&&(r=Buffer.from(e).subarray(0,r).toString().length),t=Math.max(t-r,0),e=e.slice(r),{writingBuf:e,len:t}}function hz(e){e.listenerCount("drain")>0&&(e._asyncDrainScheduled=!1,e.emit("drain"))}cz(Xr,az);function BN(e,t){return e.length===0?mp:e.length===1?e[0]:Buffer.concat(e,t)}function mz(e){if(this.destroyed)throw new Error("SonicBoom destroyed");let t=this._len+e.length,r=this._bufs;return this.maxLength&&t>this.maxLength?(this.emit("drop",e),this._len<this._hwm):(r.length===0||r[r.length-1].length+e.length>this.maxWrite?r.push(""+e):r[r.length-1]+=e,this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function gz(e){if(this.destroyed)throw new Error("SonicBoom destroyed");let t=this._len+e.length,r=this._bufs,n=this._lens;return this.maxLength&&t>this.maxLength?(this.emit("drop",e),this._len<this._hwm):(r.length===0||n[n.length-1]+e.length>this.maxWrite?(r.push([e]),n.push(e.length)):(r[r.length-1].push(e),n[n.length-1]+=e.length),this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function VN(e){this._flushPending=!0;let t=()=>{if(this._fsync)this._flushPending=!1,e();else try{dt.fsync(this.fd,n=>{this._flushPending=!1,e(n)})}catch(n){e(n)}this.off("error",r)},r=n=>{this._flushPending=!1,e(n),this.off("drain",t)};this.once("drain",t),this.once("error",r)}function yz(e){if(e!=null&&typeof e!="function")throw new Error("flush cb must be a function");if(this.destroyed){let t=new Error("SonicBoom destroyed");if(e){e(t);return}throw t}if(this.minLength<=0){e?.();return}e&&VN.call(this,e),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite())}function bz(e){if(e!=null&&typeof e!="function")throw new Error("flush cb must be a function");if(this.destroyed){let t=new Error("SonicBoom destroyed");if(e){e(t);return}throw t}if(this.minLength<=0){e?.();return}e&&VN.call(this,e),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}Xr.prototype.reopen=function(e){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.reopen(e)});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(e&&(this.file=e),this._reopening=!0,this._writing)return;let t=this.fd;this.once("ready",()=>{t!==this.fd&&dt.close(t,r=>{if(r)return this.emit("error",r)})}),UN(this.file,this)};Xr.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end()});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():gp(this)))};function vz(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");let e="";for(;this._bufs.length||e;){e.length<=0&&(e=this._bufs[0]);try{let t=dt.writeSync(this.fd,e,"utf8"),r=jb(e,this._len,t);e=r.writingBuf,this._len=r.len,e.length<=0&&this._bufs.shift()}catch(t){if((t.code==="EAGAIN"||t.code==="EBUSY")&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;qb(hp)}}try{dt.fsyncSync(this.fd)}catch{}}function Tz(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=mp);let e=mp;for(;this._bufs.length||e.length;){e.length<=0&&(e=BN(this._bufs[0],this._lens[0]));try{let t=dt.writeSync(this.fd,e);e=e.subarray(t),this._len=Math.max(this._len-t,0),e.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(t){if((t.code==="EAGAIN"||t.code==="EBUSY")&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;qb(hp)}}}Xr.prototype.destroy=function(){this.destroyed||gp(this)};function Ez(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf||this._bufs.shift()||"",this.sync)try{let t=dt.writeSync(this.fd,this._writingBuf,"utf8");e(null,t)}catch(t){e(t)}else dt.write(this.fd,this._writingBuf,"utf8",e)}function xz(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:BN(this._bufs.shift(),this._lens.shift()),this.sync)try{let t=dt.writeSync(this.fd,this._writingBuf);e(null,t)}catch(t){e(t)}else fz&&(this._writingBuf=Buffer.from(this._writingBuf)),dt.write(this.fd,this._writingBuf,e)}function gp(e){if(e.fd===-1){e.once("ready",gp.bind(null,e));return}e._periodicFlushTimer!==void 0&&clearInterval(e._periodicFlushTimer),e.destroyed=!0,e._bufs=[],e._lens=[],uz(typeof e.fd=="number",`sonic.fd must be a number, got ${typeof e.fd}`);try{dt.fsync(e.fd,t)}catch{}function t(){e.fd!==1&&e.fd!==2?dt.close(e.fd,r):r()}function r(n){if(n){e.emit("error",n);return}e._ending&&!e._writing&&e.emit("finish"),e.emit("close")}}Xr.SonicBoom=Xr;Xr.default=Xr;KN.exports=Xr});var Fb=T((dhe,JN)=>{"use strict";u();var Zr={exit:[],beforeExit:[]},HN={exit:Oz,beforeExit:_z},po;function wz(){po===void 0&&(po=new FinalizationRegistry(Az))}function Sz(e){Zr[e].length>0||process.on(e,HN[e])}function QN(e){Zr[e].length>0||(process.removeListener(e,HN[e]),Zr.exit.length===0&&Zr.beforeExit.length===0&&(po=void 0))}function Oz(){zN("exit")}function _z(){zN("beforeExit")}function zN(e){for(let t of Zr[e]){let r=t.deref(),n=t.fn;r!==void 0&&n(r,e)}Zr[e]=[]}function Az(e){for(let t of["exit","beforeExit"]){let r=Zr[t].indexOf(e);Zr[t].splice(r,r+1),QN(t)}}function WN(e,t,r){if(t===void 0)throw new Error("the object can't be undefined");Sz(e);let n=new WeakRef(t);n.fn=r,wz(),po.register(t,n),Zr[e].push(n)}function Nz(e,t){WN("exit",e,t)}function Iz(e,t){WN("beforeExit",e,t)}function Rz(e){if(po!==void 0){po.unregister(e);for(let t of["exit","beforeExit"])Zr[t]=Zr[t].filter(r=>{let n=r.deref();return n&&n!==e}),QN(t)}}JN.exports={register:Nz,registerBeforeExit:Iz,unregister:Rz}});var YN=T((hhe,Cz)=>{Cz.exports={name:"thread-stream",version:"3.1.0",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",dependencies:{"real-require":"^0.2.0"},devDependencies:{"@types/node":"^20.1.0","@types/tap":"^15.0.0","@yao-pkg/pkg":"^5.11.5",desm:"^1.3.0",fastbench:"^1.0.1",husky:"^9.0.6","pino-elasticsearch":"^8.0.0","sonic-boom":"^4.0.1",standard:"^17.0.0",tap:"^16.2.0","ts-node":"^10.8.0",typescript:"^5.3.2","why-is-node-running":"^2.2.2"},scripts:{build:"tsc --noEmit",test:'standard && npm run build && npm run transpile && tap "test/**/*.test.*js" && tap --ts test/*.test.*ts',"test:ci":"standard && npm run transpile && npm run test:ci:js && npm run test:ci:ts","test:ci:js":'tap --no-check-coverage --timeout=120 --coverage-report=lcovonly "test/**/*.test.*js"',"test:ci:ts":'tap --ts --no-check-coverage --coverage-report=lcovonly "test/**/*.test.*ts"',"test:yarn":'npm run transpile && tap "test/**/*.test.js" --no-check-coverage',transpile:"sh ./test/ts/transpile.sh",prepare:"husky install"},standard:{ignore:["test/ts/**/*","test/syntax-error.mjs"]},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina <hello@matteocollina.com>",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"}});var ZN=T((mhe,XN)=>{"use strict";u();function Lz(e,t,r,n,i){let s=Date.now()+n,o=Atomics.load(e,t);if(o===r){i(null,"ok");return}let a=o,c=l=>{Date.now()>s?i(null,"timed-out"):setTimeout(()=>{a=o,o=Atomics.load(e,t),o===a?c(l>=1e3?1e3:l*2):o===r?i(null,"ok"):i(null,"not-equal")},l)};c(1)}function kz(e,t,r,n,i){let s=Date.now()+n,o=Atomics.load(e,t);if(o!==r){i(null,"ok");return}let a=c=>{Date.now()>s?i(null,"timed-out"):setTimeout(()=>{o=Atomics.load(e,t),o!==r?i(null,"ok"):a(c>=1e3?1e3:c*2)},c)};a(1)}XN.exports={wait:Lz,waitDiff:kz}});var tI=T((yhe,eI)=>{"use strict";u();eI.exports={WRITE_INDEX:4,READ_INDEX:8}});var oI=T((vhe,sI)=>{"use strict";u();var{version:Dz}=YN(),{EventEmitter:$z}=_e("events"),{Worker:Pz}=_e("worker_threads"),{join:jz}=_e("path"),{pathToFileURL:qz}=_e("url"),{wait:Fz}=ZN(),{WRITE_INDEX:nr,READ_INDEX:yn}=tI(),Mz=_e("buffer"),Uz=_e("assert"),j=Symbol("kImpl"),Bz=Mz.constants.MAX_STRING_LENGTH,uc=class{constructor(t){this._value=t}deref(){return this._value}},bp=class{register(){}unregister(){}},Vz=process.env.NODE_V8_COVERAGE?bp:global.FinalizationRegistry||bp,Kz=process.env.NODE_V8_COVERAGE?uc:global.WeakRef||uc,rI=new Vz(e=>{e.exited||e.terminate()});function Gz(e,t){let{filename:r,workerData:n}=t,s=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||jz(__dirname,"lib","worker.js"),o=new Pz(s,{...t.workerOpts,trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:qz(r).href,dataBuf:e[j].dataBuf,stateBuf:e[j].stateBuf,workerData:{$context:{threadStreamVersion:Dz},...n}}});return o.stream=new uc(e),o.on("message",Hz),o.on("exit",iI),rI.register(e,o),o}function nI(e){Uz(!e[j].sync),e[j].needDrain&&(e[j].needDrain=!1,e.emit("drain"))}function yp(e){let t=Atomics.load(e[j].state,nr),r=e[j].data.length-t;if(r>0){if(e[j].buf.length===0){e[j].flushing=!1,e[j].ending?Kb(e):e[j].needDrain&&process.nextTick(nI,e);return}let n=e[j].buf.slice(0,r),i=Buffer.byteLength(n);i<=r?(e[j].buf=e[j].buf.slice(r),vp(e,n,yp.bind(null,e))):e.flush(()=>{if(!e.destroyed){for(Atomics.store(e[j].state,yn,0),Atomics.store(e[j].state,nr,0);i>e[j].data.length;)r=r/2,n=e[j].buf.slice(0,r),i=Buffer.byteLength(n);e[j].buf=e[j].buf.slice(r),vp(e,n,yp.bind(null,e))}})}else if(r===0){if(t===0&&e[j].buf.length===0)return;e.flush(()=>{Atomics.store(e[j].state,yn,0),Atomics.store(e[j].state,nr,0),yp(e)})}else bn(e,new Error("overwritten"))}function Hz(e){let t=this.stream.deref();if(t===void 0){this.exited=!0,this.terminate();return}switch(e.code){case"READY":this.stream=new Kz(t),t.flush(()=>{t[j].ready=!0,t.emit("ready")});break;case"ERROR":bn(t,e.err);break;case"EVENT":Array.isArray(e.args)?t.emit(e.name,...e.args):t.emit(e.name,e.args);break;case"WARNING":process.emitWarning(e.err);break;default:bn(t,new Error("this should not happen: "+e.code))}}function iI(e){let t=this.stream.deref();t!==void 0&&(rI.unregister(t),t.worker.exited=!0,t.worker.off("exit",iI),bn(t,e!==0?new Error("the worker thread exited"):null))}var Ub=class extends $z{constructor(t={}){if(super(),t.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[j]={},this[j].stateBuf=new SharedArrayBuffer(128),this[j].state=new Int32Array(this[j].stateBuf),this[j].dataBuf=new SharedArrayBuffer(t.bufferSize||4*1024*1024),this[j].data=Buffer.from(this[j].dataBuf),this[j].sync=t.sync||!1,this[j].ending=!1,this[j].ended=!1,this[j].needDrain=!1,this[j].destroyed=!1,this[j].flushing=!1,this[j].ready=!1,this[j].finished=!1,this[j].errored=null,this[j].closed=!1,this[j].buf="",this.worker=Gz(this,t),this.on("message",(r,n)=>{this.worker.postMessage(r,n)})}write(t){if(this[j].destroyed)return Bb(this,new Error("the worker has exited")),!1;if(this[j].ending)return Bb(this,new Error("the worker is ending")),!1;if(this[j].flushing&&this[j].buf.length+t.length>=Bz)try{Mb(this),this[j].flushing=!0}catch(r){return bn(this,r),!1}if(this[j].buf+=t,this[j].sync)try{return Mb(this),!0}catch(r){return bn(this,r),!1}return this[j].flushing||(this[j].flushing=!0,setImmediate(yp,this)),this[j].needDrain=this[j].data.length-this[j].buf.length-Atomics.load(this[j].state,nr)<=0,!this[j].needDrain}end(){this[j].destroyed||(this[j].ending=!0,Kb(this))}flush(t){if(this[j].destroyed){typeof t=="function"&&process.nextTick(t,new Error("the worker has exited"));return}let r=Atomics.load(this[j].state,nr);Fz(this[j].state,yn,r,1/0,(n,i)=>{if(n){bn(this,n),process.nextTick(t,n);return}if(i==="not-equal"){this.flush(t);return}process.nextTick(t)})}flushSync(){this[j].destroyed||(Mb(this),Vb(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[j].ready}get destroyed(){return this[j].destroyed}get closed(){return this[j].closed}get writable(){return!this[j].destroyed&&!this[j].ending}get writableEnded(){return this[j].ending}get writableFinished(){return this[j].finished}get writableNeedDrain(){return this[j].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[j].errored}};function Bb(e,t){setImmediate(()=>{e.emit("error",t)})}function bn(e,t){e[j].destroyed||(e[j].destroyed=!0,t&&(e[j].errored=t,Bb(e,t)),e.worker.exited?setImmediate(()=>{e[j].closed=!0,e.emit("close")}):e.worker.terminate().catch(()=>{}).then(()=>{e[j].closed=!0,e.emit("close")}))}function vp(e,t,r){let n=Atomics.load(e[j].state,nr),i=Buffer.byteLength(t);return e[j].data.write(t,n),Atomics.store(e[j].state,nr,n+i),Atomics.notify(e[j].state,nr),r(),!0}function Kb(e){if(!(e[j].ended||!e[j].ending||e[j].flushing)){e[j].ended=!0;try{e.flushSync();let t=Atomics.load(e[j].state,yn);Atomics.store(e[j].state,nr,-1),Atomics.notify(e[j].state,nr);let r=0;for(;t!==-1;){if(Atomics.wait(e[j].state,yn,t,1e3),t=Atomics.load(e[j].state,yn),t===-2){bn(e,new Error("end() failed"));return}if(++r===10){bn(e,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{e[j].finished=!0,e.emit("finish")})}catch(t){bn(e,t)}}}function Mb(e){let t=()=>{e[j].ending?Kb(e):e[j].needDrain&&process.nextTick(nI,e)};for(e[j].flushing=!1;e[j].buf.length!==0;){let r=Atomics.load(e[j].state,nr),n=e[j].data.length-r;if(n===0){Vb(e),Atomics.store(e[j].state,yn,0),Atomics.store(e[j].state,nr,0);continue}else if(n<0)throw new Error("overwritten");let i=e[j].buf.slice(0,n),s=Buffer.byteLength(i);if(s<=n)e[j].buf=e[j].buf.slice(n),vp(e,i,t);else{for(Vb(e),Atomics.store(e[j].state,yn,0),Atomics.store(e[j].state,nr,0);s>e[j].buf.length;)n=n/2,i=e[j].buf.slice(0,n),s=Buffer.byteLength(i);e[j].buf=e[j].buf.slice(n),vp(e,i,t)}}}function Vb(e){if(e[j].flushing)throw new Error("unable to flush while flushing");let t=Atomics.load(e[j].state,nr),r=0;for(;;){let n=Atomics.load(e[j].state,yn);if(n===-2)throw Error("_flushSync failed");if(n!==t)Atomics.wait(e[j].state,yn,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}sI.exports=Ub});var Qb=T((Ehe,aI)=>{"use strict";u();var{createRequire:Qz}=_e("module"),zz=Cb(),{join:Gb,isAbsolute:Wz,sep:Jz}=_e("node:path"),Yz=Pb(),Hb=Fb(),Xz=oI();function Zz(e){Hb.register(e,tW),Hb.registerBeforeExit(e,rW),e.on("close",function(){Hb.unregister(e)})}function eW(e,t,r,n){let i=new Xz({filename:e,workerData:t,workerOpts:r,sync:n});i.on("ready",s),i.on("close",function(){process.removeListener("exit",o)}),process.on("exit",o);function s(){process.removeListener("exit",o),i.unref(),r.autoEnd!==!1&&Zz(i)}function o(){i.closed||(i.flushSync(),Yz(100),i.end())}return i}function tW(e){e.ref(),e.flushSync(),e.end(),e.once("close",function(){e.unref()})}function rW(e){e.flushSync()}function nW(e){let{pipeline:t,targets:r,levels:n,dedupe:i,worker:s={},caller:o=zz(),sync:a=!1}=e,c={...e.options},l=typeof o=="string"?[o]:o,p="__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{},d=e.target;if(d&&r)throw new Error("only one of target or targets can be specified");return r?(d=p["pino-worker"]||Gb(__dirname,"worker.js"),c.targets=r.filter(m=>m.target).map(m=>({...m,target:f(m.target)})),c.pipelines=r.filter(m=>m.pipeline).map(m=>m.pipeline.map(h=>({...h,level:m.level,target:f(h.target)})))):t&&(d=p["pino-worker"]||Gb(__dirname,"worker.js"),c.pipelines=[t.map(m=>({...m,target:f(m.target)}))]),n&&(c.levels=n),i&&(c.dedupe=i),c.pinoWillSendConfig=!0,eW(f(d),c,s,a);function f(m){if(m=p[m]||m,Wz(m)||m.indexOf("file://")===0)return m;if(m==="pino/file")return Gb(__dirname,"..","file.js");let h;for(let v of l)try{let E=v==="node:repl"?process.cwd()+Jz:v;h=Qz(E).resolve(m);break}catch{continue}if(!h)throw new Error(`unable to determine transport target for "${m}"`);return h}}aI.exports=nW});var wp=T((whe,TI)=>{"use strict";u();var cI=_e("node:diagnostics_channel"),uI=jN(),{mapHttpRequest:iW,mapHttpResponse:sW}=Rb(),Wb=GN(),lI=Fb(),{lsCacheSym:oW,chindingsSym:hI,writeSym:pI,serializersSym:mI,formatOptsSym:dI,endSym:aW,stringifiersSym:gI,stringifySym:yI,stringifySafeSym:Jb,wildcardFirstSym:bI,nestedKeySym:cW,formattersSym:vI,messageKeySym:uW,errorKeySym:lW,nestedKeyStrSym:pW,msgPrefixSym:Tp}=lo(),{isMainThread:dW}=_e("worker_threads"),fW=Qb(),xp;typeof cI.tracingChannel=="function"?xp=cI.tracingChannel("pino_asJson"):xp={hasSubscribers:!1,traceSync(e,t,r,...n){return e.call(r,...n)}};function fo(){}function hW(e,t){if(!t)return r;return function(...i){t.call(this,i,r,e)};function r(n,...i){if(typeof n=="object"){let s=n;n!==null&&(n.method&&n.headers&&n.socket?n=iW(n):typeof n.setHeader=="function"&&(n=sW(n)));let o;s===null&&i.length===0?o=[null]:(s=i.shift(),o=i),typeof this[Tp]=="string"&&s!==void 0&&s!==null&&(s=this[Tp]+s),this[pI](n,uI(s,o,this[dI]),e)}else{let s=n===void 0?i.shift():n;typeof this[Tp]=="string"&&s!==void 0&&s!==null&&(s=this[Tp]+s),this[pI](null,uI(s,i,this[dI]),e)}}}function zb(e){let t="",r=0,n=!1,i=255,s=e.length;if(s>100)return JSON.stringify(e);for(var o=0;o<s&&i>=32;o++)i=e.charCodeAt(o),(i===34||i===92)&&(t+=e.slice(r,o)+"\\",r=o,n=!0);return n?t+=e.slice(r):t=e,i<32?JSON.stringify(e):'"'+t+'"'}function mW(e,t,r,n){if(xp.hasSubscribers===!1)return fI.call(this,e,t,r,n);let i={instance:this,arguments};return xp.traceSync(fI,i,this,e,t,r,n)}function fI(e,t,r,n){let i=this[yI],s=this[Jb],o=this[gI],a=this[aW],c=this[hI],l=this[mI],p=this[vI],d=this[uW],f=this[lW],m=this[oW][r]+n;m=m+c;let h;p.log&&(e=p.log(e));let v=o[bI],E="";for(let w in e)if(h=e[w],Object.prototype.hasOwnProperty.call(e,w)&&h!==void 0){l[w]?h=l[w](h):w===f&&l.err&&(h=l.err(h));let _=o[w]||v;switch(typeof h){case"undefined":case"function":continue;case"number":Number.isFinite(h)===!1&&(h=null);case"boolean":_&&(h=_(h));break;case"string":h=(_||zb)(h);break;default:h=(_||i)(h,s)}if(h===void 0)continue;let I=zb(w);E+=","+I+":"+h}let A="";if(t!==void 0){h=l[d]?l[d](t):t;let w=o[d]||v;switch(typeof h){case"function":break;case"number":Number.isFinite(h)===!1&&(h=null);case"boolean":w&&(h=w(h)),A=',"'+d+'":'+h;break;case"string":h=(w||zb)(h),A=',"'+d+'":'+h;break;default:h=(w||i)(h,s),A=',"'+d+'":'+h}}return this[cW]&&E?m+this[pW]+E.slice(1)+"}"+A+a:m+E+A+a}function gW(e,t){let r,n=e[hI],i=e[yI],s=e[Jb],o=e[gI],a=o[bI],c=e[mI],l=e[vI].bindings;t=l(t);for(let p in t)if(r=t[p],((p.length<5||p!=="level"&&p!=="serializers"&&p!=="formatters"&&p!=="customLevels")&&t.hasOwnProperty(p)&&r!==void 0)===!0){if(r=c[p]?c[p](r):r,r=(o[p]||a||i)(r,s),r===void 0)continue;n+=',"'+p+'":'+r}return n}function yW(e){return e.write!==e.constructor.prototype.write}function Ep(e){let t=new Wb(e);return t.on("error",r),!e.sync&&dW&&(lI.register(t,bW),t.on("close",function(){lI.unregister(t)})),t;function r(n){if(n.code==="EPIPE"){t.write=fo,t.end=fo,t.flushSync=fo,t.destroy=fo;return}t.removeListener("error",r),t.emit("error",n)}}function bW(e,t){e.destroyed||(t==="beforeExit"?(e.flush(),e.on("drain",function(){e.end()})):e.flushSync())}function vW(e){return function(r,n,i={},s){if(typeof i=="string")s=Ep({dest:i}),i={};else if(typeof s=="string"){if(i&&i.transport)throw Error("only one of option.transport or stream can be specified");s=Ep({dest:s})}else if(i instanceof Wb||i.writable||i._writableState)s=i,i={};else if(i.transport){if(i.transport instanceof Wb||i.transport.writable||i.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(i.transport.targets&&i.transport.targets.length&&i.formatters&&typeof i.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let c;i.customLevels&&(c=i.useOnlyCustomLevels?i.customLevels:Object.assign({},i.levels,i.customLevels)),s=fW({caller:n,...i.transport,levels:c})}if(i=Object.assign({},e,i),i.serializers=Object.assign({},e.serializers,i.serializers),i.formatters=Object.assign({},e.formatters,i.formatters),i.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:o,onChild:a}=i;return o===!1&&(i.level="silent"),a||(i.onChild=fo),s||(yW(process.stdout)?s=process.stdout:s=Ep({fd:process.stdout.fd||1})),{opts:i,stream:s}}}function TW(e,t){try{return JSON.stringify(e)}catch{try{return(t||this[Jb])(e)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function EW(e,t,r){return{level:e,bindings:t,log:r}}function xW(e){let t=Number(e);return typeof e=="string"&&Number.isFinite(t)?t:e===void 0?1:e}TI.exports={noop:fo,buildSafeSonicBoom:Ep,asChindings:gW,asJson:mW,genLog:hW,createArgsNormalizer:vW,stringify:TW,buildFormatters:EW,normalizeDestFileDescriptor:xW}});var Sp=T((Ohe,EI)=>{"use strict";u();var wW={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},SW={ASC:"ASC",DESC:"DESC"};EI.exports={DEFAULT_LEVELS:wW,SORTING_ORDER:SW}});var Zb=T((Ahe,OI)=>{"use strict";u();var{lsCacheSym:OW,levelValSym:Yb,useOnlyCustomLevelsSym:_W,streamSym:AW,formattersSym:NW,hooksSym:IW,levelCompSym:xI}=lo(),{noop:RW,genLog:rs}=wp(),{DEFAULT_LEVELS:vn,SORTING_ORDER:wI}=Sp(),SI={fatal:e=>{let t=rs(vn.fatal,e);return function(...r){let n=this[AW];if(t.call(this,...r),typeof n.flushSync=="function")try{n.flushSync()}catch{}}},error:e=>rs(vn.error,e),warn:e=>rs(vn.warn,e),info:e=>rs(vn.info,e),debug:e=>rs(vn.debug,e),trace:e=>rs(vn.trace,e)},Xb=Object.keys(vn).reduce((e,t)=>(e[vn[t]]=t,e),{}),CW=Object.keys(Xb).reduce((e,t)=>(e[t]='{"level":'+Number(t),e),{});function LW(e){let t=e[NW].level,{labels:r}=e.levels,n={};for(let i in r){let s=t(r[i],Number(i));n[i]=JSON.stringify(s).slice(0,-1)}return e[OW]=n,e}function kW(e,t){if(t)return!1;switch(e){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return!0;default:return!1}}function DW(e){let{labels:t,values:r}=this.levels;if(typeof e=="number"){if(t[e]===void 0)throw Error("unknown level value"+e);e=t[e]}if(r[e]===void 0)throw Error("unknown level "+e);let n=this[Yb],i=this[Yb]=r[e],s=this[_W],o=this[xI],a=this[IW].logMethod;for(let c in r){if(o(r[c],i)===!1){this[c]=RW;continue}this[c]=kW(c,s)?SI[c](a):rs(r[c],a)}this.emit("level-change",e,i,t[n],n,this)}function $W(e){let{levels:t,levelVal:r}=this;return t&&t.labels?t.labels[r]:""}function PW(e){let{values:t}=this.levels,r=t[e];return r!==void 0&&this[xI](r,this[Yb])}function jW(e,t,r){return e===wI.DESC?t<=r:t>=r}function qW(e){return typeof e=="string"?jW.bind(null,e):e}function FW(e=null,t=!1){let r=e?Object.keys(e).reduce((s,o)=>(s[e[o]]=o,s),{}):null,n=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),t?null:Xb,r),i=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),t?null:vn,e);return{labels:n,values:i}}function MW(e,t,r){if(typeof e=="number"){if(![].concat(Object.keys(t||{}).map(s=>t[s]),r?[]:Object.keys(Xb).map(s=>+s),1/0).includes(e))throw Error(`default level:${e} must be included in custom levels`);return}let n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:vn,t);if(!(e in n))throw Error(`default level:${e} must be included in custom levels`)}function UW(e,t){let{labels:r,values:n}=e;for(let i in t){if(i in n)throw Error("levels cannot be overridden");if(t[i]in r)throw Error("pre-existing level values cannot be used for new levels")}}function BW(e){if(typeof e!="function"&&!(typeof e=="string"&&Object.values(wI).includes(e)))throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type')}OI.exports={initialLsCache:CW,genLsCache:LW,levelMethods:SI,getLevel:$W,setLevel:DW,isLevelEnabled:PW,mappings:FW,assertNoLevelCollisions:UW,assertDefaultLevelFound:MW,genLevelComparison:qW,assertLevelComparison:BW}});var ev=T((Ihe,_I)=>{"use strict";u();_I.exports={version:"9.14.0"}});var DI=T((Lhe,kI)=>{"use strict";u();var{EventEmitter:VW}=_e("node:events"),{lsCacheSym:KW,levelValSym:GW,setLevelSym:_p,getLevelSym:AI,chindingsSym:Ap,parsedChindingsSym:HW,mixinSym:QW,asJsonSym:II,writeSym:zW,mixinMergeStrategySym:WW,timeSym:JW,timeSliceIndexSym:YW,streamSym:RI,serializersSym:ns,formattersSym:lc,errorKeySym:XW,messageKeySym:ZW,useOnlyCustomLevelsSym:eJ,needsMetadataGsym:tJ,redactFmtSym:rJ,stringifySym:nJ,formatOptsSym:iJ,stringifiersSym:sJ,msgPrefixSym:rv,hooksSym:oJ}=lo(),{getLevel:aJ,setLevel:cJ,isLevelEnabled:uJ,mappings:lJ,initialLsCache:pJ,genLsCache:dJ,assertNoLevelCollisions:fJ}=Zb(),{asChindings:nv,asJson:hJ,buildFormatters:tv,stringify:NI,noop:CI}=wp(),{version:mJ}=ev(),gJ=Db(),yJ=class{},LI={constructor:yJ,child:bJ,bindings:vJ,setBindings:TJ,flush:wJ,isLevelEnabled:uJ,version:mJ,get level(){return this[AI]()},set level(e){this[_p](e)},get levelVal(){return this[GW]},set levelVal(e){throw Error("levelVal is read-only")},get msgPrefix(){return this[rv]},get[Symbol.toStringTag](){return"Pino"},[KW]:pJ,[zW]:xJ,[II]:hJ,[AI]:aJ,[_p]:cJ};Object.setPrototypeOf(LI,VW.prototype);kI.exports=function(){return Object.create(LI)};var Op=e=>e;function bJ(e,t){if(!e)throw Error("missing bindings for child Pino");let r=this[ns],n=this[lc],i=Object.create(this);if(t==null)return i[lc].bindings!==Op&&(i[lc]=tv(n.level,Op,n.log)),i[Ap]=nv(i,e),i[_p](this.level),this.onChild!==CI&&this.onChild(i),i;if(t.hasOwnProperty("serializers")===!0){i[ns]=Object.create(null);for(let p in r)i[ns][p]=r[p];let c=Object.getOwnPropertySymbols(r);for(var s=0;s<c.length;s++){let p=c[s];i[ns][p]=r[p]}for(let p in t.serializers)i[ns][p]=t.serializers[p];let l=Object.getOwnPropertySymbols(t.serializers);for(var o=0;o<l.length;o++){let p=l[o];i[ns][p]=t.serializers[p]}}else i[ns]=r;if(t.hasOwnProperty("formatters")){let{level:c,bindings:l,log:p}=t.formatters;i[lc]=tv(c||n.level,l||Op,p||n.log)}else i[lc]=tv(n.level,Op,n.log);if(t.hasOwnProperty("customLevels")===!0&&(fJ(this.levels,t.customLevels),i.levels=lJ(t.customLevels,i[eJ]),dJ(i)),typeof t.redact=="object"&&t.redact!==null||Array.isArray(t.redact)){i.redact=t.redact;let c=gJ(i.redact,NI),l={stringify:c[rJ]};i[nJ]=NI,i[sJ]=c,i[iJ]=l}typeof t.msgPrefix=="string"&&(i[rv]=(this[rv]||"")+t.msgPrefix),i[Ap]=nv(i,e);let a=t.level||this.level;return i[_p](a),this.onChild(i),i}function vJ(){let t=`{${this[Ap].substr(1)}}`,r=JSON.parse(t);return delete r.pid,delete r.hostname,r}function TJ(e){let t=nv(this,e);this[Ap]=t,delete this[HW]}function EJ(e,t){return Object.assign(t,e)}function xJ(e,t,r){let n=this[JW](),i=this[QW],s=this[XW],o=this[ZW],a=this[WW]||EJ,c,l=this[oJ].streamWrite;e==null?c={}:e instanceof Error?(c={[s]:e},t===void 0&&(t=e.message)):(c=e,t===void 0&&e[o]===void 0&&e[s]&&(t=e[s].message)),i&&(c=a(c,i(c,r,this)));let p=this[II](c,t,r,n),d=this[RI];d[tJ]===!0&&(d.lastLevel=r,d.lastObj=c,d.lastMsg=t,d.lastTime=n.slice(this[YW]),d.lastLogger=this),d.write(l?l(p):p)}function wJ(e){if(e!=null&&typeof e!="function")throw Error("callback must be a function");let t=this[RI];typeof t.flush=="function"?t.flush(e||CI):e&&e()}});var qI=T((av,jI)=>{"use strict";u();var{hasOwnProperty:pc}=Object.prototype,ss=ov();ss.configure=ov;ss.stringify=ss;ss.default=ss;av.stringify=ss;av.configure=ov;jI.exports=ss;var SJ=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function mi(e){return e.length<5e3&&!SJ.test(e)?`"${e}"`:JSON.stringify(e)}function iv(e,t){if(e.length>200||t)return e.sort(t);for(let r=1;r<e.length;r++){let n=e[r],i=r;for(;i!==0&&e[i-1]>n;)e[i]=e[i-1],i--;e[i]=n}return e}var OJ=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function sv(e){return OJ.call(e)!==void 0&&e.length!==0}function $I(e,t,r){e.length<r&&(r=e.length);let n=t===","?"":" ",i=`"0":${n}${e[0]}`;for(let s=1;s<r;s++)i+=`${t}"${s}":${n}${e[s]}`;return i}function _J(e){if(pc.call(e,"circularValue")){let t=e.circularValue;if(typeof t=="string")return`"${t}"`;if(t==null)return t;if(t===Error||t===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function AJ(e){let t;if(pc.call(e,"deterministic")&&(t=e.deterministic,typeof t!="boolean"&&typeof t!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return t===void 0?!0:t}function NJ(e,t){let r;if(pc.call(e,t)&&(r=e[t],typeof r!="boolean"))throw new TypeError(`The "${t}" argument must be of type boolean`);return r===void 0?!0:r}function PI(e,t){let r;if(pc.call(e,t)){if(r=e[t],typeof r!="number")throw new TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${t}" argument must be an integer`);if(r<1)throw new RangeError(`The "${t}" argument must be >= 1`)}return r===void 0?1/0:r}function is(e){return e===1?"1 item":`${e} items`}function IJ(e){let t=new Set;for(let r of e)(typeof r=="string"||typeof r=="number")&&t.add(String(r));return t}function RJ(e){if(pc.call(e,"strict")){let t=e.strict;if(typeof t!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(t)return r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function ov(e){e={...e};let t=RJ(e);t&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let r=_J(e),n=NJ(e,"bigint"),i=AJ(e),s=typeof i=="function"?i:void 0,o=PI(e,"maximumDepth"),a=PI(e,"maximumBreadth");function c(m,h,v,E,A,w){let _=h[m];switch(typeof _=="object"&&_!==null&&typeof _.toJSON=="function"&&(_=_.toJSON(m)),_=E.call(h,m,_),typeof _){case"string":return mi(_);case"object":{if(_===null)return"null";if(v.indexOf(_)!==-1)return r;let I="",C=",",R=w;if(Array.isArray(_)){if(_.length===0)return"[]";if(o<v.length+1)return'"[Array]"';v.push(_),A!==""&&(w+=A,I+=`
292
+ ${w}`,C=`,
293
+ ${w}`);let $=Math.min(_.length,a),B=0;for(;B<$-1;B++){let S=c(String(B),_,v,E,A,w);I+=S!==void 0?S:"null",I+=C}let x=c(String(B),_,v,E,A,w);if(I+=x!==void 0?x:"null",_.length-1>a){let S=_.length-a-1;I+=`${C}"... ${is(S)} not stringified"`}return A!==""&&(I+=`
294
+ ${R}`),v.pop(),`[${I}]`}let q=Object.keys(_),k=q.length;if(k===0)return"{}";if(o<v.length+1)return'"[Object]"';let b="",g="";A!==""&&(w+=A,C=`,
295
+ ${w}`,b=" ");let D=Math.min(k,a);i&&!sv(_)&&(q=iv(q,s)),v.push(_);for(let $=0;$<D;$++){let B=q[$],x=c(B,_,v,E,A,w);x!==void 0&&(I+=`${g}${mi(B)}:${b}${x}`,g=C)}if(k>a){let $=k-a;I+=`${g}"...":${b}"${is($)} not stringified"`,g=C}return A!==""&&g.length>1&&(I=`
296
+ ${w}${I}
297
+ ${R}`),v.pop(),`{${I}}`}case"number":return isFinite(_)?String(_):t?t(_):"null";case"boolean":return _===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(_);default:return t?t(_):void 0}}function l(m,h,v,E,A,w){switch(typeof h=="object"&&h!==null&&typeof h.toJSON=="function"&&(h=h.toJSON(m)),typeof h){case"string":return mi(h);case"object":{if(h===null)return"null";if(v.indexOf(h)!==-1)return r;let _=w,I="",C=",";if(Array.isArray(h)){if(h.length===0)return"[]";if(o<v.length+1)return'"[Array]"';v.push(h),A!==""&&(w+=A,I+=`
298
+ ${w}`,C=`,
299
+ ${w}`);let k=Math.min(h.length,a),b=0;for(;b<k-1;b++){let D=l(String(b),h[b],v,E,A,w);I+=D!==void 0?D:"null",I+=C}let g=l(String(b),h[b],v,E,A,w);if(I+=g!==void 0?g:"null",h.length-1>a){let D=h.length-a-1;I+=`${C}"... ${is(D)} not stringified"`}return A!==""&&(I+=`
300
+ ${_}`),v.pop(),`[${I}]`}v.push(h);let R="";A!==""&&(w+=A,C=`,
301
+ ${w}`,R=" ");let q="";for(let k of E){let b=l(k,h[k],v,E,A,w);b!==void 0&&(I+=`${q}${mi(k)}:${R}${b}`,q=C)}return A!==""&&q.length>1&&(I=`
302
+ ${w}${I}
303
+ ${_}`),v.pop(),`{${I}}`}case"number":return isFinite(h)?String(h):t?t(h):"null";case"boolean":return h===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(h);default:return t?t(h):void 0}}function p(m,h,v,E,A){switch(typeof h){case"string":return mi(h);case"object":{if(h===null)return"null";if(typeof h.toJSON=="function"){if(h=h.toJSON(m),typeof h!="object")return p(m,h,v,E,A);if(h===null)return"null"}if(v.indexOf(h)!==-1)return r;let w=A;if(Array.isArray(h)){if(h.length===0)return"[]";if(o<v.length+1)return'"[Array]"';v.push(h),A+=E;let b=`
304
+ ${A}`,g=`,
305
+ ${A}`,D=Math.min(h.length,a),$=0;for(;$<D-1;$++){let x=p(String($),h[$],v,E,A);b+=x!==void 0?x:"null",b+=g}let B=p(String($),h[$],v,E,A);if(b+=B!==void 0?B:"null",h.length-1>a){let x=h.length-a-1;b+=`${g}"... ${is(x)} not stringified"`}return b+=`
306
+ ${w}`,v.pop(),`[${b}]`}let _=Object.keys(h),I=_.length;if(I===0)return"{}";if(o<v.length+1)return'"[Object]"';A+=E;let C=`,
307
+ ${A}`,R="",q="",k=Math.min(I,a);sv(h)&&(R+=$I(h,C,a),_=_.slice(h.length),k-=h.length,q=C),i&&(_=iv(_,s)),v.push(h);for(let b=0;b<k;b++){let g=_[b],D=p(g,h[g],v,E,A);D!==void 0&&(R+=`${q}${mi(g)}: ${D}`,q=C)}if(I>a){let b=I-a;R+=`${q}"...": "${is(b)} not stringified"`,q=C}return q!==""&&(R=`
308
+ ${A}${R}
309
+ ${w}`),v.pop(),`{${R}}`}case"number":return isFinite(h)?String(h):t?t(h):"null";case"boolean":return h===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(h);default:return t?t(h):void 0}}function d(m,h,v){switch(typeof h){case"string":return mi(h);case"object":{if(h===null)return"null";if(typeof h.toJSON=="function"){if(h=h.toJSON(m),typeof h!="object")return d(m,h,v);if(h===null)return"null"}if(v.indexOf(h)!==-1)return r;let E="",A=h.length!==void 0;if(A&&Array.isArray(h)){if(h.length===0)return"[]";if(o<v.length+1)return'"[Array]"';v.push(h);let R=Math.min(h.length,a),q=0;for(;q<R-1;q++){let b=d(String(q),h[q],v);E+=b!==void 0?b:"null",E+=","}let k=d(String(q),h[q],v);if(E+=k!==void 0?k:"null",h.length-1>a){let b=h.length-a-1;E+=`,"... ${is(b)} not stringified"`}return v.pop(),`[${E}]`}let w=Object.keys(h),_=w.length;if(_===0)return"{}";if(o<v.length+1)return'"[Object]"';let I="",C=Math.min(_,a);A&&sv(h)&&(E+=$I(h,",",a),w=w.slice(h.length),C-=h.length,I=","),i&&(w=iv(w,s)),v.push(h);for(let R=0;R<C;R++){let q=w[R],k=d(q,h[q],v);k!==void 0&&(E+=`${I}${mi(q)}:${k}`,I=",")}if(_>a){let R=_-a;E+=`${I}"...":"${is(R)} not stringified"`}return v.pop(),`{${E}}`}case"number":return isFinite(h)?String(h):t?t(h):"null";case"boolean":return h===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(h);default:return t?t(h):void 0}}function f(m,h,v){if(arguments.length>1){let E="";if(typeof v=="number"?E=" ".repeat(Math.min(v,10)):typeof v=="string"&&(E=v.slice(0,10)),h!=null){if(typeof h=="function")return c("",{"":m},[],h,E,"");if(Array.isArray(h))return l("",m,[],IJ(h),E,"")}if(E.length!==0)return p("",m,[],E,"")}return d("",m,[])}return f}});var BI=T(($he,UI)=>{"use strict";u();var cv=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:MI}=Sp(),CJ=MI.info;function LJ(e,t){e=e||[],t=t||{dedupe:!1};let r=Object.create(MI);r.silent=1/0,t.levels&&typeof t.levels=="object"&&Object.keys(t.levels).forEach(d=>{r[d]=t.levels[d]});let n={write:i,add:a,remove:c,emit:s,flushSync:o,end:l,minLevel:0,lastId:0,streams:[],clone:p,[cv]:!0,streamLevels:r};return Array.isArray(e)?e.forEach(a,n):a.call(n,e),e=null,n;function i(d){let f,m=this.lastLevel,{streams:h}=this,v=0,E;for(let A=kJ(h.length,t.dedupe);$J(A,h.length,t.dedupe);A=DJ(A,t.dedupe))if(f=h[A],f.level<=m){if(v!==0&&v!==f.level)break;if(E=f.stream,E[cv]){let{lastTime:w,lastMsg:_,lastObj:I,lastLogger:C}=this;E.lastLevel=m,E.lastTime=w,E.lastMsg=_,E.lastObj=I,E.lastLogger=C}E.write(d),t.dedupe&&(v=f.level)}else if(!t.dedupe)break}function s(...d){for(let{stream:f}of this.streams)typeof f.emit=="function"&&f.emit(...d)}function o(){for(let{stream:d}of this.streams)typeof d.flushSync=="function"&&d.flushSync()}function a(d){if(!d)return n;let f=typeof d.write=="function"||d.stream,m=d.write?d:d.stream;if(!f)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:h,streamLevels:v}=this,E;typeof d.levelVal=="number"?E=d.levelVal:typeof d.level=="string"?E=v[d.level]:typeof d.level=="number"?E=d.level:E=CJ;let A={stream:m,level:E,levelVal:void 0,id:++n.lastId};return h.unshift(A),h.sort(FI),this.minLevel=h[0].level,n}function c(d){let{streams:f}=this,m=f.findIndex(h=>h.id===d);return m>=0&&(f.splice(m,1),f.sort(FI),this.minLevel=f.length>0?f[0].level:-1),n}function l(){for(let{stream:d}of this.streams)typeof d.flushSync=="function"&&d.flushSync(),d.end()}function p(d){let f=new Array(this.streams.length);for(let m=0;m<f.length;m++)f[m]={level:d,stream:this.streams[m].stream};return{write:i,add:a,remove:c,minLevel:d,streams:f,clone:p,emit:s,flushSync:o,[cv]:!0}}}function FI(e,t){return e.level-t.level}function kJ(e,t){return t?e-1:0}function DJ(e,t){return t?e-1:e+1}function $J(e,t,r){return r?e>=0:e<t}UI.exports=LJ});var rR=T((jhe,kr)=>{"use strict";u();var PJ=_e("node:os"),JI=Rb(),jJ=Cb(),qJ=Db(),YI=$N(),FJ=DI(),XI=lo(),{configure:MJ}=qI(),{assertDefaultLevelFound:UJ,mappings:ZI,genLsCache:BJ,genLevelComparison:VJ,assertLevelComparison:KJ}=Zb(),{DEFAULT_LEVELS:eR,SORTING_ORDER:GJ}=Sp(),{createArgsNormalizer:HJ,asChindings:QJ,buildSafeSonicBoom:VI,buildFormatters:zJ,stringify:uv,normalizeDestFileDescriptor:KI,noop:WJ}=wp(),{version:JJ}=ev(),{chindingsSym:GI,redactFmtSym:YJ,serializersSym:HI,timeSym:XJ,timeSliceIndexSym:ZJ,streamSym:e3,stringifySym:QI,stringifySafeSym:lv,stringifiersSym:zI,setLevelSym:t3,endSym:r3,formatOptsSym:n3,messageKeySym:i3,errorKeySym:s3,nestedKeySym:o3,mixinSym:a3,levelCompSym:c3,useOnlyCustomLevelsSym:u3,formattersSym:WI,hooksSym:l3,nestedKeyStrSym:p3,mixinMergeStrategySym:d3,msgPrefixSym:f3}=XI,{epochTime:tR,nullTime:h3}=YI,{pid:m3}=process,g3=PJ.hostname(),y3=JI.err,b3={level:"info",levelComparison:GJ.ASC,levels:eR,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:m3,hostname:g3},serializers:Object.assign(Object.create(null),{err:y3}),formatters:Object.assign(Object.create(null),{bindings(e){return e},level(e,t){return{level:t}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:tR,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},v3=HJ(b3),T3=Object.assign(Object.create(null),JI);function pv(...e){let t={},{opts:r,stream:n}=v3(t,jJ(),...e);r.level&&typeof r.level=="string"&&eR[r.level.toLowerCase()]!==void 0&&(r.level=r.level.toLowerCase());let{redact:i,crlf:s,serializers:o,timestamp:a,messageKey:c,errorKey:l,nestedKey:p,base:d,name:f,level:m,customLevels:h,levelComparison:v,mixin:E,mixinMergeStrategy:A,useOnlyCustomLevels:w,formatters:_,hooks:I,depthLimit:C,edgeLimit:R,onChild:q,msgPrefix:k}=r,b=MJ({maximumDepth:C,maximumBreadth:R}),g=zJ(_.level,_.bindings,_.log),D=uv.bind({[lv]:b}),$=i?qJ(i,D):{},B=i?{stringify:$[YJ]}:{stringify:D},x="}"+(s?`\r
310
+ `:`
311
+ `),S=QJ.bind(null,{[GI]:"",[HI]:o,[zI]:$,[QI]:uv,[lv]:b,[WI]:g}),ie="";d!==null&&(f===void 0?ie=S(d):ie=S(Object.assign({},d,{name:f})));let J=a instanceof Function?a:a?tR:h3,Z=J().indexOf(":")+1;if(w&&!h)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(E&&typeof E!="function")throw Error(`Unknown mixin type "${typeof E}" - expected "function"`);if(k&&typeof k!="string")throw Error(`Unknown msgPrefix type "${typeof k}" - expected "string"`);UJ(m,h,w);let Te=ZI(h,w);typeof n.emit=="function"&&n.emit("message",{code:"PINO_CONFIG",config:{levels:Te,messageKey:c,errorKey:l}}),KJ(v);let z=VJ(v);return Object.assign(t,{levels:Te,[c3]:z,[u3]:w,[e3]:n,[XJ]:J,[ZJ]:Z,[QI]:uv,[lv]:b,[zI]:$,[r3]:x,[n3]:B,[i3]:c,[s3]:l,[o3]:p,[p3]:p?`,${JSON.stringify(p)}:{`:"",[HI]:o,[a3]:E,[d3]:A,[GI]:ie,[WI]:g,[l3]:I,silent:WJ,onChild:q,[f3]:k}),Object.setPrototypeOf(t,FJ()),BJ(t),t[t3](m),t}kr.exports=pv;kr.exports.destination=(e=process.stdout.fd)=>typeof e=="object"?(e.dest=KI(e.dest||process.stdout.fd),VI(e)):VI({dest:KI(e),minLength:0});kr.exports.transport=Qb();kr.exports.multistream=BI();kr.exports.levels=ZI();kr.exports.stdSerializers=T3;kr.exports.stdTimeFunctions=Object.assign({},YI);kr.exports.symbols=XI;kr.exports.version=JJ;kr.exports.default=pv;kr.exports.pino=pv});var fc=T((ame,vR)=>{"use strict";u();var mR="[^\\\\/]",I3="(?=.)",gR="[^/]",fv="(?:\\/|$)",yR="(?:^|\\/)",hv=`\\.{1,2}${fv}`,R3="(?!\\.)",C3=`(?!${yR}${hv})`,L3=`(?!\\.{0,1}${fv})`,k3=`(?!${hv})`,D3="[^.\\/]",$3=`${gR}*?`,P3="/",bR={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:I3,QMARK:gR,END_ANCHOR:fv,DOTS_SLASH:hv,NO_DOT:R3,NO_DOTS:C3,NO_DOT_SLASH:L3,NO_DOTS_SLASH:k3,QMARK_NO_DOT:D3,STAR:$3,START_ANCHOR:yR,SEP:P3},j3={...bR,SLASH_LITERAL:"[\\\\/]",QMARK:mR,STAR:`${mR}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},q3={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};vR.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:q3,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===!0?j3:bR}}});var hc=T(ir=>{"use strict";u();var{REGEX_BACKSLASH:F3,REGEX_REMOVE_BACKSLASH:M3,REGEX_SPECIAL_CHARS:U3,REGEX_SPECIAL_CHARS_GLOBAL:B3}=fc();ir.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);ir.hasRegexChars=e=>U3.test(e);ir.isRegexChar=e=>e.length===1&&ir.hasRegexChars(e);ir.escapeRegex=e=>e.replace(B3,"\\$1");ir.toPosixSlashes=e=>e.replace(F3,"/");ir.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let e=navigator.platform.toLowerCase();return e==="win32"||e==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};ir.removeBackslashes=e=>e.replace(M3,t=>t==="\\"?"":t);ir.escapeLast=(e,t,r)=>{let n=e.lastIndexOf(t,r);return n===-1?e:e[n-1]==="\\"?ir.escapeLast(e,t,n-1):`${e.slice(0,n)}\\${e.slice(n)}`};ir.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r};ir.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",s=`${n}(?:${e})${i}`;return t.negated===!0&&(s=`(?:^(?!${s}).*$)`),s};ir.basename=(e,{windows:t}={})=>{let r=e.split(t?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var AR=T((pme,_R)=>{"use strict";u();var TR=hc(),{CHAR_ASTERISK:mv,CHAR_AT:V3,CHAR_BACKWARD_SLASH:mc,CHAR_COMMA:K3,CHAR_DOT:gv,CHAR_EXCLAMATION_MARK:yv,CHAR_FORWARD_SLASH:OR,CHAR_LEFT_CURLY_BRACE:bv,CHAR_LEFT_PARENTHESES:vv,CHAR_LEFT_SQUARE_BRACKET:G3,CHAR_PLUS:H3,CHAR_QUESTION_MARK:ER,CHAR_RIGHT_CURLY_BRACE:Q3,CHAR_RIGHT_PARENTHESES:xR,CHAR_RIGHT_SQUARE_BRACKET:z3}=fc(),wR=e=>e===OR||e===mc,SR=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},W3=(e,t)=>{let r=t||{},n=e.length-1,i=r.parts===!0||r.scanToEnd===!0,s=[],o=[],a=[],c=e,l=-1,p=0,d=0,f=!1,m=!1,h=!1,v=!1,E=!1,A=!1,w=!1,_=!1,I=!1,C=!1,R=0,q,k,b={value:"",depth:0,isGlob:!1},g=()=>l>=n,D=()=>c.charCodeAt(l+1),$=()=>(q=k,c.charCodeAt(++l));for(;l<n;){k=$();let J;if(k===mc){w=b.backslashes=!0,k=$(),k===bv&&(A=!0);continue}if(A===!0||k===bv){for(R++;g()!==!0&&(k=$());){if(k===mc){w=b.backslashes=!0,$();continue}if(k===bv){R++;continue}if(A!==!0&&k===gv&&(k=$())===gv){if(f=b.isBrace=!0,h=b.isGlob=!0,C=!0,i===!0)continue;break}if(A!==!0&&k===K3){if(f=b.isBrace=!0,h=b.isGlob=!0,C=!0,i===!0)continue;break}if(k===Q3&&(R--,R===0)){A=!1,f=b.isBrace=!0,C=!0;break}}if(i===!0)continue;break}if(k===OR){if(s.push(l),o.push(b),b={value:"",depth:0,isGlob:!1},C===!0)continue;if(q===gv&&l===p+1){p+=2;continue}d=l+1;continue}if(r.noext!==!0&&(k===H3||k===V3||k===mv||k===ER||k===yv)===!0&&D()===vv){if(h=b.isGlob=!0,v=b.isExtglob=!0,C=!0,k===yv&&l===p&&(I=!0),i===!0){for(;g()!==!0&&(k=$());){if(k===mc){w=b.backslashes=!0,k=$();continue}if(k===xR){h=b.isGlob=!0,C=!0;break}}continue}break}if(k===mv){if(q===mv&&(E=b.isGlobstar=!0),h=b.isGlob=!0,C=!0,i===!0)continue;break}if(k===ER){if(h=b.isGlob=!0,C=!0,i===!0)continue;break}if(k===G3){for(;g()!==!0&&(J=$());){if(J===mc){w=b.backslashes=!0,$();continue}if(J===z3){m=b.isBracket=!0,h=b.isGlob=!0,C=!0;break}}if(i===!0)continue;break}if(r.nonegate!==!0&&k===yv&&l===p){_=b.negated=!0,p++;continue}if(r.noparen!==!0&&k===vv){if(h=b.isGlob=!0,i===!0){for(;g()!==!0&&(k=$());){if(k===vv){w=b.backslashes=!0,k=$();continue}if(k===xR){C=!0;break}}continue}break}if(h===!0){if(C=!0,i===!0)continue;break}}r.noext===!0&&(v=!1,h=!1);let B=c,x="",S="";p>0&&(x=c.slice(0,p),c=c.slice(p),d-=p),B&&h===!0&&d>0?(B=c.slice(0,d),S=c.slice(d)):h===!0?(B="",S=c):B=c,B&&B!==""&&B!=="/"&&B!==c&&wR(B.charCodeAt(B.length-1))&&(B=B.slice(0,-1)),r.unescape===!0&&(S&&(S=TR.removeBackslashes(S)),B&&w===!0&&(B=TR.removeBackslashes(B)));let ie={prefix:x,input:e,start:p,base:B,glob:S,isBrace:f,isBracket:m,isGlob:h,isExtglob:v,isGlobstar:E,negated:_,negatedExtglob:I};if(r.tokens===!0&&(ie.maxDepth=0,wR(k)||o.push(b),ie.tokens=o),r.parts===!0||r.tokens===!0){let J;for(let Z=0;Z<s.length;Z++){let Te=J?J+1:p,z=s[Z],he=e.slice(Te,z);r.tokens&&(Z===0&&p!==0?(o[Z].isPrefix=!0,o[Z].value=x):o[Z].value=he,SR(o[Z]),ie.maxDepth+=o[Z].depth),(Z!==0||he!=="")&&a.push(he),J=z}if(J&&J+1<e.length){let Z=e.slice(J+1);a.push(Z),r.tokens&&(o[o.length-1].value=Z,SR(o[o.length-1]),ie.maxDepth+=o[o.length-1].depth)}ie.slashes=s,ie.parts=a}return ie};_R.exports=W3});var RR=T((fme,IR)=>{"use strict";u();var Ip=fc(),Tn=hc(),{MAX_LENGTH:Rp,POSIX_REGEX_SOURCE:J3,REGEX_NON_SPECIAL_CHARS:Y3,REGEX_SPECIAL_CHARS_BACKREF:X3,REPLACEMENTS:NR}=Ip,Z3=(e,t)=>{if(typeof t.expandRange=="function")return t.expandRange(...e,t);e.sort();let r=`[${e.join("-")}]`;try{new RegExp(r)}catch{return e.map(i=>Tn.escapeRegex(i)).join("..")}return r},go=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,Tv=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=NR[e]||e;let r={...t},n=typeof r.maxLength=="number"?Math.min(Rp,r.maxLength):Rp,i=e.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:r.prepend||""},o=[s],a=r.capture?"":"?:",c=Ip.globChars(r.windows),l=Ip.extglobChars(c),{DOT_LITERAL:p,PLUS_LITERAL:d,SLASH_LITERAL:f,ONE_CHAR:m,DOTS_SLASH:h,NO_DOT:v,NO_DOT_SLASH:E,NO_DOTS_SLASH:A,QMARK:w,QMARK_NO_DOT:_,STAR:I,START_ANCHOR:C}=c,R=U=>`(${a}(?:(?!${C}${U.dot?h:p}).)*?)`,q=r.dot?"":v,k=r.dot?w:_,b=r.bash===!0?R(r):I;r.capture&&(b=`(${b})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let g={input:e,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};e=Tn.removePrefix(e,g),i=e.length;let D=[],$=[],B=[],x=s,S,ie=()=>g.index===i-1,J=g.peek=(U=1)=>e[g.index+U],Z=g.advance=()=>e[++g.index]||"",Te=()=>e.slice(g.index+1),z=(U="",me=0)=>{g.consumed+=U,g.index+=me},he=U=>{g.output+=U.output!=null?U.output:U.value,z(U.value)},O=()=>{let U=1;for(;J()==="!"&&(J(2)!=="("||J(3)==="?");)Z(),g.start++,U++;return U%2===0?!1:(g.negated=!0,g.start++,!0)},F=U=>{g[U]++,B.push(U)},V=U=>{g[U]--,B.pop()},P=U=>{if(x.type==="globstar"){let me=g.braces>0&&(U.type==="comma"||U.type==="brace"),K=U.extglob===!0||D.length&&(U.type==="pipe"||U.type==="paren");U.type!=="slash"&&U.type!=="paren"&&!me&&!K&&(g.output=g.output.slice(0,-x.output.length),x.type="star",x.value="*",x.output=b,g.output+=x.output)}if(D.length&&U.type!=="paren"&&(D[D.length-1].inner+=U.value),(U.value||U.output)&&he(U),x&&x.type==="text"&&U.type==="text"){x.output=(x.output||x.value)+U.value,x.value+=U.value;return}U.prev=x,o.push(U),x=U},we=(U,me)=>{let K={...l[me],conditions:1,inner:""};K.prev=x,K.parens=g.parens,K.output=g.output;let le=(r.capture?"(":"")+K.open;F("parens"),P({type:U,value:me,output:g.output?"":m}),P({type:"paren",extglob:!0,value:Z(),output:le}),D.push(K)},Y=U=>{let me=U.close+(r.capture?")":""),K;if(U.type==="negate"){let le=b;if(U.inner&&U.inner.length>1&&U.inner.includes("/")&&(le=R(r)),(le!==b||ie()||/^\)+$/.test(Te()))&&(me=U.close=`)$))${le}`),U.inner.includes("*")&&(K=Te())&&/^\.[^\\/.]+$/.test(K)){let de=Tv(K,{...t,fastpaths:!1}).output;me=U.close=`)${de})${le})`}U.prev.type==="bos"&&(g.negatedExtglob=!0)}P({type:"paren",extglob:!0,value:S,output:me}),V("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let U=!1,me=e.replace(X3,(K,le,de,ct,ze,To)=>ct==="\\"?(U=!0,K):ct==="?"?le?le+ct+(ze?w.repeat(ze.length):""):To===0?k+(ze?w.repeat(ze.length):""):w.repeat(de.length):ct==="."?p.repeat(de.length):ct==="*"?le?le+ct+(ze?b:""):b:le?K:`\\${K}`);return U===!0&&(r.unescape===!0?me=me.replace(/\\/g,""):me=me.replace(/\\+/g,K=>K.length%2===0?"\\\\":K?"\\":"")),me===e&&r.contains===!0?(g.output=e,g):(g.output=Tn.wrapOutput(me,g,t),g)}for(;!ie();){if(S=Z(),S==="\0")continue;if(S==="\\"){let K=J();if(K==="/"&&r.bash!==!0||K==="."||K===";")continue;if(!K){S+="\\",P({type:"text",value:S});continue}let le=/^\\+/.exec(Te()),de=0;if(le&&le[0].length>2&&(de=le[0].length,g.index+=de,de%2!==0&&(S+="\\")),r.unescape===!0?S=Z():S+=Z(),g.brackets===0){P({type:"text",value:S});continue}}if(g.brackets>0&&(S!=="]"||x.value==="["||x.value==="[^")){if(r.posix!==!1&&S===":"){let K=x.value.slice(1);if(K.includes("[")&&(x.posix=!0,K.includes(":"))){let le=x.value.lastIndexOf("["),de=x.value.slice(0,le),ct=x.value.slice(le+2),ze=J3[ct];if(ze){x.value=de+ze,g.backtrack=!0,Z(),!s.output&&o.indexOf(x)===1&&(s.output=m);continue}}}(S==="["&&J()!==":"||S==="-"&&J()==="]")&&(S=`\\${S}`),S==="]"&&(x.value==="["||x.value==="[^")&&(S=`\\${S}`),r.posix===!0&&S==="!"&&x.value==="["&&(S="^"),x.value+=S,he({value:S});continue}if(g.quotes===1&&S!=='"'){S=Tn.escapeRegex(S),x.value+=S,he({value:S});continue}if(S==='"'){g.quotes=g.quotes===1?0:1,r.keepQuotes===!0&&P({type:"text",value:S});continue}if(S==="("){F("parens"),P({type:"paren",value:S});continue}if(S===")"){if(g.parens===0&&r.strictBrackets===!0)throw new SyntaxError(go("opening","("));let K=D[D.length-1];if(K&&g.parens===K.parens+1){Y(D.pop());continue}P({type:"paren",value:S,output:g.parens?")":"\\)"}),V("parens");continue}if(S==="["){if(r.nobracket===!0||!Te().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(go("closing","]"));S=`\\${S}`}else F("brackets");P({type:"bracket",value:S});continue}if(S==="]"){if(r.nobracket===!0||x&&x.type==="bracket"&&x.value.length===1){P({type:"text",value:S,output:`\\${S}`});continue}if(g.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(go("opening","["));P({type:"text",value:S,output:`\\${S}`});continue}V("brackets");let K=x.value.slice(1);if(x.posix!==!0&&K[0]==="^"&&!K.includes("/")&&(S=`/${S}`),x.value+=S,he({value:S}),r.literalBrackets===!1||Tn.hasRegexChars(K))continue;let le=Tn.escapeRegex(x.value);if(g.output=g.output.slice(0,-x.value.length),r.literalBrackets===!0){g.output+=le,x.value=le;continue}x.value=`(${a}${le}|${x.value})`,g.output+=x.value;continue}if(S==="{"&&r.nobrace!==!0){F("braces");let K={type:"brace",value:S,output:"(",outputIndex:g.output.length,tokensIndex:g.tokens.length};$.push(K),P(K);continue}if(S==="}"){let K=$[$.length-1];if(r.nobrace===!0||!K){P({type:"text",value:S,output:S});continue}let le=")";if(K.dots===!0){let de=o.slice(),ct=[];for(let ze=de.length-1;ze>=0&&(o.pop(),de[ze].type!=="brace");ze--)de[ze].type!=="dots"&&ct.unshift(de[ze].value);le=Z3(ct,r),g.backtrack=!0}if(K.comma!==!0&&K.dots!==!0){let de=g.output.slice(0,K.outputIndex),ct=g.tokens.slice(K.tokensIndex);K.value=K.output="\\{",S=le="\\}",g.output=de;for(let ze of ct)g.output+=ze.output||ze.value}P({type:"brace",value:S,output:le}),V("braces"),$.pop();continue}if(S==="|"){D.length>0&&D[D.length-1].conditions++,P({type:"text",value:S});continue}if(S===","){let K=S,le=$[$.length-1];le&&B[B.length-1]==="braces"&&(le.comma=!0,K="|"),P({type:"comma",value:S,output:K});continue}if(S==="/"){if(x.type==="dot"&&g.index===g.start+1){g.start=g.index+1,g.consumed="",g.output="",o.pop(),x=s;continue}P({type:"slash",value:S,output:f});continue}if(S==="."){if(g.braces>0&&x.type==="dot"){x.value==="."&&(x.output=p);let K=$[$.length-1];x.type="dots",x.output+=S,x.value+=S,K.dots=!0;continue}if(g.braces+g.parens===0&&x.type!=="bos"&&x.type!=="slash"){P({type:"text",value:S,output:p});continue}P({type:"dot",value:S,output:p});continue}if(S==="?"){if(!(x&&x.value==="(")&&r.noextglob!==!0&&J()==="("&&J(2)!=="?"){we("qmark",S);continue}if(x&&x.type==="paren"){let le=J(),de=S;(x.value==="("&&!/[!=<:]/.test(le)||le==="<"&&!/<([!=]|\w+>)/.test(Te()))&&(de=`\\${S}`),P({type:"text",value:S,output:de});continue}if(r.dot!==!0&&(x.type==="slash"||x.type==="bos")){P({type:"qmark",value:S,output:_});continue}P({type:"qmark",value:S,output:w});continue}if(S==="!"){if(r.noextglob!==!0&&J()==="("&&(J(2)!=="?"||!/[!=<:]/.test(J(3)))){we("negate",S);continue}if(r.nonegate!==!0&&g.index===0){O();continue}}if(S==="+"){if(r.noextglob!==!0&&J()==="("&&J(2)!=="?"){we("plus",S);continue}if(x&&x.value==="("||r.regex===!1){P({type:"plus",value:S,output:d});continue}if(x&&(x.type==="bracket"||x.type==="paren"||x.type==="brace")||g.parens>0){P({type:"plus",value:S});continue}P({type:"plus",value:d});continue}if(S==="@"){if(r.noextglob!==!0&&J()==="("&&J(2)!=="?"){P({type:"at",extglob:!0,value:S,output:""});continue}P({type:"text",value:S});continue}if(S!=="*"){(S==="$"||S==="^")&&(S=`\\${S}`);let K=Y3.exec(Te());K&&(S+=K[0],g.index+=K[0].length),P({type:"text",value:S});continue}if(x&&(x.type==="globstar"||x.star===!0)){x.type="star",x.star=!0,x.value+=S,x.output=b,g.backtrack=!0,g.globstar=!0,z(S);continue}let U=Te();if(r.noextglob!==!0&&/^\([^?]/.test(U)){we("star",S);continue}if(x.type==="star"){if(r.noglobstar===!0){z(S);continue}let K=x.prev,le=K.prev,de=K.type==="slash"||K.type==="bos",ct=le&&(le.type==="star"||le.type==="globstar");if(r.bash===!0&&(!de||U[0]&&U[0]!=="/")){P({type:"star",value:S,output:""});continue}let ze=g.braces>0&&(K.type==="comma"||K.type==="brace"),To=D.length&&(K.type==="pipe"||K.type==="paren");if(!de&&K.type!=="paren"&&!ze&&!To){P({type:"star",value:S,output:""});continue}for(;U.slice(0,3)==="/**";){let cs=e[g.index+4];if(cs&&cs!=="/")break;U=U.slice(3),z("/**",3)}if(K.type==="bos"&&ie()){x.type="globstar",x.value+=S,x.output=R(r),g.output=x.output,g.globstar=!0,z(S);continue}if(K.type==="slash"&&K.prev.type!=="bos"&&!ct&&ie()){g.output=g.output.slice(0,-(K.output+x.output).length),K.output=`(?:${K.output}`,x.type="globstar",x.output=R(r)+(r.strictSlashes?")":"|$)"),x.value+=S,g.globstar=!0,g.output+=K.output+x.output,z(S);continue}if(K.type==="slash"&&K.prev.type!=="bos"&&U[0]==="/"){let cs=U[1]!==void 0?"|$":"";g.output=g.output.slice(0,-(K.output+x.output).length),K.output=`(?:${K.output}`,x.type="globstar",x.output=`${R(r)}${f}|${f}${cs})`,x.value+=S,g.output+=K.output+x.output,g.globstar=!0,z(S+Z()),P({type:"slash",value:"/",output:""});continue}if(K.type==="bos"&&U[0]==="/"){x.type="globstar",x.value+=S,x.output=`(?:^|${f}|${R(r)}${f})`,g.output=x.output,g.globstar=!0,z(S+Z()),P({type:"slash",value:"/",output:""});continue}g.output=g.output.slice(0,-x.output.length),x.type="globstar",x.output=R(r),x.value+=S,g.output+=x.output,g.globstar=!0,z(S);continue}let me={type:"star",value:S,output:b};if(r.bash===!0){me.output=".*?",(x.type==="bos"||x.type==="slash")&&(me.output=q+me.output),P(me);continue}if(x&&(x.type==="bracket"||x.type==="paren")&&r.regex===!0){me.output=S,P(me);continue}(g.index===g.start||x.type==="slash"||x.type==="dot")&&(x.type==="dot"?(g.output+=E,x.output+=E):r.dot===!0?(g.output+=A,x.output+=A):(g.output+=q,x.output+=q),J()!=="*"&&(g.output+=m,x.output+=m)),P(me)}for(;g.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(go("closing","]"));g.output=Tn.escapeLast(g.output,"["),V("brackets")}for(;g.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(go("closing",")"));g.output=Tn.escapeLast(g.output,"("),V("parens")}for(;g.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(go("closing","}"));g.output=Tn.escapeLast(g.output,"{"),V("braces")}if(r.strictSlashes!==!0&&(x.type==="star"||x.type==="bracket")&&P({type:"maybe_slash",value:"",output:`${f}?`}),g.backtrack===!0){g.output="";for(let U of g.tokens)g.output+=U.output!=null?U.output:U.value,U.suffix&&(g.output+=U.suffix)}return g};Tv.fastpaths=(e,t)=>{let r={...t},n=typeof r.maxLength=="number"?Math.min(Rp,r.maxLength):Rp,i=e.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);e=NR[e]||e;let{DOT_LITERAL:s,SLASH_LITERAL:o,ONE_CHAR:a,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:p,NO_DOTS_SLASH:d,STAR:f,START_ANCHOR:m}=Ip.globChars(r.windows),h=r.dot?p:l,v=r.dot?d:l,E=r.capture?"":"?:",A={negated:!1,prefix:""},w=r.bash===!0?".*?":f;r.capture&&(w=`(${w})`);let _=q=>q.noglobstar===!0?w:`(${E}(?:(?!${m}${q.dot?c:s}).)*?)`,I=q=>{switch(q){case"*":return`${h}${a}${w}`;case".*":return`${s}${a}${w}`;case"*.*":return`${h}${w}${s}${a}${w}`;case"*/*":return`${h}${w}${o}${a}${v}${w}`;case"**":return h+_(r);case"**/*":return`(?:${h}${_(r)}${o})?${v}${a}${w}`;case"**/*.*":return`(?:${h}${_(r)}${o})?${v}${w}${s}${a}${w}`;case"**/.*":return`(?:${h}${_(r)}${o})?${s}${a}${w}`;default:{let k=/^(.*?)\.(\w+)$/.exec(q);if(!k)return;let b=I(k[1]);return b?b+s+k[2]:void 0}}},C=Tn.removePrefix(e,A),R=I(C);return R&&r.strictSlashes!==!0&&(R+=`${o}?`),R};IR.exports=Tv});var kR=T((mme,LR)=>{"use strict";u();var e4=AR(),Ev=RR(),CR=hc(),t4=fc(),r4=e=>e&&typeof e=="object"&&!Array.isArray(e),ft=(e,t,r=!1)=>{if(Array.isArray(e)){let p=e.map(f=>ft(f,t,r));return f=>{for(let m of p){let h=m(f);if(h)return h}return!1}}let n=r4(e)&&e.tokens&&e.input;if(e===""||typeof e!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=t||{},s=i.windows,o=n?ft.compileRe(e,t):ft.makeRe(e,t,!1,!0),a=o.state;delete o.state;let c=()=>!1;if(i.ignore){let p={...t,ignore:null,onMatch:null,onResult:null};c=ft(i.ignore,p,r)}let l=(p,d=!1)=>{let{isMatch:f,match:m,output:h}=ft.test(p,o,t,{glob:e,posix:s}),v={glob:e,state:a,regex:o,posix:s,input:p,output:h,match:m,isMatch:f};return typeof i.onResult=="function"&&i.onResult(v),f===!1?(v.isMatch=!1,d?v:!1):c(p)?(typeof i.onIgnore=="function"&&i.onIgnore(v),v.isMatch=!1,d?v:!1):(typeof i.onMatch=="function"&&i.onMatch(v),d?v:!0)};return r&&(l.state=a),l};ft.test=(e,t,r,{glob:n,posix:i}={})=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(e==="")return{isMatch:!1,output:""};let s=r||{},o=s.format||(i?CR.toPosixSlashes:null),a=e===n,c=a&&o?o(e):e;return a===!1&&(c=o?o(e):e,a=c===n),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=ft.matchBase(e,t,r,i):a=t.exec(c)),{isMatch:!!a,match:a,output:c}};ft.matchBase=(e,t,r)=>(t instanceof RegExp?t:ft.makeRe(t,r)).test(CR.basename(e));ft.isMatch=(e,t,r)=>ft(t,r)(e);ft.parse=(e,t)=>Array.isArray(e)?e.map(r=>ft.parse(r,t)):Ev(e,{...t,fastpaths:!1});ft.scan=(e,t)=>e4(e,t);ft.compileRe=(e,t,r=!1,n=!1)=>{if(r===!0)return e.output;let i=t||{},s=i.contains?"":"^",o=i.contains?"":"$",a=`${s}(?:${e.output})${o}`;e&&e.negated===!0&&(a=`^(?!${a}).*$`);let c=ft.toRegex(a,t);return n===!0&&(c.state=e),c};ft.makeRe=(e,t={},r=!1,n=!1)=>{if(!e||typeof e!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]==="."||e[0]==="*")&&(i.output=Ev.fastpaths(e,t)),i.output||(i=Ev(e,t)),ft.compileRe(i,t,r,n)};ft.toRegex=(e,t)=>{try{let r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(r){if(t&&t.debug===!0)throw r;return/$^/}};ft.constants=t4;LR.exports=ft});var jR=T((yme,PR)=>{"use strict";u();var DR=kR(),n4=hc();function $R(e,t,r=!1){return t&&(t.windows===null||t.windows===void 0)&&(t={...t,windows:n4.isWindows()}),DR(e,t,r)}Object.assign($R,DR);PR.exports=$R});import*as bo from"node:fs";function pC(e){try{if(!bo.existsSync(e))return{success:!1,error:new Error(`package.json not found at ${e}`)};let t=bo.readFileSync(e,"utf-8");return{success:!0,data:JSON.parse(t)}}catch(t){return{success:!1,error:new Error(`Failed to parse package.json at ${e}: ${t instanceof Error?t.message:String(t)}`)}}}var qv=Uv(()=>{"use strict";u()});u();u();u();var eT=Fn(Zv(),1),{program:M4,createCommand:U4,createArgument:B4,createOption:V4,CommanderError:K4,InvalidArgumentError:G4,InvalidOptionArgumentError:H4,Command:sr,Argument:Q4,Option:z4,Help:W4}=eT.default;var tT={name:"@godaddy/cli",version:"0.1.0",description:"GoDaddy CLI for managing applications and webhooks",main:"./dist/cli.js",type:"module",bin:{godaddy:"./dist/cli.js"},files:["dist"],scripts:{format:"pnpm biome format --write",lint:"pnpm biome lint --write",check:"pnpm biome check --fix --unsafe",build:"node build.mjs","build:dev":"NODE_ENV=development node build.mjs --dev && NODE_OPTIONS=--enable-source-maps node dist/cli-dev.js",prepare:"pnpm run build",test:"vitest","test:ui":"vitest --ui","test:coverage":"vitest --coverage",changeset:"changeset",version:"changeset version",release:"pnpm build && changeset publish"},devDependencies:{"@biomejs/biome":"1.9.4","@changesets/cli":"^2.29.8","@types/node":"^22.14.1","@types/picomatch":"^4.0.2","@types/prompts":"^2.4.9","@types/react":"18.3.1","@types/semver":"^7.7.0","@vitest/coverage-v8":"^3.2.2","@vitest/ui":"^3.2.2",esbuild:"^0.25.12",ms:"^2.1.3",msw:"^2.4.0",tsx:"^4.19.3",vitest:"^3.2.2"},peerDependencies:{typescript:"^5.0.0"},dependencies:{"@clack/prompts":"^0.10.0","@iarna/toml":"^2.2.5","@inkjs/ui":"^2.0.0","@tanstack/react-query":"^5.68.0",arktype:"^2.1.9",commander:"^13.1.0","copy-to-clipboard":"^3.3.3","gql.tada":"^1.8.10",graphql:"^16.10.0","graphql-request":"^7.1.2",ink:"^5.2.0","ink-select-input":"^6.0.0",keytar:"^7.9.0",open:"^10.1.1",picomatch:"^4.0.3",pino:"^9.6.0","pino-pretty":"^13.0.0",react:"18.3.1",semver:"^7.7.1",uuid:"^11.1.0"},publishConfig:{access:"public"},packageManager:"pnpm@10.14.0"};u();u();u();var us=class extends Error{constructor(r,n){super(r);this.originalError=n;this.name=this.constructor.name}},Ue=class extends us{code="VALIDATION_ERROR";userMessage;constructor(t,r){super(t),this.userMessage=r||t}},Nt=class extends us{code="NETWORK_ERROR";constructor(t,r){super(t,r);let n="";r?.message&&r.message!==t&&!t.includes(r.message)&&(n=`: ${r.message}`),this.userMessage=`Network error: ${t}${n}`}},It=class extends us{code="AUTH_ERROR";userMessage="Authentication failed"},mr=class extends us{code="CONFIG_ERROR";userMessage="Configuration error";constructor(t,r){super(t),this.userMessage=r||t}};u();u();import*as js from"node:fs";import{homedir as jP}from"node:os";import{join as qP}from"node:path";u();var _i=Fn(LT(),1);import*as wt from"node:fs";import{join as zo}from"node:path";u();u();u();u();u();u();var Mn=e=>Array.isArray(e)?e:[e],kT=(e,t)=>{let r=[[],[]];for(let n of e)t(n)?r[0].push(n):r[1].push(n);return r},Ic=Array,gr=(e,t)=>e.includes(t),DT=(e,t=0)=>[...new Array(e)].map((r,n)=>n+t),Ne=(e,t,r)=>e===void 0?t===void 0?[]:Array.isArray(t)?t:[t]:(r?.prepend?Array.isArray(t)?e.unshift(...t):e.unshift(t):Array.isArray(t)?e.push(...t):e.push(t),e),xn=(e,t)=>t==null?e??[]:e==null?Mn(t):e.concat(t),$T=(...e)=>e.reduce(xn,[]),en=(e,t,r)=>{if(e===void 0)return Array.isArray(t)?t:[t];let n=r?.isEqual??((i,s)=>i===s);for(let i of Mn(t))e.some(s=>n(s,i))||e.push(i);return e},PT=(e,t)=>e.reduce((r,n)=>{let i=n[t];return r[i]=Ne(r[i],n),r},{}),wn=(e,t,r)=>e.length===t.length&&e.every(r?.isEqual?(n,i)=>r.isEqual(n,t[i]):(n,i)=>n===t[i]);u();u();u();var Vt=(e,t)=>gt(e)===t,gt=e=>{let t=typeof e;return t==="object"?e===null?"null":"object":t==="function"?"object":t},Kt={boolean:"boolean",null:"null",undefined:"undefined",bigint:"a bigint",number:"a number",object:"an object",string:"a string",symbol:"a symbol"},jT={...Kt,function:"a function"};u();u();var od=class extends Error{},$e=e=>vi(e,od),vi=(e,t=Error)=>{throw new t(e)},ps=class extends Error{name="ParseError"},L=e=>vi(e,ps),Dr=e=>` ${e}`,qT="\u200B";u();var ge=(e,t)=>{let r={},n=Array.isArray(e),i=!1;for(let[s,o]of Object.entries(e).entries()){let a=n?t(s,o[1]):t(...o,s);i||=typeof a[0]=="number";let c=Array.isArray(a[0])||a.length===0?a:[a];for(let[l,p]of c)typeof l=="object"?r[l.group]=Ne(r[l.group],p):r[l]=p}return i?Object.values(r):r};var ad=Object.entries;var yt=(e,t)=>e in t,fs=(e,t)=>t in e;var Rc=class{constructor(t){Object.assign(this,t)}},FT=class{},ds=class extends FT{},IL=(e,t)=>{let r={},n={},i;for(i in e)i in t?r[i]=e[i]:n[i]=e[i];return[r,n]};var Cc=(e,t)=>IL(e,t)[1],tn=e=>Object.keys(e).length===0,Ti=e=>[...Object.entries(e),...Object.getOwnPropertySymbols(e).map(t=>[t,e[t]])],MT=(e,t)=>Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)),UT=e=>{let t=Object.keys(e).sort(),r={};for(let n=0;n<t.length;n++)r[t[n]]=e[t[n]];return r};var Gt=Dr(`unset${qT}`),BT=e=>Object.values(e).filter(t=>typeof t=="number"?!0:typeof e[t]!="number");var cd={Array,Boolean,Date,Error,Function,Map,Number,Promise,RegExp,Set,String,WeakMap,WeakSet},ud=globalThis.File??Blob,ld={ArrayBuffer,Blob,File:ud,FormData,Headers,Request,Response,URL},RL={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array},Ei={...cd,...ld,...RL,String,Number,Boolean},So=e=>{let t=Object.getPrototypeOf(e);for(;t?.constructor&&(!yt(t.constructor.name,Ei)||!(e instanceof Ei[t.constructor.name]));)t=Object.getPrototypeOf(t);let r=t?.constructor?.name;if(!(r===void 0||r==="Object"))return r},Oo=e=>typeof e=="object"&&e!==null?So(e)??"object":gt(e);var He=Array.isArray,CL={Array:"an array",Function:"a function",Date:"a Date",RegExp:"a RegExp",Error:"an Error",Map:"a Map",Set:"a Set",String:"a String object",Number:"a Number object",Boolean:"a Boolean object",Promise:"a Promise",WeakMap:"a WeakMap",WeakSet:"a WeakSet"},LL={ArrayBuffer:"an ArrayBuffer instance",Blob:"a Blob instance",File:"a File instance",FormData:"a FormData instance",Headers:"a Headers instance",Request:"a Request instance",Response:"a Response instance",URL:"a URL instance"},kL={Int8Array:"an Int8Array",Uint8Array:"a Uint8Array",Uint8ClampedArray:"a Uint8ClampedArray",Int16Array:"an Int16Array",Uint16Array:"a Uint16Array",Int32Array:"an Int32Array",Uint32Array:"a Uint32Array",Float32Array:"a Float32Array",Float64Array:"a Float64Array",BigInt64Array:"a BigInt64Array",BigUint64Array:"a BigUint64Array"},VT={...CL,...LL,...kL},_o=e=>{let t=Object(e).name??null;return t&&yt(t,Ei)&&Ei[t]===e?t:null};var pd=(e,t)=>{let r=e.prototype;for(;r!==null;){if(r===t.prototype)return!0;r=Object.getPrototypeOf(r)}return!1};var KT=e=>GT(e,new Map),GT=(e,t)=>{if(typeof e!="object"||e===null)return e;if(t?.has(e))return t.get(e);let r=_o(e.constructor);if(r==="Date")return new Date(e.getTime());if(r&&r!=="Array")return e;let n=Array.isArray(e)?e.slice():Object.create(Object.getPrototypeOf(e)),i=Object.getOwnPropertyDescriptors(e);if(t){t.set(e,n);for(let s in i){let o=i[s];"get"in o||"set"in o||(o.value=GT(o.value,t))}}return Object.defineProperties(n,i),n};u();u();var DL=e=>{let t=Gt;return()=>t===Gt?t=e():t},Un=e=>typeof e=="function"&&e.length===0;var HT=class extends Function{constructor(...e){let t=e.slice(0,-1),r=e[e.length-1];try{super(...t,r)}catch(n){return $e(`Encountered an unexpected error while compiling your definition:
312
+ Message: ${n}
313
+ Source: (${e.slice(0,-1)}) => {
314
+ ${e[e.length-1]}
315
+ }`)}}},Dt=class{constructor(t,...[r]){return Object.assign(Object.setPrototypeOf(t.bind(r?.bind??this),this.constructor.prototype),r?.attach)}},QT=DL(()=>{try{return new Function("return false")()}catch{return!0}});u();var sY=Dr("brand");var $L=Dr("arkInferred");u();var uY=Dr("args"),_t=class{constructor(){}};u();u();var PL=()=>{try{return((new Error().stack?.split(`
316
+ `)[2]?.trim()||"").match(/\(?(.+?)(?::\d+:\d+)?\)?$/)?.[1]||"unknown").replace(/^file:\/\//,"")}catch{return"unknown"}},jL=globalThis.process?.env??{},zT={fileName:PL,env:jL};u();u();u();u();var WT=e=>e[0].toUpperCase()+e.slice(1),JT=e=>e[0].toLowerCase()+e.slice(1),dd=e=>new RegExp(qL(e),typeof e=="string"?"":e.flags);var qL=e=>`^(?:${typeof e=="string"?e:e.source})$`;var Sn={negativeLookahead:e=>`(?!${e})`,nonCapturingGroup:e=>`(?:${e})`},xi="\\",Bn={" ":1,"\n":1," ":1};var FL=/^-0\.?0*$/.source,XT=/[1-9]\d*/.source,ML=/\.\d+/.source,UL=/\.\d*[1-9]/.source,ZT=e=>dd(Sn.negativeLookahead(FL)+Sn.nonCapturingGroup("-?"+Sn.nonCapturingGroup(Sn.nonCapturingGroup("0|"+XT)+Sn.nonCapturingGroup(e.decimalPattern)+"?")+(e.allowDecimalOnly?"|"+e.decimalPattern:"")+"?")),YT=ZT({decimalPattern:UL,allowDecimalOnly:!1}),BL=YT.test.bind(YT),Lc=ZT({decimalPattern:ML,allowDecimalOnly:!0}),xY=Lc.test.bind(Lc),VL=/^-?\d*\.?\d*$/,KL=e=>e.length!==0&&VL.test(e),Ao=dd(Sn.negativeLookahead("^-0$")+"-?"+Sn.nonCapturingGroup(Sn.nonCapturingGroup("0|"+XT))),GL=Ao.test.bind(Ao),fd=/^-?\d+$/,HL=fd.test.bind(fd),eE={number:"a number",bigint:"a bigint",integer:"an integer"},tE=(e,t)=>`'${e}' was parsed as ${eE[t]} but could not be narrowed to a literal value. Avoid unnecessary leading or trailing zeros and other abnormal notation`,QL=(e,t)=>t==="number"?BL(e):GL(e),zL=(e,t)=>t==="number"?Number(e):Number.parseInt(e),WL=(e,t)=>t==="number"?KL(e):HL(e),rE=(e,t)=>hd(e,"number",t),nE=(e,t)=>hd(e,"number",{...t,strict:!0}),iE=(e,t)=>hd(e,"integer",t),hd=(e,t,r)=>{let n=zL(e,t);return!Number.isNaN(n)&&WL(e,t)?r?.strict?QL(e,t)?n:L(tE(e,t)):n:r?.errorOnFail?L(r?.errorOnFail===!0?`Failed to parse ${eE[t]} from '${e}'`:r?.errorOnFail):void 0},sE=e=>{if(e[e.length-1]!=="n")return;let t=e.slice(0,-1),r;try{r=BigInt(t)}catch{return}if(Ao.test(t))return r;if(fd.test(t))return L(tE(e,"bigint"))};u();u();var JL="0.56.0",YL={version:JL,filename:zT.fileName(),FileConstructor:ud},wi=YL,oE=new Map,md=Object.create(null),No=e=>{let t=oE.get(e);if(t)return t;let r=XL(e);return md[r]?r=`${r}${md[r]++}`:md[r]=1,wi[r]=e,oE.set(e,r),r},Vn=e=>/^[$A-Z_a-z][\w$]*$/.test(e),XL=e=>{switch(typeof e){case"object":{if(e===null)break;let t=So(e)??"object";return t[0].toLowerCase()+t.slice(1)}case"function":return Vn(e.name)?e.name:"fn";case"symbol":return e.description&&Vn(e.description)?e.description:"symbol"}return $e(`Unexpected attempt to register serializable value of type ${gt(e)}`)};u();u();var Io=e=>typeof e=="string"?JSON.stringify(e):typeof e=="bigint"?`${e}n`:`${e}`;var aE=(e,t={})=>Ro(e,{onUndefined:"$ark.undefined",onBigInt:r=>`$ark.bigint-${r}`,...t},[]);var ye=(e,t)=>{switch(gt(e)){case"object":let r=e,n=r.constructor?.name??"Object";return n==="Object"||n==="Array"?t?.quoteKeys===!1?kc(r,t?.indent??0,""):JSON.stringify(Ro(r,hs,[]),null,t?.indent):kc(r,t?.indent??0,"");case"symbol":return hs.onSymbol(e);default:return Io(e)}},kc=(e,t,r)=>{if(typeof e=="function")return hs.onFunction(e);if(typeof e!="object"||e===null)return Io(e);let n=r+" ".repeat(t);if(Array.isArray(e)){if(e.length===0)return"[]";let s=e.map(o=>kc(o,t,n)).join(`,
317
+ `+n);return t?`[
318
+ ${n}${s}
319
+ ${r}]`:`[${s}]`}let i=e.constructor?.name??"Object";if(i==="Object"){let s=Ti(e).map(([o,a])=>{let c=typeof o=="symbol"?hs.onSymbol(o):Vn(o)?o:JSON.stringify(o),l=kc(a,t,n);return`${n}${c}: ${l}`});return s.length===0?"{}":t?`{
320
+ ${s.join(`,
321
+ `)}
322
+ ${r}}`:`{${s.join(", ")}}`}return e instanceof Date?Si(e):"expression"in e&&typeof e.expression=="string"?e.expression:i},hs={onCycle:()=>"(cycle)",onSymbol:e=>`Symbol(${No(e)})`,onFunction:e=>`Function(${No(e)})`},Ro=(e,t,r)=>{switch(gt(e)){case"object":{let n=e;if("toJSON"in n&&typeof n.toJSON=="function")return n.toJSON();if(typeof n=="function")return hs.onFunction(n);if(r.includes(n))return"(cycle)";let i=[...r,n];if(Array.isArray(n))return n.map(o=>Ro(o,t,i));if(n instanceof Date)return n.toDateString();let s={};for(let o in n)s[o]=Ro(n[o],t,i);for(let o of Object.getOwnPropertySymbols(n))s[t.onSymbol?.(o)??o.toString()]=Ro(n[o],t,i);return s}case"symbol":return hs.onSymbol(e);case"bigint":return t.onBigInt?.(e)??`${e}n`;case"undefined":return t.onUndefined??"undefined";case"string":return e.replace(/\\/g,"\\\\");default:return e}},Si=e=>{let t=e.getFullYear(),r=e.getMonth(),n=e.getDate(),i=e.getHours(),s=e.getMinutes(),o=e.getSeconds(),a=e.getMilliseconds();if(r===0&&n===1&&i===0&&s===0&&o===0&&a===0)return`${t}`;let c=`${ZL[r]} ${n}, ${t}`;if(i===0&&s===0&&o===0&&a===0)return c;let l=e.toLocaleTimeString(),p=l.endsWith(" AM")||l.endsWith(" PM")?l.slice(-3):"";return p&&(l=l.slice(0,-p.length)),a?l+=`.${tk(a,3)}`:ek.test(l)&&(l=l.slice(0,-3)),`${l+p}, ${c}`},ZL=["January","February","March","April","May","June","July","August","September","October","November","December"],ek=/:\d\d:00$/,tk=(e,t)=>String(e).padStart(t,"0");var cE=(e,t,...[r])=>{let n=r?.stringifySymbol??ye,i=e;switch(typeof t){case"string":i=Vn(t)?e===""?t:`${e}.${t}`:`${e}[${JSON.stringify(t)}]`;break;case"number":i=`${e}[${t}]`;break;case"symbol":i=`${e}[${n(t)}]`;break;default:r?.stringifyNonKey?i=`${e}[${r.stringifyNonKey(t)}]`:L(`${ye(t)} must be a PropertyKey or stringifyNonKey must be passed to options`)}return i},On=(e,...t)=>e.reduce((r,n)=>cE(r,n,...t),""),ms=class extends Ic{cache={};constructor(...t){super(),this.push(...t)}toJSON(){if(this.cache.json)return this.cache.json;this.cache.json=[];for(let t=0;t<this.length;t++)this.cache.json.push(typeof this[t]=="symbol"?ye(this[t]):this[t]);return this.cache.json}stringify(){return this.cache.stringify?this.cache.stringify:this.cache.stringify=On(this)}stringifyAncestors(){if(this.cache.stringifyAncestors)return this.cache.stringifyAncestors;let t="",r=[t];for(let n of this)t=cE(t,n),r.push(t);return this.cache.stringifyAncestors=r}};u();var gs=class{chars;i;def;constructor(t){this.def=t,this.chars=[...t],this.i=0}shift(){return this.chars[this.i++]??""}get lookahead(){return this.chars[this.i]??""}get nextLookahead(){return this.chars[this.i+1]??""}get length(){return this.chars.length}shiftUntil(t){let r="";for(;this.lookahead&&!t(this,r);)r+=this.shift();return r}shiftUntilEscapable(t){let r="";for(;this.lookahead;)if(this.lookahead===xi)this.shift(),t(this,r)?r+=this.shift():this.lookahead===xi?r+=this.shift():r+=`${xi}${this.shift()}`;else{if(t(this,r))break;r+=this.shift()}return r}shiftUntilLookahead(t){return typeof t=="string"?this.shiftUntil(r=>r.lookahead===t):this.shiftUntil(r=>r.lookahead in t)}shiftUntilNonWhitespace(){return this.shiftUntil(()=>!(this.lookahead in Bn))}jumpToIndex(t){this.i=t<0?this.length+t:t}jumpForward(t){this.i+=t}get location(){return this.i}get unscanned(){return this.chars.slice(this.i,this.length).join("")}get scanned(){return this.chars.slice(0,this.i).join("")}sliceChars(t,r){return this.chars.slice(t,r).join("")}lookaheadIs(t){return this.lookahead===t}lookaheadIsIn(t){return this.lookahead in t}},uE=(e,t)=>`Unmatched ${e}${t===""?"":` before ${t}`}`,Dc=e=>`Missing ${e}`;u();var ZY=Dr("implementedTraits");u();u();u();var gd="$ark",rk=2;for(;gd in globalThis;)gd=`$ark${rk++}`;var lE=gd;globalThis[lE]=wi;var M=wi,nk=e=>`${lE}.${e}`,nt=e=>nk(No(e));var Co=class extends ds{argNames;body="";constructor(...t){super(),this.argNames=t;for(let r of t){if(r in this)throw new Error(`Arg name '${r}' would overwrite an existing property on FunctionBody`);this[r]=r}}indentation=0;indent(){return this.indentation+=4,this}dedent(){return this.indentation-=4,this}prop(t,r=!1){return yd(t,r)}index(t,r=!1){return pE(`${t}`,r)}line(t){return this.body+=`${" ".repeat(this.indentation)}${t}
323
+ `,this}const(t,r){return this.line(`const ${t} = ${r}`),this}let(t,r){return this.line(`let ${t} = ${r}`)}set(t,r){return this.line(`${t} = ${r}`)}if(t,r){return this.block(`if (${t})`,r)}elseIf(t,r){return this.block(`else if (${t})`,r)}else(t){return this.block("else",t)}for(t,r,n=0){return this.block(`for (let i = ${n}; ${t}; i++)`,r)}forIn(t,r){return this.block(`for (const k in ${t})`,r)}block(t,r,n=""){return this.line(`${t} {`),this.indent(),r(this),this.dedent(),this.line(`}${n}`)}return(t=""){return this.line(`return ${t}`)}write(t="anonymous",r=0){return`${t}(${this.argNames.join(", ")}) { ${r?this.body.split(`
324
+ `).map(n=>" ".repeat(r)+`${n}`).join(`
325
+ `):this.body} }`}compile(){return new HT(...this.argNames,this.body)}},$r=e=>Vt(e,"object")||typeof e=="symbol"?nt(e):Io(e),yd=(e,t=!1)=>typeof e=="string"&&Vn(e)?`${t?"?":""}.${e}`:pE(ik(e),t),ik=e=>typeof e=="symbol"?nt(e):JSON.stringify(e),pE=(e,t=!1)=>`${t?"?.":""}[${e}]`,ys=class extends Co{traversalKind;optimistic;constructor(t){super("data","ctx"),this.traversalKind=t.kind,this.optimistic=t.optimistic===!0}invoke(t,r){let n=r?.arg??this.data,i=typeof t=="string"?!0:this.requiresContextFor(t),s=typeof t=="string"?t:t.id;return i?`${this.referenceToId(s,r)}(${n}, ${this.ctx})`:`${this.referenceToId(s,r)}(${n})`}referenceToId(t,r){let n=r?.kind??this.traversalKind,i=`this.${t}${n}`;return r?.bind?`${i}.bind(${r?.bind})`:i}requiresContextFor(t){return this.traversalKind==="Apply"||t.allowsRequiresContext}initializeErrorCount(){return this.const("errorCount","ctx.currentErrorCount")}returnIfFail(){return this.if("ctx.currentErrorCount > errorCount",()=>this.return())}returnIfFailFast(){return this.if("ctx.failFast && ctx.currentErrorCount > errorCount",()=>this.return())}traverseKey(t,r,n){let i=this.requiresContextFor(n);return i&&this.line(`${this.ctx}.path.push(${t})`),this.check(n,{arg:r}),i&&this.line(`${this.ctx}.path.pop()`),this}check(t,r){return this.traversalKind==="Allows"?this.if(`!${this.invoke(t,r)}`,()=>this.return(!1)):this.line(this.invoke(t,r))}};u();var $c=e=>ge(e,(t,r)=>[t,He(r)?[...r]:r]),$t=Dr("arkKind"),re=(e,t)=>e?.[$t]===t,We=e=>re(e,"root")||re(e,"constraint");var dE=["unit","proto","domain"],bs=["required","optional","index","sequence"],bd=["pattern","divisor","exactLength","max","min","maxLength","minLength","before","after"],vd=[...bd,"structure","predicate"],Pc=[...vd,...bs],vs=["alias","union","morph","unit","intersection","proto","domain"],sk=[...vs,...Pc],jc=ge(Pc,(e,t)=>[t,1]),fE=ge([...bs,"undeclared"],(e,t)=>[t,1]),hE=ge(sk,(e,t)=>[t,e]),Ts=e=>typeof e=="string"&&e in hE;var Es=e=>hE[e],qc=e=>vs.slice(Es(e)+1),B8=[...qc("union"),"alias"],V8=[...qc("morph"),"alias"],yr=e=>typeof e=="string"||typeof e=="boolean"||e===null?e:typeof e=="number"?Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e:$r(e),Kn=e=>{let t="{ ";for(let[r,n]of Object.entries(e))t+=`${r}: ${$r(n)}, `;return t+" }"},be=e=>{let t=e;return t.hasAssociatedError&&(t.defaults.expected??=r=>"description"in r?r.description:t.defaults.description(r),t.defaults.actual??=r=>ye(r),t.defaults.problem??=r=>`must be ${r.expected}${r.actual?` (was ${r.actual})`:""}`,t.defaults.message??=r=>{if(r.path.length===0)return r.problem;let n=`${r.propString} ${r.problem}`;return n[0]==="["?`value at ${n}`:n}),t};u();var Td=class extends Error{name="ToJsonSchemaError";code;context;constructor(t,r){super(ye(r,{quoteKeys:!1,indent:4})),this.code=t,this.context=r}hasCode(t){return this.code===t}},ok={target:"draft-2020-12",dialect:"https://json-schema.org/draft/2020-12/schema",useRefs:!1,fallback:{arrayObject:e=>Ye.throw("arrayObject",e),arrayPostfix:e=>Ye.throw("arrayPostfix",e),defaultValue:e=>Ye.throw("defaultValue",e),domain:e=>Ye.throw("domain",e),morph:e=>Ye.throw("morph",e),patternIntersection:e=>Ye.throw("patternIntersection",e),predicate:e=>Ye.throw("predicate",e),proto:e=>Ye.throw("proto",e),symbolKey:e=>Ye.throw("symbolKey",e),unit:e=>Ye.throw("unit",e),date:e=>Ye.throw("date",e)}},Ye={Error:Td,throw:(...e)=>{throw new Ye.Error(...e)},throwInternalOperandError:(e,t)=>$e(`Unexpected JSON Schema input for ${e}: ${ye(t)}`),defaultConfig:ok};M.config??={};var Lo=(e,t)=>{if(!t)return e;let r={...e},n;for(n in t){let i={...e.keywords};if(n==="keywords"){for(let s in t[n]){let o=t.keywords[s];o!==void 0&&(i[s]=typeof o=="string"?{description:o}:o)}r.keywords=i}else n==="toJsonSchema"?r[n]=Ed(e.toJsonSchema,t.toJsonSchema):Ts(n)?r[n]={...e[n],...t[n]}:r[n]=t[n]}return r},ak={"draft-2020-12":"https://json-schema.org/draft/2020-12/schema","draft-07":"http://json-schema.org/draft-07/schema#"},Ed=((e,t)=>{if(!e)return mE(t??{},void 0);if(!t)return e;let r={...e},n;for(n in t)n==="fallback"?r.fallback=ck(e.fallback,t.fallback):r[n]=t[n];return mE(r,t)}),mE=(e,t)=>t?.dialect!==void 0?e:t?.target!==void 0?{...e,dialect:ak[t.target]}:e,ck=(e,t)=>{e=gE(e),t=gE(t);let r={},n;for(n in Ye.defaultConfig.fallback)r[n]=t[n]??t.default??e[n]??e.default??Ye.defaultConfig.fallback[n];return r},gE=e=>typeof e=="function"?{default:e}:e??{};u();u();u();u();var Gn=class e extends ds{[$t]="error";path;data;nodeConfig;input;ctx;constructor({prefixPath:t,relativePath:r,...n},i){super(),this.input=n,this.ctx=i,MT(this,n);let s=i.data;n.code==="union"&&(n.errors=n.errors.flatMap(a=>{let c=a.hasCode("union")?a.errors:[a];return!t&&!r?c:c.map(l=>l.transform(p=>({...p,path:$T(t,p.path,r)})))})),this.nodeConfig=i.config[this.code];let o=[...n.path??i.path];r&&o.push(...r),t&&o.unshift(...t),this.path=new ms(...o),this.data="data"in n?n.data:s}transform(t){return new e(t({data:this.data,path:this.path,...this.input}),this.ctx)}hasCode(t){return this.code===t}get propString(){return On(this.path)}get expected(){if(this.input.expected)return this.input.expected;let t=this.meta?.expected??this.nodeConfig.expected;return typeof t=="function"?t(this.input):t}get actual(){if(this.input.actual)return this.input.actual;let t=this.meta?.actual??this.nodeConfig.actual;return typeof t=="function"?t(this.data):t}get problem(){if(this.input.problem)return this.input.problem;let t=this.meta?.problem??this.nodeConfig.problem;return typeof t=="function"?t(this):t}get message(){if(this.input.message)return this.input.message;let t=this.meta?.message??this.nodeConfig.message;return typeof t=="function"?t(this):t}get flat(){return this.hasCode("intersection")?[...this.errors]:[this]}toJSON(){return{data:this.data,path:this.path,...this.input,expected:this.expected,actual:this.actual,problem:this.problem,message:this.message}}toString(){return this.message}throw(){throw this}},Ht=class e extends Ic{[$t]="errors";ctx;constructor(t){super(),this.ctx=t}byPath=Object.create(null);get flatByPath(){return ge(this.byPath,(t,r)=>[t,r.flat])}get flatProblemsByPath(){return ge(this.byPath,(t,r)=>[t,r.flat.map(n=>n.problem)])}byAncestorPath=Object.create(null);count=0;mutable=this;throw(){throw this.toTraversalError()}toTraversalError(){return new Fc(this)}add(t){let r=this.byPath[t.propString];if(r){if(t===r||r.hasCode("union")&&r.errors.length===0)return;let n=t.hasCode("union")&&t.errors.length===0?t:new Gn({code:"intersection",errors:r.hasCode("intersection")?[...r.errors,t]:[r,t]},this.ctx),i=this.indexOf(r);this.mutable[i===-1?this.length:i]=n,this.byPath[t.propString]=n,this.addAncestorPaths(t)}else this.byPath[t.propString]=t,this.addAncestorPaths(t),this.mutable.push(t);this.count++}transform(t){let r=new e(this.ctx);for(let n of this)r.add(t(n));return r}merge(t){for(let r of t)this.add(new Gn({...r,path:[...this.ctx.path,...r.path]},this.ctx))}affectsPath(t){return this.length===0?!1:t.stringifyAncestors().some(r=>r in this.byPath)||t.stringify()in this.byAncestorPath}get summary(){return this.toString()}get issues(){return this}toJSON(){return[...this.map(t=>t.toJSON())]}toString(){return this.join(`
326
+ `)}addAncestorPaths(t){for(let r of t.path.stringifyAncestors())this.byAncestorPath[r]=Ne(this.byAncestorPath[r],t)}},Fc=class extends Error{name="TraversalError";constructor(t){t.length===1?super(t.summary):super(`
327
+ `+t.map(r=>` \u2022 ${uk(r)}`).join(`
328
+ `)),Object.defineProperty(this,"arkErrors",{value:t,enumerable:!1})}},uk=e=>e.toString().split(`
329
+ `).join(`
330
+ `);var br=class{path=[];errors=new Ht(this);root;config;queuedMorphs=[];branches=[];seen={};constructor(t,r){this.root=t,this.config=r}get data(){let t=this.root;for(let r of this.path)t=t?.[r];return t}get propString(){return On(this.path)}reject(t){return this.error(t),!1}mustBe(t){return this.error(t),!1}error(t){let r=typeof t=="object"?t.code?t:{...t,code:"predicate"}:{code:"predicate",expected:t};return this.errorFromContext(r)}hasError(){return this.currentErrorCount!==0}get currentBranch(){return this.branches[this.branches.length-1]}queueMorphs(t){let r={path:new ms(...this.path),morphs:t};this.currentBranch?this.currentBranch.queuedMorphs.push(r):this.queuedMorphs.push(r)}finalize(t){return this.queuedMorphs.length&&(typeof this.root=="object"&&this.root!==null&&this.config.clone&&(this.root=this.config.clone(this.root)),this.applyQueuedMorphs()),this.hasError()?t?t(this.errors):this.errors:this.root}get currentErrorCount(){return this.currentBranch?this.currentBranch.error?1:0:this.errors.count}get failFast(){return this.branches.length!==0}pushBranch(){this.branches.push({error:void 0,queuedMorphs:[]})}popBranch(){return this.branches.pop()}get external(){return this}errorFromNodeContext(t){return this.errorFromContext(t)}errorFromContext(t){let r=new Gn(t,this);return this.currentBranch?this.currentBranch.error=r:this.errors.add(r),r}applyQueuedMorphs(){for(;this.queuedMorphs.length;){let t=this.queuedMorphs;this.queuedMorphs=[];for(let{path:r,morphs:n}of t)this.errors.affectsPath(r)||this.applyMorphsAtPath(r,n)}}applyMorphsAtPath(t,r){let n=t[t.length-1],i;if(n!==void 0){i=this.root;for(let s=0;s<t.length-1;s++)i=i[t[s]]}for(let s of r){this.path=[...t];let o=We(s),a=s(i===void 0?this.root:i[n],this);if(a instanceof Gn){this.errors.includes(a)||this.errors.add(a);break}if(a instanceof Ht){o||this.errors.merge(a),this.queuedMorphs=[];break}i===void 0?this.root=a:i[n]=a,this.applyQueuedMorphs()}}},Qt=(e,t,r)=>{if(!r)return t();r.path.push(e);let n=t();return r.path.pop(),n};var xs=class extends Dt{attachments;$;onFail;includesTransform;includesContextualPredicate;isCyclic;allowsRequiresContext;rootApplyStrategy;contextFreeMorph;rootApply;referencesById;shallowReferences;flatRefs;flatMorphs;allows;get shallowMorphs(){return[]}constructor(t,r){super((i,s,o=this.onFail)=>s?(this.traverseApply(i,s),s.hasError()?s.errors:s.data):this.rootApply(i,o),{attach:t}),this.attachments=t,this.$=r,this.onFail=this.meta.onFail??this.$.resolvedConfig.onFail,this.includesTransform=this.hasKind("morph")||this.hasKind("structure")&&this.structuralMorph!==void 0||this.hasKind("sequence")&&this.inner.defaultables!==void 0,this.includesContextualPredicate=this.hasKind("predicate")&&this.inner.predicate.length!==1,this.isCyclic=this.kind==="alias",this.referencesById={[this.id]:this},this.shallowReferences=this.hasKind("structure")?[this,...this.children]:this.children.reduce((i,s)=>fk(i,s.shallowReferences),[this]);let n=this.isStructural();this.flatRefs=[],this.flatMorphs=[];for(let i=0;i<this.children.length;i++){if(this.includesTransform||=this.children[i].includesTransform,this.includesContextualPredicate||=this.children[i].includesContextualPredicate,this.isCyclic||=this.children[i].isCyclic,!n){let s=this.children[i].flatRefs;for(let o=0;o<s.length;o++){let a=s[o];if(!this.flatRefs.some(c=>bE(c,a))){this.flatRefs.push(a);for(let c of a.node.branches)(c.hasKind("morph")||c.hasKind("intersection")&&c.structure?.structuralMorph!==void 0)&&this.flatMorphs.push({path:a.path,propString:a.propString,node:c})}}}Object.assign(this.referencesById,this.children[i].referencesById)}this.flatRefs.sort((i,s)=>i.path.length>s.path.length?1:i.path.length<s.path.length?-1:i.propString>s.propString?1:i.propString<s.propString||i.node.expression<s.node.expression?-1:1),this.allowsRequiresContext=this.includesContextualPredicate||this.isCyclic,this.rootApplyStrategy=!this.allowsRequiresContext&&this.flatMorphs.length===0?this.shallowMorphs.length===0?"allows":this.shallowMorphs.every(i=>i.length===1||i.name==="$arkStructuralMorph")?this.hasKind("union")?this.branches.some(i=>i.shallowMorphs.length>1)?"contextual":"branchedOptimistic":this.shallowMorphs.length>1?"contextual":"optimistic":"contextual":"contextual",this.rootApply=this.createRootApply(),this.allows=this.allowsRequiresContext?i=>this.traverseAllows(i,new br(i,this.$.resolvedConfig)):i=>this.traverseAllows(i)}createRootApply(){switch(this.rootApplyStrategy){case"allows":return(r,n)=>{if(this.allows(r))return r;let i=new br(r,this.$.resolvedConfig);return this.traverseApply(r,i),i.finalize(n)};case"contextual":return(r,n)=>{let i=new br(r,this.$.resolvedConfig);return this.traverseApply(r,i),i.finalize(n)};case"optimistic":this.contextFreeMorph=this.shallowMorphs[0];let t=this.$.resolvedConfig.clone;return(r,n)=>{if(this.allows(r))return this.contextFreeMorph(t&&(typeof r=="object"&&r!==null||typeof r=="function")?t(r):r);let i=new br(r,this.$.resolvedConfig);return this.traverseApply(r,i),i.finalize(n)};case"branchedOptimistic":return this.createBranchedOptimisticRootApply();default:return this.rootApplyStrategy,$e(`Unexpected rootApplyStrategy ${this.rootApplyStrategy}`)}}compiledMeta=dk(this.metaJson);cacheGetter(t,r){return Object.defineProperty(this,t,{value:r}),r}get description(){return this.cacheGetter("description",this.meta?.description??this.$.resolvedConfig[this.kind].description(this))}get references(){return Object.values(this.referencesById)}precedence=Es(this.kind);precompilation;assert=(t,r)=>this(t,r,n=>n.throw());traverse(t,r){return this(t,r,null)}get in(){return this.cacheGetter("in",this.rawIn.isRoot()?this.$.finalize(this.rawIn):this.rawIn)}get rawIn(){return this.cacheGetter("rawIn",this.getIo("in"))}get out(){return this.cacheGetter("out",this.rawOut.isRoot()?this.$.finalize(this.rawOut):this.rawOut)}get rawOut(){return this.cacheGetter("rawOut",this.getIo("out"))}getIo(t){if(!this.includesTransform)return this;let r={};for(let[n,i]of this.innerEntries){let s=this.impl.keys[n];if(s.reduceIo)s.reduceIo(t,r,i);else if(s.child){let o=i;r[n]=He(o)?o.map(a=>t==="in"?a.rawIn:a.rawOut):t==="in"?o.rawIn:o.rawOut}else r[n]=i}return this.$.node(this.kind,r)}toJSON(){return this.json}toString(){return`Type<${this.expression}>`}equals(t){let r=We(t)?t:this.$.parseDefinition(t);return this.innerHash===r.innerHash}ifEquals(t){return this.equals(t)?this:void 0}hasKind(t){return this.kind===t}assertHasKind(t){return this.kind!==t&&vi(`${this.kind} node was not of asserted kind ${t}`),this}hasKindIn(...t){return t.includes(this.kind)}assertHasKindIn(...t){return gr(t,this.kind)||vi(`${this.kind} node was not one of asserted kinds ${t}`),this}isBasis(){return gr(dE,this.kind)}isConstraint(){return gr(Pc,this.kind)}isStructural(){return gr(bs,this.kind)}isRefinement(){return gr(vd,this.kind)}isRoot(){return gr(vs,this.kind)}isUnknown(){return this.hasKind("intersection")&&this.children.length===0}isNever(){return this.hasKind("union")&&this.children.length===0}hasUnit(t){return this.hasKind("unit")&&this.allows(t)}hasOpenIntersection(){return this.impl.intersectionIsOpen}get nestableExpression(){return this.expression}select(t){let r=ko.normalize(t);return this._select(r)}_select(t){let r=ko.applyBoundary[t.boundary??"references"](this);return t.kind&&(r=r.filter(n=>n.kind===t.kind)),t.where&&(r=r.filter(t.where)),ko.applyMethod[t.method??"filter"](r,this,t)}transform(t,r){return this._transform(t,this._createTransformContext(r))}_createTransformContext(t){return{root:this,selected:void 0,seen:{},path:[],parseOptions:{prereduced:t?.prereduced??!1},undeclaredKeyHandling:void 0,...t}}_transform(t,r){let n=r.bindScope??this.$;if(r.seen[this.id])return this.$.lazilyResolve(r.seen[this.id]);if(r.shouldTransform?.(this,r)===!1)return this;let i;r.seen[this.id]=()=>i,this.hasKind("structure")&&this.undeclared!==r.undeclaredKeyHandling&&(r={...r,undeclaredKeyHandling:this.undeclared});let s=ge(this.inner,(p,d)=>{if(!this.impl.keys[p].child)return[p,d];let f=d;if(!He(f)){let h=f._transform(t,r);return h?[p,h]:[]}if(f.length===0)return[p,d];let m=f.flatMap(h=>h._transform(t,r)??[]);return m.length?[p,m]:[]});delete r.seen[this.id];let o=Object.assign(s,{meta:this.meta}),a=r.selected&&!r.selected.includes(this)?o:t(this.kind,o,r);if(a===null)return null;if(We(a))return i=a;let c=Object.keys(a);return(c.length===0||c.length===1&&c[0]==="meta")&&!tn(this.inner)?null:(this.kind==="required"||this.kind==="optional"||this.kind==="index")&&!("value"in a)?r.undeclaredKeyHandling?{...a,value:M.intrinsic.unknown}:null:(this.kind==="morph"&&(a.in??=M.intrinsic.unknown),i=n.node(this.kind,a,r.parseOptions))}configureReferences(t,r="references"){let n=ko.normalize(r),i=typeof t=="string"?(c,l)=>({...l,meta:{...l.meta,description:t}}):typeof t=="function"?(c,l)=>({...l,meta:t(l.meta)}):(c,l)=>({...l,meta:{...l.meta,...t}});if(n.boundary==="self")return this.$.node(this.kind,i(this.kind,{...this.inner,meta:this.meta}));let s=this._select(n),o=s&&Mn(s),a=n.boundary==="child"?(c,l)=>l.root.children.includes(c):n.boundary==="shallow"?c=>c.kind!=="structure":()=>!0;return this.$.finalize(this.transform(i,{shouldTransform:a,selected:o}))}},ko={applyBoundary:{self:e=>[e],child:e=>[...e.children],shallow:e=>[...e.shallowReferences],references:e=>[...e.references]},applyMethod:{filter:e=>e,assertFilter:(e,t,r)=>(e.length===0&&vi(yE(t,r)),e),find:e=>e[0],assertFind:(e,t,r)=>(e.length===0&&vi(yE(t,r)),e[0])},normalize:e=>typeof e=="function"?{boundary:"references",method:"filter",where:e}:typeof e=="string"?yt(e,ko.applyBoundary)?{method:"filter",boundary:e}:{boundary:"references",method:"filter",kind:e}:{boundary:"references",method:"filter",...e}},yE=(e,t)=>`${e} had no references matching ${ye(t)}.`,lk=e=>On(e,{stringifyNonKey:t=>t.expression}),pk=/"(\$ark\.[^"]+)"/g,dk=e=>JSON.stringify(e).replace(pk,"$1"),Pr=(e,t)=>({path:e,node:t,propString:lk(e)}),bE=(e,t)=>e.propString===t.propString&&e.node.equals(t.node),xd=(e,t)=>en(e,t,{isEqual:bE}),fk=(e,t)=>en(e,t,{isEqual:(r,n)=>r.equals(n)});u();var X=class e extends Array{static init(t,r,n,i){return new e({kind:t,l:r,r:n,path:i?.path??[],optional:i?.optional??!1})}add(t,r,n,i){return this.push({kind:t,l:r,r:n,path:i?.path??[],optional:i?.optional??!1}),this}get summary(){return this.describeReasons()}describeReasons(){if(this.length===1){let{path:t,l:r,r:n}=this[0],i=On(t);return Sd(`Intersection${i&&` at ${i}`} of ${vE(r,n)}`)}return`The following intersections result in unsatisfiable types:
331
+ \u2022 ${this.map(({path:t,l:r,r:n})=>`${t}: ${vE(r,n)}`).join(`
332
+ \u2022 `)}`}throw(){return L(this.describeReasons())}invert(){let t=this.map(r=>({...r,l:r.r,r:r.l}));return t instanceof e?t:new e(...t)}withPrefixKey(t,r){return this.map(n=>({...n,path:[t,...n.path],optional:n.optional||r==="optional"}))}toNeverIfDisjoint(){return M.intrinsic.never}},vE=(e,t)=>`${wd(e)} and ${wd(t)}`,wd=e=>We(e)?e.expression:He(e)?e.map(wd).join(" | ")||"never":String(e),Sd=e=>`${e} results in an unsatisfiable type`;u();var ws={},zt=(e,t,r)=>Je(e,t,{$:r,invert:!1,pipe:!1}),Do=(e,t,r)=>Je(e,t,{$:r,invert:!1,pipe:!0}),Je=((e,t,r)=>{let n=r.pipe?"|>":"&",i=`${e.hash}${n}${t.hash}`;if(ws[i]!==void 0)return ws[i];if(!r.pipe){let a=`${t.hash}${n}${e.hash}`;if(ws[a]!==void 0){let c=ws[a],l=c instanceof X?c.invert():c;return ws[i]=l,l}}let s=!r.pipe||!e.includesTransform&&!t.includesTransform;if(s&&e.equals(t))return e;let o=s?Od(e,t,r):e.hasKindIn(...vs)?hk(e,t,r):Od(e,t,r);return We(o)&&(e.equals(o)?o=e:t.equals(o)&&(o=t)),ws[i]=o,o}),Od=(e,t,r)=>{let n=e.precedence<t.precedence?e.kind:t.kind,i=e.impl.intersections[t.kind]??t.impl.intersections[e.kind];if(i===void 0)return null;if(n===e.kind)return i(e,t,r);{let s=i(t,e,{...r,invert:!r.invert});return s instanceof X&&(s=s.invert()),s}},hk=(e,t,r)=>e.includesTransform||t.includesTransform?r.invert?TE(t,e,r):TE(e,t,r):Od(e,t,r),TE=(e,t,r)=>e.distribute(n=>mk(n,t,r),n=>{let i=n.filter(We);if(i.length===0)return X.init("union",e.branches,t.branches);if(i.length<e.branches.length||!e.branches.every((a,c)=>a.rawIn.equals(i[c].rawIn)))return r.$.parseSchema(i);let s;if(i.length===1){let a=i[0];return s?r.$.node("morph",{...a.inner,in:a.rawIn.configure(s,"self")}):a}let o={branches:i};return s&&(o.meta=s),r.$.parseSchema(o)}),mk=(e,t,r)=>{if(e.hasKind("morph")){let i=[...e.morphs];if(e.lastMorphIfNode){let s=Je(e.lastMorphIfNode,t,r);if(s instanceof X)return s;i[i.length-1]=s}else i.push(t);return r.$.node("morph",{morphs:i,in:e.inner.in})}if(t.hasKind("morph")){let i=Je(e,t.rawIn,r);return i instanceof X?i:r.$.node("morph",{morphs:[t],in:i})}return r.$.node("morph",{morphs:[t],in:e})};var or=class extends xs{constructor(t,r){super(t,r),Object.defineProperty(this,$t,{value:"constraint",enumerable:!1})}impliedSiblings;intersect(t){return zt(this,t,this.$)}},rn=class extends or{traverseApply=(t,r)=>{this.traverseAllows(t,r)||r.errorFromNodeContext(this.errorContext)};compile(t){t.traversalKind==="Allows"?t.return(this.compiledCondition):t.if(this.compiledNegation,()=>t.line(`ctx.errorFromNodeContext(${this.compiledErrorContext})`))}get errorContext(){return{code:this.kind,description:this.description,meta:this.meta,...this.inner}}get compiledErrorContext(){return Kn(this.errorContext)}},Rt=e=>(t,r)=>{if(He(t)){if(t.length===0)return;let i=t.map(s=>r.$.node(e,s));return e==="predicate"?i:i.sort((s,o)=>s.hash<o.hash?-1:1)}let n=r.$.node(e,t);return n.hasOpenIntersection()?[n]:n},Ss=e=>{let t=e.r.shift();if(!t){let n=e.l.length===0&&e.kind==="structure"?M.intrinsic.unknown.internal:e.ctx.$.node(e.kind,Object.assign(e.baseInner,gk(e.l)),{prereduced:!0});for(let i of e.roots){if(n instanceof X)return n;n=Je(i,n,e.ctx)}return n}let r=!1;for(let n=0;n<e.l.length;n++){let i=Je(e.l[n],t,e.ctx);if(i!==null){if(i instanceof X)return i;if(i.isRoot())return e.roots.push(i),e.l.splice(n),Ss(e);if(!r)e.l[n]=i,r=!0;else if(!e.l.includes(i))return $e(`Unexpectedly encountered multiple distinct intersection results for refinement ${t}`)}}if(r||e.l.push(t),e.kind==="intersection"&&t.impliedSiblings)for(let n of t.impliedSiblings)en(e.r,n);return Ss(e)},Os=e=>Object.entries(e).flatMap(([r,n])=>r in jc?n:[]).sort((r,n)=>r.precedence<n.precedence?-1:r.precedence>n.precedence?1:r.kind==="predicate"&&n.kind==="predicate"?0:r.hash<n.hash?-1:1),gk=e=>{let t={};for(let r of e)if(r.hasOpenIntersection())t[r.kind]=Ne(t[r.kind],r);else{if(t[r.kind])return $e(`Unexpected intersection of closed refinements of kind ${r.kind}`);t[r.kind]=r}return t},EE=(...e)=>L(xE(...e)),xE=(e,t,r)=>{let n=r.hasKind("morph")?"a morph":r.isUnknown()?"unknown":r.exclude(t).defaultShortDescription;return`${WT(e)} operand must be ${t.description} (was ${n})`};u();var wE=(e,t,r)=>new _n(e,t,r,r,null),$o=class extends Dt{},_n=class extends Dt{[$t]="generic";paramDefs;bodyDef;$;arg$;baseInstantiation;hkt;description;constructor(t,r,n,i,s){super((...o)=>{let a=ge(this.names,(c,l)=>{let p=this.arg$.parse(o[c]);return p.extends(this.constraints[c])||L(yk(l,this.constraints[c].expression,p.expression)),[l,p]});if(this.defIsLazy()){let c=this.bodyDef(a);return this.$.parse(c)}return this.$.parse(r,{args:a})}),this.paramDefs=t,this.bodyDef=r,this.$=n,this.arg$=i,this.hkt=s,this.description=s?new s().description??`a generic type for ${s.constructor.name}`:"a generic type",this.baseInstantiation=this(...this.constraints)}defIsLazy(){return this.bodyDef instanceof $o}cacheGetter(t,r){return Object.defineProperty(this,t,{value:r}),r}get json(){return this.cacheGetter("json",{params:this.params.map(t=>t[1].isUnknown()?t[0]:[t[0],t[1].json]),body:aE(this.bodyDef)})}get params(){return this.cacheGetter("params",this.paramDefs.map(t=>typeof t=="string"?[t,M.intrinsic.unknown]:[t[0],this.$.parse(t[1])]))}get names(){return this.cacheGetter("names",this.params.map(t=>t[0]))}get constraints(){return this.cacheGetter("constraints",this.params.map(t=>t[1]))}get internal(){return this}get referencesById(){return this.baseInstantiation.internal.referencesById}get references(){return this.baseInstantiation.internal.references}},yk=(e,t,r)=>`${e} must be assignable to ${t} (was ${r})`;u();u();u();u();var bk=be({kind:"predicate",hasAssociatedError:!0,collapsibleKey:"predicate",keys:{predicate:{}},normalize:e=>typeof e=="function"?{predicate:e}:e,defaults:{description:e=>`valid according to ${e.predicate.name||"an anonymous predicate"}`},intersectionIsOpen:!0,intersections:{predicate:()=>null}}),_d=class extends or{serializedPredicate=nt(this.predicate);compiledCondition=`${this.serializedPredicate}(data, ctx)`;compiledNegation=`!${this.compiledCondition}`;impliedBasis=null;expression=this.serializedPredicate;traverseAllows=this.predicate;errorContext={code:"predicate",description:this.description,meta:this.meta};compiledErrorContext=Kn(this.errorContext);traverseApply=(t,r)=>{let n=r.currentErrorCount;!this.predicate(t,r.external)&&r.currentErrorCount===n&&r.errorFromNodeContext(this.errorContext)};compile(t){if(t.traversalKind==="Allows"){t.return(this.compiledCondition);return}t.initializeErrorCount(),t.if(`${this.compiledNegation} && ctx.currentErrorCount === errorCount`,()=>t.line(`ctx.errorFromNodeContext(${this.compiledErrorContext})`))}reduceJsonSchema(t,r){return r.fallback.predicate({code:"predicate",base:t,predicate:this.predicate})}},Ad={implementation:bk,Node:_d};u();var vk=be({kind:"divisor",collapsibleKey:"rule",keys:{rule:{parse:e=>Number.isInteger(e)?e:L(Tk(e))}},normalize:e=>typeof e=="number"?{rule:e}:e,hasAssociatedError:!0,defaults:{description:e=>e.rule===1?"an integer":e.rule===2?"even":`a multiple of ${e.rule}`},intersections:{divisor:(e,t,r)=>r.$.node("divisor",{rule:Math.abs(e.rule*t.rule/Ek(e.rule,t.rule))})},obviatesBasisDescription:!0}),Nd=class extends rn{traverseAllows=t=>t%this.rule===0;compiledCondition=`data % ${this.rule} === 0`;compiledNegation=`data % ${this.rule} !== 0`;impliedBasis=M.intrinsic.number.internal;expression=`% ${this.rule}`;reduceJsonSchema(t){return t.type="integer",this.rule===1||(t.multipleOf=this.rule),t}},Id={implementation:vk,Node:Nd};var Tk=e=>`divisor must be an integer (was ${e})`,Ek=(e,t)=>{let r,n=e,i=t;for(;i!==0;)r=i,i=n%i,n=r;return n};u();u();u();var Wt=class extends rn{boundOperandKind=Ok[this.kind];compiledActual=this.boundOperandKind==="value"?"data":this.boundOperandKind==="length"?"data.length":"data.valueOf()";comparator=_k(this.kind,this.exclusive);numericLimit=this.rule.valueOf();expression=`${this.comparator} ${this.rule}`;compiledCondition=`${this.compiledActual} ${this.comparator} ${this.numericLimit}`;compiledNegation=`${this.compiledActual} ${xk[this.comparator]} ${this.numericLimit}`;stringLimit=this.boundOperandKind==="date"?Ak(this.numericLimit):`${this.numericLimit}`;limitKind=this.comparator[0]==="<"?"upper":"lower";isStricterThan(t){return(this.limitKind==="upper"?this.numericLimit<t.numericLimit:this.numericLimit>t.numericLimit)||this.numericLimit===t.numericLimit&&this.exclusive===!0&&!t.exclusive}overlapsRange(t){return!(this.isStricterThan(t)||this.numericLimit===t.numericLimit&&(this.exclusive||t.exclusive))}overlapIsUnit(t){return this.numericLimit===t.numericLimit&&!this.exclusive&&!t.exclusive}},xk={"<":">=","<=":">",">":"<=",">=":"<"},wk={min:"max",minLength:"maxLength",after:"before"},Mc={parse:e=>e||void 0},Uc=e=>t=>{if(typeof t=="number")return{rule:t};let{exclusive:r,...n}=t;return r?{...n,rule:e==="minLength"?n.rule+1:n.rule-1}:n},Bc=e=>t=>{if(typeof t=="number"||typeof t=="string"||t instanceof Date)return{rule:t};let{exclusive:r,...n}=t;if(!r)return n;let i=typeof n.rule=="number"?n.rule:typeof n.rule=="string"?new Date(n.rule).valueOf():n.rule.valueOf();return r?{...n,rule:e==="after"?i+1:i-1}:n},Vc=e=>typeof e=="string"||typeof e=="number"?new Date(e):e,Sk=(e,t)=>`${e} bound must be a positive integer (was ${t})`,_s=e=>t=>((!Number.isInteger(t)||t<0)&&L(Sk(e,t)),t),Ok={min:"value",max:"value",minLength:"length",maxLength:"length",after:"date",before:"date"},_k=(e,t)=>`${yt(e,wk)?">":"<"}${t?"":"="}`,Ak=e=>typeof e=="string"?e:new Date(e).toLocaleString(),SE=e=>`Bounded expression ${e} must be exactly one of number, string, Array, or Date`;var Nk=be({kind:"after",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:Vc,serialize:e=>e.toISOString()}},normalize:Bc("after"),defaults:{description:e=>`${e.collapsibleLimitString} or later`,actual:Si},intersections:{after:(e,t)=>e.isStricterThan(t)?e:t}}),Rd=class extends Wt{impliedBasis=M.intrinsic.Date.internal;collapsibleLimitString=Si(this.rule);traverseAllows=t=>t>=this.rule;reduceJsonSchema(t,r){return r.fallback.date({code:"date",base:t,after:this.rule})}},Cd={implementation:Nk,Node:Rd};u();var Ik=be({kind:"before",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:Vc,serialize:e=>e.toISOString()}},normalize:Bc("before"),defaults:{description:e=>`${e.collapsibleLimitString} or earlier`,actual:Si},intersections:{before:(e,t)=>e.isStricterThan(t)?e:t,after:(e,t,r)=>e.overlapsRange(t)?e.overlapIsUnit(t)?r.$.node("unit",{unit:e.rule}):null:X.init("range",e,t)}}),Ld=class extends Wt{collapsibleLimitString=Si(this.rule);traverseAllows=t=>t<=this.rule;impliedBasis=M.intrinsic.Date.internal;reduceJsonSchema(t,r){return r.fallback.date({code:"date",base:t,before:this.rule})}},kd={implementation:Ik,Node:Ld};u();var Rk=be({kind:"exactLength",collapsibleKey:"rule",keys:{rule:{parse:_s("exactLength")}},normalize:e=>typeof e=="number"?{rule:e}:e,hasAssociatedError:!0,defaults:{description:e=>`exactly length ${e.rule}`,actual:e=>`${e.length}`},intersections:{exactLength:(e,t,r)=>X.init("unit",r.$.node("unit",{unit:e.rule}),r.$.node("unit",{unit:t.rule}),{path:["length"]}),minLength:(e,t)=>e.rule>=t.rule?e:X.init("range",e,t),maxLength:(e,t)=>e.rule<=t.rule?e:X.init("range",e,t)}}),Dd=class extends rn{traverseAllows=t=>t.length===this.rule;compiledCondition=`data.length === ${this.rule}`;compiledNegation=`data.length !== ${this.rule}`;impliedBasis=M.intrinsic.lengthBoundable.internal;expression=`== ${this.rule}`;reduceJsonSchema(t){switch(t.type){case"string":return t.minLength=this.rule,t.maxLength=this.rule,t;case"array":return t.minItems=this.rule,t.maxItems=this.rule,t;default:return Ye.throwInternalOperandError("exactLength",t)}}},$d={implementation:Rk,Node:Dd};u();var Ck=be({kind:"max",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{},exclusive:Mc},normalize:e=>typeof e=="number"?{rule:e}:e,defaults:{description:e=>e.rule===0?e.exclusive?"negative":"non-positive":`${e.exclusive?"less than":"at most"} ${e.rule}`},intersections:{max:(e,t)=>e.isStricterThan(t)?e:t,min:(e,t,r)=>e.overlapsRange(t)?e.overlapIsUnit(t)?r.$.node("unit",{unit:e.rule}):null:X.init("range",e,t)},obviatesBasisDescription:!0}),Pd=class extends Wt{impliedBasis=M.intrinsic.number.internal;traverseAllows=this.exclusive?t=>t<this.rule:t=>t<=this.rule;reduceJsonSchema(t){return this.exclusive?t.exclusiveMaximum=this.rule:t.maximum=this.rule,t}},jd={implementation:Ck,Node:Pd};u();var Lk=be({kind:"maxLength",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:_s("maxLength")}},reduce:(e,t)=>e.rule===0?t.node("exactLength",e):void 0,normalize:Uc("maxLength"),defaults:{description:e=>`at most length ${e.rule}`,actual:e=>`${e.length}`},intersections:{maxLength:(e,t)=>e.isStricterThan(t)?e:t,minLength:(e,t,r)=>e.overlapsRange(t)?e.overlapIsUnit(t)?r.$.node("exactLength",{rule:e.rule}):null:X.init("range",e,t)}}),qd=class extends Wt{impliedBasis=M.intrinsic.lengthBoundable.internal;traverseAllows=t=>t.length<=this.rule;reduceJsonSchema(t){switch(t.type){case"string":return t.maxLength=this.rule,t;case"array":return t.maxItems=this.rule,t;default:return Ye.throwInternalOperandError("maxLength",t)}}},Fd={implementation:Lk,Node:qd};u();var kk=be({kind:"min",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{},exclusive:Mc},normalize:e=>typeof e=="number"?{rule:e}:e,defaults:{description:e=>e.rule===0?e.exclusive?"positive":"non-negative":`${e.exclusive?"more than":"at least"} ${e.rule}`},intersections:{min:(e,t)=>e.isStricterThan(t)?e:t},obviatesBasisDescription:!0}),Md=class extends Wt{impliedBasis=M.intrinsic.number.internal;traverseAllows=this.exclusive?t=>t>this.rule:t=>t>=this.rule;reduceJsonSchema(t){return this.exclusive?t.exclusiveMinimum=this.rule:t.minimum=this.rule,t}},Ud={implementation:kk,Node:Md};u();var Dk=be({kind:"minLength",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:_s("minLength")}},reduce:e=>e.rule===0?M.intrinsic.unknown:void 0,normalize:Uc("minLength"),defaults:{description:e=>e.rule===1?"non-empty":`at least length ${e.rule}`,actual:e=>e.length===0?"":`${e.length}`},intersections:{minLength:(e,t)=>e.isStricterThan(t)?e:t}}),Bd=class extends Wt{impliedBasis=M.intrinsic.lengthBoundable.internal;traverseAllows=t=>t.length>=this.rule;reduceJsonSchema(t){switch(t.type){case"string":return t.minLength=this.rule,t;case"array":return t.minItems=this.rule,t;default:return Ye.throwInternalOperandError("minLength",t)}}},Vd={implementation:Dk,Node:Bd};var OE={min:Ud.implementation,max:jd.implementation,minLength:Vd.implementation,maxLength:Fd.implementation,exactLength:$d.implementation,after:Cd.implementation,before:kd.implementation},_E={min:Ud.Node,max:jd.Node,minLength:Vd.Node,maxLength:Fd.Node,exactLength:$d.Node,after:Cd.Node,before:kd.Node};u();var $k=be({kind:"pattern",collapsibleKey:"rule",keys:{rule:{},flags:{}},normalize:e=>typeof e=="string"?{rule:e}:e instanceof RegExp?e.flags?{rule:e.source,flags:e.flags}:{rule:e.source}:e,obviatesBasisDescription:!0,obviatesBasisExpression:!0,hasAssociatedError:!0,intersectionIsOpen:!0,defaults:{description:e=>`matched by ${e.rule}`},intersections:{pattern:()=>null}}),Kd=class extends rn{instance=new RegExp(this.rule,this.flags);expression=`${this.instance}`;traverseAllows=this.instance.test.bind(this.instance);compiledCondition=`${this.expression}.test(data)`;compiledNegation=`!${this.compiledCondition}`;impliedBasis=M.intrinsic.string.internal;reduceJsonSchema(t,r){return t.pattern?r.fallback.patternIntersection({code:"patternIntersection",base:t,pattern:this.rule}):(t.pattern=this.rule,t)}},Gd={implementation:$k,Node:Kd};u();u();var Po=(e,t)=>{let r=Pk(e);return t&&!t.includes(r)?L(`Root of kind ${r} should be one of ${t}`):r},Pk=e=>{if(re(e,"root"))return e.kind;if(typeof e=="string")return e[0]==="$"?"alias":e in Kt?"domain":"proto";if(typeof e=="function")return"proto";if(typeof e!="object"||e===null)return L(AE(e));if("morphs"in e)return"morph";if("branches"in e||He(e))return"union";if("unit"in e)return"unit";if("reference"in e)return"alias";let t=Object.keys(e);return t.length===0||t.some(r=>r in jc)?"intersection":"proto"in e?"proto":"domain"in e?"domain":L(AE(e))},AE=e=>`${ye(e)} is not a valid type schema`,NE={},jk=e=>He(e)?e.map(t=>t.collapsibleJson):e.collapsibleJson,Pt={};M.nodesByRegisteredId=Pt;var Hd=e=>(NE[e]??=0,`${e}${++NE[e]}`),Qd=e=>{let t=As[e.kind],r=t.applyConfig?.(e.def,e.$.resolvedConfig)??e.def,n={},{meta:i,...s}=r,o=i===void 0?{}:typeof i=="string"?{description:i}:i,a=ad(s).sort(([l],[p])=>Ts(l)?Ts(p)?Es(l)-Es(p):1:Ts(p)||l<p?-1:1).filter(([l,p])=>{if(l.startsWith("meta.")){let d=l.slice(5);return o[d]=p,!1}return!0});for(let l of a){let p=l[0],d=t.keys[p];if(!d)return L(`Key ${p} is not valid on ${e.kind} schema`);let f=d.parse?d.parse(l[1],e):l[1];f!==Gt&&(f!==void 0||d.preserveUndefined)&&(n[p]=f)}if(t.reduce&&!e.prereduced){let l=t.reduce(n,e.$);if(l)return l instanceof X?l.throw():qk(l,o)}return zd({id:e.id,kind:e.kind,inner:n,meta:o,$:e.$})},zd=({id:e,kind:t,inner:r,meta:n,$:i,ignoreCache:s})=>{let o=As[t],a=ad(r),c=[],l={};for(let[A,w]of a){let _=o.keys[A],I=_.serialize??(_.child?jk:yr);if(l[A]=I(w),_.child===!0){let C=w;He(C)?c.push(...C):c.push(C)}else typeof _.child=="function"&&c.push(..._.child(w))}o.finalizeInnerJson&&(l=o.finalizeInnerJson(l));let p={...l},d={};tn(n)||(d=ge(n,(A,w)=>[A,A==="examples"?w:yr(w)]),p.meta=Kc(d,"description",!0)),l=Kc(l,o.collapsibleKey,!1);let f=JSON.stringify({kind:t,...l});p=Kc(p,o.collapsibleKey,!1);let m=Kc(p,o.collapsibleKey,!0),h=JSON.stringify({kind:t,...p});if(i.nodesByHash[h]&&!s)return i.nodesByHash[h];let v={id:e,kind:t,impl:o,inner:r,innerEntries:a,innerJson:l,innerHash:f,meta:n,metaJson:d,json:p,hash:h,collapsibleJson:m,children:c};if(t!=="intersection")for(let A in r)A!=="in"&&A!=="out"&&(v[A]=r[A]);let E=new RE[t](v,i);return i.nodesByHash[h]=E},IE=(e,t)=>e.id===t?e:(We(Pt[t])&&$e(`Unexpected attempt to overwrite node id ${t}`),zd({id:t,kind:e.kind,inner:e.inner,meta:e.meta,$:e.$,ignoreCache:!0})),qk=(e,t,r)=>(r&&We(Pt[r])&&$e(`Unexpected attempt to overwrite node id ${r}`),zd({id:r??Hd(t.alias??e.kind),kind:e.kind,inner:e.inner,meta:t,$:e.$})),Kc=(e,t,r)=>{let n=Object.keys(e);if(n.length===1&&n[0]===t){let i=e[t];if(r||Vt(i,"object")&&(Object.keys(i).length===1||Array.isArray(i)))return i}return e};u();u();u();var jo=(e,t,r)=>{if(e.key!==t.key)return null;let n=e.key,i=Je(e.value,t.value,r),s=e.required||t.required?"required":"optional";if(i instanceof X)if(s==="optional")i=M.intrinsic.never.internal;else return i.withPrefixKey(e.key,e.required&&t.required?"required":"optional");if(s==="required")return r.$.node("required",{key:n,value:i});let o=e.hasDefault()?t.hasDefault()?e.default===t.default?e.default:L(Wd(e.default,t.default)):e.default:t.hasDefault()?t.default:Gt;return r.$.node("optional",{key:n,value:i,default:o})},Ns=class extends or{required=this.kind==="required";optional=this.kind==="optional";impliedBasis=M.intrinsic.object.internal;serializedKey=$r(this.key);compiledKey=typeof this.key=="string"?this.key:this.serializedKey;flatRefs=Ne(this.value.flatRefs.map(t=>Pr([this.key,...t.path],t.node)),Pr([this.key],this.value));_transform(t,r){r.path.push(this.key);let n=super._transform(t,r);return r.path.pop(),n}hasDefault(){return"default"in this.inner}traverseAllows=(t,r)=>this.key in t?Qt(this.key,()=>this.value.traverseAllows(t[this.key],r),r):this.optional;traverseApply=(t,r)=>{this.key in t?Qt(this.key,()=>this.value.traverseApply(t[this.key],r),r):this.hasKind("required")&&r.errorFromNodeContext(this.errorContext)};compile(t){t.if(`${this.serializedKey} in data`,()=>t.traverseKey(this.serializedKey,`data${t.prop(this.key)}`,this.value)),this.hasKind("required")&&t.else(()=>t.traversalKind==="Apply"?t.line(`ctx.errorFromNodeContext(${this.compiledErrorContext})`):t.return(!1)),t.traversalKind==="Allows"&&t.return(!0)}},Wd=(e,t)=>`Invalid intersection of default values ${ye(e)} & ${ye(t)}`;var Fk=be({kind:"optional",hasAssociatedError:!1,intersectionIsOpen:!0,keys:{key:{},value:{child:!0,parse:(e,t)=>t.$.parseSchema(e)},default:{preserveUndefined:!0}},normalize:e=>e,reduce:(e,t)=>{if(t.resolvedConfig.exactOptionalPropertyTypes===!1&&!e.value.allows(void 0))return t.node("optional",{...e,value:e.value.or(ae.undefined)},{prereduced:!0})},defaults:{description:e=>`${e.compiledKey}?: ${e.value.description}`},intersections:{optional:jo}}),Jd=class extends Ns{constructor(...t){super(...t),"default"in this.inner&&Fo(this.value,this.inner.default,this.key)}get rawIn(){let t=super.rawIn;return this.hasDefault()?this.$.node("optional",Cc(t.inner,{default:!0}),{prereduced:!0}):t}get outProp(){if(!this.hasDefault())return this;let{default:t,...r}=this.inner;return this.cacheGetter("outProp",this.$.node("required",r,{prereduced:!0}))}expression=this.hasDefault()?`${this.compiledKey}: ${this.value.expression} = ${ye(this.inner.default)}`:`${this.compiledKey}?: ${this.value.expression}`;defaultValueMorph=Uk(this);defaultValueMorphRef=this.defaultValueMorph&&nt(this.defaultValueMorph)},qo={implementation:Fk,Node:Jd},Mk={},Uk=e=>{if(!e.hasDefault())return;let t=`{${e.compiledKey}: ${e.value.id} = ${yr(e.default)}}`;return Mk[t]??=Yd(e.key,e.value,e.default)},Yd=(e,t,r)=>{if(typeof r=="function")return t.includesTransform?(i,s)=>(Qt(e,()=>t(i[e]=r(),s),s),i):i=>(i[e]=r(),i);let n=t.includesTransform?t.assert(r):r;return Vt(n,"object")?(i,s)=>(Qt(e,()=>t(i[e]=r,s),s),i):i=>(i[e]=n,i)},Fo=(e,t,r)=>{let n=Un(t);Vt(t,"object")&&!n&&L(Bk(r));let i=e.in(n?t():t);if(i instanceof Ht){r===null&&L(`Default ${i.summary}`);let s=i.transform(o=>o.transform(a=>({...a,prefixPath:[r]})));L(`Default for ${s.summary}`)}return t},Bk=e=>`Non-primitive default ${e===null?"":typeof e=="number"?`for value at [${e}] `:`for ${$r(e)} `}must be specified as a function like () => ({my: 'object'})`;var ar=class extends xs{constructor(t,r){super(t,r),Object.defineProperty(this,$t,{value:"root",enumerable:!1})}get rawIn(){return super.rawIn}get rawOut(){return super.rawOut}get internal(){return this}get"~standard"(){return{vendor:"arktype",version:1,validate:t=>{let r=this(t);return r instanceof Ht?r:{value:r}},jsonSchema:{input:t=>this.rawIn.toJsonSchema({target:CE(t.target),...t.libraryOptions}),output:t=>this.rawOut.toJsonSchema({target:CE(t.target),...t.libraryOptions})}}}as(){return this}brand(t){return t===""?L(Vk):this}readonly(){return this}branches=this.hasKind("union")?this.inner.branches:[this];distribute(t,r){let n=this.branches.map(t);return r?.(n)??n}get shortDescription(){return this.meta.description??this.defaultShortDescription}toJsonSchema(t={}){let r=Ed(this.$.resolvedConfig.toJsonSchema,t);r.useRefs||=this.isCyclic;let n=typeof r.dialect=="string"?{$schema:r.dialect}:{};if(Object.assign(n,this.toJsonSchemaRecurse(r)),r.useRefs){let i=ge(this.references,(s,o)=>o.isRoot()&&!o.alwaysExpandJsonSchema?[o.id,o.toResolvedJsonSchema(r)]:[]);r.target==="draft-07"?Object.assign(n,{definitions:i}):n.$defs=i}return n}toJsonSchemaRecurse(t){return t.useRefs&&!this.alwaysExpandJsonSchema?{$ref:`#/${t.target==="draft-07"?"definitions":"$defs"}/${this.id}`}:this.toResolvedJsonSchema(t)}get alwaysExpandJsonSchema(){return this.isBasis()||this.kind==="alias"||this.hasKind("union")&&this.isBoolean}toResolvedJsonSchema(t){let r=this.innerToJsonSchema(t);return Object.assign(r,this.metaJson)}intersect(t){let r=this.$.parseDefinition(t),n=this.rawIntersect(r);return n instanceof X?n:this.$.finalize(n)}rawIntersect(t){return zt(this,t,this.$)}toNeverIfDisjoint(){return this}and(t){let r=this.intersect(t);return r instanceof X?r.throw():r}rawAnd(t){let r=this.rawIntersect(t);return r instanceof X?r.throw():r}or(t){let r=this.$.parseDefinition(t);return this.$.finalize(this.rawOr(r))}rawOr(t){let r=[...this.branches,...t.branches];return this.$.node("union",r)}map(t){return this.$.schema(this.applyStructuralOperation("map",[t]))}pick(...t){return this.$.schema(this.applyStructuralOperation("pick",t))}omit(...t){return this.$.schema(this.applyStructuralOperation("omit",t))}required(){return this.$.schema(this.applyStructuralOperation("required",[]))}partial(){return this.$.schema(this.applyStructuralOperation("partial",[]))}_keyof;keyof(){if(this._keyof)return this._keyof;let t=this.applyStructuralOperation("keyof",[]).reduce((r,n)=>r.intersect(n).toNeverIfDisjoint(),M.intrinsic.unknown.internal);return t.branches.length===0&&L(Sd(`keyof ${this.expression}`)),this._keyof=this.$.finalize(t)}get props(){return this.branches.length!==1?L(Gk(this.expression)):[...this.applyStructuralOperation("props",[])[0]]}merge(t){let r=this.$.parseDefinition(t);return this.$.schema(r.distribute(n=>this.applyStructuralOperation("merge",[LE(n)??L(kE("merge",n.expression))])))}applyStructuralOperation(t,r){return this.distribute(n=>{if(n.equals(M.intrinsic.object)&&t!=="merge")return n;let i=LE(n);if(i||L(kE(t,n.expression)),t==="keyof")return i.keyof();if(t==="get")return i.get(...r);if(t==="props")return i.props;let s=t==="required"?"require":t==="partial"?"optionalize":t;return this.$.node("intersection",{domain:"object",structure:i[s](...r)})})}get(...t){return t[0]===void 0?this:this.$.schema(this.applyStructuralOperation("get",t))}extract(t){let r=this.$.parseDefinition(t);return this.$.schema(this.branches.filter(n=>n.extends(r)))}exclude(t){let r=this.$.parseDefinition(t);return this.$.schema(this.branches.filter(n=>!n.extends(r)))}array(){return this.$.schema(this.isUnknown()?{proto:Array}:{proto:Array,sequence:this},{prereduced:!0})}overlaps(t){return!(this.intersect(t)instanceof X)}extends(t){if(this.isNever())return!0;let r=this.intersect(t);return!(r instanceof X)&&this.equals(r)}ifExtends(t){return this.extends(t)?this:void 0}subsumes(t){return this.$.parseDefinition(t).extends(this)}configure(t,r="shallow"){return this.configureReferences(t,r)}describe(t,r="shallow"){return this.configure({description:t},r)}optional(){return[this,"?"]}default(t){return Fo(this,t,null),[this,"=",t]}from(t){return this.assert(t)}_pipe(...t){let r=t.reduce((n,i)=>n.rawPipeOnce(i),this);return this.$.finalize(r)}tryPipe(...t){let r=t.reduce((n,i)=>n.rawPipeOnce(re(i,"root")?i:((s,o)=>{try{return i(s,o)}catch(a){return o.error({code:"predicate",predicate:i,actual:`aborted due to error:
333
+ ${a}
334
+ `})}})),this);return this.$.finalize(r)}pipe=Object.assign(this._pipe.bind(this),{try:this.tryPipe.bind(this)});to(t){return this.$.finalize(this.toNode(this.$.parseDefinition(t)))}toNode(t){let r=Do(this,t,this.$);return r instanceof X?r.throw():r}rawPipeOnce(t){return re(t,"root")?this.toNode(t):this.distribute(r=>r.hasKind("morph")?this.$.node("morph",{in:r.inner.in,morphs:[...r.morphs,t]}):this.$.node("morph",{in:r,morphs:[t]}),this.$.parseSchema)}narrow(t){return this.constrainOut("predicate",t)}constrain(t,r){return this._constrain("root",t,r)}constrainIn(t,r){return this._constrain("in",t,r)}constrainOut(t,r){return this._constrain("out",t,r)}_constrain(t,r,n){let i=this.$.node(r,n);if(i.isRoot())return i.isUnknown()?this:$e(`Unexpected constraint node ${i}`);let s=t==="root"?this:t==="in"?this.rawIn:this.rawOut;if(s.hasKind("morph")||i.impliedBasis&&!s.extends(i.impliedBasis))return EE(r,i.impliedBasis,this);let o=this.$.node("intersection",{[i.kind]:i}),a=t==="out"?Do(this,o,this.$):zt(this,o,this.$);return a instanceof X&&a.throw(),this.$.finalize(a)}onUndeclaredKey(t){let r=typeof t=="string"?t:t.rule,n=typeof t=="string"?!1:t.deep;return this.$.finalize(this.transform((i,s)=>i==="structure"?r==="ignore"?Cc(s,{undeclared:1}):{...s,undeclared:r}:s,n?void 0:{shouldTransform:i=>!gr(bs,i.kind)}))}hasEqualMorphs(t){return!this.includesTransform&&!t.includesTransform?!0:!(!wn(this.shallowMorphs,t.shallowMorphs)||!wn(this.flatMorphs,t.flatMorphs,{isEqual:(r,n)=>r.propString===n.propString&&(r.node.hasKind("morph")&&n.node.hasKind("morph")?r.node.hasEqualMorphs(n.node):r.node.hasKind("intersection")&&n.node.hasKind("intersection")?r.node.structure?.structuralMorphRef===n.node.structure?.structuralMorphRef:!1)}))}onDeepUndeclaredKey(t){return this.onUndeclaredKey({rule:t,deep:!0})}filter(t){return this.constrainIn("predicate",t)}divisibleBy(t){return this.constrain("divisor",t)}matching(t){return this.constrain("pattern",t)}atLeast(t){return this.constrain("min",t)}atMost(t){return this.constrain("max",t)}moreThan(t){return this.constrain("min",Is(t))}lessThan(t){return this.constrain("max",Is(t))}atLeastLength(t){return this.constrain("minLength",t)}atMostLength(t){return this.constrain("maxLength",t)}moreThanLength(t){return this.constrain("minLength",Is(t))}lessThanLength(t){return this.constrain("maxLength",Is(t))}exactlyLength(t){return this.constrain("exactLength",t)}atOrAfter(t){return this.constrain("after",t)}atOrBefore(t){return this.constrain("before",t)}laterThan(t){return this.constrain("after",Is(t))}earlierThan(t){return this.constrain("before",Is(t))}},Vk="Expected a non-empty brand name after #",DE=["draft-2020-12","draft-07"],Kk=e=>`JSONSchema target '${e}' is not supported (must be ${DE.map(t=>`"${t}"`).join(" or ")})`,CE=e=>(gr(DE,e)||L(Kk(e)),e),Is=e=>typeof e=="object"&&!(e instanceof Date)?{...e,exclusive:!0}:{rule:e,exclusive:!0},Mo=(e,t)=>re(t,"root")?re(e,"root")?e.extends(t):t.allows(e):re(e,"root")?e.hasUnit(t):t===e,LE=e=>e.hasKind("morph")?null:e.hasKind("intersection")?e.inner.structure??(e.basis?.domain==="object"?e.$.bindReference(M.intrinsic.emptyStructure):null):e.isBasis()&&e.domain==="object"?e.$.bindReference(M.intrinsic.emptyStructure):null,Gk=e=>`Props cannot be extracted from a union. Use .distribute to extract props from each branch instead. Received:
335
+ ${e}`,kE=(e,t)=>`${e} operand must be an object (was ${t})`;u();var nn=(e,t)=>ge(qc(e),(r,n)=>[n,t]);var Hk=e=>typeof e=="string"?{reference:e}:e,$E=e=>e instanceof X?M.intrinsic.never.internal:e,Qk=be({kind:"alias",hasAssociatedError:!1,collapsibleKey:"reference",keys:{reference:{serialize:e=>e.startsWith("$")?e:`$ark.${e}`},resolve:{}},normalize:Hk,defaults:{description:e=>e.reference},intersections:{alias:(e,t,r)=>r.$.lazilyResolve(()=>$E(Je(e.resolution,t.resolution,r)),`${e.reference}${r.pipe?"=>":"&"}${t.reference}`),...nn("alias",(e,t,r)=>t.isUnknown()?e:t.isNever()?t:t.isBasis()&&!t.overlaps(M.intrinsic.object)?X.init("assignability",M.intrinsic.object,t):r.$.lazilyResolve(()=>$E(Je(e.resolution,t,r)),`${e.reference}${r.pipe?"=>":"&"}${t.id}`))}}),Xd=class extends ar{expression=this.reference;structure=void 0;get resolution(){let t=this._resolve();return Pt[this.id]=t}_resolve(){if(this.resolve)return this.resolve();if(this.reference[0]==="$")return this.$.resolveRoot(this.reference.slice(1));let t=this.reference,r=Pt[t],n=[];for(;re(r,"context");){if(n.includes(r.id))return L(zk(r.id,n));n.push(r.id),r=Pt[r.id]}return re(r,"root")?r:$e(`Unexpected resolution for reference ${this.reference}
336
+ Seen: [${n.join("->")}]
337
+ Resolution: ${ye(r)}`)}get resolutionId(){if(this.reference.includes("&")||this.reference.includes("=>"))return this.resolution.id;if(this.reference[0]!=="$")return this.reference;let t=this.reference.slice(1),r=this.$.resolutions[t];return typeof r=="string"?r:re(r,"root")?r.id:$e(`Unexpected resolution for reference ${this.reference}: ${ye(r)}`)}get defaultShortDescription(){return Kt.object}innerToJsonSchema(t){return this.resolution.toJsonSchemaRecurse(t)}traverseAllows=(t,r)=>{let n=r.seen[this.reference];return n?.includes(t)?!0:(r.seen[this.reference]=Ne(n,t),this.resolution.traverseAllows(t,r))};traverseApply=(t,r)=>{let n=r.seen[this.reference];n?.includes(t)||(r.seen[this.reference]=Ne(n,t),this.resolution.traverseApply(t,r))};compile(t){let r=this.resolutionId;t.if(`ctx.seen.${r} && ctx.seen.${r}.includes(data)`,()=>t.return(!0)),t.if(`!ctx.seen.${r}`,()=>t.line(`ctx.seen.${r} = []`)),t.line(`ctx.seen.${r}.push(data)`),t.return(t.invoke(r))}},zk=(e,t)=>`Alias '${e}' has a shallow resolution cycle: ${[...t,e].join("->")}`,Uo={implementation:Qk,Node:Xd};u();u();var Hn=class extends ar{traverseApply=(t,r)=>{this.traverseAllows(t,r)||r.errorFromNodeContext(this.errorContext)};get errorContext(){return{code:this.kind,description:this.description,meta:this.meta,...this.inner}}get compiledErrorContext(){return Kn(this.errorContext)}compile(t){t.traversalKind==="Allows"?t.return(this.compiledCondition):t.if(this.compiledNegation,()=>t.line(`ctx.errorFromNodeContext(${this.compiledErrorContext})`))}};var Wk=be({kind:"domain",hasAssociatedError:!0,collapsibleKey:"domain",keys:{domain:{},numberAllowsNaN:{}},normalize:e=>typeof e=="string"?{domain:e}:fs(e,"numberAllowsNaN")&&e.domain!=="number"?L(Gc.writeBadAllowNanMessage(e.domain)):e,applyConfig:(e,t)=>e.numberAllowsNaN===void 0&&e.domain==="number"&&t.numberAllowsNaN?{...e,numberAllowsNaN:!0}:e,defaults:{description:e=>Kt[e.domain],actual:e=>Number.isNaN(e)?"NaN":Kt[gt(e)]},intersections:{domain:(e,t)=>e.domain==="number"&&t.domain==="number"?e.numberAllowsNaN?t:e:X.init("domain",e,t)}}),Zd=class extends Hn{requiresNaNCheck=this.domain==="number"&&!this.numberAllowsNaN;traverseAllows=this.requiresNaNCheck?t=>typeof t=="number"&&!Number.isNaN(t):t=>gt(t)===this.domain;compiledCondition=this.domain==="object"?'((typeof data === "object" && data !== null) || typeof data === "function")':`typeof data === "${this.domain}"${this.requiresNaNCheck?" && !Number.isNaN(data)":""}`;compiledNegation=this.domain==="object"?'((typeof data !== "object" || data === null) && typeof data !== "function")':`typeof data !== "${this.domain}"${this.requiresNaNCheck?" || Number.isNaN(data)":""}`;expression=this.numberAllowsNaN?"number | NaN":this.domain;get nestableExpression(){return this.numberAllowsNaN?`(${this.expression})`:this.expression}get defaultShortDescription(){return Kt[this.domain]}innerToJsonSchema(t){return this.domain==="bigint"||this.domain==="symbol"?t.fallback.domain({code:"domain",base:{},domain:this.domain}):{type:this.domain}}},Gc={implementation:Wk,Node:Zd,writeBadAllowNanMessage:e=>`numberAllowsNaN may only be specified with domain "number" (was ${e})`};u();var Jk=be({kind:"intersection",hasAssociatedError:!0,normalize:e=>{if(We(e))return e;let{structure:t,...r}=e,n=!!t,i=t??{},s=ge(r,(o,a)=>yt(o,fE)?(n&&L(`Flattened structure key ${o} cannot be specified alongside a root 'structure' key.`),i[o]=a,[]):[o,a]);return(re(i,"constraint")||!tn(i))&&(s.structure=i),s},finalizeInnerJson:({structure:e,...t})=>Vt(e,"object")?{...e,...t}:t,keys:{domain:{child:!0,parse:(e,t)=>t.$.node("domain",e)},proto:{child:!0,parse:(e,t)=>t.$.node("proto",e)},structure:{child:!0,parse:(e,t)=>t.$.node("structure",e),serialize:e=>{if(!e.sequence?.minLength)return e.collapsibleJson;let{sequence:t,...r}=e.collapsibleJson,{minVariadicLength:n,...i}=t,s=i.variadic&&Object.keys(i).length===1?i.variadic:i;return{...r,sequence:s}}},divisor:{child:!0,parse:Rt("divisor")},max:{child:!0,parse:Rt("max")},min:{child:!0,parse:Rt("min")},maxLength:{child:!0,parse:Rt("maxLength")},minLength:{child:!0,parse:Rt("minLength")},exactLength:{child:!0,parse:Rt("exactLength")},before:{child:!0,parse:Rt("before")},after:{child:!0,parse:Rt("after")},pattern:{child:!0,parse:Rt("pattern")},predicate:{child:!0,parse:Rt("predicate")}},reduce:(e,t)=>PE({},e,{$:t,invert:!1,pipe:!1}),defaults:{description:e=>{if(e.children.length===0)return"unknown";if(e.structure)return e.structure.description;let t=[];if(e.basis&&!e.prestructurals.some(r=>r.impl.obviatesBasisDescription)&&t.push(e.basis.description),e.prestructurals.length){let r=e.prestructurals.slice().sort((n,i)=>n.kind==="min"&&i.kind==="max"?-1:0).map(n=>n.description);t.push(...r)}return e.inner.predicate&&t.push(...e.inner.predicate.map(r=>r.description)),t.join(" and ")},expected:e=>` \u25E6 ${e.errors.map(t=>t.expected).join(`
338
+ \u25E6 `)}`,problem:e=>`(${e.actual}) must be...
339
+ ${e.expected}`},intersections:{intersection:(e,t,r)=>PE(e.inner,t.inner,r),...nn("intersection",(e,t,r)=>{if(e.children.length===0)return t;let{domain:n,proto:i,...s}=e.inner,o=i??n,a=o?Je(o,t,r):t;return a instanceof X?a:e?.basis?.equals(a)?e:e.$.node("intersection",{...s,[a.kind]:a},{prereduced:!0})})}}),ef=class extends ar{basis=this.inner.domain??this.inner.proto??null;prestructurals=[];refinements=this.children.filter(t=>t.isRefinement()?(gr(bd,t.kind)&&this.prestructurals.push(t),!0):!1);structure=this.inner.structure;expression=Yk(this);get shallowMorphs(){return this.inner.structure?.structuralMorph?[this.inner.structure.structuralMorph]:[]}get defaultShortDescription(){return this.basis?.defaultShortDescription??"present"}innerToJsonSchema(t){return this.children.reduce((r,n)=>n.isBasis()?n.toJsonSchemaRecurse(t):n.reduceJsonSchema(r,t),{})}traverseAllows=(t,r)=>this.children.every(n=>n.traverseAllows(t,r));traverseApply=(t,r)=>{let n=r.currentErrorCount;if(!(this.basis&&(this.basis.traverseApply(t,r),r.currentErrorCount>n))){if(this.prestructurals.length){for(let i=0;i<this.prestructurals.length-1;i++)if(this.prestructurals[i].traverseApply(t,r),r.failFast&&r.currentErrorCount>n)return;if(this.prestructurals[this.prestructurals.length-1].traverseApply(t,r),r.currentErrorCount>n)return}if(!(this.structure&&(this.structure.traverseApply(t,r),r.currentErrorCount>n))&&this.inner.predicate){for(let i=0;i<this.inner.predicate.length-1;i++)if(this.inner.predicate[i].traverseApply(t,r),r.failFast&&r.currentErrorCount>n)return;this.inner.predicate[this.inner.predicate.length-1].traverseApply(t,r)}}};compile(t){if(t.traversalKind==="Allows"){for(let r of this.children)t.check(r);t.return(!0);return}if(t.initializeErrorCount(),this.basis&&(t.check(this.basis),this.children.length>1&&t.returnIfFail()),this.prestructurals.length){for(let r=0;r<this.prestructurals.length-1;r++)t.check(this.prestructurals[r]),t.returnIfFailFast();t.check(this.prestructurals[this.prestructurals.length-1]),(this.structure||this.inner.predicate)&&t.returnIfFail()}if(this.structure&&(t.check(this.structure),this.inner.predicate&&t.returnIfFail()),this.inner.predicate){for(let r=0;r<this.inner.predicate.length-1;r++)t.check(this.inner.predicate[r]),t.returnIfFail();t.check(this.inner.predicate[this.inner.predicate.length-1])}}},tf={implementation:Jk,Node:ef},Yk=e=>{if(e.structure?.expression)return e.structure.expression;let t=e.basis&&!e.prestructurals.some(i=>i.impl.obviatesBasisExpression)?e.basis.nestableExpression:"",r=e.prestructurals.map(i=>i.expression).join(" & "),n=`${t}${t?" ":""}${r}`;return n==="Array == 0"?"[]":n||"unknown"},PE=(e,t,r)=>{let n={},i=e.proto??e.domain,s=t.proto??t.domain,o=i?s?Je(i,s,r):i:s;return o instanceof X?o:(o&&(n[o.kind]=o),Ss({kind:"intersection",baseInner:n,l:Os(e),r:Os(t),roots:[],ctx:r}))};u();var Xk=be({kind:"morph",hasAssociatedError:!1,keys:{in:{child:!0,parse:(e,t)=>t.$.parseSchema(e)},morphs:{parse:Mn,serialize:e=>e.map(t=>re(t,"root")?t.json:nt(t))},declaredIn:{child:!1,serialize:e=>e.json},declaredOut:{child:!1,serialize:e=>e.json}},normalize:e=>e,defaults:{description:e=>`a morph from ${e.rawIn.description} to ${e.rawOut?.description??"unknown"}`},intersections:{morph:(e,t,r)=>{if(!e.hasEqualMorphs(t))return L(Zk(e.expression,t.expression));let n=Je(e.rawIn,t.rawIn,r);if(n instanceof X)return n;let i={morphs:e.morphs};if(e.declaredIn||t.declaredIn){let s=Je(e.rawIn,t.rawIn,r);if(s instanceof X)return s.throw();i.declaredIn=s}if(e.declaredOut||t.declaredOut){let s=Je(e.rawOut,t.rawOut,r);if(s instanceof X)return s.throw();i.declaredOut=s}return n.distribute(s=>r.$.node("morph",{...i,in:s}),r.$.parseSchema)},...nn("morph",(e,t,r)=>{let n=e.inner.in?Je(e.inner.in,t,r):t;return n instanceof X?n:n.equals(e.inner.in)?e:r.$.node("morph",{...e.inner,in:n})})}}),rf=class extends ar{serializedMorphs=this.morphs.map(nt);compiledMorphs=`[${this.serializedMorphs}]`;lastMorph=this.inner.morphs[this.inner.morphs.length-1];lastMorphIfNode=re(this.lastMorph,"root")?this.lastMorph:void 0;introspectableIn=this.inner.in;introspectableOut=this.lastMorphIfNode?Object.assign(this.referencesById,this.lastMorphIfNode.referencesById)&&this.lastMorphIfNode.rawOut:void 0;get shallowMorphs(){return Array.isArray(this.inner.in?.shallowMorphs)?[...this.inner.in.shallowMorphs,...this.morphs]:this.morphs}get rawIn(){return this.declaredIn??this.inner.in?.rawIn??M.intrinsic.unknown.internal}get rawOut(){return this.declaredOut??this.introspectableOut??M.intrinsic.unknown.internal}declareIn(t){return this.$.node("morph",{...this.inner,declaredIn:t})}declareOut(t){return this.$.node("morph",{...this.inner,declaredOut:t})}expression=`(In: ${this.rawIn.expression}) => ${this.lastMorphIfNode?"To":"Out"}<${this.rawOut.expression}>`;get defaultShortDescription(){return this.rawIn.meta.description??this.rawIn.defaultShortDescription}innerToJsonSchema(t){return t.fallback.morph({code:"morph",base:this.rawIn.toJsonSchemaRecurse(t),out:this.introspectableOut?.toJsonSchemaRecurse(t)??null})}compile(t){if(t.traversalKind==="Allows"){if(!this.introspectableIn)return;t.return(t.invoke(this.introspectableIn));return}this.introspectableIn&&t.line(t.invoke(this.introspectableIn)),t.line(`ctx.queueMorphs(${this.compiledMorphs})`)}traverseAllows=(t,r)=>!this.introspectableIn||this.introspectableIn.traverseAllows(t,r);traverseApply=(t,r)=>{this.introspectableIn&&this.introspectableIn.traverseApply(t,r),r.queueMorphs(this.morphs)};hasEqualMorphs(t){return wn(this.morphs,t.morphs,{isEqual:(r,n)=>r===n||re(r,"root")&&re(n,"root")&&r.equals(n)})}},nf={implementation:Xk,Node:rf},Zk=(e,t)=>`The intersection of distinct morphs at a single path is indeterminate:
340
+ Left: ${e}
341
+ Right: ${t}`;u();var eD=be({kind:"proto",hasAssociatedError:!0,collapsibleKey:"proto",keys:{proto:{serialize:e=>_o(e)??yr(e)},dateAllowsInvalid:{}},normalize:e=>{let t=typeof e=="string"?{proto:Ei[e]}:typeof e=="function"?We(e)?e:{proto:e}:typeof e.proto=="string"?{...e,proto:Ei[e.proto]}:e;return typeof t.proto!="function"&&L(Bo.writeInvalidSchemaMessage(t.proto)),fs(t,"dateAllowsInvalid")&&t.proto!==Date&&L(Bo.writeBadInvalidDateMessage(t.proto)),t},applyConfig:(e,t)=>e.dateAllowsInvalid===void 0&&e.proto===Date&&t.dateAllowsInvalid?{...e,dateAllowsInvalid:!0}:e,defaults:{description:e=>e.builtinName?VT[e.builtinName]:`an instance of ${e.proto.name}`,actual:e=>e instanceof Date&&e.toString()==="Invalid Date"?"an invalid Date":Oo(e)},intersections:{proto:(e,t)=>e.proto===Date&&t.proto===Date?e.dateAllowsInvalid?t:e:pd(e.proto,t.proto)?e:pd(t.proto,e.proto)?t:X.init("proto",e,t),domain:(e,t)=>t.domain==="object"?e:X.init("domain",M.intrinsic.object.internal,t)}}),sf=class extends Hn{builtinName=_o(this.proto);serializedConstructor=this.json.proto;requiresInvalidDateCheck=this.proto===Date&&!this.dateAllowsInvalid;traverseAllows=this.requiresInvalidDateCheck?t=>t instanceof Date&&t.toString()!=="Invalid Date":t=>t instanceof this.proto;compiledCondition=`data instanceof ${this.serializedConstructor}${this.requiresInvalidDateCheck?' && data.toString() !== "Invalid Date"':""}`;compiledNegation=`!(${this.compiledCondition})`;innerToJsonSchema(t){switch(this.builtinName){case"Array":return{type:"array"};case"Date":return t.fallback.date?.({code:"date",base:{}})??t.fallback.proto({code:"proto",base:{},proto:this.proto});default:return t.fallback.proto({code:"proto",base:{},proto:this.proto})}}expression=this.dateAllowsInvalid?"Date | InvalidDate":this.proto.name;get nestableExpression(){return this.dateAllowsInvalid?`(${this.expression})`:this.expression}domain="object";get defaultShortDescription(){return this.description}},Bo={implementation:eD,Node:sf,writeBadInvalidDateMessage:e=>`dateAllowsInvalid may only be specified with constructor Date (was ${e.name})`,writeInvalidSchemaMessage:e=>`instanceOf operand must be a function (was ${gt(e)})`};u();var tD=be({kind:"union",hasAssociatedError:!0,collapsibleKey:"branches",keys:{ordered:{},branches:{child:!0,parse:(e,t)=>{let r=[];for(let n of e){let i=re(n,"root")?n.branches:t.$.parseSchema(n).branches;for(let s of i)if(s.hasKind("morph")){let o=r.findIndex(a=>a.hasKind("morph")&&a.hasEqualMorphs(s));if(o===-1)r.push(s);else{let a=r[o];r[o]=t.$.node("morph",{...a.inner,in:a.rawIn.rawOr(s.rawIn)})}}else r.push(s)}return t.def.ordered||r.sort((n,i)=>n.hash<i.hash?-1:1),r}}},normalize:e=>He(e)?{branches:e}:e,reduce:(e,t)=>{let r=pD(e);if(r.length===1)return r[0];if(r.length!==e.branches.length)return t.node("union",{...e,branches:r},{prereduced:!0})},defaults:{description:e=>e.distribute(t=>t.description,Rs),expected:e=>{let t=PT(e.errors,"propString"),r=Object.entries(t).map(([n,i])=>{let s=[];for(let c of i)en(s,c.expected);let o=Rs(s),a=i.every(c=>c.actual===i[0].actual)?i[0].actual:ye(i[0].data);return`${n&&`${n} `}must be ${o}${a&&` (was ${a})`}`});return Rs(r)},problem:e=>e.expected,message:e=>e.problem[0]==="["?`value at ${e.problem}`:e.problem},intersections:{union:(e,t,r)=>{if(e.isNever!==t.isNever)return X.init("presence",e,t);let n;return e.ordered?(t.ordered&&L(fD(e.expression,t.expression)),n=of(t.branches,e.branches,r),n instanceof X&&n.invert()):n=of(e.branches,t.branches,r),n instanceof X?n:r.$.parseSchema(e.ordered||t.ordered?{branches:n,ordered:!0}:{branches:n})},...nn("union",(e,t,r)=>{let n=of(e.branches,[t],r);return n instanceof X?n:n.length===1?n[0]:r.$.parseSchema(e.ordered?{branches:n,ordered:!0}:{branches:n})})}}),af=class extends ar{isBoolean=this.branches.length===2&&this.branches[0].hasUnit(!1)&&this.branches[1].hasUnit(!0);get branchGroups(){let t=[],r=-1;for(let n of this.branches){if(n.hasKind("unit")&&n.domain==="boolean"){r===-1?(r=t.length,t.push(n)):t[r]=M.intrinsic.boolean;continue}t.push(n)}return t}unitBranches=this.branches.filter(t=>t.rawIn.hasKind("unit"));discriminant=this.discriminate();discriminantJson=this.discriminant?cD(this.discriminant):null;expression=this.distribute(t=>t.nestableExpression,lD);createBranchedOptimisticRootApply(){return(t,r)=>{let n=this.traverseOptimistic(t);if(n!==Gt)return n;let i=new br(t,this.$.resolvedConfig);return this.traverseApply(t,i),i.finalize(r)}}get shallowMorphs(){return this.branches.reduce((t,r)=>en(t,r.shallowMorphs),[])}get defaultShortDescription(){return this.distribute(t=>t.defaultShortDescription,Rs)}innerToJsonSchema(t){if(this.branchGroups.length===1&&this.branchGroups[0].equals(M.intrinsic.boolean))return{type:"boolean"};let r=this.branchGroups.map(n=>n.toJsonSchemaRecurse(t));return r.every(n=>Object.keys(n).length===1&&fs(n,"const"))?{enum:r.map(n=>n.const)}:{anyOf:r}}traverseAllows=(t,r)=>this.branches.some(n=>n.traverseAllows(t,r));traverseApply=(t,r)=>{let n=[];for(let i=0;i<this.branches.length;i++){if(r.pushBranch(),this.branches[i].traverseApply(t,r),!r.hasError())return this.branches[i].includesTransform?r.queuedMorphs.push(...r.popBranch().queuedMorphs):r.popBranch();n.push(r.popBranch().error)}r.errorFromNodeContext({code:"union",errors:n,meta:this.meta})};traverseOptimistic=t=>{for(let r=0;r<this.branches.length;r++){let n=this.branches[r];if(n.traverseAllows(t))return n.contextFreeMorph?n.contextFreeMorph(t):t}return Gt};compile(t){if(!this.discriminant||this.unitBranches.length===this.branches.length&&this.branches.length===2)return this.compileIndiscriminable(t);let r=this.discriminant.optionallyChainedPropString;this.discriminant.kind==="domain"&&(r=`typeof ${r} === "object" ? ${r} === null ? "null" : "object" : typeof ${r} === "function" ? "object" : typeof ${r}`);let n=this.discriminant.cases,i=Object.keys(n),{optimistic:s}=t;if(t.optimistic=!1,t.block(`switch(${r})`,()=>{for(let p in n){let d=n[p],f=p==="default"?p:`case ${p}`,m;d===!0?m=s?"data":"true":s?d.rootApplyStrategy==="branchedOptimistic"?m=t.invoke(d,{kind:"Optimistic"}):d.contextFreeMorph?m=`${t.invoke(d)} ? ${nt(d.contextFreeMorph)}(data) : "${Gt}"`:m=`${t.invoke(d)} ? data : "${Gt}"`:m=t.invoke(d),t.line(`${f}: return ${m}`)}return t}),t.traversalKind==="Allows"){t.return(s?`"${Gt}"`:!1);return}let o=Rs(this.discriminant.kind==="domain"?i.map(p=>{let d=p.slice(1,-1);return d==="function"?Kt.object:Kt[d]}):i),a=this.discriminant.path.map(p=>typeof p=="symbol"?nt(p):JSON.stringify(p)),c=JSON.stringify(o),l=this.discriminant.kind==="domain"?`${oD}[${r}]`:`${aD}(${r})`;t.line(`ctx.errorFromNodeContext({
342
+ code: "predicate",
343
+ expected: ${c},
344
+ actual: ${l},
345
+ relativePath: [${a}],
346
+ meta: ${this.compiledMeta}
347
+ })`)}compileIndiscriminable(t){if(t.traversalKind==="Apply"){t.const("errors","[]");for(let r of this.branches)t.line("ctx.pushBranch()").line(t.invoke(r)).if("!ctx.hasError()",()=>t.return(r.includesTransform?"ctx.queuedMorphs.push(...ctx.popBranch().queuedMorphs)":"ctx.popBranch()")).line("errors.push(ctx.popBranch().error)");t.line(`ctx.errorFromNodeContext({ code: "union", errors, meta: ${this.compiledMeta} })`)}else{let{optimistic:r}=t;t.optimistic=!1;for(let n of this.branches)t.if(`${t.invoke(n)}`,()=>t.return(r?n.contextFreeMorph?`${nt(n.contextFreeMorph)}(data)`:"data":!0));t.return(r?`"${Gt}"`:!1)}}get nestableExpression(){return this.isBoolean?"boolean":`(${this.expression})`}discriminate(){if(this.branches.length<2||this.isCyclic)return null;if(this.unitBranches.length===this.branches.length){let s=ge(this.unitBranches,(o,a)=>[`${a.rawIn.serializedValue}`,a.hasKind("morph")?a:!0]);return{kind:"unit",path:[],optionallyChainedPropString:"data",cases:s}}let t=[];for(let s=0;s<this.branches.length-1;s++){let o=this.branches[s];for(let a=s+1;a<this.branches.length;a++){let c=this.branches[a],l=zt(o.rawIn,c.rawIn,o.$);if(l instanceof X)for(let p of l){if(!p.kind||p.optional)continue;let d,f;if(p.kind==="domain"){let h=p.l,v=p.r;d=`"${typeof h=="string"?h:h.domain}"`,f=`"${typeof v=="string"?v:v.domain}"`}else if(p.kind==="unit")d=p.l.serializedValue,f=p.r.serializedValue;else continue;let m=t.find(h=>wn(h.path,p.path)&&h.kind===p.kind);m?(m.cases[d]?m.cases[d].branchIndices=en(m.cases[d].branchIndices,s):m.cases[d]??={branchIndices:[s],condition:p.l},m.cases[f]?m.cases[f].branchIndices=en(m.cases[f].branchIndices,a):m.cases[f]??={branchIndices:[a],condition:p.r}):t.push({kind:p.kind,cases:{[d]:{branchIndices:[s],condition:p.l},[f]:{branchIndices:[a],condition:p.r}},path:p.path})}}}let r=this.ordered?iD(t,this.branches):t;if(!r.length)return null;let n=rD(r,this),i={};for(let s in n.best.cases){let o=nD(n,s);if(o===null){i[s]=!0;continue}if(o.length===this.branches.length)return null;this.ordered&&o.sort((l,p)=>l.originalIndex-p.originalIndex);let a=o.map(l=>l.branch),c=a.length===1?a[0]:this.$.node("union",this.ordered?{branches:a,ordered:!0}:a);Object.assign(this.referencesById,c.referencesById),i[s]=c}if(n.defaultEntries.length){let s=n.defaultEntries.map(o=>o.branch);i.default=this.$.node("union",this.ordered?{branches:s,ordered:!0}:s,{prereduced:!0}),Object.assign(this.referencesById,i.default.referencesById)}return Object.assign(n.location,{cases:i})}},rD=(e,t)=>{let n=e.sort((o,a)=>o.path.length===a.path.length?Object.keys(a.cases).length-Object.keys(o.cases).length:o.path.length-a.path.length)[0],i={kind:n.kind,path:n.path,optionallyChainedPropString:FE(n.path)},s=t.branches.map((o,a)=>({originalIndex:a,branch:o}));return{best:n,location:i,defaultEntries:s,node:t}},nD=(e,t)=>{let r=e.best.cases[t],n=sD(r.condition,e.location.path,e.node.$),i=[],s=[];for(let o=0;o<e.defaultEntries.length;o++){let a=e.defaultEntries[o];if(r.branchIndices.includes(a.originalIndex)){let c=jE(e.node.branches[a.originalIndex],e.location);c===null?i=null:i?.push({originalIndex:a.originalIndex,branch:c})}else if(a.branch.hasKind("alias")&&n.hasKind("domain")&&n.domain==="object")i?.push(a);else{if(a.branch.rawIn.overlaps(n)){let c=jE(a.branch,e.location);i?.push({originalIndex:a.originalIndex,branch:c})}s.push(a)}}return e.defaultEntries=s,i},iD=(e,t)=>e.filter(n=>{let i=Object.values(n.cases).map(s=>s.branchIndices);for(let s=0;s<i.length-1;s++){let o=i[s];for(let a=s+1;a<i.length;a++){let c=i[a];for(let l of o)for(let p of c)if(l>p&&t[l].overlaps(t[p]))return!1}}return!0}),sD=(e,t,r)=>{let n=e==="undefined"?r.node("unit",{unit:void 0}):e==="null"?r.node("unit",{unit:null}):e==="boolean"?r.units([!0,!1]):e;for(let i=t.length-1;i>=0;i--){let s=t[i];n=r.node("intersection",typeof s=="number"?{proto:"Array",sequence:[...DT(s).map(o=>({})),n]}:{domain:"object",required:[{key:s,value:n}]})}return n},FE=e=>e.reduce((t,r)=>t+yd(r,!0),"data"),oD=nt(jT),aD=nt(ye),cf={implementation:tD,Node:af},cD=e=>({kind:e.kind,path:e.path.map(t=>typeof t=="string"?t:$r(t)),cases:ge(e.cases,(t,r)=>[t,r===!0?r:r.hasKind("union")&&r.discriminantJson?r.discriminantJson:r.json])}),uD={delimiter:" | ",finalDelimiter:" | "},lD=e=>Rs(e,uD),Rs=(e,t)=>{let r=t?.delimiter??", ",n=t?.finalDelimiter??" or ";if(e.length===0)return"never";if(e.length===1)return e[0];if(e.length===2&&e[0]==="false"&&e[1]==="true"||e[0]==="true"&&e[1]==="false")return"boolean";let i={},s=e.filter(a=>i[a]?!1:i[a]=!0),o=s.pop();return`${s.join(r)}${s.length?n:""}${o}`},of=(e,t,r)=>{let n=t.map(()=>[]);for(let s=0;s<e.length;s++){let o={};for(let a=0;a<t.length;a++){if(n[a]===null)continue;if(e[s].equals(t[a])){n[a]=null,o={};break}let c=Je(e[s],t[a],r);if(!(c instanceof X)){if(c.equals(e[s])){n[a].push(e[s]),o={};break}c.equals(t[a])?n[a]=null:o[a]=c}}for(let a in o)n[a][s]=o[a]}let i=n.flatMap((s,o)=>s?.flatMap(a=>a.branches)??t[o]);return i.length===0?X.init("union",e,t):i},pD=({branches:e,ordered:t})=>{if(e.length<2)return e;let r=e.map(()=>!0);for(let n=0;n<e.length;n++)for(let i=n+1;i<e.length&&r[n]&&r[i];i++){if(e[n].equals(e[i])){r[i]=!1;continue}let s=zt(e[n].rawIn,e[i].rawIn,e[0].$);s instanceof X||(t||dD(e[n],e[i]),s.equals(e[n].rawIn)?r[n]=!!t:s.equals(e[i].rawIn)&&(r[i]=!1))}return e.filter((n,i)=>r[i])},dD=(e,t)=>{!e.includesTransform&&!t.includesTransform||(wn(e.shallowMorphs,t.shallowMorphs)||L(qE(e.expression,t.expression)),wn(e.flatMorphs,t.flatMorphs,{isEqual:(r,n)=>r.propString===n.propString&&(r.node.hasKind("morph")&&n.node.hasKind("morph")?r.node.hasEqualMorphs(n.node):r.node.hasKind("intersection")&&n.node.hasKind("intersection")?r.node.structure?.structuralMorphRef===n.node.structure?.structuralMorphRef:!1)})||L(qE(e.expression,t.expression)))},jE=(e,t)=>e.transform((r,n)=>r==="domain"||r==="unit"?null:n,{shouldTransform:(r,n)=>{let i=FE(n.path);return t.optionallyChainedPropString.startsWith(i)?r.hasKind("domain")&&r.domain==="object"||(r.hasKind("domain")||t.kind==="unit")&&i===t.optionallyChainedPropString?!0:r.children.length!==0&&r.kind!=="index":!1}}),qE=(e,t)=>`An unordered union of a type including a morph and a type with overlapping input is indeterminate:
348
+ Left: ${e}
349
+ Right: ${t}`,fD=(e,t)=>`The intersection of two ordered unions is indeterminate:
350
+ Left: ${e}
351
+ Right: ${t}`;u();var hD=be({kind:"unit",hasAssociatedError:!0,keys:{unit:{preserveUndefined:!0,serialize:e=>e instanceof Date?e.toISOString():yr(e)}},normalize:e=>e,defaults:{description:e=>ye(e.unit),problem:({expected:e,actual:t})=>`${e===t?`must be reference equal to ${e} (serialized to the same value)`:`must be ${e} (was ${t})`}`},intersections:{unit:(e,t)=>X.init("unit",e,t),...nn("unit",(e,t)=>{if(t.allows(e.unit))return e;let r=t.hasKind("intersection")?t.basis:t;if(r){let n=r.hasKind("domain")?r:M.intrinsic.object;if(e.domain!==n.domain){let i=e.domain==="undefined"||e.domain==="null"||e.domain==="boolean"?e.domain:M.intrinsic[e.domain];return X.init("domain",i,n)}}return X.init("assignability",e,t.hasKind("intersection")?t.children.find(n=>!n.allows(e.unit)):t)})}}),uf=class extends Hn{compiledValue=this.json.unit;serializedValue=typeof this.unit=="string"||this.unit instanceof Date?JSON.stringify(this.compiledValue):`${this.compiledValue}`;compiledCondition=ME(this.unit,this.serializedValue);compiledNegation=ME(this.unit,this.serializedValue,"negated");expression=ye(this.unit);domain=gt(this.unit);get defaultShortDescription(){return this.domain==="object"?Kt.object:this.description}innerToJsonSchema(t){return this.unit===null?{type:"null"}:M.intrinsic.jsonPrimitive.allows(this.unit)?{const:this.unit}:t.fallback.unit({code:"unit",base:{},unit:this.unit})}traverseAllows=this.unit instanceof Date?t=>t instanceof Date&&t.toISOString()===this.compiledValue:Number.isNaN(this.unit)?t=>Number.isNaN(t):t=>t===this.unit},lf={implementation:hD,Node:uf},ME=(e,t,r)=>{if(e instanceof Date){let n=`data instanceof Date && data.toISOString() === ${t}`;return r?`!(${n})`:n}return Number.isNaN(e)?`${r?"!":""}Number.isNaN(data)`:`data ${r?"!":"="}== ${t}`};u();var mD=be({kind:"index",hasAssociatedError:!1,intersectionIsOpen:!0,keys:{signature:{child:!0,parse:(e,t)=>{let r=t.$.parseSchema(e);if(!r.extends(M.intrinsic.key))return L(yD(r.expression));let n=r.branches.filter(i=>i.hasKind("unit"));return n.length?L(gD(n.map(i=>ye(i.unit)))):r}},value:{child:!0,parse:(e,t)=>t.$.parseSchema(e)}},normalize:e=>e,defaults:{description:e=>`[${e.signature.expression}]: ${e.value.description}`},intersections:{index:(e,t,r)=>{if(e.signature.equals(t.signature)){let n=Je(e.value,t.value,r),i=n instanceof X?M.intrinsic.never.internal:n;return r.$.node("index",{signature:e.signature,value:i})}return e.signature.extends(t.signature)&&e.value.subsumes(t.value)?t:t.signature.extends(e.signature)&&t.value.subsumes(e.value)?e:null}}}),pf=class extends or{impliedBasis=M.intrinsic.object.internal;expression=`[${this.signature.expression}]: ${this.value.expression}`;flatRefs=Ne(this.value.flatRefs.map(t=>Pr([this.signature,...t.path],t.node)),Pr([this.signature],this.value));traverseAllows=(t,r)=>Ti(t).every(n=>this.signature.traverseAllows(n[0],r)?Qt(n[0],()=>this.value.traverseAllows(n[1],r),r):!0);traverseApply=(t,r)=>{for(let n of Ti(t))this.signature.traverseAllows(n[0],r)&&Qt(n[0],()=>this.value.traverseApply(n[1],r),r)};_transform(t,r){r.path.push(this.signature);let n=super._transform(t,r);return r.path.pop(),n}compile(){}},df={implementation:mD,Node:pf},gD=e=>`Index keys ${e.join(", ")} should be specified as named props.`,yD=e=>`Indexed key definition '${e}' must be a string or symbol`;u();var bD=be({kind:"required",hasAssociatedError:!0,intersectionIsOpen:!0,keys:{key:{},value:{child:!0,parse:(e,t)=>t.$.parseSchema(e)}},normalize:e=>e,defaults:{description:e=>`${e.compiledKey}: ${e.value.description}`,expected:e=>e.missingValueDescription,actual:()=>"missing"},intersections:{required:jo,optional:jo}}),ff=class extends Ns{expression=`${this.compiledKey}: ${this.value.expression}`;errorContext=Object.freeze({code:"required",missingValueDescription:this.value.defaultShortDescription,relativePath:[this.key],meta:this.meta});compiledErrorContext=Kn(this.errorContext)},hf={implementation:bD,Node:ff};u();var vD=be({kind:"sequence",hasAssociatedError:!1,collapsibleKey:"variadic",keys:{prefix:{child:!0,parse:(e,t)=>{if(e.length!==0)return e.map(r=>t.$.parseSchema(r))}},optionals:{child:!0,parse:(e,t)=>{if(e.length!==0)return e.map(r=>t.$.parseSchema(r))}},defaultables:{child:e=>e.map(t=>t[0]),parse:(e,t)=>{if(e.length!==0)return e.map(r=>{let n=t.$.parseSchema(r[0]);return Fo(n,r[1],null),[n,r[1]]})},serialize:e=>e.map(t=>[t[0].collapsibleJson,yr(t[1])]),reduceIo:(e,t,r)=>{if(e==="in"){t.optionals=r.map(n=>n[0].rawIn);return}t.prefix=r.map(n=>n[0].rawOut)}},variadic:{child:!0,parse:(e,t)=>t.$.parseSchema(e,t)},minVariadicLength:{parse:e=>e===0?void 0:e},postfix:{child:!0,parse:(e,t)=>{if(e.length!==0)return e.map(r=>t.$.parseSchema(r))}}},normalize:e=>{if(typeof e=="string")return{variadic:e};if("variadic"in e||"prefix"in e||"defaultables"in e||"optionals"in e||"postfix"in e||"minVariadicLength"in e){if(e.postfix?.length){if(!e.variadic)return L(wD);if(e.optionals?.length||e.defaultables?.length)return L(yf)}return e.minVariadicLength&&!e.variadic?L("minVariadicLength may not be specified without a variadic element"):e}return{variadic:e}},reduce:(e,t)=>{let r=e.minVariadicLength??0,n=e.prefix?.slice()??[],i=e.defaultables?.slice()??[],s=e.optionals?.slice()??[],o=e.postfix?.slice()??[];if(e.variadic){for(;s[s.length-1]?.equals(e.variadic);)s.pop();if(s.length===0&&i.length===0)for(;n[n.length-1]?.equals(e.variadic);)n.pop(),r++;for(;o[0]?.equals(e.variadic);)o.shift(),r++}else s.length===0&&i.length===0&&n.push(...o.splice(0));if(r!==e.minVariadicLength||e.prefix&&e.prefix.length!==n.length)return t.node("sequence",{...e,prefix:n,defaultables:i,optionals:s,postfix:o,minVariadicLength:r},{prereduced:!0})},defaults:{description:e=>e.isVariadicOnly?`${e.variadic.nestableExpression}[]`:`[${e.tuple.map(r=>r.kind==="defaultables"?`${r.node.nestableExpression} = ${ye(r.default)}`:r.kind==="optionals"?`${r.node.nestableExpression}?`:r.kind==="variadic"?`...${r.node.nestableExpression}[]`:r.node.expression).join(", ")}]`},intersections:{sequence:(e,t,r)=>{let n=Vo({l:e.tuple,r:t.tuple,disjoint:new X,result:[],fixedVariants:[],ctx:r}),i=n.disjoint.length===0?[n,...n.fixedVariants]:n.fixedVariants;return i.length===0?n.disjoint:i.length===1?r.$.node("sequence",UE(i[0].result)):r.$.node("union",i.map(s=>({proto:Array,sequence:UE(s.result)})))}}}),mf=class extends or{impliedBasis=M.intrinsic.Array.internal;tuple=xD(this.inner);prefixLength=this.prefix?.length??0;defaultablesLength=this.defaultables?.length??0;optionalsLength=this.optionals?.length??0;postfixLength=this.postfix?.length??0;defaultablesAndOptionals=[];prevariadic=this.tuple.filter(t=>t.kind==="defaultables"||t.kind==="optionals"?(this.defaultablesAndOptionals.push(t.node),!0):t.kind==="prefix");variadicOrPostfix=xn(this.variadic&&[this.variadic],this.postfix);flatRefs=this.addFlatRefs();addFlatRefs(){return xd(this.flatRefs,this.prevariadic.flatMap((t,r)=>Ne(t.node.flatRefs.map(n=>Pr([`${r}`,...n.path],n.node)),Pr([`${r}`],t.node)))),xd(this.flatRefs,this.variadicOrPostfix.flatMap(t=>Ne(t.flatRefs.map(r=>Pr([M.intrinsic.nonNegativeIntegerString.internal,...r.path],r.node)),Pr([M.intrinsic.nonNegativeIntegerString.internal],t)))),this.flatRefs}isVariadicOnly=this.prevariadic.length+this.postfixLength===0;minVariadicLength=this.inner.minVariadicLength??0;minLength=this.prefixLength+this.minVariadicLength+this.postfixLength;minLengthNode=this.minLength===0?null:this.$.node("minLength",this.minLength);maxLength=this.variadic?null:this.tuple.length;maxLengthNode=this.maxLength===null?null:this.$.node("maxLength",this.maxLength);impliedSiblings=this.minLengthNode?this.maxLengthNode?[this.minLengthNode,this.maxLengthNode]:[this.minLengthNode]:this.maxLengthNode?[this.maxLengthNode]:[];defaultValueMorphs=ED(this);defaultValueMorphsReference=this.defaultValueMorphs.length?nt(this.defaultValueMorphs):void 0;elementAtIndex(t,r){if(r<this.prevariadic.length)return this.tuple[r];let n=t.length-this.postfixLength;return r>=n?{kind:"postfix",node:this.postfix[r-n]}:{kind:"variadic",node:this.variadic??$e(`Unexpected attempt to access index ${r} on ${this}`)}}traverseAllows=(t,r)=>{for(let n=0;n<t.length;n++)if(!this.elementAtIndex(t,n).node.traverseAllows(t[n],r))return!1;return!0};traverseApply=(t,r)=>{let n=0;for(;n<t.length;n++)Qt(n,()=>this.elementAtIndex(t,n).node.traverseApply(t[n],r),r)};get element(){return this.cacheGetter("element",this.$.node("union",this.children))}compile(t){if(this.prefix)for(let[r,n]of this.prefix.entries())t.traverseKey(`${r}`,`data[${r}]`,n);for(let[r,n]of this.defaultablesAndOptionals.entries()){let i=`${r+this.prefixLength}`;t.if(`${i} >= data.length`,()=>t.traversalKind==="Allows"?t.return(!0):t.return()),t.traverseKey(i,`data[${i}]`,n)}if(this.variadic&&(this.postfix&&t.const("firstPostfixIndex",`data.length${this.postfix?`- ${this.postfix.length}`:""}`),t.for(`i < ${this.postfix?"firstPostfixIndex":"data.length"}`,()=>t.traverseKey("i","data[i]",this.variadic),this.prevariadic.length),this.postfix))for(let[r,n]of this.postfix.entries()){let i=`firstPostfixIndex + ${r}`;t.traverseKey(i,`data[${i}]`,n)}t.traversalKind==="Allows"&&t.return(!0)}_transform(t,r){r.path.push(M.intrinsic.nonNegativeIntegerString.internal);let n=super._transform(t,r);return r.path.pop(),n}expression=this.description;reduceJsonSchema(t,r){let n=r.target==="draft-07";if(this.prevariadic.length){let i=this.prevariadic.map(s=>{let o=s.node.toJsonSchemaRecurse(r);if(s.kind==="defaultables"){let a=typeof s.default=="function"?s.default():s.default;o.default=M.intrinsic.jsonData.allows(a)?a:r.fallback.defaultValue({code:"defaultValue",base:o,value:a})}return o});n?t.items=i:t.prefixItems=i}if(this.minLength&&(t.minItems=this.minLength),this.variadic){let i=this.variadic.toJsonSchemaRecurse(r);if(n&&this.prevariadic.length?t.additionalItems=i:t.items=i,this.maxLength&&(t.maxItems=this.maxLength),this.postfix){let s=this.postfix.map(o=>o.toJsonSchemaRecurse(r));t=r.fallback.arrayPostfix({code:"arrayPostfix",base:t,elements:s})}}else n?t.additionalItems=!1:t.items=!1,delete t.maxItems;return t}},TD={},ED=e=>{if(!e.defaultables)return[];let t=[],r="[",n=e.prefixLength+e.defaultablesLength-1;for(let i=e.prefixLength;i<=n;i++){let[s,o]=e.defaultables[i-e.prefixLength];t.push(Yd(i,s,o)),r+=`${i}: ${s.id} = ${yr(o)}, `}return r+="]",TD[r]??=t},gf={implementation:vD,Node:mf},xD=e=>{let t=[];if(e.prefix)for(let r of e.prefix)t.push({kind:"prefix",node:r});if(e.defaultables)for(let[r,n]of e.defaultables)t.push({kind:"defaultables",node:r,default:n});if(e.optionals)for(let r of e.optionals)t.push({kind:"optionals",node:r});if(e.variadic&&t.push({kind:"variadic",node:e.variadic}),e.postfix)for(let r of e.postfix)t.push({kind:"postfix",node:r});return t},UE=e=>e.reduce((t,r)=>(r.kind==="variadic"?t.variadic=r.node:r.kind==="defaultables"?t.defaultables=Ne(t.defaultables,[[r.node,r.default]]):t[r.kind]=Ne(t[r.kind],r.node),t),{}),yf="A postfix required element cannot follow an optional or defaultable element",wD="A postfix element requires a variadic element",Vo=e=>{let[t,...r]=e.l,[n,...i]=e.r;if(!t||!n)return e;let s=r[r.length-1]?.kind==="postfix",o=i[i.length-1]?.kind==="postfix",a=t.kind==="prefix"||n.kind==="prefix"?"prefix":t.kind==="postfix"||n.kind==="postfix"?"postfix":t.kind==="variadic"&&n.kind==="variadic"?"variadic":s||o?"prefix":t.kind==="defaultables"||n.kind==="defaultables"?"defaultables":"optionals";if(t.kind==="prefix"&&n.kind==="variadic"&&o){let d=Vo({...e,fixedVariants:[],r:i.map(f=>({...f,kind:"prefix"}))});d.disjoint.length===0&&e.fixedVariants.push(d)}else if(n.kind==="prefix"&&t.kind==="variadic"&&s){let d=Vo({...e,fixedVariants:[],l:r.map(f=>({...f,kind:"prefix"}))});d.disjoint.length===0&&e.fixedVariants.push(d)}let c=Je(t.node,n.node,e.ctx);if(c instanceof X)if(a==="prefix"||a==="postfix")e.disjoint.push(...c.withPrefixKey(a==="prefix"?e.result.length:`-${r.length+1}`,BE(t)&&BE(n)?"required":"optional")),e.result=[...e.result,{kind:a,node:M.intrinsic.never.internal}];else return a==="optionals"||a==="defaultables"?e:Vo({...e,fixedVariants:[],l:r.map(d=>({...d,kind:"prefix"})),r:r.map(d=>({...d,kind:"prefix"}))});else a==="defaultables"?(t.kind==="defaultables"&&n.kind==="defaultables"&&t.default!==n.default&&L(Wd(t.default,n.default)),e.result=[...e.result,{kind:a,node:c,default:t.kind==="defaultables"?t.default:n.kind==="defaultables"?n.default:$e(`Unexpected defaultable intersection from ${t.kind} and ${n.kind} elements.`)}]):e.result=[...e.result,{kind:a,node:c}];let l=e.l.length,p=e.r.length;return(t.kind!=="variadic"||l>=p&&(n.kind==="variadic"||p===1))&&(e.l=r),(n.kind!=="variadic"||p>=l&&(t.kind==="variadic"||l===1))&&(e.r=i),Vo(e)},BE=e=>e.kind==="prefix"||e.kind==="postfix";u();var HE=e=>t=>{if(t.props.length||t.index){let r=t.index?.map(i=>i[e])??[];for(let i of t.props)r.push(i[e]);t.undeclared&&r.push(`+ (undeclared): ${t.undeclared}`);let n=`{ ${r.join(", ")} }`;return t.sequence?`${n} & ${t.sequence.description}`:n}return t.sequence?.description??"{}"},SD=HE("description"),OD=HE("expression"),VE=(e,t,r)=>{let n=e.required?"required":"optional";if(!t.signature.allows(e.key))return null;let i=zt(e.value,t.value,r);return i instanceof X?n==="optional"?r.node("optional",{key:e.key,value:M.intrinsic.never.internal}):i.withPrefixKey(e.key,e.kind):null},_D=be({kind:"structure",hasAssociatedError:!1,normalize:e=>e,applyConfig:(e,t)=>!e.undeclared&&t.onUndeclaredKey!=="ignore"?{...e,undeclared:t.onUndeclaredKey}:e,keys:{required:{child:!0,parse:Rt("required"),reduceIo:(e,t,r)=>{t.required=Ne(t.required,r.map(n=>e==="in"?n.rawIn:n.rawOut))}},optional:{child:!0,parse:Rt("optional"),reduceIo:(e,t,r)=>{if(e==="in"){t.optional=r.map(n=>n.rawIn);return}for(let n of r)t[n.outProp.kind]=Ne(t[n.outProp.kind],n.outProp.rawOut)}},index:{child:!0,parse:Rt("index")},sequence:{child:!0,parse:Rt("sequence")},undeclared:{parse:e=>e==="ignore"?void 0:e,reduceIo:(e,t,r)=>{if(r==="reject"){t.undeclared="reject";return}e==="in"?delete t.undeclared:t.undeclared="reject"}}},defaults:{description:SD},intersections:{structure:(e,t,r)=>{let n={...e.inner},i={...t.inner},s=new X;if(e.undeclared){let c=e.keyof();for(let l of t.requiredKeys)c.allows(l)||s.add("presence",M.intrinsic.never.internal,t.propsByKey[l].value,{path:[l]});i.optional&&(i.optional=i.optional.filter(l=>c.allows(l.key))),i.index&&(i.index=i.index.flatMap(l=>{if(l.signature.extends(c))return l;let p=zt(c,l.signature,r.$);if(p instanceof X)return[];let d=Hc(p,l.value,r.$);return d.required&&(i.required=xn(i.required,d.required)),d.optional&&(i.optional=xn(i.optional,d.optional)),d.index??[]}))}if(t.undeclared){let c=t.keyof();for(let l of e.requiredKeys)c.allows(l)||s.add("presence",e.propsByKey[l].value,M.intrinsic.never.internal,{path:[l]});n.optional&&(n.optional=n.optional.filter(l=>c.allows(l.key))),n.index&&(n.index=n.index.flatMap(l=>{if(l.signature.extends(c))return l;let p=zt(c,l.signature,r.$);if(p instanceof X)return[];let d=Hc(p,l.value,r.$);return d.required&&(n.required=xn(n.required,d.required)),d.optional&&(n.optional=xn(n.optional,d.optional)),d.index??[]}))}let o={};(e.undeclared||t.undeclared)&&(o.undeclared=e.undeclared==="reject"||t.undeclared==="reject"?"reject":"delete");let a=Ss({kind:"structure",baseInner:o,l:Os(n),r:Os(i),roots:[],ctx:r});return a instanceof X&&s.push(...a),s.length?s:a}},reduce:(e,t)=>{if(!e.required&&!e.optional)return;let r={},n=!1,i=e.optional?[...e.optional]:[];if(e.required)for(let s=0;s<e.required.length;s++){let o=e.required[s];if(o.key in r&&L(GE(o.key)),r[o.key]=!0,e.index)for(let a of e.index){let c=VE(o,a,t);if(c instanceof X)return c}}if(e.optional)for(let s=0;s<e.optional.length;s++){let o=e.optional[s];if(o.key in r&&L(GE(o.key)),r[o.key]=!0,e.index)for(let a of e.index){let c=VE(o,a,t);if(c instanceof X)return c;c!==null&&(i[s]=c,n=!0)}}if(n)return t.node("structure",{...e,optional:i},{prereduced:!0})}}),vf=class extends or{impliedBasis=M.intrinsic.object.internal;impliedSiblings=this.children.flatMap(t=>t.impliedSiblings??[]);props=xn(this.required,this.optional);propsByKey=ge(this.props,(t,r)=>[r.key,r]);propsByKeyReference=nt(this.propsByKey);expression=OD(this);requiredKeys=this.required?.map(t=>t.key)??[];optionalKeys=this.optional?.map(t=>t.key)??[];literalKeys=[...this.requiredKeys,...this.optionalKeys];_keyof;keyof(){if(this._keyof)return this._keyof;let t=this.$.units(this.literalKeys).branches;if(this.index)for(let{signature:r}of this.index)t=t.concat(r.branches);return this._keyof=this.$.node("union",t)}map(t){return this.$.node("structure",this.props.flatMap(t).reduce((r,n)=>{let i=this.propsByKey[n.key];if(We(n))return n.kind!=="required"&&n.kind!=="optional"?L(`Map result must have kind "required" or "optional" (was ${n.kind})`):(r[n.kind]=Ne(r[n.kind],n),r);let s=n.kind??i?.kind??"required",o=ge(n,(a,c)=>a in qo.implementation.keys?[a,c]:[]);return r[s]=Ne(r[s],this.$.node(s,o)),r},{}))}assertHasKeys(t){let r=t.filter(n=>!Mo(n,this.keyof()));if(r.length)return L(KE(this.expression,r))}get(t,...r){let n,i=!1,s=RD(t);if((typeof s=="string"||typeof s=="symbol")&&this.propsByKey[s]&&(n=this.propsByKey[s].value,i=this.propsByKey[s].required),this.index)for(let a of this.index)Mo(s,a.signature)&&(n=n?.and(a.value)??a.value);if(this.sequence&&Mo(s,M.intrinsic.nonNegativeIntegerString))if(re(s,"root"))this.sequence.variadic&&(n=n?.and(this.sequence.element)??this.sequence.element);else{let a=Number.parseInt(s);if(a<this.sequence.prevariadic.length){let c=this.sequence.prevariadic[a].node;n=n?.and(c)??c,i||=a<this.sequence.prefixLength}else if(this.sequence.variadic){let c=this.$.node("union",this.sequence.variadicOrPostfix);n=n?.and(c)??c}}if(!n)return this.sequence?.variadic&&re(s,"root")&&s.extends(M.intrinsic.number)?L(CD(s.expression,this.sequence.expression)):L(KE(this.expression,[s]));let o=n.get(...r);return i?o:o.or(M.intrinsic.undefined)}pick(...t){return this.assertHasKeys(t),this.$.node("structure",this.filterKeys("pick",t))}omit(...t){return this.assertHasKeys(t),this.$.node("structure",this.filterKeys("omit",t))}optionalize(){let{required:t,...r}=this.inner;return this.$.node("structure",{...r,optional:this.props.map(n=>n.hasKind("required")?this.$.node("optional",n.inner):n)})}require(){let{optional:t,...r}=this.inner;return this.$.node("structure",{...r,required:this.props.map(n=>n.hasKind("optional")?{key:n.key,value:n.value}:n)})}merge(t){let r=this.filterKeys("omit",[t.keyof()]);return t.required&&(r.required=Ne(r.required,t.required)),t.optional&&(r.optional=Ne(r.optional,t.optional)),t.index&&(r.index=Ne(r.index,t.index)),t.sequence&&(r.sequence=t.sequence),t.undeclared?r.undeclared=t.undeclared:delete r.undeclared,this.$.node("structure",r)}filterKeys(t,r){let n=$c(this.inner),i=s=>{let o=r.some(a=>Mo(s,a));return t==="pick"?o:!o};return n.required&&(n.required=n.required.filter(s=>i(s.key))),n.optional&&(n.optional=n.optional.filter(s=>i(s.key))),n.index&&(n.index=n.index.filter(s=>i(s.signature))),n}traverseAllows=(t,r)=>this._traverse("Allows",t,r);traverseApply=(t,r)=>this._traverse("Apply",t,r);_traverse=(t,r,n)=>{let i=n?.currentErrorCount??0;for(let s=0;s<this.props.length;s++)if(t==="Allows"){if(!this.props[s].traverseAllows(r,n))return!1}else if(this.props[s].traverseApply(r,n),n.failFast&&n.currentErrorCount>i)return!1;if(this.sequence){if(t==="Allows"){if(!this.sequence.traverseAllows(r,n))return!1}else if(this.sequence.traverseApply(r,n),n.failFast&&n.currentErrorCount>i)return!1}if(this.index||this.undeclared==="reject"){let s=Object.keys(r);s.push(...Object.getOwnPropertySymbols(r));for(let o=0;o<s.length;o++){let a=s[o];if(this.index){for(let c of this.index)if(c.signature.traverseAllows(a,n)){if(t==="Allows"){if(!Qt(a,()=>c.value.traverseAllows(r[a],n),n))return!1}else if(Qt(a,()=>c.value.traverseApply(r[a],n),n),n.failFast&&n.currentErrorCount>i)return!1}}if(this.undeclared==="reject"&&!this.declaresKey(a)&&(t==="Allows"||(n.errorFromNodeContext({code:"predicate",expected:"removed",actual:"",relativePath:[a],meta:this.meta}),n.failFast)))return!1}}return this.structuralMorph&&n&&!n.hasError()&&n.queueMorphs([this.structuralMorph]),!0};get defaultable(){return this.cacheGetter("defaultable",this.optional?.filter(t=>t.hasDefault())??[])}declaresKey=t=>t in this.propsByKey||this.index?.some(r=>r.signature.allows(t))||this.sequence!==void 0&&M.intrinsic.nonNegativeIntegerString.allows(t);_compileDeclaresKey(t){let r=[];if(this.props.length&&r.push(`k in ${this.propsByKeyReference}`),this.index)for(let n of this.index)r.push(t.invoke(n.signature,{kind:"Allows",arg:"k"}));return this.sequence&&r.push("$ark.intrinsic.nonNegativeIntegerString.allows(k)"),r.join(" || ")||"false"}get structuralMorph(){return this.cacheGetter("structuralMorph",ND(this))}structuralMorphRef=this.structuralMorph&&nt(this.structuralMorph);compile(t){t.traversalKind==="Apply"&&t.initializeErrorCount();for(let r of this.props)t.check(r),t.traversalKind==="Apply"&&t.returnIfFailFast();if(this.sequence&&(t.check(this.sequence),t.traversalKind==="Apply"&&t.returnIfFailFast()),(this.index||this.undeclared==="reject")&&(t.const("keys","Object.keys(data)"),t.line("keys.push(...Object.getOwnPropertySymbols(data))"),t.for("i < keys.length",()=>this.compileExhaustiveEntry(t))),t.traversalKind==="Allows")return t.return(!0);this.structuralMorphRef&&t.if("ctx && !ctx.hasError()",()=>(t.line("ctx.queueMorphs(["),ID(t,this),t.line("])")))}compileExhaustiveEntry(t){if(t.const("k","keys[i]"),this.index)for(let r of this.index)t.if(`${t.invoke(r.signature,{arg:"k",kind:"Allows"})}`,()=>t.traverseKey("k","data[k]",r.value));return this.undeclared==="reject"&&t.if(`!(${this._compileDeclaresKey(t)})`,()=>t.traversalKind==="Allows"?t.return(!1):t.line(`ctx.errorFromNodeContext({ code: "predicate", expected: "removed", actual: "", relativePath: [k], meta: ${this.compiledMeta} })`).if("ctx.failFast",()=>t.return())),t}reduceJsonSchema(t,r){switch(t.type){case"object":return this.reduceObjectJsonSchema(t,r);case"array":let n=this.sequence?.reduceJsonSchema(t,r)??t;return this.props.length||this.index?r.fallback.arrayObject({code:"arrayObject",base:n,object:this.reduceObjectJsonSchema({type:"object"},r)}):n;default:return Ye.throwInternalOperandError("structure",t)}}reduceObjectJsonSchema(t,r){if(this.props.length){t.properties={};for(let n of this.props){let i=n.value.toJsonSchemaRecurse(r);if(typeof n.key=="symbol"){r.fallback.symbolKey({code:"symbolKey",base:t,key:n.key,value:i,optional:n.optional});continue}if(n.hasDefault()){let s=typeof n.default=="function"?n.default():n.default;i.default=M.intrinsic.jsonData.allows(s)?s:r.fallback.defaultValue({code:"defaultValue",base:i,value:s})}t.properties[n.key]=i}this.requiredKeys.length&&t.properties&&(t.required=this.requiredKeys.filter(n=>typeof n=="string"&&n in t.properties))}if(this.index)for(let n of this.index){let i=n.value.toJsonSchemaRecurse(r);if(n.signature.equals(M.intrinsic.string)){t.additionalProperties=i;continue}for(let s of n.signature.branches){if(!s.extends(M.intrinsic.string)){t=r.fallback.symbolKey({code:"symbolKey",base:t,key:null,value:i,optional:!1});continue}let o={type:"string"};if(s.hasKind("morph")&&(o=r.fallback.morph({code:"morph",base:s.rawIn.toJsonSchemaRecurse(r),out:s.rawOut.toJsonSchemaRecurse(r)})),!s.hasKind("intersection"))return $e(`Unexpected index branch kind ${s.kind}.`);let{pattern:a}=s.inner;if(a){let c=Object.assign(o,{pattern:a[0].rule});for(let l=1;l<a.length;l++)o=r.fallback.patternIntersection({code:"patternIntersection",base:c,pattern:a[l].rule});t.patternProperties??={},t.patternProperties[c.pattern]=i}}}return this.undeclared&&!t.additionalProperties&&(t.additionalProperties=!1),t}},bf={},AD=e=>{let t="";for(let r=0;r<e.defaultable.length;r++)t+=e.defaultable[r].defaultValueMorphRef;if(e.sequence?.defaultValueMorphsReference&&(t+=e.sequence?.defaultValueMorphsReference),e.undeclared==="delete"){if(t+="delete !(",e.required)for(let r of e.required)t+=r.compiledKey+" | ";if(e.optional)for(let r of e.optional)t+=r.compiledKey+" | ";if(e.index)for(let r of e.index)t+=r.signature.id+" | ";if(e.sequence)if(e.sequence.maxLength===null)t+=ae.nonNegativeIntegerString.id;else for(let r=0;r<e.sequence.tuple.length;r++)t+=r+" | ";t+=")"}return t},ND=e=>{let t=AD(e);if(!t)return;if(bf[t])return bf[t];let r=(n,i)=>{for(let s=0;s<e.defaultable.length;s++)e.defaultable[s].key in n||e.defaultable[s].defaultValueMorph(n,i);if(e.sequence?.defaultables)for(let s=n.length-e.sequence.prefixLength;s<e.sequence.defaultables.length;s++)e.sequence.defaultValueMorphs[s](n,i);if(e.undeclared==="delete")for(let s in n)e.declaresKey(s)||delete n[s];return n};return bf[t]=r},ID=(e,t)=>{let n=`(data${t.defaultable.some(i=>i.defaultValueMorph.length===2)||t.sequence?.defaultValueMorphs.some(i=>i.length===2)?", ctx":""})`;return e.block(`${n} => `,i=>{for(let s=0;s<t.defaultable.length;s++){let{serializedKey:o,defaultValueMorphRef:a}=t.defaultable[s];i.if(`!(${o} in data)`,c=>c.line(`${a}${n}`))}return t.sequence?.defaultables&&i.for(`i < ${t.sequence.defaultables.length}`,s=>s.set("data[i]",5),`data.length - ${t.sequence.prefixLength}`),t.undeclared==="delete"&&i.forIn("data",s=>s.if(`!(${t._compileDeclaresKey(s)})`,o=>o.line("delete data[k]"))),i.return("data")})},Tf={implementation:_D,Node:vf},RD=e=>(re(e,"root")&&e.hasKind("unit")&&(e=e.unit),typeof e=="number"&&(e=`${e}`),e),CD=(e,t)=>`${e} is not allowed as an array index on ${t}. Use the 'nonNegativeIntegerString' keyword instead.`,Hc=(e,t,r)=>{let[n,i]=kT(e.branches,o=>o.hasKind("unit"));if(!n.length)return{index:r.node("index",{signature:e,value:t})};let s={};for(let o of n){let a=r.node("required",{key:o.unit,value:t});s[a.kind]=Ne(s[a.kind],a)}return i.length&&(s.index=r.node("index",{signature:i,value:t})),s},LD=e=>re(e,"root")?e.expression:ye(e),KE=(e,t)=>`Key${t.length===1?"":"s"} ${t.map(LD).join(", ")} ${t.length===1?"does":"do"} not exist on ${e}`,GE=e=>`Duplicate key ${$r(e)}`;var As={...OE,alias:Uo.implementation,domain:Gc.implementation,unit:lf.implementation,proto:Bo.implementation,union:cf.implementation,morph:nf.implementation,intersection:tf.implementation,divisor:Id.implementation,pattern:Gd.implementation,predicate:Ad.implementation,required:hf.implementation,optional:qo.implementation,index:df.implementation,sequence:gf.implementation,structure:Tf.implementation};M.defaultConfig=UT(Object.assign(ge(As,(e,t)=>[e,t.defaults]),{jitless:QT(),clone:KT,onUndeclaredKey:"ignore",exactOptionalPropertyTypes:!0,numberAllowsNaN:!1,dateAllowsInvalid:!1,onFail:null,keywords:{},toJsonSchema:Ye.defaultConfig}));M.resolvedConfig=Lo(M.defaultConfig,M.config);var RE={..._E,alias:Uo.Node,domain:Gc.Node,unit:lf.Node,proto:Bo.Node,union:cf.Node,morph:nf.Node,intersection:tf.Node,divisor:Id.Node,pattern:Gd.Node,predicate:Ad.Node,required:hf.Node,optional:qo.Node,index:df.Node,sequence:gf.Node,structure:Tf.Node};u();var Oi=class extends Rc{get[$t](){return"module"}},Ef=(e,t)=>new Oi(ge(e,(r,n)=>[r,re(n,"module")?Ef(n,t):t.bindReference(n)]));var kD=e=>He(e)?e:"branches"in e&&He(e.branches)?e.branches:void 0,DD=(e,t)=>L(`Node of kind ${t} is not valid as a ${e} definition`),QE=e=>`#${e} duplicates public alias ${e}`,xf={};M.ambient??={};var zE,JE="function $",$D=e=>YE(e,XE(e)),YE=(e,t)=>{let r=t.write(JE,4),n=t.compile()();for(let i of e)i.precompilation||(i.traverseAllows=n[`${i.id}Allows`].bind(n),i.isRoot()&&!i.allowsRequiresContext&&(i.allows=i.traverseAllows),i.traverseApply=n[`${i.id}Apply`].bind(n),n[`${i.id}Optimistic`]&&(i.traverseOptimistic=n[`${i.id}Optimistic`].bind(n)),i.precompilation=r)},XE=e=>new Co().return(e.reduce((t,r)=>{let n=new ys({kind:"Allows"}).indent();r.compile(n);let i=n.write(`${r.id}Allows`),s=new ys({kind:"Apply"}).indent();r.compile(s);let o=s.write(`${r.id}Apply`),a=`${t}${i},
352
+ ${o},
353
+ `;if(!r.hasKind("union"))return a;let c=new ys({kind:"Allows",optimistic:!0}).indent();r.compile(c);let l=c.write(`${r.id}Optimistic`);return`${a}${l},
354
+ `},`{
355
+ `)+"}"),Ko=class{config;resolvedConfig;name;get[$t](){return"scope"}referencesById={};references=[];resolutions={};exportedNames=[];aliases={};resolved=!1;nodesByHash={};intrinsic;constructor(t,r){this.config=Lo(M.config,r),this.resolvedConfig=Lo(M.resolvedConfig,r),this.name=this.resolvedConfig.name??`anonymousScope${Object.keys(xf).length}`,this.name in xf&&L(`A Scope already named ${this.name} already exists`),xf[this.name]=this;let n=Object.entries(t).map(i=>this.preparseOwnAliasEntry(...i));for(let[i,s]of n){let o=i;if(i[0]==="#"?(o=i.slice(1),o in this.aliases&&L(QE(o)),this.aliases[o]=s):(o in this.aliases&&L(QE(i)),this.aliases[o]=s,this.exportedNames.push(o)),!re(s,"module")&&!re(s,"generic")&&!Un(s)){let a=this.preparseOwnDefinitionFormat(s,{alias:o});this.resolutions[o]=re(a,"root")?this.bindReference(a):this.createParseContext(a).id}}zE??=this.node("union",{branches:["string","number","object","bigint","symbol",{unit:!0},{unit:!1},{unit:void 0},{unit:null}]},{prereduced:!0}),this.nodesByHash[zE.hash]=this.node("intersection",{},{prereduced:!0}),this.intrinsic=M.intrinsic?ge(M.intrinsic,(i,s)=>i.startsWith("json")?[]:[i,this.bindReference(s)]):{}}cacheGetter(t,r){return Object.defineProperty(this,t,{value:r}),r}get internal(){return this}_json;get json(){return this._json||this.export(),this._json}defineSchema(t){return t}generic=(...t)=>{let r=this;return(n,i)=>new _n(t,i?new $o(n):n,r,r,i??null)};units=(t,r)=>{let n=[];for(let s of t)n.includes(s)||n.push(s);let i=n.map(s=>this.node("unit",{unit:s},r));return this.node("union",i,{...r,prereduced:!0})};lazyResolutions=[];lazilyResolve(t,r){let n=this.node("alias",{reference:r??"synthetic",resolve:t},{prereduced:!0});return this.resolved||this.lazyResolutions.push(n),n}schema=(t,r)=>this.finalize(this.parseSchema(t,r));parseSchema=(t,r)=>this.node(Po(t),t,r);preparseNode(t,r,n){let i=typeof t=="string"?t:Po(r,t);if(We(r)&&r.kind===i)return r;if(i==="alias"&&!n?.prereduced){let{reference:a}=Uo.implementation.normalize(r,this);if(a.startsWith("$")){let c=this.resolveRoot(a.slice(1));r=c,i=c.kind}}else if(i==="union"&&Vt(r,"object")){let a=kD(r);a?.length===1&&(r=a[0],i=Po(r))}if(We(r)&&r.kind===i)return r;let o=As[i].normalize?.(r,this)??r;return We(o)?o.kind===i?o:DD(i,o.kind):{...n,$:this,kind:i,def:o,prefix:n.alias??i}}bindReference(t){let r;return We(t)?r=t.$===this?t:new t.constructor(t.attachments,this):r=t.$===this?t:new _n(t.params,t.bodyDef,t.$,this,t.hkt),this.resolved||Object.assign(this.referencesById,r.referencesById),r}resolveRoot(t){return this.maybeResolveRoot(t)??L(Sf(t))}maybeResolveRoot(t){let r=this.maybeResolve(t);if(!re(r,"generic"))return r}maybeResolveSubalias(t){return wf(this.aliases,t)??wf(this.ambient,t)}get ambient(){return M.ambient}maybeResolve(t){let r=this.resolutions[t];if(r){if(typeof r!="string")return this.bindReference(r);let i=Pt[r];if(re(i,"root"))return this.resolutions[t]=i;if(re(i,"context")){if(i.phase==="resolving")return this.node("alias",{reference:`$${t}`},{prereduced:!0});if(i.phase==="resolved")return $e(`Unexpected resolved context for was uncached by its scope: ${ye(i)}`);i.phase="resolving";let s=this.bindReference(this.parseOwnDefinitionFormat(i.def,i));return i.phase="resolved",Pt[s.id]=s,Pt[i.id]=s,this.resolutions[t]=s}return $e(`Unexpected nodesById entry for ${r}: ${ye(i)}`)}let n=this.aliases[t]??this.ambient?.[t];return n?(n=this.normalizeRootScopeValue(n),re(n,"generic")?this.resolutions[t]=this.bindReference(n):re(n,"module")?(n.root||L(tx(t)),this.resolutions[t]=this.bindReference(n.root)):this.resolutions[t]=this.parse(n,{alias:t})):this.maybeResolveSubalias(t)}createParseContext(t){let r=t.id??Hd(t.prefix);return Pt[r]=Object.assign(t,{[$t]:"context",$:this,id:r,phase:"unresolved"})}traversal(t){return new br(t,this.resolvedConfig)}import(...t){return new Oi(ge(this.export(...t),(r,n)=>[`#${r}`,n]))}precompilation;_exportedResolutions;_exports;export(...t){if(!this._exports){this._exports={};for(let n of this.exportedNames){let i=this.aliases[n];this._exports[n]=re(i,"module")?Ef(i,this):WE(this.maybeResolve(n))}for(let n of this.lazyResolutions)n.resolution;if(this._exportedResolutions=ex(this,this._exports),this._json=ZE(this._exportedResolutions),Object.assign(this.resolutions,this._exportedResolutions),this.references=Object.values(this.referencesById),!this.resolvedConfig.jitless){let n=XE(this.references);this.precompilation=n.write(JE,4),YE(this.references,n)}this.resolved=!0}let r=t.length?t:this.exportedNames;return new Oi(ge(r,(n,i)=>[i,this._exports[i]]))}resolve(t){return this.export()[t]}node=(t,r,n={})=>{let i=this.preparseNode(t,r,n);if(We(i))return this.bindReference(i);let s=this.createParseContext(i),o=Qd(s),a=this.bindReference(o);return Pt[s.id]=a};parse=(t,r={})=>this.finalize(this.parseDefinition(t,r));parseDefinition(t,r={}){if(re(t,"root"))return this.bindReference(t);let n=this.preparseOwnDefinitionFormat(t,r);if(re(n,"root"))return this.bindReference(n);let i=this.createParseContext(n);Pt[i.id]=i;let s=this.bindReference(this.parseOwnDefinitionFormat(t,i));return s.isCyclic&&(s=IE(s,i.id)),Pt[i.id]=s,s}finalize(t){return WE(t),!t.precompilation&&!this.resolvedConfig.jitless&&$D(t.references),t}},Qc=class extends Ko{parseOwnDefinitionFormat(t,r){return Qd(r)}preparseOwnDefinitionFormat(t,r){return this.preparseNode(Po(t),t,r)}preparseOwnAliasEntry(t,r){return[t,r]}normalizeRootScopeValue(t){return t}},WE=e=>{let t=e.references.filter(r=>r.hasKind("alias"));for(let r of t){Object.assign(r.referencesById,r.resolution.referencesById);for(let n of e.references)r.id in n.referencesById&&Object.assign(n.referencesById,r.referencesById)}return e},ZE=e=>ge(e,(t,r)=>[t,re(r,"root")||re(r,"generic")?r.json:re(r,"module")?ZE(r):$e(`Unexpected resolution ${ye(r)}`)]),wf=(e,t)=>{let r=t.indexOf(".");if(r===-1)return;let n=t.slice(0,r),i=e[n];if(i===void 0)return;if(!re(i,"module"))return L(PD(n));let s=t.slice(r+1),o=i[s];if(o===void 0)return wf(i,s);if(re(o,"root")||re(o,"generic"))return o;if(re(o,"module"))return o.root??L(tx(t));$e(`Unexpected resolution for alias '${t}': ${ye(o)}`)},zc=(e,t)=>new Qc(e,t),Go=new Qc({});var ex=(e,t)=>{let r={};for(let n in t){let i=t[n];if(re(i,"module")){let s=ex(e,i),o=ge(s,(a,c)=>[`${n}.${a}`,c]);Object.assign(r,o)}else re(i,"root")||re(i,"generic")?r[n]=i:$e(`Unexpected scope resolution ${ye(i)}`)}return r},Sf=e=>`'${e}' is unresolvable`,PD=e=>`'${e}' must reference a module to be accessed using dot syntax`,tx=e=>`Reference to submodule '${e}' must specify an alias`;Go.export();var qe=Go.schema,Cs=Go.node,jee=Go.defineSchema,vr=Go.generic;u();var Of="^(?:0|[1-9]\\d*)$",jD=new RegExp(Of),Uee=nt(jD);var rx=zc({bigint:"bigint",boolean:[{unit:!1},{unit:!0}],false:{unit:!1},never:[],null:{unit:null},number:"number",object:"object",string:"string",symbol:"symbol",true:{unit:!0},unknown:{},undefined:{unit:void 0},Array,Date},{prereducedAliases:!0}).export();M.intrinsic={...rx};var nx=zc({integer:{domain:"number",divisor:1},lengthBoundable:["string",Array],key:["string","symbol"],nonNegativeIntegerString:{domain:"string",pattern:Of}},{prereducedAliases:!0}).export();Object.assign(M.intrinsic,nx);var qD=zc({jsonPrimitive:["string","number",{unit:!0},{unit:!1},{unit:null}],jsonObject:{domain:"object",index:{signature:"string",value:"$jsonData"}},jsonData:["$jsonPrimitive","$jsonObject"]},{prereducedAliases:!0}).export(),ae={...rx,...nx,...qD,emptyStructure:Cs("structure",{},{prereduced:!0})};M.intrinsic={...ae};u();u();u();u();u();var Wc=((e,t)=>new RegExp(e,t));Object.assign(Wc,{as:Wc});u();u();u();u();u();u();var sx=e=>typeof e=="string"&&e[0]==="d"&&(e[1]==="'"||e[1]==='"')&&e[e.length-1]===e[1],ix=e=>e.toString()!=="Invalid Date",ox=e=>e.slice(2,-1),_f=e=>`'${e}' could not be parsed by the Date constructor`,ax=(e,t)=>FD(e,t),FD=(e,t)=>{let r=new Date(e);if(ix(r))return r;let n=rE(e);if(n!==void 0){let i=new Date(n);if(ix(i))return i}return t?L(t===!0?_f(e):t):void 0};var MD=qe({proto:"Array",sequence:"string",required:{key:"groups",value:["object",{unit:void 0}]}}),Jc=(e,t)=>{let r=e.scanner.shiftUntilEscapable(BD[lx[t]]);if(e.scanner.lookahead==="")return e.error(KD(r,t));if(e.scanner.shift(),t in ux){let n;try{n=new RegExp(r)}catch(i){L(String(i))}e.root=e.ctx.$.node("intersection",{domain:"string",pattern:r},{prereduced:!0}),t==="x/"&&(e.root=e.ctx.$.node("morph",{in:e.root,morphs:i=>n.exec(i),declaredOut:MD}))}else if(yt(t,Af))e.root=e.ctx.$.node("unit",{unit:r});else{let n=ax(r,_f(r));e.root=e.ctx.$.node("unit",{meta:r,unit:n})}},Af={"'":1,'"':1},cx={"/":1,"'":1,'"':1},UD={"d'":"'",'d"':'"',"'":"'",'"':'"'},ux={"/":"/","x/":"/"},lx={...UD,...ux},BD={"'":e=>e.lookahead==="'",'"':e=>e.lookahead==='"',"/":e=>e.lookahead==="/"},VD={'"':"double-quote","'":"single-quote","/":"forward slash"},KD=(e,t)=>`${t}${e} requires a closing ${VD[lx[t]]}`;u();u();var px=e=>`Private type references should not include '#'. Use '${e}' instead.`,Yc="Optional definitions like 'string?' are only valid as properties in an object or tuple",Xc="Defaultable definitions like 'number = 0' are only valid as properties in an object or tuple";u();var sn={"<":1,">":1,"=":1,"|":1,"&":1,")":1,"[":1,"%":1,",":1,":":1,"?":1,"#":1,...Bn};var dx=(e,t)=>e===">"?t[0]==="="?t[1]==="=":t.trimStart()===""||yt(t.trimStart()[0],sn):e==="="?t[0]!=="=":e===","||e==="?";u();var fx=(e,t,r)=>hx(e,t,r,[]),hx=(e,t,r,n)=>{let i=r.parseUntilFinalizer();return n.push(i.root),i.finalizer===">"?n.length!==t.params.length?r.error(Nf(e,t.names,n.map(s=>s.expression))):n:i.finalizer===","?hx(e,t,r,n):i.error(Dc(">"))},Nf=(e,t,r)=>`${e}<${t.join(", ")}> requires exactly ${t.length} args (got ${r.length}${r.length===0?"":`: ${r.join(", ")}`})`;var Zc=e=>{let t=e.scanner.shiftUntilLookahead(sn);t==="keyof"?e.addPrefix("keyof"):e.root=HD(e,t)},GD=(e,t,r)=>{if(r.scanner.shiftUntilNonWhitespace(),r.scanner.shift()!=="<")return r.error(Nf(e,t.names,[]));let i=fx(e,t,r);return t(...i)},HD=(e,t)=>QD(e,t)??zD(e,t)??e.error(t===""?e.scanner.lookahead==="#"?px(e.shiftedBy(1).scanner.shiftUntilLookahead(sn)):If(e):Sf(t)),QD=(e,t)=>{if(e.ctx.args?.[t]){let n=e.ctx.args[t];return typeof n!="string"?n:e.ctx.$.node("alias",{reference:n},{prereduced:!0})}let r=e.ctx.$.maybeResolve(t);if(re(r,"root"))return r;if(r!==void 0)return re(r,"generic")?GD(t,r,e):L(`Unexpected resolution ${ye(r)}`)},zD=(e,t)=>{let r=nE(t);if(r!==void 0)return e.ctx.$.node("unit",{unit:r});let n=sE(t);if(n!==void 0)return e.ctx.$.node("unit",{unit:n})},If=e=>{let t=e.previousOperator();return t?Rf(t,e.scanner.unscanned):WD(e.scanner.unscanned)},Rf=(e,t="")=>`Token '${e}' requires a right operand${t?` before '${t}'`:""}`,WD=e=>`Expected an expression${e?` before '${e}'`:""}`;var Cf=e=>e.scanner.lookahead===""?e.error(If(e)):e.scanner.lookahead==="("?e.shiftedBy(1).reduceGroupOpen():e.scanner.lookaheadIsIn(cx)?Jc(e,e.scanner.shift()):e.scanner.lookaheadIsIn(Bn)?Cf(e.shiftedBy(1)):e.scanner.lookahead==="d"?e.scanner.nextLookahead in Af?Jc(e,`${e.scanner.shift()}${e.scanner.shift()}`):Zc(e):e.scanner.lookahead==="x"?e.scanner.nextLookahead==="/"?e.shiftedBy(2)&&Jc(e,"x/"):Zc(e):Zc(e);u();u();u();var mx={">":!0,">=":!0},gx={"<":!0,"<=":!0};var Ls={"<":">",">":"<","<=":">=",">=":"<=","==":"=="},yx=(e,t)=>`Left bounds are only valid when paired with right bounds (try ...${t}${e})`,eu=e=>`Left-bounded expressions must specify their limits using < or <= (was ${e})`,bx=(e,t,r,n)=>`An expression may have at most one left bound (parsed ${e}${Ls[t]}, ${r}${Ls[n]})`;var Tx=(e,t)=>{let r=JD(e,t);if(e.root.hasKind("unit")){if(typeof e.root.unit=="number"){e.reduceLeftBound(e.root.unit,r),e.unsetRoot();return}if(e.root.unit instanceof Date){let n=`d'${e.root.description??e.root.unit.toISOString()}'`;e.unsetRoot(),e.reduceLeftBound(n,r);return}}return XD(e,r)},Ex={"<":1,">":1,"=":1},JD=(e,t)=>e.scanner.lookaheadIs("=")?`${t}${e.scanner.shift()}`:t;var vx=(e,t,r,n)=>r.extends(M.intrinsic.number)?typeof t!="number"?L(Lf(e,t,n)):e==="=="?["min","max"]:e[0]===">"?["min"]:["max"]:r.extends(M.intrinsic.lengthBoundable)?typeof t!="number"?L(Lf(e,t,n)):e==="=="?["exactLength"]:e[0]===">"?["minLength"]:["maxLength"]:r.extends(M.intrinsic.Date)?e==="=="?["after","before"]:e[0]===">"?["after"]:["before"]:L(SE(r.expression)),YD=e=>({rule:sx(e.limit)?ox(e.limit):e.limit,exclusive:e.comparator.length===1}),XD=(e,t)=>{let r=e.unsetRoot(),n=e.scanner.location;e.parseOperand();let i=e.unsetRoot(),s=e.scanner.sliceChars(n,e.scanner.location);if(e.root=r,!i.hasKind("unit")||typeof i.unit!="number"&&!(i.unit instanceof Date))return e.error(Lf(t,s,"right"));let o=i.unit,a=t.length===1,c=vx(t,typeof o=="number"?o:s,r,"right");for(let p of c)e.constrainRoot(p,t==="=="?{rule:o}:{rule:o,exclusive:a});if(!e.branches.leftBound)return;if(!yt(t,gx))return e.error(eu(t));let l=vx(e.branches.leftBound.comparator,e.branches.leftBound.limit,r,"left");e.constrainRoot(l[0],YD(e.branches.leftBound)),e.branches.leftBound=null},Lf=(e,t,r)=>`Comparator ${r==="left"?Ls[e]:e} must be ${r==="left"?"preceded":"followed"} by a corresponding literal (was ${t})`;u();var xx=e=>{e.scanner.shiftUntilNonWhitespace();let t=e.scanner.shiftUntilLookahead(sn);e.root=e.root.brand(t)};u();var Sx=e=>{e.scanner.shiftUntilNonWhitespace();let t=e.scanner.shiftUntilLookahead(sn),r=iE(t,{errorOnFail:wx(t)});r===0&&e.error(wx(0)),e.root=e.root.constrain("divisor",r)},wx=e=>`% operator must be followed by a non-zero integer literal (was ${e})`;var kf=e=>{let t=e.scanner.shift();return t===""?e.finalize(""):t==="["?e.scanner.shift()==="]"?e.setRoot(e.root.array()):e.error(ZD):t==="|"?e.scanner.lookahead===">"?e.shiftedBy(1).pushRootToBranch("|>"):e.pushRootToBranch(t):t==="&"?e.pushRootToBranch(t):t===")"?e.finalizeGroup():dx(t,e.scanner.unscanned)?e.finalize(t):yt(t,Ex)?Tx(e,t):t==="%"?Sx(e):t==="#"?xx(e):t in Bn?kf(e):e.error(tu(t))},tu=(e,t="")=>`'${e}' is not allowed here${t&&` (should be ${t})`}`,ZD="Missing expected ']'";u();u();var Ox=e=>{let t=e.unsetRoot();e.parseOperand();let r=e.unsetRoot();if(!r.hasKind("unit"))return e.error(e$(r.expression));let n=r.unit instanceof Date?()=>new Date(r.unit):r.unit;return[t,"=",n]},e$=e=>`Default value '${e}' must be a literal value`;var Df=(e,t)=>{let r=t.$.maybeResolveRoot(e);if(r)return r;if(e.endsWith("[]")){let s=t.$.maybeResolveRoot(e.slice(0,-2));if(s)return s.array()}let n=new ks(new gs(e),t),i=t$(n);return n.finalizer===">"&&L(tu(">")),i},t$=e=>{e.parseOperand();let t=Ho(e).root;return t?(e.finalizer==="="?t=Ox(e):e.finalizer==="?"&&(t=[t,"?"]),e.scanner.shiftUntilNonWhitespace(),e.scanner.lookahead&&L(tu(e.scanner.lookahead)),t):$e(`Root was unexpectedly unset after parsing string '${e.scanner.scanned}'`)},Ho=e=>{for(;e.finalizer===void 0;)r$(e);return e},r$=e=>e.hasRoot()?e.parseOperator():e.parseOperand();var ks=class e{root;branches={prefixes:[],leftBound:null,intersection:null,union:null,pipe:null};finalizer;groups=[];scanner;ctx;constructor(t,r){this.scanner=t,this.ctx=r}error(t){return L(t)}hasRoot(){return this.root!==void 0}setRoot(t){this.root=t}unsetRoot(){let t=this.root;return this.root=void 0,t}constrainRoot(...t){this.root=this.root.constrain(t[0],t[1])}finalize(t){if(this.groups.length)return this.error(Dc(")"));this.finalizeBranches(),this.finalizer=t}reduceLeftBound(t,r){let n=Ls[r];if(!yt(n,mx))return this.error(eu(r));if(this.branches.leftBound)return this.error(bx(this.branches.leftBound.limit,this.branches.leftBound.comparator,t,n));this.branches.leftBound={comparator:n,limit:t}}finalizeBranches(){if(this.assertRangeUnset(),this.branches.pipe){this.pushRootToBranch("|>"),this.root=this.branches.pipe;return}if(this.branches.union){this.pushRootToBranch("|"),this.root=this.branches.union;return}if(this.branches.intersection){this.pushRootToBranch("&"),this.root=this.branches.intersection;return}this.applyPrefixes()}finalizeGroup(){this.finalizeBranches();let t=this.groups.pop();if(!t)return this.error(uE(")",this.scanner.unscanned));this.branches=t}addPrefix(t){this.branches.prefixes.push(t)}applyPrefixes(){for(;this.branches.prefixes.length;){let t=this.branches.prefixes.pop();this.root=t==="keyof"?this.root.keyof():$e(`Unexpected prefix '${t}'`)}}pushRootToBranch(t){this.assertRangeUnset(),this.applyPrefixes();let r=this.root;this.root=void 0,this.branches.intersection=this.branches.intersection?.rawAnd(r)??r,t!=="&"&&(this.branches.union=this.branches.union?.rawOr(this.branches.intersection)??this.branches.intersection,this.branches.intersection=null,t!=="|"&&(this.branches.pipe=this.branches.pipe?.rawPipeOnce(this.branches.union)??this.branches.union,this.branches.union=null))}parseUntilFinalizer(){return Ho(new e(this.scanner,this.ctx))}parseOperator(){return kf(this)}parseOperand(){return Cf(this)}assertRangeUnset(){if(this.branches.leftBound)return this.error(yx(this.branches.leftBound.limit,this.branches.leftBound.comparator))}reduceGroupOpen(){this.groups.push(this.branches),this.branches={prefixes:[],leftBound:null,union:null,intersection:null,pipe:null}}previousOperator(){return this.branches.leftBound?.comparator??this.branches.prefixes[this.branches.prefixes.length-1]??(this.branches.intersection?"&":this.branches.union?"|":this.branches.pipe?"|>":void 0)}shiftedBy(t){return this.scanner.jumpForward(t),this}};var n$="An empty string is not a valid generic parameter name",ru=(e,t,r)=>{e.shiftUntilNonWhitespace();let n=e.shiftUntilLookahead(sn);return n===""?e.lookahead===""&&t.length?t:L(n$):(e.shiftUntilNonWhitespace(),i$(e,n,t,r))},_x="extends ",i$=(e,t,r,n)=>{if(e.shiftUntilNonWhitespace(),e.unscanned.startsWith(_x))e.jumpForward(_x.length);else return e.lookahead===","&&e.shift(),r.push(t),ru(e,r,n);let i=Ho(new ks(e,n));return r.push([t,i.root]),ru(e,r,n)};u();u();u();var nu=class extends Dt{constructor(t){let r={$:t,raw:t.fn};super((...n)=>{let i=n.indexOf(":"),s=i===-1?n.length-1:i-1,o=n.slice(0,s+1),a=t.parse(o).assertHasKind("intersection"),c=t.intrinsic.unknown;if(i!==-1){if(i!==n.length-2)return L(s$);c=t.parse(n[i+1])}return l=>new $f(l,a,c)},{attach:r})}},$f=class extends Dt{raw;params;returns;expression;constructor(t,r,n){let i=`typed ${t.name}`,s={[i]:(...a)=>{let c=r.assert(a),l=t(...c);return n.assert(l)}}[i];super(s),this.raw=t,this.params=r,this.returns=n;let o=r.expression;o[0]==="["&&o[o.length-1]==="]"?o=o.slice(1,-1):o.endsWith("[]")&&(o=`...${o}`),this.expression=`(${o}) => ${n?.expression??"unknown"}`}},s$=`":" must be followed by exactly one return type e.g:
356
+ fn("string", ":", "number")(s => s.length)`;u();var iu=class extends Dt{$;constructor(t){super((...r)=>new Ds(t)(...r),{bind:t}),this.$=t}in(t){return new Ds(this.$,t===void 0?void 0:this.$.parse(t))}at(t,r){return new Ds(this.$).at(t,r)}case(t,r){return new Ds(this.$).case(t,r)}},Ds=class extends Dt{$;in;key;branches=[];constructor(t,r){super(n=>this.caseEntries(Object.entries(n).map(([i,s])=>i==="default"?[i,s]:[this.$.parse(i),s]))),this.$=t,this.in=r}at(t,r){return this.key&&L(a$),this.branches.length&&L(o$),this.key=t,r?this.match(r):this}case(t,r){return this.caseEntry(this.$.parse(t),r)}caseEntry(t,r){let i=(this.key?this.$.parse({[this.key]:t}):t).pipe(r);return this.branches.push(i),this}match(t){return this(t)}strings(t){return this.caseEntries(Object.entries(t).map(([r,n])=>r==="default"?[r,n]:[this.$.node("unit",{unit:r}),n]))}caseEntries(t){for(let r=0;r<t.length;r++){let[n,i]=t[r];if(n==="default")return r!==t.length-1&&L("default may only be specified as the last key of a switch definition"),this.default(i);if(typeof i!="function")return L(`Value for case "${n}" must be a function (was ${gt(i)})`);this.caseEntry(n,i)}return this}default(t){typeof t=="function"&&this.case(ae.unknown,t);let r={branches:this.branches,ordered:!0};(t==="never"||t==="assert")&&(r.meta={onFail:Ax});let n=this.$.node("union",r);if(!this.in)return this.$.finalize(n);let i=this.in.pipe(n);return(t==="never"||t==="assert")&&(i=i.configureReferences({onFail:Ax},"self")),this.$.finalize(i)}},Ax=e=>e.throw(),o$="A key matcher must be specified before the first case i.e. match.at('foo') or match.in<object>().at('bar')",a$="At most one key matcher may be specified per expression";u();u();u();var su=(e,t)=>{if(He(e)){if(e[1]==="=")return[t.$.parseOwnDefinitionFormat(e[0],t),"=",e[2]];if(e[1]==="?")return[t.$.parseOwnDefinitionFormat(e[0],t),"?"]}return ou(e,t)},Nx="Only required keys may make their values optional, e.g. { [mySymbol]: ['number', '?'] }",Ix="Only required keys may specify default values, e.g. { value: 'number = 0' }";var Rx=(e,t)=>{let r,n={},i=Ti(e);for(let[o,a]of i){let c=l$(o);if(c.kind==="spread"){if(!tn(n))return L(u$);let m=t.$.parseOwnDefinitionFormat(a,t);if(m.equals(ae.object))continue;if(!m.hasKind("intersection")||!m.basis?.equals(ae.object))return L(p$(m.expression));r=m.structure;continue}if(c.kind==="undeclared"){a!=="reject"&&a!=="delete"&&a!=="ignore"&&L(c$(a)),n.undeclared=a;continue}let l=su(a,t),p=c;if(c.kind==="required"){He(l)?Pf(n,"optional",l[1]==="="?{key:c.normalized,value:l[0],default:l[2]}:{key:c.normalized,value:l[0]},t):Pf(n,"required",{key:c.normalized,value:l},t);continue}if(He(l)&&(l[1]==="?"&&L(Nx),l[1]==="="&&L(Ix)),c.kind==="optional"){Pf(n,"optional",{key:c.normalized,value:l},t);continue}let d=t.$.parseOwnDefinitionFormat(p.normalized,t),f=Hc(d,l,t.$);f.index&&(n.index=Ne(n.index,f.index)),f.required&&(n.required=Ne(n.required,f.required))}let s=t.$.node("structure",n);return t.$.parseSchema({domain:"object",structure:r?.merge(s)??s})},Pf=(e,t,r,n)=>{e[t]=Ne(e[t],n.$.node(t,r))},c$=e=>`Value of '+' key must be 'reject', 'delete', or 'ignore' (was ${ye(e)})`,u$="Spread operator may only be used as the first key in an object",l$=e=>typeof e=="symbol"?{kind:"required",normalized:e}:e[e.length-1]==="?"?e[e.length-2]===xi?{kind:"required",normalized:`${e.slice(0,-2)}?`}:{kind:"optional",normalized:e.slice(0,-1)}:e[0]==="["&&e[e.length-1]==="]"?{kind:"index",normalized:e.slice(1,-1)}:e[0]===xi&&e[1]==="["&&e[e.length-1]==="]"?{kind:"required",normalized:e.slice(1)}:e==="..."?{kind:"spread"}:e==="+"?{kind:"undeclared"}:{kind:"required",normalized:e==="\\..."?"...":e==="\\+"?"+":e},p$=e=>`Spread operand must resolve to an object literal type (was ${e})`;u();var Lx=(e,t)=>E$(e)?Px[e[0]](e,t):v$(e)?$x[e[1]](e,t):null,d$=(e,t)=>t.$.parseOwnDefinitionFormat(e[1],t).keyof(),jf=(e,t)=>{if(e[2]===void 0)return L(Rf(e[1],""));let r=t.$.parseOwnDefinitionFormat(e[0],t),n=t.$.parseOwnDefinitionFormat(e[2],t);if(e[1]==="|")return t.$.node("union",{branches:[r,n]});let i=e[1]==="&"?zt(r,n,t.$):Do(r,n,t.$);return i instanceof X?i.throw():i},f$=(e,t)=>t.$.parseOwnDefinitionFormat(e[0],t).array(),h$=(e,t)=>typeof e[2]!="function"?L(kx("=>",e[2])):t.$.parseOwnDefinitionFormat(e[0],t).pipe(e[2]),kx=(e,t)=>`${e===":"?"Narrow":"Morph"} expression requires a function following '${e}' (was ${typeof t})`,m$=(e,t)=>typeof e[2]!="function"?L(kx(":",e[2])):t.$.parseOwnDefinitionFormat(e[0],t).constrain("predicate",e[2]),g$=(e,t)=>t.$.parseOwnDefinitionFormat(e[0],t).configure(e[2],e[3]),Dx=e=>e,y$=Dx({"[]":f$,"?":()=>L(Yc)}),b$=Dx({"|":jf,"&":jf,":":m$,"=>":h$,"|>":jf,"@":g$,"=":()=>L(Xc)}),$x={...y$,...b$},v$=e=>$x[e[1]]!==void 0,T$=e=>e,Px=T$({keyof:d$,instanceof:(e,t)=>{if(typeof e[1]!="function")return L(Cx(Oo(e[1])));let r=e.slice(1).map(n=>typeof n=="function"?t.$.node("proto",{proto:n}):L(Cx(Oo(n))));return r.length===1?r[0]:t.$.node("union",{branches:r})},"===":(e,t)=>t.$.units(e.slice(1))}),E$=e=>Px[e[0]]!==void 0,Cx=e=>`Expected a constructor following 'instanceof' operator (was ${e})`;u();var Fx=(e,t)=>{let r=[{}],n=0;for(;n<e.length;){let i=!1;e[n]==="..."&&n<e.length-1&&(i=!0,n++);let s=su(e[n],t),[o,a,c]=He(s)?s:[s];if(n++,i){if(!o.extends(M.intrinsic.Array))return L(S$(o.expression));r=r.flatMap(l=>o.distribute(p=>w$($c(l),p)))}else r=r.map(l=>a==="?"?Mx(l,o):a==="="?x$(l,o,c):qf(l,o))}return t.$.parseSchema(r.map(i=>tn(i)?{proto:Array,exactLength:0}:{proto:Array,sequence:i}))},qf=(e,t)=>e.defaultables||e.optionals?L(e.variadic?yf:O$):(e.variadic?e.postfix=Ne(e.postfix,t):e.prefix=Ne(e.prefix,t),e),Mx=(e,t)=>e.variadic?L(Ux):(e.optionals=Ne(e.optionals,t),e),x$=(e,t,r)=>e.variadic?L(Ux):e.optionals?L(_$):(e.defaultables=Ne(e.defaultables,[[t,r]]),e),jx=(e,t)=>(e.postfix&&L(qx),e.variadic?e.variadic.equals(t)||L(qx):e.variadic=t.internal,e),w$=(e,t)=>{let r=t.select({method:"find",kind:"sequence"});if(!r)return jx(e,M.intrinsic.unknown);if(r.prefix)for(let n of r.prefix)qf(e,n);if(r.optionals)for(let n of r.optionals)Mx(e,n);if(r.variadic&&jx(e,r.variadic),r.postfix)for(let n of r.postfix)qf(e,n);return e},S$=e=>`Spread element must be an array (was ${e})`,qx="A tuple may have at most one variadic element",O$="A required element may not follow an optional element",Ux="An optional element may not follow a variadic element";var _$="A defaultable element may not follow an optional element without a default";var A$={},ou=(e,t)=>{if(typeof e=="string"){if(t.args&&Object.keys(t.args).some(n=>e.includes(n)))return Df(e,t);let r=A$[t.$.name]??={};return r[e]??=Df(e,t)}return Vt(e,"object")?N$(e,t):L(Ff(gt(e)))},N$=(e,t)=>{let r=So(e);switch(r){case void 0:return re(e,"root")?e:"~standard"in e?I$(e,t):Rx(e,t);case"Array":return R$(e,t);case"RegExp":return t.$.node("intersection",{domain:"string",pattern:e},{prereduced:!0});case"Function":{let n=Un(e)?e():e;return re(n,"root")?n:L(Ff("Function"))}default:return L(Ff(r??ye(e)))}},I$=(e,t)=>t.$.intrinsic.unknown.pipe((r,n)=>{let i=e["~standard"].validate(r);if(!i.issues)return i.value;for(let{message:s,path:o}of i.issues)o?o.length?n.error({problem:JT(s),relativePath:o.map(a=>typeof a=="object"?a.key:a)}):n.error({message:s}):n.error({message:s})}),R$=(e,t)=>Lx(e,t)??Fx(e,t),Ff=e=>`Type definitions must be strings or objects (was ${e})`;u();var au=class extends Dt{constructor(t){let r=Object.assign({errors:Ht,hkt:_t,$:t,raw:t.parse,module:t.constructor.module,scope:t.constructor.scope,declare:t.declare,define:t.define,match:t.match,generic:t.generic,schema:t.schema,keywords:t.ambient,unit:t.unit,enumerated:t.enumerated,instanceOf:t.instanceOf,valueOf:t.valueOf,or:t.or,and:t.and,merge:t.merge,pipe:t.pipe,fn:t.fn},t.ambientAttachments);super((...n)=>{if(n.length===1)return t.parse(n[0]);if(n.length===2&&typeof n[0]=="string"&&n[0][0]==="<"&&n[0][n[0].length-1]===">"){let i=n[0].slice(1,-1),s=t.parseGenericParams(i,{});return new _n(s,n[1],t,t,null)}return t.parse(n)},{attach:r})}};var $s=M,cu=class e extends Ko{get ambientAttachments(){if($s.typeAttachments)return this.cacheGetter("ambientAttachments",ge($s.typeAttachments,(t,r)=>[t,this.bindReference(r)]))}preparseOwnAliasEntry(t,r){let n=t.indexOf("<");if(n===-1){if(re(r,"module")||re(r,"generic"))return[t,r];let o=this.name==="ark"?t:t==="root"?this.name:`${this.name}.${t}`,a=this.resolvedConfig.keywords?.[o];return a&&(r=[r,"@",a]),[t,r]}t[t.length-1]!==">"&&L("'>' must be the last character of a generic declaration in a scope");let i=t.slice(0,n),s=t.slice(n+1,-1);return[i,()=>{let o=this.parseGenericParams(s,{alias:i});return wE(o,r,this)}]}parseGenericParams(t,r){return ru(new gs(t),[],this.createParseContext({...r,def:t,prefix:"generic"}))}normalizeRootScopeValue(t){return Un(t)&&!re(t,"generic")?t():t}preparseOwnDefinitionFormat(t,r){return{...r,def:t,prefix:r.alias??"type"}}parseOwnDefinitionFormat(t,r){!(r.alias&&r.alias in this.aliases)&&!r.args&&(r.args={this:r.id});let i=ou(t,r);if(He(i)){if(i[1]==="=")return L(Xc);if(i[1]==="?")return L(Yc)}return i}unit=t=>this.units([t]);valueOf=t=>this.units(BT(t));enumerated=(...t)=>this.units(t);instanceOf=t=>this.node("proto",{proto:t},{prereduced:!0});or=(...t)=>this.schema(t.map(r=>this.parse(r)));and=(...t)=>t.reduce((r,n)=>r.and(this.parse(n)),this.intrinsic.unknown);merge=(...t)=>t.reduce((r,n)=>r.merge(this.parse(n)),this.intrinsic.object);pipe=(...t)=>this.intrinsic.unknown.pipe(...t);fn=new nu(this);match=new iu(this);declare=()=>({type:this.type});define(t){return t}type=new au(this);static scope=((t,r={})=>new e(t,r));static module=((t,r={})=>this.scope(t,r).export())},Mf=Object.assign(cu.scope,{define:e=>e}),Ae=cu;u();var Uf=class extends _t{description='merge an object\'s properties onto another like `Merge(User, { isAdmin: "true" })`'},C$=vr(["base",ae.object],["props",ae.object])(e=>e.base.merge(e.props),Uf),Bx=Ae.module({Key:ae.key,Merge:C$});u();u();var Bf=class extends _t{},L$=vr("element")(e=>{let t=e.element.exclude(ae.Array),r=t.array();return t.rawOr(r).pipe(Mn).distribute(n=>n.assertHasKind("morph").declareOut(r),qe)},Bf),Vx=Ae.module({root:ae.Array,readonly:"root",index:ae.nonNegativeIntegerString,liftFrom:L$},{name:"Array"});u();var Vf=qe(["string",wi.FileConstructor]),k$=Vf.rawOr(Vf.array()),Kx=qe({meta:"an object representing parsed form data",domain:"object",index:{signature:"string",value:k$}}),Gx=Ae.module({root:["instanceof",FormData],value:Vf,parsed:Kx,parse:qe({in:FormData,morphs:e=>{let t={};for(let[r,n]of e)if(r in t){let i=t[r];typeof i=="string"||i instanceof wi.FileConstructor?t[r]=[i,n]:i.push(n)}else t[r]=n;return t},declaredOut:Kx})},{name:"FormData"});u();var Hx=Ae.module({Int8:["instanceof",Int8Array],Uint8:["instanceof",Uint8Array],Uint8Clamped:["instanceof",Uint8ClampedArray],Int16:["instanceof",Int16Array],Uint16:["instanceof",Uint16Array],Int32:["instanceof",Int32Array],Uint32:["instanceof",Uint32Array],Float32:["instanceof",Float32Array],Float64:["instanceof",Float64Array],BigInt64:["instanceof",BigInt64Array],BigUint64:["instanceof",BigUint64Array]},{name:"TypedArray"});var D$={Boolean:1,Number:1,String:1},Qx=Ae.module({...ge({...cd,...ld},(e,t)=>e in D$?[]:[e,["instanceof",t]]),Array:Vx,TypedArray:Hx,FormData:Gx});u();var $$=qe({domain:{domain:"number",meta:"a number representing a Unix timestamp"},divisor:{rule:1,meta:"an integer representing a Unix timestamp"},min:{rule:-864e13,meta:"a Unix timestamp after -8640000000000000"},max:{rule:864e13,meta:"a Unix timestamp before 8640000000000000"},meta:"an integer representing a safe Unix timestamp"}),P$=qe({domain:"number",divisor:1}),uu=Ae.module({root:ae.number,integer:P$,epoch:$$,safe:qe({domain:{domain:"number",numberAllowsNaN:!1},min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER}),NaN:["===",Number.NaN],Infinity:["===",Number.POSITIVE_INFINITY],NegativeInfinity:["===",Number.NEGATIVE_INFINITY]},{name:"number"});u();var Xe=(e,t,r)=>{let n={domain:"string",pattern:{rule:e.source,flags:e.flags,meta:t}};return r&&(n.meta={format:r}),Cs("intersection",n)},zx=Xe(Ao,"a well-formed integer string"),ow=Ae.module({root:zx,parse:qe({in:zx,morphs:(e,t)=>{let r=Number.parseInt(e);return Number.isSafeInteger(r)?r:t.error("an integer in the range Number.MIN_SAFE_INTEGER to Number.MAX_SAFE_INTEGER")},declaredOut:ae.integer})},{name:"string.integer"}),j$=Xe(/^[\dA-Fa-f]+$/,"hex characters only"),q$=Ae.module({root:Xe(/^(?:[\d+/A-Za-z]{4})*(?:[\d+/A-Za-z]{2}==|[\d+/A-Za-z]{3}=)?$/,"base64-encoded"),url:Xe(/^(?:[\w-]{4})*(?:[\w-]{2}(?:==|%3D%3D)?|[\w-]{3}(?:=|%3D)?)?$/,"base64url-encoded")},{name:"string.base64"}),Wx=Xe(/^[A-Z].*$/,"capitalized"),F$=Ae.module({root:qe({in:"string",morphs:e=>e.charAt(0).toUpperCase()+e.slice(1),declaredOut:Wx}),preformatted:Wx},{name:"string.capitalize"}),M$=e=>{let t=e.replace(/[ -]+/g,""),r=0,n,i,s=!1;for(let o=t.length-1;o>=0;o--)n=t.substring(o,o+1),i=Number.parseInt(n,10),s?(i*=2,r+=i>=10?i%10+1:i):r+=i,s=!s;return!!(r%10===0&&t)},U$=/^(?:4\d{12}(?:\d{3,6})?|5[1-5]\d{14}|(222[1-9]|22[3-9]\d|2[3-6]\d{2}|27[01]\d|2720)\d{12}|6(?:011|5\d\d)\d{12,15}|3[47]\d{13}|3(?:0[0-5]|[68]\d)\d{11}|(?:2131|1800|35\d{3})\d{11}|6[27]\d{14}|^(81\d{14,17}))$/,B$=qe({domain:"string",pattern:{meta:"a credit card number",rule:U$.source},predicate:{meta:"a credit card number",predicate:M$}});var V$=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))(T((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([,.]\d+(?!:))?)?(\17[0-5]\d([,.]\d+)?)?([Zz]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;var K$=e=>!Number.isNaN(new Date(e).valueOf()),Jx=qe({domain:"string",predicate:{meta:"a parsable date",predicate:K$}}).assertHasKind("intersection"),Yx=ow.root.internal.narrow((e,t)=>{let r=Number.parseInt(e),n=uu.epoch(r);return n instanceof Ht?(t.errors.merge(n),!1):!0}).configure({description:"an integer string representing a safe Unix timestamp"},"self").assertHasKind("intersection"),G$=Ae.module({root:Yx,parse:qe({in:Yx,morphs:e=>new Date(e),declaredOut:ae.Date})},{name:"string.date.epoch"}),Xx=Xe(V$,"an ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ) date").internal.assertHasKind("intersection"),H$=Ae.module({root:Xx,parse:qe({in:Xx,morphs:e=>new Date(e),declaredOut:ae.Date})},{name:"string.date.iso"}),Q$=Ae.module({root:Jx,parse:qe({declaredIn:Jx,in:"string",morphs:(e,t)=>{let r=new Date(e);return Number.isNaN(r.valueOf())?t.error("a parsable date"):r},declaredOut:ae.Date}),iso:H$,epoch:G$},{name:"string.date"}),z$=Xe(/^[\w%+.-]+@[\d.A-Za-z-]+\.[A-Za-z]{2,}$/,"an email address","email"),Zx="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",Qn=`(${Zx}[.]){3}${Zx}`,W$=new RegExp(`^${Qn}$`),ht="(?:[0-9a-fA-F]{1,4})",J$=new RegExp(`^((?:${ht}:){7}(?:${ht}|:)|(?:${ht}:){6}(?:${Qn}|:${ht}|:)|(?:${ht}:){5}(?::${Qn}|(:${ht}){1,2}|:)|(?:${ht}:){4}(?:(:${ht}){0,1}:${Qn}|(:${ht}){1,3}|:)|(?:${ht}:){3}(?:(:${ht}){0,2}:${Qn}|(:${ht}){1,4}|:)|(?:${ht}:){2}(?:(:${ht}){0,3}:${Qn}|(:${ht}){1,5}|:)|(?:${ht}:){1}(?:(:${ht}){0,4}:${Qn}|(:${ht}){1,6}|:)|(?::((?::${ht}){0,5}:${Qn}|(?::${ht}){1,7}|:)))(%[0-9a-zA-Z.]{1,})?$`),Y$=Ae.module({root:["v4 | v6","@","an IP address"],v4:Xe(W$,"an IPv4 address","ipv4"),v6:Xe(J$,"an IPv6 address","ipv6")},{name:"string.ip"}),Ps="a JSON string",aw=e=>{if(!(e instanceof SyntaxError))throw e;return`must be ${Ps} (${e})`},X$=qe({meta:Ps,domain:"string",predicate:{meta:Ps,predicate:(e,t)=>{try{return JSON.parse(e),!0}catch(r){return t.reject({code:"predicate",expected:Ps,problem:aw(r)})}}}}),Z$=(e,t)=>{if(e.length===0)return t.error({code:"predicate",expected:Ps,actual:"empty"});try{return JSON.parse(e)}catch(r){return t.error({code:"predicate",expected:Ps,problem:aw(r)})}},eP=Ae.module({root:X$,parse:qe({meta:"safe JSON string parser",in:"string",morphs:Z$,declaredOut:ae.jsonObject})},{name:"string.json"}),ew=Xe(/^[a-z]*$/,"only lowercase letters"),tP=Ae.module({root:qe({in:"string",morphs:e=>e.toLowerCase(),declaredOut:ew}),preformatted:ew},{name:"string.lower"}),cw=["NFC","NFD","NFKC","NFKD"],Qo=ge(cw,(e,t)=>[t,qe({domain:"string",predicate:r=>r.normalize(t)===r,meta:`${t}-normalized unicode`})]),lu=ge(cw,(e,t)=>[t,qe({in:"string",morphs:r=>r.normalize(t),declaredOut:Qo[t]})]),rP=Ae.module({root:lu.NFC,preformatted:Qo.NFC},{name:"string.normalize.NFC"}),nP=Ae.module({root:lu.NFD,preformatted:Qo.NFD},{name:"string.normalize.NFD"}),iP=Ae.module({root:lu.NFKC,preformatted:Qo.NFKC},{name:"string.normalize.NFKC"}),sP=Ae.module({root:lu.NFKD,preformatted:Qo.NFKD},{name:"string.normalize.NFKD"}),oP=Ae.module({root:"NFC",NFC:rP,NFD:nP,NFKC:iP,NFKD:sP},{name:"string.normalize"}),tw=Xe(Lc,"a well-formed numeric string"),aP=Ae.module({root:tw,parse:qe({in:tw,morphs:e=>Number.parseFloat(e),declaredOut:ae.number})},{name:"string.numeric"}),rw="a regex pattern",cP=qe({domain:"string",predicate:{meta:rw,predicate:(e,t)=>{try{return new RegExp(e),!0}catch(r){return t.reject({code:"predicate",expected:rw,problem:String(r)})}}},meta:{format:"regex"}}),uP=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[A-Za-z-][\dA-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][\dA-Za-z-]*))*))?(?:\+([\dA-Za-z-]+(?:\.[\dA-Za-z-]+)*))?$/,lP=Xe(uP,"a semantic version (see https://semver.org/)"),nw=Xe(/^\S.*\S$|^\S?$/,"trimmed"),pP=Ae.module({root:qe({in:"string",morphs:e=>e.trim(),declaredOut:nw}),preformatted:nw},{name:"string.trim"}),iw=Xe(/^[A-Z]*$/,"only uppercase letters"),dP=Ae.module({root:qe({in:"string",morphs:e=>e.toUpperCase(),declaredOut:iw}),preformatted:iw},{name:"string.upper"}),fP=e=>URL.canParse(e),sw=qe({domain:"string",predicate:{meta:"a URL string",predicate:fP},meta:{format:"uri"}}),hP=Ae.module({root:sw,parse:qe({declaredIn:sw,in:"string",morphs:(e,t)=>{try{return new URL(e)}catch{return t.error("a URL string")}},declaredOut:qe(URL)})},{name:"string.url"}),mP=Ae.module({root:["versioned | nil | max","@",{description:"a UUID",format:"uuid"}],"#nil":"'00000000-0000-0000-0000-000000000000'","#max":"'ffffffff-ffff-ffff-ffff-ffffffffffff'","#versioned":/[\da-f]{8}-[\da-f]{4}-[1-8][\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}/i,v1:Xe(/^[\da-f]{8}-[\da-f]{4}-1[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv1"),v2:Xe(/^[\da-f]{8}-[\da-f]{4}-2[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv2"),v3:Xe(/^[\da-f]{8}-[\da-f]{4}-3[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv3"),v4:Xe(/^[\da-f]{8}-[\da-f]{4}-4[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv4"),v5:Xe(/^[\da-f]{8}-[\da-f]{4}-5[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv5"),v6:Xe(/^[\da-f]{8}-[\da-f]{4}-6[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv6"),v7:Xe(/^[\da-f]{8}-[\da-f]{4}-7[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv7"),v8:Xe(/^[\da-f]{8}-[\da-f]{4}-8[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv8")},{name:"string.uuid"}),uw=Ae.module({root:ae.string,alpha:Xe(/^[A-Za-z]*$/,"only letters"),alphanumeric:Xe(/^[\dA-Za-z]*$/,"only letters and digits 0-9"),hex:j$,base64:q$,capitalize:F$,creditCard:B$,date:Q$,digits:Xe(/^\d*$/,"only digits 0-9"),email:z$,integer:ow,ip:Y$,json:eP,lower:tP,normalize:oP,numeric:aP,regex:cP,semver:lP,trim:pP,upper:dP,url:hP,uuid:mP},{name:"string"});u();var lw=Ae.module({bigint:ae.bigint,boolean:ae.boolean,false:ae.false,never:ae.never,null:ae.null,number:ae.number,object:ae.object,string:ae.string,symbol:ae.symbol,true:ae.true,unknown:ae.unknown,undefined:ae.undefined}),pw=Ae.module({root:ae.unknown,any:ae.unknown},{name:"unknown"}),gP=Ae.module({root:ae.jsonObject,stringify:Cs("morph",{in:ae.jsonObject,morphs:e=>JSON.stringify(e),declaredOut:ae.string})},{name:"object.json"}),dw=Ae.module({root:ae.object,json:gP},{name:"object"}),Kf=class extends _t{description='instantiate an object from an index signature and corresponding value type like `Record("string", "number")`'},yP=vr(["K",ae.key],"V")(e=>({domain:"object",index:{signature:e.K,value:e.V}}),Kf),Gf=class extends _t{description='pick a set of properties from an object like `Pick(User, "name | age")`'},bP=vr(["T",ae.object],["K",ae.key])(e=>e.T.pick(e.K),Gf),Hf=class extends _t{description='omit a set of properties from an object like `Omit(User, "age")`'},vP=vr(["T",ae.object],["K",ae.key])(e=>e.T.omit(e.K),Hf),Qf=class extends _t{description="make all named properties of an object optional like `Partial(User)`"},TP=vr(["T",ae.object])(e=>e.T.partial(),Qf),zf=class extends _t{description="make all named properties of an object required like `Required(User)`"},EP=vr(["T",ae.object])(e=>e.T.required(),zf),Wf=class extends _t{description='exclude branches of a union like `Exclude("boolean", "true")`'},xP=vr("T","U")(e=>e.T.exclude(e.U),Wf),Jf=class extends _t{description='extract branches of a union like `Extract("0 | false | 1", "number")`'},wP=vr("T","U")(e=>e.T.extract(e.U),Jf),fw=Ae.module({Exclude:xP,Extract:wP,Omit:vP,Partial:TP,Pick:bP,Record:yP,Required:EP});var An=Mf({...lw,...fw,...Qx,...Bx,string:uw,number:uu,object:dw,unknown:pw},{prereducedAliases:!0,name:"ark"}),bt=An.export();Object.assign($s.ambient,bt);$s.typeAttachments={string:bt.string.root,number:bt.number.root,bigint:bt.bigint,boolean:bt.boolean,symbol:bt.symbol,undefined:bt.undefined,null:bt.null,object:bt.object.root,unknown:bt.unknown.root,false:bt.false,true:bt.true,never:bt.never,arrayIndex:bt.Array.index,Key:bt.Key,Record:bt.Record,Array:bt.Array.root,Date:bt.Date};var ce=Object.assign(An.type,$s.typeAttachments),SP=An.match,OP=An.fn,_P=An.generic,ase=An.schema,AP=An.define,NP=An.declare;u();var mw=ce("string").narrow((e,t)=>{try{new URL(t.root?.proxy_url.concat(e))}catch{return t.mustBe("valid endpoint")}return!0}),IP=ce({name:ce.string.atLeastLength(3),events:ce.string.array().atLeastLength(1),url:mw}),RP=ce({webhook:IP.array()}),CP=ce({name:ce.string.atLeastLength(3),url:mw}),hw=ce({name:ce.string.atLeastLength(3),version:ce.keywords.string.semver.optional()}),LP=ce({app:hw.array().optional(),feature:hw.array().optional()}),gw=ce({target:ce.string.atLeastLength(1)}),kP=ce({name:ce.string.atLeastLength(3),handle:ce.string.atLeastLength(3),source:ce.string.atLeastLength(1),targets:gw.array().atLeastLength(1)}),DP=ce({name:ce.string.atLeastLength(3),handle:ce.string.atLeastLength(3),source:ce.string.atLeastLength(1),targets:gw.array().atLeastLength(1)}),$P=ce({source:ce.string.atLeastLength(1)}),PP=ce({embed:kP.array().optional(),checkout:DP.array().optional(),blocks:$P.optional()});function yw(e={}){let t=on(e);if(typeof t!="object"||"problems"in t)return[];let r=t,n=[];if(r.extensions?.embed)for(let i of r.extensions.embed){if(!i.name||!i.handle||!i.source)throw new Error("Invalid embed extension config: missing required fields (name, handle, source)");n.push({type:"embed",name:i.name,handle:i.handle,source:i.source,targets:i.targets})}if(r.extensions?.checkout)for(let i of r.extensions.checkout){if(!i.name||!i.handle||!i.source)throw new Error("Invalid checkout extension config: missing required fields (name, handle, source)");n.push({type:"checkout",name:i.name,handle:i.handle,source:i.source,targets:i.targets})}if(r.extensions?.blocks){let i=r.extensions.blocks;if(!i.source)throw new Error("Invalid blocks extension config: missing required 'source' field");n.push({type:"blocks",name:"Blocks",handle:"blocks",source:i.source})}return n}var Yf=ce({name:"/^[a-z0-9-]{3,255}$/",client_id:ce.keywords.string.uuid.v4,description:ce.string.optional(),version:ce.keywords.string.semver,url:ce.keywords.string.url.root,proxy_url:ce.keywords.string.url.root,authorization_scopes:ce.string.array().moreThanLength(0),subscriptions:RP.optional(),actions:CP.array().optional(),dependencies:LP.array().optional(),extensions:PP.optional()});function zn(e,t){if(t)return zo(process.cwd(),t);let r=e?`godaddy.${e}.toml`:"godaddy.toml";return zo(process.cwd(),r)}function on({configPath:e,env:t}={}){if(e){let i=zo(process.cwd(),e);if(wt.existsSync(i)){let s=wt.readFileSync(i,"utf-8");return Yf(_i.parse(s))}throw new Error(`Config file not found at ${i}`)}if(t){let i=zn(t);if(wt.existsSync(i)){let s=wt.readFileSync(i,"utf-8");return Yf(_i.parse(s))}t!=="prod"&&console.warn(`No environment-specific config found for ${t}, falling back to default`)}let r=zn();if(wt.existsSync(r)){let i=wt.readFileSync(r,"utf-8");return Yf(_i.parse(i))}let n=t&&t!=="prod"?" Consider running 'godaddy application init' to create environment-specific configs.":"";throw new Error(`Config file not found at ${r}.${n}`)}async function Wo(e,t){let r=zn(t),n=r,i={};try{if(wt.existsSync(n)){let l=wt.readFileSync(n,"utf-8");i=_i.parse(l)}}catch{console.log(`Creating new config file: ${r}`)}let s=e.actions?.map(l=>typeof l=="string"?{name:l,url:""}:l),o={...Object.fromEntries(Object.entries(i).filter(([l])=>!["name","client_id","description","version","url","proxy_url","authorization_scopes","actions","subscriptions","default"].includes(l))),name:e.name,client_id:e.client_id,description:e.description||"",version:e.version,url:e.url,proxy_url:e.proxy_url,authorization_scopes:e.authorization_scopes||[],actions:s,subscriptions:e.subscriptions};"default"in i&&(o.default=i.default),e.dependencies&&(o.dependencies=e.dependencies),e.extensions&&(o.extensions=e.extensions);let a=Object.entries(o).reduce((l,[p,d])=>(d!==void 0&&(l[p]=d),l),{}),c=_i.stringify(a);wt.writeFileSync(r,c),console.log(`Config file updated: ${r}`)}function Xf(e,t){if(e){let n=zo(process.cwd(),e);if(wt.existsSync(n))return{path:n};throw new Error(`Config file not found at ${n}`)}if(t){let n=zn(t);if(wt.existsSync(n))return{path:n,env:t}}let r=zn();return wt.existsSync(r)?{path:r}:t?{path:zn(t),env:t}:{path:r}}async function bw(e,t={}){try{let r=on(t);if(typeof r=="object"&&"problems"in r)throw new Error("Config file validation failed");let n={...r,actions:[...r.actions||[],e]},{env:i}=Xf(t.configPath,t.env);return await Wo(n,i),{success:!0,data:void 0}}catch(r){return{success:!1,error:r}}}async function vw(e,t={}){try{let r=on(t);if(typeof r=="object"&&"problems"in r)throw new Error("Config file validation failed");let n={...r,subscriptions:{webhook:[...r.subscriptions?.webhook||[],e]}},{env:i}=Xf(t.configPath,t.env);return await Wo(n,i),{success:!0,data:void 0}}catch(r){return{success:!1,error:r}}}async function Tw({secret:e,publicKey:t,clientId:r,clientSecret:n},i){let s=i?`.env.${i}`:".env",o=zo(process.cwd(),s),a="";try{if(wt.existsSync(o)){let l=wt.readFileSync(o,"utf-8").split(`
357
+ `),p={};for(let d of l)if(d.trim()&&!d.startsWith("#")){let[f,...m]=d.split("=");f&&(p[f.trim()]=m.join("=").trim())}p.GODADDY_WEBHOOK_SECRET=e,p.GODADDY_PUBLIC_KEY=t,p.GODADDY_CLIENT_ID=r,p.GODADDY_CLIENT_SECRET=n,a=Object.entries(p).map(([d,f])=>`${d}=${f}`).join(`
358
+ `);for(let d of l)d.trim()&&(d.startsWith("#")||!d.includes("="))&&(a+=`
359
+ ${d}`)}else a=`GODADDY_WEBHOOK_SECRET=${e}
360
+ GODADDY_PUBLIC_KEY=${t}
361
+ GODADDY_CLIENT_ID=${r}
362
+ GODADDY_CLIENT_SECRET=${n}`}catch{a=`GODADDY_WEBHOOK_SECRET=${e}
363
+ GODADDY_PUBLIC_KEY=${t}
364
+ GODADDY_CLIENT_ID=${r}
365
+ GODADDY_CLIENT_SECRET=${n}`}wt.writeFileSync(o,a),console.log(`Environment file updated: ${s}`)}async function pu(e,t,r={}){try{let n=on(r);if(typeof n=="object"&&"problems"in n)throw new Error("Config file validation failed");let i=n.extensions||{},s;e==="blocks"?s={...i,blocks:t}:s={...i,[e]:[...i[e]||[],t]};let o={...n,extensions:s},{env:a}=Xf(r.configPath,r.env);return await Wo(o,a),{success:!0,data:void 0}}catch(n){return{success:!1,error:n}}}var FP=".gdenv",Zf=qP(jP(),FP),du=["ote","prod"];async function Ew(){try{let e=await eh();return{success:!0,data:[e,...du.filter(r=>r!==e)]}}catch(e){return{success:!1,error:new mr(`Failed to get environment list: ${e}`,"Could not retrieve environment list")}}}async function an(e){try{return e?{success:!0,data:qs(e)}:{success:!0,data:await eh()}}catch(t){return{success:!1,error:t instanceof Ue?t:new mr(`Failed to get environment: ${t}`,"Could not retrieve environment information")}}}async function xw(e){try{let t=qs(e);return js.writeFileSync(Zf,t),{success:!0}}catch(t){return{success:!1,error:t instanceof Ue?t:new mr(`Failed to set environment: ${t}`,"Could not set active environment")}}}async function ww(e){try{let t=e?qs(e):await eh(),r=Jo(t),n=zn(t),i;try{i=on({env:t})}catch{}return{success:!0,data:{environment:t,display:r,configFile:n,config:i}}}catch(t){return{success:!1,error:t instanceof Ue?t:new mr(`Failed to get environment info: ${t}`,"Could not retrieve environment information")}}}async function eh(){try{if(js.existsSync(Zf)){let t=js.readFileSync(Zf,"utf-8").trim();return qs(t)}return"ote"}catch{return"ote"}}function qs(e){let t=e.toLowerCase().trim();if(du.includes(t))return t;throw new Ue(`Invalid environment: ${e}. Must be one of: ${du.join(", ")}`,`Invalid environment: ${e}. Must be one of: ${du.join(", ")}`)}function Jo(e){let t={ote:{color:"blue",label:"OTE"},prod:{color:"red",label:"PROD"}};return t[e]||t.ote}function Ai(e){return process.env.GODADDY_API_BASE_URL?process.env.GODADDY_API_BASE_URL:e==="prod"?"https://api.godaddy.com":"https://api.ote-godaddy.com"}function Sw(e){return process.env.GODADDY_OAUTH_CLIENT_ID?process.env.GODADDY_OAUTH_CLIENT_ID:{ote:"a502484b-d7b1-4509-aa88-08b391a54c28",prod:"39489dee-4103-4284-9aab-9f2452142bce"}[e]}function th(){let e=new sr("env").description("Manage GoDaddy environments (ote, prod)");return e.command("list").description("List all available environments").option("-o, --output <format>","Output format (json|text)","text").action(async t=>{let r=await Ew();r.success||(console.error(r.error?.userMessage||"Failed to list environments"),process.exit(1)),t.output==="json"?console.log(JSON.stringify(r.data,null,2)):(console.log("Available Environments:"),r.data?.forEach((n,i)=>{let s=Jo(n),o=i===0?"\u25CF ":"\u25CB ",a=i===0?" (active)":"";console.log(` ${o}${s.label}${a}`)})),process.exit(0)}),e.command("get").description("Get current active environment").option("-o, --output <format>","Output format (json|text)","text").action(async t=>{let r=await an();if(r.success||(console.error(r.error?.userMessage||"Failed to get environment"),process.exit(1)),t.output==="json")console.log(JSON.stringify({environment:r.data},null,2));else{let n=Jo(r.data);console.log(`Current active environment: ${n.label}`)}process.exit(0)}),e.command("set").description("Set active environment").argument("<environment>","Environment to set (ote|prod)").option("-o, --output <format>","Output format (json|text)","text").action(async(t,r)=>{let n=await xw(t);if(n.success||(console.error(n.error?.userMessage||"Failed to set environment"),process.exit(1)),r.output==="json")console.log(JSON.stringify({success:!0,environment:t},null,2));else{let i=Jo(t);console.log(`Environment successfully set to ${i.label}`)}process.exit(0)}),e.command("info").description("Show detailed information about an environment").argument("[environment]","Environment to show info for (defaults to current)").option("-o, --output <format>","Output format (json|text)","text").action(async(t,r)=>{let n=await ww(t);n.success||(console.error(n.error?.userMessage||"Failed to get environment info"),process.exit(1));let i=n.data;r.output==="json"?console.log(JSON.stringify(i,null,2)):(console.log(`Environment: ${i.display.label}`),i.config?(console.log(`
366
+ Configuration:`),console.log(` Name: ${i.config.name}`),console.log(` Client ID: ${i.config.client_id}`),console.log(` Version: ${i.config.version}`),console.log(` URL: ${i.config.url}`),console.log(` Proxy URL: ${i.config.proxy_url}`),console.log(` Auth Scopes: ${i.config.authorization_scopes.join(", ")}`),console.log(`
367
+ Config File: ${i.configFile}`)):(console.log(`
368
+ No configuration file found for this environment.`),console.log(`Create one with: godaddy env init ${i.environment}`))),process.exit(0)}),e}u();u();import dh from"node:crypto";import yj from"node:http";import{URL as Uw}from"node:url";import Ii from"keytar";u();import Pw from"node:process";import{Buffer as jw}from"node:buffer";import qw from"node:path";import{fileURLToPath as lj}from"node:url";import{promisify as pj}from"node:util";import Fw from"node:child_process";import dj,{constants as fj}from"node:fs/promises";u();import Nw from"node:process";import Iw,{constants as HP}from"node:fs/promises";u();import Aw from"node:process";import KP from"node:os";import GP from"node:fs";u();import BP from"node:fs";u();import Ow from"node:fs";var rh;function MP(){try{return Ow.statSync("/.dockerenv"),!0}catch{return!1}}function UP(){try{return Ow.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function nh(){return rh===void 0&&(rh=MP()||UP()),rh}var ih,VP=()=>{try{return BP.statSync("/run/.containerenv"),!0}catch{return!1}};function Fs(){return ih===void 0&&(ih=VP()||nh()),ih}var _w=()=>{if(Aw.platform!=="linux")return!1;if(KP.release().toLowerCase().includes("microsoft"))return!Fs();try{return GP.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Fs():!1}catch{return!1}},Wn=Aw.env.__IS_WSL_TEST__?_w:_w();var QP=(()=>{let e="/mnt/",t;return async function(){if(t)return t;let r="/etc/wsl.conf",n=!1;try{await Iw.access(r,HP.F_OK),n=!0}catch{}if(!n)return e;let i=await Iw.readFile(r,{encoding:"utf8"}),s=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(i);return s?(t=s.groups.mountPoint.trim(),t=t.endsWith("/")?t:`${t}/`,t):e}})(),zP=async()=>`${await QP()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`,sh=async()=>Wn?zP():`${Nw.env.SYSTEMROOT||Nw.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;u();function Jn(e,t,r){let n=i=>Object.defineProperty(e,t,{value:i,enumerable:!0,writable:!0});return Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){let i=r();return n(i),i},set(i){n(i)}}),e}u();import{promisify as oj}from"node:util";import uh from"node:process";import{execFile as aj}from"node:child_process";u();import{promisify as WP}from"node:util";import JP from"node:process";import{execFile as YP}from"node:child_process";var XP=WP(YP);async function oh(){if(JP.platform!=="darwin")throw new Error("macOS only");let{stdout:e}=await XP("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),r=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(e)?.groups.id??"com.apple.Safari";return r==="com.apple.safari"?"com.apple.Safari":r}u();u();import ZP from"node:process";import{promisify as ej}from"node:util";import{execFile as tj,execFileSync as goe}from"node:child_process";var rj=ej(tj);async function Rw(e,{humanReadableOutput:t=!0,signal:r}={}){if(ZP.platform!=="darwin")throw new Error("macOS only");let n=t?[]:["-ss"],i={};r&&(i.signal=r);let{stdout:s}=await rj("osascript",["-e",e,n],i);return s.trim()}async function ah(e){return Rw(`tell application "Finder" to set app_path to application file id "${e}" as string
369
+ tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}u();import{promisify as nj}from"node:util";import{execFile as ij}from"node:child_process";var sj=nj(ij),Cw={MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},MSEdgeBHTML:{name:"Edge Beta",id:"com.microsoft.edge.beta"},MSEdgeDHTML:{name:"Edge Dev",id:"com.microsoft.edge.dev"},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},ChromeBHTML:{name:"Chrome Beta",id:"com.google.chrome.beta"},ChromeDHTML:{name:"Chrome Dev",id:"com.google.chrome.dev"},ChromiumHTM:{name:"Chromium",id:"org.chromium.Chromium"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveDHTML:{name:"Brave Dev",id:"com.brave.Browser.dev"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},OperaStable:{name:"Opera",id:"com.operasoftware.Opera"},VivaldiHTM:{name:"Vivaldi",id:"com.vivaldi.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}},Soe=new Map(Object.entries(Cw)),fu=class extends Error{};async function ch(e=sj){let{stdout:t}=await e("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),r=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(t);if(!r)throw new fu(`Cannot find Windows browser in stdout: ${JSON.stringify(t)}`);let{id:n}=r.groups,i=Cw[n];if(!i)throw new fu(`Unknown browser ID: ${n}`);return i}var cj=oj(aj),uj=e=>e.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,t=>t.toUpperCase());async function lh(){if(uh.platform==="darwin"){let e=await oh();return{name:await ah(e),id:e}}if(uh.platform==="linux"){let{stdout:e}=await cj("xdg-mime",["query","default","x-scheme-handler/http"]),t=e.trim();return{name:uj(t.replace(/.desktop$/,"").replace("-"," ")),id:t}}if(uh.platform==="win32")return ch();throw new Error("Only macOS, Linux, and Windows are supported")}var hj=pj(Fw.execFile),ph=qw.dirname(lj(import.meta.url)),Lw=qw.join(ph,"xdg-open"),{platform:Ms,arch:kw}=Pw;async function mj(){let e=await sh(),t=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,r=jw.from(t,"utf16le").toString("base64"),{stdout:n}=await hj(e,["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand",r],{encoding:"utf8"}),i=n.trim(),s={ChromeHTML:"com.google.chrome",BraveHTML:"com.brave.Browser",MSEdgeHTM:"com.microsoft.edge",FirefoxURL:"org.mozilla.firefox"};return s[i]?{id:s[i]}:{}}var Dw=async(e,t)=>{let r;for(let n of e)try{return await t(n)}catch(i){r=i}throw r},hu=async e=>{if(e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e},Array.isArray(e.app))return Dw(e.app,a=>hu({...e,app:a}));let{name:t,arguments:r=[]}=e.app??{};if(r=[...r],Array.isArray(t))return Dw(t,a=>hu({...e,app:{name:a,arguments:r}}));if(t==="browser"||t==="browserPrivate"){let a={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.Browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge"},c={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},l=Wn?await mj():await lh();if(l.id in a){let p=a[l.id];return t==="browserPrivate"&&r.push(c[p]),hu({...e,app:{name:Ni[p],arguments:r}})}throw new Error(`${l.name} is not supported as a default browser`)}let n,i=[],s={};if(Ms==="darwin")n="open",e.wait&&i.push("--wait-apps"),e.background&&i.push("--background"),e.newInstance&&i.push("--new"),t&&i.push("-a",t);else if(Ms==="win32"||Wn&&!Fs()&&!t){n=await sh(),i.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),Wn||(s.windowsVerbatimArguments=!0);let a=["Start"];e.wait&&a.push("-Wait"),t?(a.push(`"\`"${t}\`""`),e.target&&r.push(e.target)):e.target&&a.push(`"${e.target}"`),r.length>0&&(r=r.map(c=>`"\`"${c}\`""`),a.push("-ArgumentList",r.join(","))),e.target=jw.from(a.join(" "),"utf16le").toString("base64")}else{if(t)n=t;else{let a=!ph||ph==="/",c=!1;try{await dj.access(Lw,fj.X_OK),c=!0}catch{}n=Pw.versions.electron??(Ms==="android"||a||!c)?"xdg-open":Lw}r.length>0&&i.push(...r),e.wait||(s.stdio="ignore",s.detached=!0)}Ms==="darwin"&&r.length>0&&i.push("--args",...r),e.target&&i.push(e.target);let o=Fw.spawn(n,i,s);return e.wait?new Promise((a,c)=>{o.once("error",c),o.once("close",l=>{if(!e.allowNonzeroExitCode&&l>0){c(new Error(`Exited with code ${l}`));return}a(o)})}):(o.unref(),o)},gj=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a `target`");return hu({...t,target:e})};function $w(e){if(typeof e=="string"||Array.isArray(e))return e;let{[kw]:t}=e;if(!t)throw new Error(`${kw} is not supported`);return t}function mu({[Ms]:e},{wsl:t}){if(t&&Wn)return $w(t);if(!e)throw new Error(`${Ms} is not supported`);return $w(e)}var Ni={};Jn(Ni,"chrome",()=>mu({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));Jn(Ni,"brave",()=>mu({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));Jn(Ni,"firefox",()=>mu({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));Jn(Ni,"edge",()=>mu({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));Jn(Ni,"browser",()=>"browser");Jn(Ni,"browserPrivate",()=>"browserPrivate");var Mw=gj;var Ri="godaddy-cli",bj=7443,vj="apps.app-registry:read apps.app-registry:write",jr=null;async function Bw(){try{let e=dh.randomUUID(),t=dh.randomBytes(32).toString("base64url"),r=dh.createHash("sha256").update(t).digest("base64url"),n=await Tj(),i=await Ej(),s=await xj();return{success:!0,data:await new Promise((a,c)=>{jr=yj.createServer(async(l,p)=>{if(!l.url||!l.headers.host){p.writeHead(400),p.end("Bad Request"),c(new Error("Missing request URL or host")),jr&&jr.close();return}let d=new Uw(l.url,`http://${l.headers.host}`),f=d.searchParams;if(d.pathname==="/callback"&&l.method==="GET"){let m=f.get("state"),h=f.get("code"),v=f.get("error");try{if(m!==e)throw new Error("State mismatch");if(v)throw new Error(`Authentication error: ${v}`);if(!h)throw new Error("No code received");let E=jr?.address()?.port;if(!E)throw new Error("Could not determine server port for token exchange");let A=await fetch(i,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:s,code:h,grant_type:"authorization_code",redirect_uri:`http://localhost:${E}/callback`,code_verifier:t})});if(!A.ok)throw new Error(`Token request failed: ${A.status}`);let w=await A.json(),_=new Date(Date.now()+w.expires_in*1e3);await wj("token",JSON.stringify({accessToken:w.access_token,expiresAt:_})),p.writeHead(200,{"Content-Type":"text/html"}),p.end("<html><body><h1>Authentication successful!</h1><p>You can close this window now.</p></body></html>"),a({success:!0,accessToken:w.access_token,expiresAt:_})}catch(E){let A=E instanceof Error?E.message:"An unknown error occurred";console.error("Authentication callback error:",A),p.writeHead(500,{"Content-Type":"text/html"}),p.end(`<html><body><h1>Authentication Failed</h1><p>${A}</p></body></html>`),c(E)}finally{jr&&jr.close()}}else p.writeHead(404),p.end()}),jr.on("error",l=>{console.error("Server startup error:",l),c(l)}),jr.listen(bj,()=>{let l=jr?.address()?.port;if(!l){let d=new Error("Server started but could not determine port.");console.error(d),jr&&jr.close(),c(d);return}let p=new Uw(n);p.searchParams.set("client_id",s),p.searchParams.set("response_type","code"),p.searchParams.set("redirect_uri",`http://localhost:${l}/callback`),p.searchParams.set("state",e),p.searchParams.set("scope",vj),p.searchParams.set("code_challenge",r),p.searchParams.set("code_challenge_method","S256"),Mw(p.toString())})})}}catch(e){return{success:!1,error:new It(`Authentication failed: ${e}`,"Authentication with GoDaddy failed. Please try again.")}}}async function Vw(){try{return await Ii.deletePassword(Ri,"token"),{success:!0}}catch(e){return{success:!1,error:new mr(`Logout failed: ${e}`,"Failed to clear stored credentials")}}}async function gu(){let e=await an();if(!e.success||!e.data)throw e.error??new Error("Failed to get environment");return e.data}async function Kw(){try{let e=await gu();if(!await cr("token"))return{success:!0,data:{authenticated:!1,hasToken:!1,environment:e}};try{let r=await Ii.getPassword(Ri,"token");if(!r)return{success:!0,data:{authenticated:!1,hasToken:!1,environment:e}};let{expiresAt:n}=JSON.parse(r),i=new Date(n);return i.getTime()<Date.now()?(await Ii.deletePassword(Ri,"token"),{success:!0,data:{authenticated:!1,hasToken:!1,environment:e}}):{success:!0,data:{authenticated:!0,hasToken:!0,tokenExpiry:i,environment:e}}}catch{return await Ii.deletePassword(Ri,"token"),{success:!0,data:{authenticated:!1,hasToken:!1,environment:e}}}}catch(e){return{success:!1,error:new mr(`Failed to check authentication status: ${e}`,"Could not determine authentication status")}}}async function Tj(){if(process.env.OAUTH_AUTH_URL)return process.env.OAUTH_AUTH_URL;let e=await gu();return`${Ai(e)}/v2/oauth2/authorize`}async function Ej(){if(process.env.OAUTH_TOKEN_URL)return process.env.OAUTH_TOKEN_URL;let e=await gu();return`${Ai(e)}/v2/oauth2/token`}async function xj(){if(process.env.GODADDY_OAUTH_CLIENT_ID)return process.env.GODADDY_OAUTH_CLIENT_ID;let e=await gu();return Sw(e)}function wj(e,t){return Ii.setPassword(Ri,e,t)}async function cr(e){let t=await Ii.getPassword(Ri,e);if(!t)return null;let{accessToken:r,expiresAt:n}=JSON.parse(t);return new Date(n).getTime()<Date.now()?(await Ii.deletePassword(Ri,e),null):r}function fh(){let e=new sr("auth").description("Manage authentication with GoDaddy Developer Platform");return e.command("login").description("Login to GoDaddy Developer Platform").option("-o, --output <format>","Output format (json|text)","text").action(async t=>{let r=await Bw();r.success||(console.error(r.error?.userMessage||"Authentication failed"),process.exit(1));let n=r.data;t.output==="json"?console.log(JSON.stringify({success:n.success,authenticated:!0,expiresAt:n.expiresAt?.toISOString()},null,2)):(console.log("\u2705 Successfully authenticated with GoDaddy Developer Platform!"),n.expiresAt&&console.log(`Token expires: ${n.expiresAt.toLocaleString()}`)),process.exit(0)}),e.command("logout").description("Logout and clear stored credentials").option("-o, --output <format>","Output format (json|text)","text").action(async t=>{let r=await Vw();r.success||(console.error(r.error?.userMessage||"Logout failed"),process.exit(1)),t.output==="json"?console.log(JSON.stringify({success:!0,authenticated:!1},null,2)):console.log("\u2705 Successfully logged out. Credentials cleared."),process.exit(0)}),e.command("status").description("Check authentication status").option("-o, --output <format>","Output format (json|text)","text").action(async t=>{let r=await Kw();r.success||(console.error(r.error?.userMessage||"Failed to check authentication status"),process.exit(1));let n=r.data;t.output==="json"?console.log(JSON.stringify({authenticated:n.authenticated,hasToken:n.hasToken,environment:n.environment,tokenExpiry:n.tokenExpiry?.toISOString()},null,2)):n.authenticated?(console.log("\u2705 You are authenticated with GoDaddy Developer Platform"),console.log(`Environment: ${n.environment.toUpperCase()}`),n.tokenExpiry&&console.log(`Token expires: ${n.tokenExpiry.toLocaleString()}`)):(console.log("\u274C You are not authenticated"),console.log(`Environment: ${n.environment.toUpperCase()}`),console.log("Run 'godaddy auth' to authenticate")),process.exit(0)}),e}u();var hh=["location.address.verify","commerce.taxes.calculate","commerce.shipping-rates.calculate","commerce.price-adjustment.apply","commerce.price-adjustment.list","notifications.email.send","commerce.payment.get","commerce.payment.cancel","commerce.payment.refund","commerce.payment.process","commerce.payment.auth"],Sj={"location.address.verify":{name:"location.address.verify",description:"Verify and standardize a physical address",requestSchema:{$id:"https://godaddy.com/schema/common/address.v1",$schema:"https://json-schema.org/draft/2020-12/schema",type:"object",title:"Postal Address (Medium-Grained)",description:"An internationalized postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) from Google's Address Data Service and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute).",properties:{addressLine1:{type:"string",description:"The first line of the address. For example, number and street name. For example, `3032 Bunker Hill Lane`. Required for compliance and risk checks. Must contain the full address.",maxLength:300},addressLine2:{type:"string",description:"The second line of the address. For example, office suite or apartment number.",maxLength:300},addressLine3:{type:"string",description:"The third line of the address, if needed. For example, a street complement for Brazil; direction text, such as `next to Opera House`; or a landmark reference in an Indian address.",maxLength:100},adminArea4:{description:"The neighborhood, ward, or district. Smaller than `adminArea3` or `subLocality`. For example, the postal sorting code that is used in Guernsey and many French territories, such as French Guiana; the fine-grained administrative levels in China.",type:"string",maxLength:100},adminArea3:{description:"A sub-locality, suburb, neighborhood, or district. Smaller than `adminArea2`. For example, in Brazil - Suburb, bairro, or neighborhood; in India - Sub-locality or district. Street name information may not always available and a sub-locality or district can reference a very small area.</li></ul>",type:"string",maxLength:100},adminArea2:{description:"A city, town, or village. Smaller than `adminArea1`.",type:"string",maxLength:300},adminArea1:{type:"string",description:"The highest level sub-division in a country, which is usually a province, state, or ISO-3166-2 subdivision; formatted for postal delivery. For example, `CA` and not `California`. For example, for UK - A county; for USs - A state; for Canada - A province; for Japan - A prefecture; for Switzerland - A kanton.",maxLength:300},postalCode:{type:"string",description:"The postal code, which is the zip code or equivalent. Typically required for countries that have a postal code or an equivalent. See [Postal code](https://en.wikipedia.org/wiki/Postal_code).",maxLength:60},countryCode:{$ref:"./country-code.json",description:"The [two-character ISO 3166-1 code](https://en.wikipedia.org/wiki/ISO_3166-1) that identifies the country or region. Note: The country code for Great Britain is `GB` and not `UK` as used in the top-level domain names for that country. Use country code `C2` for China for comparable uncontrolled price (CUP) method, bank-card, and cross-border transactions."},addressDetails:{type:"object",title:"Address Details",description:"The non-portable additional address details that are sometimes needed for compliance, risk, or other scenarios where fine-grain address information might be needed. Not portable with common third-party and open-source address libraries and redundant with core fields. For example, `address.addressLine1` is usually a combination of `addressDetails.streetNumber` and `streetName` and `streetType`.",properties:{streetNumber:{description:"The street number.",type:"string",maxLength:100},streetName:{description:"The street name. Just `Drury` in `Drury Lane`.",type:"string",maxLength:100},streetType:{description:"The street type. For example, avenue, boulevard, road, or expressway.",type:"string",maxLength:100},deliveryService:{description:"The delivery service. Post office box, bag number, or post office name.",type:"string",maxLength:100},buildingName:{description:"A named locations that represents the premise. Usually a building name or number or collection of buildings with a common name or number. For example, <code>Craven House</code>.",type:"string",maxLength:100},subBuilding:{description:"The first-order entity below a named building or location that represents the sub-premise. Usually a single building within a collection of buildings with a common name. Can be a flat, story, floor, room, or apartment.",type:"string",maxLength:100},addressType:{description:"The type of address. Single character representation of a type. For example: 'B' for building, 'F' for organization, 'G' for general delivery, 'H' for high-rise, 'L' for large-volume organization, 'P' for Post Office box or delivery service, 'R' for rural route, 'S' for street, 'U' for unidentified address.",type:"string",maxLength:1},geoCoordinates:{description:"The latitude and longitude of the address. For example, `37.42242` and `-122.08585`.",$ref:"./geo-coordinates.json"}}}},required:["countryCode"]},responseSchema:{$id:"https://godaddy.com/schema/common/address.v1",$schema:"https://json-schema.org/draft/2020-12/schema",type:"object",title:"Postal Address (Medium-Grained)",description:"An internationalized postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) from Google's Address Data Service and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute).",properties:{addressLine1:{type:"string",description:"The first line of the address. For example, number and street name. For example, `3032 Bunker Hill Lane`. Required for compliance and risk checks. Must contain the full address.",maxLength:300},addressLine2:{type:"string",description:"The second line of the address. For example, office suite or apartment number.",maxLength:300},addressLine3:{type:"string",description:"The third line of the address, if needed. For example, a street complement for Brazil; direction text, such as `next to Opera House`; or a landmark reference in an Indian address.",maxLength:100},adminArea4:{description:"The neighborhood, ward, or district. Smaller than `adminArea3` or `subLocality`. For example, the postal sorting code that is used in Guernsey and many French territories, such as French Guiana; the fine-grained administrative levels in China.",type:"string",maxLength:100},adminArea3:{description:"A sub-locality, suburb, neighborhood, or district. Smaller than `adminArea2`. For example, in Brazil - Suburb, bairro, or neighborhood; in India - Sub-locality or district. Street name information may not always available and a sub-locality or district can reference a very small area.</li></ul>",type:"string",maxLength:100},adminArea2:{description:"A city, town, or village. Smaller than `adminArea1`.",type:"string",maxLength:300},adminArea1:{type:"string",description:"The highest level sub-division in a country, which is usually a province, state, or ISO-3166-2 subdivision; formatted for postal delivery. For example, `CA` and not `California`. For example, for UK - A county; for USs - A state; for Canada - A province; for Japan - A prefecture; for Switzerland - A kanton.",maxLength:300},postalCode:{type:"string",description:"The postal code, which is the zip code or equivalent. Typically required for countries that have a postal code or an equivalent. See [Postal code](https://en.wikipedia.org/wiki/Postal_code).",maxLength:60},countryCode:{$ref:"./country-code.json",description:"The [two-character ISO 3166-1 code](https://en.wikipedia.org/wiki/ISO_3166-1) that identifies the country or region. Note: The country code for Great Britain is `GB` and not `UK` as used in the top-level domain names for that country. Use country code `C2` for China for comparable uncontrolled price (CUP) method, bank-card, and cross-border transactions."},addressDetails:{type:"object",title:"Address Details",description:"The non-portable additional address details that are sometimes needed for compliance, risk, or other scenarios where fine-grain address information might be needed. Not portable with common third-party and open-source address libraries and redundant with core fields. For example, `address.addressLine1` is usually a combination of `addressDetails.streetNumber` and `streetName` and `streetType`.",properties:{streetNumber:{description:"The street number.",type:"string",maxLength:100},streetName:{description:"The street name. Just `Drury` in `Drury Lane`.",type:"string",maxLength:100},streetType:{description:"The street type. For example, avenue, boulevard, road, or expressway.",type:"string",maxLength:100},deliveryService:{description:"The delivery service. Post office box, bag number, or post office name.",type:"string",maxLength:100},buildingName:{description:"A named locations that represents the premise. Usually a building name or number or collection of buildings with a common name or number. For example, <code>Craven House</code>.",type:"string",maxLength:100},subBuilding:{description:"The first-order entity below a named building or location that represents the sub-premise. Usually a single building within a collection of buildings with a common name. Can be a flat, story, floor, room, or apartment.",type:"string",maxLength:100},addressType:{description:"The type of address. Single character representation of a type. For example: 'B' for building, 'F' for organization, 'G' for general delivery, 'H' for high-rise, 'L' for large-volume organization, 'P' for Post Office box or delivery service, 'R' for rural route, 'S' for street, 'U' for unidentified address.",type:"string",maxLength:1},geoCoordinates:{description:"The latitude and longitude of the address. For example, `37.42242` and `-122.08585`.",$ref:"./geo-coordinates.json"}}}},required:["countryCode"]}},"commerce.taxes.calculate":{name:"commerce.taxes.calculate",description:"Calculate taxes for a purchase with multiple line items",requestSchema:{$schema:"https://json-schema.org/draft/2020-12/schema",title:"commerce.taxes.calculate:request",type:"object",properties:{destination:{$ref:"#/definitions/calculationLocationInput"},lines:{type:"array",items:{$ref:"#/definitions/calculationLineInput"},minItems:1},origin:{$ref:"#/definitions/calculationLocationInput"}},required:["lines"],definitions:{calculationLocationInput:{type:"object",properties:{address:{$ref:"#/definitions/calculationAddressInput"}}},calculationAddressInput:{type:"object",properties:{addressLine1:{type:"string",description:"The first line of the address. For example, number and street name."},addressLine2:{type:"string",description:"The second line of the address. For example, office suite or apartment number."},addressLine3:{type:"string",description:"The third line of the address, if needed."},adminArea1:{type:"string",description:"The highest level sub-division in a country, which is usually a province, state, or ISO-3166-2 subdivision; formatted for postal delivery."},adminArea2:{type:"string",description:"The city, town, or village. Smaller than `adminArea1`."},adminArea3:{type:"string",description:"The sub-locality, suburb, neighborhood, or district. Smaller than `adminArea2`."},adminArea4:{type:"string",description:"The neighborhood, ward, or district. Smaller than `adminArea3` or `subLocality`."},countryCode:{type:"string",description:"The [two-character ISO 3166-1 code](https://en.wikipedia.org/wiki/ISO_3166-1) that identifies the country or region."},postalCode:{type:"string",description:"The postal code, which is the zip code or equivalent."}}},calculationLineInput:{type:"object",properties:{classification:{type:"string",description:"The ID or code for the item's classification."},destination:{$ref:"#/definitions/calculationLocationInput",description:"The location to which the item is being sent. e.g. the customer's address. Overrides the top-level value if provided."},id:{type:"string",description:"The client-defined ID for the line. This could be a UUID of the SKU, or a shipping method/package name."},origin:{$ref:"#/definitions/calculationLocationInput",description:"The location from which the item is originating. Overrides the top-level value if provided."},quantity:{type:"number",description:"The number of units being purchased."},subtotalPrice:{$ref:"#/definitions/moneyInput",description:"The money amount for the total quantity being purchased."},type:{type:"string",enum:["FEE","SHIPPING","SKU"],description:"The type of the calculation line."},unitPrice:{$ref:"#/definitions/moneyInput",description:"The money amount for a single unit of the item being purchased."}},required:["id","subtotalPrice","type"]},moneyInput:{type:"object",properties:{currencyCode:{type:"string",description:"A three-character ISO-4217 currency code."},value:{type:"number",description:"The value, which might be: An integer for currencies like JPY that are not typically fractional; or, a decimal fraction for currencies like TND that are subdivided into thousandths."}},required:["currencyCode","value"]}}},responseSchema:{$schema:"https://json-schema.org/draft/2020-12/schema",title:"commerce.taxes.calculate:response",type:"object",properties:{lines:{type:"array",items:{$ref:"#/definitions/calculatedLine"},minItems:1},taxAmounts:{type:"array",items:{$ref:"#/definitions/taxAmount"},description:"The individual tax amounts for the rates that were applied to the purchase. A combined summary of all of the rates that applied across all of the lines."},totalTaxAmount:{$ref:"#/definitions/totalTaxAmount",description:"The total money amount of tax calculated for the purchase. A sum of each individual line tax amount."}},required:["lines","taxAmounts","totalTaxAmount"],definitions:{calculatedLine:{type:"object",properties:{calculationLine:{$ref:"#/definitions/calculationLine",description:"An individual line item that was calculated."},taxAmounts:{type:"array",items:{$ref:"#/definitions/taxAmount"},description:"The individual tax amounts for the rates that were applied to the line."},totalTaxAmount:{$ref:"#/definitions/totalTaxAmount",description:"The total money amount of tax calculated for the line."}},required:["calculationLine","taxAmounts","totalTaxAmount"]},calculationLine:{type:"object",properties:{id:{type:"string",description:"The client-defined ID for the line."}},required:["id"],description:"An individual line item that was used in the calculation, passed back unmodified from the request."},taxAmount:{type:"object",properties:{rate:{$ref:"#/definitions/calculatedRate"},totalTaxAmount:{$ref:"#/definitions/totalTaxAmount"}},required:["rate","totalTaxAmount"],description:"An individual tax amount calculated."},calculatedRate:{type:"object",properties:{calculationMethod:{type:"string",enum:["ADDITIVE","INCLUSIVE"],description:"The method that was used to apply the rate to a purchase amount."},id:{type:"string",description:"The globally-unique ID."},label:{type:"string",description:"The label for display."},name:{type:"string",description:"The unique human-friendly identifier."},value:{$ref:"#/definitions/calculatedRateValue",description:"The rate's value"}},required:["calculationMethod","value"],description:"The rate that was used for the calculated amount."},calculatedRateValue:{oneOf:[{$ref:"#/definitions/calculatedRateAmount"},{$ref:"#/definitions/calculatedRatePercentage"}]},calculatedRateAmount:{type:"object",properties:{amount:{$ref:"#/definitions/money"},appliedAmount:{$ref:"#/definitions/money"}},description:"The rate value represented as a fixed money amount."},calculatedRatePercentage:{type:"object",properties:{appliedPercentage:{type:"number",description:"The percentage applied by the rate, out of 100."},percentage:{type:"number",description:"The percentage value of the rate, out of 100."}},required:["appliedPercentage","percentage"],description:"The rate value represented as a percentage."},totalTaxAmount:{type:"object",properties:{currencyCode:{type:"string"},value:{type:"number"}},required:["currencyCode","value"],description:"The total tax amount calculated."},money:{type:"object",properties:{currencyCode:{type:"string",description:"A three-character ISO-4217 currency code."},value:{type:"number",description:"The value, which might be: An integer for currencies like JPY that are not typically fractional; or, a decimal fraction for currencies like TND that are subdivided into thousandths."}},required:["currencyCode","value"],description:"A money represents the monetary value and currency for a financial transaction."}}}},"commerce.shipping-rates.calculate":{name:"commerce.shipping-rates.calculate",description:"Calculate shipping rates for a shipment with multiple items",requestSchema:{$schema:"https://json-schema.org/draft/2020-12/schema",title:"commerce.shipping-rates.calculate:request",type:"object",properties:{origin:{$ref:"#/definitions/address"},destination:{$ref:"#/definitions/address"},items:{type:"array",description:"The items to ship",minItems:1,items:{$ref:"#/definitions/shipmentItem"}},packages:{type:"array",description:"Optionally supply the items pre-packaged for shipment.",items:{$ref:"#/definitions/dimensions"}},orderTotal:{$ref:"#/definitions/money",description:"The total order amount, excluding tax."}},required:["origin","destination","items"],additionalProperties:!1,definitions:{address:{type:"object",properties:{addressLine1:{type:"string",description:"The first line of the address. For example, number and street name."},addressLine2:{type:"string",description:"The second line of the address. For example, office suite or apartment number."},addressLine3:{type:"string",description:"The third line of the address, if needed."},adminArea1:{type:"string",description:"The highest level sub-division in a country, which is usually a province, state, or ISO-3166-2 subdivision; formatted for postal delivery."},adminArea2:{type:"string",description:"The city, town, or village. Smaller than `adminArea1`."},adminArea3:{type:"string",description:"The sub-locality, suburb, neighborhood, or district. Smaller than `adminArea2`."},adminArea4:{type:"string",description:"The neighborhood, ward, or district. Smaller than `adminArea3` or `subLocality`."},countryCode:{type:"string",description:"The [two-character ISO 3166-1 code](https://en.wikipedia.org/wiki/ISO_3166-1) that identifies the country or region."},postalCode:{type:"string",description:"The postal code, which is the zip code or equivalent."}},additionalProperties:!1},package:{type:"object",properties:{name:{type:"string"},maxWeight:{$ref:"#/definitions/weight",description:"Maximum weight of the package"},dimensions:{$ref:"#/definitions/dimensions",description:"Dimensions of the package"},items:{type:"array",description:"Items contained in the package",minItems:1,items:{type:"object",properties:{sku:{type:"string"},quantity:{type:"integer",description:"Quantity of the item in the package"}},required:["sku","quantity"],additionalProperties:!1}}},required:["name","maxWeight","dimensions","items"],additionalProperties:!1},dimensions:{type:"object",properties:{units:{type:"string",enum:["INCHES","CENTIMETERS"],description:"Units for package dimensions"},length:{type:"number",description:"Length of the package"},width:{type:"number",description:"Width of the package"},height:{type:"number",description:"Height of the package"},weight:{$ref:"#/definitions/weight"}},required:["units","length","width","height","weight"],additionalProperties:!1},weight:{type:"object",properties:{value:{type:"number",description:"Weight value"},units:{type:"string",enum:["OUNCES","POUNDS","GRAMS","KILOGRAMS"],description:"Units for weight measurement"}},required:["value","units"],additionalProperties:!1},shipmentItem:{type:"object",properties:{name:{type:"string"},sku:{type:"string"},quantity:{type:"integer"},price:{$ref:"#/definitions/money"},dimensions:{$ref:"#/definitions/dimensions"}},required:["id"],additionalProperties:!1},money:{type:"object",properties:{currencyCode:{type:"string",description:"Three-letter ISO currency code (e.g., USD, EUR, GBP)"},value:{type:"number",description:"The monetary amount"}},required:["currencyCode","value"],additionalProperties:!1}}},responseSchema:{$schema:"https://json-schema.org/draft/2020-12/schema",title:"commerce.shipping-rates.calculate:response",type:"object",properties:{rates:{type:"array",items:{$ref:"#/definitions/shippingRate"},description:"Available shipping rates that match the request criteria"}},required:["status","rates"],additionalProperties:!1,definitions:{shippingRate:{type:"object",properties:{carrierCode:{type:"string",description:"Code identifying the carrier (e.g., UPS, USPS, FedEx)"},serviceCode:{type:"string",description:"Code identifying the specific service offered by the carrier"},displayName:{type:"string",description:"Human-readable name of the shipping service"},description:{type:"string",description:"Additional details about the shipping service, such as estimated delivery timeframe"},minDeliveryDate:{type:"string",format:"date-time",description:"Earliest estimated delivery date and time"},maxDeliveryDate:{type:"string",format:"date-time",description:"Latest estimated delivery date and time"},cost:{$ref:"#/definitions/money",description:"The cost of the shipping service"},features:{type:"array",items:{type:"string"},description:"List of features included with this shipping rate (e.g., tracking, insurance)"}},required:["carrierCode","serviceCode","displayName","cost"],additionalProperties:!1},money:{type:"object",properties:{currency:{type:"string",description:"Three-letter ISO currency code (e.g., USD, EUR, GBP)"},amount:{type:"number",description:"The monetary amount"}},required:["currency","amount"],additionalProperties:!1}}}},"commerce.price-adjustment.apply":{name:"commerce.price-adjustment.apply",description:"Apply price adjustments (discounts and fees) to line items",requestSchema:{$schema:"https://json-schema.org/draft/2020-12/schema",title:"commerce.price-adjustment.apply:request",type:"object",properties:{lines:{type:"array",items:{$ref:"#/definitions/calculationLineInput"},minItems:1},discountCodes:{type:"array",items:{type:"string"}}},required:["lines"],definitions:{calculationLineInput:{type:"object",properties:{id:{type:"string",description:"The client-defined ID for the line. This could be a UUID of the SKU, or a shipping method/package name. The value will be passed back unmodified in the calculation response."},quantity:{type:"number",description:"The number of units being purchased."},subtotalPrice:{$ref:"#/definitions/moneyInput",description:"The money amount for the total quantity being purchased."},type:{type:"string",enum:["SHIPPING","SKU"],description:"The type of the calculation line."}},required:["id","subtotalPrice","type","quantity"]},moneyInput:{type:"object",properties:{currencyCode:{type:"string",description:"A three-character ISO-4217 currency code."},value:{type:"number",description:"The value, which might be: An integer for currencies like JPY that are not typically fractional; or, a decimal fraction for currencies like TND that are subdivided into thousandths."}},required:["currencyCode","value"]}}},responseSchema:{$schema:"https://json-schema.org/draft/2020-12/schema",title:"commerce.price-adjustment.apply:response",type:"object",properties:{lines:{type:"array",items:{$ref:"#/definitions/calculatedLine"},minItems:1},adjustmentAmounts:{type:"array",items:{$ref:"#/definitions/calculatedAdjustment"},description:"The individual adjustments that were applied to the purchase. A combined summary of all of the adjustments that applied across all of the lines."},totalDiscountAmount:{$ref:"#/definitions/money",description:"The total money amount of discounts calculated for the purchase."},totalFeeAmount:{$ref:"#/definitions/money",description:"The total money amount of fees calculated for the purchase."}},required:["lines","adjustments","totalDiscountAmount","totalDiscountAmount"],definitions:{calculatedLine:{type:"object",properties:{calculationLine:{$ref:"#/definitions/calculationLine",description:"An individual line item that was calculated."},adjustments:{type:"array",items:{$ref:"#/definitions/calculatedAdjustment"},description:"The individual adjustments that applied to the line."},totalDiscountAmount:{$ref:"#/definitions/money",description:"The total money amount of discounts calculated for the line."},totalFeeAmount:{$ref:"#/definitions/money",description:"The total money amount of fees calculated for the line."}},required:["calculationLine","adjustments","totalDiscountAmount","totalFeeAmount"]},calculationLine:{type:"object",properties:{id:{type:"string",description:"The client-defined ID for the line."},type:{type:"string",description:"The line type"},unitPrice:{$ref:"#/definitions/money"},quantity:{type:"number",description:"The number of units being purchased"},subTotalPrice:{$ref:"#/definitions/money"}},required:["id","type","subTotalPrice"],description:"An individual line item that was used in the calculation, passed back unmodified from the request."},calculatedAdjustment:{type:"object",properties:{adjustment:{$ref:"#/definitions/adjustment"},totalAmount:{$ref:"#/definitions/money"}},required:["adjustment","totalAmount"],description:"An individual adjustment amount."},adjustment:{type:"object",properties:{id:{type:"string",description:"The globally-unique ID."},type:{type:"string",enum:["DISCOUNT","FEE"],description:"The type of adjustment."},label:{type:"string",description:"The label for display."},name:{type:"string",description:"The unique human-friendly identifier."},value:{$ref:"#/definitions/adjustmentValue",description:"The adjustment's value"}},required:["value","type"],description:"The adjustment that was used for the calculated amount."},adjustmentValue:{oneOf:[{$ref:"#/definitions/calculatedAdjustmentAmount"},{$ref:"#/definitions/calculatedAdjustmentPercentage"}]},calculatedAdjustmentAmount:{type:"object",properties:{amount:{$ref:"#/definitions/money"},appliedAmount:{$ref:"#/definitions/money"}},required:["amount","appliedAmount"],description:"The adjustment value represented as a fixed money amount."},calculatedAdjustmentPercentage:{type:"object",properties:{appliedPercentage:{type:"number",description:"The percentage applied by the adjustment, out of 100."},percentage:{type:"number",description:"The percentage value of the adjustment, out of 100."}},required:["appliedPercentage","percentage"],description:"The adjustment value represented as a percentage."},money:{type:"object",properties:{currencyCode:{type:"string",description:"A three-character ISO-4217 currency code."},value:{type:"number",description:"The value, which might be: An integer for currencies like JPY that are not typically fractional; or, a decimal fraction for currencies like TND that are subdivided into thousandths."}},required:["currencyCode","value"],description:"A money represents the monetary value and currency for a financial transaction."}}}},"notifications.email.send":{name:"notifications.email.send",description:"Send an email notification",requestSchema:{$schema:"https://json-schema.org/draft/2020-12/schema",title:"notifications.email.send",type:"object",properties:{entityId:{type:"string",description:"UUID of the entity."},entityType:{type:"string",description:"Type of UUID that the entityId refers to. Examples include: DISTRIBUTOR, STORE, CHANNEL."},envelope:{$ref:"#/definitions/emailEnvelope"},context:{$ref:"#/definitions/context"}},required:["entityId","entityType","envelope","context"],definitions:{context:{type:"object",description:"Context for the email",readonly:!0,properties:{owner:{type:"string",description:"A distinct identifier of which system or service creating the email to send.",example:"urn:com.godaddy:commerce.order"},storeId:{type:"string",description:"ID of the store that the email belongs to",example:"fd3d9291-dc9a-445d-aa68-d2ff1a77a83c"},topic:{type:"string",description:"A distinct identifier of what the email represents.",example:"delivery-confirmed"},objectType:{type:"string",description:"The object type the email is about.",example:"order"},objectId:{type:"string",description:"The object ID the email is about.",example:"Order_30CkE0hWAITMFEYEFZKEDBbtiQc"},references:{type:"array",description:"A set of references associated with the email.",items:{$ref:"#/definitions/Reference"}}},required:["owner","topic","objectType","objectId","storeId"]},emailEnvelope:{type:"object",properties:{to:{type:"array",items:{$ref:"#/definitions/addressOrString"}},subject:{type:"string",description:"Subject of the email."},body:{type:"string",description:"Body of the email."},isHtml:{type:"boolean",description:"Whether the email contains HTML."},sentFrom:{$ref:"#/definitions/addressOrString"}},required:["to","subject","body"]},addressOrString:{oneOf:[{type:"string",description:"An email address on its own or email header e.g. Jane<jane@example.com>"},{$ref:"#/definitions/address"}]},address:{type:"object",properties:{email:{type:"string",description:"Email address."},name:{type:"string",description:"Name of the person who owns the email address."}},required:["email"]},Reference:{description:"A reference to the resource in an external service. This can be useful for integrating the resource to any external service.",type:"object",required:["id","value","origin"],properties:{type:{type:"string",description:"The unique UUID of the reference.",example:"fd3d9291-dc9a-445d-aa68-d2ff1a77a83c",readonly:!0},value:{type:"string",description:"The identifier of the resource in an external service.",example:"B0CX23PQVP"},origin:{type:"string",description:"The origin or location of the reference.",example:"OLS"}}}}},responseSchema:{$schema:"https://json-schema.org/draft/2020-12/schema",title:"notifications.email.send:response",type:"object",description:"200 OK response with empty body",properties:{},additionalProperties:!1}},"commerce.payment.process":{name:"commerce.payment.process",description:"Process a payment by creating a new SALE transaction",requestSchema:{$id:"https://godaddy.com/schemas/commerce/create-sale-transaction.v2",$schema:"https://json-schema.org/draft/2020-12/schema",title:"Create Sale Transaction",description:"Schema for creating a new SALE transaction to process a payment",type:"object",properties:{type:{const:"SALE",description:"Transaction type - must be SALE for payment processing"},transactionRefNum:{$ref:"#/$defs/RefNum",description:"Reference number for the transaction"},fundingSource:{$ref:"#/$defs/FundingSource",description:"Payment method to be used for the transaction"},amount:{$ref:"#/$defs/DetailedAmount",description:"Transaction amount to be processed"},context:{$ref:"#/$defs/TransactionContext",description:"Additional context about where the transaction was initiated"},clientContext:{$ref:"#/$defs/Dictionary",description:"Non-sensitive context data that can be stored and fetched by client"},processingInstructions:{$ref:"#/$defs/TransactionProcessingInstruction",description:"Instructions for processing the transaction"},notes:{type:"string",maxLength:512,description:"Optional notes about the transaction"},references:{type:"array",items:{$ref:"#/$defs/TransactionReference"},description:"References to orders, invoices, or other documents"}},required:["type","amount","fundingSource"],additionalProperties:!1,$defs:{RefNum:{title:"ReferenceNumber",description:"Reference number (UUID format)",type:"string",format:"uuid"},Dictionary:{title:"Dictionary",description:"Key value pairs of strings",type:"object",minProperties:0,maxProperties:40,additionalProperties:{type:"string",maxLength:256}},Currency:{title:"Currency",description:"ISO 4217 Currency codes",type:"string",example:"USD",minLength:3,maxLength:3},Uuid:{title:"Uuid",description:"Unique identifier (UUID format)",type:"string",format:"uuid"},DetailedAmount:{title:"Detailed Amount",type:"object",description:"Itemized amount details for payment processing",properties:{amountType:{const:"DETAILED"},total:{type:"integer",format:"int64",minimum:1,description:"Total amount in smallest currency unit"},tip:{$ref:"#/$defs/TipAmount",description:"Tip amount details"},cashback:{type:"integer",format:"int64",minimum:0,description:"Cashback amount requested"},subTotal:{type:"integer",format:"int64",minimum:0,description:"Subtotal before tips and fees"},currency:{$ref:"#/$defs/Currency",description:"Amount currency"},fees:{type:"array",items:{$ref:"#/$defs/Fee"},description:"Additional fees applied to the transaction"}},required:["amountType","total","currency"],additionalProperties:!1},TipAmount:{title:"Tip Amount",type:"object",description:"Tip amount details",properties:{amount:{type:"integer",format:"int64",minimum:0,description:"Tip amount in smallest currency unit"},customerOptedNoTip:{type:"boolean",default:!1,description:"Indicates if customer explicitly opted for no tip"}},additionalProperties:!1},Fee:{title:"Fee",type:"object",description:"Fee details",properties:{type:{type:"string",description:"Type of fee"},amount:{type:"integer",format:"int64",minimum:0,description:"Fee amount in smallest currency unit"},description:{type:"string",description:"Description of the fee"}},required:["type","amount"],additionalProperties:!1},TransactionContext:{title:"Transaction Context",type:"object",description:"Context details about where the transaction was initiated",properties:{channelId:{$ref:"#/$defs/Uuid",description:"Channel identifier where transaction was initiated"},merchantInitiatedTransaction:{type:"boolean",default:!1,description:"True if initiated by merchant on behalf of customer"}},additionalProperties:!1},FundingSource:{title:"Funding Source",type:"object",description:"Payment method for the transaction",oneOf:[{$ref:"#/$defs/CustomFundingSource"}],discriminator:{propertyName:"sourceType"}},CustomFundingSource:{title:"Custom Funding Source",type:"object",description:"Custom payment method processed by a specific provider",properties:{sourceType:{const:"CUSTOM"},provider:{type:"string",maxLength:64,description:"Provider that can handle the funding source"},processor:{type:"string",maxLength:64,description:"Processor to be used for the funding source"},customFundingType:{type:"string",maxLength:64,description:"Type of the custom funding source"},name:{type:"string",maxLength:64,description:"Display name of the funding source"},description:{type:"string",maxLength:512,description:"Description about the funding source"},paymentReference:{type:"string",description:"The reference to the payment token for the funding source"}},required:["sourceType","customFundingType","provider","paymentReference"],additionalProperties:!1},TransactionProcessingInstruction:{title:"Transaction Processing Instruction",description:"Instructions for processing the transaction",type:"object",properties:{partialAuthEnabled:{type:"boolean",default:!0,description:"Allow partial authorizations for the sale"},statementDescriptorSuffix:{type:"string",maxLength:22,description:"Additional text to appear on customer's statement"},storeAndForward:{type:"boolean",default:!1,description:"Process as offline transaction (store and forward)"}},additionalProperties:!1},TransactionReference:{title:"Transaction Reference",type:"object",description:"Reference to an order, invoice, or other document",properties:{value:{type:"string",maxLength:128,description:"Reference value (e.g., order number, invoice ID)"},type:{type:"string",maxLength:32,description:"Type of reference (e.g., 'ORDER', 'INVOICE', 'SUBSCRIPTION')"},additionalLabel:{type:"string",maxLength:32,description:"Optional additional label for the reference"}},required:["value","type"],additionalProperties:!1}}},responseSchema:{$id:"https://godaddy.com/schemas/commerce/transaction-complete.v2",$schema:"https://json-schema.org/draft/2020-12/schema",title:"Complete Transaction Schema",description:"Full Transaction type with all referenced types expanded",type:"object",properties:{type:{const:"SALE"},transactionId:{type:"string",pattern:"([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})|(urn:[a-z]{1,3}:[a-z]{1,3}:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})",description:"Server generated identifier for this transaction"},transactionRefNum:{type:"string",format:"uuid",description:"Reference number (UUID format)"},storeId:{type:"string",format:"uuid",description:"Store identifier for this transaction"},fundingSource:{type:"object",properties:{sourceType:{const:"CUSTOM"},customFundingType:{type:"string",description:"Type of the custom funding source"},provider:{type:"string",description:"Provider that can handle the custom funding source"},processor:{type:"string",description:"Processor used for the custom funding source"},name:{type:"string",description:"Display name of the funding source"},description:{type:"string",description:"Display description for the funding source"},paymentReference:{type:"string",description:"The ID to the processed payment from the funding source"}},required:["sourceType","customFundingType","provider","paymentReference"]},status:{type:"string",enum:["INITIATED","PENDING","FAILED","COMPLETED","VOIDED"],description:"Transaction status"},amount:{type:"object",properties:{amountType:{const:"DETAILED"},total:{type:"integer",format:"int64",description:"Total amount"},currency:{type:"string",minLength:3,maxLength:3,description:"Amount currency"}},required:["amountType","total","currency"]},createdAt:{type:"string",format:"date-time",description:"Created time in RFC 3339 format",example:"2022-07-21T17:32:28Z"}},required:["type","amount","createdAt"]}},"commerce.payment.refund":{name:"commerce.payment.refund",description:"Refund a payment transaction",requestSchema:{$schema:"https://json-schema.org/draft/2020-12/schema",title:"RefundPaymentRequest",type:"object",properties:{transactionId:{type:"string",description:"ID of the transaction to refund"},amount:{type:"object",properties:{currency:{type:"string",description:"Three-letter ISO currency code"},value:{type:"number",description:"Amount to refund"}},required:["currency","value"]},reason:{type:"string",description:"Reason for the refund"},metadata:{type:"object",additionalProperties:{type:"string"},description:"Additional metadata for the refund"}},required:["transactionId","amount"]},responseSchema:{$schema:"https://json-schema.org/draft/2020-12/schema",title:"RefundPaymentResponse",type:"object",properties:{refundId:{type:"string",description:"Unique identifier for the refund"},status:{type:"string",description:"Status of the refund"},createdAt:{type:"string",format:"date-time",description:"When the refund was created"},amount:{type:"object",properties:{currency:{type:"string",description:"Three-letter ISO currency code"},value:{type:"number",description:"Amount refunded"}},required:["currency","value"]},reason:{type:"string",description:"Reason for the refund"},metadata:{type:"object",additionalProperties:{type:"string"},description:"Additional metadata for the refund"}},required:["refundId","status","createdAt","amount"]}}};function Gw(){let e=new sr("actions").description("Manage application actions");return e.command("list").description("List all available actions that an application developer can hook into").option("-o, --output <format>","Output format (json|text)","text").action(async t=>{let r=hh;if(t.output==="json")console.log(JSON.stringify({actions:r},null,2));else{if(r.length===0){console.log("No actions found");return}console.log(`Available actions (${r.length}):`);for(let n of r)console.log(` ${n}`)}process.exit(0)}),e.command("describe").description("Show detailed interface information for a specific action").argument("<action>","Action name").option("-o, --output <format>","Output format (json|text)","text").action(async(t,r)=>{hh.includes(t)||(console.error(`Action '${t}' not found`),console.log(`Available actions: ${hh.join(", ")}`),process.exit(1));let n=Sj[t];n||(console.error(`Interface definition not available for action '${t}'`),process.exit(1)),r.output==="json"?console.log(JSON.stringify(n,null,2)):(console.log(`Action: ${n.name}`),console.log(`Description: ${n.description}`),console.log(""),console.log("Request Schema:"),console.log(JSON.stringify(n.requestSchema,null,2)),console.log(""),console.log("Response Schema:"),console.log(JSON.stringify(n.responseSchema,null,2))),process.exit(0)}),e}u();u();import{rm as gi}from"node:fs/promises";import{resolve as $p}from"node:path";u();u();u();var Yo={NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType"};var mh=class extends Error{constructor(t,r,n,i,s,o,a){super(t),this.name="GraphQLError",this.message=t,s&&(this.path=s),r&&(this.nodes=Array.isArray(r)?r:[r]),n&&(this.source=n),i&&(this.positions=i),o&&(this.originalError=o);var c=a;if(!c&&o){var l=o.extensions;l&&typeof l=="object"&&(c=l)}this.extensions=c||{}}toJSON(){return{...this,message:this.message}}toString(){return this.message}get[Symbol.toStringTag](){return"GraphQLError"}},ne,G;function jt(e){return new mh(`Syntax Error: Unexpected token at ${G} in ${e}`)}function Hw(e){if(e.lastIndex=G,e.test(ne))return ne.slice(G,G=e.lastIndex)}var yu=/ +(?=[^\s])/y;function Oj(e){for(var t=e.split(`
370
+ `),r="",n=0,i=0,s=t.length-1,o=0;o<t.length;o++)yu.lastIndex=0,yu.test(t[o])&&(o&&(!n||yu.lastIndex<n)&&(n=yu.lastIndex),i=i||o,s=o);for(var a=i;a<=s;a++)a!==i&&(r+=`
371
+ `),r+=t[a].slice(n).replace(/\\"""/g,'"""');return r}function Le(){for(var e=0|ne.charCodeAt(G++);e===9||e===10||e===13||e===32||e===35||e===44||e===65279;e=0|ne.charCodeAt(G++))if(e===35)for(;(e=0|ne.charCodeAt(G++))&&e!==10&&e!==13;);G--}function gh(){for(var e=G,t=0|ne.charCodeAt(G++);t>=48&&t<=57||t>=65&&t<=90||t===95||t>=97&&t<=122;t=0|ne.charCodeAt(G++));if(e===G-1)throw jt("Name");var r=ne.slice(e,--G);return Le(),r}function Jt(){return{kind:"Name",value:gh()}}var _j=/(?:"""|(?:[\s\S]*?[^\\])""")/y,Aj=/(?:(?:\.\d+)?[eE][+-]?\d+|\.\d+)/y;function Us(e){var t;switch(ne.charCodeAt(G)){case 91:G++,Le();for(var r=[];ne.charCodeAt(G)!==93;)r.push(Us(e));return G++,Le(),{kind:"ListValue",values:r};case 123:G++,Le();for(var n=[];ne.charCodeAt(G)!==125;){var i=Jt();if(ne.charCodeAt(G++)!==58)throw jt("ObjectField");Le(),n.push({kind:"ObjectField",name:i,value:Us(e)})}return G++,Le(),{kind:"ObjectValue",fields:n};case 36:if(e)throw jt("Variable");return G++,{kind:"Variable",name:Jt()};case 34:if(ne.charCodeAt(G+1)===34&&ne.charCodeAt(G+2)===34){if(G+=3,(t=Hw(_j))==null)throw jt("StringValue");return Le(),{kind:"StringValue",value:Oj(t.slice(0,-3)),block:!0}}else{var s=G,o;G++;var a=!1;for(o=0|ne.charCodeAt(G++);o===92&&(G++,a=!0)||o!==10&&o!==13&&o!==34&&o;o=0|ne.charCodeAt(G++));if(o!==34)throw jt("StringValue");return t=ne.slice(s,G),Le(),{kind:"StringValue",value:a?JSON.parse(t):t.slice(1,-1),block:!1}}case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:for(var c=G++,l;(l=0|ne.charCodeAt(G++))>=48&&l<=57;);var p=ne.slice(c,--G);if((l=ne.charCodeAt(G))===46||l===69||l===101){if((t=Hw(Aj))==null)throw jt("FloatValue");return Le(),{kind:"FloatValue",value:p+t}}else return Le(),{kind:"IntValue",value:p};case 110:if(ne.charCodeAt(G+1)===117&&ne.charCodeAt(G+2)===108&&ne.charCodeAt(G+3)===108)return G+=4,Le(),{kind:"NullValue"};break;case 116:if(ne.charCodeAt(G+1)===114&&ne.charCodeAt(G+2)===117&&ne.charCodeAt(G+3)===101)return G+=4,Le(),{kind:"BooleanValue",value:!0};break;case 102:if(ne.charCodeAt(G+1)===97&&ne.charCodeAt(G+2)===108&&ne.charCodeAt(G+3)===115&&ne.charCodeAt(G+4)===101)return G+=5,Le(),{kind:"BooleanValue",value:!1};break}return{kind:"EnumValue",value:gh()}}function zw(e){if(ne.charCodeAt(G)===40){var t=[];G++,Le();do{var r=Jt();if(ne.charCodeAt(G++)!==58)throw jt("Argument");Le(),t.push({kind:"Argument",name:r,value:Us(e)})}while(ne.charCodeAt(G)!==41);return G++,Le(),t}}function Yn(e){if(ne.charCodeAt(G)===64){var t=[];do G++,t.push({kind:"Directive",name:Jt(),arguments:zw(e)});while(ne.charCodeAt(G)===64);return t}}function Nj(){for(var e=0;ne.charCodeAt(G)===91;)e++,G++,Le();var t={kind:"NamedType",name:Jt()};do if(ne.charCodeAt(G)===33&&(G++,Le(),t={kind:"NonNullType",type:t}),e){if(ne.charCodeAt(G++)!==93)throw jt("NamedType");Le(),t={kind:"ListType",type:t}}while(e--);return t}function bu(){if(ne.charCodeAt(G++)!==123)throw jt("SelectionSet");return Le(),vu()}function vu(){var e=[];do if(ne.charCodeAt(G)===46){if(ne.charCodeAt(++G)!==46||ne.charCodeAt(++G)!==46)throw jt("SelectionSet");switch(G++,Le(),ne.charCodeAt(G)){case 64:e.push({kind:"InlineFragment",typeCondition:void 0,directives:Yn(!1),selectionSet:bu()});break;case 111:ne.charCodeAt(G+1)===110?(G+=2,Le(),e.push({kind:"InlineFragment",typeCondition:{kind:"NamedType",name:Jt()},directives:Yn(!1),selectionSet:bu()})):e.push({kind:"FragmentSpread",name:Jt(),directives:Yn(!1)});break;case 123:G++,Le(),e.push({kind:"InlineFragment",typeCondition:void 0,directives:void 0,selectionSet:vu()});break;default:e.push({kind:"FragmentSpread",name:Jt(),directives:Yn(!1)})}}else{var t=Jt(),r=void 0;ne.charCodeAt(G)===58&&(G++,Le(),r=t,t=Jt());var n=zw(!1),i=Yn(!1),s=void 0;ne.charCodeAt(G)===123&&(G++,Le(),s=vu()),e.push({kind:"Field",alias:r,name:t,arguments:n,directives:i,selectionSet:s})}while(ne.charCodeAt(G)!==125);return G++,Le(),{kind:"SelectionSet",selections:e}}function Ij(){if(Le(),ne.charCodeAt(G)===40){var e=[];G++,Le();do{var t=void 0;if(ne.charCodeAt(G)===34&&(t=Us(!0)),ne.charCodeAt(G++)!==36)throw jt("Variable");var r=Jt();if(ne.charCodeAt(G++)!==58)throw jt("VariableDefinition");Le();var n=Nj(),i=void 0;ne.charCodeAt(G)===61&&(G++,Le(),i=Us(!0)),Le();var s={kind:"VariableDefinition",variable:{kind:"Variable",name:r},type:n,defaultValue:i,directives:Yn(!0)};t&&(s.description=t),e.push(s)}while(ne.charCodeAt(G)!==41);return G++,Le(),e}}function Rj(e){var t=Jt();if(ne.charCodeAt(G++)!==111||ne.charCodeAt(G++)!==110)throw jt("FragmentDefinition");Le();var r={kind:"FragmentDefinition",name:t,typeCondition:{kind:"NamedType",name:Jt()},directives:Yn(!1),selectionSet:bu()};return e&&(r.description=e),r}function Qw(){var e=[];do{var t=void 0;if(ne.charCodeAt(G)===34&&(t=Us(!0)),ne.charCodeAt(G)===123){if(t)throw jt("Document");G++,Le(),e.push({kind:"OperationDefinition",operation:"query",name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:vu()})}else{var r=gh();switch(r){case"fragment":e.push(Rj(t));break;case"query":case"mutation":case"subscription":var n,i=void 0;(n=ne.charCodeAt(G))!==40&&n!==64&&n!==123&&(i=Jt());var s={kind:"OperationDefinition",operation:r,name:i,variableDefinitions:Ij(),directives:Yn(!1),selectionSet:bu()};t&&(s.description=t),e.push(s);break;default:throw jt("Document")}}}while(G<ne.length);return e}function Ww(e,t){return ne=e.body?e.body:e,G=0,Le(),t&&t.noLocation?{kind:"Document",definitions:Qw()}:{kind:"Document",definitions:Qw(),loc:{start:0,end:ne.length,startToken:void 0,endToken:void 0,source:{body:ne,name:"graphql.web",locationOffset:{line:1,column:1}}}}}var Jw=0,yh=new Set;function Cj(){function e(t,r){var n=Ww(t).definitions,i=new Set;for(var s of r||[])for(var o of s.definitions)o.kind===Yo.FRAGMENT_DEFINITION&&!i.has(o)&&(n.push(o),i.add(o));var a;(a=n[0].kind===Yo.FRAGMENT_DEFINITION)&&n[0].directives&&(n[0].directives=n[0].directives.filter((l=>l.name.value!=="_unmask")));var c;return{kind:Yo.DOCUMENT,definitions:n,get loc(){if(!c&&a){var l=t+(function(d){try{Jw++;var f="";for(var m of d)if(!yh.has(m)){yh.add(m);var{loc:h}=m;h&&(f+=h.source.body)}return f}finally{--Jw==0&&yh.clear()}})(r||[]);return{start:0,end:l.length,source:{body:l,name:"GraphQLTada",locationOffset:{line:1,column:1}}}}return c},set loc(l){c=l}}}return e.scalar=function(r,n){return n},e.persisted=function(r,n){return{kind:Yo.DOCUMENT,definitions:n?n.definitions:[],documentId:r}},e}var Tr=Cj();u();u();var Yt=class e extends Error{response;request;constructor(t,r){let n=`${e.extractMessage(t)}: ${JSON.stringify({response:t,request:r})}`;super(n),Object.setPrototypeOf(this,e.prototype),this.response=t,this.request=r,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,e)}static extractMessage(t){return t.errors?.[0]?.message??`GraphQL Error (Code: ${String(t.status)})`}};u();u();u();var bh=e=>e.toUpperCase(),Tu=e=>typeof e=="function"?e():e,vh=(e,t)=>e.map((r,n)=>[r,t[n]]),Ci=e=>{let t={};return e instanceof Headers?t=Lj(e):Array.isArray(e)?e.forEach(([r,n])=>{r&&n!==void 0&&(t[r]=n)}):e&&(t=e),t},Lj=e=>{let t={};return e.forEach((r,n)=>{t[n]=r}),t},Xw=e=>{try{let t=e();return kj(t)?t.catch(r=>Yw(r)):t}catch(t){return Yw(t)}},Yw=e=>e instanceof Error?e:new Error(String(e)),kj=e=>typeof e=="object"&&e!==null&&"then"in e&&typeof e.then=="function"&&"catch"in e&&typeof e.catch=="function"&&"finally"in e&&typeof e.finally=="function",Eu=e=>{throw new Error(`Unhandled case: ${String(e)}`)},Xo=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);u();var Zw=(e,t)=>e.documents?e:{documents:e,requestHeaders:t,signal:void 0};u();var eS=(e,t,r)=>e.query?e:{query:e,variables:t,requestHeaders:r,signal:void 0};u();u();var pA=Fn(Ul(),1);u();var ub="Accept",Bl="Content-Type",Za="application/json",Vl="application/graphql-response+json";var lb=e=>e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),dA=e=>{let t=e.toLowerCase();return t.includes(Vl)||t.includes(Za)},pb=e=>{try{if(Array.isArray(e))return{_tag:"Batch",executionResults:e.map(uA)};if(Xo(e))return{_tag:"Single",executionResult:uA(e)};throw new Error(`Invalid execution result: result is not object or array.
372
+ Got:
373
+ ${String(e)}`)}catch(t){return t}},uA=e=>{if(typeof e!="object"||e===null)throw new Error("Invalid execution result: result is not object");let t,r,n;if("errors"in e){if(!Xo(e.errors)&&!Array.isArray(e.errors))throw new Error("Invalid execution result: errors is not plain object OR array");t=e.errors}if("data"in e){if(!Xo(e.data)&&e.data!==null)throw new Error("Invalid execution result: data is not plain object");r=e.data}if("extensions"in e){if(!Xo(e.extensions))throw new Error("Invalid execution result: extensions is not plain object");n=e.extensions}return{data:r,errors:t,extensions:n}},fA=e=>e._tag==="Batch"?e.executionResults.some(lA):lA(e.executionResult),lA=e=>Array.isArray(e.errors)?e.errors.length>0:!!e.errors,db=e=>typeof e=="object"&&e!==null&&"kind"in e&&e.kind===pA.Kind.OPERATION_DEFINITION;var hA=Fn(Ul(),1),mA=Fn(Ul(),1),CH=e=>{let t,r=e.definitions.filter(db);return r.length===1&&(t=r[0].name?.value),t},LH=e=>{let t=!1,r=e.definitions.filter(db);return r.length===1&&(t=r[0].operation==="mutation"),t},ec=(e,t)=>{let r=typeof e=="string"||"kind"in e?e:String(e),n=typeof r=="string"?r:(0,mA.print)(r),i=!1,s;if(t)return{expression:n,isMutation:i,operationName:s};let o=Xw(()=>typeof r=="string"?(0,hA.parse)(r):r);return o instanceof Error?{expression:n,isMutation:i,operationName:s}:(s=CH(o),i=LH(o),{expression:n,operationName:s,isMutation:i})};u();u();var Kl=JSON;var Gl=async e=>{let t={...e,method:e.request._tag==="Single"?e.request.document.isMutation?"POST":bh(e.method??"post"):e.request.hasMutations?"POST":bh(e.method??"post"),fetchOptions:{...e.fetchOptions,errorPolicy:e.fetchOptions.errorPolicy??"none"}},n=await DH(t.method)(t),i=await n.text(),s;try{s=kH(i,n.headers.get(Bl),e.fetchOptions.jsonSerializer??Kl)}catch(a){s=a}let o={status:n.status,headers:n.headers,body:i};if(!n.ok){if(s instanceof Error)return new Yt({...o},{query:e.request._tag==="Single"?e.request.document.expression:e.request.query,variables:e.request.variables});let a=s._tag==="Batch"?{...s.executionResults,...o}:{...s.executionResult,...o};return new Yt(a,{query:e.request._tag==="Single"?e.request.document.expression:e.request.query,variables:e.request.variables})}if(s instanceof Error)throw s;if(fA(s)&&t.fetchOptions.errorPolicy==="none"){let a=s._tag==="Batch"?{...s.executionResults,...o}:{...s.executionResult,...o};return new Yt(a,{query:e.request._tag==="Single"?e.request.document.expression:e.request.query,variables:e.request.variables})}switch(s._tag){case"Single":return{...o,...gA(t)(s.executionResult)};case"Batch":return{...o,data:s.executionResults.map(gA(t))};default:Eu(s)}},gA=e=>t=>({extensions:t.extensions,data:t.data,errors:e.fetchOptions.errorPolicy==="all"?t.errors:void 0}),kH=(e,t,r)=>t&&dA(t)?pb(r.parse(e)):pb(e),DH=e=>async t=>{let r=new Headers(t.headers),n=null,i;r.has(ub)||r.set(ub,[Vl,Za].join(", ")),e==="POST"?(i=(t.fetchOptions.jsonSerializer??Kl).stringify($H(t)),typeof i=="string"&&!r.has(Bl)&&r.set(Bl,Za)):n=PH(t);let s={method:e,headers:r,body:i,...t.fetchOptions},o=new URL(t.url),a=s;if(t.middleware){let l=await Promise.resolve(t.middleware({...s,url:t.url,operationName:t.request._tag==="Single"?t.request.document.operationName:void 0,variables:t.request.variables})),{url:p,...d}=l;o=new URL(p),a=d}return n&&n.forEach((l,p)=>{o.searchParams.append(p,l)}),await(t.fetch??fetch)(o,a)},$H=e=>{switch(e.request._tag){case"Single":return{query:e.request.document.expression,variables:e.request.variables,operationName:e.request.document.operationName};case"Batch":return vh(e.request.query,e.request.variables??[]).map(([t,r])=>({query:t,variables:r}));default:throw Eu(e.request)}},PH=e=>{let t=e.fetchOptions.jsonSerializer??Kl,r=new URLSearchParams;switch(e.request._tag){case"Single":return r.append("query",lb(e.request.document.expression)),e.request.variables&&r.append("variables",t.stringify(e.request.variables)),e.request.document.operationName&&r.append("operationName",e.request.document.operationName),r;case"Batch":{let n=e.request.variables?.map(o=>t.stringify(o))??[],i=e.request.query.map(lb),s=vh(i,n).map(([o,a])=>({query:o,variables:a}));return r.append("query",t.stringify(s)),r}default:throw Eu(e.request)}};var Li=class{url;requestConfig;constructor(t,r={}){this.url=t,this.requestConfig=r}rawRequest=async(...t)=>{let[r,n,i]=t,s=eS(r,n,i),{headers:o,fetch:a=globalThis.fetch,method:c="POST",requestMiddleware:l,responseMiddleware:p,excludeOperationName:d,...f}=this.requestConfig,{url:m}=this;s.signal!==void 0&&(f.signal=s.signal);let h=ec(s.query,d),v=await Gl({url:m,request:{_tag:"Single",document:h,variables:s.variables},headers:{...Ci(Tu(o)),...Ci(s.requestHeaders)},fetch:a,method:c,fetchOptions:f,middleware:l});if(p&&await p(v,{operationName:h.operationName,variables:n,url:this.url}),v instanceof Error)throw v;return v};async request(t,...r){let[n,i]=r,s=yA(t,n,i),{headers:o,fetch:a=globalThis.fetch,method:c="POST",requestMiddleware:l,responseMiddleware:p,excludeOperationName:d,...f}=this.requestConfig,{url:m}=this;s.signal!==void 0&&(f.signal=s.signal);let h=ec(s.document,d),v=await Gl({url:m,request:{_tag:"Single",document:h,variables:s.variables},headers:{...Ci(Tu(o)),...Ci(s.requestHeaders)},fetch:a,method:c,fetchOptions:f,middleware:l});if(p&&await p(v,{operationName:h.operationName,variables:s.variables,url:this.url}),v instanceof Error)throw v;return v.data}async batchRequests(t,r){let n=Zw(t,r),{headers:i,excludeOperationName:s,...o}=this.requestConfig;n.signal!==void 0&&(o.signal=n.signal);let a=n.documents.map(({document:f})=>ec(f,s)),c=a.map(({expression:f})=>f),l=a.some(({isMutation:f})=>f),p=n.documents.map(({variables:f})=>f),d=await Gl({url:this.url,request:{_tag:"Batch",operationName:void 0,query:c,hasMutations:l,variables:p},headers:{...Ci(Tu(i)),...Ci(n.requestHeaders)},fetch:this.requestConfig.fetch??globalThis.fetch,method:this.requestConfig.method||"POST",fetchOptions:o,middleware:this.requestConfig.requestMiddleware});if(this.requestConfig.responseMiddleware&&await this.requestConfig.responseMiddleware(d,{operationName:void 0,variables:p,url:this.url}),d instanceof Error)throw d;return d.data}setHeaders(t){return this.requestConfig.headers=t,this}setHeader(t,r){let{headers:n}=this.requestConfig;return n?n[t]=r:this.requestConfig.headers={[t]:r},this}setEndpoint(t){return this.url=t,this}};async function Cr(e,t,...r){let n=jH(e,t,...r);return new Li(n.url).request({...n})}var yA=(e,t,r)=>e.document?e:{document:e,variables:t,requestHeaders:r,signal:void 0},jH=(e,t,...r)=>{let[n,i]=r;return typeof e=="string"?{url:e,document:t,variables:n,requestHeaders:i,signal:void 0}:e};u();u();u();u();var At=[];for(let e=0;e<256;++e)At.push((e+256).toString(16).slice(1));function bA(e,t=0){return(At[e[t+0]]+At[e[t+1]]+At[e[t+2]]+At[e[t+3]]+"-"+At[e[t+4]]+At[e[t+5]]+"-"+At[e[t+6]]+At[e[t+7]]+"-"+At[e[t+8]]+At[e[t+9]]+"-"+At[e[t+10]]+At[e[t+11]]+At[e[t+12]]+At[e[t+13]]+At[e[t+14]]+At[e[t+15]]).toLowerCase()}u();import{randomFillSync as qH}from"crypto";var Ql=new Uint8Array(256),Hl=Ql.length;function zl(){return Hl>Ql.length-16&&(qH(Ql),Hl=0),Ql.slice(Hl,Hl+=16)}u();var fb={};function FH(e,t,r){let n;if(e)n=vA(e.random??e.rng?.()??zl(),e.msecs,e.seq,t,r);else{let i=Date.now(),s=zl();MH(fb,i,s),n=vA(s,fb.msecs,fb.seq,t,r)}return t??bA(n)}function MH(e,t,r){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=r[6]<<23|r[7]<<16|r[8]<<8|r[9],e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function vA(e,t,r,n,i=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(!n)n=new Uint8Array(16),i=0;else if(i<0||i+16>n.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),r??=e[6]*127<<24|e[7]<<16|e[8]<<8|e[9],n[i++]=t/1099511627776&255,n[i++]=t/4294967296&255,n[i++]=t/16777216&255,n[i++]=t/65536&255,n[i++]=t/256&255,n[i++]=t&255,n[i++]=112|r>>>28&15,n[i++]=r>>>20&255,n[i++]=128|r>>>14&63,n[i++]=r>>>6&255,n[i++]=r<<2&255|e[10]&3,n[i++]=e[11],n[i++]=e[12],n[i++]=e[13],n[i++]=e[14],n[i++]=e[15],n}var hb=FH;var tc=null;async function Wr(){if(tc)return tc;if(process.env.APPLICATIONS_GRAPHQL_URL)tc=process.env.APPLICATIONS_GRAPHQL_URL;else{let e=await an();if(!e.success||!e.data)throw e.error??new Error("Failed to get environment");let t=e.data;tc=`${Ai(t)}/v1/apps/app-registry-subgraph`}return tc}function Jr(e){return{Authorization:`Bearer ${e}`,"X-Request-ID":hb()}}var UH=Tr(`
374
+ query Application($name: String!) {
375
+ application(name: $name) {
376
+ id
377
+ label
378
+ name
379
+ description
380
+ status
381
+ url
382
+ proxyUrl
383
+ }
384
+ }
385
+ `),BH=Tr(`
386
+ query ApplicationWithLatestRelease($name: String!) {
387
+ application(name: $name) {
388
+ id
389
+ label
390
+ name
391
+ description
392
+ status
393
+ url
394
+ proxyUrl
395
+ authorizationScopes
396
+ releases(first: 1, orderBy: { createdAt: desc }) {
397
+ edges {
398
+ node {
399
+ id
400
+ version
401
+ description
402
+ createdAt
403
+ }
404
+ }
405
+ }
406
+ }
407
+ }
408
+ `),wfe=Tr(`
409
+ query ApplicationsList {
410
+ applications {
411
+ id
412
+ label
413
+ name
414
+ description
415
+ status
416
+ url
417
+ proxyUrl
418
+ }
419
+ }
420
+ `),VH=Tr(`
421
+ mutation CreateApplication($input: MutationCreateApplicationInput!) {
422
+ createApplication(input: $input) {
423
+ id
424
+ clientId
425
+ clientSecret
426
+ label
427
+ name
428
+ description
429
+ status
430
+ url
431
+ proxyUrl
432
+ authorizationScopes
433
+ secret
434
+ publicKey
435
+ }
436
+ }
437
+ `),KH=Tr(`
438
+ mutation UpdateApplication(
439
+ $id: String!
440
+ $input: MutationUpdateApplicationInput!
441
+ ) {
442
+ updateApplication(id: $id, input: $input) {
443
+ id
444
+ clientId
445
+ label
446
+ name
447
+ description
448
+ status
449
+ url
450
+ proxyUrl
451
+ authorizationScopes
452
+ }
453
+ }
454
+ `),GH=Tr(`
455
+ mutation CreateRelease($input: MutationCreateReleaseInput!) {
456
+ createRelease(input: $input) {
457
+ id
458
+ version
459
+ description
460
+ createdAt
461
+ }
462
+ }
463
+ `),HH=Tr(`
464
+ mutation EnableApplication($input: MutationEnableStoreApplicationInput!) {
465
+ enableStoreApplication(input: $input) {
466
+ id
467
+ }
468
+ }
469
+ `),QH=Tr(`
470
+ mutation DisableApplication($input: MutationDisableStoreApplicationInput!) {
471
+ disableStoreApplication(input: $input) {
472
+ id
473
+ }
474
+ }
475
+ `),zH=Tr(`
476
+ mutation ArchiveApplication($id: String!) {
477
+ archiveApplication(id: $id) {
478
+ id
479
+ label
480
+ name
481
+ status
482
+ createdAt
483
+ archivedAt
484
+ }
485
+ }
486
+ `),WH=ce({label:"string",name:"string",description:"string",url:ce.keywords.string.url.root,proxyUrl:ce.keywords.string.url.root,authorizationScopes:ce.string.array().moreThanLength(0)}),Sfe=ce({label:"string?",description:"string?",status:'"ACTIVE" | "INACTIVE"?'});async function TA(e,{accessToken:t}){if(!t)throw new Error("Access token is required");let r=WH(e);if(r instanceof ce.errors)throw new Error(r.summary);try{let n=await Wr();return await Cr(n,VH,{input:r},Jr(t))}catch(n){if(n instanceof Yt){let i=n.response.errors;if(i?.length){let s=i[0],o=s.extensions?.code,a=o?`${s.message} (${o})`:s.message;throw new Error(a)}throw console.log(n),new Error("An unexpected error occurred")}throw new Error("An unexpected error occurred")}}async function Wl(e,t,{accessToken:r}){if(!r)throw new Error("Access token is required");try{let n=await Wr();return await Cr(n,KH,{id:e,input:t},Jr(r))}catch(n){if(n instanceof Yt){let i=n.response.errors;if(i?.length){let s=i[0],o=s.extensions?.code,a=o?`${s.message} (${o})`:s.message;throw new Error(a)}throw console.log(n),new Error("An unexpected error occurred")}throw new Error("An unexpected error occurred")}}async function rc(e,{accessToken:t}){if(!t)throw new Error("Access token is required");let r=await Wr();return await Cr(r,UH,{name:e},Jr(t))}async function mb(e,{accessToken:t}){if(!t)throw new Error("Access token is required");let r=await Wr();return await Cr(r,BH,{name:e},Jr(t))}var JH=ce({name:"string",url:"string"}),YH=ce({name:"string",events:"string[]",url:"string"}),XH=ce({applicationId:"string",version:"string",description:"string?",actions:JH.array().optional(),subscriptions:YH.array().optional()});async function EA(e,{accessToken:t}){if(!t)throw new Error("Access token is required");let r=XH(e);if(r instanceof ce.errors)throw new Error(r.summary);let n={...r,actions:r.actions??[]};try{let i=await Wr();return await Cr(i,GH,{input:n},Jr(t))}catch(i){if(i instanceof Yt){let s=i.response.errors;if(s?.length){let o=s[0],a=o.extensions?.code,c=a?`${o.message} (${a})`:o.message;throw new Error(c)}throw console.log(i),new Error("An unexpected error occurred")}throw new Error("An unexpected error occurred")}}async function xA(e,{accessToken:t}){if(!t)throw new Error("Access token is required");try{let r=await Wr();return await Cr(r,HH,{input:e},Jr(t))}catch(r){if(r instanceof Yt){let n=r.response.errors;if(n?.length){let i=n[0],s=i.extensions?.code,o=s?`${i.message} (${s})`:i.message;throw new Error(o)}throw console.log(r),new Error("An unexpected error occurred")}throw new Error("An unexpected error occurred")}}async function wA(e,{accessToken:t}){if(!t)throw new Error("Access token is required");try{let r=await Wr();return await Cr(r,QH,{input:e},Jr(t))}catch(r){if(r instanceof Yt){let n=r.response.errors;if(n?.length){let i=n[0],s=i.extensions?.code,o=s?`${i.message} (${s})`:i.message;throw new Error(o)}throw console.log(r),new Error("An unexpected error occurred")}throw new Error("An unexpected error occurred")}}async function SA(e,{accessToken:t}){if(!t)throw new Error("Access token is required");try{let r=await Wr();return await Cr(r,zH,{id:e},Jr(t))}catch(r){if(r instanceof Yt){let n=r.response.errors;if(n?.length){let i=n[0],s=i.extensions?.code,o=s?`${i.message} (${s})`:i.message;throw new Error(o)}throw console.log(r),new Error("An unexpected error occurred")}throw new Error("An unexpected error occurred")}}u();import{existsSync as aR}from"node:fs";import{mkdir as E3,rm as Vhe,writeFile as cR}from"node:fs/promises";import{tmpdir as x3}from"node:os";import{basename as w3,join as mo}from"node:path";u();function ZH(e){let t=["node:*","@wsblocks/*"];return e==="blocks"?[...t,"react","react/*","react-dom","react-dom/*"]:t}function e2(e){if(e!=="blocks")return{react:"preact/compat","react-dom":"preact/compat","react/jsx-runtime":"preact/jsx-runtime"}}function t2(e){return e==="blocks"?{platform:"node",format:"esm",target:"node22"}:{platform:"browser",format:"iife",target:"es2020"}}function OA(e,t,r){let n=typeof e=="string"?{entryPath:e,tsconfigPath:t,overrides:r}:e,{platform:i,format:s,target:o}=t2(n.extensionType),a=e2(n.extensionType),c=[];return n.extensionDir&&c.push(`${n.extensionDir}/node_modules`),{...{entryPoints:[n.entryPath],bundle:!0,format:s,platform:i,target:o,minify:!0,sourcemap:"external",write:!1,logLevel:"silent",external:ZH(n.extensionType),outExtension:{".js":".mjs"},outdir:"out",...n.tsconfigPath&&{tsconfig:n.tsconfigPath},...a&&{alias:a},...c.length>0&&{nodePaths:c}},...n.overrides}}u();import{createHash as r2}from"node:crypto";function _A(e){return r2("sha256").update(e).digest("hex")}function AA(e){return e.slice(0,6)}function NA(e=new Date){let t=e.getUTCFullYear(),r=String(e.getUTCMonth()+1).padStart(2,"0"),n=String(e.getUTCDate()).padStart(2,"0"),i=String(e.getUTCHours()).padStart(2,"0"),s=String(e.getUTCMinutes()).padStart(2,"0"),o=String(e.getUTCSeconds()).padStart(2,"0");return`${t}${r}${n}${i}${s}${o}`}function n2(e){let t=/[/\\:*?"<>|\s@!]/g;return e.replace(t,"-").toLowerCase().replace(/^[-\s]+|[-\s]+$/g,"").slice(0,100)||"extension"}function IA(e,t,r,n){return`${n2(e)}-${t||"0.0.0"}-${r}-${n}.mjs`}var uR=Fn(tN(),1);u();var dv=Fn(rR(),1),dc=!1,nR=()=>{let e=process.env.NODE_ENV==="development",t=dc?"debug":"info",r={paths:["headers.Authorization","headers.authorization","body.headers.Authorization","body.headers.authorization"],censor:"[REDACTED]"};return e||dc?(0,dv.default)({level:t,redact:r,transport:{target:"pino-pretty",options:{colorize:!0,translateTime:"HH:MM:ss",ignore:"pid,hostname"}}}):(0,dv.default)({level:t,redact:r})},Np=nR(),iR=e=>{dc=e,Np=nR()},ho=()=>Np,sR=e=>{dc&&Np.debug({type:"http_request",method:e.method,url:e.url,headers:e.headers,body:e.body},`\u2192 ${e.method} ${e.url}`)},oR=e=>{dc&&Np.debug({type:"http_response",method:e.method,url:e.url,status:e.status,statusText:e.statusText,headers:e.headers,body:e.body,duration:e.duration},`\u2190 ${e.status} ${e.method} ${e.url} ${e.duration?`(${e.duration}ms)`:""}`)};function S3(e,t){let r=mo(e,"tsconfig.json");if(aR(r))return r;let n=mo(t,"tsconfig.json");if(aR(n))return n}function O3(e,t){let r=w3(e);return mo(x3(),"gd-cli",r,`deploy-${t}`)}async function lR(e,t,r){let n=ho(),i=Date.now(),s=r.timestamp||NA(),o=O3(r.repoRoot,s),a=mo(o,e.name);try{await E3(a,{recursive:!0});let c=r.extensionDir??mo(t,".."),l=S3(c,r.repoRoot),p=OA({entryPath:t,tsconfigPath:l,extensionType:r.extensionType,extensionDir:c}),d;try{d=await uR.build(p)}catch(k){return{success:!1,error:new Error(`ESBUILD_ERROR: ${k instanceof Error?k.message:String(k)}`)}}let f=d.outputFiles;if(!f||f.length===0)return{success:!1,error:new Error("No output files generated by esbuild")};let m=f.find(k=>k.path.endsWith(".mjs")),h=f.find(k=>k.path.endsWith(".mjs.map"));if(!m)return{success:!1,error:new Error("No .mjs file generated by esbuild")};let v=m.text,E=v.replace(/^\/\/# sourceMappingURL=.*$/m,"").trimEnd(),A=_A(Buffer.from(E)),w=AA(A),_=IA(e.name,e.version||"0.0.0",s,w);if(v=E,h){let k=`${_}.map`;v+=`
487
+ //# sourceMappingURL=${k}
488
+ `}let I=mo(a,_);await cR(I,v,"utf-8");let C;h&&(C=`${I}.map`,await cR(C,h.text,"utf-8"));let R=Date.now()-i,q=Buffer.byteLength(v);return n.debug({type:"bundle",extension:e.name,entry:t,size:q,sha256:A,durationMs:R}),{success:!0,data:{packageName:e.name,version:e.version,artifactPath:I,artifactName:_,size:q,sha256:A,sourcemapPath:C}}}catch(c){return{success:!1,error:c instanceof Error?c:new Error(String(c))}}}u();var pR=ho(),_3=Tr(`
489
+ mutation GenerateReleaseUploadUrl($input: MutationGenerateReleaseUploadUrlInput!) {
490
+ generateReleaseUploadUrl(input: $input) {
491
+ uploadId
492
+ url
493
+ key
494
+ expiresAt
495
+ maxSizeBytes
496
+ requiredHeaders
497
+ }
498
+ }
499
+ `);async function dR(e,t){pR.debug({applicationId:e.applicationId,releaseId:e.releaseId,contentType:e.contentType??"JS"},"Requesting presigned upload URL");let r=await Wr(),n=await Cr(r,_3,{input:{applicationId:e.applicationId,releaseId:e.releaseId,contentType:e.contentType??"JS",target:e.target}},Jr(t));if(!n.generateReleaseUploadUrl)throw new Error("Failed to generate upload URL: empty response");let i=n.generateReleaseUploadUrl,s={};for(let o of i.requiredHeaders){let[a,...c]=o.split(":");a&&c.length>0&&(s[a.trim()]=c.join(":").trim())}return pR.debug({uploadId:i.uploadId,key:i.key,expiresAt:i.expiresAt,maxSizeBytes:i.maxSizeBytes},"Received presigned upload URL"),{uploadId:i.uploadId,url:i.url,key:i.key,expiresAt:i.expiresAt,maxSizeBytes:i.maxSizeBytes,requiredHeaders:s}}u();import{readFile as fC}from"node:fs/promises";import{join as v4}from"node:path";import*as vo from"typescript";u();import*as Ce from"typescript";function fR(e){let t=new Map,r=new Map,n=new Map;function i(f){Ce.isImportDeclaration(f)&&s(f),Ce.isVariableStatement(f)&&o(f),Ce.isCallExpression(f)&&l(f),Ce.forEachChild(f,i)}function s(f){let m=f.moduleSpecifier;if(!Ce.isStringLiteral(m))return;let h=m.text,v=f.importClause;if(v){if(v.name){let E=v.name.text;p(h,E)}if(v.namedBindings){let E=v.namedBindings;if(Ce.isNamespaceImport(E)&&r.set(h,E.name.text),Ce.isNamedImports(E))for(let A of E.elements){let w=A.propertyName?A.propertyName.text:A.name.text,_=A.name.text;d(h,w,_)}}}}function o(f){for(let m of f.declarationList.declarations)a(m)}function a(f){if(f.initializer&&Ce.isCallExpression(f.initializer)&&Ce.isIdentifier(f.initializer.expression)&&f.initializer.expression.text==="require"){let m=f.initializer.arguments;if(m.length!==1||!Ce.isStringLiteral(m[0]))return;let h=m[0].text,v=f.name;if(Ce.isIdentifier(v)&&p(h,v.text),Ce.isObjectBindingPattern(v))for(let E of v.elements){let A=null;if(E.propertyName){if(A=c(E.propertyName),A===null)continue}else A=Ce.isIdentifier(E.name)?E.name.text:null;let w=Ce.isIdentifier(E.name)?E.name.text:null;A&&w&&d(h,A,w)}}}function c(f){if(!f)return null;if(Ce.isIdentifier(f)||Ce.isStringLiteral(f)||Ce.isNumericLiteral(f))return f.text;if(Ce.isComputedPropertyName(f)){let m=f.expression;return Ce.isStringLiteral(m)||Ce.isNumericLiteral(m)||Ce.isNoSubstitutionTemplateLiteral(m)?m.text:null}return null}function l(f){if(f.expression.kind===Ce.SyntaxKind.ImportKeyword){let m=f.arguments;if(m.length===1&&Ce.isStringLiteral(m[0])){let h=m[0].text;p(h,"__dynamic__")}}}function p(f,m){t.has(f)||t.set(f,new Set),t.get(f)?.add(m)}function d(f,m,h){n.has(f)||n.set(f,new Map),n.get(f)?.set(m,h)}return i(e),{moduleAliases:t,namespaceAliases:r,namedImports:n}}function os(e,t,r){if(r.moduleAliases.get(t)?.has(e)||r.namespaceAliases.get(t)===e)return!0;let s=r.namedImports.get(t);if(s){for(let o of s.values())if(o===e)return!0}return!1}u();function A3(e,t){let r=1;for(let n=0;n<t&&n<e.length;n++)e[n]===`
500
+ `?r++:e[n]==="\r"&&e[n+1]===`
501
+ `&&(r++,n++);return r}function N3(e,t){let n=Math.max(0,t-25),i=Math.min(e.length,t+25),s=e.slice(n,i),o=t-n,a=s.indexOf(`
502
+ `);a!==-1&&a<o&&(s=s.slice(a+1),o-=a+1);let c=s.lastIndexOf(`
503
+ `);return c!==-1&&c>o&&(s=s.slice(0,c)),s.trim()}function hR(e,t,r){let n=[];for(let i of t){let s=i.patterns;if(i.signalPatterns&&i.signalPatterns.length>0){if(!i.signalPatterns.some(a=>new RegExp(a.source,a.flags).test(e)))continue;s=[...i.signalPatterns,...i.patterns]}for(let o of s){let a=e.matchAll(o);for(let c of a){if(c.index===void 0)continue;let l=A3(e,c.index),p=N3(e,c.index);n.push({ruleId:i.id,severity:i.severity,message:i.description,file:r,line:l,col:0,snippet:p})}}}return n.sort((i,s)=>i.line-s.line),n}u();var qR=Fn(jR(),1),i4={mode:"strict",trustedDomains:["*.godaddy.com","godaddy.com","localhost","127.0.0.1"],exclude:["**/node_modules/**","**/dist/**","**/build/**","**/__tests__/**"]};function Cp(){return i4}function FR(e,t){let r=e;try{r=new URL(e).hostname||e.split(":")[0]}catch{r=e.split(":")[0]}let n=r.toLowerCase();for(let i of t.trustedDomains){let s=i.toLowerCase();if(s.startsWith("*.")){let o=s.slice(2);if(n===o||n.endsWith(`.${o}`))return!0}else if(n===s)return!0}return!1}function xv(e,t){let r=e.replace(/\\/g,"/");for(let n of t.exclude)if(s4(r,n))return!0;return!1}function s4(e,t){let r=e.startsWith("./")?e.slice(2):e;return(0,qR.default)(t)(r)}u();import Lp from"typescript";function MR(e,t,r,n,i){let s=Lp.createSourceFile(e,t,Lp.ScriptTarget.Latest,!0,Lp.ScriptKind.TSX),o=[],a=[];for(let l of r){let p={sourceFile:s,filePath:e,config:n,aliasMaps:i,report:(d,f)=>{o.push(o4(d,f,l.meta.id,l.meta.defaultSeverity,s))}};a.push(l.create(p))}for(let l of a)l.onFileStart?.();let c=new Map;for(let l of a)for(let[p,d]of Object.entries(l)){if(p==="onFileStart")continue;let f=Number(p),m=c.get(f)??[];m.push(d),c.set(f,m)}return UR(s,c),o}function UR(e,t){let r=t.get(e.kind);if(r)for(let n of r)n(e);Lp.forEachChild(e,n=>UR(n,t))}function o4(e,t,r,n,i){let{line:s,col:o}=a4(t,i);return{ruleId:r,severity:n,message:e,file:i.fileName,line:s,col:o,snippet:t.getText(i).split(`
504
+ `)[0].slice(0,80)}}function a4(e,t){let{line:r,character:n}=t.getLineAndCharacterOfPosition(e.getStart(t));return{line:r+1,col:n+1}}u();import{readdir as c4,stat as BR}from"node:fs/promises";import{join as u4,resolve as l4}from"node:path";var p4=[".js",".ts",".jsx",".tsx",".mjs",".cjs"];async function VR(e){try{let t=Cp(),r=l4(e);try{if(!(await BR(r)).isDirectory())return{success:!1,error:new Error(`Path is not a directory: ${r}`)}}catch(i){return{success:!1,error:i instanceof Error?i:new Error(String(i))}}let n=[];return await KR(r,n,t),{success:!0,data:n}}catch(t){return{success:!1,error:t instanceof Error?t:new Error(String(t))}}}async function KR(e,t,r){if(xv(e,r))return;let n;try{n=await c4(e)}catch{return}for(let i of n){let s=u4(e,i);if(xv(s,r))continue;let o;try{o=await BR(s)}catch{continue}o.isDirectory()?await KR(s,t,r):o.isFile()&&d4(s)&&t.push(s)}}function d4(e){return p4.some(t=>e.endsWith(t))}u();u();var wv={id:"SEC101",severity:"block",title:"Dynamic code execution in bundle",description:"Bundled code contains eval() or Function constructor which can execute arbitrary code",sourceRuleId:"SEC001",patterns:[/(?:^|[^\w$])eval\s*\(/g,/(?:^|[^\w$])new\s+Function\s*\(/g,/(?:globalThis|window|self)\.eval\s*\(/g,/(?:globalThis|window|self)\[['"]eval['"]]\s*\(/g,/\[['"]eval['"]]\s*\(/g,/\[['"]Function['"]]\s*\(/g,/(?:eval|Function|setTimeout|setInterval)\s*\(\s*(?:atob\([^)]*\)|Buffer\.from\([^,]+,\s*['"`]base64['"`]\))/g,/eval\s*\(\s*['"`](?:\\x[0-9A-Fa-f]{2}){8,}['"`]\s*\)/g]};u();var Sv={id:"SEC102",severity:"block",title:"child_process usage in bundle",description:"Bundled code imports and uses child_process module which can execute shell commands",sourceRuleId:"SEC002",signalPatterns:[/require\s*\(\s*['"](?:node:)?child_process['"]\s*\)/g,/from\s*['"](?:node:)?child_process['"]/g,/import\s*\(\s*['"](?:node:)?child_process['"]\s*\)/g,/require_child_process\s*\(/g,/__require\s*\(\s*['"]child_process['"]\s*\)/g,/\b[a-z]\s*\(\s*['"](?:node:)?child_process['"]\s*\)/g,/require\s*\(\s*['"](?:node:)?child['"]\s*\+\s*['"]_?process['"]\s*\)/g,/(?:require|import)\s*\(\s*(?:atob\([^)]*\)|Buffer\.from\([^,]+,\s*['"`]base64['"`]\)\.toString\(\))/g],patterns:[/\bexec\s*\(/g,/\bexecSync\s*\(/g,/\bexecFile\s*\(/g,/\bexecFileSync\s*\(/g,/\bspawn\s*\(/g,/\bspawnSync\s*\(/g,/\bfork\s*\(/g]};u();var Ov={id:"SEC103",severity:"block",title:"vm module usage in bundle",description:"Bundled code imports and uses vm module which enables arbitrary code execution",sourceRuleId:"SEC003",signalPatterns:[/require\s*\(\s*['"](?:node:)?vm['"]\s*\)/g,/from\s*['"](?:node:)?vm['"]/g,/import\s*\(\s*['"](?:node:)?vm['"]\s*\)/g,/require_vm\s*\(/g,/__require\s*\(\s*['"]vm['"]\s*\)/g],patterns:[/\bScript\s*\(/g,/\.runInNewContext\s*\(/g,/\.runInContext\s*\(/g,/\.runInThisContext\s*\(/g,/\.createContext\s*\(/g]};u();var _v={id:"SEC104",severity:"block",title:"process.binding/dlopen in bundle",description:"Bundled code accesses Node.js internal bindings which can bypass security",sourceRuleId:"SEC004",patterns:[/process\.binding\s*\(/g,/process\._linkedBinding\s*\(/g,/process\.dlopen\s*\(/g,/internalBinding\s*\(/g,/process\[['"]binding['"]]\s*\(/g,/process\[['"]_linkedBinding['"]]\s*\(/g,/process\[['"]dlopen['"]]\s*\(/g]};u();var Av={id:"SEC105",severity:"block",title:"Native addon usage in bundle",description:"Bundled code loads native addons which can bypass Node.js security",sourceRuleId:"SEC005",signalPatterns:[/require\s*\(\s*['"]bindings['"]\s*\)/g,/require\s*\(\s*['"]node-gyp['"]\s*\)/g,/require\s*\(\s*['"]ffi-napi['"]\s*\)/g,/require\s*\(\s*['"]node-addon-api['"]\s*\)/g,/from\s*['"]bindings['"]/g,/from\s*['"]ffi-napi['"]/g,/require_bindings\s*\(/g],patterns:[/['"]\.node['"]/g,/\.node['"]?\s*\)/g,/process\.dlopen\s*\(/g]};u();var Nv={id:"SEC106",severity:"block",title:"Module monkey-patching in bundle",description:"Bundled code modifies module system internals which can hijack dependencies",sourceRuleId:"SEC006",signalPatterns:[/require\s*\(\s*['"]module['"]\s*\)/g,/from\s*['"]module['"]/g,/require_module\s*\(/g],patterns:[/Module\._load\s*=/g,/Module\._resolveFilename\s*=/g,/Module\._extensions\[/g,/require\.cache\s*\[/g,/delete\s+require\.cache/g,/Module\[['"]_load['"]]\s*=/g,/Module\[['"]_resolveFilename['"]]\s*=/g]};u();var Iv={id:"SEC107",severity:"block",title:"inspector module usage in bundle",description:"Bundled code uses inspector module which can enable remote debugging access",sourceRuleId:"SEC007",signalPatterns:[/require\s*\(\s*['"](?:node:)?inspector['"]\s*\)/g,/from\s*['"](?:node:)?inspector['"]/g,/import\s*\(\s*['"](?:node:)?inspector['"]\s*\)/g,/require_inspector\s*\(/g],patterns:[/inspector\.open\s*\(/g,/inspector\.url\s*\(/g,/inspector\.waitForDebugger\s*\(/g,/inspector\[['"]open['"]]\s*\(/g]};u();var Rv={id:"SEC108",severity:"warn",title:"External URL in bundle",description:"Bundled code contains HTTP(S) URLs to external domains",sourceRuleId:"SEC008",signalPatterns:[/require\s*\(\s*['"](?:node:)?https?['"]\s*\)/g,/from\s*['"](?:node:)?https?['"]/g,/require\s*\(\s*['"]axios['"]\s*\)/g,/from\s*['"]axios['"]/g],patterns:[/https?:\/\/[^\s"'`<>]+/g,/new\s+URL\s*\(\s*['"]https?:[^'"]+['"]\s*\)/g,/fetch\s*\(\s*['"]https?:[^'"]+['"]\s*\)/g]};u();var Cv={id:"SEC109",severity:"warn",title:"Large encoded blob in bundle",description:"Bundled code contains large base64/hex encoded data that could hide malicious payloads",sourceRuleId:"SEC009",patterns:[/Buffer\.from\s*\(\s*['"][A-Za-z0-9+/]{200,}={0,2}['"]\s*,\s*['"]base64['"]\s*\)/g,/atob\s*\(\s*['"][A-Za-z0-9+/]{200,}={0,2}['"]\s*\)/g,/Buffer\.from\s*\(\s*['"][A-Fa-f0-9]{400,}['"]\s*,\s*['"]hex['"]\s*\)/g]};u();var Lv={id:"SEC110",severity:"warn",title:"Sensitive operations in bundle",description:"Bundled code accesses sensitive paths, environment variables, or network APIs",sourceRuleId:"SEC010",signalPatterns:[/require\s*\(\s*['"](?:node:)?net['"]\s*\)/g,/from\s*['"](?:node:)?net['"]/g,/require\s*\(\s*['"](?:node:)?fs['"]\s*\)/g,/from\s*['"](?:node:)?fs['"]/g],patterns:[/net\.connect\s*\(/g,/net\.createConnection\s*\(/g,/process\.env\[/g,/process\.env\./g,/['"]\/(etc\/passwd|etc\/shadow|\.ssh\/|\.aws\/)/g,/['"]~\/\.ssh\//g,/fs\.readFile(?:Sync)?\s*\(\s*['"][^'"]*\.env['"]/g]};var GR=[wv,Sv,Ov,_v,Av,Nv,Iv,Rv,Cv,Lv];u();u();import JR from"typescript";u();import*as Ke from"typescript";function HR(e,t){return Ke.isCallExpression(e)&&Ke.isIdentifier(e.expression)&&e.expression.text===t}function QR(e,t){return Ke.isNewExpression(e)&&Ke.isIdentifier(e.expression)&&e.expression.text===t}function kp(e,t){if(!Ke.isCallExpression(e))return!1;let{expression:r}=e;if(!Ke.isPropertyAccessExpression(r)||!Ke.isIdentifier(r.name)||r.name.text!==t.method)return!1;let n=r.expression;return Ke.isIdentifier(n)?os(n.text,t.objectIsAliasOf,t.aliasMaps):!1}function kv(e,t){return Ke.isPropertyAccessExpression(e)&&Ke.isIdentifier(e.expression)&&e.expression.text==="process"&&Ke.isIdentifier(e.name)&&e.name.text===t}function gc(e,t){if(!Ke.isCallExpression(e)||!Ke.isIdentifier(e.expression)||e.expression.text!=="require")return!1;let r=e.arguments;if(r.length<1||!Ke.isStringLiteral(r[0]))return!1;let n=r[0].text;return t.test(n)}function Dp(e,t){return Ke.isImportDeclaration(e)&&Ke.isStringLiteral(e.moduleSpecifier)&&e.moduleSpecifier.text===t}function zR(e){return Ke.isStringLiteral(e)||e.kind===Ke.SyntaxKind.NoSubstitutionTemplateLiteral?e.text:null}function Dv(e,t){if(!Ke.isCallExpression(e))return!1;let{expression:r}=e;if(!Ke.isPropertyAccessExpression(r)||!Ke.isIdentifier(r.expression)||r.expression.text!=="Buffer"||!Ke.isIdentifier(r.name)||r.name.text!=="from")return!1;if(t){let n=e.arguments;return n.length<2||!Ke.isStringLiteral(n[1])?!1:n[1].text===t}return!0}function $v(e){return/https?:\/\//.test(e)}function WR(e){return[/~\/\.ssh/,/\/etc\/passwd/,/\/etc\/shadow/,/\/var\/run\/secrets/].some(r=>r.test(e))}var YR={meta:{id:"SEC001",defaultSeverity:"block",title:"No eval() or Function constructor",description:"Detects eval() calls and Function constructor usage that allow arbitrary code execution",remediation:"Remove eval() and new Function(). Use JSON.parse() for data or refactor to avoid dynamic code execution."},create:e=>({[JR.SyntaxKind.CallExpression]:t=>{HR(t,"eval")&&e.report("Blocked: eval() allows arbitrary code execution. Use JSON.parse() for data or refactor code.",t)},[JR.SyntaxKind.NewExpression]:t=>{QR(t,"Function")&&e.report("Blocked: new Function() allows arbitrary code execution. Use regular function declarations instead.",t)}})};u();import XR from"typescript";var ZR={meta:{id:"SEC002",defaultSeverity:"block",title:"No child_process usage",description:"Detects child_process module usage (exec, spawn, fork, execFile) that can execute system commands",remediation:"Remove child_process usage. Use platform APIs or request capabilities through the extension system."},create:e=>{let t=["exec","spawn","fork","execFile","execSync","spawnSync","execFileSync"];return{[XR.SyntaxKind.CallExpression]:r=>{let n=r;if(XR.isIdentifier(n.expression)){let i=n.expression.text;t.includes(i)&&os(i,"child_process",e.aliasMaps)&&e.report(`Blocked: child_process.${i}() can execute arbitrary system commands. Use platform APIs instead.`,r)}for(let i of t)if(kp(r,{objectIsAliasOf:"child_process",method:i,aliasMaps:e.aliasMaps})){e.report(`Blocked: child_process.${i}() can execute arbitrary system commands. Use platform APIs instead.`,r);break}}}}};u();import yo from"typescript";var eC={meta:{id:"SEC003",defaultSeverity:"block",title:"No vm module usage",description:"Detects vm module usage (runInNewContext, runInContext, Script) that can execute code in isolated contexts",remediation:"Remove vm module usage. Use safe data transformation instead of code execution."},create:e=>{let t=["runInNewContext","runInContext","runInThisContext","createContext"];return{[yo.SyntaxKind.CallExpression]:r=>{let n=r;if(yo.isIdentifier(n.expression)){let i=n.expression.text;t.includes(i)&&os(i,"vm",e.aliasMaps)&&e.report(`Blocked: vm.${i}() can execute arbitrary code. Use safe data transformation instead.`,r)}for(let i of t)if(kp(r,{objectIsAliasOf:"vm",method:i,aliasMaps:e.aliasMaps})){e.report(`Blocked: vm.${i}() can execute arbitrary code. Use safe data transformation instead.`,r);break}},[yo.SyntaxKind.NewExpression]:r=>{let n=r;if(yo.isPropertyAccessExpression(n.expression)){let i=n.expression.expression,s=n.expression.name;yo.isIdentifier(i)&&yo.isIdentifier(s)&&s.text==="Script"&&os(i.text,"vm",e.aliasMaps)&&e.report("Blocked: new vm.Script() can compile and execute arbitrary code. Use safe data transformation instead.",r)}}}}};u();import f4 from"typescript";var tC={meta:{id:"SEC004",defaultSeverity:"block",title:"No process internals access",description:"Detects access to internal Node.js APIs (process.binding, process.dlopen) that bypass normal module loading",remediation:"Remove process.binding() and process.dlopen(). Use standard require/import instead."},create:e=>({[f4.SyntaxKind.PropertyAccessExpression]:t=>{kv(t,"binding")&&e.report("Blocked: process.binding() is an internal Node.js API. Use standard require/import instead.",t),kv(t,"dlopen")&&e.report("Blocked: process.dlopen() is an internal Node.js API. Use standard require/import instead.",t)}})};u();import rC from"typescript";var nC={meta:{id:"SEC005",defaultSeverity:"block",title:"No native addons",description:"Detects native Node.js addons (.node files) and native binding libraries (node-gyp-build, ffi-napi, ref-napi)",remediation:"Remove native addon usage. Use pure JavaScript/TypeScript or request platform capabilities."},create:e=>{let t=["node-gyp-build","ffi-napi","ref-napi","bindings"];return{[rC.SyntaxKind.ImportDeclaration]:r=>{for(let n of t)if(Dp(r,n)){e.report(`Blocked: '${n}' is a native binding library. Extensions must use pure JavaScript/TypeScript.`,r);break}},[rC.SyntaxKind.CallExpression]:r=>{gc(r,/\.node$/)&&e.report("Blocked: require('*.node') loads native addons. Extensions must use pure JavaScript/TypeScript.",r);for(let n of t)if(gc(r,new RegExp(`^${n}$`))){e.report(`Blocked: require('${n}') loads a native binding library. Extensions must use pure JavaScript/TypeScript.`,r);break}}}}};u();import yc from"typescript";var iC={meta:{id:"SEC006",defaultSeverity:"block",title:"No module system patching",description:"Detects attempts to patch Node.js module loading internals (Module._load, Module._extensions, Module._compile)",remediation:"Remove module system patching. Use standard module loading mechanisms."},create:e=>{let t=["_load","_extensions","_compile","_resolveFilename"];return{[yc.SyntaxKind.PropertyAccessExpression]:r=>{let n=r;yc.isIdentifier(n.expression)&&n.expression.text==="Module"&&yc.isIdentifier(n.name)&&t.includes(n.name.text)&&e.report(`Blocked: Module.${n.name.text} is an internal Node.js API. Do not patch module loading.`,r),yc.isIdentifier(n.expression)&&n.expression.text==="require"&&yc.isIdentifier(n.name)&&n.name.text==="extensions"&&e.report("Blocked: require.extensions patches module loading. Use standard module loading instead.",r)}}}};u();import sC from"typescript";var oC={meta:{id:"SEC007",defaultSeverity:"block",title:"No inspector module",description:"Detects inspector module usage which provides programmatic debugging capabilities",remediation:"Remove inspector module usage. Use standard debugging tools instead."},create:e=>({[sC.SyntaxKind.ImportDeclaration]:t=>{Dp(t,"inspector")&&e.report("Blocked: 'inspector' module provides programmatic debugging. Use standard debugging tools instead.",t)},[sC.SyntaxKind.CallExpression]:t=>{gc(t,/^inspector$/)&&e.report("Blocked: require('inspector') provides programmatic debugging. Use standard debugging tools instead.",t)}})};u();import Pv from"typescript";var aC={meta:{id:"SEC008",defaultSeverity:"warn",title:"External URL detection",description:"Warns about HTTP(S) URLs not matching trusted domains (*.godaddy.com, localhost, 127.0.0.1)",remediation:"Review external URLs. Document their purpose or use GoDaddy APIs instead."},create:e=>{function t(r,n){$v(n)&&!FR(n,e.config)&&e.report(`Warning: External URL '${n}' detected. Review if this is necessary or use GoDaddy APIs instead.`,r)}return{[Pv.SyntaxKind.StringLiteral]:r=>{t(r,r.text)},[Pv.SyntaxKind.NoSubstitutionTemplateLiteral]:r=>{let n=zR(r);n&&t(r,n)},[Pv.SyntaxKind.TemplateExpression]:r=>{let i=r.head.text;$v(i)&&t(r,i)}}}};u();import jv from"typescript";var cC={meta:{id:"SEC009",defaultSeverity:"warn",title:"Large encoded blob detection",description:"Warns about large base64/hex encoded data in Buffer.from() calls (>200 chars) that could hide payloads",remediation:"Review large encoded data. Load from external files instead of embedding in source."},create:e=>({[jv.SyntaxKind.CallExpression]:r=>{let n=r;if(Dv(r,"base64")){let i=n.arguments[0];jv.isStringLiteral(i)&&i.text.length>200&&e.report(`Warning: Large base64-encoded blob (${i.text.length} chars) detected. Load from external file instead.`,r)}if(Dv(r,"hex")){let i=n.arguments[0];jv.isStringLiteral(i)&&i.text.length>200&&e.report(`Warning: Large hex-encoded blob (${i.text.length} chars) detected. Load from external file instead.`,r)}}})};u();import h4 from"typescript";var uC={meta:{id:"SEC010",defaultSeverity:"warn",title:"Sensitive file path detection",description:"Warns about string literals containing paths to sensitive files (~/.ssh, /etc/passwd, /var/run/secrets)",remediation:"Remove sensitive path access. Use platform APIs for configuration and secrets."},create:e=>({[h4.SyntaxKind.StringLiteral]:t=>{let r=t;WR(r.text)&&e.report(`Warning: Sensitive file path '${r.text}' detected. Use platform APIs for configuration and secrets.`,t)}})};var lC=[YR,ZR,eC,tC,nC,iC,oC,aC,cC,uC];u();qv();var m4=["install","postinstall","preinstall"];function dC(e){let t=pC(e);if(!t.success)return{success:!1,error:t.error||new Error("Failed to read package.json")};if(!t.data)return{success:!1,error:new Error("Failed to read package.json")};let r=t.data,n=[];if(!r.scripts||typeof r.scripts!="object")return{success:!0,data:n};let i=g4(),s=r.scripts;for(let o of m4){let a=s[o];if(a&&typeof a=="string"){let c=y4(o,a,i,e);c&&n.push(c)}}return{success:!0,data:n}}function g4(){return[{name:"curl",pattern:/\bcurl\b/i,reason:"Download tool that can fetch remote payloads"},{name:"wget",pattern:/\bwget\b/i,reason:"Download tool that can fetch remote payloads"},{name:"bash -c",pattern:/\bbash\s+-c\b/i,reason:"Arbitrary command execution via bash"},{name:"sh -c",pattern:/\bsh\s+-c\b/i,reason:"Arbitrary command execution via shell"},{name:"powershell -enc",pattern:/\bpowershell\s+-enc\b/i,reason:"Encoded PowerShell command execution"},{name:"nc",pattern:/\bnc\b/i,reason:"Network utility that can create backdoors"},{name:"mkfifo",pattern:/\bmkfifo\b/i,reason:"Create named pipes for inter-process communication"},{name:"eval",pattern:/\beval\b/i,reason:"Dynamic code evaluation in shell context"},{name:"exec",pattern:/\bexec\b/i,reason:"Command execution in shell context"}]}function y4(e,t,r,n){for(let i of r)if(i.pattern.test(t))return b4(e,i,n)}function b4(e,t,r){return{ruleId:"SEC011",severity:"warn",message:`Suspicious command '${t.name}' in ${e} script: ${t.reason}`,file:r,line:0,col:0}}async function hC(e){try{let t=Cp(),r=[],n=v4(e,"package.json"),i=dC(n);i.success&&i.data&&r.push(...i.data);let s=await VR(e);if(!s.success)return{success:!1,error:s.error};let o=s.data||[];for(let c of o){let l=await fC(c,"utf-8"),p=vo.createSourceFile(c,l,vo.ScriptTarget.Latest,!0,vo.ScriptKind.TSX),d=fR(p),f=MR(c,l,lC,t,d);r.push(...f)}return r.sort((c,l)=>{let p=c.file.localeCompare(l.file);return p!==0?p:c.line-l.line}),{success:!0,data:{findings:r,blocked:r.some(c=>c.severity==="block"),summary:mC(r),scannedFiles:o.length}}}catch(t){return{success:!1,error:t instanceof Error?t:new Error(String(t))}}}function mC(e){let t={total:e.length,byRuleId:{},bySeverity:{block:0,warn:0,off:0}};for(let r of e)t.byRuleId[r.ruleId]||(t.byRuleId[r.ruleId]=0),t.byRuleId[r.ruleId]++,t.bySeverity[r.severity]++;return t}async function gC(e){try{let t=Array.isArray(e)?e:[e],r=[];for(let i of t)try{let s=await fC(i,"utf-8"),o=hR(s,GR,i);r.push(...o)}catch(s){return{success:!1,error:s instanceof Error?s:new Error(`Failed to read bundle file: ${i}`)}}return{success:!0,data:{findings:r,blocked:r.some(i=>i.severity==="block"),summary:mC(r),scannedFiles:t.length}}}catch(t){return{success:!1,error:t instanceof Error?t:new Error(String(t))}}}u();import{promises as T4}from"node:fs";var bc=ho();async function yC(e,t,r={}){let n=r.maxRetries??3,i=r.baseDelayMs??250,s=r.contentType??"application/javascript",o=await T4.readFile(t),a=o.byteLength;if(a>e.maxSizeBytes)throw new Error(`File size (${a} bytes) exceeds maximum allowed (${e.maxSizeBytes} bytes)`);bc.debug({uploadId:e.uploadId,sizeBytes:a,maxSizeBytes:e.maxSizeBytes,contentType:s},"Starting artifact upload");let c;for(let l=1;l<=n;l++)try{let{"x-amz-meta-upload-id":p,...d}=e.requiredHeaders;bc.debug({uploadId:e.uploadId,attempt:l,maxRetries:n,headers:Object.keys(d)},"Attempting upload");let f=await fetch(e.url,{method:"PUT",headers:d,body:o});if(f.ok){let v=f.headers.get("etag")??void 0;return bc.info({uploadId:e.uploadId,key:e.key,status:f.status,etag:v,sizeBytes:a,attempt:l},"Upload successful"),{uploadId:e.uploadId,etag:v,status:f.status,sizeBytes:a}}let h=(await f.text().catch(()=>"")).slice(0,200);if(f.status>=500&&f.status<600){if(c=new Error(`Upload failed with status ${f.status}: ${h}`),bc.warn({uploadId:e.uploadId,status:f.status,attempt:l,maxRetries:n,errorSnippet:h},"Upload failed with server error, retrying"),l<n){let v=i*3**(l-1);await new Promise(E=>setTimeout(E,v))}}else throw new Error(`Upload failed with status ${f.status}: ${h}`)}catch(p){if(p instanceof TypeError&&(p.message.includes("fetch")||p.message.includes("network"))){if(c=p,bc.warn({uploadId:e.uploadId,attempt:l,maxRetries:n,error:p.message},"Upload failed with network error, retrying"),l<n){let d=i*3**(l-1);await new Promise(f=>setTimeout(f,d))}}else throw p}throw new Error(`Upload failed after ${n} attempts: ${c?.message??"unknown error"}`)}var E4=ce({label:"string?",description:"string?",status:'"ACTIVE" | "INACTIVE"?'}),x4=ce({name:"string",description:"string",url:ce.keywords.string.url.root,proxyUrl:ce.keywords.string.url.root,authorizationScopes:ce.string.array().moreThanLength(0)});async function bC(e,t){try{let r=x4(e);if(r instanceof ce.errors)return{success:!1,error:new Ue(r.summary,"Invalid application configuration")};let n=await cr("token");if(!n)return{success:!1,error:new It("Not authenticated","Please run 'godaddy auth login' first")};let i={label:e.name,name:e.name,description:e.description,url:e.url,proxyUrl:e.proxyUrl,authorizationScopes:e.authorizationScopes},s=await TA(i,{accessToken:n});if(!s.createApplication)return{success:!1,error:new Nt("Failed to create application","Application creation failed - no data returned")};let o=s.createApplication,a={id:o.id,clientId:String(o.clientId||""),clientSecret:String(o.clientSecret||""),name:o.name,description:o.description||"",status:o.status,url:o.url,proxyUrl:o.proxyUrl,authorizationScopes:o.authorizationScopes||[],secret:String(o.secret||""),publicKey:String(o.publicKey||"")};try{await Wo({client_id:a.clientId,name:a.name,description:a.description,url:a.url,proxy_url:a.proxyUrl,authorization_scopes:a.authorizationScopes,version:"0.0.0",actions:[],subscriptions:{webhook:[]}},t),await Tw({secret:a.secret,publicKey:a.publicKey,clientId:a.clientId,clientSecret:a.clientSecret},t)}catch(c){console.warn(`Warning: Failed to create config files: ${c}`)}return{success:!0,data:a}}catch(r){return{success:!1,error:new Nt(`Failed to create application: ${r}`,r)}}}async function vC(e){try{if(!e)return{success:!1,error:new Ue("Application name is required","Please specify an application name")};let t=await cr("token");if(!t)return{success:!1,error:new It("Not authenticated","Please run 'godaddy auth login' first")};let r=await mb(e,{accessToken:t});if(!r.application)return{success:!1,error:new Ue(`Application '${e}' not found`,`Application '${e}' does not exist`)};let n=r.application;return{success:!0,data:{id:n.id,label:n.label,name:n.name,description:n.description,status:n.status,url:n.url,proxyUrl:n.proxyUrl,authorizationScopes:n.authorizationScopes,releases:n.releases||[]}}}catch(t){return{success:!1,error:new Nt(`Failed to get application info: ${t}`,t)}}}async function TC(){return{success:!1,error:new mr("Application listing not available","The GraphQL API does not support listing all applications. Use 'application info <name>' for specific applications.")}}async function EC(e){try{if(!e)return{success:!1,error:new Ue("Application name is required","Please specify an application name")};let t=await cr("token");if(!t)return{success:!1,error:new It("Not authenticated","Please run 'godaddy auth login' first")};let r=await rc(e,{accessToken:t});if(!r.application)return{success:!1,error:new Ue(`Application '${e}' not found`,`Application '${e}' does not exist`)};let n=r.application,i=[],s=[];return n.url||i.push("Application URL is required"),n.proxyUrl||s.push("Proxy URL is not set"),n.status==="INACTIVE"&&s.push("Application is currently inactive"),{success:!0,data:{valid:i.length===0,errors:i,warnings:s}}}catch(t){return{success:!1,error:new Nt(`Failed to validate application: ${t}`,t)}}}async function xC(e,t){try{if(!e)return{success:!1,error:new Ue("Application name is required","Please specify an application name")};let r=E4(t);if(r instanceof ce.errors)return{success:!1,error:new Ue(r.summary,"Invalid update configuration")};let n=await cr("token");if(!n)return{success:!1,error:new It("Not authenticated","Please run 'godaddy auth login' first")};let i=await rc(e,{accessToken:n});return i.application?(await Wl(i.application.id,t,{accessToken:n}),{success:!0}):{success:!1,error:new Ue(`Application '${e}' not found`,`Application '${e}' does not exist`)}}catch(r){return{success:!1,error:new Nt(`Failed to update application: ${r}`,r)}}}async function wC(e,t){try{if(!e)return{success:!1,error:new Ue("Application name is required","Please specify an application name")};if(!t)return{success:!1,error:new Ue("Store ID is required","Please specify a store ID")};let r=await cr("token");return r?(await xA({applicationName:e,storeId:t},{accessToken:r}),{success:!0}):{success:!1,error:new It("Not authenticated","Please run 'godaddy auth login' first")}}catch(r){return{success:!1,error:new Nt(`Failed to enable application: ${r}`,r)}}}async function SC(e,t){try{if(!e)return{success:!1,error:new Ue("Application name is required","Please specify an application name")};if(!t)return{success:!1,error:new Ue("Store ID is required","Please specify a store ID")};let r=await cr("token");return r?(await wA({applicationName:e,storeId:t},{accessToken:r}),{success:!0}):{success:!1,error:new It("Not authenticated","Please run 'godaddy auth login' first")}}catch(r){return{success:!1,error:new Nt(`Failed to disable application: ${r}`,r)}}}async function OC(e){try{if(!e)return{success:!1,error:new Ue("Application name is required","Please specify an application name")};let t=await cr("token");if(!t)return{success:!1,error:new It("Not authenticated","Please run 'godaddy auth login' first")};let r=await rc(e,{accessToken:t});return r.application?(await SA(r.application.id,{accessToken:t}),{success:!0}):{success:!1,error:new Ue(`Application '${e}' not found`,`Application '${e}' does not exist`)}}catch(t){return{success:!1,error:new Nt(`Failed to archive application: ${t}`,t)}}}async function _C(e){try{let t=await cr("token");if(!t)return{success:!1,error:new It("Not authenticated","Please run 'godaddy auth login' first")};let r=await rc(e.applicationName,{accessToken:t});if(!r.application)return{success:!1,error:new Ue(`Application '${e.applicationName}' not found`,`Application '${e.applicationName}' does not exist`)};let n=[],i=[];try{let a=on({configPath:e.configPath,env:e.env});typeof a=="object"&&!("problems"in a)&&(n=a.actions||[],i=a.subscriptions?.webhook||[])}catch{}let s={applicationId:r.application.id,version:e.version,description:e.description,actions:n,subscriptions:i},o=await EA(s,{accessToken:t});return{success:!0,data:{id:o.createRelease.id,version:o.createRelease.version,description:o.createRelease.description,createdAt:o.createRelease.createdAt}}}catch(t){return{success:!1,error:new Nt(`Failed to create release: ${t}`,t)}}}async function AC(e,t){try{let r=await cr("token");if(!r)return{success:!1,error:new It("Not authenticated","Please run 'godaddy auth login' first")};let n=await mb(e,{accessToken:r});if(!n.application)return{success:!1,error:new Ue(`Application '${e}' not found`,`Application '${e}' does not exist`)};let i=n.application.id,s=n.application.releases?.edges;if(!s||s.length===0)return{success:!1,error:new Ue("No release found for application",`Application '${e}' has no releases. Create a release first with: godaddy application release ${e} --release-version <version>`)};let o=s[0].node;if(!o)return{success:!1,error:new Ue("Invalid release data","Unable to retrieve release information")};let a=o.id,c=process.cwd(),l=yw({configPath:t?.configPath,env:t?.env}),p=[],d=0;if(l.length===0)return await Wl(n.application.id,{status:"ACTIVE"},{accessToken:r}),{success:!0,data:{securityReports:[],bundleReports:[],totalExtensions:0,blockedExtensions:0}};for(let h of l){let v=$p(c,"extensions",h.handle),E=$p(v,h.source),A=await hC(v);if(!A.success||!A.data)return{success:!1,error:new Ue(`Security scan failed for extension '${h.name}'`,A.error?.message||"Unable to perform security scan")};let w=A.data;w.blocked&&d++,p.push({extensionName:h.name,extensionDir:v,scannedFiles:w.scannedFiles,totalFindings:w.summary.total,blockedFindings:w.summary.bySeverity.block,warnings:w.summary.bySeverity.warn,blocked:w.blocked})}if(d>0)return{success:!1,error:new Ue("Security violations detected",`${d} extension(s) blocked due to security violations. Deployment blocked.`)};let f=[],m=new Date().toISOString().replace(/[:.]/g,"-");for(let h of l){let v=$p(c,"extensions",h.handle),E=$p(v,h.source),A=await lR({name:h.handle,version:void 0},E,{repoRoot:c,timestamp:m,extensionDir:v,extensionType:h.type});if(!A.success||!A.data)return{success:!1,error:new Ue(`Bundle failed for extension '${h.name}'`,A.error?.message||"Unable to bundle extension")};let w=A.data,_=await gC(w.artifactPath);if(!_.success)return await gi(w.artifactPath,{force:!0}),w.sourcemapPath&&await gi(w.sourcemapPath,{force:!0}),{success:!1,error:new Ue(`Post-bundle security scan failed for extension '${h.name}'`,_.error?.message||"Unable to scan bundled artifact")};if(_.data?.blocked)return await gi(w.artifactPath,{force:!0}),w.sourcemapPath&&await gi(w.sourcemapPath,{force:!0}),{success:!1,error:new Ue(`Security violations detected in bundled code for extension '${h.name}'`,`${_.data.findings.length} security violation(s) found. Deployment blocked.`)};let I=h.type==="blocks"?["blocks"]:h.targets?.length?h.targets.map(q=>q.target):[void 0],C=[],R=!1;try{for(let q of I){let k=await dR({applicationId:i,releaseId:a,contentType:"JS",target:q},r);C.push(k.uploadId),await yC(k,w.artifactPath,{contentType:"application/javascript"})}R=!0,await gi(w.artifactPath,{force:!0}),w.sourcemapPath&&await gi(w.sourcemapPath,{force:!0})}catch(q){return await gi(w.artifactPath,{force:!0}),w.sourcemapPath&&await gi(w.sourcemapPath,{force:!0}),{success:!1,error:new Nt(`Upload failed for extension '${h.name}'`,q)}}f.push({extensionName:h.name,artifactName:w.artifactName,artifactPath:w.artifactPath,size:w.size,sha256:w.sha256,uploadIds:C,targets:h.type==="blocks"?["blocks"]:h.targets?.map(q=>q.target),uploaded:R})}return await Wl(n.application.id,{status:"ACTIVE"},{accessToken:r}),{success:!0,data:{securityReports:p,bundleReports:f,totalExtensions:l.length,blockedExtensions:d}}}catch(r){return{success:!1,error:new Nt(`Failed to deploy application: ${r}`,r)}}}qv();async function as(){let e=await an();if(!e.success||!e.data)throw e.error??new Error("Failed to get environment");return e.data}function NC(){let e=new sr("application").alias("app").description("Manage applications");e.command("info").description("Show application information").argument("[name]","Application name").option("-o, --output <format>","Output format (json|text)","text").action(async(n,i)=>{n||(console.error("Application name is required"),console.log("Usage: godaddy application info <name>"),process.exit(1));let s=await vC(n);s.success||(console.error(s.error?.userMessage||"Failed to get application info"),process.exit(1));let o=s.data;i.output==="json"?console.log(JSON.stringify(o,null,2)):(console.log(`Application: ${o.name}`),console.log(` ID: ${o.id}`),console.log(` Label: ${o.label}`),console.log(` Description: ${o.description}`),console.log(` Status: ${o.status}`),console.log(` URL: ${o.url}`),console.log(` Proxy URL: ${o.proxyUrl}`),o.authorizationScopes?.length&&console.log(` Authorization Scopes: ${o.authorizationScopes.join(", ")}`),o.releases?.length&&(console.log(` Latest Release: ${o.releases[0].version}`),o.releases[0].description&&console.log(` Description: ${o.releases[0].description}`),console.log(` Created: ${new Date(o.releases[0].createdAt).toLocaleString()}`))),process.exit(0)}),e.command("list").alias("ls").description("List all applications").option("-o, --output <format>","Output format (json|text)","text").action(async n=>{let i=await TC();i.success||(console.error(i.error?.userMessage||"Failed to list applications"),process.exit(1));let s=i.data;if(n.output==="json")console.log(JSON.stringify(s,null,2));else{if(s.length===0){console.log("No applications found");return}console.log(`Found ${s.length} application(s):`);for(let o of s)console.log(` ${o.name} (${o.status})`),console.log(` Label: ${o.label}`),console.log(` Description: ${o.description}`),console.log(` URL: ${o.url}`),console.log("")}process.exit(0)}),e.command("validate").description("Validate application configuration").argument("[name]","Application name").option("-o, --output <format>","Output format (json|text)","text").action(async(n,i)=>{n||(console.error("Application name is required"),console.log("Usage: godaddy application validate <name>"),process.exit(1));let s=await EC(n);s.success||(console.error(s.error?.userMessage||"Failed to validate application"),process.exit(1));let o=s.data;if(i.output==="json")console.log(JSON.stringify(o,null,2));else{if(o.valid?console.log(`\u2705 Application '${n}' is valid`):console.log(`\u274C Application '${n}' has validation errors`),o.errors.length>0){console.log(`
505
+ Errors:`);for(let a of o.errors)console.log(` \u274C ${a}`)}if(o.warnings.length>0){console.log(`
506
+ Warnings:`);for(let a of o.warnings)console.log(` \u26A0\uFE0F ${a}`)}o.valid||process.exit(1)}process.exit(0)}),e.command("update").description("Update application configuration").argument("<name>","Application name").option("--label <label>","Application label").option("--description <description>","Application description").option("--status <status>","Application status (ACTIVE|INACTIVE)").option("-o, --output <format>","Output format (json|text)","text").action(async(n,i)=>{let s={};i.label&&(s.label=i.label),i.description&&(s.description=i.description),i.status&&(["ACTIVE","INACTIVE"].includes(i.status)||(console.error("Status must be either ACTIVE or INACTIVE"),process.exit(1)),s.status=i.status),Object.keys(s).length===0&&(console.error("At least one field must be specified for update"),console.log("Available options: --label, --description, --status"),process.exit(1));let o=await xC(n,s);o.success||(console.error(o.error?.userMessage||"Failed to update application"),process.exit(1)),i.output==="json"?console.log(JSON.stringify({success:!0},null,2)):console.log(`\u2705 Successfully updated application '${n}'`),process.exit(0)}),e.command("enable").description("Enable application on a store").argument("<name>","Application name").option("--store-id <storeId>","Store ID").option("-o, --output <format>","Output format (json|text)","text").action(async(n,i)=>{i.storeId||(console.error("Store ID is required"),console.log("Usage: godaddy application enable <name> --store-id <storeId>"),process.exit(1));let s=await wC(n,i.storeId);s.success||(console.error(s.error?.userMessage||"Failed to enable application"),process.exit(1)),i.output==="json"?console.log(JSON.stringify({success:!0},null,2)):console.log(`\u2705 Successfully enabled application '${n}' on store ${i.storeId}`),process.exit(0)}),e.command("disable").description("Disable application on a store").argument("<name>","Application name").option("--store-id <storeId>","Store ID").option("-o, --output <format>","Output format (json|text)","text").action(async(n,i)=>{i.storeId||(console.error("Store ID is required"),console.log("Usage: godaddy application disable <name> --store-id <storeId>"),process.exit(1));let s=await SC(n,i.storeId);s.success||(console.error(s.error?.userMessage||"Failed to disable application"),process.exit(1)),i.output==="json"?console.log(JSON.stringify({success:!0},null,2)):console.log(`\u2705 Successfully disabled application '${n}' on store ${i.storeId}`),process.exit(0)}),e.command("archive").description("Archive application").argument("<name>","Application name").option("-o, --output <format>","Output format (json|text)","text").action(async(n,i)=>{let s=await OC(n);s.success||(console.error(s.error?.userMessage||"Failed to archive application"),process.exit(1)),i.output==="json"?console.log(JSON.stringify({success:!0},null,2)):console.log(`\u2705 Successfully archived application '${n}'`),process.exit(0)}),e.command("init").description("Initialize/create a new application").option("--name <name>","Application name").option("--description <description>","Application description").option("--url <url>","Application URL").option("--proxy-url <proxyUrl>","Proxy URL for API endpoints").option("--scopes <scopes>","Authorization scopes (space-separated)",n=>n.split(" ")).option("-c, --config <path>","Path to configuration file").option("--environment <env>","Environment (ote|prod)").option("-o, --output <format>","Output format (json|text)","text").action(async n=>{let i;try{if(n.config||n.environment){let l=on({configPath:n.config,env:n.environment});if(typeof l=="object"&&"problems"in l){console.error("Config file validation failed:");for(let p of l.problems||[])console.error(` ${p.summary}`);process.exit(1)}i=l}}catch(l){console.error(l instanceof Error?l.message:String(l)),process.exit(1)}let s={name:n.name??i?.name??"",description:n.description??i?.description??"",url:n.url??i?.url??"",proxyUrl:n.proxyUrl??i?.proxy_url??"",authorizationScopes:n.scopes??i?.authorization_scopes??[]};s.name||(console.log("Application name is required"),process.exit(1)),s.description||(console.log("Application description is required"),process.exit(1)),s.url||(console.log("Application URL is required"),process.exit(1)),s.proxyUrl||(console.log("Proxy URL is required"),process.exit(1)),(!s.authorizationScopes||s.authorizationScopes.length===0)&&(console.log("Authorization scopes are required"),process.exit(1));let o=await as(),a=await bC(s,o);a.success||(console.error(a.error?.userMessage||"Failed to create application"),process.exit(1));let c=a.data;n.output==="json"?console.log(JSON.stringify(c,null,2)):(console.log("\u2705 Application created successfully!"),console.log(` Name: ${c.name}`),console.log(` ID: ${c.id}`),console.log(` Client ID: ${c.clientId}`),console.log(` Status: ${c.status}`),console.log(` URL: ${c.url}`),console.log(` Proxy URL: ${c.proxyUrl}`),console.log(` Authorization Scopes: ${c.authorizationScopes.join(", ")}`),console.log(`
507
+ \u{1F511} Credentials saved:`),console.log(" GODADDY_CLIENT_ID"),console.log(" GODADDY_CLIENT_SECRET"),console.log(" GODADDY_WEBHOOK_SECRET"),console.log(" GODADDY_PUBLIC_KEY")),process.exit(0)});let t=new sr("add").description("Add configurations to application");t.command("action").description("Add action configuration to godaddy.toml").option("--name <name>","Action name").option("--url <url>","Action endpoint URL").option("--config <path>","Path to configuration file").option("--environment <env>","Environment (ote|prod)").option("-o, --output <format>","Output format (json|text)","text").action(async n=>{let i=n.name,s=n.url;i||(console.error("Action name is required"),console.log("Usage: godaddy application add action --name <name> --url <url>"),process.exit(1)),s||(console.error("Action URL is required"),console.log("Usage: godaddy application add action --name <name> --url <url>"),process.exit(1)),i.length<3&&(console.error("Action name must be at least 3 characters long"),process.exit(1));let o={name:i,url:s};try{let a=n.environment||await as();await bw(o,{configPath:n.config,env:a}),n.output==="json"?console.log(JSON.stringify({success:!0,action:o},null,2)):(console.log(`\u2705 Action '${i}' added successfully!`),console.log(` Name: ${i}`),console.log(` URL: ${s}`))}catch(a){console.error(a instanceof Error?a.message:"Failed to add action"),process.exit(1)}process.exit(0)}),t.command("subscription").description("Add webhook subscription configuration to godaddy.toml").option("--name <name>","Subscription name").option("--events <events>","Comma-separated list of events").option("--url <url>","Webhook endpoint URL").option("--config <path>","Path to configuration file").option("--environment <env>","Environment (ote|prod)").option("-o, --output <format>","Output format (json|text)","text").action(async n=>{let i=n.name,s=n.events,o=n.url;i||(console.error("Subscription name is required"),console.log("Usage: godaddy application add subscription --name <name> --events <events> --url <url>"),process.exit(1)),s||(console.error("Events are required"),console.log("Usage: godaddy application add subscription --name <name> --events <events> --url <url>"),process.exit(1)),o||(console.error("Webhook URL is required"),console.log("Usage: godaddy application add subscription --name <name> --events <events> --url <url>"),process.exit(1)),i.length<3&&(console.error("Subscription name must be at least 3 characters long"),process.exit(1));let a=s.split(",").map(l=>l.trim()).filter(l=>l.length>0);a.length===0&&(console.error("At least one event is required"),process.exit(1));let c={name:i,events:a,url:o};try{let l=n.environment||await as();await vw(c,{configPath:n.config,env:l}),n.output==="json"?console.log(JSON.stringify({success:!0,subscription:c},null,2)):(console.log(`\u2705 Subscription '${i}' added successfully!`),console.log(` Name: ${i}`),console.log(` Events: ${a.join(", ")}`),console.log(` URL: ${o}`))}catch(l){console.error(l instanceof Error?l.message:"Failed to add subscription"),process.exit(1)}process.exit(0)});let r=t.command("extension").description("Add UI extension configuration to godaddy.toml");return r.command("embed").description("Add an embed extension (injected UI at specific page locations)").option("--name <name>","Extension name").option("--handle <handle>","Extension handle (unique identifier)").option("--source <source>","Path to extension source file").option("--target <targets>","Comma-separated list of target locations (e.g., body.end)").option("--config <path>","Path to configuration file").option("--environment <env>","Environment (ote|prod)").option("-o, --output <format>","Output format (json|text)","text").action(async n=>{let{name:i,handle:s,source:o,target:a}=n;i||(console.error("Extension name is required"),console.log("Usage: godaddy application add extension embed --name <name> --handle <handle> --source <source> --target <targets>"),process.exit(1)),s||(console.error("Extension handle is required"),console.log("Usage: godaddy application add extension embed --name <name> --handle <handle> --source <source> --target <targets>"),process.exit(1)),o||(console.error("Extension source is required"),console.log("Usage: godaddy application add extension embed --name <name> --handle <handle> --source <source> --target <targets>"),process.exit(1)),a||(console.error("At least one target is required for embed extensions"),console.log("Usage: godaddy application add extension embed --name <name> --handle <handle> --source <source> --target <targets>"),process.exit(1)),i.length<3&&(console.error("Extension name must be at least 3 characters long"),process.exit(1)),s.length<3&&(console.error("Extension handle must be at least 3 characters long"),process.exit(1));let c=a.split(",").map(p=>p.trim()).filter(p=>p.length>0).map(p=>({target:p}));c.length===0&&(console.error("At least one valid target is required"),process.exit(1));let l={name:i,handle:s,source:o,targets:c};try{let p=n.environment||await as();await pu("embed",l,{configPath:n.config,env:p}),n.output==="json"?console.log(JSON.stringify({success:!0,extension:l},null,2)):(console.log(`\u2705 Embed extension '${i}' added successfully!`),console.log(` Name: ${i}`),console.log(` Handle: ${s}`),console.log(` Source: ${o}`),console.log(` Targets: ${c.map(d=>d.target).join(", ")}`))}catch(p){console.error(p instanceof Error?p.message:"Failed to add extension"),process.exit(1)}process.exit(0)}),r.command("checkout").description("Add a checkout extension (checkout flow UI)").option("--name <name>","Extension name").option("--handle <handle>","Extension handle (unique identifier)").option("--source <source>","Path to extension source file").option("--target <targets>","Comma-separated list of checkout target locations").option("--config <path>","Path to configuration file").option("--environment <env>","Environment (ote|prod)").option("-o, --output <format>","Output format (json|text)","text").action(async n=>{let{name:i,handle:s,source:o,target:a}=n;i||(console.error("Extension name is required"),console.log("Usage: godaddy application add extension checkout --name <name> --handle <handle> --source <source> --target <targets>"),process.exit(1)),s||(console.error("Extension handle is required"),console.log("Usage: godaddy application add extension checkout --name <name> --handle <handle> --source <source> --target <targets>"),process.exit(1)),o||(console.error("Extension source is required"),console.log("Usage: godaddy application add extension checkout --name <name> --handle <handle> --source <source> --target <targets>"),process.exit(1)),a||(console.error("At least one target is required for checkout extensions"),console.log("Usage: godaddy application add extension checkout --name <name> --handle <handle> --source <source> --target <targets>"),process.exit(1)),i.length<3&&(console.error("Extension name must be at least 3 characters long"),process.exit(1)),s.length<3&&(console.error("Extension handle must be at least 3 characters long"),process.exit(1));let c=a.split(",").map(p=>p.trim()).filter(p=>p.length>0).map(p=>({target:p}));c.length===0&&(console.error("At least one valid target is required"),process.exit(1));let l={name:i,handle:s,source:o,targets:c};try{let p=n.environment||await as();await pu("checkout",l,{configPath:n.config,env:p}),n.output==="json"?console.log(JSON.stringify({success:!0,extension:l},null,2)):(console.log(`\u2705 Checkout extension '${i}' added successfully!`),console.log(` Name: ${i}`),console.log(` Handle: ${s}`),console.log(` Source: ${o}`),console.log(` Targets: ${c.map(d=>d.target).join(", ")}`))}catch(p){console.error(p instanceof Error?p.message:"Failed to add extension"),process.exit(1)}process.exit(0)}),r.command("blocks").description("Set the blocks extension source (consolidated UI blocks package)").option("--source <source>","Path to blocks extension source file").option("--config <path>","Path to configuration file").option("--environment <env>","Environment (ote|prod)").option("-o, --output <format>","Output format (json|text)","text").action(async n=>{let{source:i}=n;i||(console.error("Extension source is required"),console.log("Usage: godaddy application add extension blocks --source <source>"),process.exit(1));let s={source:i};try{let o=n.environment||await as();await pu("blocks",s,{configPath:n.config,env:o}),n.output==="json"?console.log(JSON.stringify({success:!0,extension:s},null,2)):(console.log("\u2705 Blocks extension configured successfully!"),console.log(` Source: ${i}`))}catch(o){console.error(o instanceof Error?o.message:"Failed to add extension"),process.exit(1)}process.exit(0)}),e.addCommand(t),e.command("release").description("Create a new release for the application").argument("<name>","Application name").option("--release-version <version>","Release version").option("--description <description>","Release description").option("--config <path>","Path to configuration file").option("--environment <env>","Environment (ote|prod)").option("-o, --output <format>","Output format (json|text)","text").action(async(n,i)=>{i.releaseVersion||(console.error("Release version is required"),console.log("Usage: godaddy application release <name> --release-version <version>"),process.exit(1));let s=i.environment||"ote",o={applicationName:n,version:i.releaseVersion,description:i.description,configPath:i.config,env:s},a=await _C(o);a.success||(console.error(a.error?.userMessage||"Failed to create release"),process.exit(1));let c=a.data;i.output==="json"?console.log(JSON.stringify(c,null,2)):(console.log("\u2705 Release created successfully!"),console.log(` ID: ${c.id}`),console.log(` Version: ${c.version}`),c.description&&console.log(` Description: ${c.description}`),console.log(` Created: ${new Date(c.createdAt).toLocaleString()}`)),process.exit(0)}),e.command("deploy").description("Deploy application (change status to ACTIVE)").argument("<name>","Application name").option("--config <path>","Path to configuration file").option("--environment <env>","Environment (ote|prod)").option("-o, --output <format>","Output format (json|text)","text").action(async(n,i)=>{let s=i.environment||await as(),o=await AC(n,{configPath:i.config,env:s});if(o.success||(console.error(o.error?.userMessage||"Failed to deploy application"),process.exit(1)),i.output==="json")console.log(JSON.stringify({success:!0,...o.data},null,2));else if(console.log(`\u2705 Application '${n}' deployed successfully!`),console.log(" Status changed to ACTIVE"),o.data){console.log(` Scanned ${o.data.totalExtensions} extension(s)`);let a=o.data.securityReports.reduce((c,l)=>c+l.scannedFiles,0);if(console.log(` Total files scanned: ${a}`),o.data.bundleReports?.length>0){console.log(` Bundled ${o.data.bundleReports.length} extension(s):`);for(let c of o.data.bundleReports){let l=c.targets?.length?` \u2192 ${c.targets.join(", ")}`:"";console.log(` - ${c.extensionName}: ${c.artifactName} (${(c.size/1024).toFixed(2)} KB)${l}`)}}}process.exit(0)}),e}u();u();u();async function IC({accessToken:e}){if(!e)throw new Error("Access token is required");let t=await an();if(!t.success||!t.data)throw t.error??new Error("Failed to get environment");let r=t.data,i=`${Ai(r)}/v1/apis/webhook-event-types`,s={Authorization:`Bearer ${e}`,UserAgent:"@godaddy/cli"},o=Date.now();sR({method:"GET",url:i,headers:s});let a=await fetch(i,{headers:s}),c=Date.now()-o,l=await a.json();if(oR({method:"GET",url:i,status:a.status,statusText:a.statusText,headers:a.headers?{}:void 0,body:l,duration:c}),!a.ok)throw new Error(l.error||"Authentication failed");return l}async function RC(){try{let e=await cr("token");return e?{success:!0,data:(await IC({accessToken:e})).events.map(n=>({eventType:n.eventType,description:n.description}))}:{success:!1,error:new It("Not authenticated","Please run 'godaddy auth login' first")}}catch(e){return{success:!1,error:new Nt(`Failed to get webhook events: ${e}`,e)}}}function CC(){let e=new sr("webhook").description("Manage webhook integrations");return e.command("events").description("List available webhook event types").option("-o, --output <format>","Output format (json|text)","text").action(async t=>{let r=await RC();r.success||(console.error(r.error?.userMessage||"Failed to get webhook events"),process.exit(1));let n=r.data;if(t.output==="json")console.log(JSON.stringify(n,null,2));else{if(n.length===0){console.log("No webhook events available");return}console.log(`Available Webhook Events (${n.length}):`),console.log("");for(let i of n)console.log(`\u2022 ${i.eventType}`),i.description&&console.log(` ${i.description}`),console.log("")}process.exit(0)}),e}function LC(){let e=new sr;return e.name("godaddy").description("GoDaddy Developer Platform CLI - Tools for building, managing, and integrating with GoDaddy's platform services").version(tT.version).option("-e, --env <environment>","Set the target environment for commands (ote, prod)").option("--debug","Enable debug logging for HTTP requests and responses").addHelpText("after",`
508
+ Environment Overview:
509
+ ote - Pre-production environment that mirrors production
510
+ prod - Production environment for live applications
511
+
512
+ Example Usage:
513
+ $ godaddy application info --env ote
514
+ $ godaddy env set prod
515
+ $ godaddy webhook events`),e.hook("preAction",async(t,r)=>{let n=t.opts();if(n.debug&&iR(!0),n.env)try{qs(n.env)}catch(i){console.error(`Error: ${i.message}`),process.exit(1)}}),e.addCommand(th()),e.addCommand(fh()),e.addCommand(Gw()),e.addCommand(NC()),e.addCommand(CC()),e}async function w4(){LC().parse()}var Fv=()=>{(process.stderr.isTTY?process.stderr:process.stdout.isTTY?process.stdout:void 0)?.write("\x1B[?25h")};process.on("exit",Fv);process.on("SIGINT",()=>{Fv(),process.exit(130)});process.on("SIGTERM",()=>{Fv(),process.exit(143)});w4().catch(e=>{console.error("Failed to start application:"),console.error(e instanceof Error?e.message:String(e)),process.exit(1)});
516
+ //# sourceMappingURL=cli.js.map